File: /www/wwwroot/www.cytocare.cn/wp-content/plugins/blocksy-companion/static/bundle/options.js
!function(){var e={487:function(e){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=t},184:function(e,t){var n;
/*!
  Copyright (c) 2017 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];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=r.apply(null,n);i&&e.push(i)}else if("object"===a)for(var c in n)o.call(n,c)&&n[c]&&e.push(c)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},12:function(e){var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,o=0;n<e.length;n++,o+=8)t[o>>>5]|=e[n]<<24-o%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],o=0;o<e.length;o+=3)for(var r=e[o]<<16|e[o+1]<<8|e[o+2],a=0;a<4;a++)8*o+6*a<=8*e.length?n.push(t.charAt(r>>>6*(3-a)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],o=0,r=0;o<e.length;r=++o%4)0!=r&&n.push((t.indexOf(e.charAt(o-1))&Math.pow(2,-2*r+8)-1)<<2*r|t.indexOf(e.charAt(o))>>>6-2*r);return n}},e.exports=n},738:function(e){function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}
/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},568:function(e,t,n){var o,r,a,i,c;o=n(12),r=n(487).utf8,a=n(738),i=n(487).bin,(c=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?i.stringToBytes(e):r.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=o.bytesToWords(e),l=8*e.length,s=1732584193,u=-271733879,p=-1732584194,d=271733878,f=0;f<n.length;f++)n[f]=16711935&(n[f]<<8|n[f]>>>24)|4278255360&(n[f]<<24|n[f]>>>8);n[l>>>5]|=128<<l%32,n[14+(l+64>>>9<<4)]=l;var m=c._ff,y=c._gg,h=c._hh,v=c._ii;for(f=0;f<n.length;f+=16){var b=s,g=u,_=p,w=d;s=m(s,u,p,d,n[f+0],7,-680876936),d=m(d,s,u,p,n[f+1],12,-389564586),p=m(p,d,s,u,n[f+2],17,606105819),u=m(u,p,d,s,n[f+3],22,-1044525330),s=m(s,u,p,d,n[f+4],7,-176418897),d=m(d,s,u,p,n[f+5],12,1200080426),p=m(p,d,s,u,n[f+6],17,-1473231341),u=m(u,p,d,s,n[f+7],22,-45705983),s=m(s,u,p,d,n[f+8],7,1770035416),d=m(d,s,u,p,n[f+9],12,-1958414417),p=m(p,d,s,u,n[f+10],17,-42063),u=m(u,p,d,s,n[f+11],22,-1990404162),s=m(s,u,p,d,n[f+12],7,1804603682),d=m(d,s,u,p,n[f+13],12,-40341101),p=m(p,d,s,u,n[f+14],17,-1502002290),s=y(s,u=m(u,p,d,s,n[f+15],22,1236535329),p,d,n[f+1],5,-165796510),d=y(d,s,u,p,n[f+6],9,-1069501632),p=y(p,d,s,u,n[f+11],14,643717713),u=y(u,p,d,s,n[f+0],20,-373897302),s=y(s,u,p,d,n[f+5],5,-701558691),d=y(d,s,u,p,n[f+10],9,38016083),p=y(p,d,s,u,n[f+15],14,-660478335),u=y(u,p,d,s,n[f+4],20,-405537848),s=y(s,u,p,d,n[f+9],5,568446438),d=y(d,s,u,p,n[f+14],9,-1019803690),p=y(p,d,s,u,n[f+3],14,-187363961),u=y(u,p,d,s,n[f+8],20,1163531501),s=y(s,u,p,d,n[f+13],5,-1444681467),d=y(d,s,u,p,n[f+2],9,-51403784),p=y(p,d,s,u,n[f+7],14,1735328473),s=h(s,u=y(u,p,d,s,n[f+12],20,-1926607734),p,d,n[f+5],4,-378558),d=h(d,s,u,p,n[f+8],11,-2022574463),p=h(p,d,s,u,n[f+11],16,1839030562),u=h(u,p,d,s,n[f+14],23,-35309556),s=h(s,u,p,d,n[f+1],4,-1530992060),d=h(d,s,u,p,n[f+4],11,1272893353),p=h(p,d,s,u,n[f+7],16,-155497632),u=h(u,p,d,s,n[f+10],23,-1094730640),s=h(s,u,p,d,n[f+13],4,681279174),d=h(d,s,u,p,n[f+0],11,-358537222),p=h(p,d,s,u,n[f+3],16,-722521979),u=h(u,p,d,s,n[f+6],23,76029189),s=h(s,u,p,d,n[f+9],4,-640364487),d=h(d,s,u,p,n[f+12],11,-421815835),p=h(p,d,s,u,n[f+15],16,530742520),s=v(s,u=h(u,p,d,s,n[f+2],23,-995338651),p,d,n[f+0],6,-198630844),d=v(d,s,u,p,n[f+7],10,1126891415),p=v(p,d,s,u,n[f+14],15,-1416354905),u=v(u,p,d,s,n[f+5],21,-57434055),s=v(s,u,p,d,n[f+12],6,1700485571),d=v(d,s,u,p,n[f+3],10,-1894986606),p=v(p,d,s,u,n[f+10],15,-1051523),u=v(u,p,d,s,n[f+1],21,-2054922799),s=v(s,u,p,d,n[f+8],6,1873313359),d=v(d,s,u,p,n[f+15],10,-30611744),p=v(p,d,s,u,n[f+6],15,-1560198380),u=v(u,p,d,s,n[f+13],21,1309151649),s=v(s,u,p,d,n[f+4],6,-145523070),d=v(d,s,u,p,n[f+11],10,-1120210379),p=v(p,d,s,u,n[f+2],15,718787259),u=v(u,p,d,s,n[f+9],21,-343485551),s=s+b>>>0,u=u+g>>>0,p=p+_>>>0,d=d+w>>>0}return o.endian([s,u,p,d])})._ff=function(e,t,n,o,r,a,i){var c=e+(t&n|~t&o)+(r>>>0)+i;return(c<<a|c>>>32-a)+t},c._gg=function(e,t,n,o,r,a,i){var c=e+(t&o|n&~o)+(r>>>0)+i;return(c<<a|c>>>32-a)+t},c._hh=function(e,t,n,o,r,a,i){var c=e+(t^n^o)+(r>>>0)+i;return(c<<a|c>>>32-a)+t},c._ii=function(e,t,n,o,r,a,i){var c=e+(n^(t|~o))+(r>>>0)+i;return(c<<a|c>>>32-a)+t},c._blocksize=16,c._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=o.wordsToBytes(c(e,t));return t&&t.asBytes?n:t&&t.asString?i.bytesToString(n):o.bytesToHex(n)}},496:function(e){for(var t=self.crypto||self.msCrypto,n="-_",o=36;o--;)n+=o.toString(36);for(o=36;o---10;)n+=o.toString(36).toUpperCase();e.exports=function(e){var r="",a=t.getRandomValues(new Uint8Array(e||21));for(o=e||21;o--;)r+=n[63&a[o]];return r}},539:function(e,t){var n,o,r;
/*!
 * php-unserialize-js JavaScript Library
 * https://github.com/bd808/php-unserialize-js
 *
 * Copyright 2013 Bryan Davis and contributors
 * Released under the MIT license
 * http://www.opensource.org/licenses/MIT
 */!function(a,i){"use strict";o=[],void 0===(r="function"==typeof(n=function(){return function(e){var t,n=0,o=[],r=0,a=function(){var t=e.indexOf(":",n),o=e.substring(n,t);return n=t+2,parseInt(o,10)},i=function(){var t=e.indexOf(";",n),o=e.substring(n,t);return n=t+1,parseInt(o,10)},c=function(){var e=i();return o[r++]=e,e},l=function(){var t=e.indexOf(";",n),a=e.substring(n,t);return n=t+1,a=parseFloat(a),o[r++]=a,a},s=function(){var t=e.indexOf(";",n),a=e.substring(n,t);return n=t+1,a="1"===a,o[r++]=a,a},u=function(t='"'){for(var o,r,i=a(),c=0,l=0;l<i;)(o=e.charCodeAt(n+c++))<=127?l++:l+=o>2047?3:2;return e.charAt(n+c)!==t&&(c+=e.indexOf('"',n+c)-n-c),r=e.substring(n,n+c),n+=c+2,r},p=function(){var e=u();return o[r++]=e,e},d=function(){var t=e.charAt(n);return n+=2,t},f=function(){var e=d();switch(e){case"i":return i();case"s":return u();default:throw new Error("Unknown key type '"+e+"' at position "+(n-2))}},m=function(){var e,i,c,l,s,u=a(),p=[],d={},m=p,y=r++;o[y]=m;try{for(c=0;c<u;c++)if(e=f(),i=t(),m===p&&e+""==c+"")p.push(i);else{if(m!==d){for(l=0,s=p.length;l<s;l++)d[l]=p[l];m=d,o[y]=m}d[e]=i}}catch(e){throw e.state=m,e}return n++,m},y=function(e,t){var o,r,a;if("\0"===e.charAt(0)){if((a=e.indexOf("\0",1))>0)return o=e.substring(1,a),r=e.substr(a+1),"*"===o||t===o?r:o+"::"+r;var i="Expected two <NUL> characters in non-public property name '"+e+"' at position "+(n-e.length-2);throw new Error(i)}return e},h=function(){var e,i,c,l,s={},p=r++,d=u();o[p]=s,e=a();try{for(l=0;l<e;l++)i=y(f(),d),c=t(),s[i]=c}catch(e){throw e.state=s,e}return n++,s},v=function(){return{__PHP_Incomplete_Class_Name:u(),serialized:u("}")}},b=function(){var e=i(),t=o[e-1];return o[r++]=t,t},g=function(){var e=i();return o[e-1]},_=function(){var e=null;return o[r++]=e,e};return(t=function(){var e=d();switch(e){case"i":return c();case"d":return l();case"b":return s();case"s":return p();case"a":return m();case"O":return h();case"C":return v();case"r":return b();case"R":return g();case"N":return _();default:throw new Error("Unknown type '"+e+"' at position "+(n-2))}})()}})?n.apply(t,o):n)||(e.exports=r)}()},459:function(e,t,n){var o=n(967);function r(e,t,n,o,a){var i=new Error(n,o,a);return i.name="UseFetchError",i.status=e,i.statusText=t,Object.setPrototypeOf(i,Object.getPrototypeOf(this)),Error.captureStackTrace&&Error.captureStackTrace(i,r),i}r.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(r,Error),e.exports=function(e,t,n){var a=(n&&n.depends||t&&t.depends||[]).reduce((function(e,t){return e||!t}),!1);return o(!a&&function(e,t,n){return fetch(e,t).then(n&&n.formatter||t&&t.formatter||function(e){if(!e.ok)throw new r(e.status,e.statusText,"Fetch error");return e.json()})},e,t||{},n||{})}},967:function(e,t,n){var o=n(313),r=n(923);e.exports=function(e){var t=Array.prototype.slice.call(arguments,[1]),n=o.useState({isLoading:!!e});return o.useEffect((function(){e&&(!n[0].isLoading&&n[1]({data:n[0].data,isLoading:!0}),e.apply(null,t).then((function(e){n[1]({data:e,isLoading:!1})})).catch((function(e){n[1]({error:e,isLoading:!1})})))}),r(t)),n[0]}},923:function(e){e.exports=function e(){for(var t=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o instanceof Array)for(var r=0;r<o.length;r++)t=t.concat(e(o[r]));else if("undefined"!=typeof URL&&o instanceof URL)t=t.concat(o.toJSON());else if(o instanceof Object)for(var a=Object.keys(o),i=0;i<a.length;i++){var c=a[i];t=t.concat([c]).concat(e(o[c]))}else t=t.concat(o)}return t}},616:function(e,t,n){var o=n(496);e.exports=function(){var e=function(){e.id=o(),e.subscribers.forEach((function(e){e()}))};return e.id=o(),e.subscribers=[],e.subscribe=function(t){e.subscribers.push(t)},e.unsubscribe=function(t){e.subscribers.indexOf(t)>=0&&e.subscribers.splice(e.subscribers.indexOf(t),1)},e}},382:function(e,t,n){var o=n(313);e.exports=function(e){var t=o.useState(e.id),n=function(){return t[1](e.id)};return o.useEffect((function(){return e.subscribe(n),function(){return e.unsubscribe(n)}}),[]),t[0]}},313:function(e){"use strict";e.exports=window.React},61:function(e,t,n){var o=n(698).default;function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=r=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,i=a.hasOwnProperty,c=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},s=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",p=l.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,n){return e[t]=n}}function f(e,t,n,o){var r=t&&t.prototype instanceof _?t:_,a=Object.create(r.prototype),i=new L(o||[]);return c(a,"_invoke",{value:N(e,n,i)}),a}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var y="suspendedStart",h="suspendedYield",v="executing",b="completed",g={};function _(){}function w(){}function E(){}var O={};d(O,s,(function(){return this}));var k=Object.getPrototypeOf,j=k&&k(k(A([])));j&&j!==a&&i.call(j,s)&&(O=j);var x=E.prototype=_.prototype=Object.create(O);function C(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(r,a,c,l){var s=m(e[r],e,a);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==o(p)&&i.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,c,l)}),(function(e){n("throw",e,c,l)})):t.resolve(p).then((function(e){u.value=e,c(u)}),(function(e){return n("throw",e,c,l)}))}l(s.arg)}var r;c(this,"_invoke",{value:function(e,o){function a(){return new t((function(t,r){n(e,o,t,r)}))}return r=r?r.then(a,a):a()}})}function N(e,n,o){var r=y;return function(a,i){if(r===v)throw Error("Generator is already running");if(r===b){if("throw"===a)throw i;return{value:t,done:!0}}for(o.method=a,o.arg=i;;){var c=o.delegate;if(c){var l=P(c,o);if(l){if(l===g)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(r===y)throw r=b,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);r=v;var s=m(e,n,o);if("normal"===s.type){if(r=o.done?b:h,s.arg===g)continue;return{value:s.arg,done:o.done}}"throw"===s.type&&(r=b,o.method="throw",o.arg=s.arg)}}}function P(e,n){var o=n.method,r=e.iterator[o];if(r===t)return n.delegate=null,"throw"===o&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g;var a=m(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function n(){for(;++r<e.length;)if(i.call(e,r))return n.value=e[r],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(o(e)+" is not iterable")}return w.prototype=E,c(x,"constructor",{value:E,configurable:!0}),c(E,"constructor",{value:w,configurable:!0}),w.displayName=d(E,p,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,d(e,p,"GeneratorFunction")),e.prototype=Object.create(x),e},n.awrap=function(e){return{__await:e}},C(S.prototype),d(S.prototype,u,(function(){return this})),n.AsyncIterator=S,n.async=function(e,t,o,r,a){void 0===a&&(a=Promise);var i=new S(f(e,t,o,r),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},C(x),d(x,p,"Generator"),d(x,s,(function(){return this})),d(x,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},n.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(o,r){return c.type="throw",c.arg=e,n.next=o,r&&(n.method="next",n.arg=t),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=i.call(a,"catchLoc"),s=i.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;D(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,n,o){return this.delegate={iterator:A(e),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=t),g}},n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},698:function(e){function t(n){return e.exports=t="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.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:function(e,t,n){var o=n(61)();e.exports=o;try{regeneratorRuntime=o}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,n),a.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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.components;function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function r(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=a.call(n)).done)&&(c.push(o.value),c.length!==t);l=!0);}catch(e){s=!0,r=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw r}}return c}}(e,t)||r(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var i=window.wp.i18n,c=window.blocksyOptions;function l(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return s="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},s(e)}function u(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=s(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function p(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var d=n(184),f=n.n(d);function m(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.includes(o))continue;n[o]=e[o]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=(0,e.useContext)(Q),o=n.isAdvancedMode,r=n.remoteConditions,a=n.allLanguages,i=r;return{isAdvancedMode:o,allRules:i.reduce((function(e,t){var n=t.rules,o=t.title;return[].concat(l(e),l(n.map((function(e){return h(h({},e),{},{group:o})}))))}),[]).reduce((function(e,n){var o=n.title,r=n.id,a=n.sub_ids,i=void 0===a?[]:a,c=m(n,["title","id","sub_ids"]);return[].concat(l(e),[h({key:t&&i.length>0&&i.find((function(e){return e.id===t.rule}))?t.rule:r,value:o,sub_ids:i},c)])}),[]),rulesToUse:i,allLanguages:a}};function b(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,u(o.key),o)}}var g=function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},_=n(568),w=n.n(_);function E(e){if(Array.isArray(e))return"[".concat(e.map((function(e){return E(e)})).join(","),"]");if("object"===s(e)&&null!==e){var t="",n=Object.keys(e).sort();t+="{".concat(JSON.stringify(n));for(var o=0;o<n.length;o++)t+="".concat(E(e[n[o]]),",");return"".concat(t,"}")}return"".concat(JSON.stringify(e))}var O=function(e){return w()(E(e))};function k(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 j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=0,C=1,S=2,N={cacheKey:{state:x,response:null,payoad:{}}},P={},T=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,o;return t=e,(n=[{key:"parseOptions",value:function(e){var t=e.fetcherName;return{args:{fetcherName:void 0===t?null:t},inputFetchOptions:m(e,["fetcherName"])}}},{key:"fetch",value:function(e,t,n){var o=this.parseOptions(n).args,r=O(j(j({},t),{},{url:e}));if(N[r]||(N[r]={state:x,response:null,payload:{waitingForResponse:[]}},o.fetcherName&&P[o.fetcherName]&&(P[o.fetcherName].forEach((function(e){e.abort()})),P[o.fetcherName]=[])),N[r].state===S){var a=g();return a.resolve(N[r].response.clone()),a.promise}if(N[r].state===C)return this.fetchLoadingState(r,e,t,n);if(N[r].state===x)return this.fetchEmptyState(r,e,t,n);throw new Error("Invalid state",{cacheEntry:N[r]})}},{key:"fetchLoadingState",value:function(e,t,n,o){var r=g();return N[e].payload.waitingForResponse.push(r),r.promise}},{key:"fetchEmptyState",value:function(e,t,n,o){var r=this.parseOptions(o),a=r.args,i=r.inputFetchOptions;N[e].state=C;var c=new AbortController;a.fetcherName&&(P[a.fetcherName]||(P[a.fetcherName]=[]),P[a.fetcherName].push(c));var s=g(),u=j({method:"POST",headers:{"Content-Type":"application/json"},signal:c.signal},i);return"POST"===u.method&&(u.body=JSON.stringify(n)),fetch(t,u).then((function(t){N[e].response=t.clone(),[s].concat(l(N[e].payload.waitingForResponse)).forEach((function(t){t.resolve(N[e].response.clone())})),N[e].payload={waitingForResponse:[]},N[e].state=S,a.fetcherName&&(P[a.fetcherName]=[])})).catch((function(t){[s].concat(l(N[e].payload.waitingForResponse)).forEach((function(t){t.reject(N[e].response)})),N[e].payload={waitingForResponse:[]},N[e].state=x})),s.promise}}])&&b(t.prototype,n),o&&b(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()),D=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return T.fetch(e,t,n)};function L(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(t){var n=t.entity,o=t.placeholder,r=t.additionOptions,s=void 0===r?[]:r,u=t.value,p=t.postType,d=t.onChange,f=a((0,e.useState)([]),2),m=f[0],y=f[1],h=(0,e.useMemo)((function(){var e={};return"posts"===n&&(e.post_type=p),"taxonomies"===n&&(e.post_type=p),A(A({},e),u?{alsoInclude:u}:{})}),[n,p,u]),v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";D("".concat(wp.ajax.settings.url,"?action=blocksy_conditions_get_all_entities"),A(A({entity:n},e?{search_query:e}:{}),h),{fetcherName:"conditions-get-all-entities-picker"}).then((function(e){return e.json()})).then((function(e){var t=e.data.entities;y(l(t).filter((function(e,t,n){return n.findIndex((function(t){return t.id===e.id}))===t})))}))};return(0,e.useEffect)((function(){v()}),[n,p]),(0,e.createElement)(c.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,searchPlaceholder:(0,i.__)("Type to search by ID or title...","blocksy-companion"),placeholder:o,choices:[].concat(l(s),l(m.map((function(e){return A({key:e.id,value:e.label},e.group?{group:e.group}:{})})))),search:!0},value:u,onChange:function(e){return d(m.find((function(t){return t.id===e}))||e)},onInputValueChange:function(e){m.find((function(t){var n=t.label,o=t.id;return n===e||o===e}))||v(e)}})};function z(){return z=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},z.apply(null,arguments)}function F(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 M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=function(t){var n=t.onChange,o=t.condition,r=a((0,e.useState)("start"),2),l=r[0],s=r[1],u=(0,e.useRef)(),d=a((0,e.useState)(!1),2),m=d[0],y=d[1],h=(0,c.usePopoverMaker)({ref:u,defaultHeight:228,shouldCalculate:!0}),v=h.styles,b=h.popoverProps,g=o.payload.start||new Date,_=o.payload.end||new Date,w=[wp.date.format("j/n/Y",g),wp.date.format("j/n/Y",_)];return w[0]===w[1]&&(w=[wp.date.format(wp.date.getSettings().formats.time,g),wp.date.format(wp.date.getSettings().formats.time,_)]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(c.OutsideClickHandler,{className:"ct-select-input",wrapperProps:{ref:u,role:"combobox","aria-expanded":m,"aria-haspopup":"listbox",onClick:function(){y(!m)}},onOutsideClick:function(e){e.target.closest(".ct-select-dropdown")||y(!1)}},(0,e.createElement)("input",{value:w.join(" - "),onChange:function(){},readOnly:!0})),m&&(0,e.createPortal)((0,e.createElement)("div",z({className:f()("ct-select-dropdown ct-date-time-picker-dropdown",{"ct-fixed":!0})},b,{style:v}),(0,e.createElement)("div",{className:"ct-start-end-date-switcher components-button-group"},["start","end"].map((function(t){return(0,e.createElement)("button",{key:t,className:f()("components-button",{"is-primary":t===l}),onClick:function(){s(t)}},"start"===t?"Start Date":"Expiration Date")}))),(0,e.createElement)(c.DateTimePicker,{value:(o.payload||{})[l]||new Date,onChange:function(e){"end"===l&&new Date(e).getTime()<(o.payload.start?new Date(o.payload.start).getTime():(new Date).getTime())&&(e=o.payload.start,alert((0,i.__)("The expiration date cannot be set earlier than the start date.","blocksy-companion"))),"start"===l&&new Date(e).getTime()>(o.payload.end?new Date(o.payload.end).getTime():(new Date).getTime())&&(o.payload.end=e),n(M(M({},o),{},{payload:M(M(M({},o.payload),o.payload.start?{}:{start:g}),{},p({},l,e))}))}})),document.body))},I=window.wp.date;function H(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 U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var V=function(n){var o=n.onChange,r=n.condition,l=(0,e.useRef)(),s=a((0,e.useState)(!1),2),u=s[0],d=s[1],m=(0,c.usePopoverMaker)({ref:l,defaultHeight:228,shouldCalculate:!0}),y=m.styles,h=m.popoverProps,v={monday:!0,tuesday:!0,wednesday:!0,thursday:!0,friday:!0,saturday:!0,sunday:!0},b=Object.keys(v).filter((function(e){return(r.payload.days||v)[e]})),g="Only "+b.map((function(e){return function(e){return{monday:(0,i.__)("Mon","blocksy-companion"),tuesday:(0,i.__)("Tue","blocksy-companion"),wednesday:(0,i.__)("Wed","blocksy-companion"),thursday:(0,i.__)("Thu","blocksy-companion"),friday:(0,i.__)("Fri","blocksy-companion"),saturday:(0,i.__)("Sat","blocksy-companion"),sunday:(0,i.__)("Sun","blocksy-companion")}[e]}(e)})).join(", ");7===b.length&&(g=(0,i.__)("Every day","blocksy-companion")),2===b.length&&b.includes("saturday")&&b.includes("sunday")&&(g=(0,i.__)("Only weekends","blocksy-companion")),5!==b.length||b.includes("saturday")||b.includes("sunday")||(g=(0,i.__)("Only weekdays","blocksy-companion")),0===b.length&&(g=(0,i.__)("Never","blocksy-companion"));var _=r.payload.time_start||"00:00",w=r.payload.time_end||"23:59",E=new Date;E.setHours(_.split(":")[0]),E.setMinutes(_.split(":")[1],0,0);var O=new Date;O.setHours(w.split(":")[0]),O.setMinutes(w.split(":")[1],0,0);var k=(0,I.getSettings)(),j=/a(?!\\)/i.test(k.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(c.OutsideClickHandler,{className:"ct-select-input",wrapperProps:{ref:l,role:"combobox","aria-expanded":u,"aria-haspopup":"listbox",onClick:function(){d(!u)}},onOutsideClick:function(e){e.target.closest(".ct-select-dropdown")||d(!1)}},(0,e.createElement)("input",{value:g,onChange:function(){},readOnly:!0})),u&&(0,e.createPortal)((0,e.createElement)("div",z({className:f()("ct-select-dropdown ct-recurring-scheduling-dropdown",{"ct-fixed":!0})},h,{style:y}),(0,e.createElement)("div",{className:"ct-recurring-scheduling-days"},(0,e.createElement)("label",{className:"ct-label"},(0,i.__)("Recurring Days","blocksy-companion")),[{key:"monday",value:(0,i.__)("Monday","blocksy-companion")},{key:"tuesday",value:(0,i.__)("Tuesday","blocksy-companion")},{key:"wednesday",value:(0,i.__)("Wednesday","blocksy-companion")},{key:"thursday",value:(0,i.__)("Thursday","blocksy-companion")},{key:"friday",value:(0,i.__)("Friday","blocksy-companion")},{key:"saturday",value:(0,i.__)("Saturday","blocksy-companion")},{key:"sunday",value:(0,i.__)("Sunday","blocksy-companion")}].map((function(n){var a=n.key,i=n.value;return(0,e.createElement)(t.CheckboxControl,{label:i,checked:(r.payload.days||v)[a],onChange:function(){o(U(U({},r),{},{payload:U(U({},r.payload),{},{days:U(U({},r.payload.days||v),{},p({},a,!(r.payload.days||v)[a]))})}))}})}))),(0,e.createElement)("div",{className:"ct-recurring-scheduling-time"},(0,e.createElement)("div",{className:"ct-recurring-start-time"},(0,e.createElement)("label",{className:"ct-label"},(0,i.__)("Start Time","blocksy-companion")),(0,e.createElement)(t.TimePicker,{is12Hour:j,currentTime:E,onChange:function(e){o(U(U({},r),{},{payload:U(U({},r.payload),{},{time_start:wp.date.format("H:i",e)})}))}})),(0,e.createElement)("div",{className:"ct-recurring-stop-time"},(0,e.createElement)("label",{className:"ct-label"},(0,i.__)("Stop Time","blocksy-companion")),(0,e.createElement)(t.TimePicker,{is12Hour:j,currentTime:O,onChange:function(e){o(U(U({},r),{},{payload:U(U({},r.payload),{},{time_end:wp.date.format("H:i",e)})}))}})))),document.body))};function G(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 q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?G(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Y=function(t){var n=t.className,o=void 0===n?"":n,r=t.condition,a=t.onRemove,l=t.onChange;r=q(q({},r),{},{payload:q({},r.payload)});var s=v(r),u=s.allRules,p=s.allLanguages,d=u.find((function(e){return e.key===r.rule})),m="post_ids"===r.rule||"page_ids"===r.rule||"product_ids"===r.rule||"custom_post_type_ids"===r.rule||"taxonomy_ids"===r.rule||"post_with_taxonomy_ids"===r.rule||"card_product_with_taxonomy_ids"===r.rule||"card_post_with_taxonomy_ids"===r.rule||"product_with_taxonomy_ids"===r.rule||"product_taxonomy_ids"===r.rule||"current_language"===r.rule||"user_post_author_id"===r.rule||"author"===r.rule||"start_end_date"===r.rule||"schedule_date"===r.rule||"request_referer"===r.rule||"request_cookie"===r.rule||"request_url"===r.rule||d&&d.sub_ids&&d.sub_ids.length>0||d&&d.is_custom_rule&&d.has_text_field||d&&d.is_custom_rule&&d.choices;return(0,e.createElement)("div",{className:f()("ct-condition-group",o,{"ct-cols-3":m,"ct-cols-2":!m})},(0,e.createElement)(c.Select,{key:"first",option:{inputClassName:"ct-condition-type",selectInputStart:function(){return"include"===r.type?(0,e.createElement)("span",{className:"ct-include"},(0,e.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,e.createElement)("path",{d:"M20,11h-9v9H9v-9H0V9h9V0h2v9h9V11z"}))):"exclude"===r.type?(0,e.createElement)("span",{className:"ct-exclude"},(0,e.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,e.createElement)("path",{d:"M20,9v2H0V9H20z"}))):null},placeholder:(0,i.__)("Select variation","blocksy-companion"),choices:{include:(0,i.__)("Include","blocksy-companion"),exclude:(0,i.__)("Exclude","blocksy-companion")}},value:r.type,onChange:function(e){l(q(q({},r),{},{type:e}))}}),(0,e.createElement)(c.Select,{key:"second",option:{appendToBody:!0,placeholder:(0,i.__)("Select rule","blocksy-companion"),choices:u,search:!0},value:r.rule,onChange:function(e){var t=u.find((function(t){return t.key===e}));t.sub_ids&&t.sub_ids.length>0?l(q(q({},r),{},{rule:t.sub_ids[0].id})):l(q(q({},r),{},{rule:e}))}}),("post_ids"===r.rule||"custom_post_type_ids"===r.rule||"product_ids"===r.rule||"page_ids"===r.rule)&&(0,e.createElement)(R,{placeholder:"post_ids"===r.rule?(0,i.__)("Select post","blocksy-companion"):"page_ids"===r.rule?(0,i.__)("Select page","blocksy-companion"):"product_ids"===r.rule?(0,i.__)("Select product","blocksy-companion"):(0,i.__)("Custom Post Type ID","blocksy-companion"),entity:"posts",postType:{post_ids:"post",page_ids:"page",product_ids:"product",custom_post_type_ids:"ct_cpt"}[r.rule],value:(r.payload||{}).post_id||"",onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{post_id:t})}))}}),("taxonomy_ids"===r.rule||"post_with_taxonomy_ids"===r.rule||"card_post_with_taxonomy_ids"===r.rule)&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select taxonomy","blocksy-companion"),entity:"taxonomies",value:(r.payload||{}).taxonomy_id||"",onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{taxonomy_id:t})}))}}),("product_with_taxonomy_ids"===r.rule||"product_taxonomy_ids"===r.rule||"card_product_with_taxonomy_ids"===r.rule)&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select taxonomy","blocksy-companion"),entity:"taxonomies",postType:"product",value:(r.payload||{}).taxonomy_id||"",onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{taxonomy_id:t})}))}}),"current_language"===r.rule&&(0,e.createElement)(c.Select,{option:{appendToBody:!0,defaultToFirstItem:!1,placeholder:(0,i.__)("Select language","blocksy-companion"),choices:p.map((function(e){return{key:e.id,value:e.name}})),search:!0},value:(r.payload||{}).language||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{language:e})}))}}),"user_post_author_id"===r.rule&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select user","blocksy-companion"),entity:"users",value:(r.payload||{}).user_id||"",additionOptions:[{key:"current_user",value:(0,i.__)("Current user","blocksy-companion")}],onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{user_id:t})}))}}),"author"===r.rule&&(0,e.createElement)(R,{placeholder:(0,i.__)("Select user","blocksy-companion"),entity:"users",value:(r.payload||{}).user_id||"all_users",additionOptions:[{key:"all_users",value:(0,i.__)("All authors","blocksy-companion")}],onChange:function(e){var t=e.id;l(q(q({},r),{},{payload:q(q({},r.payload),{},{user_id:t})}))}}),d&&d.sub_ids&&d.sub_ids.length>0&&(0,e.createElement)(c.Select,{option:{appendToBody:!0,placeholder:(0,i.__)("Select sub field","blocksy-companion"),choices:d.sub_ids.map((function(e){return{key:e.id,value:e.title}})),search:!0,inputClassName:"ct-dropdown-normal-width"},value:r.rule,onChange:function(e){l(q(q({},r),{},{rule:e}))}}),"start_end_date"===r.rule&&(0,e.createElement)(B,{condition:r,onChange:l}),"schedule_date"===r.rule&&(0,e.createElement)(V,{condition:r,onChange:l}),"request_referer"===r.rule&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"website.com",value:r.payload.referer,onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{referer:e.target.value})}))}}),(0,e.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,e.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Display based on referer domain","blocksy-companion")))),"request_cookie"===r.rule&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"cookie_name",value:(r.payload||{}).cookie||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{cookie:e.target.value})}))}}),(0,e.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,e.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Display if cookie is present","blocksy-companion")))),"request_url"===r.rule&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"example=campaignID",value:r.payload.url||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{url:e.target.value})}))}}),(0,e.createElement)("span",{className:"ct-condition-info","data-tooltip-reveal":"top"},(0,e.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M12,2C6.477,2,2,6.477,2,12s4.477,10,10,10s10-4.477,10-10S17.523,2,12,2z M12,17L12,17c-0.552,0-1-0.448-1-1v-4 c0-0.552,0.448-1,1-1h0c0.552,0,1,0.448,1,1v4C13,16.552,12.552,17,12,17z M12.5,9h-1C11.224,9,11,8.776,11,8.5v-1 C11,7.224,11.224,7,11.5,7h1C12.776,7,13,7.224,13,7.5v1C13,8.776,12.776,9,12.5,9z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Display if query string is present in URL","blocksy-companion")))),d&&d.is_custom_rule&&d.has_text_field&&(0,e.createElement)("div",{className:"ct-option-input"},(0,e.createElement)("input",{type:"text",placeholder:"",value:r.payload.value||"",onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{value:e.target.value})}))}})),d&&d.is_custom_rule&&d.choices&&(0,e.createElement)(c.Select,{option:{appendToBody:!0,placeholder:(0,i.__)("Select value","blocksy-companion"),choices:d.choices,search:!0,inputClassName:"ct-dropdown-normal-width"},value:r.payload.value||d.choices[0].key,onChange:function(e){l(q(q({},r),{},{payload:q(q({},r.payload),{},{value:e})}))}}),(0,e.createElement)("button",{type:"button",className:"ct-remove-condition-group",onClick:function(e){e.preventDefault(),a()}},(0,e.createElement)("svg",{width:"7px",height:"7px",fill:"currentColor",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"m12 14.7 9.3 9.3 2.7-2.7-9.3-9.3L24 2.7 21.3 0 12 9.3 2.7 0 0 2.7 9.3 12 0 21.3 2.7 24l9.3-9.3z"}))))};function J(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 W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?J(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var K=function t(n){var o=n.conditionsListDescriptor,r=n.onChange,i=n.extractRulesIntoRoot,c=void 0===i?null:i,s=n.className,u=void 0===s?"":s,p=a((0,e.useState)(null),2),d=p[0],m=p[1],y=v(),h=y.rulesToUse,b=y.isAdvancedMode;if(0===o.conditions.length)return null;var g=o.conditions.map((function(n,a){var i=null,s="";return d!==a&&d-1!==a||(s="ct-hovered"),n.relation&&(i=(0,e.createElement)(t,{className:s,key:a,conditionsListDescriptor:n,extractRulesIntoRoot:function(e){var t=[].concat(l(n.conditions.slice(0,e-1)),l(n.conditions.slice(e+1)));r([].concat(l(o.conditions.slice(0,a)),l(n.conditions.slice(e-1,e+1)),l(t.length>0?[W(W({},n),{},{conditions:t})]:[]),l(o.conditions.slice(a+1))))},onChange:function(e){0===e.length?r([].concat(l(o.conditions.slice(0,a)),l(o.conditions.slice(a+1)))):r(o.conditions.map((function(t,n){return W({},n===a?W(W({},t),{},{conditions:e}):t)})))}})),n.relation||(i=(0,e.createElement)(Y,{className:s,condition:n,onChange:function(e){r(o.conditions.map((function(t,n){return W({},n===a?e:t)})))},onAdd:function(){"OR"!==o.relation?r([].concat(l(o.conditions),[{type:"include",rule:h[0].rules[0].id,payload:{}}])):r(o.conditions.map((function(e,t){return W({},t===a?{relation:"AND",conditions:[e,{type:"include",rule:h[0].rules[0].id,payload:{}}]}:e)})))},onRemove:function(){r([].concat(l(o.conditions.slice(0,a)),l(o.conditions.slice(a+1))))}})),(0,e.createElement)(e.Fragment,{key:a},b&&a>0&&(0,e.createElement)("div",{className:f()("ct-condition-relation",{"ct-hovered":d===a})},(0,e.createElement)("ul",{onMouseEnter:function(){m(a)},onMouseLeave:function(){m(null)}},"AND"===o.relation&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("li",{onClick:function(){c&&(m(null),c(a))}},(0,e.createElement)("span",null,"OR")),(0,e.createElement)("li",{className:"active"},(0,e.createElement)("span",null,"AND"))),"OR"===o.relation&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("li",{className:"active"},(0,e.createElement)("span",null,"OR")),(0,e.createElement)("li",{onClick:function(){m(null),r([].concat(l(o.conditions.slice(0,a-1)),[{relation:"AND",conditions:o.conditions.slice(a-1,a+1).reduce((function(e,t){return[].concat(l(e),l(t.conditions?t.conditions:[t]))}),[])}],l(o.conditions.slice(a+1,o.conditions.length))))}},(0,e.createElement)("span",null,"AND"))))),i)}));return"OR"===o.relation&&1===o.conditions.length||!b?g:(0,e.createElement)("div",{className:f()("ct-relation-group",u),"data-relation":o.relation},g,"AND"===o.relation&&(0,e.createElement)("div",{className:"ct-condition-relation ct-add-and-relation"},(0,e.createElement)("span",{onClick:function(){r([].concat(l(o.conditions),[{type:"include",rule:h[0].rules[0].id,payload:{}}]))}},(0,e.createElement)("svg",{width:"8",height:"8",fill:"currentColor",viewBox:"0 0 20 20"},(0,e.createElement)("path",{d:"M20,11h-9v9H9v-9H0V9h9V0h2v9h9V11z"})))))};function X(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 Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Q=(0,e.createContext)({allLanguages:[],remoteConditions:[]}),$=[],ee=[],te=function(t){var n=t.value,o=t.onChange,r=t.filter,s=void 0===r?"all":r,u=t.addConditionButtonLabel,p=a((0,e.useState)($),2),d=p[0],f=p[1],m=a((0,e.useState)(ee),2),y=m[0],h=m[1],v=a((0,e.useState)("__EMPTY__"),2),b=v[0],g=v[1];(0,e.useEffect)((function(){fetch("".concat(wp.ajax.settings.url,"?action=blc_retrieve_conditions_data&filter=").concat(s),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"}).then((function(e){return e.json()})).then((function(e){var t=e.data,n=t.languages,o=t.conditions;f(n),$=n,h(o),ee=o}))}),[]);var _=Array.isArray(n)?{relation:"OR",conditions:n}:n,w="__EMPTY__"!==b&&b;return _.conditions.find((function(e){return e.relation}))&&(w=!0),(0,e.createElement)(Q.Provider,{value:{allLanguages:d,remoteConditions:y,isAdvancedMode:w}},(0,e.createElement)("div",{className:"ct-display-conditions"},(0,e.createElement)(K,{conditionsListDescriptor:_,onChange:function(e){o(Z(Z({},_),{},{conditions:e}))}}),(0,e.createElement)("div",{className:"ct-conditions-actions"},(0,e.createElement)("button",{type:"button",className:"button add-condition",onClick:function(e){e.preventDefault(),0!==y.length&&o(Z(Z({},_),{},{conditions:[].concat(l(_.conditions),[{type:"include",rule:y[0].rules[0].id,payload:{}}])}))}},u),(_.conditions.length>1||_.conditions.find((function(e){return e.relation})))&&(0,e.createElement)("span",null,(0,i.__)("Advanced Mode","blocksy-companion"),(0,e.createElement)(c.Switch,{value:w,onChange:function(e){_.conditions.find((function(e){return e.relation}))&&o(Z(Z({},_),{},{conditions:_.conditions.reduce((function(e,t){return[].concat(l(e),l(t.conditions?t.conditions:[t]))}),[])})),g(e)},option:{behavior:"boolean"}})))))},ne=function(t){var n=t.option,o=n.display,r=void 0===o?"inline":o,l=n.filter,s=void 0===l?"all":l,u=n.modalTitle,p=void 0===u?(0,i.__)("Transparent Header Display Conditions","blocksy-companion"):u,d=n.modalDescription,f=void 0===d?(0,i.__)("Add one or more conditions to display the transparent header.","blocksy-companion"):d,m=n.addConditionButtonLabel,y=void 0===m?(0,i.__)("Add Display Condition","blocksy-companion"):m,h=t.value,v=t.onChange,b=a((0,e.useState)(!1),2),g=b[0],_=b[1],w=a((0,e.useState)(null),2),E=w[0],O=w[1];return"inline"===r?(0,e.createElement)(te,{filter:s,value:h,onChange:v,addConditionButtonLabel:y}):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),_(!0),O(null)}},Object.keys(h).length>0?(0,i.__)("Edit Conditions","blocksy-companion"):(0,i.__)("Add Conditions","blocksy-companion")),(0,e.createElement)(c.Overlay,{items:g,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){_(!1),O(null)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",null,p),(0,e.createElement)("p",null,f),(0,e.createElement)("div",{className:"ct-modal-scroll"},(0,e.createElement)(te,{filter:s,value:E||h,onChange:function(e){O(e)},addConditionButtonLabel:y})),(0,e.createElement)("div",{className:"ct-modal-actions has-divider"},(0,e.createElement)("button",{className:"button-primary",disabled:!E,onClick:function(){v(E),_(!1)}},(0,i.__)("Save Conditions","blocksy-companion"))))}}))},oe="object"===("undefined"==typeof window?"undefined":s(window))&&window.window===window?window:"object"===("undefined"==typeof self?"undefined":s(self))&&self.self===self?self:"object"===(void 0===n.g?"undefined":s(n.g))&&n.g.global===n.g?n.g:void 0;function re(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){ce(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function ae(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function ie(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var ce="object"!==("undefined"==typeof window?"undefined":s(window))||window!==oe?function(){}:"download"in HTMLAnchorElement.prototype?function(e,t,n){var o=oe.URL||oe.webkitURL,r=document.createElement("a");t=t||e.name||"download",r.download=t,r.rel="noopener","string"==typeof e?(r.href=e,r.origin!==location.origin?ae(r.href)?re(e,t,n):ie(r,r.target="_blank"):ie(r)):(r.href=o.createObjectURL(e),setTimeout((function(){o.revokeObjectURL(r.href)}),4e4),setTimeout((function(){ie(r)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download","string"==typeof e)if(ae(e))re(e,t,n);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){ie(o)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!==s(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,n),t)}:function(e,t,n,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return re(e,t,n);var r="application/octet-stream"===e.type,a=/constructor/i.test(oe.HTMLElement)||oe.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||r&&a)&&"object"===("undefined"==typeof FileReader?"undefined":s(FileReader))){var c=new FileReader;c.onloadend=function(){var e=c.result;e=i?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},c.readAsDataURL(e)}else{var l=oe.URL||oe.webkitURL,u=l.createObjectURL(e);o?o.location=u:location.href=u,o=null,setTimeout((function(){l.revokeObjectURL(u)}),4e4)}},le=ce,se=n(539),ue=n.n(se),pe=function(){var t=a((0,e.useState)(null),2),n=t[0],o=t[1],r=a((0,e.useState)(null),2),s=r[0],u=r[1],p=a((0,e.useState)(!1),2),d=p[0],m=p[1],y=a((0,e.useState)(!1),2),h=y[0],v=y[1],b=a((0,e.useState)(!1),2),g=b[0],_=b[1],w=a((0,e.useState)(["options"]),2),E=w[0],O=w[1],k=(0,e.useRef)(),j=(0,e.useRef)();return(0,e.useEffect)((function(){var e=function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy",m(!0)},t=function(e){e.stopPropagation(),e.preventDefault(),m(!1)},n=function(e){e.stopPropagation(),e.preventDefault(),m(!1);var t=Array.from(e.dataTransfer.files||[]);if(Array.from(e.dataTransfer.items||[]).length>0){var n=e.dataTransfer.items[0].getAsFile();o(n)}else t.length>0&&o(t[0])};return j.current.addEventListener("dragover",e,!1),j.current.addEventListener("dragleave",t,!1),j.current.addEventListener("drop",n,!1),function(){j.current&&(j.current.removeEventListener("dragover",e,!1),j.current.removeEventListener("dragleave",t,!1),j.current.removeEventListener("drop",n,!1))}}),[]),(0,e.createElement)("div",{className:"ct-import-export"},(0,e.createElement)("div",{className:"ct-title","data-type":"simple"},(0,e.createElement)("h3",null,(0,i.__)("Export Options","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-description"},(0,i.__)("Easily export the theme customizer settings.","blocksy-companion"))),(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("button",{className:"button-primary",onClick:function(e){e.preventDefault(),v(!0)}},(0,i.__)("Export Customizations","blocksy-companion")))),(0,e.createElement)("div",{className:"ct-title","data-type":"simple"},(0,e.createElement)("h3",null,(0,i.__)("Import Options","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-description"},(0,i.__)("Easily import the theme customizer settings.","blocksy-companion"))),(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("div",{className:"ct-file-upload"},(0,e.createElement)("div",{className:"ct-attachment"},(0,e.createElement)("button",{type:"button",className:f()("ct-upload-button",{active:d}),ref:j,onClick:function(){k.current.click()}},n?n.name:(0,i.__)("Click or drop to upload a file...","blocksy-companion"))),(0,e.createElement)("input",{ref:k,type:"file",onChange:function(e){var t=a(e.target.files,1)[0];o(t)}}),(0,e.createElement)("button",{className:f()("button-primary",{"ct-loading":g}),disabled:!n,onClick:function(e){if(e.preventDefault(),n){_(!0);var t=new FileReader;t.readAsText(n,"UTF-8"),t.onload=function(e){try{fetch("".concat(window.ajaxurl,"?action=blocksy_customizer_import&wp_customize=on&nonce=").concat(ct_customizer_localizations.customizer_reset_none),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ue()(e.target.result))}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;location.reload()}))}))}catch(e){}}}}},g?(0,e.createElement)("svg",{width:"14",height:"14",viewBox:"0 0 100 100"},(0,e.createElement)("g",{transform:"translate(50,50)"},(0,e.createElement)("g",{transform:"scale(1)"},(0,e.createElement)("circle",{cx:"0",cy:"0",r:"50",fill:"currentColor"}),(0,e.createElement)("circle",{cx:"0",cy:"-26",r:"12",fill:"var(--ui-accent-color)",transform:"rotate(161.634)"},(0,e.createElement)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"linear",values:"0 0 0;360 0 0",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}))))):(0,i.__)("Import Customizations","blocksy-companion"))))),ct_customizer_localizations.has_child_theme&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"ct-title","data-type":"simple"},(0,e.createElement)("h3",null,(0,i.__)("Copy Options","blocksy-companion")),(0,e.createElement)("div",{className:"ct-option-description"},(0,i.__)("Copy and import your customizations from parent or child theme.","blocksy-companion"))),ct_customizer_localizations.is_parent_theme&&(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("button",{className:"button-primary",onClick:function(e){e.preventDefault(),u("child")}},(0,i.__)("Copy From Child Theme","blocksy-companion")))),!ct_customizer_localizations.is_parent_theme&&(0,e.createElement)("div",{className:"ct-control","data-design":"block"},(0,e.createElement)("header",null),(0,e.createElement)("section",null,(0,e.createElement)("button",{className:"button-primary",onClick:function(e){e.preventDefault(),u("parent")}},(0,i.__)("Copy From Parent Theme","blocksy-companion"))))),(0,e.createElement)(c.Overlay,{items:s,className:"ct-admin-modal ct-import-export-modal",onDismiss:function(){return u(!1)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",{className:"ct-modal-title"},!ct_customizer_localizations.is_parent_theme&&(0,i.__)("Copy From Parent Theme","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&(0,i.__)("Copy From Child Theme","blocksy-companion")),(0,e.createElement)("p",null,!ct_customizer_localizations.is_parent_theme&&(0,i.__)("You are about to copy all the settings from your parent theme into the child theme. Are you sure you want to continue?","blocksy-companion"),ct_customizer_localizations.is_parent_theme&&(0,i.__)("You are about to copy all the settings from your child theme into the parent theme. Are you sure you want to continue?","blocksy-companion")),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),u(!1)},className:"button"},(0,i.__)("Cancel","blocksy-companion")),(0,e.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_copy_options"),t.append("wp_customize","on"),t.append("strategy",s);try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){e.success,e.data;new Promise((function(e){var t=new FormData;t.append("action","blocksy_customizer_wipe_caches"),t.append("wp_customize","on"),fetch(window.ajaxurl,{method:"POST",body:t}).then((function(t){200===t.status&&t.json().then((function(t){t.success,t.data,e()}))}))})).then((function(){location.reload()}))}))}))}catch(e){}}},(0,i.__)("Yes, I am sure","blocksy-companion"))))}}),(0,e.createElement)(c.Overlay,{items:h,className:"ct-admin-modal ct-export-modal",onDismiss:function(){return v(!1)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",{className:"ct-modal-title"},(0,i.__)("Export Settings","blocksy-companion")),(0,e.createElement)("p",null,(0,i.__)("Choose what set of settings you want to export.","blocksy-companion")),(0,e.createElement)("div",{className:"ct-checkboxes-container","data-type":"grid:bordered"},["options","widgets"].map((function(t){return(0,e.createElement)("div",{className:"ct-checkbox-container",onClick:function(){1===E.length&&E[0]===t||O((function(e){return e.includes(t)?e.filter((function(e){return e!==t})):[].concat(l(e),[t])}))}},(0,e.createElement)("span",{className:f()("ct-checkbox",{active:E.includes(t)})},(0,e.createElement)("svg",{width:"10",height:"8",viewBox:"0 0 11.2 9.1"},(0,e.createElement)("polyline",{className:"check",points:"1.2,4.8 4.4,7.9 9.9,1.2 "}))),{options:(0,i.__)("Customizer settings","blocksy-companion"),widgets:(0,i.__)("Widgets settings","blocksy-companion")}[t])}))),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),v(!1)},className:"button"},(0,i.__)("Cancel","blocksy-companion")),(0,e.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault();var t=new FormData;t.append("action","blocksy_customizer_export"),t.append("strategy",E.join(":")),t.append("wp_customize","on");try{fetch(window.ajaxurl,{method:"POST",body:t}).then((function(e){200===e.status&&e.json().then((function(e){var t=e.success,n=e.data;if(t){var o=new Blob([n.data],{type:"application/octet-stream;charset=utf-8"});le(o,"".concat(n.site_url.replace("http://","").replace("https://","").replace(".","-").replace("/","-"),"-export.dat")),v(!1)}}))}))}catch(e){}}},(0,i.__)("Export","blocksy-companion"))))}}))},de=window.ctEvents,fe=n.n(de),me=window.wp.hooks;function ye(e,t,n,o,r,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(o,r)}var he=n(687),ve=n.n(he),be=n(459),ge=n.n(be),_e=n(616),we=n.n(_e),Ee=n(382),Oe=n.n(Ee),ke=we()(),je=function(t){t.forcedEdit;var n,o,r=t.headerId,s=a((0,e.useState)(!1),2),u=s[0],d=s[1],f=a((0,e.useState)(null),2),m=f[0],y=f[1],h=(0,e.useContext)(c.PlacementsDragDropContext),v=(h.builderValueCollection,h.builderValueDispatch,(0,e.useRef)()),b=Oe()(ke),g=ge()("".concat(blocksy_admin.ajax_url,"?action=blocksy_header_get_all_conditions"),{method:"POST",formatter:(n=ve().mark((function e(t){var n,o,r;return ve().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if(n=e.sent,o=n.success,r=n.data,o&&r.conditions){e.next=7;break}throw new Error;case 7:return e.abrupt("return",r.conditions);case 8:case"end":return e.stop()}}),e)})),o=function(){var e=this,t=arguments;return new Promise((function(o,r){var a=n.apply(e,t);function i(e){ye(a,o,r,i,c,"next",e)}function c(e){ye(a,o,r,i,c,"throw",e)}i(void 0)}))},function(e){return o.apply(this,arguments)}),depends:[b]}),_=g.data,w=g.isLoading;g.error;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"button-primary",style:{width:"100%"},onClick:function(e){e.preventDefault(),e.stopPropagation(),w||d(!0)}},(0,i.__)("Add/Edit Conditions","blocksy-companion")),(0,e.createElement)(c.Overlay,{items:u,initialFocusRef:v,className:"ct-admin-modal ct-builder-conditions-modal",onDismiss:function(){d(!1),y(null)},render:function(){var t;return(0,e.createElement)("div",{className:"ct-modal-content",ref:v},(0,e.createElement)("h2",null,sprintf((0,i.__)("Display Conditions","blocksy-companion"))),(0,e.createElement)("p",null,(0,i.__)("Add one or more conditions in order to display your header.","blocksy-companion")),(0,e.createElement)("div",{className:"ct-modal-scroll"},(0,e.createElement)(c.OptionsPanel,{onChange:function(e,t){y((function(e){return[].concat(l((e||_).filter((function(e){return e.id!==r}))),[{id:r,conditions:t}])}))},options:{conditions:(t={type:"blocksy-display-condition",design:"none",value:[]},p(t,"design","none"),p(t,"label",!1),t)},value:{conditions:((m||_).find((function(e){return e.id===r}))||{conditions:[]}).conditions},hasRevertButton:!1})),(0,e.createElement)("div",{className:"ct-modal-actions has-divider"},(0,e.createElement)("button",{className:"button-primary",disabled:!m,onClick:function(){fetch("".concat(wp.ajax.settings.url,"?action=blocksy_header_update_all_conditions"),{headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST",body:JSON.stringify(m)}).then((function(e){return e.json()})).then((function(){ke(),d(!1)}))}},(0,i.__)("Save Conditions","blocksy-companion"))))}}))};function xe(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 Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Se=function(){var n=a((0,e.useState)(!1),2),o=n[0],r=n[1],l=(ct_customizer_localizations.header_builder_data.secondary_items.header,ct_customizer_localizations.header_builder_data.header,(0,e.useContext)(c.PlacementsDragDropContext)),s=l.builderValueDispatch,u=l.builderValue,p=(l.option,l.builderValueCollection),d=l.panelsActions,m=(0,me.applyFilters)("blocksy.header.available-sections",null,p.sections)||p.sections.filter((function(e){var t=e.id;return"type-2"!==t&&"type-3"!==t&&-1===t.indexOf("ct-custom")}));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("ul",{className:f()("ct-panels-manager")},m.map((function(t){var n=t.name,o=t.id,a=n||{"type-1":(0,i.__)("Global Header","blocksy-companion")}[o]||o,l="builder_header_panel_".concat(o),p=ct_customizer_localizations.header_builder_data.header_data.header_options,m={label:a,"inner-options":Ce(Ce({},o.indexOf("ct-custom")>-1?{conditions_button:{label:(0,i.__)("Edit Conditions","blocksy-companion"),type:"jsx",design:"block",render:function(){return(0,e.createElement)(je,{headerId:o})}},divider:{type:"ct-divider"}}:{}),p)};return(0,e.createElement)(c.PanelMetaWrapper,z({id:l,key:o,option:m},d,{getActualOption:function(t){var n=t.open;return(0,e.createElement)(e.Fragment,null,o===u.id&&(0,e.createElement)(c.Panel,{id:l,getValues:function(){return Ce({id:o},u.settings||{})},option:m,onChangeFor:function(e,t){s({type:"BUILDER_GLOBAL_SETTING_ON_CHANGE",payload:{optionId:e,optionValue:t,values:(0,c.getValueFromInput)(p,Array.isArray(u.settings)?{}:u.settings||{})}})},view:"simple"}),(0,e.createElement)("li",{className:f()({active:o===u.id,"ct-global":"type-1"===o}),onClick:function(){o===u.id?n():s({type:"PICK_BUILDER_SECTION",payload:{id:o}})}},(0,e.createElement)("span",{className:"ct-panel-name"},a),o.indexOf("ct-custom")>-1&&o!==u.id&&(0,e.createElement)("span",{className:"ct-remove-instance","data-tooltip-reveal":"top",onClick:function(e){e.preventDefault(),e.stopPropagation(),r(o)}},(0,e.createElement)("svg",{width:"11px",height:"11px",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M9.6,0l0,1.2H1.2v2.4h21.6V1.2h-8.4l0-1.2H9.6z M2.8,6l1.8,15.9C4.8,23.1,5.9,24,7.1,24h9.9c1.2,0,2.2-0.9,2.4-2.1L21.2,6H2.8z"})),(0,e.createElement)("i",{className:"ct-tooltip"},(0,i.__)("Remove header","blocksy-companion")))))}}))}))),(0,e.createElement)(t.Slot,{name:"PlacementsBuilderPanelsManagerAfter"},(function(e){return 0===e.length?null:e})),(0,e.createElement)(c.Overlay,{items:o,className:"ct-admin-modal ct-reset-options",onDismiss:function(){return r(!1)},render:function(){return(0,e.createElement)("div",{className:"ct-modal-content"},(0,e.createElement)("h2",{className:"ct-modal-title"},(0,i.__)("Remove Header","blocksy-companion")),(0,e.createElement)("p",null,(0,i.__)("You are about to remove a custom header, are you sure you want to continue?","blocksy-companion")),(0,e.createElement)("div",{className:"ct-modal-actions has-divider","data-buttons":"2"},(0,e.createElement)("button",{onClick:function(e){e.preventDefault(),e.stopPropagation(),r(!1)},className:"button"},(0,i.__)("Cancel","blocksy-companion")),(0,e.createElement)("button",{className:"button button-primary",onClick:function(e){e.preventDefault(),s({type:"REMOVE_BUILDER_SECTION",payload:{id:o}}),r(!1)}},(0,i.__)("Confirm","blocksy-companion"))))}}))};fe().on("blocksy:options:before-option",(function(n){if(n.option&&"ct-header-builder"===n.option.type){var o=n.content;n.content=(0,e.createElement)(e.Fragment,null,o,(0,e.createElement)(t.Fill,{name:"PlacementsBuilderPanelsManager"},(0,e.createElement)(Se,null)))}})),fe().on("blocksy:options:register",(function(e){e["blocksy-display-condition"]=ne,e["blocksy-customizer-options-manager"]=pe}))}()}();