diff --git a/assets/dist/customizer.asset.php b/assets/dist/customizer.asset.php index 20a83eeb..fb18343e 100644 --- a/assets/dist/customizer.asset.php +++ b/assets/dist/customizer.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'd65749464108d6bdd25b'); + array('lodash', 'react', 'react-dom', 'wp-components', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'cb9d73eb60111336e281'); diff --git a/assets/dist/customizer.js b/assets/dist/customizer.js index fe6c3159..138b3e37 100644 --- a/assets/dist/customizer.js +++ b/assets/dist/customizer.js @@ -1,3 +1,3 @@ -!function(){var e,t={13:function(e,t,r){"use strict";var a={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,"string");if("object"!=n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}function o(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(a),r.d(a,{FILE:function(){return Ko},HTML:function(){return qo},TEXT:function(){return Wo},URL:function(){return $o}});var s=r(609),l=window.wp.element;function c(e,t){void 0!==l.createRoot?(0,l.createRoot)(t).render(e):(0,l.render)(e,t)}var u=window.wp.components;function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function d(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return wp.customize.Control.extend(Object.assign({},{ready:function(){},embed:function(){var e=this,t=e.section();t&&wp.customize.section(t,(function(t){t.expanded.bind((function(t){t&&e.actuallyEmbed()}))}))},actuallyEmbed:function(){var e=this;"resolved"!==e.deferred.embedded.state()&&(e.renderContent(),e.deferred.embedded.resolve())},initialize:function(e,t){var r=this;r.setNotificationContainer=r.setNotificationContainer.bind(r),wp.customize.Control.prototype.initialize.call(r,e,t),wp.customize.control.bind("removed",(function e(t){r===t&&(r.destroy(),r.container.remove(),wp.customize.control.unbind("removed",e))}))},setNotificationContainer:function(e){this.notifications.container=jQuery(e),this.notifications.render()},getWrapper:function(){var e=this,t=e.container[0];if(e.params.choices.wrapper){var r=document.getElementById(e.params.choices.wrapper+"--wrapper");r&&(t=r,e.container.hide())}return t},renderContent:function(){var t=this,r=t.setting.get();c((0,s.createElement)(u.SlotFillProvider,null,(0,s.createElement)(e,d(d({},t.params),{},{value:r,setNotificationContainer:t.setNotificationContainer,customizerSetting:t.setting,control:t,choices:t.params.choices,default:t.params.defaultValue})),(0,s.createElement)(u.Popover.Slot,null)),t.getWrapper())},destroy:function(){(0,l.unmountComponentAtNode)(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}},t))}},p=f;function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r=0||(n[r]=e[r]);return n}function O(e){var t=(0,s.useRef)(e),r=(0,s.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,r.current}var C=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e0:e.buttons>0)&&n.current?i(N(n.current,e,l.current)):r(!1)},t=function(){return r(!1)};function r(r){var a=c.current,i=D(n.current),o=r?i.addEventListener:i.removeEventListener;o(a?"touchmove":"mousemove",e),o(a?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,a=n.current;if(a&&(x(t),!function(e,t){return t&&!E(e)}(t,c.current)&&a)){if(E(t)){c.current=!0;var o=t.changedTouches||[];o.length&&(l.current=o[0].identifier)}a.focus(),i(N(a,t,l.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),o({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]}),[o,i]),g=u[0],d=u[1],f=u[2];return(0,s.useEffect)((function(){return f}),[f]),s.createElement("div",S({},a,{onTouchStart:g,onMouseDown:g,className:"react-colorful__interactive",ref:n,onKeyDown:d,tabIndex:0,role:"slider"}))})),I=function(e){return e.filter(Boolean).join(" ")},M=function(e){var t=e.color,r=e.left,a=e.top,n=void 0===a?.5:a,i=I(["react-colorful__pointer",e.className]);return s.createElement("div",{className:i,style:{top:100*n+"%",left:100*r+"%"}},s.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},P=(Math.PI,function(e){var t=e.s,r=e.v,a=e.a,n=(200-t)*r/100;return{h:k(e.h),s:k(n>0&&n<200?t*r/100/(n<=100?n:200-n)*100:0),l:k(n/2),a:k(a,2)}}),_=function(e){var t=P(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},R=function(e){var t=P(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},L=function(e){var t=e.h,r=e.s,a=e.v,n=e.a;t=t/360*6,r/=100,a/=100;var i=Math.floor(t),o=a*(1-r),s=a*(1-(t-i)*r),l=a*(1-(1-t+i)*r),c=i%6;return{r:k(255*[a,s,o,o,l,a][c]),g:k(255*[l,a,a,s,o,o][c]),b:k(255*[o,o,l,a,a,s][c]),a:k(n,2)}},A=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?j({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},F=A,j=function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=Math.max(t,r,a),o=i-Math.min(t,r,a),s=o?i===t?(r-a)/o:i===r?2+(a-t)/o:4+(t-r)/o:0;return{h:k(60*(s<0?s+6:s)),s:k(i?o/i*100:0),v:k(i/255*100),a:n}},B=s.memo((function(e){var t=e.hue,r=e.onChange,a=I(["react-colorful__hue",e.className]);return s.createElement("div",{className:a},s.createElement(T,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:C(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":k(t),"aria-valuemax":"360","aria-valuemin":"0"},s.createElement(M,{className:"react-colorful__hue-pointer",left:t/360,color:_({h:t,s:100,v:100,a:1})})))})),V=s.memo((function(e){var t=e.hsva,r=e.onChange,a={backgroundColor:_({h:t.h,s:100,v:100,a:1})};return s.createElement("div",{className:"react-colorful__saturation",style:a},s.createElement(T,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:C(t.s+100*e.left,0,100),v:C(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+k(t.s)+"%, Brightness "+k(t.v)+"%"},s.createElement(M,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:_(t)})))})),H=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function z(e,t,r){var a=O(r),n=(0,s.useState)((function(){return e.toHsva(t)})),i=n[0],o=n[1],l=(0,s.useRef)({color:t,hsva:i});(0,s.useEffect)((function(){if(!e.equal(t,l.current.color)){var r=e.toHsva(t);l.current={hsva:r,color:t},o(r)}}),[t,e]),(0,s.useEffect)((function(){var t;(function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0})(i,l.current.hsva)||e.equal(t=e.fromHsva(i),l.current.color)||(l.current={hsva:i,color:t},a(t))}),[i,e,a]);var c=(0,s.useCallback)((function(e){o((function(t){return Object.assign({},t,e)}))}),[]);return[i,c]}var U="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,G=new Map,K=function(e){U((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!G.has(t)){var a=t.createElement("style");a.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',G.set(t,a);var n=r.nc;n&&a.setAttribute("nonce",n),t.head.appendChild(a)}}),[])},$=function(e){var t=e.className,r=e.colorModel,a=e.color,n=void 0===a?r.defaultColor:a,i=e.onChange,o=w(e,["className","colorModel","color","onChange"]),l=(0,s.useRef)(null);K(l);var c=z(r,n,i),u=c[0],g=c[1],d=I(["react-colorful",t]);return s.createElement("div",S({},o,{ref:l,className:d}),s.createElement(V,{hsva:u,onChange:g}),s.createElement(B,{hue:u.h,onChange:g,className:"react-colorful__last-control"}))},W=function(e){var t=e.className,r=e.hsva,a=e.onChange,n={backgroundImage:"linear-gradient(90deg, "+R(Object.assign({},r,{a:0}))+", "+R(Object.assign({},r,{a:1}))+")"},i=I(["react-colorful__alpha",t]),o=k(100*r.a);return s.createElement("div",{className:i},s.createElement("div",{className:"react-colorful__alpha-gradient",style:n}),s.createElement(T,{onMove:function(e){a({a:e.left})},onKey:function(e){a({a:C(r.a+e.left)})},"aria-label":"Alpha","aria-valuetext":o+"%","aria-valuenow":o,"aria-valuemin":"0","aria-valuemax":"100"},s.createElement(M,{className:"react-colorful__alpha-pointer",left:r.a,color:R(r)})))},q=function(e){var t=e.className,r=e.colorModel,a=e.color,n=void 0===a?r.defaultColor:a,i=e.onChange,o=w(e,["className","colorModel","color","onChange"]),l=(0,s.useRef)(null);K(l);var c=z(r,n,i),u=c[0],g=c[1],d=I(["react-colorful",t]);return s.createElement("div",S({},o,{ref:l,className:d}),s.createElement(V,{hsva:u,onChange:g}),s.createElement(B,{hue:u.h,onChange:g}),s.createElement(W,{hsva:u,onChange:g,className:"react-colorful__last-control"}))},Y={defaultColor:"rgba(0, 0, 0, 1)",toHsva:A,fromHsva:function(e){var t=L(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:H},J=function(e){return s.createElement(q,S({},e,{colorModel:Y}))},X={defaultColor:"rgb(0, 0, 0)",toHsva:F,fromHsva:function(e){var t=L(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:H},Z=function(e){return s.createElement($,S({},e,{colorModel:X}))},Q={grad:.9,turn:360,rad:360/(2*Math.PI)},ee=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},te=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},re=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},ae=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ne=function(e){return{r:re(e.r,0,255),g:re(e.g,0,255),b:re(e.b,0,255),a:re(e.a)}},ie=function(e){return{r:te(e.r),g:te(e.g),b:te(e.b),a:te(e.a,3)}},oe=/^#([0-9a-f]{3,8})$/i,se=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},le=function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=Math.max(t,r,a),o=i-Math.min(t,r,a),s=o?i===t?(r-a)/o:i===r?2+(a-t)/o:4+(t-r)/o:0;return{h:60*(s<0?s+6:s),s:i?o/i*100:0,v:i/255*100,a:n}},ce=function(e){var t=e.h,r=e.s,a=e.v,n=e.a;t=t/360*6,r/=100,a/=100;var i=Math.floor(t),o=a*(1-r),s=a*(1-(t-i)*r),l=a*(1-(1-t+i)*r),c=i%6;return{r:255*[a,s,o,o,l,a][c],g:255*[l,a,a,s,o,o][c],b:255*[o,o,l,a,a,s][c],a:n}},ue=function(e){return{h:ae(e.h),s:re(e.s,0,100),l:re(e.l,0,100),a:re(e.a)}},ge=function(e){return{h:te(e.h),s:te(e.s),l:te(e.l),a:te(e.a,3)}},de=function(e){return ce((r=(t=e).s,{h:t.h,s:(r*=((a=t.l)<50?a:100-a)/100)>0?2*r/(a+r)*100:0,v:a+r,a:t.a}));var t,r,a},fe=function(e){return{h:(t=le(e)).h,s:(n=(200-(r=t.s))*(a=t.v)/100)>0&&n<200?r*a/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,r,a,n},pe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ve=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,he=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ye=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,me={string:[[function(e){var t=oe.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?te(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?te(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=he.exec(e)||ye.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ne({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=pe.exec(e)||ve.exec(e);if(!t)return null;var r,a,n=ue({h:(r=t[1],a=t[2],void 0===a&&(a="deg"),Number(r)*(Q[a]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return de(n)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=void 0===n?1:n;return ee(t)&&ee(r)&&ee(a)?ne({r:Number(t),g:Number(r),b:Number(a),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,r=e.s,a=e.l,n=e.a,i=void 0===n?1:n;if(!ee(t)||!ee(r)||!ee(a))return null;var o=ue({h:Number(t),s:Number(r),l:Number(a),a:Number(i)});return de(o)},"hsl"],[function(e){var t=e.h,r=e.s,a=e.v,n=e.a,i=void 0===n?1:n;if(!ee(t)||!ee(r)||!ee(a))return null;var o=function(e){return{h:ae(e.h),s:re(e.s,0,100),v:re(e.v,0,100),a:re(e.a)}}({h:Number(t),s:Number(r),v:Number(a),a:Number(i)});return ce(o)},"hsv"]]},be=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=ie(this.rgba)).r,r=e.g,a=e.b,i=(n=e.a)<1?se(te(255*n)):"","#"+se(t)+se(r)+se(a)+i;var e,t,r,a,n,i},e.prototype.toRgb=function(){return ie(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ie(this.rgba)).r,r=e.g,a=e.b,(n=e.a)<1?"rgba("+t+", "+r+", "+a+", "+n+")":"rgb("+t+", "+r+", "+a+")";var e,t,r,a,n},e.prototype.toHsl=function(){return ge(fe(this.rgba))},e.prototype.toHslString=function(){return t=(e=ge(fe(this.rgba))).h,r=e.s,a=e.l,(n=e.a)<1?"hsla("+t+", "+r+"%, "+a+"%, "+n+")":"hsl("+t+", "+r+"%, "+a+"%)";var e,t,r,a,n},e.prototype.toHsv=function(){return e=le(this.rgba),{h:te(e.h),s:te(e.s),v:te(e.v),a:te(e.a,3)};var e},e.prototype.invert=function(){return Ee({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Ee(Se(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Ee(Se(this.rgba,-e))},e.prototype.grayscale=function(){return Ee(Se(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Ee(Oe(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Ee(Oe(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Ee({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):te(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=fe(this.rgba);return"number"==typeof e?Ee({h:e,s:t.s,l:t.l,a:t.a}):te(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Ee(e).toHex()},e}(),Ee=function(e){return e instanceof Ce?e:new Ce(e)};function De(e,t,r){var a=this,n=(0,s.useRef)(null),i=(0,s.useRef)(0),o=(0,s.useRef)(null),l=(0,s.useRef)([]),c=(0,s.useRef)(),u=(0,s.useRef)(),g=(0,s.useRef)(e),d=(0,s.useRef)(!0);(0,s.useEffect)((function(){g.current=e}),[e]);var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var p=!!(r=r||{}).leading,v=!("trailing"in r)||!!r.trailing,h="maxWait"in r,y=h?Math.max(+r.maxWait||0,t):null;(0,s.useEffect)((function(){return d.current=!0,function(){d.current=!1}}),[]);var m=(0,s.useMemo)((function(){var e=function(e){var t=l.current,r=c.current;return l.current=c.current=null,i.current=e,u.current=g.current.apply(r,t)},r=function(e,t){f&&cancelAnimationFrame(o.current),o.current=f?requestAnimationFrame(e):setTimeout(e,t)},s=function(e){if(!d.current)return!1;var r=e-n.current;return!n.current||r>=t||r<0||h&&e-i.current>=y},m=function(t){return o.current=null,v&&l.current?e(t):(l.current=c.current=null,u.current)},b=function e(){var a=Date.now();if(s(a))return m(a);if(d.current){var o=t-(a-n.current),l=h?Math.min(o,y-(a-i.current)):o;r(e,l)}},S=function(){var g=Date.now(),f=s(g);if(l.current=[].slice.call(arguments),c.current=a,n.current=g,f){if(!o.current&&d.current)return i.current=n.current,r(b,t),p?e(n.current):u.current;if(h)return r(b,t),e(n.current)}return o.current||r(b,t),u.current};return S.cancel=function(){o.current&&(f?cancelAnimationFrame(o.current):clearTimeout(o.current)),i.current=0,l.current=n.current=c.current=o.current=null},S.isPending=function(){return!!o.current},S.flush=function(){return o.current?m(Date.now()):u.current},S}),[p,h,t,y,v,f]);return m}function Ne(e){var t=e.value,r=e.showAlpha,a=e.onChange,n=r?J:Z,i=(0,l.useMemo)((function(){return function(e){if(String(e).startsWith("var(")){var t=e.match(/\(([^)]+)\)/);if(t){var r=getComputedStyle(document.documentElement).getPropertyValue(t[1]);r&&(e=r)}}return Ee(e).toRgbString()}(t)}),[t]),o=De(a,100);return(0,s.createElement)(n,{color:i,onChange:function(e){Ee(e).isValid()&&(e=1===Ee(e).alpha()?Ee(e).toHex():e),o(e)}})}function xe(e){return"info"===e?(0,s.createElement)("svg",{width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024","aria-hidden":"true"},(0,s.createElement)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}),(0,s.createElement)("path",{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"})):"x"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M18 6L6 18M6 6l12 12"})):"ellipsis"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)("rect",{x:"0",fill:"none",width:"20",height:"20"}),(0,s.createElement)("g",null,(0,s.createElement)("path",{d:"M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))):"mobile"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20","aria-hidden":"true",width:"1em",height:"1em"},(0,s.createElement)("path",{d:"M6 2h8c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H6c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm7 12V4H7v10h6zM8 5h4l-4 5V5z",fill:"currentColor"})):"tablet"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20","aria-hidden":"true",width:"1em",height:"1em"},(0,s.createElement)("path",{d:"M4 2h12c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm11 14V4H5v12h10zM6 5h6l-6 5V5z",fill:"currentColor"})):"desktop"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20","aria-hidden":"true",width:"1em",height:"1em"},(0,s.createElement)("path",{d:"M3 2h14c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1h-5v2h2c.55 0 1 .45 1 1v1H5v-1c0-.55.45-1 1-1h2v-2H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm13 9V4H4v7h12zM5 5h9L5 9V5z",fill:"currentColor"})):"dash"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M4.5 12.75a.75.75 0 01.75-.75h13.5a.75.75 0 010 1.5H5.25a.75.75 0 01-.75-.75z",fill:"currentColor"})):"plus"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M12 5v14M5 12h14"})):"lock"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,s.createElement)("path",{d:"M7 11V7a5 5 0 0110 0v4"})):"unlock"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,s.createElement)("path",{d:"M7 11V7a5 5 0 019.9-1"})):"chevron-down"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M6 9l6 6 6-6"})):"chevron-up"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M18 15l-6-6-6 6"})):"chevron-right"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M9 18l6-6-6-6"})):"trash"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",style:{fill:"none"},stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2M10 11v6M14 11v6"})):"reorder"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"m5 9-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20"})):"check"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{fill:"none",d:"M20 6 9 17l-5-5"})):void 0}function Te(e){var t=e.value,r=e.onChange,a=e.onBlur,n=e.onEnable,i=e.isDisabled,o=e.helpText;return(0,s.createElement)("div",{className:"generate-color-input--css-var-name-wrapper"},(0,s.createElement)(u.TextControl,{label:(0,m.__)("CSS Variable Name","generatepress"),disabled:i,help:o,type:"text",value:t,onChange:r,onBlur:a}),i&&(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Changing this name will remove its color from elements already using it.","generatepress")},(0,s.createElement)(u.Button,{onClick:function(){window.alert((0,m.__)("Changing this name will break styles that are using it to define its color.","generatepress")),n(),setTimeout((function(){document.querySelector(".generate-color-input--css-var-name-wrapper input").focus()}),10)}},xe("unlock"))))}var Ie=function(e){return/^([0-9A-F]{3}){1,2}$/i.test(e)};function Me(e){var t=e.value,r=e.onChange,a=e.showReset,n=void 0!==a&&a,i=e.onClickReset;return(0,s.createElement)("div",{className:"generate-color-input-wrapper"},(0,s.createElement)(u.TextControl,{id:"generate-color-input-field",className:"generate-color-input",type:"text",value:t||"",onChange:function(e){!e.startsWith("#")&&Ie(e)&&(e="#"+e),r(e)}}),n&&(0,s.createElement)(u.Button,{isSmall:!0,isSecondary:!0,className:"components-color-clear-color",onClick:i},(0,m.__)("Default","generatepress")))}function ke(e){var t=e.value,r=e.onChange,a=generateCustomizerControls.palette,n=window.sessionStorage.getItem("generateGlobalColors");return n&&(a=JSON.parse(n)),(0,s.createElement)(u.BaseControl,{className:"generate-component-color-picker-palette"},(0,s.createElement)(u.ColorPalette,{colors:a,value:t,onChange:function(e){void 0===e&&(e=""),r(e),setTimeout((function(){document.querySelector(".generate-color-input-wrapper input").focus()}),10)},disableCustomColors:!0,clearable:!1}))}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _e(e){var t=e.value,r=e.variableName,a=e.label,n=e.tooltipText,i=e.tooltipPosition,c=e.showAlpha,g=e.showReset,d=e.showVariableName,f=e.showPalette,p=e.variableNameIsDisabled,v=e.variableNameHelpText,h=e.onChange,m=void 0===h?function(){return!1}:h,S=e.onClosePanel,w=void 0===S?function(){return!1}:S,O=e.onChangeVariableName,C=void 0===O?function(){return!1}:O,E=e.onBlurVariableName,D=void 0===E?function(){return!1}:E,N=e.onEnableVariableName,x=void 0===N?function(){return!1}:N,T=e.onClickReset,I=void 0===T?function(){return!1}:T,M=y((0,l.useState)(!1),2),k=M[0],P=M[1],_=(0,l.useCallback)((function(){P(!0)})),R=De((0,l.useCallback)((function(){P(!1),w()})),100),L={};return generateCustomizerControls.colorPickerShouldShift&&(L.shift=!0),(0,s.createElement)("div",{className:"generate-color-picker-area"},(0,s.createElement)(b,{color:t||"transparent",tooltip:n,tooltipPosition:i,ariaExpanded:k,onClick:k?R:_}),k&&(0,s.createElement)(u.Popover,function(e){for(var t=1;t=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var Ve=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?Qe(ct,--st):0,it--,10===lt&&(it=1,nt--),lt}function ft(){return lt=st2||yt(lt)>3?"":" "}function Ot(e,t){for(;--t&&ft()&&!(lt<48||lt>102||lt>57&<<65||lt>70&<<97););return ht(e,vt()+(t<6&&32==pt()&&32==ft()))}function Ct(e){for(;ft();)switch(lt){case e:return st;case 34:case 39:34!==e&&39!==e&&Ct(lt);break;case 40:41===e&&Ct(e);break;case 92:ft()}return st}function Et(e,t){for(;ft()&&e+lt!==57&&(e+lt!==84||47!==pt()););return"/*"+ht(t,st-1)+"*"+qe(47===e?e:ft())}function Dt(e){for(;!yt(pt());)ft();return ht(e,st)}var Nt="-ms-",xt="-moz-",Tt="-webkit-",It="comm",Mt="rule",kt="decl",Pt="@keyframes";function _t(e,t){for(var r="",a=rt(e),n=0;n0&&tt(C)-g&&at(f>32?Bt(C+";",a,r,g-1):Bt(Xe(C," ","")+";",a,r,g-2),l);break;case 59:C+=";";default:if(at(O=Ft(C,t,r,c,u,n,s,b,S=[],w=[],g),i),123===m)if(0===u)At(C,t,O,O,S,i,g,s,w);else switch(99===d&&110===Qe(C,3)?100:d){case 100:case 108:case 109:case 115:At(e,O,O,a&&at(Ft(e,O,O,0,0,n,s,b,n,S=[],g),w),n,w,g,s,a?S:w);break;default:At(C,O,O,O,[""],w,0,s,w)}}c=u=f=0,v=y=1,b=C="",g=o;break;case 58:g=1+tt(C),f=p;default:if(v<1)if(123==m)--v;else if(125==m&&0==v++&&125==dt())continue;switch(C+=qe(m),m*v){case 38:y=u>0?1:(C+="\f",-1);break;case 44:s[c++]=(tt(C)-1)*y,y=1;break;case 64:45===pt()&&(C+=St(ft())),d=pt(),u=g=tt(b=C+=Dt(vt())),m++;break;case 45:45===p&&2==tt(C)&&(v=0)}}return i}function Ft(e,t,r,a,n,i,o,s,l,c,u){for(var g=n-1,d=0===n?i:[""],f=rt(d),p=0,v=0,h=0;p0?d[y]+" "+m:Xe(m,/&\f/g,d[y])))&&(l[h++]=b);return ut(e,t,r,0===n?Mt:s,l,c,u)}function jt(e,t,r){return ut(e,t,r,It,qe(lt),et(e,2,-2),0)}function Bt(e,t,r,a){return ut(e,t,r,kt,et(e,0,a),et(e,a+1,-1),a)}var Vt=function(e,t,r){for(var a=0,n=0;a=n,n=pt(),38===a&&12===n&&(t[r]=1),!yt(n);)ft();return ht(e,st)},Ht=new WeakMap,zt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,a=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ht.get(r))&&!a){Ht.set(e,!0);for(var n=[],i=function(e,t){return bt(function(e,t){var r=-1,a=44;do{switch(yt(a)){case 0:38===a&&12===pt()&&(t[r]=1),e[r]+=Vt(st-1,t,r);break;case 2:e[r]+=St(a);break;case 4:if(44===a){e[++r]=58===pt()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=qe(a)}}while(a=ft());return e}(mt(e),t))}(t,n),o=r.props,s=0,l=0;s6)switch(Qe(e,t+1)){case 109:if(45!==Qe(e,t+4))break;case 102:return Xe(e,/(.+:)(.+)-([^]+)/,"$1"+Tt+"$2-$3$1"+xt+(108==Qe(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ze(e,"stretch")?Gt(Xe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Qe(e,t+1))break;case 6444:switch(Qe(e,tt(e)-3-(~Ze(e,"!important")&&10))){case 107:return Xe(e,":",":"+Tt)+e;case 101:return Xe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Tt+(45===Qe(e,14)?"inline-":"")+"box$3$1"+Tt+"$2$3$1"+Nt+"$2box$3")+e}break;case 5936:switch(Qe(e,t+11)){case 114:return Tt+e+Nt+Xe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Tt+e+Nt+Xe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Tt+e+Nt+Xe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Tt+e+Nt+e+e}return e}var Kt=[function(e,t,r,a){if(e.length>-1&&!e.return)switch(e.type){case kt:e.return=Gt(e.value,e.length);break;case Pt:return _t([gt(e,{value:Xe(e.value,"@","@"+Tt)})],a);case Mt:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return _t([gt(e,{props:[Xe(t,/:(read-\w+)/,":-moz-$1")]})],a);case"::placeholder":return _t([gt(e,{props:[Xe(t,/:(plac\w+)/,":"+Tt+"input-$1")]}),gt(e,{props:[Xe(t,/:(plac\w+)/,":-moz-$1")]}),gt(e,{props:[Xe(t,/:(plac\w+)/,Nt+"input-$1")]})],a)}return""}))}}],$t=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var a,n,i=e.stylisPlugins||Kt,o={},s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r=4;++a,n-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(n){case 3:r^=(255&e.charCodeAt(a+2))<<16;case 2:r^=(255&e.charCodeAt(a+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(a)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(n)+l;return{name:c,styles:n,next:ar}},or=!!s.useInsertionEffect&&s.useInsertionEffect,sr=or||function(e){return e()},lr=(or||s.useLayoutEffect,{}.hasOwnProperty),cr=s.createContext("undefined"!=typeof HTMLElement?$t({key:"css"}):null);cr.Provider;var ur=function(e){return(0,s.forwardRef)((function(t,r){var a=(0,s.useContext)(cr);return e(t,a,r)}))},gr=s.createContext({}),dr="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",fr=function(e){var t=e.cache,r=e.serialized,a=e.isStringTag;return Wt(t,r,a),sr((function(){return function(e,t,r){Wt(e,t,r);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var n=t;do{e.insert(t===n?"."+a:"",n,e.sheet,!0),n=n.next}while(void 0!==n)}}(t,r,a)})),null},pr=ur((function(e,t,r){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var n=e[dr],i=[a],o="";"string"==typeof e.className?o=function(e,t,r){var a="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):a+=r+" "})),a}(t.registered,i,e.className):null!=e.className&&(o=e.className+" ");var l=ir(i,void 0,s.useContext(gr));o+=t.key+"-"+l.name;var c={};for(var u in e)lr.call(e,u)&&"css"!==u&&u!==dr&&(c[u]=e[u]);return c.ref=r,c.className=o,s.createElement(s.Fragment,null,s.createElement(fr,{cache:t,serialized:l,isStringTag:"string"==typeof n}),s.createElement(n,c))})),vr=pr,hr=(r(146),function(e,t){var r=arguments;if(null==t||!lr.call(t,"css"))return s.createElement.apply(void 0,r);var a=r.length,n=new Array(a);n[0]=vr,n[1]=function(e,t){var r={};for(var a in t)lr.call(t,a)&&(r[a]=t[a]);return r[dr]=e,r}(e,t);for(var i=2;i({x:e,y:e});function Er(e){return xr(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Nr(e){var t;return null==(t=(xr(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function xr(e){return e instanceof Node||e instanceof Dr(e).Node}function Tr(e){return e instanceof Element||e instanceof Dr(e).Element}function Ir(e){return e instanceof HTMLElement||e instanceof Dr(e).HTMLElement}function Mr(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot)}function kr(e){const{overflow:t,overflowX:r,overflowY:a,display:n}=Pr(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!["inline","contents"].includes(n)}function Pr(e){return Dr(e).getComputedStyle(e)}function _r(e){const t=function(e){if("html"===Er(e))return e;const t=e.assignedSlot||e.parentNode||Mr(e)&&e.host||Nr(e);return Mr(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(Er(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ir(t)&&kr(t)?t:_r(t)}function Rr(e,t,r){var a;void 0===t&&(t=[]),void 0===r&&(r=!0);const n=_r(e),i=n===(null==(a=e.ownerDocument)?void 0:a.body),o=Dr(n);return i?t.concat(o,o.visualViewport||[],kr(n)?n:[],o.frameElement&&r?Rr(o.frameElement):[]):t.concat(n,Rr(n,[],r))}function Lr(e){return Tr(e)?e:e.contextElement}function Ar(e){const t=Lr(e);if(!Ir(t))return Cr(1);const r=t.getBoundingClientRect(),{width:a,height:n,$:i}=function(e){const t=Pr(e);let r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const n=Ir(e),i=n?e.offsetWidth:r,o=n?e.offsetHeight:a,s=wr(r)!==i||wr(a)!==o;return s&&(r=i,a=o),{width:r,height:a,$:s}}(t);let o=(i?wr(r.width):r.width)/a,s=(i?wr(r.height):r.height)/n;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const Fr=Cr(0);function jr(e){const t=Dr(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Fr}function Br(e,t,r,a){void 0===t&&(t=!1),void 0===r&&(r=!1);const n=e.getBoundingClientRect(),i=Lr(e);let o=Cr(1);t&&(a?Tr(a)&&(o=Ar(a)):o=Ar(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Dr(e))&&t}(i,r,a)?jr(i):Cr(0);let l=(n.left+s.x)/o.x,c=(n.top+s.y)/o.y,u=n.width/o.x,g=n.height/o.y;if(i){const e=Dr(i),t=a&&Tr(a)?Dr(a):a;let r=e,n=r.frameElement;for(;n&&a&&t!==r;){const e=Ar(n),t=n.getBoundingClientRect(),a=Pr(n),i=t.left+(n.clientLeft+parseFloat(a.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(a.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,g*=e.y,l+=i,c+=o,r=Dr(n),n=r.frameElement}}return function(e){const{x:t,y:r,width:a,height:n}=e;return{width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}({width:u,height:g,x:l,y:c})}var Vr=s.useLayoutEffect,Hr=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],zr=function(){};function Ur(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Gr(e,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),n=2;n-1}function Yr(e){return qr(e)?window.pageYOffset:e.scrollTop}function Jr(e,t){qr(e)?window.scrollTo(0,t):e.scrollTop=t}function Xr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zr,n=Yr(e),i=t-n,o=0;!function t(){var s=function(e,t,r,a){return r*((e=e/a-1)*e*e+1)+t}(o+=10,n,i,r);Jr(e,s),or.bottom?Jr(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):a.top-n=p)return{placement:"bottom",maxHeight:t};if(E>=p&&!o)return i&&Xr(l,D,x),{placement:"bottom",maxHeight:t};if(!o&&E>=a||o&&O>=a)return i&&Xr(l,D,x),{placement:"bottom",maxHeight:o?O-b:E-b};if("auto"===n||o){var T=t,I=o?w:C;return I>=a&&(T=Math.min(I-b-s,t)),{placement:"top",maxHeight:T}}if("bottom"===n)return i&&Jr(l,D),{placement:"bottom",maxHeight:t};break;case"top":if(w>=p)return{placement:"top",maxHeight:t};if(C>=p&&!o)return i&&Xr(l,N,x),{placement:"top",maxHeight:t};if(!o&&C>=a||o&&w>=a){var M=t;return(!o&&C>=a||o&&w>=a)&&(M=o?w-S:C-S),i&&Xr(l,N,x),{placement:"top",maxHeight:M}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return c}({maxHeight:a,menuEl:e,minHeight:r,placement:n,shouldScroll:o&&!t,isFixedPosition:t,controlHeight:m});f(s.maxHeight),h(s.placement),null==c||c(s.placement)}}),[a,n,i,o,r,c,m]),t({ref:u,placerProps:je(je({},e),{},{placement:v||oa(n),maxHeight:d})})},ca=function(e,t){var r=e.theme,a=r.spacing.baseUnit,n=r.colors;return je({textAlign:"center"},t?{}:{color:n.neutral40,padding:"".concat(2*a,"px ").concat(3*a,"px")})},ua=ca,ga=ca,da=function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),t)};da.defaultProps={children:"No options"};var fa=function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),t)};fa.defaultProps={children:"Loading..."};var pa,va=["size"],ha={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ya=function(e){var t=e.size,r=Be(e,va);return hr("svg",He({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ha},r))},ma=function(e){return hr(ya,He({size:20},e),hr("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},ba=function(e){return hr(ya,He({size:20},e),hr("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Sa=function(e,t){var r=e.isFocused,a=e.theme,n=a.spacing.baseUnit,i=a.colors;return je({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?i.neutral60:i.neutral20,padding:2*n,":hover":{color:r?i.neutral80:i.neutral40}})},wa=Sa,Oa=Sa,Ca=function(){var e=yr.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(pa||(pa=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))),Ea=function(e){var t=e.delay,r=e.offset;return hr("span",{css:yr({animation:"".concat(Ca," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Da=function(e){var t=e.innerProps,r=e.isRtl;return hr("div",He({},Wr(e,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),hr(Ea,{delay:0,offset:r}),hr(Ea,{delay:160,offset:!0}),hr(Ea,{delay:320,offset:!r}))};Da.defaultProps={size:4};var Na=["data"],xa=["innerRef","isDisabled","isHidden","inputClassName"],Ta={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Ia={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":je({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Ta)},Ma=function(e){return je({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Ta)},ka=function(e){var t=e.children,r=e.innerProps;return hr("div",r,t)},Pa={ClearIndicator:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||hr(ma,null))},Control:function(e){var t=e.children,r=e.isDisabled,a=e.isFocused,n=e.innerRef,i=e.innerProps,o=e.menuIsOpen;return hr("div",He({ref:n},Wr(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":a,"control--menu-is-open":o}),i),t)},DropdownIndicator:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||hr(ba,null))},DownChevron:ba,CrossIcon:ma,Group:function(e){var t=e.children,r=e.cx,a=e.getStyles,n=e.getClassNames,i=e.Heading,o=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return hr("div",He({},Wr(e,"group",{group:!0}),s),hr(i,He({},o,{selectProps:u,theme:c,getStyles:a,getClassNames:n,cx:r}),l),hr("div",null,t))},GroupHeading:function(e){var t=$r(e);t.data;var r=Be(t,Na);return hr("div",He({},Wr(e,"groupHeading",{"group-heading":!0}),r))},IndicatorsContainer:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"indicatorsContainer",{indicators:!0}),r),t)},IndicatorSeparator:function(e){var t=e.innerProps;return hr("span",He({},t,Wr(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,r=e.value,a=$r(e),n=a.innerRef,i=a.isDisabled,o=a.isHidden,s=a.inputClassName,l=Be(a,xa);return hr("div",He({},Wr(e,"input",{"input-container":!0}),{"data-value":r||""}),hr("input",He({className:t({input:!0},s),ref:n,style:Ma(o),disabled:i},l)))},LoadingIndicator:Da,Menu:function(e){var t=e.children,r=e.innerRef,a=e.innerProps;return hr("div",He({},Wr(e,"menu",{menu:!0}),{ref:r},a),t)},MenuList:function(e){var t=e.children,r=e.innerProps,a=e.innerRef,n=e.isMulti;return hr("div",He({},Wr(e,"menuList",{"menu-list":!0,"menu-list--is-multi":n}),{ref:a},r),t)},MenuPortal:function(e){var t=e.appendTo,r=e.children,a=e.controlElement,n=e.innerProps,i=e.menuPlacement,o=e.menuPosition,l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=y((0,s.useState)(oa(i)),2),g=u[0],d=u[1],f=(0,s.useMemo)((function(){return{setPortalPlacement:d}}),[]),p=y((0,s.useState)(null),2),v=p[0],h=p[1],m=(0,s.useCallback)((function(){if(a){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(a),t="fixed"===o?0:window.pageYOffset,r=e[g]+t;r===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||h({offset:r,rect:e})}}),[a,o,g,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);Vr((function(){m()}),[m]);var b=(0,s.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),a&&l.current&&(c.current=function(e,t,r,a){void 0===a&&(a={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=Lr(e),u=n||i?[...c?Rr(c):[],...Rr(t)]:[];u.forEach((e=>{n&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)}));const g=c&&s?function(e,t){let r,a=null;const n=Nr(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}return function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:g,height:d}=e.getBoundingClientRect();if(s||t(),!g||!d)return;const f={rootMargin:-Or(u)+"px "+-Or(n.clientWidth-(c+g))+"px "+-Or(n.clientHeight-(u+d))+"px "+-Or(c)+"px",threshold:Sr(0,br(1,l))||1};let p=!0;function v(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return o();t?o(!1,t):r=setTimeout((()=>{o(!1,1e-7)}),1e3)}p=!1}try{a=new IntersectionObserver(v,{...f,root:n.ownerDocument})}catch(e){a=new IntersectionObserver(v,f)}a.observe(e)}(!0),i}(c,r):null;let d,f=-1,p=null;o&&(p=new ResizeObserver((e=>{let[a]=e;a&&a.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),r()})),c&&!l&&p.observe(c),p.observe(t));let v=l?Br(e):null;return l&&function t(){const a=Br(e);!v||a.x===v.x&&a.y===v.y&&a.width===v.width&&a.height===v.height||r(),v=a,d=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{n&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)})),null==g||g(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(d)}}(a,l.current,m,{elementResize:"ResizeObserver"in window}))}),[a,m]);Vr((function(){b()}),[b]);var S=(0,s.useCallback)((function(e){l.current=e,b()}),[b]);if(!t&&"fixed"!==o||!v)return null;var w=hr("div",He({ref:S},Wr(je(je({},e),{},{offset:v.offset,position:o,rect:v.rect}),"menuPortal",{"menu-portal":!0}),n),r);return hr(sa.Provider,{value:f},t?(0,mr.createPortal)(w,t):w)},LoadingMessage:fa,NoOptionsMessage:da,MultiValue:function(e){var t=e.children,r=e.components,a=e.data,n=e.innerProps,i=e.isDisabled,o=e.removeProps,s=e.selectProps,l=r.Container,c=r.Label,u=r.Remove;return hr(l,{data:a,innerProps:je(je({},Wr(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),n),selectProps:s},hr(c,{data:a,innerProps:je({},Wr(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),hr(u,{data:a,innerProps:je(je({},Wr(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},o),selectProps:s}))},MultiValueContainer:ka,MultiValueLabel:ka,MultiValueRemove:function(e){var t=e.children,r=e.innerProps;return hr("div",He({role:"button"},r),t||hr(ma,{size:14}))},Option:function(e){var t=e.children,r=e.isDisabled,a=e.isFocused,n=e.isSelected,i=e.innerRef,o=e.innerProps;return hr("div",He({},Wr(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":a,"option--is-selected":n}),{ref:i,"aria-disabled":r},o),t)},Placeholder:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"placeholder",{placeholder:!0}),r),t)},SelectContainer:function(e){var t=e.children,r=e.innerProps,a=e.isDisabled,n=e.isRtl;return hr("div",He({},Wr(e,"container",{"--is-disabled":a,"--is-rtl":n}),r),t)},SingleValue:function(e){var t=e.children,r=e.isDisabled,a=e.innerProps;return hr("div",He({},Wr(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),a),t)},ValueContainer:function(e){var t=e.children,r=e.innerProps,a=e.isMulti,n=e.hasValue;return hr("div",He({},Wr(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":n}),r),t)}},_a=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ra(e,t){if(e.length!==t.length)return!1;for(var r=0;r1?"s":""," ").concat(n.join(","),", selected.");case"select-option":return"option ".concat(a,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,a=e.options,n=e.label,i=void 0===n?"":n,o=e.selectValue,s=e.isDisabled,l=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&o)return"value ".concat(i," focused, ").concat(c(o,r),".");if("menu"===t){var u=s?" disabled":"",g="".concat(l?"selected":"focused").concat(u);return"option ".concat(i," ").concat(g,", ").concat(c(a,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},ja=function(e){var t=e.ariaSelection,r=e.focusedOption,a=e.focusedValue,n=e.focusableOptions,i=e.isFocused,o=e.selectValue,l=e.selectProps,c=e.id,u=l.ariaLiveMessages,g=l.getOptionLabel,d=l.inputValue,f=l.isMulti,p=l.isOptionDisabled,v=l.isSearchable,h=l.menuIsOpen,y=l.options,m=l.screenReaderStatus,b=l.tabSelectsValue,S=l["aria-label"],w=l["aria-live"],O=(0,s.useMemo)((function(){return je(je({},Fa),u||{})}),[u]),C=(0,s.useMemo)((function(){var e,r="";if(t&&O.onChange){var a=t.option,n=t.options,i=t.removedValue,s=t.removedValues,l=t.value,c=i||a||(e=l,Array.isArray(e)?null:e),u=c?g(c):"",d=n||s||void 0,f=d?d.map(g):[],v=je({isDisabled:c&&p(c,o),label:u,labels:f},t);r=O.onChange(v)}return r}),[t,O,p,o,g]),E=(0,s.useMemo)((function(){var e="",t=r||a,i=!!(r&&o&&o.includes(r));if(t&&O.onFocus){var s={focused:t,label:g(t),isDisabled:p(t,o),isSelected:i,options:n,context:t===r?"menu":"value",selectValue:o};e=O.onFocus(s)}return e}),[r,a,g,p,O,n,o]),D=(0,s.useMemo)((function(){var e="";if(h&&y.length&&O.onFilter){var t=m({count:n.length});e=O.onFilter({inputValue:d,resultsMessage:t})}return e}),[n,d,h,O,y,m]),N=(0,s.useMemo)((function(){var e="";if(O.guidance){var t=a?"value":h?"menu":"input";e=O.guidance({"aria-label":S,context:t,isDisabled:r&&p(r,o),isMulti:f,isSearchable:v,tabSelectsValue:b})}return e}),[S,r,a,f,p,v,h,O,o,b]),x="".concat(E," ").concat(D," ").concat(N),T=hr(s.Fragment,null,hr("span",{id:"aria-selection"},C),hr("span",{id:"aria-context"},x)),I="initial-input-focus"===(null==t?void 0:t.action);return hr(s.Fragment,null,hr(Aa,{id:c},I&&T),hr(Aa,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text"},i&&!I&&T))},Ba=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Va=new RegExp("["+Ba.map((function(e){return e.letters})).join("")+"]","g"),Ha={},za=0;za1?t-1:0),a=1;a0,v=g-d-c,h=!1;v>t&&o.current&&(a&&a(e),o.current=!1),p&&l.current&&(i&&i(e),l.current=!1),p&&t>v?(r&&!o.current&&r(e),f.scrollTop=g,h=!0,o.current=!0):!p&&-t>c&&(n&&!l.current&&n(e),f.scrollTop=0,h=!0,l.current=!0),h&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[r,a,n,i]),d=(0,s.useCallback)((function(e){g(e,e.deltaY)}),[g]),f=(0,s.useCallback)((function(e){c.current=e.changedTouches[0].clientY}),[]),p=(0,s.useCallback)((function(e){var t=c.current-e.changedTouches[0].clientY;g(e,t)}),[g]),v=(0,s.useCallback)((function(e){if(e){var t=!!aa&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",p,t)}}),[p,f,d]),h=(0,s.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",p,!1))}),[p,f,d]);return(0,s.useEffect)((function(){if(t){var e=u.current;return v(e),function(){h(e)}}}),[t,v,h]),function(e){u.current=e}}({isEnabled:void 0===a||a,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,r=e.accountForScrollbars,a=void 0===r||r,n=(0,s.useRef)({}),i=(0,s.useRef)(null),o=(0,s.useCallback)((function(e){if(an){var t=document.body,r=t&&t.style;if(a&&Xa.forEach((function(e){var t=r&&r[e];n.current[e]=t})),a&&nn<1){var i=parseInt(n.current.paddingRight,10)||0,o=document.body?document.body.clientWidth:0,s=window.innerWidth-o+i||0;Object.keys(Za).forEach((function(e){var t=Za[e];r&&(r[e]=t)})),r&&(r.paddingRight="".concat(s,"px"))}t&&rn()&&(t.addEventListener("touchmove",Qa,on),e&&(e.addEventListener("touchstart",tn,on),e.addEventListener("touchmove",en,on))),nn+=1}}),[a]),l=(0,s.useCallback)((function(e){if(an){var t=document.body,r=t&&t.style;nn=Math.max(nn-1,0),a&&nn<1&&Xa.forEach((function(e){var t=n.current[e];r&&(r[e]=t)})),t&&rn()&&(t.removeEventListener("touchmove",Qa,on),e&&(e.removeEventListener("touchstart",tn,on),e.removeEventListener("touchmove",en,on)))}}),[a]);return(0,s.useEffect)((function(){if(t){var e=i.current;return o(e),function(){l(e)}}}),[t,o,l]),function(e){i.current=e}}({isEnabled:r});return hr(s.Fragment,null,r&&hr("div",{onClick:sn,css:ln}),t((function(e){n(e),i(e)})))}var un={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},gn=function(e){var t=e.name,r=e.onFocus;return hr("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:un,value:"",onChange:function(){}})},dn={clearIndicator:Oa,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var r=e.isDisabled,a=e.isFocused,n=e.theme,i=n.colors,o=n.borderRadius;return je({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:n.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?i.neutral5:i.neutral0,borderColor:r?i.neutral10:a?i.primary:i.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:a?i.primary:i.neutral30}})},dropdownIndicator:wa,group:function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:2*r.baseUnit,paddingTop:2*r.baseUnit}},groupHeading:function(e,t){var r=e.theme,a=r.colors,n=r.spacing;return je({label:"group",cursor:"default",display:"block"},t?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*n.baseUnit,paddingRight:3*n.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var r=e.isDisabled,a=e.theme,n=a.spacing.baseUnit,i=a.colors;return je({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?i.neutral10:i.neutral20,marginBottom:2*n,marginTop:2*n})},input:function(e,t){var r=e.isDisabled,a=e.value,n=e.theme,i=n.spacing,o=n.colors;return je(je({visibility:r?"hidden":"visible",transform:a?"translateZ(0)":""},Ia),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:o.neutral80})},loadingIndicator:function(e,t){var r=e.isFocused,a=e.size,n=e.theme,i=n.colors,o=n.spacing.baseUnit;return je({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?i.neutral60:i.neutral20,padding:2*o})},loadingMessage:ga,menu:function(e,t){var r,a=e.placement,n=e.theme,i=n.borderRadius,s=n.spacing,l=n.colors;return je((o(r={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(a),"100%"),o(r,"position","absolute"),o(r,"width","100%"),o(r,"zIndex",1),r),t?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},menuList:function(e,t){var r=e.maxHeight,a=e.theme.spacing.baseUnit;return je({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:a,paddingTop:a})},menuPortal:function(e){var t=e.rect,r=e.offset,a=e.position;return{left:t.left,position:a,top:r,width:t.width,zIndex:1}},multiValue:function(e,t){var r=e.theme,a=r.spacing,n=r.borderRadius,i=r.colors;return je({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:n/2,margin:a.baseUnit/2})},multiValueLabel:function(e,t){var r=e.theme,a=r.borderRadius,n=r.colors,i=e.cropWithEllipsis;return je({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:a/2,color:n.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var r=e.theme,a=r.spacing,n=r.borderRadius,i=r.colors,o=e.isFocused;return je({alignItems:"center",display:"flex"},t?{}:{borderRadius:n/2,backgroundColor:o?i.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:ua,option:function(e,t){var r=e.isDisabled,a=e.isFocused,n=e.isSelected,i=e.theme,o=i.spacing,s=i.colors;return je({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:n?s.primary:a?s.primary25:"transparent",color:r?s.neutral20:n?s.neutral0:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),":active":{backgroundColor:r?void 0:n?s.primary:s.primary50}})},placeholder:function(e,t){var r=e.theme,a=r.spacing,n=r.colors;return je({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:n.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},singleValue:function(e,t){var r=e.isDisabled,a=e.theme,n=a.spacing,i=a.colors;return je({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?i.neutral40:i.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},valueContainer:function(e,t){var r=e.theme.spacing,a=e.isMulti,n=e.hasValue,i=e.selectProps.controlShouldRenderValue;return je({alignItems:"center",display:a&&n&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(2*r.baseUnit,"px")})}},fn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},pn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Qr(),captureMenuScroll:!Qr(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var r=je({ignoreCase:!0,ignoreAccents:!0,stringify:qa,trim:!0,matchFrom:"any"},undefined),a=r.ignoreCase,n=r.ignoreAccents,i=r.stringify,o=r.trim,s=r.matchFrom,l=o?Wa(t):t,c=o?Wa(i(e)):i(e);return a&&(l=l.toLowerCase(),c=c.toLowerCase()),n&&(l=$a(l),c=Ka(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function vn(e,t,r,a){return{type:"option",data:t,isDisabled:wn(e,t,r),isSelected:On(e,t,r),label:bn(e,t),value:Sn(e,t),index:a}}function hn(e,t){return e.options.map((function(r,a){if("options"in r){var n=r.options.map((function(r,a){return vn(e,r,t,a)})).filter((function(t){return mn(e,t)}));return n.length>0?{type:"group",data:r,options:n,index:a}:void 0}var i=vn(e,r,t,a);return mn(e,i)?i:void 0})).filter(na)}function yn(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Le(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function mn(e,t){var r=e.inputValue,a=void 0===r?"":r,n=t.data,i=t.isSelected,o=t.label,s=t.value;return(!En(e)||!i)&&Cn(e,{label:o,value:s,data:n},a)}var bn=function(e,t){return e.getOptionLabel(t)},Sn=function(e,t){return e.getOptionValue(t)};function wn(e,t,r){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,r)}function On(e,t,r){if(r.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,r);var a=Sn(e,t);return r.some((function(t){return Sn(e,t)===a}))}function Cn(e,t,r){return!e.filterOption||e.filterOption(t,r)}var En=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t},Dn=1,Nn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ue(e,t)}(r,e);var t=function(e){var t=Ke();return function(){var r,a=Ge(e);if(t){var i=Ge(this).constructor;r=Reflect.construct(a,arguments,i)}else r=a.apply(this,arguments);return function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}(r);function r(e){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(a=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.instancePrefix="",a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.controlRef=null,a.getControlRef=function(e){a.controlRef=e},a.focusedOptionRef=null,a.getFocusedOptionRef=function(e){a.focusedOptionRef=e},a.menuListRef=null,a.getMenuListRef=function(e){a.menuListRef=e},a.inputRef=null,a.getInputRef=function(e){a.inputRef=e},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(e,t){var r=a.props,n=r.onChange,i=r.name;t.name=i,a.ariaOnChange(e,t),n(e,t)},a.setValue=function(e,t,r){var n=a.props,i=n.closeMenuOnSelect,o=n.isMulti,s=n.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(a.setState({inputIsHiddenAfterUpdate:!o}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(e,{action:t,option:r})},a.selectOption=function(e){var t=a.props,r=t.blurInputOnSelect,n=t.isMulti,i=t.name,o=a.state.selectValue,s=n&&a.isOptionSelected(e,o),l=a.isOptionDisabled(e,o);if(s){var c=a.getOptionValue(e);a.setValue(o.filter((function(e){return a.getOptionValue(e)!==c})),"deselect-option",e)}else{if(l)return void a.ariaOnChange(e,{action:"select-option",option:e,name:i});n?a.setValue([].concat(Le(o),[e]),"select-option",e):a.setValue(e,"select-option")}r&&a.blurInput()},a.removeValue=function(e){var t=a.props.isMulti,r=a.state.selectValue,n=a.getOptionValue(e),i=r.filter((function(e){return a.getOptionValue(e)!==n})),o=ia(t,i,i[0]||null);a.onChange(o,{action:"remove-value",removedValue:e}),a.focusInput()},a.clearValue=function(){var e=a.state.selectValue;a.onChange(ia(a.props.isMulti,[],null),{action:"clear",removedValues:e})},a.popValue=function(){var e=a.props.isMulti,t=a.state.selectValue,r=t[t.length-1],n=t.slice(0,t.length-1),i=ia(e,n,n[0]||null);a.onChange(i,{action:"pop-value",removedValue:r})},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var e=arguments.length,t=new Array(e),r=0;r5||i>5}},a.onTouchEnd=function(e){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(e.target)&&a.menuListRef&&!a.menuListRef.contains(e.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(e){a.userIsDragging||a.onControlMouseDown(e)},a.onClearIndicatorTouchEnd=function(e){a.userIsDragging||a.onClearIndicatorMouseDown(e)},a.onDropdownIndicatorTouchEnd=function(e){a.userIsDragging||a.onDropdownIndicatorMouseDown(e)},a.handleInputChange=function(e){var t=a.props.inputValue,r=e.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(r,{action:"input-change",prevInputValue:t}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(e){a.props.onFocus&&a.props.onFocus(e),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(e){var t=a.props.inputValue;a.menuListRef&&a.menuListRef.contains(document.activeElement)?a.inputRef.focus():(a.props.onBlur&&a.props.onBlur(e),a.onInputChange("",{action:"input-blur",prevInputValue:t}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1}))},a.onOptionHover=function(e){a.blockOptionHover||a.state.focusedOption===e||a.setState({focusedOption:e})},a.shouldHideSelectedOptions=function(){return En(a.props)},a.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),a.focus()},a.onKeyDown=function(e){var t=a.props,r=t.isMulti,n=t.backspaceRemovesValue,i=t.escapeClearsValue,o=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,g=t.tabSelectsValue,d=t.openMenuOnFocus,f=a.state,p=f.focusedOption,v=f.focusedValue,h=f.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(a.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||o)return;a.focusValue("previous");break;case"ArrowRight":if(!r||o)return;a.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(v)a.removeValue(v);else{if(!n)return;r?a.popValue():s&&a.clearValue()}break;case"Tab":if(a.isComposing)return;if(e.shiftKey||!c||!g||!p||d&&a.isOptionSelected(p,h))return;a.selectOption(p);break;case"Enter":if(229===e.keyCode)break;if(c){if(!p)return;if(a.isComposing)return;a.selectOption(p);break}return;case"Escape":c?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:o}),a.onMenuClose()):s&&i&&a.clearValue();break;case" ":if(o)return;if(!c){a.openMenu("first");break}if(!p)return;a.selectOption(p);break;case"ArrowUp":c?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":c?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!c)return;a.focusOption("pageup");break;case"PageDown":if(!c)return;a.focusOption("pagedown");break;case"Home":if(!c)return;a.focusOption("first");break;case"End":if(!c)return;a.focusOption("last");break;default:return}e.preventDefault()}},a.instancePrefix="react-select-"+(a.props.instanceId||++Dn),a.state.selectValue=Kr(e.value),e.menuIsOpen&&a.state.selectValue.length){var n=a.buildFocusableOptions(),i=n.indexOf(a.state.selectValue[0]);a.state.focusedOption=n[i]}return a}return function(e,t,r){t&&ze(e.prototype,t),r&&ze(e,r),Object.defineProperty(e,"prototype",{writable:!1})}(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Zr(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isDisabled,a=t.menuIsOpen,n=this.state.isFocused;(n&&!r&&e.isDisabled||n&&a&&!e.menuIsOpen)&&this.focusInput(),n&&r&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):n||r||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Zr(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,r=this.state,a=r.selectValue,n=r.isFocused,i=this.buildFocusableOptions(),o="first"===e?0:i.length-1;if(!this.props.isMulti){var s=i.indexOf(a[0]);s>-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(n&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[o]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,r=t.selectValue,a=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var n=r.indexOf(a);a||(n=-1);var i=r.length-1,o=-1;if(r.length){switch(e){case"previous":o=0===n?0:-1===n?i:n-1;break;case"next":n>-1&&n0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,r=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var n=0,i=a.indexOf(r);r||(i=-1),"up"===e?n=i>0?i-1:a.length-1:"down"===e?n=(i+1)%a.length:"pageup"===e?(n=i-t)<0&&(n=0):"pagedown"===e?(n=i+t)>a.length-1&&(n=a.length-1):"last"===e&&(n=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[n],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(fn):je(je({},fn),this.props.theme):fn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,r=this.getStyles,a=this.getClassNames,n=this.getValue,i=this.selectOption,o=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:r,getClassNames:a,getValue:n,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:i,selectProps:s,setValue:o,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,r=e.isMulti;return void 0===t?r:t}},{key:"isOptionDisabled",value:function(e,t){return wn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return On(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Cn(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var r=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:r,selectValue:a})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,r=e.isSearchable,a=e.inputId,n=e.inputValue,i=e.tabIndex,o=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,g=this.state,d=g.inputIsHidden,f=g.ariaSelection,p=this.commonProps,v=a||this.getElementId("input"),h=je(je(je({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox"},l&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!r&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return r?s.createElement(u,He({},p,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:o,type:"text",value:n},h)):s.createElement(Ja,He({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:zr,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:o,value:""},h))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),r=t.MultiValue,a=t.MultiValueContainer,n=t.MultiValueLabel,i=t.MultiValueRemove,o=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,g=u.controlShouldRenderValue,d=u.isDisabled,f=u.isMulti,p=u.inputValue,v=u.placeholder,h=this.state,y=h.selectValue,m=h.focusedValue,b=h.isFocused;if(!this.hasValue()||!g)return p?null:s.createElement(l,He({},c,{key:"placeholder",isDisabled:d,isFocused:b,innerProps:{id:this.getElementId("placeholder")}}),v);if(f)return y.map((function(t,o){var l=t===m,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return s.createElement(r,He({},c,{components:{Container:a,Label:n,Remove:i},isFocused:l,isDisabled:d,key:u,index:o,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(p)return null;var S=y[0];return s.createElement(o,He({},c,{data:S,isDisabled:d}),this.formatOptionLabel(S,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,r=this.props,a=r.isDisabled,n=r.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||a||!this.hasValue()||n)return null;var o={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return s.createElement(e,He({},t,{innerProps:o,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,r=this.props,a=r.isDisabled,n=r.isLoading,i=this.state.isFocused;return e&&n?s.createElement(e,He({},t,{innerProps:{"aria-hidden":"true"},isDisabled:a,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,r=e.IndicatorSeparator;if(!t||!r)return null;var a=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused;return s.createElement(r,He({},a,{isDisabled:n,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,r=this.props.isDisabled,a=this.state.isFocused,n={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return s.createElement(e,He({},t,{innerProps:n,isDisabled:r,isFocused:a}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),r=t.Group,a=t.GroupHeading,n=t.Menu,i=t.MenuList,o=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,g=this.commonProps,d=this.state.focusedOption,f=this.props,p=f.captureMenuScroll,v=f.inputValue,h=f.isLoading,y=f.loadingMessage,m=f.minMenuHeight,b=f.maxMenuHeight,S=f.menuIsOpen,w=f.menuPlacement,O=f.menuPosition,C=f.menuPortalTarget,E=f.menuShouldBlockScroll,D=f.menuShouldScrollIntoView,N=f.noOptionsMessage,x=f.onMenuScrollToTop,T=f.onMenuScrollToBottom;if(!S)return null;var I,M=function(t,r){var a=t.type,n=t.data,i=t.isDisabled,o=t.isSelected,l=t.label,c=t.value,f=d===n,p=i?void 0:function(){return e.onOptionHover(n)},v=i?void 0:function(){return e.selectOption(n)},h="".concat(e.getElementId("option"),"-").concat(r),y={id:h,onClick:v,onMouseMove:p,onMouseOver:p,tabIndex:-1};return s.createElement(u,He({},g,{innerProps:y,data:n,isDisabled:i,isSelected:o,key:h,label:l,type:a,value:c,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())I=this.getCategorizedOptions().map((function(t){if("group"===t.type){var n=t.data,i=t.options,o=t.index,l="".concat(e.getElementId("group"),"-").concat(o),c="".concat(l,"-heading");return s.createElement(r,He({},g,{key:l,data:n,options:i,Heading:a,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return M(e,"".concat(o,"-").concat(e.index))})))}if("option"===t.type)return M(t,"".concat(t.index))}));else if(h){var k=y({inputValue:v});if(null===k)return null;I=s.createElement(l,g,k)}else{var P=N({inputValue:v});if(null===P)return null;I=s.createElement(c,g,P)}var _={minMenuHeight:m,maxMenuHeight:b,menuPlacement:w,menuPosition:O,menuShouldScrollIntoView:D},R=s.createElement(la,He({},g,_),(function(t){var r=t.ref,a=t.placerProps,o=a.placement,l=a.maxHeight;return s.createElement(n,He({},g,_,{innerRef:r,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:h,placement:o}),s.createElement(cn,{captureEnabled:p,onTopArrive:x,onBottomArrive:T,lockEnabled:E},(function(t){return s.createElement(i,He({},g,{innerRef:function(r){e.getMenuListRef(r),t(r)},isLoading:h,maxHeight:l,focusedOption:d}),I)})))}));return C||"fixed"===O?s.createElement(o,He({},g,{appendTo:C,controlElement:this.controlRef,menuPlacement:w,menuPosition:O}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,r=t.delimiter,a=t.isDisabled,n=t.isMulti,i=t.name,o=t.required,l=this.state.selectValue;if(o&&!this.hasValue()&&!a)return s.createElement(gn,{name:i,onFocus:this.onValueInputFocus});if(i&&!a){if(n){if(r){var c=l.map((function(t){return e.getOptionValue(t)})).join(r);return s.createElement("input",{name:i,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,r){return s.createElement("input",{key:"i-".concat(r),name:i,type:"hidden",value:e.getOptionValue(t)})})):s.createElement("input",{name:i,type:"hidden",value:""});return s.createElement("div",null,u)}var g=l[0]?this.getOptionValue(l[0]):"";return s.createElement("input",{name:i,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,r=t.ariaSelection,a=t.focusedOption,n=t.focusedValue,i=t.isFocused,o=t.selectValue,l=this.getFocusableOptions();return s.createElement(ja,He({},e,{id:this.getElementId("live-region"),ariaSelection:r,focusedOption:a,focusedValue:n,isFocused:i,selectValue:o,focusableOptions:l}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,r=e.IndicatorsContainer,a=e.SelectContainer,n=e.ValueContainer,i=this.props,o=i.className,l=i.id,c=i.isDisabled,u=i.menuIsOpen,g=this.state.isFocused,d=this.commonProps=this.getCommonProps();return s.createElement(a,He({},d,{className:o,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:g}),this.renderLiveRegion(),s.createElement(t,He({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:g,menuIsOpen:u}),s.createElement(n,He({},d,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),s.createElement(r,He({},d,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=t.prevProps,a=t.clearFocusValueOnUpdate,n=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,o=t.isFocused,s=t.prevWasFocused,l=e.options,c=e.value,u=e.menuIsOpen,g=e.inputValue,d=e.isMulti,f=Kr(c),p={};if(r&&(c!==r.value||l!==r.options||u!==r.menuIsOpen||g!==r.inputValue)){var v=u?function(e,t){return yn(hn(e,t))}(e,f):[],h=a?function(e,t){var r=e.focusedValue,a=e.selectValue.indexOf(r);if(a>-1){if(t.indexOf(r)>-1)return r;if(a-1?r:t[0]}(t,v);p={selectValue:f,focusedOption:y,focusedValue:h,clearFocusValueOnUpdate:!1}}var m=null!=n&&e!==r?{inputIsHidden:n,inputIsHiddenAfterUpdate:void 0}:{},b=i,S=o&&s;return o&&!S&&(b={value:ia(d,f,f[0]||null),options:f,action:"initial-input-focus"},S=!s),"initial-input-focus"===(null==i?void 0:i.action)&&(b=null),je(je(je({},p),m),{},{prevProps:e,ariaSelection:b,prevWasFocused:S})}}]),r}(s.Component);Nn.defaultProps=pn;var xn=(0,s.forwardRef)((function(e,t){var r=function(e){var t=e.defaultInputValue,r=void 0===t?"":t,a=e.defaultMenuIsOpen,n=void 0!==a&&a,i=e.defaultValue,o=void 0===i?null:i,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,g=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,p=e.value,v=Be(e,Ve),h=y((0,s.useState)(void 0!==l?l:r),2),m=h[0],b=h[1],S=y((0,s.useState)(void 0!==c?c:n),2),w=S[0],O=S[1],C=y((0,s.useState)(void 0!==p?p:o),2),E=C[0],D=C[1],N=(0,s.useCallback)((function(e,t){"function"==typeof u&&u(e,t),D(e)}),[u]),x=(0,s.useCallback)((function(e,t){var r;"function"==typeof g&&(r=g(e,t)),b(void 0!==r?r:e)}),[g]),T=(0,s.useCallback)((function(){"function"==typeof f&&f(),O(!0)}),[f]),I=(0,s.useCallback)((function(){"function"==typeof d&&d(),O(!1)}),[d]),M=void 0!==l?l:m,k=void 0!==c?c:w,P=void 0!==p?p:E;return je(je({},v),{},{inputValue:M,menuIsOpen:k,onChange:N,onInputChange:x,onMenuClose:I,onMenuOpen:T,value:P})}(e);return s.createElement(Nn,He({ref:t},r))})),Tn=xn;function In(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Mn(e){for(var t=1;t0&&a.forEach((function(e){r.push({value:e.name,label:e.name})})),t.length>0&&t.forEach((function(e,a){r.push({value:t[a].fontFamily,label:t[a].fontFamily})})),r),onChange:function(e){o("fontFamily",e,n)}})};function qn(e,t){var r=[{value:"",label:(0,m.__)("Default","generatepress")},{value:"normal",label:(0,m.__)("Normal","generatepress")},{value:"bold",label:(0,m.__)("Bold","generatepress")},{value:"100",label:"100"},{value:"200",label:"200"},{value:"300",label:"300"},{value:"400",label:"400"},{value:"500",label:"500"},{value:"600",label:"600"},{value:"700",label:"700"},{value:"800",label:"800"},{value:"900",label:"900"}];return void 0!==Ae[e]&&"undefined"!==t.googleFontVariants&&(r=[{value:"",label:(0,m.__)("Default","generatepress")},{value:"normal",label:(0,m.__)("Normal","generatepress")},{value:"bold",label:(0,m.__)("Bold","generatepress")}],t.filter((function(t){return t.fontFamily===e})).forEach((function(e){var t=(e.googleFontVariants?e.googleFontVariants:"").replaceAll(" ","");(t=t.split(",")).filter((function(e){var t=e.match(/[a-z]/g),r=e.match(/[0-9]/g);return!(t&&r||"italic"===e||"regular"===e||""===e)})).forEach((function(e){r.push({value:e,label:e})}))}))),r}var Yn=function(e){var t=e.index,r=e.value,a=e.fontFamily,n=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Font Weight","generatepress"),value:r,options:qn(a,Hn()),onChange:function(e){n("fontWeight",e,t)}})},Jn=function(e){var t=e.index,r=e.value,a=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Text Transform","generatepress"),value:r,options:[{value:"",label:(0,m.__)("Default","generatepress")},{value:"uppercase",label:(0,m.__)("Uppercase","generatepress")},{value:"lowercase",label:(0,m.__)("Lowercase","generatepress")},{value:"capitalize",label:(0,m.__)("Capitalize","generatepress")},{value:"initial",label:(0,m.__)("Normal","generatepress")}],onChange:function(e){a("textTransform",e,t)}})},Xn=function(e){var t=e.index,r=e.value,a=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Font Style","generatepress"),value:r,options:[{value:"",label:(0,m.__)("Default","generatepress")},{value:"normal",label:(0,m.__)("Normal","generatepress")},{value:"italic",label:(0,m.__)("Italic","generatepress")},{value:"oblique",label:(0,m.__)("Oblique","generatepress")},{value:"initial",label:(0,m.__)("Initial","generatepress")}],onChange:function(e){a("fontStyle",e,t)}})},Zn=function(e){var t=y((0,l.useState)("desktop"),2),r=(t[0],t[1]),a=e.label,n=e.devices,i=e.onClick,o=void 0===i?function(){return null}:i;return(0,s.createElement)("div",{className:"components-generate-units-control-header__units"},(0,s.createElement)("div",{className:"components-generate-units-control-label__units"},a),(0,s.createElement)("div",{className:"components-generate-control__units"},(0,s.createElement)(u.ButtonGroup,{className:"components-generate-control-buttons__units","aria-label":(0,m.__)("Select Units","generatepress")},n.map((function(e){var t=(0,m.__)("Desktop","generatepress");return"tablet"===e&&(t=(0,m.__)("Tablet","generatepress")),"mobile"===e&&(t=(0,m.__)("Mobile","generatepress")),(0,s.createElement)(u.Tooltip +!function(){var e,t={13:function(e,t,r){"use strict";var a={};function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,"string");if("object"!=n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}function o(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.r(a),r.d(a,{FILE:function(){return Ko},HTML:function(){return qo},TEXT:function(){return Wo},URL:function(){return $o}});var s=r(609),l=window.wp.element;function c(e,t){void 0!==l.createRoot?(0,l.createRoot)(t).render(e):(0,l.render)(e,t)}var u=window.wp.components;function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function d(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return wp.customize.Control.extend(Object.assign({},{ready:function(){},embed:function(){var e=this,t=e.section();t&&wp.customize.section(t,(function(t){t.expanded.bind((function(t){t&&e.actuallyEmbed()}))}))},actuallyEmbed:function(){var e=this;"resolved"!==e.deferred.embedded.state()&&(e.renderContent(),e.deferred.embedded.resolve())},initialize:function(e,t){var r=this;r.setNotificationContainer=r.setNotificationContainer.bind(r),wp.customize.Control.prototype.initialize.call(r,e,t),wp.customize.control.bind("removed",(function e(t){r===t&&(r.destroy(),r.container.remove(),wp.customize.control.unbind("removed",e))}))},setNotificationContainer:function(e){this.notifications.container=jQuery(e),this.notifications.render()},getWrapper:function(){var e=this,t=e.container[0];if(e.params.choices.wrapper){var r=document.getElementById(e.params.choices.wrapper+"--wrapper");r&&(t=r,e.container.hide())}return t},renderContent:function(){var t=this,r=t.setting.get();c((0,s.createElement)(u.SlotFillProvider,null,(0,s.createElement)(e,d(d({},t.params),{},{value:r,setNotificationContainer:t.setNotificationContainer,customizerSetting:t.setting,control:t,choices:t.params.choices,default:t.params.defaultValue})),(0,s.createElement)(u.Popover.Slot,null)),t.getWrapper())},destroy:function(){(0,l.unmountComponentAtNode)(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}},t))}},p=f;function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r=0||(n[r]=e[r]);return n}function O(e){var t=(0,s.useRef)(e),r=(0,s.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,r.current}var C=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e0:e.buttons>0)&&n.current?i(N(n.current,e,l.current)):r(!1)},t=function(){return r(!1)};function r(r){var a=c.current,i=D(n.current),o=r?i.addEventListener:i.removeEventListener;o(a?"touchmove":"mousemove",e),o(a?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,a=n.current;if(a&&(x(t),!function(e,t){return t&&!E(e)}(t,c.current)&&a)){if(E(t)){c.current=!0;var o=t.changedTouches||[];o.length&&(l.current=o[0].identifier)}a.focus(),i(N(a,t,l.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),o({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]}),[o,i]),g=u[0],d=u[1],f=u[2];return(0,s.useEffect)((function(){return f}),[f]),s.createElement("div",S({},a,{onTouchStart:g,onMouseDown:g,className:"react-colorful__interactive",ref:n,onKeyDown:d,tabIndex:0,role:"slider"}))})),I=function(e){return e.filter(Boolean).join(" ")},M=function(e){var t=e.color,r=e.left,a=e.top,n=void 0===a?.5:a,i=I(["react-colorful__pointer",e.className]);return s.createElement("div",{className:i,style:{top:100*n+"%",left:100*r+"%"}},s.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},P=(Math.PI,function(e){var t=e.s,r=e.v,a=e.a,n=(200-t)*r/100;return{h:k(e.h),s:k(n>0&&n<200?t*r/100/(n<=100?n:200-n)*100:0),l:k(n/2),a:k(a,2)}}),_=function(e){var t=P(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},R=function(e){var t=P(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},L=function(e){var t=e.h,r=e.s,a=e.v,n=e.a;t=t/360*6,r/=100,a/=100;var i=Math.floor(t),o=a*(1-r),s=a*(1-(t-i)*r),l=a*(1-(1-t+i)*r),c=i%6;return{r:k(255*[a,s,o,o,l,a][c]),g:k(255*[l,a,a,s,o,o][c]),b:k(255*[o,o,l,a,a,s][c]),a:k(n,2)}},A=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?j({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},F=A,j=function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=Math.max(t,r,a),o=i-Math.min(t,r,a),s=o?i===t?(r-a)/o:i===r?2+(a-t)/o:4+(t-r)/o:0;return{h:k(60*(s<0?s+6:s)),s:k(i?o/i*100:0),v:k(i/255*100),a:n}},V=s.memo((function(e){var t=e.hue,r=e.onChange,a=I(["react-colorful__hue",e.className]);return s.createElement("div",{className:a},s.createElement(T,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:C(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":k(t),"aria-valuemax":"360","aria-valuemin":"0"},s.createElement(M,{className:"react-colorful__hue-pointer",left:t/360,color:_({h:t,s:100,v:100,a:1})})))})),B=s.memo((function(e){var t=e.hsva,r=e.onChange,a={backgroundColor:_({h:t.h,s:100,v:100,a:1})};return s.createElement("div",{className:"react-colorful__saturation",style:a},s.createElement(T,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:C(t.s+100*e.left,0,100),v:C(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+k(t.s)+"%, Brightness "+k(t.v)+"%"},s.createElement(M,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:_(t)})))})),H=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function z(e,t,r){var a=O(r),n=(0,s.useState)((function(){return e.toHsva(t)})),i=n[0],o=n[1],l=(0,s.useRef)({color:t,hsva:i});(0,s.useEffect)((function(){if(!e.equal(t,l.current.color)){var r=e.toHsva(t);l.current={hsva:r,color:t},o(r)}}),[t,e]),(0,s.useEffect)((function(){var t;(function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0})(i,l.current.hsva)||e.equal(t=e.fromHsva(i),l.current.color)||(l.current={hsva:i,color:t},a(t))}),[i,e,a]);var c=(0,s.useCallback)((function(e){o((function(t){return Object.assign({},t,e)}))}),[]);return[i,c]}var U="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,G=new Map,K=function(e){U((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!G.has(t)){var a=t.createElement("style");a.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',G.set(t,a);var n=r.nc;n&&a.setAttribute("nonce",n),t.head.appendChild(a)}}),[])},$=function(e){var t=e.className,r=e.colorModel,a=e.color,n=void 0===a?r.defaultColor:a,i=e.onChange,o=w(e,["className","colorModel","color","onChange"]),l=(0,s.useRef)(null);K(l);var c=z(r,n,i),u=c[0],g=c[1],d=I(["react-colorful",t]);return s.createElement("div",S({},o,{ref:l,className:d}),s.createElement(B,{hsva:u,onChange:g}),s.createElement(V,{hue:u.h,onChange:g,className:"react-colorful__last-control"}))},W=function(e){var t=e.className,r=e.hsva,a=e.onChange,n={backgroundImage:"linear-gradient(90deg, "+R(Object.assign({},r,{a:0}))+", "+R(Object.assign({},r,{a:1}))+")"},i=I(["react-colorful__alpha",t]),o=k(100*r.a);return s.createElement("div",{className:i},s.createElement("div",{className:"react-colorful__alpha-gradient",style:n}),s.createElement(T,{onMove:function(e){a({a:e.left})},onKey:function(e){a({a:C(r.a+e.left)})},"aria-label":"Alpha","aria-valuetext":o+"%","aria-valuenow":o,"aria-valuemin":"0","aria-valuemax":"100"},s.createElement(M,{className:"react-colorful__alpha-pointer",left:r.a,color:R(r)})))},q=function(e){var t=e.className,r=e.colorModel,a=e.color,n=void 0===a?r.defaultColor:a,i=e.onChange,o=w(e,["className","colorModel","color","onChange"]),l=(0,s.useRef)(null);K(l);var c=z(r,n,i),u=c[0],g=c[1],d=I(["react-colorful",t]);return s.createElement("div",S({},o,{ref:l,className:d}),s.createElement(B,{hsva:u,onChange:g}),s.createElement(V,{hue:u.h,onChange:g}),s.createElement(W,{hsva:u,onChange:g,className:"react-colorful__last-control"}))},Y={defaultColor:"rgba(0, 0, 0, 1)",toHsva:A,fromHsva:function(e){var t=L(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:H},J=function(e){return s.createElement(q,S({},e,{colorModel:Y}))},X={defaultColor:"rgb(0, 0, 0)",toHsva:F,fromHsva:function(e){var t=L(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:H},Z=function(e){return s.createElement($,S({},e,{colorModel:X}))},Q={grad:.9,turn:360,rad:360/(2*Math.PI)},ee=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},te=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},re=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},ae=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ne=function(e){return{r:re(e.r,0,255),g:re(e.g,0,255),b:re(e.b,0,255),a:re(e.a)}},ie=function(e){return{r:te(e.r),g:te(e.g),b:te(e.b),a:te(e.a,3)}},oe=/^#([0-9a-f]{3,8})$/i,se=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},le=function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=Math.max(t,r,a),o=i-Math.min(t,r,a),s=o?i===t?(r-a)/o:i===r?2+(a-t)/o:4+(t-r)/o:0;return{h:60*(s<0?s+6:s),s:i?o/i*100:0,v:i/255*100,a:n}},ce=function(e){var t=e.h,r=e.s,a=e.v,n=e.a;t=t/360*6,r/=100,a/=100;var i=Math.floor(t),o=a*(1-r),s=a*(1-(t-i)*r),l=a*(1-(1-t+i)*r),c=i%6;return{r:255*[a,s,o,o,l,a][c],g:255*[l,a,a,s,o,o][c],b:255*[o,o,l,a,a,s][c],a:n}},ue=function(e){return{h:ae(e.h),s:re(e.s,0,100),l:re(e.l,0,100),a:re(e.a)}},ge=function(e){return{h:te(e.h),s:te(e.s),l:te(e.l),a:te(e.a,3)}},de=function(e){return ce((r=(t=e).s,{h:t.h,s:(r*=((a=t.l)<50?a:100-a)/100)>0?2*r/(a+r)*100:0,v:a+r,a:t.a}));var t,r,a},fe=function(e){return{h:(t=le(e)).h,s:(n=(200-(r=t.s))*(a=t.v)/100)>0&&n<200?r*a/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,r,a,n},pe=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ve=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,he=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ye=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,me={string:[[function(e){var t=oe.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?te(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?te(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=he.exec(e)||ye.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ne({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=pe.exec(e)||ve.exec(e);if(!t)return null;var r,a,n=ue({h:(r=t[1],a=t[2],void 0===a&&(a="deg"),Number(r)*(Q[a]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return de(n)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,a=e.b,n=e.a,i=void 0===n?1:n;return ee(t)&&ee(r)&&ee(a)?ne({r:Number(t),g:Number(r),b:Number(a),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,r=e.s,a=e.l,n=e.a,i=void 0===n?1:n;if(!ee(t)||!ee(r)||!ee(a))return null;var o=ue({h:Number(t),s:Number(r),l:Number(a),a:Number(i)});return de(o)},"hsl"],[function(e){var t=e.h,r=e.s,a=e.v,n=e.a,i=void 0===n?1:n;if(!ee(t)||!ee(r)||!ee(a))return null;var o=function(e){return{h:ae(e.h),s:re(e.s,0,100),v:re(e.v,0,100),a:re(e.a)}}({h:Number(t),s:Number(r),v:Number(a),a:Number(i)});return ce(o)},"hsv"]]},be=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=ie(this.rgba)).r,r=e.g,a=e.b,i=(n=e.a)<1?se(te(255*n)):"","#"+se(t)+se(r)+se(a)+i;var e,t,r,a,n,i},e.prototype.toRgb=function(){return ie(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ie(this.rgba)).r,r=e.g,a=e.b,(n=e.a)<1?"rgba("+t+", "+r+", "+a+", "+n+")":"rgb("+t+", "+r+", "+a+")";var e,t,r,a,n},e.prototype.toHsl=function(){return ge(fe(this.rgba))},e.prototype.toHslString=function(){return t=(e=ge(fe(this.rgba))).h,r=e.s,a=e.l,(n=e.a)<1?"hsla("+t+", "+r+"%, "+a+"%, "+n+")":"hsl("+t+", "+r+"%, "+a+"%)";var e,t,r,a,n},e.prototype.toHsv=function(){return e=le(this.rgba),{h:te(e.h),s:te(e.s),v:te(e.v),a:te(e.a,3)};var e},e.prototype.invert=function(){return Ee({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),Ee(Se(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Ee(Se(this.rgba,-e))},e.prototype.grayscale=function(){return Ee(Se(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Ee(Oe(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Ee(Oe(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?Ee({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):te(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=fe(this.rgba);return"number"==typeof e?Ee({h:e,s:t.s,l:t.l,a:t.a}):te(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Ee(e).toHex()},e}(),Ee=function(e){return e instanceof Ce?e:new Ce(e)};function De(e,t,r){var a=this,n=(0,s.useRef)(null),i=(0,s.useRef)(0),o=(0,s.useRef)(null),l=(0,s.useRef)([]),c=(0,s.useRef)(),u=(0,s.useRef)(),g=(0,s.useRef)(e),d=(0,s.useRef)(!0);(0,s.useEffect)((function(){g.current=e}),[e]);var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var p=!!(r=r||{}).leading,v=!("trailing"in r)||!!r.trailing,h="maxWait"in r,y=h?Math.max(+r.maxWait||0,t):null;(0,s.useEffect)((function(){return d.current=!0,function(){d.current=!1}}),[]);var m=(0,s.useMemo)((function(){var e=function(e){var t=l.current,r=c.current;return l.current=c.current=null,i.current=e,u.current=g.current.apply(r,t)},r=function(e,t){f&&cancelAnimationFrame(o.current),o.current=f?requestAnimationFrame(e):setTimeout(e,t)},s=function(e){if(!d.current)return!1;var r=e-n.current;return!n.current||r>=t||r<0||h&&e-i.current>=y},m=function(t){return o.current=null,v&&l.current?e(t):(l.current=c.current=null,u.current)},b=function e(){var a=Date.now();if(s(a))return m(a);if(d.current){var o=t-(a-n.current),l=h?Math.min(o,y-(a-i.current)):o;r(e,l)}},S=function(){var g=Date.now(),f=s(g);if(l.current=[].slice.call(arguments),c.current=a,n.current=g,f){if(!o.current&&d.current)return i.current=n.current,r(b,t),p?e(n.current):u.current;if(h)return r(b,t),e(n.current)}return o.current||r(b,t),u.current};return S.cancel=function(){o.current&&(f?cancelAnimationFrame(o.current):clearTimeout(o.current)),i.current=0,l.current=n.current=c.current=o.current=null},S.isPending=function(){return!!o.current},S.flush=function(){return o.current?m(Date.now()):u.current},S}),[p,h,t,y,v,f]);return m}function Ne(e){var t=e.value,r=e.showAlpha,a=e.onChange,n=r?J:Z,i=(0,l.useMemo)((function(){return function(e){if(String(e).startsWith("var(")){var t=e.match(/\(([^)]+)\)/);if(t){var r=getComputedStyle(document.documentElement).getPropertyValue(t[1]);r&&(e=r)}}return Ee(e).toRgbString()}(t)}),[t]),o=De(a,100);return(0,s.createElement)(n,{color:i,onChange:function(e){Ee(e).isValid()&&(e=1===Ee(e).alpha()?Ee(e).toHex():e),o(e)}})}function xe(e){return"info"===e?(0,s.createElement)("svg",{width:"1em",height:"1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024","aria-hidden":"true"},(0,s.createElement)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}),(0,s.createElement)("path",{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"})):"x"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M18 6L6 18M6 6l12 12"})):"ellipsis"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)("rect",{x:"0",fill:"none",width:"20",height:"20"}),(0,s.createElement)("g",null,(0,s.createElement)("path",{d:"M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))):"mobile"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20","aria-hidden":"true",width:"1em",height:"1em"},(0,s.createElement)("path",{d:"M6 2h8c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H6c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm7 12V4H7v10h6zM8 5h4l-4 5V5z",fill:"currentColor"})):"tablet"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20","aria-hidden":"true",width:"1em",height:"1em"},(0,s.createElement)("path",{d:"M4 2h12c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm11 14V4H5v12h10zM6 5h6l-6 5V5z",fill:"currentColor"})):"desktop"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20","aria-hidden":"true",width:"1em",height:"1em"},(0,s.createElement)("path",{d:"M3 2h14c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1h-5v2h2c.55 0 1 .45 1 1v1H5v-1c0-.55.45-1 1-1h2v-2H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm13 9V4H4v7h12zM5 5h9L5 9V5z",fill:"currentColor"})):"dash"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M4.5 12.75a.75.75 0 01.75-.75h13.5a.75.75 0 010 1.5H5.25a.75.75 0 01-.75-.75z",fill:"currentColor"})):"plus"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M12 5v14M5 12h14"})):"lock"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,s.createElement)("path",{d:"M7 11V7a5 5 0 0110 0v4"})):"unlock"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,s.createElement)("path",{d:"M7 11V7a5 5 0 019.9-1"})):"chevron-down"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M6 9l6 6 6-6"})):"chevron-up"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M18 15l-6-6-6 6"})):"chevron-right"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M9 18l6-6-6-6"})):"trash"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",style:{fill:"none"},stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2M10 11v6M14 11v6"})):"reorder"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{d:"m5 9-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20"})):"check"===e?(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24"},(0,s.createElement)("path",{fill:"none",d:"M20 6 9 17l-5-5"})):void 0}function Te(e){var t=e.value,r=e.onChange,a=e.onBlur,n=e.onEnable,i=e.isDisabled,o=e.helpText;return(0,s.createElement)("div",{className:"generate-color-input--css-var-name-wrapper"},(0,s.createElement)(u.TextControl,{label:(0,m.__)("CSS Variable Name","generatepress"),disabled:i,help:o,type:"text",value:t,onChange:r,onBlur:a}),i&&(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Changing this name will remove its color from elements already using it.","generatepress")},(0,s.createElement)(u.Button,{onClick:function(){window.alert((0,m.__)("Changing this name will break styles that are using it to define its color.","generatepress")),n(),setTimeout((function(){document.querySelector(".generate-color-input--css-var-name-wrapper input").focus()}),10)}},xe("unlock"))))}var Ie=function(e){return/^([0-9A-F]{3}){1,2}$/i.test(e)};function Me(e){var t=e.value,r=e.onChange,a=e.showReset,n=void 0!==a&&a,i=e.onClickReset;return(0,s.createElement)("div",{className:"generate-color-input-wrapper"},(0,s.createElement)(u.TextControl,{id:"generate-color-input-field",className:"generate-color-input",type:"text",value:t||"",onChange:function(e){!e.startsWith("#")&&Ie(e)&&(e="#"+e),r(e)}}),n&&(0,s.createElement)(u.Button,{isSmall:!0,isSecondary:!0,className:"components-color-clear-color",onClick:i},(0,m.__)("Default","generatepress")))}function ke(e){var t=e.value,r=e.onChange,a=generateCustomizerControls.palette,n=window.sessionStorage.getItem("generateGlobalColors");return n&&(a=JSON.parse(n)),(0,s.createElement)(u.BaseControl,{className:"generate-component-color-picker-palette"},(0,s.createElement)(u.ColorPalette,{colors:a,value:t,onChange:function(e){void 0===e&&(e=""),r(e),setTimeout((function(){document.querySelector(".generate-color-input-wrapper input").focus()}),10)},disableCustomColors:!0,clearable:!1}))}function Pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _e(e){var t=e.value,r=e.variableName,a=e.label,n=e.tooltipText,i=e.tooltipPosition,c=e.showAlpha,g=e.showReset,d=e.showVariableName,f=e.showPalette,p=e.variableNameIsDisabled,v=e.variableNameHelpText,h=e.onChange,m=void 0===h?function(){return!1}:h,S=e.onClosePanel,w=void 0===S?function(){return!1}:S,O=e.onChangeVariableName,C=void 0===O?function(){return!1}:O,E=e.onBlurVariableName,D=void 0===E?function(){return!1}:E,N=e.onEnableVariableName,x=void 0===N?function(){return!1}:N,T=e.onClickReset,I=void 0===T?function(){return!1}:T,M=y((0,l.useState)(!1),2),k=M[0],P=M[1],_=(0,l.useCallback)((function(){P(!0)})),R=De((0,l.useCallback)((function(){P(!1),w()})),100),L={};return generateCustomizerControls.colorPickerShouldShift&&(L.shift=!0),(0,s.createElement)("div",{className:"generate-color-picker-area"},(0,s.createElement)(b,{color:t||"transparent",tooltip:n,tooltipPosition:i,ariaExpanded:k,onClick:k?R:_}),k&&(0,s.createElement)(u.Popover,function(e){for(var t=1;t=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var Be=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?Qe(ct,--st):0,it--,10===lt&&(it=1,nt--),lt}function ft(){return lt=st2||yt(lt)>3?"":" "}function Ot(e,t){for(;--t&&ft()&&!(lt<48||lt>102||lt>57&<<65||lt>70&<<97););return ht(e,vt()+(t<6&&32==pt()&&32==ft()))}function Ct(e){for(;ft();)switch(lt){case e:return st;case 34:case 39:34!==e&&39!==e&&Ct(lt);break;case 40:41===e&&Ct(e);break;case 92:ft()}return st}function Et(e,t){for(;ft()&&e+lt!==57&&(e+lt!==84||47!==pt()););return"/*"+ht(t,st-1)+"*"+qe(47===e?e:ft())}function Dt(e){for(;!yt(pt());)ft();return ht(e,st)}var Nt="-ms-",xt="-moz-",Tt="-webkit-",It="comm",Mt="rule",kt="decl",Pt="@keyframes";function _t(e,t){for(var r="",a=rt(e),n=0;n0&&tt(C)-g&&at(f>32?Vt(C+";",a,r,g-1):Vt(Xe(C," ","")+";",a,r,g-2),l);break;case 59:C+=";";default:if(at(O=Ft(C,t,r,c,u,n,s,b,S=[],w=[],g),i),123===m)if(0===u)At(C,t,O,O,S,i,g,s,w);else switch(99===d&&110===Qe(C,3)?100:d){case 100:case 108:case 109:case 115:At(e,O,O,a&&at(Ft(e,O,O,0,0,n,s,b,n,S=[],g),w),n,w,g,s,a?S:w);break;default:At(C,O,O,O,[""],w,0,s,w)}}c=u=f=0,v=y=1,b=C="",g=o;break;case 58:g=1+tt(C),f=p;default:if(v<1)if(123==m)--v;else if(125==m&&0==v++&&125==dt())continue;switch(C+=qe(m),m*v){case 38:y=u>0?1:(C+="\f",-1);break;case 44:s[c++]=(tt(C)-1)*y,y=1;break;case 64:45===pt()&&(C+=St(ft())),d=pt(),u=g=tt(b=C+=Dt(vt())),m++;break;case 45:45===p&&2==tt(C)&&(v=0)}}return i}function Ft(e,t,r,a,n,i,o,s,l,c,u){for(var g=n-1,d=0===n?i:[""],f=rt(d),p=0,v=0,h=0;p0?d[y]+" "+m:Xe(m,/&\f/g,d[y])))&&(l[h++]=b);return ut(e,t,r,0===n?Mt:s,l,c,u)}function jt(e,t,r){return ut(e,t,r,It,qe(lt),et(e,2,-2),0)}function Vt(e,t,r,a){return ut(e,t,r,kt,et(e,0,a),et(e,a+1,-1),a)}var Bt=function(e,t,r){for(var a=0,n=0;a=n,n=pt(),38===a&&12===n&&(t[r]=1),!yt(n);)ft();return ht(e,st)},Ht=new WeakMap,zt=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,a=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ht.get(r))&&!a){Ht.set(e,!0);for(var n=[],i=function(e,t){return bt(function(e,t){var r=-1,a=44;do{switch(yt(a)){case 0:38===a&&12===pt()&&(t[r]=1),e[r]+=Bt(st-1,t,r);break;case 2:e[r]+=St(a);break;case 4:if(44===a){e[++r]=58===pt()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=qe(a)}}while(a=ft());return e}(mt(e),t))}(t,n),o=r.props,s=0,l=0;s6)switch(Qe(e,t+1)){case 109:if(45!==Qe(e,t+4))break;case 102:return Xe(e,/(.+:)(.+)-([^]+)/,"$1"+Tt+"$2-$3$1"+xt+(108==Qe(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ze(e,"stretch")?Gt(Xe(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Qe(e,t+1))break;case 6444:switch(Qe(e,tt(e)-3-(~Ze(e,"!important")&&10))){case 107:return Xe(e,":",":"+Tt)+e;case 101:return Xe(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Tt+(45===Qe(e,14)?"inline-":"")+"box$3$1"+Tt+"$2$3$1"+Nt+"$2box$3")+e}break;case 5936:switch(Qe(e,t+11)){case 114:return Tt+e+Nt+Xe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Tt+e+Nt+Xe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Tt+e+Nt+Xe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Tt+e+Nt+e+e}return e}var Kt=[function(e,t,r,a){if(e.length>-1&&!e.return)switch(e.type){case kt:e.return=Gt(e.value,e.length);break;case Pt:return _t([gt(e,{value:Xe(e.value,"@","@"+Tt)})],a);case Mt:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return _t([gt(e,{props:[Xe(t,/:(read-\w+)/,":-moz-$1")]})],a);case"::placeholder":return _t([gt(e,{props:[Xe(t,/:(plac\w+)/,":"+Tt+"input-$1")]}),gt(e,{props:[Xe(t,/:(plac\w+)/,":-moz-$1")]}),gt(e,{props:[Xe(t,/:(plac\w+)/,Nt+"input-$1")]})],a)}return""}))}}],$t=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var a,n,i=e.stylisPlugins||Kt,o={},s=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r=4;++a,n-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(n){case 3:r^=(255&e.charCodeAt(a+2))<<16;case 2:r^=(255&e.charCodeAt(a+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(a)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(n)+l;return{name:c,styles:n,next:ar}},or=!!s.useInsertionEffect&&s.useInsertionEffect,sr=or||function(e){return e()},lr=(or||s.useLayoutEffect,{}.hasOwnProperty),cr=s.createContext("undefined"!=typeof HTMLElement?$t({key:"css"}):null);cr.Provider;var ur=function(e){return(0,s.forwardRef)((function(t,r){var a=(0,s.useContext)(cr);return e(t,a,r)}))},gr=s.createContext({}),dr="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",fr=function(e){var t=e.cache,r=e.serialized,a=e.isStringTag;return Wt(t,r,a),sr((function(){return function(e,t,r){Wt(e,t,r);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var n=t;do{e.insert(t===n?"."+a:"",n,e.sheet,!0),n=n.next}while(void 0!==n)}}(t,r,a)})),null},pr=ur((function(e,t,r){var a=e.css;"string"==typeof a&&void 0!==t.registered[a]&&(a=t.registered[a]);var n=e[dr],i=[a],o="";"string"==typeof e.className?o=function(e,t,r){var a="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):a+=r+" "})),a}(t.registered,i,e.className):null!=e.className&&(o=e.className+" ");var l=ir(i,void 0,s.useContext(gr));o+=t.key+"-"+l.name;var c={};for(var u in e)lr.call(e,u)&&"css"!==u&&u!==dr&&(c[u]=e[u]);return c.ref=r,c.className=o,s.createElement(s.Fragment,null,s.createElement(fr,{cache:t,serialized:l,isStringTag:"string"==typeof n}),s.createElement(n,c))})),vr=pr,hr=(r(146),function(e,t){var r=arguments;if(null==t||!lr.call(t,"css"))return s.createElement.apply(void 0,r);var a=r.length,n=new Array(a);n[0]=vr,n[1]=function(e,t){var r={};for(var a in t)lr.call(t,a)&&(r[a]=t[a]);return r[dr]=e,r}(e,t);for(var i=2;i({x:e,y:e});function Er(e){return xr(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Nr(e){var t;return null==(t=(xr(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function xr(e){return e instanceof Node||e instanceof Dr(e).Node}function Tr(e){return e instanceof Element||e instanceof Dr(e).Element}function Ir(e){return e instanceof HTMLElement||e instanceof Dr(e).HTMLElement}function Mr(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot)}function kr(e){const{overflow:t,overflowX:r,overflowY:a,display:n}=Pr(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!["inline","contents"].includes(n)}function Pr(e){return Dr(e).getComputedStyle(e)}function _r(e){const t=function(e){if("html"===Er(e))return e;const t=e.assignedSlot||e.parentNode||Mr(e)&&e.host||Nr(e);return Mr(t)?t.host:t}(e);return function(e){return["html","body","#document"].includes(Er(e))}(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ir(t)&&kr(t)?t:_r(t)}function Rr(e,t,r){var a;void 0===t&&(t=[]),void 0===r&&(r=!0);const n=_r(e),i=n===(null==(a=e.ownerDocument)?void 0:a.body),o=Dr(n);return i?t.concat(o,o.visualViewport||[],kr(n)?n:[],o.frameElement&&r?Rr(o.frameElement):[]):t.concat(n,Rr(n,[],r))}function Lr(e){return Tr(e)?e:e.contextElement}function Ar(e){const t=Lr(e);if(!Ir(t))return Cr(1);const r=t.getBoundingClientRect(),{width:a,height:n,$:i}=function(e){const t=Pr(e);let r=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const n=Ir(e),i=n?e.offsetWidth:r,o=n?e.offsetHeight:a,s=wr(r)!==i||wr(a)!==o;return s&&(r=i,a=o),{width:r,height:a,$:s}}(t);let o=(i?wr(r.width):r.width)/a,s=(i?wr(r.height):r.height)/n;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const Fr=Cr(0);function jr(e){const t=Dr(e);return"undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Fr}function Vr(e,t,r,a){void 0===t&&(t=!1),void 0===r&&(r=!1);const n=e.getBoundingClientRect(),i=Lr(e);let o=Cr(1);t&&(a?Tr(a)&&(o=Ar(a)):o=Ar(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Dr(e))&&t}(i,r,a)?jr(i):Cr(0);let l=(n.left+s.x)/o.x,c=(n.top+s.y)/o.y,u=n.width/o.x,g=n.height/o.y;if(i){const e=Dr(i),t=a&&Tr(a)?Dr(a):a;let r=e,n=r.frameElement;for(;n&&a&&t!==r;){const e=Ar(n),t=n.getBoundingClientRect(),a=Pr(n),i=t.left+(n.clientLeft+parseFloat(a.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(a.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,g*=e.y,l+=i,c+=o,r=Dr(n),n=r.frameElement}}return function(e){const{x:t,y:r,width:a,height:n}=e;return{width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}({width:u,height:g,x:l,y:c})}var Br=s.useLayoutEffect,Hr=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],zr=function(){};function Ur(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Gr(e,t){for(var r=arguments.length,a=new Array(r>2?r-2:0),n=2;n-1}function Yr(e){return qr(e)?window.pageYOffset:e.scrollTop}function Jr(e,t){qr(e)?window.scrollTo(0,t):e.scrollTop=t}function Xr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zr,n=Yr(e),i=t-n,o=0;!function t(){var s=function(e,t,r,a){return r*((e=e/a-1)*e*e+1)+t}(o+=10,n,i,r);Jr(e,s),or.bottom?Jr(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):a.top-n=p)return{placement:"bottom",maxHeight:t};if(E>=p&&!o)return i&&Xr(l,D,x),{placement:"bottom",maxHeight:t};if(!o&&E>=a||o&&O>=a)return i&&Xr(l,D,x),{placement:"bottom",maxHeight:o?O-b:E-b};if("auto"===n||o){var T=t,I=o?w:C;return I>=a&&(T=Math.min(I-b-s,t)),{placement:"top",maxHeight:T}}if("bottom"===n)return i&&Jr(l,D),{placement:"bottom",maxHeight:t};break;case"top":if(w>=p)return{placement:"top",maxHeight:t};if(C>=p&&!o)return i&&Xr(l,N,x),{placement:"top",maxHeight:t};if(!o&&C>=a||o&&w>=a){var M=t;return(!o&&C>=a||o&&w>=a)&&(M=o?w-S:C-S),i&&Xr(l,N,x),{placement:"top",maxHeight:M}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return c}({maxHeight:a,menuEl:e,minHeight:r,placement:n,shouldScroll:o&&!t,isFixedPosition:t,controlHeight:m});f(s.maxHeight),h(s.placement),null==c||c(s.placement)}}),[a,n,i,o,r,c,m]),t({ref:u,placerProps:je(je({},e),{},{placement:v||oa(n),maxHeight:d})})},ca=function(e,t){var r=e.theme,a=r.spacing.baseUnit,n=r.colors;return je({textAlign:"center"},t?{}:{color:n.neutral40,padding:"".concat(2*a,"px ").concat(3*a,"px")})},ua=ca,ga=ca,da=function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),t)};da.defaultProps={children:"No options"};var fa=function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),t)};fa.defaultProps={children:"Loading..."};var pa,va=["size"],ha={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ya=function(e){var t=e.size,r=Ve(e,va);return hr("svg",He({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:ha},r))},ma=function(e){return hr(ya,He({size:20},e),hr("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},ba=function(e){return hr(ya,He({size:20},e),hr("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Sa=function(e,t){var r=e.isFocused,a=e.theme,n=a.spacing.baseUnit,i=a.colors;return je({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?i.neutral60:i.neutral20,padding:2*n,":hover":{color:r?i.neutral80:i.neutral40}})},wa=Sa,Oa=Sa,Ca=function(){var e=yr.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(pa||(pa=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))),Ea=function(e){var t=e.delay,r=e.offset;return hr("span",{css:yr({animation:"".concat(Ca," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Da=function(e){var t=e.innerProps,r=e.isRtl;return hr("div",He({},Wr(e,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),hr(Ea,{delay:0,offset:r}),hr(Ea,{delay:160,offset:!0}),hr(Ea,{delay:320,offset:!r}))};Da.defaultProps={size:4};var Na=["data"],xa=["innerRef","isDisabled","isHidden","inputClassName"],Ta={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Ia={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":je({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Ta)},Ma=function(e){return je({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Ta)},ka=function(e){var t=e.children,r=e.innerProps;return hr("div",r,t)},Pa={ClearIndicator:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||hr(ma,null))},Control:function(e){var t=e.children,r=e.isDisabled,a=e.isFocused,n=e.innerRef,i=e.innerProps,o=e.menuIsOpen;return hr("div",He({ref:n},Wr(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":a,"control--menu-is-open":o}),i),t)},DropdownIndicator:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||hr(ba,null))},DownChevron:ba,CrossIcon:ma,Group:function(e){var t=e.children,r=e.cx,a=e.getStyles,n=e.getClassNames,i=e.Heading,o=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return hr("div",He({},Wr(e,"group",{group:!0}),s),hr(i,He({},o,{selectProps:u,theme:c,getStyles:a,getClassNames:n,cx:r}),l),hr("div",null,t))},GroupHeading:function(e){var t=$r(e);t.data;var r=Ve(t,Na);return hr("div",He({},Wr(e,"groupHeading",{"group-heading":!0}),r))},IndicatorsContainer:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"indicatorsContainer",{indicators:!0}),r),t)},IndicatorSeparator:function(e){var t=e.innerProps;return hr("span",He({},t,Wr(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,r=e.value,a=$r(e),n=a.innerRef,i=a.isDisabled,o=a.isHidden,s=a.inputClassName,l=Ve(a,xa);return hr("div",He({},Wr(e,"input",{"input-container":!0}),{"data-value":r||""}),hr("input",He({className:t({input:!0},s),ref:n,style:Ma(o),disabled:i},l)))},LoadingIndicator:Da,Menu:function(e){var t=e.children,r=e.innerRef,a=e.innerProps;return hr("div",He({},Wr(e,"menu",{menu:!0}),{ref:r},a),t)},MenuList:function(e){var t=e.children,r=e.innerProps,a=e.innerRef,n=e.isMulti;return hr("div",He({},Wr(e,"menuList",{"menu-list":!0,"menu-list--is-multi":n}),{ref:a},r),t)},MenuPortal:function(e){var t=e.appendTo,r=e.children,a=e.controlElement,n=e.innerProps,i=e.menuPlacement,o=e.menuPosition,l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=y((0,s.useState)(oa(i)),2),g=u[0],d=u[1],f=(0,s.useMemo)((function(){return{setPortalPlacement:d}}),[]),p=y((0,s.useState)(null),2),v=p[0],h=p[1],m=(0,s.useCallback)((function(){if(a){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(a),t="fixed"===o?0:window.pageYOffset,r=e[g]+t;r===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||h({offset:r,rect:e})}}),[a,o,g,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);Br((function(){m()}),[m]);var b=(0,s.useCallback)((function(){"function"==typeof c.current&&(c.current(),c.current=null),a&&l.current&&(c.current=function(e,t,r,a){void 0===a&&(a={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=Lr(e),u=n||i?[...c?Rr(c):[],...Rr(t)]:[];u.forEach((e=>{n&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)}));const g=c&&s?function(e,t){let r,a=null;const n=Nr(e);function i(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}return function o(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:g,height:d}=e.getBoundingClientRect();if(s||t(),!g||!d)return;const f={rootMargin:-Or(u)+"px "+-Or(n.clientWidth-(c+g))+"px "+-Or(n.clientHeight-(u+d))+"px "+-Or(c)+"px",threshold:Sr(0,br(1,l))||1};let p=!0;function v(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return o();t?o(!1,t):r=setTimeout((()=>{o(!1,1e-7)}),1e3)}p=!1}try{a=new IntersectionObserver(v,{...f,root:n.ownerDocument})}catch(e){a=new IntersectionObserver(v,f)}a.observe(e)}(!0),i}(c,r):null;let d,f=-1,p=null;o&&(p=new ResizeObserver((e=>{let[a]=e;a&&a.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),r()})),c&&!l&&p.observe(c),p.observe(t));let v=l?Vr(e):null;return l&&function t(){const a=Vr(e);!v||a.x===v.x&&a.y===v.y&&a.width===v.width&&a.height===v.height||r(),v=a,d=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach((e=>{n&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)})),null==g||g(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(d)}}(a,l.current,m,{elementResize:"ResizeObserver"in window}))}),[a,m]);Br((function(){b()}),[b]);var S=(0,s.useCallback)((function(e){l.current=e,b()}),[b]);if(!t&&"fixed"!==o||!v)return null;var w=hr("div",He({ref:S},Wr(je(je({},e),{},{offset:v.offset,position:o,rect:v.rect}),"menuPortal",{"menu-portal":!0}),n),r);return hr(sa.Provider,{value:f},t?(0,mr.createPortal)(w,t):w)},LoadingMessage:fa,NoOptionsMessage:da,MultiValue:function(e){var t=e.children,r=e.components,a=e.data,n=e.innerProps,i=e.isDisabled,o=e.removeProps,s=e.selectProps,l=r.Container,c=r.Label,u=r.Remove;return hr(l,{data:a,innerProps:je(je({},Wr(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),n),selectProps:s},hr(c,{data:a,innerProps:je({},Wr(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),hr(u,{data:a,innerProps:je(je({},Wr(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},o),selectProps:s}))},MultiValueContainer:ka,MultiValueLabel:ka,MultiValueRemove:function(e){var t=e.children,r=e.innerProps;return hr("div",He({role:"button"},r),t||hr(ma,{size:14}))},Option:function(e){var t=e.children,r=e.isDisabled,a=e.isFocused,n=e.isSelected,i=e.innerRef,o=e.innerProps;return hr("div",He({},Wr(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":a,"option--is-selected":n}),{ref:i,"aria-disabled":r},o),t)},Placeholder:function(e){var t=e.children,r=e.innerProps;return hr("div",He({},Wr(e,"placeholder",{placeholder:!0}),r),t)},SelectContainer:function(e){var t=e.children,r=e.innerProps,a=e.isDisabled,n=e.isRtl;return hr("div",He({},Wr(e,"container",{"--is-disabled":a,"--is-rtl":n}),r),t)},SingleValue:function(e){var t=e.children,r=e.isDisabled,a=e.innerProps;return hr("div",He({},Wr(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),a),t)},ValueContainer:function(e){var t=e.children,r=e.innerProps,a=e.isMulti,n=e.hasValue;return hr("div",He({},Wr(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":n}),r),t)}},_a=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Ra(e,t){if(e.length!==t.length)return!1;for(var r=0;r1?"s":""," ").concat(n.join(","),", selected.");case"select-option":return"option ".concat(a,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,a=e.options,n=e.label,i=void 0===n?"":n,o=e.selectValue,s=e.isDisabled,l=e.isSelected,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&o)return"value ".concat(i," focused, ").concat(c(o,r),".");if("menu"===t){var u=s?" disabled":"",g="".concat(l?"selected":"focused").concat(u);return"option ".concat(i," ").concat(g,", ").concat(c(a,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},ja=function(e){var t=e.ariaSelection,r=e.focusedOption,a=e.focusedValue,n=e.focusableOptions,i=e.isFocused,o=e.selectValue,l=e.selectProps,c=e.id,u=l.ariaLiveMessages,g=l.getOptionLabel,d=l.inputValue,f=l.isMulti,p=l.isOptionDisabled,v=l.isSearchable,h=l.menuIsOpen,y=l.options,m=l.screenReaderStatus,b=l.tabSelectsValue,S=l["aria-label"],w=l["aria-live"],O=(0,s.useMemo)((function(){return je(je({},Fa),u||{})}),[u]),C=(0,s.useMemo)((function(){var e,r="";if(t&&O.onChange){var a=t.option,n=t.options,i=t.removedValue,s=t.removedValues,l=t.value,c=i||a||(e=l,Array.isArray(e)?null:e),u=c?g(c):"",d=n||s||void 0,f=d?d.map(g):[],v=je({isDisabled:c&&p(c,o),label:u,labels:f},t);r=O.onChange(v)}return r}),[t,O,p,o,g]),E=(0,s.useMemo)((function(){var e="",t=r||a,i=!!(r&&o&&o.includes(r));if(t&&O.onFocus){var s={focused:t,label:g(t),isDisabled:p(t,o),isSelected:i,options:n,context:t===r?"menu":"value",selectValue:o};e=O.onFocus(s)}return e}),[r,a,g,p,O,n,o]),D=(0,s.useMemo)((function(){var e="";if(h&&y.length&&O.onFilter){var t=m({count:n.length});e=O.onFilter({inputValue:d,resultsMessage:t})}return e}),[n,d,h,O,y,m]),N=(0,s.useMemo)((function(){var e="";if(O.guidance){var t=a?"value":h?"menu":"input";e=O.guidance({"aria-label":S,context:t,isDisabled:r&&p(r,o),isMulti:f,isSearchable:v,tabSelectsValue:b})}return e}),[S,r,a,f,p,v,h,O,o,b]),x="".concat(E," ").concat(D," ").concat(N),T=hr(s.Fragment,null,hr("span",{id:"aria-selection"},C),hr("span",{id:"aria-context"},x)),I="initial-input-focus"===(null==t?void 0:t.action);return hr(s.Fragment,null,hr(Aa,{id:c},I&&T),hr(Aa,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text"},i&&!I&&T))},Va=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Ba=new RegExp("["+Va.map((function(e){return e.letters})).join("")+"]","g"),Ha={},za=0;za1?t-1:0),a=1;a0,v=g-d-c,h=!1;v>t&&o.current&&(a&&a(e),o.current=!1),p&&l.current&&(i&&i(e),l.current=!1),p&&t>v?(r&&!o.current&&r(e),f.scrollTop=g,h=!0,o.current=!0):!p&&-t>c&&(n&&!l.current&&n(e),f.scrollTop=0,h=!0,l.current=!0),h&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[r,a,n,i]),d=(0,s.useCallback)((function(e){g(e,e.deltaY)}),[g]),f=(0,s.useCallback)((function(e){c.current=e.changedTouches[0].clientY}),[]),p=(0,s.useCallback)((function(e){var t=c.current-e.changedTouches[0].clientY;g(e,t)}),[g]),v=(0,s.useCallback)((function(e){if(e){var t=!!aa&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",p,t)}}),[p,f,d]),h=(0,s.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",p,!1))}),[p,f,d]);return(0,s.useEffect)((function(){if(t){var e=u.current;return v(e),function(){h(e)}}}),[t,v,h]),function(e){u.current=e}}({isEnabled:void 0===a||a,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,r=e.accountForScrollbars,a=void 0===r||r,n=(0,s.useRef)({}),i=(0,s.useRef)(null),o=(0,s.useCallback)((function(e){if(an){var t=document.body,r=t&&t.style;if(a&&Xa.forEach((function(e){var t=r&&r[e];n.current[e]=t})),a&&nn<1){var i=parseInt(n.current.paddingRight,10)||0,o=document.body?document.body.clientWidth:0,s=window.innerWidth-o+i||0;Object.keys(Za).forEach((function(e){var t=Za[e];r&&(r[e]=t)})),r&&(r.paddingRight="".concat(s,"px"))}t&&rn()&&(t.addEventListener("touchmove",Qa,on),e&&(e.addEventListener("touchstart",tn,on),e.addEventListener("touchmove",en,on))),nn+=1}}),[a]),l=(0,s.useCallback)((function(e){if(an){var t=document.body,r=t&&t.style;nn=Math.max(nn-1,0),a&&nn<1&&Xa.forEach((function(e){var t=n.current[e];r&&(r[e]=t)})),t&&rn()&&(t.removeEventListener("touchmove",Qa,on),e&&(e.removeEventListener("touchstart",tn,on),e.removeEventListener("touchmove",en,on)))}}),[a]);return(0,s.useEffect)((function(){if(t){var e=i.current;return o(e),function(){l(e)}}}),[t,o,l]),function(e){i.current=e}}({isEnabled:r});return hr(s.Fragment,null,r&&hr("div",{onClick:sn,css:ln}),t((function(e){n(e),i(e)})))}var un={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},gn=function(e){var t=e.name,r=e.onFocus;return hr("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:un,value:"",onChange:function(){}})},dn={clearIndicator:Oa,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var r=e.isDisabled,a=e.isFocused,n=e.theme,i=n.colors,o=n.borderRadius;return je({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:n.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?i.neutral5:i.neutral0,borderColor:r?i.neutral10:a?i.primary:i.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:a?i.primary:i.neutral30}})},dropdownIndicator:wa,group:function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:2*r.baseUnit,paddingTop:2*r.baseUnit}},groupHeading:function(e,t){var r=e.theme,a=r.colors,n=r.spacing;return je({label:"group",cursor:"default",display:"block"},t?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*n.baseUnit,paddingRight:3*n.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var r=e.isDisabled,a=e.theme,n=a.spacing.baseUnit,i=a.colors;return je({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?i.neutral10:i.neutral20,marginBottom:2*n,marginTop:2*n})},input:function(e,t){var r=e.isDisabled,a=e.value,n=e.theme,i=n.spacing,o=n.colors;return je(je({visibility:r?"hidden":"visible",transform:a?"translateZ(0)":""},Ia),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:o.neutral80})},loadingIndicator:function(e,t){var r=e.isFocused,a=e.size,n=e.theme,i=n.colors,o=n.spacing.baseUnit;return je({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?i.neutral60:i.neutral20,padding:2*o})},loadingMessage:ga,menu:function(e,t){var r,a=e.placement,n=e.theme,i=n.borderRadius,s=n.spacing,l=n.colors;return je((o(r={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(a),"100%"),o(r,"position","absolute"),o(r,"width","100%"),o(r,"zIndex",1),r),t?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},menuList:function(e,t){var r=e.maxHeight,a=e.theme.spacing.baseUnit;return je({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:a,paddingTop:a})},menuPortal:function(e){var t=e.rect,r=e.offset,a=e.position;return{left:t.left,position:a,top:r,width:t.width,zIndex:1}},multiValue:function(e,t){var r=e.theme,a=r.spacing,n=r.borderRadius,i=r.colors;return je({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:n/2,margin:a.baseUnit/2})},multiValueLabel:function(e,t){var r=e.theme,a=r.borderRadius,n=r.colors,i=e.cropWithEllipsis;return je({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:a/2,color:n.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var r=e.theme,a=r.spacing,n=r.borderRadius,i=r.colors,o=e.isFocused;return je({alignItems:"center",display:"flex"},t?{}:{borderRadius:n/2,backgroundColor:o?i.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:ua,option:function(e,t){var r=e.isDisabled,a=e.isFocused,n=e.isSelected,i=e.theme,o=i.spacing,s=i.colors;return je({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:n?s.primary:a?s.primary25:"transparent",color:r?s.neutral20:n?s.neutral0:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),":active":{backgroundColor:r?void 0:n?s.primary:s.primary50}})},placeholder:function(e,t){var r=e.theme,a=r.spacing,n=r.colors;return je({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:n.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},singleValue:function(e,t){var r=e.isDisabled,a=e.theme,n=a.spacing,i=a.colors;return je({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?i.neutral40:i.neutral80,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},valueContainer:function(e,t){var r=e.theme.spacing,a=e.isMulti,n=e.hasValue,i=e.selectProps.controlShouldRenderValue;return je({alignItems:"center",display:a&&n&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(2*r.baseUnit,"px")})}},fn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},pn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Qr(),captureMenuScroll:!Qr(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var r=je({ignoreCase:!0,ignoreAccents:!0,stringify:qa,trim:!0,matchFrom:"any"},undefined),a=r.ignoreCase,n=r.ignoreAccents,i=r.stringify,o=r.trim,s=r.matchFrom,l=o?Wa(t):t,c=o?Wa(i(e)):i(e);return a&&(l=l.toLowerCase(),c=c.toLowerCase()),n&&(l=$a(l),c=Ka(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function vn(e,t,r,a){return{type:"option",data:t,isDisabled:wn(e,t,r),isSelected:On(e,t,r),label:bn(e,t),value:Sn(e,t),index:a}}function hn(e,t){return e.options.map((function(r,a){if("options"in r){var n=r.options.map((function(r,a){return vn(e,r,t,a)})).filter((function(t){return mn(e,t)}));return n.length>0?{type:"group",data:r,options:n,index:a}:void 0}var i=vn(e,r,t,a);return mn(e,i)?i:void 0})).filter(na)}function yn(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,Le(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function mn(e,t){var r=e.inputValue,a=void 0===r?"":r,n=t.data,i=t.isSelected,o=t.label,s=t.value;return(!En(e)||!i)&&Cn(e,{label:o,value:s,data:n},a)}var bn=function(e,t){return e.getOptionLabel(t)},Sn=function(e,t){return e.getOptionValue(t)};function wn(e,t,r){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,r)}function On(e,t,r){if(r.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,r);var a=Sn(e,t);return r.some((function(t){return Sn(e,t)===a}))}function Cn(e,t,r){return!e.filterOption||e.filterOption(t,r)}var En=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t},Dn=1,Nn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ue(e,t)}(r,e);var t=function(e){var t=Ke();return function(){var r,a=Ge(e);if(t){var i=Ge(this).constructor;r=Reflect.construct(a,arguments,i)}else r=a.apply(this,arguments);return function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}(r);function r(e){var a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(a=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.instancePrefix="",a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.controlRef=null,a.getControlRef=function(e){a.controlRef=e},a.focusedOptionRef=null,a.getFocusedOptionRef=function(e){a.focusedOptionRef=e},a.menuListRef=null,a.getMenuListRef=function(e){a.menuListRef=e},a.inputRef=null,a.getInputRef=function(e){a.inputRef=e},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(e,t){var r=a.props,n=r.onChange,i=r.name;t.name=i,a.ariaOnChange(e,t),n(e,t)},a.setValue=function(e,t,r){var n=a.props,i=n.closeMenuOnSelect,o=n.isMulti,s=n.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(a.setState({inputIsHiddenAfterUpdate:!o}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(e,{action:t,option:r})},a.selectOption=function(e){var t=a.props,r=t.blurInputOnSelect,n=t.isMulti,i=t.name,o=a.state.selectValue,s=n&&a.isOptionSelected(e,o),l=a.isOptionDisabled(e,o);if(s){var c=a.getOptionValue(e);a.setValue(o.filter((function(e){return a.getOptionValue(e)!==c})),"deselect-option",e)}else{if(l)return void a.ariaOnChange(e,{action:"select-option",option:e,name:i});n?a.setValue([].concat(Le(o),[e]),"select-option",e):a.setValue(e,"select-option")}r&&a.blurInput()},a.removeValue=function(e){var t=a.props.isMulti,r=a.state.selectValue,n=a.getOptionValue(e),i=r.filter((function(e){return a.getOptionValue(e)!==n})),o=ia(t,i,i[0]||null);a.onChange(o,{action:"remove-value",removedValue:e}),a.focusInput()},a.clearValue=function(){var e=a.state.selectValue;a.onChange(ia(a.props.isMulti,[],null),{action:"clear",removedValues:e})},a.popValue=function(){var e=a.props.isMulti,t=a.state.selectValue,r=t[t.length-1],n=t.slice(0,t.length-1),i=ia(e,n,n[0]||null);a.onChange(i,{action:"pop-value",removedValue:r})},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var e=arguments.length,t=new Array(e),r=0;r5||i>5}},a.onTouchEnd=function(e){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(e.target)&&a.menuListRef&&!a.menuListRef.contains(e.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(e){a.userIsDragging||a.onControlMouseDown(e)},a.onClearIndicatorTouchEnd=function(e){a.userIsDragging||a.onClearIndicatorMouseDown(e)},a.onDropdownIndicatorTouchEnd=function(e){a.userIsDragging||a.onDropdownIndicatorMouseDown(e)},a.handleInputChange=function(e){var t=a.props.inputValue,r=e.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(r,{action:"input-change",prevInputValue:t}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(e){a.props.onFocus&&a.props.onFocus(e),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(e){var t=a.props.inputValue;a.menuListRef&&a.menuListRef.contains(document.activeElement)?a.inputRef.focus():(a.props.onBlur&&a.props.onBlur(e),a.onInputChange("",{action:"input-blur",prevInputValue:t}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1}))},a.onOptionHover=function(e){a.blockOptionHover||a.state.focusedOption===e||a.setState({focusedOption:e})},a.shouldHideSelectedOptions=function(){return En(a.props)},a.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),a.focus()},a.onKeyDown=function(e){var t=a.props,r=t.isMulti,n=t.backspaceRemovesValue,i=t.escapeClearsValue,o=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,g=t.tabSelectsValue,d=t.openMenuOnFocus,f=a.state,p=f.focusedOption,v=f.focusedValue,h=f.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(a.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||o)return;a.focusValue("previous");break;case"ArrowRight":if(!r||o)return;a.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(v)a.removeValue(v);else{if(!n)return;r?a.popValue():s&&a.clearValue()}break;case"Tab":if(a.isComposing)return;if(e.shiftKey||!c||!g||!p||d&&a.isOptionSelected(p,h))return;a.selectOption(p);break;case"Enter":if(229===e.keyCode)break;if(c){if(!p)return;if(a.isComposing)return;a.selectOption(p);break}return;case"Escape":c?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:o}),a.onMenuClose()):s&&i&&a.clearValue();break;case" ":if(o)return;if(!c){a.openMenu("first");break}if(!p)return;a.selectOption(p);break;case"ArrowUp":c?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":c?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!c)return;a.focusOption("pageup");break;case"PageDown":if(!c)return;a.focusOption("pagedown");break;case"Home":if(!c)return;a.focusOption("first");break;case"End":if(!c)return;a.focusOption("last");break;default:return}e.preventDefault()}},a.instancePrefix="react-select-"+(a.props.instanceId||++Dn),a.state.selectValue=Kr(e.value),e.menuIsOpen&&a.state.selectValue.length){var n=a.buildFocusableOptions(),i=n.indexOf(a.state.selectValue[0]);a.state.focusedOption=n[i]}return a}return function(e,t,r){t&&ze(e.prototype,t),r&&ze(e,r),Object.defineProperty(e,"prototype",{writable:!1})}(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Zr(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isDisabled,a=t.menuIsOpen,n=this.state.isFocused;(n&&!r&&e.isDisabled||n&&a&&!e.menuIsOpen)&&this.focusInput(),n&&r&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):n||r||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Zr(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,r=this.state,a=r.selectValue,n=r.isFocused,i=this.buildFocusableOptions(),o="first"===e?0:i.length-1;if(!this.props.isMulti){var s=i.indexOf(a[0]);s>-1&&(o=s)}this.scrollToFocusedOptionOnUpdate=!(n&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[o]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,r=t.selectValue,a=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var n=r.indexOf(a);a||(n=-1);var i=r.length-1,o=-1;if(r.length){switch(e){case"previous":o=0===n?0:-1===n?i:n-1;break;case"next":n>-1&&n0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,r=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var n=0,i=a.indexOf(r);r||(i=-1),"up"===e?n=i>0?i-1:a.length-1:"down"===e?n=(i+1)%a.length:"pageup"===e?(n=i-t)<0&&(n=0):"pagedown"===e?(n=i+t)>a.length-1&&(n=a.length-1):"last"===e&&(n=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[n],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(fn):je(je({},fn),this.props.theme):fn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,r=this.getStyles,a=this.getClassNames,n=this.getValue,i=this.selectOption,o=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:r,getClassNames:a,getValue:n,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:i,selectProps:s,setValue:o,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,r=e.isMulti;return void 0===t?r:t}},{key:"isOptionDisabled",value:function(e,t){return wn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return On(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Cn(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var r=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:r,selectValue:a})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,r=e.isSearchable,a=e.inputId,n=e.inputValue,i=e.tabIndex,o=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,g=this.state,d=g.inputIsHidden,f=g.ariaSelection,p=this.commonProps,v=a||this.getElementId("input"),h=je(je(je({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox"},l&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!r&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return r?s.createElement(u,He({},p,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:o,type:"text",value:n},h)):s.createElement(Ja,He({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:zr,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:o,value:""},h))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),r=t.MultiValue,a=t.MultiValueContainer,n=t.MultiValueLabel,i=t.MultiValueRemove,o=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,g=u.controlShouldRenderValue,d=u.isDisabled,f=u.isMulti,p=u.inputValue,v=u.placeholder,h=this.state,y=h.selectValue,m=h.focusedValue,b=h.isFocused;if(!this.hasValue()||!g)return p?null:s.createElement(l,He({},c,{key:"placeholder",isDisabled:d,isFocused:b,innerProps:{id:this.getElementId("placeholder")}}),v);if(f)return y.map((function(t,o){var l=t===m,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return s.createElement(r,He({},c,{components:{Container:a,Label:n,Remove:i},isFocused:l,isDisabled:d,key:u,index:o,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(p)return null;var S=y[0];return s.createElement(o,He({},c,{data:S,isDisabled:d}),this.formatOptionLabel(S,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,r=this.props,a=r.isDisabled,n=r.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||a||!this.hasValue()||n)return null;var o={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return s.createElement(e,He({},t,{innerProps:o,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,r=this.props,a=r.isDisabled,n=r.isLoading,i=this.state.isFocused;return e&&n?s.createElement(e,He({},t,{innerProps:{"aria-hidden":"true"},isDisabled:a,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,r=e.IndicatorSeparator;if(!t||!r)return null;var a=this.commonProps,n=this.props.isDisabled,i=this.state.isFocused;return s.createElement(r,He({},a,{isDisabled:n,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,r=this.props.isDisabled,a=this.state.isFocused,n={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return s.createElement(e,He({},t,{innerProps:n,isDisabled:r,isFocused:a}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),r=t.Group,a=t.GroupHeading,n=t.Menu,i=t.MenuList,o=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,g=this.commonProps,d=this.state.focusedOption,f=this.props,p=f.captureMenuScroll,v=f.inputValue,h=f.isLoading,y=f.loadingMessage,m=f.minMenuHeight,b=f.maxMenuHeight,S=f.menuIsOpen,w=f.menuPlacement,O=f.menuPosition,C=f.menuPortalTarget,E=f.menuShouldBlockScroll,D=f.menuShouldScrollIntoView,N=f.noOptionsMessage,x=f.onMenuScrollToTop,T=f.onMenuScrollToBottom;if(!S)return null;var I,M=function(t,r){var a=t.type,n=t.data,i=t.isDisabled,o=t.isSelected,l=t.label,c=t.value,f=d===n,p=i?void 0:function(){return e.onOptionHover(n)},v=i?void 0:function(){return e.selectOption(n)},h="".concat(e.getElementId("option"),"-").concat(r),y={id:h,onClick:v,onMouseMove:p,onMouseOver:p,tabIndex:-1};return s.createElement(u,He({},g,{innerProps:y,data:n,isDisabled:i,isSelected:o,key:h,label:l,type:a,value:c,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())I=this.getCategorizedOptions().map((function(t){if("group"===t.type){var n=t.data,i=t.options,o=t.index,l="".concat(e.getElementId("group"),"-").concat(o),c="".concat(l,"-heading");return s.createElement(r,He({},g,{key:l,data:n,options:i,Heading:a,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return M(e,"".concat(o,"-").concat(e.index))})))}if("option"===t.type)return M(t,"".concat(t.index))}));else if(h){var k=y({inputValue:v});if(null===k)return null;I=s.createElement(l,g,k)}else{var P=N({inputValue:v});if(null===P)return null;I=s.createElement(c,g,P)}var _={minMenuHeight:m,maxMenuHeight:b,menuPlacement:w,menuPosition:O,menuShouldScrollIntoView:D},R=s.createElement(la,He({},g,_),(function(t){var r=t.ref,a=t.placerProps,o=a.placement,l=a.maxHeight;return s.createElement(n,He({},g,_,{innerRef:r,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:h,placement:o}),s.createElement(cn,{captureEnabled:p,onTopArrive:x,onBottomArrive:T,lockEnabled:E},(function(t){return s.createElement(i,He({},g,{innerRef:function(r){e.getMenuListRef(r),t(r)},isLoading:h,maxHeight:l,focusedOption:d}),I)})))}));return C||"fixed"===O?s.createElement(o,He({},g,{appendTo:C,controlElement:this.controlRef,menuPlacement:w,menuPosition:O}),R):R}},{key:"renderFormField",value:function(){var e=this,t=this.props,r=t.delimiter,a=t.isDisabled,n=t.isMulti,i=t.name,o=t.required,l=this.state.selectValue;if(o&&!this.hasValue()&&!a)return s.createElement(gn,{name:i,onFocus:this.onValueInputFocus});if(i&&!a){if(n){if(r){var c=l.map((function(t){return e.getOptionValue(t)})).join(r);return s.createElement("input",{name:i,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,r){return s.createElement("input",{key:"i-".concat(r),name:i,type:"hidden",value:e.getOptionValue(t)})})):s.createElement("input",{name:i,type:"hidden",value:""});return s.createElement("div",null,u)}var g=l[0]?this.getOptionValue(l[0]):"";return s.createElement("input",{name:i,type:"hidden",value:g})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,r=t.ariaSelection,a=t.focusedOption,n=t.focusedValue,i=t.isFocused,o=t.selectValue,l=this.getFocusableOptions();return s.createElement(ja,He({},e,{id:this.getElementId("live-region"),ariaSelection:r,focusedOption:a,focusedValue:n,isFocused:i,selectValue:o,focusableOptions:l}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,r=e.IndicatorsContainer,a=e.SelectContainer,n=e.ValueContainer,i=this.props,o=i.className,l=i.id,c=i.isDisabled,u=i.menuIsOpen,g=this.state.isFocused,d=this.commonProps=this.getCommonProps();return s.createElement(a,He({},d,{className:o,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:g}),this.renderLiveRegion(),s.createElement(t,He({},d,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:g,menuIsOpen:u}),s.createElement(n,He({},d,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),s.createElement(r,He({},d,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=t.prevProps,a=t.clearFocusValueOnUpdate,n=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,o=t.isFocused,s=t.prevWasFocused,l=e.options,c=e.value,u=e.menuIsOpen,g=e.inputValue,d=e.isMulti,f=Kr(c),p={};if(r&&(c!==r.value||l!==r.options||u!==r.menuIsOpen||g!==r.inputValue)){var v=u?function(e,t){return yn(hn(e,t))}(e,f):[],h=a?function(e,t){var r=e.focusedValue,a=e.selectValue.indexOf(r);if(a>-1){if(t.indexOf(r)>-1)return r;if(a-1?r:t[0]}(t,v);p={selectValue:f,focusedOption:y,focusedValue:h,clearFocusValueOnUpdate:!1}}var m=null!=n&&e!==r?{inputIsHidden:n,inputIsHiddenAfterUpdate:void 0}:{},b=i,S=o&&s;return o&&!S&&(b={value:ia(d,f,f[0]||null),options:f,action:"initial-input-focus"},S=!s),"initial-input-focus"===(null==i?void 0:i.action)&&(b=null),je(je(je({},p),m),{},{prevProps:e,ariaSelection:b,prevWasFocused:S})}}]),r}(s.Component);Nn.defaultProps=pn;var xn=(0,s.forwardRef)((function(e,t){var r=function(e){var t=e.defaultInputValue,r=void 0===t?"":t,a=e.defaultMenuIsOpen,n=void 0!==a&&a,i=e.defaultValue,o=void 0===i?null:i,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,g=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,p=e.value,v=Ve(e,Be),h=y((0,s.useState)(void 0!==l?l:r),2),m=h[0],b=h[1],S=y((0,s.useState)(void 0!==c?c:n),2),w=S[0],O=S[1],C=y((0,s.useState)(void 0!==p?p:o),2),E=C[0],D=C[1],N=(0,s.useCallback)((function(e,t){"function"==typeof u&&u(e,t),D(e)}),[u]),x=(0,s.useCallback)((function(e,t){var r;"function"==typeof g&&(r=g(e,t)),b(void 0!==r?r:e)}),[g]),T=(0,s.useCallback)((function(){"function"==typeof f&&f(),O(!0)}),[f]),I=(0,s.useCallback)((function(){"function"==typeof d&&d(),O(!1)}),[d]),M=void 0!==l?l:m,k=void 0!==c?c:w,P=void 0!==p?p:E;return je(je({},v),{},{inputValue:M,menuIsOpen:k,onChange:N,onInputChange:x,onMenuClose:I,onMenuOpen:T,value:P})}(e);return s.createElement(Nn,He({ref:t},r))})),Tn=xn;function In(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Mn(e){for(var t=1;t0&&a.forEach((function(e){var t=e.alias?e.alias:e.name,a=e.fontFamily?e.fontFamily:t,n=e.cssVariable?"var(".concat(e.cssVariable,")"):a;r.push({value:n,label:t})})),t.length>0&&t.forEach((function(e,a){r.push({value:t[a].fontFamily,label:t[a].fontFamily})})),r),onChange:function(e){o("fontFamily",e,n)}})};function qn(e,t){var r=[{value:"",label:(0,m.__)("Default","generatepress")},{value:"normal",label:(0,m.__)("Normal","generatepress")},{value:"bold",label:(0,m.__)("Bold","generatepress")},{value:"100",label:"100"},{value:"200",label:"200"},{value:"300",label:"300"},{value:"400",label:"400"},{value:"500",label:"500"},{value:"600",label:"600"},{value:"700",label:"700"},{value:"800",label:"800"},{value:"900",label:"900"}];return void 0!==Ae[e]&&"undefined"!==t.googleFontVariants&&(r=[{value:"",label:(0,m.__)("Default","generatepress")},{value:"normal",label:(0,m.__)("Normal","generatepress")},{value:"bold",label:(0,m.__)("Bold","generatepress")}],t.filter((function(t){return t.fontFamily===e})).forEach((function(e){var t=(e.googleFontVariants?e.googleFontVariants:"").replaceAll(" ","");(t=t.split(",")).filter((function(e){var t=e.match(/[a-z]/g),r=e.match(/[0-9]/g);return!(t&&r||"italic"===e||"regular"===e||""===e)})).forEach((function(e){r.push({value:e,label:e})}))}))),r}var Yn=function(e){var t=e.index,r=e.value,a=e.fontFamily,n=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Font Weight","generatepress"),value:r,options:qn(a,Hn()),onChange:function(e){n("fontWeight",e,t)}})},Jn=function(e){var t=e.index,r=e.value,a=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Text Transform","generatepress"),value:r,options:[{value:"",label:(0,m.__)("Default","generatepress")},{value:"uppercase",label:(0,m.__)("Uppercase","generatepress")},{value:"lowercase",label:(0,m.__)("Lowercase","generatepress")},{value:"capitalize",label:(0,m.__)("Capitalize","generatepress")},{value:"initial",label:(0,m.__)("Normal","generatepress")}],onChange:function(e){a("textTransform",e,t)}})},Xn=function(e){var t=e.index,r=e.value,a=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Font Style","generatepress"),value:r,options:[{value:"",label:(0,m.__)("Default","generatepress")},{value:"normal",label:(0,m.__)("Normal","generatepress")},{value:"italic",label:(0,m.__)("Italic","generatepress")},{value:"oblique",label:(0,m.__)("Oblique","generatepress")},{value:"initial",label:(0,m.__)("Initial","generatepress")}],onChange:function(e){a("fontStyle",e,t)}})},Zn=function(e){var t=y((0,l.useState)("desktop"),2),r=(t[0],t[1]),a=e.label,n=e.devices,i=e.onClick,o=void 0===i?function(){return null}:i;return(0,s.createElement)("div",{className:"components-generate-units-control-header__units"},(0,s.createElement)("div",{className:"components-generate-units-control-label__units"},a),(0,s.createElement)("div",{className:"components-generate-control__units"},(0,s.createElement)(u.ButtonGroup,{className:"components-generate-control-buttons__units","aria-label":(0,m.__)("Select Units","generatepress")},n.map((function(e){var t=(0,m.__)("Desktop","generatepress");return"tablet"===e&&(t=(0,m.__)("Tablet","generatepress")),"mobile"===e&&(t=(0,m.__)("Mobile","generatepress")),(0,s.createElement)(u.Tooltip /* translators: Unit type (px, em, %) */,{text:(0,m.sprintf)((0,m.__)("%s Preview","generatepress"),t),key:e},(0,s.createElement)(u.Button,{key:e,className:"components-generate-control-button__units--"+e,isSmall:!0 -/* translators: %s: values associated with CSS syntax, 'Pixel', 'Em', 'Percentage' */,"aria-label":t,onClick:function(){wp.customize.previewedDevice.set(e),r(e),o(e)}},xe(e)))})))))},Qn=r(485),ei=r.n(Qn);function ti(e){var t=e.value,r=e.onChange,a=e.units,n=void 0===a?[]:a,i=e.disabled;return n.length?(n.includes(t)||(n[n.length-1]=t),(0,s.createElement)(s.Fragment,null,(0,s.createElement)(u.DropdownMenu,{className:"gblocks-unit-control-units",label:(0,m.__)("Select a unit","generatepress"),icon:null,toggleProps:{children:t||String.fromCharCode(8212),disabled:i},popoverProps:{className:"gblocks-unit-control-popover",focusOnMount:!0,noArrow:!1}},(function(e){var a=e.onClose;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(u.MenuGroup,null,n.map((function(e){return(0,s.createElement)(u.MenuItem,{key:e,onClick:function(){r(e),a()},isSelected:e===t,variant:e===t?"primary":""},e||String.fromCharCode(8212))})),(0,s.createElement)(u.MenuItem,{onClick:function(){window.open("https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units","_blank").focus()},label:(0,m.__)("Learn more about units","generatepress"),showTooltip:!0},xe("info"))))})))):null}var ri=["px","em","%","rem","vw","vh","ch","cm","mm","in","pt","pc","ex","lh","rlh","vmin","vmax","vb","vi","svw","svh","svb","svi","svmax","svmin","lvw","lvh","lvb","lvi","lvmax","lvmin","dvw","dvh","dvb","dvi","dvmax","dvmin","fr"];function ai(e){var t=e.label,r=e.units,a=void 0===r?[]:r,n=e.defaultUnit,i=void 0===n?"":n,o=e.unitCount,c=void 0===o?7:o,g=e.id,d=e.disabled,f=void 0!==d&&d,p=e.overrideValue,v=void 0===p?null:p,h=e.overrideAction,m=void 0===h?function(){return null}:h,b=e.onChange,S=e.value,w=e.placeholder,O=e.help,C=void 0===O?"":O,E=e.focusOnMount,D=void 0!==E&&E,N=e.onFocus,x=void 0===N?function(){return null}:N,T=a.concat(ri).slice(0,c),I=y((0,l.useState)(""),2),M=I[0],k=I[1],P=y((0,l.useState)(""),2),_=P[0],R=P[1],L=y((0,l.useState)(""),2),A=L[0],F=L[1],j=(0,l.useRef)(!1),B=(0,l.useRef)(!1),V=(0,l.useRef)(!1),H=function(e){var t=ri.join("|"),r=new RegExp("(".concat(t,")"));return e?e.toString().toLowerCase().split(r).filter((function(e){return""!==e})):[]},z=function(e){return e.length>0?e[0].trim():""},U=i||T[0],G=function(e){return e.length>1?e[1]:e.length>0?"":e.length?void 0:U},K=function(e){return/^([-]?\d|[-]?\.)/.test(e)},$=function(){if(!S){var e=H(v||w);F(z(e)),k(G(e))}};return(0,l.useEffect)((function(){var e=v&&f?v:S;if(K(e)){var t=H(e);R(z(t)),k(G(t))}else R(e),k("");$()}),[S,v]),(0,l.useEffect)((function(){if(j.current){var e=!!v&&!!f,t=K(_)?_+M:_;t||(M!==G(H(w))?F(""):$()),e||t===S||b(t)}else j.current=!0}),[_,M]),(0,l.useEffect)((function(){D&&null!=V&&V.current&&V.current.focus()}),[t]),(0,s.createElement)(u.BaseControl,{label:t,help:C,id:g,className:ei()({"gblocks-unit-control":!0,"gblocks-unit-control__disabled":!!f})},(0,s.createElement)("div",{className:"gblocks-unit-control__input",ref:B},(0,s.createElement)(u.TextControl,{type:"text",value:_,placeholder:A,id:g,autoComplete:"off",disabled:f,onChange:function(e){return R(e)},onFocus:function(){x()},ref:V}),(0,s.createElement)("div",{className:"gblocks-unit-control__input--action"},!!m&&(0,s.createElement)("div",{className:"gblocks-unit-control__override-action"},m()," "),(K(_)||!_&&(!A||K(A)))&&(0,s.createElement)(ti,{value:M,disabled:f||1===T.length,units:T,onChange:function(e){return k(e)}}))))}var ni=function(e){var t=e.label,r=e.units,a=e.defaultUnit,n=void 0===a?"":a,i=e.desktopValue,o=e.desktopInitial,c=e.desktopOnChange,g=e.tabletValue,d=e.tabletInitial,f=e.tabletOnChange,p=e.mobileInitial,v=e.mobileValue,h=e.mobileOnChange,m=y((0,l.useState)("desktop"),2),b=m[0],S=m[1];return(0,s.createElement)(u.BaseControl,null,(0,s.createElement)(Zn,{label:t,devices:["desktop","tablet","mobile"],onClick:function(e){return S(e)}}),(0,s.createElement)("div",{className:"generate-component-input-with-unit"},(0,s.createElement)("div",{className:"generate-component-device-field","data-device":"desktop"},(0,s.createElement)(ai,{key:b,units:r,value:i,placeholder:o,onChange:c,defaultUnit:n})),(0,s.createElement)("div",{className:"generate-component-device-field","data-device":"tablet"},(0,s.createElement)(ai,{key:b,units:r,value:g,placeholder:d,onChange:f,defaultUnit:n})),(0,s.createElement)("div",{className:"generate-component-device-field","data-device":"mobile"},(0,s.createElement)(ai,{key:b,units:r,value:v,placeholder:p,onChange:h,defaultUnit:n}))))},ii=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:(0,m.__)("Font size","generatepress"),desktopValue:t.fontSize,desktopInitial:jn(t,"fontSize"),desktopOnChange:function(e){r("fontSize",e,t.index)},tabletValue:t.fontSizeTablet,tabletInitial:jn(t,"fontSizeTablet"),tabletOnChange:function(e){r("fontSizeTablet",e,t.index)},mobileValue:t.fontSizeMobile,mobileInitial:jn(t,"fontSizeMobile"),mobileOnChange:function(e){r("fontSizeMobile",e,t.index)}})},oi=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:(0,m.__)("Line Height","generatepress"),units:[""],defaultUnit:"em",desktopValue:t.lineHeight,desktopInitial:jn(t,"lineHeight"),desktopOnChange:function(e){r("lineHeight",e,t.index)},tabletValue:t.lineHeightTablet,tabletInitial:jn(t,"lineHeightTablet"),tabletOnChange:function(e){r("lineHeightTablet",e,t.index)},mobileValue:t.lineHeightMobile,mobileInitial:jn(t,"lineHeightMobile"),mobileOnChange:function(e){r("lineHeightMobile",e,t.index)}})},si=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:(0,m.__)("Letter Spacing","generatepress"),defaultUnit:"em",desktopValue:t.letterSpacing,desktopInitial:jn(t,"letterSpacing"),desktopOnChange:function(e){r("letterSpacing",e,t.index)},tabletValue:t.letterSpacingTablet,tabletInitial:jn(t,"letterSpacingTablet"),tabletOnChange:function(e){r("letterSpacingTablet",e,t.index)},mobileValue:t.letterSpacingMobile,mobileInitial:jn(t,"letterSpacingMobile"),mobileOnChange:function(e){r("letterSpacingMobile",e,t.index)}})},li=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:"body"===t.selector?(0,m.__)("Paragraph Bottom Margin","generatepress"):(0,m.__)("Bottom Margin","generatepress"),defaultUnit:"em",desktopValue:t.marginBottom,desktopInitial:jn(t,"marginBottom"),desktopOnChange:function(e){r("marginBottom",e,t.index)},tabletValue:t.marginBottomTablet,tabletInitial:jn(t,"marginBottomTablet"),tabletOnChange:function(e){r("marginBottomTablet",e,t.index)},mobileValue:t.marginBottomMobile,mobileInitial:jn(t,"marginBottomMobile"),mobileOnChange:function(e){r("marginBottomMobile",e,t.index)}})},ci=function(e){var t=e.index,r=e.value,a=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Text Decoration","generatepress"),value:r,options:[{value:"",label:(0,m.__)("Default","generatepress")},{value:"none",label:(0,m.__)("None","generatepress")},{value:"underline",label:(0,m.__)("Underline","generatepress")}],onChange:function(e){a("textDecoration",e,t)}})},ui=function(e){var t=e.font,r=e.toggleClose,a=e.onChangeFontValue,n=e.onChangeElement;return(0,s.createElement)("div",{className:"generate-customize-control--font-dropdown"},(0,s.createElement)(Kn,{index:t.index,value:t.selector,onChange:n}),!!t.selector&&(0,s.createElement)(s.Fragment,null,"custom"===t.selector&&(0,s.createElement)($n,{index:t.index,value:t.customSelector,onChange:a}),(0,s.createElement)(Wn,{index:t.index,value:t.fontFamily,onChange:a}),(0,s.createElement)("div",{className:"components-base-control generate-font-manager--select-options"},(0,s.createElement)(Yn,{index:t.index,value:t.fontWeight,fontFamily:t.fontFamily,onChange:a}),(0,s.createElement)(Jn,{index:t.index,value:t.textTransform,onChange:a}),(0,s.createElement)(Xn,{index:t.index,value:t.fontStyle,onChange:a}),(0,s.createElement)(ci,{index:t.index,value:t.textDecoration,onChange:a})),(0,s.createElement)(ii,{font:t,onChange:a}),(0,s.createElement)(oi,{font:t,onChange:a}),(0,s.createElement)(si,{font:t,onChange:a}),Bn(t.selector)&&(0,s.createElement)(li,{font:t,onChange:a})),(0,s.createElement)("div",{className:"generate-font-manager--footer"},(0,s.createElement)(u.Button,{isSecondary:!0,isSmall:!0,onClick:r},(0,m.__)("Close","generatepress"))))},gi=function(e){var t=e.font,r=e.label,a=e.itemId,n=e.setOpen,i=e.isOpen,o=e.deleteFont,l=e.toggleClose,c=e.onChangeFontValue,u=e.onChangeElement;return(0,s.createElement)("div",{className:"generate-font-manager--item"},(0,s.createElement)("div",{className:"generate-font-manager--header"},(0,s.createElement)(zn,{font:t,itemId:a,setOpen:n,isOpen:i,label:r}),(0,s.createElement)(Un,{itemId:a,setOpen:n,isOpen:i}),(0,s.createElement)(Gn,{onClick:o.bind(null,t.index),isOpen:i,itemId:a})),a===i&&(0,s.createElement)(ui,{font:t,toggleClose:l,onChangeFontValue:c,onChangeElement:u}))};function di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}var fi=function(e){var t,r,a=e.fontList,n=("group","other",a.reduce((function(e,t,r){var a=t.group||"other";return t.index=r,e[a]=e[a]||[],e[a].push(t),e}),{}));return t=Vn(),r=function(t,r){var a,i=null!==(a=n[r])&&void 0!==a?a:[];if(0!==i.length)return(0,s.createElement)("div",{className:"generate-font-manager-group",key:r},(0,s.createElement)("h4",{className:"generate-font-manager-group__label"},t),i.map((function(t){return(0,s.createElement)(gi,function(e){for(var t=1;t0&&b.push({label:(0,m.__)("Google Fonts","generatepress"),options:Object.keys(Ae).map((function(e){return{value:e,label:e}}))}),c.forEach((function(e){var t=e.googleFont&&generateCustomizerControls.showGoogleFonts&&h.length>0?1:0;b[t].options=b[t].options.filter((function(t){return t.value!==e.fontFamily}))}));var S=generateCustomizerControls.gpFontLibrary,w=generateCustomizerControls.gpFontLibraryURI;return(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),!!c.length>0&&c.map((function(t,r){var n=r+1,o=function(e){var t=Le(c),a=t[r];t[r]=Ln(Ln({},t[r]),{},{fontFamily:e}),d(t),void 0!==Ae[e]&&generateCustomizerControls.showGoogleFonts?(t[r]=Ln(Ln({},t[r]),{},{googleFont:!0,googleFontCategory:Ae[e].category,googleFontVariants:Ae[e].variants.join(", ")}),d(t)):(t[r]=Ln(Ln({},t[r]),{},{googleFont:!1,googleFontCategory:"",googleFontVariants:""}),d(t)),f(t[r].fontFamily,a.fontFamily)},l=c[r].fontFamily||"";return(0,s.createElement)("div",{className:"generate-font-manager--item",key:r},(0,s.createElement)("div",{className:"generate-font-manager--header"},(0,s.createElement)(u.Button,{className:"generate-font-manager--label",onClick:function(){i(n!==a&&n)}},c[r].fontFamily?c[r].fontFamily:e.label),(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Open Font Family Settings","generatepress")},(0,s.createElement)(u.Button,{className:"generate-font-manager--open",onClick:function(){i(n!==a&&n)}},xe(n===a?"chevron-up":"chevron-down"))),(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Delete Font Family","generatepress")},(0,s.createElement)(u.Button,{className:"generate-font-manager--delete-font",onClick:function(){if(window.confirm((0,m.__)("This will permanently delete this font family. Doing so will stop elements from displaying it as their font.","generatepress"))){var e=Le(c),t=e[r];f("",t.fontFamily),e.splice(r,1),d(e)}}},xe("trash")))),n===a&&(0,s.createElement)("div",{className:"generate-customize-control--font-dropdown"},(0,s.createElement)(u.BaseControl,{className:"generate-component-font-family-picker-wrapper",id:"generate-font-manager-family-name--input"},(0,s.createElement)(kn,{options:b,placeholder:(0,m.__)("Search fonts…","generatepress"),onChange:function(e){return o(e.value)}}),(0,s.createElement)(u.TextControl,{id:"generate-font-manager-family-name--input",className:"generate-font-manager-family-name--input",label:(0,m.__)("Font family name","generatepress"),value:l,onChange:function(e){var t;t=e,c.filter((function(e){return e.fontFamily===t})).length>0&&(alert((0,m.__)("Font already selected","generatepress")),e=""),o(e)}}),!!c[r].fontFamily&&!!generateCustomizerControls.showGoogleFonts&&(0,s.createElement)("div",{className:"generate-font-manager--options"},(0,s.createElement)(u.ToggleControl,{className:"generate-font-manager-google-font--field",label:(0,m.__)("Use Google Fonts API","generatepress"),checked:!!c[r].googleFont,onChange:function(e){var t=Le(c);t[r]=Ln(Ln({},t[r]),{},{googleFont:e}),d(t)}}),!!c[r].googleFont&&(0,s.createElement)("div",{className:"generate-font-manager--google-font-options"},(0,s.createElement)(u.TextControl,{label:(0,m.__)("Category","generatepress"),value:c[r].googleFontCategory||"",onChange:function(e){var t=Le(c);t[r]=Ln(Ln({},t[r]),{},{googleFontCategory:e}),d(t)}}),(0,s.createElement)(u.TextControl,{label:(0,m.__)("Variants","generatepress"),value:c[r].googleFontVariants||"",onChange:function(e){var t=Le(c);t[r]=Ln(Ln({},t[r]),{},{googleFontVariants:e}),d(t)}}))),(0,s.createElement)("div",{className:"generate-font-manager--footer"},(0,s.createElement)(u.Button,{isSecondary:!0,isSmall:!0,onClick:p},(0,m.__)("Close","generatepress"))))))})),!!S.length>0&&S.map((function(e,t){return(0,s.createElement)("div",{className:"generate-font-manager--item",key:t},(0,s.createElement)("div",{className:"generate-font-manager--header"},(0,s.createElement)("span",{className:"generate-font-manager--label"},e.name),!!w&&(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Font Library","generatepress")},(0,s.createElement)(u.Button,{className:"generate-font-manager--open",href:w},xe("chevron-right")))))})),(0,s.createElement)(u.Button,{isPrimary:!0,onClick:function(){var t=Le(e.value);t.push({fontFamily:"",googleFont:!1,googleFontApi:1,googleFontCategory:"",googleFontVariants:""}),d(t);var r=wp.customize.control(e.customizerSetting.id).setting.get().length;i(r)}},(0,m.__)("Add Font","generatepress")))})),mi=p.extend((function(e){var t=e.value,r=y((0,l.useState)([]),2),a=r[0],i=r[1],o=y((0,l.useState)(0),2),c=o[0],g=o[1];(0,l.useEffect)((function(){var e=[];Array.isArray(t)?e=t:"object"===n(t)&&(e=Object.values(t)),i(e),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!1;e.forEach((function(r,a){var n=function(e){var t={};return["fontSize","lineHeight","letterSpacing","marginBottom"].forEach((function(r){var a=e[r+"Unit"]||"";["","Tablet","Mobile"].forEach((function(n){var i=r+n;"number"==typeof e[i]&&(t[i]=String(e[i]+a))})),a&&(t[r+"Unit"]="")})),t}(r);(0,pi.isEmpty)(n)||(e[a]=hi(hi({},e[a]),n),t=!0)})),t&&i(e)}(e)}),[]);var d=function(t){i(t),wp.customize.control(e.customizerSetting.id).setting.set(t)};return(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),(0,s.createElement)(fi,{fontList:a,setOpen:g,isOpen:c,label:e.label,deleteFont:function(e){var t=Le(a);t.splice(e,1),d(t)},toggleClose:function(){return g(0)},onChangeFontValue:function(e,t,r){var n=Le(a);n[r]=hi({},n[r]),n[r][e]=t,d(n)},onChangeElement:function(e,t){var r=e.value,n=e.group,i=e.module,o=Le(a);o[t]=hi(hi({},o[t]),{},{selector:r,module:i,group:n}),Bn(r)||(o[t]=hi(hi({},o[t]),{},{marginBottom:"",marginBottomTablet:"",marginBottomMobile:"",marginBottomUnit:""})),d(o)}}),(0,s.createElement)(u.Button,{isPrimary:!0,onClick:function(){var t=Le(e.value);t.push({selector:"",customSelector:"",fontFamily:"",fontWeight:"",textTransform:"",textDecoration:"",fontStyle:"",fontSize:"",fontSizeTablet:"",fontSizeMobile:"",lineHeight:"",lineHeightTablet:"",lineHeightMobile:"",letterSpacing:"",letterSpacingTablet:"",letterSpacingMobile:""}),d(t),g(t.length)}},(0,m.__)("Add Typography","generatepress")))}));function bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Si(e){for(var t=1;t=0;a--)if(t.canDragSource(e[a])){r=e[a];break}return r}(t,o);if(null==l)return void e.dispatch(Gi);let c=null;if(n){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){Li("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),c=i(l)}e.dispatch(Ui(n,c));const u=s.getSource(l).beginDrag(o,l);if(null==u)return;!function(e){Li(Ai(e),"Item must be an object.")}(u),s.pinSource(l);const g=s.getSourceType(l);return{type:ji,payload:{itemType:g,item:u,sourceId:l,clientOffset:n||null,sourceClientOffset:c||null,isSourcePublic:!!a}}}}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wi(e){for(var t=1;t{const o=function(e,t,r,a){const n=r.getTarget(e);let i=n?n.drop(a,e):void 0;return function(e){Li(void 0===e||Ai(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:a.getDropResult()),i}(n,i,a,r),s={type:Hi,payload:{dropResult:Wi({},t,o)}};e.dispatch(s)}))}}function Yi(e){return function(){const t=e.getMonitor(),r=e.getRegistry();!function(e){Li(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const a=t.getSourceId();return null!=a&&(r.getSource(a,!0).endDrag(t,a),r.unpinSource()),{type:zi}}}function Ji(e,t){return null===t?null===e:Array.isArray(e)?e.some((e=>e===t)):e===t}function Xi(e){return function(t,{clientOffset:r}={}){!function(e){Li(Array.isArray(e),"Expected targetIds to be an array.")}(t);const a=t.slice(0),n=e.getMonitor(),i=e.getRegistry();return function(e,t,r){for(let a=e.length-1;a>=0;a--){const n=e[a];Ji(t.getTargetType(n),r)||e.splice(a,1)}}(a,i,n.getItemType()),function(e,t,r){Li(t.isDragging(),"Cannot call hover while not dragging."),Li(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t{const i=r[n];var o;return a[n]=(o=i,(...r)=>{const a=o.apply(e,r);void 0!==a&&t(a)}),a}),{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function eo(e,t){return{x:e.x-t.x,y:e.y-t.y}}const to=[],ro=[];to.__IS_NONE__=!0,ro.__IS_ALL__=!0;class ao{subscribeToStateChange(e,t={}){const{handlerIds:r}=t;Li("function"==typeof e,"listener must be a function."),Li(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;return this.store.subscribe((()=>{const t=this.store.getState(),n=t.stateId;try{const i=n===a||n===a+1&&!function(e,t){if(e===to)return!1;if(e===ro||void 0===t)return!0;const r=(a=e,t.filter((e=>a.indexOf(e)>-1)));var a;return r.length>0}(t.dirtyHandlerIds,r);i||e()}finally{a=n}}))}subscribeToOffsetChange(e){Li("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe((()=>{const r=this.store.getState().dragOffset;r!==t&&(t=r,e())}))}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return Li(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);return Li(t,`Expected to find a valid target. targetId=${e}`),!(!this.isDragging()||this.didDrop())&&(Ji(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);return Li(t,`Expected to find a valid source. sourceId=${e}`),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:r}=t;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),n=this.getItemType();if(n&&!Ji(a,n))return!1;const i=this.getTargetIds();if(!i.length)return!1;const o=i.indexOf(e);return r?o===i.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:a}=e;return t&&r&&a?eo(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,a),r):null}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:r}=e;return t&&r?eo(t,r):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}const no="undefined"!=typeof global?global:self,io=no.MutationObserver||no.WebKitMutationObserver;function oo(e){return function(){const t=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(t),clearInterval(r),e()}}}const so="function"==typeof io?function(e){let t=1;const r=new io(e),a=document.createTextNode("");return r.observe(a,{characterData:!0}),function(){t=-t,a.data=t}}:oo;class lo{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const co=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.indexthis.capacity){for(let t=0,r=e.length-this.index;t{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=so(this.flush),this.requestErrorThrow=oo((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},uo=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new lo(this.onError,(e=>t[t.length]=e));return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}(co.registerPendingError),go="dnd-core/ADD_SOURCE",fo="dnd-core/ADD_TARGET",po="dnd-core/REMOVE_SOURCE",vo="dnd-core/REMOVE_TARGET";function ho(e,t){t&&Array.isArray(e)?e.forEach((e=>ho(e,!1))):Li("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var yo;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(yo||(yo={}));let mo=0;function bo(e){switch(e[0]){case"S":return yo.SOURCE;case"T":return yo.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function So(e,t){const r=e.entries();let a=!1;do{const{done:e,value:[,n]}=r.next();if(n===t)return!0;a=!!e}while(!a);return!1}class wo{addSource(e,t){ho(e),function(e){Li("function"==typeof e.canDrag,"Expected canDrag to be a function."),Li("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Li("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const r=this.addHandler(yo.SOURCE,e,t);return this.store.dispatch(function(e){return{type:go,payload:{sourceId:e}}}(r)),r}addTarget(e,t){ho(e,!0),function(e){Li("function"==typeof e.canDrop,"Expected canDrop to be a function."),Li("function"==typeof e.hover,"Expected hover to be a function."),Li("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const r=this.addHandler(yo.TARGET,e,t);return this.store.dispatch(function(e){return{type:fo,payload:{targetId:e}}}(r)),r}containsHandler(e){return So(this.dragSources,e)||So(this.dropTargets,e)}getSource(e,t=!1){return Li(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Li(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return Li(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return Li(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return bo(e)===yo.SOURCE}isTargetId(e){return bo(e)===yo.TARGET}removeSource(e){var t;Li(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:po,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},co.enqueueTask(uo.create(t))}removeTarget(e){Li(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:vo,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);Li(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){Li(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,r){const a=function(e){const t=(mo++).toString();switch(e){case yo.SOURCE:return`S${t}`;case yo.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}(e);return this.types.set(a,t),e===yo.SOURCE?this.dragSources.set(a,r):e===yo.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Oo=(e,t)=>e===t;function Co(e=to,t){switch(t.type){case Vi:break;case go:case fo:case vo:case po:return to;default:return ro}const{targetIds:r=[],prevTargetIds:a=[]}=t.payload,n=function(e,t){const r=new Map,a=e=>{r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(a),t.forEach(a);const n=[];return r.forEach(((e,t)=>{1===e&&n.push(t)})),n}(r,a),i=n.length>0||!function(e,t,r=Oo){if(e.length!==t.length)return!1;for(let a=0;ae!==n)))});case Hi:return To({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case zi:return To({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var a,n}function ko(e=0,t){switch(t.type){case go:case fo:return e+1;case po:case vo:return e-1;default:return e}}function Po(e=0){return e+1}function _o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ro(e){for(var t=1;te&&e[t]?e[t]:a||null),r))})}),dragOffset:No(e.dragOffset,t),refCount:ko(e.refCount,t),dragOperation:Mo(e.dragOperation,t),stateId:Po(e.stateId)};var r,a}function Ao(e,t=void 0,r={},a=!1){const n=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return Ri(Lo,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(a),i=new ao(n,new wo(n)),o=new Qi(n,i),s=e(o,t,r);return o.receiveBackend(s),o}const Fo=(0,s.createContext)({dragDropManager:void 0});let jo=0;const Bo=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Vo=(0,s.memo)((function(e){var{children:t}=e,r=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,["children"]);const[a,n]=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=function(e,t=Ho(),r,a){const n=t;return n[Bo]||(n[Bo]={dragDropManager:Ao(e,t,r,a)}),n[Bo]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(r);return(0,s.useEffect)((()=>{if(n){const e=Ho();return++jo,()=>{0==--jo&&(e[Bo]=null)}}}),[]),(0,Ii.jsx)(Fo.Provider,{value:a,children:t})}));function Ho(){return"undefined"!=typeof global?global:window}function zo(e){let t=null;return()=>(null==t&&(t=e()),t)}class Uo{enter(e){const t=this.entered.length;return this.entered=function(e,t){const r=new Set,a=e=>r.add(e);e.forEach(a),t.forEach(a);const n=[];return r.forEach((e=>n.push(e))),n}(this.entered.filter((t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e)))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var r,a;return this.entered=(r=this.entered.filter(this.isNodeInDocument),a=e,r.filter((e=>e!==a))),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Go{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach((e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})}))}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach((r=>{const a=this.config.exposeProperties[r];null!=a&&(t[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})})),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Ko="__NATIVE_FILE__",$o="__NATIVE_URL__",Wo="__NATIVE_TEXT__",qo="__NATIVE_HTML__";function Yo(e,t,r){const a=t.reduce(((t,r)=>t||e.getData(r)),"");return null!=a?a:r}const Jo={[Ko]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[qo]:{exposeProperties:{html:(e,t)=>Yo(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[$o]:{exposeProperties:{urls:(e,t)=>Yo(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Wo]:{exposeProperties:{text:(e,t)=>Yo(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Xo(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Jo).filter((e=>{const r=Jo[e];return!!(null==r?void 0:r.matchesTypes)&&r.matchesTypes.some((e=>t.indexOf(e)>-1))}))[0]||null}const Zo=zo((()=>/firefox/i.test(navigator.userAgent))),Qo=zo((()=>Boolean(window.safari)));class es{interpolate(e){const{xs:t,ys:r,c1s:a,c2s:n,c3s:i}=this;let o=t.length-1;if(e===t[o])return r[o];let s,l=0,c=i.length-1;for(;l<=c;){s=Math.floor(.5*(l+c));const a=t[s];if(ae))return r[s];c=s-1}}o=Math.max(0,c);const u=e-t[o],g=u*u;return r[o]+a[o]*u+n[o]*g+i[o]*u*g}constructor(e,t){const{length:r}=e,a=[];for(let e=0;ee[t]{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,r){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);const a=t=>this.handleDragStart(t,e),n=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",a),t.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",a),t.removeEventListener("selectstart",n),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const r=t=>this.handleDragEnter(t,e),a=t=>this.handleDragOver(t,e),n=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",r),t.addEventListener("dragover",a),t.addEventListener("drop",n),()=>{t.removeEventListener("dragenter",r),t.removeEventListener("dragover",a),t.removeEventListener("drop",n)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return os({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return os({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(a).some((t=>a[t]===e))}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const r=Jo[e];if(!r)throw new Error(`native type ${e} has no configuration`);const a=new Go(r);return a.loadDataTransfer(t),a}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}clearCurrentDragSourceNode(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&rs(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame((()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null})))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const r=as(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=e,n=Xo(a);if(this.monitor.isDragging()){if(a&&"function"==typeof a.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),n=this.sourcePreviewNodes.get(e)||t;if(n){const{anchorX:e,anchorY:i,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),l=function(e,t,r,a,n){const i=function(e){var t;return"IMG"===e.nodeName&&(Zo()||!(null===(t=document.documentElement)||void 0===t?void 0:t.contains(e)))}(t),o=rs(i?e:t),s={x:r.x-o.x,y:r.y-o.y},{offsetWidth:l,offsetHeight:c}=e,{anchorX:u,anchorY:g}=a,{dragPreviewWidth:d,dragPreviewHeight:f}=function(e,t,r,a){let n=e?t.width:r,i=e?t.height:a;return Qo()&&e&&(i/=window.devicePixelRatio,n/=window.devicePixelRatio),{dragPreviewWidth:n,dragPreviewHeight:i}}(i,t,l,c),{offsetX:p,offsetY:v}=n,h=0===v||v;return{x:0===p||p?p:new es([0,.5,1],[s.x,s.x/l*d,s.x+d-l]).interpolate(u),y:h?v:(()=>{let e=new es([0,.5,1],[s.y,s.y/c*f,s.y+f-c]).interpolate(g);return Qo()&&i&&(e+=(window.devicePixelRatio-1)*f),e})()}}(t,n,r,{anchorX:e,anchorY:i},{offsetX:o,offsetY:s});a.setDragImage(n,l.x,l.y)}}try{null==a||a.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout((()=>this.actions.publishDragSource()),0)}else if(n)this.beginDragNativeItem(n);else{if(a&&!a.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)),!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:r}=e,a=Xo(r);a&&this.beginDragNativeItem(a,r)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:as(e)}),t.some((e=>this.monitor.canDropOnTarget(e)))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{var t;this.dragOverTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=as(e),this.scheduleHover(t),(t||[]).some((e=>this.monitor.canDropOnTarget(e)))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout((()=>this.endDragNativeItem()),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;this.dropTargetIds=[],this.isDraggingNativeItem()?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Xo(e.dataTransfer)&&e.preventDefault(),this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:as(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new ns(t,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Uo(this.isNodeInDocument)}}const ls=function(e,t,r){return new ss(e,t,r)};var cs=r(17);const us="undefined"!=typeof window?s.useLayoutEffect:s.useEffect;function gs(e,t,r){return function(e,t,r){const[a,n]=function(e,t,r){const[a,n]=(0,s.useState)((()=>t(e))),i=(0,s.useCallback)((()=>{const i=t(e);cs(a,i)||(n(i),r&&r())}),[a,e,r]);return us(i),[a,i]}(e,t,r);return us((function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(n,{handlerIds:[t]})}),[e,n]),a}(t,e||(()=>({})),(()=>r.reconnect()))}function ds(e,t){const r=[...t||[]];return null==t&&"function"!=typeof e&&r.push(e),(0,s.useMemo)((()=>"function"==typeof e?e():e),r)}function fs(e){return(0,s.useMemo)((()=>e.hooks.dropTarget()),[e])}function ps(e,t,r,a){let n=r?r.call(a,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o{const a=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const e=function(e){return(t=null,r=null)=>{if(!(0,s.isValidElement)(t)){const a=t;return e(a,r),a}const a=t;!function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a
, or turn it into a drag source or a drop target itself.`)}(a);const n=r?t=>e(t,r):e;return function(e,t){const r=e.ref;return Li("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?(0,s.cloneElement)(e,{ref:e=>{ys(r,e),ys(t,e)}}):(0,s.cloneElement)(e,{ref:t})}(a,n)}}(a);t[r]=()=>e}})),t}function ys(e,t){"function"==typeof e?e(t):e.current=t}class ms{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!ps(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=hs({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,vs(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function bs(){const{dragDropManager:e}=(0,s.useContext)(Fo);return Li(null!=e,"Expected drag drop context"),e}let Ss=!1;class ws{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;Li(!Ss,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ss=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ss=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}class Os{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Cs(e,t){const r=ds(e,t),a=function(){const e=bs();return(0,s.useMemo)((()=>new ws(e)),[e])}(),n=function(e){const t=bs(),r=(0,s.useMemo)((()=>new ms(t.getBackend())),[t]);return us((()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget())),[e]),r}(r.options);return function(e,t,r){const a=bs(),n=function(e,t){const r=(0,s.useMemo)((()=>new Os(e,t)),[t]);return(0,s.useEffect)((()=>{r.spec=e}),[e]),r}(e,t),i=function(e){const{accept:t}=e;return(0,s.useMemo)((()=>(Li(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t])),[t])}(e);us((function(){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addTarget(e,t);return[n,()=>a.removeTarget(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}),[a,t,n,r,i.map((e=>e.toString())).join("|")])}(r,a,n),[gs(r.collect,a,n),fs(n)]}function Es(e){return(0,s.useMemo)((()=>e.hooks.dragSource()),[e])}function Ds(e){return(0,s.useMemo)((()=>e.hooks.dragPreview()),[e])}class Ns{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();r&&this.disconnectDragPreview(),this.handlerId&&(t?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!ps(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ps(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=hs({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,vs(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,vs(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}let xs=!1,Ts=!1;class Is{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){Li(!xs,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return xs=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{xs=!1}}isDragging(){if(!this.sourceId)return!1;Li(!Ts,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ts=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ts=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}class Ms{beginDrag(){const e=this.spec,t=this.monitor;let r=null;return r="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=r?r:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const r=this.spec,a=this.monitor,{isDragging:n}=r;return n?n(a):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,r=this.connector,{end:a}=e;a&&a(t.getItem(),t),r.reconnect()}constructor(e,t,r){this.spec=e,this.monitor=t,this.connector=r}}function ks(e,t){const r=ds(e,t);Li(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const a=function(){const e=bs();return(0,s.useMemo)((()=>new Is(e)),[e])}(),n=function(e,t){const r=bs(),a=(0,s.useMemo)((()=>new Ns(r.getBackend())),[r]);return us((()=>(a.dragSourceOptions=e||null,a.reconnect(),()=>a.disconnectDragSource())),[a,e]),us((()=>(a.dragPreviewOptions=t||null,a.reconnect(),()=>a.disconnectDragPreview())),[a,t]),a}(r.options,r.previewOptions);return function(e,t,r){const a=bs(),n=function(e,t,r){const a=(0,s.useMemo)((()=>new Ms(e,t,r)),[t,r]);return(0,s.useEffect)((()=>{a.spec=e}),[e]),a}(e,t,r),i=function(e){return(0,s.useMemo)((()=>{const t=e.type;return Li(null!=t,"spec.type must be defined"),t}),[e])}(e);us((function(){if(null!=i){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addSource(e,t);return[n,()=>a.removeSource(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}}),[a,t,r,n,i])}(r,a,n),[gs(r.collect,a,n),Es(n),Ds(n)]}function Ps(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _s(e){var t=e.id,r=e.itemType,a=e.onDrop,n=e.getIndex,i=e.className,l=e.innerComponentProps,c=e.InnerComponent,u=y(ks((function(){return{type:r,item:{id:t},collect:function(e){return{isDragging:e.isDragging()}}}}),[t]),2),g=u[0].isDragging,d=u[1],f=Cs((function(){return{accept:r,hover:function(e){var r=e.id;if(r!==t){var i=n(t);a(r,i)}}}}),[n,a]),p=y(f,2)[1],v=g?"0.2":1;return(0,s.createElement)("div",{ref:function(e){return d(p(e))},className:i,style:{opacity:v}},c&&(0,s.createElement)(c,function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return r({type:"ADD_COLOR",payload:Object.assign({},wi,{slug:e,color:t})})},deleteColor:function(e){return r({type:"DELETE_COLOR",payload:e})},updateColorValue:function(e,t){return r({type:"UPDATE_COLOR_VALUE",payload:{slug:e,value:t}})},updateColorSlug:function(e,t){return r({type:"UPDATE_COLOR_SLUG",payload:{slug:e,value:t}})}}}(),r=t.colors,a=t.setColors,n=t.addColor,i=t.deleteColor,o=t.updateColorValue,c=t.updateColorSlug,u=y((0,l.useState)(!1),2),g=u[0],d=u[1],f=y((0,l.useState)(!1),2),p=f[0],v=f[1],h=y((0,l.useState)([]),2),b=h[0],S=h[1];(0,l.useEffect)((function(){var t=(0,pi.isObject)(e.value)?Object.values(e.value):e.value;a(t),d(!0)}),[]),(0,l.useEffect)((function(){var t,a;g&&(a=[],(t=r).length>0&&t.forEach((function(e){a.push({name:e.slug,slug:e.slug,color:"var(--"+e.slug+")"})})),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(a)),function(t){wp.customize.control(e.customizerSetting.id).setting.set(t);var r=":root {";t.length>0&&t.forEach((function(e){var t=e.slug.replace(" ","-").toLowerCase();r+="--"+t+": "+e.color+";"})),r+="}";var a=document.getElementById("generate-global-color-styles");a?a.innerHTML=r:document.body.insertAdjacentHTML("beforeend",'")}(r))}),[JSON.stringify(r),g]);var w=(0,l.useCallback)((function(){n(function e(t){var a="global-color-".concat(t+1);return-1===(0,pi.findIndex)(r,{slug:a})?a:e(t+1)}(r.length))}),[r.length]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),(0,s.createElement)("div",{className:"generate-color-manager-wrapper"},(0,s.createElement)("div",{className:"generate-color-manager--item"},(0,s.createElement)(Ni,{onClick:w,disabled:p})),(0,s.createElement)("div",{className:"generate-color-manager--item"},(0,s.createElement)(Ei,{id:"add-color",icon:p?"check":"reorder",text:p?(0,m.__)("Finish re-ordering","generatepress"):(0,m.__)("Re-order colors","generatepress"),onClick:function(e){e.preventDefault(),p&&(a(b),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(b))),v(!p)}}))),p?(0,s.createElement)(Ls,{listData:r,idKey:"slug",listClassName:"generate-color-manager-dnd-list",itemClassName:"generate-color-manager-dnd-list-item",InnerComponent:As,onChangeData:S}):(0,s.createElement)(Ti,{colors:r,onChangeColor:o,onChangeSlug:c,onClickDeleteColor:i}))}));wp.customize.controlConstructor["generate-color-manager-control"]=Fs;var js=function(e){var t=y((0,l.useState)(!1),2),r=t[0],a=t[1],n=function(){e.choices.sectionRedirect?wp.customize.section(e.choices.toggleId).focus():document.querySelectorAll('[data-toggleId="'+e.choices.toggleId+'"]').forEach((function(e){r?(e.style.display="",a(!1)):(e.style.display="block",a(!0))}))},i=e.choices.tooltipText?e.choices.tooltipText:(0,m.sprintf)((0,m.__)("Open %s Settings","generatepress"),e.choices.title),o=e.choices.sectionRedirect?"chevron-right":"chevron-down";return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"generate-customize-control-title"},!!e.choices.toggleId&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(u.Tooltip,{text:i},(0,s.createElement)(u.Button,{className:"generate-customize-control-title--label",onClick:n},e.choices.title)),(0,s.createElement)(u.Tooltip,{text:i},(0,s.createElement)(u.Button,{className:"generate-customize-control-title--toggle",onClick:n},xe(r?"chevron-up":o)))),!e.choices.toggleId&&(0,s.createElement)("h3",null,e.choices.title)))};function Bs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Vs(e){for(var t=1;t=i)&&Object.keys(a.O).every((function(e){return a.O[e](r[l])}))?r.splice(l--,1):(s=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,n,i]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={242:0,863:0};a.O.j=function(t){return 0===e[t]};var t=function(t,r){var n,i,o=r[0],s=r[1],l=r[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);if(l)var u=l(a)}for(t&&t(r);c0?e[0].trim():""},U=i||T[0],G=function(e){return e.length>1?e[1]:e.length>0?"":e.length?void 0:U},K=function(e){return/^([-]?\d|[-]?\.)/.test(e)},$=function(){if(!S){var e=H(v||w);F(z(e)),k(G(e))}};return(0,l.useEffect)((function(){var e=v&&f?v:S;if(K(e)){var t=H(e);R(z(t)),k(G(t))}else R(e),k("");$()}),[S,v]),(0,l.useEffect)((function(){if(j.current){var e=!!v&&!!f,t=K(_)?_+M:_;t||(M!==G(H(w))?F(""):$()),e||t===S||b(t)}else j.current=!0}),[_,M]),(0,l.useEffect)((function(){D&&null!=B&&B.current&&B.current.focus()}),[t]),(0,s.createElement)(u.BaseControl,{label:t,help:C,id:g,className:ei()({"gblocks-unit-control":!0,"gblocks-unit-control__disabled":!!f})},(0,s.createElement)("div",{className:"gblocks-unit-control__input",ref:V},(0,s.createElement)(u.TextControl,{type:"text",value:_,placeholder:A,id:g,autoComplete:"off",disabled:f,onChange:function(e){return R(e)},onFocus:function(){x()},ref:B}),(0,s.createElement)("div",{className:"gblocks-unit-control__input--action"},!!m&&(0,s.createElement)("div",{className:"gblocks-unit-control__override-action"},m()," "),(K(_)||!_&&(!A||K(A)))&&(0,s.createElement)(ti,{value:M,disabled:f||1===T.length,units:T,onChange:function(e){return k(e)}}))))}var ni=function(e){var t=e.label,r=e.units,a=e.defaultUnit,n=void 0===a?"":a,i=e.desktopValue,o=e.desktopInitial,c=e.desktopOnChange,g=e.tabletValue,d=e.tabletInitial,f=e.tabletOnChange,p=e.mobileInitial,v=e.mobileValue,h=e.mobileOnChange,m=y((0,l.useState)("desktop"),2),b=m[0],S=m[1];return(0,s.createElement)(u.BaseControl,null,(0,s.createElement)(Zn,{label:t,devices:["desktop","tablet","mobile"],onClick:function(e){return S(e)}}),(0,s.createElement)("div",{className:"generate-component-input-with-unit"},(0,s.createElement)("div",{className:"generate-component-device-field","data-device":"desktop"},(0,s.createElement)(ai,{key:b,units:r,value:i,placeholder:o,onChange:c,defaultUnit:n})),(0,s.createElement)("div",{className:"generate-component-device-field","data-device":"tablet"},(0,s.createElement)(ai,{key:b,units:r,value:g,placeholder:d,onChange:f,defaultUnit:n})),(0,s.createElement)("div",{className:"generate-component-device-field","data-device":"mobile"},(0,s.createElement)(ai,{key:b,units:r,value:v,placeholder:p,onChange:h,defaultUnit:n}))))},ii=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:(0,m.__)("Font size","generatepress"),desktopValue:t.fontSize,desktopInitial:jn(t,"fontSize"),desktopOnChange:function(e){r("fontSize",e,t.index)},tabletValue:t.fontSizeTablet,tabletInitial:jn(t,"fontSizeTablet"),tabletOnChange:function(e){r("fontSizeTablet",e,t.index)},mobileValue:t.fontSizeMobile,mobileInitial:jn(t,"fontSizeMobile"),mobileOnChange:function(e){r("fontSizeMobile",e,t.index)}})},oi=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:(0,m.__)("Line Height","generatepress"),units:[""],defaultUnit:"em",desktopValue:t.lineHeight,desktopInitial:jn(t,"lineHeight"),desktopOnChange:function(e){r("lineHeight",e,t.index)},tabletValue:t.lineHeightTablet,tabletInitial:jn(t,"lineHeightTablet"),tabletOnChange:function(e){r("lineHeightTablet",e,t.index)},mobileValue:t.lineHeightMobile,mobileInitial:jn(t,"lineHeightMobile"),mobileOnChange:function(e){r("lineHeightMobile",e,t.index)}})},si=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:(0,m.__)("Letter Spacing","generatepress"),defaultUnit:"em",desktopValue:t.letterSpacing,desktopInitial:jn(t,"letterSpacing"),desktopOnChange:function(e){r("letterSpacing",e,t.index)},tabletValue:t.letterSpacingTablet,tabletInitial:jn(t,"letterSpacingTablet"),tabletOnChange:function(e){r("letterSpacingTablet",e,t.index)},mobileValue:t.letterSpacingMobile,mobileInitial:jn(t,"letterSpacingMobile"),mobileOnChange:function(e){r("letterSpacingMobile",e,t.index)}})},li=function(e){var t=e.font,r=e.onChange;return(0,s.createElement)(ni,{label:"body"===t.selector?(0,m.__)("Paragraph Bottom Margin","generatepress"):(0,m.__)("Bottom Margin","generatepress"),defaultUnit:"em",desktopValue:t.marginBottom,desktopInitial:jn(t,"marginBottom"),desktopOnChange:function(e){r("marginBottom",e,t.index)},tabletValue:t.marginBottomTablet,tabletInitial:jn(t,"marginBottomTablet"),tabletOnChange:function(e){r("marginBottomTablet",e,t.index)},mobileValue:t.marginBottomMobile,mobileInitial:jn(t,"marginBottomMobile"),mobileOnChange:function(e){r("marginBottomMobile",e,t.index)}})},ci=function(e){var t=e.index,r=e.value,a=e.onChange;return(0,s.createElement)(u.SelectControl,{label:(0,m.__)("Text Decoration","generatepress"),value:r,options:[{value:"",label:(0,m.__)("Default","generatepress")},{value:"none",label:(0,m.__)("None","generatepress")},{value:"underline",label:(0,m.__)("Underline","generatepress")}],onChange:function(e){a("textDecoration",e,t)}})},ui=function(e){var t=e.font,r=e.toggleClose,a=e.onChangeFontValue,n=e.onChangeElement;return(0,s.createElement)("div",{className:"generate-customize-control--font-dropdown"},(0,s.createElement)(Kn,{index:t.index,value:t.selector,onChange:n}),!!t.selector&&(0,s.createElement)(s.Fragment,null,"custom"===t.selector&&(0,s.createElement)($n,{index:t.index,value:t.customSelector,onChange:a}),(0,s.createElement)(Wn,{index:t.index,value:t.fontFamily,onChange:a}),(0,s.createElement)("div",{className:"components-base-control generate-font-manager--select-options"},(0,s.createElement)(Yn,{index:t.index,value:t.fontWeight,fontFamily:t.fontFamily,onChange:a}),(0,s.createElement)(Jn,{index:t.index,value:t.textTransform,onChange:a}),(0,s.createElement)(Xn,{index:t.index,value:t.fontStyle,onChange:a}),(0,s.createElement)(ci,{index:t.index,value:t.textDecoration,onChange:a})),(0,s.createElement)(ii,{font:t,onChange:a}),(0,s.createElement)(oi,{font:t,onChange:a}),(0,s.createElement)(si,{font:t,onChange:a}),Vn(t.selector)&&(0,s.createElement)(li,{font:t,onChange:a})),(0,s.createElement)("div",{className:"generate-font-manager--footer"},(0,s.createElement)(u.Button,{isSecondary:!0,isSmall:!0,onClick:r},(0,m.__)("Close","generatepress"))))},gi=function(e){var t=e.font,r=e.label,a=e.itemId,n=e.setOpen,i=e.isOpen,o=e.deleteFont,l=e.toggleClose,c=e.onChangeFontValue,u=e.onChangeElement;return(0,s.createElement)("div",{className:"generate-font-manager--item"},(0,s.createElement)("div",{className:"generate-font-manager--header"},(0,s.createElement)(zn,{font:t,itemId:a,setOpen:n,isOpen:i,label:r}),(0,s.createElement)(Un,{itemId:a,setOpen:n,isOpen:i}),(0,s.createElement)(Gn,{onClick:o.bind(null,t.index),isOpen:i,itemId:a})),a===i&&(0,s.createElement)(ui,{font:t,toggleClose:l,onChangeFontValue:c,onChangeElement:u}))};function di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}var fi=function(e){var t,r,a=e.fontList,n=a.reduce((function(e,t,r){var a=t.group||"other";return t.index=r,e[a]=e[a]||[],e[a].push(t),e}),{});return t=Bn(),r=function(t,r){var a,i=null!==(a=n[r])&&void 0!==a?a:[];if(0!==i.length)return(0,s.createElement)("div",{className:"generate-font-manager-group",key:r},(0,s.createElement)("h4",{className:"generate-font-manager-group__label"},t),i.map((function(t){return(0,s.createElement)(gi,function(e){for(var t=1;t0&&b.push({label:(0,m.__)("Google Fonts","generatepress"),options:Object.keys(Ae).map((function(e){return{value:e,label:e}}))}),c.forEach((function(e){var t=e.googleFont&&generateCustomizerControls.showGoogleFonts&&h.length>0?1:0;b[t].options=b[t].options.filter((function(t){return t.value!==e.fontFamily}))}));var S=generateCustomizerControls.gpFontLibrary,w=generateCustomizerControls.gpFontLibraryURI;return(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),!!c.length>0&&c.map((function(t,r){var n=r+1,o=function(e){var t=Le(c),a=t[r];t[r]=Ln(Ln({},t[r]),{},{fontFamily:e}),d(t),void 0!==Ae[e]&&generateCustomizerControls.showGoogleFonts?(t[r]=Ln(Ln({},t[r]),{},{googleFont:!0,googleFontCategory:Ae[e].category,googleFontVariants:Ae[e].variants.join(", ")}),d(t)):(t[r]=Ln(Ln({},t[r]),{},{googleFont:!1,googleFontCategory:"",googleFontVariants:""}),d(t)),f(t[r].fontFamily,a.fontFamily)},l=c[r].fontFamily||"";return(0,s.createElement)("div",{className:"generate-font-manager--item",key:r},(0,s.createElement)("div",{className:"generate-font-manager--header"},(0,s.createElement)(u.Button,{className:"generate-font-manager--label",onClick:function(){i(n!==a&&n)}},c[r].fontFamily?c[r].fontFamily:e.label),(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Open Font Family Settings","generatepress")},(0,s.createElement)(u.Button,{className:"generate-font-manager--open",onClick:function(){i(n!==a&&n)}},xe(n===a?"chevron-up":"chevron-down"))),(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Delete Font Family","generatepress")},(0,s.createElement)(u.Button,{className:"generate-font-manager--delete-font",onClick:function(){if(window.confirm((0,m.__)("This will permanently delete this font family. Doing so will stop elements from displaying it as their font.","generatepress"))){var e=Le(c),t=e[r];f("",t.fontFamily),e.splice(r,1),d(e)}}},xe("trash")))),n===a&&(0,s.createElement)("div",{className:"generate-customize-control--font-dropdown"},(0,s.createElement)(u.BaseControl,{className:"generate-component-font-family-picker-wrapper",id:"generate-font-manager-family-name--input"},(0,s.createElement)(kn,{options:b,placeholder:(0,m.__)("Search fonts…","generatepress"),onChange:function(e){return o(e.value)}}),(0,s.createElement)(u.TextControl,{id:"generate-font-manager-family-name--input",className:"generate-font-manager-family-name--input",label:(0,m.__)("Font family name","generatepress"),value:l,onChange:function(e){var t;t=e,c.filter((function(e){return e.fontFamily===t})).length>0&&(alert((0,m.__)("Font already selected","generatepress")),e=""),o(e)}}),!!c[r].fontFamily&&!!generateCustomizerControls.showGoogleFonts&&(0,s.createElement)("div",{className:"generate-font-manager--options"},(0,s.createElement)(u.ToggleControl,{className:"generate-font-manager-google-font--field",label:(0,m.__)("Use Google Fonts API","generatepress"),checked:!!c[r].googleFont,onChange:function(e){var t=Le(c);t[r]=Ln(Ln({},t[r]),{},{googleFont:e}),d(t)}}),!!c[r].googleFont&&(0,s.createElement)("div",{className:"generate-font-manager--google-font-options"},(0,s.createElement)(u.TextControl,{label:(0,m.__)("Category","generatepress"),value:c[r].googleFontCategory||"",onChange:function(e){var t=Le(c);t[r]=Ln(Ln({},t[r]),{},{googleFontCategory:e}),d(t)}}),(0,s.createElement)(u.TextControl,{label:(0,m.__)("Variants","generatepress"),value:c[r].googleFontVariants||"",onChange:function(e){var t=Le(c);t[r]=Ln(Ln({},t[r]),{},{googleFontVariants:e}),d(t)}}))),(0,s.createElement)("div",{className:"generate-font-manager--footer"},(0,s.createElement)(u.Button,{isSecondary:!0,isSmall:!0,onClick:p},(0,m.__)("Close","generatepress"))))))})),!!S.length>0&&S.map((function(e,t){return(0,s.createElement)("div",{className:"generate-font-manager--item",key:t},(0,s.createElement)("div",{className:"generate-font-manager--header"},(0,s.createElement)("span",{className:"generate-font-manager--label"},e.name),!!w&&(0,s.createElement)(u.Tooltip,{text:(0,m.__)("Font Library","generatepress")},(0,s.createElement)(u.Button,{className:"generate-font-manager--open",href:w},xe("chevron-right")))))})),(0,s.createElement)(u.Button,{isPrimary:!0,onClick:function(){var t=Le(e.value);t.push({fontFamily:"",googleFont:!1,googleFontApi:1,googleFontCategory:"",googleFontVariants:""}),d(t);var r=wp.customize.control(e.customizerSetting.id).setting.get().length;i(r)}},(0,m.__)("Add Font","generatepress")))})),mi=p.extend((function(e){var t=e.value,r=y((0,l.useState)([]),2),a=r[0],i=r[1],o=y((0,l.useState)(0),2),c=o[0],g=o[1];(0,l.useEffect)((function(){var e=[];Array.isArray(t)?e=t:"object"===n(t)&&(e=Object.values(t)),i(e),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=!1;e.forEach((function(r,a){var n=function(e){var t={};return["fontSize","lineHeight","letterSpacing","marginBottom"].forEach((function(r){var a=e[r+"Unit"]||"";["","Tablet","Mobile"].forEach((function(n){var i=r+n;"number"==typeof e[i]&&(t[i]=String(e[i]+a))})),a&&(t[r+"Unit"]="")})),t}(r);(0,pi.isEmpty)(n)||(e[a]=hi(hi({},e[a]),n),t=!0)})),t&&i(e)}(e)}),[]);var d=function(t){i(t),wp.customize.control(e.customizerSetting.id).setting.set(t)};return(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),(0,s.createElement)(fi,{fontList:a,setOpen:g,isOpen:c,label:e.label,deleteFont:function(e){var t=Le(a);t.splice(e,1),d(t)},toggleClose:function(){return g(0)},onChangeFontValue:function(e,t,r){var n=Le(a);n[r]=hi({},n[r]),n[r][e]=t,d(n)},onChangeElement:function(e,t){var r=e.value,n=e.group,i=e.module,o=Le(a);o[t]=hi(hi({},o[t]),{},{selector:r,module:i,group:n}),Vn(r)||(o[t]=hi(hi({},o[t]),{},{marginBottom:"",marginBottomTablet:"",marginBottomMobile:"",marginBottomUnit:""})),d(o)}}),(0,s.createElement)(u.Button,{isPrimary:!0,onClick:function(){var t=Le(e.value);t.push({selector:"",customSelector:"",fontFamily:"",fontWeight:"",textTransform:"",textDecoration:"",fontStyle:"",fontSize:"",fontSizeTablet:"",fontSizeMobile:"",lineHeight:"",lineHeightTablet:"",lineHeightMobile:"",letterSpacing:"",letterSpacingTablet:"",letterSpacingMobile:""}),d(t),g(t.length)}},(0,m.__)("Add Typography","generatepress")))}));function bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Si(e){for(var t=1;t=0;a--)if(t.canDragSource(e[a])){r=e[a];break}return r}(t,o);if(null==l)return void e.dispatch(Gi);let c=null;if(n){if(!i)throw new Error("getSourceClientOffset must be defined");!function(e){Li("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(i),c=i(l)}e.dispatch(Ui(n,c));const u=s.getSource(l).beginDrag(o,l);if(null==u)return;!function(e){Li(Ai(e),"Item must be an object.")}(u),s.pinSource(l);const g=s.getSourceType(l);return{type:ji,payload:{itemType:g,item:u,sourceId:l,clientOffset:n||null,sourceClientOffset:c||null,isSourcePublic:!!a}}}}function $i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wi(e){for(var t=1;t{const o=function(e,t,r,a){const n=r.getTarget(e);let i=n?n.drop(a,e):void 0;return function(e){Li(void 0===e||Ai(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:a.getDropResult()),i}(n,i,a,r),s={type:Hi,payload:{dropResult:Wi({},t,o)}};e.dispatch(s)}))}}function Yi(e){return function(){const t=e.getMonitor(),r=e.getRegistry();!function(e){Li(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const a=t.getSourceId();return null!=a&&(r.getSource(a,!0).endDrag(t,a),r.unpinSource()),{type:zi}}}function Ji(e,t){return null===t?null===e:Array.isArray(e)?e.some((e=>e===t)):e===t}function Xi(e){return function(t,{clientOffset:r}={}){!function(e){Li(Array.isArray(e),"Expected targetIds to be an array.")}(t);const a=t.slice(0),n=e.getMonitor(),i=e.getRegistry();return function(e,t,r){for(let a=e.length-1;a>=0;a--){const n=e[a];Ji(t.getTargetType(n),r)||e.splice(a,1)}}(a,i,n.getItemType()),function(e,t,r){Li(t.isDragging(),"Cannot call hover while not dragging."),Li(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t{const i=r[n];var o;return a[n]=(o=i,(...r)=>{const a=o.apply(e,r);void 0!==a&&t(a)}),a}),{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function eo(e,t){return{x:e.x-t.x,y:e.y-t.y}}const to=[],ro=[];to.__IS_NONE__=!0,ro.__IS_ALL__=!0;class ao{subscribeToStateChange(e,t={}){const{handlerIds:r}=t;Li("function"==typeof e,"listener must be a function."),Li(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;return this.store.subscribe((()=>{const t=this.store.getState(),n=t.stateId;try{const i=n===a||n===a+1&&!function(e,t){if(e===to)return!1;if(e===ro||void 0===t)return!0;const r=(a=e,t.filter((e=>a.indexOf(e)>-1)));var a;return r.length>0}(t.dirtyHandlerIds,r);i||e()}finally{a=n}}))}subscribeToOffsetChange(e){Li("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe((()=>{const r=this.store.getState().dragOffset;r!==t&&(t=r,e())}))}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return Li(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);return Li(t,`Expected to find a valid target. targetId=${e}`),!(!this.isDragging()||this.didDrop())&&(Ji(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e))}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);return Li(t,`Expected to find a valid source. sourceId=${e}`),!(!this.isDragging()||!this.isSourcePublic())&&(this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e))}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:r}=t;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),n=this.getItemType();if(n&&!Ji(a,n))return!1;const i=this.getTargetIds();if(!i.length)return!1;const o=i.indexOf(e);return r?o===i.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:a}=e;return t&&r&&a?eo(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,a),r):null}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:r}=e;return t&&r?eo(t,r):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}const no="undefined"!=typeof global?global:self,io=no.MutationObserver||no.WebKitMutationObserver;function oo(e){return function(){const t=setTimeout(a,0),r=setInterval(a,50);function a(){clearTimeout(t),clearInterval(r),e()}}}const so="function"==typeof io?function(e){let t=1;const r=new io(e),a=document.createTextNode("");return r.observe(a,{characterData:!0}),function(){t=-t,a.data=t}}:oo;class lo{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const co=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.indexthis.capacity){for(let t=0,r=e.length-this.index;t{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=so(this.flush),this.requestErrorThrow=oo((()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()}))}},uo=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new lo(this.onError,(e=>t[t.length]=e));return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}(co.registerPendingError),go="dnd-core/ADD_SOURCE",fo="dnd-core/ADD_TARGET",po="dnd-core/REMOVE_SOURCE",vo="dnd-core/REMOVE_TARGET";function ho(e,t){t&&Array.isArray(e)?e.forEach((e=>ho(e,!1))):Li("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var yo;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(yo||(yo={}));let mo=0;function bo(e){switch(e[0]){case"S":return yo.SOURCE;case"T":return yo.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function So(e,t){const r=e.entries();let a=!1;do{const{done:e,value:[,n]}=r.next();if(n===t)return!0;a=!!e}while(!a);return!1}class wo{addSource(e,t){ho(e),function(e){Li("function"==typeof e.canDrag,"Expected canDrag to be a function."),Li("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),Li("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const r=this.addHandler(yo.SOURCE,e,t);return this.store.dispatch(function(e){return{type:go,payload:{sourceId:e}}}(r)),r}addTarget(e,t){ho(e,!0),function(e){Li("function"==typeof e.canDrop,"Expected canDrop to be a function."),Li("function"==typeof e.hover,"Expected hover to be a function."),Li("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const r=this.addHandler(yo.TARGET,e,t);return this.store.dispatch(function(e){return{type:fo,payload:{targetId:e}}}(r)),r}containsHandler(e){return So(this.dragSources,e)||So(this.dropTargets,e)}getSource(e,t=!1){return Li(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Li(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return Li(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return Li(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return bo(e)===yo.SOURCE}isTargetId(e){return bo(e)===yo.TARGET}removeSource(e){var t;Li(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:po,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},co.enqueueTask(uo.create(t))}removeTarget(e){Li(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:vo,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);Li(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){Li(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,r){const a=function(e){const t=(mo++).toString();switch(e){case yo.SOURCE:return`S${t}`;case yo.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}(e);return this.types.set(a,t),e===yo.SOURCE?this.dragSources.set(a,r):e===yo.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const Oo=(e,t)=>e===t;function Co(e=to,t){switch(t.type){case Bi:break;case go:case fo:case vo:case po:return to;default:return ro}const{targetIds:r=[],prevTargetIds:a=[]}=t.payload,n=function(e,t){const r=new Map,a=e=>{r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(a),t.forEach(a);const n=[];return r.forEach(((e,t)=>{1===e&&n.push(t)})),n}(r,a),i=n.length>0||!function(e,t,r=Oo){if(e.length!==t.length)return!1;for(let a=0;ae!==n)))});case Hi:return To({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case zi:return To({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var a,n}function ko(e=0,t){switch(t.type){case go:case fo:return e+1;case po:case vo:return e-1;default:return e}}function Po(e=0){return e+1}function _o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ro(e){for(var t=1;te&&e[t]?e[t]:a||null),r))})}),dragOffset:No(e.dragOffset,t),refCount:ko(e.refCount,t),dragOperation:Mo(e.dragOperation,t),stateId:Po(e.stateId)};var r,a}function Ao(e,t=void 0,r={},a=!1){const n=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return Ri(Lo,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(a),i=new ao(n,new wo(n)),o=new Qi(n,i),s=e(o,t,r);return o.receiveBackend(s),o}const Fo=(0,s.createContext)({dragDropManager:void 0});let jo=0;const Vo=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Bo=(0,s.memo)((function(e){var{children:t}=e,r=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,["children"]);const[a,n]=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=function(e,t=Ho(),r,a){const n=t;return n[Vo]||(n[Vo]={dragDropManager:Ao(e,t,r,a)}),n[Vo]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(r);return(0,s.useEffect)((()=>{if(n){const e=Ho();return++jo,()=>{0==--jo&&(e[Vo]=null)}}}),[]),(0,Ii.jsx)(Fo.Provider,{value:a,children:t})}));function Ho(){return"undefined"!=typeof global?global:window}function zo(e){let t=null;return()=>(null==t&&(t=e()),t)}class Uo{enter(e){const t=this.entered.length;return this.entered=function(e,t){const r=new Set,a=e=>r.add(e);e.forEach(a),t.forEach(a);const n=[];return r.forEach((e=>n.push(e))),n}(this.entered.filter((t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e)))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var r,a;return this.entered=(r=this.entered.filter(this.isNodeInDocument),a=e,r.filter((e=>e!==a))),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class Go{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach((e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})}))}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach((r=>{const a=this.config.exposeProperties[r];null!=a&&(t[r]={value:a(e,this.config.matchesTypes),configurable:!0,enumerable:!0})})),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const Ko="__NATIVE_FILE__",$o="__NATIVE_URL__",Wo="__NATIVE_TEXT__",qo="__NATIVE_HTML__";function Yo(e,t,r){const a=t.reduce(((t,r)=>t||e.getData(r)),"");return null!=a?a:r}const Jo={[Ko]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[qo]:{exposeProperties:{html:(e,t)=>Yo(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[$o]:{exposeProperties:{urls:(e,t)=>Yo(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[Wo]:{exposeProperties:{text:(e,t)=>Yo(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Xo(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Jo).filter((e=>{const r=Jo[e];return!!(null==r?void 0:r.matchesTypes)&&r.matchesTypes.some((e=>t.indexOf(e)>-1))}))[0]||null}const Zo=zo((()=>/firefox/i.test(navigator.userAgent))),Qo=zo((()=>Boolean(window.safari)));class es{interpolate(e){const{xs:t,ys:r,c1s:a,c2s:n,c3s:i}=this;let o=t.length-1;if(e===t[o])return r[o];let s,l=0,c=i.length-1;for(;l<=c;){s=Math.floor(.5*(l+c));const a=t[s];if(ae))return r[s];c=s-1}}o=Math.max(0,c);const u=e-t[o],g=u*u;return r[o]+a[o]*u+n[o]*g+i[o]*u*g}constructor(e,t){const{length:r}=e,a=[];for(let e=0;ee[t]{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,r){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);const a=t=>this.handleDragStart(t,e),n=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",a),t.addEventListener("selectstart",n),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",a),t.removeEventListener("selectstart",n),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const r=t=>this.handleDragEnter(t,e),a=t=>this.handleDragOver(t,e),n=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",r),t.addEventListener("dragover",a),t.addEventListener("drop",n),()=>{t.removeEventListener("dragenter",r),t.removeEventListener("dragover",a),t.removeEventListener("drop",n)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return os({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return os({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(a).some((t=>a[t]===e))}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const r=Jo[e];if(!r)throw new Error(`native type ${e} has no configuration`);const a=new Go(r);return a.loadDataTransfer(t),a}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout((()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}),1e3)}clearCurrentDragSourceNode(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&rs(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame((()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null})))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const r=as(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:a}=e,n=Xo(a);if(this.monitor.isDragging()){if(a&&"function"==typeof a.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),n=this.sourcePreviewNodes.get(e)||t;if(n){const{anchorX:e,anchorY:i,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),l=function(e,t,r,a,n){const i=function(e){var t;return"IMG"===e.nodeName&&(Zo()||!(null===(t=document.documentElement)||void 0===t?void 0:t.contains(e)))}(t),o=rs(i?e:t),s={x:r.x-o.x,y:r.y-o.y},{offsetWidth:l,offsetHeight:c}=e,{anchorX:u,anchorY:g}=a,{dragPreviewWidth:d,dragPreviewHeight:f}=function(e,t,r,a){let n=e?t.width:r,i=e?t.height:a;return Qo()&&e&&(i/=window.devicePixelRatio,n/=window.devicePixelRatio),{dragPreviewWidth:n,dragPreviewHeight:i}}(i,t,l,c),{offsetX:p,offsetY:v}=n,h=0===v||v;return{x:0===p||p?p:new es([0,.5,1],[s.x,s.x/l*d,s.x+d-l]).interpolate(u),y:h?v:(()=>{let e=new es([0,.5,1],[s.y,s.y/c*f,s.y+f-c]).interpolate(g);return Qo()&&i&&(e+=(window.devicePixelRatio-1)*f),e})()}}(t,n,r,{anchorX:e,anchorY:i},{offsetX:o,offsetY:s});a.setDragImage(n,l.x,l.y)}}try{null==a||a.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout((()=>this.actions.publishDragSource()),0)}else if(n)this.beginDragNativeItem(n);else{if(a&&!a.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)),!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:r}=e,a=Xo(r);a&&this.beginDragNativeItem(a,r)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:as(e)}),t.some((e=>this.monitor.canDropOnTarget(e)))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{var t;this.dragOverTargetIds=[],this.isDraggingNativeItem()&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=as(e),this.scheduleHover(t),(t||[]).some((e=>this.monitor.canDropOnTarget(e)))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout((()=>this.endDragNativeItem()),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;this.dropTargetIds=[],this.isDraggingNativeItem()?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Xo(e.dataTransfer)&&e.preventDefault(),this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:as(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new ns(t,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Uo(this.isNodeInDocument)}}const ls=function(e,t,r){return new ss(e,t,r)};var cs=r(17);const us="undefined"!=typeof window?s.useLayoutEffect:s.useEffect;function gs(e,t,r){return function(e,t,r){const[a,n]=function(e,t,r){const[a,n]=(0,s.useState)((()=>t(e))),i=(0,s.useCallback)((()=>{const i=t(e);cs(a,i)||(n(i),r&&r())}),[a,e,r]);return us(i),[a,i]}(e,t,r);return us((function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(n,{handlerIds:[t]})}),[e,n]),a}(t,e||(()=>({})),(()=>r.reconnect()))}function ds(e,t){const r=[...t||[]];return null==t&&"function"!=typeof e&&r.push(e),(0,s.useMemo)((()=>"function"==typeof e?e():e),r)}function fs(e){return(0,s.useMemo)((()=>e.hooks.dropTarget()),[e])}function ps(e,t,r,a){let n=r?r.call(a,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o{const a=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const e=function(e){return(t=null,r=null)=>{if(!(0,s.isValidElement)(t)){const a=t;return e(a,r),a}const a=t;!function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a
, or turn it into a drag source or a drop target itself.`)}(a);const n=r?t=>e(t,r):e;return function(e,t){const r=e.ref;return Li("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?(0,s.cloneElement)(e,{ref:e=>{ys(r,e),ys(t,e)}}):(0,s.cloneElement)(e,{ref:t})}(a,n)}}(a);t[r]=()=>e}})),t}function ys(e,t){"function"==typeof e?e(t):e.current=t}class ms{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!ps(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=hs({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,vs(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function bs(){const{dragDropManager:e}=(0,s.useContext)(Fo);return Li(null!=e,"Expected drag drop context"),e}let Ss=!1;class ws{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;Li(!Ss,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ss=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ss=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}class Os{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function Cs(e,t){const r=ds(e,t),a=function(){const e=bs();return(0,s.useMemo)((()=>new ws(e)),[e])}(),n=function(e){const t=bs(),r=(0,s.useMemo)((()=>new ms(t.getBackend())),[t]);return us((()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget())),[e]),r}(r.options);return function(e,t,r){const a=bs(),n=function(e,t){const r=(0,s.useMemo)((()=>new Os(e,t)),[t]);return(0,s.useEffect)((()=>{r.spec=e}),[e]),r}(e,t),i=function(e){const{accept:t}=e;return(0,s.useMemo)((()=>(Li(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t])),[t])}(e);us((function(){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addTarget(e,t);return[n,()=>a.removeTarget(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}),[a,t,n,r,i.map((e=>e.toString())).join("|")])}(r,a,n),[gs(r.collect,a,n),fs(n)]}function Es(e){return(0,s.useMemo)((()=>e.hooks.dragSource()),[e])}function Ds(e){return(0,s.useMemo)((()=>e.hooks.dragPreview()),[e])}class Ns{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();r&&this.disconnectDragPreview(),this.handlerId&&(t?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!ps(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ps(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=hs({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,vs(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,vs(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}let xs=!1,Ts=!1;class Is{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){Li(!xs,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return xs=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{xs=!1}}isDragging(){if(!this.sourceId)return!1;Li(!Ts,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ts=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ts=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}class Ms{beginDrag(){const e=this.spec,t=this.monitor;let r=null;return r="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=r?r:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const r=this.spec,a=this.monitor,{isDragging:n}=r;return n?n(a):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,r=this.connector,{end:a}=e;a&&a(t.getItem(),t),r.reconnect()}constructor(e,t,r){this.spec=e,this.monitor=t,this.connector=r}}function ks(e,t){const r=ds(e,t);Li(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const a=function(){const e=bs();return(0,s.useMemo)((()=>new Is(e)),[e])}(),n=function(e,t){const r=bs(),a=(0,s.useMemo)((()=>new Ns(r.getBackend())),[r]);return us((()=>(a.dragSourceOptions=e||null,a.reconnect(),()=>a.disconnectDragSource())),[a,e]),us((()=>(a.dragPreviewOptions=t||null,a.reconnect(),()=>a.disconnectDragPreview())),[a,t]),a}(r.options,r.previewOptions);return function(e,t,r){const a=bs(),n=function(e,t,r){const a=(0,s.useMemo)((()=>new Ms(e,t,r)),[t,r]);return(0,s.useEffect)((()=>{a.spec=e}),[e]),a}(e,t,r),i=function(e){return(0,s.useMemo)((()=>{const t=e.type;return Li(null!=t,"spec.type must be defined"),t}),[e])}(e);us((function(){if(null!=i){const[e,o]=function(e,t,r){const a=r.getRegistry(),n=a.addSource(e,t);return[n,()=>a.removeSource(n)]}(i,n,a);return t.receiveHandlerId(e),r.receiveHandlerId(e),o}}),[a,t,r,n,i])}(r,a,n),[gs(r.collect,a,n),Es(n),Ds(n)]}function Ps(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _s(e){var t=e.id,r=e.itemType,a=e.onDrop,n=e.getIndex,i=e.className,l=e.innerComponentProps,c=e.InnerComponent,u=y(ks((function(){return{type:r,item:{id:t},collect:function(e){return{isDragging:e.isDragging()}}}}),[t]),2),g=u[0].isDragging,d=u[1],f=Cs((function(){return{accept:r,hover:function(e){var r=e.id;if(r!==t){var i=n(t);a(r,i)}}}}),[n,a]),p=y(f,2)[1],v=g?"0.2":1;return(0,s.createElement)("div",{ref:function(e){return d(p(e))},className:i,style:{opacity:v}},c&&(0,s.createElement)(c,function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return r({type:"ADD_COLOR",payload:Object.assign({},wi,{slug:e,color:t})})},deleteColor:function(e){return r({type:"DELETE_COLOR",payload:e})},updateColorValue:function(e,t){return r({type:"UPDATE_COLOR_VALUE",payload:{slug:e,value:t}})},updateColorSlug:function(e,t){return r({type:"UPDATE_COLOR_SLUG",payload:{slug:e,value:t}})}}}(),r=t.colors,a=t.setColors,n=t.addColor,i=t.deleteColor,o=t.updateColorValue,c=t.updateColorSlug,u=y((0,l.useState)(!1),2),g=u[0],d=u[1],f=y((0,l.useState)(!1),2),p=f[0],v=f[1],h=y((0,l.useState)([]),2),b=h[0],S=h[1];(0,l.useEffect)((function(){var t=(0,pi.isObject)(e.value)?Object.values(e.value):e.value;a(t),d(!0)}),[]),(0,l.useEffect)((function(){var t,a;g&&(a=[],(t=r).length>0&&t.forEach((function(e){a.push({name:e.slug,slug:e.slug,color:"var(--"+e.slug+")"})})),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(a)),function(t){wp.customize.control(e.customizerSetting.id).setting.set(t);var r=":root {";t.length>0&&t.forEach((function(e){var t=e.slug.replace(" ","-").toLowerCase();r+="--"+t+": "+e.color+";"})),r+="}";var a=document.getElementById("generate-global-color-styles");a?a.innerHTML=r:document.body.insertAdjacentHTML("beforeend",'")}(r))}),[JSON.stringify(r),g]);var w=(0,l.useCallback)((function(){n(function e(t){var a="global-color-".concat(t+1);return-1===(0,pi.findIndex)(r,{slug:a})?a:e(t+1)}(r.length))}),[r.length]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),(0,s.createElement)("div",{className:"generate-color-manager-wrapper"},(0,s.createElement)("div",{className:"generate-color-manager--item"},(0,s.createElement)(Ni,{onClick:w,disabled:p})),(0,s.createElement)("div",{className:"generate-color-manager--item"},(0,s.createElement)(Ei,{id:"add-color",icon:p?"check":"reorder",text:p?(0,m.__)("Finish re-ordering","generatepress"):(0,m.__)("Re-order colors","generatepress"),onClick:function(e){e.preventDefault(),p&&(a(b),window.sessionStorage.setItem("generateGlobalColors",JSON.stringify(b))),v(!p)}}))),p?(0,s.createElement)(Ls,{listData:r,idKey:"slug",listClassName:"generate-color-manager-dnd-list",itemClassName:"generate-color-manager-dnd-list-item",InnerComponent:As,onChangeData:S}):(0,s.createElement)(Ti,{colors:r,onChangeColor:o,onChangeSlug:c,onClickDeleteColor:i}))}));wp.customize.controlConstructor["generate-color-manager-control"]=Fs;var js=function(e){var t=y((0,l.useState)(!1),2),r=t[0],a=t[1],n=function(){e.choices.sectionRedirect?wp.customize.section(e.choices.toggleId).focus():document.querySelectorAll('[data-toggleId="'+e.choices.toggleId+'"]').forEach((function(e){r?(e.style.display="",a(!1)):(e.style.display="block",a(!0))}))},i=e.choices.tooltipText?e.choices.tooltipText:(0,m.sprintf)((0,m.__)("Open %s Settings","generatepress"),e.choices.title),o=e.choices.sectionRedirect?"chevron-right":"chevron-down";return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"generate-customize-control-title"},!!e.choices.toggleId&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(u.Tooltip,{text:i},(0,s.createElement)(u.Button,{className:"generate-customize-control-title--label",onClick:n},e.choices.title)),(0,s.createElement)(u.Tooltip,{text:i},(0,s.createElement)(u.Button,{className:"generate-customize-control-title--toggle",onClick:n},xe(r?"chevron-up":o)))),!e.choices.toggleId&&(0,s.createElement)("h3",null,e.choices.title)))};function Vs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function Bs(e){for(var t=1;t=i)&&Object.keys(a.O).every((function(e){return a.O[e](r[l])}))?r.splice(l--,1):(s=!1,i0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[r,n,i]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={242:0,863:0};a.O.j=function(t){return 0===e[t]};var t=function(t,r){var n,i,o=r[0],s=r[1],l=r[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(n in s)a.o(s,n)&&(a.m[n]=s[n]);if(l)var u=l(a)}for(t&&t(r);c