(()=>{"use strict";var e,o={20:(e,o,t)=>{var r=t(609),a=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function n(e,o,t){var r,n={},c=null,d=null;for(r in void 0!==t&&(c=""+t),void 0!==o.key&&(c=""+o.key),void 0!==o.ref&&(d=o.ref),o)i.call(o,r)&&!s.hasOwnProperty(r)&&(n[r]=o[r]);if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===n[r]&&(n[r]=o[r]);return{$$typeof:a,type:e,key:c,ref:d,props:n,_owner:l.current}}o.jsx=n,o.jsxs=n},431:(e,o,t)=>{const r=window.wp.blocks,a=window.wp.element,i=(0,a.forwardRef)((function({icon:e,size:o=24,...t},r){return(0,a.cloneElement)(e,{width:o,height:o,...t,ref:r})})),l=window.wp.primitives;var s=t(848);const n=(0,s.jsx)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(l.Path,{fillRule:"evenodd",d:"M5 5.5h14a.5.5 0 01.5.5v1.5a.5.5 0 01-.5.5H5a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 9.232A2 2 0 013 7.5V6a2 2 0 012-2h14a2 2 0 012 2v1.5a2 2 0 01-1 1.732V18a2 2 0 01-2 2H6a2 2 0 01-2-2V9.232zm1.5.268V18a.5.5 0 00.5.5h12a.5.5 0 00.5-.5V9.5h-13z",clipRule:"evenodd"})}),c=window.wp.blockEditor,d=window.wp.i18n,p=(0,s.jsx)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(l.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),u=window.wp.data;function h(e){var o,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(o=0;o{const{onChange:o,options:t,label:r,value:l="",className:n,size:c,errorId:h,required:f,errorMessage:_=(0,d.__)("Please select a valid option","woo-checkout-field-editor-pro"),placeholder:v,...k}=e,g=(0,a.useCallback)((e=>{o(e.target.value)}),[o]),y=(0,a.useMemo)((()=>({value:"",label:null!=v?v:(0,d.sprintf)( // translators: %s will be label of the field. For example "country/region". // translators: %s will be label of the field. For example "country/region". (0,d.__)("Select a %s","woo-checkout-field-editor-pro"),r?.toLowerCase()),disabled:!!f})),[r,v,f]),x=(0,a.useId)(),j=k.id||`wc-blocks-components-select-${x}`,E=h||j,N=(0,a.useMemo)((()=>f&&l?t:[y].concat(t)),[f,l,y,t]),{setValidationErrors:C,clearValidationError:O}=(0,u.useDispatch)(b.VALIDATION_STORE_KEY),{error:I,validationErrorId:A}=(0,u.useSelect)((e=>{const o=e(b.VALIDATION_STORE_KEY);return{error:o.getValidationError(E),validationErrorId:o.getValidationErrorId(E)}}));(0,a.useEffect)((()=>(!f||l?O(E):C({[E]:{message:_,hidden:!0}}),()=>{O(E)})),[O,l,E,_,f,C]);const T=(0,u.useSelect)((e=>e(b.VALIDATION_STORE_KEY).getValidationError(E||"")||{hidden:!0}));return(0,s.jsxs)("div",{className:m(n,{"has-error":!T.hidden}),children:[(0,s.jsx)("div",{className:"wc-blocks-components-select",children:(0,s.jsxs)("div",{className:"wc-blocks-components-select__container",children:[(0,s.jsx)("label",{htmlFor:j,className:"wc-blocks-components-select__label",children:r}),(0,s.jsx)("select",{className:"wc-blocks-components-select__select",id:j,size:void 0!==c?c:1,onChange:g,value:l,"aria-invalid":!(!I?.message||I?.hidden),"aria-errormessage":A,...k,children:N.map((e=>(0,s.jsx)("option",{value:e.value,"data-alternate-values":`[${e.label}]`,disabled:void 0!==e.disabled&&e.disabled,children:e.label},e.value)))},j),(0,s.jsx)(i,{className:"wc-blocks-components-select__expand",icon:p})]})}),(0,s.jsx)(w.ValidationInputError,{propertyName:E})]})};var _=t(609);const v=window.wp.compose,k=({label:e,secondaryLabel:o,description:t,secondaryDescription:r,id:a})=>(0,s.jsxs)("div",{className:"wc-block-components-radio-control__option-layout",children:[(0,s.jsxs)("div",{className:"wc-block-components-radio-control__label-group",children:[e&&(0,s.jsx)("span",{id:a&&`${a}__label`,className:"wc-block-components-radio-control__label",children:e}),o&&(0,s.jsx)("span",{id:a&&`${a}__secondary-label`,className:"wc-block-components-radio-control__secondary-label",children:o})]}),(t||r)&&(0,s.jsxs)("div",{className:"wc-block-components-radio-control__description-group",children:[t&&(0,s.jsx)("span",{id:a&&`${a}__description`,className:"wc-block-components-radio-control__description",children:t}),r&&(0,s.jsx)("span",{id:a&&`${a}__secondary-description`,className:"wc-block-components-radio-control__secondary-description",children:r})]})]}),g=({checked:e,name:o,onChange:t,option:r,disabled:a=!1,highlightChecked:i=!1})=>{const{value:l,label:n,description:c,secondaryLabel:d,secondaryDescription:p}=r;return(0,s.jsxs)("label",{className:m("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":e,"wc-block-components-radio-control__option--checked-option-highlighted":e&&i}),htmlFor:`${o}-${l}`,children:[(0,s.jsx)("input",{id:`${o}-${l}`,className:"wc-block-components-radio-control__input",type:"radio",name:o,value:l,onChange:e=>t(e.target.value),checked:e,"aria-describedby":m({[`${o}-${l}__label`]:n,[`${o}-${l}__secondary-label`]:d,[`${o}-${l}__description`]:c,[`${o}-${l}__secondary-description`]:p}),"aria-disabled":a,onKeyDown:e=>{a&&["ArrowUp","ArrowDown","AllowLeft","ArrowRight"].includes(e.key)&&e.preventDefault()}}),(0,s.jsx)(k,{id:`${o}-${l}`,label:n,secondaryLabel:d,description:c,secondaryDescription:p})]})},y=({className:e="",id:o,selected:t="",onChange:r,options:a=[],disabled:i=!1,highlightChecked:l=!1,title:n="",required:c=!1,errorMessage:p=(0,d.__)("Please select an option","woo-checkout-field-editor-pro"),errorId:h})=>{const f=(0,v.useInstanceId)(y),k=o||f,x=h||k,{setValidationErrors:j,clearValidationError:E}=(0,u.useDispatch)(b.VALIDATION_STORE_KEY),N=(0,u.useSelect)((e=>e(b.VALIDATION_STORE_KEY).getValidationError(x)||{hidden:!0}));(0,_.useEffect)((()=>(!c||t?E(x):j({[x]:{message:p,hidden:!0}}),()=>{E(x)})),[t,c,x,p]);const C=(0,_.useMemo)((()=>a.findIndex((e=>e.value===t))),[a,t]);return a.length?(0,s.jsxs)("div",{className:m("wc-block-components-radio-control thwcfe-radio-control",{"has-error":!N.hidden,"wc-block-components-radio-control--highlight-checked--first-selected":l&&0===C,"wc-block-components-radio-control--highlight-checked--last-selected":l&&C===a.length-1,"wc-block-components-radio-control--highlight-checked":l},e),children:[(0,s.jsxs)("div",{className:"wc-block-components-cfe-radio-control__heading",children:[" ",n||""," "]}),a.map((e=>(0,s.jsx)(g,{highlightChecked:l,name:`radio-control-${k}`,checked:e.value===t,option:e,onChange:o=>{r(o),"function"==typeof e.onChange&&e.onChange(o)},disabled:i},`${k}-${e.value}`))),(0,s.jsx)(w.ValidationInputError,{propertyName:x})]}):null},x=y,j=e=>{const{errorId:o,errorMessage:t,autoCapitalize:r,autoComplete:a,placeholder:i,...l}=e;return l},E=(window.wc.blocksCheckout,window.wp.url),N=({field:e,onChange:o=""})=>{const{id:t,label:r,type:a,value:i,placeholder:l,required:n,options:c,title:p,validate:u,property_set:h,enabled:b,cssclass:v}=e,{default:k,checked:g}=h,y=(e=>({id:`section_one-${e?.id}`.replaceAll("/","-"),errorId:`section_${e?.id}`,label:e?.title,autoCapitalize:e?.autocapitalize,autoComplete:e?.autocomplete,errorMessage:e?.errorMessage,required:e?.required,placeholder:e?.placeholder,className:`wc-block-components-address-form__${e?.id}`.replaceAll("/","-"),options:e?.options?Object.values(e.options).map((e=>({value:e.key,label:e.text}))):[],...e?.attributes}))(e),N=(0,_.useRef)({});if(!b||"0"===b)return null;const C=e=>{};return"email"!==e.type?"checkbox"===a?(0,s.jsx)(w.CheckboxControl,{checked:i,onChange:C,...j(y),className:m(v?.split(",").map((e=>e.trim()))),required:n},t):"select"===a&&e.options?(0,s.jsx)(f,{...y,label:p||"",className:m(v?.split(",").map((e=>e.trim())),"wc-block-components-select-input",`wc-block-components-select-input-${t}`.replaceAll("/","-")),value:i,onChange:C,options:y.options,required:n,errorMessage:y.errorMessage||void 0,placeholder:l||null},t):"radio"===a?(0,s.jsx)(x,{...y,selected:i,onChange:C,options:y.options,disabled:!1,highlightChecked:!0,title:p||"",className:m(v?.split(",").map((e=>e.trim())))}):(0,s.jsx)(w.ValidatedTextInput,{ref:e=>N.current[t]=e,...y,type:a,value:i,onChange:C,className:m(v?.split(",").map((e=>e.trim()))),customFormatter:o=>"postcode"===e.type?o.trimStart().toUpperCase():o,customValidation:e=>((e,o)=>!((e.required||e.value)&&("phone"!==o||(0,E.isPhoneNumber)(e.value)?"url"!==o||(0,E.isURL)(e.value)?"email"===o&&!(0,E.isEmail)(e.value)&&(e.setCustomValidity((0,d.__)("Please enter a valid email address","woo-checkout-field-editor-pro")),1):(e.setCustomValidity((0,d.__)("Please enter a valid URL","woo-checkout-field-editor-pro")),1):(e.setCustomValidity((0,d.__)("Please enter a valid Phone Number","woo-checkout-field-editor-pro")),1))))(e,u)},t):void 0},C=window.wp.dom,O=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"],I=({children:e,style:o={},...t})=>{const r=(0,a.useRef)(null),i=()=>{r.current&&C.focus.focusable.find(r.current).forEach((e=>{O.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))};return(0,a.useLayoutEffect)((()=>{let e,o;return i(),r.current&&(e=new MutationObserver((()=>{clearTimeout(o),o=setTimeout(i,0)})),e.observe(r.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),clearTimeout(o)}}),[]),(0,s.jsx)("div",{ref:r,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...o},...t,children:e})},A=JSON.parse('{"apiVersion":2,"name":"woocommerce-checkout-field-editor-pro/contact-information-section","version":"2.0.0","title":"Contact Information Section","category":"woocommerce","description":"Adds fields.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-contact-information-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}},"text":{"type":"string","default":""},"title":{"type":"string","default":"Contact Information"},"description":{"type":"string","default":"contact Fields"}},"textdomain":"woocommerce-checkout-field-editor-pro","editorStyle":"file:../../../build/style-checkout-section-block.css"}'),T=(0,window.wc.wcSettings.getSetting)("thwcfe-block-integration_data",""),{allSections:V}=T,{contact:$}=V,S={...A,attributes:{...A.attributes,sectionData:{type:"object",default:$}}};(0,r.registerBlockType)(S,{icon:{src:(0,s.jsx)(i,{icon:n})},edit:({attributes:e,setAttributes:o})=>{const t=(0,c.useBlockProps)(),{sectionData:r}=e,a=Array.isArray(r?.fields)?r.fields:Object.values(r?.fields||{});return(0,s.jsx)("div",{...t,children:a.map((e=>(0,s.jsx)("div",{className:"wc-block-checkout__thwcfe-contact-fields__field",children:(0,s.jsx)(I,{children:(0,s.jsx)(N,{field:e})})},e.id)))})},save:()=>(0,s.jsx)("div",{})})},609:e=>{e.exports=window.React},848:(e,o,t)=>{e.exports=t(20)}},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var i=t[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.m=o,e=[],r.O=(o,t,a,i)=>{if(!t){var l=1/0;for(d=0;d=i)&&Object.keys(r.O).every((e=>r.O[e](t[n])))?t.splice(n--,1):(s=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[t,a,i]},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={924:0,185:0};r.O.j=o=>0===e[o];var o=(o,t)=>{var a,i,[l,s,n]=t,c=0;if(l.some((o=>0!==e[o]))){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);if(n)var d=n(r)}for(o&&o(t);cr(431)));a=r.O(a)})();