D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
www
/
oems
/
wp-content
/
plugins
/
qi-blocks
/
assets
/
dist
/
Filename :
parallax-images.js
back
Copy
(()=>{var e={7584(e,t,a){"use strict";a.d(t,{A:()=>n}),document.addEventListener("DOMContentLoaded",function(){l.init()});const l={init:function(){this.holder=document.querySelectorAll(".qi-block-parallax-images"),this.holder.length&&[...this.holder].map(e=>{l.initItem(e)})},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e)),e},initItem:function(e){if(!(e=l.getRealCurrentItem(e)))return;("object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor).qodefWaitForImages.check(e,function(){l.setParallaxElements(e)})},setParallaxElements:function(e){const t=e.querySelectorAll(".qodef-e-parallax-image"),a=e.querySelector(".qodef-e-main-image");if(!a)return;const l=a.querySelector("img"),n=a.getAttribute("data-parallax-main");let i=40,o=-50,r=30,s=15;window.innerWidth>1024&&(n&&(i=n,r=Math.abs(parseInt(i,10)/.9)),l.setAttribute("data-parallax",'{"y" : '+i+' , "smoothness": '+r+"}"),t.forEach(e=>{const t=e.querySelector("img"),a=e.getAttribute("data-parallax");t&&(a&&(o=a,s=Math.abs(parseInt(o,10)/2.5)),t.setAttribute("data-parallax",'{"y" : '+o+' , "smoothness": '+s+"}"))}),setTimeout(()=>{e.querySelectorAll("[data-parallax]").length&&ParallaxScroll.init()},document.body.classList.contains("wp-admin")?600:0))}},n=l},8859(e,t,a){var l=a(6449);e.exports=function(){if(!arguments.length)return[];var e=arguments[0];return l(e)?e:[e]}},7217(e,t,a){var l=a(3702),n=a(80),i=a(4739),o=a(8655),r=a(1175);function s(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}s.prototype.clear=l,s.prototype.delete=n,s.prototype.get=i,s.prototype.has=o,s.prototype.set=r,e.exports=s},7828(e,t,a){var l=a(9325).Uint8Array;e.exports=l},1033(e){e.exports=function(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}},882(e){e.exports=function(e,t,a,l){var n=-1,i=null==e?0:e.length;for(l&&i&&(a=e[++n]);++n<i;)a=t(a,e[n],n,e);return a}},4248(e){e.exports=function(e,t){for(var a=-1,l=null==e?0:e.length;++a<l;)if(t(e[a],a,e))return!0;return!1}},1074(e){e.exports=function(e){return e.split("")}},1733(e){var t=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;e.exports=function(e){return e.match(t)||[]}},7805(e,t,a){var l=a(3360),n=a(5288);e.exports=function(e,t,a){(void 0!==a&&!n(e[t],a)||void 0===a&&!(t in e))&&l(e,t,a)}},6547(e,t,a){var l=a(3360),n=a(5288),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,a){var o=e[t];i.call(e,t)&&n(o,a)&&(void 0!==a||t in e)||l(e,t,a)}},6025(e,t,a){var l=a(5288);e.exports=function(e,t){for(var a=e.length;a--;)if(l(e[a][0],t))return a;return-1}},3360(e,t,a){var l=a(3243);e.exports=function(e,t,a){"__proto__"==t&&l?l(e,t,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[t]=a}},9344(e,t,a){var l=a(3805),n=Object.create,i=function(){function e(){}return function(t){if(!l(t))return{};if(n)return n(t);e.prototype=t;var a=new e;return e.prototype=void 0,a}}();e.exports=i},6649(e,t,a){var l=a(3221)();e.exports=l},2552(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},6131(e){e.exports=function(e,t,a){for(var l=a-1,n=e.length;++l<n;)if(e[l]===t)return l;return-1}},270(e,t,a){var l=a(7068),n=a(346);e.exports=function e(t,a,i,o,r){return t===a||(null==t||null==a||!n(t)&&!n(a)?t!=t&&a!=a:l(t,a,i,o,e,r))}},7068(e,t,a){var l=a(7217),n=a(5911),i=a(1986),o=a(689),r=a(5861),s=a(6449),c=a(3656),u=a(7167),m="[object Arguments]",p="[object Array]",d="[object Object]",b=Object.prototype.hasOwnProperty;e.exports=function(e,t,a,f,g,h){var k=s(e),_=s(t),v=k?p:r(e),y=_?p:r(t),w=(v=v==m?d:v)==d,A=(y=y==m?d:y)==d,I=v==y;if(I&&c(e)){if(!c(t))return!1;k=!0,w=!1}if(I&&!w)return h||(h=new l),k||u(e)?n(e,t,a,f,g,h):i(e,t,v,a,f,g,h);if(!(1&a)){var S=w&&b.call(e,"__wrapped__"),x=A&&b.call(t,"__wrapped__");if(S||x){var q=S?e.value():e,E=x?t.value():t;return h||(h=new l),g(q,E,a,f,h)}}return!!I&&(h||(h=new l),o(e,t,a,f,g,h))}},5250(e,t,a){var l=a(7217),n=a(7805),i=a(6649),o=a(2824),r=a(3805),s=a(7241),c=a(4974);e.exports=function e(t,a,u,m,p){t!==a&&i(a,function(i,s){if(p||(p=new l),r(i))o(t,a,s,u,e,m,p);else{var d=m?m(c(t,s),i,s+"",t,a,p):void 0;void 0===d&&(d=i),n(t,s,d)}},s)}},2824(e,t,a){var l=a(7805),n=a(3290),i=a(1961),o=a(3007),r=a(5529),s=a(2428),c=a(6449),u=a(3693),m=a(3656),p=a(1882),d=a(3805),b=a(1331),f=a(7167),g=a(4974),h=a(9884);e.exports=function(e,t,a,k,_,v,y){var w=g(e,a),A=g(t,a),I=y.get(A);if(I)l(e,a,I);else{var S=v?v(w,A,a+"",e,t,y):void 0,x=void 0===S;if(x){var q=c(A),E=!q&&m(A),T=!q&&!E&&f(A);S=A,q||E||T?c(w)?S=w:u(w)?S=o(w):E?(x=!1,S=n(A,!0)):T?(x=!1,S=i(A,!0)):S=[]:b(A)||s(A)?(S=w,s(w)?S=h(w):d(w)&&!p(w)||(S=r(A))):x=!1}x&&(y.set(A,S),_(S,A,k,v,y),y.delete(A)),l(e,a,S)}}},9302(e,t,a){var l=a(3488),n=a(6757),i=a(2865);e.exports=function(e,t){return i(n(e,t,l),e+"")}},5160(e){e.exports=function(e,t,a){var l=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(a=a>n?n:a)<0&&(a+=n),n=t>a?0:a-t>>>0,t>>>=0;for(var i=Array(n);++l<n;)i[l]=e[l+t];return i}},7556(e){e.exports=function(e){return e}},9219(e,t,a){var l=a(6131);e.exports=function(e,t){return!!(null==e?0:e.length)&&l(e,t,0)>-1}},8754(e,t,a){var l=a(5160);e.exports=function(e,t,a){var n=e.length;return a=void 0===a?n:a,!t&&a>=n?e:l(e,t,a)}},9653(e,t,a){var l=a(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new l(t).set(new l(e)),t}},3290(e,t,a){e=a.nmd(e);var l=a(9325),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,o=i&&i.exports===n?l.Buffer:void 0,r=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var a=e.length,l=r?r(a):new e.constructor(a);return e.copy(l),l}},1961(e,t,a){var l=a(9653);e.exports=function(e,t){var a=t?l(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}},3007(e){e.exports=function(e,t){var a=-1,l=e.length;for(t||(t=Array(l));++a<l;)t[a]=e[a];return t}},1791(e,t,a){var l=a(6547),n=a(3360);e.exports=function(e,t,a,i){var o=!a;a||(a={});for(var r=-1,s=t.length;++r<s;){var c=t[r],u=i?i(a[c],e[c],c,a,e):void 0;void 0===u&&(u=e[c]),o?n(a,c,u):l(a,c,u)}return a}},999(e,t,a){var l=a(9302),n=a(6800);e.exports=function(e){return l(function(t,a){var l=-1,i=a.length,o=i>1?a[i-1]:void 0,r=i>2?a[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,r&&n(a[0],a[1],r)&&(o=i<3?void 0:o,i=1),t=Object(t);++l<i;){var s=a[l];s&&e(t,s,l,o)}return t})}},3221(e){e.exports=function(e){return function(t,a,l){for(var n=-1,i=Object(t),o=l(t),r=o.length;r--;){var s=o[e?r:++n];if(!1===a(i[s],s,i))break}return t}}},2507(e,t,a){var l=a(8754),n=a(9698),i=a(3912),o=a(3222);e.exports=function(e){return function(t){t=o(t);var a=n(t)?i(t):void 0,r=a?a[0]:t.charAt(0),s=a?l(a,1).join(""):t.slice(1);return r[e]()+s}}},5539(e,t,a){var l=a(882),n=a(828),i=a(6645),o=RegExp("['’]","g");e.exports=function(e){return function(t){return l(i(n(t).replace(o,"")),e,"")}}},3243(e,t,a){var l=a(6110),n=function(){try{var e=l(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},5911(e,t,a){var l=a(8859),n=a(4248),i=a(9219);e.exports=function(e,t,a,o,r,s){var c=1&a,u=e.length,m=t.length;if(u!=m&&!(c&&m>u))return!1;var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var b=-1,f=!0,g=2&a?new l:void 0;for(s.set(e,t),s.set(t,e);++b<u;){var h=e[b],k=t[b];if(o)var _=c?o(k,h,b,t,e,s):o(h,k,b,e,t,s);if(void 0!==_){if(_)continue;f=!1;break}if(g){if(!n(t,function(e,t){if(!i(g,t)&&(h===e||r(h,e,a,o,s)))return g.push(t)})){f=!1;break}}else if(h!==k&&!r(h,k,a,o,s)){f=!1;break}}return s.delete(e),s.delete(t),f}},1986(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},689(e,t,a){var l=a(2),n=Object.prototype.hasOwnProperty;e.exports=function(e,t,a,i,o,r){var s=1&a,c=l(e),u=c.length;if(u!=l(t).length&&!s)return!1;for(var m=u;m--;){var p=c[m];if(!(s?p in t:n.call(t,p)))return!1}var d=r.get(e),b=r.get(t);if(d&&b)return d==t&&b==e;var f=!0;r.set(e,t),r.set(t,e);for(var g=s;++m<u;){var h=e[p=c[m]],k=t[p];if(i)var _=s?i(k,h,p,t,e,r):i(h,k,p,e,t,r);if(!(void 0===_?h===k||o(h,k,a,i,r):_)){f=!1;break}g||(g="constructor"==p)}if(f&&!g){var v=e.constructor,y=t.constructor;v==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y||(f=!1)}return r.delete(e),r.delete(t),f}},4840(e){var t="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;e.exports=t},2(e,t,a){var l=a(4335)(Object.keys,Object);e.exports=l},6110(e){e.exports=function(e,t){return null==e?void 0:e[t]}},8879(e,t,a){var l=a(4335)(Object.getPrototypeOf,Object);e.exports=l},5861(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9698(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},5434(e){var t=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;e.exports=function(e){return t.test(e)}},5529(e,t,a){var l=a(9344),n=a(8879),i=a(5527);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:l(n(e))}},6800(e){e.exports=function(){return!1}},5527(e){e.exports=function(){return!1}},3702(e){e.exports=function(){this.__data__=[],this.size=0}},80(e,t,a){var l=a(6025),n=Array.prototype.splice;e.exports=function(e){var t=this.__data__,a=l(t,e);return!(a<0)&&(a==t.length-1?t.pop():n.call(t,a,1),--this.size,!0)}},4739(e,t,a){var l=a(6025);e.exports=function(e){var t=this.__data__,a=l(t,e);return a<0?void 0:t[a][1]}},8655(e,t,a){var l=a(6025);e.exports=function(e){return l(this.__data__,e)>-1}},1175(e,t,a){var l=a(6025);e.exports=function(e,t){var a=this.__data__,n=l(a,e);return n<0?(++this.size,a.push([e,t])):a[n][1]=t,this}},4335(e){e.exports=function(e,t){return function(a){return e(t(a))}}},6757(e,t,a){var l=a(1033),n=Math.max;e.exports=function(e,t,a){return t=n(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,r=n(i.length-t,0),s=Array(r);++o<r;)s[o]=i[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=i[o];return c[t]=a(s),l(e,this,c)}}},9325(e,t,a){var l=a(4840),n="object"==typeof self&&self&&self.Object===Object&&self,i=l||n||Function("return this")();e.exports=i},4974(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},2865(e){e.exports=function(e){return e}},3912(e,t,a){var l=a(1074),n=a(9698),i=a(2054);e.exports=function(e){return n(e)?i(e):l(e)}},2054(e){var t="\\ud800-\\udfff",a="["+t+"]",l="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",i="[^"+t+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",r="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+l+"|"+n+")"+"?",c="[\\ufe0e\\ufe0f]?",u=c+s+("(?:\\u200d(?:"+[i,o,r].join("|")+")"+c+s+")*"),m="(?:"+[i+l+"?",l,o,r,a].join("|")+")",p=RegExp(n+"(?="+n+")|"+m+u,"g");e.exports=function(e){return e.match(p)||[]}},2225(e){var t="\\ud800-\\udfff",a="\\u2700-\\u27bf",l="a-z\\xdf-\\xf6\\xf8-\\xff",n="A-Z\\xc0-\\xd6\\xd8-\\xde",i="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="["+i+"]",r="\\d+",s="["+a+"]",c="["+l+"]",u="[^"+t+i+r+a+l+n+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",d="["+n+"]",b="(?:"+c+"|"+u+")",f="(?:"+d+"|"+u+")",g="(?:['’](?:d|ll|m|re|s|t|ve))?",h="(?:['’](?:D|LL|M|RE|S|T|VE))?",k="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",_="[\\ufe0e\\ufe0f]?",v=_+k+("(?:\\u200d(?:"+["[^"+t+"]",m,p].join("|")+")"+_+k+")*"),y="(?:"+[s,m,p].join("|")+")"+v,w=RegExp([d+"?"+c+"+"+g+"(?="+[o,d,"$"].join("|")+")",f+"+"+h+"(?="+[o,d+b,"$"].join("|")+")",d+"?"+b+"+"+g,d+"+"+h,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",r,y].join("|"),"g");e.exports=function(e){return e.match(w)||[]}},4058(e,t,a){var l=a(4792),n=a(5539)(function(e,t,a){return t=t.toLowerCase(),e+(a?l(t):t)});e.exports=n},4792(e,t,a){var l=a(3222),n=a(5808);e.exports=function(e){return n(l(e).toLowerCase())}},828(e,t,a){var l=a(7556);e.exports=function(e){return null==e?"":l(e)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},3488(e){e.exports=function(e){return e}},2428(e){e.exports=function(){return!1}},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,a){var l=a(1882),n=a(294);e.exports=function(e){return null!=e&&n(e.length)&&!l(e)}},3693(e,t,a){var l=a(4894),n=a(346);e.exports=function(e){return n(e)&&l(e)}},3656(e){e.exports=function(){return!1}},2404(e,t,a){var l=a(270);e.exports=function(e,t){return l(e,t)}},1882(e,t,a){var l=a(2552),n=a(3805);e.exports=function(e){if(!n(e))return!1;var t=l(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1331(e,t,a){var l=a(2552),n=a(8879),i=a(346),o=Function.prototype,r=Object.prototype,s=o.toString,c=r.hasOwnProperty,u=s.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=l(e))return!1;var t=n(e);if(null===t)return!0;var a=c.call(t,"constructor")&&t.constructor;return"function"==typeof a&&a instanceof a&&s.call(a)==u}},7167(e){e.exports=function(){return!1}},7241(e){e.exports=function(e){var t=[];if(null!=e)for(var a in Object(e))t.push(a);return t}},5364(e,t,a){var l=a(5250),n=a(999)(function(e,t,a){l(e,t,a)});e.exports=n},9884(e,t,a){var l=a(1791),n=a(7241);e.exports=function(e){return l(e,n(e))}},3222(e){e.exports=function(e){return e}},5808(e,t,a){var l=a(2507)("toUpperCase");e.exports=l},6645(e,t,a){var l=a(1733),n=a(5434),i=a(3222),o=a(2225);e.exports=function(e,t,a){return e=i(e),void 0===(t=a?void 0:t)?n(e)?o(e):l(e):e.match(t)||[]}},5287(e,t){"use strict";var a=Symbol.for("react.element"),l=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.iterator;var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function h(e,t,a){this.props=e,this.context=t,this.refs=g,this.updater=a||b}function k(){}function _(e,t,a){this.props=e,this.context=t,this.refs=g,this.updater=a||b}h.prototype.isReactComponent={},h.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},h.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},k.prototype=h.prototype;var v=_.prototype=new k;v.constructor=_,f(v,h.prototype),v.isPureReactComponent=!0;var y=Array.isArray,w=Object.prototype.hasOwnProperty,A={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,l){var n,i={},o=null,r=null;if(null!=t)for(n in void 0!==t.ref&&(r=t.ref),void 0!==t.key&&(o=""+t.key),t)w.call(t,n)&&!I.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(1===s)i.children=l;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(n in s=e.defaultProps)void 0===i[n]&&(i[n]=s[n]);return{$$typeof:a,type:e,key:o,ref:r,props:i,_owner:A.current}}function x(e){return"object"==typeof e&&null!==e&&e.$$typeof===a}var q=/\/+/g;function E(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function T(e,t,n,i,o){var r=typeof e;"undefined"!==r&&"boolean"!==r||(e=null);var s=!1;if(null===e)s=!0;else switch(r){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case a:case l:s=!0}}if(s)return o=o(s=e),e=""===i?"."+E(s,0):i,y(o)?(n="",null!=e&&(n=e.replace(q,"$&/")+"/"),T(o,t,n,"",function(e){return e})):null!=o&&(x(o)&&(o=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(q,"$&/")+"/")+e)),t.push(o)),1;if(s=0,i=""===i?".":i+":",y(e))for(var c=0;c<e.length;c++){var u=i+E(r=e[c],c);s+=T(r,t,n,u,o)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(r=e.next()).done;)s+=T(r=r.value,t,n,u=i+E(r,c++),o);else if("object"===r)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function C(e,t,a){if(null==e)return e;var l=[],n=0;return T(e,l,"","",function(e){return t.call(a,e,n++)}),l}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},P={transition:null};function B(){throw Error("act(...) is not supported in production builds of React.")}t.createElement=S},6540(e,t,a){"use strict";e.exports=a(5287)},6942(e,t){var a;!function(){"use strict";var l={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=o(e,i(a)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)l.call(e,a)&&e[a]&&(t=o(t,a));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(l){var n=t[l];if(void 0!==n)return n.exports;var i=t[l]={id:l,loaded:!1,exports:{}};return e[l](i,i.exports,a),i.loaded=!0,i.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";const e=wp.i18n,t=wp.blocks;var l=a(4058),n=a.n(l);const i=wp.hooks,o=wp.data;var r,s=a(6540);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},c.apply(null,arguments)}const u=e=>s.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 24 24"},e),r||(r=s.createElement("path",{d:"M13 18h2c.6 0 1 .4 1 1s-.4 1-1 1H9c-.6 0-1-.4-1-1s.4-1 1-1h2v-2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2h-7zM4 6v8h16V6z"})));var m;function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},p.apply(null,arguments)}const d=e=>s.createElement("svg",p({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 24 24"},e),m||(m=s.createElement("path",{d:"M6 4v15h12V4zm0-2h12c1.1 0 2 .9 2 2v16c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2"})));var b;function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},f.apply(null,arguments)}const g=e=>s.createElement("svg",f({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",viewBox:"0 0 24 24"},e),b||(b=s.createElement("path",{d:"M8 2h8c1.1 0 2 .9 2 2v16c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m0 2v15h8V4z"}))),h="desktop",k={desktop:{label:(0,e.__)("Desktop","qi-blocks"),icon:wp.element.createElement(u,null)},tablet:{label:(0,e.__)("Tablet","qi-blocks"),icon:wp.element.createElement(d,null)},mobile:{label:(0,e.__)("Mobile","qi-blocks"),icon:wp.element.createElement(g,null)}};let _=h;const v=()=>_,y=wp.components,w=e=>{const t={...e},{blockAttributeKey:a,blockAttributes:l,setAttributes:n,repeater:i,repeaterItemIndex:o,repeaterItemKey:r,repeaterSetAttributes:s,repeaterGetAttributes:c}=t;return t.getAttributeValue=()=>{let e=l[a];return i&&(e=c(r,o)),e||!1},t.setAttributeValue=e=>{i?s(r,e,o):n({[a]:e})},wp.element.createElement("div",{className:"qodef-on-off-option"},wp.element.createElement(y.ToggleControl,{label:t.label,help:t.help,checked:t.getAttributeValue(),onChange:()=>t.setAttributeValue(!t.getAttributeValue())}))};w.defaultProps={label:(0,e.__)("Show","qi-blocks"),help:"",blockAttributeKey:"",blockAttributes:{},setAttributes:()=>{},repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const A=w,I=[{classSuffix:"desktop",label:(0,e.__)("Hide On Desktop","qi-blocks"),blockAttributeKey:"hideOnDesktop"},{classSuffix:"tablet",label:(0,e.__)("Hide On Tablet","qi-blocks"),blockAttributeKey:"hideOnTablet"},{classSuffix:"mobile",label:(0,e.__)("Hide On Mobile","qi-blocks"),blockAttributeKey:"hideOnMobile"}],S=e=>{const t={...e},{label:a,description:l,blockAttributeKeys:n,blockAttributes:i,setAttributes:o}=t;return wp.element.createElement("div",{className:"qodef-visibility-group-option"},a&&wp.element.createElement("label",{className:"qodef-option-label"},a),l&&wp.element.createElement("p",{className:"qodef-option-description"},l),n.map(e=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(A,{label:e.label,blockAttributeKey:e.blockAttributeKey,blockAttributes:i,setAttributes:o}))))};S.defaultProps={label:(0,e.__)("Visibility","qi-blocks"),description:(0,e.__)("Responsive visibility will take effect only on preview or live page, and not while editing in Gutenberg.","qi-blocks"),blockAttributeKeys:I,blockAttributes:{},setAttributes:()=>{}};const x=()=>({hideOnDesktop:{type:"boolean",default:!1},hideOnTablet:{type:"boolean",default:!1},hideOnMobile:{type:"boolean",default:!1}}),q=e=>{const{attrNameTemplate:t,attrName:a}=e,l=e=>X(t,a,e),n=!le(e,"all")||(e.allowUnitControl??!0),i=le(e,"all")&&e.disableDirections||[];let o={};return["Top","Right","Bottom","Left"].map(e=>{i.includes(e)||(o[l(e)]={type:"number",default:""},o[l(e+"Tablet")]={type:"number",default:""},o[l(e+"Mobile")]={type:"number",default:""},n&&(o[l(`${e}Decimal`)]={type:"number",default:""},o[l(`${e}DecimalTablet`)]={type:"number",default:""},o[l(`${e}DecimalMobile`)]={type:"number",default:""}))}),o[l("Unit")]={type:"string",default:"px"},o[l("UnitTablet")]={type:"string",default:"px"},o[l("UnitMobile")]={type:"string",default:"px"},o};q.defaultProps={attrNameTemplate:"",attrName:"",allowUnitControl:!0};const E=q,T=e=>{const{blockAttributeKey:t}=e,a=!!le(e,"all")&&(e.allowScreens??!1),l=!le(e,"all")||(e.allowUnits??!0),n=le(e,"all")&&e.optionType||"integer",i=le(e,"all")&&e.defaultValue||"",o="decimal"===n?i:"";let r={};return"integer"===n&&(r[t]={type:"number",default:i}),r[X(t,"Unit")]={type:"string",default:"px"},(l||"decimal"===n)&&(r[X(t,"Decimal")]={type:"number",default:o}),a&&(r[X(t,"Tablet")]={type:"number",default:""},r[X(t,"Mobile")]={type:"number",default:""},r[X(t,"UnitTablet")]={type:"string",default:"px"},r[X(t,"UnitMobile")]={type:"string",default:"px"},l&&(r[X(t,"DecimalTablet")]={type:"number",default:""},r[X(t,"DecimalMobile")]={type:"number",default:""})),r};T.defaultProps={allowScreens:!1,allowUnits:!0};const C=T,N=e=>{const t=le(e,"all")&&e.attrNameTemplate||"",a=le(e,"all")&&e.attrName||"Background",l=e=>X(t,a+e),n=C({blockAttributeKey:l("XPosition"),allowScreens:!0}),i=C({blockAttributeKey:l("YPosition"),allowScreens:!0}),o=C({blockAttributeKey:l("SizeWidth"),allowScreens:!0});return{[l("Image")]:{type:"object",default:{id:null,url:"",alt:"",caption:""}},[l("ImageTablet")]:{type:"object",default:{id:null,url:"",alt:"",caption:""}},[l("ImageMobile")]:{type:"object",default:{id:null,url:"",alt:"",caption:""}},[l("Position")]:{type:"string",default:""},[l("PositionTablet")]:{type:"string",default:""},[l("PositionMobile")]:{type:"string",default:""},...n,...i,[l("Attachment")]:{type:"string",default:""},[l("Repeat")]:{type:"string",default:""},[l("RepeatTablet")]:{type:"string",default:""},[l("RepeatMobile")]:{type:"string",default:""},[l("Size")]:{type:"string",default:""},[l("SizeTablet")]:{type:"string",default:""},[l("SizeMobile")]:{type:"string",default:""},...o}};N.defaultProps={attrNameTemplate:"",attrName:"Background"};const O=N,P=e=>{const t=le(e,"all")&&e.attrNameTemplate||"",a=e=>X(t,e),l=!!le(e,"all")&&(e.includeVideoBG??!1),n=O({attrNameTemplate:t});let i={[a("BackgroundType")]:{type:"string",default:""},[a("BackgroundColor")]:{type:"string",default:""},...n,[a("BackgroundGradientColor1")]:{type:"string",default:""},[a("BackgroundGradientLocation1")]:{type:"number",default:""},[a("BackgroundGradientColor2")]:{type:"string",default:""},[a("BackgroundGradientLocation2")]:{type:"number",default:""},[a("BackgroundGradientType")]:{type:"string",default:"linear"},[a("BackgroundGradientTypeAngle")]:{type:"number",default:""},[a("BackgroundGradientTypePosition")]:{type:"string",default:"center center"}};if(l){const e={[a("BackgroundVideoLink")]:{type:"object",default:{id:null,url:"",alt:""}},[a("BackgroundVideoStartTime")]:{type:"number",default:""},[a("BackgroundVideoEndTime")]:{type:"number",default:""},[a("BackgroundVideoStartTime")]:{type:"number",default:""},[a("BackgroundVideoPlayOnce")]:{type:"boolean",default:!1},[a("BackgroundVideoPlayOnMobile")]:{type:"boolean",default:!1},[a("BackgroundVideoFallbackImage")]:{type:"object",default:{id:null,url:"",alt:""}}};i={...i,...e}}return i};P.defaultProps={attrNameTemplate:"",includeVideoBG:!1};const B=P,D=e=>{const t=le(e,"all")&&e.attrNameTemplate||"",a=le(e,"all")&&e.attrName||"",l=le(e,"all")&&e.defaultValue||"",n=e=>X(t,a+e);return{[n("")]:{type:"string",default:l},[n("Tablet")]:{type:"string",default:""},[n("Mobile")]:{type:"string",default:""}}};D.defaultProps={attrNameTemplate:"",attrName:"",defaultValue:""};const V=D,R=e=>{const t=le(e,"all")&&e.attrNameTemplate||"",a=le(e,"all")&&e.disableWidthDirections||[],l=!le(e,"all")||(e.allowBorderColor??!0),n=!le(e,"all")||(e.allowBorderRadius??!0),i=e=>X(t,e),o=E({attrNameTemplate:t,attrName:"BorderWidth",disableDirections:a,allowUnitControl:!1}),r=l?{[i("BorderColor")]:{type:"string",default:""}}:{},s=n?E({attrNameTemplate:t,attrName:"BorderRadius"}):{};return{[i("BorderStyle")]:{type:"string",default:""},...r,...o,...s}};R.defaultProps={attrNameTemplate:"",allowBorderColor:!0,allowBorderRadius:!0};const L=R,z=e=>{const t=le(e,"all")&&e.attrNameTemplate||"",a=e=>X(t,e);return{[a("BoxShadowColor")]:{type:"string",default:""},[a("BoxShadowHorizontal")]:{type:"number",default:""},[a("BoxShadowVertical")]:{type:"number",default:""},[a("BoxShadowBlur")]:{type:"number",default:""},[a("BoxShadowSpread")]:{type:"number",default:""},[a("BoxShadowPosition")]:{type:"string",default:""}}};z.defaultProps={attrNameTemplate:""};const M=z,U=e=>{const t=le(e,"all")&&e.excludePanels||[],a=le(e,"all")&&e.includePanels||[];let l=a&&a.length?a:K();const n=e=>X("",e);t&&t.length&&t.forEach(e=>{l.splice(l.indexOf(e),1)});let i={};const o=x();if(l.includes("advanced")){const e=E({attrName:n("Margin")}),t=E({attrName:n("Padding")});i={...i,...e,...t,[n("zIndex")]:{type:"number",default:""},[n("cssId")]:{type:"string",default:""},[n("cssClasses")]:{type:"string",default:""}}}if(l.includes("motion-effects")&&(i={...i,[n("EntranceAnimation")]:{type:"string",default:""},[n("EntranceAnimationDuration")]:{type:"string",default:"normal"},[n("EntranceAnimationDelay")]:{type:"number",default:""}}),l.includes("background")){const e=B({attrNameTemplate:"Advanced"});i={...i,...e}}if(l.includes("border")){const e=L({attrNameTemplate:"Advanced"}),t=M({attrNameTemplate:"Advanced"});i={...i,...e,...t}}if(l.includes("positioning")){const e=V({attrName:n("BlockWidth")}),t=C({blockAttributeKey:n("BlockCustomWidth"),allowScreens:!0}),a=C({blockAttributeKey:n("PositionHorizontalOffset"),allowScreens:!0}),l=C({blockAttributeKey:n("PositionVerticalOffset"),allowScreens:!0});i={...i,...e,...t,[n("BlockPosition")]:{type:"string",default:""},[n("PositionHorizontalOrientation")]:{type:"string",default:"left"},...a,[n("PositionVerticalOrientation")]:{type:"string",default:"top"},...l}}return l.includes("responsive")&&(i={...i,...o}),i};U.defaultProps={excludePanels:[],includePanels:[]};const j=U;const K=()=>["advanced","motion-effects","background","border","positioning","responsive"],F=(e,t="")=>{const a=e=>X(t,e),l=[];return e[a("cssClasses")]&&l.push(e[a("cssClasses")]),void 0!==e[a("EntranceAnimation")]&&""!==e[a("EntranceAnimation")]&&(l.push("qodef-entrance-animation--on"),e[a("EntranceAnimationDuration")]&&l.push("qodef-animation-speed--"+e[a("EntranceAnimationDuration")])),e[a("BlockWidth")]&&l.push("qodef-width--"+e[a("BlockWidth")]),e[a("BlockWidthTablet")]&&l.push("qodef-width--tablet--"+e[a("BlockWidthTablet")]),e[a("BlockWidthMobile")]&&l.push("qodef-width--mobile--"+e[a("BlockWidthMobile")]),l.push((e=>{const t=[];return I.map(a=>{const l="qodef-hide-on--"+a.classSuffix,n=e[a.blockAttributeKey];t.includes(l)&&!n?t.filter(function(e){return e!==l}):!t.includes(l)&&n&&t.push(l)}),t.join(" ")})(e)),l.join(" ")};const G=(e,t="",a="")=>{let l=[];a&&l.push(`wp-block-qi-blocks-${a}`),l.push("qodef-block-container"),le(e.uniqueClass,"all")&&l.push(e.uniqueClass);const n=F(e,t);return n&&l.push(n),l.join(" ")},W=(e,t="")=>{let a={};const l=((e,t="")=>{const a=(e,a="")=>X(t,e,a),l={};return void 0!==e[a("EntranceAnimation")]&&""!==e[a("EntranceAnimation")]&&(l["data-animation"]=e[a("EntranceAnimation")]),"custom"!==e[a("BlockWidth")]&&"custom"!==e[a("BlockWidthTablet")]&&"custom"!==e[a("BlockWidthMobile")]||["","Tablet","Mobile"].forEach(t=>{const n=e[a("BlockCustomWidth",t)],i=e[a("BlockCustomWidthDecimal",t)],o=e[a("BlockCustomWidthUnit",t)];ee(o)&&n?l["data-width"+(t?"-"+t.toLowerCase():"")]=parseInt(n,10)+o:te(o)&&i&&(l["data-width"+(t?"-"+t.toLowerCase():"")]=parseFloat(i)+o)}),l})(e,t);return l&&(a={...a,...l}),a},H=(e,t="",a=[])=>Y(e,t,a),$=(e,t,a=[])=>{if(!e)return"";let l=[`qi-block-${e}`,"qodef-block","qodef-m"];if(le(t.attributes.className,"all")){const e=t.attributes.className.split(/\s+/).filter(e=>e&&!e.startsWith("wp-block-")).join(" ");e&&l.push(e)}return a&&(l=[...l,...a]),l.join(" ")},Y=(e,t="",a=[])=>{const l=e=>X(t,e);if(!e)return"";let n=[];return le(e[l("cssId")],"all")&&n.push(e[l("cssId")]),a&&(n=[...n,...a]),n.join(" ")},X=(t,a,l)=>(t=t||"",a=a||"",l=l||"",n()((0,e.sprintf)("%s%s%s",t,a,l))),Z=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",J=e=>e&&h!==e?Z(e):"",Q=(e,t)=>{let a=e.desktop;return"mobile"===t&&(a={...a,...e.tablet}),{...a,...e[t]}},ee=e=>["px"].includes(e),te=e=>["em","rem","%","vw","vh"].includes(e),ae=(e,t="integer")=>{let a="";return 0===e||"0"===e?a=0:e&&(a=parseInt(e,10),"decimal"===t&&(a=parseFloat(e))),a},le=(e,t="")=>{let a=void 0!==e&&""!==e;return"all"===t&&(a=void 0!==e&&e),a},ne=e=>{let t="";return 0===e||"0"===e?t=0:e&&(t=e),t},ie=(t,a=!0,l=[])=>{let n=[],o=[];if(t){switch(a&&(n=[{value:"",label:(0,e.__)("Default","qi-blocks")}]),t){case"no_yes":o=[{value:"no",label:(0,e.__)("No","qi-blocks")},{value:"yes",label:(0,e.__)("Yes","qi-blocks")}];break;case"yes_no":o=[{value:"yes",label:(0,e.__)("Yes","qi-blocks")},{value:"no",label:(0,e.__)("No","qi-blocks")}];break;case"link_target":o=[{value:"_self",label:(0,e.__)("Same Window","qi-blocks")},{value:"_blank",label:(0,e.__)("New Window","qi-blocks")}];break;case"column_gap":o=[{value:"huge",label:(0,e.__)("Huge (35)","qi-blocks")},{value:"large",label:(0,e.__)("Large (25)","qi-blocks")},{value:"medium",label:(0,e.__)("Medium (20)","qi-blocks")},{value:"normal",label:(0,e.__)("Normal (15)","qi-blocks")},{value:"small",label:(0,e.__)("Small (10)","qi-blocks")},{value:"tiny",label:(0,e.__)("Tiny (5)","qi-blocks")},{value:"no",label:(0,e.__)("No (0)","qi-blocks")}];break;case"columns_responsive":o=[{value:"predefined",label:(0,e.__)("Predefined","qi-blocks")},{value:"custom",label:(0,e.__)("Custom","qi-blocks")}];break;case"masonry_image_sizes":o=[{value:"square",label:(0,e.__)("Square","qi-blocks")},{value:"landscape",label:(0,e.__)("Landscape","qi-blocks")},{value:"portrait",label:(0,e.__)("Portrait","qi-blocks")},{value:"huge-square",label:(0,e.__)("Huge","qi-blocks")}];break;case"image_sizes":o=[{value:"full",label:(0,e.__)("Original","qi-blocks")},{value:"thumbnail",label:(0,e.__)("Thumbnail","qi-blocks")},{value:"medium",label:(0,e.__)("Medium","qi-blocks")},{value:"large",label:(0,e.__)("Large","qi-blocks")}];break;case"title_tag":o=[{value:"h1",label:(0,e.__)("H1","qi-blocks")},{value:"h2",label:(0,e.__)("H2","qi-blocks")},{value:"h3",label:(0,e.__)("H3","qi-blocks")},{value:"h4",label:(0,e.__)("H4","qi-blocks")},{value:"h5",label:(0,e.__)("H5","qi-blocks")},{value:"h6",label:(0,e.__)("H6","qi-blocks")},{value:"p",label:(0,e.__)("Paragraph","qi-blocks")}];break;case"font_weight":o=[{value:"normal",label:(0,e.__)("Normal","qi-blocks")},{value:"bold",label:(0,e.__)("Bold","qi-blocks")},{value:"100",label:(0,e.__)("Thin (100)","qi-blocks")},{value:"200",label:(0,e.__)("Extra Light (200)","qi-blocks")},{value:"300",label:(0,e.__)("Light (300)","qi-blocks")},{value:"400",label:(0,e.__)("Normal (400)","qi-blocks")},{value:"500",label:(0,e.__)("Medium (500)","qi-blocks")},{value:"600",label:(0,e.__)("Semi Bold (600)","qi-blocks")},{value:"700",label:(0,e.__)("Bold (700)","qi-blocks")},{value:"800",label:(0,e.__)("Extra Bold (800)","qi-blocks")},{value:"900",label:(0,e.__)("Black (900)","qi-blocks")}];break;case"text_transform":o=[{value:"none",label:(0,e.__)("None","qi-blocks")},{value:"uppercase",label:(0,e.__)("Uppercase","qi-blocks")},{value:"lowercase",label:(0,e.__)("Lowercase","qi-blocks")},{value:"capitalize",label:(0,e.__)("Capitalize","qi-blocks")},{value:"normal",label:(0,e.__)("Normal","qi-blocks")}];break;case"font_style":o=[{value:"normal",label:(0,e.__)("Normal","qi-blocks")},{value:"italic",label:(0,e.__)("Italic","qi-blocks")},{value:"oblique",label:(0,e.__)("Oblique","qi-blocks")}];break;case"text_decoration":o=[{value:"none",label:(0,e.__)("None","qi-blocks")},{value:"underline",label:(0,e.__)("Underline","qi-blocks")},{value:"overline",label:(0,e.__)("Overline","qi-blocks")},{value:"line-through",label:(0,e.__)("Line-Through","qi-blocks")}];break;case"background_position":o=[{value:"center center",label:(0,e.__)("Center Center","qi-blocks")},{value:"center left",label:(0,e.__)("Center Left","qi-blocks")},{value:"center right",label:(0,e.__)("Center Right","qi-blocks")},{value:"top center",label:(0,e.__)("Top Center","qi-blocks")},{value:"top left",label:(0,e.__)("Top Left","qi-blocks")},{value:"top right",label:(0,e.__)("Top Right","qi-blocks")},{value:"bottom center",label:(0,e.__)("Bottom Center","qi-blocks")},{value:"bottom left",label:(0,e.__)("Bottom Left","qi-blocks")},{value:"bottom right",label:(0,e.__)("Bottom Right","qi-blocks")}];break;case"background_attachment":o=[{value:"scroll",label:(0,e.__)("Scroll","qi-blocks")},{value:"fixed",label:(0,e.__)("Fixed","qi-blocks")}];break;case"background_repeat":o=[{value:"no-repeat",label:(0,e.__)("No-repeat","qi-blocks")},{value:"repeat",label:(0,e.__)("Repeat","qi-blocks")},{value:"repeat-x",label:(0,e.__)("Repeat-x","qi-blocks")},{value:"repeat-y",label:(0,e.__)("Repeat-y","qi-blocks")}];break;case"background_size":o=[{value:"auto",label:(0,e.__)("Auto","qi-blocks")},{value:"cover",label:(0,e.__)("Cover","qi-blocks")},{value:"contain",label:(0,e.__)("Contain","qi-blocks")}];break;case"horizontal_alignment":o=[{value:"left",label:(0,e.__)("Left","qi-blocks")},{value:"right",label:(0,e.__)("Right","qi-blocks")},{value:"center",label:(0,e.__)("Center","qi-blocks")}];break;case"vertical_alignment":o=[{value:"top",label:(0,e.__)("Top","qi-blocks")},{value:"middle",label:(0,e.__)("Middle","qi-blocks")},{value:"bottom",label:(0,e.__)("Bottom","qi-blocks")}];break;case"html_tag":o=[{value:"section",label:(0,e.__)("Section","qi-blocks")},{value:"div",label:(0,e.__)("Div","qi-blocks")},{value:"main",label:(0,e.__)("Main","qi-blocks")},{value:"article",label:(0,e.__)("Article","qi-blocks")},{value:"nav",label:(0,e.__)("Nav","qi-blocks")},{value:"footer",label:(0,e.__)("Footer","qi-blocks")},{value:"header",label:(0,e.__)("Header","qi-blocks")},{value:"aside",label:(0,e.__)("Aside","qi-blocks")}];break;case"appear_animation":o=[{value:"none",label:(0,e.__)("None","qi-blocks")},{value:"from-bottom",label:(0,e.__)("From Bottom","qi-blocks")},{value:"from-top",label:(0,e.__)("From Top","qi-blocks")},{value:"from-left",label:(0,e.__)("From Left","qi-blocks")},{value:"from-right",label:(0,e.__)("From Right","qi-blocks")},{value:"fade",label:(0,e.__)("Fade in","qi-blocks")}];break;case"appear_delay":o=[{value:"random",label:(0,e.__)("Random","qi-blocks")},{value:"ms",label:(0,e.__)("Set ms","qi-blocks")}];break;case"responsive_screens":o=[{value:"1024",label:(0,e.__)("Below 1024px","qi-blocks")},{value:"768",label:(0,e.__)("Below 768px","qi-blocks")},{value:"680",label:(0,e.__)("Below 680px","qi-blocks")},{value:"480",label:(0,e.__)("Below 480px","qi-blocks")}];break;case"order_by":o=[{value:"date",label:(0,e.__)("Date","qi-blocks")},{value:"id",label:(0,e.__)("ID","qi-blocks")},{value:"title",label:(0,e.__)("Title","qi-blocks")}];break;case"order":o=[{value:"desc",label:(0,e.__)("Descending","qi-blocks")},{value:"asc",label:(0,e.__)("Ascending","qi-blocks")}];break;case"border_style":o=[{value:"solid",label:(0,e.__)("Solid","qi-blocks")},{value:"dashed",label:(0,e.__)("Dashed","qi-blocks")},{value:"dotted",label:(0,e.__)("Dotted","qi-blocks")}]}n=[...n,...o],l&&(n=[...n,...l])}return(0,i.applyFilters)("qi-blocks-filter-options-pool",n)},oe=(e,t="",a={cssProp:"",value:""})=>{const{attributes:l,blockAttrName:n,cssProp:i}=e,o=le(e,"all")&&void 0!==e.direction&&e.direction?Z(e.direction):"",r=!!le(e,"all")&&(e.customUnitValue??!1);let s={},c={},u={};return Object.entries(k).map(([e])=>{let m=J(e),p="",d=n+o+m,b=n+o+"Decimal"+m,f=l[n+"Unit"+m];(le(l[d])||le(l[b]))&&(ee(f)&&le(l[d])&&!r?p=ae(l[d])+f:te(f)&&le(l[b])&&!r?p=ae(l[b],"decimal")+f:""!==l[d]&&(p=l[d]));const g=e=>{let a=e;if(t.includes("%s")){const l=t.split("%s");a="",l.forEach((t,n)=>{a+=t,n!==l.length-1&&(a+=e)})}return a};if(p)switch(e){case"desktop":s[i]=t?g(p):p,a.cssProp&&a.value&&(s[a.cssProp]=a.value);break;case"tablet":c[i]=t?g(p):p,a.cssProp&&a.value&&(c[a.cssProp]=a.value);break;case"mobile":u[i]=t?g(p):p,a.cssProp&&a.value&&(u[a.cssProp]=a.value)}}),{desktop:s,tablet:c,mobile:u}},re=e=>{if(!e)return null;const t=Number(e);return(0,o.select)("core").getEntityRecord("postType","attachment",Number.isNaN(t)?e:t)},se=e=>{const t=le(e,"all")&&e.attrNameTemplate||"",a=e=>X(t,e);return{[a("Image")]:{type:"object",default:{id:null,url:"",alt:"",caption:"",html:""}},[a("ImageTablet")]:{type:"object",default:{id:null,url:"",alt:"",caption:"",html:""}},[a("ImageMobile")]:{type:"object",default:{id:null,url:"",alt:"",caption:"",html:""}},[a("ImageSize")]:{type:"string",default:"full"},[a("ImageSizeTablet")]:{type:"string",default:""},[a("ImageSizeMobile")]:{type:"string",default:""},[a("ImageCustomWidth")]:{type:"number",default:""},[a("ImageCustomWidthTablet")]:{type:"number",default:""},[a("ImageCustomWidthMobile")]:{type:"number",default:""},[a("ImageCustomHeight")]:{type:"number",default:""},[a("ImageCustomHeightTablet")]:{type:"number",default:""},[a("ImageCustomHeightMobile")]:{type:"number",default:""}}};se.defaultProps={attrNameTemplate:""};const ce=se({attrNameTemplate:"Main"}),ue=E({attrNameTemplate:"Main",attrName:"Padding"}),me=M({attrNameTemplate:"Main"}),pe=M({attrNameTemplate:"Parallax"}),de=j(),be={uniqueClass:{type:"string",default:""},...ce,mainImageParallaxLevel:{type:"number",default:""},items:{type:"array",default:[{itemImage:{image:{id:null,url:qiBlocksEditor.vars.defaultThumbnail,alt:qiBlocksEditor.vars.defaultImagePlaceholder},imageSize:"full"},itemImagePosition:"top-left",itemImageWidth:{itemImageWidthUnit:"px",itemImageWidthUnitTablet:"px",itemImageWidthUnitMobile:"px"},itemYOffset:{itemYOffsetUnit:"px",itemYOffsetUnitTablet:"px",itemYOffsetUnitMobile:"px"},itemXOffset:{itemXOffsetUnit:"px",itemXOffsetUnitTablet:"px",itemXOffsetUnitMobile:"px"},itemImageZIndex:"",itemImageParallaxLevel:""},{itemImage:{image:{id:null,url:qiBlocksEditor.vars.defaultThumbnail,alt:qiBlocksEditor.vars.defaultImagePlaceholder},imageSize:"full"},itemImagePosition:"bottom-right",itemImageWidth:{itemImageWidthUnit:"px",itemImageWidthUnitTablet:"px",itemImageWidthUnitMobile:"px"},itemYOffset:{itemYOffsetUnit:"px",itemYOffsetUnitTablet:"px",itemYOffsetUnitMobile:"px"},itemXOffset:{itemXOffsetUnit:"px",itemXOffsetUnitTablet:"px",itemXOffsetUnitMobile:"px"},itemImageZIndex:"",itemImageParallaxLevel:""}]},...ue,...me,...pe,...de};var fe=a(2404),ge=a.n(fe),he=a(5364),ke=a.n(he);const _e=wp.blockEditor,ve=wp.compose,ye=wp.element;var we=a(6942),Ae=a.n(we);const Ie=e=>{const{unitType:t,unitValue:a,onChangeUnit:l}=e;if(e.units[t])return wp.element.createElement("ul",{className:"qodef-unit-control"},Object.entries(e.units[t]).map(([e,t],n)=>wp.element.createElement("li",{key:n},wp.element.createElement("a",{className:Ae()("qodef-unit",{"qodef--selected":("p"===e?"%":e)===a}),onClick:l,"data-unit":"p"===e?"%":e},t))))};Ie.defaultProps={units:{typography:{px:(0,e.__)("px","qi-blocks"),em:(0,e.__)("em","qi-blocks"),rem:(0,e.__)("rem","qi-blocks"),vw:(0,e.__)("vw","qi-blocks")},measure:{px:(0,e.__)("px","qi-blocks"),p:(0,e.__)("%","qi-blocks"),vw:(0,e.__)("vw","qi-blocks"),vh:(0,e.__)("vh","qi-blocks")},space:{px:(0,e.__)("px","qi-blocks"),p:(0,e.__)("%","qi-blocks"),em:(0,e.__)("em","qi-blocks")},height:{px:(0,e.__)("px","qi-blocks"),vw:(0,e.__)("vw","qi-blocks"),vh:(0,e.__)("vh","qi-blocks")},xPosition:{px:(0,e.__)("px","qi-blocks"),em:(0,e.__)("em","qi-blocks"),p:(0,e.__)("%","qi-blocks"),vw:(0,e.__)("vw","qi-blocks")},yPosition:{px:(0,e.__)("px","qi-blocks"),em:(0,e.__)("em","qi-blocks"),p:(0,e.__)("%","qi-blocks"),vh:(0,e.__)("vh","qi-blocks")},pxAndPercent:{px:(0,e.__)("px","qi-blocks"),p:(0,e.__)("%","qi-blocks")},pxAndEm:{px:(0,e.__)("px","qi-blocks"),em:(0,e.__)("em","qi-blocks")},pxEmVw:{px:(0,e.__)("px","qi-blocks"),em:(0,e.__)("em","qi-blocks"),vw:(0,e.__)("vw","qi-blocks")},pxPercentVh:{px:(0,e.__)("px","qi-blocks"),p:(0,e.__)("%","qi-blocks"),vh:(0,e.__)("vh","qi-blocks")},pxPercentVw:{px:(0,e.__)("px","qi-blocks"),p:(0,e.__)("%","qi-blocks"),vw:(0,e.__)("vw","qi-blocks")},pxEmRem:{px:(0,e.__)("px","qi-blocks"),em:(0,e.__)("em","qi-blocks"),rem:(0,e.__)("rem","qi-blocks")}},unitValue:"",onChangeUnit:()=>{}};const Se=Ie;class xe extends ye.Component{constructor(){super(...arguments),this.state={screen:h,isScreenPickerOpen:!1,isMouseOver:!1}}onChangeScreen(e,t){const a=this;a.state.isScreenPickerOpen?(a.props.onChangeScreen(e),a.setState({screen:e,isScreenPickerOpen:!1}),_=e,!t&&a.changePreviewScreen(e),(0,i.doAction)("qi-blocks-action-screen-change",e)):t||a.setState({isScreenPickerOpen:!0}),window.addEventListener("click",e=>{const t=document.querySelectorAll(".qodef-screens-option .qodef-screens.qodef--opened");t.length&&!t[0].contains(e.target)&&a.setState({isScreenPickerOpen:!1})})}onOtherScreenChange(e){this.props.onChangeScreen(e),this.setState({screen:e})}componentDidMount(){const{instanceId:e}=this.props;(0,i.addAction)("qi-blocks-action-screen-change",`qi-blocks/components/screen-control-${e}`,this.onOtherScreenChange.bind(this))}componentWillUnmount(){const{instanceId:e}=this.props;(0,i.removeAction)("qi-blocks-action-screen-change",`qi-blocks/components/screen-control-${e}`)}changeScreenControls(e){v()!==e.previewScreen&&this.onChangeScreen(e.previewScreen,!0)}changePreviewScreen(e){if(e!==this.props.previewScreen){const t=(0,o.dispatch)("core/edit-post")||"",a=(0,o.dispatch)("core/edit-site")||"";let l;if(t){let{__experimentalSetPreviewDeviceType:e}=t;l=e}if(a){const{__experimentalSetPreviewDeviceType:e}=a;l=e}l&&l(Z(e))}}render(){const e={...this.props},t={...this.state},{label:a,screens:l,isWidgetsArea:n,previewScreen:i}=e;let o=!1;return(l.length<1||n)&&(o=!0),h!==i&&t.screen!==i&&this.onOtherScreenChange(i),this.changeScreenControls(e),wp.element.createElement("div",{className:"qodef-screens-option"},h!==t.screen&&wp.element.createElement("style",null,"\n\t\t\t\t\t\t\t.qodef-screens-option .qodef-screens.qodef--opened {\n\t\t\t\t\t\t\t\ttop: calc(-4px - 22px * "+Object.keys(l).indexOf(t.screen)+");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t"),a&&wp.element.createElement("label",{className:"qodef-option-label"},a),!o&&wp.element.createElement("ul",{className:"qodef-screens "+(t.isScreenPickerOpen?"qodef--opened":"")},Object.entries(l).map(([e,a],n)=>n===Object.keys(l).indexOf(t.screen)||t.isScreenPickerOpen?wp.element.createElement("li",{className:"qodef-screen-item "+(e===t.screen?"qodef--selected":""),key:n},wp.element.createElement(y.Button,{className:"qodef-screen-item-button",onClick:()=>this.onChangeScreen(e),icon:a.icon,showTooltip:!1,label:a.label,"data-screen":e,onMouseEnter:()=>this.setState({isMouseOver:e}),onMouseLeave:()=>this.setState({isMouseOver:!1})}),e===t.isMouseOver&&wp.element.createElement("div",{className:"qodef-screen-item-tooltip"},a.label)):null)))}}xe.defaultProps={label:"",screens:k,isWidgetsArea:!1,previewScreen:"desktop",onChangeScreen:()=>{}};const qe=(0,o.withSelect)(e=>{let t="desktop";return e("core/edit-post")&&(t="function"==typeof e("core/editor")?.getDeviceType?e("core/editor")?.getDeviceType()?.toLowerCase():e("core/edit-post").__experimentalGetPreviewDeviceType().toLowerCase()),e("core/edit-site")&&(t="function"==typeof e("core/editor")?.getDeviceType?e("core/editor")?.getDeviceType()?.toLowerCase():e("core/edit-site").__experimentalGetPreviewDeviceType().toLowerCase()),{isWidgetsArea:e("core/edit-widgets")&&!e("core/edit-post"),previewScreen:t}})((0,ve.withInstanceId)(xe));class Ee extends ye.Component{constructor(){super(...arguments),this.state={screen:v(),linkedInputs:!1}}getScreenLabelSuffix(e){const t=e||this.state.screen;return J(t)}getAttributeValue(e,t=""){const{blockAttributes:a,allowScreens:l,repeater:n,repeaterItemIndex:i,repeaterItemKey:o,repeaterGetAttributes:r}=this.props;let s=e;l&&t&&(s=e+t);let c=a[s];return n&&(c=r({key:o,childKey:s},i)),ne(c)}setAttributeValue(e,t,a=""){const{setAttributes:l,allowScreens:n,repeater:i,repeaterItemIndex:o,repeaterItemKey:r,repeaterSetAttributes:s}=this.props;let c=e;n&&a&&(c=e+a),i?s({key:r,childKey:c},t,o):l({[c]:t})}render(){const t={...this.props},{label:a,allowScreens:l,rangeMax:n,rangeMin:i,rangeStep:o,rangeDecimalMax:r,rangeDecimalMin:s,rangeDecimalStep:c,repeater:u}=t,m=e=>X(t.attrNameTemplate,t.attrName,e),p=this.getScreenLabelSuffix(),d=m(),b=m("Unit"+p),f=["Top","Right","Bottom","Left"],g=()=>{const e=this.getAttributeValue(b)||"px";return ee(e)},h="margin"===t.attrName.toLowerCase()||t.allowNegativeValues?-1*(g()?n:r):g()?i:s;return t.onChange=(e,t)=>{g()?this.setAttributeValue(m(t),ae(e),p):this.setAttributeValue(m(`${t}Decimal`),ae(e,"decimal"),p)},t.getValue=e=>{let t;return t=g()?""!==this.getAttributeValue(m(e),p)?parseInt(this.getAttributeValue(m(e),p),10):"":""!==this.getAttributeValue(m(`${e}Decimal`),p)?parseFloat(this.getAttributeValue(m(`${e}Decimal`),p)):"",t},t.getPlaceholderValue=e=>{let t="";return"Tablet"===p?t=g()?""!==this.getAttributeValue(m(e))?parseInt(this.getAttributeValue(m(e)),10):"":""!==this.getAttributeValue(m(`${e}Decimal`))?parseFloat(this.getAttributeValue(m(`${e}Decimal`))):"":"Mobile"===p&&(g()?""!==this.getAttributeValue(m(e),"Tablet")?t=parseInt(this.getAttributeValue(m(e),"Tablet"),10):""!==this.getAttributeValue(m(e))&&(t=parseInt(this.getAttributeValue(m(e)),10)):""!==this.getAttributeValue(m(`${e}Decimal`),"Tablet")?t=parseInt(this.getAttributeValue(m(`${e}Decimal`),"Tablet"),10):""!==this.getAttributeValue(m(`${e}Decimal`))&&(t=parseInt(this.getAttributeValue(m(`${e}Decimal`)),10))),t},t.getRangeValue=()=>{let e="";return[...f].some(a=>{t.disableDirections.includes(a)||(e=t.getValue(a))}),e},t.onRangeChange=e=>{[...f].map(a=>{t.disableDirections.length>0&&t.disableDirections.includes(a)?t.onChange("",a):t.onChange(e,a)})},t.onChangeScreen=e=>{this.setState({screen:e})},t.onLinkInputs=e=>{e.preventDefault(),this.state.linkedInputs||[...f].map(e=>{t.disableDirections.length>0&&t.disableDirections.includes(e)?t.onChange("",e):t.onChange(t.getValue("Top"),e)}),this.setState({linkedInputs:!this.state.linkedInputs})},t.onChangeUnit=e=>{e.preventDefault();const t=u?200:0,a=e.target.getAttribute("data-unit"),l=this.getAttributeValue(b)||"px";this.setAttributeValue(b,a),setTimeout(()=>{a!==l&&[...f].map(e=>{const t=d+e,n=`${t}Decimal`;let i=t+p,o=n+p;"px"!==a&&(i=n+p),"px"===l&&(o=t+p,this.setAttributeValue(o,"")),this.setAttributeValue(i,this.getAttributeValue(o))})},t)},wp.element.createElement(y.BaseControl,{className:"qodef-input-control"},wp.element.createElement("div",{className:"qodef-control-heading"},l?wp.element.createElement("div",{className:"qodef-input-control-screens"},wp.element.createElement(qe,{label:a,onChangeScreen:t.onChangeScreen})):wp.element.createElement("label",{className:"qodef-option-label"},a),t.allowUnitControl&&wp.element.createElement(Se,{unitType:t.unitType,unitValue:this.getAttributeValue(b),onChangeUnit:t.onChangeUnit}),t.allowLinkedControl&&wp.element.createElement(y.Button,{icon:this.state.linkedInputs?"editor-unlink":"admin-links",onClick:t.onLinkInputs,className:"qodef-link-inputs-button "+(this.state.linkedInputs?"linked":"unlinked")})),this.state.linkedInputs?wp.element.createElement(y.RangeControl,{min:i,max:g()?n:r,step:g()?o:c,onChange:t.onRangeChange,allowReset:!0,value:t.getRangeValue()}):wp.element.createElement("ul",null,[...f].map((a,l)=>wp.element.createElement("li",{className:"qodef-input-control-item",key:l},t.disableDirections.length>0&&t.disableDirections.includes(a)?wp.element.createElement("div",{className:"components-base-control__field"},wp.element.createElement("label",null,(0,e.__)(a,"qi-blocks")),wp.element.createElement("input",{className:"components-text-control__input",type:"text",disabled:!0,value:(0,e.__)("auto","qi-blocks")})):wp.element.createElement(y.TextControl,{type:"number",value:t.getValue(a),placeholder:t.getPlaceholderValue(a),onChange:e=>t.onChange(e,a),label:(0,e.__)(a,"qi-blocks"),min:h,max:g()?n:r,step:g()?o:c})))))}}Ee.defaultProps={label:"",attrNameTemplate:"",attrName:"",blockAttributes:{},setAttributes:()=>{},unitType:"space",allowScreens:!0,allowNegativeValues:!1,disableDirections:[],allowUnitControl:!0,allowLinkedControl:!0,rangeMax:600,rangeMin:0,rangeStep:1,rangeDecimalMax:100,rangeDecimalMin:0,rangeDecimalStep:.01,repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const Te=Ee;class Ce extends ye.Component{constructor(){super(...arguments),this.state={screen:v()}}getScreenLabelSuffix(){return J(this.state.screen)}getAttributeValue(e,t=this.getScreenLabelSuffix()){const{blockAttributes:a,repeater:l,repeaterItemIndex:n,repeaterItemKey:i,repeaterGetAttributes:o}=this.props;let r=e;t&&(r=e+t);let s=a[r];return l&&(s=o({key:i,childKey:r},n)),ne(s)}setAttributeValue(e,t,a=this.getScreenLabelSuffix()){const{setAttributes:l,setCustomEventOnChange:n,repeater:i,repeaterItemIndex:o,repeaterItemKey:r,repeaterSetAttributes:s}=this.props;let c=e;a&&(c=e+a),i?s({key:r,childKey:c},t,o):l({[c]:t}),n(t)}render(){const e={...this.props},{label:t,blockAttributeKey:a,selectOptions:l}=e;return e.onChangeScreen=e=>{this.setState({screen:e})},wp.element.createElement(y.BaseControl,{className:"qodef-advanced-select-option"},wp.element.createElement("div",{className:"qodef-advanced-select-heading"},wp.element.createElement(qe,{label:t,onChangeScreen:e.onChangeScreen})),wp.element.createElement(y.SelectControl,{value:this.getAttributeValue(a),options:l,onChange:e=>this.setAttributeValue(a,e)}))}}Ce.defaultProps={label:(0,e.__)("Default Label Text","qi-blocks"),blockAttributes:{},blockAttributeKey:"",setAttributes:()=>{},selectOptions:{},setCustomEventOnChange:()=>{},repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const Ne=Ce,Oe=wp.blob;function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,l=Array(t);a<t;a++)l[a]=e[a];return l}function Be(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l,n,i,o,r=[],s=!0,c=!1;try{if(i=(a=a.call(e)).next,0===t);else for(;!(s=(l=i.call(a)).done)&&(r.push(l.value),r.length!==t);s=!0);}catch(e){c=!0,n=e}finally{try{if(!s&&null!=a.return&&(o=a.return(),Object(o)!==o))return}finally{if(c)throw n}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pe(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Pe(e,t):void 0}}(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.")}()}const De=Object.entries,Ve=Object.setPrototypeOf,Re=Object.isFrozen,Le=Object.getPrototypeOf,ze=Object.getOwnPropertyDescriptor;let Me=Object.freeze,Ue=Object.seal,je=Object.create,Ke="undefined"!=typeof Reflect&&Reflect,Fe=Ke.apply,Ge=Ke.construct;Me||(Me=function(e){return e}),Ue||(Ue=function(e){return e}),Fe||(Fe=function(e,t){for(var a=arguments.length,l=new Array(a>2?a-2:0),n=2;n<a;n++)l[n-2]=arguments[n];return e.apply(t,l)}),Ge||(Ge=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),l=1;l<t;l++)a[l-1]=arguments[l];return new e(...a)});const We=dt(Array.prototype.forEach),He=dt(Array.prototype.lastIndexOf),$e=dt(Array.prototype.pop),Ye=dt(Array.prototype.push),Xe=dt(Array.prototype.splice),Ze=Array.isArray,Je=dt(String.prototype.toLowerCase),Qe=dt(String.prototype.toString),et=dt(String.prototype.match),tt=dt(String.prototype.replace),at=dt(String.prototype.indexOf),lt=dt(String.prototype.trim),nt=dt(Number.prototype.toString),it=dt(Boolean.prototype.toString),ot="undefined"==typeof BigInt?null:dt(BigInt.prototype.toString),rt="undefined"==typeof Symbol?null:dt(Symbol.prototype.toString),st=dt(Object.prototype.hasOwnProperty),ct=dt(Object.prototype.toString),ut=dt(RegExp.prototype.test),mt=(pt=TypeError,function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return Ge(pt,t)});var pt;function dt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,l=new Array(a>1?a-1:0),n=1;n<a;n++)l[n-1]=arguments[n];return Fe(e,t,l)}}function bt(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Je;if(Ve&&Ve(e,null),!Ze(t))return e;let l=t.length;for(;l--;){let n=t[l];if("string"==typeof n){const e=a(n);e!==n&&(Re(t)||(t[l]=e),n=e)}e[n]=!0}return e}function ft(e){for(let t=0;t<e.length;t++){st(e,t)||(e[t]=null)}return e}function gt(e){const t=je(null);for(const l of De(e)){var a=Be(l,2);const n=a[0],i=a[1];st(e,n)&&(Ze(i)?t[n]=ft(i):i&&"object"==typeof i&&i.constructor===Object?t[n]=gt(i):t[n]=i)}return t}function ht(e,t){for(;null!==e;){const a=ze(e,t);if(a){if(a.get)return dt(a.get);if("function"==typeof a.value)return dt(a.value)}e=Le(e)}return function(){return null}}const kt=Me(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),_t=Me(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),vt=Me(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yt=Me(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),wt=Me(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),At=Me(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),It=Me(["#text"]),St=Me(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),xt=Me(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),qt=Me(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Et=Me(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Tt=Ue(/{{[\w\W]*|^[\w\W]*}}/g),Ct=Ue(/<%[\w\W]*|^[\w\W]*%>/g),Nt=Ue(/\${[\w\W]*/g),Ot=Ue(/^data-[\-\w.\u00B7-\uFFFF]+$/),Pt=Ue(/^aria-[\-\w]+$/),Bt=Ue(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dt=Ue(/^(?:\w+script|data):/i),Vt=Ue(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rt=Ue(/^html$/i),Lt=Ue(/^[a-z][.\w]*(-[.\w]+)+$/i),zt=Ue(/<[/\w!]/g),Mt=Ue(/<[/\w]/g),Ut=Ue(/<\/no(script|embed|frames)/i),jt=Ue(/\/>/i),Kt=1,Ft=3,Gt=7,Wt=8,Ht=9,$t=11,Yt=function(){return"undefined"==typeof window?null:window},Xt=function(e,t,a,l){return st(e,t)&&Ze(e[t])?bt(l.base?gt(l.base):{},e[t],l.transform):a};var Zt=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yt();const a=t=>e(t);if(a.version="3.4.10",a.removed=[],!t||!t.document||t.document.nodeType!==Ht||!t.Element)return a.isSupported=!1,a;let l=t.document;const n=l,i=n.currentScript;t.DocumentFragment;const o=t.HTMLTemplateElement,r=t.Node,s=t.Element,c=t.NodeFilter,u=t.NamedNodeMap;void 0===u&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const m=t.DOMParser,p=t.trustedTypes,d=s.prototype,b=ht(d,"cloneNode"),f=ht(d,"remove"),g=ht(d,"nextSibling"),h=ht(d,"childNodes"),k=ht(d,"parentNode"),_=ht(d,"shadowRoot"),v=ht(d,"attributes"),y=r&&r.prototype?ht(r.prototype,"nodeType"):null,w=r&&r.prototype?ht(r.prototype,"nodeName"):null;if("function"==typeof o){const e=l.createElement("template");e.content&&e.content.ownerDocument&&(l=e.content.ownerDocument)}let A,I,S="",x=!1,q=0;const E=function(){if(q>0)throw mt('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},T=function(e){E(),q++;try{return A.createHTML(e)}finally{q--}},C=function(){return x||(I=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let a=null;const l="data-tt-policy-suffix";t&&t.hasAttribute(l)&&(a=t.getAttribute(l));const n="dompurify"+(a?"#"+a:"");try{return e.createPolicy(n,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+n+" could not be created."),null}}(p,i),x=!0),I},N=l,O=N.implementation,P=N.createNodeIterator,B=N.createDocumentFragment,D=N.getElementsByTagName,V=n.importNode;let R={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};a.isSupported="function"==typeof De&&"function"==typeof k&&O&&void 0!==O.createHTMLDocument;const L=Tt,z=Ct,M=Nt,U=Ot,j=Pt,K=Dt,F=Vt,G=Lt;let W=Bt,H=null;const $=bt({},[...kt,..._t,...vt,...wt,...It]);let Y=null;const X=bt({},[...St,...xt,...qt,...Et]);let Z=Object.seal(je(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),J=null,Q=null;const ee=Object.seal(je(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let te=!0,ae=!0,le=!1,ne=!0,ie=!1,oe=!0,re=!1,se=!1,ce=!1,ue=!1,me=!1,pe=!1,de=!0,be=!1;const fe="user-content-";let ge=!0,he=!1,ke={},_e=null;const ve=bt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let ye=null;const we=bt({},["audio","video","img","source","image","track"]);let Ae=null;const Ie=bt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Se="http://www.w3.org/1998/Math/MathML",xe="http://www.w3.org/2000/svg",qe="http://www.w3.org/1999/xhtml";let Ee=qe,Te=!1,Ce=null;const Ne=bt({},[Se,xe,qe],Qe),Oe=Me(["mi","mo","mn","ms","mtext"]);let Pe=bt({},Oe);const Be=Me(["annotation-xml"]);let Ve=bt({},Be);const Re=bt({},["title","style","font","a","script"]);let Le=null;const ze=["application/xhtml+xml","text/html"];let Ke=null,Fe=null;const Ge=l.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Fe&&Fe===e)return;e&&"object"==typeof e||(e={}),e=gt(e),Le=-1===ze.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ke="application/xhtml+xml"===Le?Qe:Je,H=Xt(e,"ALLOWED_TAGS",$,{transform:Ke}),Y=Xt(e,"ALLOWED_ATTR",X,{transform:Ke}),Ce=Xt(e,"ALLOWED_NAMESPACES",Ne,{transform:Qe}),Ae=Xt(e,"ADD_URI_SAFE_ATTR",Ie,{transform:Ke,base:Ie}),ye=Xt(e,"ADD_DATA_URI_TAGS",we,{transform:Ke,base:we}),_e=Xt(e,"FORBID_CONTENTS",ve,{transform:Ke}),J=Xt(e,"FORBID_TAGS",gt({}),{transform:Ke}),Q=Xt(e,"FORBID_ATTR",gt({}),{transform:Ke}),ke=!!st(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?gt(e.USE_PROFILES):e.USE_PROFILES),te=!1!==e.ALLOW_ARIA_ATTR,ae=!1!==e.ALLOW_DATA_ATTR,le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ne=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,ie=e.SAFE_FOR_TEMPLATES||!1,oe=!1!==e.SAFE_FOR_XML,re=e.WHOLE_DOCUMENT||!1,ue=e.RETURN_DOM||!1,me=e.RETURN_DOM_FRAGMENT||!1,pe=e.RETURN_TRUSTED_TYPE||!1,ce=e.FORCE_BODY||!1,de=!1!==e.SANITIZE_DOM,be=e.SANITIZE_NAMED_PROPS||!1,ge=!1!==e.KEEP_CONTENT,he=e.IN_PLACE||!1,W=function(e){try{return ut(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Bt,Ee="string"==typeof e.NAMESPACE?e.NAMESPACE:qe,Pe=st(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?gt(e.MATHML_TEXT_INTEGRATION_POINTS):bt({},Oe),Ve=st(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?gt(e.HTML_INTEGRATION_POINTS):bt({},Be);const t=st(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?gt(e.CUSTOM_ELEMENT_HANDLING):je(null);if(Z=je(null),st(t,"tagNameCheck")&&pt(t.tagNameCheck)&&(Z.tagNameCheck=t.tagNameCheck),st(t,"attributeNameCheck")&&pt(t.attributeNameCheck)&&(Z.attributeNameCheck=t.attributeNameCheck),st(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(Z.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Ue(Z),ie&&(ae=!1),me&&(ue=!0),ke&&(H=bt({},It),Y=je(null),!0===ke.html&&(bt(H,kt),bt(Y,St)),!0===ke.svg&&(bt(H,_t),bt(Y,xt),bt(Y,Et)),!0===ke.svgFilters&&(bt(H,vt),bt(Y,xt),bt(Y,Et)),!0===ke.mathMl&&(bt(H,wt),bt(Y,qt),bt(Y,Et))),ee.tagCheck=null,ee.attributeCheck=null,st(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?ee.tagCheck=e.ADD_TAGS:Ze(e.ADD_TAGS)&&(H===$&&(H=gt(H)),bt(H,e.ADD_TAGS,Ke))),st(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?ee.attributeCheck=e.ADD_ATTR:Ze(e.ADD_ATTR)&&(Y===X&&(Y=gt(Y)),bt(Y,e.ADD_ATTR,Ke))),st(e,"ADD_URI_SAFE_ATTR")&&Ze(e.ADD_URI_SAFE_ATTR)&&bt(Ae,e.ADD_URI_SAFE_ATTR,Ke),st(e,"FORBID_CONTENTS")&&Ze(e.FORBID_CONTENTS)&&(_e===ve&&(_e=gt(_e)),bt(_e,e.FORBID_CONTENTS,Ke)),st(e,"ADD_FORBID_CONTENTS")&&Ze(e.ADD_FORBID_CONTENTS)&&(_e===ve&&(_e=gt(_e)),bt(_e,e.ADD_FORBID_CONTENTS,Ke)),ge&&(H["#text"]=!0),re&&bt(H,["html","head","body"]),H.table&&(bt(H,["tbody"]),delete J.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=A;A=e.TRUSTED_TYPES_POLICY;try{S=T("")}catch(e){throw A=t,e}}else null===e.TRUSTED_TYPES_POLICY?(A=void 0,S=""):(void 0===A&&(A=C()),A&&"string"==typeof S&&(S=T("")));(R.uponSanitizeElement.length>0||R.uponSanitizeAttribute.length>0)&&H===$&&(H=gt(H)),R.uponSanitizeAttribute.length>0&&Y===X&&(Y=gt(Y)),Me&&Me(e),Fe=e},ft=bt({},[..._t,...vt,...yt]),Zt=bt({},[...wt,...At]),Jt=function(e){let t=k(e);t&&t.tagName||(t={namespaceURI:Ee,tagName:"template"});const a=Je(e.tagName),l=Je(t.tagName);return!!Ce[e.namespaceURI]&&(e.namespaceURI===xe?function(e,t,a){return t.namespaceURI===qe?"svg"===e:t.namespaceURI===Se?"svg"===e&&("annotation-xml"===a||Pe[a]):Boolean(ft[e])}(a,t,l):e.namespaceURI===Se?function(e,t,a){return t.namespaceURI===qe?"math"===e:t.namespaceURI===xe?"math"===e&&Ve[a]:Boolean(Zt[e])}(a,t,l):e.namespaceURI===qe?function(e,t,a){return!(t.namespaceURI===xe&&!Ve[a])&&!(t.namespaceURI===Se&&!Pe[a])&&!Zt[e]&&(Re[e]||!ft[e])}(a,t,l):!("application/xhtml+xml"!==Le||!Ce[e.namespaceURI]))},Qt=function(e){Ye(a.removed,{element:e});try{k(e).removeChild(e)}catch(t){if(f(e),!k(e))throw mt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ea=function(e){const t=h(e);if(t){const e=[];We(t,t=>{Ye(e,t)}),We(e,e=>{try{f(e)}catch(e){}})}const a=v(e);if(a)for(let t=a.length-1;t>=0;--t){const l=a[t],n=l&&l.name;if("string"==typeof n)try{e.removeAttribute(n)}catch(e){}}},ta=function(e,t){try{Ye(a.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ye(a.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ue||me)try{Qt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},aa=function(e){const t=v(e);if(t)for(let a=t.length-1;a>=0;--a){const l=t[a],n=l&&l.name;if("string"==typeof n&&!Y[Ke(n)])try{e.removeAttribute(n)}catch(e){}}},la=function(e){let t=null,a=null;if(ce)e="<remove></remove>"+e;else{const t=et(e,/^[\r\n\t ]+/);a=t&&t[0]}"application/xhtml+xml"===Le&&Ee===qe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const n=A?T(e):e;if(Ee===qe)try{t=(new m).parseFromString(n,Le)}catch(e){}if(!t||!t.documentElement){t=O.createDocument(Ee,"template",null);try{t.documentElement.innerHTML=Te?S:n}catch(e){}}const i=t.body||t.documentElement;return e&&a&&i.insertBefore(l.createTextNode(a),i.childNodes[0]||null),Ee===qe?D.call(t,re?"html":"body")[0]:re?t.documentElement:i},na=function(e){return P.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ia=function(e){return e=tt(e,L," "),e=tt(e,z," "),e=tt(e,M," ")},oa=function(e){var t;e.normalize();const a=P.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let l=a.nextNode();for(;l;)l.data=ia(l.data),l=a.nextNode();const n=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");n&&We(n,e=>{sa(e.content)&&oa(e.content)})},ra=function(e){const t=w?w(e):null;return"string"==typeof t&&("form"===Ke(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==v(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==y(e)||e.childNodes!==h(e)))},sa=function(e){if(!y||"object"!=typeof e||null===e)return!1;try{return y(e)===$t}catch(e){return!1}},ca=function(e){if(!y||"object"!=typeof e||null===e)return!1;try{return"number"==typeof y(e)}catch(e){return!1}};function ua(e,t,l){0!==e.length&&We(e,e=>{e.call(a,t,l,Fe)})}const ma=function(e){if(ua(R.beforeSanitizeElements,e,null),ra(e))return Qt(e),!0;const t=Ke(w?w(e):e.nodeName);if(ua(R.uponSanitizeElement,e,{tagName:t,allowedTags:H}),function(e,t){return!!(oe&&e.hasChildNodes()&&!ca(e.firstElementChild)&&ut(zt,e.textContent)&&ut(zt,e.innerHTML))||!(!oe||e.namespaceURI!==qe||"style"!==t||!ca(e.firstElementChild))||e.nodeType===Gt||!(!oe||e.nodeType!==Wt||!ut(Mt,e.data))}(e,t))return Qt(e),!0;if(J[t]||!(ee.tagCheck instanceof Function&&ee.tagCheck(t))&&!H[t])return function(e,t){if(!J[t]&&ba(t)){if(Z.tagNameCheck instanceof RegExp&&ut(Z.tagNameCheck,t))return!1;if(Z.tagNameCheck instanceof Function&&Z.tagNameCheck(t))return!1}if(ge&&!_e[t]){const t=k(e),a=h(e);if(a&&t)for(let l=a.length-1;l>=0;--l){const n=he?a[l]:b(a[l],!0);t.insertBefore(n,g(e))}}return Qt(e),!0}(e,t);if((y?y(e):e.nodeType)===Kt&&!Jt(e))return Qt(e),!0;if(("noscript"===t||"noembed"===t||"noframes"===t)&&ut(Ut,e.innerHTML))return Qt(e),!0;if(ie&&e.nodeType===Ft){const t=ia(e.textContent);e.textContent!==t&&(Ye(a.removed,{element:e.cloneNode()}),e.textContent=t)}return ua(R.afterSanitizeElements,e,null),!1},pa=function(e,t,a){if(Q[t])return!1;if(de&&("id"===t||"name"===t)&&(a in l||a in Ge))return!1;const n=Y[t]||ee.attributeCheck instanceof Function&&ee.attributeCheck(t,e);if(ae&&ut(U,t));else if(te&&ut(j,t));else if(n)if(Ae[t]);else if(ut(W,tt(a,F,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==at(a,"data:")||!ye[e]){if(le&&!ut(K,tt(a,F,"")));else if(a)return!1}else;else if(!(ba(e)&&(Z.tagNameCheck instanceof RegExp&&ut(Z.tagNameCheck,e)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(e))&&(Z.attributeNameCheck instanceof RegExp&&ut(Z.attributeNameCheck,t)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(t,e))||"is"===t&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&ut(Z.tagNameCheck,a)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(a))))return!1;return!0},da=bt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ba=function(e){return!da[Je(e)]&&ut(G,e)},fa=function(e,t,a,l){if(A&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!a)switch(p.getAttributeType(e,t)){case"TrustedHTML":return T(l);case"TrustedScriptURL":return function(e){E(),q++;try{return A.createScriptURL(e)}finally{q--}}(l)}return l},ga=function(e,t,l,n){try{l?e.setAttributeNS(l,t,n):e.setAttribute(t,n),ra(e)?Qt(e):$e(a.removed)}catch(a){ta(t,e)}},ha=function(e){ua(R.beforeSanitizeAttributes,e,null);const t=e.attributes;if(!t||ra(e))return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let l=t.length;const n=Ke(e.nodeName);for(;l--;){const i=t[l],o=i.name,r=i.namespaceURI,s=i.value,c=Ke(o),u=s;let m="value"===o?u:lt(u);a.attrName=c,a.attrValue=m,a.keepAttr=!0,a.forceKeepAttr=void 0,ua(R.uponSanitizeAttribute,e,a),m=a.attrValue,!be||"id"!==c&&"name"!==c||0===at(m,fe)||(ta(o,e),m=fe+m),oe&&ut(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,m)?ta(o,e):"attributename"===c&&et(m,"href")?ta(o,e):a.forceKeepAttr||(a.keepAttr&&(ne||!ut(jt,m))?(ie&&(m=ia(m)),pa(n,c,m)?(m=fa(n,c,r,m),m!==u&&ga(e,o,r,m)):ta(o,e)):ta(o,e))}ua(R.afterSanitizeAttributes,e,null)},ka=function(e){let t=null;const a=na(e);for(ua(R.beforeSanitizeShadowDOM,e,null);t=a.nextNode();){ua(R.uponSanitizeShadowNode,t,null),ma(t),ha(t),sa(t.content)&&ka(t.content);if((y?y(t):t.nodeType)===Kt){const e=_(t);sa(e)&&(_a(e),ka(e))}}ua(R.afterSanitizeShadowDOM,e,null)},_a=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){ka(e.shadow);continue}const a=e.node,l=(y?y(a):a.nodeType)===Kt,n=h(a);if(n)for(let e=n.length-1;e>=0;--e)t.push({node:n[e],shadow:null});if(l){const e=w?w(a):null;if("string"==typeof e&&"template"===Ke(e)){const e=a.content;sa(e)&&t.push({node:e,shadow:null})}}if(l){const e=_(a);sa(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return a.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=null,i=null,o=null,r=null;if(Te=!e,Te&&(e="\x3c!--\x3e"),"string"!=typeof e&&!ca(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return nt(e);case"boolean":return it(e);case"bigint":return ot?ot(e):"0";case"symbol":return rt?rt(e):"Symbol()";case"undefined":default:return ct(e);case"function":case"object":{if(null===e)return ct(e);const t=e,a=ht(t,"toString");if("function"==typeof a){const e=a(t);return"string"==typeof e?e:ct(e)}return ct(e)}}}(e)))throw mt("dirty is not a string, aborting");if(!a.isSupported)return e;se||dt(t),a.removed=[];const s=he&&"string"!=typeof e&&ca(e);if(s){const t=w?w(e):e.nodeName;if("string"==typeof t){const e=Ke(t);if(!H[e]||J[e])throw mt("root node is forbidden and cannot be sanitized in-place")}if(ra(e))throw mt("root node is clobbered and cannot be sanitized in-place");try{_a(e)}catch(t){throw ea(e),t}}else if(ca(e))l=la("\x3c!----\x3e"),i=l.ownerDocument.importNode(e,!0),i.nodeType===Kt&&"BODY"===i.nodeName||"HTML"===i.nodeName?l=i:l.appendChild(i),_a(i);else{if(!ue&&!ie&&!re&&-1===e.indexOf("<"))return A&&pe?T(e):e;if(l=la(e),!l)return ue?null:pe?S:""}l&&ce&&Qt(l.firstChild);const c=na(s?e:l);try{for(;o=c.nextNode();)ma(o),ha(o),sa(o.content)&&ka(o.content)}catch(t){throw s&&ea(e),t}if(s)return We(a.removed,e=>{e.element&&function(e){const t=[e];for(;t.length>0;){const e=t.pop();(y?y(e):e.nodeType)===Kt&&aa(e);const a=h(e);if(a)for(let e=a.length-1;e>=0;--e)t.push(a[e])}}(e.element)}),ie&&oa(e),e;if(ue){if(ie&&oa(l),me)for(r=B.call(l.ownerDocument);l.firstChild;)r.appendChild(l.firstChild);else r=l;return(Y.shadowroot||Y.shadowrootmode)&&(r=V.call(n,r,!0)),r}let u=re?l.outerHTML:l.innerHTML;return re&&H["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&ut(Rt,l.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+l.ownerDocument.doctype.name+">\n"+u),ie&&(u=ia(u)),A&&pe?T(u):u},a.setConfig=function(){dt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),se=!0},a.clearConfig=function(){Fe=null,se=!1,A=I,S=""},a.isValidAttribute=function(e,t,a){Fe||dt({});const l=Ke(e),n=Ke(t);return pa(l,n,a)},a.addHook=function(e,t){"function"==typeof t&&Ye(R[e],t)},a.removeHook=function(e,t){if(void 0!==t){const a=He(R[e],t);return-1===a?void 0:Xe(R[e],a,1)[0]}return $e(R[e])},a.removeHooks=function(e){R[e]=[]},a.removeAllHooks=function(){R={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},a}();class Jt extends ye.Component{constructor(){super(...arguments),this.state={screen:v(),imageId:"",externalImageIsSet:!1,imageSizeNotExist:!1}}getScreenLabelSuffix(){return J(this.state.screen)}getAttributeValue(e=this.getScreenLabelSuffix()){const{blockAttributeKey:t,blockAttributes:a,allowScreens:l,repeater:n,repeaterItemIndex:i,repeaterItemKey:o,isSimpleRepeaterValue:r,repeaterGetAttributes:s}=this.props;let c=t;l&&e&&(c=t+e);let u=a[c];if(n){let a=r?null:t;l&&e&&(a=r?this.state.screen:c),u=s({key:o,childKey:a},i)||{}}return ne(u)}setAttributeValue(e){const{blockAttributeKey:t,setAttributes:a,allowScreens:l,repeater:n,repeaterItemIndex:i,repeaterItemKey:o,isSimpleRepeaterValue:r,repeaterSetAttributes:s}=this.props,c=this.getScreenLabelSuffix();let u=t;if(l&&c&&(u=t+c),n){let a=r?null:t;l&&c&&(a=r?this.state.screen:u),s({key:o,childKey:a},e,i)}else a({[u]:e})}componentDidMount(){const{allowScreens:e,allowDefaultImage:t}=this.props,{url:a,id:l,defaultValueIsSet:n}=this.getAttributeValue("");if(a&&!a.includes(qiBlocksEditor.vars.siteURL))this.onSelectURL(a),this.setState({externalImageIsSet:!0});else{l&&(this.setState({imageId:l}),this.updateImageSizeOption(l)),!t||n||a||l||(this.setAttributeValue({id:null,url:qiBlocksEditor.vars.defaultImage,alt:qiBlocksEditor.vars.defaultImagePlaceholder,caption:"",width:1200,height:800,custom_image_size:"",html:""}),this.setState({defaultImageIsSet:!0}));const i=[""];e&&(i.push("Tablet"),i.push("Mobile")),i.map(e=>{const{url:t,id:a}=this.getAttributeValue(e);t&&(0,Oe.isBlobURL)(t)&&!a&&this.setAttributeValue({url:"",alt:"",caption:"",width:"",height:"",html:""})})}}setSVGIcon=(e,t,a,l)=>{const n=new XMLHttpRequest;null!=n&&(n.open("GET",t,!0),n.onreadystatechange=()=>{4===n.readyState&&200===n.status&&this.setAttributeValue({id:e,url:t,alt:a,caption:l,html:Zt.sanitize(n.responseText,{USE_PROFILES:{svg:!0,svgFilters:!0}})})},n.send())};onSelectImage=({id:e,url:t,alt:a,caption:l,width:n,height:i})=>{t.includes(".svg")?this.setSVGIcon(e,t,a,l):this.setAttributeValue({id:e,url:t,alt:a,caption:l,width:n,height:i}),this.setState({imageId:e,externalImageIsSet:!1}),this.updateImageSizeOption(e)};updateImageSizeOption=e=>{if(this.props.allowImageSizes){const t=setInterval(()=>{re(e)&&(clearInterval(t),this.forceUpdate())},1e3)}};onSelectURL=e=>{e.includes(".svg")?this.setSVGIcon(null,e,"",""):this.setAttributeValue({id:null,url:e,alt:"",caption:"",width:"",height:"",html:""}),this.setState({externalImageIsSet:!1})};onUploadError=e=>{const{noticeOperations:t}=this.props;t.createErrorNotice(e)};removeImage=()=>{this.setAttributeValue({id:null,url:"",alt:"",caption:"",width:"",height:"",html:"",defaultValueIsSet:!!this.props.allowDefaultImage})};onImageSizeChange=e=>{const{customImageSizes:t}=this.props,a=re(this.state.imageId);if(a){let l=e;t&&t.length>1&&(l=this.getImageURLbySize(e)||a.source_url),"custom"===e&&(l=a.source_url),this.setAttributeValue({id:a.id,url:l,alt:a.alt_text||"",caption:a.caption&&a.caption.raw||"",custom_image_size:e})}};getImageURLbySize(e){const t=this.getAttributeValue();let a="";if(t){const l=re(t.id);if(!l)return"";const n=l.media_details.sizes;if(n&&0===Object.keys(n).length)this.setState({imageSizeNotExist:!0});else{this.setState({imageSizeNotExist:!1});for(const t in n)if(t.includes("qi_blocks_image_size_"+e.replace("-","_"))){a=n[t].source_url;break}}["","custom"].includes(e)&&this.setState({imageSizeNotExist:!1})}return a}getImageSizes(){const{imageSizes:t,customImageSizes:a}=this.props,l=this.getAttributeValue();let n=[];if(l){const i=re(l.id);if(!i)return[];const o=i.media_details.sizes;if(o&&0===Object.keys(o).length&&n.push({label:(0,e.__)("Default","qi-blocks"),value:""}),a&&a.length>1)a.map(e=>{n.push({label:e.label,value:e.value})});else for(const e in o){const a=o[e],l=t.find(t=>t.slug===e);l&&n.push({label:l.name,value:a.source_url})}}return n}render(){const t={...this.props},a={...this.state},{label:l,help:n,noticeUI:i,allowedTypes:o,allowScreens:r,allowImageSizes:s}=t,c=this.getAttributeValue(),{id:u,url:m,alt:p,html:d}=c;t.onChangeScreen=e=>{this.setState({screen:e}),this.updateImageSizeOption(u)};let b=["qodef-image-option"];return m&&m.includes(".svg")&&b.push("qodef--svg"),wp.element.createElement(y.BaseControl,{className:b.join(" ")},wp.element.createElement("div",{className:"qodef-advanced-select-heading"},r?wp.element.createElement(qe,{label:l,onChangeScreen:t.onChangeScreen}):wp.element.createElement(wp.element.Fragment,null,l&&wp.element.createElement("label",{className:"qodef-option-label"},l))),n&&wp.element.createElement("p",{className:"qodef-option-description"},n),m?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"qodef-image-option-inner"},(0,Oe.isBlobURL)(m)&&wp.element.createElement("div",{className:"qodef-image-option-spinner"},wp.element.createElement(y.Spinner,null)),wp.element.createElement(_e.MediaUploadCheck,null,wp.element.createElement(_e.MediaUpload,{allowedTypes:o,value:u,onSelect:this.onSelectImage,render:({open:t})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("img",{src:m,alt:p}),wp.element.createElement("div",{className:"qodef-image-option-actions"},wp.element.createElement(y.Button,{icon:"edit",showTooltip:!0,label:(0,e.__)("Edit Image","qi-blocks"),onClick:t}),wp.element.createElement(y.Button,{icon:"trash",showTooltip:!0,label:(0,e.__)("Remove Image","qi-blocks"),onClick:this.removeImage})))}))),a.imageSizeNotExist&&wp.element.createElement("p",{className:"qodef-image-notice"},(0,e.__)("The Image has no predefined sizes, please set a custom image size.","qi-blocks")),a.externalImageIsSet&&wp.element.createElement("p",{className:"qodef-image-notice"},(0,e.__)("External image URL is set, please upload your image for this Element.","qi-blocks"))):wp.element.createElement(_e.MediaPlaceholder,{allowedTypes:o,icon:"format-image",onSelect:this.onSelectImage,onSelectURL:this.onSelectURL,onError:this.onUploadError,notices:i}),s&&u&&!d&&wp.element.createElement("div",{className:"qodef-image-option-sizes"},wp.element.createElement(y.SelectControl,{label:(0,e.__)("Image Size","qi-blocks"),options:this.getImageSizes(),onChange:this.onImageSizeChange,value:void 0!==c.custom_image_size?c.custom_image_size:m})))}}Jt.defaultProps={label:(0,e.__)("Image","qi-blocks"),help:"",blockAttributeKey:"",blockAttributes:{},setAttributes:()=>{},allowedTypes:["image"],allowScreens:!1,allowDefaultImage:!1,allowImageSizes:!1,customImageSizes:[],repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",isSimpleRepeaterValue:!0,repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const Qt=(0,o.withSelect)(e=>({imageSizes:e("core/block-editor")?.getSettings()?.imageSizes}))((0,y.withNotices)(Jt));class ea extends ye.Component{constructor(){super(...arguments),this.state={isPickerVisible:!1}}getAttributeValue(){const{defaultColor:e,blockAttributeKey:t,blockAttributes:a,repeater:l,repeaterItemIndex:n,repeaterItemKey:i,isSimpleRepeaterValue:o,repeaterGetAttributes:r}=this.props;let s=a[t];return l&&(s=r({key:i,childKey:o?"":t},n)),s||e}setAttributeValue(e){const{blockAttributeKey:t,setAttributes:a,repeater:l,repeaterItemIndex:n,repeaterItemKey:i,isSimpleRepeaterValue:o,repeaterSetAttributes:r}=this.props;l?r({key:i,childKey:o?"":t},e,n):a({[t]:e})}onChange=e=>{const{r:t,g:a,b:l,a:n}=e.rgb;let i="rgba("+[t,a,l,n].join(",")+")";this.props.setHEXValue&&(i=e.hex),this.setState({colorReset:!0}),this.setAttributeValue(i)};onClick=e=>{e.preventDefault();const t=this;t.setState({isPickerVisible:!this.state.isPickerVisible}),window.addEventListener("click",e=>{const a=document.querySelectorAll(".qodef-color-option.qodef--opened");a.length&&a.forEach(a=>{a.contains(e.target)||t.setState({isPickerVisible:!1})})})};onResetColor=e=>{e.preventDefault(),this.setState({isPickerVisible:!this.state.isPickerVisible}),this.setAttributeValue("")};render(){const{label:t,popup:a}=this.props;return wp.element.createElement(y.BaseControl,{className:"qodef-color-option "+(this.state.isPickerVisible?"qodef--opened":"")},wp.element.createElement("div",{className:"qodef-control-heading"},t&&wp.element.createElement("label",{className:"qodef-option-label"},t),wp.element.createElement(y.Button,{onClick:this.onClick,className:"qodef-color-indicator-button"},wp.element.createElement(y.ColorIndicator,{colorValue:this.getAttributeValue(),className:"qodef-color-indicator"}))),this.state.isPickerVisible&&wp.element.createElement("div",{className:`qodef-color-picker-wrapper ${a&&"qodef--popup"}`},wp.element.createElement(y.ColorPicker,{color:this.getAttributeValue(),onChangeComplete:this.onChange,disableAlpha:this.props.setHEXValue}),wp.element.createElement(y.Button,{onClick:this.onResetColor,isSecondary:!0},(0,e.__)("Reset Color","qi-blocks"))))}}ea.defaultProps={label:(0,e.__)("Color","qi-blocks"),defaultColor:"#000",setHEXValue:!1,blockAttributeKey:"",blockAttributes:{},setAttributes:()=>{},popup:!0,repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",isSimpleRepeaterValue:!1,repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const ta=ea;class aa extends ye.Component{getAttributeValue(){const{blockAttributeKey:e,blockAttributes:t,repeater:a,repeaterItemIndex:l,repeaterItemKey:n,repeaterGetAttributes:i}=this.props;let o=t[e];return a&&(o=i({key:n},l)||{}),ne(o)}setAttributeValue(e){const{blockAttributeKey:t,setAttributes:a,repeater:l,repeaterItemIndex:n,repeaterItemKey:i,repeaterSetAttributes:o}=this.props;l?o({key:i},e,n):a({[t]:e})}componentDidMount(){const{url:e,id:t}=this.getAttributeValue();e&&(0,Oe.isBlobURL)(e)&&!t&&this.setAttributeValue({url:"",alt:""})}onSelectVideo=({id:e,url:t,alt:a})=>{this.setAttributeValue({id:e,url:t,alt:a})};onSelectURL=e=>{this.setAttributeValue({id:null,url:e,alt:""})};onUploadError=e=>{const{noticeOperations:t}=this.props;t.createErrorNotice(e)};removeVideo=()=>{this.setAttributeValue({id:null,url:"",alt:""})};render(){const t={...this.props},{label:a,description:l,noticeUI:n}=t,{id:i,url:o}=this.getAttributeValue();return wp.element.createElement(y.BaseControl,{className:"qodef-video-option"},a&&wp.element.createElement("label",{className:"qodef-option-label"},a),l&&wp.element.createElement("p",{className:"qodef-option-description"},l),o?wp.element.createElement("div",{className:"qodef-video-option-inner"},(0,Oe.isBlobURL)(o)&&wp.element.createElement("div",{className:"qodef-video-option-spinner"},wp.element.createElement(y.Spinner,null)),wp.element.createElement(_e.MediaUploadCheck,null,wp.element.createElement(_e.MediaUpload,{allowedTypes:["video"],value:i,onSelect:this.onSelectVideo,render:({open:t})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("video",{src:o}),wp.element.createElement("div",{className:"qodef-video-option-actions"},wp.element.createElement(y.Button,{icon:"edit",showTooltip:!0,label:(0,e.__)("Edit Video","qi-blocks"),onClick:t}),wp.element.createElement(y.Button,{icon:"trash",showTooltip:!0,label:(0,e.__)("Remove Video","qi-blocks"),onClick:this.removeVideo})))}))):wp.element.createElement(_e.MediaPlaceholder,{allowedTypes:["video"],icon:"format-video",onSelect:this.onSelectVideo,onSelectURL:this.onSelectURL,onError:this.onUploadError,notices:n}))}}aa.defaultProps={label:(0,e.__)("Video","qi-blocks"),description:"",blockAttributeKey:"",blockAttributes:{},setAttributes:()=>{},repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const la=(0,y.withNotices)(aa),na=qiBlocksEditor.vars.defaultFontSize,ia=qiBlocksEditor.vars.defaultLineHeight,oa=e=>{const{convertorType:t,value:a,attributeKey:l}=e;let n=1;l.includes("FontSize")||l.includes("fontSize")?n=na:(l.includes("LineHeight")||l.includes("lineHeight"))&&(n=ia);const i=e=>Math.round(parseInt(e,10)/n*100)/100,o=e=>Math.round(parseInt(e,10)/n*100)/100,r=e=>Math.round(parseFloat(e)/n*100),s=e=>Math.round(100*parseInt(e,10)/window.innerWidth),c=e=>Math.round(100*parseInt(e,10)/window.innerHeight),u=e=>Math.round(parseFloat(e)*n),m=e=>Math.round(parseFloat(e)*n/100),p=e=>Math.round(window.innerWidth*parseInt(e,10)/100),d=e=>Math.round(window.innerHeight*parseInt(e,10)/100);let b="";if(""!==a&&""!==l&&""!==t)switch(t){case"pxToEm":b=i(a);break;case"pxToRem":b=o(a);break;case"pxToP":b=r(a);break;case"pxToVw":b=s(a);break;case"pxToVh":b=c(a);break;case"emToPx":b=u(a);break;case"emToRem":case"remToRem":case"vwToVh":case"vhToVw":b=a;break;case"emToP":case"remToP":b=(e=>100*parseFloat(e))(a);break;case"emToVw":case"remToVw":b=(e=>s(u(e)))(a);break;case"emToVh":case"remToVh":b=(e=>c(u(e)))(a);break;case"remToPx":b=(e=>Math.round(parseFloat(e)*n))(a);break;case"pToPx":b=m(a);break;case"pToEm":case"pToRem":b=(e=>parseFloat(e)/100)(a);break;case"pToVw":b=(e=>s(m(e)))(a);break;case"pToVh":b=(e=>c(m(e)))(a);break;case"vwToPx":b=p(a);break;case"vwToEm":b=(e=>i(p(e)))(a);break;case"vwToRem":b=(e=>o(p(e)))(a);break;case"vwToP":b=(e=>r(p(e)))(a);break;case"vhToPx":b=d(a);break;case"vhToEm":b=(e=>i(d(e)))(a);break;case"vhToRem":b=(e=>o(d(e)))(a);break;case"vhToP":b=(e=>r(d(e)))(a)}return b};oa.defaultProps={convertorType:"pxToEm"};const ra=oa;class sa extends ye.Component{constructor(){super(...arguments),this.state={screen:v()}}getScreenLabelSuffix(e){const t=e||this.state.screen;return J(t)}getAttributeValue(e,t=""){const{blockAttributes:a,allowScreens:l,repeater:n,repeaterItemIndex:i,repeaterItemKey:o,repeaterGetAttributes:r}=this.props;let s=e;l&&t&&(s=e+t);let c=a[s];return n&&(c=r({key:o,childKey:s},i)),ne(c)}setAttributeValue(e,t,a=this.getScreenLabelSuffix()){const{setAttributes:l,allowScreens:n,repeater:i,repeaterItemIndex:o,repeaterItemKey:r,repeaterSetAttributes:s}=this.props;let c=e;n&&a&&(c=e+a),i?s({key:r,childKey:c},t,o):l({[c]:t})}onChangeUnitsValues(e,t,a,l){const n={...this.props},{rangeMax:i,rangeDecimalMax:o,allowUnitsConvertor:r}=n;let s=this.getAttributeValue(t);const c=s;l?(s=parseInt(s,10),s>i&&(s=i)):!l&&s>o&&(s=o),r?["emToRem","remToEm","vwToVh","vhToVw"].includes(a)||(this.setAttributeValue(e,ra({convertorType:a,value:c,attributeKey:t}),""),this.setAttributeValue(t,"","")):(this.setAttributeValue(e,s,""),this.setAttributeValue(t,"",""))}render(){const e={...this.props},{label:t,unitType:a,blockAttributeKey:l,rangeMax:n,rangeMin:i,rangeStep:o,rangeDecimalMax:r,rangeDecimalMin:s,rangeDecimalStep:c,optionType:u,allowReset:m,allowScreens:p,allowUnits:d,repeater:b,repeaterItemKey:f,isSimpleRepeaterValue:g}=e,h=this.getScreenLabelSuffix();let k=b&&!g?f:l;const _=`${k}Decimal`,v=`${k}Unit`,w=`${k}Tablet`,A=`${_}Tablet`,I=`${v}Tablet`,S=`${k}Mobile`,x=`${_}Mobile`,q=`${v}Mobile`;return e.onChangeScreen=e=>{this.setState({screen:e})},e.onChangeUnit=e=>{e.preventDefault();const t=b?200:0,a=e.target.getAttribute("data-unit"),l=this.getAttributeValue(v,h)||"px";this.setAttributeValue(v,a),setTimeout(()=>{if(a!==l){const e=`${l}To${Z(a)}`;let t=k+h,n=_+h;"px"!==a&&(t=_+h,n=k+h),this.onChangeUnitsValues(t,n,e,"px"===a)}},t)},e.onChange=t=>{this.setAttributeValue(k,t),e.setCustomEventOnChange()},e.onChangeDecimal=t=>{let a=0;"decimal"===u&&void 0===t&&(a=200),setTimeout(()=>{this.setAttributeValue(_,t),e.setCustomEventOnChange()},a)},e.getPlaceholderValue=e=>{let t="";const a=this.getAttributeValue(k),l=this.getAttributeValue(_),n=this.getAttributeValue(w),i=this.getAttributeValue(A);return"Tablet"===h?e&&""===n?t=a:e||""!==i||(t=l):"Mobile"===h&&(e&&""===this.getAttributeValue(S)?t=""!==n?n:a:e||""!==this.getAttributeValue(x)||(t=""!==i?i:l)),t},wp.element.createElement(y.BaseControl,{className:"qodef-advanced-range-option"},wp.element.createElement("div",{className:"qodef-advanced-range-heading"},p?wp.element.createElement(qe,{label:t,onChangeScreen:e.onChangeScreen}):wp.element.createElement("label",{className:"qodef-option-label"},t),d&&wp.element.createElement(Se,{unitType:a,unitValue:this.getAttributeValue(v,h),onChangeUnit:e.onChangeUnit})),"desktop"===this.state.screen&&wp.element.createElement(wp.element.Fragment,null,(ee(this.getAttributeValue(v))&&"decimal"!==u||!d&&"integer"===u)&&wp.element.createElement(y.RangeControl,{min:i,max:n,step:o,value:this.getAttributeValue(k),onChange:e.onChange,allowReset:m}),(te(this.getAttributeValue(v))||!d&&"decimal"===u)&&wp.element.createElement(y.RangeControl,{min:s,max:r,step:c,value:this.getAttributeValue(_),onChange:e.onChangeDecimal,allowReset:m})),"tablet"===this.state.screen&&wp.element.createElement(wp.element.Fragment,null,(ee(this.getAttributeValue(I))&&"decimal"!==u||!d&&"integer"===u)&&wp.element.createElement(y.RangeControl,{min:i,max:n,step:o,value:this.getAttributeValue(w),afterIcon:e.getPlaceholderValue(!0),onChange:e.onChange,allowReset:m}),(te(this.getAttributeValue(I))||!d&&"decimal"===u)&&wp.element.createElement(y.RangeControl,{min:s,max:r,step:c,value:this.getAttributeValue(A),afterIcon:e.getPlaceholderValue(!1),onChange:e.onChangeDecimal,allowReset:m})),"mobile"===this.state.screen&&wp.element.createElement(wp.element.Fragment,null,(ee(this.getAttributeValue(q))&&"decimal"!==u||!d&&"integer"===u)&&wp.element.createElement(y.RangeControl,{min:i,max:n,step:o,value:this.getAttributeValue(S),afterIcon:e.getPlaceholderValue(!0),onChange:e.onChange,allowReset:m}),(te(this.getAttributeValue(q))||!d&&"decimal"===u)&&wp.element.createElement(y.RangeControl,{min:s,max:r,step:c,value:this.getAttributeValue(x),afterIcon:e.getPlaceholderValue(!1),onChange:e.onChangeDecimal,allowReset:m})))}}sa.defaultProps={label:(0,e.__)("Default Label Text","qi-blocks"),unitType:"typography",blockAttributes:{},blockAttributeKey:"",setAttributes:()=>{},rangeMax:300,rangeMin:0,rangeStep:1,rangeDecimalMax:10,rangeDecimalMin:0,rangeDecimalStep:.01,optionType:"integer",allowReset:!0,screens:k,allowScreens:!1,allowUnits:!0,allowUnitsConvertor:!1,setCustomEventOnChange:()=>{},repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",isSimpleRepeaterValue:!1,repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const ca=sa,ua=t=>{const a={...t},{attrNameTemplate:l,attrName:n,blockAttributes:i,setAttributes:o,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m,previewScreen:p}=a,d=n||"Background",b=e=>X(l,d+e);a.getAttributeValue=(e,t="")=>{let a=e;t&&(a=e+t);let l=i[a];return r&&(l=m({key:c,childKey:a},s)),ne(l)},a.setAttributeValue=(e,t,a="")=>{let l=e;a&&(l=e+a),r?u({key:c,childKey:l},t,s):o({[l]:t})};let f=J(p||v());return wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Qt,{label:(0,e.__)(`${d} Image`,"qi-blocks"),blockAttributeKey:b("Image"),blockAttributes:i,setAttributes:o,allowScreens:!0,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,isSimpleRepeaterValue:!1,repeaterSetAttributes:u,repeaterGetAttributes:m}),a.getAttributeValue(b("Image"))&&a.getAttributeValue(b("Image")).url&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Ne,{label:(0,e.__)(`${d} Position`,"qi-blocks"),blockAttributeKey:b("Position"),blockAttributes:i,setAttributes:o,selectOptions:ie("background_position",!0,[{value:"custom",label:(0,e.__)("Custom","qi-blocks")}]),repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),(""===f&&"custom"===a.getAttributeValue(b("Position"))||""!==f&&"custom"===a.getAttributeValue(b("Position"),f)||""!==f&&"custom"===a.getAttributeValue(b("Position"))&&["","custom"].includes(a.getAttributeValue(b("Position"),"Tablet"))&&""===a.getAttributeValue(b("Position"),f))&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(ca,{label:(0,e.__)("X Position","qi-blocks"),blockAttributeKey:b("XPosition"),setAttributes:o,blockAttributes:i,rangeMax:800,rangeMin:-800,rangeDecimalMax:100,rangeDecimalMin:-100,unitType:"xPosition",allowScreens:!0,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(ca,{label:(0,e.__)("Y Position","qi-blocks"),blockAttributeKey:b("YPosition"),setAttributes:o,blockAttributes:i,rangeMax:800,rangeMin:-800,rangeDecimalMax:100,rangeDecimalMin:-100,unitType:"yPosition",allowScreens:!0,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m})),wp.element.createElement(y.SelectControl,{label:(0,e.__)(`${d} Attachment`,"qi-blocks"),value:a.getAttributeValue(b("Attachment")),options:ie("background_attachment")||"",onChange:e=>a.setAttributeValue(b("Attachment"),e)}),wp.element.createElement(Ne,{label:(0,e.__)(`${d} Repeat`,"qi-blocks"),blockAttributeKey:b("Repeat"),blockAttributes:i,setAttributes:o,selectOptions:ie("background_repeat"),repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(Ne,{label:(0,e.__)(`${d} Size`,"qi-blocks"),blockAttributeKey:b("Size"),blockAttributes:i,setAttributes:o,selectOptions:ie("background_size",!0,[{value:"custom",label:(0,e.__)("Custom","qi-blocks")}]),repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),"custom"===a.getAttributeValue(b("Size"),f)&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(ca,{label:(0,e.__)("Custom Width","qi-blocks"),blockAttributeKey:b("SizeWidth"),setAttributes:o,blockAttributes:i,rangeMax:1e3,rangeMin:0,rangeDecimalMax:100,rangeDecimalMin:0,unitType:"xPosition",allowScreens:!0,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}))))};ua.defaultProps={attrNameTemplate:"",attrName:"Background",blockAttributes:{},setAttributes:()=>{},repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{},previewScreen:""};const ma=ua,pa=t=>{const a={...t},{attrNameTemplate:l,blockAttributes:n,setAttributes:i,includeVideoBG:o,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m,previewScreen:p}=a,d=e=>X(l,e);a.getAttributeValue=(e,t="")=>{let a=n[e];if(r){let l=e;t&&(l=e+t),a=m({key:c,childKey:l},s)}return ne(a)},a.setAttributeValue=(e,t,a="")=>{if(r){let l=e;a&&(l=e+a),u({key:c,childKey:l},t,s)}else i({[e+a]:t})};const b=[{label:(0,e.__)("Classic","qi-blocks"),value:""},{label:(0,e.__)("Gradient","qi-blocks"),value:"gradient"}];return o&&b.push({label:(0,e.__)("Video","qi-blocks"),value:"video"}),wp.element.createElement("div",{className:"qodef-background-panel"},wp.element.createElement(y.SelectControl,{label:(0,e.__)("Background Type","qi-blocks"),value:a.getAttributeValue(d("BackgroundType")),options:b,onChange:e=>a.setAttributeValue(d("BackgroundType"),e)}),""===a.getAttributeValue(d("BackgroundType"))&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(ta,{label:(0,e.__)("Background Color","qi-blocks"),blockAttributeKey:d("BackgroundColor"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(ma,{attrNameTemplate:l,blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m,previewScreen:p})),"gradient"===a.getAttributeValue(d("BackgroundType"))&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(ta,{label:(0,e.__)("First Color","qi-blocks"),blockAttributeKey:d("BackgroundGradientColor1"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(y.RangeControl,{label:(0,e.__)("Location","qi-blocks"),value:a.getAttributeValue(d("BackgroundGradientLocation1")),onChange:e=>a.setAttributeValue(d("BackgroundGradientLocation1"),e),min:0,max:100,step:1}),wp.element.createElement(ta,{label:(0,e.__)("Second Color","qi-blocks"),blockAttributeKey:d("BackgroundGradientColor2"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(y.RangeControl,{label:(0,e.__)("Location","qi-blocks"),value:a.getAttributeValue(d("BackgroundGradientLocation2")),onChange:e=>a.setAttributeValue(d("BackgroundGradientLocation2"),e),min:0,max:100,step:1}),wp.element.createElement(y.SelectControl,{label:(0,e.__)("Gradient Type","qi-blocks"),value:a.getAttributeValue(d("BackgroundGradientType")),options:[{label:(0,e.__)("Linear","qi-blocks"),value:"linear"},{label:(0,e.__)("Radial","qi-blocks"),value:"radial"}],onChange:e=>a.setAttributeValue(d("BackgroundGradientType"),e)}),"linear"===a.getAttributeValue(d("BackgroundGradientType"))&&wp.element.createElement(y.RangeControl,{label:(0,e.__)("Angle","qi-blocks"),value:a.getAttributeValue(d("BackgroundGradientTypeAngle")),onChange:e=>a.setAttributeValue(d("BackgroundGradientTypeAngle"),e),min:0,max:360,step:1}),"radial"===a.getAttributeValue(d("BackgroundGradientType"))&&wp.element.createElement(y.SelectControl,{label:(0,e.__)("Position","qi-blocks"),value:a.getAttributeValue(d("BackgroundGradientTypePosition")),options:ie("background_position",!1),onChange:e=>a.setAttributeValue(d("BackgroundGradientTypePosition"),e)})),"video"===a.getAttributeValue(d("BackgroundType"))&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(la,{label:(0,e.__)("Video Link","qi-blocks"),description:(0,e.__)("Self hosted video file (mp4 is recommended)","qi-blocks"),blockAttributeKey:d("BackgroundVideoLink"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(y.TextControl,{type:"number",label:(0,e.__)("Start Time","qi-blocks"),help:(0,e.__)("Specify a start time (in seconds)","qi-blocks"),value:a.getAttributeValue(d("BackgroundVideoStartTime")),onChange:e=>a.setAttributeValue(d("BackgroundVideoStartTime"),ae(e))}),wp.element.createElement(y.TextControl,{type:"number",label:(0,e.__)("End Time","qi-blocks"),help:(0,e.__)("Specify an end time (in seconds)","qi-blocks"),value:a.getAttributeValue(d("BackgroundVideoEndTime")),onChange:e=>a.setAttributeValue(d("BackgroundVideoEndTime"),ae(e))}),wp.element.createElement(A,{label:(0,e.__)("Play Once","qi-blocks"),blockAttributeKey:d("BackgroundVideoPlayOnce"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(A,{label:(0,e.__)("Play On Mobile","qi-blocks"),blockAttributeKey:d("BackgroundVideoPlayOnMobile"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),wp.element.createElement(Qt,{label:(0,e.__)("Background Fallback","qi-blocks"),blockAttributeKey:d("BackgroundVideoFallbackImage"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m})))};pa.defaultProps={attrNameTemplate:"",blockAttributes:{},setAttributes:()=>{},includeVideoBG:!1,repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{},previewScreen:""};const da=pa,ba=t=>{const a={...t},{attrNameTemplate:l,blockAttributes:n,setAttributes:i,disableWidthDirections:o,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}=a,p=e=>X(l,e);return a.getAttributeValue=(e,t="")=>{let a=n[e];if(r){let l=e;t&&(l=e+t),a=m({key:c,childKey:l},s)}return ne(a)},a.setAttributeValue=(e,t,a="")=>{if(r){let l=e;a&&(l=e+a),u({key:c,childKey:l},t,s)}else i({[e+a]:t})},wp.element.createElement("div",{className:"qodef-border-panel"},wp.element.createElement(y.SelectControl,{label:(0,e.__)("Border Type","qi-blocks"),value:a.getAttributeValue(p("BorderStyle")),options:[{label:(0,e.__)("Default","qi-blocks"),value:""},{label:(0,e.__)("None","qi-blocks"),value:"none"},{label:(0,e.__)("Double","qi-blocks"),value:"double"},{label:(0,e.__)("Groove","qi-blocks"),value:"groove"},...ie("border_style",!1)],onChange:e=>a.setAttributeValue(p("BorderStyle"),e)}),!["","none"].includes(n[p("BorderStyle")])&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(Te,{label:(0,e.__)("Border Width","qi-blocks"),attrName:p("BorderWidth"),blockAttributes:n,setAttributes:i,allowUnitControl:!1,disableDirections:o,rangeMax:20,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}),(a.allowBorderColor??!0)&&wp.element.createElement(ta,{label:(0,e.__)("Border Color","qi-blocks"),blockAttributeKey:p("BorderColor"),blockAttributes:n,setAttributes:i,repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m})),(a.allowBorderRadius??!0)&&wp.element.createElement(Te,{label:(0,e.__)("Border Radius","qi-blocks"),attrName:p("BorderRadius"),blockAttributes:n,setAttributes:i,unitType:"pxAndPercent",repeater:r,repeaterItemIndex:s,repeaterItemKey:c,repeaterSetAttributes:u,repeaterGetAttributes:m}))};ba.defaultProps={attrNameTemplate:"",blockAttributes:{},setAttributes:()=>{},allowBorderColor:!0,allowBorderRadius:!0,disableWidthDirections:[],repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const fa=ba,ga=t=>{const a={...t},{attrNameTemplate:l,blockAttributes:n,setAttributes:i,excludeOptions:o}=a,r=e=>X(l,e),[s,c]=(0,ye.useState)(!1);let u=["qodef-box-shadow-panel"];return a.popup&&u.push("qodef--has-popup"),s&&u.push("qodef--opened"),a.onClick=()=>{c(e=>!e),window.addEventListener("click",e=>{const t=document.querySelectorAll(".qodef-box-shadow-panel.qodef--opened");t.length&&t.forEach(t=>{t.contains(e.target)||c(!1)})})},wp.element.createElement("div",{className:u.join(" ")},wp.element.createElement("div",{className:"qodef-box-shadow-panel-heading"},a.label&&wp.element.createElement("label",{className:"qodef-option-label"},a.label),a.popup&&wp.element.createElement(y.Button,{icon:"edit",showTooltip:!0,label:(0,e.__)("Open Panel","qi-blocks"),onClick:a.onClick})),wp.element.createElement("div",{className:"qodef-box-shadow-panel-content"},wp.element.createElement(ta,{label:(0,e.__)("Color","qi-blocks"),blockAttributeKey:r("BoxShadowColor"),blockAttributes:n,setAttributes:i,popup:!1}),wp.element.createElement(y.RangeControl,{label:(0,e.__)("Horizontal","qi-blocks"),value:n[r("BoxShadowHorizontal")],onChange:e=>i({[r("BoxShadowHorizontal")]:e}),min:-100,max:100,step:1,allowReset:!0}),wp.element.createElement(y.RangeControl,{label:(0,e.__)("Vertical","qi-blocks"),value:n[r("BoxShadowVertical")],onChange:e=>i({[r("BoxShadowVertical")]:e}),min:-100,max:100,step:1,allowReset:!0}),wp.element.createElement(y.RangeControl,{label:(0,e.__)("Blur","qi-blocks"),value:n[r("BoxShadowBlur")],onChange:e=>i({[r("BoxShadowBlur")]:e}),min:0,max:100,step:1,allowReset:!0}),wp.element.createElement(y.RangeControl,{label:(0,e.__)("Spread","qi-blocks"),value:n[r("BoxShadowSpread")],onChange:e=>i({[r("BoxShadowSpread")]:e}),min:-100,max:100,step:1,allowReset:!0}),(m="position",!(o&&o.length&&o.includes(m))&&wp.element.createElement(y.SelectControl,{label:(0,e.__)("Position","qi-blocks"),value:n[r("BoxShadowPosition")],options:[{label:(0,e.__)("Outline","qi-blocks"),value:""},{label:(0,e.__)("Inset","qi-blocks"),value:"inset"}],onChange:e=>i({[r("BoxShadowPosition")]:e})}))));var m};ga.defaultProps={label:(0,e.__)("Box Shadow","qi-blocks"),attrNameTemplate:"",blockAttributes:{},setAttributes:()=>{},excludeOptions:[],popup:!1};const ha=ga;class ka extends ye.Component{render(){const{blockAttributes:t,setAttributes:a,excludePanels:l,previewScreen:n,blockName:i}=this.props,o=(e,t="")=>X("",e,t),r=K();l&&l.length&&l.forEach(e=>{r.splice(r.indexOf(e),1)});let s=J(n);return wp.element.createElement("div",{className:"qodef-advanced-panel"},r.includes("advanced")&&wp.element.createElement(y.PanelBody,{title:(0,e.__)("Advanced","qi-blocks")},wp.element.createElement(Te,{label:(0,e.__)("Margin","qi-blocks"),attrName:o("Margin"),blockAttributes:t,setAttributes:a}),wp.element.createElement(Te,{label:(0,e.__)("Padding","qi-blocks"),attrName:o("Padding"),blockAttributes:t,setAttributes:a}),wp.element.createElement(y.TextControl,{type:"number",label:(0,e.__)("Z-Index","qi-blocks"),value:t[o("zIndex")],onChange:e=>a({[o("zIndex")]:ae(e)})}),wp.element.createElement(y.TextControl,{label:(0,e.__)("CSS ID","qi-blocks"),value:t[o("cssId")],onChange:e=>a({[o("cssId")]:e})}),wp.element.createElement(y.TextControl,{label:(0,e.__)("CSS Classes","qi-blocks"),value:t[o("cssClasses")],onChange:e=>a({[o("cssClasses")]:e})})),r.includes("motion-effects")&&wp.element.createElement(y.PanelBody,{title:(0,e.__)("Motion Effects","qi-blocks"),initialOpen:!1},wp.element.createElement(y.SelectControl,{label:(0,e.__)("Entrance Animation","qi-blocks"),value:t[o("EntranceAnimation")],options:[{label:(0,e.__)("None","qi-blocks"),value:""},{label:(0,e.__)("Back In Down","qi-blocks"),value:"backInDown"},{label:(0,e.__)("Back In Left","qi-blocks"),value:"backInLeft"},{label:(0,e.__)("Back In Right","qi-blocks"),value:"backInRight"},{label:(0,e.__)("Back In Up","qi-blocks"),value:"backInUp"},{label:(0,e.__)("Bounce","qi-blocks"),value:"bounce"},{label:(0,e.__)("Bounce In","qi-blocks"),value:"bounceIn"},{label:(0,e.__)("Bounce In Down","qi-blocks"),value:"bounceInDown"},{label:(0,e.__)("Bounce In Left","qi-blocks"),value:"bounceInLeft"},{label:(0,e.__)("Bounce In Right","qi-blocks"),value:"bounceInRight"},{label:(0,e.__)("Bounce In Up","qi-blocks"),value:"bounceInUp"},{label:(0,e.__)("Fade In","qi-blocks"),value:"fadeIn"},{label:(0,e.__)("Fade In Down","qi-blocks"),value:"fadeInDown"},{label:(0,e.__)("Fade In Down Big","qi-blocks"),value:"fadeInDownBig"},{label:(0,e.__)("Fade In Left","qi-blocks"),value:"fadeInLeft"},{label:(0,e.__)("Fade In Left Big","qi-blocks"),value:"fadeInLeftBig"},{label:(0,e.__)("Fade In Right","qi-blocks"),value:"fadeInRight"},{label:(0,e.__)("Fade In Right Big","qi-blocks"),value:"fadeInRightBig"},{label:(0,e.__)("Fade In Up","qi-blocks"),value:"fadeInUp"},{label:(0,e.__)("Fade In Up Big","qi-blocks"),value:"fadeInUpBig"},{label:(0,e.__)("Fade In Top Left","qi-blocks"),value:"fadeInTopLeft"},{label:(0,e.__)("Fade In Top Right","qi-blocks"),value:"fadeInTopRight"},{label:(0,e.__)("Fade In Bottom Left","qi-blocks"),value:"fadeInBottomLeft"},{label:(0,e.__)("Fade In Bottom Right","qi-blocks"),value:"fadeInBottomRight"},{label:(0,e.__)("Flash","qi-blocks"),value:"flash"},{label:(0,e.__)("Flip","qi-blocks"),value:"flip"},{label:(0,e.__)("Flip In X","qi-blocks"),value:"flipInX"},{label:(0,e.__)("Flip In Y","qi-blocks"),value:"flipInY"},{label:(0,e.__)("Head Shake","qi-blocks"),value:"headShake"},{label:(0,e.__)("Heart Beat","qi-blocks"),value:"heartBeat"},{label:(0,e.__)("Jack In The Box","qi-blocks"),value:"jackInTheBox"},{label:(0,e.__)("Jello","qi-blocks"),value:"jello"},{label:(0,e.__)("Light Speed In Right","qi-blocks"),value:"lightSpeedInRight"},{label:(0,e.__)("Light Speed In Left","qi-blocks"),value:"lightSpeedInLeft"},{label:(0,e.__)("Pulse","qi-blocks"),value:"pulse"},{label:(0,e.__)("Roll In","qi-blocks"),value:"rollIn"},{label:(0,e.__)("Rotate In","qi-blocks"),value:"rotateIn"},{label:(0,e.__)("Rotate In Down Left","qi-blocks"),value:"rotateInDownLeft"},{label:(0,e.__)("Rotate In Down Right","qi-blocks"),value:"rotateInDownRight"},{label:(0,e.__)("Rotate In Up Left","qi-blocks"),value:"rotateInUpLeft"},{label:(0,e.__)("Rotate In Up Right","qi-blocks"),value:"rotateInUpRight"},{label:(0,e.__)("Rubber Band","qi-blocks"),value:"rubberBand"},{label:(0,e.__)("Shake X","qi-blocks"),value:"shakeX"},{label:(0,e.__)("Shake Y","qi-blocks"),value:"shakeY"},{label:(0,e.__)("Slide In Down","qi-blocks"),value:"slideInDown"},{label:(0,e.__)("Slide In Left","qi-blocks"),value:"slideInLeft"},{label:(0,e.__)("Slide In Right","qi-blocks"),value:"slideInRight"},{label:(0,e.__)("Slide In Up","qi-blocks"),value:"slideInUp"},{label:(0,e.__)("Swing","qi-blocks"),value:"swing"},{label:(0,e.__)("Tada","qi-blocks"),value:"tada"},{label:(0,e.__)("Wobble","qi-blocks"),value:"wobble"},{label:(0,e.__)("Zoom In","qi-blocks"),value:"zoomIn"},{label:(0,e.__)("Zoom In Down","qi-blocks"),value:"zoomInDown"},{label:(0,e.__)("Zoom In Left","qi-blocks"),value:"zoomInLeft"},{label:(0,e.__)("Zoom In Right","qi-blocks"),value:"zoomInRight"},{label:(0,e.__)("Zoom In Up","qi-blocks"),value:"zoomInUp"}],onChange:e=>{a({[o("EntranceAnimation")]:e}),setTimeout(()=>{qiBlocksEditor.qodefTriggerBlockAnimation.triggerAnimation(t.uniqueClass)},300)}}),void 0!==t[o("EntranceAnimation")]&&""!==t[o("EntranceAnimation")]&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(y.SelectControl,{label:(0,e.__)("Animation Duration","qi-blocks"),value:t[o("EntranceAnimationDuration")],options:[{label:(0,e.__)("Slower","qi-blocks"),value:"slower"},{label:(0,e.__)("Slow","qi-blocks"),value:"slow"},{label:(0,e.__)("Normal","qi-blocks"),value:"normal"},{label:(0,e.__)("Fast","qi-blocks"),value:"fast"},{label:(0,e.__)("Faster","qi-blocks"),value:"faster"}],onChange:e=>{a({[o("EntranceAnimationDuration")]:e}),setTimeout(()=>{qiBlocksEditor.qodefTriggerBlockAnimation.triggerAnimation(t.uniqueClass)},300)}}),wp.element.createElement(y.TextControl,{type:"number",label:(0,e.__)("Animation Delay (ms)","qi-blocks"),value:t[o("EntranceAnimationDelay")],min:0,step:100,onChange:e=>{a({[o("EntranceAnimationDelay")]:ae(e)}),qiBlocksEditor.qodefTriggerBlockAnimation.triggerAnimation(t.uniqueClass,!0)}}))),r.includes("background")&&wp.element.createElement(y.PanelBody,{title:(0,e.__)("Background","qi-blocks"),initialOpen:!1},wp.element.createElement(da,{attrNameTemplate:"Advanced",blockAttributes:t,setAttributes:a,previewScreen:n})),r.includes("border")&&wp.element.createElement(y.PanelBody,{title:(0,e.__)("Border","qi-blocks"),initialOpen:!1},wp.element.createElement(fa,{attrNameTemplate:"Advanced",blockAttributes:t,setAttributes:a}),wp.element.createElement(ha,{attrNameTemplate:"Advanced",blockAttributes:t,setAttributes:a,popup:!0})),r.includes("positioning")&&wp.element.createElement(y.PanelBody,{title:(0,e.__)("Positioning","qi-blocks"),initialOpen:!1},wp.element.createElement(Ne,{label:(0,e.__)("Width","qi-blocks"),blockAttributeKey:o("BlockWidth"),blockAttributes:t,setAttributes:a,selectOptions:[{label:(0,e.__)("Default","qi-blocks"),value:""},{label:(0,e.__)("Full Width (100%)","qi-blocks"),value:"full-width"},{label:(0,e.__)("Inline (auto)","qi-blocks"),value:"inline"},{label:(0,e.__)("Custom","qi-blocks"),value:"custom"}]}),(""===s&&"custom"===t[o("BlockWidth")]||""!==s&&"custom"===t[o("BlockWidth",s)]||""!==s&&"custom"===t[o("BlockWidth")]&&["","custom"].includes(t[o("BlockWidth","Tablet")])&&""===t[o("BlockWidth",s)])&&wp.element.createElement(ca,{label:(0,e.__)("Custom Width","qi-blocks"),blockAttributeKey:o("BlockCustomWidth"),setAttributes:a,blockAttributes:t,rangeMax:1e3,rangeDecimalMax:100,unitType:"pxPercentVw",allowScreens:!0}),wp.element.createElement(y.SelectControl,{label:(0,e.__)("Position","qi-blocks"),value:t[o("BlockPosition")],options:[{label:(0,e.__)("Default","qi-blocks"),value:""},{label:(0,e.__)("Absolute","qi-blocks"),value:"absolute"},{label:(0,e.__)("Relative","qi-blocks"),value:"relative"},{label:(0,e.__)("Fixed","qi-blocks"),value:"fixed"}],onChange:e=>{a({[o("BlockPosition")]:e})}}),""!==t[o("BlockPosition")]&&wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(y.SelectControl,{label:(0,e.__)("Horizontal Orientation","qi-blocks"),value:t[o("PositionHorizontalOrientation")],options:[{label:(0,e.__)("Left","qi-blocks"),value:"left"},{label:(0,e.__)("Right","qi-blocks"),value:"right"}],onChange:e=>a({[o("PositionHorizontalOrientation")]:e})}),wp.element.createElement(ca,{label:(0,e.__)("Offset","qi-blocks"),blockAttributeKey:o("PositionHorizontalOffset"),setAttributes:a,blockAttributes:t,rangeMax:1e3,rangeMin:-1e3,rangeDecimalMax:100,rangeDecimalMin:-100,unitType:"measure",allowScreens:!0}),wp.element.createElement(y.SelectControl,{label:(0,e.__)("Vertical Orientation","qi-blocks"),value:t[o("PositionVerticalOrientation")],options:[{label:(0,e.__)("Top","qi-blocks"),value:"Top"},{label:(0,e.__)("Bottom","qi-blocks"),value:"bottom"}],onChange:e=>a({[o("PositionVerticalOrientation")]:e})}),wp.element.createElement(ca,{label:(0,e.__)("Offset","qi-blocks"),blockAttributeKey:o("PositionVerticalOffset"),setAttributes:a,blockAttributes:t,rangeMax:1e3,rangeMin:-1e3,rangeDecimalMax:100,rangeDecimalMin:-100,unitType:"measure",allowScreens:!0}))),r.includes("responsive")&&wp.element.createElement(y.PanelBody,{title:(0,e.__)("Responsive","qi-blocks"),initialOpen:!1},wp.element.createElement(S,{blockAttributes:t,setAttributes:a})),qiBlocksEditor.vars?.advancedBlockPanel&&wp.element.createElement(wp.element.Fragment,null,Object.entries(qiBlocksEditor.vars.advancedBlockPanel).map(([t,a],l)=>{let n="";if("help"===t?n=(0,e.__)("Help","qi-blocks"):"features"===t&&(n=(0,e.__)("Get more features","qi-blocks")),a.length<=0||"blocks"===t)return"";const o="help"===t,r=i?i.replace("qi-blocks/",""):"",s=a.map((a,l)=>{let n=a?.link;if(0===l&&"help"===t&&r){const e=qiBlocksEditor.vars.advancedBlockPanel?.blocks[r]||"";e&&e?.demo&&(n=e?.demo+"?utm_source=dash&utm_medium=qiblocks&utm_campaign=blocks")}return wp.element.createElement("div",{className:"qodef-m-item"},a?.image?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("a",{className:"qodef-m-item-image-link",href:a?.link,target:"_blank",rel:"noreferrer"},wp.element.createElement("img",{className:"qodef-m-item-image",src:a.image,alt:a?.title})),wp.element.createElement("p",{className:"qodef-m-item-title"},a?.title),wp.element.createElement("a",{className:"qodef-m-item-button",href:a?.link,target:"_blank",rel:"noreferrer"},(0,e.__)("Upgrade","qi-blocks"))):wp.element.createElement("a",{className:"qodef-m-item-link",href:n,target:"_blank",rel:"noreferrer"},a?.title))});return wp.element.createElement(y.PanelBody,{title:n,className:`qodef-advanced-block-panel-features ${"qodef--"+t} qodef-m`,key:l,initialOpen:o},s)})))}}ka.defaultProps={blockAttributes:{},setAttributes:()=>{},excludePanels:[],previewScreen:"desktop",blockName:""};const _a=(0,o.withSelect)(e=>{let t="desktop";return e("core/edit-post")&&(t="function"==typeof e("core/editor")?.getDeviceType?e("core/editor")?.getDeviceType()?.toLowerCase():e("core/edit-post")?.__experimentalGetPreviewDeviceType()?.toLowerCase()),e("core/edit-site")&&(t="function"==typeof e("core/editor")?.getDeviceType?e("core/editor")?.getDeviceType()?.toLowerCase():e("core/edit-site").__experimentalGetPreviewDeviceType().toLowerCase()),{previewScreen:t,blockName:e("core/block-editor")?.getSelectedBlock()?.name}})(ka);const va=jQuery;var ya=a.n(va);const wa={init:function(){this.holder=ya()(".qodef-repeater-option .qodef-repeater-items"),this.holder.length&&this.holder.each(function(){wa.initItem(ya()(this))})},initItem:function(e){e&&e.find(".qodef-repeater-item-heading").off().on("click touchstart",function(e){const t=ya()(this),a=t.parents(".qodef-repeater-item");e.target.classList.contains("qodef-repeater-button")||e.target.classList.contains("dashicon")||(a.hasClass("qodef--active")?(a.removeClass("qodef--active"),t.siblings(".qodef-repeater-item-options").slideUp()):(t.siblings(".qodef-repeater-item-options").slideDown(),a.addClass("qodef--active"),a.siblings().removeClass("qodef--active"),a.siblings().find(".qodef-repeater-item-options").slideUp()))})}},Aa=wa;function Ia(){return Ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},Ia.apply(null,arguments)}class Sa extends ye.Component{constructor(){super(...arguments),this.state={addedItemIndex:""},this.handleAddItem.bind(this),this.handleOnChange.bind(this),this.handleOnRemove.bind(this),this.handleDuplicateItem.bind(this)}componentDidMount(){this.initControlScript()}initControlScript(){setTimeout(()=>{"object"==typeof Aa&&Aa.init()},600)}getItems=()=>{const{blockAttributeKey:e,blockAttributes:t}=this.props,a=t[e];return le(this.props,"all")&&a.length?JSON.parse(JSON.stringify(a)):[]};handleAddItem=()=>{const{options:e,blockAttributeKey:t,setAttributes:a}=this.props,l=this.getItems();let n={};e.map(e=>{n[e.optionKey]=e.optionDefaultValue||""}),l.push(n),this.setState({addedItemIndex:l.length-1}),a({[t]:l}),this.initControlScript()};handleOnChange=(e,t,a)=>{const{blockAttributeKey:l,setAttributes:n}=this.props,i=this.getItems();"object"==typeof e?e.key&&e.childKey?i[a][e.key][e.childKey]=t:i[a][e.key]=t:i[a][e]=t,n({[l]:i})};getRepeaterItemValues=(e,t)=>{const a=this.getItems();let l;return l="object"==typeof e?e.key&&e.childKey?a[t][e.key][e.childKey]:a[t][e.key]:a[t][e],ne(l)};handleOnRemove=e=>{const{blockAttributeKey:t,setAttributes:a}=this.props,l=this.getItems();l.splice(e,1),a({[t]:l}),this.initControlScript()};handleDuplicateItem=e=>{const{options:t,blockAttributeKey:a,setAttributes:l}=this.props,n=this.getItems();let i={};t.map(t=>{i[t.optionKey]=n[e][t.optionKey]}),n.splice(e+1,0,i),l({[a]:n}),this.initControlScript()};handleOnDrag=(e,t)=>{const{blockAttributeKey:a,setAttributes:l}=this.props,n=this.getItems();let i=(o=n,r=e,s="up"===t?e-1:e+1,function(e,t,a){const l=t<0?e.length+t:t;if(l>=0&&l<e.length){const l=a<0?e.length+a:a,[n]=e.splice(t,1);e.splice(l,0,n)}}(o=[...o],r,s),o);var o,r,s;l({[a]:i}),this.initControlScript()};showItems=()=>{const{options:t,blockAttributes:a,blockAttributeKey:l,setAttributes:n}=this.props,i=this.getItems();return i.length>0&&wp.element.createElement("div",{className:"qodef-repeater-items"},i.map((o,r)=>wp.element.createElement("div",{className:"qodef-repeater-item "+(this.state.addedItemIndex===r?"qodef--active":""),key:r},wp.element.createElement("div",{className:"qodef-repeater-item-heading"},wp.element.createElement("span",{className:"qodef-repeater-item-heading-label"},(0,e.__)(`Item ${r+1}`,"qi-blocks")),wp.element.createElement("div",{className:"qodef-repeater-item-action"},i.length>1&&wp.element.createElement(wp.element.Fragment,null,0!==r&&wp.element.createElement(y.Button,{className:"qodef-repeater-button qodef--move-up",icon:"arrow-up-alt2",text:"",showTooltip:!0,label:(0,e.__)("Move Up","qi-blocks"),onClick:()=>this.handleOnDrag(r,"up")}),i.length!==r+1&&wp.element.createElement(y.Button,{className:"qodef-repeater-button qodef--move-down",icon:"arrow-down-alt2",text:"",showTooltip:!0,label:(0,e.__)("Move Down","qi-blocks"),onClick:()=>this.handleOnDrag(r,"down")})),wp.element.createElement(y.Button,{className:"qodef-repeater-button qodef--duplicate",icon:"admin-page",text:"",showTooltip:!0,label:(0,e.__)("Duplicate Item","qi-blocks"),onClick:()=>this.handleDuplicateItem(r)}),wp.element.createElement(y.Button,{className:"qodef-repeater-button qodef--remove",icon:"no-alt",text:"",showTooltip:!0,label:(0,e.__)("Remove Item","qi-blocks"),onClick:()=>this.handleOnRemove(r)}))),wp.element.createElement("div",{className:"qodef-repeater-item-options"},t.map((e,t)=>{const o=e.optionType;let s=e.optionAttributes||{};const c=e.advancedOptions||!1,u=e.dependency||{},m=Object.prototype.hasOwnProperty.call(u,"value")&&Object.prototype.hasOwnProperty.call(u,"key"),p="string"==typeof u.value?[u.value]:u.value,d=Object.prototype.hasOwnProperty.call(u,"isGlobal")?a[u.key]:i[r][u.key];return s=c?{...s,blockAttributeKey:l,blockAttributes:a,setAttributes:n,repeater:!0,repeaterItemIndex:r,repeaterItemKey:e.optionKey,repeaterSetAttributes:this.handleOnChange,repeaterGetAttributes:this.getRepeaterItemValues}:{...s,onChange:t=>this.handleOnChange(e.optionKey,t,r)},wp.element.createElement("div",{key:t,className:"qodef-repeater-item-option"},(m&&p.includes(d)||!m)&&wp.element.createElement(o,Ia({label:e.label||"",placeholder:e.placeholder||"",value:i[r][e.optionKey]},s)))})))))};render(){const{label:t}=this.props;return wp.element.createElement("div",{className:"qodef-repeater-option"},t&&wp.element.createElement("label",{className:"qodef-option-label"},t),this.showItems(),wp.element.createElement(y.Button,{className:"qodef-repeater-button qodef--add",isSecondary:!0,text:(0,e.__)("Add Item","qi-blocks"),onClick:this.handleAddItem}))}}Sa.defaultProps={label:(0,e.__)("Items","qi-blocks"),options:[{label:(0,e.__)("Title","qi-blocks"),optionType:y.TextControl,optionKey:"itemTitle",optionDefaultValue:"",optionAttributes:{},advancedOptions:!1,dependency:{}}],blockAttributeKey:"",blockAttributes:{},setAttributes:()=>{},isRichText:!1};const xa=Sa,qa=wp.apiFetch;var Ea=a.n(qa);class Ta extends ye.Component{constructor(){super(...arguments),this.state={screen:v(),imageId:"",customImageSizeLoading:!1,externalImageIsSet:!1,imageSizeNotExist:!1}}getScreenLabelSuffix(){return J(this.state.screen)}getAttributeName(e){const{attrNameTemplate:t}=this.props;return X(t,e)}getAttributeValue(e,t=this.getScreenLabelSuffix()){const{blockAttributes:a,allowScreens:l,repeater:n,repeaterItemIndex:i,repeaterItemKey:o,repeaterGetAttributes:r}=this.props;let s=e;l&&t&&(s=e+t);let c=a[s];return n&&(c=r({key:o,childKey:s},i)),ne(c)}setAttributeValue(e,t,a=this.getScreenLabelSuffix()){const{setAttributes:l,allowScreens:n,repeater:i,repeaterItemIndex:o,repeaterItemKey:r,repeaterSetAttributes:s}=this.props;let c=e;n&&a&&(c=e+a),i?s({key:r,childKey:c},t,o):l({[c]:t})}componentDidMount(){const{allowDefaultImage:e,defaultImageURL:t,allowScreens:a}=this.props,{url:l,id:n,defaultValueIsSet:i}=this.getAttributeValue(this.getAttributeName("Image"));l&&!l.includes(qiBlocksEditor.vars.siteURL)?(this.onSelectURL(l),this.setState({externalImageIsSet:!0})):(l&&(0,Oe.isBlobURL)(l)&&!n&&this.setAttributeValue(this.getAttributeName("Image"),{url:"",alt:"",caption:"",html:""}),a&&["Tablet","Mobile"].map(e=>{const{url:t,id:a}=this.getAttributeValue(this.getAttributeName("Image"),e);t&&(0,Oe.isBlobURL)(t)&&!a&&this.setAttributeValue(this.getAttributeName("Image"),{url:"",alt:"",caption:"",html:""},e)}),!e||i||l||n||this.setAttributeValue(this.getAttributeName("Image"),{id:null,url:t||qiBlocksEditor.vars.defaultImage,alt:qiBlocksEditor.vars.defaultImagePlaceholder,caption:"",html:""}),n&&(this.setState({imageId:n}),this.updateImageSizeOption(n)))}setSVGIcon=(e,t,a,l)=>{const n=new XMLHttpRequest;null!=n&&(n.open("GET",t,!0),n.onreadystatechange=()=>{4===n.readyState&&200===n.status&&this.setAttributeValue(this.getAttributeName("Image"),{id:e,url:t,alt:a,caption:l,html:Zt.sanitize(n.responseText,{USE_PROFILES:{svg:!0,svgFilters:!0}})})},n.send())};onSelectImage=({id:e,url:t,alt:a,caption:l})=>{this.setAttributeValue(this.getAttributeName("ImageSize"),""),t.includes(".svg")?this.setSVGIcon(e,t,a,l):this.setAttributeValue(this.getAttributeName("Image"),{id:e,url:t,alt:a,caption:l}),this.setState({imageId:e,externalImageIsSet:!1}),this.updateImageSizeOption(e)};updateImageSizeOption=e=>{if(this.props.allowImageSizes){let t=0;const a=setInterval(()=>{(re(e)||t>5)&&(clearInterval(a),this.forceUpdate()),t++},1e3)}};onSelectURL=e=>{e.includes(".svg")?this.setSVGIcon(null,e,"",""):this.setAttributeValue(this.getAttributeName("Image"),{id:null,url:e,alt:"",caption:"",html:""}),this.setAttributeValue(this.getAttributeName("ImageSize"),""),this.setState({externalImageIsSet:!1})};onUploadError=e=>{const{noticeOperations:t}=this.props;t.createErrorNotice(e)};removeImage=()=>{this.setAttributeValue(this.getAttributeName("Image"),{id:null,url:"",alt:"",caption:"",html:"",defaultValueIsSet:!!this.props.allowDefaultImage})};getImageSizes(){const{imageSizes:t,additionalImageSizes:a}=this.props,l=this.getAttributeValue(this.getAttributeName("Image"));let n=[];if(l){const i=re(l.id);if(!i)return[];const o=i.media_details.sizes;o&&0===Object.keys(o).length&&n.push({label:(0,e.__)("Default","qi-blocks"),value:""});for(const e in o){const a=t.find(t=>t.slug===e);a&&n.push({label:a.name,value:e})}a&&a.length>1&&a.map(e=>{n.push({label:e.label,value:e.value})}),n.push({label:(0,e.__)("Custom","qi-blocks"),value:"custom"})}return n}onImageSizeChange=e=>{this.setAttributeValue(this.getAttributeName("ImageSize"),e);const t=re(this.state.imageId);if(t){let a=t.source_url;""!==e&&(a=this.getImageURLbySize(e)||t.source_url),"custom"===e?this.getImageURLbyCustomSize(e):this.setAttributeValue(this.getAttributeName("Image"),{id:t.id,url:a,alt:t.alt_text||"",caption:t.caption&&t.caption.raw||""})}};getImageURLbySize(e){const t=this.getAttributeValue(this.getAttributeName("Image"));let a="";if(t){const l=re(t.id);if(!l)return"";this.setState({customImageSizeLoading:!0});const n=l.media_details.sizes;if(n&&0===Object.keys(n).length)this.setState({imageSizeNotExist:!0,customImageSizeLoading:!1});else{this.setState({imageSizeNotExist:!1,customImageSizeLoading:!1});for(const t in n){if(t===e){a=n[t].source_url;break}if(t.includes("qi_blocks_image_size_"+e.replace("-","_"))){a=n[t].source_url;break}}}["","custom"].includes(e)&&this.setState({imageSizeNotExist:!1})}return a}getImageURLbyCustomSize=()=>{const e=re(this.state.imageId);if(e){let t=e.source_url;const a=parseInt(this.getAttributeValue(this.getAttributeName("ImageCustomWidth")),10),l=parseInt(this.getAttributeValue(this.getAttributeName("ImageCustomHeight")),10);t&&a&&l&&(this.setState({customImageSizeLoading:!0}),Ea()({method:"POST",path:"/qi-blocks/v1/resize-image",data:{image_id:this.state.imageId,custom_size:{width:a,height:l}}}).then(a=>{"success"===a.status&&(t=a.data.url),this.setState({customImageSizeLoading:!1}),this.setAttributeValue(this.getAttributeName("Image"),{id:e.id,url:t,alt:e.alt_text||"",caption:e.caption&&e.caption.raw||""})}))}};render(){const t={...this.props},a={...this.state},{label:l,noticeUI:n,allowScreens:i,allowImageSizes:o}=t,r=this.getAttributeValue(this.getAttributeName("Image")),{id:s,url:c,alt:u,html:m}=r;return t.onChangeScreen=e=>{this.setState({screen:e}),this.updateImageSizeOption(s)},wp.element.createElement(y.BaseControl,{className:"qodef-advanced-image-option qodef-image-option"},wp.element.createElement("div",{className:"qodef-advanced-select-heading"},i?wp.element.createElement(qe,{label:l,onChangeScreen:t.onChangeScreen}):wp.element.createElement(wp.element.Fragment,null,l&&wp.element.createElement("label",{className:"qodef-option-label"},l))),c?wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("div",{className:"qodef-image-option-inner"},((0,Oe.isBlobURL)(c)||a.customImageSizeLoading)&&wp.element.createElement("div",{className:"qodef-image-option-spinner"},wp.element.createElement(y.Spinner,null)),wp.element.createElement(_e.MediaUploadCheck,null,wp.element.createElement(_e.MediaUpload,{allowedTypes:["image"],value:s,onSelect:this.onSelectImage,render:({open:t})=>wp.element.createElement(wp.element.Fragment,null,wp.element.createElement("img",{src:c,alt:u}),wp.element.createElement("div",{className:"qodef-image-option-actions"},wp.element.createElement(y.Button,{icon:"edit",showTooltip:!0,label:(0,e.__)("Edit Image","qi-blocks"),onClick:t}),wp.element.createElement(y.Button,{icon:"trash",showTooltip:!0,label:(0,e.__)("Remove Image","qi-blocks"),onClick:this.removeImage})))}))),a.imageSizeNotExist&&wp.element.createElement("p",{className:"qodef-image-notice"},(0,e.__)("The Image has no predefined sizes, please set a custom image size.","qi-blocks")),a.externalImageIsSet&&wp.element.createElement("p",{className:"qodef-image-notice"},(0,e.__)("External image URL is set, please upload your image for this Element.","qi-blocks"))):wp.element.createElement(_e.MediaPlaceholder,{allowedTypes:["image"],icon:"format-image",onSelect:this.onSelectImage,onSelectURL:this.onSelectURL,onError:this.onUploadError,notices:n}),o&&s&&!m&&wp.element.createElement("div",{className:"qodef-image-option-sizes"},this.getImageSizes()&&this.getImageSizes().length>0?wp.element.createElement(y.SelectControl,{label:(0,e.__)("Image Size","qi-blocks"),options:this.getImageSizes(),onChange:this.onImageSizeChange,value:this.getAttributeValue(this.getAttributeName("ImageSize"))||"full"}):wp.element.createElement(y.Spinner,null),"custom"===this.getAttributeValue(this.getAttributeName("ImageSize"))&&wp.element.createElement("div",{className:"qodef-image-option-custom-size"},wp.element.createElement("label",{className:"qodef-option-label"},(0,e.__)("Custom Image Size","qi-blocks")),wp.element.createElement(y.TextControl,{type:"number",label:(0,e.__)("Width","qi-blocks"),value:this.getAttributeValue(this.getAttributeName("ImageCustomWidth")),onChange:e=>this.setAttributeValue(this.getAttributeName("ImageCustomWidth"),ae(e)),min:1,max:2560,step:1}),wp.element.createElement(y.TextControl,{type:"number",label:(0,e.__)("Height","qi-blocks"),value:this.getAttributeValue(this.getAttributeName("ImageCustomHeight")),onChange:e=>this.setAttributeValue(this.getAttributeName("ImageCustomHeight"),ae(e)),min:1,max:2560,step:1}),wp.element.createElement(y.Button,{isPrimary:!0,text:(0,e.__)("Apply Changes","qi-blocks"),onClick:this.getImageURLbyCustomSize}))))}}Ta.defaultProps={label:(0,e.__)("Image","qi-blocks"),attrNameTemplate:"",blockAttributes:{},setAttributes:()=>{},allowDefaultImage:!1,defaultImageURL:"",allowScreens:!1,allowImageSizes:!0,additionalImageSizes:[],repeater:!1,repeaterItemIndex:0,repeaterItemKey:"",repeaterSetAttributes:()=>{},repeaterGetAttributes:()=>{}};const Ca=(0,o.withSelect)(e=>({imageSizes:e("core/block-editor")?.getSettings()?.imageSizes}))((0,y.withNotices)(Ta)),Na=e=>{const t=t=>X(e.attrNameTemplate,e.attrName,t),a=le(e,"all")&&void 0!==e.disableDirections&&e.disableDirections.length>0?e.disableDirections:[],l=le(e,"all")&&void 0!==e.isImportant&&e.isImportant?" !important":"",{blockAttributes:n}=e,i=["Top","Right","Bottom","Left"];let o={},r={},s={};return Object.entries(k).map(([c])=>{const u=J(c),m=t("Unit"+u),p="p"===n[m]?"%":n[m]||"px";[...i].map((m,d)=>{const b=n[t(m+u)],f=n[t(`${m}Decimal`+u)];if(le(b)||le(f)){let t;const n=e.attrName?e.attrName.toLowerCase():"";if(n.includes("border")){if(n.includes("width"))t=`border${m}Width`;else if(n.includes("radius")){let e,a,l;a=d%2?i[d-1]:m,l=d%2?m:i[i.length-d-1],e=`${a}${l}`,t=`border${e}Radius`}}else t=e.attrName?`${n}${m}`:m.toLowerCase();let u="";if(ee(p)&&""!==b?u=a.length>0&&a.includes(m)?"":parseInt(b,10)+p:te(p)&&""!==f&&(u=a.length>0&&a.includes(m)?"":parseFloat(f)+p),u)switch(c){case"desktop":o[t]=u+l;break;case"tablet":r[t]=u+l;break;case"mobile":s[t]=u+l}}})}),{desktop:o,tablet:r,mobile:s}};Na.defaultProps={attrNameTemplate:"",attrName:"",blockAttributes:{},disableDirections:[],isImportant:!1};const Oa=Na,Pa=e=>{const{blockAttributes:t}=e,a=le(e,"all")&&e.attrNameTemplate||"",l=le(e,"all")&&e.attrName||"Background",n=(e,t)=>X(a,l+e,t);let i={},o={},r={};return t[n("Attachment")]&&(i.backgroundAttachment=t[n("Attachment")]),Object.entries(k).map(([e])=>{let a=J(e),l={};if(t[n("Image",a)]&&t[n("Image",a)].url&&(l.backgroundImage=`url(${t[n("Image",a)].url})`),t[n("Repeat",a)]&&(l.backgroundRepeat=t[n("Repeat",a)]),"custom"===t[n("Position",a)]){let e="",i="";(t[n("XPosition",a)]||t[n("XPositionDecimal",a)])&&(ee(t[n("XPositionUnit",a)])&&t[n("XPosition",a)]?e=parseInt(t[n("XPosition",a)],10)+t[n("XPositionUnit",a)]:te(t[n("XPositionUnit",a)])&&t[n("XPositionDecimal",a)]&&(e=parseFloat(t[n("XPositionDecimal",a)])+t[n("XPositionUnit",a)])),(t[n("YPosition",a)]||t[n("YPositionDecimal",a)])&&(ee(t[n("YPositionUnit",a)])&&t[n("YPosition",a)]?i=parseInt(t[n("YPosition",a)],10)+t[n("YPositionUnit",a)]:te(t[n("YPositionUnit",a)])&&t[n("YPositionDecimal",a)]&&(i=parseFloat(t[n("YPositionDecimal",a)])+t[n("YPositionUnit",a)])),""===e&&""===i||(l.backgroundPosition=e+" "+i)}else t[n("Position",a)]&&(l.backgroundPosition=t[n("Position",a)]);"custom"===t[n("Size",a)]?(t[n("SizeWidth",a)]||t[n("SizeWidthDecimal",a)])&&(ee(t[n("SizeWidthUnit",a)])&&t[n("SizeWidth",a)]?l.backgroundSize=parseInt(t[n("SizeWidth",a)],10)+t[n("SizeWidthUnit",a)]+" auto":te(t[n("SizeWidthUnit",a)])&&t[n("SizeWidthDecimal",a)]&&(l.backgroundSize=parseFloat(t[n("SizeWidthDecimal",a)])+t[n("SizeWidthUnit",a)]+" auto")):t[n("Size",a)]&&(l.backgroundSize=t[n("Size",a)]),Object.keys(l).length>0&&Object.entries(l).map(([t,a])=>{switch(e){case"desktop":i[t]=a;break;case"tablet":o[t]=a;break;case"mobile":r[t]=a}})}),{desktop:i,tablet:o,mobile:r}};Pa.defaultProps={attrNameTemplate:"",attrName:"Background",blockAttributes:{}};const Ba=Pa,Da=e=>{const{blockAttributes:t}=e,a=le(e,"all")&&e.attrNameTemplate||"",l=(e,t)=>X(a,e,t),n=t[l("BackgroundType")]||"";let i={},o={},r={};if("gradient"===n){let e={type:"linear",position:"",color_1:"",location_1:"",color_2:"",location_2:""};t[l("BackgroundGradientColor1")]&&(e.color_1=t[l("BackgroundGradientColor1")]),le(t[l("BackgroundGradientLocation1")])&&(e.location_1=ae(t[l("BackgroundGradientLocation1")])+"%"),t[l("BackgroundGradientColor2")]&&(e.color_2=t[l("BackgroundGradientColor2")]),le(t[l("BackgroundGradientLocation2")])&&(e.location_2=ae(t[l("BackgroundGradientLocation2")])+"%"),t[l("BackgroundGradientType")]&&(e.type=t[l("BackgroundGradientType")]),"linear"===e.type&&""!==t[l("BackgroundGradientTypeAngle")]?e.position=ae(t[l("BackgroundGradientTypeAngle")])+"deg":"radial"===e.type&&t[l("BackgroundGradientTypePosition")]&&(e.position="at "+t[l("BackgroundGradientTypePosition")]),e.type&&e.position&&e.color_1&&e.location_1&&e.color_2&&e.location_2?(i.backgroundColor="transparent",i.backgroundImage=`${e.type}-gradient(${e.position}, ${e.color_1} ${e.location_1}, ${e.color_2} ${e.location_2})`):e.color_1&&(i.backgroundColor=e.color_1)}else"video"===n?!t[l("BackgroundVideoPlayOnMobile")]&&t[l("BackgroundVideoFallbackImage")]&&t[l("BackgroundVideoFallbackImage")].url&&(o.backgroundImage=`url(${t[l("BackgroundVideoFallbackImage")].url})`,o.backgroundPosition="center",o.backgroundSize="cover"):(t[l("BackgroundColor")]&&(i.backgroundColor=t[l("BackgroundColor")]),r=Ba({attrNameTemplate:a,blockAttributes:t}));return ke()({desktop:i,tablet:{},mobile:o},r)};Da.defaultProps={attrNameTemplate:"",blockAttributes:{}};const Va=Da,Ra=e=>{const{blockAttributes:t}=e,a=le(e,"all")&&e.attrNameTemplate||"",l=le(e,"all")&&e.disableWidthDirections||[],n=!le(e,"all")||(e.allowBorderColor??!0),i=(e,t)=>X(a,e,t);let o={},r={};const s=!le(e,"all")||(e.allowBorderRadius??!0)?Oa({blockAttributes:t,attrNameTemplate:a,attrName:"BorderRadius",disableDirections:l}):{};return t[i("BorderStyle")]&&(o.borderStyle=t[i("BorderStyle")],n&&t[i("BorderColor")]&&(o.borderColor=t[i("BorderColor")]),r=Oa({attrNameTemplate:a,attrName:"BorderWidth",blockAttributes:t})),ke()({desktop:o,tablet:{},mobile:{}},r,s)};Ra.defaultProps={attrNameTemplate:"",allowBorderColor:!0,allowBorderRadius:!0,blockAttributes:{}};const La=Ra,za=e=>{const{blockAttributes:t,excludeOptions:a}=e,l=le(e,"all")&&e.attrNameTemplate||"",n=(e,t)=>X(l,e,t);let i={},o={x:0,y:0,blur:0,spread:0,color:"",position:""};var r;return t[n("BoxShadowColor")]&&(o.color=t[n("BoxShadowColor")]),""!==t[n("BoxShadowHorizontal")]&&(o.x=t[n("BoxShadowHorizontal")]),""!==t[n("BoxShadowVertical")]&&(o.y=t[n("BoxShadowVertical")]),""!==t[n("BoxShadowBlur")]&&(o.blur=t[n("BoxShadowBlur")]),""!==t[n("BoxShadowSpread")]&&(o.spread=t[n("BoxShadowSpread")]),r="position",a&&a.length&&a.includes(r)||!t[n("BoxShadowPosition")]||(o.position=t[n("BoxShadowPosition")]),o.color&&(i.boxShadow=o.x+"px "+o.y+"px "+o.blur+"px "+o.spread+"px "+o.color+" "+o.position),{desktop:i,tablet:{},mobile:{}}};za.defaultProps={attrNameTemplate:"",blockAttributes:{}};const Ma=za,Ua=e=>{const{blockAttributes:t}=e,a=(e,t="")=>X("",e,t),l=le(e,"all")&&e.excludePanels||[],n=le(e,"all")&&e.includePanels||[];let i=n&&n.length?n:K();l&&l.length&&l.forEach(e=>{i.splice(i.indexOf(e),1)});let o={},r={},s={},c={},u={};i.includes("advanced")&&(le(t[a("zIndex")])&&(o.zIndex=ae(t[a("zIndex")])),c=Oa({attrName:a("Margin"),blockAttributes:t}),u=Oa({attrName:a("Padding"),blockAttributes:t})),i.includes("motion-effects")&&void 0!==t[a("EntranceAnimation")]&&""!==t[a("EntranceAnimation")]&&t[a("EntranceAnimationDelay")]&&(o.animationDelay=ae(t[a("EntranceAnimationDelay")])+"ms");let m={};i.includes("background")&&(m=Va({attrNameTemplate:"Advanced",blockAttributes:t}));let p={};if(i.includes("border")){const e=La({attrNameTemplate:"Advanced",blockAttributes:t}),a=Ma({attrNameTemplate:"Advanced",blockAttributes:t});p=ke()(e,a)}if(i.includes("positioning")){le(t[a("BlockPosition")])&&(o.position=t[a("BlockPosition")]);const e=t[a("PositionHorizontalOrientation")],l=t[a("PositionVerticalOrientation")];Object.entries(k).map(([n])=>{let i=J(n),c={};"custom"!==t[a("BlockWidth")]&&"custom"!==t[a("BlockWidth",i)]||!t[a("BlockCustomWidth",i)]&&!t[a("BlockCustomWidthDecimal",i)]||(ee(t[a("BlockCustomWidthUnit",i)])&&t[a("BlockCustomWidth",i)]?(c.width=parseInt(t[a("BlockCustomWidth",i)],10)+t[a("BlockCustomWidthUnit",i)],c.maxWidth=parseInt(t[a("BlockCustomWidth",i)],10)+t[a("BlockCustomWidthUnit",i)]):te(t[a("BlockCustomWidthUnit",i)])&&t[a("BlockCustomWidthDecimal",i)]&&(c.width=parseFloat(t[a("BlockCustomWidthDecimal",i)])+t[a("BlockCustomWidthUnit",i)],c.maxWidth=parseFloat(t[a("BlockCustomWidthDecimal",i)])+t[a("BlockCustomWidthUnit",i)])),""===ne(t[a("PositionHorizontalOffset",i)])&&""===ne(t[a("PositionHorizontalOffsetDecimal",i)])||(ee(t[a("PositionHorizontalOffsetUnit",i)])&&""!==ne(t[a("PositionHorizontalOffset",i)])?c[e]=parseInt(t[a("PositionHorizontalOffset",i)],10)+t[a("PositionHorizontalOffsetUnit",i)]:te(t[a("PositionHorizontalOffsetUnit",i)])&&""!==ne(t[a("PositionHorizontalOffsetDecimal",i)])&&(c[e]=parseFloat(t[a("PositionHorizontalOffsetDecimal",i)])+t[a("PositionHorizontalOffsetUnit",i)])),""===ne(t[a("PositionVerticalOffset",i)])&&""===ne(t[a("PositionVerticalOffsetDecimal",i)])||(ee(t[a("PositionVerticalOffsetUnit",i)])&&""!==ne(t[a("PositionVerticalOffset",i)])?c[l]=parseInt(t[a("PositionVerticalOffset",i)],10)+t[a("PositionVerticalOffsetUnit",i)]:te(t[a("PositionVerticalOffsetUnit",i)])&&""!==ne(t[a("PositionVerticalOffsetDecimal",i)])&&(c[l]=parseFloat(t[a("PositionVerticalOffsetDecimal",i)])+t[a("PositionVerticalOffsetUnit",i)])),Object.keys(c).length>0&&Object.entries(c).map(([e,t])=>{switch(n){case"desktop":o[e]=t;break;case"tablet":r[e]=t;break;case"mobile":s[e]=t}})})}return o={desktop:o,tablet:r,mobile:s},ke()(o,c,u,m,p)};Ua.defaultProps={blockAttributes:{},excludePanels:[],includePanels:[]};const ja=Ua;let Ka=[];const Fa=qiBlocksEditor.vars.systemFontOptions,Ga=e=>{let t=!0;return e||(t=!1),Fa&&Fa.map(({value:e})=>e).forEach(a=>{""!==a&&e===a&&(t=!1)}),t},Wa=e=>{Object.keys(e).filter(e=>e.match(/fontfamily/i)).forEach(t=>{const a=e[t];a&&setTimeout(()=>{(e=>{if(qiBlocksEditor.qodefGetCurrentBlockElement.getIframe()&&(Ka=[]),Ka.includes(e))return;const t=qiBlocksEditor.qodefGetCurrentBlockElement.getCurrentDocument();if(t&&Ga(e)){const a=t.createElement("link");a.setAttribute("href",(e=>`https://fonts.googleapis.com/css?family=${e.replace(/ /g,"+")}:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic&subset=latin-ext`)(e)),a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),t.querySelector("head").appendChild(a)}Ka.push(e)})(a)},400)})},Ha=(0,ve.createHigherOrderComponent)(e=>class extends ye.Component{static defaultProps={attributes:{}};componentDidMount(){Wa(this.props.attributes)}render(){return wp.element.createElement(e,this.props)}},"withGoogleFont"),$a=(0,ve.createHigherOrderComponent)(e=>class extends ye.Component{static defaultProps={clientId:"",attributes:{},setAttributes:()=>{}};componentDidMount(){const{clientId:e,attributes:t,setAttributes:a}=this.props;t.uniqueClass||a({uniqueClass:this.getNewUniqueClass(e)}),this.reInitUniqueClass(!0)}getNewUniqueClass(e){let t="qodef-block-";return this.props.isFullSiteEditor?t="qodef-template-block-":"widget"===this.props.postID&&(t="qodef-widget-block-"),`${t}${e.substring(0,8)}`}hasParent(e,t){let a=!1,l=e?.parentNode;for(;l;){let e=l;if(e&&e?.classList?.contains(t)){a=!0;break}if(!e?.parentNode)break;l=e.parentNode}return a}reInitUniqueClass(e){const{clientId:t,attributes:a,setAttributes:l,isFullSiteEditor:n}=this.props,{uniqueClass:i}=a,o=qiBlocksEditor.qodefGetCurrentBlockElement.getCurrentDocument(),r=this.getNewUniqueClass(t);let s=!1;if(n){if(i.includes("qodef-block")||i.includes("qodef-widget")){const e=o.querySelector(`.${i}`);if(e){this.hasParent(e,"wp-block-post-content")||(s=!0)}}e&&o.addEventListener("paste",()=>{s=!0})}!n&&i.includes("qodef-template-block")&&(s=!0),""!==i&&i!==r&&o.querySelectorAll(`.${i}`).length>1&&(s=!0),s&&l({uniqueClass:r})}render(){return this.reInitUniqueClass(),wp.element.createElement(e,this.props)}},"withUniqueClass"),Ya=$a;function Xa(){return Xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},Xa.apply(null,arguments)}let Za=new Set,Ja={family:new Set,weight:new Set,style:new Set};const Qa=(e={})=>{let t="";return Object.entries(e).forEach(([e,a])=>{const l=e.toLowerCase();if(l.includes("fontfamily")){const e=a.replace(/["']/g,"");!Za.has(e)&&Ga(e)&&(Za.add(e),Ja.family.add(e))}if(l.includes("fontweight")){const e=parseInt(a,10);isNaN(e)||Ja.weight.add(e)}l.includes("fontstyle")&&Ja.style.add(a),t+=`${e.replace(/([A-Z])/g,(e,t,a)=>(a>0?"-":"")+e.toLowerCase())}: ${a};`}),t},el=(0,ve.createHigherOrderComponent)(e=>class extends ye.Component{addPageStyle(e){if(!e)return;const t=this.postID;let a=Array.isArray(qiBlocksEditor.vars.currentPageStyles)?[...qiBlocksEditor.vars.currentPageStyles]:Object.values(this.getPageStyles||{});Za=new Set,Ja={family:new Set,weight:new Set,style:new Set};const l=["widget","template"].includes(t)?"":`body[class*="-${t}"]`,n={key:this.attributes.uniqueClass,values:[],fonts:[]};e.forEach(e=>{if(!Object.values(e.styles).every(e=>0===Object.keys(e).length)){const t=Array.isArray(e.selector)?e.selector.filter(Boolean).map(e=>`${l} ${e}`):[`${l} ${e.selector}`];n.values.push({selector:t.length>1?t.join(","):t[0],styles:Qa(e.styles.desktop||{}),tablet_styles:Qa(e.styles.tablet||{}),mobile_styles:Qa(e.styles.mobile||{}),custom_styles:e.custom_styles||[]}),n.fonts={family:Array.from(Ja.family),weight:Array.from(Ja.weight),style:Array.from(Ja.style)}}});const i=a.findIndex(e=>e.key===n.key);i>-1?a[i]=n:n.values.length&&a.push(n);const o=a.filter(e=>e.values.length);qiBlocksEditor.vars.currentPageID=t,qiBlocksEditor.vars.currentPageStyles=o}render(){return wp.element.createElement(e,Xa({},this.props,{addPageStyle:this.addPageStyle}))}},"withStyles"),tl=(0,ve.compose)((0,o.withSelect)(e=>{let t=e("core/editor")?.getCurrentPostId()||"widget";const a=!!e("core/edit-site");let l="desktop";return e("core/edit-post")&&(l="function"==typeof e("core/editor")?.getDeviceType?e("core/editor")?.getDeviceType()?.toLowerCase():e("core/edit-post")?.__experimentalGetPreviewDeviceType()?.toLowerCase()),a&&(t="template",l="function"==typeof e("core/editor")?.getDeviceType?e("core/editor")?.getDeviceType()?.toLowerCase():e("core/edit-site").__experimentalGetPreviewDeviceType().toLowerCase()),{previewScreen:l,postID:t,getPageStyles:e("qi-blocks/data/with-styles").getOptions(t).data,isFullSiteEditor:a}}),Ya,el);var al=a(7584);class ll extends ye.Component{componentDidMount(){this.initBlockScript()}componentDidUpdate(e){ge()(e.attributes,this.props.attributes)||this.initBlockScript()}initBlockScript(){"object"==typeof al.A&&al.A.initItem(this.props.attributes.uniqueClass)}render(){const{attributes:t,setAttributes:a,previewScreen:l}=this.props,{uniqueClass:n,mainImage:i,mainImageParallaxLevel:o,items:r}=t,s=H(t),c=ja({blockAttributes:t});let u={className:G(t,"","parallax-images"),style:Q(c,l),...W(t)};s&&(u.id=s);const m=Ae()($("parallax-images",this.props),{}),p=Oa({attrNameTemplate:"Main",attrName:"Padding",blockAttributes:t});let d=""!==ae(o)?ae(o):"";""!==d&&Number.isInteger(d)&&0===parseInt(d,10)&&(d="parallax-disabled");const b=Ma({attrNameTemplate:"Main",blockAttributes:t,excludeOptions:["position"]}),f=Ma({attrNameTemplate:"Parallax",blockAttributes:t,excludeOptions:["position"]});let g=[];return r&&r.length&&r.map((e,t)=>{const a=oe({attributes:e.itemImageWidth,blockAttrName:"itemImageWidth",cssProp:"width"}),i=oe({attributes:e.itemYOffset,blockAttrName:"itemYOffset",cssProp:e.itemImagePosition&&e.itemImagePosition.includes("bottom")?"bottom":"top"}),o=oe({attributes:e.itemXOffset,blockAttrName:"itemXOffset",cssProp:e.itemImagePosition&&e.itemImagePosition.includes("right")?"right":"left"}),r=oe({attributes:e,blockAttrName:"itemImageZIndex",cssProp:"zIndex"}),s=ke()(a,i,o,r);((e,t=!0)=>{let a="";return Object.entries(e).map(([e,l])=>{a+=`${e.replace(/([A-Z])/g,(e,t,a)=>(a>0?"-":"")+e.toLowerCase())}: ${l} ${t?"!important":""};`}),a})(Q(s,l))&&g.push({selector:`.${n} .qi-block-parallax-images .qodef-m-images > *:nth-child(${t+2})`,styles:s})}),this.props.addPageStyle([{selector:`.${n}.qodef-block-container`,styles:c},{selector:`.${n} .qi-block-parallax-images`,styles:p},{selector:`.${n} .qi-block-parallax-images .qodef-e-main-image img`,styles:b},{selector:`.${n} .qi-block-parallax-images .qodef-e-parallax-image img`,styles:f},...g]),wp.element.createElement(wp.element.Fragment,null,wp.element.createElement(_e.InspectorControls,null,wp.element.createElement(y.TabPanel,{className:"qodef-tab-panel qodef--parallax-images",activeClass:"qodef--active",tabs:[{name:"content",title:(0,e.__)("Content","qi-blocks")},{name:"style",title:(0,e.__)("Style","qi-blocks")},{name:"advanced",title:(0,e.__)("Advanced","qi-blocks")}]},l=>wp.element.createElement(wp.element.Fragment,null,"content"===l.name&&wp.element.createElement(y.BaseControl,{className:"qodef-base-control-container"},wp.element.createElement(Ca,{label:(0,e.__)("Image","qi-blocks"),attrNameTemplate:"Main",blockAttributes:t,setAttributes:a,allowDefaultImage:!0}),wp.element.createElement(y.TextControl,{type:"number",label:(0,e.__)("Main Image Parallax Level","qi-blocks"),help:(0,e.__)("Enter custom image parallax level","qi-blocks"),min:0,value:o,onChange:e=>a({mainImageParallaxLevel:parseInt(e,10)})}),wp.element.createElement(xa,{label:(0,e.__)("Items","qi-blocks"),blockAttributeKey:"items",blockAttributes:t,setAttributes:a,options:[{label:(0,e.__)("Image","qi-blocks"),optionType:Ca,optionKey:"itemImage",optionDefaultValue:{image:{id:null,url:qiBlocksEditor.vars.defaultThumbnail,alt:qiBlocksEditor.vars.defaultImagePlaceholder},imageSize:"full"},optionAttributes:{allowDefaultImage:!0},advancedOptions:!0},{label:(0,e.__)("Image Position","qi-blocks"),optionType:y.SelectControl,optionKey:"itemImagePosition",optionDefaultValue:"bottom-left",optionAttributes:{options:[{value:"top-left",label:(0,e.__)("Top Left","qi-blocks")},{value:"top-right",label:(0,e.__)("Top Right","qi-blocks")},{value:"bottom-left",label:(0,e.__)("Bottom Left","qi-blocks")},{value:"bottom-right",label:(0,e.__)("Bottom Right","qi-blocks")}]}},{label:(0,e.__)("Image Width","qi-blocks"),optionType:ca,optionKey:"itemImageWidth",optionDefaultValue:{itemImageWidthUnit:"px",itemImageWidthUnitTablet:"px",itemImageWidthUnitMobile:"px"},optionAttributes:{rangeMax:500,rangeMin:0,rangeDecimalMax:100,unitType:"space",allowScreens:!0},advancedOptions:!0},{label:(0,e.__)("Vertical Offset","qi-blocks"),optionType:ca,optionKey:"itemYOffset",optionDefaultValue:{itemYOffsetUnit:"px",itemYOffsetUnitTablet:"px",itemYOffsetUnitMobile:"px"},optionAttributes:{rangeMax:200,rangeMin:-200,rangeDecimalMax:100,rangeDecimalMin:-100,unitType:"pxPercentVh",allowScreens:!0},advancedOptions:!0},{label:(0,e.__)("Horizontal Offset","qi-blocks"),optionType:ca,optionKey:"itemXOffset",optionDefaultValue:{itemXOffsetUnit:"px",itemXOffsetUnitTablet:"px",itemXOffsetUnitMobile:"px"},optionAttributes:{rangeMax:200,rangeMin:-200,rangeDecimalMax:100,rangeDecimalMin:-100,unitType:"pxPercentVw",allowScreens:!0},advancedOptions:!0},{label:(0,e.__)("Image Z Index","qi-blocks"),optionType:y.TextControl,optionKey:"itemImageZIndex",optionAttributes:{type:"number",min:-10,max:100}},{label:(0,e.__)("Image Parallax Level","qi-blocks"),optionType:y.TextControl,optionKey:"itemImageParallaxLevel",optionAttributes:{type:"number",min:-100,max:100}}]})),"style"===l.name&&wp.element.createElement(y.BaseControl,{className:"qodef-base-control-container"},wp.element.createElement(Te,{label:(0,e.__)("Padding","qi-blocks"),attrNameTemplate:"Main",attrName:"Padding",setAttributes:a,blockAttributes:t}),wp.element.createElement(ha,{label:(0,e.__)("Main Image Shadow","qi-blocks"),attrNameTemplate:"Main",blockAttributes:t,setAttributes:a,excludeOptions:["position"],popup:!0}),wp.element.createElement(ha,{label:(0,e.__)("Parallax Images Shadow","qi-blocks"),attrNameTemplate:"Parallax",blockAttributes:t,setAttributes:a,excludeOptions:["position"],popup:!0})),"advanced"===l.name&&wp.element.createElement(_a,{blockAttributes:t,setAttributes:a})))),wp.element.createElement("div",u,wp.element.createElement("div",{className:m,style:Q(p,l)},wp.element.createElement("div",{className:"qodef-m-images"},wp.element.createElement("div",{className:"qodef-e-main-image-holder"},wp.element.createElement("div",{className:"qodef-e-main-image-zoom-holder"},i&&i.url&&wp.element.createElement("div",{className:"qodef-e-main-image","data-parallax-main":d},wp.element.createElement("img",{className:""+(i.id?`wp-image-${i.id}`:""),src:i.url,alt:i.alt,style:Q(b,l)})))),r&&r.length>0&&r.map(e=>{let t=""!==ae(e.itemImageParallaxLevel)?ae(e.itemImageParallaxLevel):"";Number.isInteger(t)&&0===t&&(t="parallax-disabled");const a=oe({attributes:e.itemImageWidth,blockAttrName:"itemImageWidth",cssProp:"width"}),n=oe({attributes:e.itemYOffset,blockAttrName:"itemYOffset",cssProp:e.itemImagePosition&&e.itemImagePosition.includes("bottom")?"bottom":"top"}),i=oe({attributes:e.itemXOffset,blockAttrName:"itemXOffset",cssProp:e.itemImagePosition&&e.itemImagePosition.includes("right")?"right":"left"}),o=oe({attributes:e,blockAttrName:"itemImageZIndex",cssProp:"zIndex"}),r=ke()(a,n,i,o);return e.itemImage&&e.itemImage.image&&wp.element.createElement("div",{className:"qodef-e-parallax-image "+(e.itemImagePosition?"qodef-position--"+e.itemImagePosition:""),"data-parallax":t,style:Q(r,l)},wp.element.createElement("img",{className:""+(e.itemImage.image.id?`wp-image-${e.itemImage.image.id}`:""),src:e.itemImage.image.url,alt:e.itemImage.image.alt,style:Q(f,l)}))})))))}}ll.defaultProps={previewScreen:h};const nl=(0,ve.compose)(tl,Ha)(ll);class il extends ye.Component{render(){const{attributes:e}=this.props,{mainImage:t,mainImageParallaxLevel:a,items:l}=e,n=H(e);let i={className:G(e,"","parallax-images"),...W(e)};n&&(i.id=n);const o=Ae()($("parallax-images",this.props),{});let r=""!==ae(a)?ae(a):"";return""!==r&&Number.isInteger(r)&&0===parseInt(r,10)&&(r="parallax-disabled"),wp.element.createElement("div",i,wp.element.createElement("div",{className:o},wp.element.createElement("div",{className:"qodef-m-images"},wp.element.createElement("div",{className:"qodef-e-main-image-holder"},wp.element.createElement("div",{className:"qodef-e-main-image-zoom-holder"},t&&t.url&&wp.element.createElement("div",{className:"qodef-e-main-image","data-parallax-main":r},wp.element.createElement("img",{className:""+(t.id?`wp-image-${t.id}`:""),src:t.url,alt:t.alt})))),l&&l.length>0&&l.map(e=>{let t=""!==ae(e.itemImageParallaxLevel)?ae(e.itemImageParallaxLevel):"";return Number.isInteger(t)&&0===t&&(t="parallax-disabled"),e.itemImage&&e.itemImage.image&&wp.element.createElement("div",{className:"qodef-e-parallax-image "+(e.itemImagePosition?"qodef-position--"+e.itemImagePosition:""),"data-parallax":t},wp.element.createElement("img",{className:""+(e.itemImage.image.id?`wp-image-${e.itemImage.image.id}`:""),src:e.itemImage.image.url,alt:e.itemImage.image.alt}))}))))}}const ol=il,rl={attributes:{items:[{itemImage:{image:{id:null,url:qiBlocksEditor.vars.defaultThumbnail,alt:qiBlocksEditor.vars.defaultImagePlaceholder},imageSize:"full"},itemImagePosition:"bottom-left",itemImageWidth:{itemImageWidthUnit:"px",itemImageWidthUnitTablet:"px",itemImageWidthUnitMobile:"px"},itemYOffset:{itemYOffsetUnit:"px",itemYOffsetUnitTablet:"px",itemYOffsetUnitMobile:"px"},itemXOffset:{itemXOffsetUnit:"px",itemXOffsetUnitTablet:"px",itemXOffsetUnitMobile:"px"},itemImageZIndex:"",itemImageParallaxLevel:""},{itemImage:{image:{id:null,url:qiBlocksEditor.vars.defaultThumbnail,alt:qiBlocksEditor.vars.defaultImagePlaceholder},imageSize:"full"},itemImagePosition:"top-right",itemImageWidth:{itemImageWidthUnit:"px",itemImageWidthUnitTablet:"px",itemImageWidthUnitMobile:"px"},itemYOffset:{itemYOffsetUnit:"px",itemYOffsetUnitTablet:"px",itemYOffsetUnitMobile:"px"},itemXOffset:{itemXOffsetUnit:"px",itemXOffsetUnitTablet:"px",itemXOffsetUnitMobile:"px"},itemImageZIndex:"",itemImageParallaxLevel:""}],mainImage:{id:null,url:qiBlocksEditor.vars.defaultImage,alt:qiBlocksEditor.vars.defaultImagePlaceholder,custom_image_size:""}}};var sl,cl;function ul(){return ul=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},ul.apply(null,arguments)}const ml=e=>s.createElement("svg",ul({xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",width:24,height:24},e),sl||(sl=s.createElement("path",{fill:"none",d:"M11 18.459H7.5v2.042H20V4.5H7.5v5.959H11z"})),cl||(cl=s.createElement("path",{fill:"#EE2852",d:"M7 3v6.959H3v8h4v3.042h14V3zM4 16.959v-6h6v6H4m16 3.042H8v-2.042h3v-8H8V4h12z"})));(0,t.registerBlockType)("qi-blocks/parallax-images",{apiVersion:3,icon:wp.element.createElement(ml,null),title:(0,e.__)("Parallax Image Showcase","qi-blocks"),description:(0,e.__)("Create visually attractive sections with images that move independently at different speeds on scroll.","qi-blocks"),category:"qi-blocks",keywords:[(0,e.__)("parallax","qi-blocks"),(0,e.__)("creative","qi-blocks"),(0,e.__)("animation","qi-blocks"),(0,e.__)("animated","qi-blocks"),(0,e.__)("interactive","qi-blocks"),(0,e.__)("scroll","qi-blocks"),(0,e.__)("qi","qi-blocks")],attributes:be,example:rl,edit:nl,save:ol})})()})();