!function(){var e={353:function(e,t,n){"use strict";n(581)},556:function(e,t,n){e.exports=n(694)()},581:function(e,t){"use strict";var n,o=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.server_context"),p=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen");
/**
 * @license React
 * react-is.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */function y(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case i:case s:case a:case d:case f:return e;default:switch(e=e&&e.$$typeof){case u:case c:case p:case h:case m:case l:return e;default:return t}}case r:return t}}}n=Symbol.for("react.module.reference")},694:function(e,t,n){"use strict";var o=n(925);function r(){}function i(){}i.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,i,a){if(a!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return n.PropTypes=n,n}},925:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},942:function(e,t){var n;
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)o.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";function e(t){return e="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},e(t)}function t(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n||"default");if("object"!=e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function o(e,n,o){return(n=t(n))in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}var r=window.wp.element,i=window.wp.hooks,a=window.wp.i18n,s=n(942),l=n.n(s);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c.apply(null,arguments)}function u(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==t.indexOf(o))continue;n[o]=e[o]}return n}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var d=n(556),f=n.n(d),m=window.React,h=n.n(m);n(353);const g=e=>"object"==typeof e&&null!=e&&1===e.nodeType,y=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,v=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return y(n.overflowY,t)||y(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},b=(e,t,n,o,r,i,a,s)=>i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-o:a>t&&s<n||i<e&&s>n?a-t+r:0,I=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var _=function(){return _=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},_.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var w=0;function S(e){return"function"==typeof e?e:O}function O(){}function k(e,t){if(e){var n=((e,t)=>{var n,o,r,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:l,boundary:c,skipOverflowHiddenElements:u}=t,p="function"==typeof c?c:e=>e!==c;if(!g(e))throw new TypeError("Invalid target");const d=document.scrollingElement||document.documentElement,f=[];let m=e;for(;g(m)&&p(m);){if(m=I(m),m===d){f.push(m);break}null!=m&&m===document.body&&v(m)&&!v(document.documentElement)||null!=m&&v(m,u)&&f.push(m)}const h=null!=(o=null==(n=window.visualViewport)?void 0:n.width)?o:innerWidth,y=null!=(i=null==(r=window.visualViewport)?void 0:r.height)?i:innerHeight,{scrollX:_,scrollY:w}=window,{height:S,width:O,top:k,right:E,bottom:x,left:P}=e.getBoundingClientRect(),{top:D,right:C,bottom:M,left:H}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let T="start"===s||"nearest"===s?k-D:"end"===s?x+M:k+S/2-D+M,L="center"===l?P+O/2-H+C:"end"===l?E+C:P-H;const j=[];for(let e=0;e<f.length;e++){const t=f[e],{height:n,width:o,top:r,right:i,bottom:c,left:u}=t.getBoundingClientRect();if("if-needed"===a&&k>=0&&P>=0&&x<=y&&E<=h&&(t===d&&!v(t)||k>=r&&x<=c&&P>=u&&E<=i))return j;const p=getComputedStyle(t),m=parseInt(p.borderLeftWidth,10),g=parseInt(p.borderTopWidth,10),I=parseInt(p.borderRightWidth,10),D=parseInt(p.borderBottomWidth,10);let C=0,M=0;const H="offsetWidth"in t?t.offsetWidth-t.clientWidth-m-I:0,A="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-D:0,R="offsetWidth"in t?0===t.offsetWidth?0:o/t.offsetWidth:0,N="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(d===t)C="start"===s?T:"end"===s?T-y:"nearest"===s?b(w,w+y,y,g,D,w+T,w+T+S,S):T-y/2,M="start"===l?L:"center"===l?L-h/2:"end"===l?L-h:b(_,_+h,h,m,I,_+L,_+L+O,O),C=Math.max(0,C+w),M=Math.max(0,M+_);else{C="start"===s?T-r-g:"end"===s?T-c+D+A:"nearest"===s?b(r,c,n,g,D+A,T,T+S,S):T-(r+n/2)+A/2,M="start"===l?L-u-m:"center"===l?L-(u+o/2)+H/2:"end"===l?L-i+I+H:b(u,i,o,m,I+H,L,L+O,O);const{scrollLeft:e,scrollTop:a}=t;C=0===N?0:Math.max(0,Math.min(a+C/N,t.scrollHeight-n/N+A)),M=0===R?0:Math.max(0,Math.min(e+M/R,t.scrollWidth-o/R+H)),T+=a-C,L+=e-M}j.push({el:t,top:C,left:M})}return j})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach(function(e){var t=e.el,n=e.top,o=e.left;t.scrollTop=n,t.scrollLeft=o})}}function E(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function x(e,t){var n;function o(){n&&clearTimeout(n)}function r(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];o(),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}return r.cancel=o,r}function P(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return t.some(function(t){return t&&t.apply(void 0,[e].concat(o)),e.preventDownshiftDefault||e.hasOwnProperty("nativeEvent")&&e.nativeEvent.preventDownshiftDefault})}}function D(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){t.forEach(function(t){"function"==typeof t?t(e):t&&(t.current=e)})}}function C(){return String(w++)}function M(e){var t=e.isOpen,n=e.resultCount,o=e.previousResultCount;return t?n?n!==o?n+" result"+(1===n?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function H(e,t){return!(e=Array.isArray(e)?e[0]:e)&&t?t:e}function T(e){return"string"==typeof e.type}function L(e){return e.props}var j=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function A(e){void 0===e&&(e={});var t={};return j.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function R(e,t){return e&&t?Object.keys(e).reduce(function(n,o){return n[o]=N(t,o)?t[o]:e[o],n},{}):e}function N(e,t){return void 0!==e[t]}function V(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}function K(e,t,n,o,r){void 0===r&&(r=!1);var i=n.length;if(0===i)return-1;var a=i-1;("number"!=typeof e||e<0||e>a)&&(e=t>0?-1:a+1);var s=e+t;s<0?s=r?a:0:s>a&&(s=r?0:a);var l=z(s,t<0,n,o,r);return-1===l?e>=i?-1:e:l}function z(e,t,n,o,r){void 0===r&&(r=!1);var i=n.length;if(t){for(var a=e;a>=0;a--)if(!o(n[a],a))return a}else for(var s=e;s<i;s++)if(!o(n[s],s))return s;return r?z(t?i-1:0,t,n,o):-1}function B(e,t,n,o){return void 0===o&&(o=!0),n&&t.some(function(t){return t&&(E(t,e,n)||o&&E(t,n.document.activeElement,n))})}var F=x(function(e){U(e).textContent=""},500);function U(e){var t=e.getElementById("a11y-status-message");return t||((t=e.createElement("div")).setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function W(e,t){e&&t&&(U(t).textContent=e,F(t))}var q=Object.freeze({__proto__:null,blurButton:14,blurInput:10,changeInput:11,clickButton:13,clickItem:9,controlledPropUpdatedSelectedItem:15,itemMouseEnter:2,keyDownArrowDown:4,keyDownArrowUp:3,keyDownEnd:8,keyDownEnter:6,keyDownEscape:5,keyDownHome:7,keyDownSpaceButton:12,mouseUp:1,touchEnd:16,unknown:0}),$=["refKey","ref"],Y=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],X=["onKeyDown","onBlur","onChange","onInput","onChangeText"],G=["refKey","ref"],J=["onMouseMove","onMouseDown","onClick","onPress","index","item"],Q=function(){var e=function(e){function t(t){var n;(n=e.call(this,t)||this).id=n.props.id||"downshift-"+C(),n.menuId=n.props.menuId||n.id+"-menu",n.labelId=n.props.labelId||n.id+"-label",n.inputId=n.props.inputId||n.id+"-input",n.getItemId=n.props.getItemId||function(e){return n.id+"-item-"+e},n.items=[],n.itemCount=null,n.previousResultCount=0,n.timeoutIds=[],n.internalSetTimeout=function(e,t){var o=setTimeout(function(){n.timeoutIds=n.timeoutIds.filter(function(e){return e!==o}),e()},t);n.timeoutIds.push(o)},n.setItemCount=function(e){n.itemCount=e},n.unsetItemCount=function(){n.itemCount=null},n.isItemDisabled=function(e,t){var o=n.getItemNodeFromIndex(t);return o&&o.hasAttribute("disabled")},n.setHighlightedIndex=function(e,t){void 0===e&&(e=n.props.defaultHighlightedIndex),void 0===t&&(t={}),t=A(t),n.internalSetState(c({highlightedIndex:e},t))},n.clearSelection=function(e){n.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:n.props.defaultHighlightedIndex,isOpen:n.props.defaultIsOpen},e)},n.selectItem=function(e,t,o){t=A(t),n.internalSetState(c({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,selectedItem:e,inputValue:n.props.itemToString(e)},t),o)},n.selectItemAtIndex=function(e,t,o){var r=n.items[e];null!=r&&n.selectItem(r,t,o)},n.selectHighlightedItem=function(e,t){return n.selectItemAtIndex(n.getState().highlightedIndex,e,t)},n.internalSetState=function(e,t){var o,r,i={},a="function"==typeof e;return!a&&e.hasOwnProperty("inputValue")&&n.props.onInputValueChange(e.inputValue,c({},n.getStateAndHelpers(),e)),n.setState(function(t){var s;t=n.getState(t);var l=a?e(t):e;l=n.props.stateReducer(t,l),o=l.hasOwnProperty("selectedItem");var u={};return o&&l.selectedItem!==t.selectedItem&&(r=l.selectedItem),(s=l).type||(s.type=0),Object.keys(l).forEach(function(e){t[e]!==l[e]&&(i[e]=l[e]),"type"!==e&&(l[e],N(n.props,e)||(u[e]=l[e]))}),a&&l.hasOwnProperty("inputValue")&&n.props.onInputValueChange(l.inputValue,c({},n.getStateAndHelpers(),l)),u},function(){S(t)(),Object.keys(i).length>1&&n.props.onStateChange(i,n.getStateAndHelpers()),o&&n.props.onSelect(e.selectedItem,n.getStateAndHelpers()),void 0!==r&&n.props.onChange(r,n.getStateAndHelpers()),n.props.onUserAction(i,n.getStateAndHelpers())})},n.rootRef=function(e){return n._rootNode=e},n.getRootProps=function(e,t){var o,r=void 0===e?{}:e,i=r.refKey,a=void 0===i?"ref":i,s=r.ref,l=u(r,$),p=(void 0===t?{}:t).suppressRefError,d=void 0!==p&&p;n.getRootProps.called=!0,n.getRootProps.refKey=a,n.getRootProps.suppressRefError=d;var f=n.getState().isOpen;return c(((o={})[a]=D(s,n.rootRef),o.role="combobox",o["aria-expanded"]=f,o["aria-haspopup"]="listbox",o["aria-owns"]=f?n.menuId:void 0,o["aria-labelledby"]=n.labelId,o),l)},n.keyDownHandlers={ArrowDown:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?5:1;this.moveHighlightedIndex(n,{type:4})}else this.internalSetState({isOpen:!0,type:4},function(){var e=t.getItemCount();if(e>0){var n=K(t.getState().highlightedIndex,1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:4})}})},ArrowUp:function(e){var t=this;if(e.preventDefault(),this.getState().isOpen){var n=e.shiftKey?-5:-1;this.moveHighlightedIndex(n,{type:3})}else this.internalSetState({isOpen:!0,type:3},function(){var e=t.getItemCount();if(e>0){var n=K(t.getState().highlightedIndex,-1,{length:e},t.isItemDisabled,!0);t.setHighlightedIndex(n,{type:3})}})},Enter:function(e){if(229!==e.which){var t=this.getState(),n=t.isOpen,o=t.highlightedIndex;if(n&&null!=o){e.preventDefault();var r=this.items[o],i=this.getItemNodeFromIndex(o);if(null==r||i&&i.hasAttribute("disabled"))return;this.selectHighlightedItem({type:6})}}},Escape:function(e){e.preventDefault(),this.reset(c({type:5},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},n.buttonKeyDownHandlers=c({},n.keyDownHandlers,{" ":function(e){e.preventDefault(),this.toggleMenu({type:12})}}),n.inputKeyDownHandlers=c({},n.keyDownHandlers,{Home:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var o=z(0,!1,{length:n},this.isItemDisabled);this.setHighlightedIndex(o,{type:7})}}},End:function(e){var t=this.getState().isOpen;if(t){e.preventDefault();var n=this.getItemCount();if(!(n<=0)&&t){var o=z(n-1,!0,{length:n},this.isItemDisabled);this.setHighlightedIndex(o,{type:8})}}}}),n.getToggleButtonProps=function(e){var t=void 0===e?{}:e,o=t.onClick;t.onPress;var r=t.onKeyDown,i=t.onKeyUp,a=t.onBlur,s=u(t,Y),l=n.getState().isOpen,p={onClick:P(o,n.buttonHandleClick),onKeyDown:P(r,n.buttonHandleKeyDown),onKeyUp:P(i,n.buttonHandleKeyUp),onBlur:P(a,n.buttonHandleBlur)};return c({type:"button",role:"button","aria-label":l?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},s.disabled?{}:p,s)},n.buttonHandleKeyUp=function(e){e.preventDefault()},n.buttonHandleKeyDown=function(e){var t=V(e);n.buttonKeyDownHandlers[t]&&n.buttonKeyDownHandlers[t].call(n,e)},n.buttonHandleClick=function(e){if(e.preventDefault(),n.props.environment){var t=n.props.environment.document,o=t.body,r=t.activeElement;o&&o===r&&e.target.focus()}n.internalSetTimeout(function(){return n.toggleMenu({type:13})})},n.buttonHandleBlur=function(e){var t=e.target;n.internalSetTimeout(function(){if(!n.isMouseDown&&n.props.environment){var e=n.props.environment.document.activeElement;null!=e&&e.id===n.inputId||e===t||n.reset({type:14})}})},n.getLabelProps=function(e){return c({htmlFor:n.inputId,id:n.labelId},e)},n.getInputProps=function(e){var t=void 0===e?{}:e,o=t.onKeyDown,r=t.onBlur,i=t.onChange,a=t.onInput;t.onChangeText;var s=u(t,X),l={};var p,d=n.getState(),f=d.inputValue,m=d.isOpen,h=d.highlightedIndex;s.disabled||((p={}).onChange=P(i,a,n.inputHandleChange),p.onKeyDown=P(o,n.inputHandleKeyDown),p.onBlur=P(r,n.inputHandleBlur),l=p);return c({"aria-autocomplete":"list","aria-activedescendant":m&&"number"==typeof h&&h>=0?n.getItemId(h):void 0,"aria-controls":m?n.menuId:void 0,"aria-labelledby":s&&s["aria-label"]?void 0:n.labelId,autoComplete:"off",value:f,id:n.inputId},l,s)},n.inputHandleKeyDown=function(e){var t=V(e);t&&n.inputKeyDownHandlers[t]&&n.inputKeyDownHandlers[t].call(n,e)},n.inputHandleChange=function(e){n.internalSetState({type:11,isOpen:!0,inputValue:e.target.value,highlightedIndex:n.props.defaultHighlightedIndex})},n.inputHandleBlur=function(){n.internalSetTimeout(function(){var e;if(!n.isMouseDown&&n.props.environment){var t=n.props.environment.document.activeElement;(null==t||null==(e=t.dataset)?void 0:e.toggle)&&n._rootNode&&n._rootNode.contains(t)||n.reset({type:10})}})},n.menuRef=function(e){n._menuNode=e},n.getMenuProps=function(e,t){var o,r=void 0===e?{}:e,i=r.refKey,a=void 0===i?"ref":i,s=r.ref,l=u(r,G),p=(void 0===t?{}:t).suppressRefError,d=void 0!==p&&p;return n.getMenuProps.called=!0,n.getMenuProps.refKey=a,n.getMenuProps.suppressRefError=d,c(((o={})[a]=D(s,n.menuRef),o.role="listbox",o["aria-labelledby"]=l&&l["aria-label"]?void 0:n.labelId,o.id=n.menuId,o),l)},n.getItemProps=function(e){var t,o=void 0===e?{}:e,r=o.onMouseMove,i=o.onMouseDown,a=o.onClick;o.onPress;var s=o.index,l=o.item,p=void 0===l?void 0:l,d=u(o,J);void 0===s?(n.items.push(p),s=n.items.indexOf(p)):n.items[s]=p;var f=a,m=((t={onMouseMove:P(r,function(){s!==n.getState().highlightedIndex&&(n.setHighlightedIndex(s,{type:2}),n.avoidScrolling=!0,n.internalSetTimeout(function(){return n.avoidScrolling=!1},250))}),onMouseDown:P(i,function(e){e.preventDefault()})}).onClick=P(f,function(){n.selectItemAtIndex(s,{type:9})}),t),h=d.disabled?{onMouseDown:m.onMouseDown}:m;return c({id:n.getItemId(s),role:"option","aria-selected":n.getState().highlightedIndex===s},h,d)},n.clearItems=function(){n.items=[]},n.reset=function(e,t){void 0===e&&(e={}),e=A(e),n.internalSetState(function(t){var o=t.selectedItem;return c({isOpen:n.props.defaultIsOpen,highlightedIndex:n.props.defaultHighlightedIndex,inputValue:n.props.itemToString(o)},e)},t)},n.toggleMenu=function(e,t){void 0===e&&(e={}),e=A(e),n.internalSetState(function(t){var o=t.isOpen;return c({isOpen:!o},o&&{highlightedIndex:n.props.defaultHighlightedIndex},e)},function(){var o=n.getState(),r=o.isOpen,i=o.highlightedIndex;r&&n.getItemCount()>0&&"number"==typeof i&&n.setHighlightedIndex(i,e),S(t)()})},n.openMenu=function(e){n.internalSetState({isOpen:!0},e)},n.closeMenu=function(e){n.internalSetState({isOpen:!1},e)},n.updateStatus=x(function(){var e;if(null!=(e=n.props)&&null!=(e=e.environment)&&e.document){var t=n.getState(),o=n.items[t.highlightedIndex],r=n.getItemCount(),i=n.props.getA11yStatusMessage(c({itemToString:n.props.itemToString,previousResultCount:n.previousResultCount,resultCount:r,highlightedItem:o},t));n.previousResultCount=r,W(i,n.props.environment.document)}},200);var o=n.props,r=o.defaultHighlightedIndex,i=o.initialHighlightedIndex,a=void 0===i?r:i,s=o.defaultIsOpen,l=o.initialIsOpen,p=void 0===l?s:l,d=o.initialInputValue,f=void 0===d?"":d,m=o.initialSelectedItem,h=void 0===m?null:m,g=n.getState({highlightedIndex:a,isOpen:p,inputValue:f,selectedItem:h});return null!=g.selectedItem&&void 0===n.props.initialInputValue&&(g.inputValue=n.props.itemToString(g.selectedItem)),n.state=g,n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,p(e,t)}(t,e);var n=t.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach(function(e){clearTimeout(e)}),this.timeoutIds=[]},n.getState=function(e){return void 0===e&&(e=this.state),R(e,this.props)},n.getItemCount=function(){var e=this.items.length;return null!=this.itemCount?e=this.itemCount:void 0!==this.props.itemCount&&(e=this.props.itemCount),e},n.getItemNodeFromIndex=function(e){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(e)):null},n.scrollHighlightedItemIntoView=function(){var e=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(e,this._menuNode)},n.moveHighlightedIndex=function(e,t){var n=this.getItemCount(),o=this.getState().highlightedIndex;if(n>0){var r=K(o,e,{length:n},this.isItemDisabled,!0);this.setHighlightedIndex(r,t)}},n.getStateAndHelpers=function(){var e=this.getState(),t=e.highlightedIndex,n=e.inputValue,o=e.selectedItem,r=e.isOpen,i=this.props.itemToString,a=this.id,s=this.getRootProps,l=this.getToggleButtonProps,c=this.getLabelProps,u=this.getMenuProps,p=this.getInputProps,d=this.getItemProps,f=this.openMenu,m=this.closeMenu,h=this.toggleMenu,g=this.selectItem,y=this.selectItemAtIndex,v=this.selectHighlightedItem,b=this.setHighlightedIndex,I=this.clearSelection,_=this.clearItems;return{getRootProps:s,getToggleButtonProps:l,getLabelProps:c,getMenuProps:u,getInputProps:p,getItemProps:d,reset:this.reset,openMenu:f,closeMenu:m,toggleMenu:h,selectItem:g,selectItemAtIndex:y,selectHighlightedItem:v,setHighlightedIndex:b,clearSelection:I,clearItems:_,setItemCount:this.setItemCount,unsetItemCount:this.unsetItemCount,setState:this.internalSetState,itemToString:i,id:a,highlightedIndex:t,inputValue:n,isOpen:r,selectedItem:o}},n.componentDidMount=function(){var e=this;if(this.props.environment){var t=function(){e.isMouseDown=!0},n=function(t){e.isMouseDown=!1,!B(t.target,[e._rootNode,e._menuNode],e.props.environment)&&e.getState().isOpen&&e.reset({type:1},function(){return e.props.onOuterClick(e.getStateAndHelpers())})},o=function(){e.isTouchMove=!1},r=function(){e.isTouchMove=!0},i=function(t){var n=B(t.target,[e._rootNode,e._menuNode],e.props.environment,!1);e.isTouchMove||n||!e.getState().isOpen||e.reset({type:16},function(){return e.props.onOuterClick(e.getStateAndHelpers())})},a=this.props.environment;a.addEventListener("mousedown",t),a.addEventListener("mouseup",n),a.addEventListener("touchstart",o),a.addEventListener("touchmove",r),a.addEventListener("touchend",i),this.cleanup=function(){e.internalClearTimeouts(),e.updateStatus.cancel(),a.removeEventListener("mousedown",t),a.removeEventListener("mouseup",n),a.removeEventListener("touchstart",o),a.removeEventListener("touchmove",r),a.removeEventListener("touchend",i)}}else this.cleanup=function(){e.internalClearTimeouts()}},n.shouldScroll=function(e,t){var n=(void 0===this.props.highlightedIndex?this.getState():this.props).highlightedIndex,o=(void 0===t.highlightedIndex?e:t).highlightedIndex;return n&&this.getState().isOpen&&!e.isOpen||n!==o},n.componentDidUpdate=function(e,t){N(this.props,"selectedItem")&&this.props.selectedItemChanged(e.selectedItem,this.props.selectedItem)&&this.internalSetState({type:15,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(t,e)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var e=H(this.props.children,O);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var t=H(e(this.getStateAndHelpers()));return t?this.getRootProps.called||this.props.suppressRefError?t:T(t)?(0,m.cloneElement)(t,this.getRootProps(L(t))):void 0:null},t}(m.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:M,itemToString:function(e){return null==e?"":String(e)},onStateChange:O,onInputValueChange:O,onUserAction:O,onChange:O,onSelect:O,onOuterClick:O,selectedItemChanged:function(e,t){return e!==t},environment:"undefined"==typeof window?void 0:window,stateReducer:function(e,t){return t},suppressRefError:!1,scrollIntoView:k},e.stateChangeTypes=q,e}();x(function(e,t){W(e,t)},200),"undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?m.useLayoutEffect:m.useEffect,h();var Z={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:function(e,t){return t.changes},scrollIntoView:k,environment:"undefined"==typeof window?void 0:window};var ee={environment:f().shape({addEventListener:f().func.isRequired,removeEventListener:f().func.isRequired,document:f().shape({createElement:f().func.isRequired,getElementById:f().func.isRequired,activeElement:f().any.isRequired,body:f().any.isRequired}).isRequired,Node:f().func.isRequired}),itemToString:f().func,itemToKey:f().func,stateReducer:f().func},te=c({},ee,{getA11yStatusMessage:f().func,highlightedIndex:f().number,defaultHighlightedIndex:f().number,initialHighlightedIndex:f().number,isOpen:f().bool,defaultIsOpen:f().bool,initialIsOpen:f().bool,selectedItem:f().any,initialSelectedItem:f().any,defaultSelectedItem:f().any,id:f().string,labelId:f().string,menuId:f().string,getItemId:f().func,toggleButtonId:f().string,onSelectedItemChange:f().func,onHighlightedIndexChange:f().func,onStateChange:f().func,onIsOpenChange:f().func,scrollIntoView:f().func});_(_({},te),{items:f().array.isRequired,isItemDisabled:f().func}),_(_({},Z),{isItemDisabled:function(){return!1}});c({},te,{items:f().array.isRequired,isItemDisabled:f().func,inputValue:f().string,defaultInputValue:f().string,initialInputValue:f().string,inputId:f().string,onInputValueChange:f().func});c({},Z,{isItemDisabled:function(){return!1}});f().array,f().array,f().array,f().func,f().number,f().number,f().number,f().func,f().func,f().string,f().string;function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var re=function({listId:e,provider:t,apiKey:n,apiUrl:o,onChange:i,onListsLoading:s}){const[u,p]=(0,r.useState)([]),[d,f]=(0,r.useState)(!1);let[{controller:m},h]=(0,r.useState)({controller:null});const g=function(e){p(e),s(e.length)};return(0,r.useEffect)(function(){n||["mailpoet","fluentcrm"].includes(t)?async function(){m&&m.abort(),f(!0),"AbortController"in window&&(m=new AbortController,h({controller:m}));const e=new FormData;e.append("api_key",n),e.append("api_url",o),e.append("provider",t),e.append("action","blocksy_ext_newsletter_subscribe_maybe_get_lists"),e.append("nonce",ctDashboardLocalizations.dashboard_actions_nonce);try{const t=await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",signal:m.signal,body:e});if(200===t.status){const e=await t.json();if(e.success&&"api_key_invalid"!==e.data.result)return f(!1),void g(e.data.result.map(function(e){return oe(oe({},e),{},{id:e.id.toString()})}))}}catch(e){}g([]),f(!1)}():g([])},[t,n,o]),0===u.length?(0,r.createElement)("div",{className:l()("ct-select-input","ct-no-results")},(0,r.createElement)("input",{disabled:!0,placeholder:d?(0,a.__)("Fetching...","blocksy-companion"):""})):(0,r.createElement)(Q,{selectedItem:u.find(function({id:t}){return t===e})?e:"",onChange:function(e){return i(e)},itemToString:function(e){return e?(u.find(function({id:t}){return t===e})||{}).name:""}},function({getInputProps:e,getItemProps:t,getLabelProps:n,getMenuProps:o,isOpen:i,inputValue:s,highlightedIndex:p,selectedItem:d,openMenu:f}){return(0,r.createElement)("div",{className:"ct-select-input"},(0,r.createElement)("input",c({},e({onFocus:function(){return f()},onClick:function(){return f()}}),{placeholder:(0,a.__)("Select list...","blocksy-companion"),readOnly:!0})),i&&(0,r.createElement)("div",o({className:"ct-select-dropdown"}),u.map(function(e,n){return(0,r.createElement)("div",t({key:e.id,index:n,item:e.id,className:l()("ct-select-dropdown-item",{active:p===n,selected:d===e.id})}),e.name)})))})},ie=window.blocksyOptions;const ae=(window.ctDashboardLocalizations||{}).DashboardContext;(ae||{}).Provider,(ae||{}).Consumer;var se=ae;(0,a.__)("Free","blocksy-companion"),(0,a.__)("Personal","blocksy-companion"),(0,a.__)("Business","blocksy-companion"),(0,a.__)("Agency","blocksy-companion"),(0,a.__)("Personal","blocksy-companion"),(0,a.__)("Business","blocksy-companion"),(0,a.__)("Agency","blocksy-companion");var le=function({currentPlan:e="free",requiredPlan:t="personal",personal:n={title:(0,a.__)("This is a Pro feature","blocksy-companion"),description:(0,a.__)("Upgrade to any pro plan and get instant access to this and many other feature.","blocksy-companion")},professional:o={description:(0,a.__)("Upgrade to the business or agency plan and get instant access to this and many other features.","blocksy-companion")},agency:i={description:(0,a.__)("Upgrade to the agency plan and get instant access to this and many other features.","blocksy-companion")}}={}){const[s,l]=(0,r.useState)(!1);return{showNotice:function(e){l(e||!0)},content:(0,r.createElement)(ie.Overlay,{items:s,className:"ct-onboarding-modal",onDismiss:function(){return l(!1)},render:function(){return(0,r.createElement)("div",{className:"ct-modal-content"},(0,r.createElement)("svg",{width:"55",height:"55",viewBox:"0 0 40.5 48.3"},(0,r.createElement)("path",{fill:"#2d82c8",d:"M33.4 29.4l7.1 12.3-7.4.6-4 6-7.3-12.9"}),(0,r.createElement)("path",{d:"M33.5 29.6L26 42.7l-4.2-7.3 11.6-6 .1.2zM0 41.7l7.5.6 3.9 6 7.2-12.4-11-7.3L0 41.7z",fill:"#2271b1"}),(0,r.createElement)("path",{d:"M39.5 18.7c0 1.6-2.4 2.8-2.7 4.3-.4 1.5 1 3.8.2 5.1-.8 1.3-3.4 1.2-4.5 2.3-1.1 1.1-1 3.7-2.3 4.5-1.3.8-3.6-.6-5.1-.2-1.5.4-2.7 2.7-4.3 2.7S18 35 16.5 34.7c-1.5-.4-3.8 1-5.1.2s-1.2-3.4-2.3-4.5-3.7-1-4.5-2.3.6-3.6.2-5.1-2.7-2.7-2.7-4.3 2.4-2.8 2.7-4.3c.4-1.5-1-3.8-.2-5.1C5.4 8 8.1 8.1 9.1 7c1.1-1.1 1-3.7 2.3-4.5s3.6.6 5.1.2C18 2.4 19.2 0 20.8 0c1.6 0 2.8 2.4 4.3 2.7 1.5.4 3.8-1 5.1-.2 1.3.8 1.2 3.4 2.3 4.5 1.1 1.1 3.7 1 4.5 2.3s-.6 3.6-.2 5.1c.3 1.5 2.7 2.7 2.7 4.3z",fill:"#599fd9"}),(0,r.createElement)("path",{d:"M23.6 7c-6.4-1.5-12.9 2.5-14.4 8.9-.7 3.1-.2 6.3 1.5 9.1 1.7 2.7 4.3 4.6 7.4 5.4.9.2 1.9.3 2.8.3 2.2 0 4.4-.6 6.3-1.8 2.7-1.7 4.6-4.3 5.4-7.5C34 15 30 8.5 23.6 7zm7 14c-.6 2.6-2.2 4.8-4.5 6.2-2.3 1.4-5 1.8-7.6 1.2-2.6-.6-4.8-2.2-6.2-4.5-1.4-2.3-1.8-5-1.2-7.6.6-2.6 2.2-4.8 4.5-6.2 1.6-1 3.4-1.5 5.2-1.5.8 0 1.5.1 2.3.3 5.4 1.3 8.7 6.7 7.5 12.1zm-8.2-4.5l3.7.5-2.7 2.7.7 3.7-3.4-1.8-3.3 1.8.6-3.7-2.7-2.7 3.8-.5 1.6-3.4 1.7 3.4z",fill:"#fff"})),"personal"===t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h2",{className:"ct-modal-title"},n.title),(0,r.createElement)("p",null,n.description)),"professional"===t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",null,"Required plan"),(0,r.createElement)("h2",{className:"ct-modal-title"},(0,a.__)("Business or Agency","blocksy-companion")),(0,r.createElement)("p",null,o.description)),"agency"===t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",null,"Required plan"),(0,r.createElement)("h2",{className:"ct-modal-title"},(0,a.__)("Agency","blocksy-companion")),(0,r.createElement)("p",null,i.description)),(0,r.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,r.createElement)("a",{href:ctDashboardLocalizations.plugin_data?ctDashboardLocalizations.plugin_data.modal_links["compare-plans"]:"https://creativethemes.com/blocksy/pricing/#comparison-free-vs-pro",target:"_blank",className:"button"},(0,a.__)("Compare Plans","blocksy-companion")),(0,r.createElement)("a",{href:ctDashboardLocalizations.plugin_data.modal_links?ctDashboardLocalizations.plugin_data.modal_links.pricing:"https://creativethemes.com/blocksy/pricing/",target:"_blank",className:"button button-primary"},(0,a.__)("Upgrade Now","blocksy-companion"))))}})}};function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pe=function(e,t={}){t=ue({strategy:"pro-ext",modalTitle:(0,a.__)("This is a Pro extension","blocksy-companion")},t);const[n,o]=(0,r.useState)(!1),i=ctDashboardLocalizations.plugin_data.is_pro,{history:s}=(0,r.useContext)(se),l=!i&&e.config.pro,c=ctDashboardLocalizations.plugin_data.current_plan;let u="personal";e.config.plans&&(e.config.plans.includes("agency_v2")&&(u="agency"),e.config.plans.includes("professional_v2")&&(u="professional"));const{content:p,showNotice:d}=le(ue({currentPlan:c,requiredPlan:u},t));return{isPro:i,isProInFree:!i&&e.config.pro||e.config.plans&&e.config.plans.length&&!e.config.plans.includes(c),showNotice:d,content:"pro-ext"===t.strategy&&l||"pro"===t.strategy&&!i||e.config.plans&&e.config.plans.length&&!e.config.plans.includes(c)?p:null}};const de=["mailchimp","demo"];var fe=function({extension:e,onCredentialsValidated:t}){const[n,o]=(0,r.useState)(e.data.provider),[i,s]=(0,r.useState)(e.data.api_key),[c,u]=(0,r.useState)(e.data.api_url),[p,d]=(0,r.useState)(e.data.list_id),[f,m]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1),{isPro:y,showNotice:v,content:b}=pe(e,{strategy:"pro"});(0,r.useEffect)(function(){!e.data||de.includes(e.data.provider)||y||o(de[0])},[]);const I={mailerlite:"mailerlite-new",convertkit:"convertkit-new"},_=I[Object.keys(I).find(function(e){return n.includes(e)})||n]||n;return(0,r.createElement)("div",{className:l()("ct-extension-options ct-newsletter-subscribe-options")},(0,r.createElement)("h4",null,(0,a.__)("Connect Newsletter Provider","blocksy-companion")),(0,r.createElement)("div",{className:"ct-newsletter-credentials","data-columns":n.indexOf("mailerlite")>-1||"activecampaign"===n||n.indexOf("convertkit")>-1?4:["mailpoet","fluentcrm"].includes(n)?2:3},(0,r.createElement)("section",null,(0,r.createElement)("label",null,(0,a.__)("Provider","blocksy-companion")),(0,r.createElement)(ie.Select,{onChange:function(e){if(!y&&!de.includes(e))return o(e),setTimeout(function(){o(de[0])}),void v();o(e)},option:{placeholder:(0,a.__)("Pick Mailing Service","blocksy-companion"),choices:e.data.providers},value:_})),n.indexOf("activecampaign")>-1&&(0,r.createElement)("section",null,(0,r.createElement)("label",null,(0,a.__)("API URL","blocksy-companion")),(0,r.createElement)("div",{className:"ct-option-input"},(0,r.createElement)("input",{type:"text",onChange:function({target:{value:e}}){return u(e)},value:c||""}))),n.indexOf("mailerlite")>-1&&(0,r.createElement)("section",null,(0,r.createElement)("label",null,(0,a.__)("API Version","blocksy-companion")),(0,r.createElement)(ie.Select,{onChange:function(e){o("new"===e?"mailerlite-new":"mailerlite")},option:{placeholder:(0,a.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"new",value:"New"},{key:"classic",value:"Classic"}]},value:"mailerlite-new"===n?"new":"classic"})),n.indexOf("convertkit")>-1&&(0,r.createElement)("section",null,(0,r.createElement)("label",null,(0,a.__)("API Version","blocksy-companion")),(0,r.createElement)(ie.Select,{onChange:function(e){o("new"===e?"convertkit-new":"convertkit")},option:{placeholder:(0,a.__)("Pick Mailing Service","blocksy-companion"),choices:[{key:"new",value:"New (v4)"},{key:"classic",value:"Classic (v3)"}]},value:"convertkit-new"===n?"new":"classic"})),(de.includes(n)||ctDashboardLocalizations.plugin_data.is_pro)&&(0,r.createElement)(r.Fragment,null,["mailpoet","fluentcrm"].includes(n)?null:(0,r.createElement)("section",null,(0,r.createElement)("label",null,(0,a.__)("API Key","blocksy-companion")),(0,r.createElement)("div",{className:"ct-option-input"},(0,r.createElement)("input",{type:"text",onChange:function({target:{value:e}}){return s(e)},value:i||""}))),(0,r.createElement)("section",null,(0,r.createElement)("label",null,(0,a.__)("List ID","blocksy-companion")),(0,r.createElement)(re,{listId:p,onChange:function(e){return d(e)},provider:n,apiUrl:c,apiKey:i,onListsLoading:function(e){return m(!!e)}})))),"mailchimp"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for Mailchimp can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://mailchimp.com/help/about-api-keys/">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&n.indexOf("mailerlite")>-1&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for Mailerlite can be found %shere%s. Please note that it is required at least one group to be created in your account for the integration to work. More info on how to create a group %shere%s.","blocksy-companion"),'<a target="_blank" href="https://www.mailerlite.com/help/where-to-find-the-mailerlite-api-key-and-documentation">',"</a>",'<a target="_blank" href="https://www.mailerlite.com/help/how-to-create-and-use-groups">',"</a>")}}),n.indexOf("demo")>-1&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.__)("This provider is used only for testing purposes. It doesnt register any real subscribers.","blocksy-companion")}}),ctDashboardLocalizations.plugin_data.is_pro&&"klaviyo"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for Klaviyo can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://developers.klaviyo.com/en/reference/api_overview">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"brevo"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for Brevo can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://help.brevo.com/hc/en-us/articles/209467485-Create-and-manage-your-API-keys">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&n.indexOf("convertkit")>-1&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for Kit (ConvertKit) can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://developers.kit.com/welcome#api-basics">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"activecampaign"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for ActiveCampaign can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://developers.activecampaign.com/reference/overview">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"campaignmonitor"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for Campaign Monitor can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://help.campaignmonitor.com/api-keys">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"emailoctopus"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to generate an API key for EmailOctopus can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://emailoctopus.com/api-documentation/v2">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"mailpoet"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to create a list in MailPoet can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://kb.mailpoet.com/article/282-create-a-list">',"</a>")}}),ctDashboardLocalizations.plugin_data.is_pro&&"fluentcrm"===n&&(0,r.createElement)("span",{className:"ct-option-description",dangerouslySetInnerHTML:{__html:(0,a.sprintf)((0,a.__)("More information on how to create a list in fluentcrm can be found %shere%s.","blocksy-companion"),'<a target="_blank" href="https://kb.fluentcrm.com/article/282-create-a-list">',"</a>")}}),(0,r.createElement)("button",{className:"ct-button-primary",disabled:!i&&!["mailpoet","fluentcrm"].includes(n)||!p||!f||h||!c&&"activecampaign"===n,onClick:function(){return async function(){const e=new FormData;e.append("provider",n),e.append("api_key",i),e.append("api_url",c),e.append("list_id",p),e.append("action","blocksy_ext_newsletter_subscribe_maybe_save_credentials"),e.append("nonce",ctDashboardLocalizations.dashboard_actions_nonce),g(!0);try{const n=await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:e});if(200===n.status){const e=await n.json();e.success&&"api_key_invalid"!==e.data.result&&t()}}catch(e){}await new Promise(function(e){return setTimeout(function(){return e()},1e3)}),g(!1)}()}},h?(0,a.__)("Loading...","blocksy-companion"):(0,a.__)("Save Settings","blocksy-companion")),b)};var me=function({extension:e,onExtsSync:t}){return(0,r.createElement)(fe,{extension:e,onCredentialsValidated:function(){e.__object||async function(){const n=new FormData;n.append("ext",e.name),n.append("action",e.__object?"blocksy_extension_deactivate":"blocksy_extension_activate"),n.append("nonce",ctDashboardLocalizations.dashboard_actions_nonce);try{await fetch(ctDashboardLocalizations.ajax_url,{method:"POST",body:n}),t()}catch(e){}}()}})};function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?he(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):he(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}(0,i.addFilter)("blocksy.extensions.current_extension_content","blocksy",function(e,{extension:t,onExtsSync:n}){return"newsletter-subscribe"!==t.name?e:ge(ge(ge({},e),t.data.api_key?{}:{activationStrategy:"from-custom-content"}),{},{content:(0,r.createElement)(me,{extension:t,onExtsSync:n})})})}()}();