!function(){var e={};e=React;var t=t=>{let{control:n,customizerSetting:o,defaultArray:i,valueArray:a,valueUnit:r}=t,[l,c]=(0,e.useState)(()=>a),s=e=>{let t="",n="",o="";return"boolean"==typeof e?{unit:"",number:e}:(""!==e&&(o=-1<(e=(e="string"!=typeof e?e.toString():e).trim()).indexOf("-")?"-":"",""!==(e=e.replace(o,""))?(t=e.replace(/\d+/g,""),n=parseFloat(n=o+(n=e.replace(t,"")).trim())):n=o),{unit:t,number:n})},u=e=>{let t;for(let n in e)Object.hasOwnProperty.call(e,n)&&(t=s(e[n]),e[n]=t.number);return e},p=e=>{let t;for(let n in e)Object.hasOwnProperty.call(e,n)&&(""!==(t=e[n])&&(t="boolean"==typeof(t=(t=s(t)).number)?t:t+r),e[n]=t);return e};n.updateComponentState=e=>{c(u(e))};let m=(e,t)=>{let n={...l};n.isLinked?(n.top=e.target.value,n.right=e.target.value,n.bottom=e.target.value,n.left=e.target.value):n[t]=e.target.value,o.set(p(n))},d=(e,t)=>{if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();let n=parseFloat(e.target.value)||0;"ArrowUp"===e.key?n+=1:"ArrowDown"===e.key&&(n-=1);let i={...l};i.isLinked?(i.top=n,i.right=n,i.bottom=n,i.left=n):i[t]=n,c(i),o.set(p(i))}},f=`kirki-control-input-${t.type}-top`;return(0,e.useRef)(null),React.createElement("div",{className:"kirki-control-form dashicons-picker",tabIndex:"1"},(t.label||t.description)&&React.createElement(React.Fragment,null,React.createElement("label",{className:"kirki-control-label",htmlFor:f},t.label&&React.createElement("span",{className:"customize-control-title"},t.label),t.description&&React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:t.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:t.setNotificationContainer})),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:e=>{let n=""!==t.default&&void 0!==t.default?i:a;o.set(p(n))}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("div",{class:"kirki-control-fields"},(()=>{let e=[];for(let t in l)Object.hasOwnProperty.call(l,t)&&"boolean"!=typeof l[t]&&e.push({position:t,value:l[t]});return e})(l).map(e=>{let n=`kirki-control-input kirki-control-input-${e.position}`,o=`kirki-control-input-${t.type}-${e.position}`;return React.createElement("div",{class:"kirki-control-field"},React.createElement("input",{id:o,type:"text",value:e.value||0===e.value?e.value:"",className:n,onChange:t=>m(t,e.position),onKeyDown:t=>d(t,e.position)}),React.createElement("label",{class:"kirki-control-sublabel",htmlFor:o},e.position))}))),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("span",{className:`newsx-spacing-linked ${l.isLinked?"active":""}`,onClick:e=>{let t={...l,isLinked:!l.isLinked};o.set(p(t))}},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 5C10.3431 5 9 6.34315 9 8V10H7V8C7 5.23858 9.23858 3 12 3C14.7614 3 17 5.23858 17 8V10H15V8C15 6.34315 13.6569 5 12 5Z",fill:"#0284c7"}),React.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 19C10.3431 19 9 17.6569 9 16V14H7V16C7 18.7614 9.23858 21 12 21C14.7614 21 17 18.7614 17 16V14H15V16C15 17.6569 13.6569 19 12 19Z",fill:"#0284c7"}),React.createElement("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11 16V8H13V16H11Z",fill:"#0284c7"}))))))};function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(null,arguments)}let o=wp.customize.Control.extend({initialize:function(e,t){let n=this;n.setNotificationContainer=n.setNotificationContainer.bind(n),wp.customize.Control.prototype.initialize.call(n,e,t),wp.customize.control.bind("removed",function e(t){n===t&&(n.destroy(),n.container.remove(),wp.customize.control.unbind("removed",e))})},setNotificationContainer:function(e){this.notifications.container=jQuery(e),this.notifications.render()},renderContent:function(){ReactDOM.render(React.createElement(t,n({},this.params,{control:this,customizerSetting:this.setting,setNotificationContainer:this.setNotificationCotainer,value:this.params.value})),this.container[0]),!1!==this.params.choices.allowCollapse&&this.container.addClass("allowCollapse")},ready:function(){let e=this;e.setting.bind(t=>{e.updateComponentState(t)})},updateComponentState:e=>{},destroy:function(){ReactDOM.unmountComponentAtNode(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["kirki-margin"]=o,wp.customize.controlConstructor["kirki-padding"]=o}();
//# sourceMappingURL=control.js.map
