@emailmaker/emailmaker 1.0.117-alpha.3 → 1.0.117-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.en.md +40 -3
- package/CHANGELOG.md +40 -0
- package/README.md +3 -2
- package/asset-manifest.json +44 -38
- package/emailmaker-esm.js +1 -1
- package/emailmaker.d.ts +7 -0
- package/emailmaker.js +1 -1
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/css/sandbox-dark.css +8 -0
- package/iframe/css/sandbox-light.css +8 -0
- package/iframe/css/sandbox.css +32 -0
- package/iframe/iframe-eblock.3d39ec0d6695dfd04dfe.html +1 -0
- package/iframe/iframe.3d39ec0d6695dfd04dfe.html +1 -0
- package/iframe/index.html +1 -1
- package/iframe/js/525.f6e2f6b3.js +1 -0
- package/iframe/js/781.94ac3161.js +1 -0
- package/iframe/js/{667.a3109c1d.js.LICENSE.txt → 781.94ac3161.js.LICENSE.txt} +2 -0
- package/iframe/js/882.7804f4a0.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/iframe/sandbox-eblock.js.LICENSE.txt +0 -2
- package/package.json +1 -1
- package/react/index.js +1 -1
- package/react/index.mjs +1 -1
- package/static/css/2016.6d88154a.chunk.css +2 -0
- package/static/css/2854.eaf83aed.chunk.css +2 -0
- package/static/css/8727.566a7baa.chunk.css +2 -0
- package/static/css/main.ec0d79d0.css +2 -0
- package/static/js/{1807.2f873ba8.js → 1807.544be549.js} +3 -3
- package/static/js/{1902.59ed55f8.js → 1902.46b497c9.js} +3 -3
- package/static/js/{5072.a7444daa.js → 2016.d527f648.js} +3 -3
- package/static/js/{262.3062229e.js → 262.a0c80d6d.js} +3 -3
- package/static/js/3195.56b10745.js +2 -0
- package/static/js/6256.e81830e2.js +2 -0
- package/static/js/{1716.2d977604.js → 6802.8b81b864.js} +3 -3
- package/static/js/7251.a53ab2ce.js +2 -0
- package/static/js/817.00be8b68.js +2 -0
- package/static/js/8245.117e8e2d.js +2 -0
- package/static/js/8559.f5ef7cd8.js +3 -0
- package/static/js/8727.11fb3035.js +2 -0
- package/static/js/9688.dddd5b80.js +2 -0
- package/static/js/emailmaker_core.767054b1.js +2 -0
- package/iframe/iframe-eblock.6ba89053b8c4bd89671b.html +0 -1
- package/iframe/iframe.6ba89053b8c4bd89671b.html +0 -1
- package/iframe/js/525.2a5bee62.js +0 -1
- package/iframe/js/667.a3109c1d.js +0 -1
- package/iframe/js/882.b65c6b97.js +0 -1
- package/iframe/js/882.b65c6b97.js.LICENSE.txt +0 -1
- package/static/css/2854.257728de.chunk.css +0 -2
- package/static/css/5072.72467a43.chunk.css +0 -2
- package/static/css/8727.2f8ba497.chunk.css +0 -2
- package/static/css/main.4fad2cb5.css +0 -2
- package/static/js/5243.413e6220.js +0 -3
- package/static/js/817.93306766.js +0 -2
- package/static/js/8245.d98fa2d7.js +0 -2
- package/static/js/8727.ef480f4b.js +0 -2
- package/static/js/9535.1da6d801.js +0 -2
- package/static/js/emailmaker_core.d8816d78.js +0 -2
- /package/iframe/js/{525.2a5bee62.js.LICENSE.txt → 525.f6e2f6b3.js.LICENSE.txt} +0 -0
- /package/static/js/{1807.2f873ba8.js.LICENSE.txt → 1807.544be549.js.LICENSE.txt} +0 -0
- /package/static/js/{1902.59ed55f8.js.LICENSE.txt → 1902.46b497c9.js.LICENSE.txt} +0 -0
- /package/static/js/{5072.a7444daa.js.LICENSE.txt → 2016.d527f648.js.LICENSE.txt} +0 -0
- /package/static/js/{262.3062229e.js.LICENSE.txt → 262.a0c80d6d.js.LICENSE.txt} +0 -0
- /package/static/js/{1716.2d977604.js.LICENSE.txt → 6802.8b81b864.js.LICENSE.txt} +0 -0
- /package/static/js/{5243.413e6220.js.LICENSE.txt → 8559.f5ef7cd8.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 8559.f5ef7cd8.js.LICENSE.txt */
|
|
2
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8559],{78559:(e,t,r)=>{var n;r.d(t,{F:()=>js,N:()=>Qi,P:()=>BM,a:()=>Xi,b:()=>Zi,c:()=>gM,d:()=>Ka,e:()=>so,f:()=>Co,g:()=>Ms,h:()=>gr,i:()=>hi,j:()=>ca,k:()=>ua,l:()=>fa,m:()=>di,n:()=>fr,o:()=>Kn,p:()=>Fs,q:()=>ro,r:()=>Gn,s:()=>ti,t:()=>ln,u:()=>Sn,x:()=>zM});var i=r(81516),o=r(1936),a=r(55054),s=r(52225),l=r(18021),c=r(27335),u=r(97508),d=r(92416),h=r(92927),f=r(28380),p=r(5464),g=r(236),m=r(59878),v=r(69588),y=r(90947),b=r(77550),w=r(94533),x=r(21261),C=r(7494),_=r(32380),S=r(14516),A=r(60369),k=r(77190),E=r(68076),I=r(52802),j=r(51114),T=r(32357),F=r(22722),O=r(54760),M=r(3636),P=r(30290),R=r(32937),L=r(83215),N=r(50186),D=r(92828),z=r(33486),B=r(14638),U=r(58937),V=r(74168),H=r(484),W=r(8647),$=r(73394),q=r(21986),G=r(5199),Y=r(56400),X=r(50088),K=r(90669),Z=r(71282),Q=r(67791),J=r(11930),ee=r(52433),te=r(53082),re=r(60222),ne=r(9438),ie=r(78811),oe=r(86588),ae=r(91796),se=r(96526),le=r(18005),ce=r(91691).Buffer;function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function de(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ue(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ue(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.")}()}function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function fe(e){var t=function(e,t){if("object"!=he(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==he(t)?t:t+""}function pe(e,t,r){return(t=fe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(r),!0).forEach(function(t){pe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ve={},ye=[];function be(e,t){}function we(e,t){}function xe(e,t,r){t||ve[r]||(e(!1,r),ve[r]=!0)}function Ce(e,t){xe(be,e,t)}function _e(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new Set;return function e(t,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=n.has(t);if(Ce(!a,"Warning: There may be circular references"),a)return!1;if(t===i)return!0;if(r&&o>1)return!1;n.add(t);var s=o+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var l=0;l<t.length;l++)if(!e(t[l],i[l],s))return!1;return!0}if(t&&i&&"object"===he(t)&&"object"===he(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every(function(r){return e(t[r],i[r],s)})}return!1}(e,t)}function Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ae(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fe(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ke(e){return e.join("%")}Ce.preMessage=function(e){ye.push(e)},Ce.resetWarned=function(){ve={}},Ce.noteOnce=function(e,t){xe(we,e,t)};var Ee=function(){function e(t){Se(this,e),pe(this,"instanceId",void 0),pe(this,"cache",new Map),pe(this,"extracted",new Set),this.instanceId=t}return Ae(e,[{key:"get",value:function(e){return this.opGet(ke(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(ke(e),t)}},{key:"opUpdate",value:function(e,t){var r=t(this.cache.get(e));null===r?this.cache.delete(e):this.cache.set(e,r)}}]),e}(),Ie=["children"],je="data-css-hash",Te="__cssinjs_instance__";function Fe(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(je,"]"))||[],r=document.head.firstChild;Array.from(t).forEach(function(t){t[Te]=t[Te]||e,t[Te]===e&&document.head.insertBefore(t,r)});var n={};Array.from(document.querySelectorAll("style[".concat(je,"]"))).forEach(function(t){var r,i=t.getAttribute(je);n[i]?t[Te]===e&&(null===(r=t.parentNode)||void 0===r||r.removeChild(t)):n[i]=!0})}return new Ee(e)}var Oe=o.createContext({hashPriority:"low",cache:Fe(),defaultCache:!0}),Me=function(e){var t,r,n,i,a=e.children,s=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Ie),l=o.useContext(Oe),c=(t=function(){var e=me({},l);Object.keys(s).forEach(function(t){var r=s[t];void 0!==s[t]&&(e[t]=r)});var t=s.cache;return e.cache=e.cache||Fe(),e.defaultCache=!t&&l.defaultCache,e},r=[l,s],n=function(e,t){return!_e(e[0],t[0],!0)||!_e(e[1],t[1],!0)},"value"in(i=o.useRef({})).current&&!n(i.current.condition,r)||(i.current.value=t(),i.current.condition=r),i.current.value);return o.createElement(Oe.Provider,{value:c},a)},Pe=function(){function e(){Se(this,e),pe(this,"cache",void 0),pe(this,"keys",void 0),pe(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return Ae(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={map:this.cache};return e.forEach(function(e){var t;i=i?null===(t=i)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e):void 0}),null!==(t=i)&&void 0!==t&&t.value&&n&&(i.value[1]=this.cacheCallTimes++),null===(r=i)||void 0===r?void 0:r.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,r){var n=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var i=this.keys.reduce(function(e,t){var r=de(e,2)[1];return n.internalGet(t)[1]<r?[t,n.internalGet(t)[1]]:e},[this.keys[0],this.cacheCallTimes]),o=de(i,1)[0];this.delete(o)}this.keys.push(t)}var a=this.cache;t.forEach(function(e,i){if(i===t.length-1)a.set(e,{value:[r,n.cacheCallTimes++]});else{var o=a.get(e);o?o.map||(o.map=new Map):a.set(e,{map:new Map}),a=a.get(e).map}})}},{key:"deleteByPath",value:function(e,t){var r,n=e.get(t[0]);if(1===t.length)return n.map?e.set(t[0],{map:n.map}):e.delete(t[0]),null===(r=n.value)||void 0===r?void 0:r[0];var i=this.deleteByPath(n.map,t.slice(1));return n.map&&0!==n.map.size||n.value||e.delete(t[0]),i}},{key:"delete",value:function(e){if(this.has(e))return this.keys=this.keys.filter(function(t){return!function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(t,e)}),this.deleteByPath(this.cache,e)}}]),e}();function Re(e,t,r){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4])return e;var n=me(me({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},pe(pe({},"data-token-hash",t),je,r)),i=Object.keys(n).map(function(e){var t=n[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"<style ".concat(i,">").concat(e,"</style>")}pe(Pe,"MAX_CACHE_SIZE",20),pe(Pe,"MAX_CACHE_OFFSET",5),new Pe,"undefined"!=typeof window&&window.document&&window.document.createElement?o.useLayoutEffect:o.useEffect,me({},n||(n=r.t(o,2))).useInsertionEffect,me({},n||(n=r.t(o,2))).useInsertionEffect;var Le="comm",Ne="rule",De="decl",ze=Math.abs,Be=String.fromCharCode;function Ue(e){return e.trim()}function Ve(e,t,r){return e.replace(t,r)}function He(e,t,r){return e.indexOf(t,r)}function We(e,t){return 0|e.charCodeAt(t)}function $e(e,t,r){return e.slice(t,r)}function qe(e){return e.length}function Ge(e,t){return t.push(e),e}var Ye=1,Xe=1,Ke=0,Ze=0,Qe=0,Je="";function et(e,t,r,n,i,o,a,s){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Ye,column:Xe,length:a,return:"",siblings:s}}function tt(){return Qe=Ze>0?We(Je,--Ze):0,Xe--,10===Qe&&(Xe=1,Ye--),Qe}function rt(){return Qe=Ze<Ke?We(Je,Ze++):0,Xe++,10===Qe&&(Xe=1,Ye++),Qe}function nt(){return We(Je,Ze)}function it(){return Ze}function ot(e,t){return $e(Je,e,t)}function at(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function st(e){return Ue(ot(Ze-1,ut(91===e?e+2:40===e?e+1:e)))}function lt(e){for(;(Qe=nt())&&Qe<33;)rt();return at(e)>2||at(Qe)>3?"":" "}function ct(e,t){for(;--t&&rt()&&!(Qe<48||Qe>102||Qe>57&&Qe<65||Qe>70&&Qe<97););return ot(e,it()+(t<6&&32==nt()&&32==rt()))}function ut(e){for(;rt();)switch(Qe){case e:return Ze;case 34:case 39:34!==e&&39!==e&&ut(Qe);break;case 40:41===e&&ut(e);break;case 92:rt()}return Ze}function dt(e,t){for(;rt()&&e+Qe!==57&&(e+Qe!==84||47!==nt()););return"/*"+ot(t,Ze-1)+"*"+Be(47===e?e:rt())}function ht(e){for(;!at(nt());)rt();return ot(e,Ze)}function ft(e){return function(e){return Je="",e}(pt("",null,null,null,[""],e=function(e){return Ye=Xe=1,Ke=qe(Je=e),Ze=0,[]}(e),0,[0],e))}function pt(e,t,r,n,i,o,a,s,l){for(var c=0,u=0,d=a,h=0,f=0,p=0,g=1,m=1,v=1,y=0,b="",w=i,x=o,C=n,_=b;m;)switch(p=y,y=rt()){case 40:if(108!=p&&58==We(_,d-1)){-1!=He(_+=Ve(st(y),"&","&\f"),"&\f",ze(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:_+=st(y);break;case 9:case 10:case 13:case 32:_+=lt(p);break;case 92:_+=ct(it()-1,7);continue;case 47:switch(nt()){case 42:case 47:Ge(mt(dt(rt(),it()),t,r,l),l),5!=at(p||1)&&5!=at(nt()||1)||!qe(_)||" "===$e(_,-1,void 0)||(_+=" ");break;default:_+="/"}break;case 123*g:s[c++]=qe(_)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(_=Ve(_,/\f/g,"")),f>0&&(qe(_)-d||0===g&&47===p)&&Ge(f>32?vt(_+";",n,r,d-1,l):vt(Ve(_," ","")+";",n,r,d-2,l),l);break;case 59:_+=";";default:if(Ge(C=gt(_,t,r,c,u,i,s,b,w=[],x=[],d,o),o),123===y)if(0===u)pt(_,t,C,C,w,o,d,s,x);else{switch(h){case 99:if(110===We(_,3))break;case 108:if(97===We(_,2))break;default:u=0;case 100:case 109:case 115:}u?pt(e,C,C,n&&Ge(gt(e,C,C,0,0,i,s,b,i,w=[],d,x),x),i,x,d,s,n?w:x):pt(_,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=_="",d=a;break;case 58:d=1+qe(_),f=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==tt())continue;switch(_+=Be(y),y*g){case 38:v=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(qe(_)-1)*v,v=1;break;case 64:45===nt()&&(_+=st(rt())),h=nt(),u=d=qe(b=_+=ht(it())),y++;break;case 45:45===p&&2==qe(_)&&(g=0)}}return o}function gt(e,t,r,n,i,o,a,s,l,c,u,d){for(var h=i-1,f=0===i?o:[""],p=function(e){return e.length}(f),g=0,m=0,v=0;g<n;++g)for(var y=0,b=$e(e,h+1,h=ze(m=a[g])),w=e;y<p;++y)(w=Ue(m>0?f[y]+" "+b:Ve(b,/&\f/g,f[y])))&&(l[v++]=w);return et(e,t,r,0===i?Ne:s,l,c,u,d)}function mt(e,t,r,n){return et(e,t,r,Le,Be(Qe),$e(e,2,-2),0,n)}function vt(e,t,r,n,i){return et(e,t,r,De,$e(e,0,n),$e(e,n+1,-1),n,i)}function yt(e,t){for(var r="",n=0;n<e.length;n++)r+=t(e[n],n,e,t)||"";return r}function bt(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case De:return e.return=e.return||e.value;case Le:return"";case"@keyframes":return e.return=e.value+"{"+yt(e.children,n)+"}";case Ne:if(!qe(e.value=e.props.join(",")))return""}return qe(r=yt(e.children,n))?e.return=e.value+"{"+r+"}":""}function wt(e){return e.notSplit=!0,e}pe(pe(pe({},"style",function(e,t,r){var n=de(e,6),i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=(r||{}).plain;if(l)return null;var d=i,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(c)};return d=Re(i,o,a,h,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var r=function(e){return yt(ft(e),bt).replace(/\{%%%\:[^;];}/g,";")}(s[e]),n=Re(r,o,"_effect-".concat(e),h,u);e.startsWith("@layer")?d=n+d:d+=n}}),[c,a,d]}),"token",function(e,t,r){var n=de(e,5),i=n[2],o=n[3],a=n[4],s=(r||{}).plain;if(!o)return null;var l=i._tokenKey;return[-999,l,Re(o,a,l,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]}),"cssVar",function(e,t,r){var n=de(e,4),i=n[1],o=n[2],a=n[3],s=(r||{}).plain;return i?[-999,o,Re(i,a,o,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]:null}),wt(["borderTop","borderBottom"]),wt(["borderTop"]),wt(["borderBottom"]),wt(["borderLeft","borderRight"]),wt(["borderLeft"]),wt(["borderRight"]);const xt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function Ct(e,t){return t}function _t(e,t){return e.filter(e=>void 0!==e)}var St,At;function kt(e){return"object"!=typeof e||null===e?0:Array.isArray(e)?2:function(e){if(!jt.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(void 0===t)return!0;const r=t.prototype;return!(null===r||"object"!=typeof r||!jt.includes(Object.prototype.toString.call(r)))&&!!r.hasOwnProperty("isPrototypeOf")}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function Et(e,t){return"object"==typeof e&&Object.prototype.propertyIsEnumerable.call(e,t)}function It(e){let t=0,r=e[0]?.[Symbol.iterator]();return{[Symbol.iterator]:()=>({next(){for(;;){if(void 0===r)return{done:!0,value:void 0};const n=r.next();if(!0!==n.done)return{done:!1,value:n.value};t+=1,r=e[t]?.[Symbol.iterator]()}}})}}(At=St||(St={}))[At.NOT=0]="NOT",At[At.RECORD=1]="RECORD",At[At.ARRAY=2]="ARRAY",At[At.SET=3]="SET",At[At.MAP=4]="MAP",At[At.OTHER=5]="OTHER";const jt=["[object Object]","[object Module]"],Tt={mergeRecords:function(e,t,r){const n={};for(const i of function(e){const t=new Set;for(const r of e)for(const e of[...Object.keys(r),...Object.getOwnPropertySymbols(r)])t.add(e);return t}(e)){const o=[];for(const t of e)Et(t,i)&&o.push(t[i]);if(0===o.length)continue;const a=t.metaDataUpdater(r,{key:i,parents:e}),s=Ft(o,t,a);s!==xt.skip&&("__proto__"===i?Object.defineProperty(n,i,{value:s,configurable:!0,enumerable:!0,writable:!0}):n[i]=s)}return n},mergeArrays:function(e){return e.flat()},mergeSets:function(e){return new Set(It(e))},mergeMaps:function(e){return new Map(It(e))},mergeOthers:function(e){return e.at(-1)}};function Ft(e,t,r){const n=t.filterValues?.(e,r)??e;if(0===n.length)return;if(1===n.length)return Ot(n,t,r);const i=kt(n[0]);if(0!==i&&5!==i)for(let o=1;o<n.length;o++)if(kt(n[o])!==i)return Ot(n,t,r);switch(i){case 1:return function(e,t,r){const n=t.mergeFunctions.mergeRecords(e,t,r);return n===xt.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,r):n}(n,t,r);case 2:return function(e,t,r){const n=t.mergeFunctions.mergeArrays(e,t,r);return n===xt.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):n}(n,t,r);case 3:return function(e,t,r){const n=t.mergeFunctions.mergeSets(e,t,r);return n===xt.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):n}(n,t,r);case 4:return function(e,t,r){const n=t.mergeFunctions.mergeMaps(e,t,r);return n===xt.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):n}(n,t,r);default:return Ot(n,t,r)}}function Ot(e,t,r){const n=t.mergeFunctions.mergeOthers(e,t,r);return n===xt.defaultMerge||t.useImplicitDefaultMerging&&void 0===n&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):n}const Mt="my_files",Pt="gif",Rt="stock_images",Lt="icons",Nt="ai",Dt="image_codes",zt="editor",Bt="Trash",Ut="light",Vt="dark",Ht="system",Wt="(prefers-color-scheme: dark)",$t="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",qt=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif"],Gt=["jpg","jpeg","png","bmp","webp","svg","ico","tiff","tif","gif"],Yt={keywords:"",color:"",orientation:""};s.A.setDefaultIndicator((0,i.jsx)(()=>(0,i.jsx)(B.A,{style:{fontSize:48,height:"100%"},spin:!0}),{}));const Xt={hashed:!1,algorithm:l.A.defaultAlgorithm,token:{colorLink:"#1677ff",colorInfo:"#722ed1",colorTextBase:"#000000",colorBgLayout:"#f0f2f5",borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},components:{Progress:{colorFillSecondary:"#ffffff"},Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},Kt={hashed:!1,algorithm:l.A.darkAlgorithm,token:{colorBgBase:"#1F1F1F",colorInfo:"#9254de",colorLink:"#1890ff",colorLinkHover:"#69c0ff",wireframe:!1,borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,borderWidth:1,colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},components:{Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},Zt=({externalTheme:e=Ut,children:t,customThemeToken:r})=>{const n=matchMedia(Wt).matches?Vt:Ut,a=e===Ht?n:e,[s,l]=(0,o.useState)(a),[d,h]=(0,o.useState)("light"===s?Xt:Kt);return(0,o.useEffect)(()=>{l(a)},[a]),(0,o.useEffect)(()=>{const e="light"===s?Xt:Kt,t=r?function(...e){return function(){const e=function(e,t){return{defaultMergeFunctions:Tt,mergeFunctions:{...Tt,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(Tt,e)).map(([e,t])=>!1===t?[e,Tt.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??Ct,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:!1===e.filterValues?void 0:e.filterValues??_t,actions:xt}}({},t);function t(...t){return Ft(t,e,void 0)}return t}()(...e)}(e.token,r):e.token;h(Object.assign(Object.assign({},e),{token:t}))},[h,s,r]),(0,i.jsx)("div",{id:"file-manager-element-id",style:{height:"100%"},children:(0,i.jsx)(c.Ay,{theme:d,children:(0,i.jsx)(Me,{transformers:[],children:(0,i.jsx)(u.A,{style:{height:"100%"},children:t})})})})};let Qt=!1;const Jt=()=>{if(Qt)return;window.addEventListener("error",e=>!(!e.message||!e.message.includes("ResizeObserver loop completed with undelivered notifications"))&&(e.stopImmediatePropagation(),e.preventDefault(),!0),!0);const e=window.onerror;window.onerror=(t,r,n,i,o)=>!("string"!=typeof t||!t.includes("ResizeObserver loop completed with undelivered notifications"))||!!e&&e(t,r,n,i,o),window.addEventListener("unhandledrejection",e=>{var t,r;(null===(r=null===(t=e.reason)||void 0===t?void 0:t.message)||void 0===r?void 0:r.includes("ResizeObserver loop completed with undelivered notifications"))&&e.preventDefault()});const t=console.error;if(console.error=(...e)=>{var r;((null===(r=e[0])||void 0===r?void 0:r.toString())||"").includes("ResizeObserver loop completed with undelivered notifications")||t.apply(console,e)},"undefined"!=typeof window){const e=()=>{try{["webpackHotUpdate","__webpack_require__","__webpack_hash__"].forEach(e=>{if(window[e]){window.__webpack_require__}})}catch(e){}};e(),setTimeout(e,1e3)}Qt=!0},er=e=>{if(!e)return"image/png";const t=e.toLowerCase();return t.includes("jpeg")||t.includes("jpg")||t.includes("pjpeg")?"image/jpeg":t.includes("png")?"image/png":t.includes("gif")?"image/gif":t.includes("webp")?"image/webp":t.includes("svg")?"image/svg+xml":"image/png"},tr=e=>{if(!e.startsWith("data:"))return null;const t=e.match(/^data:([^;,]+)/);return t?t[1]:null},rr=(e,t="image/png")=>{let r=t;if("string"==typeof e&&e.startsWith("data:")){const t=tr(e);t&&t.startsWith("image/")&&(r=t)}return er(r)},nr=e=>{const t=er(e).split("/")[1];return"svg+xml"===t?"svg":t||"png"};function ir(e){var t;switch(null===(t=e.trim().split(".").pop())||void 0===t?void 0:t.toLowerCase()){case"svg":return"image/svg+xml";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"webp":return"image/webp";default:return}}function or(e){var t,r,n,i;if(null===(r=null===(t=e.type)||void 0===t?void 0:t.startsWith)||void 0===r?void 0:r.call(t,"image/"))return!0;const o=(null!==(n=e.name)&&void 0!==n?n:"").trim();if(ir(o))return!0;const a=(null!==(i=e.type)&&void 0!==i?i:"").toLowerCase();return!!a.includes("svg")||("text/xml"===a||"application/xml"===a||"text/plain"===a)&&o.toLowerCase().endsWith(".svg")}const ar=/^data:(.+?);base64,(.+)$/i,sr=(e,t)=>{const r=(e=>{const t=(e=>{if("function"!=typeof globalThis.atob)throw new Error("Base64 decoding is not supported in the current environment.");return globalThis.atob(e)})(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n})(e.replace(/\s/g,"")),n=new ArrayBuffer(r.length);return new Uint8Array(n).set(r),new Blob([n],{type:t})},lr=(e,t="application/octet-stream")=>{if(e instanceof Blob)return e;if("string"==typeof e){const r=e.trim(),n=r.match(ar);if(n){const[,e,t]=n;return sr(t,e)}return sr(r,t)}throw new Error("Unsupported data type. Expected Blob or base64 string.")},cr={"\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0451":"yo","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"y","\u043a":"k","\u043b":"l","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"ts","\u0447":"ch","\u0448":"sh","\u0449":"sch","\u044a":"","\u044b":"y","\u044c":"","\u044d":"e","\u044e":"yu","\u044f":"ya","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0401":"Yo","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"Y","\u041a":"K","\u041b":"L","\u041c":"M","\u041d":"N","\u041e":"O","\u041f":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"Ts","\u0427":"Ch","\u0428":"Sh","\u0429":"Sch","\u042a":"","\u042b":"Y","\u042c":"","\u042d":"E","\u042e":"Yu","\u042f":"Ya"},ur=/[<>:"/\\|?*()#\x00-\x1f]/g,dr={transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0};function hr(e,t){let r=e;return t.transliterate&&(r=r.normalize("NFC").split("").map(e=>{var t;return null!==(t=cr[e])&&void 0!==t?t:e}).join("")),t.removeForbiddenChars&&(r=r.replace(ur,"_")),t.replaceSpaces&&(r=r.replace(/\s+/g,"_")),t.toLowerCase&&(r=r.toLowerCase()),r=r.replace(/_{2,}/g,"_"),r=r.replace(/^_+|_+$/g,""),r.length>255&&(r=r.substring(0,255)),r}function fr(e,t){const r=Object.assign(Object.assign({},dr),null==t?void 0:t.fileNameProcessing),n=e.lastIndexOf(".");let i,o;return n>0?(i=e.substring(0,n),o=e.substring(n).toLowerCase()):(i=e,o=""),(hr(i,r)||"unnamed_file")+o}function pr(e,t){return hr(e,Object.assign(Object.assign({},dr),null==t?void 0:t.folderNameProcessing))||"unnamed_folder"}function gr(e){return!0===(null==e?void 0:e.dedupeUploadNamesOnClient)}const mr=e=>"string"==typeof e,vr=()=>{let e,t;const r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},yr=e=>null==e?"":""+e,br=/###/g,wr=e=>e&&e.indexOf("###")>-1?e.replace(br,"."):e,xr=e=>!e||mr(e),Cr=(e,t,r)=>{const n=mr(t)?t.split("."):t;let i=0;for(;i<n.length-1;){if(xr(e))return{};const t=wr(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return xr(e)?{}:{obj:e,k:wr(n[i])}},_r=(e,t,r)=>{const{obj:n,k:i}=Cr(e,t,Object);if(void 0!==n||1===t.length)return void(n[i]=r);let o=t[t.length-1],a=t.slice(0,t.length-1),s=Cr(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=Cr(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},Sr=(e,t)=>{const{obj:r,k:n}=Cr(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Ar=(e,t,r)=>{for(const n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?mr(e[n])||e[n]instanceof String||mr(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):Ar(e[n],t[n],r):e[n]=t[n]);return e},kr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Er={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Ir=e=>mr(e)?e.replace(/[&<>"'\/]/g,e=>Er[e]):e,jr=[" ",",","?","!",";"],Tr=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),Fr=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const n=t.split(r);let i=e;for(let o=0;o<n.length;){if(!i||"object"!=typeof i)return;let e,t="";for(let a=o;a<n.length;++a)if(a!==o&&(t+=r),t+=n[a],e=i[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<n.length-1)continue;o+=a-o+1;break}i=e}return i},Or=e=>e?.replace("_","-"),Mr={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class Pr{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Mr,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,r,n){return n&&!this.debug?null:(mr(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Pr(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Pr(this.logger,e)}}var Rr=new Pr;class Lr{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const r=this.observers[e].get(t)||0;this.observers[e].set(t,r+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}class Nr extends Lr{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,r,n={}){const i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],r&&(Array.isArray(r)?a.push(...r):mr(r)&&i?a.push(...r.split(i)):a.push(r)));const s=Sr(this.data,a);return!s&&!t&&!r&&e.indexOf(".")>-1&&(e=a[0],t=a[1],r=a.slice(2).join(".")),!s&&o&&mr(r)?Fr(this.data?.[e]?.[t],r,i):s}addResource(e,t,r,n,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),_r(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(const i in r)(mr(r[i])||Array.isArray(r[i]))&&this.addResource(e,t,i,r[i],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=r,r=t,t=a[1]),this.addNamespaces(t);let s=Sr(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?Ar(s,r,i):s={...s,...r},_r(this.data,a,s),o.silent||this.emit("added",e,t,r)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Dr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,i)??t}),t}};const zr=Symbol("i18next/PATH_KEY");function Br(e,t){const{[zr]:r}=e(function(){const e=[],t=Object.create(null);let r;return t.get=(n,i)=>(r?.revoke?.(),i===zr?e:(e.push(i),r=Proxy.revocable(n,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return r.join(t?.keySeparator??".")}const Ur={},Vr=e=>!mr(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Hr extends Lr{constructor(e,t={}){super(),((e,t,r)=>{["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{t[e]&&(r[e]=t[e])})})(0,e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Rr.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const r={...t};if(null==e)return!1;const n=this.resolve(e,r);return void 0!==n?.res}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");const n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,r)=>{t=t||"",r=r||"";const n=jr.filter(e=>t.indexOf(e)<0&&r.indexOf(e)<0);if(0===n.length)return!0;const i=Tr.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(r);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,r,n));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:mr(i)?[i]:i};const o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(n)}return{key:e,namespaces:mr(i)?[i]:i}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=Br(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1];let c=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?i?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${c}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;const h=this.resolve(e,n);let f=h?.res;const p=h?.usedKey||a,g=h?.exactUsedKey||a,m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==n.count&&!mr(n.count),b=Hr.hasDefaultValue(n),w=y?this.pluralResolver.getSuffix(u,n.count,n):"",x=n.ordinal&&y?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",C=y&&!n.ordinal&&0===n.count,_=C&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${w}`]||n[`defaultValue${x}`]||n.defaultValue;let S=f;v&&!f&&b&&(S=_);const A=Vr(S),k=Object.prototype.toString.apply(S);if(!(v&&S&&A&&["[object Number]","[object Function]","[object RegExp]"].indexOf(k)<0)||mr(m)&&Array.isArray(S))if(v&&mr(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,e,n,r));else{let t=!1,i=!1;!this.isValidLookup(f)&&b&&(t=!0,f=_),this.isValidLookup(f)||(i=!0,f=a);const s=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=b&&_!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,a,d?_:f),o){const e=this.resolve(a,{...n,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);const r=(e,t,r)=>{const i=b&&r!==f?r:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,n),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,n);C&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],a+t,n[`defaultValue${t}`]||_)})}):r(e,a,_))}f=this.extendTranslation(f,e,n,h,r),i&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?f:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,S,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(n),h):e}if(o){const e=Array.isArray(S),t=e?[]:{},r=e?g:p;for(const i in S)if(Object.prototype.hasOwnProperty.call(S,i)){const e=`${r}${o}${i}`;t[i]=b&&!f?this.translate(e,{...n,defaultValue:Vr(_)?_[i]:void 0,joinArrays:!1,ns:s}):this.translate(e,{...n,joinArrays:!1,ns:s}),t[i]===e&&(t[i]=S[i])}f=t}}return i?(h.res=f,h.usedParams=this.getUsedParamsDetails(n),h):f}extendTranslation(e,t,r,n,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const o=mr(e)&&(void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=r.replace&&!mr(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,r.lng||this.language||n.usedLng,r),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,a=mr(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=Dr.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,i,o,a;return mr(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(r))return;const s=this.extractFromKey(e,t),l=s.key;n=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!mr(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(mr(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(r)||(a=e,Ur[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(Ur[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(n=>{if(this.isValidLookup(r))return;o=n;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(n,t.count,t));const r=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(i)&&a.push(l+e.replace(i,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+r)),h){const n=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(n),u&&(t.ordinal&&0===e.indexOf(i)&&a.push(n+e.replace(i,this.options.pluralSeparator)),a.push(n+e),d&&a.push(n+r))}}let s;for(;s=a.pop();)this.isValidLookup(r)||(i=s,r=this.getResource(n,e,s,t))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!mr(e.replace);let n=r?e.replace:e;if(r&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!r){n={...n};for(const e of t)delete n[e]}return n}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class Wr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Rr.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Or(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Or(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(mr(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const r=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(r)||(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),mr(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){const r=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],i=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return mr(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):mr(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{n.indexOf(e)<0&&i(this.formatLanguageCode(e))}),n}}const $r={zero:0,one:1,two:2,few:3,many:4,other:5},qr={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Gr{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Rr.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const r=Or("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:n})}catch(r){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),qr;if(!e.match(/-|_/))return qr;const n=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(n,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?r.resolvedOptions().pluralCategories.sort((e,t)=>$r[e]-$r[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){const n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}const Yr=(e,t,r,n=".",i=!0)=>{let o=((e,t,r)=>{const n=Sr(e,r);return void 0!==n?n:Sr(t,r)})(e,t,r);return!o&&i&&mr(r)&&(o=Fr(e,r,n),void 0===o&&(o=Fr(t,r,n))),o},Xr=e=>e.replace(/\$/g,"$$$$");class Kr{constructor(e={}){this.logger=Rr.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:Ir,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?kr(i):o||"{{",this.suffix=a?kr(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?kr(d):h||kr("$t("),this.nestingSuffix=f?kr(f):p||kr(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,r,n){let i,o,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=Yr(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,r,{...n,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(Yr(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,r,{...n,...t,interpolationkey:o})};this.resetRegExp();const c=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Xr(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Xr(this.escape(e)):Xr(e)}].forEach(t=>{for(a=0;i=t.regex.exec(e);){const r=i[1].trim();if(o=l(r),void 0===o)if("function"==typeof c){const t=c(e,i,n);o=mr(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))o="";else{if(u){o=i[0];continue}this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),o=""}else mr(o)||this.useRawValueToEscape||(o=yr(o));const s=t.safeValue(o);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,i,o;const a=(e,t)=>{const r=this.nestingOptionsSeparator;if(e.indexOf(r)<0)return e;const n=e.split(new RegExp(`${r}[ ]*{`));let i=`{${n[1]}`;e=n[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);((a?.length??0)%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];o={...r},o=o.replace&&!mr(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==l&&(s=n[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),i=t(a.call(this,n[1].trim(),o),o),i&&n[0]===e&&!mr(i))return i;mr(i)||(i=yr(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}const Zr=e=>{const t={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=n+JSON.stringify(o);let s=t[a];return s||(s=e(Or(n),i),t[a]=s),s(r)}},Qr=e=>(t,r,n)=>e(Or(r),n)(t);class Jr{constructor(e={}){this.logger=Rr.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const r=t.cacheInBuiltFormats?Zr:Qr;this.formats={number:r((e,t)=>{const r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{const r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{const r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{const r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{const r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Zr(t)}format(e,t,r,n={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(e=>e.indexOf(")")>-1)){const e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const o=i.reduce((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);"currency"===t&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(e=>{if(e){const[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:r}})(t);if(this.formats[i]){let t=e;try{const a=n?.formatParams?.[n.interpolationkey]||{},s=a.locale||a.lng||n.locale||n.lng||r;t=this.formats[i](e,s,{...o,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e);return o}}class en extends Lr{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=Rr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(e,t,r,n){const i={},o={},a={},s={};return e.forEach(e=>{let n=!0;t.forEach(t=>{const a=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,n=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,r){const n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);const a={};this.queue.forEach(r=>{((e,t,r)=>{const{obj:n,k:i}=Cr(e,t,Object);n[i]=n[i]||[],n[i].push(r)})(r.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(r,e),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{a[e]||(a[e]={});const t=r.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:i,callback:o});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,r,n+1,2*i,o)},i):o(a,s)},s=this.backend[r].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const r=s(e,t);r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();mr(e)&&(e=this.languageUtils.toResolveHierarchy(e)),mr(t)&&(t=[t]);const i=this.queueLoad(e,t,r,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){const r=e.split("|"),n=r[0],i=r[1];this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,n,i,o={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=r&&""!==r){if(this.backend?.create){const s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,r,n,s):l(e,t,r,n),i&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,r,n,a,s)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}else this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const tn=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),mr(e[1])&&(t.defaultValue=e[1]),mr(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),rn=e=>(mr(e.ns)&&(e.ns=[e.ns]),mr(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),mr(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),nn=()=>{};class on extends Lr{constructor(e={},t){var r;if(super(),this.options=rn(e),this.services={},this.logger=Rr,this.modules={external:[]},r=this,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(e=>{"function"==typeof r[e]&&(r[e]=r[e].bind(r))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(mr(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=tn();this.options={...r,...this.options,...rn(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Rr.init(n(this.modules.logger),this.options):Rr.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Jr;const t=new Wr(this.options);this.store=new Nr(this.options.resources,this.options);const i=this.services;i.logger=Rr,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new Gr(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=n(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new Kr(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new en(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Hr(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=nn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=vr(),o=()=>{const e=(e,r)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(r),t(e,r)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),i}loadResources(e,t=nn){let r=t;const n=mr(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return r();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};n?t(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),r(e)})}else r(null)}reloadResources(e,t,r){const n=vr();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=nn),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Dr.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const r=vr();this.emit("languageChanging",e);const n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const r=mr(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(mr(t)?[t]:t);o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}getFixedT(e,t,r){const n=(e,t,...i)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},o.lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||r||n.keyPrefix);const a=this.options.keySeparator||".";let s;return o.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=Br(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=Br(e,{...this.options,...t})),s=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(s,o)};return mr(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=r,n}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;const o=(e,t)=>{const r=this.services.backendConnector.state[`${e}|${t}`];return-1===r||0===r||2===r};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!!this.hasResourceBundle(r,e)||!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(r,e)||n&&!o(i,e))}loadNamespaces(e,t){const r=vr();return this.options.ns?(mr(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){const r=vr();mr(e)&&(e=[e]);const n=this.options.preload||[],i=e.filter(e=>n.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=n.concat(i),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new Wr(tn());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new on(e,t)}cloneInstance(e={},t=nn){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},i=new on(n);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((r,n)=>(r[n]={...e[t][n]},r),e[t]),e),{});i.store=new Nr(e,n),i.services.resourceStore=i.store}return i.translator=new Hr(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const an=on.createInstance();an.createInstance=on.createInstance,an.createInstance,an.dir,an.init,an.loadResources,an.reloadResources,an.use,an.changeLanguage,an.getFixedT,an.t,an.exists,an.setDefaultNamespace,an.hasLoadedNamespace,an.loadNamespaces,an.loadLanguages;var sn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof r.g?r.g:"undefined"!=typeof self?self:{};function ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const cn={},un=(e,t,r,n)=>{pn(r)&&cn[r]||(pn(r)&&(cn[r]=new Date),((e,t,r,n)=>{const i=[r,{code:t,...n||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);pn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console})(e,t,r,n))},dn=(e,t)=>()=>{if(e.isInitialized)t();else{const r=()=>{setTimeout(()=>{e.off("initialized",r)},0),t()};e.on("initialized",r)}},hn=(e,t,r)=>{e.loadNamespaces(t,dn(e,r))},fn=(e,t,r,n)=>{if(pn(r)&&(r=[r]),e.options.preload&&e.options.preload.indexOf(t)>-1)return hn(e,r,n);r.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,dn(e,n))},pn=e=>"string"==typeof e,gn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,mn={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xa9","©":"\xa9","®":"\xae","®":"\xae","…":"\u2026","…":"\u2026","/":"/","/":"/"},vn=e=>mn[e];let yn,bn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(gn,vn)};const wn={type:"3rdParty",init(e){((e={})=>{bn={...bn,...e}})(e.options.react),(e=>{yn=e})(e)}},xn=(0,o.createContext)();class Cn{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const _n=(e,t,r,n)=>e.getFixedT(t,r,n),Sn=(e,t={})=>{const{i18n:r}=t,{i18n:n,defaultNS:i}=(0,o.useContext)(xn)||{},a=r||n||yn;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Cn),!a){un(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return pn(t)?t:"object"==typeof(r=t)&&null!==r&&pn(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var r},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}a.options.react?.wait&&un(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...bn,...a.options.react,...t},{useSuspense:l,keyPrefix:c}=s;let u=i||a.options?.defaultNS;u=pn(u)?[u]:u||["translation"],a.reportNamespaces.addUsedNamespaces?.(u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(e=>((e,t,r={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:r.lng,precheck:(t,n)=>{if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!n(t.isLanguageChangingTo,e))return!1}}):(un(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,a,s)),h=((e,t,r,n)=>(0,o.useCallback)(_n(e,t,r,n),[e,t,r,n]))(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),f=()=>h,p=()=>_n(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),[g,m]=(0,o.useState)(f);let v=u.join();t.lng&&(v=`${t.lng}${v}`);const y=(e=>{const t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current=e},[e,void 0]),t.current})(v),b=(0,o.useRef)(!0);(0,o.useEffect)(()=>{const{bindI18n:e,bindI18nStore:r}=s;b.current=!0,d||l||(t.lng?fn(a,t.lng,u,()=>{b.current&&m(p)}):hn(a,u,()=>{b.current&&m(p)})),d&&y&&y!==v&&b.current&&m(p);const n=()=>{b.current&&m(p)};return e&&a?.on(e,n),r&&a?.store.on(r,n),()=>{b.current=!1,a&&e&&e?.split(" ").forEach(e=>a.off(e,n)),r&&a&&r.split(" ").forEach(e=>a.store.off(e,n))}},[a,v]),(0,o.useEffect)(()=>{b.current&&d&&m(f)},[a,c,d]);const w=[g,a,d];if(w.t=g,w.i18n=a,w.ready=d,d)return w;if(!d&&!l)return w;throw new Promise(e=>{t.lng?fn(a,t.lng,u,()=>e()):hn(a,u,()=>e())})};function An({i18n:e,defaultNS:t,children:r}){const n=(0,o.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,o.createElement)(xn.Provider,{value:n},r)}var kn={};function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function In(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,jn(n.key),n)}}function jn(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function Tn(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,On(e,t,"get"))}function Fn(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,On(e,t,"set"),r),r}function On(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function Mn(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var Pn=function(e){if(!e)return[];Array.isArray(e)||(e=[e]);for(var t={},r=0;r<e.length;++r){var n,i=e[r];if(i&&"object"===En(i)&&(i=String(i)),"string"!=typeof i){var o="Locales should be strings, ".concat(JSON.stringify(i)," isn't.");throw new TypeError(o)}var a=i.split("-");if(!a.every(function(e){return/[a-z0-9]+/i.test(e)})){var s=JSON.stringify(i),l="The locale ".concat(s," is not a structurally valid BCP 47 language tag.");throw new RangeError(l)}var c=a[0].toLowerCase();a[0]=null!==(n={in:"id",iw:"he",ji:"yi"}[c])&&void 0!==n?n:c,t[a.join("-")]=!0}return Object.keys(t)};function Rn(e){switch(En(e)){case"number":return e;case"bigint":throw new TypeError("Cannot convert a BigInt value to a number");default:return Number(e)}}var Ln,Nn,Dn,zn=Object.freeze({__proto__:null,default:function(e,t,r,n){var i=function(e){do{if(t(e))return e;e=e.replace(/-?[^-]*$/,"")}while(e);return null},o=new WeakMap,a=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,u=function(){function u(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),Mn(this,o,{writable:!0,value:void 0}),Mn(this,a,{writable:!0,value:void 0}),Mn(this,s,{writable:!0,value:void 0}),Mn(this,l,{writable:!0,value:void 0}),Mn(this,c,{writable:!0,value:void 0}),Fn(this,o,function(t){for(var r=Pn(t),n=0;n<r.length;++n){var o=i(r[n]);if(o)return o}var a=(new e).resolvedOptions().locale;return i(a)}(r)),Fn(this,s,t(Tn(this,o))),Fn(this,a,n(Tn(this,o))),Fn(this,l,function(e){var t=Object.prototype.hasOwnProperty.call(e,"type")&&e.type;if(!t)return"cardinal";if("cardinal"===t||"ordinal"===t)return t;throw new RangeError("Not a valid plural type: "+JSON.stringify(t))}(d)),Fn(this,c,new e("en",d))}var d,h,f;return d=u,f=[{key:"supportedLocalesOf",value:function(e){return Pn(e).filter(i)}}],(h=[{key:"resolvedOptions",value:function(){var e=Tn(this,c).resolvedOptions(),t=e.minimumIntegerDigits,n=e.minimumFractionDigits,i=e.maximumFractionDigits,a=e.minimumSignificantDigits,s=e.maximumSignificantDigits,u=e.roundingPriority,d={locale:Tn(this,o),type:Tn(this,l),minimumIntegerDigits:t,minimumFractionDigits:n,maximumFractionDigits:i};return"number"==typeof a&&(d.minimumSignificantDigits=a,d.maximumSignificantDigits=s),d.pluralCategories=r(Tn(this,o),"ordinal"===Tn(this,l)).slice(0),d.roundingPriority=u||"auto",d}},{key:"select",value:function(e){if(!(this instanceof u))throw new TypeError("select() called on incompatible ".concat(this));if("number"!=typeof e&&(e=Number(e)),!isFinite(e))return"other";var t=Tn(this,c).format(Math.abs(e));return Tn(this,s).call(this,t,"ordinal"===Tn(this,l))}},{key:"selectRange",value:function(e,t){if(!(this instanceof u))throw new TypeError("selectRange() called on incompatible ".concat(this));if(void 0===e)throw new TypeError("start is undefined");if(void 0===t)throw new TypeError("end is undefined");var r=Rn(e),n=Rn(t);if(!isFinite(r))throw new RangeError("start must be finite");if(!isFinite(n))throw new RangeError("end must be finite");return Tn(this,a).call(this,this.select(r),this.select(n))}}])&&In(d.prototype,h),f&&In(d,f),Object.defineProperty(d,"prototype",{writable:!1}),u}();return"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u.prototype,Symbol.toStringTag,{value:"Intl.PluralRules",writable:!1,configurable:!0}),Object.defineProperty(u,"prototype",{writable:!1}),u}}),Bn=function(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(zn);!function(){if(Dn)return kn;Dn=1;var e=function(){if(Nn)return Ln;function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}Nn=1;var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(Bn);function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==sn||"undefined"!=typeof self&&self;var n={exports:{}};!function(e){var t=function(e,t){return t?"other":1==e?"one":"other"},r=function(e,t){return t?"other":0==e||1==e?"one":"other"},n=function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},i=function(e,t){var r=!String(e).split(".")[1];return t?"other":1==e&&r?"one":"other"},o=function(e,t){return"other"},a=function(e,t){return t?"other":1==e?"one":2==e?"two":"other"};!function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),e.exports=r}(0,{af:t,ak:r,am:n,an:t,ar:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},ars:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:t,ast:i,az:function(e,t){var r=String(e).split(".")[0],n=r.slice(-1),i=r.slice(-2),o=r.slice(-3);return t?1==n||2==n||5==n||7==n||8==n||20==i||50==i||70==i||80==i?"one":3==n||4==n||100==o||200==o||300==o||400==o||500==o||600==o||700==o||800==o||900==o?"few":0==r||6==n||40==i||60==i||90==i?"many":"other":1==e?"one":"other"},bal:function(e,t){return 1==e?"one":"other"},be:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1),o=n&&r[0].slice(-2);return t?2!=i&&3!=i||12==o||13==o?"other":"few":1==i&&11!=o?"one":i>=2&&i<=4&&(o<12||o>14)?"few":n&&0==i||i>=5&&i<=9||o>=11&&o<=14?"many":"other"},bem:t,bez:t,bg:t,bho:r,bm:o,bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:o,br:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1),o=n&&r[0].slice(-2),a=n&&r[0].slice(-6);return t?"other":1==i&&11!=o&&71!=o&&91!=o?"one":2==i&&12!=o&&72!=o&&92!=o?"two":(3==i||4==i||9==i)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=e&&n&&0==a?"many":"other"},brx:t,bs:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ca:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},ce:t,ceb:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=i.slice(-1);return t?"other":o&&(1==n||2==n||3==n)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},cgg:t,chr:t,ckb:t,cs:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1];return t?"other":1==e&&i?"one":n>=2&&n<=4&&i?"few":i?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var r=String(e).split("."),n=r[0],i=Number(r[0])==e;return t||1!=e&&(i||0!=n&&1!=n)?"other":"one"},de:i,doi:n,dsb:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},dv:t,dz:o,ee:t,el:t,en:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return t?1==o&&11!=a?"one":2==o&&12!=a?"two":3==o&&13!=a?"few":"other":1==e&&n?"one":"other"},eo:t,es:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?"other":1==e?"one":0!=n&&0==o&&i?"many":"other"},et:i,eu:t,fa:n,ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:i,fil:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==n||2==n||3==n)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},fo:t,fr:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?1==e?"one":"other":e>=0&&e<2?"one":0!=n&&0==o&&i?"many":"other"},fur:t,fy:i,ga:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"},gl:i,gsw:t,gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:r,gv:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-1),a=n.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":!i||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?i?"other":"many":"few"},ha:t,haw:t,he:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1];return t?"other":1==n&&i||0==n&&!i?"one":2==n&&i?"two":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hnj:o,hr:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},hsb:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:i,id:o,ig:o,ii:o,io:i,is:function(e,t){var r=String(e).split("."),n=r[0],i=(r[1]||"").replace(/0+$/,""),o=Number(r[0])==e,a=n.slice(-1),s=n.slice(-2);return t?"other":o&&1==a&&11!=s||i%10==1&&i%100!=11?"one":"other"},it:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},iu:a,ja:o,jbo:o,jgo:t,jmc:t,jv:o,jw:o,ka:function(e,t){var r=String(e).split(".")[0],n=r.slice(-2);return t?1==r?"one":0==r||n>=2&&n<=20||40==n||60==n||80==n?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:t,kcg:t,kde:o,kea:o,kk:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1);return t?6==i||9==i||n&&0==i&&0!=e?"many":"other":1==e?"one":"other"},kkj:t,kl:t,km:o,kn:n,ko:o,ks:t,ksb:t,ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:t,kw:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-2),o=n&&r[0].slice(-3),a=n&&r[0].slice(-5),s=n&&r[0].slice(-6);return t?n&&e>=1&&e<=4||i>=1&&i<=4||i>=21&&i<=24||i>=41&&i<=44||i>=61&&i<=64||i>=81&&i<=84?"one":5==e||5==i?"many":"other":0==e?"zero":1==e?"one":2==i||22==i||42==i||62==i||82==i||n&&0==o&&(a>=1e3&&a<=2e4||4e4==a||6e4==a||8e4==a)||0!=e&&1e5==s?"two":3==i||23==i||43==i||63==i||83==i?"few":1==e||1!=i&&21!=i&&41!=i&&61!=i&&81!=i?"other":"many"},ky:t,lag:function(e,t){var r=String(e).split(".")[0];return t?"other":0==e?"zero":0!=r&&1!=r||0==e?"other":"one"},lb:t,lg:t,lij:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e;return t?11==e||8==e||i&&e>=80&&e<=89||i&&e>=800&&e<=899?"many":"other":1==e&&n?"one":"other"},lkt:o,ln:r,lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var r=String(e).split("."),n=r[1]||"",i=Number(r[0])==e,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return t?"other":1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=n?"many":"other"},lv:function(e,t){var r=String(e).split("."),n=r[1]||"",i=n.length,o=Number(r[0])==e,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},mas:t,mg:r,mgo:t,mk:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":7!=a&&8!=a||17==s||18==s?"other":"many":o&&1==a&&11!=s||1==l&&11!=c?"one":"other"},ml:t,mn:t,mo:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e&&r[0].slice(-2);return t?1==e?"one":"other":1==e&&n?"one":!n||0==e||1!=e&&i>=1&&i<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":1==e?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-2);return t?"other":1==e?"one":2==e?"two":0==e||n>=3&&n<=10?"few":n>=11&&n<=19?"many":"other"},my:o,nah:t,naq:a,nb:t,nd:t,ne:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?n&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:i,nn:t,nnh:t,no:t,nqo:o,nr:t,nso:r,ny:t,nyn:t,om:t,or:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?1==e||5==e||n&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:t,osa:o,pa:r,pap:t,pcm:n,pl:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-1),a=n.slice(-2);return t?"other":1==e&&i?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&1!=n&&(0==o||1==o)||i&&o>=5&&o<=9||i&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var r=String(e).split("."),n=r[1]||"",i=n.length,o=Number(r[0])==e,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2),l=n.slice(-2),c=n.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},ps:t,pt:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?"other":0==n||1==n?"one":0!=n&&0==o&&i?"many":"other"},pt_PT:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},rm:t,ro:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e&&r[0].slice(-2);return t?1==e?"one":"other":1==e&&n?"one":!n||0==e||1!=e&&i>=1&&i<=19?"few":"other"},rof:t,ru:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-1),a=n.slice(-2);return t?"other":i&&1==o&&11!=a?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&0==o||i&&o>=5&&o<=9||i&&a>=11&&a<=14?"many":"other"},rwk:t,sah:o,saq:t,sat:a,sc:function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},scn:function(e,t){var r=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&r?"one":"other"},sd:t,sdh:t,se:a,seh:t,ses:o,sg:o,sh:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},shi:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"},si:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"";return t?"other":0==e||1==e||0==n&&1==i?"one":"other"},sk:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1];return t?"other":1==e&&i?"one":n>=2&&n<=4&&i?"few":i?"other":"many"},sl:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":i&&(3==o||4==o)||!i?"few":"other"},sma:a,smi:a,smj:a,smn:a,sms:a,sn:t,so:t,sq:function(e,t){var r=String(e).split("."),n=Number(r[0])==e,i=n&&r[0].slice(-1),o=n&&r[0].slice(-2);return t?1==e?"one":4==i&&14!=o?"many":"other":1==e?"one":"other"},sr:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=n.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ss:t,ssy:t,st:t,su:o,sv:function(e,t){var r=String(e).split("."),n=!r[1],i=Number(r[0])==e,o=i&&r[0].slice(-1),a=i&&r[0].slice(-2);return t?1!=o&&2!=o||11==a||12==a?"other":"one":1==e&&n?"one":"other"},sw:i,syr:t,ta:t,te:t,teo:t,th:o,ti:r,tig:t,tk:function(e,t){var r=String(e).split("."),n=Number(r[0])==e&&r[0].slice(-1);return t?6==n||9==n||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var r=String(e).split("."),n=r[0],i=r[1]||"",o=!r[1],a=n.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==n||2==n||3==n)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},tn:t,to:o,tpi:o,tr:t,ts:t,tzm:function(e,t){var r=String(e).split("."),n=Number(r[0])==e;return t?"other":0==e||1==e||n&&e>=11&&e<=99?"one":"other"},ug:t,uk:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=Number(r[0])==e,a=o&&r[0].slice(-1),s=o&&r[0].slice(-2),l=n.slice(-1),c=n.slice(-2);return t?3==a&&13!=s?"few":"other":i&&1==l&&11!=c?"one":i&&l>=2&&l<=4&&(c<12||c>14)?"few":i&&0==l||i&&l>=5&&l<=9||i&&c>=11&&c<=14?"many":"other"},und:o,ur:i,uz:t,ve:t,vec:function(e,t){var r=String(e).split("."),n=r[0],i=!r[1],o=n.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=n&&0==o&&i?"many":"other"},vi:function(e,t){return t&&1==e?"one":"other"},vo:t,vun:t,wa:r,wae:t,wo:o,xh:t,xog:t,yi:i,yo:o,yue:o,zh:o,zu:n})}(n);var i=r(n.exports),o=e({__proto__:null,default:i},[n.exports]),a={exports:{}};!function(e){var t="zero",r="one",n="two",i="few",o="many",a="other",s={cardinal:[r,a],ordinal:[a]},l={cardinal:[r,a],ordinal:[r,a]},c={cardinal:[a],ordinal:[a]},u={cardinal:[r,n,a],ordinal:[a]};!function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),e.exports=r}(0,{af:s,ak:s,am:s,an:s,ar:{cardinal:[t,r,n,i,o,a],ordinal:[a]},ars:{cardinal:[t,r,n,i,o,a],ordinal:[a]},as:{cardinal:[r,a],ordinal:[r,n,i,o,a]},asa:s,ast:s,az:{cardinal:[r,a],ordinal:[r,i,o,a]},bal:l,be:{cardinal:[r,i,o,a],ordinal:[i,a]},bem:s,bez:s,bg:s,bho:s,bm:c,bn:{cardinal:[r,a],ordinal:[r,n,i,o,a]},bo:c,br:{cardinal:[r,n,i,o,a],ordinal:[a]},brx:s,bs:{cardinal:[r,i,a],ordinal:[a]},ca:{cardinal:[r,o,a],ordinal:[r,n,i,a]},ce:s,ceb:s,cgg:s,chr:s,ckb:s,cs:{cardinal:[r,i,o,a],ordinal:[a]},cy:{cardinal:[t,r,n,i,o,a],ordinal:[t,r,n,i,o,a]},da:s,de:s,doi:s,dsb:{cardinal:[r,n,i,a],ordinal:[a]},dv:s,dz:c,ee:s,el:s,en:{cardinal:[r,a],ordinal:[r,n,i,a]},eo:s,es:{cardinal:[r,o,a],ordinal:[a]},et:s,eu:s,fa:s,ff:s,fi:s,fil:l,fo:s,fr:{cardinal:[r,o,a],ordinal:[r,a]},fur:s,fy:s,ga:{cardinal:[r,n,i,o,a],ordinal:[r,a]},gd:{cardinal:[r,n,i,a],ordinal:[r,n,i,a]},gl:s,gsw:s,gu:{cardinal:[r,a],ordinal:[r,n,i,o,a]},guw:s,gv:{cardinal:[r,n,i,o,a],ordinal:[a]},ha:s,haw:s,he:u,hi:{cardinal:[r,a],ordinal:[r,n,i,o,a]},hnj:c,hr:{cardinal:[r,i,a],ordinal:[a]},hsb:{cardinal:[r,n,i,a],ordinal:[a]},hu:l,hy:l,ia:s,id:c,ig:c,ii:c,io:s,is:s,it:{cardinal:[r,o,a],ordinal:[o,a]},iu:u,ja:c,jbo:c,jgo:s,jmc:s,jv:c,jw:c,ka:{cardinal:[r,a],ordinal:[r,o,a]},kab:s,kaj:s,kcg:s,kde:c,kea:c,kk:{cardinal:[r,a],ordinal:[o,a]},kkj:s,kl:s,km:c,kn:s,ko:c,ks:s,ksb:s,ksh:{cardinal:[t,r,a],ordinal:[a]},ku:s,kw:{cardinal:[t,r,n,i,o,a],ordinal:[r,o,a]},ky:s,lag:{cardinal:[t,r,a],ordinal:[a]},lb:s,lg:s,lij:{cardinal:[r,a],ordinal:[o,a]},lkt:c,ln:s,lo:{cardinal:[a],ordinal:[r,a]},lt:{cardinal:[r,i,o,a],ordinal:[a]},lv:{cardinal:[t,r,a],ordinal:[a]},mas:s,mg:s,mgo:s,mk:{cardinal:[r,a],ordinal:[r,n,o,a]},ml:s,mn:s,mo:{cardinal:[r,i,a],ordinal:[r,a]},mr:{cardinal:[r,a],ordinal:[r,n,i,a]},ms:{cardinal:[a],ordinal:[r,a]},mt:{cardinal:[r,n,i,o,a],ordinal:[a]},my:c,nah:s,naq:u,nb:s,nd:s,ne:l,nl:s,nn:s,nnh:s,no:s,nqo:c,nr:s,nso:s,ny:s,nyn:s,om:s,or:{cardinal:[r,a],ordinal:[r,n,i,o,a]},os:s,osa:c,pa:s,pap:s,pcm:s,pl:{cardinal:[r,i,o,a],ordinal:[a]},prg:{cardinal:[t,r,a],ordinal:[a]},ps:s,pt:{cardinal:[r,o,a],ordinal:[a]},pt_PT:{cardinal:[r,o,a],ordinal:[a]},rm:s,ro:{cardinal:[r,i,a],ordinal:[r,a]},rof:s,ru:{cardinal:[r,i,o,a],ordinal:[a]},rwk:s,sah:c,saq:s,sat:u,sc:{cardinal:[r,a],ordinal:[o,a]},scn:{cardinal:[r,a],ordinal:[o,a]},sd:s,sdh:s,se:u,seh:s,ses:c,sg:c,sh:{cardinal:[r,i,a],ordinal:[a]},shi:{cardinal:[r,i,a],ordinal:[a]},si:s,sk:{cardinal:[r,i,o,a],ordinal:[a]},sl:{cardinal:[r,n,i,a],ordinal:[a]},sma:u,smi:u,smj:u,smn:u,sms:u,sn:s,so:s,sq:{cardinal:[r,a],ordinal:[r,o,a]},sr:{cardinal:[r,i,a],ordinal:[a]},ss:s,ssy:s,st:s,su:c,sv:l,sw:s,syr:s,ta:s,te:s,teo:s,th:c,ti:s,tig:s,tk:{cardinal:[r,a],ordinal:[i,a]},tl:l,tn:s,to:c,tpi:c,tr:s,ts:s,tzm:s,ug:s,uk:{cardinal:[r,i,o,a],ordinal:[i,a]},und:c,ur:s,uz:s,ve:s,vec:{cardinal:[r,o,a],ordinal:[o,a]},vi:{cardinal:[a],ordinal:[r,a]},vo:s,vun:s,wa:s,wae:s,wo:c,xh:s,xog:s,yi:s,yo:c,yue:c,zh:c,zu:s})}(a);var s=r(a.exports),l=e({__proto__:null,default:s},[a.exports]),c={exports:{}};!function(e){var t,r=function(e,t){return"other"},n=function(e,t){return"other"===e&&"one"===t?"one":"other"},i=function(e,t){return t||"other"};t={af:r,ak:n,am:i,an:r,ar:function(e,t){return"few"===t?"few":"many"===t?"many":"zero"===e&&"one"===t||"zero"===e&&"two"===t?"zero":"other"},as:i,az:i,be:i,bg:r,bn:i,bs:i,ca:r,cs:i,cy:i,da:i,de:i,el:i,en:r,es:r,et:r,eu:r,fa:n,fi:r,fil:i,fr:i,ga:i,gl:i,gsw:i,gu:i,he:r,hi:i,hr:i,hu:i,hy:i,ia:r,id:r,io:r,is:i,it:i,ja:r,ka:function(e,t){return e||"other"},kk:i,km:r,kn:i,ko:r,ky:i,lij:i,lo:r,lt:i,lv:function(e,t){return"one"===t?"one":"other"},mk:r,ml:i,mn:i,mr:i,ms:r,my:r,nb:r,ne:i,nl:i,no:r,or:n,pa:i,pcm:r,pl:i,ps:i,pt:i,ro:function(e,t){return"few"===t||"one"===t?"few":"other"},ru:i,sc:i,scn:i,sd:n,si:function(e,t){return"one"===e&&"one"===t?"one":"other"},sk:i,sl:function(e,t){return"few"===t||"one"===t?"few":"two"===t?"two":"other"},sq:i,sr:i,sv:r,sw:i,ta:i,te:i,th:r,tk:i,tr:i,ug:i,uk:i,ur:r,uz:i,vi:r,yue:r,zh:r,zu:i},Object.defineProperty(t,"__esModule",{value:!0}),e.exports=t}(c);var u=r(c.exports),d=i||o,h=s||l,f=u||e({__proto__:null,default:u},[c.exports]),p=function(e){return"pt-PT"===e?"pt_PT":e},g=t.default(Intl.NumberFormat,function(e){return d[p(e)]},function(e,t){return h[p(e)][t?"ordinal":"cardinal"]},function(e){return f[p(e)]});return Ln=g}();var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e);if("undefined"==typeof Intl)void 0!==sn?sn.Intl={PluralRules:t.default}:"undefined"!=typeof window?window.Intl={PluralRules:t.default}:kn.Intl={PluralRules:t.default},t.default.polyfill=!0;else if(Intl.PluralRules&&Intl.PluralRules.prototype.selectRange){var r=["en","es","ru","zh"];Intl.PluralRules.supportedLocalesOf(r).length<r.length&&(Intl.PluralRules=t.default,t.default.polyfill=!0)}else Intl.PluralRules=t.default,t.default.polyfill=!0}();var Un={Files:"Arquivos",selected:"selecionado(s)",Deselected:"Desmarcar",Refresh:"Atualizar","Select all":"Selecionar tudo",Rename:"Renomear","Rename file":"Renomear arquivo {{currentFileName}}","Select the destination folder":"Selecionar a pasta de destino","Selected files:":"Arquivos selecionados:","Selected files":"Arquivos selecionados: {{count}}",selected_files_one:"{{count}} arquivo selecionado",selected_files_few:"{{count}} arquivos selecionados",selected_files_many:"{{count}} arquivos selecionados",selected_files_other:"{{count}} arquivos selecionados",Copy:"Duplicar",Edit:"Editar",Move:"Mover","Move to":"Mover para",Delete:"Excluir","New folder":"Nova pasta","Image search...":"Busca de imagens...","Search icons":"Encontrar \xedcones","By name":"Por nome","By size":"Por tamanho","By date":"Por data",List:"Lista",Grid:"Grade",Main:"Principal",Folders:"Pastas","total pages":"Total de {{total}} itens",Name:"Nome",Untitled:"Sem t\xedtulo",Size:"Tamanho","Stroke width":"Espessura do tra\xe7o",Dimensions:"Dimens\xf5es",Date:"Data",error:"erro",Folder:"Pasta",created:"criada","Failed to create folder":"Falha ao criar pasta","File deleted":"Arquivo exclu\xeddo","Error when deleting a file":"Erro ao excluir arquivo","Folder deleted":"Pasta exclu\xedda","Error when deleting a folder":"Erro ao excluir pasta","Delete folder":"Excluir pasta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Tem certeza que deseja excluir esta pasta? Esta a\xe7\xe3o tamb\xe9m excluir\xe1 todos os arquivos e subpastas.","API-endpoint for file upload is not configured":"Endpoint da API para upload de arquivos n\xe3o est\xe1 configurado","Please select an image file":"Por favor, selecione um arquivo de imagem",File:"Arquivo","has been successfully uploaded":"foi carregado com sucesso","The URL must point to an image":"A URL deve apontar para uma imagem","Image upload...":"Carregando imagem...",Unknown:"Desconhecido","Error downloading file by URL":"Erro ao baixar arquivo por URL","successfully uploaded":"carregado com sucesso","Error when downloading a file by URL":"Erro ao baixar arquivo por URL","Error when uploading a file":"Erro ao enviar arquivo","Error loading files":"Erro ao carregar arquivos","File not found":"Arquivo n\xe3o encontrado","File renamed to":"Arquivo renomeado para","Failed to rename the file":"Falha ao renomear o arquivo","Folder renamed to":"Pasta renomeada para","Rename folder":"Renomear pasta","New folder name":"Novo nome da pasta","Enter a new folder name":"Digite um novo nome para a pasta","Please drag and drop image files only":"Por favor, arraste e solte apenas arquivos de imagem","Upload file by URL":"Carregar arquivo por URL","Upload file":"Carregar arquivo","Creating a new folder":"Criando uma nova pasta",Create:"Criar",Cancel:"Cancelar","Folder name":"Nome da pasta","Enter the name of the folder":"Digite o nome da pasta","Enter the name":"Digite o nome","A folder will be created inside:":"A pasta ser\xe1 criada dentro de:","selected folder":"pasta selecionada","The folder will be created in the root directory":"A pasta ser\xe1 criada no diret\xf3rio raiz","Failed to load folders":"N\xe3o foi poss\xedvel carregar as pastas","Folder name cannot be empty":"O nome da pasta n\xe3o pode estar vazio","Folder creation provider is not configured":"O provedor de cria\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Folder created":"Pasta criada","Folder rename is disabled by config":"Renomear pastas est\xe1 desabilitado pela configura\xe7\xe3o","Folder rename provider is not configured":"O provedor de renomea\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Unexpected response when renaming folder":"Resposta inesperada ao renomear a pasta","Folder renamed":"Pasta renomeada","Failed to rename folder":"N\xe3o foi poss\xedvel renomear a pasta","Failed to load folder items count":"N\xe3o foi poss\xedvel obter a contagem de itens da pasta","Failed to load subfolders":"N\xe3o foi poss\xedvel carregar as subpastas",Download:"Baixar","image URL":"URL da imagem","Enter the URL of the image":"Digite a URL da imagem","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos suportados: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Novo nome do arquivo","Enter a new file name":"Digite um novo nome para o arquivo","Copy to folder":"Copiar para pasta",Added:"Adicionado em {{date}}","File uploaded successfully":"Arquivo {{fileName}} carregado com sucesso","Successfully uploaded":"{{successCount}} de {{count}} arquivo carregado com sucesso","Successfully uploaded files":"{{successCount}} de {{count}} arquivos carregados com sucesso",uploads_success_summary:"Enviados {{successCount}} de {{totalCount}} arquivos",uploads_fail_summary:"Falhou ao enviar {{failCount}} de {{totalCount}} arquivos","File with this name already exists.":"J\xe1 existe um arquivo com esse nome.","File not found or no longer available.":"O arquivo n\xe3o foi encontrado ou j\xe1 foi exclu\xeddo.","You don't have permission to access this file.":"Voc\xea n\xe3o tem permiss\xe3o para acessar este arquivo.","File is too large to upload.":"O arquivo \xe9 grande demais para ser enviado.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"O arquivo \xe9 grande demais ({{fileSize}}). Tamanho m\xe1ximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"N\xfamero m\xe1ximo de arquivos excedido. Permitido: {{allowed}}, recebido: {{received}}","This file type is not allowed.":"Este tipo de arquivo n\xe3o \xe9 permitido.","File name is not valid.":"O nome do arquivo n\xe3o \xe9 v\xe1lido.","File name is not valid. Allowed characters: {{allowedChars}}":"O nome do arquivo n\xe3o \xe9 v\xe1lido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"N\xe3o foi poss\xedvel ler o arquivo.","Failed to write the file.":"N\xe3o foi poss\xedvel gravar o arquivo.","The file appears to be corrupted.":"O arquivo parece estar corrompido.","File integrity check failed.":"A verifica\xe7\xe3o de integridade do arquivo falhou.","Folder not found or no longer available.":"A pasta n\xe3o foi encontrada ou j\xe1 foi exclu\xedda.","Folder with this name already exists.":"J\xe1 existe uma pasta com esse nome.","A folder with that name already exists. Please enter a different folder name.":"J\xe1 existe uma pasta com esse nome. Digite um nome diferente para a pasta.","You don't have permission to access this folder.":"Voc\xea n\xe3o tem permiss\xe3o para acessar esta pasta.","Folder name is not valid.":"O nome da pasta n\xe3o \xe9 v\xe1lido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"N\xe3o foi poss\xedvel criar a pasta. Caracteres permitidos no nome: {{allowedChars}}","Failed to read the folder contents.":"N\xe3o foi poss\xedvel ler o conte\xfado da pasta.","Failed to write to the folder.":"N\xe3o foi poss\xedvel gravar na pasta.","Folder storage quota exceeded.":"A cota de armazenamento da pasta foi excedida.","Folder is not empty.":"A pasta n\xe3o est\xe1 vazia.","Server error while processing the folder.":"Erro do servidor ao processar a pasta.","Folder operation took too long.":"A opera\xe7\xe3o com a pasta demorou demais.","Network error. Please check your connection and try again.":"Erro de rede. Verifique sua conex\xe3o e tente novamente.","The operation took too long. Please try again.":"A opera\xe7\xe3o demorou demais. Tente novamente.","Server error. Please try again later.":"Erro no servidor. Tente novamente mais tarde.","Service is temporarily unavailable. Please try again later.":"O servi\xe7o est\xe1 temporariamente indispon\xedvel. Tente novamente mais tarde.","Too many requests. Please try again a bit later.":"Muitas solicita\xe7\xf5es. Tente novamente mais tarde.","Authentication failed. Please sign in again.":"Falha na autentica\xe7\xe3o. Fa\xe7a login novamente.","You are not allowed to perform this action.":"Voc\xea n\xe3o tem permiss\xe3o para executar esta a\xe7\xe3o.","Some of the provided data is invalid.":"Alguns dos dados fornecidos s\xe3o inv\xe1lidos.","This operation is not supported.":"Esta opera\xe7\xe3o n\xe3o \xe9 suportada.","Request payload is too large.":"O corpo da requisi\xe7\xe3o \xe9 grande demais.","This media type is not supported.":"Este tipo de m\xeddia n\xe3o \xe9 suportado.","You have exceeded the upload quota.":"Voc\xea excedeu a cota de upload de arquivos.","Network error while uploading the file.":"Erro de rede ao enviar o arquivo.","File upload took too long.":"O envio do arquivo demorou demais.","Server error while uploading the file.":"Erro do servidor ao enviar o arquivo.","The specified URL is not valid.":"A URL especificada n\xe3o \xe9 v\xe1lida.","The specified URL is not reachable.":"A URL especificada n\xe3o est\xe1 acess\xedvel.","Content type at the URL is not allowed.":"O tipo de conte\xfado na URL n\xe3o \xe9 permitido.","Failed to download file from the URL.":"N\xe3o foi poss\xedvel baixar o arquivo da URL.","Network error while downloading the file.":"Erro de rede ao baixar o arquivo.","File download took too long.":"O download do arquivo demorou demais.","Server error while downloading the file.":"Erro do servidor ao baixar o arquivo.","Some items could not be processed.":"Nem todos os itens foram processados com sucesso.","Failed to process all items in the batch.":"Nenhum item do lote p\xf4de ser processado.","Some items in the batch are in a conflicting state.":"Alguns itens do lote est\xe3o em estado de conflito.","Some items in the batch did not pass validation.":"Alguns itens do lote n\xe3o passaram na valida\xe7\xe3o.","AI service returned an invalid response.":"O servi\xe7o de IA retornou uma resposta inv\xe1lida.","Failed to generate image using AI.":"Falha ao gerar imagem usando IA.","You have reached the AI image generation limit.":"Voc\xea atingiu o limite de gera\xe7\xe3o de imagens por IA.","Error in external integration.":"Erro em uma integra\xe7\xe3o externa.","Error in a third-party service.":"Erro em um servi\xe7o de terceiros.","An unknown error occurred.":"Ocorreu um erro desconhecido.","Renaming is not allowed for this item.":"Renomear n\xe3o \xe9 permitido para este item.","Moving is not allowed for this item.":"Mover n\xe3o \xe9 permitido para este item.","Copying is not allowed for this item.":"Copiar n\xe3o \xe9 permitido para este item.","Deleting is not allowed for this item.":"Excluir n\xe3o \xe9 permitido para este item.","Cannot move an item into itself.":"N\xe3o \xe9 poss\xedvel mover um item para dentro de si mesmo.","Cannot move an item into its descendant folder.":"N\xe3o \xe9 poss\xedvel mover um item para sua pasta descendente.","Cannot copy an item into itself.":"N\xe3o \xe9 poss\xedvel copiar um item para dentro de si mesmo.","Configuration error occurred.":"Ocorreu um erro de configura\xe7\xe3o.","Storage quota exceeded. Please free up space.":"Cota de armazenamento excedida. Libere espa\xe7o.","File is locked by another process or user.":"O arquivo est\xe1 bloqueado por outro processo ou usu\xe1rio.","File version conflict. Please refresh and try again.":"Conflito de vers\xe3o do arquivo. Atualize a p\xe1gina e tente novamente.","Batch operation exceeds the maximum number of items allowed.":"A opera\xe7\xe3o em lote excede o n\xfamero m\xe1ximo de itens permitidos.",Moved:"Movidos: {{names}}",move_success_summary:"Movidos {{successCount}} de {{totalCount}} itens",move_fail_summary:"Falhou ao mover {{failCount}} de {{totalCount}} itens",Copied:"Copiados: {{names}}",copy_success_summary:"Copiados {{successCount}} de {{totalCount}} itens",copy_fail_summary:"Falhou ao copiar {{failCount}} de {{totalCount}} itens",Uploaded:"Arquivos enviados: {{names}}",Failed:"Falha ao enviar: {{names}}","Failed to upload":"Falha ao carregar {{failCount}} de {{count}} arquivo","Failed to upload files":"Falha ao carregar {{failCount}} de {{count}} arquivos",months:{january:"janeiro",february:"fevereiro",march:"mar\xe7o",april:"abril",may:"maio",june:"junho",july:"julho",august:"agosto",september:"setembro",october:"outubro",november:"novembro",december:"dezembro"},files:"arquivos","No available folders":"Nenhuma pasta dispon\xedvel","My files":"Meus arquivos",GIF:"GIF","Stock images":"Imagens de stock","QR & Barcode":"QR e c\xf3digo de barras","QR code":"C\xf3digo QR",Barcode:"C\xf3digo de barras","Text or URL":"Texto ou URL","Code color":"Cor do c\xf3digo","Background color":"Cor de fundo","Add to My files":"Adicionar aos Meus arquivos","Transparent background":"Fundo transparente","Barcode generation failed":"N\xe3o foi poss\xedvel gerar o c\xf3digo de barras. Use caracteres compat\xedveis com CODE128.","Validation error":"Erro de valida\xe7\xe3o","Enter text or URL to preview":"Digite texto ou um URL para pr\xe9-visualizar.",Preview:"Pr\xe9-visualiza\xe7\xe3o","QR transparent background hint":"PNG transparente pode se misturar a temas escuros do e-mail; fundo branco costuma ser mais confi\xe1vel para leitores.","QR image size px":"Tamanho do QR","Barcode bar height px":"Altura das barras",AI:"IA","AI image generation":"Gera\xe7\xe3o de imagens por IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Isso \xe9 tudo que conseguimos encontrar.","Search image":"Buscar imagem",All:"Todos",Landscape:"Paisagem",Portrait:"Retrato",Squarish:"Quadrados",Black:"Preto","Black and White":"Preto e branco",White:"Branco",Orange:"Laranja",Red:"Vermelho",Purple:"Roxo",Magenta:"Magenta",Green:"Verde",Teal:"Verde-azulado",Blue:"Azul","Photo by":"Foto por",on:"em","File Manager":"Gerenciador de arquivos","File Manager not configured":"Gerenciador de arquivos n\xe3o configurado","Filter by type":"Filtrar por tipo","All types":"Todos os tipos","File name":"Nome do arquivo",Actions:"A\xe7\xf5es","Add file":"Adicionar arquivo","Add folder":"Adicionar pasta","Add file by URL":"Adicionar arquivo por URL","File moved":"Arquivo movido","Error when moving a file":"Erro ao mover arquivo","Failed to download file":"N\xe3o foi poss\xedvel baixar o arquivo","Failed to load JSON data":"N\xe3o foi poss\xedvel carregar os dados JSON","Invalid file URL":"URL de arquivo inv\xe1lida","Unable to validate file URL":"N\xe3o foi poss\xedvel validar a URL do arquivo","Type to search...":"Digite para buscar...",Submit:"Enviar","No folders yet":"Nenhuma pasta ainda","Drag files to upload":"Arraste arquivos para carregar","Drop files here to upload":"Solte os arquivos aqui para carreg\xe1-los","Newest first":"Mais recentes primeiro","Oldest first":"Mais antigos primeiro","Largest first":"Maiores primeiro","Smallest first":"Menores primeiro","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Avaliando a tarefa","Something went wrong, please try again":"Algo deu errado, por favor tente novamente","Sort by":"Ordenar por","preview text":"Carregando imagem...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar exclus\xe3o","Are you sure you want to delete the selected items?":"Tem certeza que deseja excluir os itens selecionados?","Move to Trash":"Mover para lixeira","Are you sure you want to move the selected items to the Trash?":"Tem certeza que deseja mover os itens selecionados para a lixeira?","Permanently delete":"Exclus\xe3o permanente","Delete permanently":"Excluir permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Tem certeza que deseja excluir permanentemente os itens selecionados? Esta a\xe7\xe3o n\xe3o pode ser desfeita.",Clear:"Limpar","Clear Trash":"Limpar lixeira","Are you sure you want to permanently delete all items from Trash?":"Tem certeza que deseja excluir permanentemente todos os itens da lixeira?","Trash cleared successfully":"Lixeira limpa com sucesso","{{count}} items permanently deleted":"{{count}} itens exclu\xeddos permanentemente","Trash partially cleared":"Lixeira parcialmente limpa","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} itens exclu\xeddos, {{failed}} falharam","Failed to clear trash":"Falha ao limpar lixeira","Error clearing trash":"Erro ao limpar lixeira","Deleting items...":"Excluindo itens...",delete_files_permanent_one:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivo",delete_files_permanent_few:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_many:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_other:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_folder_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente a pasta \xab{{name}}\xbb e todo seu conte\xfado, incluindo {{count}} itens.",delete_mixed_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{total}} itens selecionados, incluindo {{folders}} pastas e todas as {{images}} imagens dentro delas.",permanent_delete_warning:"Excluir arquivos que foram usados em e-mails causar\xe1 problemas na exibi\xe7\xe3o de imagens em e-mails antigos. Tem certeza de que deseja excluir permanentemente a sele\xe7\xe3o?",move_files_to_trash_one:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivo para a lixeira.",move_files_to_trash_few:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_many:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_other:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_folder_to_trash:"Esta a\xe7\xe3o mover\xe1 a pasta \xab{{name}}\xbb e todo seu conte\xfado ({{count}} itens) para a lixeira.",move_mixed_to_trash:"Esta a\xe7\xe3o mover\xe1 {{total}} itens selecionados para a lixeira, incluindo {{folders}} pastas e {{images}} imagens.",delete_count_confirm_trash_one:"Mover {{count}} arquivo para a lixeira?",delete_count_confirm_trash_few:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_many:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_other:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_permanent_one:"Excluir permanentemente {{count}} arquivo?",delete_count_confirm_permanent_few:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_many:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_other:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_one:"Excluir {{count}} arquivo?",delete_count_confirm_few:"Excluir {{count}} arquivos?",delete_count_confirm_many:"Excluir {{count}} arquivos?",delete_count_confirm_other:"Excluir {{count}} arquivos?",item:"arquivo",items:"arquivos",Trash:"Lixeira",Choose:"Escolher",Stock:"Banco de imagens","Select an image from our library":"Selecione uma imagem da nossa biblioteca","AI generation":"Gera\xe7\xe3o por IA","Creating an image on demand":"Criando uma imagem sob demanda","Search file or folder":"Buscar arquivo ou pasta","Click here to select a file":"Clique aqui para selecionar um arquivo","Supported files:":"Arquivos suportados:","Create folder":"Criar pasta",Done:"Conclu\xeddo","Move here":"Mover aqui","Copy here":"Copiar aqui","File URL":"URL do arquivo","There's nothing here":"N\xe3o h\xe1 nada aqui","Try using a different search query.":"Tente usar uma consulta de pesquisa diferente.","Millions of free stock images":"Milh\xf5es de imagens de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Digite uma consulta de busca e encontraremos a imagem perfeita para voc\xea","Millions of icons":"Milh\xf5es de \xedcones","Lucide icons":"\xcdcones Lucide","Thousands of icons":"Milhares de \xedcones","Enter a search query and we'll find the perfect icon for you":"Digite uma consulta de busca e encontraremos o \xedcone perfeito para voc\xea","Enter your query and we will find the right one for you":"Digite sua consulta e n\xf3s encontraremos a ideal para voc\xea","Over 350,000 live images":"Mais de 350.000 imagens ao vivo","The folder will be created in the root directory.":"A pasta ser\xe1 criada no diret\xf3rio raiz.",undo:"DESFAZER",moved_to_trash_one:"{{count}} item movido para a lixeira",moved_to_trash_few:"{{count}} itens movidos para a lixeira",moved_to_trash_many:"{{count}} itens movidos para a lixeira",moved_to_trash_other:"{{count}} itens movidos para a lixeira",restored_items_one:"{{count}} item restaurado",restored_items_few:"{{count}} itens restaurados",restored_items_many:"{{count}} itens restaurados",restored_items_other:"{{count}} itens restaurados",Type:"Tipo","Generate image":"Gerar imagem","A beautiful image of a sunset over a calm ocean.":"Uma imagem bonita de um p\xf4r do sol sobre um oceano tranquilo.","For example:":"Por exemplo:",Insert:"Inserir",Error:"Erro","Upload progress":"Enviando {{completed}}/{{total}}","Uploading files":"Enviando {{completed}}/{{total}} arquivos","Uploaded files":"Enviados {{success}} de {{total}} arquivos","Upload error files":"Erro ao enviar {{errorCount}} arquivos","Applies to all {{count}} files":"(aplica-se a todos os {{count}} arquivos)","Some files failed to upload":"Alguns arquivos n\xe3o puderam ser enviados. Verifique o tamanho e o formato dos arquivos.",upload_error_hint_invalid_name:"Renomeie o arquivo: use apenas letras, n\xfameros, h\xedfens e sublinhados.",upload_error_hint_size:"Reduza o tamanho do arquivo ou escolha outro.",upload_error_hint_format:"Use um formato permitido: JPG, PNG ou GIF.",upload_error_hint_exists:"J\xe1 existe um arquivo com este nome na pasta. Renomeie o arquivo.","Images generated successfully":"Imagens geradas com sucesso","Choose for template":"Selecionar para carregar no modelo","Trash is empty":"A lixeira est\xe1 vazia","Deleted files will be displayed here":"Os arquivos exclu\xeddos ser\xe3o exibidos aqui","Editing: {{name}}":"Editando: {{name}}","Editing image":"Editando imagem",Save:"Salvar","Loading editor...":"Carregando editor...","Error loading image":"Erro ao carregar a imagem","Error saving image":"Erro ao salvar a imagem","Error initializing editor":"Erro ao inicializar o editor","Close File Manager":"Fechar gerenciador de arquivos","Are you sure you want to close? Unsaved changes will be lost.":"Tem certeza de que deseja fechar? As altera\xe7\xf5es n\xe3o salvas ser\xe3o perdidas.","Are you sure you want to close the file manager?":"Tem certeza de que deseja fechar o gerenciador de arquivos?",Close:"Fechar",KB:"KB","No files":"Nenhum arquivo","Folder is empty or files not found":"A pasta est\xe1 vazia ou os arquivos n\xe3o foram encontrados","Search files...":"Buscar arquivos...",Success:"Sucesso","Image updated successfully":"Imagem atualizada com sucesso","Failed to save changes":"Falha ao salvar altera\xe7\xf5es: {{error}}","Unknown error":"Erro desconhecido","Select destination folder":"Selecione a pasta de destino","Error moving":"Erro ao mover","Error deleting":"Erro ao excluir","Error copying":"Erro ao copiar","Error renaming":"Erro ao renomear","Failed to refresh folder tree":"Falha ao atualizar a \xe1rvore de pastas","Failed to refresh file list":"Falha ao atualizar a lista de arquivos","Errors occurred while moving":"Ocorreram erros ao mover","Errors occurred while copying":"Ocorreram erros ao copiar","(error)":"(erro)","(circular reference)":"(refer\xeancia circular)","File too large. Maximum size: {{size}}":"Arquivo muito grande. Tamanho m\xe1ximo: {{size}}","File too small. Minimum size: {{size}}":"Arquivo muito pequeno. Tamanho m\xednimo: {{size}}","Unsupported file type":"Tipo de arquivo n\xe3o suportado","Unsupported file type: {{type}}":"Tipo de arquivo n\xe3o suportado: {{type}}",unknown:"desconhecido","Failed to load files":"Falha ao carregar arquivos","Failed to load files in folder":"N\xe3o foi poss\xedvel carregar o conte\xfado da pasta ({{folderName}})","Failed to load subfolders in folder":'N\xe3o foi poss\xedvel carregar subpastas em "{{folderName}}"',"Failed to load folder items count in folder":'N\xe3o foi poss\xedvel obter a contagem de itens em "{{folderName}}"',"DataProvider for folder deletion is not configured":"DataProvider para exclus\xe3o de pastas n\xe3o est\xe1 configurado","DataProvider for file upload is not configured":"DataProvider para upload de arquivos n\xe3o est\xe1 configurado","Error uploading file {{fileName}}":"Erro ao carregar o arquivo {{fileName}}","Error uploading file":"Erro ao carregar o arquivo","Cannot upload files to Trash":"N\xe3o \xe9 poss\xedvel carregar arquivos para a lixeira","Please fill in all fields":"Por favor, preencha todos os campos","URL too long":"URL muito longa","Only http and https URLs are supported":"Apenas URLs com protocolo http e https s\xe3o suportadas","Private and local URLs are not allowed":"URLs locais e privadas n\xe3o s\xe3o permitidas","Upload by URL is not supported":"Upload por URL n\xe3o \xe9 suportado","File name is too long. Maximum {{max}} characters":"O nome do arquivo \xe9 muito longo. M\xe1ximo de {{max}} caracteres","File name contains invalid characters":"O nome do arquivo cont\xe9m caracteres inv\xe1lidos","Large file may take a long time to upload":"Um arquivo grande pode demorar muito para ser carregado","File unavailable: {{status}} {{statusText}}":"Arquivo indispon\xedvel: {{status}} {{statusText}}","File too large: {{size}}":"Arquivo muito grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de arquivo n\xe3o suportado: {{contentType}}","Invalid server response: folder ID is missing":"Resposta do servidor inv\xe1lida: ID da pasta ausente","Error: folder cannot be its own parent":"Erro: a pasta n\xe3o pode ser seu pr\xf3prio pai","Upload to Trash is forbidden":"Enviar para a lixeira \xe9 proibido","renameFolder is not implemented in dataProviders":"renameFolder n\xe3o est\xe1 implementado em dataProviders","renameFile is not implemented in dataProviders":"renameFile n\xe3o est\xe1 implementado em dataProviders",Clean:"Limpar","Circular dependency detected: folder cannot be its own parent":"Depend\xeancia circular detectada: a pasta n\xe3o pode ser seu pr\xf3prio pai","Save as copy and choose":"Salvar como c\xf3pia e escolher","Save and choose":"Salvar e escolher",pixie:{"added drawing":"Desenho adicionado","added frame":"Moldura adicionada","added image":"Imagem adicionada","added shape":"Forma adicionada","added sticker":"Adesivo adicionado","added text":"Texto adicionado","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fundo","background color":"Cor de fundo",beach:"Praia","brush color":"Cor do pincel","brush size":"Tamanho do pincel","brush type":"Tipo de pincel",bubbles:"Bolhas",Cancel:"Cancelar","changed style":"Estilo alterado","Circle Brush":"C\xedrculo",close:"Fechar",color:"Cor",corners:"Cantos",crop:"Cortar",Custom:"Personalizado","deleted object":"Objeto exclu\xeddo","Diamond Brush":"Diamante",doodles:"Rabiscos",draw:"Desenhar",emoticons:"Emoticons","Eraser Brush":"Borracha",filter:"Filtro",font:"Fonte","font size":"Tamanho da fonte",frame:"Moldura",gradient:"Gradiente",height:"Altura",history:"Hist\xf3rico","H Line Brush":"Linha H",image:"Imagem",initial:"Inicial",landmarks:"Pontos tur\xedsticos","loaded state":"Estado carregado","loading canvas":"Carregando tela","loading image":"Carregando imagem","loading state":"Carregando estado","maintain aspect ratio":"Manter propor\xe7\xe3o",merge:"Mesclar","merged objects":"Objetos mesclados","new text":"Novo texto",objects:"Objetos",opacity:"Opacidade",outline:"Contorno","outline color":"Cor do contorno","Pencil Brush":"L\xe1pis","processing image":"Processando imagem",quality:"Qualidade",radius:"Raio","replace image":"Substituir imagem","replaced background image":"Imagem de fundo substitu\xedda",resize:"Redimensionar","resized image":"Imagem redimensionada","rounded corner":"Canto arredondado",save:"Salvar",shadow:"Sombra","shadow color":"Cor da sombra",shapes:"Formas","Spray Brush":"Spray",square:"Quadrado","Square Brush":"Quadrado",stickers:"Adesivos",text:"Texto",texture:"Textura",transportation:"Transporte","V Line Brush":"Linha V",width:"Largura",grayscale:"Tons de cinza","black & White":"Preto e branco",sharpen:"Nitidez",invert:"Inverter",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"S\xe9pia quente",sepia:"S\xe9pia","remove Color":"Remover cor",brightness:"Brilho",gamma:"Gamma",noise:"Ru\xeddo",pixelate:"Pixelar",blur:"Desfocar",emboss:"Relevo","blend Color":"Misturar cor",distance:"Dist\xe2ncia",red:"Vermelho",green:"Verde",blue:"Azul",blocksize:"Tamanho do bloco",alpha:"Alfa",add:"Adicionar",multiply:"Multiplicar",subtract:"Subtrair",diff:"Diferen\xe7a",screen:"Tela",lighten:"Clarear",darken:"Escurecer","select an option...":"Selecione uma op\xe7\xe3o..."}};const Vn={en:{translation:{Folder:"Folder",Folders:"Folders",Files:"Files",File:"File","Select the destination folder":"Select the destination folder","Filter by type":"Filter by type","All types":"All types","File name":"File name",Size:"Size",Date:"Date",Actions:"Actions",Delete:"Delete",Move:"Move",Copy:"Copy",Refresh:"Refresh","Add folder":"Add folder","Add file":"Add file","Add file by URL":"Add file by URL","Please select an image file":"Please select an image file","File deleted":"File deleted","Error when deleting a file":"Error when deleting a file","Folder deleted":"Folder deleted","Error when deleting a folder":"Error when deleting a folder","Delete folder":"Delete folder","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Are you sure you want to delete this folder? This action will also delete all files and subfolders.","File moved":"File moved","Error when moving a file":"Error when moving a file","has been successfully uploaded":"has been successfully uploaded","Failed to download file":"Failed to download file","Failed to load JSON data":"Failed to load JSON data","Invalid file URL":"Invalid file URL","Unable to validate file URL":"Unable to validate file URL","Error when uploading a file":"Error when uploading a file","successfully uploaded":"successfully uploaded","Error when downloading a file by URL":"Error when downloading a file by URL","Error loading files":"Error loading files","File Manager not configured":"File Manager not configured","Type to search...":"Type to search...","Failed to create folder":"Failed to create folder",Cancel:"Cancel",Submit:"Submit",months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},files:"files","No available folders":"No available folders","My files":"My files",GIF:"GIF","Stock images":"Stock images","QR & Barcode":"QR & Barcode","QR code":"QR code",Barcode:"Barcode","Text or URL":"Text or URL","Code color":"Code color","Background color":"Background color","Add to My files":"Add to My files","Transparent background":"Transparent background","Barcode generation failed":"Could not generate this barcode. Use characters supported by CODE128.","Validation error":"Validation error","Enter text or URL to preview":"Enter text or a URL to encode.",Preview:"Preview","QR transparent background hint":"A transparent PNG may blend into dark email themes; a white background is often easier for scanners.","QR image size px":"QR image size","Barcode bar height px":"Barcode bar height",Icons:"Icons",AI:"AI","AI image generation":"AI image generation","Search GIFs":"Search GIFs","That`s all we could find.":"That`s all we could find.","Search image":"Search image",All:"All",Landscape:"Landscape",Portrait:"Portrait",Squarish:"Squarish",Black:"Black","Black and White":"Black and White",White:"White",Orange:"Orange",Red:"Red",Purple:"Purple",Magenta:"Magenta",Green:"Green",Teal:"Teal",Blue:"Blue","Photo by":"Photo by",on:"on",selected:"selected",Deselected:"Deselected","Select all":"Select all",Rename:"Rename","Rename file":"Rename file {{currentFileName}}","Selected files":"Selected files: {{count}}",selected_files_one:"Selected {{count}} file",selected_files_other:"Selected {{count}} files",Edit:"Edit","Move to":"Move to","New folder":"New folder","Image search...":"Image search...","Search icons":"Search icons","By name":"By name","By size":"By size","By date":"By date",List:"List",Grid:"Grid",Main:"Main","total pages":"Total {{total}} items",Name:"Name",Untitled:"Untitled",Dimensions:"Dimensions",error:"error",created:"created","API-endpoint for file upload is not configured":"API-endpoint for file upload is not configured","The URL must point to an image":"The URL must point to an image","Image upload...":"Image upload...",Unknown:"Unknown","Error downloading file by URL":"Error downloading file by URL","File not found":"File not found","File renamed to":"File renamed to ","Failed to rename the file":"Failed to rename the file","Folder renamed to":"Folder renamed to","Rename folder":"Rename folder","New folder name":"New folder name","Enter a new folder name":"Enter a new folder name","Please drag and drop image files only":"Please drag and drop image files only","Upload file by URL":"Upload file by URL","Upload file":"Upload file","Creating a new folder":"Creating a new folder",Create:"Create","Folder name":"Folder name","Enter the name of the folder":"Enter the name of the folder","Enter the name":"Enter the name","A folder will be created inside:":"A folder will be created inside:","selected folder":"selected folder","The folder will be created in the root directory":"The folder will be created in the root directory","Failed to load folders":"Failed to load folders","Folder name cannot be empty":"Folder name cannot be empty","Folder creation provider is not configured":"Folder creation provider is not configured","Folder created":"Folder created","Folder rename is disabled by config":"Folder rename is disabled by config","Folder rename provider is not configured":"Folder rename provider is not configured","Unexpected response when renaming folder":"Unexpected response when renaming folder","Folder renamed":"Folder renamed","Failed to rename folder":"Failed to rename folder","Failed to load folder items count":"Failed to load folder items count","Failed to load subfolders":"Failed to load subfolders",Download:"Download","image URL":"image URL","Enter the URL of the image":"Enter the URL of the image","URL too long":"URL is too long","Only http and https URLs are supported":"Only http and https URLs are supported","Private and local URLs are not allowed":"Private and local URLs are not allowed","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"New file name","Enter a new file name":"Enter a new file name","Copy to folder":"Copy to folder",Added:"Added {{date}}","File uploaded successfully":"File {{fileName}} uploaded successfully","Successfully uploaded":"Successfully uploaded {{successCount}} of {{count}} file","Successfully uploaded files":"Successfully uploaded {{successCount}} of {{count}} files",Uploaded:"Uploaded: {{names}}",uploads_success_summary:"Uploaded {{successCount}} of {{totalCount}} files",Failed:"Failed: {{names}}",uploads_fail_summary:"Failed to upload {{failCount}} of {{totalCount}} files","File with this name already exists.":"File with this name already exists.","File not found or no longer available.":"File not found or no longer available.","You don't have permission to access this file.":"You don't have permission to access this file.","File is too large to upload.":"File is too large to upload.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}","This file type is not allowed.":"This file type is not allowed.","File name is not valid.":"File name is not valid.","File name is not valid. Allowed characters: {{allowedChars}}":"File name is not valid. Allowed characters: {{allowedChars}}","Failed to read the file.":"Failed to read the file.","Failed to write the file.":"Failed to write the file.","The file appears to be corrupted.":"The file appears to be corrupted.","File integrity check failed.":"File integrity check failed.","Folder not found or no longer available.":"Folder not found or no longer available.","Folder with this name already exists.":"Folder with this name already exists.","A folder with that name already exists. Please enter a different folder name.":"A folder with that name already exists. Please enter a different folder name.","You don't have permission to access this folder.":"You don't have permission to access this folder.","Folder name is not valid.":"Folder name is not valid.","Folder name is not valid. Allowed characters: {{allowedChars}}":"Folder name is not valid. Allowed characters: {{allowedChars}}","Failed to read the folder contents.":"Failed to read the folder contents.","Failed to write to the folder.":"Failed to write to the folder.","Folder storage quota exceeded.":"Folder storage quota exceeded.","Folder is not empty.":"Folder is not empty.","Server error while processing the folder.":"Server error while processing the folder.","Folder operation took too long.":"Folder operation took too long.","Network error. Please check your connection and try again.":"Network error. Please check your connection and try again.","The operation took too long. Please try again.":"The operation took too long. Please try again.","Server error. Please try again later.":"Server error. Please try again later.","Service is temporarily unavailable. Please try again later.":"Service is temporarily unavailable. Please try again later.","Too many requests. Please try again a bit later.":"Too many requests. Please try again a bit later.","Authentication failed. Please sign in again.":"Authentication failed. Please sign in again.","You are not allowed to perform this action.":"You are not allowed to perform this action.","Some of the provided data is invalid.":"Some of the provided data is invalid.","This operation is not supported.":"This operation is not supported.","Request payload is too large.":"Request payload is too large.","This media type is not supported.":"This media type is not supported.","You have exceeded the upload quota.":"You have exceeded the upload quota.","Network error while uploading the file.":"Network error while uploading the file.","File upload took too long.":"File upload took too long.","Server error while uploading the file.":"Server error while uploading the file.","The specified URL is not valid.":"The specified URL is not valid.","The specified URL is not reachable.":"The specified URL is not reachable.","Content type at the URL is not allowed.":"Content type at the URL is not allowed.","Failed to download file from the URL.":"Failed to download file from the URL.","Network error while downloading the file.":"Network error while downloading the file.","File download took too long.":"File download took too long.","Server error while downloading the file.":"Server error while downloading the file.","Some items could not be processed.":"Some items could not be processed.","Failed to process all items in the batch.":"Failed to process all items in the batch.","Some items in the batch are in a conflicting state.":"Some items in the batch are in a conflicting state.","Some items in the batch did not pass validation.":"Some items in the batch did not pass validation.","AI service returned an invalid response.":"AI service returned an invalid response.","Failed to generate image using AI.":"Failed to generate image using AI.","You have reached the AI image generation limit.":"You have reached the AI image generation limit.","Error in external integration.":"Error in external integration.","Error in a third-party service.":"Error in a third-party service.","An unknown error occurred.":"An unknown error occurred.","Renaming is not allowed for this item.":"Renaming is not allowed for this item.","Moving is not allowed for this item.":"Moving is not allowed for this item.","Copying is not allowed for this item.":"Copying is not allowed for this item.","Deleting is not allowed for this item.":"Deleting is not allowed for this item.","Cannot move an item into itself.":"Cannot move an item into itself.","Cannot move an item into its descendant folder.":"Cannot move an item into its descendant folder.","Cannot copy an item into itself.":"Cannot copy an item into itself.","Configuration error occurred.":"Configuration error occurred.","Storage quota exceeded. Please free up space.":"Storage quota exceeded. Please free up space.","File is locked by another process or user.":"File is locked by another process or user.","File version conflict. Please refresh and try again.":"File version conflict. Please refresh and try again.","Batch operation exceeds the maximum number of items allowed.":"Batch operation exceeds the maximum number of items allowed.",Moved:"Moved: {{names}}",move_success_summary:"Moved {{successCount}} of {{totalCount}} items",move_fail_summary:"Failed to move {{failCount}} of {{totalCount}} items",Copied:"Copied: {{names}}",copy_success_summary:"Copied {{successCount}} of {{totalCount}} items",copy_fail_summary:"Failed to copy {{failCount}} of {{totalCount}} items","Failed to upload":"Failed to upload {{failCount}} of {{count}} file","Failed to upload files":"Failed to upload {{failCount}} of {{count}} files","No folders yet":"No folders yet","Drag files to upload":"Drag files to upload","Drop files here to upload":"Drop files here to upload","Newest first":"Newest first","Oldest first":"Oldest first","Largest first":"Largest first","Smallest first":"Smallest first","A-Z":"A-Z","Z-A":"Z-A","By type":"By type","Evaluating the task":"Evaluating the task","Something went wrong, please try again":"Something went wrong, please try again","Sort by":"Sort by","preview text":"The image preview is trying to load ...","Use this variant":"Use this variant","Confirm deletion":"Confirm deletion","Are you sure you want to delete the selected items?":"Are you sure you want to delete the selected items?","Move to Trash":"Move to Trash","Are you sure you want to move the selected items to the Trash?":"Are you sure you want to move the selected items to the Trash?","Permanently delete":"Permanently delete","Delete permanently":"Delete permanently","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Are you sure you want to permanently delete the selected items? This action cannot be undone.",Clear:"Clear","Clear Trash":"Clear Trash","Are you sure you want to permanently delete all items from Trash?":"Are you sure you want to permanently delete all items from Trash?","Trash cleared successfully":"Trash cleared successfully","{{count}} items permanently deleted":"{{count}} items permanently deleted","Trash partially cleared":"Trash partially cleared","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} items deleted, {{failed}} items failed","Failed to clear trash":"Failed to clear trash","Error clearing trash":"Error clearing trash","Deleting items...":"Deleting items...",delete_files_permanent_one:"This action will permanently delete {{count}} file",delete_files_permanent_other:"This action will permanently delete {{count}} files",delete_folder_permanent:"This action will permanently delete the folder '{{name}}' and all its contents, including {{count}} items.",delete_mixed_permanent:"This action will permanently delete {{total}} selected items, including {{folders}} folders and all {{images}} images within them.",permanent_delete_warning:"Deleting files that were used in emails will cause problems with displaying images in old emails. Are you sure you want to permanently delete the selection?",move_files_to_trash_one:"This will move {{count}} file to the Trash.",move_files_to_trash_other:"This will move {{count}} files to the Trash.",move_folder_to_trash:"This will move the folder '{{name}}' and all its contents ({{count}} items) to the Trash.",move_mixed_to_trash:"This will move {{total}} selected items to the Trash, including {{folders}} folders and {{images}} images.",delete_count_confirm_trash_one:"Move {{count}} file to Trash?",delete_count_confirm_trash_other:"Move {{count}} files to Trash?",delete_count_confirm_permanent_one:"Permanently delete {{count}} file?",delete_count_confirm_permanent_other:"Permanently delete {{count}} files?",delete_count_confirm_one:"Delete {{count}} file?",delete_count_confirm_other:"Delete {{count}} files?",item:"item",items:"items",Trash:"Deleted",Choose:"Choose",Stock:"Stock","Select an image from our library":"Select an image from our library","AI generation":"AI generation","Creating an image on demand":"Creating an image on demand","Search file or folder":"Search file or folder","Click here to select a file":"Click here to select a file","Create folder":"Create folder",Done:"Done","Move here":"Move here","Copy here":"Copy here","File URL":"File URL","There's nothing here":"There's nothing here","Try using a different search query.":"Try using a different search query.","Millions of free stock images":"Millions of free stock images","Enter a search query and we'll find the perfect image for you":"Enter a search query and we'll find the perfect image for you","Millions of icons":"Millions of icons","Lucide icons":"Lucide icons","Thousands of icons":"Thousands of icons","Enter a search query and we'll find the perfect icon for you":"Enter a search query and we'll find the perfect icon for you","Enter your query and we will find the right one for you":"Enter your query and we will find the right one for you","Over 350,000 live images":"Over 350,000 live images","The folder will be created in the root directory.":"The folder will be created in the root directory.",undo:"UNDO",moved_to_trash_one:"Moved {{count}} item to Trash",moved_to_trash_other:"Moved {{count}} items to Trash",restored_items_one:"Restored {{count}} item",restored_items_other:"Restored {{count}} items",Type:"Type","Generate image":"Generate image","For example:":"For example:","A beautiful image of a sunset over a calm ocean.":"A beautiful image of a sunset over a calm ocean.",Insert:"Insert",Error:"Error","Upload progress":"Upload {{completed}}/{{total}}","Uploading files":"Uploading {{completed}}/{{total}} files","Uploaded files":"Uploaded {{success}} of {{total}} files","Upload error files":"Upload error {{errorCount}} files","Applies to all {{count}} files":"(applies to all {{count}} files)","Some files failed to upload":"Some files failed to upload. Please check file size and format.",upload_error_hint_invalid_name:"Rename the file: use only letters, numbers, hyphens and underscores.",upload_error_hint_size:"Reduce the file size or choose a different file.",upload_error_hint_format:"Use an allowed format: JPG, PNG, or GIF.",upload_error_hint_exists:"A file with this name already exists in the folder. Rename the file.","Images generated successfully":"Images generated successfully","Trash is empty":"Trash is empty","Deleted files will be displayed here":"Deleted files will be displayed here","Supported files:":"Supported files:","Stroke width":"Stroke thickness",Color1:"Color",Color2:"Color2",Color3:"Color3","Global search":"Global search","Family search":"Family search","Choose for template":"Choose for template",Back:"Back","Editing: {{name}}":"Editing: {{name}}","Editing image":"Editing image",Save:"Save","Loading editor...":"Loading editor...","Error loading image":"Error loading image","Error saving image":"Error saving image","Error initializing editor":"Error initializing editor","Close File Manager":"Close File Manager","Are you sure you want to close? Unsaved changes will be lost.":"Are you sure you want to close? Unsaved changes will be lost.","Are you sure you want to close the file manager?":"Are you sure you want to close the file manager?",Close:"Close",KB:"KB","No files":"No files","Folder is empty or files not found":"Folder is empty or files not found","Search files...":"Search files...",Success:"Success","Image updated successfully":"Image updated successfully","Failed to save changes":"Failed to save changes: {{error}}","Unknown error":"Unknown error","Select destination folder":"Select destination folder","Error moving":"Error moving","Error deleting":"Error deleting","Error copying":"Error copying","Error renaming":"Error renaming","Failed to refresh folder tree":"Failed to refresh folder tree","Failed to refresh file list":"Failed to refresh file list","Errors occurred while moving":"Errors occurred while moving","Errors occurred while copying":"Errors occurred while copying","(error)":"(error)","(circular reference)":"(circular reference)","File too large. Maximum size: {{size}}":"File too large. Maximum size: {{size}}","File too small. Minimum size: {{size}}":"File too small. Minimum size: {{size}}","Unsupported file type":"Unsupported file type","Unsupported file type: {{type}}":"Unsupported file type: {{type}}",unknown:"unknown","Failed to load files":"Failed to load files","Failed to load files in folder":"Could not load folder contents ({{folderName}})","Failed to load subfolders in folder":'Could not load subfolders in "{{folderName}}"',"Failed to load folder items count in folder":'Could not get item count for "{{folderName}}"',"DataProvider for folder deletion is not configured":"DataProvider for folder deletion is not configured","DataProvider for file upload is not configured":"DataProvider for file upload is not configured","Error uploading file {{fileName}}":"Error uploading file {{fileName}}","Error uploading file":"Error uploading file","Cannot upload files to Trash":"Cannot upload files to Trash","Please fill in all fields":"Please fill in all fields","Upload by URL is not supported":"Upload by URL is not supported","File name is too long. Maximum {{max}} characters":"File name is too long. Maximum {{max}} characters","File name contains invalid characters":"File name contains invalid characters","Large file may take a long time to upload":"Large file may take a long time to upload","File unavailable: {{status}} {{statusText}}":"File unavailable: {{status}} {{statusText}}","File too large: {{size}}":"File too large: {{size}}","Unsupported file type: {{contentType}}":"Unsupported file type: {{contentType}}","Invalid server response: folder ID is missing":"Invalid server response: folder ID is missing","Error: folder cannot be its own parent":"Error: folder cannot be its own parent","Upload to Trash is forbidden":"Upload to Trash is forbidden","renameFolder is not implemented in dataProviders":"renameFolder is not implemented in dataProviders","renameFile is not implemented in dataProviders":"renameFile is not implemented in dataProviders",Deleted:"Deleted",Clean:"Clean","Circular dependency detected: folder cannot be its own parent":"Circular dependency detected: folder cannot be its own parent","Save as copy and choose":"Save as copy and choose","Save and choose":"Save and choose",pixie:{"added drawing":"Added Drawing","added frame":"Added Frame","added image":"Added Image","added shape":"Added Shape","added sticker":"Added Sticker","added text":"Added Text","applied filters":"Applied Filters",apply:"Apply",background:"Background","background color":"Background color",beach:"Beach","brush color":"Brush Color","brush size":"Brush Size","brush type":"Brush Type",bubbles:"Bubbles",Cancel:"Cancel","changed style":"Changed Style","Circle Brush":"Circle Brush",close:"Close",color:"Color",corners:"Corners",crop:"Crop",Custom:"Custom","deleted object":"Deleted object","Diamond Brush":"Diamond Brush",doodles:"Doodles",draw:"Draw",emoticons:"Emoticons","Eraser Brush":"Eraser Brush",filter:"Filter",font:"Font","font size":"Font Size",frame:"Frame",gradient:"Gradient",height:"Height",history:"History","H Line Brush":"H Line Brush",image:"Image",initial:"Initial",landmarks:"Landmarks","loaded state":"Loaded State","loading canvas":"Loading Canvas","loading image":"Loading Image","loading state":"Loading State","maintain aspect ratio":"Maintain aspect ratio",merge:"Merge","merged objects":"Merged Objects","new text":"New Text",objects:"Objects",opacity:"Opacity",outline:"Outline","outline color":"Outline Color","Pencil Brush":"Pencil Brush","processing image":"Processing Image",quality:"Quality",radius:"Radius","replace image":"Replace Image","replaced background image":"Replaced Background Image",resize:"Resize","resized image":"Resized Image","rounded corner":"Rounded Corner",save:"Save",shadow:"Shadow","shadow color":"Shadow Color",shapes:"Shapes","Spray Brush":"Spray Brush",square:"Square","Square Brush":"Square Brush",stickers:"Stickers",text:"Text",texture:"Texture",transportation:"Transportation","V Line Brush":"V Line Brush",width:"Width",grayscale:"Grayscale","black & White":"Black & White",sharpen:"Sharpen",invert:"Invert",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"Brownie",sepia:"Sepia","remove Color":"Remove Color",brightness:"Brightness",gamma:"Gamma",noise:"Noise",pixelate:"Pixelate",blur:"Blur",emboss:"Emboss","blend Color":"Blend Color",distance:"Distance",red:"Red",green:"Green",blue:"Blue",blocksize:"Blocksize",alpha:"Alpha",add:"Add",multiply:"Multiply",subtract:"Subtract",diff:"Diff",screen:"Screen",lighten:"Lighten",darken:"Darken","select an option...":"Select an option..."}}},ru:{translation:{Files:"\u0424\u0430\u0439\u043b\u044b",selected:"\u0432\u044b\u0431\u0440\u0430\u043d\u043e",Deselected:"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440",Refresh:"\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c","Select all":"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435",Rename:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c","Rename file":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f","Selected files:":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432:","Selected files":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432: {{count}}",selected_files_one:"\u0412\u044b\u0431\u0440\u0430\u043d {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0430",selected_files_many:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",selected_files_other:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",Copy:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",Edit:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c",Move:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c","Move to":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c",Delete:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c","New folder":"\u041d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0438\u0441\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439...","Search icons":"\u041d\u0430\u0439\u0442\u0438 \u0438\u043a\u043e\u043d\u043a\u0438","By name":"\u041f\u043e \u0438\u043c\u0435\u043d\u0438","By size":"\u041f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443","By date":"\u041f\u043e \u0434\u0430\u0442\u0435",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043b\u0430\u0432\u043d\u0430\u044f",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u0435\u0433\u043e {{total}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Name:"\u0418\u043c\u044f",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f",Size:"\u0420\u0430\u0437\u043c\u0435\u0440",Dimensions:"\u0420\u0430\u0437\u043c\u0435\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043e\u0448\u0438\u0431\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u043e\u0437\u0434\u0430\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0443\u0434\u0430\u043b\u0435\u043d","Files deleted":"\u0424\u0430\u0439\u043b\u044b \u0443\u0434\u0430\u043b\u0435\u043d\u044b","Error when deleting a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Folder deleted":"\u041f\u0430\u043f\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430","Error when deleting a folder":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Please select an image file":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","The URL must point to an image":"URL \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Image upload...":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f...",Unknown:"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e","Error downloading file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Error when downloading a file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","Error when uploading a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430","Error loading files":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Upload file by URL":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Upload file":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u043e\u0437\u0434\u0430\u0442\u044c",Cancel:"\u041e\u0442\u043c\u0435\u043d\u0430","Folder name":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter the name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438:","selected folder":"\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435","Failed to load folders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c","Folder creation provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Folder created":"\u041f\u0430\u043f\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043e\u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439","Folder rename provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430","Failed to rename folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435","Failed to load subfolders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c","image URL":"URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Enter a new file name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Copy to folder":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b {{fileName}} \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Successfully uploaded":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Successfully uploaded files":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_success_summary:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0451\u043d.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 ({{fileSize}}). \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u2014 {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e: {{allowed}}, \u0432\u044b\u0431\u0440\u0430\u043d\u043e: {{received}}","This file type is not allowed.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","File name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.","File name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b: {{allowedChars}}","Failed to read the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d \u0438\u043b\u0438 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","A folder with that name already exists. Please enter a different folder name.":"\u041f\u0430\u043f\u043a\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435.","Folder name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438: {{allowedChars}}","Failed to read the folder contents.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u0430\u043f\u043a\u043e\u0439.","Folder storage quota exceeded.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u0443\u0441\u0442\u0430.","Server error while processing the folder.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u043f\u0430\u043f\u043a\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Network error. Please check your connection and try again.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0442\u0438. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Too many requests. Please try again a bit later.":"\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.","Some of the provided data is invalid.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b.","This operation is not supported.":"\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Request payload is too large.":"\u0422\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435.","This media type is not supported.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432.","Network error while uploading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","File upload took too long.":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while uploading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","The specified URL is not valid.":"\u0423\u043a\u0430\u0437\u0430\u043d \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL.","The specified URL is not reachable.":"\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 URL \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL.","Network error while downloading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","File download took too long.":"\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while downloading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0438 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.","Some items in the batch are in a conflicting state.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.","Some items in the batch did not pass validation.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0438\u0441 AI \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.","Failed to generate image using AI.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u043b\u0438\u043c\u0438\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 AI.","Error in external integration.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.","Error in a third-party service.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435.","An unknown error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.","Cannot move an item into its descendant folder.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043f\u0430\u043f\u043a\u0443.","Cannot copy an item into itself.":"\u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.","Configuration error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.","Storage quota exceeded. Please free up space.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u0435 \u043c\u0435\u0441\u0442\u043e.","File is locked by another process or user.":"\u0424\u0430\u0439\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0438\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.","File version conflict. Please refresh and try again.":"\u041a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0432\u0435\u0440\u0441\u0438\u0439 \u0444\u0430\u0439\u043b\u0430. \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.","Batch operation exceeds the maximum number of items allowed.":"\u041f\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u044b: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",move_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Copied:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",copy_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Uploaded:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b: {{names}}",Failed:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c: {{names}}","Failed to upload":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Failed to upload files":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",months:{january:"\u044f\u043d\u0432\u0430\u0440\u044f",february:"\u0444\u0435\u0432\u0440\u0430\u043b\u044f",march:"\u043c\u0430\u0440\u0442\u0430",april:"\u0430\u043f\u0440\u0435\u043b\u044f",may:"\u043c\u0430\u044f",june:"\u0438\u044e\u043d\u044f",july:"\u0438\u044e\u043b\u044f",august:"\u0430\u0432\u0433\u0443\u0441\u0442\u0430",september:"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",october:"\u043e\u043a\u0442\u044f\u0431\u0440\u044f",november:"\u043d\u043e\u044f\u0431\u0440\u044f",december:"\u0434\u0435\u043a\u0430\u0431\u0440\u044f"},files:"\u0444\u0430\u0439\u043b\u043e\u0432","No available folders":"\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0438 \u0444\u0430\u0439\u043b\u044b",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","QR & Barcode":"QR \u0438 \u0448\u0442\u0440\u0438\u0445\u043a\u043e\u0434","QR code":"QR-\u043a\u043e\u0434",Barcode:"\u0428\u0442\u0440\u0438\u0445\u043a\u043e\u0434","Text or URL":"\u0422\u0435\u043a\u0441\u0442 \u0438\u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0430","Code color":"\u0426\u0432\u0435\u0442 \u043a\u043e\u0434\u0430","Background color":"\u0426\u0432\u0435\u0442 \u0444\u043e\u043d\u0430","Add to My files":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u041c\u043e\u0438 \u0444\u0430\u0439\u043b\u044b","Transparent background":"\u041f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \u0444\u043e\u043d","Barcode generation failed":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0448\u0442\u0440\u0438\u0445\u043a\u043e\u0434. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 CODE128.","Validation error":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438","Enter text or URL to preview":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043a\u0441\u0442 \u0438\u043b\u0438 URL \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430.",Preview:"\u041f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440","QR transparent background hint":"\u041f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 PNG \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u0442\u0451\u043c\u043d\u043e\u0439 \u0442\u0435\u043c\u043e\u0439 \u043f\u0438\u0441\u044c\u043c\u0430; \u0431\u0435\u043b\u044b\u0439 \u0444\u043e\u043d \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u0435\u0435 \u0434\u043b\u044f \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432.","QR image size px":"\u0420\u0430\u0437\u043c\u0435\u0440 QR","Barcode bar height px":"\u0412\u044b\u0441\u043e\u0442\u0430 \u0448\u0442\u0440\u0438\u0445\u043e\u0432",Icons:"\u0418\u043a\u043e\u043d\u043a\u0438",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Search GIFs":"\u041d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u042d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0439\u0442\u0438.","Search image":"\u041d\u0430\u0439\u0442\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",All:"\u0412\u0441\u0435",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0435",Black:"\u0427\u0435\u0440\u043d\u044b\u0439","Black and White":"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0439",White:"\u0411\u0435\u043b\u044b\u0439",Orange:"\u041e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",Red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439",Purple:"\u0424\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439",Teal:"\u0411\u0438\u0440\u044e\u0437\u043e\u0432\u044b\u0439",Blue:"\u0421\u0438\u043d\u0438\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Filter by type":"\u0424\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u0442\u0438\u043f\u0443","All types":"\u0412\u0441\u0435 \u0442\u0438\u043f\u044b","File name":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430",Actions:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f","Add file":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d","Files moved":"\u0424\u0430\u0439\u043b\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u044b","Error when moving a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Files copied":"\u0424\u0430\u0439\u043b\u044b \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b","Failed to download file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL \u0444\u0430\u0439\u043b\u0430","Unable to validate file URL":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Type to search...":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430...",Submit:"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0430 \u043d\u0435\u0442","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438","Drop files here to upload":"\u041e\u0442\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0437\u0434\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445","Newest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u043e\u0432\u044b\u0435","Oldest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0440\u044b\u0435","Largest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435","Smallest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435","A-Z":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u0410-\u042f","Z-A":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u042f-\u0410","By type":"\u041f\u043e \u0442\u0438\u043f\u0443","Evaluating the task":"\u041e\u0446\u0435\u043d\u043a\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f","Something went wrong, please try again":"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e","preview text":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f ...","Use this variant":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442","Confirm deletion":"\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Are you sure you want to delete the selected items?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Are you sure you want to move the selected items to the Trash?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443?","Permanently delete":"\u041f\u043e\u043b\u043d\u043e\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Delete permanently":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c.",Clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c","Clear Trash":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Are you sure you want to permanently delete all items from Trash?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u043a\u043e\u0440\u0437\u0438\u043d\u044b?","Trash cleared successfully":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u0430","{{count}} items permanently deleted":"{{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043e","Trash partially cleared":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u0430","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043e, {{failed}} \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c","Failed to clear trash":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Error clearing trash":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u044b","Deleting items...":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432...",delete_files_permanent_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u0430",delete_files_permanent_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_files_permanent_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_folder_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.",delete_mixed_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 \u0432\u0441\u0435 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445.",permanent_delete_warning:"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043f\u0438\u0441\u044c\u043c\u0430\u0445, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a \u0432 \u0441\u0442\u0430\u0440\u044b\u0445 \u043f\u0438\u0441\u044c\u043c\u0430\u0445. \u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435?",move_files_to_trash_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430.",move_files_to_trash_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_files_to_trash_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_folder_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 ({{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432).",move_mixed_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_permanent_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u043e\u0432",Trash:"\u041a\u043e\u0440\u0437\u0438\u043d\u0430",Choose:"\u0412\u044b\u0431\u0440\u0430\u0442\u044c",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f","Creating an image on demand":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443","Search file or folder":"\u041d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043f\u0430\u043f\u043a\u0443","Click here to select a file":"\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0437\u0434\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Supported files:":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b:","Create folder":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u044e\u0434\u0430","Copy here":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u044e\u0434\u0430","File URL":"URL \u0444\u0430\u0439\u043b\u0430","There's nothing here":"\u0417\u0434\u0435\u0441\u044c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442","Try using a different search query.":"\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441.","Millions of free stock images":"\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Millions of icons":"\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0438\u043a\u043e\u043d\u043e\u043a","Lucide icons":"\u0418\u043a\u043e\u043d\u043a\u0438 Lucide","Thousands of icons":"\u0422\u044b\u0441\u044f\u0447\u0438 \u0438\u043a\u043e\u043d\u043e\u043a","Enter a search query and we'll find the perfect icon for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043a\u043e\u043d\u043a\u0443","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435","Over 350,000 live images":"\u0411\u043e\u043b\u0435\u0435 350 000 \u0436\u0438\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435.",undo:"\u041e\u0422\u041c\u0415\u041d\u0410",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",restored_items_one:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430",restored_items_many:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",restored_items_other:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Type:"\u0422\u0438\u043f","Generate image":"C\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0442\u0430 \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u044b\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c.","For example:":"\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:",Insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c",Error:"\u041e\u0448\u0438\u0431\u043a\u0430","Upload progress":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 {{completed}}/{{total}}","Uploading files":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 {{completed}}/{{total}} \u0444\u0430\u0439\u043b\u043e\u0432","Uploaded files":"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{success}} \u0438\u0437 {{total}} \u0444\u0430\u0439\u043b\u043e\u0432","Upload error files":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 {{errorCount}} \u0444\u0430\u0439\u043b\u043e\u0432","Applies to all {{count}} files":"(\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e \u0432\u0441\u0435\u043c {{count}} \u0444\u0430\u0439\u043b\u0430\u043c)","Some files failed to upload":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u043e\u0432.",upload_error_hint_invalid_name:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432\u044b, \u0446\u0438\u0444\u0440\u044b, \u0434\u0435\u0444\u0438\u0441 \u0438 \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435.",upload_error_hint_size:"\u0423\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u043e\u0439.",upload_error_hint_format:"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: JPG, PNG \u0438\u043b\u0438 GIF.",upload_error_hint_exists:"\u0424\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b.","Images generated successfully":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b","Trash is empty":"\u041a\u043e\u0440\u0437\u0438\u043d\u0430 \u043f\u0443\u0441\u0442\u0430","Deleted files will be displayed here":"\u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b","Stroke width":"\u0422\u043e\u043b\u0449\u0438\u043d\u0430",Style:"\u0421\u0442\u0438\u043b\u044c",Color1:"\u0426\u0432\u0435\u0442",Color2:"\u0426\u0432\u0435\u0442 2",Color3:"\u0426\u0432\u0435\u0442 3","Global search":"\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a","Family search":"\u041f\u043e\u0438\u0441\u043a \u043f\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0443","Choose for template":"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d",Back:"\u041d\u0430\u0437\u0430\u0434","Editing: {{name}}":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: {{name}}","Editing image":"\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",Save:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c","Loading editor...":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u2026","Error loading image":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Error saving image":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Error initializing editor":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430","Close File Manager":"\u0417\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","Are you sure you want to close? Unsaved changes will be lost.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c? \u041d\u0435\u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u044b.","Are you sure you want to close the file manager?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440?",Close:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",KB:"\u041a\u0411","No files":"\u041d\u0435\u0442 \u0444\u0430\u0439\u043b\u043e\u0432","Folder is empty or files not found":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0443\u0441\u0442\u0430 \u0438\u043b\u0438 \u0444\u0430\u0439\u043b\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b","Search files...":"\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432...",Success:"\u0423\u0441\u043f\u0435\u0445","Image updated successfully":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043e","Failed to save changes":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: {{error}}","Unknown error":"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430","Select destination folder":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f","Error moving":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438","Error deleting":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438","Error copying":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438","Error renaming":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438","Failed to refresh folder tree":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0430\u043f\u043e\u043a","Failed to refresh file list":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u043e\u0432","Errors occurred while moving":"\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438","Errors occurred while copying":"\u041f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438","(error)":"(\u043e\u0448\u0438\u0431\u043a\u0430)","(circular reference)":"(\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430)","File too large. Maximum size: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: {{size}}","File too small. Minimum size: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440: {{size}}","Unsupported file type":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430","Unsupported file type: {{type}}":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430: {{type}}",unknown:"\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439","Failed to load files":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b","Failed to load files in folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438 \xab{{folderName}}\xbb","Failed to load subfolders in folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438 \u0432 \xab{{folderName}}\xbb","Failed to load folder items count in folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \xab{{folderName}}\xbb","DataProvider for folder deletion is not configured":"DataProvider \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","DataProvider for file upload is not configured":"DataProvider \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Error uploading file {{fileName}}":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 {{fileName}}","Error uploading file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430","Cannot upload files to Trash":"\u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Please fill in all fields":"\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f","URL too long":"URL \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439","Only http and https URLs are supported":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e URL \u0441 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c http \u0438 https","Private and local URLs are not allowed":"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 URL \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b","Upload by URL is not supported":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f","File name is too long. Maximum {{max}} characters":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u043e\u0435. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c {{max}} \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432","File name contains invalid characters":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b","Large file may take a long time to upload":"\u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u043b\u0433\u043e","File unavailable: {{status}} {{statusText}}":"\u0424\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d: {{status}} {{statusText}}","File too large: {{size}}":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439: {{size}}","Unsupported file type: {{contentType}}":"\u041d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430: {{contentType}}","Invalid server response: folder ID is missing":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043f\u0430\u043f\u043a\u0438","Error: folder cannot be its own parent":"\u041e\u0448\u0438\u0431\u043a\u0430: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f","Upload to Trash is forbidden":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u0430","renameFolder is not implemented in dataProviders":"renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders","renameFile is not implemented in dataProviders":"renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders",Deleted:"\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b",Clean:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c","Circular dependency detected: folder cannot be its own parent":"\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f","Save as copy and choose":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043f\u0438\u044e \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c","Save and choose":"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c",pixie:{"added drawing":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0430","added frame":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u043c\u043a\u0438","added image":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","added shape":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b","added sticker":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043a\u0435\u0440\u0430","added text":"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430","applied filters":"\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440",apply:"\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c",background:"\u0424\u043e\u043d","background color":"\u0424\u043e\u043d\u043e\u0432\u044b\u0439 \u0446\u0432\u0435\u0442",beach:"\u041f\u043b\u044f\u0436","brush color":"\u0426\u0432\u0435\u0442 \u043a\u0438\u0441\u0442\u0438","brush size":"\u0420\u0430\u0437\u043c\u0435\u0440 \u043a\u0438\u0441\u0442\u0438","brush type":"\u0422\u0438\u043f \u043a\u0438\u0441\u0442\u0438",bubbles:"\u041f\u0443\u0437\u044b\u0440\u044c\u043a\u0438",Cancel:"\u041e\u0442\u043c\u0435\u043d\u0430","changed style":"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f","Circle Brush":"\u041a\u0440\u0443\u0433\u0438",close:"\u0417\u0430\u043a\u0440\u044b\u0442\u044c",color:"\u0426\u0432\u0435\u0442",corners:"\u0423\u0433\u043b\u044b",crop:"\u041e\u0431\u0440\u0435\u0437\u0430\u0442\u044c",Custom:"\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439","deleted object":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430","Diamond Brush":"\u0410\u043b\u043c\u0430\u0437",doodles:"\u0426\u0432\u0435\u0442\u043d\u044b\u0435",draw:"\u0420\u0438\u0441\u0443\u043d\u043e\u043a",emoticons:"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438","Eraser Brush":"\u041b\u0430\u0441\u0442\u0438\u043a",filter:"\u0424\u0438\u043b\u044c\u0442\u0440",font:"\u0428\u0440\u0438\u0444\u0442","font size":"\u0420\u0430\u0437\u043c\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430",frame:"\u0420\u0430\u043c\u043a\u0430",gradient:"\u0413\u0440\u0430\u0434\u0438\u0435\u043d\u0442",height:"\u0412\u044b\u0441\u043e\u0442\u0430",history:"\u0418\u0441\u0442\u043e\u0440\u0438\u044f","H Line Brush":"\u041d-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f",image:"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",initial:"\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439",landmarks:"\u0414\u043e\u0441\u0442\u043e\u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438","loaded state":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f","loading canvas":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","loading image":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","loading state":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","maintain aspect ratio":"Maintain aspect ratio",merge:"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435","merged objects":"\u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432","new text":"\u041d\u043e\u0432\u0430\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u044c",objects:"\u041e\u0431\u044a\u0435\u043a\u0442",opacity:"\u041f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c",outline:"\u041a\u043e\u043d\u0442\u0443\u0440","outline color":"\u0426\u0432\u0435\u0442 \u043a\u043e\u043d\u0442\u0443\u0440\u0430","Pencil Brush":"\u041a\u0430\u0440\u0430\u043d\u0434\u0430\u0448","processing image":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430",quality:"\u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e",radius:"\u0420\u0430\u0434\u0438\u0443\u0441","replace image":"Replace Image","replaced background image":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",resize:"\u0420\u0430\u0437\u043c\u0435\u0440","resized image":"\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430","rounded corner":"\u0417\u0430\u0433\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435 \u0443\u0433\u043b\u043e\u0432",save:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c",shadow:"\u0422\u0435\u043d\u044c","shadow color":"\u0426\u0432\u0435\u0442 \u0442\u0435\u043d\u0438",shapes:"\u0424\u0438\u0433\u0443\u0440\u044b","Spray Brush":"\u0421\u043f\u0440\u0435\u0439",square:"\u041a\u0432\u0430\u0440\u0434\u0440\u0430\u0442","Square Brush":"\u041a\u0432\u0430\u0440\u0434\u0440\u0430\u0442",stickers:"\u0421\u0442\u0438\u043a\u0435\u0440\u044b",text:"\u041d\u0430\u0434\u043f\u0438\u0441\u044c",texture:"\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430",transportation:"\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","V Line Brush":"V-\u043e\u0431\u0440\u0430\u0437\u043d\u0430\u044f",width:"\u0428\u0438\u0440\u0438\u043d\u0430",grayscale:"\u041e\u0442\u0442\u0435\u043d\u043a\u0438 \u0441\u0435\u0440\u043e\u0433\u043e","black & White":"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0439",sharpen:"\u0420\u0435\u0437\u043a\u043e\u0441\u0442\u044c",invert:"\u0418\u043d\u0432\u0435\u0440\u0441\u0438\u044f",vintage:"\u0412\u0438\u043d\u0442\u0430\u0436",polaroid:"\u041f\u043e\u043b\u0430\u0440\u043e\u0438\u0434",kodachrome:"\u041a\u043e\u0434\u0430\u0445\u0440\u043e\u043c",technicolor:"\u0422\u0435\u0445\u043d\u0438\u043a\u043e\u043b\u043e\u0440",brownie:"\u041a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439",sepia:"\u0421\u0435\u043f\u0438\u044f","remove Color":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0446\u0432\u0435\u0442",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442\u044c",gamma:"\u0413\u0430\u043c\u043c\u0430",noise:"\u0428\u0443\u043c",pixelate:"\u041f\u0438\u043a\u0441\u0435\u043b\u044c\u0438\u0437\u0430\u0446\u0438\u044f",blur:"\u0420\u0430\u0437\u043c\u044b\u0442\u0438\u0435",emboss:"\u0422\u0438\u0441\u043d\u0435\u043d\u0438\u0435","blend Color":"\u0421\u043c\u0435\u0448\u0430\u0442\u044c \u0446\u0432\u0435\u0442",distance:"\u0420\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435",red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439",blue:"\u0421\u0438\u043d\u0438\u0439",blocksize:"\u0420\u0430\u0437\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430",alpha:"\u0410\u043b\u044c\u0444\u0430",add:"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c",multiply:"\u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c",subtract:"\u0412\u044b\u0447\u0435\u0441\u0442\u044c",diff:"\u0420\u0430\u0437\u043d\u0438\u0446\u0430",screen:"\u042d\u043a\u0440\u0430\u043d",lighten:"\u041e\u0441\u0432\u0435\u0442\u043b\u0438\u0442\u044c",darken:"\u0417\u0430\u0442\u0435\u043c\u043d\u0438\u0442\u044c","select an option...":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u043f\u0446\u0438\u044e..."}}},es:{translation:{Files:"Archivos",selected:"seleccionado(s)",Deselected:"Deseleccionar",Refresh:"Actualizar","Select all":"Seleccionar todo",Rename:"Renombrar","Rename file":"Renombrar archivo {{currentFileName}}","Select the destination folder":"Seleccionar la carpeta de destino","Selected files:":"Archivos seleccionados:","Selected files":"Archivos seleccionados: {{count}}",selected_files_one:"{{count}} archivo seleccionado",selected_files_few:"{{count}} archivos seleccionados",selected_files_many:"{{count}} archivos seleccionados",selected_files_other:"{{count}} archivos seleccionados",Copy:"Duplicar",Edit:"Editar",Move:"Mover","Move to":"Mover a",Delete:"Eliminar","New folder":"Nueva carpeta","Image search...":"B\xfasqueda de im\xe1genes...","Search icons":"Buscar iconos","By name":"Por nombre","By size":"Por tama\xf1o","By date":"Por fecha",List:"Lista",Grid:"Cuadr\xedcula",Main:"Principal",Folders:"Carpetas","total pages":"{{total}} elementos en total",Name:"Nombre",Untitled:"Sin t\xedtulo",Size:"Tama\xf1o","Stroke width":"Grosor del trazo",Dimensions:"Dimensiones",Date:"Fecha",error:"error",Folder:"Carpeta",created:"creada","Failed to create folder":"Error al crear la carpeta","File deleted":"Archivo eliminado","Error when deleting a file":"Error al eliminar el archivo","Folder deleted":"Carpeta eliminada","Error when deleting a folder":"Error al eliminar la carpeta","Delete folder":"Eliminar carpeta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\xbfEst\xe1 seguro de que desea eliminar esta carpeta? Esta acci\xf3n tambi\xe9n eliminar\xe1 todos los archivos y subcarpetas.","API-endpoint for file upload is not configured":"El endpoint API para la carga de archivos no est\xe1 configurado","Please select an image file":"Por favor, seleccione un archivo de imagen",File:"Archivo","has been successfully uploaded":"se ha cargado exitosamente","The URL must point to an image":"La URL debe apuntar a una imagen","Image upload...":"Cargando imagen...",Unknown:"Desconocido","Error downloading file by URL":"Error al descargar el archivo por URL","successfully uploaded":"cargado exitosamente","Error when downloading a file by URL":"Error al descargar un archivo por URL","Error when uploading a file":"Error al cargar el archivo","Error loading files":"Error al cargar archivos","File not found":"Archivo no encontrado","File renamed to":"Archivo renombrado a","Failed to rename the file":"Error al renombrar el archivo","Folder renamed to":"Carpeta renombrada a","Rename folder":"Renombrar carpeta","New folder name":"Nuevo nombre de la carpeta","Enter a new folder name":"Ingrese un nuevo nombre para la carpeta","Please drag and drop image files only":"Por favor, arrastre y suelte solo archivos de imagen","Upload file by URL":"Cargar archivo por URL","Upload file":"Cargar archivo","Creating a new folder":"Creando una nueva carpeta",Create:"Crear",Cancel:"Cancelar","Folder name":"Nombre de la carpeta","Enter the name of the folder":"Ingrese el nombre de la carpeta","Enter the name":"Ingrese el nombre","A folder will be created inside:":"La carpeta se crear\xe1 dentro de:","selected folder":"carpeta seleccionada","The folder will be created in the root directory":"La carpeta se crear\xe1 en el directorio ra\xedz","Failed to load folders":"No se pudieron cargar las carpetas","Folder name cannot be empty":"El nombre de la carpeta no puede estar vac\xedo","Folder creation provider is not configured":"El proveedor de creaci\xf3n de carpetas no est\xe1 configurado","Folder created":"Carpeta creada","Folder rename is disabled by config":"El renombrado de carpetas est\xe1 deshabilitado por la configuraci\xf3n","Folder rename provider is not configured":"El proveedor para renombrar carpetas no est\xe1 configurado","Unexpected response when renaming folder":"Respuesta inesperada al renombrar la carpeta","Folder renamed":"Carpeta renombrada","Failed to rename folder":"No se pudo renombrar la carpeta","Failed to load folder items count":"No se pudo obtener la cantidad de elementos de la carpeta","Failed to load subfolders":"No se pudieron cargar las subcarpetas",Download:"Descargar","image URL":"URL de la imagen","Enter the URL of the image":"Ingrese la URL de la imagen","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos admitidos: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Nuevo nombre del archivo","Enter a new file name":"Ingrese un nuevo nombre para el archivo","Copy to folder":"Copiar a carpeta",Added:"A\xf1adido el {{date}}","File uploaded successfully":"Archivo {{fileName}} cargado exitosamente","Successfully uploaded":"{{successCount}} de {{count}} archivo cargado exitosamente","Successfully uploaded files":"{{successCount}} de {{count}} archivos cargados exitosamente",uploads_success_summary:"Se cargaron {{successCount}} de {{totalCount}} archivos",uploads_fail_summary:"No se pudieron cargar {{failCount}} de {{totalCount}} archivos","File with this name already exists.":"Ya existe un archivo con este nombre.","File not found or no longer available.":"El archivo no se encontr\xf3 o ya fue eliminado.","You don't have permission to access this file.":"No tiene permisos para acceder a este archivo.","File is too large to upload.":"El archivo es demasiado grande para subir.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"El archivo es demasiado grande ({{fileSize}}). Tama\xf1o m\xe1ximo permitido: {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"Se ha superado el n\xfamero m\xe1ximo de archivos. Permitido: {{allowed}}, recibido: {{received}}","This file type is not allowed.":"Este tipo de archivo no est\xe1 permitido.","File name is not valid.":"El nombre del archivo no es v\xe1lido.","File name is not valid. Allowed characters: {{allowedChars}}":"El nombre del archivo no es v\xe1lido. Caracteres permitidos: {{allowedChars}}","Failed to read the file.":"No se pudo leer el archivo.","Failed to write the file.":"No se pudo escribir el archivo.","The file appears to be corrupted.":"El archivo parece estar da\xf1ado.","File integrity check failed.":"La verificaci\xf3n de integridad del archivo fall\xf3.","Folder not found or no longer available.":"La carpeta no se encontr\xf3 o ya fue eliminada.","Folder with this name already exists.":"Ya existe una carpeta con este nombre.","A folder with that name already exists. Please enter a different folder name.":"Ya existe una carpeta con ese nombre. Introduzca un nombre de carpeta diferente.","You don't have permission to access this folder.":"No tiene permisos para acceder a esta carpeta.","Folder name is not valid.":"El nombre de la carpeta no es v\xe1lido.","Folder name is not valid. Allowed characters: {{allowedChars}}":"No se pudo crear la carpeta. Caracteres permitidos en el nombre: {{allowedChars}}","Failed to read the folder contents.":"No se pudo leer el contenido de la carpeta.","Failed to write to the folder.":"No se pudo escribir en la carpeta.","Folder storage quota exceeded.":"Se super\xf3 la cuota de almacenamiento de la carpeta.","Folder is not empty.":"La carpeta no est\xe1 vac\xeda.","Server error while processing the folder.":"Error del servidor al procesar la carpeta.","Folder operation took too long.":"La operaci\xf3n con la carpeta tard\xf3 demasiado.","Network error. Please check your connection and try again.":"Error de red. Compruebe su conexi\xf3n e int\xe9ntelo de nuevo.","The operation took too long. Please try again.":"La operaci\xf3n tard\xf3 demasiado. Int\xe9ntelo de nuevo.","Server error. Please try again later.":"Error del servidor. Int\xe9ntelo de nuevo m\xe1s tarde.","Service is temporarily unavailable. Please try again later.":"El servicio no est\xe1 disponible temporalmente. Int\xe9ntelo de nuevo m\xe1s tarde.","Too many requests. Please try again a bit later.":"Demasiadas solicitudes. Int\xe9ntelo de nuevo m\xe1s tarde.","Authentication failed. Please sign in again.":"Error de autenticaci\xf3n. Inicie sesi\xf3n de nuevo.","You are not allowed to perform this action.":"No tiene permisos para realizar esta acci\xf3n.","Some of the provided data is invalid.":"Algunos de los datos proporcionados no son v\xe1lidos.","This operation is not supported.":"Esta operaci\xf3n no est\xe1 soportada.","Request payload is too large.":"El cuerpo de la solicitud es demasiado grande.","This media type is not supported.":"Este tipo de contenido no est\xe1 soportado.","You have exceeded the upload quota.":"Se ha superado la cuota de subida de archivos.","Network error while uploading the file.":"Error de red al subir el archivo.","File upload took too long.":"La subida del archivo tard\xf3 demasiado.","Server error while uploading the file.":"Error del servidor al subir el archivo.","The specified URL is not valid.":"La URL especificada no es v\xe1lida.","The specified URL is not reachable.":"La URL especificada no es accesible.","Content type at the URL is not allowed.":"El tipo de contenido en la URL no est\xe1 permitido.","Failed to download file from the URL.":"No se pudo descargar el archivo desde la URL.","Network error while downloading the file.":"Error de red al descargar el archivo.","File download took too long.":"La descarga del archivo tard\xf3 demasiado.","Server error while downloading the file.":"Error del servidor al descargar el archivo.","Some items could not be processed.":"No todos los elementos se procesaron correctamente.","Failed to process all items in the batch.":"No se pudo procesar ning\xfan elemento del lote.","Some items in the batch are in a conflicting state.":"Algunos elementos del lote est\xe1n en estado de conflicto.","Some items in the batch did not pass validation.":"Algunos elementos del lote no pasaron la validaci\xf3n.","AI service returned an invalid response.":"El servicio de IA devolvi\xf3 una respuesta no v\xe1lida.","Failed to generate image using AI.":"No se pudo generar la imagen usando IA.","You have reached the AI image generation limit.":"Se alcanz\xf3 el l\xedmite de generaci\xf3n de im\xe1genes con IA.","Error in external integration.":"Error en la integraci\xf3n externa.","Error in a third-party service.":"Error en un servicio de terceros.","An unknown error occurred.":"Se ha producido un error desconocido.","Renaming is not allowed for this item.":"No se permite renombrar este elemento.","Moving is not allowed for this item.":"No se permite mover este elemento.","Copying is not allowed for this item.":"No se permite copiar este elemento.","Deleting is not allowed for this item.":"No se permite eliminar este elemento.","Cannot move an item into itself.":"No se puede mover un elemento dentro de s\xed mismo.","Cannot move an item into its descendant folder.":"No se puede mover un elemento a su carpeta descendiente.","Cannot copy an item into itself.":"No se puede copiar un elemento dentro de s\xed mismo.","Configuration error occurred.":"Se produjo un error de configuraci\xf3n.","Storage quota exceeded. Please free up space.":"Se super\xf3 la cuota de almacenamiento. Libere espacio.","File is locked by another process or user.":"El archivo est\xe1 bloqueado por otro proceso o usuario.","File version conflict. Please refresh and try again.":"Conflicto de versi\xf3n del archivo. Actualice la p\xe1gina e int\xe9ntelo de nuevo.","Batch operation exceeds the maximum number of items allowed.":"La operaci\xf3n por lotes excede el n\xfamero m\xe1ximo de elementos permitidos.",Moved:"Movidos: {{names}}",move_success_summary:"Se movieron {{successCount}} de {{totalCount}} elementos",move_fail_summary:"No se pudieron mover {{failCount}} de {{totalCount}} elementos",Copied:"Copiados: {{names}}",copy_success_summary:"Se copiaron {{successCount}} de {{totalCount}} elementos",copy_fail_summary:"No se pudieron copiar {{failCount}} de {{totalCount}} elementos",Uploaded:"Archivos cargados: {{names}}",Failed:"No se pudieron cargar: {{names}}","Failed to upload":"Error al cargar {{failCount}} de {{count}} archivo","Failed to upload files":"Error al cargar {{failCount}} de {{count}} archivos",months:{january:"enero",february:"febrero",march:"marzo",april:"abril",may:"mayo",june:"junio",july:"julio",august:"agosto",september:"septiembre",october:"octubre",november:"noviembre",december:"diciembre"},files:"archivos","No available folders":"No hay carpetas disponibles","My files":"Mis archivos",GIF:"GIF","Stock images":"Im\xe1genes de stock","QR & Barcode":"QR y c\xf3digo de barras","QR code":"C\xf3digo QR",Barcode:"C\xf3digo de barras","Text or URL":"Texto o URL","Code color":"Color del c\xf3digo","Background color":"Color de fondo","Add to My files":"A\xf1adir a Mis archivos","Transparent background":"Fondo transparente","Barcode generation failed":"No se pudo generar el c\xf3digo de barras. Use caracteres compatibles con CODE128.","Validation error":"Error de validaci\xf3n","Enter text or URL to preview":"Introduzca texto o una URL para la vista previa.",Preview:"Vista previa","QR transparent background hint":"Un PNG transparente puede fundirse con temas oscuros del correo; un fondo blanco suele escanearse mejor.","QR image size px":"Tama\xf1o del QR","Barcode bar height px":"Altura de barras",AI:"IA","AI image generation":"Generaci\xf3n de im\xe1genes con IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Es todo lo que pudimos encontrar.","Search image":"Buscar imagen",All:"Todos",Landscape:"Horizontal",Portrait:"Vertical",Squarish:"Cuadrado",Black:"Negro","Black and White":"Blanco y negro",White:"Blanco",Orange:"Naranja",Red:"Rojo",Purple:"Morado",Magenta:"Magenta",Green:"Verde",Teal:"Verde azulado",Blue:"Azul","Photo by":"Foto de",on:"en","File Manager":"Administrador de archivos","File Manager not configured":"Administrador de archivos no configurado","Filter by type":"Filtrar por tipo","All types":"Todos los tipos","File name":"Nombre del archivo",Actions:"Acciones","Add file":"A\xf1adir archivo","Add folder":"A\xf1adir carpeta","Add file by URL":"A\xf1adir archivo por URL","File moved":"Archivo movido","Error when moving a file":"Error al mover el archivo","Failed to download file":"No se pudo descargar el archivo","Failed to load JSON data":"No se pudieron cargar los datos JSON","Invalid file URL":"URL de archivo inv\xe1lida","Unable to validate file URL":"No se pudo validar la URL del archivo","Type to search...":"Escriba para buscar...",Submit:"Enviar","No folders yet":"A\xfan no hay carpetas","Drag files to upload":"Arrastre archivos para cargarlos","Drop files here to upload":"Suelte los archivos aqu\xed para cargarlos","Newest first":"Los m\xe1s nuevos primero","Oldest first":"Los m\xe1s antiguos primero","Largest first":"Los m\xe1s grandes primero","Smallest first":"Los m\xe1s peque\xf1os primero","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Evaluando la tarea","Something went wrong, please try again":"Algo sali\xf3 mal, por favor intente nuevamente","Sort by":"Ordenar por","preview text":"Cargando imagen...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar eliminaci\xf3n","Are you sure you want to delete the selected items?":"\xbfEst\xe1 seguro de que desea eliminar los elementos seleccionados?","Move to Trash":"Mover a la papelera","Are you sure you want to move the selected items to the Trash?":"\xbfEst\xe1 seguro de que desea mover los elementos seleccionados a la papelera?","Permanently delete":"Eliminaci\xf3n permanente","Delete permanently":"Eliminar permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\xbfEst\xe1 seguro de que desea eliminar permanentemente los elementos seleccionados? Esta acci\xf3n no se puede deshacer.",Clear:"Limpiar","Clear Trash":"Vaciar papelera","Are you sure you want to permanently delete all items from Trash?":"\xbfEst\xe1 seguro de que desea eliminar permanentemente todos los elementos de la papelera?","Trash cleared successfully":"Papelera vaciada con \xe9xito","{{count}} items permanently deleted":"{{count}} elementos eliminados permanentemente","Trash partially cleared":"Papelera parcialmente vaciada","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} elementos eliminados, {{failed}} fallaron","Failed to clear trash":"Error al vaciar papelera","Error clearing trash":"Error al vaciar papelera","Deleting items...":"Eliminando elementos...",delete_files_permanent_one:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivo",delete_files_permanent_few:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_many:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_other:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_folder_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente la carpeta \xab{{name}}\xbb y todo su contenido, incluyendo {{count}} elementos.",delete_mixed_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente {{total}} elementos seleccionados, incluyendo {{folders}} carpetas y todas las {{images}} im\xe1genes dentro de ellas.",permanent_delete_warning:"Eliminar archivos que se usaron en correos provocar\xe1 problemas para mostrar im\xe1genes en correos antiguos. \xbfEst\xe1 seguro de que desea eliminar permanentemente la selecci\xf3n?",move_files_to_trash_one:"Esta acci\xf3n mover\xe1 {{count}} archivo a la papelera.",move_files_to_trash_few:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_many:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_other:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_folder_to_trash:"Esta acci\xf3n mover\xe1 la carpeta \xab{{name}}\xbb y todo su contenido ({{count}} elementos) a la papelera.",move_mixed_to_trash:"Esta acci\xf3n mover\xe1 {{total}} elementos seleccionados a la papelera, incluyendo {{folders}} carpetas y {{images}} im\xe1genes.",delete_count_confirm_trash_one:"\xbfMover {{count}} archivo a la papelera?",delete_count_confirm_trash_few:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_many:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_other:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_permanent_one:"\xbfEliminar permanentemente {{count}} archivo?",delete_count_confirm_permanent_few:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_many:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_other:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_one:"\xbfEliminar {{count}} archivo?",delete_count_confirm_few:"\xbfEliminar {{count}} archivos?",delete_count_confirm_many:"\xbfEliminar {{count}} archivos?",delete_count_confirm_other:"\xbfEliminar {{count}} archivos?",item:"archivo",items:"archivos",Trash:"Papelera",Choose:"Elegir",Stock:"Banco de im\xe1genes","Select an image from our library":"Seleccione una imagen de nuestra biblioteca","AI generation":"Generaci\xf3n con IA","Creating an image on demand":"Creando una imagen bajo demanda","Search file or folder":"Buscar archivo o carpeta","Click here to select a file":"Haz clic aqu\xed para seleccionar un archivo","Supported files:":"Archivos admitidos:","Create folder":"Crear carpeta",Done:"Hecho","Move here":"Mover aqu\xed","Copy here":"Copiar aqu\xed","File URL":"URL del archivo","There's nothing here":"Aqu\xed no hay nada","Try using a different search query.":"Prueba a utilizar una consulta de b\xfasqueda diferente.","Millions of free stock images":"Millones de im\xe1genes de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Ingrese una consulta de b\xfasqueda y encontraremos la imagen perfecta para usted","Millions of icons":"Millones de iconos","Lucide icons":"Iconos Lucide","Thousands of icons":"Miles de iconos","Enter a search query and we'll find the perfect icon for you":"Ingrese una consulta de b\xfasqueda y encontraremos el \xedcono perfecto para usted","Enter your query and we will find the right one for you":"Ingrese su consulta y nosotros encontraremos la adecuada para usted","Over 350,000 live images":"M\xe1s de 350,000 im\xe1genes en vivo","The folder will be created in the root directory.":"La carpeta se crear\xe1 en el directorio ra\xedz.",undo:"DESHACER",moved_to_trash_one:"{{count}} elemento movido a la papelera",moved_to_trash_few:"{{count}} elementos movidos a la papelera",moved_to_trash_many:"{{count}} elementos movidos a la papelera",moved_to_trash_other:"{{count}} elementos movidos a la papelera",restored_items_one:"{{count}} elemento restaurado",restored_items_few:"{{count}} elementos restaurados",restored_items_many:"{{count}} elementos restaurados",restored_items_other:"{{count}} elementos restaurados",Type:"Tipo","Generate image":"Generar imagen","A beautiful image of a sunset over a calm ocean.":"Una imagen hermosa de un atardecer sobre un oc\xe9ano tranquilo.","For example:":"Por ejemplo:",Insert:"Insertar",Error:"Error","Upload progress":"Cargando {{completed}}/{{total}}","Uploading files":"Cargando {{completed}}/{{total}} archivos","Uploaded files":"Cargados {{success}} de {{total}} archivos","Upload error files":"Error al cargar {{errorCount}} archivos","Applies to all {{count}} files":"(se aplica a todos los {{count}} archivos)","Some files failed to upload":"Algunos archivos no se pudieron cargar. Verifique el tama\xf1o y el formato de los archivos.",upload_error_hint_invalid_name:"Renombre el archivo: use solo letras, n\xfameros, guiones y guiones bajos.",upload_error_hint_size:"Reduzca el tama\xf1o del archivo o elija otro.",upload_error_hint_format:"Use un formato permitido: JPG, PNG o GIF.",upload_error_hint_exists:"Ya existe un archivo con este nombre en la carpeta. Renombre el archivo.","Images generated successfully":"Im\xe1genes generadas correctamente","Choose for template":"Seleccionar para cargar en la plantilla","Trash is empty":"La papelera est\xe1 vac\xeda","Deleted files will be displayed here":"Los archivos eliminados se mostrar\xe1n aqu\xed","Editing: {{name}}":"Editando: {{name}}","Editing image":"Editando imagen",Save:"Guardar","Loading editor...":"Cargando editor...","Error loading image":"Error al cargar la imagen","Error saving image":"Error al guardar la imagen","Error initializing editor":"Error al inicializar el editor","Close File Manager":"Cerrar administrador de archivos","Are you sure you want to close? Unsaved changes will be lost.":"\xbfEst\xe1 seguro de que desea cerrar? Los cambios no guardados se perder\xe1n.","Are you sure you want to close the file manager?":"\xbfEst\xe1 seguro de que desea cerrar el administrador de archivos?",Close:"Cerrar",KB:"KB","No files":"No hay archivos","Folder is empty or files not found":"La carpeta est\xe1 vac\xeda o no se encontraron archivos","Search files...":"Buscar archivos...",Success:"\xc9xito","Image updated successfully":"Imagen actualizada exitosamente","Failed to save changes":"Error al guardar los cambios: {{error}}","Unknown error":"Error desconocido","Select destination folder":"Seleccione la carpeta de destino","Error moving":"Error al mover","Error deleting":"Error al eliminar","Error copying":"Error al copiar","Error renaming":"Error al renombrar","Failed to refresh folder tree":"Error al actualizar el \xe1rbol de carpetas","Failed to refresh file list":"Error al actualizar la lista de archivos","Errors occurred while moving":"Ocurrieron errores al mover","Errors occurred while copying":"Ocurrieron errores al copiar","(error)":"(error)","(circular reference)":"(referencia circular)","File too large. Maximum size: {{size}}":"El archivo es demasiado grande. Tama\xf1o m\xe1ximo: {{size}}","File too small. Minimum size: {{size}}":"El archivo es demasiado peque\xf1o. Tama\xf1o m\xednimo: {{size}}","Unsupported file type":"Tipo de archivo no admitido","Unsupported file type: {{type}}":"Tipo de archivo no admitido: {{type}}",unknown:"desconocido","Failed to load files":"Error al cargar archivos","Failed to load files in folder":"No se pudo cargar el contenido de la carpeta ({{folderName}})","Failed to load subfolders in folder":'No se pudieron cargar las subcarpetas en "{{folderName}}"',"Failed to load folder items count in folder":'No se pudo obtener el recuento de elementos en "{{folderName}}"',"DataProvider for folder deletion is not configured":"DataProvider para eliminar carpetas no est\xe1 configurado","DataProvider for file upload is not configured":"DataProvider para cargar archivos no est\xe1 configurado","Error uploading file {{fileName}}":"Error al cargar el archivo {{fileName}}","Error uploading file":"Error al cargar el archivo","Cannot upload files to Trash":"No se pueden cargar archivos a la papelera","Please fill in all fields":"Por favor, complete todos los campos","URL too long":"La URL es demasiado larga","Only http and https URLs are supported":"Solo se admiten URLs con protocolo http y https","Private and local URLs are not allowed":"No se permiten URLs locales ni privadas","Upload by URL is not supported":"La carga por URL no est\xe1 admitida","File name is too long. Maximum {{max}} characters":"El nombre del archivo es demasiado largo. M\xe1ximo {{max}} caracteres","File name contains invalid characters":"El nombre del archivo contiene caracteres no v\xe1lidos","Large file may take a long time to upload":"Un archivo grande puede tardar mucho en cargarse","File unavailable: {{status}} {{statusText}}":"Archivo no disponible: {{status}} {{statusText}}","File too large: {{size}}":"Archivo demasiado grande: {{size}}","Unsupported file type: {{contentType}}":"Tipo de archivo no admitido: {{contentType}}","Invalid server response: folder ID is missing":"Respuesta del servidor inv\xe1lida: falta el ID de la carpeta","Error: folder cannot be its own parent":"Error: la carpeta no puede ser su propio padre","Upload to Trash is forbidden":"Cargar a la papelera est\xe1 prohibido","renameFolder is not implemented in dataProviders":"renameFolder no est\xe1 implementado en dataProviders","renameFile is not implemented in dataProviders":"renameFile no est\xe1 implementado en dataProviders",Clean:"Limpiar","Circular dependency detected: folder cannot be its own parent":"Dependencia circular detectada: la carpeta no puede ser su propio padre","Save as copy and choose":"Guardar como copia y elegir","Save and choose":"Guardar y elegir",pixie:{"added drawing":"Dibujo a\xf1adido","added frame":"Marco a\xf1adido","added image":"Imagen a\xf1adida","added shape":"Forma a\xf1adida","added sticker":"Pegatina a\xf1adida","added text":"Texto a\xf1adido","applied filters":"Filtros aplicados",apply:"Aplicar",background:"Fondo","background color":"Color de fondo",beach:"Playa","brush color":"Color del pincel","brush size":"Tama\xf1o del pincel","brush type":"Tipo de pincel",bubbles:"Burbujas",Cancel:"Cancelar","changed style":"Estilo cambiado","Circle Brush":"C\xedrculo",close:"Cerrar",color:"Color",corners:"Esquinas",crop:"Recortar",Custom:"Personalizado","deleted object":"Objeto eliminado","Diamond Brush":"Diamante",doodles:"Garabatos",draw:"Dibujar",emoticons:"Emoticonos","Eraser Brush":"Borrador",filter:"Filtro",font:"Fuente","font size":"Tama\xf1o de fuente",frame:"Marco",gradient:"Gradiente",height:"Alto",history:"Historial","H Line Brush":"L\xednea H",image:"Imagen",initial:"Inicial",landmarks:"Monumentos","loaded state":"Estado cargado","loading canvas":"Cargando lienzo","loading image":"Cargando imagen","loading state":"Cargando estado","maintain aspect ratio":"Mantener proporci\xf3n",merge:"Fusionar","merged objects":"Objetos fusionados","new text":"Nuevo texto",objects:"Objetos",opacity:"Opacidad",outline:"Contorno","outline color":"Color del contorno","Pencil Brush":"L\xe1piz","processing image":"Procesando imagen",quality:"Calidad",radius:"Radio","replace image":"Reemplazar imagen","replaced background image":"Imagen de fondo reemplazada",resize:"Redimensionar","resized image":"Imagen redimensionada","rounded corner":"Esquina redondeada",save:"Guardar",shadow:"Sombra","shadow color":"Color de la sombra",shapes:"Formas","Spray Brush":"Spray",square:"Cuadrado","Square Brush":"Cuadrado",stickers:"Pegatinas",text:"Texto",texture:"Textura",transportation:"Transporte","V Line Brush":"L\xednea V",width:"Ancho",grayscale:"Escala de grises","black & White":"Blanco y negro",sharpen:"Enfocar",invert:"Invertir",vintage:"Vintage",polaroid:"Polaroid",kodachrome:"Kodachrome",technicolor:"Technicolor",brownie:"Sepia c\xe1lido",sepia:"Sepia","remove Color":"Eliminar color",brightness:"Brillo",gamma:"Gamma",noise:"Ruido",pixelate:"Pixelar",blur:"Desenfocar",emboss:"Relieve","blend Color":"Mezclar color",distance:"Distancia",red:"Rojo",green:"Verde",blue:"Azul",blocksize:"Tama\xf1o de bloque",alpha:"Alfa",add:"A\xf1adir",multiply:"Multiplicar",subtract:"Restar",diff:"Diferencia",screen:"Pantalla",lighten:"Aclarar",darken:"Oscurecer","select an option...":"Seleccione una opci\xf3n..."}}},uk:{translation:{Files:"\u0424\u0430\u0439\u043b\u0438",selected:"\u043e\u0431\u0440\u0430\u043d\u043e",Deselected:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438 \u0432\u0438\u0431\u0456\u0440",Refresh:"\u041e\u043d\u043e\u0432\u0438\u0442\u0438","Select all":"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0432\u0441\u0435",Rename:"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438","Rename file":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f","Selected files:":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432:","Selected files":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432: {{count}}",selected_files_one:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0438",selected_files_many:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",selected_files_other:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",Copy:"\u0414\u0443\u0431\u043b\u044e\u0432\u0430\u0442\u0438",Edit:"\u0417\u043c\u0456\u043d\u0438\u0442\u0438",Move:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438","Move to":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438",Delete:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438","New folder":"\u041d\u043e\u0432\u0430 \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0448\u0443\u043a \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c...","Search icons":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0456\u043a\u043e\u043d\u043a\u0438","By name":"\u0417\u0430 \u043d\u0430\u0437\u0432\u043e\u044e","By size":"\u0417\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u043e\u043c","By date":"\u0417\u0430 \u0434\u0430\u0442\u043e\u044e",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043e\u043b\u043e\u0432\u043d\u0430",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u044c\u043e\u0433\u043e {{total}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Name:"\u041d\u0430\u0437\u0432\u0430",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0438",Size:"\u0420\u043e\u0437\u043c\u0456\u0440","Stroke width":"\u0422\u043e\u0432\u0449\u0438\u043d\u0430 \u043e\u0431\u0432\u0435\u0434\u0435\u043d\u043d\u044f",Dimensions:"\u0420\u043e\u0437\u043c\u0456\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043f\u043e\u043c\u0438\u043b\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Folder deleted":"\u041f\u0430\u043f\u043a\u0443 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a folder":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0446\u044e \u043f\u0430\u043f\u043a\u0443? \u0426\u044f \u0434\u0456\u044f \u0442\u0430\u043a\u043e\u0436 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u0443\u0441\u0456 \u0444\u0430\u0439\u043b\u0438 \u0442\u0430 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Please select an image file":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","The URL must point to an image":"URL \u043f\u043e\u0432\u0438\u043d\u0435\u043d \u0432\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043d\u0430 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Image upload...":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f...",Unknown:"\u041d\u0435\u0432\u0456\u0434\u043e\u043c\u043e","Error downloading file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Error when downloading a file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","Error when uploading a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Error loading files":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043f\u0435\u0440\u0435\u0442\u044f\u0433\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u0435 \u0444\u0430\u0439\u043b\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Upload file by URL":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Upload file":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043d\u043e\u0432\u043e\u0457 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438",Cancel:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","Folder name":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","Enter the name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u0430\u0437\u0432\u0443","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456:","selected folder":"\u043e\u0431\u0440\u0430\u043d\u043e\u0457 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456","Failed to load folders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u043f\u043e\u0440\u043e\u0436\u043d\u044c\u043e\u044e","Folder creation provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Folder created":"\u041f\u0430\u043f\u043a\u0443 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043e","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u0432\u0438\u043c\u043a\u043d\u0435\u043d\u043e \u0432 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f\u0445","Folder rename provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0447\u0456\u043a\u0443\u0432\u0430\u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c \u043f\u0456\u0434 \u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e","Failed to rename folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043f\u0430\u043f\u0446\u0456","Failed to load subfolders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438","image URL":"URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u043e\u0440\u043c\u0430\u0442\u0438: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443","Enter a new file name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u0444\u0430\u0439\u043b\u0443","Copy to folder":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0434\u0430\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b {{fileName}} \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Successfully uploaded":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Successfully uploaded files":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_success_summary:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0439\u043e\u0433\u043e \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u044c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f.","File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439 ({{fileSize}}). \u0414\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440 \u2014 {{maxSize}}.","Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u0456\u0432. \u0414\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e: {{allowed}}, \u043e\u0431\u0440\u0430\u043d\u043e: {{received}}","This file type is not allowed.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","File name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443.","File name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438: {{allowedChars}}","Failed to read the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0448\u043a\u043e\u0434\u0436\u0435\u043d\u0438\u0439 \u0430\u0431\u043e \u043c\u0430\u0454 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0446\u0456\u043b\u0456\u0441\u043d\u043e\u0441\u0442\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0432\u0434\u0430\u043b\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0443 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0457\u0457 \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","A folder with that name already exists. Please enter a different folder name.":"\u041f\u0430\u043f\u043a\u0430 \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454. \u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0456\u043d\u0448\u0435 \u0456\u043c'\u044f \u043f\u0430\u043f\u043a\u0438.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u0456\u0454\u0457 \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid. Allowed characters: {{allowedChars}}":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438 \u0432 \u043d\u0430\u0437\u0432\u0456 \u043f\u0430\u043f\u043a\u0438: {{allowedChars}}","Failed to read the folder contents.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0432\u043c\u0456\u0441\u0442 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044e \u0437 \u043f\u0430\u043f\u043a\u043e\u044e.","Folder storage quota exceeded.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u043d\u044f.","Server error while processing the folder.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u043e\u0431\u0440\u043e\u0431\u043a\u0438 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0437 \u043f\u0430\u043f\u043a\u043e\u044e \u0437\u0430\u0439\u043d\u044f\u043b\u0430 \u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0447\u0430\u0441\u0443.","Network error. Please check your connection and try again.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456. \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f \u0434\u043e \u0456\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0442\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u043b\u0430\u0441\u044f \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0456. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0442\u0438\u043c\u0447\u0430\u0441\u043e\u0432\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Too many requests. Please try again a bit later.":"\u0417\u0430\u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0437\u0430\u043f\u0438\u0442\u0456\u0432. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e. \u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0443\u0432\u0456\u0439\u0434\u0456\u0442\u044c \u0437\u043d\u043e\u0432\u0443.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0446\u0456\u0454\u0457 \u0434\u0456\u0457.","Some of the provided data is invalid.":"\u0414\u0435\u044f\u043a\u0456 \u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u0454 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u043c\u0438.","This operation is not supported.":"\u0426\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Request payload is too large.":"\u0422\u0456\u043b\u043e \u0437\u0430\u043f\u0438\u0442\u0443 \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0435.","This media type is not supported.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u0438\u0445 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u043d\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432.","Network error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File upload took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","The specified URL is not valid.":"\u0412\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 URL-\u0430\u0434\u0440\u0435\u0441\u0443.","The specified URL is not reachable.":"\u0412\u043a\u0430\u0437\u0430\u043d\u0430 URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0432\u043c\u0456\u0441\u0442\u0443 \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e.","Network error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File download took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0431\u0443\u043b\u0438 \u043e\u0431\u0440\u043e\u0431\u043b\u0435\u043d\u0456 \u0443\u0441\u043f\u0456\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0431\u0440\u043e\u0431\u0438\u0442\u0438 \u0436\u043e\u0434\u0435\u043d \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457.","Some items in the batch are in a conflicting state.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043f\u0435\u0440\u0435\u0431\u0443\u0432\u0430\u044e\u0442\u044c \u0443 \u043a\u043e\u043d\u0444\u043b\u0456\u043a\u0442\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0456.","Some items in the batch did not pass validation.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043d\u0435 \u043f\u0440\u043e\u0439\u0448\u043b\u0438 \u0432\u0430\u043b\u0456\u0434\u0430\u0446\u0456\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0428\u0406 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0432 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c.","Failed to generate image using AI.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0428\u0406.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u044f\u0433\u043d\u0443\u0442\u043e \u043b\u0456\u043c\u0456\u0442\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u0457 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0428\u0406.","Error in external integration.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u0456\u0439 \u0456\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0456\u0457.","Error in a third-party service.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u044c\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0456\u0441\u0456.","An unknown error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043d\u0435\u0432\u0456\u0434\u043e\u043c\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u0435.","Cannot move an item into its descendant folder.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0434\u043e\u0447\u0456\u0440\u043d\u044e \u043f\u0430\u043f\u043a\u0443.","Cannot copy an item into itself.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u0435.","Configuration error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043f\u043e\u043c\u0438\u043b\u043a\u0430 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0457.","Storage quota exceeded. Please free up space.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u0441\u0445\u043e\u0432\u0438\u0449\u0430. \u0417\u0432\u0456\u043b\u044c\u043d\u0456\u0442\u044c \u043c\u0456\u0441\u0446\u0435.","File is locked by another process or user.":"\u0424\u0430\u0439\u043b \u0437\u0430\u0431\u043b\u043e\u043a\u043e\u0432\u0430\u043d\u043e \u0456\u043d\u0448\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u043e\u043c \u0430\u0431\u043e \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0447\u0435\u043c.","File version conflict. Please refresh and try again.":"\u041a\u043e\u043d\u0444\u043b\u0456\u043a\u0442 \u0432\u0435\u0440\u0441\u0456\u0439 \u0444\u0430\u0439\u043b\u0443. \u041e\u043d\u043e\u0432\u0456\u0442\u044c \u0441\u0442\u043e\u0440\u0456\u043d\u043a\u0443 \u0442\u0430 \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.","Batch operation exceeds the maximum number of items allowed.":"\u041f\u0430\u043a\u0435\u0442\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u043f\u0435\u0440\u0435\u0432\u0438\u0449\u0443\u0454 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",move_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Copied:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",copy_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Uploaded:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e: {{names}}",Failed:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438: {{names}}","Failed to upload":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Failed to upload files":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",months:{january:"\u0441\u0456\u0447\u043d\u044f",february:"\u043b\u044e\u0442\u043e\u0433\u043e",march:"\u0431\u0435\u0440\u0435\u0437\u043d\u044f",april:"\u043a\u0432\u0456\u0442\u043d\u044f",may:"\u0442\u0440\u0430\u0432\u043d\u044f",june:"\u0447\u0435\u0440\u0432\u043d\u044f",july:"\u043b\u0438\u043f\u043d\u044f",august:"\u0441\u0435\u0440\u043f\u043d\u044f",september:"\u0432\u0435\u0440\u0435\u0441\u043d\u044f",october:"\u0436\u043e\u0432\u0442\u043d\u044f",november:"\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430",december:"\u0433\u0440\u0443\u0434\u043d\u044f"},files:"\u0444\u0430\u0439\u043b\u0456\u0432","No available folders":"\u041d\u0435\u043c\u0430\u0454 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0457 \u0444\u0430\u0439\u043b\u0438",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u0456 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","QR & Barcode":"QR \u0442\u0430 \u0448\u0442\u0440\u0438\u0445\u043a\u043e\u0434","QR code":"QR-\u043a\u043e\u0434",Barcode:"\u0428\u0442\u0440\u0438\u0445\u043a\u043e\u0434","Text or URL":"\u0422\u0435\u043a\u0441\u0442 \u0430\u0431\u043e \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f","Code color":"\u041a\u043e\u043b\u0456\u0440 \u043a\u043e\u0434\u0443","Background color":"\u041a\u043e\u043b\u0456\u0440 \u0444\u043e\u043d\u0443","Add to My files":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0432 \u041c\u043e\u0457 \u0444\u0430\u0439\u043b\u0438","Transparent background":"\u041f\u0440\u043e\u0437\u043e\u0440\u0438\u0439 \u0444\u043e\u043d","Barcode generation failed":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u043e\u0431\u0443\u0434\u0443\u0432\u0430\u0442\u0438 \u0448\u0442\u0440\u0438\u0445\u043a\u043e\u0434. \u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0439\u0442\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u0438, \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 CODE128.","Validation error":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0432\u0430\u043b\u0456\u0434\u0430\u0446\u0456\u0457","Enter text or URL to preview":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0430\u0431\u043e URL \u0434\u043b\u044f \u043f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u044c\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0433\u043b\u044f\u0434\u0443.",Preview:"\u041f\u043e\u043f\u0435\u0440\u0435\u0434\u043d\u0456\u0439 \u043f\u0435\u0440\u0435\u0433\u043b\u044f\u0434","QR transparent background hint":"\u041f\u0440\u043e\u0437\u043e\u0440\u0438\u0439 PNG \u043c\u043e\u0436\u0435 \u0437\u043b\u0438\u0432\u0430\u0442\u0438\u0441\u044f \u0437 \u0442\u0435\u043c\u043d\u043e\u044e \u0442\u0435\u043c\u043e\u044e \u043b\u0438\u0441\u0442\u0430; \u0431\u0456\u043b\u0438\u0439 \u0444\u043e\u043d \u0447\u0430\u0441\u0442\u0456\u0448\u0435 \u043d\u0430\u0434\u0456\u0439\u043d\u0456\u0448\u0438\u0439 \u0434\u043b\u044f \u0441\u043a\u0430\u043d\u0435\u0440\u0456\u0432.","QR image size px":"\u0420\u043e\u0437\u043c\u0456\u0440 QR","Barcode bar height px":"\u0412\u0438\u0441\u043e\u0442\u0430 \u0448\u0442\u0440\u0438\u0445\u0456\u0432",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Search GIFs":"\u0417\u043d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u0426\u0435 \u0432\u0441\u0435, \u0449\u043e \u043c\u0438 \u0437\u043c\u043e\u0433\u043b\u0438 \u0437\u043d\u0430\u0439\u0442\u0438.","Search image":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",All:"\u0412\u0441\u0456",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0456",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0456",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0456",Black:"\u0427\u043e\u0440\u043d\u0438\u0439","Black and White":"\u0427\u043e\u0440\u043d\u043e-\u0431\u0456\u043b\u0438\u0439",White:"\u0411\u0456\u043b\u0438\u0439",Orange:"\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",Red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439",Purple:"\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u0438\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439",Teal:"\u0411\u0456\u0440\u044e\u0437\u043e\u0432\u0438\u0439",Blue:"\u0421\u0438\u043d\u0456\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Filter by type":"\u0424\u0456\u043b\u044c\u0442\u0440 \u0437\u0430 \u0442\u0438\u043f\u043e\u043c","All types":"\u0412\u0441\u0456 \u0442\u0438\u043f\u0438","File name":"\u041d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443",Actions:"\u0414\u0456\u0457","Add file":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0434\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e","Error when moving a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Failed to download file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0434\u0430\u043d\u0456 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u0439 URL \u0444\u0430\u0439\u043b\u0443","Unable to validate file URL":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Type to search...":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0448\u0443\u043a\u0443...",Submit:"\u041d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0438 \u043d\u0435\u043c\u0430\u0454","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u044f\u0433\u043d\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","Drop files here to upload":"\u0412\u0456\u0434\u043f\u0443\u0441\u0442\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0442\u0443\u0442, \u0449\u043e\u0431 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0457\u0445","Newest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043d\u043e\u0432\u0456","Oldest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0441\u0442\u0430\u0440\u0456","Largest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0432\u0435\u043b\u0438\u043a\u0456","Smallest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0456","A-Z":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u0410-\u042f","Z-A":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u042f-\u0410","By type":"\u0417\u0430 \u0442\u0438\u043f\u043e\u043c","Evaluating the task":"\u041e\u0446\u0456\u043d\u043a\u0430 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f","Something went wrong, please try again":"\u0429\u043e\u0441\u044c \u043f\u0456\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u0431\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u0437\u0430","preview text":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0454\u0442\u044c\u0441\u044f ...","Use this variant":"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0446\u0435\u0439 \u0432\u0430\u0440\u0456\u0430\u043d\u0442","Confirm deletion":"\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Are you sure you want to delete the selected items?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a","Are you sure you want to move the selected items to the Trash?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a?","Permanently delete":"\u041f\u043e\u0432\u043d\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Delete permanently":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438? \u0426\u044e \u0434\u0456\u044e \u043d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438.",Clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438","Clear Trash":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u0448\u0438\u043a","Are you sure you want to permanently delete all items from Trash?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0432\u0441\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0437 \u043a\u043e\u0448\u0438\u043a\u0430?","Trash cleared successfully":"\u041a\u043e\u0448\u0438\u043a \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043e","{{count}} items permanently deleted":"{{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Trash partially cleared":"\u041a\u043e\u0448\u0438\u043a \u0447\u0430\u0441\u0442\u043a\u043e\u0432\u043e \u043e\u0447\u0438\u0449\u0435\u043d\u043e","{{succeeded}} items deleted, {{failed}} items failed":"{{succeeded}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e, {{failed}} \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438","Failed to clear trash":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u0448\u0438\u043a","Error clearing trash":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043e\u0447\u0438\u0449\u0435\u043d\u043d\u0456 \u043a\u043e\u0448\u0438\u043a\u0430","Deleting items...":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432...",delete_files_permanent_one:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0438",delete_files_permanent_many:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_files_permanent_other:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_folder_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432.",delete_mixed_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 \u0432\u0441\u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u043d\u0438\u0445.",permanent_delete_warning:"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432, \u044f\u043a\u0456 \u0431\u0443\u043b\u0438 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u043d\u0456 \u0432 \u043b\u0438\u0441\u0442\u0430\u0445, \u043f\u0440\u0438\u0437\u0432\u0435\u0434\u0435 \u0434\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0437 \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f\u043c \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0443 \u0441\u0442\u0430\u0440\u0438\u0445 \u043b\u0438\u0441\u0442\u0430\u0445. \u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u043e\u0432\u043d\u0456\u0441\u0442\u044e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0435?",move_files_to_trash_one:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438.",move_files_to_trash_many:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_files_to_trash_other:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_folder_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442 ({{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432).",move_mixed_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_permanent_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u0456\u0432",Trash:"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u0456",Choose:"\u041e\u0431\u0440\u0430\u0442\u0438",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437 \u043d\u0430\u0448\u043e\u0457 \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f","Creating an image on demand":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043d\u0430 \u0437\u0430\u043c\u043e\u0432\u043b\u0435\u043d\u043d\u044f","Search file or folder":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0430\u0431\u043e \u043f\u0430\u043f\u043a\u0443","Click here to select a file":"\u041d\u0430\u0442\u0438\u0441\u043d\u0456\u0442\u044c \u0442\u0443\u0442, \u0449\u043e\u0431 \u0432\u0438\u0431\u0440\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Supported files:":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u0430\u0439\u043b\u0438:","Create folder":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0441\u044e\u0434\u0438","Copy here":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0441\u044e\u0434\u0438","File URL":"URL \u0444\u0430\u0439\u043b\u0443","There's nothing here":"\u0422\u0443\u0442 \u043d\u0456\u0447\u043e\u0433\u043e \u043d\u0435\u043c\u0430\u0454","Try using a different search query.":"\u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0456\u043d\u0448\u0438\u0439 \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442.","Millions of free stock images":"\u041c\u0456\u043b\u044c\u0439\u043e\u043d\u0438 \u0431\u0435\u0437\u043a\u043e\u0448\u0442\u043e\u0432\u043d\u0438\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442, \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0456\u0434\u0435\u0430\u043b\u044c\u043d\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Millions of icons":"\u041c\u0456\u043b\u044c\u0439\u043e\u043d\u0438 \u0456\u043a\u043e\u043d\u043e\u043a","Lucide icons":"\u0406\u043a\u043e\u043d\u043a\u0438 Lucide","Thousands of icons":"\u0422\u0438\u0441\u044f\u0447\u0456 \u0456\u043a\u043e\u043d\u043e\u043a","Enter a search query and we'll find the perfect icon for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442, \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0456\u0434\u0435\u0430\u043b\u044c\u043d\u0443 \u0456\u043a\u043e\u043d\u043a\u0443","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0437\u0430\u043f\u0438\u0442 \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0435","Over 350,000 live images":"\u041f\u043e\u043d\u0430\u0434 350 000 \u0436\u0438\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456.",undo:"\u0421\u041a\u0410\u0421\u0423\u0412\u0410\u0422\u0418",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",restored_items_one:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438",restored_items_many:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",restored_items_other:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Type:"\u0422\u0438\u043f","Generate image":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0445\u043e\u0434\u0443 \u0441\u043e\u043d\u0446\u044f \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u0456\u0439\u043d\u0438\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c.","For example:":"\u041d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434:",Insert:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u0438",Error:"\u041f\u043e\u043c\u0438\u043b\u043a\u0430","Upload progress":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{completed}}/{{total}}","Uploading files":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{completed}}/{{total}} \u0444\u0430\u0439\u043b\u0456\u0432","Uploaded files":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{success}} \u0437 {{total}} \u0444\u0430\u0439\u043b\u0456\u0432","Upload error files":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f {{errorCount}} \u0444\u0430\u0439\u043b\u0456\u0432","Applies to all {{count}} files":"(\u0441\u0442\u043e\u0441\u0443\u0454\u0442\u044c\u0441\u044f \u0432\u0441\u0456\u0445 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432)","Some files failed to upload":"\u0414\u0435\u044f\u043a\u0456 \u0444\u0430\u0439\u043b\u0438 \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438. \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u0440\u043e\u0437\u043c\u0456\u0440 \u0442\u0430 \u0444\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0456\u0432.",upload_error_hint_invalid_name:"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b: \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u0435 \u043b\u0456\u0442\u0435\u0440\u0438, \u0446\u0438\u0444\u0440\u0438, \u0434\u0435\u0444\u0456\u0441 \u0442\u0430 \u043f\u0456\u0434\u043a\u0440\u0435\u0441\u043b\u0435\u043d\u043d\u044f.",upload_error_hint_size:"\u0417\u043c\u0435\u043d\u0448\u0456\u0442\u044c \u0440\u043e\u0437\u043c\u0456\u0440 \u0444\u0430\u0439\u043b\u0443 \u0430\u0431\u043e \u043e\u0431\u0435\u0440\u0456\u0442\u044c \u0456\u043d\u0448\u0438\u0439.",upload_error_hint_format:"\u041e\u0431\u0435\u0440\u0456\u0442\u044c \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442: JPG, PNG \u0430\u0431\u043e GIF.",upload_error_hint_exists:"\u0424\u0430\u0439\u043b \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0454 \u0432 \u043f\u0430\u043f\u0446\u0456. \u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b.","Images generated successfully":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043e","Choose for template":"\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d","Trash is empty":"\u041a\u043e\u0448\u0438\u043a \u043f\u043e\u0440\u043e\u0436\u043d\u0456\u0439","Deleted files will be displayed here":"\u0422\u0443\u0442 \u0431\u0443\u0434\u0443\u0442\u044c \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u0438\u0441\u044f \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u0456 \u0444\u0430\u0439\u043b\u0438","Editing: {{name}}":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f: {{name}}","Editing image":"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",Save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438","Loading editor...":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u2026","Error loading image":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Error saving image":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u043d\u0456 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Error initializing editor":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0456\u043d\u0456\u0446\u0456\u0430\u043b\u0456\u0437\u0430\u0446\u0456\u0457 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430","Close File Manager":"\u0417\u0430\u043a\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","Are you sure you want to close? Unsaved changes will be lost.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u0438\u0442\u0438? \u041d\u0435\u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0456 \u0437\u043c\u0456\u043d\u0438 \u0431\u0443\u0434\u0443\u0442\u044c \u0432\u0442\u0440\u0430\u0447\u0435\u043d\u0456.","Are you sure you want to close the file manager?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0437\u0430\u043a\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440?",Close:"\u0417\u0430\u043a\u0440\u0438\u0442\u0438",KB:"\u041a\u0411","No files":"\u041d\u0435\u043c\u0430\u0454 \u0444\u0430\u0439\u043b\u0456\u0432","Folder is empty or files not found":"\u041f\u0430\u043f\u043a\u0430 \u043f\u043e\u0440\u043e\u0436\u043d\u044f \u0430\u0431\u043e \u0444\u0430\u0439\u043b\u0438 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u0456","Search files...":"\u041f\u043e\u0448\u0443\u043a \u0444\u0430\u0439\u043b\u0456\u0432...",Success:"\u0423\u0441\u043f\u0456\u0445","Image updated successfully":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043e","Failed to save changes":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0437\u043c\u0456\u043d\u0438: {{error}}","Unknown error":"\u041d\u0435\u0432\u0456\u0434\u043e\u043c\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430","Select destination folder":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f","Error moving":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u0456","Error deleting":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456","Error copying":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u0456","Error renaming":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u0456","Failed to refresh folder tree":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u0434\u0435\u0440\u0435\u0432\u043e \u043f\u0430\u043f\u043e\u043a","Failed to refresh file list":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0430\u0439\u043b\u0456\u0432","Errors occurred while moving":"\u041f\u0456\u0434 \u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u0432\u0438\u043d\u0438\u043a\u043b\u0438 \u043f\u043e\u043c\u0438\u043b\u043a\u0438","Errors occurred while copying":"\u041f\u0456\u0434 \u0447\u0430\u0441 \u043a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u0432\u0438\u043d\u0438\u043a\u043b\u0438 \u043f\u043e\u043c\u0438\u043b\u043a\u0438","(error)":"(\u043f\u043e\u043c\u0438\u043b\u043a\u0430)","(circular reference)":"(\u0446\u0438\u043a\u043b\u0456\u0447\u043d\u0435 \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f)","File too large. Maximum size: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440: {{size}}","File too small. Minimum size: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439. \u041c\u0456\u043d\u0456\u043c\u0430\u043b\u044c\u043d\u0438\u0439 \u0440\u043e\u0437\u043c\u0456\u0440: {{size}}","Unsupported file type":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443","Unsupported file type: {{type}}":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443: {{type}}",unknown:"\u043d\u0435\u0432\u0456\u0434\u043e\u043c\u0438\u0439","Failed to load files":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b\u0438","Failed to load files in folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0432\u043c\u0456\u0441\u0442 \u043f\u0430\u043f\u043a\u0438 \xab{{folderName}}\xbb","Failed to load subfolders in folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438 \u0432 \xab{{folderName}}\xbb","Failed to load folder items count in folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \xab{{folderName}}\xbb","DataProvider for folder deletion is not configured":"DataProvider \u0434\u043b\u044f \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","DataProvider for file upload is not configured":"DataProvider \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Error uploading file {{fileName}}":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443 {{fileName}}","Error uploading file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Cannot upload files to Trash":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a","Please fill in all fields":"\u0417\u0430\u043f\u043e\u0432\u043d\u0456\u0442\u044c \u0443\u0441\u0456 \u043f\u043e\u043b\u044f","URL too long":"URL \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u0438\u0439","Only http and https URLs are supported":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u044e\u0442\u044c\u0441\u044f \u043b\u0438\u0448\u0435 URL \u0437 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c http \u0442\u0430 https","Private and local URLs are not allowed":"\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0456 \u0442\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u0456 URL \u0437\u0430\u0431\u043e\u0440\u043e\u043d\u0435\u043d\u0456","Upload by URL is not supported":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 URL \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f","File name is too long. Maximum {{max}} characters":"\u0406\u043c'\u044f \u0444\u0430\u0439\u043b\u0443 \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u0435. \u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c {{max}} \u0441\u0438\u043c\u0432\u043e\u043b\u0456\u0432","File name contains invalid characters":"\u0406\u043c'\u044f \u0444\u0430\u0439\u043b\u0443 \u043c\u0456\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0456 \u0441\u0438\u043c\u0432\u043e\u043b\u0438","Large file may take a long time to upload":"\u0412\u0435\u043b\u0438\u043a\u0438\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0432\u0430\u0442\u0438\u0441\u044f \u0434\u043e\u0432\u0433\u043e","File unavailable: {{status}} {{statusText}}":"\u0424\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439: {{status}} {{statusText}}","File too large: {{size}}":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439: {{size}}","Unsupported file type: {{contentType}}":"\u041d\u0435\u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0438\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443: {{contentType}}","Invalid server response: folder ID is missing":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u0432\u0456\u0434\u0441\u0443\u0442\u043d\u0456\u0439 ID \u043f\u0430\u043f\u043a\u0438","Error: folder cannot be its own parent":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0430\u0442\u044c\u043a\u043e\u043c \u0441\u0430\u043c\u043e\u0457 \u0441\u0435\u0431\u0435","Upload to Trash is forbidden":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0432 \u043a\u043e\u0448\u0438\u043a \u0437\u0430\u0431\u043e\u0440\u043e\u043d\u0435\u043d\u043e","renameFolder is not implemented in dataProviders":"renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u043e\u0432\u0430\u043d\u043e \u0432 dataProviders","renameFile is not implemented in dataProviders":"renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0456\u0437\u043e\u0432\u0430\u043d\u043e \u0432 dataProviders",Clean:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438","Circular dependency detected: folder cannot be its own parent":"\u0412\u0438\u044f\u0432\u043b\u0435\u043d\u043e \u0446\u0438\u043a\u043b\u0456\u0447\u043d\u0443 \u0437\u0430\u043b\u0435\u0436\u043d\u0456\u0441\u0442\u044c: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u0431\u0430\u0442\u044c\u043a\u043e\u043c \u0441\u0430\u043c\u043e\u0457 \u0441\u0435\u0431\u0435","Save as copy and choose":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u044f\u043a \u043a\u043e\u043f\u0456\u044e \u0456 \u0432\u0438\u0431\u0440\u0430\u0442\u0438","Save and choose":"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0456 \u0432\u0438\u0431\u0440\u0430\u0442\u0438",pixie:{"added drawing":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u043c\u0430\u043b\u044e\u043d\u043a\u0430","added frame":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0440\u0430\u043c\u043a\u0438","added image":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","added shape":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0444\u0456\u0433\u0443\u0440\u0438","added sticker":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0441\u0442\u0456\u043a\u0435\u0440\u0430","added text":"\u0414\u043e\u0434\u0430\u0432\u0430\u043d\u043d\u044f \u0442\u0435\u043a\u0441\u0442\u0443","applied filters":"\u0417\u0430\u0441\u0442\u043e\u0441\u0443\u0432\u0430\u043d\u043d\u044f \u0444\u0456\u043b\u044c\u0442\u0440",apply:"\u0417\u0430\u0441\u0442\u043e\u0441\u0443\u0432\u0430\u0442\u0438",background:"\u0424\u043e\u043d","background color":"\u0424\u043e\u043d\u043e\u0432\u0438\u0439 \u043a\u043e\u043b\u0456\u0440",beach:"\u041f\u043b\u044f\u0436","brush color":"\u041a\u043e\u043b\u0456\u0440 \u043a\u0438\u0441\u0442\u0456","brush size":"\u0420\u043e\u0437\u043c\u0456\u0440 \u043a\u0438\u0441\u0442\u0456","brush type":"\u0422\u0438\u043f \u043a\u0438\u0441\u0442\u0456",bubbles:"\u041f\u0443\u0437\u0438\u0440\u0446\u0456",Cancel:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","changed style":"\u0417\u043c\u0456\u043d\u0430 \u0441\u0442\u0438\u043b\u044e","Circle Brush":"\u041a\u043e\u043b\u0430",close:"\u0417\u0430\u043a\u0440\u0438\u0442\u0438",color:"\u041a\u043e\u043b\u0456\u0440",corners:"\u041a\u0443\u0442\u0438",crop:"\u041e\u0431\u0440\u0456\u0437\u0430\u0442\u0438",Custom:"\u041a\u043e\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044c\u043a\u0438\u0439","deleted object":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043e\u0431'\u0454\u043a\u0442\u0430","Diamond Brush":"\u0410\u043b\u043c\u0430\u0437",doodles:"\u041a\u043e\u043b\u044c\u043e\u0440\u043e\u0432\u0456",draw:"\u041c\u0430\u043b\u044e\u043d\u043e\u043a",emoticons:"\u0421\u043c\u0430\u0439\u043b\u0438\u043a\u0438","Eraser Brush":"\u0413\u0443\u043c\u043a\u0430",filter:"\u0424\u0456\u043b\u044c\u0442\u0440",font:"\u0428\u0440\u0438\u0444\u0442","font size":"\u0420\u043e\u0437\u043c\u0456\u0440 \u0448\u0440\u0438\u0444\u0442\u0443",frame:"\u0420\u0430\u043c\u043a\u0430",gradient:"\u0413\u0440\u0430\u0434\u0456\u0454\u043d\u0442",height:"\u0412\u0438\u0441\u043e\u0442\u0430",history:"\u0406\u0441\u0442\u043e\u0440\u0456\u044f","H Line Brush":"\u041d-\u043f\u043e\u0434\u0456\u0431\u043d\u0430",image:"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",initial:"\u041f\u043e\u0447\u0430\u0442\u043a\u043e\u0432\u0438\u0439",landmarks:"\u041f\u0430\u043c'\u044f\u0442\u043a\u0438","loaded state":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0441\u0442\u0430\u043d\u0443","loading canvas":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","loading image":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","loading state":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","maintain aspect ratio":"Maintain aspect ratio",merge:"\u041e\u0431'\u0454\u0434\u043d\u0430\u043d\u043d\u044f","merged objects":"\u041e\u0431'\u0454\u0434\u043d\u0430\u043d\u043d\u044f \u043e\u0431'\u0454\u043a\u0442\u0456\u0432","new text":"\u041d\u043e\u0432\u0438\u0439 \u043d\u0430\u043f\u0438\u0441",objects:"\u041e\u0431'\u0454\u043a\u0442",opacity:"\u041f\u0440\u043e\u0437\u043e\u0440\u0456\u0441\u0442\u044c",outline:"\u041a\u043e\u043d\u0442\u0443\u0440","outline color":"\u041a\u043e\u043b\u0456\u0440 \u043a\u043e\u043d\u0442\u0443\u0440\u0443","Pencil Brush":"\u041e\u043b\u0456\u0432\u0435\u0446\u044c","processing image":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f",quality:"\u042f\u043a\u0456\u0441\u0442\u044c",radius:"\u0420\u0430\u0434\u0456\u0443\u0441","replace image":"Replace Image","replaced background image":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",resize:"\u0420\u043e\u0437\u043c\u0456\u0440","resized image":"\u0417\u043c\u0456\u043d\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u0443","rounded corner":"\u0417\u0430\u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044f \u043a\u0443\u0442\u0456\u0432",save:"\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438",shadow:"\u0422\u0456\u043d\u044c","shadow color":"\u041a\u043e\u043b\u0456\u0440 \u0442\u0456\u043d\u0456",shapes:"\u0424\u0456\u0433\u0443\u0440\u0438","Spray Brush":"\u0421\u043f\u0440\u0435\u0439",square:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442","Square Brush":"\u041a\u0432\u0430\u0434\u0440\u0430\u0442",stickers:"\u0421\u0442\u0456\u043a\u0435\u0440\u0438",text:"\u041d\u0430\u043f\u0438\u0441",texture:"\u0422\u0435\u043a\u0441\u0442\u0443\u0440\u0430",transportation:"\u0422\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442","V Line Brush":"V-\u043f\u043e\u0434\u0456\u0431\u043d\u0430",width:"\u0428\u0438\u0440\u0438\u043d\u0430",grayscale:"\u0412\u0456\u0434\u0442\u0456\u043d\u043a\u0438 \u0441\u0456\u0440\u043e\u0433\u043e","black & White":"\u0427\u043e\u0440\u043d\u043e-\u0431\u0456\u043b\u0438\u0439",sharpen:"\u0420\u0456\u0437\u043a\u0456\u0441\u0442\u044c",invert:"\u0406\u043d\u0432\u0435\u0440\u0441\u0456\u044f",vintage:"\u0412\u0456\u043d\u0442\u0430\u0436",polaroid:"\u041f\u043e\u043b\u0430\u0440\u043e\u0457\u0434",kodachrome:"\u041a\u043e\u0434\u0430\u0445\u0440\u043e\u043c",technicolor:"\u0422\u0435\u0445\u043d\u0456\u043a\u043e\u043b\u043e\u0440",brownie:"\u041a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u0438\u0439",sepia:"\u0421\u0435\u043f\u0456\u044f","remove Color":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043a\u043e\u043b\u0456\u0440",brightness:"\u042f\u0441\u043a\u0440\u0430\u0432\u0456\u0441\u0442\u044c",gamma:"\u0413\u0430\u043c\u043c\u0430",noise:"\u0428\u0443\u043c",pixelate:"\u041f\u0456\u043a\u0441\u0435\u043b\u0456\u0437\u0430\u0446\u0456\u044f",blur:"\u0420\u043e\u0437\u043c\u0438\u0442\u0442\u044f",emboss:"\u0422\u0438\u0441\u043d\u0435\u043d\u043d\u044f","blend Color":"\u0417\u043c\u0456\u0448\u0430\u0442\u0438 \u043a\u043e\u043b\u0456\u0440",distance:"\u0412\u0456\u0434\u0441\u0442\u0430\u043d\u044c",red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439",blue:"\u0421\u0438\u043d\u0456\u0439",blocksize:"\u0420\u043e\u0437\u043c\u0456\u0440 \u0431\u043b\u043e\u043a\u0443",alpha:"\u0410\u043b\u044c\u0444\u0430",add:"\u0414\u043e\u0434\u0430\u0442\u0438",multiply:"\u041f\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u0438",subtract:"\u0412\u0456\u0434\u043d\u044f\u0442\u0438",diff:"\u0420\u0456\u0437\u043d\u0438\u0446\u044f",screen:"\u0415\u043a\u0440\u0430\u043d",lighten:"\u041e\u0441\u0432\u0456\u0442\u043b\u0438\u0442\u0438",darken:"\u0417\u0430\u0442\u0435\u043c\u043d\u0438\u0442\u0438","select an option...":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043e\u043f\u0446\u0456\u044e..."}}},"pt-br":{translation:Un},pt:{translation:Un},br:{translation:Un},"pt-BR":{translation:Un}};an.use(wn).init({resources:Vn,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}}),Object.values({images:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp","image/tiff"],documents:["application/pdf","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],archives:["application/zip","application/x-rar-compressed","application/x-7z-compressed"],videos:["video/mp4","video/avi","video/quicktime","video/x-msvideo"],audio:["audio/mpeg","audio/wav","audio/ogg"]}).flat();const Hn=e=>{if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]},Wn=e=>{if(!e||e<=0)return"";const t=1048576;return e<t?`${Math.round(e/1024)} Kb`:`${(e/t).toFixed(2)} Mb`},$n=e=>{if(null==e)return"";if("number"==typeof e)return Wn(e);const t=String(e).trim();if(!t)return"";const r=Number(t);return Number.isNaN(r)?t:Wn(r)},qn=(e,t)=>{const r=t.filter(e=>"string"==typeof e),n=new Set(r.map(e=>e.toLowerCase())),i="string"==typeof e?e:String(null!=e?e:"");if(!n.has(i.toLowerCase()))return i;const o=i.lastIndexOf("."),a=o>0?i.slice(0,o):i,s=o>0?i.slice(o):"";let l,c=1;do{l=`${a}_${c}${s}`,c++}while(n.has(l.toLowerCase()));return l};async function Gn(e,t,r,n,i){if(!i||!(null==e?void 0:e.getFiles))return t;try{let i=[];const{files:o}=await e.getFiles({folderId:n?void 0:null!=r?r:void 0,noFolder:n,itemType:"all",page:1,limit:1e4});if(i=(o||[]).map(e=>e.name).filter(e=>!!e),!n&&(null==e?void 0:e.getFolders)){const t=(await e.getFolders({parentId:null!=r?r:null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);i=[...i,...t]}return qn(t,i)}catch(e){return t}}const Yn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m6 9 6 6 6-6"}));Yn.displayName="ChevronDown";const Xn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M12 20.472a6 6 0 1 0 5.58-10.262m-11.16 0a6 6 0 1 0 7.16 3.58M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0Z"}));Xn.displayName="Colors";const Kn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M16 16v2.8c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C14.48 22 13.92 22 12.8 22H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 20.48 2 19.92 2 18.8v-7.6c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 8 4.08 8 5.2 8H8m3.2 8h7.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 14.48 22 13.92 22 12.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2h-7.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C9.52 16 10.08 16 11.2 16Z"}));Kn.displayName="Copy04";const Zn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M10 6h4.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C18 7.52 18 8.08 18 9.2V14M2 6h4m12 12v4m4-4H9.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C6 16.48 6 15.92 6 14.8V2"}));Zn.displayName="Crop02";const Qn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0-7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));Qn.displayName="DotsVertical";const Jn=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7 3 3m0 0 3-3m-3 3v-6"}));Jn.displayName="FolderDownload";const ei=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7h6"}));ei.displayName="FolderMinus";const ti=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));ti.displayName="FolderPlus";const ri=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm13.5 10.5L14 16m1-2.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));ri.displayName="FolderSearch";const ni=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));ni.displayName="Grid01";const ii=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21Z"}));ii.displayName="Image03";const oi=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"}));oi.displayName="Link01";const ai=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));ai.displayName="List";const si=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}),o.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));si.displayName="PlaySquare";const li=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M12 8v8m-4-4h8m6 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));li.displayName="PlusCircle";const ci=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M6.5 6.5h.01m10.99 0h.01M6.5 17.5h.01M13 13h.01m4.49 4.5h.01M17 21h4v-4m-7-.5V21m7-7h-4.5m-.9-4h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10Zm-11 0h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10Zm0 11h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21Z"}));ci.displayName="QrCode02";const ui=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M20.453 12.893A8.5 8.5 0 0 1 4.638 16.25l-.25-.433m-.842-4.71A8.5 8.5 0 0 1 19.361 7.75l.25.433M3.493 18.066l.732-2.732 2.732.732m10.085-8.132 2.732.732.732-2.732"}));ui.displayName="RefreshCw05";const di=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M14 22H6.8m0 0c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2M6.8 22h.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C12 19.72 12 18.88 12 17.2v-.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C9.72 12 8.88 12 7.2 12h-.4c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 14.28 2 15.12 2 16.8v.4m0 0V10m8-8h4m8 8v4m-4 8c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C22 19.395 22 18.93 22 18m0-12c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.122-2.122C19.395 2 18.93 2 18 2M6 2c-.93 0-1.395 0-1.776.102a3 3 0 0 0-2.122 2.122C2 4.605 2 5.07 2 6"}));di.displayName="Scale01";const hi=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));hi.displayName="SearchMd";const fi=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M4.5 22v-5m0-10V2M2 4.5h5m-5 15h5M13 3l-1.734 4.509c-.282.733-.423 1.1-.643 1.408a3 3 0 0 1-.706.707c-.308.219-.675.36-1.408.642L4 12l4.509 1.734c.733.282 1.1.423 1.408.643.273.194.512.433.707.706.219.308.36.675.642 1.408L13 21l1.734-4.509c.282-.733.423-1.1.643-1.408.194-.273.433-.512.706-.707.308-.219.675-.36 1.408-.642L22 12l-4.509-1.734c-.733-.282-1.1-.423-1.408-.642a3 3 0 0 1-.706-.707c-.22-.308-.36-.675-.643-1.408L13 3Z"}));fi.displayName="Stars02";const pi=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M13 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v3.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 17 4.08 17 5.2 17H13m4-10h1.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 8.52 22 9.08 22 10.2v3.6c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C20.48 17 19.92 17 18.8 17H17m0 4V3m2.5 0h-5m5 18h-5"}));pi.displayName="TextInput";const gi=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M7 22V11m-5 2v7a2 2 0 0 0 2 2h13.426a3 3 0 0 0 2.965-2.544l1.077-7A3 3 0 0 0 18.503 9H15a1 1 0 0 1-1-1V4.466A2.466 2.466 0 0 0 11.534 2a.822.822 0 0 0-.75.488l-3.52 7.918A1 1 0 0 1 6.35 11H4a2 2 0 0 0-2 2Z"}));gi.displayName="ThumbsUp";const mi=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6m5 4.5v5m4-5v5"}));mi.displayName="Trash03";const vi=({size:e=24,color:t="currentColor",...r})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},o.createElement("path",{d:"M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6"}));vi.displayName="Trash04";const yi=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),bi=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),wi=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),xi=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),Ci=()=>(0,i.jsxs)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"}),(0,i.jsx)("path",{d:"M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"}),(0,i.jsx)("path",{d:"M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"}),(0,i.jsx)("path",{d:"M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"})]}),_i=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 7.81819C6.50303 7.81819 6.93182 7.64092 7.28637 7.28637C7.64092 6.93182 7.81819 6.50303 7.81819 6C7.81819 5.49697 7.64092 5.06818 7.28637 4.71363C6.93182 4.35908 6.50303 4.18181 6 4.18181C5.49697 4.18181 5.06818 4.35908 4.71363 4.71363C4.35908 5.06818 4.18181 5.49697 4.18181 6C4.18181 6.50303 4.35908 6.93182 4.71363 7.28637C5.06818 7.64092 5.49697 7.81819 6 7.81819ZM6 8.72727C5.24545 8.72727 4.60227 8.46136 4.07045 7.92955C3.53864 7.39773 3.27273 6.75455 3.27273 6C3.27273 5.24545 3.53864 4.60227 4.07045 4.07045C4.60227 3.53864 5.24545 3.27273 6 3.27273C6.75455 3.27273 7.39773 3.53864 7.92955 4.07045C8.46136 4.60227 8.72727 5.24545 8.72727 6C8.72727 6.75455 8.46136 7.39773 7.92955 7.92955C7.39773 8.46136 6.75455 8.72727 6 8.72727ZM2.18182 6.45454H0V5.54546H2.18182V6.45454ZM12 6.45454H9.81818V5.54546H12V6.45454ZM5.54546 2.18182V0H6.45454V2.18182H5.54546ZM5.54546 12V9.81818H6.45454V12H5.54546ZM3 3.6091L1.63182 2.28637L2.28181 1.61819L3.5909 2.98182L3 3.6091ZM9.72727 10.3727L8.39546 9.00454L9.0091 8.38182L10.3682 9.71363L9.72727 10.3727ZM8.38182 2.9909L9.71363 1.63182L10.3818 2.27273L9.02727 3.6L8.38182 2.9909ZM1.62727 9.71819L2.98636 8.38636L3.61818 9.0091L2.28637 10.3682L1.62727 9.71819Z"})}),Si=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 11C4.61111 11 3.43056 10.5139 2.45833 9.54167C1.48611 8.56944 1 7.38889 1 6C1 4.61111 1.48611 3.43056 2.45833 2.45833C3.43056 1.48611 4.61111 1 6 1C6.09259 1 6.1875 1.00309 6.28472 1.00926C6.38194 1.01543 6.49382 1.02469 6.62036 1.03704C6.2716 1.32408 5.99769 1.68442 5.79861 2.11806C5.59954 2.55169 5.5 3.01234 5.5 3.5C5.5 4.33333 5.79167 5.04167 6.375 5.625C6.95833 6.20833 7.66667 6.5 8.5 6.5C8.99074 6.5 9.45216 6.40509 9.88426 6.21528C10.3164 6.02546 10.6759 5.76544 10.963 5.43519C10.9753 5.54939 10.9846 5.65047 10.9907 5.73843C10.9969 5.82639 11 5.91358 11 6C11 7.38889 10.5139 8.56944 9.54167 9.54167C8.56944 10.5139 7.38889 11 6 11ZM6 10.0741C6.94444 10.0741 7.77469 9.7909 8.49075 9.22454C9.20681 8.65818 9.67594 7.97376 9.89815 7.17129C9.68211 7.25463 9.45474 7.3179 9.21606 7.36111C8.97737 7.40431 8.73869 7.42592 8.5 7.42592C7.41242 7.42592 6.4862 7.0435 5.72135 6.27865C4.9565 5.5138 4.57408 4.58758 4.57408 3.5C4.57408 3.29012 4.59414 3.06944 4.63426 2.83796C4.67438 2.60648 4.74229 2.35185 4.83797 2.07407C3.99229 2.3395 3.29552 2.83487 2.74768 3.56018C2.19984 4.28549 1.92592 5.09876 1.92592 6C1.92592 7.12963 2.32252 8.09105 3.11574 8.88426C3.90895 9.67748 4.87037 10.0741 6 10.0741Z"})}),Ai=()=>(0,i.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{opacity:"0.5",d:"M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z",fill:"#91CAFF"}),(0,i.jsx)("path",{d:"M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z",fill:"#2884FF"}),(0,i.jsx)("path",{d:"M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z",stroke:"#2884FF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ki=()=>(0,i.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{opacity:"0.5",d:"M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z",fill:"#91CAFF"}),(0,i.jsx)("path",{d:"M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z",stroke:"currentColor"}),(0,i.jsx)("path",{d:"M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ei=()=>(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M10.8337 5.83333L9.90404 3.9741C9.6365 3.439 9.50271 3.17144 9.30313 2.97597C9.12664 2.80311 8.91393 2.67164 8.68039 2.59109C8.4163 2.5 8.11716 2.5 7.5189 2.5H4.33366C3.40024 2.5 2.93353 2.5 2.57701 2.68166C2.2634 2.84144 2.00844 3.09641 1.84865 3.41002C1.66699 3.76654 1.66699 4.23325 1.66699 5.16667V5.83333M1.66699 5.83333H14.3337C15.7338 5.83333 16.4339 5.83333 16.9686 6.10582C17.439 6.3455 17.8215 6.72795 18.0612 7.19836C18.3337 7.73314 18.3337 8.4332 18.3337 9.83333V13.5C18.3337 14.9001 18.3337 15.6002 18.0612 16.135C17.8215 16.6054 17.439 16.9878 16.9686 17.2275C16.4339 17.5 15.7338 17.5 14.3337 17.5H5.66699C4.26686 17.5 3.5668 17.5 3.03202 17.2275C2.56161 16.9878 2.17916 16.6054 1.93948 16.135C1.66699 15.6002 1.66699 14.9001 1.66699 13.5V5.83333Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),Ii=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M32 24.5L24 16.5M24 16.5L16 24.5M24 16.5V34.9C24 37.6814 24 39.0721 25.101 40.6292C25.8326 41.6638 27.9388 42.9406 29.1944 43.1108C31.0842 43.3668 31.8019 42.9924 33.2371 42.2437C39.6333 38.9071 44 32.2135 44 24.5C44 13.4543 35.0457 4.5 24 4.5C12.9543 4.5 4 13.4543 4 24.5C4 31.9028 8.02199 38.3663 14 41.8244",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),ji=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),(0,i.jsx)("path",{d:"M28 36.4722C29.0615 37.4223 30.4633 38 32 38C35.3137 38 38 35.3137 38 32C38 29.2331 36.1271 26.9036 33.5798 26.2102M22.4202 26.2102C19.8729 26.9036 18 29.2331 18 32C18 35.3137 20.6863 38 24 38C27.3137 38 30 35.3137 30 32C30 31.2195 29.851 30.4738 29.5798 29.7898M34 24C34 27.3137 31.3137 30 28 30C24.6863 30 22 27.3137 22 24C22 20.6863 24.6863 18 28 18C31.3137 18 34 20.6863 34 24Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ti=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),(0,i.jsx)("path",{d:"M20.5 38V33M20.5 23V18M18 20.5H23M18 35.5H23M29 19L27.2658 23.5089C26.9838 24.2421 26.8428 24.6087 26.6235 24.9171C26.4292 25.1904 26.1904 25.4292 25.9171 25.6235C25.6087 25.8428 25.2421 25.9838 24.5089 26.2658L20 28L24.5089 29.7342C25.2421 30.0162 25.6087 30.1572 25.9171 30.3765C26.1904 30.5708 26.4292 30.8096 26.6235 31.0829C26.8428 31.3913 26.9838 31.7579 27.2658 32.4911L29 37L30.7342 32.4911C31.0162 31.7579 31.1572 31.3913 31.3765 31.0829C31.5708 30.8096 31.8096 30.5708 32.0829 30.3765C32.3913 30.1572 32.7579 30.0162 33.4911 29.7342L38 28L33.4911 26.2658C32.7579 25.9838 32.3913 25.8428 32.0829 25.6235C31.8096 25.4292 31.5708 25.1904 31.3765 24.9171C31.1572 24.6087 31.0162 24.2421 30.7342 23.5089L29 19Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Fi=()=>(0,i.jsxs)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M19 18.4307C19 17.4761 19 16.9988 19.1995 16.7324C19.3733 16.5001 19.6394 16.3549 19.9288 16.3342C20.2608 16.3105 20.6622 16.5686 21.4652 17.0848L30.9064 23.1541C31.6032 23.602 31.9516 23.826 32.0719 24.1108C32.177 24.3596 32.177 24.6404 32.0719 24.8892C31.9516 25.174 31.6032 25.398 30.9064 25.8459L21.4652 31.9152C20.6622 32.4314 20.2608 32.6895 19.9288 32.6658C19.6394 32.6451 19.3733 32.4998 19.1995 32.2676C19 32.0012 19 31.5239 19 30.5693V18.4307Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M6 16.1C6 12.7397 6 11.0595 6.65396 9.77606C7.2292 8.64708 8.14708 7.7292 9.27606 7.15396C10.5595 6.5 12.2397 6.5 15.6 6.5H32.4C35.7603 6.5 37.4405 6.5 38.7239 7.15396C39.8529 7.7292 40.7708 8.64708 41.346 9.77606C42 11.0595 42 12.7397 42 16.1V32.9C42 36.2603 42 37.9405 41.346 39.2239C40.7708 40.3529 39.8529 41.2708 38.7239 41.846C37.4405 42.5 35.7603 42.5 32.4 42.5H15.6C12.2397 42.5 10.5595 42.5 9.27606 41.846C8.14708 41.2708 7.2292 40.3529 6.65396 39.2239C6 37.9405 6 36.2603 6 32.9V16.1Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),Oi=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M24 41.4444C26.123 43.3446 28.9266 44.5 32 44.5C38.6274 44.5 44 39.1274 44 32.5C44 26.9662 40.2541 22.3072 35.1596 20.9203M12.8404 20.9203C7.74587 22.3072 4 26.9661 4 32.5C4 39.1274 9.37258 44.5 16 44.5C22.6274 44.5 28 39.1274 28 32.5C28 30.939 27.7019 29.4476 27.1596 28.0797M36 16.5C36 23.1274 30.6274 28.5 24 28.5C17.3726 28.5 12 23.1274 12 16.5C12 9.87258 17.3726 4.5 24 4.5C30.6274 4.5 36 9.87258 36 16.5Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),Mi=e=>(0,i.jsx)(U.A,Object.assign({component:yi},e)),Pi=e=>(0,i.jsx)(U.A,Object.assign({component:bi},e)),Ri=e=>(0,i.jsx)(U.A,Object.assign({component:wi},e)),Li=e=>(0,i.jsx)(U.A,Object.assign({component:xi},e)),Ni=e=>(0,i.jsx)(U.A,Object.assign({component:Ci},e)),Di=e=>(0,i.jsx)(U.A,Object.assign({component:_i},e)),zi=e=>(0,i.jsx)(U.A,Object.assign({component:Si},e)),Bi=e=>(0,i.jsx)(U.A,Object.assign({component:Ai},e)),Ui=e=>(0,i.jsx)(U.A,Object.assign({component:ki},e)),Vi=e=>(0,i.jsx)(U.A,Object.assign({component:Ei},e)),Hi=e=>(0,i.jsx)(U.A,Object.assign({component:Ii},e)),Wi=e=>(0,i.jsx)(U.A,Object.assign({component:ji},e)),$i=e=>(0,i.jsx)(U.A,Object.assign({component:Ti},e)),qi=e=>(0,i.jsx)(U.A,Object.assign({component:Fi},e)),Gi=e=>(0,i.jsx)(U.A,Object.assign({component:Oi},e)),Yi=(0,o.createContext)({state:{},actions:{},options:{}}),Xi=()=>(0,o.useContext)(Yi),Ki=({children:e,options:t})=>{var r,n,a,s;const[l,c]=(0,o.useState)([]),[u,h]=(0,o.useState)([]),[f,p]=(0,o.useState)(null),[g,m]=(0,o.useState)(t.searchQuery||""),[v,y]=(0,o.useState)(t.sortBySize||"name"),{config:b}=t,w=(0,o.useCallback)(e=>{var t,r,n,i;if(e===Pt){const e=!1!==(null===(t=null==b?void 0:b.features)||void 0===t?void 0:t.enableGif),r=!(null==b?void 0:b.enabledTabs)||b.enabledTabs.includes("gif");return e&&r}if(e===Rt){const e=!1!==(null===(r=null==b?void 0:b.features)||void 0===r?void 0:r.enableStockImages),t=!(null==b?void 0:b.enabledTabs)||b.enabledTabs.includes("stock");return e&&t}if(e===Lt){const e=!1!==(null===(n=null==b?void 0:b.features)||void 0===n?void 0:n.enableIconStock),t=!(null==b?void 0:b.enabledTabs)||b.enabledTabs.includes("icons");return e&&t}if(e===Dt){const e=!1!==(null===(i=null==b?void 0:b.features)||void 0===i?void 0:i.enableQrBarcodeTab),t=!(null==b?void 0:b.enabledTabs)||b.enabledTabs.includes("codes");return e&&t}return!0},[null==b?void 0:b.enabledTabs,null===(r=null==b?void 0:b.features)||void 0===r?void 0:r.enableGif,null===(n=null==b?void 0:b.features)||void 0===n?void 0:n.enableIconStock,null===(a=null==b?void 0:b.features)||void 0===a?void 0:a.enableStockImages,null===(s=null==b?void 0:b.features)||void 0===s?void 0:s.enableQrBarcodeTab]),[x,C]=(0,o.useState)("date"),[_,S]=(0,o.useState)("desc"),[A,k]=(0,o.useState)([{id:"folders",name:"\u041f\u0430\u043f\u043a\u0438"}]),[E,I]=(0,o.useState)(""),[j,T]=(0,o.useState)(!1),[F,O]=(0,o.useState)(Mt);(0,o.useEffect)(()=>{(null==b?void 0:b.activeLibraryItem)&&O&&O(w(b.activeLibraryItem)?b.activeLibraryItem:Mt)},[null==b?void 0:b.activeLibraryItem,w,O]),(0,o.useEffect)(()=>{w(F)||O(Mt)},[F,w]);const[M,P]=(0,o.useState)({current:1,pageSize:20,total:0}),[R]=d.A.useForm(),[L]=d.A.useForm(),[N]=d.A.useForm(),[D]=d.A.useForm(),[z]=d.A.useForm(),[B]=d.A.useForm(),[U,V]=(0,o.useState)(!1),[H,W]=(0,o.useState)(!1),[$,q]=(0,o.useState)(!1),[G,Y]=(0,o.useState)(!1),[X,K]=(0,o.useState)(!1),[Z,Q]=(0,o.useState)(!1),[J,ee]=(0,o.useState)(!1),[te,re]=(0,o.useState)(null),[ne,ie]=(0,o.useState)(null),[oe,ae]=(0,o.useState)(null),se=(e,t)=>{k(r=>r.map(r=>r.id===e?Object.assign(Object.assign({},r),{name:t}):r))},le=(0,o.useCallback)(e=>{P(t=>Object.assign(Object.assign({},t),e))},[P]),ce=(0,o.useMemo)(()=>{var e;return{folders:l,files:u,selectedFolder:f,searchTerm:g,sortField:v,sortBy:x,sortOrder:_,pathHistory:A,currentMenuFile:E,loading:j,pagination:M,isModalVisible:U,isUrlModalVisible:H,isRenameModalVisible:$,isMoveModalVisible:G,isRenameFolderModalVisible:X,isCopyModalVisible:Z,isDeleteConfirmVisible:J,form:R,urlForm:L,renameForm:N,moveForm:D,renameFolderForm:z,copyForm:B,fileToRename:te,folderToRename:ne,activeLibraryItem:F,multiSelect:null===(e=null==b?void 0:b.multiSelect)||void 0===e||e,undoDeletion:oe}},[F,null==b?void 0:b.multiSelect,B,E,te,u,l,R,Z,J,U,G,X,$,H,j,D,M,A,z,N,g,f,x,v,_,oe,L,ne]),ue=(0,o.useMemo)(()=>({setFolders:c,setFiles:h,setSelectedFolder:p,setSearchTerm:m,setSortField:y,setSortBy:C,setSortOrder:S,setPathHistory:k,setLoading:T,setPagination:le,setIsModalVisible:V,setIsUrlModalVisible:W,setIsRenameModalVisible:q,setIsMoveModalVisible:Y,setIsRenameFolderModalVisible:K,setIsCopyModalVisible:Q,setIsDeleteConfirmVisible:ee,setFileToRename:re,setFolderToRename:ie,setUndoDeletion:ae,updatePathHistoryOnFolderRename:se,setActiveLibraryItem:e=>O(w(e)?e:Mt),setCurrentMenuFile:I}),[le,w]),de=(0,o.useMemo)(()=>({state:ce,actions:ue,options:t}),[ue,t,ce]);return(0,i.jsx)(Yi.Provider,{value:de,children:e})},Zi=()=>{const{options:e}=Xi(),{customIcons:t}=e,r=o.useCallback((e,r,n)=>{const i=null==t?void 0:t[e];return i?o.createElement(i,n):o.createElement(r,n)},[t]);return o.useMemo(()=>({RootFolderIcon:e=>r("rootFolder",V.A,e),FolderIcon:e=>r("folder",Bi,e),FolderOpenIcon:e=>r("folderOpen",H.A,e),AddFolderIcon:e=>r("addFolder",W.A,e),FileIcon:e=>r("file",$.A,e),UploadIcon:e=>r("upload",q.A,e),UploadByUrlIcon:e=>r("uploadByUrl",G.A,e),ExpandArrowIcon:e=>r("expandArrow",Y.A,e),CollapseArrowIcon:e=>r("collapseArrow",X.A,e),ExpandFolderIcon:e=>r("expandArrow",ti,e),CollapseFolderIcon:e=>r("collapseArrow",ei,e),FolderPreviewIcon:e=>r("folderPreview",Ui,e),EmptyFolderIcon:e=>r("folderPreview",Vi,e),GridViewIcon:e=>r("gridView",K.A,e),ListViewIcon:e=>r("listView",Z.A,e),DropZoneFileIcon:e=>r("folderPreview",Hi,e),BigStockIcon:e=>r("folderPreview",Wi,e),BigAIIcon:e=>r("folderPreview",$i,e),GifPlayIcon:e=>r("folderPreview",qi,e),StockBigIcon:e=>r("folderPreview",Gi,e),MixedViewIcon:e=>r("mixedView",Mi,e),LandscapeViewIcon:e=>r("landscapeView",Pi,e),PortraitViewIcon:e=>r("portraitView",Ri,e),SquareViewIcon:e=>r("squareView",Li,e),LightModeIcon:e=>r("lightMode",Di,e),DarkModeIcon:e=>r("darkMode",zi,e),AiIcon_2:e=>r("aiIcon_2",Ni,e),NoFilesIcon:e=>r("noFiles",ri,e),ThumbsUpIcon:e=>r("thumbsUp",gi,e),getCustomIcon:r}),[r])};const Qi=()=>{const{t:e}=Sn(),{NoFilesIcon:t}=Zi();return(0,i.jsxs)("div",{className:"noFilesContainer",children:[(0,i.jsx)(t,{className:"noFilesImage",size:48,strokeWidth:1.4}),(0,i.jsx)("h2",{className:"noFilesTitle",children:e("There's nothing here")}),(0,i.jsx)("div",{className:"noFilesDescription",children:e("Try using a different search query.")})]})};var Ji,eo={exports:{}},to=eo.exports,ro=(Ji||(Ji=1,function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=1/0,c=9007199254740991,u=NaN,d=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],f="[object Arguments]",p="[object Array]",g="[object Boolean]",m="[object Date]",v="[object Error]",y="[object Function]",b="[object GeneratorFunction]",w="[object Map]",x="[object Number]",C="[object Object]",_="[object Promise]",S="[object RegExp]",A="[object Set]",k="[object String]",E="[object Symbol]",I="[object WeakMap]",j="[object ArrayBuffer]",T="[object DataView]",F="[object Float32Array]",O="[object Float64Array]",M="[object Int8Array]",P="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",D="[object Uint16Array]",z="[object Uint32Array]",B=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,$=RegExp(H.source),q=RegExp(W.source),G=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,J=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(J.source),te=/^\s+/,re=/\s/,ne=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,pe=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",_e="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",Ae="\\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",ke="["+be+"]",Ee="["+Ae+"]",Ie="["+we+"]",je="\\d+",Te="["+xe+"]",Fe="["+Ce+"]",Oe="[^"+be+Ae+je+xe+Ce+_e+"]",Me="\\ud83c[\\udffb-\\udfff]",Pe="[^"+be+"]",Re="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="["+_e+"]",De="\\u200d",ze="(?:"+Fe+"|"+Oe+")",Be="(?:"+Ne+"|"+Oe+")",Ue="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ve="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",He="(?:"+Ie+"|"+Me+")?",We="["+Se+"]?",$e=We+He+"(?:"+De+"(?:"+[Pe,Re,Le].join("|")+")"+We+He+")*",qe="(?:"+[Te,Re,Le].join("|")+")"+$e,Ge="(?:"+[Pe+Ie+"?",Ie,Re,Le,ke].join("|")+")",Ye=RegExp("['\u2019]","g"),Xe=RegExp(Ie,"g"),Ke=RegExp(Me+"(?="+Me+")|"+Ge+$e,"g"),Ze=RegExp([Ne+"?"+Fe+"+"+Ue+"(?="+[Ee,Ne,"$"].join("|")+")",Be+"+"+Ve+"(?="+[Ee,Ne+ze,"$"].join("|")+")",Ne+"?"+ze+"+"+Ue,Ne+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",je,qe].join("|"),"g"),Qe=RegExp("["+De+be+we+Se+"]"),Je=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,rt={};rt[F]=rt[O]=rt[M]=rt[P]=rt[R]=rt[L]=rt[N]=rt[D]=rt[z]=!0,rt[f]=rt[p]=rt[j]=rt[g]=rt[T]=rt[m]=rt[v]=rt[y]=rt[w]=rt[x]=rt[C]=rt[S]=rt[A]=rt[k]=rt[I]=!1;var nt={};nt[f]=nt[p]=nt[j]=nt[T]=nt[g]=nt[m]=nt[F]=nt[O]=nt[M]=nt[P]=nt[R]=nt[w]=nt[x]=nt[C]=nt[S]=nt[A]=nt[k]=nt[E]=nt[L]=nt[N]=nt[D]=nt[z]=!0,nt[v]=nt[y]=nt[I]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,at=parseInt,st="object"==typeof sn&&sn&&sn.Object===Object&&sn,lt="object"==typeof self&&self&&self.Object===Object&&self,ct=st||lt||Function("return this")(),ut=t&&!t.nodeType&&t,dt=ut&&e&&!e.nodeType&&e,ht=dt&&dt.exports===ut,ft=ht&&st.process,pt=function(){try{return dt&&dt.require&&dt.require("util").types||ft&&ft.binding&&ft.binding("util")}catch(e){}}(),gt=pt&&pt.isArrayBuffer,mt=pt&&pt.isDate,vt=pt&&pt.isMap,yt=pt&&pt.isRegExp,bt=pt&&pt.isSet,wt=pt&&pt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ct(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function _t(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function St(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function kt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Et(e,t){return!(null==e||!e.length)&&Nt(e,t,0)>-1}function It(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function jt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Tt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Ft(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Ot(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Mt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Pt=Ut("length");function Rt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Lt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Nt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Lt(e,zt,r)}function Dt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function zt(e){return e!=e}function Bt(e,t){var r=null==e?0:e.length;return r?Wt(e,t)/r:u}function Ut(e){return function(t){return null==t?r:t[e]}}function Vt(e){return function(t){return null==e?r:e[t]}}function Ht(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function Wt(e,t){for(var n,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function $t(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function qt(e){return e?e.slice(0,lr(e)+1).replace(te,""):e}function Gt(e){return function(t){return e(t)}}function Yt(e,t){return jt(t,function(t){return e[t]})}function Xt(e,t){return e.has(t)}function Kt(e,t){for(var r=-1,n=e.length;++r<n&&Nt(t,e[r],0)>-1;);return r}function Zt(e,t){for(var r=e.length;r--&&Nt(t,e[r],0)>-1;);return r}var Qt=Vt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),Jt=Vt({"&":"&","<":"<",">":">",'"':""","'":"'"});function er(e){return"\\"+it[e]}function tr(e){return Qe.test(e)}function rr(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function nr(e,t){return function(r){return e(t(r))}}function ir(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var s=e[r];s!==t&&s!==o||(e[r]=o,a[i++]=r)}return a}function or(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function ar(e){return tr(e)?function(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}(e):Pt(e)}function sr(e){return tr(e)?function(e){return e.match(Ke)||[]}(e):function(e){return e.split("")}(e)}function lr(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var cr=Vt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ur=function e(t){var re,be=(t=null==t?ct:ur.defaults(ct.Object(),t,ur.pick(ct,et))).Array,we=t.Date,xe=t.Error,Ce=t.Function,_e=t.Math,Se=t.Object,Ae=t.RegExp,ke=t.String,Ee=t.TypeError,Ie=be.prototype,je=Ce.prototype,Te=Se.prototype,Fe=t["__core-js_shared__"],Oe=je.toString,Me=Te.hasOwnProperty,Pe=0,Re=(re=/[^.]+$/.exec(Fe&&Fe.keys&&Fe.keys.IE_PROTO||""))?"Symbol(src)_1."+re:"",Le=Te.toString,Ne=Oe.call(Se),De=ct._,ze=Ae("^"+Oe.call(Me).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:r,Ue=t.Symbol,Ve=t.Uint8Array,He=Be?Be.allocUnsafe:r,We=nr(Se.getPrototypeOf,Se),$e=Se.create,qe=Te.propertyIsEnumerable,Ge=Ie.splice,Ke=Ue?Ue.isConcatSpreadable:r,Qe=Ue?Ue.iterator:r,it=Ue?Ue.toStringTag:r,st=function(){try{var e=so(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,ut=we&&we.now!==ct.Date.now&&we.now,dt=t.setTimeout!==ct.setTimeout&&t.setTimeout,ft=_e.ceil,pt=_e.floor,Pt=Se.getOwnPropertySymbols,Vt=Be?Be.isBuffer:r,dr=t.isFinite,hr=Ie.join,fr=nr(Se.keys,Se),pr=_e.max,gr=_e.min,mr=we.now,vr=t.parseInt,yr=_e.random,br=Ie.reverse,wr=so(t,"DataView"),xr=so(t,"Map"),Cr=so(t,"Promise"),_r=so(t,"Set"),Sr=so(t,"WeakMap"),Ar=so(Se,"create"),kr=Sr&&new Sr,Er={},Ir=Po(wr),jr=Po(xr),Tr=Po(Cr),Fr=Po(_r),Or=Po(Sr),Mr=Ue?Ue.prototype:r,Pr=Mr?Mr.valueOf:r,Rr=Mr?Mr.toString:r;function Lr(e){if(Za(e)&&!Ba(e)&&!(e instanceof Br)){if(e instanceof zr)return e;if(Me.call(e,"__wrapped__"))return Ro(e)}return new zr(e)}var Nr=function(){function e(){}return function(t){if(!Ka(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Dr(){}function zr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Br(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Hr;++t<r;)this.add(e[t])}function $r(e){var t=this.__data__=new Vr(e);this.size=t.size}function qr(e,t){var r=Ba(e),n=!r&&za(e),i=!r&&!n&&Wa(e),o=!r&&!n&&!i&&os(e),a=r||n||i||o,s=a?$t(e.length,ke):[],l=s.length;for(var c in e)!t&&!Me.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||go(c,l))||s.push(c);return s}function Gr(e){var t=e.length;return t?e[Wn(0,t-1)]:r}function Yr(e,t){return Fo(Ai(e),nn(t,0,e.length))}function Xr(e){return Fo(Ai(e))}function Kr(e,t,n){(n!==r&&!La(e[t],n)||n===r&&!(t in e))&&tn(e,t,n)}function Zr(e,t,n){var i=e[t];Me.call(e,t)&&La(i,n)&&(n!==r||t in e)||tn(e,t,n)}function Qr(e,t){for(var r=e.length;r--;)if(La(e[r][0],t))return r;return-1}function Jr(e,t,r,n){return cn(e,function(e,i,o){t(n,e,r(e),o)}),n}function en(e,t){return e&&ki(t,Es(t),e)}function tn(e,t,r){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function rn(e,t){for(var n=-1,i=t.length,o=be(i),a=null==e;++n<i;)o[n]=a?r:Cs(e,t[n]);return o}function nn(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function on(e,t,n,i,o,a){var s,l=1&t,c=2&t,u=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!Ka(e))return e;var d=Ba(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Me.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ai(e,s)}else{var h=uo(e),p=h==y||h==b;if(Wa(e))return bi(e,l);if(h==C||h==f||p&&!o){if(s=c||p?{}:fo(e),!l)return c?function(e,t){return ki(e,co(e),t)}(e,function(e,t){return e&&ki(t,Is(t),e)}(s,e)):function(e,t){return ki(e,lo(e),t)}(e,en(s,e))}else{if(!nt[h])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case j:return wi(e);case g:case m:return new i(+e);case T:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case F:case O:case M:case P:case R:case L:case N:case D:case z:return xi(e,r);case w:return new i;case x:case k:return new i(e);case S:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new i;case E:return n=e,Pr?Se(Pr.call(n)):{}}}(e,h,l)}}a||(a=new $r);var v=a.get(e);if(v)return v;a.set(e,s),rs(e)?e.forEach(function(r){s.add(on(r,t,n,r,e,a))}):Qa(e)&&e.forEach(function(r,i){s.set(i,on(r,t,n,i,e,a))});var _=d?r:(u?c?eo:Ji:c?Is:Es)(e);return _t(_||e,function(r,i){_&&(r=e[i=r]),Zr(s,i,on(r,t,n,i,e,a))}),s}function an(e,t,n){var i=n.length;if(null==e)return!i;for(e=Se(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function sn(e,t,i){if("function"!=typeof e)throw new Ee(n);return Eo(function(){e.apply(r,i)},t)}function ln(e,t,r,n){var i=-1,o=Et,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=jt(t,Gt(r))),n?(o=It,a=!1):t.length>=200&&(o=Xt,a=!1,t=new Wr(t));e:for(;++i<s;){var u=e[i],d=null==r?u:r(u);if(u=n||0!==u?u:0,a&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,n)||l.push(u)}return l}Lr.templateSettings={escape:G,evaluate:Y,interpolate:X,variable:"",imports:{_:Lr}},Lr.prototype=Dr.prototype,Lr.prototype.constructor=Lr,zr.prototype=Nr(Dr.prototype),zr.prototype.constructor=zr,Br.prototype=Nr(Dr.prototype),Br.prototype.constructor=Br,Ur.prototype.clear=function(){this.__data__=Ar?Ar(null):{},this.size=0},Ur.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ur.prototype.get=function(e){var t=this.__data__;if(Ar){var n=t[e];return n===i?r:n}return Me.call(t,e)?t[e]:r},Ur.prototype.has=function(e){var t=this.__data__;return Ar?t[e]!==r:Me.call(t,e)},Ur.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ar&&t===r?i:t,this},Vr.prototype.clear=function(){this.__data__=[],this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=Qr(t,e);return!(r<0||(r==t.length-1?t.pop():Ge.call(t,r,1),--this.size,0))},Vr.prototype.get=function(e){var t=this.__data__,n=Qr(t,e);return n<0?r:t[n][1]},Vr.prototype.has=function(e){return Qr(this.__data__,e)>-1},Vr.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Hr.prototype.clear=function(){this.size=0,this.__data__={hash:new Ur,map:new(xr||Vr),string:new Ur}},Hr.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},Hr.prototype.get=function(e){return oo(this,e).get(e)},Hr.prototype.has=function(e){return oo(this,e).has(e)},Hr.prototype.set=function(e,t){var r=oo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Wr.prototype.add=Wr.prototype.push=function(e){return this.__data__.set(e,i),this},Wr.prototype.has=function(e){return this.__data__.has(e)},$r.prototype.clear=function(){this.__data__=new Vr,this.size=0},$r.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},$r.prototype.get=function(e){return this.__data__.get(e)},$r.prototype.has=function(e){return this.__data__.has(e)},$r.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Vr){var n=r.__data__;if(!xr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Hr(n)}return r.set(e,t),this.size=r.size,this};var cn=ji(vn),un=ji(yn,!0);function dn(e,t){var r=!0;return cn(e,function(e,n,i){return r=!!t(e,n,i)}),r}function hn(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(l===r?s==s&&!is(s):n(s,l)))var l=s,c=a}return c}function fn(e,t){var r=[];return cn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function pn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=po),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?pn(s,t-1,r,n,i):Tt(i,s):n||(i[i.length]=s)}return i}var gn=Ti(),mn=Ti(!0);function vn(e,t){return e&&gn(e,t,Es)}function yn(e,t){return e&&mn(e,t,Es)}function bn(e,t){return kt(t,function(t){return Ga(e[t])})}function wn(e,t){for(var n=0,i=(t=gi(t,e)).length;null!=e&&n<i;)e=e[Mo(t[n++])];return n&&n==i?e:r}function xn(e,t,r){var n=t(e);return Ba(e)?n:Tt(n,r(e))}function Cn(e){return null==e?e===r?"[object Undefined]":"[object Null]":it&&it in Se(e)?function(e){var t=Me.call(e,it),n=e[it];try{e[it]=r;var i=!0}catch(e){}var o=Le.call(e);return i&&(t?e[it]=n:delete e[it]),o}(e):function(e){return Le.call(e)}(e)}function _n(e,t){return e>t}function Sn(e,t){return null!=e&&Me.call(e,t)}function An(e,t){return null!=e&&t in Se(e)}function kn(e,t,n){for(var i=n?It:Et,o=e[0].length,a=e.length,s=a,l=be(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=jt(d,Gt(t))),c=gr(d.length,c),l[s]=!n&&(t||o>=120&&d.length>=120)?new Wr(s&&d):r}d=e[0];var h=-1,f=l[0];e:for(;++h<o&&u.length<c;){var p=d[h],g=t?t(p):p;if(p=n||0!==p?p:0,!(f?Xt(f,g):i(u,g,n))){for(s=a;--s;){var m=l[s];if(!(m?Xt(m,g):i(e[s],g,n)))continue e}f&&f.push(g),u.push(p)}}return u}function En(e,t,n){var i=null==(e=So(e,t=gi(t,e)))?e:e[Mo(qo(t))];return null==i?r:xt(i,e,n)}function In(e){return Za(e)&&Cn(e)==f}function jn(e,t,n,i,o){return e===t||(null==e||null==t||!Za(e)&&!Za(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ba(e),l=Ba(t),c=s?p:uo(e),u=l?p:uo(t),d=(c=c==f?C:c)==C,h=(u=u==f?C:u)==C,y=c==u;if(y&&Wa(e)){if(!Wa(t))return!1;s=!0,d=!1}if(y&&!d)return a||(a=new $r),s||os(e)?Zi(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case g:case m:case x:return La(+e,+t);case v:return e.name==t.name&&e.message==t.message;case S:case k:return e==t+"";case w:var s=rr;case A:var l=1&n;if(s||(s=or),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=2,a.set(e,t);var u=Zi(s(e),s(t),n,i,o,a);return a.delete(e),u;case E:if(Pr)return Pr.call(e)==Pr.call(t)}return!1}(e,t,c,n,i,o,a);if(!(1&n)){var b=d&&Me.call(e,"__wrapped__"),_=h&&Me.call(t,"__wrapped__");if(b||_){var I=b?e.value():e,F=_?t.value():t;return a||(a=new $r),o(I,F,n,i,a)}}return!!y&&(a||(a=new $r),function(e,t,n,i,o,a){var s=1&n,l=Ji(e),c=l.length;if(c!=Ji(t).length&&!s)return!1;for(var u=c;u--;){var d=l[u];if(!(s?d in t:Me.call(t,d)))return!1}var h=a.get(e),f=a.get(t);if(h&&f)return h==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var g=s;++u<c;){var m=e[d=l[u]],v=t[d];if(i)var y=s?i(v,m,d,t,e,a):i(m,v,d,e,t,a);if(!(y===r?m===v||o(m,v,n,i,a):y)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(e),a.delete(t),p}(e,t,n,i,o,a))}(e,t,n,i,jn,o))}function Tn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Se(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],u=e[c],d=l[1];if(s&&l[2]){if(u===r&&!(c in e))return!1}else{var h=new $r;if(i)var f=i(u,d,c,e,t,h);if(!(f===r?jn(d,u,3,i,h):f))return!1}}return!0}function Fn(e){return!(!Ka(e)||(t=e,Re&&Re in t))&&(Ga(e)?ze:fe).test(Po(e));var t}function On(e){return"function"==typeof e?e:null==e?Js:"object"==typeof e?Ba(e)?Nn(e[0],e[1]):Ln(e):ll(e)}function Mn(e){if(!wo(e))return fr(e);var t=[];for(var r in Se(e))Me.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Pn(e,t){return e<t}function Rn(e,t){var r=-1,n=Va(e)?be(e.length):[];return cn(e,function(e,i,o){n[++r]=t(e,i,o)}),n}function Ln(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(r){return r===e||Tn(r,e,t)}}function Nn(e,t){return vo(e)&&xo(t)?Co(Mo(e),t):function(n){var i=Cs(n,e);return i===r&&i===t?_s(n,e):jn(t,i,3)}}function Dn(e,t,n,i,o){e!==t&&gn(t,function(a,s){if(o||(o=new $r),Ka(a))!function(e,t,n,i,o,a,s){var l=Ao(e,n),c=Ao(t,n),u=s.get(c);if(u)Kr(e,n,u);else{var d=a?a(l,c,n+"",e,t,s):r,h=d===r;if(h){var f=Ba(c),p=!f&&Wa(c),g=!f&&!p&&os(c);d=c,f||p||g?Ba(l)?d=l:Ha(l)?d=Ai(l):p?(h=!1,d=bi(c,!0)):g?(h=!1,d=xi(c,!0)):d=[]:es(c)||za(c)?(d=l,za(l)?d=fs(l):Ka(l)&&!Ga(l)||(d=fo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Kr(e,n,d)}}(e,t,s,n,Dn,i,o);else{var l=i?i(Ao(e,s),a,s+"",e,t,o):r;l===r&&(l=a),Kr(e,s,l)}},Is)}function zn(e,t){var n=e.length;if(n)return go(t+=t<0?n:0,n)?e[t]:r}function Bn(e,t,r){t=t.length?jt(t,function(e){return Ba(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e}):[Js];var n=-1;t=jt(t,Gt(io()));var i=Rn(e,function(e,r,i){var o=jt(t,function(t){return t(e)});return{criteria:o,index:++n,value:e}});return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;++n<a;){var l=Ci(i[n],o[n]);if(l)return n>=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)})}function Un(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=wn(e,a);r(s,a)&&Xn(o,gi(a,e),s)}return o}function Vn(e,t,r,n){var i=n?Dt:Nt,o=-1,a=t.length,s=e;for(e===t&&(t=Ai(t)),r&&(s=jt(e,Gt(r)));++o<a;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(s,u,l,n))>-1;)s!==e&&Ge.call(s,l,1),Ge.call(e,l,1);return e}function Hn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;go(i)?Ge.call(e,i,1):si(e,i)}}return e}function Wn(e,t){return e+pt(yr()*(t-e+1))}function $n(e,t){var r="";if(!e||t<1||t>c)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function qn(e,t){return Io(_o(e,t,Js),e+"")}function Gn(e){return Gr(Ls(e))}function Yn(e,t){var r=Ls(e);return Fo(r,nn(t,0,r.length))}function Xn(e,t,n,i){if(!Ka(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Mo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var d=l[c];(u=i?i(d,c,l):r)===r&&(u=Ka(d)?d:go(t[o+1])?[]:{})}Zr(l,c,u),l=l[c]}return e}var Kn=kr?function(e,t){return kr.set(e,t),e}:Js,Zn=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:Ks(t),writable:!0})}:Js;function Qn(e){return Fo(Ls(e))}function Jn(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=be(i);++n<i;)o[n]=e[n+t];return o}function ei(e,t){var r;return cn(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function ti(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!is(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return ri(e,t,Js,r)}function ri(e,t,n,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=is(t),u=t===r;o<a;){var d=pt((o+a)/2),h=n(e[d]),f=h!==r,p=null===h,g=h==h,m=is(h);if(s)var v=i||g;else v=u?g&&(i||f):l?g&&f&&(i||!p):c?g&&f&&!p&&(i||!m):!p&&!m&&(i?h<=t:h<t);v?o=d+1:a=d}return gr(a,4294967294)}function ni(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!La(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function ii(e){return"number"==typeof e?e:is(e)?u:+e}function oi(e){if("string"==typeof e)return e;if(Ba(e))return jt(e,oi)+"";if(is(e))return Rr?Rr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,r){var n=-1,i=Et,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=It;else if(o>=200){var c=t?null:$i(e);if(c)return or(c);a=!1,i=Xt,l=new Wr}else l=t?[]:s;e:for(;++n<o;){var u=e[n],d=t?t(u):u;if(u=r||0!==u?u:0,a&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),s.push(u)}else i(l,d,r)||(l!==s&&l.push(d),s.push(u))}return s}function si(e,t){return null==(e=So(e,t=gi(t,e)))||delete e[Mo(qo(t))]}function li(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function ci(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?Jn(e,n?0:o,n?o+1:i):Jn(e,n?o+1:0,n?i:o)}function ui(e,t){var r=e;return r instanceof Br&&(r=r.value()),Ft(t,function(e,t){return t.func.apply(t.thisArg,Tt([e],t.args))},r)}function di(e,t,r){var n=e.length;if(n<2)return n?ai(e[0]):[];for(var i=-1,o=be(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=ln(o[i]||a,e[s],t,r));return ai(pn(o,1),t,r)}function hi(e,t,n){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var l=i<a?t[i]:r;n(s,e[i],l)}return s}function fi(e){return Ha(e)?e:[]}function pi(e){return"function"==typeof e?e:Js}function gi(e,t){return Ba(e)?e:vo(e,t)?[e]:Oo(ps(e))}var mi=qn;function vi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:Jn(e,t,n)}var yi=lt||function(e){return ct.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var r=e.length,n=He?He(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function xi(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=is(e),s=t!==r,l=null===t,c=t==t,u=is(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function _i(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,l=t.length,c=pr(o-a,0),u=be(l+c),d=!n;++s<l;)u[s]=t[s];for(;++i<a;)(d||i<o)&&(u[r[i]]=e[i]);for(;c--;)u[s++]=e[i++];return u}function Si(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,l=-1,c=t.length,u=pr(o-s,0),d=be(u+c),h=!n;++i<u;)d[i]=e[i];for(var f=i;++l<c;)d[f+l]=t[l];for(;++a<s;)(h||i<o)&&(d[f+r[a]]=e[i++]);return d}function Ai(e,t){var r=-1,n=e.length;for(t||(t=be(n));++r<n;)t[r]=e[r];return t}function ki(e,t,n,i){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=i?i(n[l],e[l],l,n,e):r;c===r&&(c=e[l]),o?tn(n,l,c):Zr(n,l,c)}return n}function Ei(e,t){return function(r,n){var i=Ba(r)?Ct:Jr,o=t?t():{};return i(r,e,io(n,2),o)}}function Ii(e){return qn(function(t,n){var i=-1,o=n.length,a=o>1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&mo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Se(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t})}function ji(e,t){return function(r,n){if(null==r)return r;if(!Va(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Se(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ti(e){return function(t,r,n){for(var i=-1,o=Se(t),a=n(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===r(o[l],l,o))break}return t}}function Fi(e){return function(t){var n=tr(t=ps(t))?sr(t):r,i=n?n[0]:t.charAt(0),o=n?vi(n,1).join(""):t.slice(1);return i[e]()+o}}function Oi(e){return function(t){return Ft(Gs(zs(t).replace(Ye,"")),e,"")}}function Mi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Nr(e.prototype),n=e.apply(r,t);return Ka(n)?n:r}}function Pi(e){return function(t,n,i){var o=Se(t);if(!Va(t)){var a=io(n,3);t=Es(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,i);return s>-1?o[a?t[s]:s]:r}}function Ri(e){return Qi(function(t){var i=t.length,o=i,a=zr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ee(n);if(a&&!l&&"wrapper"==ro(s))var l=new zr([],!0)}for(o=l?o:i;++o<i;){var c=ro(s=t[o]),u="wrapper"==c?to(s):r;l=u&&yo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==s.length&&yo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ba(r))return l.plant(r).value();for(var n=0,o=i?t[n].apply(this,e):r;++n<i;)o=t[n].call(this,o);return o}})}function Li(e,t,n,i,o,a,l,c,u,d){var h=t&s,f=1&t,p=2&t,g=24&t,m=512&t,v=p?r:Mi(e);return function s(){for(var y=arguments.length,b=be(y),w=y;w--;)b[w]=arguments[w];if(g)var x=no(s),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,x);if(i&&(b=_i(b,i,o,g)),a&&(b=Si(b,a,l,g)),y-=C,g&&y<d){var _=ir(b,x);return Hi(e,t,Li,s.placeholder,n,b,_,c,u,d-y)}var S=f?n:this,A=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var n=e.length,i=gr(t.length,n),o=Ai(e);i--;){var a=t[i];e[i]=go(a,n)?o[a]:r}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==ct&&this instanceof s&&(A=v||Mi(A)),A.apply(S,b)}}function Ni(e,t){return function(r,n){return function(e,t,r,n){return vn(e,function(e,i,o){t(n,r(e),i,o)}),n}(r,e,t(n),{})}}function Di(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=oi(n),i=oi(i)):(n=ii(n),i=ii(i)),o=e(n,i)}return o}}function zi(e){return Qi(function(t){return t=jt(t,Gt(io())),qn(function(r){var n=this;return e(t,function(e){return xt(e,n,r)})})})}function Bi(e,t){var n=(t=t===r?" ":oi(t)).length;if(n<2)return n?$n(t,e):t;var i=$n(t,ft(e/ar(t)));return tr(t)?vi(sr(i),0,e).join(""):i.slice(0,e)}function Ui(e){return function(t,n,i){return i&&"number"!=typeof i&&mo(t,n,i)&&(n=i=r),t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r,n){for(var i=-1,o=pr(ft((t-e)/(r||1)),0),a=be(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:cs(i),e)}}function Vi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=hs(t),r=hs(r)),e(t,r)}}function Hi(e,t,n,i,o,s,l,c,u,d){var h=8&t;t|=h?a:64,4&(t&=~(h?64:a))||(t&=-4);var f=[e,t,o,h?s:r,h?l:r,h?r:s,h?r:l,c,u,d],p=n.apply(r,f);return yo(e)&&ko(p,f),p.placeholder=i,jo(p,e,t)}function Wi(e){var t=_e[e];return function(e,r){if(e=hs(e),(r=null==r?0:gr(us(r),292))&&dr(e)){var n=(ps(e)+"e").split("e");return+((n=(ps(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var $i=_r&&1/or(new _r([,-0]))[1]==l?function(e){return new _r(e)}:il;function qi(e){return function(t){var r=uo(t);return r==w?rr(t):r==A?function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}(t):function(e,t){return jt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Gi(e,t,i,l,c,u,d,h){var f=2&t;if(!f&&"function"!=typeof e)throw new Ee(n);var p=l?l.length:0;if(p||(t&=-97,l=c=r),d=d===r?d:pr(us(d),0),h=h===r?h:us(h),p-=c?c.length:0,64&t){var g=l,m=c;l=c=r}var v=f?r:to(e),y=[e,t,i,l,c,g,m,u,d,h];if(v&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,l=n==s&&8==r||n==s&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!l)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?_i(u,c,t[4]):c,e[4]=u?ir(e[3],o):t[4]}(c=t[5])&&(u=e[5],e[5]=u?Si(u,c,t[6]):c,e[6]=u?ir(e[5],o):t[6]),(c=t[7])&&(e[7]=c),n&s&&(e[8]=null==e[8]?t[8]:gr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(y,v),e=y[0],t=y[1],i=y[2],l=y[3],c=y[4],!(h=y[9]=y[9]===r?f?0:e.length:pr(y[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,n){var i=Mi(e);return function o(){for(var a=arguments.length,s=be(a),l=a,c=no(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:ir(s,c);return(a-=u.length)<n?Hi(e,t,Li,o.placeholder,r,s,u,r,r,n-a):xt(this&&this!==ct&&this instanceof o?i:e,this,s)}}(e,t,h):t!=a&&33!=t||c.length?Li.apply(r,y):function(e,t,r,n){var i=1&t,o=Mi(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=n.length,u=be(c+s),d=this&&this!==ct&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;s--;)u[l++]=arguments[++a];return xt(d,i?r:this,u)}}(e,t,i,l);else var b=function(e,t,r){var n=1&t,i=Mi(e);return function t(){return(this&&this!==ct&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return jo((v?Kn:ko)(b,y),e,t)}function Yi(e,t,n,i){return e===r||La(e,Te[n])&&!Me.call(i,n)?t:e}function Xi(e,t,n,i,o,a){return Ka(e)&&Ka(t)&&(a.set(t,e),Dn(e,t,r,Xi,a),a.delete(t)),e}function Ki(e){return es(e)?r:e}function Zi(e,t,n,i,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&n?new Wr:r;for(a.set(e,t),a.set(t,e);++h<l;){var g=e[h],m=t[h];if(i)var v=s?i(m,g,h,t,e,a):i(g,m,h,e,t,a);if(v!==r){if(v)continue;f=!1;break}if(p){if(!Mt(t,function(e,t){if(!Xt(p,t)&&(g===e||o(g,e,n,i,a)))return p.push(t)})){f=!1;break}}else if(g!==m&&!o(g,m,n,i,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function Qi(e){return Io(_o(e,r,Uo),e+"")}function Ji(e){return xn(e,Es,lo)}function eo(e){return xn(e,Is,co)}var to=kr?function(e){return kr.get(e)}:il;function ro(e){for(var t=e.name+"",r=Er[t],n=Me.call(Er,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function no(e){return(Me.call(Lr,"placeholder")?Lr:e).placeholder}function io(){var e=Lr.iteratee||el;return e=e===el?On:e,arguments.length?e(arguments[0],arguments[1]):e}function oo(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=Es(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,xo(i)]}return t}function so(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Fn(n)?n:r}var lo=Pt?function(e){return null==e?[]:(e=Se(e),kt(Pt(e),function(t){return qe.call(e,t)}))}:dl,co=Pt?function(e){for(var t=[];e;)Tt(t,lo(e)),e=We(e);return t}:dl,uo=Cn;function ho(e,t,r){for(var n=-1,i=(t=gi(t,e)).length,o=!1;++n<i;){var a=Mo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Xa(i)&&go(a,i)&&(Ba(e)||za(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Nr(We(e))}function po(e){return Ba(e)||za(e)||!!(Ke&&e&&e[Ke])}function go(e,t){var r=typeof e;return!!(t=null==t?c:t)&&("number"==r||"symbol"!=r&&ge.test(e))&&e>-1&&e%1==0&&e<t}function mo(e,t,r){if(!Ka(r))return!1;var n=typeof t;return!!("number"==n?Va(r)&&go(t,r.length):"string"==n&&t in r)&&La(r[t],e)}function vo(e,t){if(Ba(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!is(e))||Z.test(e)||!K.test(e)||null!=t&&e in Se(t)}function yo(e){var t=ro(e),r=Lr[t];if("function"!=typeof r||!(t in Br.prototype))return!1;if(e===r)return!0;var n=to(r);return!!n&&e===n[0]}(wr&&uo(new wr(new ArrayBuffer(1)))!=T||xr&&uo(new xr)!=w||Cr&&uo(Cr.resolve())!=_||_r&&uo(new _r)!=A||Sr&&uo(new Sr)!=I)&&(uo=function(e){var t=Cn(e),n=t==C?e.constructor:r,i=n?Po(n):"";if(i)switch(i){case Ir:return T;case jr:return w;case Tr:return _;case Fr:return A;case Or:return I}return t});var bo=Fe?Ga:hl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Te)}function xo(e){return e==e&&!Ka(e)}function Co(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in Se(n))}}function _o(e,t,n){return t=pr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=pr(r.length-t,0),a=be(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=be(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),xt(e,this,s)}}function So(e,t){return t.length<2?e:wn(e,Jn(t,0,-1))}function Ao(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ko=To(Kn),Eo=dt||function(e,t){return ct.setTimeout(e,t)},Io=To(Zn);function jo(e,t,r){var n=t+"";return Io(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ne,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return _t(h,function(r){var n="_."+r[0];t&r[1]&&!Et(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(oe):[]}(n),r)))}function To(e){var t=0,n=0;return function(){var i=mr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Fo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=Wn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Oo=function(){var e=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,r,n,i){t.push(n?i.replace(le,"$1"):r||e)}),t},function(e){return 500===t.size&&t.clear(),e}),t=e.cache;return e}();function Mo(e){if("string"==typeof e||is(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Po(e){if(null!=e){try{return Oe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Br)return e.clone();var t=new zr(e.__wrapped__,e.__chain__);return t.__actions__=Ai(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=qn(function(e,t){return Ha(e)?ln(e,pn(t,1,Ha,!0)):[]}),No=qn(function(e,t){var n=qo(t);return Ha(n)&&(n=r),Ha(e)?ln(e,pn(t,1,Ha,!0),io(n,2)):[]}),Do=qn(function(e,t){var n=qo(t);return Ha(n)&&(n=r),Ha(e)?ln(e,pn(t,1,Ha,!0),r,n):[]});function zo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:us(r);return i<0&&(i=pr(n+i,0)),Lt(e,io(t,3),i)}function Bo(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=us(n),o=n<0?pr(i+o,0):gr(o,i-1)),Lt(e,io(t,3),o,!0)}function Uo(e){return null!=e&&e.length?pn(e,1):[]}function Vo(e){return e&&e.length?e[0]:r}var Ho=qn(function(e){var t=jt(e,fi);return t.length&&t[0]===e[0]?kn(t):[]}),Wo=qn(function(e){var t=qo(e),n=jt(e,fi);return t===qo(n)?t=r:n.pop(),n.length&&n[0]===e[0]?kn(n,io(t,2)):[]}),$o=qn(function(e){var t=qo(e),n=jt(e,fi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?kn(n,r,t):[]});function qo(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Go=qn(Yo);function Yo(e,t){return e&&e.length&&t&&t.length?Vn(e,t):e}var Xo=Qi(function(e,t){var r=null==e?0:e.length,n=rn(e,t);return Hn(e,jt(t,function(e){return go(e,r)?+e:e}).sort(Ci)),n});function Ko(e){return null==e?e:br.call(e)}var Zo=qn(function(e){return ai(pn(e,1,Ha,!0))}),Qo=qn(function(e){var t=qo(e);return Ha(t)&&(t=r),ai(pn(e,1,Ha,!0),io(t,2))}),Jo=qn(function(e){var t=qo(e);return t="function"==typeof t?t:r,ai(pn(e,1,Ha,!0),r,t)});function ea(e){if(!e||!e.length)return[];var t=0;return e=kt(e,function(e){if(Ha(e))return t=pr(e.length,t),!0}),$t(t,function(t){return jt(e,Ut(t))})}function ta(e,t){if(!e||!e.length)return[];var n=ea(e);return null==t?n:jt(n,function(e){return xt(t,r,e)})}var ra=qn(function(e,t){return Ha(e)?ln(e,t):[]}),na=qn(function(e){return di(kt(e,Ha))}),ia=qn(function(e){var t=qo(e);return Ha(t)&&(t=r),di(kt(e,Ha),io(t,2))}),oa=qn(function(e){var t=qo(e);return t="function"==typeof t?t:r,di(kt(e,Ha),r,t)}),aa=qn(ea),sa=qn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ta(e,n)});function la(e){var t=Lr(e);return t.__chain__=!0,t}function ca(e,t){return t(e)}var ua=Qi(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return rn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Br&&go(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ca,args:[o],thisArg:r}),new zr(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),da=Ei(function(e,t,r){Me.call(e,r)?++e[r]:tn(e,r,1)}),ha=Pi(zo),fa=Pi(Bo);function pa(e,t){return(Ba(e)?_t:cn)(e,io(t,3))}function ga(e,t){return(Ba(e)?St:un)(e,io(t,3))}var ma=Ei(function(e,t,r){Me.call(e,r)?e[r].push(t):tn(e,r,[t])}),va=qn(function(e,t,r){var n=-1,i="function"==typeof t,o=Va(e)?be(e.length):[];return cn(e,function(e){o[++n]=i?xt(t,e,r):En(e,t,r)}),o}),ya=Ei(function(e,t,r){tn(e,r,t)});function ba(e,t){return(Ba(e)?jt:Rn)(e,io(t,3))}var wa=Ei(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),xa=qn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&mo(e,t[0],t[1])?t=[]:r>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Bn(e,pn(t,1),[])}),Ca=ut||function(){return ct.Date.now()};function _a(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Gi(e,s,r,r,r,r,t)}function Sa(e,t){var i;if("function"!=typeof t)throw new Ee(n);return e=us(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Aa=qn(function(e,t,r){var n=1;if(r.length){var i=ir(r,no(Aa));n|=a}return Gi(e,n,t,r,i)}),ka=qn(function(e,t,r){var n=3;if(r.length){var i=ir(r,no(ka));n|=a}return Gi(t,n,e,r,i)});function Ea(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ee(n);function g(t){var n=o,i=a;return o=a=r,d=t,l=e.apply(i,n)}function m(e){var n=e-u;return u===r||n>=t||n<0||f&&e-d>=s}function v(){var e=Ca();if(m(e))return y(e);c=Eo(v,function(e){var r=t-(e-u);return f?gr(r,s-(e-d)):r}(e))}function y(e){return c=r,p&&o?g(e):(o=a=r,l)}function b(){var e=Ca(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=Eo(v,t),h?g(e):l}(u);if(f)return yi(c),c=Eo(v,t),g(u)}return c===r&&(c=Eo(v,t)),l}return t=hs(t)||0,Ka(i)&&(h=!!i.leading,s=(f="maxWait"in i)?pr(hs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==r&&yi(c),d=0,o=u=a=c=r},b.flush=function(){return c===r?l:y(Ca())},b}var Ia=qn(function(e,t){return sn(e,1,t)}),ja=qn(function(e,t,r){return sn(e,hs(t)||0,r)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ta.Cache||Hr),r}function Fa(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ta.Cache=Hr;var Oa=mi(function(e,t){var r=(t=1==t.length&&Ba(t[0])?jt(t[0],Gt(io())):jt(pn(t,1),Gt(io()))).length;return qn(function(n){for(var i=-1,o=gr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return xt(e,this,n)})}),Ma=qn(function(e,t){var n=ir(t,no(Ma));return Gi(e,a,r,t,n)}),Pa=qn(function(e,t){var n=ir(t,no(Pa));return Gi(e,64,r,t,n)}),Ra=Qi(function(e,t){return Gi(e,256,r,r,r,t)});function La(e,t){return e===t||e!=e&&t!=t}var Na=Vi(_n),Da=Vi(function(e,t){return e>=t}),za=In(function(){return arguments}())?In:function(e){return Za(e)&&Me.call(e,"callee")&&!qe.call(e,"callee")},Ba=be.isArray,Ua=gt?Gt(gt):function(e){return Za(e)&&Cn(e)==j};function Va(e){return null!=e&&Xa(e.length)&&!Ga(e)}function Ha(e){return Za(e)&&Va(e)}var Wa=Vt||hl,$a=mt?Gt(mt):function(e){return Za(e)&&Cn(e)==m};function qa(e){if(!Za(e))return!1;var t=Cn(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!es(e)}function Ga(e){if(!Ka(e))return!1;var t=Cn(e);return t==y||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==us(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function Ka(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Za(e){return null!=e&&"object"==typeof e}var Qa=vt?Gt(vt):function(e){return Za(e)&&uo(e)==w};function Ja(e){return"number"==typeof e||Za(e)&&Cn(e)==x}function es(e){if(!Za(e)||Cn(e)!=C)return!1;var t=We(e);if(null===t)return!0;var r=Me.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Oe.call(r)==Ne}var ts=yt?Gt(yt):function(e){return Za(e)&&Cn(e)==S},rs=bt?Gt(bt):function(e){return Za(e)&&uo(e)==A};function ns(e){return"string"==typeof e||!Ba(e)&&Za(e)&&Cn(e)==k}function is(e){return"symbol"==typeof e||Za(e)&&Cn(e)==E}var os=wt?Gt(wt):function(e){return Za(e)&&Xa(e.length)&&!!rt[Cn(e)]},as=Vi(Pn),ss=Vi(function(e,t){return e<=t});function ls(e){if(!e)return[];if(Va(e))return ns(e)?sr(e):Ai(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=uo(e);return(t==w?rr:t==A?or:Ls)(e)}function cs(e){return e?(e=hs(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function us(e){var t=cs(e),r=t%1;return t==t?r?t-r:t:0}function ds(e){return e?nn(us(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(is(e))return u;if(Ka(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ka(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var r=he.test(e);return r||pe.test(e)?at(e.slice(2),r?2:8):de.test(e)?u:+e}function fs(e){return ki(e,Is(e))}function ps(e){return null==e?"":oi(e)}var gs=Ii(function(e,t){if(wo(t)||Va(t))ki(t,Es(t),e);else for(var r in t)Me.call(t,r)&&Zr(e,r,t[r])}),ms=Ii(function(e,t){ki(t,Is(t),e)}),vs=Ii(function(e,t,r,n){ki(t,Is(t),e,n)}),ys=Ii(function(e,t,r,n){ki(t,Es(t),e,n)}),bs=Qi(rn),ws=qn(function(e,t){e=Se(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&mo(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Is(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===r||La(d,Te[u])&&!Me.call(e,u))&&(e[u]=a[u])}return e}),xs=qn(function(e){return e.push(r,Xi),xt(Ts,r,e)});function Cs(e,t,n){var i=null==e?r:wn(e,t);return i===r?n:i}function _s(e,t){return null!=e&&ho(e,t,An)}var Ss=Ni(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),e[t]=r},Ks(Js)),As=Ni(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),Me.call(e,t)?e[t].push(r):e[t]=[r]},io),ks=qn(En);function Es(e){return Va(e)?qr(e):Mn(e)}function Is(e){return Va(e)?qr(e,!0):function(e){if(!Ka(e))return function(e){var t=[];if(null!=e)for(var r in Se(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&Me.call(e,n))&&r.push(n);return r}(e)}var js=Ii(function(e,t,r){Dn(e,t,r)}),Ts=Ii(function(e,t,r,n){Dn(e,t,r,n)}),Fs=Qi(function(e,t){var r={};if(null==e)return r;var n=!1;t=jt(t,function(t){return t=gi(t,e),n||(n=t.length>1),t}),ki(e,eo(e),r),n&&(r=on(r,7,Ki));for(var i=t.length;i--;)si(r,t[i]);return r}),Os=Qi(function(e,t){return null==e?{}:function(e,t){return Un(e,t,function(t,r){return _s(e,r)})}(e,t)});function Ms(e,t){if(null==e)return{};var r=jt(eo(e),function(e){return[e]});return t=io(t),Un(e,r,function(e,r){return t(e,r[0])})}var Ps=qi(Es),Rs=qi(Is);function Ls(e){return null==e?[]:Yt(e,Es(e))}var Ns=Oi(function(e,t,r){return t=t.toLowerCase(),e+(r?Ds(t):t)});function Ds(e){return qs(ps(e).toLowerCase())}function zs(e){return(e=ps(e))&&e.replace(me,Qt).replace(Xe,"")}var Bs=Oi(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Us=Oi(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Vs=Fi("toLowerCase"),Hs=Oi(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),Ws=Oi(function(e,t,r){return e+(r?" ":"")+qs(t)}),$s=Oi(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),qs=Fi("toUpperCase");function Gs(e,t,n){return e=ps(e),(t=n?r:t)===r?function(e){return Je.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(ae)||[]}(e):e.match(t)||[]}var Ys=qn(function(e,t){try{return xt(e,r,t)}catch(e){return qa(e)?e:new xe(e)}}),Xs=Qi(function(e,t){return _t(t,function(t){t=Mo(t),tn(e,t,Aa(e[t],e))}),e});function Ks(e){return function(){return e}}var Zs=Ri(),Qs=Ri(!0);function Js(e){return e}function el(e){return On("function"==typeof e?e:on(e,1))}var tl=qn(function(e,t){return function(r){return En(r,e,t)}}),rl=qn(function(e,t){return function(r){return En(e,r,t)}});function nl(e,t,r){var n=Es(t),i=bn(t,n);null!=r||Ka(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=bn(t,Es(t)));var o=!(Ka(r)&&"chain"in r&&!r.chain),a=Ga(e);return _t(i,function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ai(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Tt([this.value()],arguments))})}),e}function il(){}var ol=zi(jt),al=zi(At),sl=zi(Mt);function ll(e){return vo(e)?Ut(Mo(e)):function(e){return function(t){return wn(t,e)}}(e)}var cl=Ui(),ul=Ui(!0);function dl(){return[]}function hl(){return!1}var fl,pl=Di(function(e,t){return e+t},0),gl=Wi("ceil"),ml=Di(function(e,t){return e/t},1),vl=Wi("floor"),yl=Di(function(e,t){return e*t},1),bl=Wi("round"),wl=Di(function(e,t){return e-t},0);return Lr.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=us(e),function(){if(--e<1)return t.apply(this,arguments)}},Lr.ary=_a,Lr.assign=gs,Lr.assignIn=ms,Lr.assignInWith=vs,Lr.assignWith=ys,Lr.at=bs,Lr.before=Sa,Lr.bind=Aa,Lr.bindAll=Xs,Lr.bindKey=ka,Lr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ba(e)?e:[e]},Lr.chain=la,Lr.chunk=function(e,t,n){t=(n?mo(e,t,n):t===r)?1:pr(us(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=be(ft(i/t));o<i;)s[a++]=Jn(e,o,o+=t);return s},Lr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Lr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=be(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Tt(Ba(r)?Ai(r):[r],pn(t,1))},Lr.cond=function(e){var t=null==e?0:e.length,r=io();return e=t?jt(e,function(e){if("function"!=typeof e[1])throw new Ee(n);return[r(e[0]),e[1]]}):[],qn(function(r){for(var n=-1;++n<t;){var i=e[n];if(xt(i[0],this,r))return xt(i[1],this,r)}})},Lr.conforms=function(e){return function(e){var t=Es(e);return function(r){return an(r,e,t)}}(on(e,1))},Lr.constant=Ks,Lr.countBy=da,Lr.create=function(e,t){var r=Nr(e);return null==t?r:en(r,t)},Lr.curry=function e(t,n,i){var o=Gi(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Lr.curryRight=function e(t,n,i){var o=Gi(t,16,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Lr.debounce=Ea,Lr.defaults=ws,Lr.defaultsDeep=xs,Lr.defer=Ia,Lr.delay=ja,Lr.difference=Lo,Lr.differenceBy=No,Lr.differenceWith=Do,Lr.drop=function(e,t,n){var i=null==e?0:e.length;return i?Jn(e,(t=n||t===r?1:us(t))<0?0:t,i):[]},Lr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?Jn(e,0,(t=i-(t=n||t===r?1:us(t)))<0?0:t):[]},Lr.dropRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0,!0):[]},Lr.dropWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0):[]},Lr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&mo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=us(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:us(i))<0&&(i+=o),i=n>i?0:ds(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Lr.filter=function(e,t){return(Ba(e)?kt:fn)(e,io(t,3))},Lr.flatMap=function(e,t){return pn(ba(e,t),1)},Lr.flatMapDeep=function(e,t){return pn(ba(e,t),l)},Lr.flatMapDepth=function(e,t,n){return n=n===r?1:us(n),pn(ba(e,t),n)},Lr.flatten=Uo,Lr.flattenDeep=function(e){return null!=e&&e.length?pn(e,l):[]},Lr.flattenDepth=function(e,t){return null!=e&&e.length?pn(e,t=t===r?1:us(t)):[]},Lr.flip=function(e){return Gi(e,512)},Lr.flow=Zs,Lr.flowRight=Qs,Lr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Lr.functions=function(e){return null==e?[]:bn(e,Es(e))},Lr.functionsIn=function(e){return null==e?[]:bn(e,Is(e))},Lr.groupBy=ma,Lr.initial=function(e){return null!=e&&e.length?Jn(e,0,-1):[]},Lr.intersection=Ho,Lr.intersectionBy=Wo,Lr.intersectionWith=$o,Lr.invert=Ss,Lr.invertBy=As,Lr.invokeMap=va,Lr.iteratee=el,Lr.keyBy=ya,Lr.keys=Es,Lr.keysIn=Is,Lr.map=ba,Lr.mapKeys=function(e,t){var r={};return t=io(t,3),vn(e,function(e,n,i){tn(r,t(e,n,i),e)}),r},Lr.mapValues=function(e,t){var r={};return t=io(t,3),vn(e,function(e,n,i){tn(r,n,t(e,n,i))}),r},Lr.matches=function(e){return Ln(on(e,1))},Lr.matchesProperty=function(e,t){return Nn(e,on(t,1))},Lr.memoize=Ta,Lr.merge=js,Lr.mergeWith=Ts,Lr.method=tl,Lr.methodOf=rl,Lr.mixin=nl,Lr.negate=Fa,Lr.nthArg=function(e){return e=us(e),qn(function(t){return zn(t,e)})},Lr.omit=Fs,Lr.omitBy=function(e,t){return Ms(e,Fa(io(t)))},Lr.once=function(e){return Sa(2,e)},Lr.orderBy=function(e,t,n,i){return null==e?[]:(Ba(t)||(t=null==t?[]:[t]),Ba(n=i?r:n)||(n=null==n?[]:[n]),Bn(e,t,n))},Lr.over=ol,Lr.overArgs=Oa,Lr.overEvery=al,Lr.overSome=sl,Lr.partial=Ma,Lr.partialRight=Pa,Lr.partition=wa,Lr.pick=Os,Lr.pickBy=Ms,Lr.property=ll,Lr.propertyOf=function(e){return function(t){return null==e?r:wn(e,t)}},Lr.pull=Go,Lr.pullAll=Yo,Lr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Vn(e,t,io(r,2)):e},Lr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Vn(e,t,r,n):e},Lr.pullAt=Xo,Lr.range=cl,Lr.rangeRight=ul,Lr.rearg=Ra,Lr.reject=function(e,t){return(Ba(e)?kt:fn)(e,Fa(io(t,3)))},Lr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=io(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Hn(e,i),r},Lr.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return qn(e,t=t===r?t:us(t))},Lr.reverse=Ko,Lr.sampleSize=function(e,t,n){return t=(n?mo(e,t,n):t===r)?1:us(t),(Ba(e)?Yr:Yn)(e,t)},Lr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Lr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Xn(e,t,n,i)},Lr.shuffle=function(e){return(Ba(e)?Xr:Qn)(e)},Lr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&mo(e,t,n)?(t=0,n=i):(t=null==t?0:us(t),n=n===r?i:us(n)),Jn(e,t,n)):[]},Lr.sortBy=xa,Lr.sortedUniq=function(e){return e&&e.length?ni(e):[]},Lr.sortedUniqBy=function(e,t){return e&&e.length?ni(e,io(t,2)):[]},Lr.split=function(e,t,n){return n&&"number"!=typeof n&&mo(e,t,n)&&(t=n=r),(n=n===r?d:n>>>0)?(e=ps(e))&&("string"==typeof t||null!=t&&!ts(t))&&!(t=oi(t))&&tr(e)?vi(sr(e),0,n):e.split(t,n):[]},Lr.spread=function(e,t){if("function"!=typeof e)throw new Ee(n);return t=null==t?0:pr(us(t),0),qn(function(r){var n=r[t],i=vi(r,0,t);return n&&Tt(i,n),xt(e,this,i)})},Lr.tail=function(e){var t=null==e?0:e.length;return t?Jn(e,1,t):[]},Lr.take=function(e,t,n){return e&&e.length?Jn(e,0,(t=n||t===r?1:us(t))<0?0:t):[]},Lr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?Jn(e,(t=i-(t=n||t===r?1:us(t)))<0?0:t,i):[]},Lr.takeRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!1,!0):[]},Lr.takeWhile=function(e,t){return e&&e.length?ci(e,io(t,3)):[]},Lr.tap=function(e,t){return t(e),e},Lr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return Ka(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ea(e,t,{leading:i,maxWait:t,trailing:o})},Lr.thru=ca,Lr.toArray=ls,Lr.toPairs=Ps,Lr.toPairsIn=Rs,Lr.toPath=function(e){return Ba(e)?jt(e,Mo):is(e)?[e]:Ai(Oo(ps(e)))},Lr.toPlainObject=fs,Lr.transform=function(e,t,r){var n=Ba(e),i=n||Wa(e)||os(e);if(t=io(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Ka(e)&&Ga(o)?Nr(We(e)):{}}return(i?_t:vn)(e,function(e,n,i){return t(r,e,n,i)}),r},Lr.unary=function(e){return _a(e,1)},Lr.union=Zo,Lr.unionBy=Qo,Lr.unionWith=Jo,Lr.uniq=function(e){return e&&e.length?ai(e):[]},Lr.uniqBy=function(e,t){return e&&e.length?ai(e,io(t,2)):[]},Lr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ai(e,r,t):[]},Lr.unset=function(e,t){return null==e||si(e,t)},Lr.unzip=ea,Lr.unzipWith=ta,Lr.update=function(e,t,r){return null==e?e:li(e,t,pi(r))},Lr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:li(e,t,pi(n),i)},Lr.values=Ls,Lr.valuesIn=function(e){return null==e?[]:Yt(e,Is(e))},Lr.without=ra,Lr.words=Gs,Lr.wrap=function(e,t){return Ma(pi(t),e)},Lr.xor=na,Lr.xorBy=ia,Lr.xorWith=oa,Lr.zip=aa,Lr.zipObject=function(e,t){return hi(e||[],t||[],Zr)},Lr.zipObjectDeep=function(e,t){return hi(e||[],t||[],Xn)},Lr.zipWith=sa,Lr.entries=Ps,Lr.entriesIn=Rs,Lr.extend=ms,Lr.extendWith=vs,nl(Lr,Lr),Lr.add=pl,Lr.attempt=Ys,Lr.camelCase=Ns,Lr.capitalize=Ds,Lr.ceil=gl,Lr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=hs(n))==n?n:0),t!==r&&(t=(t=hs(t))==t?t:0),nn(hs(e),t,n)},Lr.clone=function(e){return on(e,4)},Lr.cloneDeep=function(e){return on(e,5)},Lr.cloneDeepWith=function(e,t){return on(e,5,t="function"==typeof t?t:r)},Lr.cloneWith=function(e,t){return on(e,4,t="function"==typeof t?t:r)},Lr.conformsTo=function(e,t){return null==t||an(e,t,Es(t))},Lr.deburr=zs,Lr.defaultTo=function(e,t){return null==e||e!=e?t:e},Lr.divide=ml,Lr.endsWith=function(e,t,n){e=ps(e),t=oi(t);var i=e.length,o=n=n===r?i:nn(us(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Lr.eq=La,Lr.escape=function(e){return(e=ps(e))&&q.test(e)?e.replace(W,Jt):e},Lr.escapeRegExp=function(e){return(e=ps(e))&&ee.test(e)?e.replace(J,"\\$&"):e},Lr.every=function(e,t,n){var i=Ba(e)?At:dn;return n&&mo(e,t,n)&&(t=r),i(e,io(t,3))},Lr.find=ha,Lr.findIndex=zo,Lr.findKey=function(e,t){return Rt(e,io(t,3),vn)},Lr.findLast=fa,Lr.findLastIndex=Bo,Lr.findLastKey=function(e,t){return Rt(e,io(t,3),yn)},Lr.floor=vl,Lr.forEach=pa,Lr.forEachRight=ga,Lr.forIn=function(e,t){return null==e?e:gn(e,io(t,3),Is)},Lr.forInRight=function(e,t){return null==e?e:mn(e,io(t,3),Is)},Lr.forOwn=function(e,t){return e&&vn(e,io(t,3))},Lr.forOwnRight=function(e,t){return e&&yn(e,io(t,3))},Lr.get=Cs,Lr.gt=Na,Lr.gte=Da,Lr.has=function(e,t){return null!=e&&ho(e,t,Sn)},Lr.hasIn=_s,Lr.head=Vo,Lr.identity=Js,Lr.includes=function(e,t,r,n){e=Va(e)?e:Ls(e),r=r&&!n?us(r):0;var i=e.length;return r<0&&(r=pr(i+r,0)),ns(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Nt(e,t,r)>-1},Lr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:us(r);return i<0&&(i=pr(n+i,0)),Nt(e,t,i)},Lr.inRange=function(e,t,n){return t=cs(t),n===r?(n=t,t=0):n=cs(n),function(e,t,r){return e>=gr(t,r)&&e<pr(t,r)}(e=hs(e),t,n)},Lr.invoke=ks,Lr.isArguments=za,Lr.isArray=Ba,Lr.isArrayBuffer=Ua,Lr.isArrayLike=Va,Lr.isArrayLikeObject=Ha,Lr.isBoolean=function(e){return!0===e||!1===e||Za(e)&&Cn(e)==g},Lr.isBuffer=Wa,Lr.isDate=$a,Lr.isElement=function(e){return Za(e)&&1===e.nodeType&&!es(e)},Lr.isEmpty=function(e){if(null==e)return!0;if(Va(e)&&(Ba(e)||"string"==typeof e||"function"==typeof e.splice||Wa(e)||os(e)||za(e)))return!e.length;var t=uo(e);if(t==w||t==A)return!e.size;if(wo(e))return!Mn(e).length;for(var r in e)if(Me.call(e,r))return!1;return!0},Lr.isEqual=function(e,t){return jn(e,t)},Lr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?jn(e,t,r,n):!!i},Lr.isError=qa,Lr.isFinite=function(e){return"number"==typeof e&&dr(e)},Lr.isFunction=Ga,Lr.isInteger=Ya,Lr.isLength=Xa,Lr.isMap=Qa,Lr.isMatch=function(e,t){return e===t||Tn(e,t,ao(t))},Lr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Tn(e,t,ao(t),n)},Lr.isNaN=function(e){return Ja(e)&&e!=+e},Lr.isNative=function(e){if(bo(e))throw new xe("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fn(e)},Lr.isNil=function(e){return null==e},Lr.isNull=function(e){return null===e},Lr.isNumber=Ja,Lr.isObject=Ka,Lr.isObjectLike=Za,Lr.isPlainObject=es,Lr.isRegExp=ts,Lr.isSafeInteger=function(e){return Ya(e)&&e>=-9007199254740991&&e<=c},Lr.isSet=rs,Lr.isString=ns,Lr.isSymbol=is,Lr.isTypedArray=os,Lr.isUndefined=function(e){return e===r},Lr.isWeakMap=function(e){return Za(e)&&uo(e)==I},Lr.isWeakSet=function(e){return Za(e)&&"[object WeakSet]"==Cn(e)},Lr.join=function(e,t){return null==e?"":hr.call(e,t)},Lr.kebabCase=Bs,Lr.last=qo,Lr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=us(n))<0?pr(i+o,0):gr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Lt(e,zt,o,!0)},Lr.lowerCase=Us,Lr.lowerFirst=Vs,Lr.lt=as,Lr.lte=ss,Lr.max=function(e){return e&&e.length?hn(e,Js,_n):r},Lr.maxBy=function(e,t){return e&&e.length?hn(e,io(t,2),_n):r},Lr.mean=function(e){return Bt(e,Js)},Lr.meanBy=function(e,t){return Bt(e,io(t,2))},Lr.min=function(e){return e&&e.length?hn(e,Js,Pn):r},Lr.minBy=function(e,t){return e&&e.length?hn(e,io(t,2),Pn):r},Lr.stubArray=dl,Lr.stubFalse=hl,Lr.stubObject=function(){return{}},Lr.stubString=function(){return""},Lr.stubTrue=function(){return!0},Lr.multiply=yl,Lr.nth=function(e,t){return e&&e.length?zn(e,us(t)):r},Lr.noConflict=function(){return ct._===this&&(ct._=De),this},Lr.noop=il,Lr.now=Ca,Lr.pad=function(e,t,r){e=ps(e);var n=(t=us(t))?ar(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Bi(pt(i),r)+e+Bi(ft(i),r)},Lr.padEnd=function(e,t,r){e=ps(e);var n=(t=us(t))?ar(e):0;return t&&n<t?e+Bi(t-n,r):e},Lr.padStart=function(e,t,r){e=ps(e);var n=(t=us(t))?ar(e):0;return t&&n<t?Bi(t-n,r)+e:e},Lr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),vr(ps(e).replace(te,""),t||0)},Lr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&mo(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=cs(e),t===r?(t=e,e=0):t=cs(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=yr();return gr(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return Wn(e,t)},Lr.reduce=function(e,t,r){var n=Ba(e)?Ft:Ht,i=arguments.length<3;return n(e,io(t,4),r,i,cn)},Lr.reduceRight=function(e,t,r){var n=Ba(e)?Ot:Ht,i=arguments.length<3;return n(e,io(t,4),r,i,un)},Lr.repeat=function(e,t,n){return t=(n?mo(e,t,n):t===r)?1:us(t),$n(ps(e),t)},Lr.replace=function(){var e=arguments,t=ps(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Lr.result=function(e,t,n){var i=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[Mo(t[i])];a===r&&(i=o,a=n),e=Ga(a)?a.call(e):a}return e},Lr.round=bl,Lr.runInContext=e,Lr.sample=function(e){return(Ba(e)?Gr:Gn)(e)},Lr.size=function(e){if(null==e)return 0;if(Va(e))return ns(e)?ar(e):e.length;var t=uo(e);return t==w||t==A?e.size:Mn(e).length},Lr.snakeCase=Hs,Lr.some=function(e,t,n){var i=Ba(e)?Mt:ei;return n&&mo(e,t,n)&&(t=r),i(e,io(t,3))},Lr.sortedIndex=function(e,t){return ti(e,t)},Lr.sortedIndexBy=function(e,t,r){return ri(e,t,io(r,2))},Lr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ti(e,t);if(n<r&&La(e[n],t))return n}return-1},Lr.sortedLastIndex=function(e,t){return ti(e,t,!0)},Lr.sortedLastIndexBy=function(e,t,r){return ri(e,t,io(r,2),!0)},Lr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ti(e,t,!0)-1;if(La(e[r],t))return r}return-1},Lr.startCase=Ws,Lr.startsWith=function(e,t,r){return e=ps(e),r=null==r?0:nn(us(r),0,e.length),t=oi(t),e.slice(r,r+t.length)==t},Lr.subtract=wl,Lr.sum=function(e){return e&&e.length?Wt(e,Js):0},Lr.sumBy=function(e,t){return e&&e.length?Wt(e,io(t,2)):0},Lr.template=function(e,t,n){var i=Lr.templateSettings;n&&mo(e,t,n)&&(t=r),e=ps(e),t=vs({},t,i,Yi);var o,a,s=vs({},t.imports,i.imports,Yi),l=Es(s),c=Yt(s,l),u=0,d=t.interpolate||ve,h="__p += '",f=Ae((t.escape||ve).source+"|"+d.source+"|"+(d===X?ce:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(Me.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tt+"]")+"\n";e.replace(f,function(t,r,n,i,s,l){return n||(n=i),h+=e.slice(u,l).replace(ye,er),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),h+="';\n";var g=Me.call(t,"variable")&&t.variable;if(g){if(se.test(g))throw new xe("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(B,""):h).replace(U,"$1").replace(V,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=Ys(function(){return Ce(l,p+"return "+h).apply(r,c)});if(m.source=h,qa(m))throw m;return m},Lr.times=function(e,t){if((e=us(e))<1||e>c)return[];var r=d,n=gr(e,d);t=io(t),e-=d;for(var i=$t(n,t);++r<e;)t(r);return i},Lr.toFinite=cs,Lr.toInteger=us,Lr.toLength=ds,Lr.toLower=function(e){return ps(e).toLowerCase()},Lr.toNumber=hs,Lr.toSafeInteger=function(e){return e?nn(us(e),-9007199254740991,c):0===e?e:0},Lr.toString=ps,Lr.toUpper=function(e){return ps(e).toUpperCase()},Lr.trim=function(e,t,n){if((e=ps(e))&&(n||t===r))return qt(e);if(!e||!(t=oi(t)))return e;var i=sr(e),o=sr(t);return vi(i,Kt(i,o),Zt(i,o)+1).join("")},Lr.trimEnd=function(e,t,n){if((e=ps(e))&&(n||t===r))return e.slice(0,lr(e)+1);if(!e||!(t=oi(t)))return e;var i=sr(e);return vi(i,0,Zt(i,sr(t))+1).join("")},Lr.trimStart=function(e,t,n){if((e=ps(e))&&(n||t===r))return e.replace(te,"");if(!e||!(t=oi(t)))return e;var i=sr(e);return vi(i,Kt(i,sr(t))).join("")},Lr.truncate=function(e,t){var n=30,i="...";if(Ka(t)){var o="separator"in t?t.separator:o;n="length"in t?us(t.length):n,i="omission"in t?oi(t.omission):i}var a=(e=ps(e)).length;if(tr(e)){var s=sr(e);a=s.length}if(n>=a)return e;var l=n-ar(i);if(l<1)return i;var c=s?vi(s,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(s&&(l+=c.length-l),ts(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Ae(o.source,ps(ue.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===r?l:h)}}else if(e.indexOf(oi(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Lr.unescape=function(e){return(e=ps(e))&&$.test(e)?e.replace(H,cr):e},Lr.uniqueId=function(e){var t=++Pe;return ps(e)+t},Lr.upperCase=$s,Lr.upperFirst=qs,Lr.each=pa,Lr.eachRight=ga,Lr.first=Vo,nl(Lr,(fl={},vn(Lr,function(e,t){Me.call(Lr.prototype,t)||(fl[t]=e)}),fl),{chain:!1}),Lr.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Lr[e].placeholder=Lr}),_t(["drop","take"],function(e,t){Br.prototype[e]=function(n){n=n===r?1:pr(us(n),0);var i=this.__filtered__&&!t?new Br(this):this.clone();return i.__filtered__?i.__takeCount__=gr(n,i.__takeCount__):i.__views__.push({size:gr(n,d),type:e+(i.__dir__<0?"Right":"")}),i},Br.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Br.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),_t(["head","last"],function(e,t){var r="take"+(t?"Right":"");Br.prototype[e]=function(){return this[r](1).value()[0]}}),_t(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Br.prototype[e]=function(){return this.__filtered__?new Br(this):this[r](1)}}),Br.prototype.compact=function(){return this.filter(Js)},Br.prototype.find=function(e){return this.filter(e).head()},Br.prototype.findLast=function(e){return this.reverse().find(e)},Br.prototype.invokeMap=qn(function(e,t){return"function"==typeof e?new Br(this):this.map(function(r){return En(r,e,t)})}),Br.prototype.reject=function(e){return this.filter(Fa(io(e)))},Br.prototype.slice=function(e,t){e=us(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Br(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=us(t))<0?n.dropRight(-t):n.take(t-e)),n)},Br.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Br.prototype.toArray=function(){return this.take(d)},vn(Br.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Lr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Lr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Br,c=s[0],u=l||Ba(t),d=function(e){var t=o.apply(Lr,Tt([e],s));return i&&h?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Br(this);var m=e.apply(t,s);return m.__actions__.push({func:ca,args:[d],thisArg:r}),new zr(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ie[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Lr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ba(i)?i:[],e)}return this[r](function(r){return t.apply(Ba(r)?r:[],e)})}}),vn(Br.prototype,function(e,t){var r=Lr[t];if(r){var n=r.name+"";Me.call(Er,n)||(Er[n]=[]),Er[n].push({name:t,func:r})}}),Er[Li(r,2).name]=[{name:"wrapper",func:r}],Br.prototype.clone=function(){var e=new Br(this.__wrapped__);return e.__actions__=Ai(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ai(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ai(this.__views__),e},Br.prototype.reverse=function(){if(this.__filtered__){var e=new Br(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Br.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ba(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=gr(t,e+a);break;case"takeRight":e=pr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=n?s:a-1,u=this.__iteratees__,d=u.length,h=0,f=gr(l,this.__takeCount__);if(!r||!n&&i==l&&f==l)return ui(e,this.__actions__);var p=[];e:for(;l--&&h<f;){for(var g=-1,m=e[c+=t];++g<d;){var v=u[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue e;break e}}p[h++]=m}return p},Lr.prototype.at=ua,Lr.prototype.chain=function(){return la(this)},Lr.prototype.commit=function(){return new zr(this.value(),this.__chain__)},Lr.prototype.next=function(){this.__values__===r&&(this.__values__=ls(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Lr.prototype.plant=function(e){for(var t,n=this;n instanceof Dr;){var i=Ro(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Lr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Br){var t=e;return this.__actions__.length&&(t=new Br(this)),(t=t.reverse()).__actions__.push({func:ca,args:[Ko],thisArg:r}),new zr(t,this.__chain__)}return this.thru(Ko)},Lr.prototype.toJSON=Lr.prototype.valueOf=Lr.prototype.value=function(){return ui(this.__wrapped__,this.__actions__)},Lr.prototype.first=Lr.prototype.head,Qe&&(Lr.prototype[Qe]=function(){return this}),Lr}();dt?((dt.exports=ur)._=ur,ut._=ur):ct._=ur}).call(to)}(eo,eo.exports)),eo.exports);const no=e=>null===e.parentId||"null"===e.parentId||!e.parentId,io=e=>{var t,r,n,i;const{state:a,actions:s,options:l}=Xi(),{searchTerm:c,sortBy:u,sortOrder:d,selectedFolder:h,pagination:f,pathHistory:p}=a,{setSearchTerm:g,setSortBy:m,setSortOrder:v,setPagination:y}=s,b=e||s.fetchFiles,w=(0,o.useRef)(null),x=(0,o.useRef)(ro.debounce(e=>{const t=JSON.stringify(e);w.current!==t&&(w.current=t,null==b||b(e))},150)).current,C=(0,o.useCallback)(()=>{const e=h||"";if(!e)return;const t=[...Array.isArray(p)?p:[]].reverse().find(t=>t.id===e);return null==t?void 0:t.name},[h,p]),_=(0,o.useCallback)(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:h||"",folderName:C(),search:(null==c?void 0:c.trim())||void 0,page:t?void 0:f.current,limit:t?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}},[h,C,c,f.current,f.pageSize,u,d,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),S=(0,o.useCallback)(e=>{var t,r;if(g&&g(e),y&&y({current:1,pageSize:f.pageSize,total:0}),b){const n={folderId:h||"",folderName:C(),search:(null==e?void 0:e.trim())||void 0,page:(null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination)?void 0:1,limit:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"};b(n)}},[g,y,f.pageSize,b,h,C,u,d,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),A=(0,o.useCallback)((e,t)=>{var r,n;null==m||m(e),null==v||v(t),b&&x({folderId:h||"",folderName:C(),search:(null==c?void 0:c.trim())||void 0,page:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:f.current,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:f.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[m,v,x,h,C,c,f.current,f.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),k=(0,o.useCallback)((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(y&&y({current:e,pageSize:t||f.pageSize,total:f.total}),b&&x({folderId:h||"",folderName:C(),search:(null==c?void 0:c.trim())||void 0,page:e,limit:t||f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}))},[y,f.pageSize,f.total,x,h,C,c,u,d,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return(0,o.useEffect)(()=>{if(b){const e=_();x(Object.assign(Object.assign({},e),{page:1}))}},[h]),(0,o.useEffect)(()=>{b&&x(_())},[]),(0,o.useEffect)(()=>()=>{var e;null===(e=x.cancel)||void 0===e||e.call(x)},[x]),{state:{searchTerm:c||"",sortBy:u||"name",sortOrder:d||"asc"},actions:{setSearchTerm:g||(()=>{}),setSortBy:m||(()=>{}),setSortOrder:v||(()=>{}),handleSearch:S,handleSort:A,handlePaginationChange:k,getCurrentQueryParams:_}}},oo=new Map;function ao(e){const t="id"in e&&void 0!==e.id?String(e.id):"unknown",r="data"in e?e.data:void 0;return`${e.type}:${t}:${function(e){if(null==e)return"";try{return JSON.stringify(e,Object.keys(e).sort())}catch(t){return String(e)}}(r)}`}const so=()=>{var e,t;const{notification:r}=u.A.useApp(),n=Xi(),{options:i}=n,a=(0,o.useCallback)(async e=>{let t;if(i.handleNotify){try{t=await i.handleNotify(e)}catch(e){}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&i.handleError){try{t=await i.handleError(e)}catch(e){}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&i.handleSuccess){try{t=await i.handleSuccess(e)}catch(e){}if(t)return!1}return t},[i]),s=(0,o.useCallback)(async function(e,t=!1){var n,o,s,l;try{void 0===e.visibility&&(e.visibility=!t);const c=await a(e);"object"==typeof c&&(e=c);const u=null!==(o=null===(n=i.config)||void 0===n?void 0:n.notificationDedupeTtlMs)&&void 0!==o?o:12e3,d="error"===e.type&&!0===e.notificationDedupe;if(d&&function(e,t){if(t<=0)return;const r=ao(e),n=Date.now(),i=oo.get(r);void 0!==i&&n-i<t&&(e.visibility=!1)}(e,u),!1===e.visibility||!1===c||!1===(null===(s=i.config)||void 0===s?void 0:s.showNotifications))return e;const h=r[e.type];"function"==typeof h&&(h(e),d&&(l=e,u<=0||oo.set(ao(l),Date.now())))}catch(e){}return e},[r,a,null===(e=i.config)||void 0===e?void 0:e.notificationDedupeTtlMs,null===(t=i.config)||void 0===t?void 0:t.showNotifications]);return(0,o.useMemo)(()=>({error:(e,t=!1)=>s(Object.assign(Object.assign({},e),{type:"error"}),t),success:(e,t=!1)=>s(Object.assign(Object.assign({},e),{type:"success"}),t),warning:(e,t=!1)=>s(Object.assign(Object.assign({},e),{type:"warning"}),t),notify:s}),[s])},lo={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid. Allowed characters: {{allowedChars}}",FileAccessDenied:"You don't have permission to access this file.",FileReadError:"Failed to read the file.",FileWriteError:"Failed to write the file.",FileTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",FileTypeNotAllowed:"This file type is not allowed.",FileCorrupted:"The file appears to be corrupted.",FileChecksumMismatch:"File integrity check failed.",FileStorageQuotaExceeded:"Storage quota exceeded. Please free up space.",FileLocked:"File is locked by another process or user.",FileVersionConflict:"File version conflict. Please refresh and try again.",FolderNotFound:"Folder not found or no longer available.",FolderAlreadyExists:"Folder with this name already exists.",FolderInvalidName:"Folder name is not valid. Allowed characters: {{allowedChars}}",FolderAccessDenied:"You don't have permission to access this folder.",FolderReadError:"Failed to read the folder contents.",FolderWriteError:"Failed to write to the folder.",FolderQuotaExceeded:"Folder storage quota exceeded.",FolderNotEmpty:"Folder is not empty.",FolderBackendError:"Server error while processing the folder.",FolderTimeout:"Folder operation took too long.",RenameNotAllowed:"Renaming is not allowed for this item.",MoveNotAllowed:"Moving is not allowed for this item.",CopyNotAllowed:"Copying is not allowed for this item.",DeleteNotAllowed:"Deleting is not allowed for this item.",MoveIntoSelf:"Cannot move an item into itself.",MoveIntoDescendant:"Cannot move an item into its descendant folder.",CopyIntoSelf:"Cannot copy an item into itself.",UnsupportedOperation:"This operation is not supported.",ConfigError:"Configuration error occurred.",FileUploadQuotaExceeded:"You have exceeded the upload quota.",FileUploadNetworkError:"Network error while uploading the file.",FileUploadTimeout:"File upload took too long.",FileUploadBackendError:"Server error while uploading the file.",UploadUrlInvalid:"The specified URL is not valid.",UploadUrlNotReachable:"The specified URL is not reachable.",UploadUrlContentTypeNotAllowed:"Content type at the URL is not allowed.",UploadUrlDownloadFailed:"Failed to download file from the URL.",FileLookupFailed:"Failed to find existing file by URL.",FileProxyFailed:"Failed to load file through proxy.",FileProxyNotConfigured:"File proxy is not configured.",FileDownloadNetworkError:"Network error while downloading the file.",FileDownloadTimeout:"File download took too long.",FileDownloadBackendError:"Server error while downloading the file.",BatchPartialFailure:"Some items could not be processed.",BatchAllFailed:"Failed to process all items in the batch.",BatchConflict:"Some items in the batch are in a conflicting state.",BatchValidationFailed:"Some items in the batch did not pass validation.",BatchItemLimitExceeded:"Batch operation exceeds the maximum number of items allowed.",ValidationError:"Some of the provided data is invalid.",PayloadTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",UnsupportedMediaType:"This media type is not supported.",NetworkError:"Network error. Please check your connection and try again.",BackendError:"Server error. Please try again later.",Timeout:"The operation took too long. Please try again.",AuthenticationFailed:"Authentication failed. Please sign in again.",AuthorizationFailed:"You are not allowed to perform this action.",RateLimitExceeded:"Too many requests. Please try again a bit later.",ServiceUnavailable:"Service is temporarily unavailable. Please try again later.",AIResponseInvalid:"AI service returned an invalid response.",AIImageGenerationFailed:"Failed to generate image using AI.",AIImageGenerationLimitExceeded:"You have reached the AI image generation limit.",IntegrationError:"Error in external integration.",ThirdPartyError:"Error in a third-party service.",UnknownError:"An unknown error occurred."},co={FileTooLarge:"File is too large to upload.",PayloadTooLarge:"File is too large to upload."},uo=(e,t,r)=>{var n,i,o;if(!e)return;const a=lo[e];if(!a)return;const s=null!==(n=null==r?void 0:r.fileSize)&&void 0!==n?n:"",l=null!==(i=null==r?void 0:r.maxSize)&&void 0!==i?i:"";if(("FileTooLarge"===e||"PayloadTooLarge"===e)&&(!s||!l)){const r=co[e];return r?t(r):t(a,{fileSize:"?",maxSize:"?"})}return t(a,{allowedChars:null!==(o=null==r?void 0:r.allowedChars)&&void 0!==o?o:"a-z A-Z 0-9 . _ -",fileSize:s,maxSize:l})},ho=e=>{if(!e||"string"!=typeof e)return;const t=e.toLowerCase();return(t.includes("maximum number of files")||t.includes("number of files exceeded"))&&(t.includes("allowed")||t.includes("received"))?"BatchItemLimitExceeded":t.includes("exceeds")||t.includes("maximum")||t.includes("too large")||t.includes("size limit")||t.includes("object size")||t.includes("\u0440\u0430\u0437\u043c\u0435\u0440")||t.includes("\u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d")?"PayloadTooLarge":t.includes("403")||t.includes("forbidden")||t.includes("access denied")||t.includes("\u0434\u043e\u0441\u0442\u0443\u043f \u0437\u0430\u043f\u0440\u0435\u0449\u0451\u043d")?"AuthorizationFailed":t.includes("404")||t.includes("not found")||t.includes("\u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d")?"UploadUrlNotReachable":t.includes("already exists")||t.includes("\u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442")||t.includes("\u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442")?"FileAlreadyExists":t.includes("invalid")&&(t.includes("name")||t.includes("\u0438\u043c\u044f")||t.includes("\u043d\u0430\u0437\u0432\u0430"))?"FileInvalidName":t.includes("type")&&(t.includes("not allowed")||t.includes("\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f"))?"FileTypeNotAllowed":void 0},fo=e=>{var t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y;if(!e)return{message:"Unknown error",raw:e};if("string"==typeof e)return{message:e};if(e instanceof Error){const o=e;return{message:null!==(t=o.message)&&void 0!==t?t:e.message,code:o.code,status:null!==(r=o.status)&&void 0!==r?r:o.httpStatus,stack:null!==(n=o.stack)&&void 0!==n?n:e.stack,raw:null!==(i=o.raw)&&void 0!==i?i:e}}if("object"==typeof e){const t=e,r=null!==(o=t.data)&&void 0!==o?o:t,n=null!==(a=null==r?void 0:r.data)&&void 0!==a?a:r,i=null!==(c=null!==(l=null!==(s=t.message)&&void 0!==s?s:null==r?void 0:r.message)&&void 0!==l?l:t.error)&&void 0!==c?c:t.reason,b=null!==(h=null!==(d=null!==(u=t.status)&&void 0!==u?u:t.httpStatus)&&void 0!==d?d:null==n?void 0:n.status)&&void 0!==h?h:null==r?void 0:r.status,w=null!==(f=t.code)&&void 0!==f?f:null==r?void 0:r.code,x=t.stack,C=null!==(p=t.raw)&&void 0!==p?p:e,_=null!==(m=null!==(g=t.fileSize)&&void 0!==g?g:null==n?void 0:n.fileSize)&&void 0!==m?m:null==r?void 0:r.fileSize,S=null!==(y=null!==(v=t.maxSize)&&void 0!==v?v:null==n?void 0:n.maxSize)&&void 0!==y?y:null==r?void 0:r.maxSize;if(i||w||b||x||C)return Object.assign(Object.assign({message:i,code:w,status:b,stack:x,raw:C},null!=_&&{fileSize:_}),null!=S&&{maxSize:S})}return{message:String(e),raw:e}},po=(e,t,r)=>{const n=fo(e),i=null==n?void 0:n.code;if("FileTooLarge"===i&&null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize))return t("File too large ({{size}}). Maximum allowed size: {{maxSize}}",{size:Hn(r.fileSize),maxSize:Hn(r.maxSize)});if(("BatchItemLimitExceeded"===i||"exceeded_max_files"===i)&&(null==n?void 0:n.message)){const{allowed:e,received:r}=function(e){const t=e.match(/Allowed:\s*(\d+)/i),r=e.match(/received:\s*(\d+)/i);return{allowed:t?parseInt(t[1],10):void 0,received:r?parseInt(r[1],10):void 0}}(n.message);if(null!=e&&null!=r)return t("Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}",{allowed:e,received:r})}if((null==n?void 0:n.message)&&"Unknown error"!==n.message)return n.message;const o=null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize)?{fileSize:Hn(r.fileSize),maxSize:Hn(r.maxSize)}:void 0,a=uo(i,t,o);return null!=a?a:t("Error uploading file")},go=e=>{const t=fo(e);return"path_folder_not_found"===(null==t?void 0:t.code)},mo=["file_get_contents","open stream","failed to open stream","http request failed","curl_error"],vo=(e,t,r)=>{var n;if(!e)return t("Error when downloading a file by URL");const i=null!==(n=(e=>{const t=ho(e);if("AuthorizationFailed"===t){const t=(e||"").toLowerCase();if(t.includes("download")||t.includes("url")||t.includes("file_get_contents")||t.includes("failed to download"))return"UploadUrlNotReachable"}return t})(null==e?void 0:e.message))&&void 0!==n?n:null==e?void 0:e.code,o=uo(i,t,r);if(o)return o;const a=(null==e?void 0:e.message)&&"string"==typeof e.message?e.message.trim():null;return a&&function(e){if(!e||e.length>200)return!1;const t=e.toLowerCase();return!mo.some(e=>t.includes(e))}(a)?a:t("Failed to download file from the URL.")},yo=e=>Array.isArray(e)?e.filter(e=>(null==e?void 0:e.id)&&"folders"!==e.id).map(e=>e.name).filter(Boolean).join("/"):"",bo=e=>{const t=e.trim();if(!t)return"";const r=t.toLowerCase(),n=[r.indexOf(" and "),r.indexOf(" or "),t.indexOf(","),t.indexOf(";"),r.indexOf(". ")].filter(e=>e>=0);if(0===n.length)return t;const i=Math.min(...n);return t.slice(0,i).trim()||t},wo=(e,t)=>{const r=(e=>{var t,r,n,i;if(e&&"object"==typeof e){const o=e,a=null!==(n=null===(r=null===(t=o.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.path_folder)&&void 0!==n?n:null===(i=o.data)||void 0===i?void 0:i.path_folder;if("string"==typeof a&&a.trim())return bo(a)||null}const o=fo(e),a=null==o?void 0:o.message;if(!a)return null;const s=a.toLowerCase(),l=["\u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442:","not exists:","not exist:","not found:"];for(const u of l){const e=s.indexOf(u);if(e>=0){const t=a.slice(e+u.length).trim();return bo(t)||null}}const c=["not exists ","not exist ","not found "];for(const u of c){const e=s.indexOf(u);if(e>=0){const t=a.slice(e+u.length).trim();return bo(t)||null}}return null})(e);return r?(e=>{const t=e.split("/").filter(Boolean);return t.length<=1?"":(t.pop(),t.join("/"))})(r):yo(t)},xo=async e=>{var t;const{options:r,pathFolder:n,dataProviders:i}=e;if(null==i?void 0:i.clearCache)return void await i.clearCache(n||null);const o=null===(t=null==r?void 0:r.apiEndpoints)||void 0===t?void 0:t.clearCache;if(!o)return;const a=o.includes("?");let s=o;n&&n.length>0&&(s=`${o}${a?"&":"?"}path_folder=${encodeURIComponent(n)}`);const l=await fetch(s,{method:"POST"});if(!l.ok)throw new Error(`Cache clear failed: ${l.status}`)},Co=()=>{var e,t;const{state:r,actions:n,options:i}=Xi(),{t:a}=Sn(),s=so(),{folders:l,selectedFolder:c,pathHistory:u,form:d,loading:h,isModalVisible:f}=r,{setFolders:p,setLoading:g,setIsModalVisible:m}=n,{dataProviders:v,config:y}=i,b=(0,o.useCallback)(e=>(Array.isArray(e)?e:[]).filter(e=>e&&e.id&&e.name).map(e=>({id:e.id,name:e.name,parentId:e.folderId?e.folderId:null})),[]),w=(0,o.useCallback)(async(e=!1)=>{null==g||g(!0);try{let e=[];const t="lazy"===(null==y?void 0:y.folderTreeLoading);if(!(null==v?void 0:v.getFolders)){if(null==v?void 0:v.getFiles){const e=async r=>{const{files:n}=await v.getFiles({itemType:"folder",folderId:null!=r?r:void 0}),i=b(n);if(t)return i;const o=await Promise.all(i.map(t=>e(t.id)));return[...i,...o.flat()]},r=await e(null);return void(p&&p(e=>{const n=Array.isArray(e)?e:[];if(!t){const e=r;return e.filter(e=>e.id===e.parentId).length,e}const i=n.filter(e=>e.parentId),o=[...i,...r],a=o.filter(e=>e.id===e.parentId);return a.length,o}))}return}{const r=!t;e=await v.getFolders({parentId:null,deep:r})}const r=Array.isArray(e)?e:[];null==p||p(r);const n=r.filter(e=>e.id===e.parentId);n.length}catch(t){const n=fo(t);if(!e&&(404===(null==n?void 0:n.status)||"FileNotFound"===(null==n?void 0:n.code))){const n=wo(t,u||[]);try{return await xo({options:i,pathFolder:n,dataProviders:null==i?void 0:i.dataProviders}),void await w(!0)}catch(e){}}const o=uo(null==n?void 0:n.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=o?o:a("Failed to load folders"),description:a("Folders"),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{reason:t instanceof Error?t.message:String(t),folderId:null,folderName:a("Folders")}})}finally{null==g||g(!1)}},[null==v?void 0:v.getFiles,null==v?void 0:v.getFolders,p,g,null==y?void 0:y.folderTreeLoading,b,s,a,u,i]),x=(0,o.useCallback)(()=>w(),[w]),C=(0,o.useCallback)(async e=>{try{let t,r;if(null==v?void 0:v.getFolders){t=await v.getFolders({parentId:e,deep:!1});const n=Array.isArray(l)?l:[],i=new Set(t.map(e=>e.id)),o=n.filter(t=>t.parentId!==e||i.has(t.id));r=[...o,...t.filter(e=>!o.some(t=>t.id===e.id))]}else{if(!(null==v?void 0:v.getFiles))return[];{const{files:n}=await v.getFiles({itemType:"folder",folderId:null!=e?e:void 0});t=b(n);const i=Array.isArray(l)?l:[],o=new Set(t.map(e=>e.id)),a=i.filter(t=>t.parentId!==e||o.has(t.id));r=[...a,...t.filter(e=>!a.some(t=>t.id===e.id))]}}let n=r,i=0;for(;i!==n.length;){i=n.length;const e=new Set(n.map(e=>e.id));n=n.filter(t=>!t.parentId||e.has(t.parentId))}return null==p||p(n),t}catch(e){return[]}},[v,l,p,b]),_=(0,o.useCallback)(()=>{var e;const t=null!==(e=null==y?void 0:y.defaultFolderName)&&void 0!==e?e:a("New folder");d.setFieldsValue({folderName:t}),null==m||m(!0)},[d,m,a,null==y?void 0:y.defaultFolderName]),S=(0,o.useCallback)(async(e,t)=>{const r=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==p||p(r),e.parentId&&(await C(e.parentId),await new Promise(e=>setTimeout(e,50))),!(null==t?void 0:t.preserveSelection)&&n.setSelectedFolder&&n.setSelectedFolder(e.id),!(null==t?void 0:t.preserveSelection)&&n.setPathHistory){const t=Array.isArray(r)?r:[],i=(e,r=new Set)=>{if(r.has(e))return[];const n=t.find(t=>t.id===e);if(!n)return[];const o=new Set(r);return o.add(e),n.parentId?[...i(n.parentId,o),{id:n.id,name:n.name}]:[{id:n.id,name:n.name}]},o=i(e.id),s=[{id:"folders",name:a("Folders")},...o];n.setPathHistory(s)}},[l,p,n,r.pathHistory,C,a]),A=(0,o.useCallback)(async e=>{try{if(null==v?void 0:v.getFolders){const t=await v.getFolders();return(Array.isArray(t)?t:[]).some(t=>t.id===e)}if(null==v?void 0:v.getFiles){const t=new Set,r=async n=>{const{files:i}=await v.getFiles({itemType:"folder",folderId:null!=n?n:void 0}),o=b(i);for(const a of o)if(!t.has(a.id)){if(t.add(a.id),a.id===e)return!0;if(await r(a.id))return!0}return!1};return await r(null)}}catch(e){}return!1},[null==v?void 0:v.getFolders,null==v?void 0:v.getFiles,b]),k=(0,o.useCallback)(async e=>{var t;let r,n,i=null;try{const o=await(e?e.validateFields():d.validateFields());if(r=o.folderName.trim(),!r){const e=o.targetFolder||(c&&"folders"!==c?c:null);return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderName:r,folderId:null!=e?e:null,reason:"emptyName",is_force_create:!!o.is_force_create}})}n=pr(r,y);const h=o.targetFolder;if(h)i="folders"!==h?h:null;else if(c&&"folders"!==c)i=c;else if(Array.isArray(u)&&u.length>1){const e=u[u.length-1];i=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}if(gr(y)&&(null==v?void 0:v.getFolders))try{const e=(await v.getFolders({parentId:i,deep:!1})||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean);if(e.includes(r.trim().toLowerCase()))return void s.error({id:"FOLDER_ALREADY_EXISTS",message:a("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,folderId:i}})}catch(e){}let f;if(!(null==v?void 0:v.createFolder))return void s.error({id:"FOLDER_CREATE_PROVIDER_NOT_CONFIGURED",message:a("Folder creation provider is not configured"),placement:"bottomRight",data:{folderName:n,folderId:null!=i?i:null,is_force_create:!!o.is_force_create}});f=await v.createFolder({name:n,parentId:i,is_force_create:!!o.is_force_create}),(e=>{if(!e||!e.id)throw new Error(a("Invalid server response: folder ID is missing"));if(e.id===e.parentId&&e.parentId)throw new Error(a("Error: folder cannot be its own parent"))})(f);const g={id:f.id,name:f.name,parentId:null!=i?i:null,childCount:f.childCount},b=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==g.id),g];if(null==p||p(b),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[g.id],folderId:null!==(t=g.parentId)&&void 0!==t?t:null,folderName:g.name}}),e||null==m||m(!1),(async()=>{try{await S(g,{preserveSelection:Boolean(e)}),await x(),await new Promise(e=>setTimeout(e,200)),await A(f.id)}catch(e){}})(),e)return f}catch(e){const t=fo(e),o=uo(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=o?o:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:n||r,folderId:null!=i?i:null,reason:e instanceof Error?e.message:String(e)}})}},[d,c,v,S,x,A,m,s,a,l,p,y,u]),E=(0,o.useCallback)(()=>{null==m||m(!1)},[m]),I=(0,o.useCallback)((e,t=new Set)=>{const r=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return{key:e.id,label:e.name+" "+a("(error)"),icon:o.createElement(V.A,{style:{color:"red"}})};const n=new Set(t);n.add(e.id);const i=r.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:i.length>0?I(i,n):void 0}})},[l]),j=(0,o.useCallback)(()=>{const e=Array.isArray(l)?l:[],t={key:"folders",label:a("Folders"),children:[]},r=e.filter(e=>null===e.parentId||!e.parentId);return t.children=I(r),[t]},[l,a,I]),T=(0,o.useCallback)(async(e,t)=>{var r,o,c,u;let d;try{const h=t.trim(),f=null==l?void 0:l.find(t=>t.id===e);if(!h)return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:e,folderName:t,reason:"emptyName"}});if(d=pr(h,y),!1===(null===(r=null==y?void 0:y.features)||void 0===r?void 0:r.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:e,itemName:null!==(o=null==f?void 0:f.name)&&void 0!==o?o:d}});if(!(null===(c=i.dataProviders)||void 0===c?void 0:c.renameFolder))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Folder rename provider is not configured"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"providerNotConfigured"}}});const p=await i.dataProviders.renameFolder(e,d);if(!(null==p?void 0:p.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"invalidResponse"}}});await x(),e!==p.id&&n.setSelectedFolder&&n.setSelectedFolder(p.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:p.id,itemName:p.name,folderId:null!==(u=p.parentId)&&void 0!==u?u:null}})}catch(r){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:r,data:{itemId:e,itemName:d||t,error:{message:r instanceof Error?r.message:String(r)}}})}},[x,l,null===(e=i.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==y?void 0:y.features)||void 0===t?void 0:t.enableRenameFolder,y,n.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:f,loading:h},actions:{fetchFolders:x,fetchChildFolders:C,handleCreateFolder:_,handleModalOk:k,handleModalCancel:E,generateMenuItems:j,renameFolder:T}}},_o=()=>{const{options:e,actions:t}=Xi(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:a}=Sn(),s=so(),l=(0,o.useCallback)(async({items:e,selectedFolder:t,getItemNameById:o,showNotifications:l=!1})=>{let c=0,u=0;const d=[],h=async t=>{if(null==r?void 0:r.deleteItems)try{const n=await r.deleteItems(e.map(e=>e.id),{permanent:t}),i=n.detailed;if(i){const e=i.filter(e=>e.success),t=i.filter(e=>!e.success),r=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return go(r)}),n=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return!go(r)});return c+=e.length+r.length,u+=n.length,void n.forEach(e=>{var t;const r=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),n=null!==(t=e.innerException)&&void 0!==t?t:e.error,i=fo(n);d.push({itemId:r,itemName:o(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(go(t))c+=e.length;else if(t){u+=e.length;const r=fo(t);d.push({error:r})}else u+=e.length}return}catch(r){if(go(r))c+=e.length;else{u+=e.length;const n=fo(r);d.push({error:n})}}},f=(null==n?void 0:n.enableTrashFolder)&&"Trash"===t;return(null==n?void 0:n.enableTrashFolder)&&!f?await h(!1):await h(!0),c>0&&(null==n?void 0:n.enableTrashFolder)&&!f&&(null==i||i({itemIds:e.map(e=>e.id),sourceFolderId:t||"folders"})),l&&(c>0&&s.success({id:"FILES_DELETE_SUCCESS",message:a("Files deleted"),placement:"bottomRight",data:{successCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&s.error({id:"FILES_DELETE_ERROR",message:a("Error when deleting a file"),placement:"bottomRight",data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>o(e.id)),folderId:t||null,errors:d}})),{successCount:c,failCount:u,errorDetails:d}},[r,n,i,a,s]);return{deleteItems:l}};class So extends Error{constructor(e,t,r,n){super(e),this.code=t,this.status=r,this.details=n,this.name="FileManagerApiError",Error.captureStackTrace&&Error.captureStackTrace(this,So)}}const Ao=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,ko=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function Eo(e,t){const r=e.trim();if(!r)throw new So(t("Enter the URL of the image"),"UploadUrlInvalid");if(r.length>8192)throw new So(t("URL too long"),"UploadUrlInvalid");let n;try{n=new URL(r)}catch(e){throw new So(t("The specified URL is not valid."),"UploadUrlInvalid")}const i=n.protocol.toLowerCase();if("http:"!==i&&"https:"!==i)throw new So(t("Only http and https URLs are supported"),"UploadUrlInvalid");const o=n.hostname.toLowerCase();if(Ao.test(o)&&("undefined"==typeof window||!Ao.test(window.location.hostname.toLowerCase())))throw new So(t("Private and local URLs are not allowed"),"UploadUrlInvalid");if(ko.test(o))throw new So(t("Private and local URLs are not allowed"),"UploadUrlInvalid")}function Io(e,t){return new Promise(function(r,n){let i;return jo(e).then(function(e){try{return i=e,r(new Blob([t.slice(0,2),i,t.slice(2)],{type:"image/jpeg"}))}catch(e){return n(e)}},n)})}const jo=e=>new Promise((t,r)=>{const n=new FileReader;n.addEventListener("load",({target:{result:e}})=>{const n=new DataView(e);let i=0;if(65496!==n.getUint16(i))return r("not a valid JPEG");for(i+=2;;){const o=n.getUint16(i);if(65498===o)break;const a=n.getUint16(i+2);if(65505===o&&1165519206===n.getUint32(i+4)){const o=i+10;let s;switch(n.getUint16(o)){case 18761:s=!0;break;case 19789:s=!1;break;default:return r("TIFF header contains invalid endian")}if(42!==n.getUint16(o+2,s))return r("TIFF header contains invalid version");const l=n.getUint32(o+4,s),c=o+l+2+12*n.getUint16(o+l,s);for(let e=o+l+2;e<c;e+=12)if(274==n.getUint16(e,s)){if(3!==n.getUint16(e+2,s))return r("Orientation data type is invalid");if(1!==n.getUint32(e+4,s))return r("Orientation data count is invalid");n.setUint16(e+8,1,s);break}return t(e.slice(i,i+2+a))}i+=2+a}return t(new Blob)}),n.readAsArrayBuffer(e)});var To={},Fo={get exports(){return To},set exports(e){To=e}};!function(){var e,t,r={};Fo.exports=r,r.parse=function(e,t){for(var n=r.bin.readUshort,i=r.bin.readUint,o=0,a={},s=new Uint8Array(e),l=s.length-4;101010256!=i(s,l);)l--;o=l,o+=4;var c=n(s,o+=4);n(s,o+=2);var u=i(s,o+=2),d=i(s,o+=4);o+=4,o=d;for(var h=0;h<c;h++){i(s,o),o+=4,o+=4,o+=4,i(s,o+=4),u=i(s,o+=4);var f=i(s,o+=4),p=n(s,o+=4),g=n(s,o+2),m=n(s,o+4);o+=6;var v=i(s,o+=8);o+=4,o+=p+g+m,r._readLocal(s,v,a,u,f,t)}return a},r._readLocal=function(e,t,n,i,o,a){var s=r.bin.readUshort,l=r.bin.readUint;l(e,t),s(e,t+=4),s(e,t+=2);var c=s(e,t+=2);l(e,t+=2),l(e,t+=4),t+=4;var u=s(e,t+=8),d=s(e,t+=2);t+=2;var h=r.bin.readUTF8(e,t,u);if(t+=u,t+=d,a)n[h]={size:o,csize:i};else{var f=new Uint8Array(e.buffer,t);if(0==c)n[h]=new Uint8Array(f.buffer.slice(t,t+i));else{if(8!=c)throw"unknown compression method: "+c;var p=new Uint8Array(o);r.inflateRaw(f,p),n[h]=p}}},r.inflateRaw=function(e,t){return r.F.inflate(e,t)},r.inflate=function(e,t){return e[0],e[1],r.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},r.deflate=function(e,t){null==t&&(t={level:6});var n=0,i=new Uint8Array(50+Math.floor(1.1*e.length));i[n]=120,i[n+1]=156,n+=2,n=r.F.deflateRaw(e,i,n,t.level);var o=r.adler(e,0,e.length);return i[n+0]=o>>>24&255,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=o>>>0&255,new Uint8Array(i.buffer,0,n+4)},r.deflateRaw=function(e,t){null==t&&(t={level:6});var n=new Uint8Array(50+Math.floor(1.1*e.length)),i=r.F.deflateRaw(e,n,i,t.level);return new Uint8Array(n.buffer,0,i)},r.encode=function(e,t){null==t&&(t=!1);var n=0,i=r.bin.writeUint,o=r.bin.writeUshort,a={};for(var s in e){var l=!r._noNeed(s)&&!t,c=e[s],u=r.crc.crc(c,0,c.length);a[s]={cpr:l,usize:c.length,crc:u,file:l?r.deflateRaw(c):c}}for(var s in a)n+=a[s].file.length+30+46+2*r.bin.sizeUTF8(s);n+=22;var d=new Uint8Array(n),h=0,f=[];for(var s in a){var p=a[s];f.push(h),h=r._writeHeader(d,h,s,p,0)}var g=0,m=h;for(var s in a)p=a[s],f.push(h),h=r._writeHeader(d,h,s,p,1,f[g++]);var v=h-m;return i(d,h,101010256),h+=4,o(d,h+=4,g),o(d,h+=2,g),i(d,h+=2,v),i(d,h+=4,m),h+=4,h+=2,d.buffer},r._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},r._writeHeader=function(e,t,n,i,o,a){var s=r.bin.writeUint,l=r.bin.writeUshort,c=i.file;return s(e,t,0==o?67324752:33639248),t+=4,1==o&&(t+=2),l(e,t,20),l(e,t+=2,0),l(e,t+=2,i.cpr?8:0),s(e,t+=2,0),s(e,t+=4,i.crc),s(e,t+=4,c.length),s(e,t+=4,i.usize),l(e,t+=4,r.bin.sizeUTF8(n)),l(e,t+=2,0),t+=2,1==o&&(t+=2,t+=2,s(e,t+=6,a),t+=4),t+=r.bin.writeUTF8(e,t,n),0==o&&(e.set(c,t),t+=c.length),t},r.crc={table:function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var r=t,n=0;n<8;n++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update:function(e,t,n,i){for(var o=0;o<i;o++)e=r.crc.table[255&(e^t[n+o])]^e>>>8;return e},crc:function(e,t,n){return 4294967295^r.crc.update(4294967295,e,t,n)}},r.adler=function(e,t,r){for(var n=1,i=0,o=t,a=t+r;o<a;){for(var s=Math.min(o+5552,a);o<s;)i+=n+=e[o++];n%=65521,i%=65521}return i<<16|n},r.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255},readASCII:function(e,t,r){for(var n="",i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII:function(e,t,r){for(var n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,n){for(var i,o="",a=0;a<n;a++)o+="%"+r.bin.pad(e[t+a].toString(16));try{i=decodeURIComponent(o)}catch(i){return r.bin.readASCII(e,t,n)}return i},writeUTF8:function(e,t,r){for(var n=r.length,i=0,o=0;o<n;o++){var a=r.charCodeAt(o);if(4294967168&a)if(4294965248&a)if(4294901760&a){if(4292870144&a)throw"e";e[t+i]=240|a>>18,e[t+i+1]=128|a>>12&63,e[t+i+2]=128|a>>6&63,e[t+i+3]=128|63&a,i+=4}else e[t+i]=224|a>>12,e[t+i+1]=128|a>>6&63,e[t+i+2]=128|63&a,i+=3;else e[t+i]=192|a>>6,e[t+i+1]=128|63&a,i+=2;else e[t+i]=a,i++}return i},sizeUTF8:function(e){for(var t=e.length,r=0,n=0;n<t;n++){var i=e.charCodeAt(n);if(4294967168&i)if(4294965248&i)if(4294901760&i){if(4292870144&i)throw"e";r+=4}else r+=3;else r+=2;else r++}return r}},r.F={},r.F.deflateRaw=function(e,t,n,i){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],a=r.F.U,s=r.F._goodIndex;r.F._hash;var l=r.F._putsE,c=0,u=n<<3,d=0,h=e.length;if(0==i){for(;c<h;)l(t,u,c+(S=Math.min(65535,h-c))==h?1:0),u=r.F._copyExact(e,c,S,t,u+8),c+=S;return u>>>3}var f=a.lits,p=a.strt,g=a.prev,m=0,v=0,y=0,b=0,w=0,x=0;for(h>2&&(p[x=r.F._hash(e,0)]=0),c=0;c<h;c++){if(w=x,c+1<h-2){x=r.F._hash(e,c+1);var C=c+1&32767;g[C]=p[x],p[x]=C}if(d<=c){(m>14e3||v>26697)&&h-c>100&&(d<c&&(f[m]=c-d,m+=2,d=c),u=r.F._writeBlock(c==h-1||d==h?1:0,f,m,b,e,y,c-y,t,u),m=v=b=0,y=c);var _=0;c<h-2&&(_=r.F._bestMatch(e,c,g,w,Math.min(o[2],h-c),o[3]));var S=_>>>16,A=65535&_;if(0!=_){A=65535&_;var k=s(S=_>>>16,a.of0);a.lhst[257+k]++;var E=s(A,a.df0);a.dhst[E]++,b+=a.exb[k]+a.dxb[E],f[m]=S<<23|c-d,f[m+1]=A<<16|k<<8|E,m+=2,d=c+S}else a.lhst[e[c]]++;v++}}for(y==c&&0!=e.length||(d<c&&(f[m]=c-d,m+=2,d=c),u=r.F._writeBlock(1,f,m,b,e,y,c-y,t,u),m=0,v=0,m=v=b=0,y=c);7&u;)u++;return u>>>3},r.F._bestMatch=function(e,t,n,i,o,a){var s=32767&t,l=n[s],c=s-l+32768&32767;if(l==s||i!=r.F._hash(e,t-c))return 0;for(var u=0,d=0,h=Math.min(32767,t);c<=h&&0!=--a&&l!=s;){if(0==u||e[t+u]==e[t+u-c]){var f=r.F._howLong(e,t,c);if(f>u){if(d=c,(u=f)>=o)break;c+2<f&&(f=c+2);for(var p=0,g=0;g<f-2;g++){var m=t-c+g+32768&32767,v=m-n[m]+32768&32767;v>p&&(p=v,l=m)}}}c+=(s=l)-(l=n[s])+32768&32767}return u<<16|d},r.F._howLong=function(e,t,r){if(e[t]!=e[t-r]||e[t+1]!=e[t+1-r]||e[t+2]!=e[t+2-r])return 0;var n=t,i=Math.min(e.length,t+258);for(t+=3;t<i&&e[t]==e[t-r];)t++;return t-n},r.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(e,t,n,i,o,a,s,l,c){var u,d,h,f,p,g,m,v,y,b=r.F.U,w=r.F._putsF,x=r.F._putsE;b.lhst[256]++,d=(u=r.F.getTrees())[0],h=u[1],f=u[2],p=u[3],g=u[4],m=u[5],v=u[6],y=u[7];var C=32+(c+3&7?8-(c+3&7):0)+(s<<3),_=i+r.F.contSize(b.fltree,b.lhst)+r.F.contSize(b.fdtree,b.dhst),S=i+r.F.contSize(b.ltree,b.lhst)+r.F.contSize(b.dtree,b.dhst);S+=14+3*m+r.F.contSize(b.itree,b.ihst)+(2*b.ihst[16]+3*b.ihst[17]+7*b.ihst[18]);for(var A=0;A<286;A++)b.lhst[A]=0;for(A=0;A<30;A++)b.dhst[A]=0;for(A=0;A<19;A++)b.ihst[A]=0;var k=C<_&&C<S?0:_<S?1:2;if(w(l,c,e),w(l,c+1,k),c+=3,0==k){for(;7&c;)c++;c=r.F._copyExact(o,a,s,l,c)}else{var E,I;if(1==k&&(E=b.fltree,I=b.fdtree),2==k){r.F.makeCodes(b.ltree,d),r.F.revCodes(b.ltree,d),r.F.makeCodes(b.dtree,h),r.F.revCodes(b.dtree,h),r.F.makeCodes(b.itree,f),r.F.revCodes(b.itree,f),E=b.ltree,I=b.dtree,x(l,c,p-257),x(l,c+=5,g-1),x(l,c+=5,m-4),c+=4;for(var j=0;j<m;j++)x(l,c+3*j,b.itree[1+(b.ordr[j]<<1)]);c+=3*m,c=r.F._codeTiny(v,b.itree,l,c),c=r.F._codeTiny(y,b.itree,l,c)}for(var T=a,F=0;F<n;F+=2){for(var O=t[F],M=O>>>23,P=T+(8388607&O);T<P;)c=r.F._writeLit(o[T++],E,l,c);if(0!=M){var R=t[F+1],L=R>>16,N=R>>8&255,D=255&R;x(l,c=r.F._writeLit(257+N,E,l,c),M-b.of0[N]),c+=b.exb[N],w(l,c=r.F._writeLit(D,I,l,c),L-b.df0[D]),c+=b.dxb[D],T+=M}}c=r.F._writeLit(256,E,l,c)}return c},r.F._copyExact=function(e,t,r,n,i){var o=i>>>3;return n[o]=r,n[o+1]=r>>>8,n[o+2]=255-n[o],n[o+3]=255-n[o+1],o+=4,n.set(new Uint8Array(e.buffer,t,r),o),i+(r+4<<3)},r.F.getTrees=function(){for(var e=r.F.U,t=r.F._hufTree(e.lhst,e.ltree,15),n=r.F._hufTree(e.dhst,e.dtree,15),i=[],o=r.F._lenCodes(e.ltree,i),a=[],s=r.F._lenCodes(e.dtree,a),l=0;l<i.length;l+=2)e.ihst[i[l]]++;for(l=0;l<a.length;l+=2)e.ihst[a[l]]++;for(var c=r.F._hufTree(e.ihst,e.itree,7),u=19;u>4&&0==e.itree[1+(e.ordr[u-1]<<1)];)u--;return[t,n,c,o,s,u,i,a]},r.F.getSecond=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(e[r+1]);return t},r.F.nonZero=function(e){for(var t="",r=0;r<e.length;r+=2)0!=e[r+1]&&(t+=(r>>1)+",");return t},r.F.contSize=function(e,t){for(var r=0,n=0;n<t.length;n++)r+=t[n]*e[1+(n<<1)];return r},r.F._codeTiny=function(e,t,n,i){for(var o=0;o<e.length;o+=2){var a=e[o],s=e[o+1];i=r.F._writeLit(a,t,n,i);var l=16==a?2:17==a?3:7;a>15&&(r.F._putsE(n,i,s,l),i+=l)}return i},r.F._lenCodes=function(e,t){for(var r=e.length;2!=r&&0==e[r-1];)r-=2;for(var n=0;n<r;n+=2){var i=e[n+1],o=n+3<r?e[n+3]:-1,a=n+5<r?e[n+5]:-1,s=0==n?-1:e[n-1];if(0==i&&o==i&&a==i){for(var l=n+5;l+2<r&&e[l+2]==i;)l+=2;(c=Math.min(l+1-n>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),n+=2*c-2}else if(i==s&&o==i&&a==i){for(l=n+5;l+2<r&&e[l+2]==i;)l+=2;var c=Math.min(l+1-n>>>1,6);t.push(16,c-3),n+=2*c-2}else t.push(i,0)}return r>>>1},r.F._hufTree=function(e,t,n){var i=[],o=e.length,a=t.length,s=0;for(s=0;s<a;s+=2)t[s]=0,t[s+1]=0;for(s=0;s<o;s++)0!=e[s]&&i.push({lit:s,f:e[s]});var l=i.length,c=i.slice(0);if(0==l)return 0;if(1==l){var u=i[0].lit;return c=0==u?1:0,t[1+(u<<1)]=1,t[1+(c<<1)]=1,1}i.sort(function(e,t){return e.f-t.f});var d=i[0],h=i[1],f=0,p=1,g=2;for(i[0]={lit:-1,f:d.f+h.f,l:d,r:h,d:0};p!=l-1;)d=f!=p&&(g==l||i[f].f<i[g].f)?i[f++]:i[g++],h=f!=p&&(g==l||i[f].f<i[g].f)?i[f++]:i[g++],i[p++]={lit:-1,f:d.f+h.f,l:d,r:h};var m=r.F.setDepth(i[p-1],0);for(m>n&&(r.F.restrictDepth(c,n,m),m=n),s=0;s<l;s++)t[1+(c[s].lit<<1)]=c[s].d;return m},r.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(r.F.setDepth(e.l,t+1),r.F.setDepth(e.r,t+1))},r.F.restrictDepth=function(e,t,r){var n=0,i=1<<r-t,o=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),n=0;n<e.length&&e[n].d>t;n++){var a=e[n].d;e[n].d=t,o+=i-(1<<r-a)}for(o>>>=r-t;o>0;)(a=e[n].d)<t?(e[n].d++,o-=1<<t-a-1):n++;for(;n>=0;n--)e[n].d==t&&o<0&&(e[n].d--,o++)},r.F._goodIndex=function(e,t){var r=0;return t[16|r]<=e&&(r|=16),t[8|r]<=e&&(r|=8),t[4|r]<=e&&(r|=4),t[2|r]<=e&&(r|=2),t[1|r]<=e&&(r|=1),r},r.F._writeLit=function(e,t,n,i){return r.F._putsF(n,i,t[e<<1]),i+t[1+(e<<1)]},r.F.inflate=function(e,t){var n=Uint8Array;if(3==e[0]&&0==e[1])return t||new n(0);var i=r.F,o=i._bitsF,a=i._bitsE,s=i._decodeTiny,l=i.makeCodes,c=i.codes2map,u=i._get17,d=i.U,h=null==t;h&&(t=new n(e.length>>>2<<3));for(var f,p,g=0,m=0,v=0,y=0,b=0,w=0,x=0,C=0,_=0;0==g;)if(g=o(e,_,1),m=o(e,_+1,2),_+=3,0!=m){if(h&&(t=r.F._check(t,C+(1<<17))),1==m&&(f=d.flmap,p=d.fdmap,w=511,x=31),2==m){v=a(e,_,5)+257,y=a(e,_+5,5)+1,b=a(e,_+10,4)+4,_+=14;for(var S=0;S<38;S+=2)d.itree[S]=0,d.itree[S+1]=0;var A=1;for(S=0;S<b;S++){var k=a(e,_+3*S,3);d.itree[1+(d.ordr[S]<<1)]=k,k>A&&(A=k)}_+=3*b,l(d.itree,A),c(d.itree,A,d.imap),f=d.lmap,p=d.dmap,_=s(d.imap,(1<<A)-1,v+y,e,_,d.ttree);var E=i._copyOut(d.ttree,0,v,d.ltree);w=(1<<E)-1;var I=i._copyOut(d.ttree,v,y,d.dtree);x=(1<<I)-1,l(d.ltree,E),c(d.ltree,E,f),l(d.dtree,I),c(d.dtree,I,p)}for(;;){var j=f[u(e,_)&w];_+=15&j;var T=j>>>4;if(T>>>8==0)t[C++]=T;else{if(256==T)break;var F=C+T-254;if(T>264){var O=d.ldef[T-257];F=C+(O>>>3)+a(e,_,7&O),_+=7&O}var M=p[u(e,_)&x];_+=15&M;var P=M>>>4,R=d.ddef[P],L=(R>>>4)+o(e,_,15&R);for(_+=15&R,h&&(t=r.F._check(t,C+(1<<17)));C<F;)t[C]=t[C++-L],t[C]=t[C++-L],t[C]=t[C++-L],t[C]=t[C++-L];C=F}}}else{7&_&&(_+=8-(7&_));var N=4+(_>>>3),D=e[N-4]|e[N-3]<<8;h&&(t=r.F._check(t,C+D)),t.set(new n(e.buffer,e.byteOffset+N,D),C),_=N+D<<3,C+=D}return t.length==C?t:t.slice(0,C)},r.F._check=function(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n},r.F._decodeTiny=function(e,t,n,i,o,a){for(var s=r.F._bitsE,l=r.F._get17,c=0;c<n;){var u=e[l(i,o)&t];o+=15&u;var d=u>>>4;if(d<=15)a[c]=d,c++;else{var h=0,f=0;16==d?(f=3+s(i,o,2),o+=2,h=a[c-1]):17==d?(f=3+s(i,o,3),o+=3):18==d&&(f=11+s(i,o,7),o+=7);for(var p=c+f;c<p;)a[c]=h,c++}}return o},r.F._copyOut=function(e,t,r,n){for(var i=0,o=0,a=n.length>>>1;o<r;){var s=e[o+t];n[o<<1]=0,n[1+(o<<1)]=s,s>i&&(i=s),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},r.F.makeCodes=function(e,t){for(var n,i,o,a,s=r.F.U,l=e.length,c=s.bl_count,u=0;u<=t;u++)c[u]=0;for(u=1;u<l;u+=2)c[e[u]]++;var d=s.next_code;for(n=0,c[0]=0,i=1;i<=t;i++)n=n+c[i-1]<<1,d[i]=n;for(o=0;o<l;o+=2)0!=(a=e[o+1])&&(e[o]=d[a],d[a]++)},r.F.codes2map=function(e,t,n){for(var i=e.length,o=r.F.U.rev15,a=0;a<i;a+=2)if(0!=e[a+1])for(var s=a>>1,l=e[a+1],c=s<<4|l,u=t-l,d=e[a]<<u,h=d+(1<<u);d!=h;)n[o[d]>>>15-t]=c,d++},r.F.revCodes=function(e,t){for(var n=r.F.U.rev15,i=15-t,o=0;o<e.length;o+=2){var a=e[o]<<t-e[o+1];e[o]=n[a]>>>i}},r.F._putsE=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},r.F._putsF=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},r.F._bitsE=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},r.F._bitsF=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=r.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function i(e,t,r){for(;0!=t--;)e.push(0,r)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),i(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()}();var Oo=function(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}({__proto__:null,default:To},[To]);const Mo=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,r){e[t]=r>>8&255,e[t+1]=255&r},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},readASCII(e,t,r){let n="";for(let i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},readBytes(e,t,r){const n=[];for(let i=0;i<r;i++)n.push(e[t+i]);return n},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,r,n){let i,o="";for(let a=0;a<n;a++)o+=`%${e.pad(t[r+a].toString(16))}`;try{i=decodeURIComponent(o)}catch(i){return e.readASCII(t,r,n)}return i}};function t(t,r,n,i){const a=r*n,s=o(i),l=Math.ceil(r*s/8),c=new Uint8Array(4*a),u=new Uint32Array(c.buffer),{ctype:d}=i,{depth:h}=i,f=e.readUshort;if(6==d){const e=a<<2;if(8==h)for(var p=0;p<e;p+=4)c[p]=t[p],c[p+1]=t[p+1],c[p+2]=t[p+2],c[p+3]=t[p+3];if(16==h)for(p=0;p<e;p++)c[p]=t[p<<1]}else if(2==d){const e=i.tabs.tRNS;if(null==e){if(8==h)for(p=0;p<a;p++){var g=3*p;u[p]=255<<24|t[g+2]<<16|t[g+1]<<8|t[g]}if(16==h)for(p=0;p<a;p++)g=6*p,u[p]=255<<24|t[g+4]<<16|t[g+2]<<8|t[g]}else{var m=e[0];const r=e[1],n=e[2];if(8==h)for(p=0;p<a;p++){var v=p<<2;g=3*p,u[p]=255<<24|t[g+2]<<16|t[g+1]<<8|t[g],t[g]==m&&t[g+1]==r&&t[g+2]==n&&(c[v+3]=0)}if(16==h)for(p=0;p<a;p++)v=p<<2,g=6*p,u[p]=255<<24|t[g+4]<<16|t[g+2]<<8|t[g],f(t,g)==m&&f(t,g+2)==r&&f(t,g+4)==n&&(c[v+3]=0)}}else if(3==d){const e=i.tabs.PLTE,o=i.tabs.tRNS,s=o?o.length:0;if(1==h)for(var y=0;y<n;y++){var b=y*l,w=y*r;for(p=0;p<r;p++){v=w+p<<2;var x=3*(C=t[b+(p>>3)]>>7-(7&p)&1);c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255}}if(2==h)for(y=0;y<n;y++)for(b=y*l,w=y*r,p=0;p<r;p++)v=w+p<<2,x=3*(C=t[b+(p>>2)]>>6-((3&p)<<1)&3),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255;if(4==h)for(y=0;y<n;y++)for(b=y*l,w=y*r,p=0;p<r;p++)v=w+p<<2,x=3*(C=t[b+(p>>1)]>>4-((1&p)<<2)&15),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255;if(8==h)for(p=0;p<a;p++){var C;v=p<<2,x=3*(C=t[p]),c[v]=e[x],c[v+1]=e[x+1],c[v+2]=e[x+2],c[v+3]=C<s?o[C]:255}}else if(4==d){if(8==h)for(p=0;p<a;p++){v=p<<2;var _=t[S=p<<1];c[v]=_,c[v+1]=_,c[v+2]=_,c[v+3]=t[S+1]}if(16==h)for(p=0;p<a;p++){var S;v=p<<2,_=t[S=p<<2],c[v]=_,c[v+1]=_,c[v+2]=_,c[v+3]=t[S+2]}}else if(0==d)for(m=i.tabs.tRNS?i.tabs.tRNS:-1,y=0;y<n;y++){const e=y*l,n=y*r;if(1==h)for(var A=0;A<r;A++){var k=(_=255*(t[e+(A>>>3)]>>>7-(7&A)&1))==255*m?0:255;u[n+A]=k<<24|_<<16|_<<8|_}else if(2==h)for(A=0;A<r;A++)k=(_=85*(t[e+(A>>>2)]>>>6-((3&A)<<1)&3))==85*m?0:255,u[n+A]=k<<24|_<<16|_<<8|_;else if(4==h)for(A=0;A<r;A++)k=(_=17*(t[e+(A>>>1)]>>>4-((1&A)<<2)&15))==17*m?0:255,u[n+A]=k<<24|_<<16|_<<8|_;else if(8==h)for(A=0;A<r;A++)k=(_=t[e+A])==m?0:255,u[n+A]=k<<24|_<<16|_<<8|_;else if(16==h)for(A=0;A<r;A++)_=t[e+(A<<1)],k=f(t,e+(A<<1))==m?0:255,u[n+A]=k<<24|_<<16|_<<8|_}return c}function r(e,t,r,s){const l=o(e),c=Math.ceil(r*l/8),u=new Uint8Array((c+1+e.interlace)*s);return t=e.tabs.CgBI?i(t,u):n(t,u),0==e.interlace?t=a(t,e,0,r,s):1==e.interlace&&(t=function(e,t){const r=t.width,n=t.height,i=o(t),s=i>>3,l=Math.ceil(r*i/8),c=new Uint8Array(n*l);let u=0;const d=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],f=[8,8,8,4,4,2,2],p=[8,8,4,4,2,2,1];let g=0;for(;g<7;){const o=f[g],v=p[g];let y=0,b=0,w=d[g];for(;w<n;)w+=o,b++;let x=h[g];for(;x<r;)x+=v,y++;const C=Math.ceil(y*i/8);a(e,t,u,y,b);let _=0,S=d[g];for(;S<n;){let t=h[g],n=u+_*C<<3;for(;t<r;){var m;if(1==i&&(m=(m=e[n>>3])>>7-(7&n)&1,c[S*l+(t>>3)]|=m<<7-(7&t)),2==i&&(m=(m=e[n>>3])>>6-(7&n)&3,c[S*l+(t>>2)]|=m<<6-((3&t)<<1)),4==i&&(m=(m=e[n>>3])>>4-(7&n)&15,c[S*l+(t>>1)]|=m<<4-((1&t)<<2)),i>=8){const r=S*l+t*s;for(let t=0;t<s;t++)c[r+t]=e[(n>>3)+t]}n+=i,t+=v}_++,S+=o}y*b!=0&&(u+=b*(1+C)),g+=1}return c}(t,e)),t}function n(e,t){return i(new Uint8Array(e.buffer,2,e.length-6),t)}var i=function(){const e={H:{}};return e.H.N=function(t,r){const n=Uint8Array;let i,o,a=0,s=0,l=0,c=0,u=0,d=0,h=0,f=0,p=0;if(3==t[0]&&0==t[1])return r||new n(0);const g=e.H,m=g.b,v=g.e,y=g.R,b=g.n,w=g.A,x=g.Z,C=g.m,_=null==r;for(_&&(r=new n(t.length>>>2<<5));0==a;)if(a=m(t,p,1),s=m(t,p+1,2),p+=3,0!=s){if(_&&(r=e.H.W(r,f+(1<<17))),1==s&&(i=C.J,o=C.h,d=511,h=31),2==s){l=v(t,p,5)+257,c=v(t,p+5,5)+1,u=v(t,p+10,4)+4,p+=14;let e=1;for(var S=0;S<38;S+=2)C.Q[S]=0,C.Q[S+1]=0;for(S=0;S<u;S++){const r=v(t,p+3*S,3);C.Q[1+(C.X[S]<<1)]=r,r>e&&(e=r)}p+=3*u,b(C.Q,e),w(C.Q,e,C.u),i=C.w,o=C.d,p=y(C.u,(1<<e)-1,l+c,t,p,C.v);const r=g.V(C.v,0,l,C.C);d=(1<<r)-1;const n=g.V(C.v,l,c,C.D);h=(1<<n)-1,b(C.C,r),w(C.C,r,i),b(C.D,n),w(C.D,n,o)}for(;;){const e=i[x(t,p)&d];p+=15&e;const n=e>>>4;if(n>>>8==0)r[f++]=n;else{if(256==n)break;{let e=f+n-254;if(n>264){const r=C.q[n-257];e=f+(r>>>3)+v(t,p,7&r),p+=7&r}const i=o[x(t,p)&h];p+=15&i;const a=i>>>4,s=C.c[a],l=(s>>>4)+m(t,p,15&s);for(p+=15&s;f<e;)r[f]=r[f++-l],r[f]=r[f++-l],r[f]=r[f++-l],r[f]=r[f++-l];f=e}}}}else{7&p&&(p+=8-(7&p));const i=4+(p>>>3),o=t[i-4]|t[i-3]<<8;_&&(r=e.H.W(r,f+o)),r.set(new n(t.buffer,t.byteOffset+i,o),f),p=i+o<<3,f+=o}return r.length==f?r:r.slice(0,f)},e.H.W=function(e,t){const r=e.length;if(t<=r)return e;const n=new Uint8Array(r<<1);return n.set(e,0),n},e.H.R=function(t,r,n,i,o,a){const s=e.H.e,l=e.H.Z;let c=0;for(;c<n;){const e=t[l(i,o)&r];o+=15&e;const n=e>>>4;if(n<=15)a[c]=n,c++;else{let e=0,t=0;16==n?(t=3+s(i,o,2),o+=2,e=a[c-1]):17==n?(t=3+s(i,o,3),o+=3):18==n&&(t=11+s(i,o,7),o+=7);const r=c+t;for(;c<r;)a[c]=e,c++}}return o},e.H.V=function(e,t,r,n){let i=0,o=0;const a=n.length>>>1;for(;o<r;){const r=e[o+t];n[o<<1]=0,n[1+(o<<1)]=r,r>i&&(i=r),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},e.H.n=function(t,r){const n=e.H.m,i=t.length;let o,a,s,l;const c=n.j;for(var u=0;u<=r;u++)c[u]=0;for(u=1;u<i;u+=2)c[t[u]]++;const d=n.K;for(o=0,c[0]=0,a=1;a<=r;a++)o=o+c[a-1]<<1,d[a]=o;for(s=0;s<i;s+=2)l=t[s+1],0!=l&&(t[s]=d[l],d[l]++)},e.H.A=function(t,r,n){const i=t.length,o=e.H.m.r;for(let e=0;e<i;e+=2)if(0!=t[e+1]){const i=e>>1,a=t[e+1],s=i<<4|a,l=r-a;let c=t[e]<<l;const u=c+(1<<l);for(;c!=u;)n[o[c]>>>15-r]=s,c++}},e.H.l=function(t,r){const n=e.H.m.r,i=15-r;for(let e=0;e<t.length;e+=2){const o=t[e]<<r-t[e+1];t[e]=n[o]>>>i}},e.H.M=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},e.H.I=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},e.H.e=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},e.H.b=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var r=0;r<32768;r++){let e=r;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[r]=(e>>>16|e<<16)>>>17}function n(e,t,r){for(;0!=t--;)e.push(0,r)}for(r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];n(t._,144,8),n(t._,112,9),n(t._,24,7),n(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),n(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),n(t.Q,19,0),n(t.C,286,0),n(t.D,30,0),n(t.v,320,0)}(),e.H.N}();function o(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function a(e,t,r,n,i){let a=o(t);const l=Math.ceil(n*a/8);let c,u;a=Math.ceil(a/8);let d=e[r],h=0;if(d>1&&(e[r]=[0,0,1][d-2]),3==d)for(h=a;h<l;h++)e[h+1]=e[h+1]+(e[h+1-a]>>>1)&255;for(let o=0;o<i;o++)if(c=r+o*l,u=c+o+1,d=e[u-1],h=0,0==d)for(;h<l;h++)e[c+h]=e[u+h];else if(1==d){for(;h<a;h++)e[c+h]=e[u+h];for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-a]}else if(2==d)for(;h<l;h++)e[c+h]=e[u+h]+e[c+h-l];else if(3==d){for(;h<a;h++)e[c+h]=e[u+h]+(e[c+h-l]>>>1);for(;h<l;h++)e[c+h]=e[u+h]+(e[c+h-l]+e[c+h-a]>>>1)}else{for(;h<a;h++)e[c+h]=e[u+h]+s(0,e[c+h-l],0);for(;h<l;h++)e[c+h]=e[u+h]+s(e[c+h-a],e[c+h-l],e[c+h-a-l])}return e}function s(e,t,r){const n=e+t-r,i=n-e,o=n-t,a=n-r;return i*i<=o*o&&i*i<=a*a?e:o*o<=a*a?t:r}function l(t,r,n){n.width=e.readUint(t,r),r+=4,n.height=e.readUint(t,r),r+=4,n.depth=t[r],r++,n.ctype=t[r],r++,n.compress=t[r],r++,n.filter=t[r],r++,n.interlace=t[r],r++}function c(e,t,r,n,i,o,a,s,l){const c=Math.min(t,i),u=Math.min(r,o);let d=0,h=0;for(let x=0;x<u;x++)for(let r=0;r<c;r++)if(a>=0&&s>=0?(d=x*t+r<<2,h=(s+x)*i+a+r<<2):(d=(-s+x)*t-a+r<<2,h=x*i+r<<2),0==l)n[h]=e[d],n[h+1]=e[d+1],n[h+2]=e[d+2],n[h+3]=e[d+3];else if(1==l){var f=e[d+3]*(1/255),p=e[d]*f,g=e[d+1]*f,m=e[d+2]*f,v=n[h+3]*(1/255),y=n[h]*v,b=n[h+1]*v,w=n[h+2]*v;const t=1-f,r=f+v*t,i=0==r?0:1/r;n[h+3]=255*r,n[h+0]=(p+y*t)*i,n[h+1]=(g+b*t)*i,n[h+2]=(m+w*t)*i}else if(2==l)f=e[d+3],p=e[d],g=e[d+1],m=e[d+2],v=n[h+3],y=n[h],b=n[h+1],w=n[h+2],f==v&&p==y&&g==b&&m==w?(n[h]=0,n[h+1]=0,n[h+2]=0,n[h+3]=0):(n[h]=p,n[h+1]=g,n[h+2]=m,n[h+3]=f);else if(3==l){if(f=e[d+3],p=e[d],g=e[d+1],m=e[d+2],v=n[h+3],y=n[h],b=n[h+1],w=n[h+2],f==v&&p==y&&g==b&&m==w)continue;if(f<220&&v>20)return!1}return!0}return{decode:function(t){const o=new Uint8Array(t);let a=8;const s=e,c=s.readUshort,u=s.readUint,d={tabs:{},frames:[]},h=new Uint8Array(o.length);let f,p=0,g=0;const m=[137,80,78,71,13,10,26,10];for(var v=0;v<8;v++)if(o[v]!=m[v])throw"The input is not a PNG file!";for(;a<o.length;){const t=s.readUint(o,a);a+=4;const m=s.readASCII(o,a,4);if(a+=4,"IHDR"==m)l(o,a,d);else if("iCCP"==m){for(var y=a;0!=o[y];)y++;s.readASCII(o,a,y-a),o[y+1];const r=o.slice(y+2,a+t);let l=null;try{l=n(r)}catch(e){l=i(r)}d.tabs[m]=l}else if("CgBI"==m)d.tabs[m]=o.slice(a,a+4);else if("IDAT"==m){for(v=0;v<t;v++)h[p+v]=o[a+v];p+=t}else if("acTL"==m)d.tabs[m]={num_frames:u(o,a),num_plays:u(o,a+4)},f=new Uint8Array(o.length);else if("fcTL"==m){0!=g&&((S=d.frames[d.frames.length-1]).data=r(d,f.slice(0,g),S.rect.width,S.rect.height),g=0);const e={x:u(o,a+12),y:u(o,a+16),width:u(o,a+4),height:u(o,a+8)};let t=c(o,a+22);t=c(o,a+20)/(0==t?100:t);const n={rect:e,delay:Math.round(1e3*t),dispose:o[a+24],blend:o[a+25]};d.frames.push(n)}else if("fdAT"==m){for(v=0;v<t-4;v++)f[g+v]=o[a+v+4];g+=t-4}else if("pHYs"==m)d.tabs[m]=[s.readUint(o,a),s.readUint(o,a+4),o[a+8]];else if("cHRM"==m)for(d.tabs[m]=[],v=0;v<8;v++)d.tabs[m].push(s.readUint(o,a+4*v));else if("tEXt"==m||"zTXt"==m){null==d.tabs[m]&&(d.tabs[m]={});var b=s.nextZero(o,a),w=s.readASCII(o,a,b-a),x=a+t-b-1;if("tEXt"==m)_=s.readASCII(o,b+1,x);else{var C=n(o.slice(b+2,b+2+x));_=s.readUTF8(C,0,C.length)}d.tabs[m][w]=_}else if("iTXt"==m){null==d.tabs[m]&&(d.tabs[m]={}),b=0,y=a,b=s.nextZero(o,y),w=s.readASCII(o,y,b-y);const e=o[y=b+1];var _;o[y+1],y+=2,b=s.nextZero(o,y),s.readASCII(o,y,b-y),y=b+1,b=s.nextZero(o,y),s.readUTF8(o,y,b-y),x=t-((y=b+1)-a),0==e?_=s.readUTF8(o,y,x):(C=n(o.slice(y,y+x)),_=s.readUTF8(C,0,C.length)),d.tabs[m][w]=_}else if("PLTE"==m)d.tabs[m]=s.readBytes(o,a,t);else if("hIST"==m){const e=d.tabs.PLTE.length/3;for(d.tabs[m]=[],v=0;v<e;v++)d.tabs[m].push(c(o,a+2*v))}else if("tRNS"==m)3==d.ctype?d.tabs[m]=s.readBytes(o,a,t):0==d.ctype?d.tabs[m]=c(o,a):2==d.ctype&&(d.tabs[m]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==m)d.tabs[m]=s.readUint(o,a)/1e5;else if("sRGB"==m)d.tabs[m]=o[a];else if("bKGD"==m)0==d.ctype||4==d.ctype?d.tabs[m]=[c(o,a)]:2==d.ctype||6==d.ctype?d.tabs[m]=[c(o,a),c(o,a+2),c(o,a+4)]:3==d.ctype&&(d.tabs[m]=o[a]);else if("IEND"==m)break;a+=t,s.readUint(o,a),a+=4}var S;return 0!=g&&((S=d.frames[d.frames.length-1]).data=r(d,f.slice(0,g),S.rect.width,S.rect.height)),d.data=r(d,h,d.width,d.height),delete d.compress,delete d.interlace,delete d.filter,d},toRGBA8:function(e){const r=e.width,n=e.height;if(null==e.tabs.acTL)return[t(e.data,r,n,e).buffer];const i=[];null==e.frames[0].data&&(e.frames[0].data=e.data);const o=r*n*4,a=new Uint8Array(o),s=new Uint8Array(o),l=new Uint8Array(o);for(let d=0;d<e.frames.length;d++){const h=e.frames[d],f=h.rect.x,p=h.rect.y,g=h.rect.width,m=h.rect.height,v=t(h.data,g,m,e);if(0!=d)for(var u=0;u<o;u++)l[u]=a[u];if(0==h.blend?c(v,g,m,a,r,n,f,p,0):1==h.blend&&c(v,g,m,a,r,n,f,p,1),i.push(a.buffer.slice(0)),0==h.dispose);else if(1==h.dispose)c(s,g,m,a,r,n,f,p,0);else if(2==h.dispose)for(u=0;u<o;u++)a[u]=l[u]}return i},_paeth:s,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=Mo,{_bin:t}=Mo,r=Mo._paeth;var n={table:function(){const e=new Uint32Array(256);for(let t=0;t<256;t++){let r=t;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update(e,t,r,i){for(let o=0;o<i;o++)e=n.table[255&(e^t[r+o])]^e>>>8;return e},crc:(e,t,r)=>4294967295^n.update(4294967295,e,t,r)};function i(e,t,r,n){t[r]+=e[0]*n>>4,t[r+1]+=e[1]*n>>4,t[r+2]+=e[2]*n>>4,t[r+3]+=e[3]*n>>4}function o(e){return Math.max(0,Math.min(255,e))}function a(e,t){const r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function s(e,t,r,n,s,l,c){null==c&&(c=1);const u=n.length,d=[];for(var h=0;h<u;h++){const e=n[h];d.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(h=0;h<u;h++){let e=4294967295;for(var f=0,p=0;p<u;p++){var g=a(d[h],d[p]);p!=h&&g<e&&(e=g,f=p)}}const m=new Uint32Array(s.buffer),v=new Int16Array(t*r*4),y=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<y.length;h++)y[h]=255*((y[h]+.5)/16-.5);for(let w=0;w<r;w++)for(let s=0;s<t;s++){var b;h=4*(w*t+s),2!=c?b=[o(e[h]+v[h]),o(e[h+1]+v[h+1]),o(e[h+2]+v[h+2]),o(e[h+3]+v[h+3])]:(g=y[4*(3&w)+(3&s)],b=[o(e[h]+g),o(e[h+1]+g),o(e[h+2]+g),o(e[h+3]+g)]),f=0;let x=16777215;for(p=0;p<u;p++){const e=a(b,d[p]);e<x&&(x=e,f=p)}const C=d[f],_=[b[0]-C[0],b[1]-C[1],b[2]-C[2],b[3]-C[3]];1==c&&(s!=t-1&&i(_,v,h+4,7),w!=r-1&&(0!=s&&i(_,v,h+4*t-4,3),i(_,v,h+4*t,5),s!=t-1&&i(_,v,h+4*t+4,1))),l[h>>2]=f,m[h>>2]=n[f]}}function l(e,r,i,o,a){null==a&&(a={});const{crc:s}=n,l=t.writeUint,c=t.writeUshort,u=t.writeASCII;let d=8;const h=e.frames.length>1;let f,p=!1,g=33+(h?20:0);if(null!=a.sRGB&&(g+=13),null!=a.pHYs&&(g+=21),null!=a.iCCP&&(f=pako.deflate(a.iCCP),g+=21+f.length+4),3==e.ctype){for(var m=e.plte.length,v=0;v<m;v++)e.plte[v]>>>24!=255&&(p=!0);g+=8+3*m+4+(p?8+1*m+4:0)}for(var y=0;y<e.frames.length;y++)h&&(g+=38),g+=(C=e.frames[y]).cimg.length+12,0!=y&&(g+=4);g+=12;const b=new Uint8Array(g),w=[137,80,78,71,13,10,26,10];for(v=0;v<8;v++)b[v]=w[v];if(l(b,d,13),d+=4,u(b,d,"IHDR"),d+=4,l(b,d,r),d+=4,l(b,d,i),d+=4,b[d]=e.depth,d++,b[d]=e.ctype,d++,b[d]=0,d++,b[d]=0,d++,b[d]=0,d++,l(b,d,s(b,d-17,17)),d+=4,null!=a.sRGB&&(l(b,d,1),d+=4,u(b,d,"sRGB"),d+=4,b[d]=a.sRGB,d++,l(b,d,s(b,d-5,5)),d+=4),null!=a.iCCP){const e=13+f.length;l(b,d,e),d+=4,u(b,d,"iCCP"),d+=4,u(b,d,"ICC profile"),d+=11,d+=2,b.set(f,d),d+=f.length,l(b,d,s(b,d-(e+4),e+4)),d+=4}if(null!=a.pHYs&&(l(b,d,9),d+=4,u(b,d,"pHYs"),d+=4,l(b,d,a.pHYs[0]),d+=4,l(b,d,a.pHYs[1]),d+=4,b[d]=a.pHYs[2],d++,l(b,d,s(b,d-13,13)),d+=4),h&&(l(b,d,8),d+=4,u(b,d,"acTL"),d+=4,l(b,d,e.frames.length),d+=4,l(b,d,null!=a.loop?a.loop:0),d+=4,l(b,d,s(b,d-12,12)),d+=4),3==e.ctype){for(l(b,d,3*(m=e.plte.length)),d+=4,u(b,d,"PLTE"),d+=4,v=0;v<m;v++){const t=3*v,r=e.plte[v],n=255&r,i=r>>>8&255,o=r>>>16&255;b[d+t+0]=n,b[d+t+1]=i,b[d+t+2]=o}if(d+=3*m,l(b,d,s(b,d-3*m-4,3*m+4)),d+=4,p){for(l(b,d,m),d+=4,u(b,d,"tRNS"),d+=4,v=0;v<m;v++)b[d+v]=e.plte[v]>>>24&255;d+=m,l(b,d,s(b,d-m-4,m+4)),d+=4}}let x=0;for(y=0;y<e.frames.length;y++){var C=e.frames[y];h&&(l(b,d,26),d+=4,u(b,d,"fcTL"),d+=4,l(b,d,x++),d+=4,l(b,d,C.rect.width),d+=4,l(b,d,C.rect.height),d+=4,l(b,d,C.rect.x),d+=4,l(b,d,C.rect.y),d+=4,c(b,d,o[y]),d+=2,c(b,d,1e3),d+=2,b[d]=C.dispose,d++,b[d]=C.blend,d++,l(b,d,s(b,d-30,30)),d+=4);const t=C.cimg;l(b,d,(m=t.length)+(0==y?0:4)),d+=4;const r=d;u(b,d,0==y?"IDAT":"fdAT"),d+=4,0!=y&&(l(b,d,x++),d+=4),b.set(t,d),d+=m,l(b,d,s(b,r,d-r)),d+=4}return l(b,d,0),d+=4,u(b,d,"IEND"),d+=4,l(b,d,s(b,d-4,4)),d+=4,b.buffer}function c(e,t,r){for(let n=0;n<e.frames.length;n++){const i=e.frames[n];i.rect.width;const o=i.rect.height,a=new Uint8Array(o*i.bpl+o);i.cimg=f(i.img,o,i.bpp,i.bpl,a,t,r)}}function u(t,r,n,i,o){const a=o[0],l=o[1],c=o[2],u=o[3],f=o[4],p=o[5];let m=6,v=8,y=255;for(var b=0;b<t.length;b++){const e=new Uint8Array(t[b]);for(var w=e.length,x=0;x<w;x+=4)y&=e[x+3]}const C=255!=y,_=function(t,r,n,i,o,a){const s=[];for(var l=0;l<t.length;l++){const d=new Uint8Array(t[l]),f=new Uint32Array(d.buffer);var c;let g=0,m=0,v=r,y=n,b=i?1:0;if(0!=l){const w=a||i||1==l||0!=s[l-2].dispose?1:2;let x=0,C=1e9;for(let e=0;e<w;e++){var u=new Uint8Array(t[l-1-e]);const i=new Uint32Array(t[l-1-e]);let a=r,s=n,c=-1,d=-1;for(let e=0;e<n;e++)for(let t=0;t<r;t++)f[p=e*r+t]!=i[p]&&(t<a&&(a=t),t>c&&(c=t),e<s&&(s=e),e>d&&(d=e));-1==c&&(a=s=c=d=0),o&&(!(1&~a)&&a--,!(1&~s)&&s--);const h=(c-a+1)*(d-s+1);h<C&&(C=h,x=e,g=a,m=s,v=c-a+1,y=d-s+1)}u=new Uint8Array(t[l-1-x]),1==x&&(s[l-1].dispose=2),c=new Uint8Array(v*y*4),e(u,r,n,c,v,y,-g,-m,0),b=e(d,r,n,c,v,y,-g,-m,3)?1:0,1==b?h(d,r,n,c,{x:g,y:m,width:v,height:y}):e(d,r,n,c,v,y,-g,-m,0)}else c=d.slice(0);s.push({rect:{x:g,y:m,width:v,height:y},img:c,blend:b,dispose:0})}if(i)for(l=0;l<s.length;l++){if(1==(g=s[l]).blend)continue;const e=g.rect,i=s[l-1].rect,a=Math.min(e.x,i.x),c=Math.min(e.y,i.y),u={x:a,y:c,width:Math.max(e.x+e.width,i.x+i.width)-a,height:Math.max(e.y+e.height,i.y+i.height)-c};s[l-1].dispose=1,l-1!=0&&d(t,r,n,s,l-1,u,o),d(t,r,n,s,l,u,o)}let f=0;if(1!=t.length)for(var p=0;p<s.length;p++){var g;f+=(g=s[p]).rect.width*g.rect.height}return s}(t,r,n,a,l,c),S={},A=[],k=[];if(0!=i){const e=[];for(x=0;x<_.length;x++)e.push(_[x].img.buffer);const t=function(e){let t=0;for(var r=0;r<e.length;r++)t+=e[r].byteLength;const n=new Uint8Array(t);let i=0;for(r=0;r<e.length;r++){const t=new Uint8Array(e[r]),o=t.length;for(let e=0;e<o;e+=4){let r=t[e],o=t[e+1],a=t[e+2];const s=t[e+3];0==s&&(r=o=a=0),n[i+e]=r,n[i+e+1]=o,n[i+e+2]=a,n[i+e+3]=s}i+=o}return n.buffer}(e),r=g(t,i);for(x=0;x<r.plte.length;x++)A.push(r.plte[x].est.rgba);let n=0;for(x=0;x<_.length;x++){const e=(I=_[x]).img.length;var E=new Uint8Array(r.inds.buffer,n>>2,e>>2);k.push(E);const t=new Uint8Array(r.abuf,n,e);p&&s(I.img,I.rect.width,I.rect.height,A,t,E),I.img.set(t),n+=e}}else for(b=0;b<_.length;b++){var I=_[b];const e=new Uint32Array(I.img.buffer);var j=I.rect.width;for(w=e.length,E=new Uint8Array(w),k.push(E),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])E[x]=E[x-1];else if(x>j&&t==e[x-j])E[x]=E[x-j];else{let e=S[t];if(null==e&&(S[t]=e=A.length,A.push(t),A.length>=300))break;E[x]=e}}}const T=A.length;for(T<=256&&0==f&&(v=T<=2?1:T<=4?2:T<=16?4:8,v=Math.max(v,u)),b=0;b<_.length;b++){(I=_[b]).rect.x,I.rect.y,j=I.rect.width;const e=I.rect.height;let t=I.img;new Uint32Array(t.buffer);let r=4*j,n=4;if(T<=256&&0==f){r=Math.ceil(v*j/8);var F=new Uint8Array(r*e);const i=k[b];for(let t=0;t<e;t++){x=t*r;const e=t*j;if(8==v)for(var O=0;O<j;O++)F[x+O]=i[e+O];else if(4==v)for(O=0;O<j;O++)F[x+(O>>1)]|=i[e+O]<<4-4*(1&O);else if(2==v)for(O=0;O<j;O++)F[x+(O>>2)]|=i[e+O]<<6-2*(3&O);else if(1==v)for(O=0;O<j;O++)F[x+(O>>3)]|=i[e+O]<<7-1*(7&O)}t=F,m=3,n=1}else if(0==C&&1==_.length){F=new Uint8Array(j*e*3);const i=j*e;for(x=0;x<i;x++){const e=3*x,r=4*x;F[e]=t[r],F[e+1]=t[r+1],F[e+2]=t[r+2]}t=F,m=2,n=3,r=3*j}I.img=t,I.bpl=r,I.bpp=n}return{ctype:m,depth:v,plte:A,frames:_}}function d(t,r,n,i,o,a,s){const l=Uint8Array,c=Uint32Array,u=new l(t[o-1]),d=new c(t[o-1]),f=o+1<t.length?new l(t[o+1]):null,p=new l(t[o]),g=new c(p.buffer);let m=r,v=n,y=-1,b=-1;for(let e=0;e<a.height;e++)for(let t=0;t<a.width;t++){const n=a.x+t,s=a.y+e,l=s*r+n,c=g[l];0==c||0==i[o-1].dispose&&d[l]==c&&(null==f||0!=f[4*l+3])||(n<m&&(m=n),n>y&&(y=n),s<v&&(v=s),s>b&&(b=s))}-1==y&&(m=v=y=b=0),s&&(!(1&~m)&&m--,!(1&~v)&&v--),a={x:m,y:v,width:y-m+1,height:b-v+1};const w=i[o];w.rect=a,w.blend=1,w.img=new Uint8Array(a.width*a.height*4),0==i[o-1].dispose?(e(u,r,n,w.img,a.width,a.height,-a.x,-a.y,0),h(p,r,n,w.img,a)):e(p,r,n,w.img,a.width,a.height,-a.x,-a.y,0)}function h(t,r,n,i,o){e(t,r,n,i,o.width,o.height,-o.x,-o.y,2)}function f(e,t,r,n,i,o,a){const s=[];let l,c=[0,1,2,3,4];-1!=o?c=[o]:(t*n>5e5||1==r)&&(c=[0]),a&&(l={level:0});const u=Oo;for(var d=0;d<c.length;d++){for(let o=0;o<t;o++)p(i,e,o,n,r,c[d]);s.push(u.deflate(i,l))}let h,f=1e9;for(d=0;d<s.length;d++)s[d].length<f&&(h=d,f=s[d].length);return s[h]}function p(e,t,n,i,o,a){const s=n*i;let l=s+n;if(e[l]=a,l++,0==a)if(i<500)for(var c=0;c<i;c++)e[l+c]=t[s+c];else e.set(new Uint8Array(t.buffer,s,i),l);else if(1==a){for(c=0;c<o;c++)e[l+c]=t[s+c];for(c=o;c<i;c++)e[l+c]=t[s+c]-t[s+c-o]+256&255}else if(0==n){for(c=0;c<o;c++)e[l+c]=t[s+c];if(2==a)for(c=o;c<i;c++)e[l+c]=t[s+c];if(3==a)for(c=o;c<i;c++)e[l+c]=t[s+c]-(t[s+c-o]>>1)+256&255;if(4==a)for(c=o;c<i;c++)e[l+c]=t[s+c]-r(t[s+c-o],0,0)+256&255}else{if(2==a)for(c=0;c<i;c++)e[l+c]=t[s+c]+256-t[s+c-i]&255;if(3==a){for(c=0;c<o;c++)e[l+c]=t[s+c]+256-(t[s+c-i]>>1)&255;for(c=o;c<i;c++)e[l+c]=t[s+c]+256-(t[s+c-i]+t[s+c-o]>>1)&255}if(4==a){for(c=0;c<o;c++)e[l+c]=t[s+c]+256-r(0,t[s+c-i],0)&255;for(c=o;c<i;c++)e[l+c]=t[s+c]+256-r(t[s+c-o],t[s+c-i],t[s+c-o-i])&255}}}function g(e,t){const r=new Uint8Array(e),n=r.slice(0),i=new Uint32Array(n.buffer),o=m(n,t),a=o[0],s=o[1],l=r.length,c=new Uint8Array(l>>2);let u;if(r.length<2e7)for(var d=0;d<l;d+=4)u=v(a,h=r[d]*(1/255),f=r[d+1]*(1/255),p=r[d+2]*(1/255),g=r[d+3]*(1/255)),c[d>>2]=u.ind,i[d>>2]=u.est.rgba;else for(d=0;d<l;d+=4){var h=r[d]*(1/255),f=r[d+1]*(1/255),p=r[d+2]*(1/255),g=r[d+3]*(1/255);for(u=a;u.left;)u=y(u.est,h,f,p,g)<=0?u.left:u.right;c[d>>2]=u.ind,i[d>>2]=u.est.rgba}return{abuf:n.buffer,inds:c,plte:s}}function m(e,t,r){null==r&&(r=1e-4);const n=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=x(e,i.i0,i.i1),i.est=C(i.bst);const o=[i];for(;o.length<t;){let t=0,i=0;for(var a=0;a<o.length;a++)o[a].est.L>t&&(t=o[a].est.L,i=a);if(t<r)break;const s=o[i],l=b(e,n,s.i0,s.i1,s.est.e,s.est.eMq255);if(s.i0>=l||s.i1<=l){s.est.L=0;continue}const c={i0:s.i0,i1:l,bst:null,est:null,tdst:0,left:null,right:null};c.bst=x(e,c.i0,c.i1),c.est=C(c.bst);const u={i0:l,i1:s.i1,bst:null,est:null,tdst:0,left:null,right:null};for(u.bst={R:[],m:[],N:s.bst.N-c.bst.N},a=0;a<16;a++)u.bst.R[a]=s.bst.R[a]-c.bst.R[a];for(a=0;a<4;a++)u.bst.m[a]=s.bst.m[a]-c.bst.m[a];u.est=C(u.bst),s.left=c,s.right=u,o[i]=c,o.push(u)}for(o.sort((e,t)=>t.bst.N-e.bst.N),a=0;a<o.length;a++)o[a].ind=a;return[i,o]}function v(e,t,r,n,i){if(null==e.left)return e.tdst=function(e,t,r,n,i){const o=t-e[0],a=r-e[1],s=n-e[2],l=i-e[3];return o*o+a*a+s*s+l*l}(e.est.q,t,r,n,i),e;const o=y(e.est,t,r,n,i);let a=e.left,s=e.right;o>0&&(a=e.right,s=e.left);const l=v(a,t,r,n,i);if(l.tdst<=o*o)return l;const c=v(s,t,r,n,i);return c.tdst<l.tdst?c:l}function y(e,t,r,n,i){const{e:o}=e;return o[0]*t+o[1]*r+o[2]*n+o[3]*i-e.eMq}function b(e,t,r,n,i,o){for(n-=4;r<n;){for(;w(e,r,i)<=o;)r+=4;for(;w(e,n,i)>o;)n-=4;if(r>=n)break;const a=t[r>>2];t[r>>2]=t[n>>2],t[n>>2]=a,r+=4,n-=4}for(;w(e,r,i)>o;)r-=4;return r+4}function w(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]+e[t+3]*r[3]}function x(e,t,r){const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=r-t>>2;for(let a=t;a<r;a+=4){const t=e[a]*(1/255),r=e[a+1]*(1/255),o=e[a+2]*(1/255),s=e[a+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=o,i[3]+=s,n[0]+=t*t,n[1]+=t*r,n[2]+=t*o,n[3]+=t*s,n[5]+=r*r,n[6]+=r*o,n[7]+=r*s,n[10]+=o*o,n[11]+=o*s,n[15]+=s*s}return n[4]=n[1],n[8]=n[2],n[9]=n[6],n[12]=n[3],n[13]=n[7],n[14]=n[11],{R:n,m:i,N:o}}function C(e){const{R:t}=e,{m:r}=e,{N:n}=e,i=r[0],o=r[1],a=r[2],s=r[3],l=0==n?0:1/n,c=[t[0]-i*i*l,t[1]-i*o*l,t[2]-i*a*l,t[3]-i*s*l,t[4]-o*i*l,t[5]-o*o*l,t[6]-o*a*l,t[7]-o*s*l,t[8]-a*i*l,t[9]-a*o*l,t[10]-a*a*l,t[11]-a*s*l,t[12]-s*i*l,t[13]-s*o*l,t[14]-s*a*l,t[15]-s*s*l],u=c,d=_;let h=[Math.random(),Math.random(),Math.random(),Math.random()],f=0,p=0;if(0!=n)for(let m=0;m<16&&(h=d.multVec(u,h),p=Math.sqrt(d.dot(h,h)),h=d.sml(1/p,h),!(0!=m&&Math.abs(p-f)<1e-9));m++)f=p;const g=[i*l,o*l,a*l,s*l];return{Cov:c,q:g,e:h,L:f,eMq255:d.dot(d.sml(255,g),h),eMq:d.dot(h,g),rgba:(Math.round(255*g[3])<<24|Math.round(255*g[2])<<16|Math.round(255*g[1])<<8|Math.round(255*g[0]))>>>0}}var _={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};Mo.encode=function(e,t,r,n,i,o,a){null==n&&(n=0),null==a&&(a=!1);const s=u(e,t,r,n,[!1,!1,!1,0,a,!1]);return c(s,-1),l(s,t,r,i,o)},Mo.encodeLL=function(e,t,r,n,i,o,a,s){const u={ctype:0+(1==n?0:2)+(0==i?0:4),depth:o,frames:[]},d=(n+i)*o,h=d*t;for(let l=0;l<e.length;l++)u.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[l]),blend:0,dispose:1,bpp:Math.ceil(d/8),bpl:Math.ceil(h/8)});return c(u,0,!0),l(u,t,r,a,s)},Mo.encode.compress=u,Mo.encode.dither=s,Mo.quantize=g,Mo.quantize.getKDtree=m,Mo.quantize.getNearest=v}();const Po={toArrayBuffer(e,t){const r=e.width,n=e.height,i=r<<2,o=e.getContext("2d").getImageData(0,0,r,n),a=new Uint32Array(o.data.buffer),s=(32*r+31)/32<<2,l=s*n,c=122+l,u=new ArrayBuffer(c),d=new DataView(u),h=1<<20;let f,p,g,m,v=h,y=0,b=0,w=0;function x(e){d.setUint16(b,e,!0),b+=2}function C(e){d.setUint32(b,e,!0),b+=4}function _(e){b+=e}x(19778),C(c),_(4),C(122),C(108),C(r),C(-n>>>0),x(1),x(32),C(3),C(l),C(2835),C(2835),_(8),C(16711680),C(65280),C(255),C(4278190080),C(1466527264),function e(){for(;y<n&&v>0;){for(m=122+y*s,f=0;f<i;)v--,p=a[w++],g=p>>>24,d.setUint32(m+f,p<<8|g),f+=4;y++}w<a.length?(v=h,setTimeout(e,Po._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var Ro={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Lo={[Ro.CHROME]:16384,[Ro.FIREFOX]:11180,[Ro.DESKTOP_SAFARI]:16384,[Ro.IE]:8192,[Ro.IOS]:4096,[Ro.ETC]:8192};const No="undefined"!=typeof window,Do="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,zo=No&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Bo=(No||Do)&&(zo&&zo.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),Uo=(No||Do)&&(zo&&zo.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function Vo(e,t,r=Date.now()){return new Promise(n=>{const i=e.split(","),o=i[0].match(/:(.*?);/)[1],a=globalThis.atob(i[1]);let s=a.length;const l=new Uint8Array(s);for(;s--;)l[s]=a.charCodeAt(s);const c=new Blob([l],{type:o});c.name=t,c.lastModified=r,n(c)})}function Ho(e){return new Promise((t,r)=>{const n=new Uo;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function Wo(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function $o(){if(void 0!==$o.cachedResult)return $o.cachedResult;let e=Ro.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=Ro.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=Ro.IOS:/Safari/i.test(t)?e=Ro.DESKTOP_SAFARI:/Firefox/i.test(t)?e=Ro.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=Ro.IE),$o.cachedResult=e,$o.cachedResult}function qo(e,t){const r=$o(),n=Lo[r];let i=e,o=t,a=i*o;const s=i>o?o/i:i/o;for(;a>n*n;){const e=(n+i)/2,t=(n+o)/2;e<t?(o=t,i=t*s):(o=e*s,i=e),a=i*o}return{width:i,height:o}}function Go(e,t){let r,n;try{if(r=new OffscreenCanvas(e,t),n=r.getContext("2d"),null===n)throw new Error("getContext of OffscreenCanvas returns null")}catch(e){r=document.createElement("canvas"),n=r.getContext("2d")}return r.width=e,r.height=t,[r,n]}function Yo(e,t){const{width:r,height:n}=qo(e.width,e.height),[i,o]=Go(r,n);return t&&/jpe?g/.test(t)&&(o.fillStyle="white",o.fillRect(0,0,i.width,i.height)),o.drawImage(e,0,0,i.width,i.height),i}function Xo(){return void 0!==Xo.cachedResult||(Xo.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),Xo.cachedResult}function Ko(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=Yo(i,t.fileType||e.type),r([i,o])}catch(e){return n(e)}},s=function(t){try{var r=function(e){try{throw e}catch(e){return n(e)}};try{let t;return Ho(e).then(function(e){try{return t=e,Wo(t).then(function(e){try{return i=e,function(){try{return a()}catch(e){return n(e)}}()}catch(e){return r(e)}},r)}catch(e){return r(e)}},r)}catch(e){r(e)}}catch(e){return n(e)}};try{if(Xo()||[Ro.DESKTOP_SAFARI,Ro.MOBILE_SAFARI].includes($o()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return i=e,a()}catch(e){return s()}},s)}catch(e){s()}})}function Zo(e,t,r,n,i=1){return new Promise(function(o,a){let s;if("image/png"===t){let c,u,d;return c=e.getContext("2d"),({data:u}=c.getImageData(0,0,e.width,e.height)),d=Mo.encode([u.buffer],e.width,e.height,4096*i),s=new Blob([d],{type:t}),s.name=r,s.lastModified=n,l.call(this)}{if("image/bmp"===t)return new Promise(t=>Po.toBlob(e,t)).then(function(e){try{return s=e,s.name=r,s.lastModified=n,h.call(this)}catch(e){return a(e)}}.bind(this),a);{if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then(function(e){try{return s=e,s.name=r,s.lastModified=n,f.call(this)}catch(e){return a(e)}}.bind(this),a);{let p;return p=e.toDataURL(t,i),Vo(p,r,n).then(function(e){try{return s=e,f.call(this)}catch(e){return a(e)}}.bind(this),a)}function f(){return h.call(this)}}function h(){return l.call(this)}}function l(){return o(s)}})}function Qo(e){e.width=0,e.height=0}function Jo(){return new Promise(function(e,t){let r,n,i,o;return void 0!==Jo.cachedResult?e(Jo.cachedResult):Vo("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,Ko(r).then(function(a){try{return n=a[1],Zo(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,Qo(n),Ko(i).then(function(r){try{return o=r[0],Jo.cachedResult=1===o.width&&2===o.height,e(Jo.cachedResult)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)})}function ea(e){return new Promise((t,r)=>{const n=new Uo;n.onload=e=>{const r=new DataView(e.target.result);if(65496!=r.getUint16(0,!1))return t(-2);const n=r.byteLength;let i=2;for(;i<n;){if(r.getUint16(i+2,!1)<=8)return t(-1);const e=r.getUint16(i,!1);if(i+=2,65505==e){if(1165519206!=r.getUint32(i+=2,!1))return t(-1);const e=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,e);const n=r.getUint16(i,e);i+=2;for(let o=0;o<n;o++)if(274==r.getUint16(i+12*o,e))return t(r.getUint16(i+12*o+8,e))}else{if(65280&~e)break;i+=r.getUint16(i,!1)}}return t(-1)},n.onerror=e=>r(e),n.readAsArrayBuffer(e)})}function ta(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:i}=t;let o,a=e;return isFinite(i)&&(r>i||n>i)&&([a,o]=Go(r,n),r>n?(a.width=i,a.height=n/r*i):(a.width=r/n*i,a.height=i),o.drawImage(e,0,0,a.width,a.height),Qo(e)),a}function ra(e,t){const{width:r}=e,{height:n}=e,[i,o]=Go(r,n);switch(t>4&&t<9?(i.width=n,i.height=r):(i.width=r,i.height=n),t){case 2:o.transform(-1,0,0,1,r,0);break;case 3:o.transform(-1,0,0,-1,r,n);break;case 4:o.transform(1,0,0,-1,0,n);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,n,0);break;case 7:o.transform(0,-1,-1,0,n,r);break;case 8:o.transform(0,-1,1,0,0,r)}return o.drawImage(e,0,0,r,n),Qo(e),i}function na(e,t,r=0){return new Promise(function(n,i){let o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S;function A(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function k(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;o=Math.min(Math.max(e,o),100),t.onProgress(o)}return o=r,a=t.maxIteration||10,s=1024*t.maxSizeMB*1024,A(),Ko(e,t).then(function(r){try{return[,l]=r,A(),c=ta(l,t),A(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return ea(e).then(function(e){try{return i=e,o.call(this)}catch(e){return n(e)}}.bind(this),n);function o(){return r(i)}return o.call(this)}).then(function(r){try{return u=r,A(),Jo().then(function(r){try{return d=r?c:ra(c,u),A(),h=t.initialQuality||1,f=t.fileType||e.type,Zo(d,f,e.name,e.lastModified,h).then(function(r){try{{if(p=r,A(),g=p.size>s,m=p.size>e.size,!g&&!m)return k(100),n(p);var o;function E(){if(a--&&(b>s||b>v)){let t,r;return t=S?.95*_.width:_.width,r=S?.95*_.height:_.height,[x,C]=Go(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,Zo(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,Qo(_),_=x,b=w.size,k(Math.min(99,Math.floor((y-b)/(y-s)*100))),E}catch(e){return i(e)}},i)}return[1]}return v=e.size,y=p.size,b=y,_=d,S=!t.alwaysKeepResolution&&g,(o=function(e){for(;e;){if(e.then)return void e.then(o,i);try{if(e.pop){if(e.length)return e.pop()?I.call(this):e;e=E}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(E);function I(){return Qo(_),Qo(x),Qo(c),Qo(d),Qo(l),k(100),n(w)}}}catch(u){return i(u)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)})}let ia;function oa(e,t){return new Promise(function(r,n){let i,o,a,s,l,c;if(i={...t},a=0,({onProgress:s}=i),i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{a=e,"function"==typeof s&&s(a)},!(e instanceof Blob||e instanceof Bo))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!l||"function"!=typeof Worker||c)return na(e,i).then(function(e){try{return o=e,h.call(this)}catch(e){return n(e)}}.bind(this),n);var u=function(){try{return h.call(this)}catch(e){return n(e)}}.bind(this),d=function(t){try{return na(e,i).then(function(e){try{return o=e,u()}catch(e){return n(e)}},n)}catch(e){return n(e)}};try{return i.libURL=i.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",function(e,t){return new Promise((r,n)=>{ia||(ia=function(){const e=[];return e.push("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"),URL.createObjectURL(new Blob(e))}());const i=new Worker(ia);i.addEventListener("message",function(e){if(t.signal&&t.signal.aborted)i.terminate();else if(void 0===e.data.progress){if(e.data.error)return n(new Error(e.data.error)),void i.terminate();r(e.data.file),i.terminate()}else t.onProgress(e.data.progress)}),i.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",()=>{n(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}(e,i).then(function(e){try{return o=e,u()}catch(e){return d()}},d)}catch(e){d()}function h(){try{o.name=e.name,o.lastModified=e.lastModified}catch(e){}try{i.preserveExif&&"image/jpeg"===e.type&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(o=Io(e,o))}catch(e){}return r(o)}})}function aa(e,t){var r;if(null==e?void 0:e.extension){const t=e.extension.toLowerCase(),r={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.type){const t=er(e.type),r={"image/jpeg":{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},"image/png":{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},"image/gif":{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},"image/webp":{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},"image/svg+xml":{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.name){const t=null===(r=e.name.split(".").pop())||void 0===r?void 0:r.toLowerCase();if(t){const e={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(e[t])return e[t]}}if(t){const e=er(t),r=nr(e);let n="jpeg";return"png"===r?n="png":"svg"===r?n="svg":"jpeg"===r&&(n="jpeg"),{extension:r,mimeType:e,format:r,pixieFormat:n}}return{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"}}oa.getDataUrlFromFile=Ho,oa.getFilefromDataUrl=Vo,oa.loadImage=Wo,oa.drawImageInCanvas=Yo,oa.drawFileInCanvas=Ko,oa.canvasToFile=Zo,oa.getExifOrientation=ea,oa.handleMaxWidthOrHeight=ta,oa.followExifOrientation=ra,oa.cleanupCanvasMemory=Qo,oa.isAutoOrientationInBrowser=Jo,oa.approximateBelowMaximumCanvasSizeOfBrowser=qo,oa.copyExifWithoutOrientation=Io,oa.getBrowserName=$o,oa.version="2.0.2";const sa={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},la=["gif","svg"];function ca(e,t){const{colorHex:r,colorHex2:n,colorHex3:i}=t,o=[`--icon-grad-1: ${r}`,`--icon-grad-2: ${n}`,`--icon-stroke-1: ${r}`,`--icon-stroke-2: ${n}`,`--icon-stroke-3: ${i}`,`--icon-fill-1: ${r}`,`--icon-fill-2: ${n}`,`--icon-fill-3: ${i}`,`color: ${r}`].join(";");let a=e.replace(/<svg([^>]*)>/i,(e,t)=>{let r=t;return/style="/i.test(r)?r=r.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};${o}"`):r+=` style="${o}"`,`<svg${r}>`});return a=a.replace(/var\(--icon-color-1\)/g,r).replace(/var\(--icon-color-2\)/g,n).replace(/var\(--icon-color-3\)/g,i).replace(/var\(--icon-fill-1\)/g,r).replace(/var\(--icon-fill-2\)/g,n).replace(/var\(--icon-fill-3\)/g,i).replace(/var\(--icon-stroke-1\)/g,r).replace(/var\(--icon-stroke-2\)/g,n).replace(/var\(--icon-stroke-3\)/g,i).replace(/var\(--icon-grad-1\)/g,r).replace(/var\(--icon-grad-2\)/g,n).replace(/currentColor/g,r),a}function ua(e,t){const r=e.match(/\swidth="([0-9.]+)(px)?"/i),n=e.match(/\sheight="([0-9.]+)(px)?"/i);if(r&&n){const e=parseFloat(r[1]),i=parseFloat(n[1]);if(Number.isFinite(e)&&Number.isFinite(i)&&e>0&&i>0){const r=e/i;return r>=1?{width:t,height:Math.max(1,Math.round(t/r))}:{width:Math.max(1,Math.round(t*r)),height:t}}}const i=e.match(/viewBox="([^"]+)"/i);if(i){const e=i[1].trim().split(/\s+/);if(4===e.length){const r=parseFloat(e[2]),n=parseFloat(e[3]);if(Number.isFinite(r)&&Number.isFinite(n)&&r>0&&n>0){const e=r/n;return e>=1?{width:t,height:Math.max(1,Math.round(t/e))}:{width:Math.max(1,Math.round(t*e)),height:t}}}}return{width:t,height:t}}function da(e){if(!e)return null;const t=e.trim();if(t.endsWith("%"))return null;const r=parseFloat(t.replace(/px$/i,""));return Number.isFinite(r)&&r>0?r:null}async function ha(e,t,r,n,i){var o;const a=null!==(o=null==i?void 0:i.canvasScale)&&void 0!==o?o:2,s=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(s);try{const e=new Image;await new Promise((t,r)=>{e.onload=()=>t(),e.onerror=()=>r(new Error("Failed to load SVG image")),e.src=l});const n=document.createElement("canvas"),i=Math.max(1,Math.round(t*a)),o=Math.max(1,Math.round(r*a));n.width=i,n.height=o;const s=n.getContext("2d");if(!s)throw new Error("Canvas 2D context is not available");return s.clearRect(0,0,i,o),s.drawImage(e,0,0,i,o),function(e){return new Promise((t,r)=>{e.toBlob(e=>{e?t(e):r(new Error("canvas.toBlob returned null"))},"image/png")})}(n)}finally{URL.revokeObjectURL(l)}}async function fa(e,t,r,n,i){const o=await ha(e,t,r,0,i);return a=o,new Promise((e,t)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>{var e;return t(null!==(e=r.error)&&void 0!==e?e:new Error("readAsDataURL failed"))},r.readAsDataURL(a)});var a}function pa(e,t,r,n){return new File([e],t,{type:r,lastModified:n})}function ga(e,t){return t&&t!==e.name?pa(e,t,e.type,e.lastModified):e}async function ma(e,t={}){const{maxSizeMB:r=sa.MAX_SIZE_MB,maxWidthOrHeight:n=sa.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0,convertSvgToPng:l=!1}=t;if(!(e&&e instanceof File))return e;let c=e,u=!1;if(l){const r=(c.type||"").toLowerCase(),i=/\.svg$/i.test(c.name.trim()),a=r.includes("svg");let s=!1;if(!a&&!i)try{const e=await async function(e,t=24e3){const r=Math.min(t,Math.max(0,e.size));return e.slice(0,r).text()}(c);s=function(e){const t=e.trimStart().replace(/^\uFEFF/,"");return!!t.startsWith("<")&&/<\s*svg[\s>/]/i.test(t)}(e)}catch(e){s=!1}if(a||i||s)try{c=await async function(e,t={}){var r,n,i;const o=null!==(r=t.pixelScale)&&void 0!==r?r:2,a=null!==(n=t.maxLongEdge)&&void 0!==n?n:4096,s=await e.text(),{width:l,height:c}=function(e,t=2,r=4096){const{width:n,height:i}=function(e){var t,r,n,i,o;const a=null!==(r=null===(t=e.match(/<\s*svg\b[\s\S]*?>/i))||void 0===t?void 0:t[0])&&void 0!==r?r:"",s=null===(n=a.match(/\bwidth\s*=\s*["']([^"']*)["']/i))||void 0===n?void 0:n[1],l=null===(i=a.match(/\bheight\s*=\s*["']([^"']*)["']/i))||void 0===i?void 0:i[1],c=da(s),u=da(l);if(null!=c&&null!=u)return{width:c,height:u};const d=null===(o=e.match(/viewBox\s*=\s*["']([^"']+)["']/i))||void 0===o?void 0:o[1];if(d){const e=d.trim().split(/[\s,]+/);if(4===e.length){const t=parseFloat(e[2]),r=parseFloat(e[3]);if(Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0)return{width:t,height:r}}}return null!=c?{width:c,height:c}:null!=u?{width:u,height:u}:{width:300,height:300}}(e);let o=Math.max(1,Math.round(n*t)),a=Math.max(1,Math.round(i*t));const s=Math.max(64,r),l=Math.max(o,a);if(l>s){const e=s/l;o=Math.max(1,Math.round(o*e)),a=Math.max(1,Math.round(a*e))}return{width:o,height:a}}(s,o,a),u=await ha(s,l,c,0,{canvasScale:1}),d=null!==(i=t.outputFileName)&&void 0!==i?i:e.name,h=/\.svg$/i.test(d)?d.replace(/\.svg$/i,".png"):`${d}.png`;return new File([u],h,{type:"image/png",lastModified:e.lastModified})}(c,{maxLongEdge:n,outputFileName:null!=o?o:c.name}),u=!0}catch(t){c=e}}if(u)return c;const d=(c.type&&""!==c.type.trim()?c.type:ir(c.name))||i||"image/jpeg",h=er(d);if(!h.startsWith("image/"))return ga(c,o);const f="image/webp"===(p=h)?"image/jpeg":p;var p;const g=nr(h),m=nr(f),v=f!==h?function(e,t){const r=t.startsWith(".")?t.slice(1):t,n=e.lastIndexOf(".");return n>0?`${e.substring(0,n)}.${r}`:`${e}.${r}`}(null!=o?o:c.name,m):null!=o?o:c.name,y=s&&(b=g,!la.includes(b));var b;if(!y&&f===h)return ga(c,v);try{const t={libURL:a,useWebWorker:!0,fileType:f};y?(t.maxSizeMB=r,t.maxWidthOrHeight=n):(t.maxSizeMB=Math.max(e.size/1048576+1,1),t.initialQuality=1,t.alwaysKeepResolution=!0);const i=await oa(c,t);return function(e,t,r,n){const i=null!=n?n:t.name;return e instanceof File?e.type!==r||e.lastModified!==t.lastModified||e.name!==i?pa(e,i,r,t.lastModified):e:pa(e,i,r,t.lastModified)}(i,c,er(i.type||f),v)}catch(e){try{return ga(c,v)}catch(e){return c}}}async function va(e){const{folderId:t,dataProviders:r,folders:n,pathHistory:i,t:o}=e,a=null==t?"":String(t);if(!a||"folders"===a)return o("Folders");if("Trash"===a)return o("Trash");const s=i||[],l=s[s.length-1];if((null==l?void 0:l.id)===a&&l.name)return l.name;const c=[...s].reverse().find(e=>e.id===a);if(null==c?void 0:c.name)return c.name;const u=null==r?void 0:r.getItem;if(u)try{const e=await Promise.resolve(u(a));if(null==e?void 0:e.name)return e.name}catch(e){}const d=null==n?void 0:n.find(e=>e.id===a);return(null==d?void 0:d.name)?d.name:a}const ya=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function ba(e){const t=new URL(e.trim());t.hash="",t.hostname=t.hostname.toLowerCase(),("https:"===t.protocol&&"443"===t.port||"http:"===t.protocol&&"80"===t.port)&&(t.port="");const r=Array.from(t.searchParams.entries()).filter(([e])=>!ya.test(e)).sort(([e,t],[r,n])=>{const i=e.localeCompare(r);return 0!==i?i:t.localeCompare(n)});return t.search="",r.forEach(([e,r])=>t.searchParams.append(e,r)),t.toString()}function wa(e){return!!(null==e?void 0:e.startsWith("image/"))&&"image/gif"!==e}function xa(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch(t){return e}}function Ca(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>{var e;return r(null!==(e=n.error)&&void 0!==e?e:new Error("Failed to read proxied file"))},n.readAsDataURL(e)})}function _a(e){try{const t=new URL(e).pathname.split("/").pop();return t?decodeURIComponent(t):void 0}catch(e){return}}function Sa(e){return null==e||""===e||"folders"===e?null:e}async function Aa(e){const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new So(`HTTP ${t.status}`,"UploadUrlDownloadFailed",t.status);return t.blob()}function ka(e,t){var r,n;if(!(e instanceof Blob)||0===e.size)throw new So(t("Failed to download file from the URL."),"UploadUrlDownloadFailed");const i=(null===(n=null===(r=e.type)||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim())||"image/png";if(!i.startsWith("image/"))throw new So(t("Content type at the URL is not allowed."),"UploadUrlContentTypeNotAllowed");return{blob:e,mimeType:i}}const Ea=()=>{var e,t,r,n;const{state:i,actions:a,options:s}=Xi(),l=io(),{sortBy:c,sortOrder:u}=l.state,{actions:{fetchFolders:d}}=Co(),{t:h}=Sn(),f=so(),{deleteItems:p}=_o(),{selectedFolder:g,urlForm:m,pagination:v,files:y,pathHistory:b,folders:w}=i,x=o.useRef(null),C=o.useRef([]);x.current=v,C.current=Array.isArray(y)?y:[];const _=o.useRef(null),{setFiles:S,setLoading:A,setIsUrlModalVisible:k,setActiveLibraryItem:E,setPagination:I,setSelectedFolder:j,setPathHistory:T}=a,{dataProviders:F}=s,O=(0,o.useCallback)(async e=>{var t,r,n,i,o;if(!(null==F?void 0:F.getFiles))return[];const a=null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.disablePagination,l=a?void 0:null!==(r=null==e?void 0:e.page)&&void 0!==r?r:1,c=a?void 0:null!==(n=null==e?void 0:e.limit)&&void 0!==n?n:20,{files:u,pagination:d}=await F.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,noFolder:null==e?void 0:e.noFolder,search:(null===(i=null==e?void 0:e.search)||void 0===i?void 0:i.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:l,limit:c,itemType:(null==e?void 0:e.itemType)||"all"});return I&&((null===(o=null==s?void 0:s.config)||void 0===o?void 0:o.disablePagination)?I({current:1,pageSize:u.length||1,total:u.length||0}):d&&I({current:d.page,pageSize:d.limit,total:d.total})),u},[F,null===(e=null==s?void 0:s.config)||void 0===e?void 0:e.disablePagination,I]),M=(0,o.useCallback)(async(e,t,r)=>Gn(F,e,t,r,gr(null==s?void 0:s.config)),[F,null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient]),P=(0,o.useCallback)(async(e,t=!1)=>{var r,n,o;try{null==A||A(!0);let t=[];if(!(null==F?void 0:F.getFiles))return;t=await O(e);const r=null!=e?e:{folderId:g||"",itemType:"all"};"file"!==r.itemType&&(t=await(async(e,t,r)=>{var n;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!r)return e;{const e=await r({parentId:t.folderId});i=Array.isArray(e)?e:[]}let o=((e,t)=>{const r=Array.isArray(e)?e:[];return(n=t.folderId)&&"root"!==n&&"folders"!==n&&"null"!==n&&null!==n?r.filter(e=>e.parentId===t.folderId):r.filter(no);var n})(i,t);if(null===(n=null==t?void 0:t.search)||void 0===n?void 0:n.trim()){const e=t.search.trim().toLowerCase();o=o.filter(t=>{var r;return null===(r=t.name)||void 0===r?void 0:r.toLowerCase().includes(e)})}if(0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:void 0,date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:"",childCount:e.childCount}));if("folder"===(null==t?void 0:t.itemType))return a;const s=e.filter(e=>!e.isFolder);return[...a,...s]})(t,r,null==F?void 0:F.getFolders)),"Trash"!==(g||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==S||S(t);if(Sa(r.folderId)===Sa(g)){const e=Array.isArray(b)?b:[];_.current={selectedFolder:null!=g?g:null,pathHistory:e.map(e=>Object.assign({},e))}}}catch(i){if("StaleLoad"===(null==i?void 0:i.name))return;const l=fo(i),c=404===(null==l?void 0:l.status)||"FileNotFound"===(null==l?void 0:l.code)||"path_folder_not_found"===(null==l?void 0:l.code);if(!t&&c){const t=wo(i,b||[]);try{return await xo({options:s,pathFolder:t,dataProviders:null==s?void 0:s.dataProviders}),void await P(e,!0)}catch(e){}}if(c&&j&&T){const t=Array.isArray(b)?b:[];if(t.length>1){const n=t.slice(0,-1),i=n[n.length-1],o=null!==(r=null==i?void 0:i.id)&&void 0!==r?r:"folders";return T(n),j(o),await d(),f.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:h("Folder not found"),description:h("Navigated to parent folder"),placement:"bottomRight"}),void await P(Object.assign(Object.assign({},e),{folderId:o}),!1)}return T([{id:"folders",name:h("Folders")}]),j("folders"),await d(),f.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:h("Folder not found"),description:h("Navigated to root folder"),placement:"bottomRight"}),void await P(Object.assign(Object.assign({},e),{folderId:"folders"}),!1)}const u=_.current;if(u&&j&&T){const e=Array.isArray(b)?b:[],t=(null!==(n=u.selectedFolder)&&void 0!==n?n:null)===(null!=g?g:null),r=function(e,t){return e.length===t.length&&e.every((e,r)=>{var n;return e.id===(null===(n=t[r])||void 0===n?void 0:n.id)})}(u.pathHistory,e);t&&r||(j(u.selectedFolder),T(u.pathHistory.map(e=>Object.assign({},e))),s.onPathChange&&s.onPathChange(u.pathHistory.map(e=>e.name)))}const p=uo(null==l?void 0:l.code,h),m=null!=e?e:{folderId:g||"",itemType:"all"},v=void 0!==m.folderId&&""!==m.folderId?m.folderId:g||"",y=Array.isArray(b)?b.map(e=>Object.assign({},e)):[],x=null===(o=m.folderName)||void 0===o?void 0:o.trim(),C=x&&x.length>0?x:await va({folderId:v,dataProviders:F,folders:Array.isArray(w)?w:[],pathHistory:y,t:h}),S=h("Failed to load files"),A=h("Failed to load files in folder",{folderName:C}),k=p&&p!==S?p:void 0;f.error({id:"FILES_FETCH_FAILED",message:A,description:k,placement:"bottomRight",innerException:i,notificationDedupe:!0,data:{params:Object.assign(Object.assign({},m),{folderName:C}),folderName:C}})}finally{null==A||A(!1)}},[F,S,A,j,T,O,d,g,w,f,h,b,s]),R=(0,o.useCallback)(e=>P(e),[P]),L=(0,o.useCallback)(async(e,t)=>{var r;if(!(null==F?void 0:F.findFileByUrl))return null;const n=ba(e);try{return null!==(r=await F.findFileByUrl(n))&&void 0!==r?r:null}catch(e){return null}},[F]),N=(0,o.useCallback)(async(e,t)=>{var r,n,i;Eo(e,h);const o=ba(e),a=await L(o,t);if(a)return{kind:"existing",file:a,normalizedUrl:o};let l,c,u;const d=null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.fetchWithProxy,f=null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.handleFileProxy,p=null===(i=null==s?void 0:s.config)||void 0===i?void 0:i.handleProxyUrl,g=function(e){if("undefined"==typeof window)return!1;try{return new URL(e).origin===window.location.origin}catch(e){return!1}}(o);if(!g&&d)try{const e=await Promise.resolve(d(o,{mode:"cors"},{intent:"downloadBlob"}));if(!e.ok)throw new So(`HTTP ${e.status}`,"UploadUrlDownloadFailed",e.status);const t=ka(await e.blob(),h);l=t.blob,c=t.mimeType}catch(e){u=e}if(!g&&!l&&f)try{const e=ka(await Promise.resolve(f(o)),h);l=e.blob,c=e.mimeType}catch(e){u=e}if(!g&&!l&&p)try{const e=await Promise.resolve(p(o)),t=ka(await Aa(e),h);l=t.blob,c=t.mimeType}catch(e){u=e}if(!l)try{const e=ka(await Aa(o),h);l=e.blob,c=e.mimeType}catch(e){u=e}if(!l||!c)throw u instanceof Error?u:new So(h("Failed to download file from the URL."),"UploadUrlDownloadFailed");const m=nr(c),v=_a(o)||"uploaded-file",y=v.replace(/\.[^.]+$/,"")||"uploaded-file";return{kind:"blob",blob:l,normalizedUrl:o,mimeType:c,extension:m,fileName:fr(v.includes(".")?v:`${y}.${m}`,null==s?void 0:s.config)}},[L,null==s?void 0:s.config,h]),D=(0,o.useCallback)(async(e,t)=>{var r,n,i,o;Eo(e,h);const a=ba(e);try{const e=await N(a,t);return"existing"===e.kind?e.file:{thumbnail:await Ca(e.blob),name:e.fileName,type:e.mimeType,extension:e.extension,size:e.blob.size,sourceUrl:e.normalizedUrl,saveWithoutFolder:!0}}catch(e){let c=e;if(null==F?void 0:F.uploadFileByUrl)try{const e=null!=g?g:"",t=fr(_a(a)||"uploaded-file",null==s?void 0:s.config),i=await M(t,e,!1),o=await F.uploadFileByUrl({url:a,folderId:e,name:i,eventSource:"pixie"}),l=ka(null!==(r=(null==o?void 0:o.id)&&F.getFileData?await F.getFileData(o.id):void 0)&&void 0!==r?r:(null==o?void 0:o.url)?await Aa(o.url):(null==o?void 0:o.thumbnailUrl)?await Aa(o.thumbnailUrl):(null==o?void 0:o.sourceUrl)?await Aa(o.sourceUrl):void 0,h),c=await Ca(l.blob);return Object.assign(Object.assign({},o),{thumbnail:c,type:o.type||l.mimeType,extension:o.extension||nr(l.mimeType),size:null!==(n=o.size)&&void 0!==n?n:l.blob.size,sourceUrl:o.sourceUrl||a})}catch(e){c=e}const u=fo(c),d="string"==typeof(l=null==u?void 0:u.code)?l:"UploadUrlDownloadFailed",p=c instanceof So?c:new So(null!==(o=null!==(i=uo(d,h))&&void 0!==i?i:null==u?void 0:u.message)&&void 0!==o?o:h("Failed to download file from the URL."),d,null==u?void 0:u.status);throw p.notificationShown=!0,await f.error({id:"EDITOR_PROXY_FILE_FAILED",message:p.message,placement:"bottomRight",data:{url:a,folderId:g||null,error:u,eventSource:"pixie"},innerException:c},t),p}var l},[F,f,null==s?void 0:s.config,N,M,g,h]),z=(0,o.useCallback)(async e=>{const t=x.current;try{const r=C.current.find(t=>t.id===e),n=e=>{if(!e)return;const t=y.find(t=>t.id===e);return null==t?void 0:t.name};await p({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:g,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===y.length&&(o=i.current>1?i.current-1:1),await R({folderId:g||"",page:o,limit:t.pageSize,sortBy:c,sortOrder:u})}catch(t){(null==t?void 0:t.notificationShown)||f.error({id:"FILES_DELETE_ERROR",message:h("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:g||null,errors:[{itemId:e,error:fo(t)}]}})}},[p,R,g,h,f,y,c,u]),B=(0,o.useCallback)(async e=>{try{const t=x.current;if(!(null==F?void 0:F.deleteFolder))return void f.error({id:"FOLDER_DELETE_ERROR",message:h("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await F.deleteFolder(e)){const e=new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443");throw e.notificationShown=!1,e}f.success({id:"FOLDER_DELETE_SUCCESS",message:h("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}}),g===e?await R({page:t.current,limit:t.pageSize,sortBy:c,sortOrder:u}):await R({folderId:g||"",sortBy:c,sortOrder:u,page:t.current,limit:t.pageSize})}catch(t){(null==t?void 0:t.notificationShown)||f.error({id:"FOLDER_DELETE_ERROR",message:h("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:fo(t)}]}})}},[F,g,f,h,R,c,u]),U=(0,o.useCallback)(async(e,t)=>{var r,n;try{if(null==F?void 0:F.getFileData){const t=await F.getFileData(e);if(t)return t;throw new Error(h("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(h("Error loading image"));return await t.blob()}}catch(i){const o=C.current.find(t=>t.id===e);t||f.error({id:"FILE_DOWNLOAD_FAILED",message:h("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,notificationDedupe:!1,data:{itemId:e,itemName:(null==o?void 0:o.name)||e,folderId:null!==(r=null==o?void 0:o.folderId)&&void 0!==r?r:null,thumbnail:null!==(n=null==o?void 0:o.thumbnail)&&void 0!==n?n:null}},t)}},[F,f,h]),V=(0,o.useCallback)(async(e,t,r,n)=>{var o,a,l,c,u,d,p,m,v,y,b,w,x,C,_;if("Trash"===(n?"":null!=t?t:g||""))throw new Error(h("Upload to Trash is forbidden"));const S=fr(e.name,null==s?void 0:s.config),A=S.split(".").pop()||"",k=n?"":null!=t?t:g||"";let I=e;try{if(or(e)){const t=null!==(a=null===(o=null==s?void 0:s.config)||void 0===o?void 0:o.compressMaxSize)&&void 0!==a?a:sa.MAX_SIZE_MB,r=null!==(c=null===(l=null==s?void 0:s.config)||void 0===l?void 0:l.compressMaxWidthOrHeight)&&void 0!==c?c:2e3,n=null!==(d=null===(u=null==s?void 0:s.config)||void 0===u?void 0:u.compessorUrl)&&void 0!==d?d:null===(p=null==s?void 0:s.config)||void 0===p?void 0:p.compressorUrl,i=(null===(m=e.type)||void 0===m?void 0:m.trim())||ir(e.name)||e.type;I=await ma(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:i,fileName:S,libURL:n,enableCompression:wa(i),convertSvgToPng:!0})}else I=xa(e,S)}catch(t){I=xa(e,S)}let j=I.name;const T=gr(null==s?void 0:s.config);T&&(j=await M(j,k,n)),T&&(I=xa(I,j));try{if(null==F?void 0:F.uploadFiles)try{const t=await F.uploadFiles({items:[{name:j,size:I.size,type:I.type||e.type,folderId:k,data:I,extension:A,noFolder:n}],folderId:k});if(t.success&&t.detailed&&t.detailed.length>0){const o=t.detailed[0];if(!o.success||!o.data){if(!r){const e=(null==o?void 0:o.error)?String(o.error):h("Failed to upload file");f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:S,innerException:null==o?void 0:o.error,data:{itemName:S,folderId:k||null,eventSource:"upload"}})}return void(E&&E(Mt))}{const t=o.data;if(t.id){const r=(null!==(v=t.folderId)&&void 0!==v?v:k)||void 0,o=null!==(y=null!=r?r:g)&&void 0!==y?y:"";await R({folderId:o,noFolder:n});let a=i.files.find(e=>e.id===t.id);if(!a)try{a=(await O({folderId:r,noFolder:n,itemType:"all"})).find(e=>e.id===t.id)}catch(e){}return E&&E(Mt),a||Object.assign(Object.assign({},t),{id:t.id,name:t.name||S,folderId:null!==(w=null!==(b=t.folderId)&&void 0!==b?b:k)&&void 0!==w?w:null,type:I.type||e.type,size:I.size,extension:A||S.split(".").pop()||"",thumbnail:null!==(x=t.thumbnail)&&void 0!==x?x:void 0,url:null!==(C=t.url)&&void 0!==C?C:void 0,thumbnailUrl:null!==(_=t.thumbnailUrl)&&void 0!==_?_:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!r){const e=t.error?String(t.error):h("Failed to upload file");f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:S,innerException:t.error,data:{itemName:S,folderId:k||null,eventSource:"upload"}})}return void(E&&E(Mt))}return void(E&&E(Mt))}catch(e){throw e}if(null==F?void 0:F.uploadFile){const t=await F.uploadFile({name:j,size:I.size,type:I.type||e.type,folderId:k,noFolder:n,data:I,extension:A});return E&&E(Mt),t}return void(r||f.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:h("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=fo(e),n=uo(null==t?void 0:t.code,h);return r?void 0:void f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=n?n:h("Failed to upload file"),placement:"bottomRight",description:S,innerException:e,data:{itemName:S,folderId:k||null,error:fo(e),eventSource:"upload"}})}},[F,g,E,i.files,R,O,f,h,null==s?void 0:s.config]),H=(0,o.useCallback)(async(e,t)=>{var r;if(!(null==F?void 0:F.getFolders)||!(null==F?void 0:F.createFolder))return e||"";try{const n=await F.getFolders(),i=Array.isArray(n)?n:[],o=(e,t)=>i.find(r=>{var n;return(null!==(n=r.parentId)&&void 0!==n?n:null)===(null!=e?e:null)&&r.name===t});let a=null!=e?e:"";for(const e of t){if(!e)continue;let t=o(a,e);if(!t){const r=await F.createFolder({name:e,parentId:null!=a?a:null});i.push(r),t=r}a=t.id}return null!==(r=a)&&void 0!==r?r:e||""}catch(t){return e||""}},[F]),W=(0,o.useCallback)(async(e,t)=>{var r,n,i,o;if(!(null===(n=null===(r=e.type)||void 0===r?void 0:r.startsWith)||void 0===n?void 0:n.call(r,"image/")))return null!=t?t:null;const a=null==e?void 0:e.webkitRelativePath;let s=t||"";if(a&&a.includes("/")){const e=a.split("/");e.pop();const r=e.filter(Boolean);r.length&&(s=await H(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[H]);(0,o.useCallback)(async e=>{var t,r,n,i,o,a,s,l,c,u,d,h;const{file:f,selectedFolderId:p,uploadFn:g,progressCallbacks:m}=e;if(!(null===(r=null===(t=f.type)||void 0===t?void 0:t.startsWith)||void 0===r?void 0:r.call(t,"image/")))return{success:!0,fileName:f.name,folderId:null!=p?p:null};const v=null!==(i=null!==(n=await W(f,p))&&void 0!==n?n:p)&&void 0!==i?i:null,y=null!==(o=null!=v?v:p)&&void 0!==o?o:null;let b;null===(a=null==m?void 0:m.onStart)||void 0===a||a.call(m,f);try{if(null==m?void 0:m.onProgress){let e=0;b=window.setInterval(()=>{var t;e=Math.min(e+10+Math.floor(Date.now()%10),90),null===(t=null==m?void 0:m.onProgress)||void 0===t||t.call(m,f.name,e)},200)}const e=await g(f,null!=y?y:void 0);return(null==m?void 0:m.onProgress)&&(null===(s=null==m?void 0:m.onProgress)||void 0===s||s.call(m,f.name,100)),null===(l=null==m?void 0:m.onComplete)||void 0===l||l.call(m,f.name),{success:!0,fileName:f.name,fileId:null==e?void 0:e.id,folderId:null!==(u=null!==(c=null==e?void 0:e.folderId)&&void 0!==c?c:y)&&void 0!==u?u:null}}catch(e){const t=e instanceof Error?e.message:String(e);return null===(d=null==m?void 0:m.onError)||void 0===d||d.call(m,f.name,t),{success:!1,fileName:f.name,folderId:null!==(h=null!=y?y:p)&&void 0!==h?h:null,error:t}}finally{void 0!==b&&clearInterval(b)}},[W]);const $=(0,o.useCallback)(async(e,t)=>{var r,n,i,o,a,l,c,u,d,p,m,v,y,b,w,x,C,_,S,A,k,I,j,T,O,M,P,R,L,N,D,z,B,U,V;if(0===e.length)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};null===(r=null==t?void 0:t.onStartBatch)||void 0===r||r.call(t,e);const H=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},$=[];for(let E=0;E<e.length;E++){const r=e[E];if(!or(r)){const e=await f.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:h("Unsupported file type"),placement:"bottomRight",data:{itemName:r.name,fileType:r.type,folderId:g||null}});null===(n=null==t?void 0:t.onError)||void 0===n||n.call(t,r.name,e.message);continue}const v=fr(r.name,null==s?void 0:s.config);let y=r;try{if(or(r)){const e=null!==(o=null===(i=null==s?void 0:s.config)||void 0===i?void 0:i.compressMaxSize)&&void 0!==o?o:sa.MAX_SIZE_MB,t=null!==(l=null===(a=null==s?void 0:s.config)||void 0===a?void 0:a.compressMaxWidthOrHeight)&&void 0!==l?l:2e3,n=null!==(u=null===(c=null==s?void 0:s.config)||void 0===c?void 0:c.compessorUrl)&&void 0!==u?u:null===(d=null==s?void 0:s.config)||void 0===d?void 0:d.compressorUrl,h=(null===(p=r.type)||void 0===p?void 0:p.trim())||ir(r.name)||r.type;y=await ma(r,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:h,fileName:v,libURL:n,enableCompression:wa(h),convertSvgToPng:!0})}else y=xa(r,v)}catch(e){y=xa(r,v)}const b=`${Date.now()}-${E}-${Math.random().toString(36).slice(2,8)}`,w=await W(y,g);null===(m=null==t?void 0:t.onStart)||void 0===m||m.call(t,y),$.push({file:y,targetFolderId:w,requestId:b,originalFileName:r.name,originalIndex:E})}const q=$.length;if(0===q)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const G=gr(null==s?void 0:s.config),Y=new Map;if(G&&(null==F?void 0:F.getFiles)){const t=[...new Set($.map(e=>{var t,r;return null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:g)&&void 0!==r?r:""}).filter(e=>null!=e))];for(const r of t)try{const{files:e}=await F.getFiles({folderId:""===r?"":null!=r?r:void 0,itemType:"all",page:1,limit:1e4});let t=(e||[]).map(e=>e.name).filter(e=>!!e);if(null==F?void 0:F.getFolders){const e=(await F.getFolders({parentId:r||null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);t=[...t,...e]}Y.set(r,t)}catch(e){}}const X=new Map,K=$.map(e=>{const t=G?((e,t)=>{const r=null!=e?e:"";let n=Y.get(r)||[],i=X.get(r);i||(i=new Set(n.map(e=>e.toLowerCase())),X.set(r,i));const o=qn(t,Array.from(i));return i.add(o.toLowerCase()),o})(e.targetFolderId,e.file.name):e.file.name,r=G?xa(e.file,t):e.file;return Object.assign(Object.assign({},e),{resolvedUploadName:t,uploadFile:r})}),Z=!t,Q=1===q&&Z,J=[],ee=[],te=[],re=[],ne=new Map;let ie=0,oe=0;const ae=null!==(y=null===(v=null==s?void 0:s.config)||void 0===v?void 0:v.maxFileSize)&&void 0!==y?y:52428800,se=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};ie++,J.push(e),ee.push(null!=n?n:e),await((e,t,r,n)=>{var i;return f.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${h("File")} ${e} ${h("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:g)&&void 0!==i?i:null,eventSource:"upload"}},n||!Z)})(e,r,n,!l),s&&(null===(o=null==t?void 0:t.onProgress)||void 0===o||o.call(t,e,100),null===(a=null==t?void 0:t.onComplete)||void 0===a||a.call(t,e))},le=async(e,r,n,i)=>{var o;const{emitProgress:a=!0,emitNotification:s=!0,fileSize:l,progressCallbackName:c,progressCallbackIndex:u}=null!=i?i:{};oe++;const d=null!=l?{fileSize:l,maxSize:ae}:void 0,p=await((e,t,r,n,i)=>{var o,a,s,l,c,u,d;const p=fo(r),m=null!==(o=null==i?void 0:i.fileSize)&&void 0!==o?o:null==p?void 0:p.fileSize,v=null!==(s=null!==(a=null==i?void 0:i.maxSize)&&void 0!==a?a:null==p?void 0:p.maxSize)&&void 0!==s?s:ae,y={allowedChars:"a-z A-Z 0-9 . _ -",fileSize:null!=m?Hn(Number(m)):void 0,maxSize:null!=v?Hn(Number(v)):void 0},b=null==p?void 0:p.code,w="BatchItemLimitExceeded"===b||"exceeded_max_files"===b?b:null!==(l=ho(null==p?void 0:p.message))&&void 0!==l?l:b,x="BatchItemLimitExceeded"===w||"exceeded_max_files"===w?po(r,h):uo(w,h,y),C=(null==p?void 0:p.message)&&"string"==typeof p.message&&p.message.length>0?p.message:null,_=r instanceof Error?r.message:"string"==typeof r?r:null,S=_&&"[object Object]"!==_?_:null;return f.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!==(u=null!==(c=null!=C?C:x)&&void 0!==c?c:S)&&void 0!==u?u:h("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(d=null!=t?t:g)&&void 0!==d?d:null,error:fo(r),eventSource:"upload"},innerException:r},n||!Z)})(e,r,n,!s,d);a&&(null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,null!=c?c:e,p.message,u)),re.push({itemId:void 0,itemName:e,error:fo(n)}),te.push({fileName:e,error:p.message})};let ce;if(!(null==F?void 0:F.uploadFiles))return f.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:h("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:q,successes:[],errors:[],totalCount:q};{const r=[];try{(null==t?void 0:t.onProgress)&&$.forEach(e=>{let n=0;const i=window.setInterval(()=>{var r;n=Math.min(n+10+Math.floor(Date.now()%10),90),null===(r=null==t?void 0:t.onProgress)||void 0===r||r.call(t,e.file.name,n)},200);r.push(i)}),ce=await F.uploadFiles({items:K.map(e=>{var t,r;return{requestId:e.requestId,name:e.resolvedUploadName,size:e.uploadFile.size,type:e.uploadFile.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:g)&&void 0!==r?r:null,data:e.uploadFile,extension:e.uploadFile.name.split(".").pop()||""}}),folderId:null!=g?g:null}),r.forEach(e=>window.clearInterval(e)),r.length=0;const e=null!==(b=ce.detailed)&&void 0!==b?b:[],n=new Map(e.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(e.length>0)for(let t=0;t<K.length;t++){const r=K[t],i=null!==(w=r.requestId?n.get(r.requestId):void 0)&&void 0!==w?w:e[t];if(i&&i.success){const e=i.data,t=null!==(x=null==e?void 0:e.name)&&void 0!==x?x:r.resolvedUploadName,n=null!==(S=null!==(_=null!==(C=null==e?void 0:e.folderId)&&void 0!==C?C:r.targetFolderId)&&void 0!==_?_:g)&&void 0!==S?S:null,o=null==e?void 0:e.id;ne.set(t,{id:o,name:t,folderId:n,size:null==e?void 0:e.size,originalFileName:r.originalFileName,originalIndex:r.originalIndex}),await se(t,n,o,{emitNotification:Q})}else{const e=null==i?void 0:i.data,t=null!==(A=null==e?void 0:e.name)&&void 0!==A?A:r.resolvedUploadName,n=null!==(j=null!==(I=null!==(k=null==e?void 0:e.folderId)&&void 0!==k?k:r.targetFolderId)&&void 0!==I?I:g)&&void 0!==j?j:null;await le(t,n,null!==(T=null==i?void 0:i.error)&&void 0!==T?T:new Error(h("Error uploading file")),{emitNotification:Q,fileSize:r.file.size,progressCallbackName:r.originalFileName,progressCallbackIndex:r.originalIndex})}}else if(ce.success)for(const t of K){const e=t.resolvedUploadName,r=null!==(M=null!==(O=t.targetFolderId)&&void 0!==O?O:g)&&void 0!==M?M:null;await se(e,r,void 0,{emitNotification:Q})}else{const e=null!==(P=ce.error)&&void 0!==P?P:new Error(h("Error uploading file"));for(const t of K){const r=t.resolvedUploadName,n=null!==(L=null!==(R=t.targetFolderId)&&void 0!==R?R:g)&&void 0!==L?L:null;await le(r,n,e,{emitNotification:Q,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}}catch(e){for(const t of K){const r=t.resolvedUploadName,n=null!==(D=null!==(N=t.targetFolderId)&&void 0!==N?N:g)&&void 0!==D?D:null;await le(r,n,null!=e?e:new Error(h("Error uploading file")),{emitNotification:Q,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{r.forEach(e=>window.clearInterval(e))}}if(ie>0&&(E&&E(Mt),q>1&&Z)){const e=H(J),t=e?h("Uploaded",{names:e}):h("uploads_success_summary",{successCount:ie,totalCount:q});f.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:ie,totalCount:q,itemIds:ee,itemNames:J,folderId:null!=g?g:null,eventSource:"upload"}})}if(oe>0&&Z&&!Q)if(q>1){const e=te.map(e=>e.fileName),t=H(e),r=t?h("Failed",{names:t}):h("uploads_fail_summary",{failCount:oe,totalCount:q});f.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:oe,totalCount:q,itemNames:e,folderId:null!=g?g:null,errors:re,eventSource:"upload"}})}else if(1===q&&re.length>0&&(null===(z=re[0].error)||void 0===z?void 0:z.code)){const e=uo(null===(B=re[0].error)||void 0===B?void 0:B.code,h),t=null!==(V=null===(U=te[0])||void 0===U?void 0:U.fileName)&&void 0!==V?V:"",r=null!=e?e:t?`${h("Failed to upload files")}: ${t}`:h("Failed to upload files");f.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:oe,totalCount:q,itemNames:[t],folderId:null!=g?g:null,errors:re,eventSource:"upload"}})}return{successCount:ie,failCount:oe,successes:J,errors:te,totalCount:q,uploadedFiles:ne.size>0?ne:void 0}},[F,null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient,f,W,g,E,h,null==s?void 0:s.config]),q=(0,o.useCallback)(async e=>{var t;if(!(null==F?void 0:F.uploadFiles))return void f.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:h("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===g)return void f.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:h("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:g||null,reason:"Upload to Trash is not allowed"}});const r=x.current,n=document.createElement("input");n.type="file",n.accept="image/*",n.multiple=!0;try{(null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.features)&&s.config.features.enableDirectoryUpload&&(n.webkitdirectory=!0)}catch(e){}n.onchange=async t=>{var n;const i=t.target.files;if(!i||0===i.length)return;const o=Array.from(i);try{null==A||A(!0);const{successes:t,errors:i,uploadedFiles:a}=await $(o,e);null===(n=null==e?void 0:e.onBatchComplete)||void 0===n||n.call(e,{files:o,successes:t,errors:i,uploadedFiles:a}),await d(),await R({folderId:g||"",sortBy:c,sortOrder:u,page:r.current,limit:r.pageSize})}catch(e){}finally{null==A||A(!1)}},n.click()},[null==F?void 0:F.uploadFiles,g,f,h,A,R,d,c,u,$,null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.features]),G=(0,o.useCallback)(async(e,t,r,n="uploadByUrl")=>{const i=x.current,o=Boolean(e&&String(e).trim());let a,l=null!=e?e:null;try{if(!t&&"Trash"===g)throw r||f.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:h("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:g||null,reason:"Upload to Trash is not allowed"}}),new So(h("Cannot upload files to Trash"),"UploadUrlDownloadFailed");let d,p;if(!l&&m&&(d=await m.validateFields(),l=null==d?void 0:d.fileUrl),!l)throw r||f.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:h("Please fill in all fields"),placement:"bottomRight",data:{url:null!=l?l:null,folderId:g||null,eventSource:n}}),new So(h("Please fill in all fields"),"UploadUrlInvalid");if(Eo(l,h),l=ba(l),null==A||A(!0),l){const e=l.split("?")[0].split("#")[0].split("/");p=e[e.length-1]||"uploaded-file",p=fr(p,null==s?void 0:s.config)}const v=t?"":g||"",y=Boolean((null==F?void 0:F.uploadFiles)||(null==F?void 0:F.uploadFile)),b=Boolean(null==F?void 0:F.uploadFileByUrl);let w=p;w&&b&&(w=await M(w,v,t));try{const i=await N(l,r);if("existing"===i.kind)a=i.file;else if(y){const r=new File([i.blob],i.fileName,{type:i.mimeType,lastModified:Date.now()});try{a=await V(r,v,!0,t)}catch(e){throw e.uploadUrlStage="binaryUpload",e}if(!a){const e=new So(h("Failed to upload file"),"FileUploadBackendError");throw e.uploadUrlStage="binaryUpload",e}}else{if(!b)throw r||f.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:h("Upload by URL is not supported"),placement:"bottomRight",data:{url:l,folderId:g||null,eventSource:n}}),new So(h("Upload by URL is not supported"),"UploadUrlDownloadFailed");a=await F.uploadFileByUrl({url:l,folderId:g||"",noFolder:t,name:w,eventSource:n})}}catch(e){if("binaryUpload"===(null==e?void 0:e.uploadUrlStage)||!b)throw e;a=await F.uploadFileByUrl({url:l,folderId:g||"",noFolder:t,name:w,eventSource:n})}const x=(null==d?void 0:d.name)||(null==a?void 0:a.name)||"unnamed file";return a&&f.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${h("File")} ${x} ${h("successfully uploaded")}`,placement:"bottomRight",data:{itemName:x,itemId:null==a?void 0:a.id,folderId:g||null,eventSource:n}},r),(d||o)&&(null==k||k(!1),null==m||m.resetFields()),E&&E(Mt),await R({folderId:g||"",noFolder:t,sortBy:c,sortOrder:u,page:i.current,limit:i.pageSize}),a}catch(e){if(!r){const t=fo(e),r=t,i=e,o=Number(null==r?void 0:r.fileSize),a=Number(null==r?void 0:r.maxSize),s=Number.isFinite(o)&&Number.isFinite(a)?{fileSize:o,maxSize:a}:void 0,c="binaryUpload"===(null==i?void 0:i.uploadUrlStage)?po(t,h,s):vo(t,h);f.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:c,placement:"bottomRight",data:{url:null!=l?l:null,folderId:g||null,error:t,eventSource:n},innerException:e})}throw e}finally{null==A||A(!1)}},[m,A,F,f,h,k,E,R,g,c,u,M,N,V,null==s?void 0:s.config]),Y=(0,o.useCallback)(async e=>{if(!e.length)return;const t=x.current;"Trash"!==g?(await $(e),await R({folderId:g||"",sortBy:c,sortOrder:u,page:t.current,limit:t.pageSize})):f.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:h("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:g||null,reason:"Upload to Trash is not allowed"}})},[R,g,c,u,$,f,h]);return{fetchFiles:R,handleDeleteFile:z,handleDeleteFolder:B,handleAddFile:q,handleAddFileByUrl:G,handleDroppedFiles:Y,getFileData:U,findFileByUrl:L,resolveFileForEditByUrl:D,uploadFileWithProvider:V}},Ia=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,i,o);return o},ja=e=>e,Ta=e=>{const t=(e=>e?Ia(e):Ia)(e),r=e=>function(e,t=ja){const r=o.useSyncExternalStore(e.subscribe,o.useCallback(()=>t(e.getState()),[e,t]),o.useCallback(()=>t(e.getInitialState()),[e,t]));return o.useDebugValue(r),r}(t,e);return Object.assign(r,t),r};function Fa(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const Oa=(Ma=e=>({selectedFiles:new Set,visibleFileIds:[],anchorId:null,multiSelect:!0,setMultiSelect:t=>{e(e=>{var r;if(e.multiSelect===t)return e;if(t)return{multiSelect:!0};const n=null!==(r=Array.from(e.selectedFiles)[0])&&void 0!==r?r:null;return{multiSelect:!1,selectedFiles:n?new Set([n]):new Set,anchorId:n}})},syncVisibleFiles:t=>{const r=Array.isArray(t)?t.map(e=>e.id):[];e(e=>{const t=new Set(r),n=new Set(Array.from(e.selectedFiles).filter(e=>t.has(e))),i=e.anchorId&&t.has(e.anchorId)?e.anchorId:null,o=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}(e.visibleFileIds,r),a=Fa(e.selectedFiles,n),s=e.anchorId===i;return o&&a&&s?e:{visibleFileIds:r,selectedFiles:n,anchorId:i}})},setSelectedFiles:t=>{e(e=>{var r;const n=new Set(e.visibleFileIds),i=new Set(Array.from(t).filter(e=>n.has(e)));return Fa(e.selectedFiles,i)?e:{selectedFiles:i,anchorId:null!==(r=Array.from(i)[0])&&void 0!==r?r:null}})},clearSelection:()=>{e(e=>0===e.selectedFiles.size&&null===e.anchorId?e:{selectedFiles:new Set,anchorId:null})},selectAllVisible:()=>{e(e=>{var t;const r=new Set(e.visibleFileIds),n=null!==(t=e.visibleFileIds[0])&&void 0!==t?t:null;return Fa(e.selectedFiles,r)&&e.anchorId===n?e:{selectedFiles:r,anchorId:n}})},toggleFileSelection:(t,r)=>{e(e=>{const n=!1!==e.multiSelect,i=Boolean(null==r?void 0:r.shiftKey)&&n,o=Boolean(null==r?void 0:r.metaKey)||Boolean(null==r?void 0:r.ctrlKey)||Boolean(null==r?void 0:r.forceToggle),a=e.visibleFileIds,s=new Set(a);if(a.length>0&&!s.has(t))return e;if(!n){const r=new Set([t]);return Fa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(i&&e.anchorId&&s.has(e.anchorId)){const r=a.indexOf(e.anchorId),n=a.indexOf(t);if(-1===r||-1===n)return e;const[i,s]=r<n?[r,n]:[n,r],l=a.slice(i,s+1),c=o?new Set(e.selectedFiles):new Set;return l.forEach(e=>{c.add(e)}),Fa(e.selectedFiles,c)?e:{selectedFiles:c}}if(i&&!e.anchorId){const r=new Set([t]);return Fa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(o){const r=new Set(e.selectedFiles);return r.has(t)?r.delete(t):r.add(t),Fa(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}const l=new Set([t]);return Fa(e.selectedFiles,l)&&e.anchorId===t?e:{selectedFiles:l,anchorId:t}})}}),Ma?Ta(Ma):Ta);var Ma;const Pa=e=>{const t=t=>{if(!t)return;const r=e.find(e=>e.id===t);return null==r?void 0:r.name};return{getItemNameById:t,getItemNamesByIds:e=>e.map(t).filter(e=>Boolean(e)),getNamesPreview:e=>e.length>0&&e.length<=5?e.join(", "):null}},Ra=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),La=(e,t,r,n,i,o)=>({itemIds:e,itemNames:o&&o.length?o:void 0,failCount:t,totalCount:r,folderId:null!=n?n:null,errors:i}),Na=()=>{const e=so(),{t:t}=Sn(),{state:r,options:n}=Xi(),{folders:i,pathHistory:a}=r,{dataProviders:s}=n,{actions:{fetchFolders:l,fetchChildFolders:c}}=Co();return{refreshFolders:(0,o.useCallback)(async({parentIds:r,selectedFolder:n})=>{try{if(await l(),r&&c)for(const e of r)e&&await c(e)}catch(r){const n=t("Folders");e.error({id:"FOLDERS_FETCH_FAILED",message:t("Failed to refresh folder tree"),description:n,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{folderId:null,folderName:n,reason:r instanceof Error?r.message:String(r)}})}},[e,t,l,c]),refreshFiles:(0,o.useCallback)(async({fetchFiles:r,selectedFolder:n,page:o,limit:l})=>{try{await r({folderId:n||"",page:o,limit:l})}catch(r){const c=await va({folderId:n||"",dataProviders:s,folders:Array.isArray(i)?i:[],pathHistory:a,t:t}),u=t("Failed to load files"),d=r instanceof Error?r.message:String(r);e.error({id:"FILES_FETCH_FAILED",message:t("Failed to load files in folder",{folderName:c}),description:d&&d!==u?d:void 0,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{params:{folderId:n||void 0,page:o,limit:l,folderName:c},folderName:c}})}},[e,t,s,i,a])}},Da=e=>{const t=(e=>{var t,r,n,i;const{state:a,actions:s,options:l}=Xi(),{t:c}=Sn(),u=Co(),d=so(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=Xi(),{dataProviders:t}=e,{t:r}=Sn(),n=(0,o.useCallback)(async({itemId:n,newName:i,isFolder:o})=>{var a,s,l,c,u,d,h,f;try{if(o){if(!(null==t?void 0:t.renameFolder))throw new Error(r("renameFolder is not implemented in dataProviders"));const o=pr(i.trim(),e.config),c=await t.renameFolder(n,o);return{success:!0,renamedItem:{id:c.id,name:null!==(a=c.name)&&void 0!==a?a:o,parentId:null!==(s=c.parentId)&&void 0!==s?s:null,folderId:null!==(l=c.parentId)&&void 0!==l?l:null}}}if(!(null==t?void 0:t.renameFile))throw new Error(r("renameFile is not implemented in dataProviders"));const p=fr(i,e.config),g=await t.renameFile(n,p);return{success:!0,renamedItem:{id:null!==(c=null==g?void 0:g.id)&&void 0!==c?c:n,name:null!==(u=null==g?void 0:g.name)&&void 0!==u?u:p,folderId:null!==(d=null==g?void 0:g.folderId)&&void 0!==d?d:null,parentId:null!==(f=null!==(h=null==g?void 0:g.parentId)&&void 0!==h?h:null==g?void 0:g.folderId)&&void 0!==f?f:null}}}catch(e){return{success:!1,error:fo(e)}}},[t,r,e.config]);return{renameItem:n}})(),{files:p,selectedFolder:g,fileToRename:m,renameForm:v,isRenameModalVisible:y,pagination:b}=a,{setFileToRename:w,setIsRenameModalVisible:x}=s,{dataProviders:C,config:_}=l,S=e=>{var t,r;if(!e)return null;const n=e;return null!==(r=null!==(t=n.folderId)&&void 0!==t?t:n.parentId)&&void 0!==r?r:null},A=(e,t)=>{var r;return{itemId:null!==(r=null==e?void 0:e.id)&&void 0!==r?r:t,itemName:null==e?void 0:e.name,folderId:S(e)}},k=(0,o.useCallback)(e=>{var t,r;const n=null==p?void 0:p.find(t=>t.id===e);if((null==n?void 0:n.isFolder)||e.startsWith("folder_")){if(!1===(null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder))return void d.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:c("Folder rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFolder))throw new Error(c("renameFolder is not implemented in dataProviders"))}else{if(!1===(null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:c("File rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFile))throw new Error(c("renameFile is not implemented in dataProviders"))}null==w||w(e),null==x||x(!0),n&&v&&v.setFieldsValue({newFileName:n.name})},[p,w,x,v,null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder,null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile,null==C?void 0:C.renameFolder,null==C?void 0:C.renameFile,d,c]),E=(0,o.useCallback)(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),I=(0,o.useCallback)(async()=>{var t,r,n,i,o,a,l,u,y,w,x,C;if(!m||!v)return;const S=null==p?void 0:p.find(e=>e.id===m);try{const p=await v.validateFields();if(!(null==p?void 0:p.newFileName))return;const k=(null==S?void 0:S.isFolder)||m.startsWith("folder_");if(k){if(!1===(null===(t=null==_?void 0:_.features)||void 0===t?void 0:t.enableRenameFolder))return void d.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:c("Folder rename is disabled by config"),placement:"bottomRight",data:A(S,m)})}else if(!1===(null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:c("File rename is disabled by config"),placement:"bottomRight",data:A(S,m)});const I=await f({itemId:m,newName:p.newFileName,isFolder:k});if(!I.success){const e=uo(null===(n=I.error)||void 0===n?void 0:n.code,c);return void d.error({id:"ITEM_RENAME_FAILED",message:null!==(o=null!=e?e:null===(i=I.error)||void 0===i?void 0:i.message)&&void 0!==o?o:c("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{error:I.error}),innerException:I.error})}const j=I.renamedItem;k?(d.success({id:"FOLDER_RENAME_SUCCESS",message:c(`${c("Folder renamed to")} ${null!==(a=null==j?void 0:j.name)&&void 0!==a?a:p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(l=null==j?void 0:j.id)&&void 0!==l?l:m,itemName:null!==(u=null==j?void 0:j.name)&&void 0!==u?u:p.newFileName,folderId:null!==(w=null!==(y=null==j?void 0:j.parentId)&&void 0!==y?y:null==j?void 0:j.folderId)&&void 0!==w?w:null}}),await h(),(null==j?void 0:j.id)&&j.id!==m&&s.setSelectedFolder&&s.setSelectedFolder(j.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${c("File renamed to")} ${null!==(x=null==j?void 0:j.name)&&void 0!==x?x:p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{itemName:null!==(C=null==j?void 0:j.name)&&void 0!==C?C:p.newFileName})}),E(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){const r=fo(e),n=uo(null==r?void 0:r.code,c);d.error({id:"ITEM_RENAME_FAILED",message:null!=n?n:e instanceof Error?e.message:c("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(S,m)),{error:r}),innerException:e})}},[m,v,p,s,E,e,g,c,b,null===(n=null==_?void 0:_.features)||void 0===n?void 0:n.enableRenameFolder,null===(i=null==_?void 0:_.features)||void 0===i?void 0:i.enableRenameFile,d,h,f]);return{state:{isRenamingFile:y||!1,fileToRename:m},actions:{showRenameModal:k,handleRenameCancel:E,handleRenameOk:I}}})(e),r=(e=>{var t;const{state:r,actions:n,options:i}=Xi(),{t:a}=Sn(),s=so(),l=Oa(e=>e.selectedFiles),c=Oa(e=>e.clearSelection),{files:u,selectedFolder:d,moveForm:h,pagination:f,currentMenuFile:p}=r,{setIsMoveModalVisible:g,setPagination:m}=n,{dataProviders:v}=i,{moveItems:y}=(()=>{const{options:e}=Xi(),{dataProviders:t}=e,{t:r}=Sn(),n=so(),i=(0,o.useCallback)(async({items:e,targetFolderId:i,getItemNameById:o,showNotifications:a=!1})=>{let s=0,l=0;const c=[];if(null==t?void 0:t.moveItems)try{const r=await t.moveItems("folders"===i?"":i,e.map(e=>e.id)),n=r.detailed;if(n){const e=n.filter(e=>e.success),t=n.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),r=e.error,n=fo(r);c.push({itemId:t,itemName:o(t),error:n})})}else if(r.success)s+=e.length;else{const t=r.error;if(t){l+=e.length;const r=fo(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const n=fo(t);c.push({error:n})}else l+=e.length,c.push({error:{message:"Move provider is not configured"}});return a&&(s>0&&n.success({id:"FILES_MOVE_SUCCESS",message:r("Files moved"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&n.error({id:"FILES_MOVE_ERROR",message:r("Errors occurred while moving"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,n,r]);return{moveItems:i}})(),{refreshFolders:b,refreshFiles:w}=Na(),{getItemNameById:x,getItemNamesByIds:C,getNamesPreview:_}=Pa(u),S=(0,o.useCallback)(()=>{null==g||g(!0)},[g]),A=(0,o.useCallback)(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),k=(0,o.useCallback)(async t=>{var r,n,o,g,S,k,E,I;if(!((null==p?void 0:p.length)||l&&0!==l.size))return;const j=u.length,T=Object.assign({},f),F=Array.from((null==p?void 0:p.length)?[p]:l),O=F.length;let M=0,P=0;const R=[],L=F.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),N=L.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let l=t;if(!t){const e=await h.validateFields();l=null==e?void 0:e.targetFolder}if(!l)return void s.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:a("Select destination folder"),placement:"bottomRight"});const u="folders"===l?null:l,f=null!=u?u:d,p=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(p&&(null==v?void 0:v.getFolders))try{const e=await v.getFolders({parentId:u,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const r of L){if(!r.isFolder&&!(null===(o=(n=r.id).startsWith)||void 0===o?void 0:o.call(n,"folder_")))continue;const e=r.name||x(r.id)||"";if(e&&t.has(e.toLowerCase()))return void s.error({id:"FOLDER_ALREADY_EXISTS_MOVE",message:a("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:e,targetFolderId:l}})}}catch(e){}if(p&&(null==v?void 0:v.getFiles)&&(null==v?void 0:v.renameFile))try{let e=[];if(null==v?void 0:v.getFiles){const{files:t}=await v.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(null==v?void 0:v.getFolders){const t=(await v.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const t=new Set(e.map(e=>null==e?void 0:e.toLowerCase()).filter(Boolean));for(const r of L){if(r.isFolder||(null===(S=(g=r.id).startsWith)||void 0===S?void 0:S.call(g,"folder_")))continue;const e=r.name||x(r.id)||"";if(!e||!t.has(e.toLowerCase())){t.add(e.toLowerCase());continue}const n=qn(e,Array.from(t));await v.renameFile(r.id,n),t.add(n.toLowerCase())}}catch(e){}const D=await y({items:L,targetFolderId:l,getItemNameById:x,showNotifications:!1});if(M=D.successCount,P=D.failCount,R.push(...D.errorDetails),M>0){const e=C(F),t=_(e),r=t?a("Moved",{names:t}):a("move_success_summary",{successCount:M,totalCount:O});s.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:Ra(F,M,O,u,e)})}if(P>0){const e=C(F),t=_(e);let r;if(1===O&&R.length>0&&(null===(k=R[0].error)||void 0===k?void 0:k.code)){const e=uo(null===(E=R[0].error)||void 0===E?void 0:E.code,a);r=null!=e?e:t?a("Failed",{names:t}):a("move_fail_summary",{failCount:P,totalCount:O})}else r=t?a("Failed",{names:t}):a("move_fail_summary",{failCount:P,totalCount:O});s.error({id:"FILES_MOVE_ERROR",message:r,placement:"bottomRight",innerException:R.length?R:void 0,data:La(F,P,O,u,R.length?R:void 0,e)})}A(),c();let z=T.current;if(M>0&&j>0&&M>=j&&T.current>1&&(z=T.current-1),M>0&&T.total>=M){const e=Math.max(0,(null!==(I=T.total)&&void 0!==I?I:0)-M);null==m||m({current:z,pageSize:T.pageSize,total:e})}N&&await b({parentIds:void 0,selectedFolder:f}),await w({fetchFiles:e,selectedFolder:d,page:z,limit:T.pageSize})}catch(e){const r=uo(fo(e).code,a);s.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=r?r:a("Error moving"),placement:"bottomRight",data:La(F,O,O,d||null,[{error:fo(e)}],C(F))})}},[p,l,h,e,d,f,u,s,m,a,y,c,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==v?void 0:v.getFiles,null==v?void 0:v.renameFile,x]);return{actions:{showMoveModal:S,handleMoveCancel:A,handleMoveOk:k}}})(e),n=(e=>{var t;const{state:r,actions:n,options:i}=Xi(),{t:a}=Sn(),s=so(),l=Oa(e=>e.selectedFiles),c=Oa(e=>e.clearSelection),{files:u,selectedFolder:d,copyForm:h,pagination:f,currentMenuFile:p}=r,{setIsCopyModalVisible:g}=n,{dataProviders:m}=i,{copyItems:v}=(()=>{const{options:e}=Xi(),{dataProviders:t}=e,{t:r}=Sn(),n=so(),i=(0,o.useCallback)(async({items:e,targetFolderId:i,getItemNameById:o,showNotifications:a=!1})=>{let s=0,l=0;const c=[],u="folders"===i?"":i;if(null==t?void 0:t.copyItems)try{const r=await t.copyItems(u,e.map(e=>({id:e.id,newName:e.newName}))),n=r.detailed;if(n){const e=n.filter(e=>e.success),t=n.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),r=e.error,n=fo(r);c.push({itemId:t,itemName:o(t),error:n})})}else if(r.success)s+=e.length;else{const t=r.error;if(t){l+=e.length;const r=fo(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const n=fo(t);c.push({error:n})}else if(null==t?void 0:t.copyItem)for(const r of e)try{const e=(null==r?void 0:r.isFolder)||r.id.startsWith("folder_");await t.copyItem({itemId:r.id,targetFolderId:u,isFolder:e,newName:r.newName})?s++:l++}catch(e){l++;const t=fo(e);c.push({itemId:r.id,itemName:o(r.id),error:t})}else l+=e.length,c.push({error:{message:"Copy provider is not configured"}});return a&&(s>0&&n.success({id:"FILES_COPY_SUCCESS",message:r("Files copied"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&n.error({id:"FILES_COPY_ERROR",message:r("Errors occurred while copying"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,n,r]);return{copyItems:i}})(),{refreshFolders:y,refreshFiles:b}=Na(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=Pa(u),_=(0,o.useCallback)(()=>{null==g||g(!0)},[g]),S=(0,o.useCallback)(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),A=(0,o.useCallback)(async t=>{var r,n,o,g,_;if(!((null==p?void 0:p.length)||l&&0!==l.size))return;const A=Array.from((null==p?void 0:p.length)?[p]:l),k=A.length;let E=0,I=0;const j=[],T=A.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),F=T.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let l=t;if(!t){const e=await h.validateFields();l=null==e?void 0:e.targetFolder}if(!l)return void s.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:a("Select destination folder"),placement:"bottomRight"});const u="folders"===l?null:l,p=null!=u?u:d;let O=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const M=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(M&&(null==m?void 0:m.getFolders))try{const e=await m.getFolders({parentId:u,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const r of T){if(!r.isFolder&&!(null===(o=(n=r.id).startsWith)||void 0===o?void 0:o.call(n,"folder_")))continue;const e=r.name||w(r.id)||"";if(e&&t.has(e.toLowerCase()))return void s.error({id:"FOLDER_ALREADY_EXISTS_COPY",message:a("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:e,targetFolderId:l}})}}catch(e){}if(M&&(null==m?void 0:m.getFiles))try{let e=[];const{files:t}=await m.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),null==m?void 0:m.getFolders){const t=(await m.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const r=[...e];O=T.map(e=>{var t,n;if(e.isFolder||(null===(n=(t=e.id).startsWith)||void 0===n?void 0:n.call(t,"folder_")))return{id:e.id,isFolder:!0};const i=T.find(t=>t.id===e.id),o=(null==i?void 0:i.name)||w(e.id)||"",a=qn(o,r);return r.push(a),{id:e.id,isFolder:!1,newName:a!==o?a:void 0}})}catch(e){}else O=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const P=await v({items:O,targetFolderId:l,getItemNameById:w,showNotifications:!1});if(E=P.successCount,I=P.failCount,j.push(...P.errorDetails),E>0){const e=x(A),t=C(e),r=t?a("Copied",{names:t}):a("copy_success_summary",{successCount:E,totalCount:k});s.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:Ra(A,E,k,u,e)})}if(I>0){const e=x(A),t=C(e);let r;if(1===k&&j.length>0&&(null===(g=j[0].error)||void 0===g?void 0:g.code)){const e=uo(null===(_=j[0].error)||void 0===_?void 0:_.code,a);r=null!=e?e:t?a("Failed",{names:t}):a("copy_fail_summary",{failCount:I,totalCount:k})}else r=t?a("Failed",{names:t}):a("copy_fail_summary",{failCount:I,totalCount:k});s.error({id:"FILES_COPY_ERROR",message:r,placement:"bottomRight",innerException:j.length?j:void 0,data:La(A,I,k,u,j.length?j:void 0,e)})}S(),c(),F&&await y({parentIds:void 0,selectedFolder:p}),await b({fetchFiles:e,selectedFolder:d,page:f.current,limit:f.pageSize})}catch(e){const r=uo(fo(e).code,a);s.error({id:"FILES_COPY_ERROR",message:null!=r?r:a("Error copying"),innerException:e,placement:"bottomRight",data:La(A,k,k,d||null,[{error:fo(e)}],x(A))})}},[p,l,h,e,d,f,u,s,a,v,c,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==m?void 0:m.getFiles,w]);return{actions:{showCopyModal:_,handleCopyCancel:S,handleCopyOk:A}}})(e),i=(e=>{const{state:t,actions:r,options:n}=Xi(),{t:i}=Sn(),a=so(),s=Oa(e=>e.selectedFiles),l=Oa(e=>e.clearSelection),{files:c,selectedFolder:u,pagination:d,currentMenuFile:h}=t,{setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=_o(),{refreshFolders:y,refreshFiles:b}=Na(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=Pa(c),_=(0,o.useCallback)(()=>{null==f||f(!0)},[f]),S=(0,o.useCallback)(()=>{null==f||f(!1)},[f]),A=(0,o.useCallback)(async()=>{var t,r,n;if(!((null==h?void 0:h.length)||s&&0!==s.size))return void(null==f||f(!1));const o=c.length,_=Object.assign({},d),S=Array.from(h?[h]:s),A=S.map(e=>c.find(t=>t.id===e)).filter(e=>Boolean(e)),k=new Set;A.forEach(e=>{(null==e?void 0:e.isFolder)&&k.add((e=>{var t,r;if(!e)return null;const n=e;return null!==(r=null!==(t=n.folderId)&&void 0!==t?t:n.parentId)&&void 0!==r?r:null})(e))});let E=0,I=0;const j=[];try{const s=await v({items:A,selectedFolder:u,getItemNameById:w,showNotifications:!1});E=s.successCount,I=s.failCount,j.push(...s.errorDetails);const c=(null==m?void 0:m.enableTrashFolder)&&"Trash"===u;if(E>0&&(null==m?void 0:m.enableTrashFolder)&&!c&&(null==p||p({itemIds:S,sourceFolderId:u||"folders"})),E>0){const e=S.length;(null==m?void 0:m.enableTrashFolder)&&!c?await a.success({id:"FILES_DELETE_SUCCESS",message:i("moved_to_trash",{count:E}),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:u||null}}):await a.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:u||null}})}if(I>0){const e=x(S),n=C(e),o=S.length,s=1===o&&j.length>0&&(null===(t=j[0].error)||void 0===t?void 0:t.code),l=(null==m?void 0:m.enableTrashFolder)&&!c,u=i(l?"\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438":"\u041f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438"),d=s?uo(null===(r=j[0].error)||void 0===r?void 0:r.code,i):void 0,h=null!=d?d:n?i("Failed",{names:n}):u;a.error({id:"FILES_DELETE_ERROR",message:h,placement:"bottomRight",innerException:j.length?j:void 0,data:{failCount:I,isTrashMove:l,totalCount:o,itemNames:e,errors:j.length?j:void 0}})}l(),null==f||f(!1),await y({parentIds:Array.from(k),selectedFolder:u});let d=_.current;if(E>0&&o>0&&E>=o&&_.current>1&&(d=_.current-1),E>0&&_.total>=E){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-E);null==g||g({current:d,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:u,page:d,limit:_.pageSize})}catch(e){a.error({id:"FILES_DELETE_ERROR",message:i("Error deleting"),placement:"bottomRight",innerException:e,data:{failCount:I,totalCount:A.length}})}},[h,s,f,e,u,d,p,g,c,i,a,v,l,null==m?void 0:m.enableTrashFolder]);return{actions:{showDeleteConfirm:_,handleDeleteConfirmCancel:S,handleDeleteConfirmOk:A}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),r.actions),n.actions),i.actions)}};function za({maxConcurrent:e=6}={}){const t=(0,o.useRef)(new Map),r=(0,o.useRef)([]),n=(0,o.useRef)(0),i=(0,o.useMemo)(()=>{const i=e=>({status:e.status,shouldLoad:"loading"===e.status||"loaded"===e.status||"error"===e.status}),o=e=>{const t=i(e);e.listeners.forEach(e=>e(t))},a=e=>{0!==r.current.length&&(r.current=r.current.filter(t=>t!==e))},s=(e,r)=>{const n=t.current.get(e);if(!n){const n={id:e,src:r,status:"idle",listeners:new Set,active:!1};return t.current.set(e,n),n}return n.src!==r&&(a(e),n.src=r,n.status="idle"),n},l=()=>{for(;n.current<e&&r.current.length>0;){const e=r.current.shift();if(!e)break;const i=t.current.get(e);i&&i.active&&"queued"===i.status&&(i.status="loading",n.current+=1,o(i))}},c=(e,t)=>{"loading"===e.status&&(e.status=t,n.current=Math.max(0,n.current-1),o(e),l())};return{getSnapshot:(e,t)=>i(s(e,t)),subscribe:(e,r,n)=>{const o=s(e,r);return o.listeners.add(n),n(i(o)),()=>{const r=t.current.get(e);r&&(r.listeners.delete(n),r.active||0!==r.listeners.size||"loading"===r.status||t.current.delete(e))}},setActive:(e,t,i)=>{const c=s(e,t);c.active=i,i?"loaded"!==c.status&&"loading"!==c.status&&"queued"!==c.status?(c.status="queued",o(c),r.current.includes(e)||r.current.push(e),l()):o(c):"queued"===c.status?(a(e),c.status="idle",o(c)):"loading"===c.status&&(n.current=Math.max(0,n.current-1),c.status="idle",o(c),l())},markLoaded:e=>{const r=t.current.get(e);r&&c(r,"loaded")},markError:e=>{const r=t.current.get(e);r&&c(r,"error")},release:e=>{const r=t.current.get(e);r&&(r.active=!1,"queued"===r.status?(a(e),r.status="idle"):"loading"===r.status&&(n.current=Math.max(0,n.current-1),r.status="idle",l()),0===r.listeners.size&&t.current.delete(e))}}},[e]);return(0,o.useEffect)(()=>()=>{r.current=[],t.current.clear(),n.current=0},[]),i}function Ba(e){var t;if(e&&"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q=="!==e){if(e.startsWith("data:image/")){const t=e.split(",")[1];return t&&t.length>20?e:void 0}return e.startsWith("blob:")?e:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?null!==(t=(e=>{if(e&&"string"==typeof e){if(e.startsWith("data:")||e.startsWith("blob:"))return e;try{if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")){const t=new URL(e.startsWith("/")?`https://x${e}`:e),r=e.startsWith("/")?"":`${t.protocol}//${t.host}`,n=t.pathname.split("/").map(e=>{if(!e)return"";try{return encodeURIComponent(decodeURIComponent(e))}catch(t){return encodeURIComponent(e)}}).join("/");return e.startsWith("/")?n+(t.search||"")+(t.hash||""):`${r}${n}${t.search}${t.hash}`}}catch(e){}return e}})(e))&&void 0!==t?t:e:void 0}}function Ua(e,t){var r;if(!e)return null;const n=Ba(null!==(r=e.src)&&void 0!==r?r:void 0);return e.exhausted?Object.assign(Object.assign({},e),{src:null}):n?Object.assign(Object.assign({},e),{src:n}):Object.assign(Object.assign({},e),{src:null!=t?t:null,changed:!1,reason:"unchanged"})}function Va(e){var t;const{options:r}=Xi(),n=null===(t=r.config)||void 0===t?void 0:t.getProxiedUrl,i=(0,o.useRef)([]),a=(0,o.useRef)(!1),s=(0,o.useRef)(0),l=(0,o.useRef)(null),[c,u]=(0,o.useState)(!1),d=(0,o.useMemo)(()=>{const t=e.map(e=>Ba(e)).filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t);return function(e,t){return e===t||e.length===t.length&&e.every((e,r)=>e===t[r])}(i.current,t)?i.current:(i.current=t,t)},[e]),[h,f]=(0,o.useState)([]),[p,g]=(0,o.useState)(0);(0,o.useEffect)(()=>{let e=!1;if(g(0),a.current=!1,s.current=0,l.current=null,u(!1),0!==d.length)return(async()=>{const t=await Promise.all(d.map(async e=>{if(!n||!(t=e).startsWith("http://")&&!t.startsWith("https://"))return[{originalSrc:e,src:e}];var t;try{const t=await Promise.resolve(n(e)),r=Ba(null==t?void 0:t.src);return r?[{originalSrc:e,src:r,stabilityKey:t.stabilityKey,handleChangeSrc:t.handleChangeSrc,handleSuccess:t.handleSuccess,handleError:t.handleError,subscribeToSrcChange:t.subscribeToSrcChange}]:[{originalSrc:e,src:e}]}catch(t){return[{originalSrc:e,src:e}]}}));if(!e){const e=function(e){const t=new Set;return e.filter(e=>!(!e.src||t.has(e.src)||(t.add(e.src),0)))}(t.flat());f(t=>function(e,t){return e===t||e.length===t.length&&e.every((e,r)=>{const n=t[r];return e.originalSrc===n.originalSrc&&e.src===n.src&&e.stabilityKey===n.stabilityKey})}(t,e)?t:e)}})(),()=>{e=!0};f(e=>0===e.length?e:[])},[n,d]);const m=h[p];(0,o.useEffect)(()=>{if(!(null==m?void 0:m.subscribeToSrcChange))return;let e,t=!1;return Promise.resolve(m.subscribeToSrcChange(e=>{if(t||a.current)return;const r=Ua(e,m.src);(null==r?void 0:r.changed)&&r.src&&!t&&f(e=>e.map((e,t)=>t===p?Object.assign(Object.assign({},e),{src:r.src}):e))})).then(r=>{t?null==r||r():e=r}),()=>{t=!0,null==e||e()}},[m,p]),(0,o.useEffect)(()=>{var e;if(!(null==m?void 0:m.handleChangeSrc))return;if(a.current)return;const t=`${m.originalSrc}::${null!==(e=m.stabilityKey)&&void 0!==e?e:""}::${p}`;if(l.current===t)return;l.current=t;let r=!1;return Promise.resolve(m.handleChangeSrc()).then(e=>{const t=Ua(e,m.src);(null==t?void 0:t.changed)&&t.src&&!r&&f(e=>e.map((e,r)=>r===p?Object.assign(Object.assign({},e),{src:t.src}):e))}),()=>{r=!0}},[m,p]);const v=(0,o.useCallback)(async()=>{var e;if(!(null==m?void 0:m.handleChangeSrc))return{src:null!==(e=null==m?void 0:m.src)&&void 0!==e?e:null,changed:!1,exhausted:!1,reason:"unchanged"};if(a.current)return{src:null,changed:!1,exhausted:!0,reason:"exhausted"};const t=Ua(await Promise.resolve(m.handleChangeSrc()),m.src);return(null==t?void 0:t.changed)&&t.src&&t.src!==m.src?(f(e=>e.map((e,r)=>r===p?Object.assign(Object.assign({},e),{src:t.src}):e)),t):null!=t?t:{src:m.src,changed:!1,exhausted:!1,reason:"unchanged"}},[m,p]),y=(0,o.useCallback)(async()=>{var e,t;if(a.current)return{src:null,changed:!1,exhausted:!0,reason:"exhausted"};if(!m)return a.current=!0,u(!0),{src:null,changed:!1,exhausted:!0,reason:"exhausted"};const r=(n=h.length,Math.max(8,6*n));var n;if(s.current>=r)return a.current=!0,u(!0),{src:null,changed:!1,exhausted:!0,reason:"exhausted"};s.current+=1;const i=m.handleError?Ua(await Promise.resolve(m.handleError()),m.src):null;return(null==i?void 0:i.exhausted)?(a.current=!0,u(!0),i):(null==i?void 0:i.changed)&&i.src&&i.src!==m.src?(f(e=>e.map((e,t)=>t===p?Object.assign(Object.assign({},e),{src:i.src}):e)),i):p+1>=h.length?(a.current=!0,u(!0),null!=i?i:{src:null,changed:!1,exhausted:!0,reason:"exhausted"}):(g(e=>e+1),{src:null!==(t=null===(e=h[p+1])||void 0===e?void 0:e.src)&&void 0!==t?t:null,changed:!0,exhausted:!1,reason:"candidate-fallback"})},[m,p,h]),b=(0,o.useCallback)(()=>{var e;a.current||m&&(s.current=0,null===(e=m.handleSuccess)||void 0===e||e.call(m))},[m]);return{src:c||null==m?void 0:m.src,hasNextCandidate:p+1<h.length,handleError:y,handleLoad:b,handleChangeSrc:v}}const Ha=/(auto|scroll|overlay)/;function Wa(e,t){const r=Math.max(0,null!=t?t:e.clientWidth);return Math.max(1,Math.round(r-function(e){if("undefined"==typeof window)return 0;const t=window.getComputedStyle(e);return(Number.parseFloat(t.paddingLeft||"0")||0)+(Number.parseFloat(t.paddingRight||"0")||0)}(e)))}function $a(e){if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return Ha.test(t.overflowY)||Ha.test(t.overflow)||Ha.test(t.overflowX)}function qa(e){if("undefined"==typeof window)return e;let t=e;for(;t;){if($a(t))return t;t=t.parentElement}return null}function Ga(e){if("undefined"==typeof window)return[e];const t=qa(e);return t?t===e?[window,e]:[window,t]:[window]}function Ya(e,t,r){return Math.max(0,e.clientHeight),Math.max(0,Math.round(e.getBoundingClientRect().height)),Math.max(1,t)}function Xa(e){if("undefined"==typeof window)return{scrollTop:e.scrollTop,viewportHeight:Math.max(1,e.clientHeight),viewportWidth:Wa(e),scrollHeight:e.scrollHeight};const t=qa(e);return t&&function(e){return e.scrollHeight-e.clientHeight>1}(t)?function(e,t){if(e===t){const r=function(e){var t;if("undefined"==typeof window)return Math.max(1,e.clientHeight);const r=e.getBoundingClientRect(),n=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,i=Math.max(0,r.top),o=Math.min(n,r.bottom);return Math.max(0,Math.round(o-i))}(t);return{scrollTop:t.scrollTop,viewportHeight:Ya(e,Math.min(t.clientHeight,r||t.clientHeight)),viewportWidth:Wa(t),scrollHeight:e.scrollHeight}}const r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=Math.max(r.top,n.top),o=Math.min(r.bottom,n.bottom),a=Math.max(r.left,n.left),s=Math.min(r.right,n.right),l=Math.max(0,Math.round(o-i)),c=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(i-n.top)),viewportHeight:Ya(e,l),viewportWidth:Wa(e,c||t.clientWidth||e.clientWidth),scrollHeight:e.scrollHeight}}(e,t):function(e){var t,r;const n=e.getBoundingClientRect(),i=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,o=window.innerWidth||(null===(r=document.documentElement)||void 0===r?void 0:r.clientWidth)||n.width,a=Math.max(0,n.top),s=Math.min(i,n.bottom),l=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(-n.top)),viewportHeight:Ya(e,l),viewportWidth:Wa(e,Math.min(Math.round(n.width),o)),scrollHeight:e.scrollHeight}}(e)}function Ka(e,t){const r=(0,o.useRef)(null),n=(0,o.useCallback)(t=>{e(Xa(t))},[e]);return(0,o.useEffect)(()=>{r.current&&n(r.current)},[n,...t]),(0,o.useEffect)(()=>{if(!r.current||"undefined"==typeof ResizeObserver)return;const e=r.current,t=new ResizeObserver(()=>{n(e)});return t.observe(e),()=>t.disconnect()},[n]),(0,o.useEffect)(()=>{const e=r.current;if(!e)return;const t=()=>{n(e)},i=Ga(e);return i.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{i.forEach(e=>{e.removeEventListener("scroll",t)})}},[n,...t]),r}const Za=({onSearch:e,placeholder:t,className:r})=>{const{t:n}=Sn(),[a,s]=(0,o.useState)(""),l=(0,o.useRef)(null),{options:c}=Xi(),{config:u}=c,d=t||n("Search files...");return(0,o.useEffect)(()=>(l.current=ro.debounce(t=>{e(t)},500),()=>{var e;null===(e=l.current)||void 0===e||e.cancel()}),[e]),(0,i.jsx)(h.A,{value:a,onChange:e=>{var t;const r=e.target.value;s(r),null===(t=l.current)||void 0===t||t.call(l,r)},placeholder:d,prefix:(0,i.jsx)(hi,{size:16,strokeWidth:null==u?void 0:u.iconStrokeWidth}),className:r,allowClear:!0,onClear:()=>{s(""),e("")}})},Qa=[{value:"date-desc",labelKey:"Newest first"},{value:"date-asc",labelKey:"Oldest first"},{value:"size-desc",labelKey:"Largest first"},{value:"size-asc",labelKey:"Smallest first"},{value:"name-asc",labelKey:"A-Z"},{value:"name-desc",labelKey:"Z-A"},{value:"type-asc",labelKey:"By type"}];var Ja={contentLayout:"contentLayout",headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",filesLoadingOverlay:"filesLoadingOverlay",emptyStateWrapper:"emptyStateWrapper",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",tableLoadingWrapper:"tableLoadingWrapper",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",buttonSelectAll:"buttonSelectAll",gridRow:"gridRow",gridCard:"gridCard",selectedRow:"selectedRow",gridCardSelected:"gridCardSelected",gridCheckbox:"gridCheckbox",gridCardContent:"gridCardContent",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",gridFileMenu:"gridFileMenu",gridFileMenuButton:"gridFileMenuButton",actionsBox:"actionsBox",uploadContainer:"uploadContainer",uploadArea:"uploadArea",blockText:"blockText",textTitle:"textTitle",textDescription:"textDescription",buttons:"buttons",btnAi:"btnAi",btnPhoto:"btnPhoto",dragOverlay:"dragOverlay",dragOverlayInner:"dragOverlayInner",dragCaptureLayer:"dragCaptureLayer",dragOverlayGlobal:"dragOverlayGlobal",noFiles:"noFiles",noFilesIcon:"noFilesIcon",textTitle_trash:"textTitle_trash",textDescription_trash:"textDescription_trash"};const{Text:es}=f.A,{Option:ts}=p.A,rs=o.memo(({files:e,filesById:t,currentSortOption:r,isSmallScreen:n,iconStrokeWidth:a,multiSelectEnabled:s=!0,features:l,viewMode:c,setViewMode:u,handleSearch:d,handleSortOptionChange:h,sortOptions:f,onClearSelection:b,onRename:w,onDelete:x,onCopy:C,onMove:_,onEdit:S,t:A})=>{const k=(0,o.useMemo)(()=>(null==f?void 0:f.length)?Qa.filter(e=>f.includes(e.value)):Qa,[f]),E=(0,o.useMemo)(()=>k.map(e=>e.value).join("|")||"all",[k]),I=Oa(e=>e.selectedFiles),j=Oa(e=>e.selectedFiles.size),T=Oa(e=>e.selectAllVisible),F=e.length>0&&j===e.length,O=(0,o.useMemo)(()=>Array.from(I)[0],[I]),M=(0,o.useMemo)(()=>O?t.get(O):void 0,[t,O]),P=(null==M?void 0:M.isFolder)?!1!==(null==l?void 0:l.enableRenameFolder):!1!==(null==l?void 0:l.enableRenameFile),R=(0,o.useMemo)(()=>Array.from(I).every(e=>{const r=t.get(e);return!!r&&(r.isFolder?!1!==(null==l?void 0:l.enableMoveFolder):!1!==(null==l?void 0:l.enableMoveItem))}),[l,t,I]),L=(0,o.useMemo)(()=>Array.from(I).every(e=>{const r=t.get(e);return!!r&&(r.isFolder?!1!==(null==l?void 0:l.enableCopyFolder):!1!==(null==l?void 0:l.enableCopyItem))}),[l,t,I]),N=(0,o.useMemo)(()=>1===j&&function(e){var t,r,n;if(!e||e.isFolder)return!1;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&qt.includes(i.toLowerCase()))}(M),[j,M]);return(0,i.jsxs)("div",j>0?{className:`header-container ${Ja.headerContainer}`,children:[(0,i.jsxs)(es,{type:"secondary",className:"selected-text",children:[(0,i.jsxs)("div",{children:[j," ",A("selected")]}),s&&(0,i.jsx)(g.A,{title:n?A("Select all"):null,children:(0,i.jsx)(m.Ay,{className:Ja.buttonSelectAll,onClick:T,disabled:F||0===e.length,children:A("Select all")})}),(0,i.jsx)(g.A,{title:n?A("Deselected"):null,children:(0,i.jsx)(m.Ay,{className:Ja.buttonDeselected,icon:(0,i.jsx)(di,{size:16,strokeWidth:a}),onClick:b,children:A("Deselected")})})]}),(0,i.jsxs)(v.A,{children:[N&&!1!==(null==l?void 0:l.enableEdit)&&(0,i.jsx)(g.A,{title:n?A("Edit"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(Zn,{size:16,strokeWidth:a}),onClick:()=>S(M),disabled:!N,children:A("Edit")})}),R&&(0,i.jsx)(g.A,{title:n?A("Move to"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(Jn,{size:16,strokeWidth:a}),onClick:_,children:A("Move to")})}),L&&(0,i.jsx)(g.A,{title:n?A("Copy"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(Kn,{size:16,strokeWidth:a}),onClick:C,children:A("Copy")})}),1===j&&P&&(0,i.jsx)(g.A,{title:n?A("Rename"):null,children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(pi,{size:16,strokeWidth:a}),onClick:()=>w(),disabled:1!==j||!P,children:A("Rename")})}),!1!==(null==l?void 0:l.enableDelete)&&(0,i.jsx)(g.A,{title:n?A("Delete"):null,children:(0,i.jsx)(m.Ay,{danger:!0,icon:(0,i.jsx)(mi,{size:16,strokeWidth:a}),onClick:e=>{e.stopPropagation(),e.preventDefault(),x()},children:A("Delete")})})]})]}:{className:Ja.headerContainer,children:[(0,i.jsx)("div",{className:"search-container",children:(0,i.jsx)(Za,{placeholder:A("Search file or folder"),onSearch:d,className:Ja.searchInput})}),(0,i.jsxs)("div",{className:Ja.actionsBox,children:[(0,i.jsx)("div",{className:"sort-container",children:(0,i.jsx)(p.A,{value:r,onChange:h,className:Ja.sortSelect,popupMatchSelectWidth:!1,suffixIcon:(0,i.jsx)(Yn,{size:16,strokeWidth:a}),children:k.map(({value:e,labelKey:t})=>(0,i.jsx)(ts,{value:e,children:A(t)},e))},E)}),(0,i.jsx)("div",{className:Ja.actionsContainer,children:(0,i.jsx)(y.A,{options:[{value:"grid",icon:(0,i.jsx)(ni,{size:16,strokeWidth:a})},{value:"table",icon:(0,i.jsx)(ai,{size:20,strokeWidth:a})}],value:c,onChange:e=>u(e)})})]})]})});rs.displayName="FileContentHeader";const ns=o.memo(({fileId:e,style:t})=>{const r=Oa(t=>t.selectedFiles.has(e)),n=Oa(e=>e.toggleFileSelection);return(0,i.jsx)(b.A,{checked:r,style:t,onClick:e=>{e.stopPropagation()},onChange:t=>{const r=t.nativeEvent;n(e,{metaKey:r.metaKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,forceToggle:!0})}})});function is(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}ns.displayName="FileSelectionCheckbox","function"==typeof SuppressedError&&SuppressedError;const os=o.memo(e=>{var{className:t}=e,r=is(e,["className"]);const n=r["data-row-key"],o=null==n?"":String(n),a=[t,Oa(e=>!!o&&e.selectedFiles.has(o))?Ja.selectedRow:""].filter(Boolean).join(" ");return(0,i.jsx)("tr",Object.assign({},r,{className:a}))});os.displayName="SelectableTableRow";const as=o.memo(({item:e,variant:t="table",t:r,iconStrokeWidth:n,setCurrentMenuFile:a,showMoveModal:s,showCopyModal:l,showRenameModal:c,showDeleteConfirm:u,onEdit:d})=>{const[h,f]=(0,o.useState)(!1),p=(0,o.useMemo)(()=>{if(!h)return[];const t=[];return e.canEdit&&t.push({key:"edit",label:r("Edit"),icon:(0,i.jsx)(Zn,{size:16,strokeWidth:n})}),e.canMove&&t.push({key:"move",label:r("Move to"),icon:(0,i.jsx)(Jn,{size:16,strokeWidth:n})}),e.canCopy&&t.push({key:"copy",label:r("Copy"),icon:(0,i.jsx)(Kn,{size:16,strokeWidth:n})}),e.canRename&&t.push({key:"rename",label:r("Rename"),icon:(0,i.jsx)(pi,{size:16,strokeWidth:n})}),e.canDelete&&t.push({key:"delete",label:r("Delete"),icon:(0,i.jsx)(mi,{size:16,strokeWidth:n}),style:{color:"#ff4d4f"}}),t},[n,h,e.canCopy,e.canDelete,e.canEdit,e.canMove,e.canRename,r]),g=(0,o.useCallback)(({key:t})=>{switch(e.id&&(null==a||a(e.id)),t){case"edit":d(e.file);break;case"move":s();break;case"copy":l();break;case"rename":c(e.id);break;case"delete":null==u||u();break;default:null==a||a("")}},[e,d,a,l,u,s,c]),v=(0,o.useMemo)(()=>({items:p,onClick:g}),[g,p]);return(0,i.jsx)(w.A,{arrow:!0,placement:"bottom",menu:v,trigger:["hover"],onOpenChange:f,children:"grid"===t?(0,i.jsx)(m.Ay,{type:"default",className:`${Ja.gridFileMenuButton} gridFileMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,i.jsx)(Qn,{size:16,strokeWidth:n})}):(0,i.jsx)("span",{className:`${Ja.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,i.jsx)(Qn,{size:16,strokeWidth:n})})})});as.displayName="FileItemActionsDropdown";const ss=({thumbnailSrc:e,previewSrc:t,lightboxSrc:r,alt:n,className:a,width:s,height:l,preview:c=!1})=>{var u,d;const h=(0,o.useMemo)(()=>[e,t],[e,t]),f=(0,o.useMemo)(()=>[r,t,e],[r,t,e]),p=Va(h),g=Va(f),{handleError:m,handleLoad:v}=g,y=null!==(u=p.src)&&void 0!==u?u:$t,b=null!==(d=g.src)&&void 0!==d?d:p.src,w=(0,o.useRef)(!1);(0,o.useEffect)(()=>{w.current=!1},[b]);const C=(0,o.useCallback)(e=>o.cloneElement(e,{key:null!=b?b:$t,src:null!=b?b:$t,fallback:void 0,onError:()=>{w.current||(w.current=!0,m().finally(()=>{w.current=!1}).catch(()=>{}))},onLoad:()=>{v()}}),[b,m,v]),_=(0,o.useMemo)(()=>!(!c||!b)&&{src:b,toolbarRender:()=>null,destroyOnHidden:!0,mask:(0,i.jsx)(Q.A,{style:{fontSize:"20px"}}),imageRender:C},[c,b,C]);return(0,i.jsx)(x.A,{className:a,src:y,alt:n,width:s,height:l,preview:_,onLoad:p.handleLoad,onError:()=>{p.handleError().catch(()=>{})},fallback:$t})},ls=o.memo(({item:e,variant:t="table",FolderIcon:r,getFileData:n,className:o,width:a,height:s})=>e.isFolder?(0,i.jsx)("div","grid"===t?{className:Ja.gridFolderIcon,children:(0,i.jsx)(r,{className:Ja.gridFolderIconImage})}:{className:Ja.fileManagerTableFolder,children:(0,i.jsx)("div",{className:Ja.fileManagerTableFolderInner,children:(0,i.jsx)(r,{className:Ja.tableFolderIcon,style:{width:null!=a?a:40,height:null!=s?s:40}})})}):e.thumbnailSrc||e.previewSrc?(0,i.jsx)(ss,{className:o,thumbnailSrc:e.thumbnailSrc,previewSrc:e.previewSrc,lightboxSrc:e.lightboxSrc,alt:e.file.name,width:a,height:s,preview:!0,file:e.file,getFileData:n}):null);ls.displayName="FileItemPreview";const cs=[".ant-image",".ant-image-preview-root",".ant-image-preview-wrap",".ant-image-preview-mask",".ant-image-preview-close",".ant-image-preview-operations"].join(","),us=e=>Boolean(e.closest(cs));function ds(e){var t,r,n;if(e.isFolder)return!1;const i="string"==typeof e.name?e.name:"",o=i?null===(t=i.split(".").pop())||void 0===t?void 0:t.toLowerCase():void 0,a=null!==(n=null===(r=e.extension)||void 0===r?void 0:r.toLowerCase())&&void 0!==n?n:o;return"string"==typeof e.type&&e.type.startsWith("image/")||"string"==typeof a&&Gt.includes(a)}const hs=o.memo(({item:e,t:t,iconStrokeWidth:r,FolderIcon:n,handleItemClick:a,setCurrentMenuFile:s,showMoveModal:l,showCopyModal:c,showRenameModal:u,showDeleteConfirm:d,onEdit:h,onEditorOk:f,getFileData:p,showSelectionCheckbox:g=!0})=>{const m=Oa(t=>t.selectedFiles.has(e.id)),v=(0,o.useCallback)(t=>{const r=t.target;r.closest(".gridFileMenuButton")||r.closest(".ant-dropdown-menu")||us(r)||1===t.detail&&(e.isFolder?a(e.file):f&&ds(e.file)&&f(e.file))},[a,e.file,e.isFolder,f]);return(0,i.jsx)(C.A,{className:Ja.gridCard_col,style:{padding:0},children:(0,i.jsxs)(_.A,{hoverable:!0,cover:(0,i.jsx)("div",{className:e.isFolder?Ja.gridPreviewContainerFolder:Ja.gridPreviewContainer,onClick:e=>{e.stopPropagation(),v(e)},children:(0,i.jsx)(ls,{item:e,variant:"grid",FolderIcon:n,getFileData:p,className:Ja.gridImagePreview})}),className:`${Ja.gridCard} ${m?Ja.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),v(e)},children:[(0,i.jsxs)("div",{className:Ja.gridCardContent,onClick:e=>{e.stopPropagation(),e.preventDefault(),v(e)},children:[(0,i.jsx)("div",{className:Ja.gridFileName,children:e.nameText||t("Untitled")}),(0,i.jsx)("div",{className:Ja.gridFileInfo,children:e.gridInfoText})]}),(0,i.jsx)("div",{className:Ja.gridFileMenu,onClick:e=>{e.stopPropagation()},children:(0,i.jsx)(as,{item:e,variant:"grid",t:t,iconStrokeWidth:r,setCurrentMenuFile:s,showMoveModal:l,showCopyModal:c,showRenameModal:u,showDeleteConfirm:d,onEdit:h})}),g?(0,i.jsx)("div",{onClick:e=>{e.stopPropagation()},className:Ja.gridCheckbox,children:(0,i.jsx)(ns,{fileId:e.id,style:{height:20}})}):null]})})});hs.displayName="FileGridItem";const fs=o.memo(({rows:e,topOffset:t=0,bottomOffset:r=0,t:n,iconStrokeWidth:o,FolderIcon:a,handleItemClick:s,setCurrentMenuFile:l,showMoveModal:c,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f,onEditorOk:p,getFileData:g,showSelectionCheckbox:m=!0})=>(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{style:{paddingTop:t,paddingBottom:r},children:(0,i.jsx)(S.A,{gutter:[16,16],className:Ja.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:e.map(e=>(0,i.jsx)(hs,{item:e,handleItemClick:s,iconStrokeWidth:o,t:n,FolderIcon:a,setCurrentMenuFile:l,showMoveModal:c,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f,onEditorOk:p,getFileData:g,showSelectionCheckbox:m},e.id))})})}));fs.displayName="FileGridView";const ps=o.memo(({rows:e,columns:t,topOffset:r=0,bottomOffset:n=0,onRow:a,components:s})=>{const l=(0,o.useMemo)(()=>(0,i.jsx)("div",{style:{paddingTop:r,paddingBottom:n},children:(0,i.jsx)(c.Ay,{renderEmpty:()=>(0,i.jsx)(A.A,{image:(0,i.jsx)(i.Fragment,{}),description:""}),children:(0,i.jsx)(k.A,{dataSource:e,columns:t,rowKey:"id",pagination:!1,tableLayout:"fixed",onRow:a,components:s,showHeader:!1})})}),[n,t,s,a,e,r]);return(0,i.jsx)("div",{className:Ja.tableLoadingWrapper,children:l})});ps.displayName="FileTableView";const gs=o.memo(({item:e})=>e.dateText?(0,i.jsx)(g.A,{title:e.dateText,placement:"bottom",className:Ja.fileDate,children:e.dateText}):null);gs.displayName="FileItemDate";const ms=o.memo(({item:e})=>(0,i.jsxs)("div",{className:Ja.fileName,children:[e.nameText,e.isFolder&&(0,i.jsx)("div",{className:Ja.fileItemCount,children:e.folderItemsText})]}));ms.displayName="FileItemName";const vs="filemanager_view_mode";class ys{constructor(){this.rowsById=new Map}reconcile(e,t,r){const n=new Map,i=[];for(const o of e){const e=t.getId(o),a=t.buildSignature(o,r),s=this.rowsById.get(e);if(s&&s.signature===a){n.set(e,s),i.push(s);continue}const l=t.buildRowModel(o,r,{id:e,signature:a});n.set(e,l),i.push(l)}return this.rowsById=n,i}}class bs{createRenderWindow(e,t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S,A,k;const E=null!==(r=null==t?void 0:t.renderStrategy)&&void 0!==r?r:"full";if("windowed"!==E){if("positioned"===E){const r=null!==(i=null===(n=null==t?void 0:t.positioned)||void 0===n?void 0:n.layout)&&void 0!==i?i:[],v=null!==(a=null===(o=null==t?void 0:t.positioned)||void 0===o?void 0:o.viewportTop)&&void 0!==a?a:0,y=null!==(l=null===(s=null==t?void 0:t.positioned)||void 0===s?void 0:s.viewportBottom)&&void 0!==l?l:Number.MAX_SAFE_INTEGER,b=Math.max(0,null!==(u=null===(c=null==t?void 0:t.positioned)||void 0===c?void 0:c.overscanPx)&&void 0!==u?u:0),w=Math.max(0,null!==(h=null===(d=null==t?void 0:t.positioned)||void 0===d?void 0:d.containerHeight)&&void 0!==h?h:0),x=r.filter(e=>e.bottom>=v-b&&e.top<=y+b).map(t=>({row:e[t.index],layout:t})).filter(e=>Boolean(e.row)),C=null!==(p=null===(f=x[0])||void 0===f?void 0:f.layout.index)&&void 0!==p?p:-1,_=null!==(m=null===(g=x[x.length-1])||void 0===g?void 0:g.layout.index)&&void 0!==m?m:-1;return{rows:x.map(e=>e.row),startIndex:C,endIndex:_,topOffset:0,bottomOffset:0,totalCount:e.length,containerHeight:w,positionedItems:x}}return{rows:e,startIndex:0,endIndex:e.length>0?e.length-1:-1,topOffset:0,bottomOffset:0,totalCount:e.length}}const I=Math.max(0,null!==(y=null===(v=null==t?void 0:t.windowed)||void 0===v?void 0:v.startIndex)&&void 0!==y?y:0),j=null!==(w=null===(b=null==t?void 0:t.windowed)||void 0===b?void 0:b.endIndex)&&void 0!==w?w:e.length-1,T=Math.max(0,null!==(C=null===(x=null==t?void 0:t.windowed)||void 0===x?void 0:x.overscan)&&void 0!==C?C:0),F=Math.max(1,null!==(S=null===(_=null==t?void 0:t.windowed)||void 0===_?void 0:_.estimatedItemSize)&&void 0!==S?S:1),O=Math.max(1,null!==(k=null===(A=null==t?void 0:t.windowed)||void 0===A?void 0:A.itemsPerLane)&&void 0!==k?k:1),M=Math.ceil(e.length/O),P=Math.min(e.length-1,j),R=Math.floor(I/O),L=Math.floor(Math.max(I,P)/O),N=Math.max(0,R-T),D=Math.min(M-1,L+T),z=N*O,B=Math.min(e.length-1,(D+1)*O-1),U=Math.max(0,M-D-1);return{rows:e.slice(z,B+1),startIndex:z,endIndex:B,topOffset:N*F,bottomOffset:U*F,totalCount:e.length}}}function ws({items:e,context:t,adapter:r,options:n}){const i=(0,o.useRef)(null),a=(0,o.useRef)(null);i.current||(i.current=new ys),a.current||(a.current=new bs);const s=(0,o.useMemo)(()=>i.current.reconcile(e,r,t),[r,t,e]),l=(0,o.useMemo)(()=>a.current.createRenderWindow(s,n),[n,s]);return{rowModels:s,renderWindow:l}}function xs(e,t){if("number"==typeof e.childCount)return e.childCount;const r=t[e.id];return null===r?null:null!=r?r:0}function Cs(e){var t,r,n;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&qt.includes(i.toLowerCase()))}function _s(e,t){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=[t("months.january"),t("months.february"),t("months.march"),t("months.april"),t("months.may"),t("months.june"),t("months.july"),t("months.august"),t("months.september"),t("months.october"),t("months.november"),t("months.december")];return t("Added",{date:`${r.getDate()} ${n[r.getMonth()]} ${r.getFullYear()}`})}const Ss={getId:e=>e.id,buildSignature:(e,t)=>function(e,t){var r,n,i,o,a,s,l,c;const u=Boolean(e.isFolder),d=u?xs(e,t.folderFileCounts):null,h=u?null===d?"u":String(d):"0",f=_s(e.date,t.t),p=!u&&e.size?String(e.size):"",g=e.thumbnailUrl||e.thumbnail,m=e.url&&Cs(e)?e.url:"",v=t.previewFallbackToFileUrl?m:"",y=[!1!==(null===(r=t.features)||void 0===r?void 0:r.enableEdit),!1!==(null===(n=t.features)||void 0===n?void 0:n.enableMoveFolder),!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveItem),!1!==(null===(o=t.features)||void 0===o?void 0:o.enableCopyFolder),!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyItem),!1!==(null===(s=t.features)||void 0===s?void 0:s.enableRenameFolder),!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFile),!1!==(null===(c=t.features)||void 0===c?void 0:c.enableDelete)].join("|"),b=[g||"",v,m].join("::");return[e.id,e.name,e.folderId,e.type||"",e.extension||"",b,b,e.dimensions||"",p,f,u?"1":"0",h,y].join("::")}(e,t),buildRowModel:(e,t,r)=>{var n,i,o,a,s,l,c,u;const d=Boolean(e.isFolder),h=d?xs(e,t.folderFileCounts):null,f=d&&null===h?"\u2014":d?`${h} ${1===h?t.t("item"):t.t("items")}`:"",p=e.dimensions||"",g=!d&&e.size?$n(e.size):"",m=d?t.t("Folder"):function(e){var t,r,n;return e.extension||(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase())||(e.url?null===(n=null===(r=e.url.split("?")[0].split("/").pop())||void 0===r?void 0:r.split(".").pop())||void 0===n?void 0:n.toLowerCase():"")||""}(e),v=_s(e.date,t.t),y=d?f:[p,g,m].filter(Boolean).join(" \u2022 "),b=e.thumbnailUrl||e.thumbnail,w=e.url&&Cs(e)?e.url:void 0,x=t.previewFallbackToFileUrl?w:void 0;return{id:r.id,signature:r.signature,item:e,file:e,isFolder:d,nameText:e.name||t.t("No name"),folderItemsText:f,dimensionsText:p,sizeText:g,typeText:m,dateText:v,gridInfoText:y,thumbnailSrc:b,previewSrc:x,lightboxSrc:w,canEdit:!d&&!1!==(null===(n=t.features)||void 0===n?void 0:n.enableEdit)&&Cs(e),canMove:d?!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveFolder):!1!==(null===(o=t.features)||void 0===o?void 0:o.enableMoveItem),canCopy:d?!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyFolder):!1!==(null===(s=t.features)||void 0===s?void 0:s.enableCopyItem),canRename:d?!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFolder):!1!==(null===(c=t.features)||void 0===c?void 0:c.enableRenameFile),canDelete:!1!==(null===(u=t.features)||void 0===u?void 0:u.enableDelete)}}},As=o.memo(({files:e,searchTerm:t,handleSearch:r,sortBy:n,sortOrder:a,handleSortOptionChange:l,pagination:c,setPagination:u,loading:d,handleItemClick:h,onClearSelection:f,onRename:p,onDelete:g,onCopy:m,onMove:v,showRenameModal:y,showDeleteConfirm:b,showCopyModal:w,showMoveModal:x,onEdit:C,getFileData:_,handleAddFile:S})=>{var A;const{t:k}=Sn(),I=so(),{DropZoneFileIcon:j,BigStockIcon:T,BigAIIcon:F,FolderIcon:O}=Zi(),{options:M,actions:P,state:R}=Xi(),{dataProviders:L,config:N}=M,D=null==N?void 0:N.disablePagination,{setCurrentMenuFile:z,setActiveLibraryItem:B}=P,U="Trash"===(null==R?void 0:R.selectedFolder),V=!1!==(null==R?void 0:R.multiSelect),{viewMode:H,setViewMode:W}=(()=>{const[e,t]=(0,o.useState)(()=>{try{return localStorage.getItem(vs)||"table"}catch(e){return"table"}}),r=(0,o.useCallback)(e=>{t(e);try{localStorage.setItem(vs,e)}catch(e){}},[]),n=(0,o.useCallback)(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[$,q]=(0,o.useState)({}),[G,Y]=(0,o.useState)(!1),X=(0,o.useRef)(0),K=(0,o.useRef)(null);(0,o.useEffect)(()=>{const e=window.matchMedia("(max-width: 1199px)"),t=e=>{Y(e.matches)};t(e);const r=e=>t(e);return"function"==typeof e.addEventListener?(e.addEventListener("change",r),()=>e.removeEventListener("change",r)):(e.addListener(r),()=>e.removeListener(r))},[]);const Z=(0,o.useMemo)(()=>(null==N?void 0:N.features)||{},[null==N?void 0:N.features]),Q=null==N?void 0:N.iconStrokeWidth,J=null==N?void 0:N.sortOptions,ee=(0,o.useMemo)(()=>(null==J?void 0:J.length)?new Set(J):null,[J]),te=`${n}-${a}`;(0,o.useEffect)(()=>{var e;if(ee&&!ee.has(te)){const t=null===(e=Qa.find(e=>ee.has(e.value)))||void 0===e?void 0:e.value;t&&l(t)}},[ee,te,l]);const re=(0,o.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),{renderRows:ne,renderWindow:ie,hasAnyValidDate:oe,handleViewportChange:ae}=function({files:e,folderFileCounts:t,features:r,t:n,viewMode:i,previewFallbackToFileUrl:a}){const s=(0,o.useMemo)(()=>({folderFileCounts:t,features:r,t:n,previewFallbackToFileUrl:a}),[r,t,n,a]),[l,c]=(0,o.useState)(()=>Math.max(1,Math.floor(5))),u=(0,o.useMemo)(()=>{const t=e.length>150;return"table"===i?{enabled:t,estimatedItemSize:56,overscan:10,itemsPerLane:1,fallbackViewportHeight:800}:{enabled:t,estimatedItemSize:320,overscan:2,itemsPerLane:l,fallbackViewportHeight:800}},[e.length,l,i]),{engineOptions:d,handleViewportChange:h}=function({totalCount:e,plan:t}){const[r,n]=(0,o.useState)(null),i=(0,o.useMemo)(()=>{var n,i;if(!t.enabled)return{renderStrategy:"full"};const o=function(e,t){var r;return Math.max(1,null!==(r=null==e?void 0:e.viewportHeight)&&void 0!==r?r:t)}(r,null!==(n=t.fallbackViewportHeight)&&void 0!==n?n:800),a=Math.max(1,Math.ceil(o/t.estimatedItemSize)),s=Math.max(1,Math.ceil(e/t.itemsPerLane)),l=Math.min(s-1,Math.max(0,Math.floor((null!==(i=null==r?void 0:r.scrollTop)&&void 0!==i?i:0)/t.estimatedItemSize))),c=l+a-1;return{renderStrategy:"windowed",windowed:{startIndex:l*t.itemsPerLane,endIndex:Math.min(e-1,(c+1)*t.itemsPerLane-1),overscan:t.overscan,estimatedItemSize:t.estimatedItemSize,itemsPerLane:t.itemsPerLane}}},[t.enabled,t.estimatedItemSize,t.fallbackViewportHeight,t.itemsPerLane,t.overscan,e,r]);return{engineOptions:i,handleViewportChange:(0,o.useCallback)(e=>{n(t=>(null==t?void 0:t.viewportHeight)===e.viewportHeight&&(null==t?void 0:t.viewportWidth)===e.viewportWidth&&(null==t?void 0:t.scrollHeight)===e.scrollHeight&&(null==t?void 0:t.scrollTop)===e.scrollTop?t:e)},[])}}({totalCount:e.length,plan:u}),{rowModels:f,renderWindow:p}=ws({items:e,context:s,adapter:Ss,options:d}),g=(0,o.useMemo)(()=>f.some(e=>Boolean(e.dateText)),[f]),m=(0,o.useCallback)(e=>{if("grid"===i){const t=Math.max(1,Math.floor(e.viewportWidth/240));c(e=>e===t?e:t)}h(e)},[h,i]);return{rowModels:f,renderRows:p.rows,renderWindow:p,hasAnyValidDate:g,handleViewportChange:m}}({files:e,folderFileCounts:$,features:Z,t:k,viewMode:H,previewFallbackToFileUrl:null==N?void 0:N.previewFallbackToFileUrl}),se=(0,o.useCallback)(async e=>{var t,r,n,i;try{if(null==L?void 0:L.getChildrenCount)return await L.getChildrenCount("folders"===e?void 0:e);if(null==L?void 0:L.getFiles){const{files:r,pagination:n}=await L.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:D?void 0:1,limit:D?void 0:1});return D?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;if(404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.code)||404===(null===(i=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.status))return 0;const a=await va({folderId:e,dataProviders:L,folders:Array.isArray(R.folders)?R.folders:[],pathHistory:R.pathHistory,t:k});return I.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:k("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[L,D,I,R.folders,R.pathHistory,k]),le=(0,o.useCallback)(async()=>{const t=X.current+1;X.current=t;const r=e.filter(e=>e.isFolder);if(0===r.length)return void q(e=>0===Object.keys(e).length?e:{});const n={},i=r.map(async e=>{"number"!=typeof e.childCount?n[e.id]=await se(e.id):n[e.id]=e.childCount});await Promise.all(i),X.current===t&&q(e=>{const t=Object.keys(e),r=Object.keys(n);return t.length===r.length&&t.every(t=>e[t]===n[t])?e:n})},[e,se]);(0,o.useEffect)(()=>{le()},[le]),(0,o.useEffect)(()=>{K.current&&ae(Xa(K.current))},[e.length,ae,H]),(0,o.useEffect)(()=>{if(!K.current||"undefined"==typeof ResizeObserver)return;const e=K.current,t=new ResizeObserver(()=>{ae(Xa(e))});return t.observe(e),()=>{t.disconnect()}},[ae]);const ce=(0,o.useCallback)(e=>{const t=Xa(e);ae(t)},[ae]);(0,o.useEffect)(()=>{const e=K.current;if(!e)return;const t=()=>{ce(e)},r=Ga(e);return r.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{r.forEach(e=>{e.removeEventListener("scroll",t)})}},[e.length,ce,H]);const ue=(0,o.useCallback)((e,t)=>e!==t,[]),de=(0,o.useMemo)(()=>[...V?[{key:"selection",width:46,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(ns,{fileId:t.id})}]:[],{key:"preview",width:60,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(ls,{item:t,variant:"table",FolderIcon:O,getFileData:_,className:`${Ja.imagePreview} ${Ja.tableImagePreview}`,width:40,height:40})},{title:k("Name"),width:"calc(100% - 430px)",dataIndex:"nameText",key:"name",className:Ja.fileNameCol,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(ms,{item:t})},{title:k("Dimensions"),key:"dimensions",width:100,shouldCellUpdate:ue,render:(e,t)=>t.dimensionsText&&(0,i.jsx)("div",{className:Ja.fileSize,children:t.dimensionsText})},{title:k("Size"),key:"size",width:90,shouldCellUpdate:ue,render:(e,t)=>t.sizeText?(0,i.jsx)("div",{className:Ja.fileSize,children:t.sizeText}):null},{title:k("Type"),key:"type",width:90,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)("div",{className:Ja.fileSize,children:t.typeText})},...oe?[{title:k("Date"),dataIndex:"dateText",key:"date",width:200,shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(gs,{item:t})}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),shouldCellUpdate:ue,render:(e,t)=>(0,i.jsx)(as,{item:t,variant:"table",t:k,iconStrokeWidth:Q,setCurrentMenuFile:z,showMoveModal:x,showCopyModal:w,showRenameModal:y,showDeleteConfirm:b,onEdit:C})}],[O,_,oe,Q,V,C,z,ue,w,b,x,y,k]),he=(0,o.useMemo)(()=>({body:{row:os}}),[]),fe=(0,o.useCallback)(e=>({onClick:t=>{if(t.stopPropagation(),t.preventDefault(),1!==t.detail)return;const r=t.target,n=Boolean(r.closest(".ant-checkbox-wrapper")),i=Boolean(r.closest(".tableMenuButton")),o=Boolean(r.closest(".ant-dropdown-menu"));n||us(r)||i||o||(e.isFolder?h(e.file):M.onEditorOk&&ds(e.file)&&M.onEditorOk(e.file))}}),[h,M]);let pe="table"===H?(0,i.jsx)(ps,{rows:ne,columns:de,topOffset:ie.topOffset,bottomOffset:ie.bottomOffset,onRow:fe,components:he}):(0,i.jsx)(fs,{rows:ne,topOffset:ie.topOffset,bottomOffset:ie.bottomOffset,t:k,iconStrokeWidth:Q,FolderIcon:O,handleItemClick:h,setCurrentMenuFile:z,showMoveModal:x,showCopyModal:w,showRenameModal:y,showDeleteConfirm:b,onEdit:C,onEditorOk:M.onEditorOk,getFileData:_,showSelectionCheckbox:V});t&&!e.length&&(pe=(0,i.jsx)(Qi,{}));const ge=null===(A=null==N?void 0:N.availableImageExtensions)||void 0===A?void 0:A.map(e=>"."+e).join(", "),me=(0,i.jsxs)("div",U?{className:`${Ja.noFiles} ant-layout-sider-light`,children:[(0,i.jsx)(vi,{size:48,className:Ja.noFilesIcon}),(0,i.jsx)("div",{className:`${Ja.textTitle_trash} ant-menu-submenu-title`,children:k("Trash is empty")}),(0,i.jsx)("div",{className:`${Ja.textDescription_trash} ant-menu-submenu-title`,children:k("Deleted files will be displayed here")})]}:{className:Ja.uploadContainer,children:[(0,i.jsxs)("div",{className:`${Ja.uploadArea} `,onClick:S,children:[(0,i.jsx)("div",{className:Ja.uploadIcon,children:(0,i.jsx)(j,{})}),(0,i.jsx)("div",{className:Ja.textTitle,children:k("Click here to select a file")}),(0,i.jsx)("div",{className:Ja.textDescription,children:k("Supported files:")+" "+(ge||"jpeg, .svg, .png")})]}),(0,i.jsxs)("div",{className:Ja.buttons,children:[(0,i.jsxs)("button",{className:Ja.btnPhoto,onClick:()=>{B&&B(Rt)},children:[(0,i.jsx)("div",{className:Ja.icon,children:(0,i.jsx)(T,{})}),(0,i.jsxs)("div",{className:Ja.blockText,children:[(0,i.jsx)("div",{className:Ja.textTitle,children:k("Stock")}),(0,i.jsx)("div",{className:Ja.textDescription,children:k("Select an image from our library")})]})]}),(0,i.jsxs)("button",{className:Ja.btnAi,onClick:()=>{B&&B(Nt)},children:[(0,i.jsx)("div",{className:Ja.icon,children:(0,i.jsx)(F,{})}),(0,i.jsxs)("div",{className:Ja.blockText,children:[(0,i.jsx)("div",{className:Ja.textTitle,children:k("AI generation")}),(0,i.jsx)("div",{className:Ja.textDescription,children:k("Creating an image on demand")})]})]})]})]});return(0,i.jsx)("div",{className:`content-layout ${Ja.contentLayout}`,children:d||0!==(null==e?void 0:e.length)||t?(0,i.jsxs)("div",{className:Ja.tableContainer,children:[(0,i.jsx)(rs,{files:e,filesById:re,currentSortOption:te,isSmallScreen:G,iconStrokeWidth:Q,multiSelectEnabled:V,features:Z,viewMode:H,setViewMode:W,handleSearch:r,handleSortOptionChange:l,sortOptions:J,onClearSelection:f,onRename:p,onDelete:g,onCopy:m,onMove:v,onEdit:C,t:k}),(0,i.jsxs)("div",{ref:K,className:Ja.filesContainer,children:[pe,d?(0,i.jsx)("div",{className:Ja.filesLoadingOverlay,"aria-busy":"true","aria-live":"polite",children:(0,i.jsx)(s.A,{size:"large"})}):null]}),!D&&c.total>c.pageSize&&(0,i.jsx)("div",{className:Ja.paginationContainer,children:(0,i.jsx)(E.A,{current:c.current,pageSize:c.pageSize,total:c.total,onChange:(e,t)=>u({current:e,pageSize:t,total:c.total}),showSizeChanger:!0,showTotal:e=>k("total pages",{total:e})})})]}):(0,i.jsx)("div",{className:Ja.emptyStateWrapper,children:me})})});As.displayName="FileContent";var ks="folderLabelItem",Es="foldersTitle",Is="foldersTitleItem";const js=({selectedFolder:e,onSelect:t,onExpand:r,generateMenuItems:n,fetchChildFolders:a,disabledFolders:s=[],showFileCounts:l=!1,folderFileCounts:c={},className:u="",expandedKeys:d,setExpandedKeys:h,showTrashFolder:f=!1,mode:p="navigation",defaultExpandAll:g=!1})=>{const{t:m}=Sn(),{options:v}=Xi(),{config:y}=v,{ExpandArrowIcon:b,CollapseArrowIcon:w,CollapseFolderIcon:x,ExpandFolderIcon:C,EmptyFolderIcon:_}=Zi(),S=(0,o.useCallback)(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[A,k]=(0,o.useState)(()=>{if(g||"selection"===p&&g){const e=n();return S(e)}return[]}),E=void 0!==d?d:A,j=void 0!==h?h:k;(0,o.useEffect)(()=>{if(g||"selection"===p&&g){const e=n(),t=S(e);void 0===d&&k(t)}},[g,p,n,S,d]);const T=(0,o.useCallback)(async e=>{const r=e[0];r&&"empty"!==r&&!r.endsWith("_input")&&(null==t||t(e),await(null==a?void 0:a("folders"===r?null:r)))},[t,a]),F=(0,o.useCallback)(async(e,t)=>{var n;if(j(e),null==r||r(e,t),"lazy"!==(null==y?void 0:y.folderTreeLoading))return;const i=(null===(n=null==t?void 0:t.node)||void 0===n?void 0:n.key)||void 0;if(i&&"folders"!==i)try{await(null==a?void 0:a(i))}catch(e){}},[null==y?void 0:y.folderTreeLoading,a,r,j]),O=(0,o.useCallback)(()=>{var t,r;const o=n(),a=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?a(e.children):void 0})),u=f?a(o):o,d=t=>{"selection"!==p?(E.includes(t)&&e===t?j(E.filter(e=>e!==t)):E.includes(t)||j([...E,t]),T([t])):T([t])},h=0===u.length||1===u.length&&(!u[0].children||0===u[0].children.length),g=e=>{var t;const r=l?c[e.key]:void 0,n=l&&null===r?null:l&&null!=r?r:0,o=E.includes(e.key),a=s.includes(e.key),u=(()=>{var t;return(null===(t=e.children)||void 0===t?void 0:t.length)?(0,i.jsx)(o?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}):(0,i.jsx)(_,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth})})(),h=(0,i.jsxs)("div",{className:"folderItemContainer folder-item-container",onClick:()=>!a&&d(e.key),style:{opacity:a?.5:1,cursor:a?"not-allowed":"pointer"},children:[(0,i.jsxs)("div",{className:"folderLabel",children:[void 0!==e.icon?e.icon:u,(0,i.jsx)("span",{className:ks,children:e.label})]}),l&&(0,i.jsx)("div",{className:"fileCount",title:null===n?void 0:`${n} ${m(1===n?"item":"items")}`,children:null===n?"\u2014":n})]});return{key:e.key,title:h,children:null===(t=e.children)||void 0===t?void 0:t.map(g),disabled:a}},v=E.includes("folders"),b=(0,i.jsx)("div",{className:Es,onClick:()=>d("folders"),children:(0,i.jsxs)("div",{className:Is,children:[(0,i.jsx)(v?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:`${ks} folder-label-item`,children:"folders"===(null===(t=u[0])||void 0===t?void 0:t.key)?u[0].label:m("Folders")})]})}),w=()=>({key:"Trash",title:(0,i.jsx)("div",{className:Es,onClick:()=>d("Trash"),children:(0,i.jsxs)("div",{className:Is,children:[(0,i.jsx)(mi,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:ks,children:m("Trash")})]})}),children:void 0});if(h){if(!f)return[{key:"empty",title:(0,i.jsx)("div",{className:"emptyFolderContainer",children:m("No folders yet")}),disabled:!0}];const e=[];return u.length>0&&"folders"===u[0].key&&e.push({key:"folders",title:b,children:[]}),e.push(w()),e}if(u.length>0&&"folders"===u[0].key){const e=[{key:"folders",title:b,children:null===(r=u[0].children)||void 0===r?void 0:r.map(g)}];return f&&e.push(w()),e}return u.map(g)},[n,E,x,null==y?void 0:y.iconStrokeWidth,C,m,e,T,l,c,_,s,f,p,j]),M=(0,o.useMemo)(()=>O(),[O]);return(0,i.jsx)(I.A,{className:`folderTree folderMenu ${u}`,selectedKeys:e?[e]:[],expandedKeys:E,onSelect:T,onExpand:F,treeData:M,switcherIcon:({expanded:e})=>(0,i.jsx)(e?w:b,{}),showLine:!1})},Ts=({style:e={},wrap:t=!1})=>{const r=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},e);return(0,i.jsx)(v.A,{size:"large",style:r,wrap:t,children:(0,i.jsx)(s.A,{})})};var Fs={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField",inputButtonOk:"inputButtonOk",permanentDeleteWarning:"permanentDeleteWarning",clearTrashProgress:"clearTrashProgress",progressText:"progressText",closeIcon:"closeIcon",modalContentWithLoader:"modalContentWithLoader",modalLoaderOverlay:"modalLoaderOverlay"};const Os=({folderId:e,activeFormField:t,EmptyFolderIcon:r,targetForm:n,handleModalOk:o,onComplete:a,setIsLoading:s,t:l})=>(0,i.jsx)(d.A.Item,{className:"form-item form-item-moveto "+(t===e?"form-item_active":""),name:"folderName",initialValue:l("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(l("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{className:"form-input",autoFocus:!0,prefix:(0,i.jsx)(r,{style:{marginRight:6}}),suffix:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.A,{placement:"top",title:"Clean",children:(0,i.jsx)(m.Ay,{icon:(0,i.jsx)(J.A,{style:{fontSize:10}}),className:Fs.inputButtonClose,type:"text",onClick:()=>{n.setFieldsValue({folderName:""})}})}),(0,i.jsx)(m.Ay,{className:Fs.inputButtonOk,type:"text",onClick:()=>{s(!0),o(n).then(e=>{const t=null==e?void 0:e.id;a(t)}).finally(()=>s(!1))},children:l("Create")})]})})});function Ms({folders:e,selectedFolder:t,EmptyFolderIcon:r,handleCreateFolderModalOk:n,setIsLoading:a,t:s}){const[l,c]=o.useState(""),u=o.useCallback((e,t)=>o=>(0,i.jsx)(Os,{folderId:o,activeFormField:l,EmptyFolderIcon:r,targetForm:e,handleModalOk:n,onComplete:t,setIsLoading:a,t:s},o),[r,l,n,a,s]),d=o.useCallback(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),c(t),r.setFieldsValue({folderName:s("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),n([t]).then(()=>i(t))}}},[s]),h=o.useCallback(r=>{const{targetForm:n,onTreeSelect:o,onComplete:a,actionButtonText:c}=r,h=u(n,a),f=Array.isArray(e)?e:[],p=(e=null,r=new Set)=>f.filter(t=>{const r=null===e&&!t.parentId,n=t.parentId===e;return r||n}).map(e=>{if(r.has(e.id))return{key:e.id,label:`${e.name} (\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430)`};const s=new Set(r);s.add(e.id);const u=p(e.id,s),{handleAddFolder:f,handleSelectFolder:g}=d({folderId:e.id,targetForm:n,onTreeSelect:o,onComplete:a}),v=l===e.id?[{key:`${e.id}_input`,label:h(e.id),icon:null},...u]:u;return{key:e.id,label:(0,i.jsxs)(i.Fragment,{children:[e.name,t!==e.id&&(0,i.jsxs)("div",{className:`${Fs.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(m.Ay,{onClick:f,children:"+"}),(0,i.jsx)(m.Ay,{onClick:g,children:c})]})]}),children:v}}),g=p(),{handleAddFolder:v,handleSelectFolder:y}=d({folderId:"folders",targetForm:n,onTreeSelect:o,onComplete:a}),b="folders"===l?[{key:"folders_input",label:h("folders"),icon:null},...g]:g;return[{key:"folders",label:(0,i.jsxs)(i.Fragment,{children:[s("Folders"),"folders"!==t&&null!==t&&(0,i.jsxs)("div",{className:`${Fs.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(m.Ay,{onClick:v,children:"+"}),(0,i.jsx)(m.Ay,{onClick:y,children:c})]})]}),children:b}]},[l,u,d,e,t,s]);return{activeFormField:l,setActiveFormField:c,generateMenuItemsFromFolders:h}}const Ps=(0,o.memo)(({folderId:e,activeFormField:t,EmptyFolderIcon:r,targetForm:n,handleModalOk:a,onComplete:s,t:l,setIsLoading:c,defaultFolderName:u})=>{const f=(0,o.useCallback)(()=>{c(!0),a(n).then(e=>s(null==e?void 0:e.id)).finally(()=>c(!1))},[a,n,s,c]);return(0,i.jsx)(d.A.Item,{className:"form-item form-item-moveto "+(t===e?"form-item_active":""),name:"folderName",initialValue:u,rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(l("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{className:"form-input",autoFocus:!0,prefix:(0,i.jsx)(r,{style:{marginRight:6}}),suffix:(0,i.jsx)(m.Ay,{className:Fs.inputButtonOk,type:"text",onClick:()=>{c(!0),f()},children:l("Create")})})})});Ps.displayName="CustomFolderInput";const Rs=({isModalVisible:e,handleModalOk:t,handleModalCancel:r,form:n,selectedFolder:a,folders:s,isUrlModalVisible:l,setIsUrlModalVisible:c,handleAddFileByUrl:u,urlForm:f,isRenameModalVisible:p,handleRenameOk:g,handleRenameCancel:v,renameForm:y,fileToRename:b,files:w,isMoveModalVisible:x,handleMoveOk:C,handleMoveCancel:_,moveForm:S,selectedFiles:A,isRenameFolderModalVisible:k,handleRenameFolderOk:E,handleRenameFolderCancel:I,renameFolderForm:F,folderToRename:O,isCopyModalVisible:M,handleCopyOk:P,handleCopyCancel:R,copyForm:L,isDeleteConfirmVisible:N,handleDeleteConfirmOk:D,handleDeleteConfirmCancel:z,isClearTrashConfirmVisible:B,handleClearTrashConfirm:U,handleClearTrashCancel:V,fetchChildFolders:H})=>{var W,$,q;const{t:G}=Sn(),{state:Y,actions:X,options:K}=Xi(),{setCurrentMenuFile:Z}=X,{config:Q}=K,{currentMenuFile:ee}=Y,te=d.A.useWatch("folderName",n),{EmptyFolderIcon:re}=Zi(),[ne,ie]=(0,o.useState)(!1),oe=(0,o.useMemo)(()=>{var e;return(null===(e=null==Q?void 0:Q.defaultFolderName)||void 0===e?void 0:e.trim())||G("New folder")},[null==Q?void 0:Q.defaultFolderName,G]),ae=!te||0===String(te).trim().length,se=(0,o.useMemo)(()=>Array.isArray(w)?w:[],[w]),le=b?null===(W=se.find(e=>e.id===b))||void 0===W?void 0:W.name:"",ce=Array.isArray(s)?s:[],ue=O?null===($=ce.find(e=>e.id===O))||void 0===$?void 0:$.name:"",{activeFormField:de,setActiveFormField:he,generateMenuItemsFromFolders:fe}=Ms({folders:ce,selectedFolder:a,EmptyFolderIcon:re,handleCreateFolderModalOk:t,setIsLoading:e=>ie(Boolean(e)),t:G});(0,o.useEffect)(()=>{if(N){const e=setTimeout(()=>{const e=document.querySelector(".deleteModal");if(e){const t=e.querySelector(".ant-modal-footer");if(t){const e=t.querySelector(".ant-btn-primary");e&&e.focus()}}},100);return()=>clearTimeout(e)}},[N]);const pe=b?se.find(e=>e.id===b):null,ge=(null==pe?void 0:pe.isFolder)||(null==b?void 0:b.startsWith("folder_")),me=(0,o.useCallback)(async e=>{e.length>0&&(S.setFieldsValue({targetFolder:e[0]}),de!==e[0].toString()&&he(""))},[S,de,he]),ve=(0,o.useCallback)(async e=>{e.length>0&&(L.setFieldsValue({targetFolder:e[0]}),de!==e[0].toString()&&he(""))},[de,L,he]),ye=(0,o.useCallback)(async e=>{ie(!0);try{await C(e)}finally{ie(!1)}},[C]),be=(0,o.useCallback)(async e=>{ie(!0);try{await P(e)}finally{ie(!1)}},[P]),we=(0,o.useMemo)(()=>{const e=Array.from(A).filter(e=>{const t=se.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||s.some(t=>t.id===e)});return a&&"folders"!==a?e.push(a):a&&"folders"!==a||e.push("folders"),e},[A,se,s,a]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:G("Creating a new folder")}),open:e,onOk:()=>t(),onCancel:r,okText:G("Create"),cancelText:G("Cancel"),okButtonProps:{disabled:ae,loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>ie(!1),children:(0,i.jsxs)(d.A,{form:n,layout:"vertical",children:[(0,i.jsx)(d.A.Item,{name:"folderName",label:(0,i.jsx)("div",{className:"form-label",children:G("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(G("Enter the name of the folder"))):Promise.resolve()}],initialValue:oe,className:"form-item",style:{marginBottom:5},children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:ne,placeholder:G("Enter the name"),onPressEnter:async()=>{ie(!0);try{await n.validateFields(),ae||await t()}catch(At){ie(!1)}}})}),(0,i.jsx)("div",{children:a&&"folders"!==a?(0,i.jsxs)("p",{className:"fm-note",children:[G("A folder will be created inside:")," ",(null===(q=ce.find(e=>e.id===a))||void 0===q?void 0:q.name)||G("selected folder"),"."]}):(0,i.jsx)("p",{className:"fm-note",children:G("The folder will be created in the root directory.")})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:G("Upload file by URL")}),open:l,onOk:async()=>{var e;ie(!0);try{const t=await f.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await u(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{ie(!1)}},onCancel:()=>c(!1),okText:G("Download"),okButtonProps:{loading:ne},cancelText:G("Cancel"),cancelButtonProps:{disabled:ne},afterClose:()=>ie(!1),children:(0,i.jsx)(d.A,{form:f,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"fileUrl",label:(0,i.jsx)("div",{className:"form-label",children:G("File URL")}),rules:[{required:!0,message:G("Enter the URL of the image")},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return Eo(String(t),G),Promise.resolve()}catch(e){return Promise.reject(new Error(e instanceof Error?e.message:G("The specified URL is not valid.")))}}}],validateTrigger:"onBlur",className:"form-item",children:(0,i.jsx)(h.A,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:ne,onPressEnter:async()=>{var e;ie(!0);try{const t=await f.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await u(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{ie(!1)}}})})})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:ge?`${G("Rename folder")} ${le}`:G("Rename file",{currentFileName:le})}),open:p,onOk:g,okText:G("Rename"),okButtonProps:{loading:ne},onCancel:v,cancelText:G("Cancel"),cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1),Z&&Z("")},children:(0,i.jsx)(d.A,{form:y,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"newFileName",label:(0,i.jsx)("div",{className:"form-label",children:G(ge?"New folder name":"New file name")}),rules:[{required:!0,message:G(ge?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:ne,onPressEnter:async()=>{ie(!0);try{await y.validateFields(),g()}catch(At){ie(!1)}}})})})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:G("Move to")}),open:x,onCancel:_,footer:(0,i.jsxs)("div",{className:Fs.formFooter,children:[(0,i.jsxs)(m.Ay,{className:Fs.folderButton,onClick:()=>{const e=null!=a?a:"folders";he(e),S.setFieldsValue({folderName:oe,targetFolder:e})},loading:ne,children:[(0,i.jsx)(ti,{size:18,strokeWidth:null==Q?void 0:Q.iconStrokeWidth}),G("Create folder")]}),(0,i.jsx)(m.Ay,{type:"primary",className:Fs.folderButton,onClick:_,loading:ne,children:G("Done")})]}),afterClose:()=>{Z&&Z(""),he(""),ie(!1)},loading:ne,children:(0,i.jsxs)("div",{className:Fs.modalContentWithLoader,children:[ne&&(0,i.jsx)("div",{className:Fs.modalLoaderOverlay,children:(0,i.jsx)(Ts,{})}),(0,i.jsx)(d.A,{form:S,layout:"vertical",initialValues:{targetFolder:"folders",folderName:oe,is_force_create:!1},children:(0,i.jsxs)("div",{className:Fs.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:G("Select the destination folder")}],className:Fs.formItem,children:(0,i.jsx)(js,{onSelect:me,generateMenuItems:()=>fe({targetForm:S,onTreeSelect:me,onComplete:ye,actionButtonText:G("Move here")}),fetchChildFolders:H,disabledFolders:we,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(G("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsx)("div",{className:"modal-title",children:G("Copy to folder")}),open:M,onCancel:R,footer:(0,i.jsxs)("div",{className:Fs.formFooter,children:[(0,i.jsxs)(m.Ay,{className:Fs.folderButton,onClick:()=>{const e=null!=a?a:"folders";he(e),L.setFieldsValue({folderName:oe,targetFolder:e})},loading:ne,children:[(0,i.jsx)(ti,{size:18,strokeWidth:null==Q?void 0:Q.iconStrokeWidth}),G("Create folder")]}),(0,i.jsx)(m.Ay,{type:"primary",className:Fs.folderButton,onClick:R,loading:ne,children:G("Done")})]}),afterClose:()=>{Z&&Z(""),he(""),ie(!1)},loading:ne,children:(0,i.jsxs)("div",{className:Fs.modalContentWithLoader,children:[ne&&(0,i.jsx)("div",{className:Fs.modalLoaderOverlay,children:(0,i.jsx)(Ts,{})}),(0,i.jsx)(d.A,{form:L,layout:"vertical",initialValues:{targetFolder:"folders",folderName:oe,is_force_create:!1},children:(0,i.jsxs)("div",{className:Fs.foldersWrapper,children:[(0,i.jsx)(d.A.Item,{name:"targetFolder",rules:[{required:!0,message:G("Select the destination folder")}],className:Fs.formItem,children:(0,i.jsx)(js,{onSelect:ve,generateMenuItems:()=>fe({targetForm:L,onTreeSelect:ve,onComplete:be,actionButtonText:G("Copy here")}),fetchChildFolders:H,disabledFolders:we,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),(0,i.jsx)(d.A.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(G("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(h.A,{})}),(0,i.jsx)(d.A.Item,{name:"is_force_create",style:{display:"none"},children:(0,i.jsx)(h.A,{})})]})})]})}),(0,i.jsx)(j.A,{title:(0,i.jsxs)("div",{className:"modal-title",children:[G("Rename folder")," ",ue]}),open:k,onOk:E,onCancel:I,okText:G("Rename"),cancelText:G("Cancel"),okButtonProps:{loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1),Z&&Z("")},children:(0,i.jsx)(d.A,{form:F,layout:"vertical",children:(0,i.jsx)(d.A.Item,{name:"newFolderName",label:(0,i.jsx)("div",{className:"form-label",children:G("New folder name")}),rules:[{required:!0,message:G("Enter a new folder name")}],className:"form-item",children:(0,i.jsx)(h.A,{autoFocus:!0,className:"form-input",disabled:ne,onPressEnter:async()=>{ie(!0);try{await F.validateFields(),E()}catch(At){ie(!1)}}})})})}),(0,i.jsx)(j.A,{className:`${Fs.deleteModal} deleteModal`,title:(()=>{const e=!!(null==Q?void 0:Q.enableTrashFolder)&&"Trash"===a||!(null==Q?void 0:Q.enableTrashFolder),t=G(e?"Permanently delete":"Move to Trash");return(0,i.jsx)("div",{className:"modal-title",children:t})})(),open:!!N,onOk:()=>{ie(!0);try{D&&D()}catch(At){ie(!1)}},onCancel:()=>z&&z(),okText:(null==Q?void 0:Q.enableTrashFolder)&&"Trash"===a?G("Delete permanently"):(null==Q?void 0:Q.enableTrashFolder)?G("Move to Trash"):G("Delete"),cancelText:G("Cancel"),okButtonProps:{danger:!(null==Q?void 0:Q.enableTrashFolder)||"Trash"===a,loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1),Z&&Z("")},closeIcon:(0,i.jsx)(J.A,{className:Fs.closeIcon}),children:(()=>{var e,t;const r=(ee?[ee]:Array.from(A||[])).map(e=>se.find(t=>t.id===e)).filter(e=>!!e),n=r.filter(e=>e.isFolder||e.id.startsWith("folder_")),o=r.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=r.length,l=n.length,c=o.length,u=!!(null==Q?void 0:Q.enableTrashFolder);if(!u||u&&"Trash"===a){let t;if(1===s&&1===l){const r=n[0],i=(null==r?void 0:r.name)||"",o=null!==(e=null==r?void 0:r.childCount)&&void 0!==e?e:0;t=G("delete_folder_permanent",{name:i,count:o})}else t=0===l&&c>0?G("delete_files_permanent",{count:c}):G("delete_mixed_permanent",{total:s,folders:l,images:c});return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{children:t}),(0,i.jsx)("p",{className:Fs.permanentDeleteWarning,children:G("permanent_delete_warning")})]})}if(1===s&&1===l){const e=n[0],r=(null==e?void 0:e.name)||"",o=null!==(t=null==e?void 0:e.childCount)&&void 0!==t?t:0;return(0,i.jsx)("div",{children:G("move_folder_to_trash",{name:r,count:o})})}return(0,i.jsx)("div",0===l&&c>0?{children:G("move_files_to_trash",{count:c})}:{children:G("move_mixed_to_trash",{total:s,folders:l,images:c})})})()}),(0,i.jsxs)(j.A,{className:`${Fs.deleteModal} deleteModal`,title:(0,i.jsx)("div",{className:"modal-title",children:G("Clear Trash")}),open:!!B,onOk:async()=>{ie(!0),U&&await U(),ie(!1)},onCancel:()=>V&&V(),okText:G("Delete permanently"),cancelText:G("Cancel"),okButtonProps:{danger:!0,loading:ne},cancelButtonProps:{disabled:ne},afterClose:()=>{ie(!1)},closeIcon:(0,i.jsx)(J.A,{className:Fs.closeIcon}),children:[(0,i.jsx)("div",{children:G("Are you sure you want to permanently delete all items from Trash?")}),ne&&(0,i.jsxs)("div",{className:Fs.clearTrashProgress,children:[(0,i.jsx)(T.A,{percent:99,status:"active",showInfo:!1}),(0,i.jsx)("div",{className:Fs.progressText,children:G("Deleting items...")})]})]})]})};var Ls={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const Ns=(0,o.memo)((0,o.forwardRef)(({selectedFolder:e,generateMenuItems:t,onFolderSelect:r,folders:n,fetchChildFolders:a,handleAddFile:s,setIsUrlModalVisible:l,handleCreateFolder:c,activeLibraryItem:u,setActiveLibraryItem:d},h)=>{var f,p,g,v;const y=(0,o.useMemo)(()=>Array.isArray(n)?n:[],[n]),{t:b}=Sn(),w=so(),[x,C]=(0,o.useState)({}),{options:_,state:S}=Xi(),{dataProviders:A,config:k}=_,E=S.pathHistory,I=!1!==(null===(f=null==k?void 0:k.features)||void 0===f?void 0:f.enableGif)&&(!(null==k?void 0:k.enabledTabs)||k.enabledTabs.includes("gif")),j=!1!==(null===(p=null==k?void 0:k.features)||void 0===p?void 0:p.enableStockImages)&&(!(null==k?void 0:k.enabledTabs)||k.enabledTabs.includes("stock")),T=!1!==(null===(g=null==k?void 0:k.features)||void 0===g?void 0:g.enableIconStock)&&(!(null==k?void 0:k.enabledTabs)||k.enabledTabs.includes("icons")),M=!1!==(null===(v=null==k?void 0:k.features)||void 0===v?void 0:v.enableQrBarcodeTab)&&(!(null==k?void 0:k.enabledTabs)||k.enabledTabs.includes("codes")),P=(0,o.useCallback)(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[R,L]=(0,o.useState)(()=>{if(!0===(null==k?void 0:k.expandAllFoldersOnInit)&&"lazy"!==(null==k?void 0:k.folderTreeLoading)){const e=t();return P(e)}return!0===(null==k?void 0:k.expandRootFolderOnInit)?["folders"]:[]}),N=(0,o.useRef)(!1),D=(0,o.useRef)(!1);(0,o.useEffect)(()=>{N.current||"lazy"===(null==k?void 0:k.folderTreeLoading)&&!0===(null==k?void 0:k.expandRootFolderOnInit)&&(N.current=!0,(async()=>{try{await(null==a?void 0:a(null))}catch(At){}})())},[null==k?void 0:k.folderTreeLoading,null==k?void 0:k.expandRootFolderOnInit,a]),(0,o.useEffect)(()=>{!0===(null==k?void 0:k.expandRootFolderOnInit)&&Array.isArray(y)&&y.length>0&&(D.current||R&&0!==R.length||(D.current=!0,L(["folders"])))},[null==k?void 0:k.expandRootFolderOnInit,y,R]),(0,o.useEffect)(()=>{if(!0===(null==k?void 0:k.expandAllFoldersOnInit)&&"lazy"!==(null==k?void 0:k.folderTreeLoading)){const e=t(),r=P(e);return void L(r)}!0===(null==k?void 0:k.expandRootFolderOnInit)&&L(e=>e&&e.length>0?[...e]:["folders"])},[y,t,P,null==k?void 0:k.expandAllFoldersOnInit,null==k?void 0:k.folderTreeLoading,null==k?void 0:k.expandRootFolderOnInit]);const z=null==k?void 0:k.disablePagination,B=(0,o.useCallback)(async e=>{var t,r,n,i;try{if(null==A?void 0:A.getChildrenCount)return await A.getChildrenCount("folders"===e?void 0:e);if(null==A?void 0:A.getFiles){const{files:r,pagination:n}=await A.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:z?void 0:1,limit:z?void 0:1});return z?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;if(404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.code)||404===(null===(i=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.status))return 0;const a=await va({folderId:e,dataProviders:A,folders:y,pathHistory:E,t:b});return w.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:b("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[A,z,w,E,y,b]),U=(0,o.useCallback)(async()=>{if(0===y.length)return;const e={};e.folders=await B("folders");const t=y.map(async t=>{"number"!=typeof t.childCount?e[t.id]=await B(t.id):e[t.id]=t.childCount});await Promise.all(t),C(e)},[y,B]),V=(0,o.useCallback)(async e=>{const t=await B(e);C(r=>Object.assign(Object.assign({},r),{[e]:t}))},[B]);(0,o.useImperativeHandle)(h,()=>({refreshFileCounts:U}),[U]),(0,o.useEffect)(()=>{U()},[U]),(0,o.useEffect)(()=>{if(!e||"folders"===e)return;const t=(e,r=new Set)=>{if(r.has(e))return[];const n=y.find(t=>t.id===e);if(!n)return[];if(!n.parentId)return[];const i=new Set(r);return i.add(e),[...t(n.parentId,i),n.parentId]},r=t(e);r.length>0?L(e=>{const t=new Set(e);return r.forEach(e=>t.add(e)),t.add("folders"),Array.from(t)}):L(e=>e.includes("folders")?e:[...e,"folders"])},[e,y]);const H=(0,o.useCallback)(async()=>{await s(),e?await V(e):await V("folders")},[s,e,V]),W=[{key:Mt,label:b("My files"),icon:(0,i.jsx)(ii,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth})},{key:Pt,label:b("GIF"),icon:(0,i.jsx)(si,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth}),disabled:!I},{key:Rt,label:b("Stock images"),icon:(0,i.jsx)(Xn,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth}),disabled:!j},{key:Lt,label:b("Icons"),icon:(0,i.jsx)(ee.A,{size:20}),disabled:!T},{key:Dt,label:b("QR & Barcode"),icon:(0,i.jsx)(ci,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth}),disabled:!M},{key:Nt,label:b("AI"),icon:(0,i.jsx)(fi,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth}),disabled:!(null==k?void 0:k.sseQuery)}].filter(e=>!e.disabled),$=(0,o.useCallback)(async e=>{const t=e[0];t&&"empty"!==t&&(u!==Mt&&d(Mt),null==r||r(t),await(null==a?void 0:a(t)))},[r,u,d,a]),q=(0,o.useCallback)(({key:e})=>{d(e)},[d]),G=(0,o.useCallback)(async(e,t)=>{var r;if(L(e),"lazy"!==(null==k?void 0:k.folderTreeLoading))return;const n=(null===(r=null==t?void 0:t.node)||void 0===r?void 0:r.key)||void 0;if(n&&"folders"!==n)try{await(null==a?void 0:a(n))}catch(e){const t=await va({folderId:n,dataProviders:A,folders:y,pathHistory:E,t:b});w.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:b("Failed to load subfolders in folder",{folderName:t}),placement:"bottomRight",innerException:e,notificationDedupe:!0,data:{folderId:n,folderName:t,reason:e instanceof Error?e.message:String(e)}})}},[null==k?void 0:k.folderTreeLoading,A,a,w,E,y,b]);return(0,i.jsxs)("div",{className:"sidebar-container",children:[(0,i.jsxs)("div",{className:Ls.buttonWrapper,children:[(0,i.jsx)(m.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(li,{size:24,strokeWidth:null==k?void 0:k.iconStrokeWidth}),onClick:H,className:Ls.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===e,children:(0,i.jsx)("span",{className:Ls.uploadButtonTitle,children:b("Upload file")})}),(0,i.jsx)(m.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(oi,{size:24,strokeWidth:null==k?void 0:k.iconStrokeWidth}),onClick:()=>null==l?void 0:l(!0),className:Ls.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===e})]}),(0,i.jsx)(F.A,{className:"folder-menu",items:W,defaultSelectedKeys:[Mt],onSelect:({key:e})=>q({key:e}),selectedKeys:[u]}),(0,i.jsx)(O.A,{className:Ls.divider}),(0,i.jsxs)("div",{className:Ls.foldersContainer,children:[(0,i.jsx)(js,{selectedFolder:e,onSelect:$,onExpand:G,generateMenuItems:t,fetchChildFolders:a,showFileCounts:!0,folderFileCounts:x,expandedKeys:R,setExpandedKeys:L,showTrashFolder:null==k?void 0:k.enableTrashFolder}),(0,i.jsx)("div",{className:Ls.folderActions,children:(0,i.jsx)(m.Ay,{onClick:e=>{e.stopPropagation(),c()},className:Ls.button,icon:(0,i.jsx)(ti,{size:18,strokeWidth:null==k?void 0:k.iconStrokeWidth}),size:"middle"})})]})]})}));Ns.displayName="FolderSidebar";var Ds=Object.defineProperty,zs=(e,t,r)=>(((e,t,r)=>{t in e?Ds(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function Bs(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function Us(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function Vs(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=Us(e);return t>0?Bs(Number(e)*Math.pow(10,t)):Number(e)}function Hs(e){Gs&&(e>Number.MAX_SAFE_INTEGER||Number.MIN_SAFE_INTEGER)}function Ws(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0];return t.slice(1).reduce(function(t,r){return e(t,r)},n)}}var $s=Ws(function(e,t){var r=Vs(e),n=Vs(t),i=Us(e)+Us(t),o=r*n;return Hs(o),o/Math.pow(10,i)}),qs=(Ws(function(e,t){var r=Math.pow(10,Math.max(Us(e),Us(t)));return($s(e,r)+$s(t,r))/r}),Ws(function(e,t){var r=Math.pow(10,Math.max(Us(e),Us(t)));return($s(e,r)-$s(t,r))/r}),Ws(function(e,t){var r=Vs(e),n=Vs(t);return Hs(r),Hs(n),$s(r/n,Bs(Math.pow(10,Us(t)-Us(e))))})),Gs=!0,Ys=function(e,t){var r=Math.pow(10,t),n=qs(Math.round(Math.abs($s(e,r))),r);return e<0&&0!==n&&(n=$s(n,-1)),n},Xs=function(e){void 0===e&&(e=!0),Gs=e};const Ks=Object.prototype.toString;function Zs(e){switch(Ks.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return sl(e,Error)}}function Qs(e,t){return Ks.call(e)===`[object ${t}]`}function Js(e){return Qs(e,"ErrorEvent")}function el(e){return Qs(e,"DOMError")}function tl(e){return Qs(e,"String")}function rl(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function nl(e){return null===e||rl(e)||"object"!=typeof e&&"function"!=typeof e}function il(e){return Qs(e,"Object")}function ol(e){return typeof Event<"u"&&sl(e,Event)}function al(e){return!(!e||!e.then||"function"!=typeof e.then)}function sl(e,t){try{return e instanceof t}catch{return!1}}function ll(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function cl(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function ul(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const t=e[n];try{ll(t)?r.push("[VueViewModel]"):r.push(String(t))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function dl(e,t=[],r=!1){return t.some(t=>function(e,t,r=!1){return!!tl(e)&&(function(e){return Qs(e,"RegExp")}(t)?t.test(e):!!tl(t)&&(r?e===t:e.includes(t)))}(e,t,r))}function hl(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&sl(a.originalException,Error)))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=function(e,t){return e.map(e=>(e.value&&(e.value=cl(e.value,t)),e))}(fl(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function fl(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(sl(n[i],Error)){pl(a,s);const o=e(t,n[i]),c=l.length;gl(o,i,c,s),l=fl(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(sl(n,Error)){pl(a,s);const c=e(t,n),u=l.length;gl(c,`errors[${o}]`,u,s),l=fl(e,t,r,n,i,[c,...l],c,u)}}),l}function pl(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function gl(e,t,r,n){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function ml(e){return e&&e.Math==Math?e:void 0}const vl="object"==typeof globalThis&&ml(globalThis)||"object"==typeof window&&ml(window)||"object"==typeof self&&ml(self)||"object"==typeof r.g&&ml(r.g)||function(){return this}()||{};function yl(){return vl}function bl(e,t,r){const n=r||vl,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const wl=yl();function xl(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let o=0,a=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;r&&o++<n&&(c=Cl(r,u),!("html"===c||o>1&&a+i.length*l+c.length>=d));)i.push(c),a+=c.length,r=r.parentNode;return i.reverse().join(s)}catch{return"<unknown>"}}function Cl(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(wl.HTMLElement&&r instanceof HTMLElement&&r.dataset&&r.dataset.sentryComponent)return r.dataset.sentryComponent;n.push(r.tagName.toLowerCase());const c=t&&t.length?t.filter(e=>r.getAttribute(e)).map(e=>[e,r.getAttribute(e)]):null;if(c&&c.length)c.forEach(e=>{n.push(`[${e[0]}="${e[1]}"]`)});else if(r.id&&n.push(`#${r.id}`),i=r.className,i&&tl(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)n.push(`.${o[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=r.getAttribute(a),s&&n.push(`[${a}="${s}"]`);return n.join("")}const _l=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Sl=["debug","info","warn","error","log","assert","trace"],Al={};function kl(e){if(!("console"in vl))return e();const t=vl.console,r={},n=Object.keys(Al);n.forEach(e=>{const n=Al[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const El=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return _l?Sl.forEach(r=>{t[r]=(...t)=>{e&&kl(()=>{vl.console[r](`Sentry Logger [${r}]:`,...t)})}}):Sl.forEach(e=>{t[e]=()=>{}}),t}(),Il=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function jl(e,t=!1){const{host:r,path:n,pass:i,port:o,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${r}${o?`:${o}`:""}/${n&&`${n}/`}${a}`}function Tl(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}class Fl extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function Ol(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&Pl(i,n),e[t]=i}function Ml(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{_l&&El.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Pl(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,Ml(e,"__sentry_original__",t)}catch{}}function Rl(e){return e.__sentry_original__}function Ll(e){if(Zs(e))return{message:e.message,name:e.name,stack:e.stack,...Dl(e)};if(ol(e)){const t={type:e.type,target:Nl(e.target),currentTarget:Nl(e.currentTarget),...Dl(e)};return typeof CustomEvent<"u"&&sl(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Nl(e){try{return function(e){return typeof Element<"u"&&sl(e,Element)}(e)?xl(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Dl(e){if("object"==typeof e&&null!==e){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}return{}}function zl(e){return Bl(e,new Map)}function Bl(e,t){if(function(e){if(!il(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch{return!0}}(e)){const r=t.get(e);if(void 0!==r)return r;const n={};t.set(e,n);for(const i of Object.keys(e))typeof e[i]<"u"&&(n[i]=Bl(e[i],t));return n}if(Array.isArray(e)){const r=t.get(e);if(void 0!==r)return r;const n=[];return t.set(e,n),e.forEach(e=>{n.push(Bl(e,t))}),n}return e}const Ul=/\(error: (.*)\)/,Vl=/captureMessage|captureException/;function Hl(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,r=0)=>{const n=[],i=e.split("\n");for(let o=r;o<i.length;o++){const e=i[o];if(e.length>1024)continue;const r=Ul.test(e)?e.replace(Ul,"$1"):e;if(!r.match(/\S*Error: /)){for(const e of t){const t=e(r);if(t){n.push(t);break}}if(n.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),Vl.test(t[t.length-1].function||"")&&(t.pop(),Vl.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"}))}(n)}}function Wl(e){return Array.isArray(e)?Hl(...e):e}const $l="<anonymous>";function ql(e){try{return e&&"function"==typeof e&&e.name||$l}catch{return $l}}const Gl={},Yl={};function Xl(e,t){Gl[e]=Gl[e]||[],Gl[e].push(t)}function Kl(e,t){Yl[e]||(t(),Yl[e]=!0)}function Zl(e,t){const r=e&&Gl[e];if(r)for(const n of r)try{n(t)}catch(t){_l&&El.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${ql(n)}\nError:`,t)}}function Ql(){"console"in vl&&Sl.forEach(function(e){e in vl.console&&Ol(vl.console,e,function(t){return Al[e]=t,function(...t){Zl("console",{args:t,level:e});const r=Al[e];r&&r.apply(vl.console,t)}})})}function Jl(){const e=vl,t=e.crypto||e.msCrypto;let r=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(r=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&r())>>e/4).toString(16))}function ec(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function tc(e){const{message:t,event_id:r}=e;if(t)return t;const n=ec(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function rc(e,t,r){const n=e.exception=e.exception||{},i=n.values=n.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type="Error")}function nc(e,t){const r=ec(e);if(!r)return;const n=r.mechanism;if(r.mechanism={type:"generic",handled:!0,...n,...t},t&&"data"in t){const e={...n&&n.data,...t.data};r.mechanism.data=e}}function ic(e){if(e&&e.__sentry_captured__)return!0;try{Ml(e,"__sentry_captured__",!0)}catch{}return!1}function oc(e){return Array.isArray(e)?e:[e]}const ac=vl;let sc,lc,cc;function uc(){if(!ac.document)return;const e=Zl.bind(null,"dom"),t=dc(e,!0);ac.document.addEventListener("click",t,!1),ac.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=ac[t]&&ac[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ol(r,"addEventListener",function(t){return function(r,n,i){if("click"===r||"keypress"==r)try{const n=this,o=n.__sentry_instrumentation_handlers__=n.__sentry_instrumentation_handlers__||{},a=o[r]=o[r]||{refCount:0};if(!a.handler){const n=dc(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),Ol(r,"removeEventListener",function(e){return function(t,r,n){if("click"===t||"keypress"==t)try{const r=this,i=r.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,n),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete r.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,r,n)}}))})}function dc(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=function(e){try{return e.target}catch{return null}}(r);if(function(e,t){return!("keypress"!==e||t&&t.tagName&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable))}(r.type,n))return;Ml(r,"_sentryCaptured",!0),n&&!n._sentryId&&Ml(n,"_sentryId",Jl());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==lc)return!1;try{if(!e.target||e.target._sentryId!==cc)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),lc=r.type,cc=n?n._sentryId:void 0),clearTimeout(sc),sc=ac.setTimeout(()=>{cc=void 0,lc=void 0},1e3)}}const hc=yl();function fc(){if(!("fetch"in hc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function pc(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function gc(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!fc())return!1;if(pc(hc.fetch))return!0;let e=!1;const t=hc.document;if(t&&"function"==typeof t.createElement)try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=pc(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){_l&&El.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&Ol(vl,"fetch",function(e){return function(...t){const{method:r,url:n}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,r]=e;return{url:vc(t),method:mc(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:vc(t),method:mc(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Zl("fetch",{...i}),e.apply(vl,t).then(e=>(Zl("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Zl("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function mc(e,t){return!!e&&"object"==typeof e&&!!e[t]}function vc(e){return"string"==typeof e?e:e?mc(e,"url")?e.url:e.toString?e.toString():"":""}let yc=null;function bc(){yc=vl.onerror,vl.onerror=function(e,t,r,n,i){return Zl("error",{column:n,error:i,line:r,msg:e,url:t}),!(!yc||yc.__SENTRY_LOADER__)&&yc.apply(this,arguments)},vl.onerror.__SENTRY_INSTRUMENTED__=!0}let wc=null;function xc(){wc=vl.onunhandledrejection,vl.onunhandledrejection=function(e){return Zl("unhandledrejection",e),!(wc&&!wc.__SENTRY_LOADER__)||wc.apply(this,arguments)},vl.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Cc=yl(),_c=vl;let Sc;function Ac(e){const t="history";Xl(t,e),Kl(t,kc)}function kc(){if(!function(){const e=Cc.chrome,t=e&&e.app&&e.app.runtime,r="history"in Cc&&!!Cc.history.pushState&&!!Cc.history.replaceState;return!t&&r}())return;const e=_c.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=Sc,t=String(r);Sc=t,Zl("history",{from:e,to:t})}return e.apply(this,t)}}_c.onpopstate=function(...t){const r=_c.location.href,n=Sc;if(Sc=r,Zl("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},Ol(_c.history,"pushState",t),Ol(_c.history,"replaceState",t)}const Ec=vl,Ic="__sentry_xhr_v3__";function jc(){if(!Ec.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Ol(e,"open",function(e){return function(...t){const r=Date.now(),n=tl(t[0])?t[0].toUpperCase():void 0,i=function(e){if(tl(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[Ic]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[Ic];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}Zl("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?Ol(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),Ol(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[Ic];return i&&tl(r)&&tl(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),Ol(e,"send",function(e){return function(...t){const r=this[Ic];return r?(void 0!==t[0]&&(r.body=t[0]),Zl("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)):e.apply(this,t)}})}function Tc(e,t=100,r=1/0){try{return Oc("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Fc(e,t=3,r=102400){const n=Tc(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?Fc(e,t-1,r):n}function Oc(e,t,n=1/0,i=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(r){if(e)return!!t.has(r)||(t.add(r),!1);for(let e=0;e<t.length;e++)if(t[e]===r)return!0;return t.push(r),!1},function(r){if(e)t.delete(r);else for(let e=0;e<t.length;e++)if(t[e]===r){t.splice(e,1);break}}]}()){const[a,s]=o;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const l=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof r.g<"u"&&t===r.g)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(ll(t))return"[VueViewModel]";if(function(e){return il(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if("function"==typeof t)return`[Function: ${ql(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const n=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===c)return l.replace("object ","");if(a(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return Oc("",u.toJSON(),c-1,i,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const f=Ll(t);for(const r in f){if(!Object.prototype.hasOwnProperty.call(f,r))continue;if(h>=i){d[r]="[MaxProperties ~]";break}const e=f[r];d[r]=Oc(r,e,c-1,i,o),h++}return s(t),d}var Mc;function Pc(e){return new Lc(t=>{t(e)})}function Rc(e){return new Lc((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(Mc||(Mc={}));class Lc{constructor(e){Lc.prototype.__init.call(this),Lc.prototype.__init2.call(this),Lc.prototype.__init3.call(this),Lc.prototype.__init4.call(this),this._state=Mc.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Lc((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Lc((t,r)=>{let n,i;return this.then(t=>{i=!1,n=t,e&&e()},t=>{i=!0,n=t,e&&e()}).then(()=>{i?r(n):t(n)})})}__init(){this._resolve=e=>{this._setResult(Mc.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Mc.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===Mc.PENDING){if(al(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Mc.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Mc.RESOLVED&&e[1](this._value),this._state===Mc.REJECTED&&e[2](this._value),e[0]=!0)})}}}function Nc(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}const Dc=["fatal","error","warning","log","info","debug"];function zc(e){return"warn"===e?"warning":Dc.includes(e)?e:"log"}function Bc(){return Date.now()/1e3}const Uc=function(){const{performance:e}=vl;if(!e||!e.now)return Bc;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function Vc(e,t=[]){return[e,t]}function Hc(e,t){const[r,n]=e;return[r,[...n,t]]}function Wc(e,t){const r=e[1];for(const n of r)if(t(n,n[0].type))return!0;return!1}function $c(e,t){return(t||new TextEncoder).encode(e)}function qc(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[$c(i,t),e]:i.push("string"==typeof e?$c(e,t):e)}for(const a of n){const[e,t]=a;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(Tc(t))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}(i)}function Gc(e,t){const r="string"==typeof e.data?$c(e.data,t):e.data;return[zl({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=vl;if(!e||!e.now)return;const t=36e5,r=e.now(),n=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+r-n):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+r-n):t;(o||s<t)&&i<=s&&e.timeOrigin})();const Yc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function Xc(e){return Yc[e]}function Kc(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}const Zc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Qc="production";function Jc(){return bl("globalEventProcessors",()=>[])}function eu(e){Jc().push(e)}function tu(e,t,r,n=0){return new Lc((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);Zc&&a.id&&null===s&&El.log(`Event processor "${a.id}" dropped event`),al(s)?s.then(t=>tu(e,t,r,n+1).then(i)).then(null,o):tu(e,s,r,n+1).then(i).then(null,o)}})}function ru(e){const t=Uc(),r={sid:Jl(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return zl({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(r)};return e&&nu(r,e),r}function nu(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Uc(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Jl()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function iu(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),nu(e,r)}function ou(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=au(e);return zl({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function au(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}const su=new WeakMap;function lu(e,t){return Fu().captureEvent(e,t)}function cu(e,t){Fu().addBreadcrumb(e,t)}function uu(){return Fu().getClient()}function du(){return Fu().getScope()}function hu(e){const t=uu(),r=Ou(),n=du(),{release:i,environment:o=Qc}=t&&t.getOptions()||{},{userAgent:a}=vl.navigator||{},s=ru({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&nu(l,{status:"exited"}),fu(),r.setSession(s),n.setSession(s),s}function fu(){const e=Ou(),t=du(),r=t.getSession()||e.getSession();r&&iu(r),pu(),e.setSession(),t.setSession()}function pu(){const e=Ou(),t=du(),r=uu(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function gu(e=!1){e?fu():pu()}function mu(e){return e.transaction}function vu(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=zl({environment:n.environment||Qc,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function yu(e){const t=uu();if(!t)return{};const r=vu(au(e).trace_id||"",t,du()),n=mu(e);if(!n)return r;const i=n&&n._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:o,source:a}=n.metadata;null!=o&&(r.sample_rate=`${o}`);const s=au(n);return a&&"url"!==a&&(r.transaction=s.description),r.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return!!(1&t)}(n)),t.emit&&t.emit("createDsc",r),r}function bu(e,t){const{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:o}=t;(function(e,t){const{extra:r,tags:n,user:i,contexts:o,level:a,transactionName:s}=t,l=zl(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=zl(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=zl(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=zl(o);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),a&&(e.level=a),s&&(e.transaction=s)})(e,t),n&&function(e,t){e.contexts={trace:ou(t),...e.contexts};const r=mu(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:yu(t),...e.sdkProcessingMetadata};const n=au(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?oc(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,r),function(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}(e,i),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,o)}function wu(e,t){const{extra:r,tags:n,user:i,contexts:o,level:a,sdkProcessingMetadata:s,breadcrumbs:l,fingerprint:c,eventProcessors:u,attachments:d,propagationContext:h,transactionName:f,span:p}=t;xu(e,"extra",r),xu(e,"tags",n),xu(e,"user",i),xu(e,"contexts",o),xu(e,"sdkProcessingMetadata",s),a&&(e.level=a),f&&(e.transactionName=f),p&&(e.span=p),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),c.length&&(e.fingerprint=[...e.fingerprint,...c]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function xu(e,t,r){if(r&&Object.keys(r).length){e[t]={...e[t]};for(const n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[t][n]=r[n])}}let Cu;class _u{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Su()}static clone(e){return e?e.clone():new _u}clone(){const e=new _u;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&nu(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e;if(t instanceof _u){const e=t.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(il(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Su(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:Bc(),...e},i=this._breadcrumbs;return i.push(n),this._breadcrumbs=i.length>r?i.slice(-r):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:r,_tags:n,_extra:i,_user:o,_level:a,_fingerprint:s,_eventProcessors:l,_propagationContext:c,_sdkProcessingMetadata:u,_transactionName:d,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:r,tags:n,extra:i,user:o,level:a,fingerprint:s||[],eventProcessors:l,propagationContext:c,sdkProcessingMetadata:u,transactionName:d,span:h}}applyToEvent(e,t={},r=[]){return bu(e,this.getScopeData()),tu([...r,...Jc(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t&&t.event_id?t.event_id:Jl();if(!this._client)return El.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r&&r.event_id?r.event_id:Jl();if(!this._client)return El.warn("No client configured on scope - will not capture message!"),n;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=t&&t.event_id?t.event_id:Jl();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(El.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Su(){return{traceId:Jl(),spanId:Jl().substring(16)}}const Au="7.116.0",ku=parseFloat(Au),Eu=100;class Iu{constructor(e,t,r,n=ku){let i,o;this._version=n,t?i=t:(i=new _u,i.setClient(e)),r?o=r:(o=new _u,o.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let r;try{r=e(t)}catch(e){throw this.popScope(),e}return al(r)?r.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const r=this._lastEventId=t&&t.event_id?t.event_id:Jl(),n=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:n,...t,event_id:r}),r}captureMessage(e,t,r){const n=this._lastEventId=r&&r.event_id?r.event_id:Jl(),i=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n}),n}captureEvent(e,t){const r=t&&t.event_id?t.event_id:Jl();return e.type||(this._lastEventId=r),this.getScope().captureEvent(e,{...t,event_id:r}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:r,client:n}=this.getStackTop();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Eu}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:Bc(),...e},s=i?kl(()=>i(a,t)):a;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),r.addBreadcrumb(s,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:r}=this.getStackTop();r&&e(t)}run(e){const t=Tu(this);try{e(this)}finally{Tu(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Zc&&El.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return Zc&&!r&&(this.getClient()?El.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):El.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&iu(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Qc}=r&&r.getOptions()||{},{userAgent:o}=vl.navigator||{},a=ru({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&nu(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return!(!t||!t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),r=e.getSession();r&&t&&t.captureSession&&t.captureSession(r)}_callExtensionMethod(e,...t){const r=ju().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Zc&&El.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function ju(){return vl.__SENTRY__=vl.__SENTRY__||{extensions:{},hub:void 0},vl}function Tu(e){const t=ju(),r=Mu(t);return Pu(t,e),r}function Fu(){const e=ju();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=ju()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||Mu(e).isOlderThan(ku))&&Pu(e,new Iu),Mu(e)}(e)}function Ou(){return Fu().getIsolationScope()}function Mu(e){return bl("hub",()=>new Iu,e)}function Pu(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}const Ru=[];function Lu(e){const t=e.defaultIntegrations||[],r=e.integrations;let n;t.forEach(e=>{e.isDefaultInstance=!0}),n=Array.isArray(r)?[...t,...r]:"function"==typeof r?oc(r(t)):t;const i=function(e){const t={};return e.forEach(e=>{const{name:r}=e,n=t[r];n&&!n.isDefaultInstance&&e.isDefaultInstance||(t[r]=e)}),Object.keys(t).map(e=>t[e])}(n),o=function(e,t){for(let r=0;r<e.length;r++)if(!0===t(e[r]))return r;return-1}(i,e=>"Debug"===e.name);if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}function Nu(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function Du(e,t,r){if(r[t.name])Zc&&El.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===Ru.indexOf(t.name)&&(t.setupOnce(eu,Fu),Ru.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,n)=>r(t,n,e))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const r=t.processEvent.bind(t),n=Object.assign((t,n)=>r(t,n,e),{id:t.name});e.addEventProcessor(n)}Zc&&El.log(`Integration installed: ${t.name}`)}}function zu(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}const Bu="Not capturing exception because it's already been captured.";class Uu{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Il.exec(e);if(!t)return void kl(()=>{});const[r,n,i="",o,a="",s]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return Tl({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):Tl(e);if(t&&function(e){if(!_l)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(El.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(El.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(El.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(El.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}(e.dsn):Zc&&El.warn("No DSN provided, client will not send events."),this._dsn){const t=function(e,t={}){const r="string"==typeof t?t:t.tunnel,n="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return r||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return function(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}(e,n)}`}(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,r){if(ic(e))return void(Zc&&El.log(Bu));let n=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,r)).then(e=>{n=e})),n}captureMessage(e,t,r,n){let i=r&&r.event_id;const o=rl(e)?e:String(e),a=nl(e)?this.eventFromMessage(o,t,r):this.eventFromException(e,r);return this._process(a.then(e=>this._captureEvent(e,r,n)).then(e=>{i=e})),i}captureEvent(e,t,r){if(t&&t.originalException&&ic(t.originalException))return void(Zc&&El.log(Bu));let n=t&&t.event_id;const i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,i||r).then(e=>{n=e})),n}captureSession(e){"string"!=typeof e.release?Zc&&El.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),nu(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(r=>t.flush(e).then(e=>r&&e))):Pc(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return Zc&&El.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Du(this,e,this._integrations),t||Nu(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=function(e,t,r,n){const i=Kc(r),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,r&&r.sdk);const a=function(e,t,r,n){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:jl(n)},...i&&{trace:zl({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,Vc(a,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])r=Hc(r,Gc(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));const n=this._sendEnvelope(r);n&&n.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){const t=function(e,t,r,n){const i=Kc(r);return Vc({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:jl(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,r){if(this._options.sendClientReports){const r=`${e}:${t}`;Zc&&El.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){Zc&&El.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=function(e,t,r,n){const i={sent_at:(new Date).toISOString()};r&&r.sdk&&(i.sdk={name:r.sdk.name,version:r.sdk.version}),n&&t&&(i.dsn=jl(t));const o=function(e){const t=function(e){let t="";for(const r of e){const e=Object.entries(r.tags),n=e.length>0?`|#${e.map(([e,t])=>`${e}:${t}`).join(",")}`:"";t+=`${r.name}@${r.unit}:${r.metric}|${r.metricType}${n}|T${r.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return Vc(i,[o])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(e=>e(...t))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const r={};return t.forEach(t=>{t&&Du(e,t,r)}),r}(this,e),Nu(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let r=!1,n=!1;const i=t.exception&&t.exception.values;if(i){n=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){r=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&r)&&(nu(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Lc(t=>{let r=0;const n=setInterval(()=>{0==this._numProcessing?(clearInterval(n),t(!0)):(r+=1,e&&r>=e&&(clearInterval(n),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,r,n=Ou()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),function(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||Jl(),timestamp:t.timestamp||Bc()},c=r.integrations||e.integrations.map(e=>e.name);(function(e,t){const{environment:r,release:n,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?r:Qc),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=cl(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=cl(a.value,o));const s=e.request;s&&s.url&&(s.url=cl(s.url,o))})(l,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(l,c),void 0===t.type&&function(e,t){const r=vl._sentryDebugIds;if(!r)return;let n;const i=su.get(t);i?n=i:(n=new Map,su.set(t,n));const o=Object.keys(r).reduce((e,i)=>{let o;const a=n.get(i);a?o=a:(o=t(i),n.set(i,o));for(let t=o.length-1;t>=0;t--){const n=o[t];if(n.filename){e[n.filename]=r[i];break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=o[e.filename])})})}catch{}}(l,e.stackParser);const u=function(e,t){if(!t)return e;const r=e?e.clone():new _u;return r.update(t),r}(n,r.captureContext);r.mechanism&&nc(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(Cu||(Cu=new _u),Cu).getScopeData();o&&wu(h,o.getScopeData()),u&&wu(h,u.getScopeData());const f=[...r.attachments||[],...h.attachments];return f.length&&(r.attachments=f),bu(l,h),tu([...d,...Jc(),...h.eventProcessors],l,r).then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch{}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.keys(t).forEach(e=>{r.push({type:"sourcemap",code_file:e,debug_id:t[e]})})}(e),"number"==typeof a&&a>0?function(e,t,r){if(!e)return null;const n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Tc(e.data,t,r)}}))},...e.user&&{user:Tc(e.user,t,r)},...e.contexts&&{contexts:Tc(e.contexts,t,r)},...e.extra&&{extra:Tc(e.extra,t,r)}};return e.contexts&&e.contexts.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=Tc(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=au(e).data;return n&&(e.data=Tc(n,t,r)),e})),n}(e,a,s):e))}(i,e,t,r,this,n).then(e=>{if(null===e)return e;const t={...n.getPropagationContext(),...r?r.getPropagationContext():void 0};if((!e.contexts||!e.contexts.trace)&&t){const{traceId:n,spanId:i,parentSpanId:o,dsc:a}=t;e.contexts={trace:{trace_id:n,span_id:i,parent_span_id:o},...e.contexts};const s=a||vu(n,this,r);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},r){return this._processEvent(e,t,r).then(e=>e.event_id,e=>{if(Zc){const t=e;"log"===t.logLevel?El.log(t.message):El.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=Hu(e),a=Vu(e),s=e.type||"error",l=`before send for type \`${s}\``;if(a&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),Rc(new Fl(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const c="replay_event"===s?"replay":s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,r,u).then(r=>{if(null===r)throw this.recordDroppedEvent("event_processor",c,e),new Fl("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return r;const i=function(e,t,r){const{beforeSend:n,beforeSendTransaction:i}=e;return Vu(t)&&n?n(t,r):Hu(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(al(e))return e.then(e=>{if(!il(e)&&null!==e)throw new Fl(r);return e},e=>{throw new Fl(`${t} rejected with ${e}`)});if(!il(e)&&null!==e)throw new Fl(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new Fl(`${l} returned \`null\`, will not send event.`,"log");const i=r&&r.getSession();!o&&i&&this._updateSessionFromEvent(i,n);const a=n.transaction_info;if(o&&a&&n.transaction!==e.transaction){const e="custom";n.transaction_info={...a,source:e}}return this.sendEvent(n,t),n}).then(null,e=>{throw e instanceof Fl?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Fl(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,e=>{Zc&&El.error("Error while sending event:",e)});Zc&&El.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[r,n]=t.split(":");return{reason:r,category:n,quantity:e[t]}})}}function Vu(e){return void 0===e.type}function Hu(e){return"transaction"===e.type}function Wu(e,t,r=function(e){const t=[];function r(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(n){if(!(void 0===e||t.length<e))return Rc(new Fl("Not adding Promise because buffer limit was reached."));const i=n();return-1===t.indexOf(i)&&t.push(i),i.then(()=>r(i)).then(null,()=>r(i).then(null,()=>{})),i},drain:function(e){return new Lc((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{Pc(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}(e.bufferSize||30)){let n={};function i(i){const o=[];if(Wc(i,(t,r)=>{const i=Xc(r);if(function(e,t,r=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>r}(n,i)){const n=$u(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return Pc();const a=Vc(i[0],o),s=t=>{Wc(a,(r,n)=>{const i=$u(r,n);e.recordDroppedEvent(t,Xc(n),i)})};return r.add(()=>t({body:qc(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Zc&&El.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=function(e,{statusCode:t,headers:r},n=Date.now()){const i={...e},o=r&&r["x-sentry-rate-limits"],a=r&&r["retry-after"];if(o)for(const s of o.trim().split(",")){const[e,t,,,r]=s.split(":",5),o=parseInt(e,10),a=1e3*(isNaN(o)?60:o);if(t)for(const s of t.split(";"))"metric_bucket"===s?(!r||r.split(";").includes("custom"))&&(i[s]=n+a):i[s]=n+a;else i.all=n+a}else a?i.all=n+function(e,t=Date.now()){const r=parseInt(`${e}`,10);if(!isNaN(r))return 1e3*r;const n=Date.parse(`${e}`);return isNaN(n)?6e4:n-t}(a,n):429===t&&(i.all=n+6e4);return i}(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof Fl)return Zc&&El.error("Skipped sending event because buffer is full."),s("queue_overflow"),Pc();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function $u(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function qu(e,t,r=[t],n="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:r.map(e=>({name:`${n}:@sentry/${e}`,version:Au})),version:Au}),e._metadata=i}const Gu=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Yu=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Xu="InboundFilters",Ku=(e={})=>({name:Xu,setupOnce(){},processEvent(t,r,n){const i=n.getOptions(),o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Gu],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Yu],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch{}return!1}(e)?(Zc&&El.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${tc(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){const t=[];let r;e.message&&t.push(e.message);try{r=e.exception.values[e.exception.values.length-1]}catch{}return r&&r.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`)),Zc&&0===t.length&&El.error(`Could not extract message for event ${tc(e)}`),t}(e).some(e=>dl(e,t))}(e,t.ignoreErrors)?(Zc&&El.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${tc(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&dl(r,t)}(e,t.ignoreTransactions)?(Zc&&El.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${tc(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=Zu(e);return!!r&&dl(r,t)}(e,t.denyUrls)?(Zc&&El.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${tc(e)}.\nUrl: ${Zu(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=Zu(e);return!r||dl(r,t)}(e,t.allowUrls)&&(Zc&&El.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${tc(e)}.\nUrl: ${Zu(e)}`),!0)}(t,o)?null:t}});function Zu(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&"<anonymous>"!==r.filename&&"[native code]"!==r.filename)return r.filename||null}return null}(t):null}catch{return Zc&&El.error(`Cannot extract url for event ${tc(e)}`),null}}let Qu;zu(Xu,Ku);const Ju="FunctionToString",ed=new WeakMap,td=()=>({name:Ju,setupOnce(){Qu=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Rl(this),r=ed.has(uu())&&void 0!==t?t:this;return Qu.apply(r,e)}}catch{}},setup(e){ed.set(e,!0)}});zu(Ju,td);const rd=vl;let nd=0;function id(){return nd>0}function od(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(Rl(e))return e}catch{return e}const n=function(){const n=Array.prototype.slice.call(arguments);try{r&&"function"==typeof r&&r.apply(this,arguments);const i=n.map(e=>od(e,t));return e.apply(this,i)}catch(e){throw nd++,setTimeout(()=>{nd--}),function(...e){const t=Fu();if(2===e.length){const[r,n]=e;return r?t.withScope(()=>(t.getStackTop().scope=r,n(r))):t.withScope(n)}t.withScope(e[0])}(i=>{i.addEventProcessor(e=>(t.mechanism&&(rc(e,void 0),nc(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){Fu().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}Pl(n,e),Ml(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const ad=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function sd(e,t){const r=cd(e,t),n={type:t&&t.name,value:dd(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function ld(e,t){return{exception:{values:[sd(e,t)]}}}function cd(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(ud.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const ud=/Minified React error #\d+;/i;function dd(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function hd(e,t,r,n,i){let o;if(Js(t)&&t.error)return ld(e,t.error);if(el(t)||function(e){return Qs(e,"DOMException")}(t)){const i=t;if("stack"in t)o=ld(e,t);else{const t=i.name||(el(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=fd(e,a,r,n),rc(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return Zs(t)?ld(e,t):il(t)||ol(t)?(o=function(e,t,r,n){const i=uu(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:ol(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:pd(t,{isUnhandledRejection:n})}]},extra:{__serialized__:Fc(t,o)}};if(r){const t=cd(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),nc(o,{synthetic:!0}),o):(o=fd(e,t,r,n),rc(o,`${t}`),nc(o,{synthetic:!0}),o)}function fd(e,t,r,n){const i={};if(n&&r){const n=cd(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(rl(t)){const{__sentry_template_string__:e,__sentry_template_values__:r}=t;return i.logentry={message:e,params:r},i}return i.message=t,i}function pd(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(Ll(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return cl(r[0],t);for(let n=r.length;n>0;n--){const e=r.slice(0,n).join(", ");if(!(e.length>t))return n===r.length?e:cl(e,t)}return""}(e),n=t?"promise rejection":"exception";return Js(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:ol(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}class gd extends Uu{constructor(e){qu(e,"browser",["browser"],rd.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&rd.document&&rd.document.addEventListener("visibilitychange",()=>{"hidden"===rd.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=hd(e,t,r&&r.syntheticException||void 0,n);return nc(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),Pc(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=fd(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Pc(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(ad&&El.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:r,dsn:n}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!r&&!!n&&{dsn:jl(n)}},o=function(e){return[{type:"user_report"},e]}(e);return Vc(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(ad&&El.log("No outcomes to send"));if(!this._dsn)return void(ad&&El.log("No dsn provided, will not send outcomes"));ad&&El.log("Sending outcomes:",e);const t=function(e,t){return Vc(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:Bc(),discarded_events:e}]])}(e,this._options.tunnel&&jl(this._dsn));this._sendEnvelope(t)}}let md;function vd(e,t=function(){if(md)return md;if(pc(rd.fetch))return md=rd.fetch.bind(rd);const e=rd.document;let t=rd.fetch;if(e&&"function"==typeof e.createElement)try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r);const n=r.contentWindow;n&&n.fetch&&(t=n.fetch),e.head.removeChild(r)}catch(e){ad&&El.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return md=t.bind(rd)}()){let r=0,n=0;return Wu(e,function(i){const o=i.body.length;r+=o,n++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};try{return t(e.url,a).then(e=>(r-=o,n--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(e){return md=void 0,r-=o,n--,Rc(e)}})}function yd(e){return Wu(e,function(t){return new Lc((r,n)=>{const i=new XMLHttpRequest;i.onerror=n,i.onreadystatechange=()=>{4===i.readyState&&r({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)})})}const bd="?";function wd(e,t,r,n){const i={filename:e,function:t,in_app:!0};return void 0!==r&&(i.lineno=r),void 0!==n&&(i.colno=n),i}const xd=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Cd=/\((\S*)(?::(\d+))(?::(\d+))\)/,_d=[30,e=>{const t=xd.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Cd.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=Td(t[1]||bd,t[2]);return wd(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Sd=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ad=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kd=[50,e=>{const t=Sd.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Ad.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],r=t[1]||bd;return[r,e]=Td(r,e),wd(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Ed=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Id=[40,e=>{const t=Ed.exec(e);return t?wd(t[2],t[1]||bd,+t[3],t[4]?+t[4]:void 0):void 0}],jd=Hl(_d,kd,Id),Td=(e,t)=>{const r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:bd,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Fd="Breadcrumbs",Od=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Fd,setupOnce(){},setup(e){t.console&&function(e){const t="console";Xl(t,e),Kl(t,Ql)}(function(e){return function(t){if(uu()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:zc(t.level),message:ul(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${ul(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}cu(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){Xl("dom",e),Kl("dom",uc)}(function(e,t){return function(r){if(uu()!==e)return;let n,i,o="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;a&&a>1024&&(ad&&El.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=1024),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=xl(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!wl.HTMLElement)return null;let t=e;for(let r=0;r<5;r++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}(t)}catch{n="<unknown>"}if(0===n.length)return;const s={category:`ui.${r.name}`,message:n};i&&(s.data={"ui.component_name":i}),cu(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){Xl("xhr",e),Kl("xhr",jc)}(function(e){return function(t){if(uu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[Ic];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;cu({category:"xhr",data:{method:o,url:a,status_code:s},type:"http"},{xhr:t.xhr,input:l,startTimestamp:r,endTimestamp:n})}}(e)),t.fetch&&function(e){const t="fetch";Xl(t,e),Kl(t,gc)}(function(e){return function(t){if(uu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)cu({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n});else{const e=t.response;cu({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&Ac(function(e){return function(t){if(uu()!==e)return;let r=t.from,n=t.to;const i=Nc(rd.location.href);let o=r?Nc(r):void 0;const a=Nc(n);(!o||!o.path)&&(o=i),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),cu({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){uu()===e&&cu({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:tc(t)},{event:t})}}(e))}}};zu(Fd,Od);const Md="Dedupe",Pd=()=>{let e;return{name:Md,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&!(!function(e,t){const r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Ld(e,t)||!Rd(e,t))}(e,t)&&!function(e,t){const r=Nd(t),n=Nd(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&Ld(e,t)&&Rd(e,t))}(e,t))}(t,e))return ad&&El.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function Rd(e,t){let r=Dd(e),n=Dd(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const e=n[i],t=r[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function Ld(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;try{return r.join("")===n.join("")}catch{return!1}}function Nd(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Dd(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}zu(Md,Pd);const zd="GlobalHandlers",Bd=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:zd,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";Xl(t,e),Kl(t,bc)}(t=>{const{stackParser:r,attachStacktrace:n}=Hd();if(uu()!==e||id())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&tl(i)?function(e,t,r,n){let i=Js(e)?e.message:e,o="Error";const a=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);return a&&(o=a[1],i=a[2]),Ud({exception:{values:[{type:o,value:i}]}},t,r,n)}(i,o,a,s):Ud(hd(r,l||i,void 0,n,!1),o,a,s);c.level="error",lu(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Vd("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";Xl(t,e),Kl(t,xc)}(t=>{const{stackParser:r,attachStacktrace:n}=Hd();if(uu()!==e||id())return;const i=function(e){if(nl(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return e}(t),o=nl(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):hd(r,i,void 0,n,!0);o.level="error",lu(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Vd("onunhandledrejection"))}}};function Ud(e,t,r,n){const i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(n,10))?void 0:n,u=isNaN(parseInt(r,10))?void 0:r,d=tl(t)&&t.length>0?t:function(){try{return wl.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Vd(e){ad&&El.log(`Global Handler attached: ${e}`)}function Hd(){const e=uu();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}zu(zd,Bd);const Wd="HttpContext",$d=()=>({name:Wd,setupOnce(){},preprocessEvent(e){if(!rd.navigator&&!rd.location&&!rd.document)return;const t=e.request&&e.request.url||rd.location&&rd.location.href,{referrer:r}=rd.document||{},{userAgent:n}=rd.navigator||{},i={...e.request&&e.request.headers,...r&&{Referer:r},...n&&{"User-Agent":n}},o={...e.request,...t&&{url:t},headers:i};e.request=o}});zu(Wd,$d);const qd="LinkedErrors",Gd=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:qd,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();hl(sd,o.stackParser,o.maxValueLength,r,t,e,n)}}};zu(qd,Gd);const Yd=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Xd="TryCatch",Kd=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:Xd,setupOnce(){t.setTimeout&&Ol(rd,"setTimeout",Zd),t.setInterval&&Ol(rd,"setInterval",Zd),t.requestAnimationFrame&&Ol(rd,"requestAnimationFrame",Qd),t.XMLHttpRequest&&"XMLHttpRequest"in rd&&Ol(XMLHttpRequest.prototype,"send",Jd);const e=t.eventTarget;e&&(Array.isArray(e)?e:Yd).forEach(eh)}}};function Zd(e){return function(...t){const r=t[0];return t[0]=od(r,{mechanism:{data:{function:ql(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Qd(e){return function(t){return e.apply(this,[od(t,{mechanism:{data:{function:"requestAnimationFrame",handler:ql(e)},handled:!1,type:"instrument"}})])}}function Jd(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&Ol(r,e,function(t){const r={mechanism:{data:{function:e,handler:ql(t)},handled:!1,type:"instrument"}},n=Rl(t);return n&&(r.mechanism.data.handler=ql(n)),od(t,r)})}),e.apply(this,t)}}function eh(e){const t=rd,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ol(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=od(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ql(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,od(n,{mechanism:{data:{function:"addEventListener",handler:ql(n),target:e},handled:!1,type:"instrument"}}),i])}}),Ol(r,"removeEventListener",function(e){return function(t,r,n){const i=r;try{const r=i&&i.__sentry_wrapped__;r&&e.call(this,t,r,n)}catch{}return e.call(this,t,i,n)}}))}zu(Xd,Kd);const th=[Ku(),td(),Kd(),Od(),Bd(),Gd(),Pd(),$d()];function rh(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...th]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),rd.SENTRY_RELEASE&&rd.SENTRY_RELEASE.id&&(e.release=rd.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Wl(e.stackParser||jd),integrations:Lu(e),transport:e.transport||(fc()?vd:yd)};(function(e,t){!0===t.debug&&(Zc?El.enable():kl(()=>{})),du().update(t.initialScope);const r=new e(t);(function(e){const t=Fu().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)})(gd,t),e.autoSessionTracking&&(typeof rd.document>"u"?ad&&El.warn("Session tracking in non-browser environment with @sentry/browser is not supported."):(hu({ignoreDuration:!0}),gu(),Ac(({from:e,to:t})=>{void 0!==e&&e!==t&&(hu({ignoreDuration:!0}),gu())})))}var nh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof r.g<"u"?r.g:typeof self<"u"?self:{};function ih(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oh=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(oh||{}),ah=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(ah||{});function sh(e,t){return{...t,message:e}}const lh={emoticons:sh("Emoticons"),doodles:sh("Doodles"),landmarks:sh("Landmarks"),bubbles:sh("Bubbles"),transportation:sh("Transportation"),beach:sh("Beach")},ch={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},uh=[1,8,15,20,25];var dh=(e=>(e.DARK="dark",e.LIGHT="light",e))(dh||{});const hh=[{name:dh.LIGHT,colors:{"--be-foreground-base":"0 0 0","--be-primary-light":"191 219 254","--be-primary":"59 130 246","--be-primary-dark":"37 99 235","--be-on-primary":"255 255 255","--be-danger":"179 38 30","--be-on-danger":"255 255 255","--be-background":"255 255 255","--be-background-alt":"250 250 250","--be-paper":"255 255 255","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"26%","--be-hover-opacity":"4%","--be-focus-opacity":"12%","--be-selected-opacity":"8%","--be-text-main-opacity":"87%","--be-text-muted-opacity":"60%","--be-divider-opacity":"12%"}},{name:dh.DARK,isDark:!0,colors:{"--be-foreground-base":"255 255 255","--be-primary-light":"239 246 255","--be-primary":"191 219 254","--be-primary-dark":"147 197 253","--be-on-primary":"56 30 114","--be-danger":"242 184 181","--be-on-danger":"96 20 16","--be-background":"20 21 23","--be-background-alt":"26 27 30","--be-paper":"44 46 51","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"30%","--be-hover-opacity":"8%","--be-focus-opacity":"12%","--be-selected-opacity":"16%","--be-text-main-opacity":"100%","--be-text-muted-opacity":"70%","--be-divider-opacity":"12%"}}];var fh=(e=>(e.FILTER="filter",e.RESIZE="resize",e.CROP="crop",e.DRAW="draw",e.TEXT="text",e.SHAPES="shapes",e.STICKERS="stickers",e.FRAME="frame",e.CORNERS="corners",e.MERGE="merge",e))(fh||{});function ph(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=ph(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function gh(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=ph(e))&&(n&&(n+=" "),n+=t);return n}const mh=(0,o.forwardRef)((e,t)=>{const{attr:r,size:n,title:o,className:a,color:s,style:l,children:c,viewBox:u,width:d,height:h,...f}=e;return(0,i.jsxs)("svg",{"aria-hidden":!o,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:u||"0 0 24 24",...r,...f,className:gh("svg-icon",a,vh(n)),style:{color:s,...l},ref:t,height:h||"1em",width:d||"1em",children:[o&&(0,i.jsx)("title",{children:o}),c]})});function vh(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":return"icon-sm";case"md":return"icon-md";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return e}}function yh(e,t="",r){return o.memo(o.forwardRef((n,o)=>(0,i.jsx)(mh,{"data-testid":`${t}Icon`,ref:o,viewBox:r,...n,size:n.size||"md",children:e})))}function bh(e,t=""){return yh(wh(e),t)}function wh(e){return(null==e?void 0:e.map)&&e.map((e,t)=>o.createElement(e.tag,{key:t,...e.attr},wh(e.child)))}const xh=yh((0,i.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),Ch=yh((0,i.jsx)("path",{d:"M21 15h2v2h-2v-2zm0-4h2v2h-2v-2zm2 8h-2v2c1 0 2-1 2-2zM13 3h2v2h-2V3zm8 4h2v2h-2V7zm0-4v2h2c0-1-1-2-2-2zM1 7h2v2H1V7zm16-4h2v2h-2V3zm0 16h2v2h-2v-2zM3 3C2 3 1 4 1 5h2V3zm6 0h2v2H9V3zM5 3h2v2H5V3zm-4 8v8c0 1.1.9 2 2 2h12V11H1zm2 8 2.5-3.21 1.79 2.15 2.5-3.22L13 19H3z"}),"PhotoSizeSelectLargeOutlined"),_h=yh((0,i.jsx)("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),Sh=yh((0,i.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),Ah=yh((0,i.jsx)("path",{d:"M10.5 4.5c.28 0 .5.22.5.5v2h6v6h2c.28 0 .5.22.5.5s-.22.5-.5.5h-2v6h-2.12c-.68-1.75-2.39-3-4.38-3s-3.7 1.25-4.38 3H4v-2.12c1.75-.68 3-2.39 3-4.38 0-1.99-1.24-3.7-2.99-4.38L4 7h6V5c0-.28.22-.5.5-.5m0-2C9.12 2.5 8 3.62 8 5H4c-1.1 0-1.99.9-1.99 2v3.8h.29c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-.3c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7v.3H17c1.1 0 2-.9 2-2v-4c1.38 0 2.5-1.12 2.5-2.5S20.38 11 19 11V7c0-1.1-.9-2-2-2h-4c0-1.38-1.12-2.5-2.5-2.5z"}),"ExtensionOutlined"),kh=yh((0,i.jsx)("path",{d:"M10.25 13c0 .69-.56 1.25-1.25 1.25S7.75 13.69 7.75 13s.56-1.25 1.25-1.25 1.25.56 1.25 1.25zM15 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm7 .25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c.46 0 .91-.05 1.34-.12C17.44 5.56 14.9 4 12 4c-.46 0-.91.05-1.34.12zM4.42 9.47c1.71-.97 3.03-2.55 3.66-4.44C6.37 6 5.05 7.58 4.42 9.47zM20 12c0-.78-.12-1.53-.33-2.24-.7.15-1.42.24-2.17.24-3.13 0-5.92-1.44-7.76-3.69C8.69 8.87 6.6 10.88 4 11.86c.01.04 0 .09 0 .14 0 4.41 3.59 8 8 8s8-3.59 8-8z"}),"FaceOutlined"),Eh=yh((0,i.jsx)("path",{d:"M20 4h-4l-4-4-4 4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H4V6h4.52l3.52-3.5L15.52 6H20v14zM6 18h12V8H6v10zm2-8h8v6H8v-6z"}),"FilterFramesOutlined"),Ih=yh((0,i.jsx)("path",{d:"M6.41 21 5 19.59l4.83-4.83c.75-.75 1.17-1.77 1.17-2.83v-5.1L9.41 8.41 8 7l4-4 4 4-1.41 1.41L13 6.83v5.1c0 1.06.42 2.08 1.17 2.83L19 19.59 17.59 21 12 15.41 6.41 21z"}),"MergeOutlined"),jh=yh((0,i.jsx)("path",{d:"M19 19h2v2h-2v-2zm0-2h2v-2h-2v2zM3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm0-4h2V3H3v2zm4 0h2V3H7v2zm8 16h2v-2h-2v2zm-4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm-8 0h2v-2H7v2zm-4 0h2v-2H3v2zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2V8z"}),"RoundedCornerOutlined"),Th=yh((0,i.jsx)("path",{d:"M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}),"PhotoLibraryOutlined"),Fh=yh((0,i.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined"),Oh=yh([(0,i.jsx)("path",{d:"m2.53 19.65 1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z"},"0"),(0,i.jsx)("circle",{cx:"11",cy:"9",r:"1"},"1"),(0,i.jsx)("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),Mh=yh((0,i.jsx)("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}),"DeleteOutlined"),Ph=yh((0,i.jsx)("path",{d:"M18.85,10.39l1.06-1.06c0.78-0.78,0.78-2.05,0-2.83L18.5,5.09c-0.78-0.78-2.05-0.78-2.83,0l-1.06,1.06L18.85,10.39z M14.61,11.81L7.41,19H6v-1.41l7.19-7.19L14.61,11.81z M13.19,7.56L4,16.76V21h4.24l9.19-9.19L13.19,7.56L13.19,7.56z M19,17.5 c0,2.19-2.54,3.5-5,3.5c-0.55,0-1-0.45-1-1s0.45-1,1-1c1.54,0,3-0.73,3-1.5c0-0.47-0.48-0.87-1.23-1.2l1.48-1.48 C18.32,15.45,19,16.29,19,17.5z M4.58,13.35C3.61,12.79,3,12.06,3,11c0-1.8,1.89-2.63,3.56-3.36C7.59,7.18,9,6.56,9,6 c0-0.41-0.78-1-2-1C5.74,5,5.2,5.61,5.17,5.64C4.82,6.05,4.19,6.1,3.77,5.76C3.36,5.42,3.28,4.81,3.62,4.38C3.73,4.24,4.76,3,7,3 c2.24,0,4,1.32,4,3c0,1.87-1.93,2.72-3.64,3.47C6.42,9.88,5,10.5,5,11c0,0.31,0.43,0.6,1.07,0.86L4.58,13.35z"}),"Draw"),Rh=yh((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),Lh={[fh.FILTER]:{name:sh("Applied Filters"),icon:xh},[fh.RESIZE]:{name:sh("Resized Image"),icon:Ch},[fh.CROP]:{name:sh("Cropped Image"),icon:_h},[fh.DRAW]:{name:sh("Added Drawing"),icon:Ph},[fh.TEXT]:{name:sh("Added Text"),icon:Sh},[fh.SHAPES]:{name:sh("Added Shape"),icon:Ah},[fh.STICKERS]:{name:sh("Added Sticker"),icon:kh},[fh.FRAME]:{name:sh("Added Frame"),icon:Eh},[fh.MERGE]:{name:sh("Merged Objects"),icon:Ih},[fh.CORNERS]:{name:sh("Rounded Corner"),icon:jh},bgImage:{name:sh("Replaced Background Image"),icon:Th},overlayImage:{name:sh("Added Image"),icon:Th},initial:{name:sh("Initial"),icon:Rh},loadedState:{name:sh("Loaded State"),icon:Fh},objectStyle:{name:sh("Changed Style"),icon:Oh},deletedObject:{name:sh("Deleted object"),icon:Mh}},Nh=Object.values(fh).map(e=>({name:e,icon:Lh[e].icon,action:e===fh.MERGE?e=>{e.tools.merge.apply()}:e})),Dh={filter:sh("filter"),resize:sh("resize"),crop:sh("crop"),draw:sh("draw"),text:sh("text"),shapes:sh("shapes"),stickers:sh("stickers"),frame:sh("frame"),corners:sh("corners"),merge:sh("merge")},zh=yh((0,i.jsx)("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}),"FileDownloadOutlined"),Bh={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:oh.INLINE,forceOverlayModeOnMobile:!0,activeTheme:dh.LIGHT,themes:hh,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:Fh,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:zh,label:sh("Done"),align:"right",action:e=>{var t;null!=(t=e.state.config.ui)&&t.showExportPanel?e.state.togglePanel("export",!0):e.tools.export.save()}}]},nav:{position:ah.BOTTOM,items:[...Nh]},openImageDialog:{show:!0,sampleImages:[{url:"images/samples/sample1.jpg",thumbnail:"images/samples/sample1_thumbnail.jpg"},{url:"images/samples/sample2.jpg",thumbnail:"images/samples/sample2_thumbnail.jpg"},{url:"images/samples/sample3.jpg",thumbnail:"images/samples/sample3_thumbnail.jpg"}]},colorPresets:{items:["rgb(0,0,0)","rgb(255, 255, 255)","rgb(242, 38, 19)","rgb(249, 105, 14)","rgb(253, 227, 167)","rgb(4, 147, 114)","rgb(30, 139, 195)","rgb(142, 68, 173)"]}},objectDefaults:{global:{...ch},sticker:{fill:void 0},text:{textAlign:"initial",underline:!1,linethrough:!1,fontStyle:"normal",fontFamily:"Times New Roman",fontWeight:"normal",stroke:void 0,fontSize:40}},tools:{filter:{items:["grayscale","blackWhite","sharpen","invert","vintage","polaroid","kodachrome","technicolor","brownie","sepia","removeColor","brightness","gamma","noise","pixelate","blur","emboss","blendColor"]},zoom:{allowUserZoom:!0,fitImageToScreen:!0},crop:{allowCustomRatio:!0,defaultRatio:"1:1",presets:[{ratio:null,name:"Custom"},{ratio:"1:1",name:"Square"},{ratio:"4:3"},{ratio:"16:9"},{ratio:"5:3"},{ratio:"5:4"},{ratio:"6:4"},{ratio:"7:5"},{ratio:"10:8"}]},text:{defaultText:"Double click to edit",controlsPadding:6,items:[{family:"Roboto",src:"fonts/open-sans-v27-latin-ext_latin-regular.woff2"},{family:"Fuzzy Bubbles",src:"fonts/fuzzy-bubbles-v3-latin-700.woff2",descriptors:{weight:"700"}},{family:"Aleo Bold",src:"fonts/aleo-v4-latin-ext_latin-700.woff2",descriptors:{weight:"700"}},{family:"Amatic SC",src:"fonts/amatic-sc-v16-latin-ext_latin-regular.woff2"},{family:"Corinthia Bold",src:"fonts/corinthia-v7-latin-ext_latin-700.woff2"},{family:"Bungee Inline",src:"fonts/bungee-inline-v6-latin-ext_latin-regular.woff2"},{family:"Robot Slab Bold",src:"fonts/roboto-slab-v16-latin-ext_latin-500.woff2"},{family:"Carter One",src:"fonts/carter-one-v12-latin-regular.woff2"},{family:"Cody Star",src:"fonts/codystar-v10-latin-ext_latin-regular.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Krona One",src:"fonts/krona-one-v9-latin-ext_latin-regular.woff2"},{family:"Kumar One Outline",src:"fonts/kumar-one-outline-v8-latin-ext_latin-regular.woff2"},{family:"Lobster Two",src:"fonts/lobster-two-v13-latin-regular.woff2"},{family:"Molle Italic",src:"fonts/molle-v11-latin-ext_latin-italic.woff2"},{family:"Monoton",src:"fonts/monoton-v10-latin-regular.woff2"},{family:"Nixie One",src:"fonts/nixie-one-v11-latin-regular.woff2"},{family:"Permanent Marker",src:"fonts/permanent-marker-v10-latin-regular.woff2"},{family:"Sancreek",src:"fonts/sancreek-v13-latin-ext_latin-regular.woff2"},{family:"Stint Ultra Expanded",src:"fonts/stint-ultra-expanded-v10-latin-regular.woff2"},{family:"VT323",src:"fonts/vt323-v12-latin-ext_latin-regular.woff2"},{family:"Trash Hand",src:"fonts/TrashHand.ttf"}]},draw:{brushSizes:uh,brushTypes:["PencilBrush","EraserBrush","SprayBrush","CircleBrush","DiamondBrush","VLineBrush","HLineBrush","SquareBrush"]},shapes:{items:[{name:"circle",type:"Circle"},{name:"square",type:"Rect",options:{lockUniScaling:!1}},{name:"triangle",type:"Triangle"},{name:"ellipse",type:"Ellipse",options:{lockUniScaling:!1}},{name:"Arrow #1",type:"Path",options:{path:"M 294.9 16.4 l 15.7 42.2 c -171.4 70.3 -294 242.3 -289.1 437.4 l 14.7 -1 c 9.1 -0.6 18.1 -1.2 27.1 -1.9 l 14.7 -1 c -4.3 -170.1 102.5 -320 252 -381.3 l 15.7 42.2 c 34.7 -40.5 83.1 -76.6 144.8 -99.8 c -58.1 -26.2 -124.9 -39.6 -195.6 -36.8 z"}},{name:"Arrow #2",type:"Path",options:{path:"M 16 248.4 v 14.9 h 447.5 l -93.2 82.5 l 11.9 10.5 l 113.8 -100.2 l -113.6 -100.4 l -11.8 10.5 l 92.9 82.2 z"}},{name:"Arrow #3",type:"Path",options:{path:"M 496 256 l -118.6 -66 v 40.8 h -361.4 v 50.4 h 361.4 v 40.8 l 118.6 -66 z"}},{name:"Line",type:"Path",options:{path:"M 16 256 h 480",strokeWidth:10,stroke:"#000",padding:10}},{name:"Star",type:"Path",options:{path:"M 256 406.3 l 148.3 78 l -28.3 -165.2 l 120 -117 l -165.8 -24.1 l -74.2 -150.3 l -74.2 150.3 l -165.8 24.1 l 120 117 l -28.3 165.2 z"}},{name:"Polygon",type:"Path",options:{path:"M 256 19.6 l 156.6 57.1 l 83.4 144.3 l -28.9 164.2 l -127.7 107.2 h -166.8 l -127.7 -107.2 l -28.9 -164.2 l 83.4 -144.3 z"}},{name:"Badge",type:"Path",options:{path:"M 257.3 16.2 s -148 58.2 -204.4 81.4 c 0 75.7 -16.8 303.5 204.4 398.2 c 218.7 -94.6 201.9 -322.4 201.9 -398.2 c -62.1 -23.6 -201.9 -81.4 -201.9 -81.4 z"}}].slice()},stickers:{items:[{name:"emoticons",list:["afro-1","afro","agent","alien-1","alien","angel","angry-1","angry-2","angry-3","angry-4","angry-5","angry","arguing","arrogant","asian-1","asian","avatar","baby-1","baby-2","baby","bully","burglar","businessman","cheeky-1","cheeky","clown","confused-1","confused-2","confused-3","confused","creepy","crying-1","crying-2","crying-3","crying","dazed-1","dazed-2","dazed-3","dazed","dead-1","dead-2","dead-3","dead-4","dead-5","dead-6","dead","desperate-1","desperate","detective","dissapointment","doctor","drunk","dumb","emo-1","emo-2","emo","emoticon","evil","faint-1","faint","flirt-1","flirt-2","flirt","flirty","gangster","geek-1","geek","gentleman-1","gentleman-2","gentleman-3","gentleman-4","gentleman","ginger","girl-1","girl","goofy-1","goofy-2","goofy-3","goofy-4","goofy","grubby-1","grubby","happy-1","happy-10","happy-11","happy-12","happy-13","happy-14","happy-15","happy-16","happy-2","happy-3","happy-4","happy-5","happy-6","happy-7","happy-8","happy-9","happy","harry-potter","heisenberg","hipster-1","hipster-2","hipster","in-love-1","in-love-2","in-love-3","in-love-4","in-love-5","in-love-6","in-love","japan","jew","joyful-1","joyful-2","joyful","kiss-1","kiss-2","kiss-3","kiss-4","kiss","laughing-1","laughing-2","laughing-3","laughing","listening","love","manly","miserly-1","miserly","nerd-1","nerd-2","nerd-3","nerd-4","nerd","ninja","pirate-1","pirate-2","pirate","punk-1","punk-2","punk","rapper","relieved","rich-1","rich-2","rich","rockstar","sad-1","sad-2","sad-3","sad-4","sad-5","sad-6","sad","scared-1","scared-2","scared-3","scared","sceptic-1","sceptic-2","sceptic-3","sceptic-4","sceptic-5","sceptic-6","sceptic-7","sceptic","secret","shocked-1","shocked-2","shocked-3","shocked","sick-1","sick-2","sick-3","sick-4","sick","silent","skeleton","smile","smiling-1","smiling","smoked","smug-1","smug-2","smug-3","smug-4","smug-5","smug-6","smug","sporty","stunned","superhero-1","superhero-2","superhero-3","superhero-4","superhero","surprised-1","surprised","thinking","tired-1","tired-2","tired-3","tired","tough-1","tough","trendy","vampire-1","vampire","wink-1","wink-2","wink","winking-1","winking","yawning-1","yawning-2","yawning-3","yawning","yelling","zombie"],type:"svg",thumbnailUrl:"images/stickers/categories/emoticon.svg"},{name:"doodles",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/doodles.svg"},{name:"landmarks",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/landmark.svg",invertPreview:!0},{name:"bubbles",items:104,type:"png",thumbnailUrl:"images/stickers/categories/speech-bubble.svg"},{name:"transportation",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/transportation.svg",invertPreview:!0},{name:"beach",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/beach.svg",invertPreview:!0}]},import:{validImgExtensions:["png","jpg","jpeg","svg","gif"],fitOverlayToScreen:!0,openDroppedImageAsBackground:!1},export:{defaultFormat:"png",defaultQuality:.8,defaultName:"image"},frame:{items:[{name:"basic",mode:"basic",size:{min:1,max:35,default:10}},{name:"pine",mode:"stretch",size:{min:1,max:35,default:15}},{name:"oak",mode:"stretch",size:{min:1,max:35,default:15}},{name:"rainbow",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge1",display_name:"grunge #1",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge2",display_name:"grunge #2",mode:"stretch",size:{min:1,max:35,default:20}},{name:"ebony",mode:"stretch",size:{min:1,max:35,default:15}},{name:"art1",display_name:"Art #1",mode:"repeat",size:{min:10,max:70,default:55}},{name:"art2",display_name:"Art #2",mode:"repeat",size:{min:10,max:70,default:55}}]}}},Uh=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=n??("object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e)),destroy:()=>{r.clear()}},a=t=e(n,i,o);return o};var Vh={exports:{}},Hh={},Wh={exports:{}},$h={},qh=o,Gh="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Yh=qh.useState,Xh=qh.useEffect,Kh=qh.useLayoutEffect,Zh=qh.useDebugValue;function Qh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Gh(e,r)}catch{return!0}}var Jh=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?function(e,t){return t()}:function(e,t){var r=t(),n=Yh({inst:{value:r,getSnapshot:t}}),i=n[0].inst,o=n[1];return Kh(function(){i.value=r,i.getSnapshot=t,Qh(i)&&o({inst:i})},[e,r,t]),Xh(function(){return Qh(i)&&o({inst:i}),e(function(){Qh(i)&&o({inst:i})})},[e]),Zh(r),r};$h.useSyncExternalStore=void 0!==qh.useSyncExternalStore?qh.useSyncExternalStore:Jh,Wh.exports=$h;var ef=Wh.exports,tf=o,rf=ef,nf="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},of=rf.useSyncExternalStore,af=tf.useRef,sf=tf.useEffect,lf=tf.useMemo,cf=tf.useDebugValue;Hh.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var o=af(null);if(null===o.current){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=lf(function(){function e(e){if(!l){if(l=!0,o=e,e=n(e),void 0!==i&&a.hasValue){var t=a.value;if(i(t,e))return s=t}return s=e}if(t=s,nf(o,e))return t;var r=n(e);return void 0!==i&&i(t,r)?t:(o=e,s=r)}var o,s,l=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,r,n,i]);var s=of(e,o[0],o[1]);return sf(function(){a.hasValue=!0,a.value=s},[s]),cf(s),s},Vh.exports=Hh;const uf=ih(Vh.exports),{useDebugValue:df}=o,{useSyncExternalStoreWithSelector:hf}=uf,ff=e=>e,pf=e=>{const t="function"==typeof e?(e=>e?Uh(e):Uh)(e):e,r=(e,r)=>function(e,t=ff,r){const n=hf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return df(n),n}(t,e,r);return Object.assign(r,t),r},gf=e=>pf;var mf=Symbol.for("immer-nothing"),vf=Symbol.for("immer-draftable"),yf=Symbol.for("immer-state");function bf(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var wf=Object.getPrototypeOf;function xf(e){return!!e&&!!e[yf]}function Cf(e){var t;return!!e&&(Sf(e)||Array.isArray(e)||!!e[vf]||!(null==(t=e.constructor)||!t[vf])||jf(e)||Tf(e))}var _f=Object.prototype.constructor.toString();function Sf(e){if(!e||"object"!=typeof e)return!1;const t=wf(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===_f}function Af(e,t){0===kf(e)?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function kf(e){const t=e[yf];return t?t.type_:Array.isArray(e)?1:jf(e)?2:Tf(e)?3:0}function Ef(e,t){return 2===kf(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function If(e,t,r){const n=kf(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function jf(e){return e instanceof Map}function Tf(e){return e instanceof Set}function Ff(e){return e.copy_||e.base_}function Of(e,t){if(jf(e))return new Map(e);if(Tf(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=Sf(e);if(!0===t||"class_only"===t&&!r){const t=Object.getOwnPropertyDescriptors(e);delete t[yf];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){const i=r[n],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(wf(e),t)}{const t=wf(e);if(null!==t&&r)return{...e};const n=Object.create(t);return Object.assign(n,e)}}function Mf(e,t=!1){return Rf(e)||xf(e)||!Cf(e)||(kf(e)>1&&(e.set=e.add=e.clear=e.delete=Pf),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>Mf(t,!0))),e}function Pf(){bf(2)}function Rf(e){return Object.isFrozen(e)}var Lf,Nf={};function Df(e){const t=Nf[e];return t||bf(0),t}function zf(){return Lf}function Bf(e,t){t&&(Df("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Uf(e){Vf(e),e.drafts_.forEach(Wf),e.drafts_=null}function Vf(e){e===Lf&&(Lf=e.parent_)}function Hf(e){return Lf=function(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(Lf,e)}function Wf(e){const t=e[yf];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function $f(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[yf].modified_&&(Uf(t),bf(4)),Cf(e)&&(e=qf(t,e),t.parent_||Yf(t,e)),t.patches_&&Df("Patches").generateReplacementPatches_(r[yf].base_,e,t.patches_,t.inversePatches_)):e=qf(t,r,[]),Uf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mf?e:void 0}function qf(e,t,r){if(Rf(t))return t;const n=t[yf];if(!n)return Af(t,(i,o)=>Gf(e,n,t,i,o,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return Yf(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let i=t,o=!1;3===n.type_&&(i=new Set(t),t.clear(),o=!0),Af(i,(i,a)=>Gf(e,n,t,i,a,r,o)),Yf(e,t,!1),r&&e.patches_&&Df("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Gf(e,t,r,n,i,o,a){if(xf(i)){const a=qf(e,i,o&&t&&3!==t.type_&&!Ef(t.assigned_,n)?o.concat(n):void 0);if(If(r,n,a),!xf(a))return;e.canAutoFreeze_=!1}else a&&r.add(i);if(Cf(i)&&!Rf(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;qf(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&Object.prototype.propertyIsEnumerable.call(r,n)&&Yf(e,i)}}function Yf(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Mf(t,r)}var Xf={get(e,t){if(t===yf)return e;const r=Ff(e);if(!Ef(r,t))return function(e,t,r){var n;const i=Qf(t,r);return i?"value"in i?i.value:null==(n=i.get)?void 0:n.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!Cf(n)?n:n===Zf(e.base_,t)?(ep(e),e.copy_[t]=tp(n,e)):n},has:(e,t)=>t in Ff(e),ownKeys:e=>Reflect.ownKeys(Ff(e)),set(e,t,r){const n=Qf(Ff(e),t);if(null!=n&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=Zf(Ff(e),t),i=null==n?void 0:n[yf];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(r,n)&&(void 0!==r||Ef(e.base_,t)))return!0;ep(e),Jf(e)}return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Zf(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ep(e),Jf(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=Ff(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}},defineProperty(){bf(11)},getPrototypeOf:e=>wf(e.base_),setPrototypeOf(){bf(12)}},Kf={};function Zf(e,t){const r=e[yf];return(r?Ff(r):e)[t]}function Qf(e,t){if(!(t in e))return;let r=wf(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=wf(r)}}function Jf(e){e.modified_||(e.modified_=!0,e.parent_&&Jf(e.parent_))}function ep(e){e.copy_||(e.copy_=Of(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function tp(e,t){const r=jf(e)?Df("MapSet").proxyMap_(e,t):Tf(e)?Df("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:zf(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,o=Xf;r&&(i=[n],o=Kf);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return n.draft_=s,n.revoke_=a,s}(e,t);return(t?t.scope_:zf()).drafts_.push(r),r}function rp(e){if(!Cf(e)||Rf(e))return e;const t=e[yf];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Of(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Of(e,!0);return Af(r,(e,t)=>{If(r,e,rp(t))}),t&&(t.finalized_=!1),r}Af(Xf,(e,t)=>{Kf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Kf.deleteProperty=function(e,t){return Kf.set.call(this,e,t,void 0)},Kf.set=function(e,t,r){return Xf.set.call(this,e[0],t,r,e[0])};var np=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}let n;if("function"!=typeof t&&bf(6),void 0!==r&&"function"!=typeof r&&bf(7),Cf(e)){const i=Hf(this),o=tp(e,void 0);let a=!0;try{n=t(o),a=!1}finally{a?Uf(i):Vf(i)}return Bf(i,r),$f(n,i)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===mf&&(n=void 0),this.autoFreeze_&&Mf(n,!0),r){const t=[],i=[];Df("Patches").generateReplacementPatches_(e,n,t,i),r(t,i)}return n}bf(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let r,n;return[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof(null==e?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Cf(e)||bf(8),xf(e)&&(e=function(e){return xf(e)||bf(10),rp(e)}(e));const t=Hf(this),r=tp(e,void 0);return r[yf].isManual_=!0,Vf(t),r}finishDraft(e,t){const r=e&&e[yf];(!r||!r.isManual_)&&bf(9);const{scope_:n}=r;return Bf(n,t),$f(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=Df("Patches").applyPatches_;return xf(e)?n(e,t):this.produce(e,e=>n(e,t))}},ip=np.produce;np.produceWithPatches.bind(np),np.setAutoFreeze.bind(np),np.setUseStrictShallowCopy.bind(np),np.applyPatches.bind(np),np.createDraft.bind(np),np.finishDraft.bind(np);var op=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===ap}(e)}(e)},ap="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function sp(e,t){return!1!==t.clone&&t.isMergeableObject(e)?dp(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function lp(e,t,r){return e.concat(t).map(function(e){return sp(e,r)})}function cp(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function up(e,t){try{return t in e}catch{return!1}}function dp(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||lp,r.isMergeableObject=r.isMergeableObject||op,r.cloneUnlessOtherwiseSpecified=sp;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):function(e,t,r){var n={};return r.isMergeableObject(e)&&cp(e).forEach(function(t){n[t]=sp(e[t],r)}),cp(t).forEach(function(i){(function(e,t){return up(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(up(e,i)&&r.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return dp;var r=t.customMerge(e);return"function"==typeof r?r:dp}(i,r)(e[i],t[i],r):n[i]=sp(t[i],r))}),n}(e,t,r):sp(t,r)}dp.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return dp(e,r,t)},{})};const hp=ih(dp);function fp(e,t){return pp(hp(t,e),e)}function pp(e,t){return Object.keys(e).forEach(r=>{if(r.startsWith("replaceDefault")&&e[r]){const n=function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(r.replace("replaceDefault","")||"items");e[n]=t?t[n]:[],delete e[r]}else"object"==typeof e[r]&&null!==e[r]&&pp(e[r],null==t?void 0:t[r])}),e}const gp=(e,t)=>({history:{...mp,updatePointerById:e=>{const r=t().history.items.findIndex(t=>t.id===e);t().history.update(r)},update:(t,r)=>{e(e=>{e.history.pointer=t,r&&(e.history.items=r),e.history.canUndo=e.history.pointer>0,e.history.canRedo=e.history.items.length>e.history.pointer+1})},reset:r=>{e({history:{...t().history,...r??mp}})}}}),mp={items:[],pointer:0,canUndo:!1,canRedo:!1};var vp=(e=>(e.Filter="filter",e.Frame="frame",e.ActiveObject="activeObj",e.Text="text",e))(vp||{});const yp=(e,t)=>({filter:{...bp,select(t,r=!1){e(e=>{e.filter.selected=t,e.activeToolOverlay=r?vp.Filter:null,e.dirty=!0})},deselect(r){t().filter.selected===r&&e(e=>{e.filter.selected=null,e.activeToolOverlay=null,e.dirty=!0})},reset(){e({filter:{...t().filter,...bp}})}}}),bp={selected:null,applied:[]},wp=(e,t)=>({crop:{...xp,setCropzoneRect:t=>{e(e=>{e.crop.zoneRect=t})},setAspectRatio:t=>{e(e=>{e.crop.selectedAspectRatio=t})},setTransformAngle:t=>{e(e=>{e.crop.straightenAngle=t})},apply:async()=>{const e=t().crop.zoneRect;if(e){const r={width:Math.ceil(e.width/t().zoom),height:Math.ceil(e.height/t().zoom),left:Math.ceil(e.left/t().zoom),top:Math.ceil(e.top/t().zoom)};await t().editor.tools.crop.apply(r)}},reset:()=>{e({crop:{...t().crop,...xp}})}}}),xp={zoneRect:null,selectedAspectRatio:null,straightenAngle:0};function Cp(e){return"i-text"===(null==e?void 0:e.type)}var _p=(e=>(e.Text="text",e.Shape="shape",e.Sticker="sticker",e.Drawing="drawing",e.Image="image",e.MainImage="mainImage",e.StraightenAnchor="straightenHelper",e))(_p||{});const Sp={text:{name:sh("Text"),icon:Lh.text.icon},shape:{name:sh("Shape"),icon:Lh.shapes.icon},sticker:{name:sh("Sticker"),icon:Lh.stickers.icon},drawing:{name:sh("Drawing"),icon:Lh.draw.icon},image:{name:sh("Image"),icon:Lh.overlayImage.icon},mainImage:{name:sh("Background Image"),icon:Lh.bgImage.icon}},Ap={isMoving:!1,editableProps:{},id:null,isText:!1,isImage:!1,name:null},kp=(e,t)=>({objects:{...Ep,setActiveIsMoving:t=>{e(e=>{e.objects.active.isMoving=t})},setIsEditingText:t=>{e(e=>{e.objects.isEditingText=t})},setActive:r=>{e(r?e=>{e.objects.active.editableProps=function(e){if(!e)return{};const t={fill:e.fill,opacity:e.opacity,backgroundColor:e.backgroundColor,stroke:e.stroke,strokeWidth:e.strokeWidth},r=e.shadow;return r&&(t.shadow={color:r.color,blur:r.blur,offsetX:r.offsetX,offsetY:r.offsetY}),Cp(e)&&(t.textAlign=e.textAlign,t.underline=e.underline,t.linethrough=e.linethrough,t.fontStyle=e.fontStyle,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize),t}(r),e.objects.active.id=r.data.id,e.objects.active.name=r.name??null,e.objects.active.isText=Cp(r),e.objects.active.isImage=function(e){return e.name===_p.Image}(r)}:e=>{var r,n,i,o,a;const s={...null==(r=t().config.objectDefaults)?void 0:r.global,fontFamily:null==(i=null==(n=t().config.objectDefaults)?void 0:n.text)?void 0:i.fontFamily,fontSize:null==(a=null==(o=t().config.objectDefaults)?void 0:o.text)?void 0:a.fontSize};e.objects.active={...Ap,editableProps:s}})},reset(){e({objects:{...t().objects,...Ep}})}}}),Ep={all:[],isEditingText:!1,active:Ap},Ip=(e,t)=>({frame:{...jp,select:r=>{e(e=>{e.frame.active=r}),t().frame.showOptionsPanel()},deselect:()=>{e(e=>{e.frame.active=null,e.activeToolOverlay=null})},showOptionsPanel:()=>{t().activeTool===fh.FRAME&&e(e=>{e.activeToolOverlay=vp.Frame})},reset(){e({frame:{...t().frame,...jp}})}}}),jp={active:null},Tp=(e,t)=>({resize:{...Fp,setFormValue:t=>{e(e=>{Object.entries(t).forEach(([t,r])=>{e.resize.formValue[t]=r})})},apply(){const e=t().resize.formValue,r=t().original;if(e.width===r.width&&e.height===r.height)return!1;t().editor.tools.resize.apply(e)},reset(){e({resize:{...t().resize,...Fp}})}}}),Fp={formValue:{width:1,height:1,maintainAspect:!0,usePercentages:!1}},Op=(e,t)=>({corners:{...Mp,setRadius:t=>{e(e=>{e.corners.radius=t})},apply:()=>t().editor.tools.corners.apply(t().corners.radius),reset(){e({corners:{...t().corners,...Mp}})}}}),Mp={radius:50},Pp=e=>(t,r,n)=>(n.setState=(e,r,...n)=>{const i="function"==typeof e?ip(e):e;return t(i,r,...n)},e(n.setState,r,n));var Rp={exports:{}},Lp={exports:{}},Np=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Dp=Array.prototype.concat,zp=Array.prototype.slice,Bp=Lp.exports=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];Np(i)?t=Dp.call(t,zp.call(i)):t.push(i)}return t};Bp.wrap=function(e){return function(){return e(Bp(arguments))}};var Up=Lp.exports,Vp={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Hp=Up,Wp=Object.hasOwnProperty,$p=Object.create(null);for(var qp in Vp)Wp.call(Vp,qp)&&($p[Vp[qp]]=qp);var Gp=Rp.exports={to:{},get:{}};function Yp(e,t,r){return Math.min(Math.max(t,e),r)}function Xp(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}Gp.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=Gp.get.hsl(e),r="hsl";break;case"hwb":t=Gp.get.hwb(e),r="hwb";break;default:t=Gp.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},Gp.get.rgb=function(e){if(!e)return null;var t,r,n,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(n=t[2],t=t[1],r=0;r<3;r++){var o=2*r;i[r]=parseInt(t.slice(o,o+2),16)}n&&(i[3]=parseInt(n,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(n=(t=t[1])[3],r=0;r<3;r++)i[r]=parseInt(t[r]+t[r],16);n&&(i[3]=parseInt(n+n,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(t[r+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:Wp.call(Vp,t[1])?((i=Vp[t[1]])[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(r=0;r<3;r++)i[r]=Yp(i[r],0,255);return i[3]=Yp(i[3],0,1),i},Gp.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,Yp(parseFloat(t[2]),0,100),Yp(parseFloat(t[3]),0,100),Yp(isNaN(r)?1:r,0,1)]}return null},Gp.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,Yp(parseFloat(t[2]),0,100),Yp(parseFloat(t[3]),0,100),Yp(isNaN(r)?1:r,0,1)]}return null},Gp.to.hex=function(){var e=Hp(arguments);return"#"+Xp(e[0])+Xp(e[1])+Xp(e[2])+(e[3]<1?Xp(Math.round(255*e[3])):"")},Gp.to.rgb=function(){var e=Hp(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Gp.to.rgb.percent=function(){var e=Hp(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},Gp.to.hsl=function(){var e=Hp(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Gp.to.hwb=function(){var e=Hp(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},Gp.to.keyword=function(e){return $p[e.slice(0,3)]};var Kp=Rp.exports;const Zp={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Qp={};for(const UM of Object.keys(Zp))Qp[Zp[UM]]=UM;const Jp={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var eg=Jp;for(const UM of Object.keys(Jp)){if(!("channels"in Jp[UM]))throw new Error("missing channels property: "+UM);if(!("labels"in Jp[UM]))throw new Error("missing channel labels property: "+UM);if(Jp[UM].labels.length!==Jp[UM].channels)throw new Error("channel and label counts mismatch: "+UM);const{channels:e,labels:t}=Jp[UM];delete Jp[UM].channels,delete Jp[UM].labels,Object.defineProperty(Jp[UM],"channels",{value:e}),Object.defineProperty(Jp[UM],"labels",{value:t})}function tg(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Jp.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=o-i;let s,l;o===i?s=0:t===o?s=(r-n)/a:r===o?s=2+(n-t)/a:n===o&&(s=4+(t-r)/a),s=Math.min(60*s,360),s<0&&(s+=360);const c=(i+o)/2;return l=o===i?0:c<=.5?a/(o+i):a/(2-o-i),[s,100*l,100*c]},Jp.rgb.hsv=function(e){let t,r,n,i,o;const a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?(i=0,o=0):(o=u/c,t=d(a),r=d(s),n=d(l),a===c?i=n-r:s===c?i=1/3+t-n:l===c&&(i=2/3+r-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},Jp.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const i=Jp.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,100*o,100*n]},Jp.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n);return[100*((1-t-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*i]},Jp.rgb.keyword=function(e){const t=Qp[e];if(t)return t;let r,n=1/0;for(const i of Object.keys(Zp)){const t=tg(e,Zp[i]);t<n&&(n=t,r=i)}return r},Jp.keyword.rgb=function(e){return Zp[e]},Jp.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,[100*(.4124*t+.3576*r+.1805*n),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},Jp.rgb.lab=function(e){const t=Jp.rgb.xyz(e);let r=t[0],n=t[1],i=t[2];return r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*n-16,500*(r-n),200*(n-i)]},Jp.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let i,o,a;if(0===r)return a=255*n,[a,a,a];i=n<.5?n*(1+r):n+r-n*r;const s=2*n-i,l=[0,0,0];for(let c=0;c<3;c++)o=t+1/3*-(c-1),o<0&&o++,o>1&&o--,a=6*o<1?s+6*(i-s)*o:2*o<1?i:3*o<2?s+(i-s)*(2/3-o)*6:s,l[c]=255*a;return l},Jp.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,i=r;const o=Math.max(n,.01);return n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o,[t,100*(0===n?2*i/(o+i):2*r/(n+r)),(n+r)/2*100]},Jp.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),a=255*n*(1-r),s=255*n*(1-r*o),l=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,l,a];case 1:return[s,n,a];case 2:return[a,n,l];case 3:return[a,s,n];case 4:return[l,a,n];case 5:return[n,a,s]}},Jp.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01);let o,a;a=(2-r)*n;const s=(2-r)*i;return o=r*i,o/=s<=1?s:2-s,o=o||0,a/=2,[t,100*o,100*a]},Jp.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const i=r+n;let o;i>1&&(r/=i,n/=i);const a=Math.floor(6*t),s=1-n;o=6*t-a,1&a&&(o=1-o);const l=r+o*(s-r);let c,u,d;switch(a){default:case 6:case 0:c=s,u=l,d=r;break;case 1:c=l,u=s,d=r;break;case 2:c=r,u=s,d=l;break;case 3:c=r,u=l,d=s;break;case 4:c=l,u=r,d=s;break;case 5:c=s,u=r,d=l}return[255*c,255*u,255*d]},Jp.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},Jp.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let i,o,a;return i=3.2406*t+-1.5372*r+-.4986*n,o=-.9689*t+1.8758*r+.0415*n,a=.0557*t+-.204*r+1.057*n,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[255*i,255*o,255*a]},Jp.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];return t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*r-16,500*(t-r),200*(r-n)]},Jp.lab.xyz=function(e){let t,r,n;r=(e[0]+16)/116,t=e[1]/500+r,n=r-e[2]/200;const i=r**3,o=t**3,a=n**3;return r=i>.008856?i:(r-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,t*=95.047,r*=100,n*=108.883,[t,r,n]},Jp.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let i;return i=360*Math.atan2(n,r)/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(r*r+n*n),i]},Jp.lch.lab=function(e){const t=e[0],r=e[1],n=e[2]/360*2*Math.PI;return[t,r*Math.cos(n),r*Math.sin(n)]},Jp.rgb.ansi16=function(e,t=null){const[r,n,i]=e;let o=null===t?Jp.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return 2===o&&(a+=60),a},Jp.hsv.ansi16=function(e){return Jp.rgb.ansi16(Jp.hsv.rgb(e),e[2])},Jp.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},Jp.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},Jp.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},Jp.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},Jp.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map(e=>e+e).join(""));const n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},Jp.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),a=i-o;let s,l;return s=a<1?o/(1-a):0,l=a<=0?0:i===t?(r-n)/a%6:i===r?2+(n-t)/a:4+(t-r)/a,l/=6,l%=1,[360*l,100*a,100*s]},Jp.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],100*n,100*i]},Jp.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},Jp.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];const i=[0,0,0],o=t%1*6,a=o%1,s=1-a;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-r)*n,[255*(r*i[0]+l),255*(r*i[1]+l),255*(r*i[2]+l)]},Jp.hcg.hsv=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);let n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},Jp.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},Jp.hcg.hwb=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},Jp.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,n=r-t;let i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},Jp.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},Jp.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},Jp.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},Jp.gray.hsl=function(e){return[0,0,e[0]]},Jp.gray.hsv=Jp.gray.hsl,Jp.gray.hwb=function(e){return[0,100,e[0]]},Jp.gray.cmyk=function(e){return[0,0,0,e[0]]},Jp.gray.lab=function(e){return[e[0],0,0]},Jp.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},Jp.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const rg=eg;function ng(e,t){return function(r){return t(e(r))}}function ig(e,t){const r=[t[e].parent,e];let n=rg[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)r.unshift(t[i].parent),n=ng(rg[t[i].parent][i],n),i=t[i].parent;return n.conversion=r,n}const og=eg,ag=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(rg);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;){const e=r.pop(),n=Object.keys(rg[e]);for(let i=n.length,o=0;o<i;o++){const i=n[o],a=t[i];-1===a.distance&&(a.distance=t[e].distance+1,a.parent=e,r.unshift(i))}}return t}(e),r={},n=Object.keys(t);for(let i=n.length,o=0;o<i;o++){const e=n[o];null!==t[e].parent&&(r[e]=ig(e,t))}return r},sg={};Object.keys(og).forEach(e=>{sg[e]={},Object.defineProperty(sg[e],"channels",{value:og[e].channels}),Object.defineProperty(sg[e],"labels",{value:og[e].labels});const t=ag(e);Object.keys(t).forEach(r=>{const n=t[r];sg[e][r]=function(e){const t=function(...t){const r=t[0];if(null==r)return r;r.length>1&&(t=r);const n=e(t);if("object"==typeof n)for(let e=n.length,i=0;i<e;i++)n[i]=Math.round(n[i]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(n),sg[e][r].raw=function(e){const t=function(...t){const r=t[0];return null==r?r:(r.length>1&&(t=r),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)})});const lg=Kp,cg=sg,ug=["keyword","gray","hex"],dg={};for(const UM of Object.keys(cg))dg[[...cg[UM].labels].sort().join("")]=UM;const hg={};function fg(e,t){if(!(this instanceof fg))return new fg(e,t);if(t&&t in ug&&(t=null),t&&!(t in cg))throw new Error("Unknown model: "+t);let r,n;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof fg)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=lg.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,n=cg[this.model].channels,this.color=t.value.slice(0,n),this.valpha="number"==typeof t.value[n]?t.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=cg[this.model].channels;const r=Array.prototype.slice.call(e,0,n);this.color=yg(r,n),this.valpha="number"==typeof e[n]?e[n]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const n=t.sort().join("");if(!(n in dg))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=dg[n];const{labels:i}=cg[this.model],o=[];for(r=0;r<i.length;r++)o.push(e[i[r]]);this.color=yg(o)}if(hg[this.model])for(n=cg[this.model].channels,r=0;r<n;r++){const e=hg[this.model][r];e&&(this.color[r]=e(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}fg.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in lg.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const r=1===t.valpha?t.color:[...t.color,this.valpha];return lg.to[t.model](r)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:[...t.color,this.valpha];return lg.to.rgb.percent(r)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=cg[this.model],{labels:r}=cg[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new fg([...this.color.map(pg(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new fg([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:gg("rgb",0,mg(255)),green:gg("rgb",1,mg(255)),blue:gg("rgb",2,mg(255)),hue:gg(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:gg("hsl",1,mg(100)),lightness:gg("hsl",2,mg(100)),saturationv:gg("hsv",1,mg(100)),value:gg("hsv",2,mg(100)),chroma:gg("hcg",1,mg(100)),gray:gg("hcg",2,mg(100)),white:gg("hwb",1,mg(100)),wblack:gg("hwb",2,mg(100)),cyan:gg("cmyk",0,mg(100)),magenta:gg("cmyk",1,mg(100)),yellow:gg("cmyk",2,mg(100)),black:gg("cmyk",3,mg(100)),x:gg("xyz",0,mg(95.047)),y:gg("xyz",1,mg(100)),z:gg("xyz",2,mg(108.833)),l:gg("lab",0,mg(100)),a:gg("lab",1),b:gg("lab",2),keyword(e){return void 0!==e?new fg(e):cg[this.model].keyword(this.color)},hex(e){return void 0!==e?new fg(e):lg.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new fg(e);const t=this.rgb().round().color;let r=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===r.length&&(r="0"+r),lg.to.hex(t)+r},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[r,n]of e.entries()){const e=n/255;t[r]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return fg.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const r=e.rgb(),n=this.rgb(),i=void 0===t?.5:t,o=2*i-1,a=r.alpha()-n.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return fg.rgb(s*r.red()+l*n.red(),s*r.green()+l*n.green(),s*r.blue()+l*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(const UM of Object.keys(cg)){if(ug.includes(UM))continue;const{channels:e}=cg[UM];fg.prototype[UM]=function(...e){return this.model===UM?new fg(this):e.length>0?new fg(e,UM):new fg([...vg(cg[this.model][UM].raw(this.color)),this.valpha],UM)},fg[UM]=function(...t){let r=t[0];return"number"==typeof r&&(r=yg(t,e)),new fg(r,UM)}}function pg(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function gg(e,t,r){e=Array.isArray(e)?e:[e];for(const n of e)(hg[n]||(hg[n]=[]))[t]=r;return e=e[0],function(n){let i;return void 0!==n?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function mg(e){return function(t){return Math.max(0,Math.min(e,t))}}function vg(e){return Array.isArray(e)?e:[e]}function yg(e,t){for(let r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}const bg=ih(fg);function wg(e){return e.endsWith("%")||3===e.split(" ").length?e:bg(e).rgb().array().slice(0,3).join(" ")}let xg=typeof document<"u"?document.getElementById("root")??document.body:void 0,Cg=typeof document<"u"?document.documentElement:void 0;const _g=gf()(e=>({data:typeof window<"u"&&window.bootstrapData?Ag(window.bootstrapData):null,setData:t=>{const r="string"==typeof t?Ag(t):t;e({data:r})},mergeData:t=>{e(e=>({data:{...e.data,...t}}))}}));_g.getState().setData;const Sg=_g.getState().mergeData;function Ag(e){return"string"==typeof e?JSON.parse(e):e}const kg={top:0,right:0,bottom:0,left:0,width:0,height:0},Eg=gf()((e=>(t,r,n)=>{const i=n.subscribe;return n.subscribe=(e,t,r)=>{let o=e;if(t){const i=(null==r?void 0:r.equalityFn)||Object.is;let a=e(n.getState());o=r=>{const n=e(r);if(!i(a,n)){const e=a;t(a=n,e)}},null!=r&&r.fireImmediately&&t(a,a)}return i(o)},e(t,r,n)})(Pp((e,t)=>({editor:null,fabric:null,config:Bh,zoom:1,dirty:!1,original:{width:1,height:1},stageSize:kg,canvasSize:kg,canvasRef:null,activeTool:null,activeToolOverlay:null,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1},...gp(e,t),...kp(e,t),...yp(e,t),...wp(e,t),...Ip(e,t),...Tp(e,t),...Op(e,t),setZoom:t=>e(e=>{e.zoom=t}),setOriginal:(t,r)=>e(e=>{e.original={width:t,height:r}}),setDirty:t=>e(e=>{e.dirty=t}),toggleLoading:t=>e(e=>{e.loading=t}),setStageSize:t=>e(e=>{e.stageSize=t}),setCanvasSize:t=>e(e=>{e.canvasSize=t}),setActiveTool:(t,r)=>{e(e=>{e.activeTool=t,e.activeToolOverlay=r})},setConfig:r=>e(e=>{var n,i;const o=fp(r,t().config);e.config=o;const a=o.activeLanguage||"en",s=null==(n=o.languages)?void 0:n[a],l=((null==(i=o.ui)?void 0:i.themes)||[]).map(e=>function(e){const t=e.isDark?hh.find(e=>e.isDark):hh.find(e=>!e.isDark),r={...t,...e,colors:{...null==t?void 0:t.colors,...e.colors}},n=Object.entries(r.colors).map(([e,t])=>[e,wg(t)]);return{id:r.name,name:r.name,values:Object.fromEntries(n),is_dark:r.isDark}}(e)),c=l.find(e=>{var t;return e.id===(null==(t=o.ui)?void 0:t.activeTheme)});c&&function(e){Object.entries(e.values).forEach(([e,t])=>{!function(e,t){null==Cg||Cg.style.setProperty(e,t)}(e,t)}),e.is_dark?Cg.classList.add("dark"):Cg.classList.remove("dark")}(c),Sg({i18n:{language:a,name:a,id:0,lines:s},themes:{all:l}})}),togglePanel:(t,r)=>e(e=>{e.openPanels[t]=r??!e.openPanels[t]}),applyChanges:async()=>{var r;const n=t().activeTool;if(!n)return;const i=t()[n],o=await(null==(r=null==i?void 0:i.apply)?void 0:r.call(i));e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),!1!==o&&t().editor.tools.history.addHistoryItem({name:n}),null==i||i.reset()},cancelChanges:async()=>{const r=t().activeTool;if(!r)return;const n=t().dirty;e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),n&&await t().editor.tools.history.reload();const i=t()[r];null==i||i.reset()},reset:()=>{t().editor.tools.transform.resetStraightenAnchor(),e({activeTool:null,activeToolOverlay:null,zoom:1,dirty:!1,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1}}),t().history.reset(),t().objects.reset(),t().filter.reset(),t().crop.reset(),t().frame.reset(),t().resize.reset(),t().corners.reset()}}))));function Ig(){return Eg.getState()}function jg(){return Ig().editor.tools}function Tg(){return Ig().fabric}function Fg(e){var t,r,n,i,o;jg().canvas.clear(),jg().frame.remove();const a=!(null!=(t=Ig().config.ui)&&t.visible);return Ig().setConfig({image:void 0,blankCanvasSize:void 0,...e}),Ig().reset(),null!=(r=Ig().config.ui)&&r.defaultTool&&Ig().setActiveTool(null==(n=Ig().config.ui)?void 0:n.defaultTool,null),a&&(null==(o=(i=Ig().config).onOpen)||o.call(i)),new Promise(e=>setTimeout(e))}async function Og(e){return(await fetch(e)).json()}const Mg={selectable:!1,evented:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,hasControls:!1,hasBorders:!1,hasRotatingPoint:!1,strokeWidth:0};function Pg(e=[]){var t;e=[...Object.keys(Mg),"crossOrigin","name","displayName","data",...e];const r=Tg().toJSON(e);return r.objects=r.objects.filter(e=>!e.data.pixieInternal).map(e=>("image"===e.type&&Ig().config.crossOrigin&&(e.crossOrigin="anonymous"),Cp(e)&&(e.selectable=!0,e.lockMovementX=!1,e.lockMovementY=!1,e.lockUniScaling=!1),{...e,data:e.data?{...e.data}:{}})),{canvas:r,editor:{frame:jg().frame.active.config?{name:jg().frame.active.config.name,sizePercent:jg().frame.active.currentSizeInPercent}:null,zoom:Ig().zoom,activeObjectId:(null==(t=Ig().objects.active)?void 0:t.id)||null},canvasWidth:Ig().original.width,canvasHeight:Ig().original.height}}function Rg(e=null){if(Ig().dirty)return;jg().zoom.fitToScreen();const[t,r]=Lg(Tg().getActiveObject());e?Ig().setActiveTool(e,t===e?r:null):Ig().setActiveTool(t,r)}function Lg(e){switch(null==e?void 0:e.name){case _p.Text:return[fh.TEXT,vp.Text];case _p.Sticker:return[fh.STICKERS,vp.ActiveObject];case _p.Image:return[null,vp.ActiveObject];case _p.Shape:return[fh.SHAPES,vp.ActiveObject];default:return[null,null]}}let Ng=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[e]];return t};class Dg{constructor(e,t){zs(this,"timerId"),zs(this,"createdAt",0),this.callback=e,this.remaining=t,this.resume()}pause(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.createdAt}resume(){this.createdAt=Date.now(),this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}clear(){clearTimeout(this.timerId)}}const zg=gf()(Pp((e,t)=>({toasts:[],add:(r,n)=>{const i=t().toasts.length+1-1;i>0&&e(e=>{e.toasts.splice(0,i)});const o=(null==n?void 0:n.id)||Ng(6),a=(null==n?void 0:n.type)||"positive",s=(null==n?void 0:n.duration)??function(e){switch(e){case"danger":return 8e3;case"loading":return 0;default:return 3e3}}(a),l={timer:s>0?new Dg(()=>t().remove(o),s):null,message:r,...n,id:o,type:a,position:(null==n?void 0:n.position)||"bottom-center",duration:s,disableExitAnimation:null==n?void 0:n.disableExitAnimation,disableEnterAnimation:null==n?void 0:n.disableEnterAnimation},c=t().toasts.findIndex(e=>e.id===l.id);e(c>-1?e=>{e.toasts[c]=l}:e=>{e.toasts.push(l)})},remove:r=>{const n=t().toasts.filter(e=>{var t;return r!==e.id||(null==(t=e.timer)||t.clear(),!1)});e(e=>{e.toasts=n})}})));function Bg(){return zg.getState()}function Ug(e,t){Bg().add(e,t)}Ug.danger=(e,t)=>{Bg().add(e,{...t,type:"danger"})},Ug.positive=(e,t)=>{Bg().add(e,{...t,type:"positive"})},Ug.loading=(e,t)=>{Bg().add(e,{...t,type:"loading"})};const Vg=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Hg=(0,o.createContext)({}),Wg=(0,o.createContext)(null),$g=typeof document<"u",qg=$g?o.useLayoutEffect:o.useEffect,Gg=(0,o.createContext)({strict:!1}),Yg=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Xg="data-"+Yg("framerAppearId");function Kg(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Zg(e){return"string"==typeof e||Array.isArray(e)}function Qg(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Jg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],em=["initial",...Jg];function tm(e){return Qg(e.animate)||em.some(t=>Zg(e[t]))}function rm(e){return!(!tm(e)&&!e.variants)}function nm(e){return Array.isArray(e)?e.join(" "):e}const im={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},om={};for(const UM in im)om[UM]={isEnabled:e=>im[UM].some(t=>!!e[t])};function am(e){for(const t in e)om[t]={...om[t],...e[t]}}const sm=(0,o.createContext)({}),lm=(0,o.createContext)({}),cm=Symbol.for("motionComponentSymbol");function um({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&am(e);const a=(0,o.forwardRef)(function(a,s){let l;const c={...(0,o.useContext)(Vg),...a,layoutId:dm(a)},{isStatic:u}=c,d=function(e){const{initial:t,animate:r}=function(e,t){if(tm(e)){const{initial:t,animate:r}=e;return{initial:!1===t||Zg(t)?t:void 0,animate:Zg(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Hg));return(0,o.useMemo)(()=>({initial:t,animate:r}),[nm(t),nm(r)])}(a),h=n(a,u);if(!u&&$g){d.visualElement=function(e,t,r,n){const{visualElement:i}=(0,o.useContext)(Hg),a=(0,o.useContext)(Gg),s=(0,o.useContext)(Wg),l=(0,o.useContext)(Vg).reducedMotion,c=(0,o.useRef)();n=n||a.renderer,!c.current&&n&&(c.current=n(e,{visualState:t,parent:i,props:r,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:l}));const u=c.current;(0,o.useInsertionEffect)(()=>{u&&u.update(r,s)});const d=(0,o.useRef)(!(!r[Xg]||window.HandoffComplete));return qg(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,o.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,c,t);const r=(0,o.useContext)(lm),n=(0,o.useContext)(Gg).strict;d.visualElement&&(l=d.visualElement.loadFeatures(c,n,e,r))}return o.createElement(Hg.Provider,{value:d},l&&d.visualElement?o.createElement(l,{visualElement:d.visualElement,...c}):null,r(i,a,function(e,t,r){return(0,o.useCallback)(n=>{n&&e.mount&&e.mount(n),t&&(n?t.mount(n):t.unmount()),r&&("function"==typeof r?r(n):Kg(r)&&(r.current=n))},[t])}(h,d.visualElement,s),h,u,d.visualElement))});return a[cm]=i,a}function dm({layoutId:e}){const t=(0,o.useContext)(sm).id;return t&&void 0!==e?t+"-"+e:e}const hm=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function fm(e){return"string"==typeof e&&!e.includes("-")&&!!(hm.indexOf(e)>-1||/[A-Z]/.test(e))}const pm={},gm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mm=new Set(gm);function vm(e,{layout:t,layoutId:r}){return mm.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!pm[e]||"opacity"===e)}const ym=e=>!(!e||!e.getVelocity),bm={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wm=gm.length,xm=e=>t=>"string"==typeof t&&t.startsWith(e),Cm=xm("--"),_m=xm("var(--"),Sm=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Am=(e,t,r)=>Math.min(Math.max(r,e),t),km={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Em={...km,transform:e=>Am(0,1,e)},Im={...km,default:1},jm=e=>Math.round(1e5*e)/1e5,Tm=/(-)?([\d]*\.?[\d])+/g,Fm=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Om=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Mm(e){return"string"==typeof e}const Pm=e=>({test:t=>Mm(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Rm=Pm("deg"),Lm=Pm("%"),Nm=Pm("px"),Dm=Pm("vh"),zm=Pm("vw"),Bm={...Lm,parse:e=>Lm.parse(e)/100,transform:e=>Lm.transform(100*e)},Um={...km,transform:Math.round},Vm={borderWidth:Nm,borderTopWidth:Nm,borderRightWidth:Nm,borderBottomWidth:Nm,borderLeftWidth:Nm,borderRadius:Nm,radius:Nm,borderTopLeftRadius:Nm,borderTopRightRadius:Nm,borderBottomRightRadius:Nm,borderBottomLeftRadius:Nm,width:Nm,maxWidth:Nm,height:Nm,maxHeight:Nm,size:Nm,top:Nm,right:Nm,bottom:Nm,left:Nm,padding:Nm,paddingTop:Nm,paddingRight:Nm,paddingBottom:Nm,paddingLeft:Nm,margin:Nm,marginTop:Nm,marginRight:Nm,marginBottom:Nm,marginLeft:Nm,rotate:Rm,rotateX:Rm,rotateY:Rm,rotateZ:Rm,scale:Im,scaleX:Im,scaleY:Im,scaleZ:Im,skew:Rm,skewX:Rm,skewY:Rm,distance:Nm,translateX:Nm,translateY:Nm,translateZ:Nm,x:Nm,y:Nm,z:Nm,perspective:Nm,transformPerspective:Nm,opacity:Em,originX:Bm,originY:Bm,originZ:Nm,zIndex:Um,fillOpacity:Em,strokeOpacity:Em,numOctaves:Um};function Hm(e,t,r,n){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,c=!1,u=!0;for(const d in t){const e=t[d];if(Cm(d)){o[d]=e;continue}const r=Vm[d],n=Sm(e,r);if(mm.has(d)){if(l=!0,a[d]=n,!u)continue;e!==(r.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,s[d]=n):i[d]=n}if(t.transform||(l||n?i.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:r=!0},n,i){let o="";for(let a=0;a<wm;a++){const t=gm[a];void 0!==e[t]&&(o+=`${bm[t]||t}(${e[t]}) `)}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,n?"":o):r&&n&&(o="none"),o}(e.transform,r,u,n):i.transform&&(i.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:r=0}=s;i.transformOrigin=`${e} ${t} ${r}`}}function Wm(e,t,r){for(const n in t)!ym(t[n])&&!vm(n,r)&&(e[n]=t[n])}function $m(e,t,r){const n={},i=function(e,t,r){const n={};return Wm(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t,r){return(0,o.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Hm(n,t,{enableHardwareAcceleration:!r},e),Object.assign({},n.vars,n.style)},[t])}(e,t,r)),e.transformValues?e.transformValues(n):n}(e,t,r);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const qm=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Gm(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||qm.has(e)}let Ym=e=>!Gm(e);try{!function(e){e&&(Ym=t=>t.startsWith("on")?!Gm(t):e(t))}(r(36118).A)}catch{}function Xm(e,t,r){const n={};for(const i in e)"values"===i&&"object"==typeof e.values||(Ym(i)||!0===r&&Gm(i)||!t&&!Gm(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function Km(e,t,r){return"string"==typeof e?e:Nm.transform(t+r*e)}const Zm={offset:"stroke-dashoffset",array:"stroke-dasharray"},Qm={offset:"strokeDashoffset",array:"strokeDasharray"};function Jm(e,{attrX:t,attrY:r,attrScale:n,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...c},u,d,h){if(Hm(e,c,u,h),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:g}=e;f.transform&&(g&&(p.transform=f.transform),delete f.transform),g&&(void 0!==i||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,r){return`${Km(t,e.x,e.width)} ${Km(r,e.y,e.height)}`}(g,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==t&&(f.x=t),void 0!==r&&(f.y=r),void 0!==n&&(f.scale=n),void 0!==a&&function(e,t,r=1,n=0,i=!0){e.pathLength=1;const o=i?Zm:Qm;e[o.offset]=Nm.transform(-n);const a=Nm.transform(t),s=Nm.transform(r);e[o.array]=`${a} ${s}`}(f,a,s,l,!1)}const ev=e=>"string"==typeof e&&"svg"===e.toLowerCase();function tv(e,t,r,n){const i=(0,o.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Jm(r,t,{enableHardwareAcceleration:!1},ev(n),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const t={};Wm(t,e.style,e),i.style={...t,...i.style}}return i}function rv(e=!1){return(t,r,n,{latestValues:i},a)=>{const s=(fm(t)?tv:$m)(r,i,a,t),l={...Xm(r,"string"==typeof t,e),...s,ref:n},{children:c}=r,u=(0,o.useMemo)(()=>ym(c)?c.get():c,[c]);return(0,o.createElement)(t,{...l,children:u})}}function nv(e,{style:t,vars:r},n,i){Object.assign(e.style,t,i&&i.getProjectionStyles(n));for(const o in r)e.style.setProperty(o,r[o])}const iv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ov(e,t,r,n){nv(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(iv.has(i)?i:Yg(i),t.attrs[i])}function av(e,t){const{style:r}=e,n={};for(const i in r)(ym(r[i])||t.style&&ym(t.style[i])||vm(i,e))&&(n[i]=r[i]);return n}function sv(e,t){const r=av(e,t);for(const n in e)(ym(e[n])||ym(t[n]))&&(r[-1!==gm.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function lv(e,t,r,n={},i={}){return"function"==typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),t}function cv(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const uv=e=>Array.isArray(e),dv=e=>uv(e)?e[e.length-1]||0:e;function hv(e){const t=ym(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const fv=e=>(t,r)=>{const n=(0,o.useContext)(Hg),i=(0,o.useContext)(Wg),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,o){const a={latestValues:pv(n,i,o,e),renderState:t()};return r&&(a.mount=e=>r(n,e,a)),a}(e,t,n,i);return r?a():cv(a)};function pv(e,t,r,n){const i={},o=n(e,{});for(const h in o)i[h]=hv(o[h]);let{initial:a,animate:s}=e;const l=tm(e),c=rm(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let u=!!r&&!1===r.initial;u=u||!1===a;const d=u?s:a;return d&&"boolean"!=typeof d&&!Qg(d)&&(Array.isArray(d)?d:[d]).forEach(t=>{const r=lv(e,t);if(!r)return;const{transitionEnd:n,transition:o,...a}=r;for(const e in a){let t=a[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(i[e]=t)}for(const e in n)i[e]=n[e]}),i}const gv=e=>e;class mv{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const vv=["prepare","read","update","preRender","render","postRender"],{schedule:yv,cancel:bv,state:wv}=function(e){let t=!1,r=!0;const n={delta:0,timestamp:0,isProcessing:!1},i=vv.reduce((e,r)=>(e[r]=function(e){let t=new mv,r=new mv,n=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(e,o=!1,s=!1)=>{const l=s&&i,c=l?t:r;return o&&a.add(e),c.add(e)&&l&&i&&(n=t.order.length),e},cancel:e=>{r.remove(e),a.delete(e)},process:l=>{if(i)o=!0;else{if(i=!0,[t,r]=[r,t],r.clear(),n=t.order.length,n)for(let r=0;r<n;r++){const n=t.order[r];n(l),a.has(n)&&(s.schedule(n),e())}i=!1,o&&(o=!1,s.process(l))}}};return s}(()=>t=!0),e),{}),o=e=>i[e].process(n),a=()=>{const i=performance.now();t=!1,n.delta=r?1e3/60:Math.max(Math.min(i-n.timestamp,40),1),n.timestamp=i,n.isProcessing=!0,vv.forEach(o),n.isProcessing=!1,t&&(r=!1,e(a))};return{schedule:vv.reduce((o,s)=>{const l=i[s];return o[s]=(i,o=!1,s=!1)=>(t||(t=!0,r=!0,n.isProcessing||e(a)),l.schedule(i,o,s)),o},{}),cancel:e=>vv.forEach(t=>i[t].cancel(e)),state:n,steps:i}}(typeof requestAnimationFrame<"u"?requestAnimationFrame:gv),xv={useVisualState:fv({scrapeMotionValuesFromProps:sv,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(e,t,{renderState:r,latestValues:n})=>{yv.read(()=>{try{r.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),yv.render(()=>{Jm(r,n,{enableHardwareAcceleration:!1},ev(t.tagName),e.transformTemplate),ov(t,r)})}})},Cv={useVisualState:fv({scrapeMotionValuesFromProps:av,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function _v(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Sv(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}function Av(e,t,r,n){return _v(e,t,(e=>t=>(e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary)(t)&&e(t,Sv(t)))(r),n)}const kv=(e,t)=>r=>t(e(r)),Ev=(...e)=>e.reduce(kv);function Iv(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const jv=Iv("dragHorizontal"),Tv=Iv("dragVertical");function Fv(){const e=function(){let e=!1;{const t=jv(),r=Tv();t&&r?e=()=>{t(),r()}:(t&&t(),r&&r())}return e}();return!e||(e(),!1)}class Ov{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Mv(e,t){const r="pointer"+(t?"enter":"leave"),n="onHover"+(t?"Start":"End");return Av(e.current,r,(r,i)=>{if("touch"===r.pointerType||Fv())return;const o=e.getProps();e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",t),o[n]&&yv.update(()=>o[n](r,i))},{passive:!e.getProps()[n]})}const Pv=(e,t)=>!!t&&(e===t||Pv(e,t.parentElement));function Rv(e,t){if(!t)return;const r=new PointerEvent("pointer"+e);t(r,Sv(r))}const Lv=new WeakMap,Nv=new WeakMap,Dv=e=>{const t=Lv.get(e.target);t&&t(e)},zv=e=>{e.forEach(Dv)};const Bv={some:0,all:1},Uv={inView:{Feature:class extends Ov{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:i}=e,o={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:Bv[n]};return function(e,t,r){const n=function({root:e,...t}){const r=e||document;Nv.has(r)||Nv.set(r,{});const n=Nv.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(zv,{root:e,...t})),n[i]}(t);return Lv.set(e,r),n.observe(e),()=>{Lv.delete(e),n.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),o=t?r:n;o&&o(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Ov{constructor(){super(...arguments),this.removeStartListeners=gv,this.removeEndListeners=gv,this.removeAccessibleListeners=gv,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),n=Av(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;const{onTap:r,onTapCancel:n,globalTapTarget:i}=this.node.getProps();yv.update(()=>{i||Pv(this.node.current,e.target)?r&&r(e,t):n&&n(e,t)})},{passive:!(r.onTap||r.onPointerUp)}),i=Av(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Ev(n,i),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=_v(this.node.current,"keydown",e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=_v(this.node.current,"keyup",e=>{"Enter"!==e.key||!this.checkPressEnd()||Rv("up",(e,t)=>{const{onTap:r}=this.node.getProps();r&&yv.update(()=>r(e,t))})}),Rv("down",(e,t)=>{this.startPress(e,t)}))}),t=_v(this.node.current,"blur",()=>{this.isPressing&&Rv("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=Ev(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:r,whileTap:n}=this.node.getProps();n&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&yv.update(()=>r(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Fv()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&yv.update(()=>r(e,t))}mount(){const e=this.node.getProps(),t=Av(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=_v(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ev(t,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Ov{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ev(_v(this.node.current,"focus",()=>this.onFocus()),_v(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Ov{mount(){this.unmount=Ev(Mv(this.node,!0),Mv(this.node,!1))}unmount(){}}}};function Vv(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Hv(e,t,r){const n=e.getProps();return lv(n,t,void 0!==r?r:n.custom,function(e){const t={};return e.values.forEach((e,r)=>t[r]=e.get()),t}(e),function(e){const t={};return e.values.forEach((e,r)=>t[r]=e.getVelocity()),t}(e))}let Wv=gv;const $v=e=>1e3*e,qv=e=>e/1e3,Gv=e=>Array.isArray(e)&&"number"==typeof e[0];function Yv(e){return!!(!e||"string"==typeof e&&Kv[e]||Gv(e)||Array.isArray(e)&&e.every(Yv))}const Xv=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Kv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xv([0,.65,.55,1]),circOut:Xv([.55,0,1,.45]),backIn:Xv([.31,.01,.66,-.59]),backOut:Xv([.33,1.53,.69,.99])};function Zv(e){if(e)return Gv(e)?Xv(e):Array.isArray(e)?e.map(Zv):Kv[e]}const Qv=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function Jv(e,t,r,n){if(e===t&&r===n)return gv;const i=t=>function(e,t,r,n,i){let o,a,s=0;do{a=t+(r-t)/2,o=Qv(a,n,i)-e,o>0?r=a:t=a}while(Math.abs(o)>1e-7&&++s<12);return a}(t,0,1,e,r);return e=>0===e||1===e?e:Qv(i(e),t,n)}const ey=Jv(.42,0,1,1),ty=Jv(0,0,.58,1),ry=Jv(.42,0,.58,1),ny=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iy=e=>t=>1-e(1-t),oy=e=>1-Math.sin(Math.acos(e)),ay=iy(oy),sy=ny(oy),ly=Jv(.33,1.53,.69,.99),cy=iy(ly),uy=ny(cy),dy={linear:gv,easeIn:ey,easeInOut:ry,easeOut:ty,circIn:oy,circInOut:sy,circOut:ay,backIn:cy,backInOut:uy,backOut:ly,anticipate:e=>(e*=2)<1?.5*cy(e):.5*(2-Math.pow(2,-10*(e-1)))},hy=e=>{if(Array.isArray(e)){Wv(4===e.length);const[t,r,n,i]=e;return Jv(t,r,n,i)}return"string"==typeof e?dy[e]:e},fy=(e,t)=>r=>!!(Mm(r)&&Om.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),py=(e,t,r)=>n=>{if(!Mm(n))return n;const[i,o,a,s]=n.match(Tm);return{[e]:parseFloat(i),[t]:parseFloat(o),[r]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},gy={...km,transform:e=>Math.round((e=>Am(0,255,e))(e))},my={test:fy("rgb","red"),parse:py("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+gy.transform(e)+", "+gy.transform(t)+", "+gy.transform(r)+", "+jm(Em.transform(n))+")"},vy={test:fy("#"),parse:function(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:my.transform},yy={test:fy("hsl","hue"),parse:py("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Lm.transform(jm(t))+", "+Lm.transform(jm(r))+", "+jm(Em.transform(n))+")"},by={test:e=>my.test(e)||vy.test(e)||yy.test(e),parse:e=>my.test(e)?my.parse(e):yy.test(e)?yy.parse(e):vy.parse(e),transform:e=>Mm(e)?e:e.hasOwnProperty("red")?my.transform(e):yy.transform(e)},wy=(e,t,r)=>-r*e+r*t+e;function xy(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}const Cy=(e,t,r)=>{const n=e*e;return Math.sqrt(Math.max(0,r*(t*t-n)+n))},_y=[vy,my,yy];function Sy(e){const t=(e=>_y.find(t=>t.test(e)))(e);let r=t.parse(e);return t===yy&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let i=0,o=0,a=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;i=xy(s,n,e+1/3),o=xy(s,n,e),a=xy(s,n,e-1/3)}else i=o=a=r;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*a),alpha:n}}(r)),r}const Ay=(e,t)=>{const r=Sy(e),n=Sy(t),i={...r};return e=>(i.red=Cy(r.red,n.red,e),i.green=Cy(r.green,n.green,e),i.blue=Cy(r.blue,n.blue,e),i.alpha=wy(r.alpha,n.alpha,e),my.transform(i))},ky={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:gv},Ey={regex:Fm,countKey:"Colors",token:"${c}",parse:by.parse},Iy={regex:Tm,countKey:"Numbers",token:"${n}",parse:km.parse};function jy(e,{regex:t,countKey:r,token:n,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+r]=o.length,e.tokenised=e.tokenised.replace(t,n),e.values.push(...o.map(i)))}function Ty(e){const t=e.toString(),r={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return r.value.includes("var(--")&&jy(r,ky),jy(r,Ey),jy(r,Iy),r}function Fy(e){return Ty(e).values}function Oy(e){const{values:t,numColors:r,numVars:n,tokenised:i}=Ty(e),o=t.length;return e=>{let t=i;for(let i=0;i<o;i++)t=i<n?t.replace(ky.token,e[i]):i<n+r?t.replace(Ey.token,by.transform(e[i])):t.replace(Iy.token,jm(e[i]));return t}}const My=e=>"number"==typeof e?0:e,Py={test:function(e){var t,r;return isNaN(e)&&Mm(e)&&((null===(t=e.match(Tm))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(Fm))||void 0===r?void 0:r.length)||0)>0},parse:Fy,createTransformer:Oy,getAnimatableNone:function(e){const t=Fy(e);return Oy(e)(t.map(My))}},Ry=(e,t)=>r=>`${r>0?t:e}`;function Ly(e,t){return"number"==typeof e?r=>wy(e,t,r):by.test(e)?Ay(e,t):e.startsWith("var(")?Ry(e,t):zy(e,t)}const Ny=(e,t)=>{const r=[...e],n=r.length,i=e.map((e,r)=>Ly(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=i[t](e);return r}},Dy=(e,t)=>{const r={...e,...t},n={};for(const i in r)void 0!==e[i]&&void 0!==t[i]&&(n[i]=Ly(e[i],t[i]));return e=>{for(const t in n)r[t]=n[t](e);return r}},zy=(e,t)=>{const r=Py.createTransformer(t),n=Ty(e),i=Ty(t);return n.numVars===i.numVars&&n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?Ev(Ny(n.values,i.values),r):Ry(e,t)},By=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},Uy=(e,t)=>r=>wy(e,t,r);function Vy(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const o=e.length;if(Wv(o===t.length),1===o)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,r){const n=[],i=r||function(e){return"number"==typeof e?Uy:"string"==typeof e?by.test(e)?Ay:zy:Array.isArray(e)?Ny:"object"==typeof e?Dy:Uy}(e[0]),o=e.length-1;for(let a=0;a<o;a++){let r=i(e[a],e[a+1]);if(t){const e=Array.isArray(t)?t[a]||gv:t;r=Ev(e,r)}n.push(r)}return n}(t,n,i),s=a.length,l=t=>{let r=0;if(s>1)for(;r<e.length-2&&!(t<e[r+1]);r++);const n=By(e[r],e[r+1],t);return a[r](n)};return r?t=>l(Am(e[0],e[o-1],t)):l}function Hy(e,t){return e.map(()=>t||ry).splice(0,e.length-1)}function Wy({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(hy):hy(n),o={done:!1,value:t[0]},a=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:function(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=By(0,t,n);e.push(wy(r,1,i))}}(t,e.length-1),t}(t),e),s=Vy(a,t,{ease:Array.isArray(i)?i:Hy(t,i)});return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}function $y(e,t){return t?e*(1e3/t):0}function qy(e,t,r){const n=Math.max(t-5,0);return $y(r-e(n),t-n)}const Gy=.001;const Yy=12;function Xy(e,t){return e*Math.sqrt(1-t*t)}const Ky=["duration","bounce"],Zy=["stiffness","damping","mass"];function Qy(e,t){return t.some(t=>void 0!==e[t])}function Jy({keyframes:e,restDelta:t,restSpeed:r,...n}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Qy(e,Zy)&&Qy(e,Ky)){const r=function({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let i,o,a=1-t;a=Am(.05,1,a),e=Am(.01,10,qv(e)),a<1?(i=t=>{const n=t*a,i=n*e,o=n-r,s=Xy(t,a),l=Math.exp(-i);return Gy-o/s*l},o=t=>{const n=t*a*e,o=n*r+r,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=Xy(Math.pow(t,2),a);return(-i(t)+Gy>0?-1:1)*((o-s)*l)/c}):(i=t=>Math.exp(-t*e)*((t-r)*e+1)-Gy,o=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let i=1;i<Yy;i++)n-=e(n)/t(n);return n}(i,o,5/e);if(e=$v(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*a*Math.sqrt(n*t),duration:e}}}(e);t={...t,...r,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-qv(n.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(s*c)),g=o-i,m=qv(Math.sqrt(s/c)),v=Math.abs(g)<5;let y;if(r||(r=v?.01:2),t||(t=v?.005:.5),p<1){const e=Xy(m,p);y=t=>{const r=Math.exp(-p*m*t);return o-r*((f+p*m*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===p)y=e=>o-Math.exp(-m*e)*(g+(f+m*g)*e);else{const e=m*Math.sqrt(p*p-1);y=t=>{const r=Math.exp(-p*m*t),n=Math.min(e*t,300);return o-r*((f+p*m*g)*Math.sinh(n)+e*g*Math.cosh(n))/e}}return{calculatedDuration:h&&u||null,next:e=>{const n=y(e);if(h)a.done=e>=u;else{let i=f;0!==e&&(i=p<1?qy(y,e,n):0);const s=Math.abs(i)<=r,l=Math.abs(o-n)<=t;a.done=s&&l}return a.value=a.done?o:n,a}}}function eb({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let p=r*t;const g=d+p,m=void 0===a?g:a(g);m!==g&&(p=m-d);const v=e=>-p*Math.exp(-e/n),y=e=>m+v(e),b=e=>{const t=v(e),r=y(e);h.done=Math.abs(t)<=c,h.value=h.done?m:r};let w,x;const C=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(h.value)&&(w=e,x=Jy({keyframes:[h.value,f(h.value)],velocity:qy(y,e,h.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&void 0===w&&(t=!0,b(e),C(e)),void 0!==w&&e>w?x.next(e-w):(!t&&b(e),h)}}}const tb=e=>{const t=({timestamp:t})=>e(t);return{start:()=>yv.update(t,!0),stop:()=>bv(t),now:()=>wv.isProcessing?wv.timestamp:performance.now()}};function rb(e){let t=0,r=e.next(t);for(;!r.done&&t<2e4;)t+=50,r=e.next(t);return t>=2e4?1/0:t}const nb={decay:eb,inertia:eb,tween:Wy,keyframes:Wy,spring:Jy};function ib({autoplay:e=!0,delay:t=0,driver:r=tb,keyframes:n,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f,p,g=1,m=!1;const v=()=>{p=new Promise(e=>{f=e})};let y;v();const b=nb[i]||Wy;let w;b!==Wy&&"number"!=typeof n[0]&&(w=Vy([0,100],n,{clamp:!1}),n=[0,100]);const x=b({...h,keyframes:n});let C;"mirror"===s&&(C=b({...h,keyframes:[...n].reverse(),velocity:-(h.velocity||0)}));let _="idle",S=null,A=null,k=null;null===x.calculatedDuration&&o&&(x.calculatedDuration=rb(x));const{calculatedDuration:E}=x;let I=1/0,j=1/0;null!==E&&(I=E+a,j=I*(o+1)-a);let T=0;const F=e=>{if(null===A)return;g>0&&(A=Math.min(A,e)),g<0&&(A=Math.min(e-j/g,A)),T=null!==S?S:Math.round(e-A)*g;const r=T-t*(g>=0?1:-1),i=g>=0?r<0:r>j;T=Math.max(r,0),"finished"===_&&null===S&&(T=j);let l=T,c=x;if(o){const e=Math.min(T,j)/I;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,o+1),!!(t%2)&&("reverse"===s?(r=1-r,a&&(r-=a/I)):"mirror"===s&&(c=C)),l=Am(0,1,r)*I}const u=i?{done:!1,value:n[0]}:c.next(l);w&&(u.value=w(u.value));let{done:h}=u;!i&&null!==E&&(h=g>=0?T>=j:T<=0);const f=null===S&&("finished"===_||"running"===_&&h);return d&&d(u.value),f&&P(),u},O=()=>{y&&y.stop(),y=void 0},M=()=>{_="idle",O(),f(),v(),A=k=null},P=()=>{_="finished",u&&u(),O(),f()},R=()=>{if(m)return;y||(y=r(F));const e=y.now();l&&l(),null!==S?A=e-S:(!A||"finished"===_)&&(A=e),"finished"===_&&v(),k=A,S=null,_="running",y.start()};e&&R();const L={then:(e,t)=>p.then(e,t),get time(){return qv(T)},set time(e){e=$v(e),T=e,null===S&&y&&0!==g?A=y.now()-e/g:S=e},get duration(){const e=null===x.calculatedDuration?rb(x):x.calculatedDuration;return qv(e)},get speed(){return g},set speed(e){e===g||!y||(g=e,L.time=qv(T))},get state(){return _},play:R,pause:()=>{_="paused",S=T},stop:()=>{m=!0,"idle"!==_&&(_="idle",c&&c(),M())},cancel:()=>{null!==k&&F(k),M()},complete:()=>{_="finished"},sample:e=>(A=0,F(e))};return L}const ob=function(){let e;return()=>(void 0===e&&(e=Object.hasOwnProperty.call(Element.prototype,"animate")),e)}(),ab=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const sb={type:"spring",stiffness:500,damping:25,restSpeed:10},lb={type:"keyframes",duration:.8},cb={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ub=(e,{keyframes:t})=>t.length>2?lb:mm.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):sb:cb,db=(e,t)=>"zIndex"!==e&&!("number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!Py.test(t)&&"0"!==t||t.startsWith("url("))),hb=new Set(["brightness","contrast","saturate","opacity"]);function fb(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(Tm)||[];if(!n)return e;const i=r.replace(n,"");let o=hb.has(t)?1:0;return n!==r&&(o*=100),t+"("+o+i+")"}const pb=/([a-z-]*)\(.*?\)/g,gb={...Py,getAnimatableNone:e=>{const t=e.match(pb);return t?t.map(fb).join(" "):e}},mb={...Vm,color:by,backgroundColor:by,outlineColor:by,fill:by,stroke:by,borderColor:by,borderTopColor:by,borderRightColor:by,borderBottomColor:by,borderLeftColor:by,filter:gb,WebkitFilter:gb},vb=e=>mb[e];function yb(e,t){let r=vb(e);return r!==gb&&(r=Py),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const bb=e=>/^0[^.\s]+$/.test(e);function wb(e){return"number"==typeof e?0===e:null!==e?"none"===e||"0"===e||bb(e):void 0}function xb(e,t){return e[t]||e.default||e}const Cb=(e,t,r,n={})=>i=>{const o=xb(n,e)||{},a=o.delay||n.delay||0;let{elapsed:s=0}=n;s-=$v(a);const l=function(e,t,r,n){const i=db(t,r);let o;o=Array.isArray(r)?[...r]:[null,r];const a=void 0!==n.from?n.from:e.get();let s;const l=[];for(let c=0;c<o.length;c++)null===o[c]&&(o[c]=0===c?a:o[c-1]),wb(o[c])&&l.push(c),"string"==typeof o[c]&&"none"!==o[c]&&"0"!==o[c]&&(s=o[c]);if(i&&l.length&&s)for(let c=0;c<l.length;c++)o[l[c]]=yb(t,s);return o}(t,e,r,o),c=l[0],u=l[l.length-1],d=db(e,c),h=db(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)||(f={...f,...ub(e,f)}),f.duration&&(f.duration=$v(f.duration)),f.repeatDelay&&(f.repeatDelay=$v(f.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:e,delay:t,onUpdate:r,onComplete:n}){const i=()=>(r&&r(e[e.length-1]),n&&n(),{time:0,speed:1,duration:0,play:gv,pause:gv,stop:gv,then:e=>(e(),Promise.resolve()),cancel:gv,complete:gv});return t?ib({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}(f);if(!n.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const r=function(e,t,{onUpdate:r,onComplete:n,...i}){if(!ob()||!ab.has(t)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,a,s=!1,l=!1;const c=()=>{a=new Promise(e=>{o=e})};c();let{keyframes:u,duration:d=300,ease:h,times:f}=i;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!Yv(t.ease))(t,i)){const e=ib({...i,repeat:0,delay:0});let t={done:!1,value:u[0]};const r=[];let n=0;for(;!t.done&&n<2e4;)t=e.sample(n),r.push(t.value),n+=10;f=void 0,u=r,d=n-10,h="linear"}const p=function(e,t,r,{delay:n=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const c={[t]:r};l&&(c.offset=l);const u=Zv(s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,u,{...i,duration:d,ease:h,times:f}),g=()=>{l=!1,p.cancel()},m=()=>{l=!0,yv.update(g),o(),c()};return p.onfinish=()=>{l||(e.set(function(e,{repeat:t,repeatType:r="loop"}){return e[t&&"loop"!==r&&t%2==1?0:e.length-1]}(u,i)),n&&n(),m())},{then:(e,t)=>a.then(e,t),attachTimeline:e=>(p.timeline=e,p.onfinish=null,gv),get time(){return qv(p.currentTime||0)},set time(e){p.currentTime=$v(e)},get speed(){return p.playbackRate},set speed(e){p.playbackRate=e},get duration(){return qv(d)},play:()=>{s||(p.play(),bv(g))},pause:()=>p.pause(),stop:()=>{if(s=!0,"idle"===p.playState)return;const{currentTime:t}=p;if(t){const r=ib({...i,autoplay:!1});e.setWithVelocity(r.sample(t-10).value,r.sample(t).value,10)}m()},complete:()=>{l||p.finish()},cancel:m}}(t,e,f);if(r)return r}return ib(f)};function _b(e){return!(!ym(e)||!e.add)}const Sb=e=>/^\-?\d*\.?\d+$/.test(e);class Ab{constructor(){this.subscriptions=[]}add(e){return function(e,t){-1===e.indexOf(t)&&e.push(t)}(this.subscriptions,e),()=>function(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class kb{constructor(e,t={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;const{delta:r,timestamp:n}=wv;this.lastUpdated!==n&&(this.timeDelta=r,this.lastUpdated=n,yv.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>yv.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Ab);const r=this.events[e].add(t);return"change"===e?()=>{r(),yv.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=e,this.timeDelta=r}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$y(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Eb(e,t){return new kb(e,t)}const Ib=e=>t=>t.test(e),jb=[km,Nm,Lm,Rm,zm,Dm,{test:e=>"auto"===e,parse:e=>e}],Tb=e=>jb.find(Ib(e)),Fb=[...jb,by,Py],Ob=e=>Fb.find(Ib(e));function Mb(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Eb(r))}function Pb(e,t){return t?(t[e]||t.default||t).from:void 0}function Rb({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function Lb(e,t){const r=e.get();if(!Array.isArray(t))return r!==t;for(let n=0;n<t.length;n++)if(t[n]!==r)return!0}function Nb(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");n&&(o=n);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const t=e.getValue(d),n=s[d];if(!t||void 0===n||u&&Rb(u,d))continue;const i={delay:r,elapsed:0,...xb(o||{},d)};if(window.HandoffAppearAnimations){const r=e.getProps()[Xg];if(r){const e=window.HandoffAppearAnimations(r,d,t,yv);null!==e&&(i.elapsed=e,i.isHandoff=!0)}}let a=!i.isHandoff&&!Lb(t,n);if("spring"===i.type&&(t.getVelocity()||i.velocity)&&(a=!1),t.animation&&(a=!1),a)continue;t.start(Cb(d,t,n,e.shouldReduceMotion&&mm.has(d)?{type:!1}:i));const h=t.animation;_b(l)&&(l.add(d),h.then(()=>l.remove(d))),c.push(h)}return a&&Promise.all(c).then(()=>{a&&function(e,t){const r=Hv(e,t);let{transitionEnd:n={},transition:i={},...o}=r?e.makeTargetAnimatable(r,!1):{};o={...o,...n};for(const a in o)Mb(e,a,dv(o[a]))}(e,a)}),c}function Db(e,t,r={}){const n=Hv(e,t,r.custom);let{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const o=n?()=>Promise.all(Nb(e,n,r)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(e,t,r=0,n=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*n,l=1===i?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(zb).forEach((e,n)=>{e.notify("AnimationStart",t),a.push(Db(e,t,{...o,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,o+n,a,s,r)}:()=>Promise.resolve(),{when:s}=i;if(s){const[e,t]="beforeChildren"===s?[o,a]:[a,o];return e().then(()=>t())}return Promise.all([o(),a(r.delay)])}function zb(e,t){return e.sortNodePosition(t)}const Bb=[...Jg].reverse(),Ub=Jg.length;function Vb(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>Db(e,t,r));n=Promise.all(i)}else if("string"==typeof t)n=Db(e,t,r);else{const i="function"==typeof t?Hv(e,t,r.custom):t;n=Promise.all(Nb(e,i,r))}return n.then(()=>e.notify("AnimationComplete",t))}(e,t,r)))}(e);const r={animate:Wb(!0),whileInView:Wb(),whileHover:Wb(),whileTap:Wb(),whileDrag:Wb(),whileFocus:Wb(),exit:Wb()};let n=!0;const i=(t,r)=>{const n=Hv(e,r);if(n){const{transition:e,transitionEnd:r,...i}=n;t={...t,...i,...r}}return t};function o(o,a){const s=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let d={},h=1/0;for(let t=0;t<Ub;t++){const f=Bb[t],p=r[f],g=void 0!==s[f]?s[f]:l[f],m=Zg(g),v=f===a?p.isActive:null;!1===v&&(h=t);let y=g===l[f]&&g!==s[f]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...d},!p.isActive&&null===v||!g&&!p.prevProp||Qg(g)||"boolean"==typeof g)continue;let b=Hb(p.prevProp,g)||f===a&&p.isActive&&!y&&m||t>h&&m,w=!1;const x=Array.isArray(g)?g:[g];let C=x.reduce(i,{});!1===v&&(C={});const{prevResolvedValues:_={}}=p,S={..._,...C},A=e=>{b=!0,u.has(e)&&(w=!0,u.delete(e)),p.needsAnimating[e]=!0};for(const e in S){const t=C[e],r=_[e];if(d.hasOwnProperty(e))continue;let n=!1;n=uv(t)&&uv(r)?!Vv(t,r):t!==r,n?void 0!==t?A(e):u.add(e):void 0!==t&&u.has(e)?A(e):p.protectedKeys[e]=!0}p.prevProp=g,p.prevResolvedValues=C,p.isActive&&(d={...d,...C}),n&&e.blockInitialAnimation&&(b=!1),b&&(!y||w)&&c.push(...x.map(e=>({animation:e,options:{type:f,...o}})))}if(u.size){const t={};u.forEach(r=>{const n=e.getBaseTarget(r);void 0!==n&&(t[r]=n)}),c.push({animation:t})}let f=!!c.length;return n&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(f=!1),n=!1,f?t(c):Promise.resolve()}return{animateChanges:o,setActive:function(t,n,i){var a;if(r[t].isActive===n)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const s=o(i,t);for(const e in r)r[e].protectedKeys={};return s},setAnimateFunction:function(r){t=r(e)},getState:()=>r}}function Hb(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Vv(t,e)}function Wb(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $b=0;const qb={animation:{Feature:class extends Ov{constructor(e){super(e),e.animationState||(e.animationState=Vb(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Qg(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends Ov{constructor(){super(...arguments),this.id=$b++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const i=this.node.animationState.setActive("exit",!e,{custom:r??this.node.getProps().custom});t&&!e&&i.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Gb=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Yb(e,t,r=1){const[n,i]=function(e){const t=Gb.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]}(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const e=o.trim();return Sb(e)?parseFloat(e):e}return _m(i)?Yb(i,t,r+1):i}const Xb=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Kb=e=>Xb.has(e),Zb=e=>e===km||e===Nm,Qb=(e,t)=>parseFloat(e.split(", ")[t]),Jb=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return Qb(i[1],t);{const t=n.match(/^matrix\((.+)\)$/);return t?Qb(t[1],e):0}},ew=new Set(["x","y","z"]),tw=gm.filter(e=>!ew.has(e)),rw={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Jb(4,13),y:Jb(5,14)};rw.translateX=rw.x,rw.translateY=rw.y;function nw(e,t,r,n){return(e=>Object.keys(e).some(Kb))(t)?((e,t,r={},n={})=>{t={...t},n={...n};const i=Object.keys(t).filter(Kb);let o=[],a=!1;const s=[];if(i.forEach(i=>{const l=e.getValue(i);if(!e.hasValue(i))return;let c=r[i],u=Tb(c);const d=t[i];let h;if(uv(d)){const e=d.length,t=null===d[0]?1:0;c=d[t],u=Tb(c);for(let r=t;r<e&&null!==d[r];r++)h?Wv(Tb(d[r])===h):h=Tb(d[r])}else h=Tb(d);if(u!==h)if(Zb(u)&&Zb(h)){const e=l.get();"string"==typeof e&&l.set(parseFloat(e)),"string"==typeof d?t[i]=parseFloat(d):Array.isArray(d)&&h===Nm&&(t[i]=d.map(parseFloat))}else null!=u&&u.transform&&null!=h&&h.transform&&(0===c||0===d)?0===c?l.set(h.transform(c)):t[i]=u.transform(d):(a||(o=function(e){const t=[];return tw.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),a=!0),s.push(i),n[i]=void 0!==n[i]?n[i]:t[i],l.jump(d))}),s.length){const r=s.indexOf("height")>=0?window.pageYOffset:null,i=((e,t,r)=>{const n=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),r.forEach(e=>{s[e]=rw[e](n,o)}),t.render();const l=t.measureViewportBox();return r.forEach(r=>{const n=t.getValue(r);n&&n.jump(s[r]),e[r]=rw[r](l,o)}),e})(t,e,s);return o.length&&o.forEach(([t,r])=>{e.getValue(t).set(r)}),e.render(),$g&&null!==r&&window.scrollTo({top:r}),{target:i,transitionEnd:n}}return{target:t,transitionEnd:n}})(e,t,r,n):{target:t,transitionEnd:n}}const iw={current:null},ow={current:!1},aw=new WeakMap,sw=Object.keys(om),lw=sw.length,cw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],uw=em.length;class dw{constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>yv.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=s,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=tm(t),this.isVariantNode=rm(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(t,{});for(const u in c){const e=c[u];void 0!==a[u]&&ym(e)&&(e.set(a[u],!1),_b(l)&&l.add(u))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,aw.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),ow.current||function(){if(ow.current=!0,$g)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>iw.current=e.matches;e.addListener(t),t()}else iw.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||iw.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){aw.delete(this.current),this.projection&&this.projection.unmount(),bv(this.notifyUpdate),bv(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const r=mm.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&yv.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{n(),i()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},r,n,i){let o,a;for(let s=0;s<lw;s++){const e=sw[s],{isEnabled:r,Feature:n,ProjectionNode:i,MeasureLayout:l}=om[e];i&&(o=i),r(t)&&(!this.features[e]&&n&&(this.features[e]=new n(this)),l&&(a=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:r,drag:n,dragConstraints:a,layoutScroll:s,layoutRoot:l}=t;this.projection.setOptions({layoutId:e,layout:r,alwaysMeasureLayout:!!n||a&&Kg(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,layoutScroll:s,layoutRoot:l})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let r=0;r<cw.length;r++){const t=cw[r];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const n=e["on"+t];n&&(this.propEventSubscriptions[t]=this.on(t,n))}this.prevMotionValues=function(e,t,r){const{willChange:n}=t;for(const i in t){const o=t[i],a=r[i];if(ym(o))e.addValue(i,o),_b(n)&&n.add(i);else if(ym(a))e.addValue(i,Eb(o,{owner:e})),_b(n)&&n.remove(i);else if(a!==o)if(e.hasValue(i)){const t=e.getValue(i);!t.hasAnimated&&t.set(o)}else{const t=e.getStaticValue(i);e.addValue(i,Eb(void 0!==t?t:o,{owner:e}))}}for(const i in r)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const t={};for(let r=0;r<uw;r++){const e=em[r],n=this.props[e];(Zg(n)||!1===n)&&(t[e]=n)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=Eb(t,{owner:this}),this.addValue(e,r)),r}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props,n="string"==typeof r||"object"==typeof r?null===(t=lv(this.props,r))||void 0===t?void 0:t[e]:void 0;if(r&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||ym(i)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new Ab),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class hw extends dw{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...r},{transformValues:n},i){let o=function(e,t,r){const n={};for(const i in e){const e=Pb(i,t);if(void 0!==e)n[i]=e;else{const e=r.getValue(i);e&&(n[i]=e.get())}}return n}(r,e||{},this);if(n&&(t&&(t=n(t)),r&&(r=n(r)),o&&(o=n(o))),i){!function(e,t,r){var n,i;const o=Object.keys(t).filter(t=>!e.hasValue(t)),a=o.length;if(a)for(let s=0;s<a;s++){const a=o[s],l=t[a];let c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(i=null!==(n=r[a])&&void 0!==n?n:e.readValue(a))&&void 0!==i?i:t[a]),null!=c&&("string"==typeof c&&(Sb(c)||bb(c))?c=parseFloat(c):!Ob(c)&&Py.test(l)&&(c=yb(a,l)),e.addValue(a,Eb(c,{owner:e})),void 0===r[a]&&(r[a]=c),null!==c&&e.setBaseTarget(a,c))}}(this,r,o);const e=((e,t,r,n)=>{const i=function(e,{...t},r){const n=e.current;if(!(n instanceof Element))return{target:t,transitionEnd:r};r&&(r={...r}),e.values.forEach(e=>{const t=e.get();if(!_m(t))return;const r=Yb(t,n);r&&e.set(r)});for(const i in t){const e=t[i];if(!_m(e))continue;const o=Yb(e,n);o&&(t[i]=o,r||(r={}),void 0===r[i]&&(r[i]=e))}return{target:t,transitionEnd:r}}(e,t,n);return nw(e,t=i.target,r,n=i.transitionEnd)})(this,r,o,t);t=e.transitionEnd,r=e.target}return{transition:e,transitionEnd:t,...r}}}class fw extends hw{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(mm.has(t)){const e=vb(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(Cm(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return function(e,t){return function({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}(e,t)}build(e,t,r,n){Hm(e,t,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,t){return av(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ym(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,r,n){nv(e,t,r,n)}}class pw extends hw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(mm.has(t)){const e=vb(t);return e&&e.default||0}return t=iv.has(t)?t:Yg(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return sv(e,t)}build(e,t,r,n){Jm(e,t,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,r,n){ov(e,t,0,n)}mount(e){this.isSVGTag=ev(e.tagName),super.mount(e)}}const gw=function(){function e(e,t={}){return um(function(e,{forwardMotionProps:t=!1},r,n){return{...fm(e)?xv:Cv,preloadedFeatures:r,useRender:rv(t),createVisualElement:n,Component:e}}(e,t))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(r,n)=>(t.has(n)||t.set(n,e(n)),t.get(n))})}();function mw(){const e=(0,o.useRef)(!1);return qg(()=>(e.current=!0,()=>{e.current=!1}),[]),e}class vw extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function yw({children:e,isPresent:t}){const r=(0,o.useId)(),n=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0});return(0,o.useInsertionEffect)(()=>{const{width:e,height:o,top:a,left:s}=i.current;if(t||!n.current||!e||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[t]),o.createElement(vw,{isPresent:t,childRef:n,sizeRef:i},o.cloneElement(e,{ref:n}))}const bw=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:s})=>{const l=cv(ww),c=(0,o.useId)(),u=(0,o.useMemo)(()=>({id:c,initial:t,isPresent:r,custom:i,onExitComplete:e=>{l.set(e,!0);for(const t of l.values())if(!t)return;n&&n()},register:e=>(l.set(e,!1),()=>l.delete(e))}),a?void 0:[r]);return(0,o.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[r]),o.useEffect(()=>{!r&&!l.size&&n&&n()},[r]),"popLayout"===s&&(e=o.createElement(yw,{isPresent:r},e)),o.createElement(Wg.Provider,{value:u},e)};function ww(){return new Map}const xw=e=>e.key||"",Cw=({children:e,custom:t,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:a=!0,mode:s="sync"})=>{const l=(0,o.useContext)(sm).forceRender||function(){const e=mw(),[t,r]=(0,o.useState)(0),n=(0,o.useCallback)(()=>{e.current&&r(t+1)},[t]);return[(0,o.useCallback)(()=>yv.postRender(n),[n]),t]}()[0],c=mw(),u=function(e){const t=[];return o.Children.forEach(e,e=>{(0,o.isValidElement)(e)&&t.push(e)}),t}(e);let d=u;const h=(0,o.useRef)(new Map).current,f=(0,o.useRef)(d),p=(0,o.useRef)(new Map).current,g=(0,o.useRef)(!0);if(qg(()=>{g.current=!1,function(e,t){e.forEach(e=>{const r=xw(e);t.set(r,e)})}(u,p),f.current=d}),(0,o.useEffect)(()=>()=>(g.current=!0,p.clear(),void h.clear()),[]),g.current)return o.createElement(o.Fragment,null,d.map(e=>o.createElement(bw,{key:xw(e),isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:a,mode:s},e)));d=[...d];const m=f.current.map(xw),v=u.map(xw),y=m.length;for(let o=0;o<y;o++){const e=m[o];-1===v.indexOf(e)&&!h.has(e)&&h.set(e,void 0)}return"wait"===s&&h.size&&(d=[]),h.forEach((e,r)=>{if(-1!==v.indexOf(r))return;const i=p.get(r);if(!i)return;const g=m.indexOf(r);let y=e;if(!y){const e=()=>{h.delete(r);const e=Array.from(p.keys()).filter(e=>!v.includes(e));if(e.forEach(e=>p.delete(e)),f.current=u.filter(t=>{const n=xw(t);return n===r||e.includes(n)}),!h.size){if(!1===c.current)return;l(),n&&n()}};y=o.createElement(bw,{key:xw(i),isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:a,mode:s},i),h.set(r,y)}d.splice(g,0,y)}),d=d.map(e=>{const t=e.key;return h.has(t)?e:o.createElement(bw,{key:xw(e),isPresent:!0,presenceAffectsLayout:a,mode:s},e)}),o.createElement(o.Fragment,null,h.size?d:d.map(e=>(0,o.cloneElement)(e)))};function _w({children:e,features:t,strict:r=!1}){const[,n]=(0,o.useState)(!Sw(t)),i=(0,o.useRef)(void 0);if(!Sw(t)){const{renderer:e,...r}=t;i.current=e,am(r)}return(0,o.useEffect)(()=>{Sw(t)&&t().then(({renderer:e,...t})=>{am(t),i.current=e,n(!0)})},[]),o.createElement(Gg.Provider,{value:{renderer:i.current,strict:r}},e)}function Sw(e){return"function"==typeof e}const Aw={renderer:(e,t)=>fm(e)?new pw(t,{enableHardwareAcceleration:!1}):new fw(t,{enableHardwareAcceleration:!0}),...qb,...Uv},kw=typeof document<"u"?o.useLayoutEffect:()=>{},Ew=o.createContext(!1);function Iw(){return!1}function jw(){return!0}function Tw(e){return()=>{}}function Fw(){return"function"==typeof o.useSyncExternalStore?o.useSyncExternalStore(Tw,Iw,jw):(0,o.useContext)(Ew)}o.useId;let Ow=new Map;function Mw(e,t){if(e===t)return e;let r=Ow.get(e);if(r)return r(t),t;let n=Ow.get(t);return n?(n(e),e):t}function Pw(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}const Rw=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},Lw=e=>e&&"window"in e&&e.window===e?e:Rw(e).defaultView||window;function Nw(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=Pw(r,i):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof r||"string"!=typeof i?"id"===e&&r&&i?t.id=Mw(r,i):t[e]=void 0!==i?i:r:t[e]=gh(r,i)}}return t}function Dw(e){if(function(){if(null==zw){zw=!1;try{document.createElement("div").focus({get preventScroll(){return zw=!0,!0}})}catch{}}return zw}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let zw=null;function Bw(){return function(){var e;return typeof window<"u"&&null!=window.navigator&&/^Mac/i.test((null===(e=window.navigator.userAgentData)||void 0===e?void 0:e.platform)||window.navigator.platform)}()}let Uw=new Map,Vw=new Set;function Hw(){if(typeof window>"u")return;function e(e){return"propertyName"in e}let t=r=>{if(!e(r)||!r.target)return;let n=Uw.get(r.target);if(n&&(n.delete(r.propertyName),0===n.size&&(r.target.removeEventListener("transitioncancel",t),Uw.delete(r.target)),0===Uw.size)){for(let e of Vw)e();Vw.clear()}};document.body.addEventListener("transitionrun",r=>{if(!e(r)||!r.target)return;let n=Uw.get(r.target);n||(n=new Set,Uw.set(r.target,n),r.target.addEventListener("transitioncancel",t,{once:!0})),n.add(r.propertyName)}),document.body.addEventListener("transitionend",t)}function Ww(){let e=(0,o.useRef)(new Map),t=(0,o.useCallback)((t,r,n,i)=>{let o=null!=i&&i.once?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:o,options:i}),t.addEventListener(r,n,i)},[]),r=(0,o.useCallback)((t,r,n,i)=>{var o;let a=(null===(o=e.current.get(n))||void 0===o?void 0:o.fn)||n;t.removeEventListener(r,a,i),e.current.delete(n)},[]),n=(0,o.useCallback)(()=>{e.current.forEach((e,t)=>{r(e.eventTarget,e.type,t,e.options)})},[r]);return(0,o.useEffect)(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}function $w(e){const t=(0,o.useRef)(null);return(0,o.useMemo)(()=>({get current(){return t.current},set current(r){t.current=r,"function"==typeof e?e(r):e&&(e.current=r)}}),[e])}typeof document<"u"&&("loading"!==document.readyState?Hw():document.addEventListener("DOMContentLoaded",Hw));let qw=typeof document<"u"&&window.visualViewport;function Gw(){return{width:qw&&(null==qw?void 0:qw.width)||window.innerWidth,height:qw&&(null==qw?void 0:qw.height)||window.innerHeight}}function Yw(e,t,r){let[n,i]=(0,o.useState)(e||t),a=(0,o.useRef)(void 0!==e),s=void 0!==e;(0,o.useEffect)(()=>{a.current;a.current=s},[s]);let l=s?e:n,c=(0,o.useCallback)((e,...t)=>{let n=(e,...t)=>{r&&(Object.is(l,e)||r(e,...t)),s||(l=e)};"function"==typeof e?i((r,...i)=>{let o=e(s?l:r,...i);return n(o,...t),s?r:o}):(s||i(e),n(e,...t))},[s,l,r]);return[l,c]}function Xw(e,t=-1/0,r=1/0){return Math.min(Math.max(e,t),r)}function Kw(e,t){let r=e,n=t.toString(),i=n.indexOf("."),o=i>=0?n.length-i:0;if(o>0){let e=Math.pow(10,o);r=Math.round(r*e)/e}return r}function Zw(e,t,r=10){const n=Math.pow(r,t);return Math.round(e*n)/n}var Qw={};const Jw=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));!function(e){var t=t||{version:"5.3.0"};if(e.fabric=t,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?t.document=document:t.document=document.implementation.createHTMLDocument(""),t.window=window;else{var r=new Jw.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;t.document=r.document,t.jsdomImplForWrapper=Jw.implForWrapper,t.nodeCanvas=Jw.Canvas,t.window=r,DOMParser=t.window.DOMParser}function n(e,t){var r=e.canvas,n=t.targetCanvas,i=n.getContext("2d");i.translate(0,n.height),i.scale(1,-1);var o=r.height-n.height;i.drawImage(r,0,o,n.width,n.height,0,0,n.width,n.height)}function i(e,t){var r=t.targetCanvas.getContext("2d"),n=t.destinationWidth,i=t.destinationHeight,o=n*i*4,a=new Uint8Array(this.imageBuffer,0,o),s=new Uint8ClampedArray(this.imageBuffer,0,o);e.readPixels(0,0,n,i,e.RGBA,e.UNSIGNED_BYTE,a);var l=new ImageData(s,n,i);r.putImageData(l,0,0)}t.isTouchSupported="ontouchstart"in t.window||"ontouchstart"in t.document||t.window&&t.window.navigator&&t.window.navigator.maxTouchPoints>0,t.isLikelyNode=typeof ce<"u"&&typeof window>"u",t.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],t.DPI=96,t.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",t.commaWsp="(?:\\s+,?\\s*|,\\s*)",t.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,t.reNonWord=/[ \n\.,;!\?\-]/,t.fontPaths={},t.iMatrix=[1,0,0,1,0,0],t.svgNS="http://www.w3.org/2000/svg",t.perfLimitSizeTotal=2097152,t.maxCacheSideLimit=4096,t.minCacheSideLimit=256,t.charWidthsCache={},t.textureSize=2048,t.disableStyleCopyPaste=!1,t.enableGLFiltering=!0,t.devicePixelRatio=t.window.devicePixelRatio||t.window.webkitDevicePixelRatio||t.window.mozDevicePixelRatio||1,t.browserShadowBlurConstant=1,t.arcToSegmentsCache={},t.boundsOfCurveCache={},t.cachesBoundsOfCurve=!0,t.forceGLPutImageData=!1,t.initFilterBackend=function(){return t.enableGLFiltering&&t.isWebglSupported&&t.isWebglSupported(t.textureSize)?new t.WebglFilterBackend({tileSize:t.textureSize}):t.Canvas2dFilterBackend?new t.Canvas2dFilterBackend:void 0},typeof document<"u"&&typeof window<"u"&&(window.fabric=t),function(){function e(e,r){if(this.__eventListeners[e]){var n=this.__eventListeners[e];r?n[n.indexOf(r)]=!1:t.util.array.fill(n,!1)}}function r(e,t){var r=function(){t.apply(this,arguments),this.off(e,r)}.bind(this);this.on(e,r)}t.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var r=this.__eventListeners[e];if(!r)return this;for(var n=0,i=r.length;n<i;n++)r[n]&&r[n].call(this,t||{});return this.__eventListeners[e]=r.filter(function(e){return!1!==e}),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var r in e)this.on(r,e[r]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,t){if(1===arguments.length)for(var n in e)r.call(this,n,e[n]);else r.call(this,e,t);return this},off:function(t,r){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var n in t)e.call(this,n,t[n]);else e.call(this,t,r);return this}}}(),t.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,r){var n=this._objects;return r?n[t]=e:n.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,r=!1,n=0,i=arguments.length;n<i;n++)-1!==(e=t.indexOf(arguments[n]))&&(r=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[n]));return this.renderOnAddRemove&&r&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var r=this.getObjects(),n=0,i=r.length;n<i;n++)e.call(t,r[n],n,r);return this},getObjects:function(e){return typeof e>"u"?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some(function(t){return"function"==typeof t.contains&&t.contains(e,!0)})},complexity:function(){return this._objects.reduce(function(e,t){return e+(t.complexity?t.complexity():0)},0)}},t.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,r){e&&e.colorStops&&!(e instanceof t.Gradient)&&this.set(r,new t.Gradient(e))},_initPattern:function(e,r,n){!e||!e.source||e instanceof t.Pattern?n&&n():this.set(r,new t.Pattern(e,n))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},function(e){var r=Math.sqrt,n=Math.atan2,i=Math.pow,o=Math.PI/180,a=Math.PI/2;t.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/a){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/a){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var r=e.indexOf(t);return-1!==r&&e.splice(r,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*o},radiansToDegrees:function(e){return e/o},rotatePoint:function(e,r,n){var i=new t.Point(e.x-r.x,e.y-r.y),o=t.util.rotateVector(i,n);return new t.Point(o.x,o.y).addEquals(r)},rotateVector:function(e,r){var n=t.util.sin(r),i=t.util.cos(r);return{x:e.x*i-e.y*n,y:e.x*n+e.y*i}},createVector:function(e,r){return new t.Point(r.x-e.x,r.y-e.y)},calcAngleBetweenVectors:function(e,t){return Math.acos((e.x*t.x+e.y*t.y)/(Math.hypot(e.x,e.y)*Math.hypot(t.x,t.y)))},getHatVector:function(e){return new t.Point(e.x,e.y).multiply(1/Math.hypot(e.x,e.y))},getBisector:function(e,r,n){var i=t.util.createVector(e,r),o=t.util.createVector(e,n),a=t.util.calcAngleBetweenVectors(i,o),s=a*(0===t.util.calcAngleBetweenVectors(t.util.rotateVector(i,a),o)?1:-1)/2;return{vector:t.util.getHatVector(t.util.rotateVector(i,s)),angle:a}},projectStrokeOnPoints:function(e,r,n){var i=[],o=r.strokeWidth/2,a=r.strokeUniform?new t.Point(1/r.scaleX,1/r.scaleY):new t.Point(1,1),s=function(e){var r=o/Math.hypot(e.x,e.y);return new t.Point(e.x*r*a.x,e.y*r*a.y)};return e.length<=1||e.forEach(function(l,c){var u,d,h=new t.Point(l.x,l.y);0===c?(d=e[c+1],u=n?s(t.util.createVector(d,h)).addEquals(h):e[e.length-1]):c===e.length-1?(u=e[c-1],d=n?s(t.util.createVector(u,h)).addEquals(h):e[0]):(u=e[c-1],d=e[c+1]);var f,p,g=t.util.getBisector(h,u,d),m=g.vector,v=g.angle;if("miter"===r.strokeLineJoin&&(f=-o/Math.sin(v/2),p=new t.Point(m.x*f*a.x,m.y*f*a.y),Math.hypot(p.x,p.y)/o<=r.strokeMiterLimit))return i.push(h.add(p)),void i.push(h.subtract(p));f=-o*Math.SQRT2,p=new t.Point(m.x*f*a.x,m.y*f*a.y),i.push(h.add(p)),i.push(h.subtract(p))}),i},transformPoint:function(e,r,n){return n?new t.Point(r[0]*e.x+r[2]*e.y,r[1]*e.x+r[3]*e.y):new t.Point(r[0]*e.x+r[2]*e.y+r[4],r[1]*e.x+r[3]*e.y+r[5])},makeBoundingBoxFromPoints:function(e,r){if(r)for(var n=0;n<e.length;n++)e[n]=t.util.transformPoint(e[n],r);var i=[e[0].x,e[1].x,e[2].x,e[3].x],o=t.util.array.min(i),a=t.util.array.max(i)-o,s=[e[0].y,e[1].y,e[2].y,e[3].y],l=t.util.array.min(s);return{left:o,top:l,width:a,height:t.util.array.max(s)-l}},invertTransform:function(e){var r=1/(e[0]*e[3]-e[1]*e[2]),n=[r*e[3],-r*e[1],-r*e[2],r*e[0]],i=t.util.transformPoint({x:e[4],y:e[5]},n,!0);return n[4]=-i.x,n[5]=-i.y,n},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,r){var n=/\D{0,2}$/.exec(e),i=parseFloat(e);switch(r||(r=t.Text.DEFAULT_SVG_FONT_SIZE),n[0]){case"mm":return i*t.DPI/25.4;case"cm":return i*t.DPI/2.54;case"in":return i*t.DPI;case"pt":return i*t.DPI/72;case"pc":return i*t.DPI/72*12;case"em":return i*r;default:return i}},falseFunction:function(){return!1},getKlass:function(e,r){return e=t.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),t.util.resolveNamespace(r)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(r){if(!r)return t;var n,i=r.split("."),o=i.length,a=e||t.window;for(n=0;n<o;++n)a=a[i[n]];return a},loadImage:function(e,r,n,i){if(e){var o=t.util.createImage(),a=function(){r&&r.call(n,o,!1),o=o.onload=o.onerror=null};o.onload=a,o.onerror=function(){t.log("Error loading "+o.src),r&&r.call(n,null,!0),o=o.onload=o.onerror=null},0!==e.indexOf("data")&&null!=i&&(o.crossOrigin=i),"data:image/svg"===e.substring(0,14)&&(o.onload=null,t.util.loadImageInDom(o,a)),o.src=e}else r&&r.call(n,e)},loadImageInDom:function(e,r){var n=t.document.createElement("div");n.style.width=n.style.height="1px",n.style.left=n.style.top="-100%",n.style.position="absolute",n.appendChild(e),t.document.querySelector("body").appendChild(n),e.onload=function(){r(),n.parentNode.removeChild(n),n=null}},enlivenObjects:function(e,r,n,i){var o=[],a=0,s=(e=e||[]).length;function l(){++a===s&&r&&r(o.filter(function(e){return e}))}s?e.forEach(function(e,r){e&&e.type?t.util.getKlass(e.type,n).fromObject(e,function(t,n){n||(o[r]=t),i&&i(e,t,n),l()}):l()}):r&&r(o)},enlivenObjectEnlivables:function(e,r,n){var i=t.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});t.util.enlivenObjects(i.map(function(t){return e[t]}),function(e){var t={};i.forEach(function(n,i){t[n]=e[i],r&&(r[n]=e[i])}),n&&n(t)})},enlivenPatterns:function(e,r){function n(){++o===a&&r&&r(i)}var i=[],o=0,a=(e=e||[]).length;a?e.forEach(function(e,r){e&&e.source?new t.Pattern(e,function(e){i[r]=e,n()}):(i[r]=e,n())}):r&&r(i)},groupSVGElements:function(e,r,n){var i;return e&&1===e.length?(typeof n<"u"&&(e[0].sourcePath=n),e[0]):(r&&(r.width&&r.height?r.centerPoint={x:r.width/2,y:r.height/2}:(delete r.width,delete r.height)),i=new t.Group(e,r),typeof n<"u"&&(i.sourcePath=n),i)},populateWithProperties:function(e,t,r){if(r&&Array.isArray(r))for(var n=0,i=r.length;n<i;n++)r[n]in e&&(t[r[n]]=e[r[n]])},createCanvasElement:function(){return t.document.createElement("canvas")},copyCanvasElement:function(e){var r=t.util.createCanvasElement();return r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0),r},toDataURL:function(e,t,r){return e.toDataURL("image/"+t,r)},createImage:function(){return t.document.createElement("img")},multiplyTransformMatrices:function(e,t,r){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],r?0:e[0]*t[4]+e[2]*t[5]+e[4],r?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var t=n(e[1],e[0]),a=i(e[0],2)+i(e[1],2),s=r(a),l=(e[0]*e[3]-e[2]*e[1])/s,c=n(e[0]*e[2]+e[1]*e[3],a);return{angle:t/o,scaleX:s,scaleY:l,skewX:c/o,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return t.iMatrix.concat();var r=t.util.degreesToRadians(e.angle),n=t.util.cos(r),i=t.util.sin(r);return[n,i,-i,n,0,0]},calcDimensionsMatrix:function(e){var r=typeof e.scaleX>"u"?1:e.scaleX,n=typeof e.scaleY>"u"?1:e.scaleY,i=[e.flipX?-r:r,0,0,e.flipY?-n:n,0,0],o=t.util.multiplyTransformMatrices,a=t.util.degreesToRadians;return e.skewX&&(i=o(i,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(i=o(i,[1,Math.tan(a(e.skewY)),0,1],!0)),i},composeMatrix:function(e){var r=[1,0,0,1,e.translateX||0,e.translateY||0],n=t.util.multiplyTransformMatrices;return e.angle&&(r=n(r,t.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(r=n(r,t.util.calcDimensionsMatrix(e))),r},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,r,n){n>0&&(t>n?t-=n:t=0,r>n?r-=n:r=0);var i,o=!0,a=e.getImageData(t,r,2*n||1,2*n||1),s=a.data.length;for(i=3;i<s&&!1!==(o=a.data[i]<=0);i+=4);return a=null,o},parsePreserveAspectRatioAttribute:function(e){var t,r="meet",n=e.split(" ");return n&&n.length&&("meet"!==(r=n.pop())&&"slice"!==r?(t=r,r="meet"):n.length&&(t=n.pop())),{meetOrSlice:r,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?t.charWidthsCache[e]&&delete t.charWidthsCache[e]:t.charWidthsCache={}},limitDimsByArea:function(e,t){var r=Math.sqrt(t*e),n=Math.floor(t/r);return{x:Math.floor(r),y:n}},capValue:function(e,t,r){return Math.max(e,Math.min(t,r))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map(function(e){return t.util.toFixed(e,t.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(e,r){var n=t.util.invertTransform(r),i=t.util.multiplyTransformMatrices(n,e.calcOwnMatrix());t.util.applyTransformToObject(e,i)},addTransformToObject:function(e,r){t.util.applyTransformToObject(e,t.util.multiplyTransformMatrices(r,e.calcOwnMatrix()))},applyTransformToObject:function(e,r){var n=t.util.qrDecompose(r),i=new t.Point(n.translateX,n.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",n.scaleX),e.set("scaleY",n.scaleY),e.skewX=n.skewX,e.skewY=n.skewY,e.angle=n.angle,e.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(e,r,n){var i=e/2,o=r/2,a=[{x:-i,y:-o},{x:i,y:-o},{x:-i,y:o},{x:i,y:o}],s=t.util.calcDimensionsMatrix(n),l=t.util.makeBoundingBoxFromPoints(a,s);return{x:l.width,y:l.height}},mergeClipPaths:function(e,r){var n=e,i=r;n.inverted&&!i.inverted&&(n=r,i=e),t.util.applyTransformToObject(i,t.util.multiplyTransformMatrices(t.util.invertTransform(n.calcTransformMatrix()),i.calcTransformMatrix()));var o=n.inverted&&i.inverted;return o&&(n.inverted=i.inverted=!1),new t.Group([n],{clipPath:i,inverted:o})},hasStyleChanged:function(e,t,r){return r=r||!1,e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.textBackgroundColor!==t.textBackgroundColor||e.deltaY!==t.deltaY||r&&(e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough)},stylesToArray:function(e,r){e=t.util.object.clone(e,!0);for(var n=r.split("\n"),i=-1,o={},a=[],s=0;s<n.length;s++)if(e[s])for(var l=0;l<n[s].length;l++){i++;var c=e[s][l];c&&Object.keys(c).length>0&&(t.util.hasStyleChanged(o,c,!0)?a.push({start:i,end:i+1,style:c}):a[a.length-1].end++),o=c||{}}else i+=n[s].length;return a},stylesFromArray:function(e,t){if(!Array.isArray(e))return e;for(var r=t.split("\n"),n=-1,i=0,o={},a=0;a<r.length;a++)for(var s=0;s<r[a].length;s++)n++,e[i]&&e[i].start<=n&&n<e[i].end&&(o[a]=o[a]||{},o[a][s]=Object.assign({},e[i].style),n===e[i].end-1&&i++);return o}}}(e),function(){var e=Array.prototype.join,r={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},n={m:"l",M:"L"};function i(e,r,n,i,o,a,s,l,c,u,d){var h=t.util.cos(e),f=t.util.sin(e),p=t.util.cos(r),g=t.util.sin(r),m=n*o*p-i*a*g+s,v=i*o*p+n*a*g+l;return["C",u+c*(-n*o*f-i*a*h),d+c*(-i*o*f+n*a*h),m+c*(n*o*g+i*a*p),v+c*(i*o*g-n*a*p),m,v]}function o(e,t,r,n){var i=Math.atan2(t,e),o=Math.atan2(n,r);return o>=i?o-i:2*Math.PI-(i-o)}function a(e,r,n){for(var a=n[1],s=n[2],l=n[3],c=n[4],u=n[5],d=function(e,r,n,a,s,l,c){var u=Math.PI,d=c*u/180,h=t.util.sin(d),f=t.util.cos(d),p=0,g=0,m=-f*e*.5-h*r*.5,v=-f*r*.5+h*e*.5,y=(n=Math.abs(n))*n,b=(a=Math.abs(a))*a,w=v*v,x=m*m,C=y*b-y*w-b*x,_=0;if(C<0){var S=Math.sqrt(1-C/(y*b));n*=S,a*=S}else _=(s===l?-1:1)*Math.sqrt(C/(y*w+b*x));var A=_*n*v/a,k=-_*a*m/n,E=f*A-h*k+.5*e,I=h*A+f*k+.5*r,j=o(1,0,(m-A)/n,(v-k)/a),T=o((m-A)/n,(v-k)/a,(-m-A)/n,(-v-k)/a);0===l&&T>0?T-=2*u:1===l&&T<0&&(T+=2*u);for(var F=Math.ceil(Math.abs(T/u*2)),O=[],M=T/F,P=8/3*Math.sin(M/4)*Math.sin(M/4)/Math.sin(M/2),R=j+M,L=0;L<F;L++)O[L]=i(j,R,f,h,n,a,E,I,P,p,g),p=O[L][5],g=O[L][6],j=R,R+=M;return O}(n[6]-e,n[7]-r,a,s,c,u,l),h=0,f=d.length;h<f;h++)d[h][1]+=e,d[h][2]+=r,d[h][3]+=e,d[h][4]+=r,d[h][5]+=e,d[h][6]+=r;return d}function s(e,t,r,n){return Math.sqrt((r-e)*(r-e)+(n-t)*(n-t))}function l(e,t,r,n,i,o,a,s){return function(l){var c=function(e){return e*e*e}(l),u=function(e){return 3*e*e*(1-e)}(l),d=function(e){return 3*e*(1-e)*(1-e)}(l),h=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:a*c+i*u+r*d+e*h,y:s*c+o*u+n*d+t*h}}}function c(e,t,r,n,i,o,a,s){return function(l){var c=1-l,u=3*c*c*(r-e)+6*c*l*(i-r)+3*l*l*(a-i),d=3*c*c*(n-t)+6*c*l*(o-n)+3*l*l*(s-o);return Math.atan2(d,u)}}function u(e,t,r,n,i,o){return function(a){var s=function(e){return e*e}(a),l=function(e){return 2*e*(1-e)}(a),c=function(e){return(1-e)*(1-e)}(a);return{x:i*s+r*l+e*c,y:o*s+n*l+t*c}}}function d(e,t,r,n,i,o){return function(a){var s=1-a,l=2*s*(r-e)+2*a*(i-r),c=2*s*(n-t)+2*a*(o-n);return Math.atan2(c,l)}}function h(e,t,r){var n,i,o={x:t,y:r},a=0;for(i=1;i<=100;i+=1)n=e(i/100),a+=s(o.x,o.y,n.x,n.y),o=n;return a}function f(e,t){for(var r,n,i,o=0,a=0,l=e.iterator,c={x:e.x,y:e.y},u=.01,d=e.angleFinder;a<t&&u>1e-4;)r=l(o),i=o,(n=s(c.x,c.y,r.x,r.y))+a>t?(o-=u,u/=2):(c=r,o+=u,a+=n);return r.angle=d(i),r}function p(e){for(var t,r,n,i,o=0,a=e.length,f=0,p=0,g=0,m=0,v=[],y=0;y<a;y++){switch(n={x:f,y:p,command:(t=e[y])[0]},t[0]){case"M":n.length=0,g=f=t[1],m=p=t[2];break;case"L":n.length=s(f,p,t[1],t[2]),f=t[1],p=t[2];break;case"C":r=l(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),i=c(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),n.iterator=r,n.angleFinder=i,n.length=h(r,f,p),f=t[5],p=t[6];break;case"Q":r=u(f,p,t[1],t[2],t[3],t[4]),i=d(f,p,t[1],t[2],t[3],t[4]),n.iterator=r,n.angleFinder=i,n.length=h(r,f,p),f=t[3],p=t[4];break;case"Z":case"z":n.destX=g,n.destY=m,n.length=s(f,p,g,m),f=g,p=m}o+=n.length,v.push(n)}return v.push({length:o,x:f,y:p}),v}t.util.joinPath=function(e){return e.map(function(e){return e.join(" ")}).join(" ")},t.util.parsePath=function(e){var i,o,a,s,l,c=[],u=[],d=t.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+h+")"+t.commaWsp,p="([01])"+t.commaWsp+"?",g=new RegExp(f+"?"+f+"?"+f+p+p+f+"?("+h+")","g");if(!e||!e.match)return c;for(var m,v=0,y=(l=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<y;v++){s=(i=l[v]).slice(1).trim(),u.length=0;var b=i.charAt(0);if(m=[b],"a"===b.toLowerCase())for(var w;w=g.exec(s);)for(var x=1;x<w.length;x++)u.push(w[x]);else for(;a=d.exec(s);)u.push(a[0]);x=0;for(var C=u.length;x<C;x++)o=parseFloat(u[x]),isNaN(o)||m.push(o);var _=r[b.toLowerCase()],S=n[b]||b;if(m.length-1>_)for(var A=1,k=m.length;A<k;A+=_)c.push([b].concat(m.slice(A,A+_))),b=S;else c.push(m)}return c},t.util.makePathSimpler=function(e){var t,r,n,i,o,s,l=0,c=0,u=e.length,d=0,h=0,f=[];for(r=0;r<u;++r){switch(n=!1,(t=e[r].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],d=t[1],h=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":o=t[3],s=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=o,t[2]=s,o=t[3],s=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":o=t[1],s=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),t[0]="Q",l=t[1],c=t[2],t[1]=o,t[2]=s,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":n=!0,f=f.concat(a(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=d,c=h}n||f.push(t),i=t[0]}return f},t.util.getSmoothPathFromPoints=function(e,r){var n,i=[],o=new t.Point(e[0].x,e[0].y),a=new t.Point(e[1].x,e[1].y),s=e.length,l=1,c=0,u=s>2;for(r=r||0,u&&(l=e[2].x<a.x?-1:e[2].x===a.x?0:1,c=e[2].y<a.y?-1:e[2].y===a.y?0:1),i.push(["M",o.x-l*r,o.y-c*r]),n=1;n<s;n++){if(!o.eq(a)){var d=o.midPointFrom(a);i.push(["Q",o.x,o.y,d.x,d.y])}o=e[n],n+1<e.length&&(a=e[n+1])}return u&&(l=o.x>e[n-2].x?1:o.x===e[n-2].x?0:-1,c=o.y>e[n-2].y?1:o.y===e[n-2].y?0:-1),i.push(["L",o.x+l*r,o.y+c*r]),i},t.util.getPathSegmentsInfo=p,t.util.getBoundsOfCurve=function(r,n,i,o,a,s,l,c){var u;if(t.cachesBoundsOfCurve&&(u=e.call(arguments),t.boundsOfCurveCache[u]))return t.boundsOfCurveCache[u];var d,h,f,p,g,m,v,y,b=Math.sqrt,w=Math.min,x=Math.max,C=Math.abs,_=[],S=[[],[]];h=6*r-12*i+6*a,d=-3*r+9*i-9*a+3*l,f=3*i-3*r;for(var A=0;A<2;++A)if(A>0&&(h=6*n-12*o+6*s,d=-3*n+9*o-9*s+3*c,f=3*o-3*n),C(d)<1e-12){if(C(h)<1e-12)continue;0<(p=-f/h)&&p<1&&_.push(p)}else!((v=h*h-4*f*d)<0)&&(0<(g=(-h+(y=b(v)))/(2*d))&&g<1&&_.push(g),0<(m=(-h-y)/(2*d))&&m<1&&_.push(m));for(var k,E,I,j=_.length,T=j;j--;)k=(I=1-(p=_[j]))*I*I*r+3*I*I*p*i+3*I*p*p*a+p*p*p*l,S[0][j]=k,E=I*I*I*n+3*I*I*p*o+3*I*p*p*s+p*p*p*c,S[1][j]=E;S[0][T]=r,S[1][T]=n,S[0][T+1]=l,S[1][T+1]=c;var F=[{x:w.apply(null,S[0]),y:w.apply(null,S[1])},{x:x.apply(null,S[0]),y:x.apply(null,S[1])}];return t.cachesBoundsOfCurve&&(t.boundsOfCurveCache[u]=F),F},t.util.getPointOnPath=function(e,r,n){n||(n=p(e));for(var i=0;r-n[i].length>0&&i<n.length-2;)r-=n[i].length,i++;var o,a=n[i],s=r/a.length,l=a.command,c=e[i];switch(l){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(o=new t.Point(a.x,a.y).lerp(new t.Point(a.destX,a.destY),s)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),o;case"L":return(o=new t.Point(a.x,a.y).lerp(new t.Point(c[1],c[2]),s)).angle=Math.atan2(c[2]-a.y,c[1]-a.x),o;case"C":case"Q":return f(a,r)}},t.util.transformPath=function(e,r,n){return n&&(r=t.util.multiplyTransformMatrices(r,[1,0,0,1,-n.x,-n.y])),e.map(function(e){for(var n=e.slice(0),i={},o=1;o<e.length-1;o+=2)i.x=e[o],i.y=e[o+1],i=t.util.transformPoint(i,r),n[o]=i.x,n[o+1]=i.y;return n})}}(),function(){var e=Array.prototype.slice;function r(e,t,r){if(e&&0!==e.length){var n=e.length-1,i=t?e[n][t]:e[n];if(t)for(;n--;)r(e[n][t],i)&&(i=e[n][t]);else for(;n--;)r(e[n],i)&&(i=e[n]);return i}}t.util.array={fill:function(e,t){for(var r=e.length;r--;)e[r]=t;return e},invoke:function(t,r){for(var n=e.call(arguments,2),i=[],o=0,a=t.length;o<a;o++)i[o]=n.length?t[o][r].apply(t[o],n):t[o][r].call(t[o]);return i},min:function(e,t){return r(e,t,function(e,t){return e<t})},max:function(e,t){return r(e,t,function(e,t){return e>=t})}}}(),function(){function e(r,n,i){if(i)if(!t.isLikelyNode&&n instanceof Element)r=n;else if(n instanceof Array){r=[];for(var o=0,a=n.length;o<a;o++)r[o]=e({},n[o],i)}else if(n&&"object"==typeof n)for(var s in n)"canvas"===s||"group"===s?r[s]=null:n.hasOwnProperty(s)&&(r[s]=e({},n[s],i));else r=n;else for(var s in n)r[s]=n[s];return r}t.util.object={extend:e,clone:function(t,r){return e({},t,r)}},t.util.object.extend(t.util,t.Observable)}(),function(){function e(e,t){var r=e.charCodeAt(t);if(isNaN(r))return"";if(r<55296||r>57343)return e.charAt(t);if(55296<=r&&r<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var n=e.charCodeAt(t+1);if(56320>n||n>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}t.util.string={camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(t){var r,n=0,i=[];for(n=0;n<t.length;n++)!1!==(r=e(t,n))&&i.push(r);return i}}}(),function(){var e=Array.prototype.slice,r=function(){},n=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),i=function(e,t,r){for(var i in t)i in e.prototype&&"function"==typeof e.prototype[i]&&(t[i]+"").indexOf("callSuper")>-1?e.prototype[i]=function(e){return function(){var n=this.constructor.superclass;this.constructor.superclass=r;var i=t[e].apply(this,arguments);if(this.constructor.superclass=n,"initialize"!==e)return i}}(i):e.prototype[i]=t[i],n&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function o(){}function a(t){for(var r=null,n=this;n.constructor.superclass;){var i=n.constructor.superclass.prototype[t];if(n[t]!==i){r=i;break}n=n.constructor.superclass.prototype}return r?arguments.length>1?r.apply(this,e.call(arguments,1)):r.call(this):void 0}t.util.createClass=function(){var t=null,n=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof n[0]&&(t=n.shift()),s.superclass=t,s.subclasses=[],t&&(o.prototype=t.prototype,s.prototype=new o,t.subclasses.push(s));for(var l=0,c=n.length;l<c;l++)i(s,n[l],t);return s.prototype.initialize||(s.prototype.initialize=r),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),function(){var e=!!t.document.createElement("div").attachEvent,r=["touchstart","touchmove","touchend"];t.util.addListener=function(t,r,n,i){t&&t.addEventListener(r,n,!e&&i)},t.util.removeListener=function(t,r,n,i){t&&t.removeEventListener(r,n,!e&&i)},t.util.getPointer=function(e){var r=e.target,n=t.util.getScrollLeftTop(r),i=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:i.clientX+n.left,y:i.clientY+n.top}},t.util.isTouchEvent=function(e){return r.indexOf(e.type)>-1||"touch"===e.pointerType}}(),function(){var e=t.document.createElement("div"),r="string"==typeof e.style.opacity,n="string"==typeof e.style.filter,i=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,o=function(e){return e};r?o=function(e,t){return e.style.opacity=t,e}:n&&(o=function(e,t){var r=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(r.zoom=1),i.test(r.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",r.filter=r.filter.replace(i,t)):r.filter+=" alpha(opacity="+100*t+")",e}),t.util.setStyle=function(e,t){var r=e.style;if(!r)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?o(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var n in t)if("opacity"===n)o(e,t[n]);else{var i="float"===n||"cssFloat"===n?typeof r.styleFloat>"u"?"cssFloat":"styleFloat":n;r.setProperty(i,t[n])}return e}}(),function(){var e,r,n,i,o=Array.prototype.slice,a=function(e){return o.call(e,0)};try{e=a(t.document.childNodes)instanceof Array}catch{}function s(e,r){var n=t.document.createElement(e);for(var i in r)"class"===i?n.className=r[i]:"for"===i?n.htmlFor=r[i]:n.setAttribute(i,r[i]);return n}function l(e){for(var r=0,n=0,i=t.document.documentElement,o=t.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===t.document?(r=o.scrollLeft||i.scrollLeft||0,n=o.scrollTop||i.scrollTop||0):(r+=e.scrollLeft||0,n+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:r,top:n}}e||(a=function(e){for(var t=new Array(e.length),r=e.length;r--;)t[r]=e[r];return t}),r=t.document.defaultView&&t.document.defaultView.getComputedStyle?function(e,r){var n=t.document.defaultView.getComputedStyle(e,null);return n?n[r]:void 0}:function(e,t){var r=e.style[t];return!r&&e.currentStyle&&(r=e.currentStyle[t]),r},n=t.document.documentElement.style,i="userSelect"in n?"userSelect":"MozUserSelect"in n?"MozUserSelect":"WebkitUserSelect"in n?"WebkitUserSelect":"KhtmlUserSelect"in n?"KhtmlUserSelect":"",t.util.makeElementUnselectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=t.util.falseFunction),i?e.style[i]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},t.util.makeElementSelectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=null),i?e.style[i]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},t.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},t.util.getById=function(e){return"string"==typeof e?t.document.getElementById(e):e},t.util.toArray=a,t.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},t.util.makeElement=s,t.util.wrapElement=function(e,t,r){return"string"==typeof t&&(t=s(t,r)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},t.util.getScrollLeftTop=l,t.util.getElementOffset=function(e){var t,n,i=e&&e.ownerDocument,o={left:0,top:0},a={left:0,top:0},s={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!i)return a;for(var c in s)a[s[c]]+=parseInt(r(e,c),10)||0;return t=i.documentElement,typeof e.getBoundingClientRect<"u"&&(o=e.getBoundingClientRect()),n=l(e),{left:o.left+n.left-(t.clientLeft||0)+a.left,top:o.top+n.top-(t.clientTop||0)+a.top}},t.util.getNodeCanvas=function(e){var r=t.jsdomImplForWrapper(e);return r._canvas||r._image},t.util.cleanUpJsdomNode=function(e){if(t.isLikelyNode){var r=t.jsdomImplForWrapper(e);r&&(r._image=null,r._canvas=null,r._currentSrc=null,r._attributes=null,r._classList=null)}}}(),function(){function e(){}t.util.request=function(r,n){n||(n={});var i=n.method?n.method.toUpperCase():"GET",o=n.onComplete||function(){},a=new t.window.XMLHttpRequest,s=n.body||n.parameters;return a.onreadystatechange=function(){4===a.readyState&&(o(a),a.onreadystatechange=e)},"GET"===i&&(s=null,"string"==typeof n.parameters&&(r=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(r,n.parameters))),a.open(i,r,!0),("POST"===i||"PUT"===i)&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(s),a}}(),t.log=console.log,t.warn=console.warn,function(){var e=t.util.object.extend,r=t.util.object.clone,n=[];function i(){return!1}function o(e,t,r,n){return-r*Math.cos(e/n*(Math.PI/2))+r+t}t.util.object.extend(n,{cancelAll:function(){var e=this.splice(0);return e.forEach(function(e){e.cancel()}),e},cancelByCanvas:function(e){if(!e)return[];var t=this.filter(function(t){return"object"==typeof t.target&&t.target.canvas===e});return t.forEach(function(e){e.cancel()}),t},cancelByTarget:function(e){var t=this.findAnimationsByTarget(e);return t.forEach(function(e){e.cancel()}),t},findAnimationIndex:function(e){return this.indexOf(this.findAnimation(e))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}});var a=t.window.requestAnimationFrame||t.window.webkitRequestAnimationFrame||t.window.mozRequestAnimationFrame||t.window.oRequestAnimationFrame||t.window.msRequestAnimationFrame||function(e){return t.window.setTimeout(e,1e3/60)},s=t.window.cancelAnimationFrame||t.window.clearTimeout;function l(){return a.apply(t.window,arguments)}t.util.animate=function(n){n||(n={});var a,s=!1,c=function(){var e=t.runningAnimations.indexOf(a);return e>-1&&t.runningAnimations.splice(e,1)[0]};return a=e(r(n),{cancel:function(){return s=!0,c()},currentValue:"startValue"in n?n.startValue:0,completionRate:0,durationRate:0}),t.runningAnimations.push(a),l(function(e){var t,r=e||+new Date,u=n.duration||500,d=r+u,h=n.onChange||i,f=n.abort||i,p=n.onComplete||i,g=n.easing||o,m="startValue"in n&&n.startValue.length>0,v="startValue"in n?n.startValue:0,y="endValue"in n?n.endValue:100,b=n.byValue||(m?v.map(function(e,t){return y[t]-v[t]}):y-v);n.onStart&&n.onStart(),function e(n){var i=(t=n||+new Date)>d?u:t-r,o=i/u,w=m?v.map(function(e,t){return g(i,v[t],b[t],u)}):g(i,v,b,u),x=Math.abs(m?(w[0]-v[0])/b[0]:(w-v)/b);if(a.currentValue=m?w.slice():w,a.completionRate=x,a.durationRate=o,!s){if(f(w,x,o))return void c();if(t>d)return a.currentValue=m?y.slice():y,a.completionRate=1,a.durationRate=1,h(m?y.slice():y,1,1),p(y,1,1),void c();h(w,x,o),l(e)}}(r)}),a.cancel},t.util.requestAnimFrame=l,t.util.cancelAnimFrame=function(){return s.apply(t.window,arguments)},t.runningAnimations=n}(),function(){function e(e,t,r){var n="rgba("+parseInt(e[0]+r*(t[0]-e[0]),10)+","+parseInt(e[1]+r*(t[1]-e[1]),10)+","+parseInt(e[2]+r*(t[2]-e[2]),10);return(n+=","+(e&&t?parseFloat(e[3]+r*(t[3]-e[3])):1))+")"}t.util.animateColor=function(r,n,i,o){var a=new t.Color(r).getSource(),s=new t.Color(n).getSource(),l=o.onComplete,c=o.onChange;return o=o||{},t.util.animate(t.util.object.extend(o,{duration:i||500,startValue:a,endValue:s,byValue:s,easing:function(t,r,n,i){return e(r,n,o.colorEasing?o.colorEasing(t,i):1-Math.cos(t/i*(Math.PI/2)))},onComplete:function(t,r,n){if(l)return l(e(s,s,0),r,n)},onChange:function(t,r,n){if(c){if(Array.isArray(t))return c(e(t,t,0),r,n);c(t,r,n)}}}))}}(),function(){function e(e,t,r,n){return e<Math.abs(t)?(e=t,n=r/4):n=0===t&&0===e?r/(2*Math.PI)*Math.asin(1):r/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:r,s:n}}function r(e,t,r){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*r-e.s)*(2*Math.PI)/e.p)}function n(e,t,r,n){return r-i(n-e,0,r,n)+t}function i(e,t,r,n){return(e/=n)<1/2.75?r*(7.5625*e*e)+t:e<2/2.75?r*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?r*(7.5625*(e-=2.25/2.75)*e+.9375)+t:r*(7.5625*(e-=2.625/2.75)*e+.984375)+t}t.util.ease={easeInQuad:function(e,t,r,n){return r*(e/=n)*e+t},easeOutQuad:function(e,t,r,n){return-r*(e/=n)*(e-2)+t},easeInOutQuad:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,r,n){return r*(e/=n)*e*e+t},easeOutCubic:function(e,t,r,n){return r*((e=e/n-1)*e*e+1)+t},easeInOutCubic:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,r,n){return r*(e/=n)*e*e*e+t},easeOutQuart:function(e,t,r,n){return-r*((e=e/n-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e*e+t:-r/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,r,n){return r*(e/=n)*e*e*e*e+t},easeOutQuint:function(e,t,r,n){return r*((e=e/n-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,r,n){return(e/=n/2)<1?r/2*e*e*e*e*e+t:r/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,r,n){return-r*Math.cos(e/n*(Math.PI/2))+r+t},easeOutSine:function(e,t,r,n){return r*Math.sin(e/n*(Math.PI/2))+t},easeInOutSine:function(e,t,r,n){return-r/2*(Math.cos(Math.PI*e/n)-1)+t},easeInExpo:function(e,t,r,n){return 0===e?t:r*Math.pow(2,10*(e/n-1))+t},easeOutExpo:function(e,t,r,n){return e===n?t+r:r*(1-Math.pow(2,-10*e/n))+t},easeInOutExpo:function(e,t,r,n){return 0===e?t:e===n?t+r:(e/=n/2)<1?r/2*Math.pow(2,10*(e-1))+t:r/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,r,n){return-r*(Math.sqrt(1-(e/=n)*e)-1)+t},easeOutCirc:function(e,t,r,n){return r*Math.sqrt(1-(e=e/n-1)*e)+t},easeInOutCirc:function(e,t,r,n){return(e/=n/2)<1?-r/2*(Math.sqrt(1-e*e)-1)+t:r/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(t,n,i,o){var a=0;return 0===t?n:1===(t/=o)?n+i:(a||(a=.3*o),-r(e(i,i,a,1.70158),t,o)+n)},easeOutElastic:function(t,r,n,i){var o=0;if(0===t)return r;if(1===(t/=i))return r+n;o||(o=.3*i);var a=e(n,n,o,1.70158);return a.a*Math.pow(2,-10*t)*Math.sin((t*i-a.s)*(2*Math.PI)/a.p)+a.c+r},easeInOutElastic:function(t,n,i,o){var a=0;if(0===t)return n;if(2===(t/=o/2))return n+i;a||(a=o*(.3*1.5));var s=e(i,i,a,1.70158);return t<1?-.5*r(s,t,o)+n:s.a*Math.pow(2,-10*(t-=1))*Math.sin((t*o-s.s)*(2*Math.PI)/s.p)*.5+s.c+n},easeInBack:function(e,t,r,n,i){return void 0===i&&(i=1.70158),r*(e/=n)*e*((i+1)*e-i)+t},easeOutBack:function(e,t,r,n,i){return void 0===i&&(i=1.70158),r*((e=e/n-1)*e*((i+1)*e+i)+1)+t},easeInOutBack:function(e,t,r,n,i){return void 0===i&&(i=1.70158),(e/=n/2)<1?r/2*(e*e*((1+(i*=1.525))*e-i))+t:r/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},easeInBounce:n,easeOutBounce:i,easeInOutBounce:function(e,t,r,o){return e<o/2?.5*n(2*e,0,r,o)+t:.5*i(2*e-o,0,r,o)+.5*r+t}}}(),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.object.clone,i=t.util.toFixed,o=t.util.parseUnit,a=t.util.multiplyTransformMatrices,s={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},l={stroke:"strokeOpacity",fill:"fillOpacity"},c="font-size",u="clip-path";function d(e){return e in s?s[e]:e}function h(e,r,n,i){var s,l=Array.isArray(r);if("fill"!==e&&"stroke"!==e||"none"!==r){if("strokeUniform"===e)return"non-scaling-stroke"===r;if("strokeDashArray"===e)r="none"===r?null:r.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)r=n&&n.transformMatrix?a(n.transformMatrix,t.parseTransformAttribute(r)):t.parseTransformAttribute(r);else if("visible"===e)r="none"!==r&&"hidden"!==r,n&&!1===n.visible&&(r=!1);else if("opacity"===e)r=parseFloat(r),n&&typeof n.opacity<"u"&&(r*=n.opacity);else if("textAnchor"===e)r="start"===r?"left":"end"===r?"right":"center";else if("charSpacing"===e)s=o(r,i)/i*1e3;else if("paintFirst"===e){var c=r.indexOf("fill"),u=r.indexOf("stroke");r="fill",(c>-1&&u>-1&&u<c||-1===c&&u>-1)&&(r="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return r;if("imageSmoothing"===e)return"optimizeQuality"===r;s=l?r.map(o):o(r,i)}}else r="";return!l&&isNaN(s)?r:s}function f(e){return new RegExp("^("+e.join("|")+")\\b","i")}function p(e,t){var r,n,i,o,a=[];for(i=0,o=t.length;i<o;i++)r=t[i],n=e.getElementsByTagName(r),a=a.concat(Array.prototype.slice.call(n));return a}function g(e,t){var r,n=!0;return(r=m(e,t.pop()))&&t.length&&(n=function(e,t){for(var r,n=!0;e.parentNode&&1===e.parentNode.nodeType&&t.length;)n&&(r=t.pop()),n=m(e=e.parentNode,r);return 0===t.length}(e,t)),r&&n&&0===t.length}function m(e,t){var r,n,i=e.nodeName,o=e.getAttribute("class"),a=e.getAttribute("id");if(r=new RegExp("^"+i,"i"),t=t.replace(r,""),a&&t.length&&(r=new RegExp("#"+a+"(?![a-zA-Z\\-]+)","i"),t=t.replace(r,"")),o&&t.length)for(n=(o=o.split(" ")).length;n--;)r=new RegExp("\\."+o[n]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(r,"");return 0===t.length}function v(e,t){var r;if(e.getElementById&&(r=e.getElementById(t)),r)return r;var n,i,o,a=e.getElementsByTagName("*");for(i=0,o=a.length;i<o;i++)if(t===(n=a[i]).getAttribute("id"))return n}t.svgValidTagNamesRegEx=f(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=f(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=f(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=f(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,r,n){e[n]=Math.tan(t.util.degreesToRadians(r[0]))}var r=t.iMatrix,n=t.reNum,i=t.commaWsp,o="(?:(?:(matrix)\\s*\\(\\s*("+n+")"+i+"("+n+")"+i+"("+n+")"+i+"("+n+")"+i+"("+n+")"+i+"("+n+")\\s*\\))|(?:(translate)\\s*\\(\\s*("+n+")(?:"+i+"("+n+"))?\\s*\\))|(?:(scale)\\s*\\(\\s*("+n+")(?:"+i+"("+n+"))?\\s*\\))|(?:(rotate)\\s*\\(\\s*("+n+")(?:"+i+"("+n+")"+i+"("+n+"))?\\s*\\))|(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))|(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\)))",a=new RegExp("^\\s*(?:(?:"+o+"(?:"+i+"*"+o+")*)?)\\s*$"),s=new RegExp(o,"g");return function(n){var i=r.concat(),l=[];if(!n||n&&!a.test(n))return i;n.replace(s,function(n){var a=new RegExp(o).exec(n).filter(function(e){return!!e}),s=a[1],c=a.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(i,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,r){var n=t.util.cos(r[0]),i=t.util.sin(r[0]),o=0,a=0;3===r.length&&(o=r[1],a=r[2]),e[0]=n,e[1]=i,e[2]=-i,e[3]=n,e[4]=o-(n*o-i*a),e[5]=a-(i*o+n*a)}(i,c);break;case"scale":!function(e,t){var r=t[0],n=2===t.length?t[1]:t[0];e[0]=r,e[3]=n}(i,c);break;case"skewX":e(i,c,2);break;case"skewY":e(i,c,1);break;case"matrix":i=c}l.push(i.concat()),i=r.concat()});for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var y=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function b(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var r,n,i,a,s,l,c=e.getAttribute("viewBox"),u=1,d=1,h=e.getAttribute("width"),f=e.getAttribute("height"),p=e.getAttribute("x")||0,g=e.getAttribute("y")||0,m=e.getAttribute("preserveAspectRatio")||"",v=!c||!(c=c.match(y)),b=!h||!f||"100%"===h||"100%"===f,w=v&&b,x={},C="",_=0,S=0;if(x.width=0,x.height=0,x.toBeParsed=w,v&&(p||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") ",s=(e.getAttribute("transform")||"")+C,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(v)return x.width=o(h),x.height=o(f),x;if(r=-parseFloat(c[1]),n=-parseFloat(c[2]),i=parseFloat(c[3]),a=parseFloat(c[4]),x.minX=r,x.minY=n,x.viewBoxWidth=i,x.viewBoxHeight=a,b?(x.width=i,x.height=a):(x.width=o(h),x.height=o(f),u=x.width/i,d=x.height/a),"none"!==(m=t.util.parsePreserveAspectRatioAttribute(m)).alignX&&("meet"===m.meetOrSlice&&(d=u=u>d?d:u),"slice"===m.meetOrSlice&&(d=u=u>d?u:d),_=x.width-i*u,S=x.height-a*u,"Mid"===m.alignX&&(_/=2),"Mid"===m.alignY&&(S/=2),"Min"===m.alignX&&(_=0),"Min"===m.alignY&&(S=0)),1===u&&1===d&&0===r&&0===n&&0===p&&0===g)return x;if((p||g)&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") "),s=C+" matrix("+u+" 0 0 "+d+" "+(r*u+_)+" "+(n*d+S)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function w(e,t){var r="xlink:href",n=v(e,t.getAttribute(r).slice(1));if(n&&n.getAttribute(r)&&w(e,n),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach(function(e){n&&!t.hasAttribute(e)&&n.hasAttribute(e)&&t.setAttribute(e,n.getAttribute(e))}),!t.children.length)for(var i=n.cloneNode(!0);i.firstChild;)t.appendChild(i.firstChild);t.removeAttribute(r)}t.parseSVGDocument=function(e,r,i,o){if(e){!function(e){for(var r=p(e,["use","svg:use"]),n=0;r.length&&n<r.length;){var i=r[n],o=i.getAttribute("xlink:href")||i.getAttribute("href");if(null===o)return;var a,s,l,c,u=o.slice(1),d=i.getAttribute("x")||0,h=i.getAttribute("y")||0,f=v(e,u).cloneNode(!0),g=(f.getAttribute("transform")||"")+" translate("+d+", "+h+")",m=r.length,y=t.svgNS;if(b(f),/^svg$/i.test(f.nodeName)){var w=f.ownerDocument.createElementNS(y,"g");for(s=0,c=(l=f.attributes).length;s<c;s++)a=l.item(s),w.setAttributeNS(y,a.nodeName,a.nodeValue);for(;f.firstChild;)w.appendChild(f.firstChild);f=w}for(s=0,c=(l=i.attributes).length;s<c;s++)"x"!==(a=l.item(s)).nodeName&&"y"!==a.nodeName&&"xlink:href"!==a.nodeName&&"href"!==a.nodeName&&("transform"===a.nodeName?g=a.nodeValue+" "+g:f.setAttribute(a.nodeName,a.nodeValue));f.setAttribute("transform",g),f.setAttribute("instantiated_by_use","1"),f.removeAttribute("id"),i.parentNode.replaceChild(f,i),r.length===m&&n++}}(e);var a,s,l=t.Object.__uid++,c=b(e),u=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===u.length&&t.isLikelyNode){var d=[];for(a=0,s=(u=e.selectNodes('//*[name(.)!="svg"]')).length;a<s;a++)d[a]=u[a];u=d}var h=u.filter(function(e){return b(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)});if(!h||h&&!h.length)return void(r&&r([],{}));var f={};u.filter(function(e){return"clipPath"===e.nodeName.replace("svg:","")}).forEach(function(e){var r=e.getAttribute("id");f[r]=t.util.toArray(e.getElementsByTagName("*")).filter(function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))})}),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=f,t.parseElements(h,function(e,n){r&&(r(e,c,n,u),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])},n(c),i,o)}};var x=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");r(t,{parseFontDeclaration:function(e,t){var r=e.match(x);if(r){var n=r[1],i=r[3],a=r[4],s=r[5],l=r[6];n&&(t.fontStyle=n),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),a&&(t.fontSize=o(a)),l&&(t.fontFamily=l),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,r=p(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,i={};for(n=r.length;n--;)(t=r[n]).getAttribute("xlink:href")&&w(e,t),i[t.getAttribute("id")]=t;return i},parseAttributes:function(e,n,a){if(e){var s,f,p,m={};typeof a>"u"&&(a=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,n,a));var v=n.reduce(function(t,r){return(s=e.getAttribute(r))&&(t[r]=s),t},{}),y=r(function(e,r){var n={};for(var i in t.cssRules[r])if(g(e,i.split(" ")))for(var o in t.cssRules[r][i])n[o]=t.cssRules[r][i][o];return n}(e,a),t.parseStyleAttribute(e));v=r(v,y),y[u]&&e.setAttribute(u,y[u]),f=p=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,v[c]&&(v[c]=f=o(v[c],p));var b,w,x={};for(var C in v)w=h(b=d(C),v[C],m,f),x[b]=w;x&&x.font&&t.parseFontDeclaration(x.font,x);var _=r(m,x);return t.svgValidParentsRegEx.test(e.nodeName)?_:function(e){for(var r in l)if(!(typeof e[l[r]]>"u"||""===e[r])){if(typeof e[r]>"u"){if(!t.Object.prototype[r])continue;e[r]=t.Object.prototype[r]}if(0!==e[r].indexOf("url(")){var n=new t.Color(e[r]);e[r]=n.setAlpha(i(n.getAlpha()*e[l[r]],2)).toRgba()}}return e}(_)}},parseElements:function(e,r,n,i,o){new t.ElementsParser(e,r,n,i,o).parse()},parseStyleAttribute:function(e){var t={},r=e.getAttribute("style");return r&&("string"==typeof r?function(e,t){var r,n;e.replace(/;\s*$/,"").split(";").forEach(function(e){var i=e.split(":");r=i[0].trim().toLowerCase(),n=i[1].trim(),t[r]=n})}(r,t):function(e,t){var r,n;for(var i in e)typeof e[i]>"u"||(r=i.toLowerCase(),n=e[i],t[r]=n)}(r,t)),t},parsePointsAttribute:function(e){if(!e)return null;var t,r,n=[];for(t=0,r=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<r;t+=2)n.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return n},getCSSRules:function(e){var r,n,i=e.getElementsByTagName("style"),o={};for(r=0,n=i.length;r<n;r++){var a=i[r].textContent;""!==(a=a.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&a.split("}").filter(function(e){return e.trim()}).forEach(function(e){var i=e.split("{"),a={},s=i[1].trim().split(";").filter(function(e){return e.trim()});for(r=0,n=s.length;r<n;r++){var l=s[r].split(":"),c=l[0].trim(),u=l[1].trim();a[c]=u}(e=i[0].trim()).split(",").forEach(function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(o[e]?t.util.object.extend(o[e],a):o[e]=t.util.object.clone(a))})})}return o},loadSVGFromURL:function(e,r,n,i){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var o=e.responseXML;if(!o||!o.documentElement)return r&&r(null),!1;t.parseSVGDocument(o.documentElement,function(e,t,n,i){r&&r(e,t,n,i)},n,i)}})},loadSVGFromString:function(e,r,n,i){var o=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(o.documentElement,function(e,t,n,i){r(e,t,n,i)},n,i)}})}(e),t.ElementsParser=function(e,t,r,n,i,o){this.elements=e,this.callback=t,this.options=r,this.reviver=n,this.svgUid=r&&r.svgUid||0,this.parsingOptions=i,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},function(e){e.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},e.createObjects=function(){var e=this;this.elements.forEach(function(t,r){t.setAttribute("svgUid",e.svgUid),e.createObject(t,r)})},e.findTag=function(e){return t[t.util.string.capitalize(e.tagName.replace("svg:",""))]},e.createObject=function(e,r){var n=this.findTag(e);if(n&&n.fromElement)try{n.fromElement(e,this.createCallback(r,e),this.options)}catch(e){t.log(e)}else this.checkIfDone()},e.createCallback=function(e,r){var n=this;return function(i){var o;n.resolveGradient(i,r,"fill"),n.resolveGradient(i,r,"stroke"),i instanceof t.Image&&i._originalElement&&(o=i.parsePreserveAspectRatioAttribute(r)),i._removeTransformMatrix(o),n.resolveClipPath(i,r),n.reviver&&n.reviver(r,i),n.instances[e]=i,n.checkIfDone()}},e.extractPropertyDefinition=function(e,r,n){var i=e[r],o=this.regexUrl;if(o.test(i)){o.lastIndex=0;var a=o.exec(i)[1];return o.lastIndex=0,t[n][this.svgUid][a]}},e.resolveGradient=function(e,r,n){var i=this.extractPropertyDefinition(e,n,"gradientDefs");if(i){var o=r.getAttribute(n+"-opacity"),a=t.Gradient.fromElement(i,e,o,this.options);e.set(n,a)}},e.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},e.resolveClipPath=function(e,r){var n,i,o,a,s=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(s){o=[],i=t.util.invertTransform(e.calcTransformMatrix());for(var l=s[0].parentNode,c=r;c.parentNode&&c.getAttribute("clip-path")!==e.clipPath;)c=c.parentNode;c.parentNode.appendChild(l);for(var u=0;u<s.length;u++)n=s[u],this.findTag(n).fromElement(n,this.createClipPathCallback(e,o),this.options);s=1===o.length?o[0]:new t.Group(o),a=t.util.multiplyTransformMatrices(i,s.calcTransformMatrix()),s.clipPath&&this.resolveClipPath(s,c);var d=t.util.qrDecompose(a);s.flipX=!1,s.flipY=!1,s.set("scaleX",d.scaleX),s.set("scaleY",d.scaleY),s.angle=d.angle,s.skewX=d.skewX,s.skewY=0,s.setPositionByOrigin({x:d.translateX,y:d.translateY},"center","center"),e.clipPath=s}else delete e.clipPath},e.checkIfDone=function(){0===--this.numElements&&(this.instances=this.instances.filter(function(e){return null!=e}),this.callback(this.instances,this.elements))}}(t.ElementsParser.prototype),function(e){var t=e.fabric||(e.fabric={});function r(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=r,r.prototype={type:"point",constructor:r,add:function(e){return new r(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new r(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new r(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new r(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new r(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new r(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return typeof t>"u"&&(t=.5),t=Math.max(Math.min(1,t),0),new r(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,r=this.y-e.y;return Math.sqrt(t*t+r*r)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new r(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new r(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,r=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=r},clone:function(){return new r(this.x,this.y)}})}(e),function(e){var t=e.fabric||(e.fabric={});function r(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=r,t.Intersection.prototype={constructor:r,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,n,i,o){var a,s=(o.x-i.x)*(e.y-i.y)-(o.y-i.y)*(e.x-i.x),l=(n.x-e.x)*(e.y-i.y)-(n.y-e.y)*(e.x-i.x),c=(o.y-i.y)*(n.x-e.x)-(o.x-i.x)*(n.y-e.y);if(0!==c){var u=s/c,d=l/c;0<=u&&u<=1&&0<=d&&d<=1?(a=new r("Intersection")).appendPoint(new t.Point(e.x+u*(n.x-e.x),e.y+u*(n.y-e.y))):a=new r}else a=new r(0===s||0===l?"Coincident":"Parallel");return a},t.Intersection.intersectLinePolygon=function(e,t,n){var i,o,a,s,l=new r,c=n.length;for(s=0;s<c;s++)i=n[s],o=n[(s+1)%c],a=r.intersectLineLine(e,t,i,o),l.appendPoints(a.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var n,i=new r,o=e.length;for(n=0;n<o;n++){var a=e[n],s=e[(n+1)%o],l=r.intersectLinePolygon(a,s,t);i.appendPoints(l.points)}return i.points.length>0&&(i.status="Intersection"),i},t.Intersection.intersectPolygonRectangle=function(e,n,i){var o=n.min(i),a=n.max(i),s=new t.Point(a.x,o.y),l=new t.Point(o.x,a.y),c=r.intersectLinePolygon(o,s,e),u=r.intersectLinePolygon(s,a,e),d=r.intersectLinePolygon(a,l,e),h=r.intersectLinePolygon(l,o,e),f=new r;return f.appendPoints(c.points),f.appendPoints(u.points),f.appendPoints(d.points),f.appendPoints(h.points),f.points.length>0&&(f.status="Intersection"),f})}(e),function(e){var t=e.fabric||(e.fabric={});function r(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function n(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=r,t.Color.prototype={_tryParsingColor:function(e){var t;e in r.colorNameMap&&(e=r.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=r.sourceFromHex(e)),t||(t=r.sourceFromRgb(e)),t||(t=r.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,r,n){e/=255,r/=255,n/=255;var i,o,a,s=t.util.array.max([e,r,n]),l=t.util.array.min([e,r,n]);if(a=(s+l)/2,s===l)i=o=0;else{var c=s-l;switch(o=a>.5?c/(2-s-l):c/(s+l),s){case e:i=(r-n)/c+(r<n?6:0);break;case r:i=(n-e)/c+2;break;case n:i=(e-r)/c+4}i/=6}return[Math.round(360*i),Math.round(100*o),Math.round(100*a)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,r,n=this.getSource();return e=1===(e=n[0].toString(16)).length?"0"+e:e,t=1===(t=n[1].toString(16)).length?"0"+t:t,r=1===(r=n[2].toString(16)).length?"0"+r:r,e.toUpperCase()+t.toUpperCase()+r.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),r=e[3];return this.setSource([t,t,t,r]),this},toBlackWhite:function(e){var t=this.getSource(),r=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),n=t[3];return e=e||127,r=Number(r)<Number(e)?0:255,this.setSource([r,r,r,n]),this},overlayWith:function(e){e instanceof r||(e=new r(e));var t,n=[],i=this.getAlpha(),o=this.getSource(),a=e.getSource();for(t=0;t<3;t++)n.push(Math.round(.5*o[t]+.5*a[t]));return n[3]=i,this.setSource(n),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},t.Color.fromRgb=function(e){return r.fromSource(r.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(r.reRGBa);if(t){var n=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),i=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),o=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(n,10),parseInt(i,10),parseInt(o,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=r.fromRgb,t.Color.fromHsl=function(e){return r.fromSource(r.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(r.reHSLa);if(t){var i,o,a,s=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)i=o=a=c;else{var u=c<=.5?c*(l+1):c+l-c*l,d=2*c-u;i=n(d,u,s+1/3),o=n(d,u,s),a=n(d,u,s-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*a),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=r.fromHsl,t.Color.fromHex=function(e){return r.fromSource(r.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(r.reHex)){var t=e.slice(e.indexOf("#")+1),n=3===t.length||4===t.length,i=8===t.length||4===t.length,o=n?t.charAt(0)+t.charAt(0):t.substring(0,2),a=n?t.charAt(1)+t.charAt(1):t.substring(2,4),s=n?t.charAt(2)+t.charAt(2):t.substring(4,6),l=i?n?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(o,16),parseInt(a,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new r;return t.setSource(e),t})}(e),function(e){var t=e.fabric||(e.fabric={}),r=["e","se","s","sw","w","nw","n","ne","e"],n=["ns","nesw","ew","nwse"],i={},o="left",a="top",s="right",l="bottom",c="center",u={top:l,bottom:a,left:s,right:o,center:c},d=t.util.radiansToDegrees,h=Math.sign||function(e){return(e>0)-(e<0)||+e};function f(e,t){var r=e.angle+d(Math.atan2(t.y,t.x))+360;return Math.round(r%360/45)}function p(e,r){var n=r.transform.target,i=n.canvas,o=t.util.object.clone(r);o.target=n,i&&i.fire("object:"+e,o),n.fire(e,r)}function g(e,t){var r=t.canvas,n=e[r.uniScaleKey];return r.uniformScaling&&!n||!r.uniformScaling&&n}function m(e){return e.originX===c&&e.originY===c}function v(e,t,r){var n=e.lockScalingX,i=e.lockScalingY;return!!(n&&i||!t&&(n||i)&&r||n&&"x"===t||i&&"y"===t)}function y(e,t,r,n){return{e:e,transform:t,pointer:{x:r,y:n}}}function b(e){return function(t,r,n,i){var o=r.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,r.originX,r.originY),l=e(t,r,n,i);return o.setPositionByOrigin(s,r.originX,r.originY),l}}function w(e,t){return function(r,n,i,o){var a=t(r,n,i,o);return a&&p(e,y(r,n,i,o)),a}}function x(e,r,n,i,o){var a=e.target,s=a.controls[e.corner],l=a.canvas.getZoom(),c=a.padding/l,u=a.toLocalPoint(new t.Point(i,o),r,n);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=s.offsetX,u.y-=s.offsetY,u}function C(e){return e.flipX!==e.flipY}function _(e,t,r,n,i){if(0!==e[t]){var o=i/e._getTransformedDimensions()[n]*e[r];e.set(r,o)}}function S(e,t,r,n){var i,c=t.target,u=c._getTransformedDimensions(0,c.skewY),h=x(t,t.originX,t.originY,r,n),f=Math.abs(2*h.x)-u.x,p=c.skewX;f<2?i=0:(i=d(Math.atan2(f/c.scaleX,u.y/c.scaleY)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().y;c.set("skewX",i),_(c,"skewY","scaleY","y",m)}return g}function A(e,t,r,n){var i,c=t.target,u=c._getTransformedDimensions(c.skewX,0),h=x(t,t.originX,t.originY,r,n),f=Math.abs(2*h.y)-u.y,p=c.skewY;f<2?i=0:(i=d(Math.atan2(f/c.scaleY,u.x/c.scaleX)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().x;c.set("skewY",i),_(c,"skewX","scaleX","x",m)}return g}function k(e,t,r,n,i){i=i||{};var o,a,s,l,c,d,f=t.target,p=f.lockScalingX,y=f.lockScalingY,b=i.by,w=g(e,f),C=v(f,b,w),_=t.gestureScale;if(C)return!1;if(_)a=t.scaleX*_,s=t.scaleY*_;else{if(o=x(t,t.originX,t.originY,r,n),c="y"!==b?h(o.x):1,d="x"!==b?h(o.y):1,t.signX||(t.signX=c),t.signY||(t.signY=d),f.lockScalingFlip&&(t.signX!==c||t.signY!==d))return!1;if(l=f._getTransformedDimensions(),w&&!b){var S=Math.abs(o.x)+Math.abs(o.y),A=t.original,k=S/(Math.abs(l.x*A.scaleX/f.scaleX)+Math.abs(l.y*A.scaleY/f.scaleY));a=A.scaleX*k,s=A.scaleY*k}else a=Math.abs(o.x*f.scaleX/l.x),s=Math.abs(o.y*f.scaleY/l.y);m(t)&&(a*=2,s*=2),t.signX!==c&&"y"!==b&&(t.originX=u[t.originX],a*=-1,t.signX=c),t.signY!==d&&"x"!==b&&(t.originY=u[t.originY],s*=-1,t.signY=d)}var E=f.scaleX,I=f.scaleY;return b?("x"===b&&f.set("scaleX",a),"y"===b&&f.set("scaleY",s)):(!p&&f.set("scaleX",a),!y&&f.set("scaleY",s)),E!==f.scaleX||I!==f.scaleY}i.scaleCursorStyleHandler=function(e,t,n){var i=g(e,n),o="";if(0!==t.x&&0===t.y?o="x":0===t.x&&0!==t.y&&(o="y"),v(n,o,i))return"not-allowed";var a=f(n,t);return r[a]+"-resize"},i.skewCursorStyleHandler=function(e,t,r){if(0!==t.x&&r.lockSkewingY||0!==t.y&&r.lockSkewingX)return"not-allowed";var i=f(r,t)%4;return n[i]+"-resize"},i.scaleSkewCursorStyleHandler=function(e,t,r){return e[r.canvas.altActionKey]?i.skewCursorStyleHandler(e,t,r):i.scaleCursorStyleHandler(e,t,r)},i.rotationWithSnapping=w("rotating",b(function(e,t,r,n){var i=t,o=i.target,a=o.translateToOriginPoint(o.getCenterPoint(),i.originX,i.originY);if(o.lockRotation)return!1;var s,l=Math.atan2(i.ey-a.y,i.ex-a.x),c=Math.atan2(n-a.y,r-a.x),u=d(c-l+i.theta);if(o.snapAngle>0){var h=o.snapAngle,f=o.snapThreshold||h,p=Math.ceil(u/h)*h,g=Math.floor(u/h)*h;Math.abs(u-g)<f?u=g:Math.abs(u-p)<f&&(u=p)}return u<0&&(u=360+u),u%=360,s=o.angle!==u,o.angle=u,s})),i.scalingEqually=w("scaling",b(function(e,t,r,n){return k(e,t,r,n)})),i.scalingX=w("scaling",b(function(e,t,r,n){return k(e,t,r,n,{by:"x"})})),i.scalingY=w("scaling",b(function(e,t,r,n){return k(e,t,r,n,{by:"y"})})),i.scalingYOrSkewingX=function(e,t,r,n){return e[t.target.canvas.altActionKey]?i.skewHandlerX(e,t,r,n):i.scalingY(e,t,r,n)},i.scalingXOrSkewingY=function(e,t,r,n){return e[t.target.canvas.altActionKey]?i.skewHandlerY(e,t,r,n):i.scalingX(e,t,r,n)},i.changeWidth=w("resizing",b(function(e,t,r,n){var i=t.target,o=x(t,t.originX,t.originY,r,n),a=i.strokeWidth/(i.strokeUniform?i.scaleX:1),s=m(t)?2:1,l=i.width,c=Math.abs(o.x*s/i.scaleX)-a;return i.set("width",Math.max(c,0)),l!==c})),i.skewHandlerX=function(e,t,r,n){var i,l=t.target,u=l.skewX,d=t.originY;return!l.lockSkewingX&&(0===u?i=x(t,c,c,r,n).x>0?o:s:(u>0&&(i=d===a?o:s),u<0&&(i=d===a?s:o),C(l)&&(i=i===o?s:o)),t.originX=i,w("skewing",b(S))(e,t,r,n))},i.skewHandlerY=function(e,t,r,n){var i,s=t.target,u=s.skewY,d=t.originX;return!s.lockSkewingY&&(0===u?i=x(t,c,c,r,n).y>0?a:l:(u>0&&(i=d===o?a:l),u<0&&(i=d===o?l:a),C(s)&&(i=i===a?l:a)),t.originY=i,w("skewing",b(A))(e,t,r,n))},i.dragHandler=function(e,t,r,n){var i=t.target,o=r-t.offsetX,a=n-t.offsetY,s=!i.get("lockMovementX")&&i.left!==o,l=!i.get("lockMovementY")&&i.top!==a;return s&&i.set("left",o),l&&i.set("top",a),(s||l)&&p("moving",y(e,t,r,n)),s||l},i.scaleOrSkewActionName=function(e,t,r){var n=e[r.canvas.altActionKey];return 0===t.x?n?"skewX":"scaleY":0===t.y?n?"skewY":"scaleX":void 0},i.rotationStyleHandler=function(e,t,r){return r.lockRotation?"not-allowed":t.cursorStyle},i.fireEvent=p,i.wrapWithFixedAnchor=b,i.wrapWithFireEvent=w,i.getLocalPoint=x,t.controlsUtils=i}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.degreesToRadians,n=t.controlsUtils;n.renderCircleControl=function(e,t,r,n,i){n=n||{};var o,a=this.sizeX||n.cornerSize||i.cornerSize,s=this.sizeY||n.cornerSize||i.cornerSize,l=typeof n.transparentCorners<"u"?n.transparentCorners:i.transparentCorners,c=l?"stroke":"fill",u=!l&&(n.cornerStrokeColor||i.cornerStrokeColor),d=t,h=r;e.save(),e.fillStyle=n.cornerColor||i.cornerColor,e.strokeStyle=n.cornerStrokeColor||i.cornerStrokeColor,a>s?(o=a,e.scale(1,s/a),h=r*a/s):s>a?(o=s,e.scale(a/s,1),d=t*s/a):o=a,e.lineWidth=1,e.beginPath(),e.arc(d,h,o/2,0,2*Math.PI,!1),e[c](),u&&e.stroke(),e.restore()},n.renderSquareControl=function(e,t,n,i,o){i=i||{};var a=this.sizeX||i.cornerSize||o.cornerSize,s=this.sizeY||i.cornerSize||o.cornerSize,l=typeof i.transparentCorners<"u"?i.transparentCorners:o.transparentCorners,c=l?"stroke":"fill",u=!l&&(i.cornerStrokeColor||o.cornerStrokeColor),d=a/2,h=s/2;e.save(),e.fillStyle=i.cornerColor||o.cornerColor,e.strokeStyle=i.cornerStrokeColor||o.cornerStrokeColor,e.lineWidth=1,e.translate(t,n),e.rotate(r(o.angle)),e[c+"Rect"](-d,-h,a,s),u&&e.strokeRect(-d,-h,a,s),e.restore()}}(e),function(e){var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var r=e._controlsVisibility;return r&&typeof r[t]<"u"?r[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,r){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},r)},calcCornerCoords:function(e,r,n,i,o){var a,s,l,c,u=o?this.touchSizeX:this.sizeX,d=o?this.touchSizeY:this.sizeY;if(u&&d&&u!==d){var h=Math.atan2(d,u),f=Math.sqrt(u*u+d*d)/2,p=h-t.util.degreesToRadians(e),g=Math.PI/2-h-t.util.degreesToRadians(e);a=f*t.util.cos(p),s=f*t.util.sin(p),l=f*t.util.cos(g),c=f*t.util.sin(g)}else f=.7071067812*(u&&d?u:r),p=t.util.degreesToRadians(45-e),a=l=f*t.util.cos(p),s=c=f*t.util.sin(p);return{tl:{x:n-c,y:i-l},tr:{x:n+a,y:i-s},bl:{x:n-a,y:i+s},br:{x:n+c,y:i+l}}},render:function(e,r,n,i,o){"circle"===((i=i||{}).cornerStyle||o.cornerStyle)?t.controlsUtils.renderCircleControl.call(this,e,r,n,i,o):t.controlsUtils.renderSquareControl.call(this,e,r,n,i,o)}}}(e),function(){function e(e,r){var n,i,o,a,s=e.getAttribute("style"),l=e.getAttribute("offset")||0;if(l=(l=parseFloat(l)/(/%$/.test(l)?100:1))<0?0:l>1?1:l,s){var c=s.split(/\s*;\s*/);for(""===c[c.length-1]&&c.pop(),a=c.length;a--;){var u=c[a].split(/\s*:\s*/),d=u[0].trim(),h=u[1].trim();"stop-color"===d?n=h:"stop-opacity"===d&&(o=h)}}return n||(n=e.getAttribute("stop-color")||"rgb(0,0,0)"),o||(o=e.getAttribute("stop-opacity")),i=(n=new t.Color(n)).getAlpha(),o=isNaN(parseFloat(o))?1:parseFloat(o),o*=i*r,{offset:l,color:n.toRgb(),opacity:o}}var r=t.util.object.clone;t.Gradient=t.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var r,n=this;Object.keys(e).forEach(function(t){n[t]=e[t]}),this.id?this.id+="_"+t.Object.__uid++:this.id=t.Object.__uid++,r={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(r.r1=e.coords.r1||0,r.r2=e.coords.r2||0),this.coords=r,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var r in e){var n=new t.Color(e[r]);this.colorStops.push({offset:parseFloat(r),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(e){var r={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return t.util.populateWithProperties(this,r,e),r},toSVG:function(e,n){var i,o,a,s,l=r(this.coords,!0),c=(n=n||{},r(this.colorStops,!0)),u=l.r1>l.r2,d=this.gradientTransform?this.gradientTransform.concat():t.iMatrix.concat(),h=-this.offsetX,f=-this.offsetY,p=!!n.additionalTransform,g="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(c.sort(function(e,t){return e.offset-t.offset}),"objectBoundingBox"===g?(h/=e.width,f/=e.height):(h+=e.width/2,f+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(h-=e.pathOffset.x,f-=e.pathOffset.y),d[4]-=h,d[5]-=f,s='id="SVGID_'+this.id+'" gradientUnits="'+g+'"',s+=' gradientTransform="'+(p?n.additionalTransform+" ":"")+t.util.matrixToSVG(d)+'" ',"linear"===this.type?a=["<linearGradient ",s,' x1="',l.x1,'" y1="',l.y1,'" x2="',l.x2,'" y2="',l.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",s,' cx="',u?l.x1:l.x2,'" cy="',u?l.y1:l.y2,'" r="',u?l.r1:l.r2,'" fx="',u?l.x2:l.x1,'" fy="',u?l.y2:l.y1,'">\n']),"radial"===this.type){if(u)for((c=c.concat()).reverse(),i=0,o=c.length;i<o;i++)c[i].offset=1-c[i].offset;var m=Math.min(l.r1,l.r2);if(m>0){var v=m/Math.max(l.r1,l.r2);for(i=0,o=c.length;i<o;i++)c[i].offset+=v*(1-c[i].offset)}}for(i=0,o=c.length;i<o;i++){var y=c[i];a.push("<stop ",'offset="',100*y.offset+"%",'" style="stop-color:',y.color,typeof y.opacity<"u"?";stop-opacity: "+y.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(e){var r,n,i,o=t.util.object.clone(this.coords);if(this.type){for("linear"===this.type?r=e.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(r=e.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),n=0,i=this.colorStops.length;n<i;n++){var a=this.colorStops[n].color,s=this.colorStops[n].opacity,l=this.colorStops[n].offset;typeof s<"u"&&(a=new t.Color(a).setAlpha(s).toRgba()),r.addColorStop(l,a)}return r}}}),t.util.object.extend(t.Gradient,{fromElement:function(r,n,i,o){var a=parseFloat(i)/(/%$/.test(i)?100:1);a=a<0?0:a>1?1:a,isNaN(a)&&(a=1);var s,l,c,u,d=r.getElementsByTagName("stop"),h="userSpaceOnUse"===r.getAttribute("gradientUnits")?"pixels":"percentage",f=r.getAttribute("gradientTransform")||"",p=[],g=0,m=0;for("linearGradient"===r.nodeName||"LINEARGRADIENT"===r.nodeName?(s="linear",l=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(r)):(s="radial",l=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(r)),c=d.length;c--;)p.push(e(d[c],a));return u=t.parseTransformAttribute(f),function(e,t,r,n){var i,o;Object.keys(t).forEach(function(e){"Infinity"===(i=t[e])?o=1:"-Infinity"===i?o=0:(o=parseFloat(t[e],10),"string"==typeof i&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(o*=.01,"pixels"===n&&(("x1"===e||"x2"===e||"r2"===e)&&(o*=r.viewBoxWidth||r.width),("y1"===e||"y2"===e)&&(o*=r.viewBoxHeight||r.height)))),t[e]=o})}(0,l,o,h),"pixels"===h&&(g=-n.left,m=-n.top),new t.Gradient({id:r.getAttribute("id"),type:s,coords:l,colorStops:p,gradientUnits:h,gradientTransform:u,offsetX:g,offsetY:m})}})}(),function(){var e=t.util.toFixed;t.Pattern=t.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,r){if(e||(e={}),this.id=t.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)r&&r(this);else{var n=this;this.source=t.util.createImage(),t.util.loadImage(e.source,function(e,t){n.source=e,r&&r(n,t)},null,this.crossOrigin)}},toObject:function(r){var n,i,o=t.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?n=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(n=this.source.toDataURL()),i={type:"pattern",source:n,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,o),offsetY:e(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},t.util.populateWithProperties(this,i,r),i},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,r=t.width/e.width,n=t.height/e.height,i=this.offsetX/e.width,o=this.offsetY/e.height,a="";return("repeat-x"===this.repeat||"no-repeat"===this.repeat)&&(n=1,o&&(n+=Math.abs(o))),("repeat-y"===this.repeat||"no-repeat"===this.repeat)&&(r=1,i&&(r+=Math.abs(i))),t.src?a=t.src:t.toDataURL&&(a=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+i+'" y="'+o+'" width="'+r+'" height="'+n+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+a+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;return!t||typeof t.src<"u"&&(!t.complete||0===t.naturalWidth||0===t.naturalHeight)?"":e.createPattern(t,this.repeat)}})}(),function(e){var t=e.fabric||(e.fabric={}),r=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var r in"string"==typeof e&&(e=this._parseShadow(e)),e)this[r]=e[r];this.id=t.Object.__uid++},_parseShadow:function(e){var r=e.trim(),n=t.Shadow.reOffsetsAndBlur.exec(r)||[];return{color:(r.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(n[1],10)||0,offsetY:parseFloat(n[2],10)||0,blur:parseFloat(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var n=40,i=40,o=t.Object.NUM_FRACTION_DIGITS,a=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(n=100*r((Math.abs(a.x)+this.blur)/e.width,o)+20,i=100*r((Math.abs(a.y)+this.blur)/e.height,o)+20),e.flipX&&(a.x*=-1),e.flipY&&(a.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+i+'%" height="'+(100+2*i)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+r(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+r(a.x,o)+'" dy="'+r(a.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},r=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(t){this[t]!==r[t]&&(e[t]=this[t])},this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(e),function(){if(t.StaticCanvas)t.warn("fabric.StaticCanvas is already defined.");else{var e=t.util.object.extend,r=t.util.getElementOffset,n=t.util.removeFromArray,i=t.util.toFixed,o=t.util.transformPoint,a=t.util.invertTransform,s=t.util.getNodeCanvas,l=t.util.createCanvasElement,c=new Error("Could not initialize `canvas` element");t.StaticCanvas=t.util.createClass(t.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:t.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var r=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,r),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,r),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,r),t.overlayColor&&this.setOverlayColor(t.overlayColor,r),this.calcOffset()},_isRetinaScaling:function(){return t.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,t.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=t.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,r){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),r.scale(e,e)},calcOffset:function(){return this._offset=r(this.lowerCanvasEl),this},setOverlayImage:function(e,t,r){return this.__setBgOverlayImage("overlayImage",e,t,r)},setBackgroundImage:function(e,t,r){return this.__setBgOverlayImage("backgroundImage",e,t,r)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,r,n,i){return"string"==typeof r?t.util.loadImage(r,function(r,o){if(r){var a=new t.Image(r,i);this[e]=a,a.canvas=this}n&&n(r,o)},this,i&&i.crossOrigin):(i&&r.setOptions(i),this[e]=r,r&&(r.canvas=this),n&&n(r,!1)),this},__setBgOverlayColor:function(e,t,r){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,r),this},_createCanvasElement:function(){var e=l();if(!e||(e.style||(e.style={}),typeof e.getContext>"u"))throw c;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=t.util.getById(e)||this._createCanvasElement(),t.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var r;for(var n in t=t||{},e)r=e[n],t.cssOnly||(this._setBackstoreDimension(n,e[n]),r+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(n,r);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,r,n,i=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=e,r=0,n=this._objects.length;r<n;r++)(t=this._objects[r]).group||t.setCoords(!0);return i&&i.setCoords(),o&&o.setCoords(!0),a&&a.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var r=e,n=this.viewportTransform.slice(0);e=o(e,a(this.viewportTransform)),n[0]=t,n[3]=t;var i=o(e,n);return n[4]+=r.x-i.x,n[5]+=r.y-i.y,this.setViewportTransform(n)},setZoom:function(e){return this.zoomToPoint(new t.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new t.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=t.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},r=this.width,n=this.height,i=a(this.viewportTransform);return e.tl=o({x:0,y:0},i),e.br=o({x:r,y:n},i),e.tr=new t.Point(e.br.x,e.tl.y),e.bl=new t.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,r){var n=this.viewportTransform,i=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),t.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this._renderObjects(e,r),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),i&&(i.canvas=this,i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,r=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",r.transform(e),e.scale(1/r.zoomX,1/r.zoomY),e.drawImage(r._cacheCanvas,-r.cacheTranslationX,-r.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var r,n;for(r=0,n=t.length;r<n;++r)t[r]&&t[r].render(e)},_renderBackgroundOrOverlay:function(e,t){var r=this[t+"Color"],n=this[t+"Image"],i=this.viewportTransform,o=this[t+"Vpt"];if(r||n){if(r){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=r.toLive?r.toLive(e,this):r,o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.transform(1,0,0,1,r.offsetX||0,r.offsetY||0);var a=r.gradientTransform||r.patternTransform;a&&e.transform(a[0],a[1],a[2],a[3],a[4],a[5]),e.fill(),e.restore()}n&&(e.save(),o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),n.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new t.Point(this.width/2,this.height/2)},centerObjectH:function(e){return this._centerObject(e,new t.Point(this.getCenterPoint().x,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new t.Point(e.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(e){var t=this.getCenterPoint();return this._centerObject(e,t)},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var r=this.getVpCenter();return this._centerObject(e,new t.Point(r.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var r=this.getVpCenter();return this._centerObject(e,new t.Point(e.getCenterPoint().x,r.y))},getVpCenter:function(){var e=this.getCenterPoint(),t=a(this.viewportTransform);return o(e,t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(r,n){var i=this.clipPath,o={version:t.version,objects:this._toObjects(r,n)};return i&&!i.excludeFromExport&&(o.clipPath=this._toObject(this.clipPath,r,n)),e(o,this.__serializeBgOverlay(r,n)),t.util.populateWithProperties(this,o,n),o},_toObjects:function(e,t){return this._objects.filter(function(e){return!e.excludeFromExport}).map(function(r){return this._toObject(r,e,t)},this)},_toObject:function(e,t,r){var n;this.includeDefaultValues||(n=e.includeDefaultValues,e.includeDefaultValues=!1);var i=e[t](r);return this.includeDefaultValues||(e.includeDefaultValues=n),i},__serializeBgOverlay:function(e,t){var r={},n=this.backgroundImage,i=this.overlayImage,o=this.backgroundColor,a=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(r.background=o.toObject(t)):o&&(r.background=o),a&&a.toObject?a.excludeFromExport||(r.overlay=a.toObject(t)):a&&(r.overlay=a),n&&!n.excludeFromExport&&(r.backgroundImage=this._toObject(n,e,t)),i&&!i.excludeFromExport&&(r.overlayImage=this._toObject(i,e,t)),r},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var r=[];return this._setSVGPreamble(r,e),this._setSVGHeader(r,e),this.clipPath&&r.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(r,"background"),this._setSVGBgOverlayImage(r,"backgroundImage",t),this._setSVGObjects(r,t),this.clipPath&&r.push("</g>\n"),this._setSVGBgOverlayColor(r,"overlay"),this._setSVGBgOverlayImage(r,"overlayImage",t),r.push("</svg>"),r.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,r){var n,o=r.width||this.width,a=r.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',l=t.Object.NUM_FRACTION_DIGITS;r.viewBox?s='viewBox="'+r.viewBox.x+" "+r.viewBox.y+" "+r.viewBox.width+" "+r.viewBox.height+'" ':this.svgViewportTransformation&&(n=this.viewportTransform,s='viewBox="'+i(-n[4]/n[0],l)+" "+i(-n[5]/n[3],l)+" "+i(this.width/n[0],l)+" "+i(this.height/n[3],l)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',o,'" ','height="',a,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",t.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(r),"</defs>\n")},createSVGClipPathMarkup:function(e){var r=this.clipPath;return r?(r.clipPathId="CLIPPATH_"+t.Object.__uid++,'<clipPath id="'+r.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map(function(r){var n=e[r+"Color"];if(n&&n.toLive){var i=e[r+"Vpt"],o=e.viewportTransform,a={width:e.width/(i?o[0]:1),height:e.height/(i?o[3]:1)};return n.toSVG(a,{additionalTransform:i?t.util.matrixToSVG(o):""})}}).join("")},createSVGFontFacesMarkup:function(){var e,r,n,i,o,a,s,l,c="",u={},d=t.fontPaths,h=[];for(this._objects.forEach(function e(t){h.push(t),t._objects&&t._objects.forEach(e)}),s=0,l=h.length;s<l;s++)if(r=(e=h[s]).fontFamily,-1!==e.type.indexOf("text")&&!u[r]&&d[r]&&(u[r]=!0,e.styles))for(o in n=e.styles)for(a in i=n[o])!u[r=i[a].fontFamily]&&d[r]&&(u[r]=!0);for(var f in u)c+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",d[f],"');\n","\t\t}\n"].join("");return c&&(c=['\t<style type="text/css">',"<![CDATA[\n",c,"]]>","</style>\n"].join("")),c},_setSVGObjects:function(e,t){var r,n,i,o=this._objects;for(n=0,i=o.length;n<i;n++)!(r=o[n]).excludeFromExport&&this._setSVGObject(e,r,t)},_setSVGObject:function(e,t,r){e.push(t.toSVG(r))},_setSVGBgOverlayImage:function(e,t,r){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(r))},_setSVGBgOverlayColor:function(e,r){var n=this[r+"Color"],i=this.viewportTransform,o=this.width,a=this.height;if(n)if(n.toLive){var s=n.repeat,l=t.util.invertTransform(i),c=this[r+"Vpt"]?t.util.matrixToSVG(l):"";e.push('<rect transform="'+c+" translate(",o/2,",",a/2,')"',' x="',n.offsetX-o/2,'" y="',n.offsetY-a/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?n.source.width:o,'" height="',"repeat-x"===s||"no-repeat"===s?n.source.height:a,'" fill="url(#SVGID_'+n.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',n,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,r,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(t=(i=o._objects).length;t--;)r=i[t],n(this._objects,r),this._objects.unshift(r);else n(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,r,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(i=o._objects,t=0;t<i.length;t++)r=i[t],n(this._objects,r),this._objects.push(r);else n(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var r,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(s=l._objects,r=0;r<s.length;r++)i=s[r],(o=this._objects.indexOf(i))>0+c&&(a=o-1,n(this._objects,i),this._objects.splice(a,0,i)),c++;else 0!==(o=this._objects.indexOf(e))&&(a=this._findNewLowerIndex(e,o,t),n(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,r){var n,i;if(r){for(n=t,i=t-1;i>=0;--i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){n=i;break}}else n=t-1;return n},bringForward:function(e,t){if(!e)return this;var r,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(r=(s=l._objects).length;r--;)i=s[r],(o=this._objects.indexOf(i))<this._objects.length-1-c&&(a=o+1,n(this._objects,i),this._objects.splice(a,0,i)),c++;else(o=this._objects.indexOf(e))!==this._objects.length-1&&(a=this._findNewUpperIndex(e,o,t),n(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,r){var n,i,o;if(r){for(n=t,i=t+1,o=this._objects.length;i<o;++i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){n=i;break}}else n=t+1;return n},moveTo:function(e,t){return n(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(t.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),t.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),t.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(t.StaticCanvas.prototype,t.Observable),e(t.StaticCanvas.prototype,t.Collection),e(t.StaticCanvas.prototype,t.DataURLExporter),e(t.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=l();if(!t||!t.getContext)return null;var r=t.getContext("2d");return r&&"setLineDash"===e?typeof r.setLineDash<"u":null}}),t.StaticCanvas.prototype.toJSON=t.StaticCanvas.prototype.toObject,t.isLikelyNode&&(t.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},t.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),t.BaseBrush=t.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(e){e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,r=this.shadow,n=e.contextTop,i=e.getZoom();e&&e._isRetinaScaling()&&(i*=t.devicePixelRatio),n.shadowColor=r.color,n.shadowBlur=r.blur*i,n.shadowOffsetX=r.offsetX*i,n.shadowOffsetY=r.offsetY*i}},needsFullRender:function(){return new t.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),t.PencilBrush=t.util.createClass(t.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(e){this.canvas=e,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(e,t,r){var n=t.midPointFrom(r);return e.quadraticCurveTo(t.x,t.y,n.x,n.y),n},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var r=this._points,n=r.length,i=this.canvas.contextTop;this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,r[n-2],r[n-1],!0),i.stroke(),i.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var r=new t.Point(e.x,e.y);this._reset(),this._addPoint(r),this.canvas.contextTop.moveTo(r.x,r.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(e){var r=new t.Point(e.x,e.y);return this._addPoint(r)},_render:function(e){var r,n,i=this._points[0],o=this._points[1];if(e=e||this.canvas.contextTop,this._saveAndTransform(e),e.beginPath(),2===this._points.length&&i.x===o.x&&i.y===o.y){var a=this.width/1e3;i=new t.Point(i.x,i.y),o=new t.Point(o.x,o.y),i.x-=a,o.x+=a}for(e.moveTo(i.x,i.y),r=1,n=this._points.length;r<n;r++)this._drawSegment(e,i,o),i=this._points[r],o=this._points[r+1];e.lineTo(i.x,i.y),e.stroke(),e.restore()},convertPointsToSVGPath:function(e){var r=this.width/1e3;return t.util.getSmoothPathFromPoints(e,r)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===t.util.joinPath(e)},createPath:function(e){var r=new t.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,r.shadow=new t.Shadow(this.shadow)),r},decimatePoints:function(e,t){if(e.length<=2)return e;var r,n=this.canvas.getZoom(),i=Math.pow(t/n,2),o=e.length-1,a=e[0],s=[a];for(r=1;r<o-1;r++)Math.pow(a.x-e[r].x,2)+Math.pow(a.y-e[r].y,2)>=i&&(a=e[r],s.push(a));return s.push(e[o]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),t.CircleBrush=t.util.createClass(t.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),r=this.canvas.contextTop;this._saveAndTransform(r),this.dot(r,t),r.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,r=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(r),e=0,t=n.length;e<t;e++)this.dot(r,n[e]);r.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,r,n=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var i=[];for(e=0,r=this.points.length;e<r;e++){var o=this.points[e],a=new t.Circle({radius:o.radius,left:o.x,top:o.y,originX:"center",originY:"center",fill:o.fill});this.shadow&&(a.shadow=new t.Shadow(this.shadow)),i.push(a)}var s=new t.Group(i);s.canvas=this.canvas,this.canvas.fire("before:path:created",{path:s}),this.canvas.add(s),this.canvas.fire("path:created",{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=n,this.canvas.requestRenderAll()},addPoint:function(e){var r=new t.Point(e.x,e.y),n=t.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new t.Color(this.color).setAlpha(t.util.getRandomInt(0,100)/100).toRgba();return r.radius=n,r.fill=i,this.points.push(r),r}}),t.SprayBrush=t.util.createClass(t.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var r=[],n=0,i=this.sprayChunks.length;n<i;n++)for(var o=this.sprayChunks[n],a=0,s=o.length;a<s;a++){var l=new t.Rect({width:o[a].width,height:o[a].width,left:o[a].x+1,top:o[a].y+1,originX:"center",originY:"center",fill:this.color});r.push(l)}this.optimizeOverlapping&&(r=this._getOptimizedRects(r));var c=new t.Group(r);this.shadow&&c.set("shadow",new t.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:c}),this.canvas.add(c),this.canvas.fire("path:created",{path:c}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,r,n,i={};for(r=0,n=e.length;r<n;r++)i[t=e[r].left+""+e[r].top]||(i[t]=e[r]);var o=[];for(t in i)o.push(i[t]);return o},render:function(e){var t,r,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),t=0,r=e.length;t<r;t++){var i=e[t];typeof i.opacity<"u"&&(n.globalAlpha=i.opacity),n.fillRect(i.x,i.y,i.width,i.width)}n.restore()},_render:function(){var e,t,r=this.canvas.contextTop;for(r.fillStyle=this.color,this._saveAndTransform(r),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);r.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var r,n,i,o,a=this.width/2;for(o=0;o<this.density;o++){r=t.util.getRandomInt(e.x-a,e.x+a),n=t.util.getRandomInt(e.y-a,e.y+a),i=this.dotWidthVariance?t.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new t.Point(r,n);s.width=i,this.randomOpacity&&(s.opacity=t.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),t.PatternBrush=t.util.createClass(t.PencilBrush,{getPatternSrc:function(){var e=t.util.createCanvasElement(),r=e.getContext("2d");return e.width=e.height=25,r.fillStyle=this.color,r.beginPath(),r.arc(10,10,10,0,2*Math.PI,!1),r.closePath(),r.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(e){return e.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle=this.getPattern(e)},createPath:function(e){var r=this.callSuper("createPath",e),n=r._getLeftTopCoords().scalarAdd(r.strokeWidth/2);return r.stroke=new t.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-n.x,offsetY:-n.y}),r}}),function(){var e=t.util.getPointer,r=t.util.degreesToRadians,n=t.util.isTouchEvent;for(var i in t.Canvas=t.util.createClass(t.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=t.PencilBrush&&new t.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,r,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){t=[],r=[];for(var i=0,o=this._objects.length;i<o;i++)e=this._objects[i],-1===n.indexOf(e)?t.push(e):r.push(e);n.length>1&&(this._activeObject._objects=r),t.push.apply(t,r)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,r){var n=e.calcTransformMatrix(),i=t.util.invertTransform(n),o=this.restorePointerVpt(r);return t.util.transformPoint(o,i)},isTargetTransparent:function(e,r,n){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var i=this._normalizePointer(e,{x:r,y:n}),o=Math.max(e.cacheTranslationX+i.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+i.y*e.zoomY,0);return t.util.isTransparent(e._cacheContext,Math.round(o),Math.round(a),this.targetFindTolerance)}var s=this.contextCache,l=e.selectionBackgroundColor,c=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(s),s.save(),s.transform(c[0],c[1],c[2],c[3],c[4],c[5]),e.render(s),s.restore(),e.selectionBackgroundColor=l,t.util.isTransparent(s,r,n,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return!0===e[t]}):e[this.selectionKey]},_shouldClearSelection:function(e,t){var r=this.getActiveObjects(),n=this._activeObject;return!t||t&&n&&r.length>1&&-1===r.indexOf(t)&&n!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&n&&n!==t},_shouldCenterTransform:function(e,t,r){var n;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?n=this.centeredScaling||e.centeredScaling:"rotate"===t&&(n=this.centeredRotation||e.centeredRotation),n?!r:r},_getOriginFromCorner:function(e,t){var r={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?r.x="right":("mr"===t||"tr"===t||"br"===t)&&(r.x="left"),"tl"===t||"mt"===t||"tr"===t?r.y="bottom":("bl"===t||"mb"===t||"br"===t)&&(r.y="top"),r},_getActionFromCorner:function(e,t,r,n){if(!t||!e)return"drag";var i=n.controls[t];return i.getActionName(r,i,n)},_setupCurrentTransform:function(e,n,i){if(n){var o=this.getPointer(e),a=n.__corner,s=n.controls[a],l=i&&a?s.getActionHandler(e,n,s):t.controlsUtils.dragHandler,c=this._getActionFromCorner(i,a,e,n),u=this._getOriginFromCorner(n,a),d=e[this.centeredKey],h={target:n,action:c,actionHandler:l,corner:a,scaleX:n.scaleX,scaleY:n.scaleY,skewX:n.skewX,skewY:n.skewY,offsetX:o.x-n.left,offsetY:o.y-n.top,originX:u.x,originY:u.y,ex:o.x,ey:o.y,lastX:o.x,lastY:o.y,theta:r(n.angle),width:n.width*n.scaleX,shiftKey:e.shiftKey,altKey:d,original:t.util.saveObjectTransform(n)};this._shouldCenterTransform(n,c,d)&&(h.originX="center",h.originY="center"),h.original.originX=u.x,h.original.originY=u.y,this._currentTransform=h,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var r=this._groupSelector,n=new t.Point(r.ex,r.ey),i=t.util.transformPoint(n,this.viewportTransform),o=new t.Point(r.ex+r.left,r.ey+r.top),a=t.util.transformPoint(o,this.viewportTransform),s=Math.min(i.x,a.x),l=Math.min(i.y,a.y),c=Math.max(i.x,a.x),u=Math.max(i.y,a.y),d=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,l,c-s,u-l)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=d,l+=d,c-=d,u-=d,t.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,l,c-s,u-l))},findTarget:function(e,t){if(!this.skipTargetFind){var r,i,o=this.getPointer(e,!0),a=this._activeObject,s=this.getActiveObjects(),l=n(e),c=s.length>1&&!t||1===s.length;if(this.targets=[],c&&a._findTargetCorner(o,l)||s.length>1&&!t&&a===this._searchPossibleTargets([a],o))return a;if(1===s.length&&a===this._searchPossibleTargets([a],o)){if(!this.preserveObjectStacking)return a;r=a,i=this.targets,this.targets=[]}var u=this._searchPossibleTargets(this._objects,o);return e[this.altSelectionKey]&&u&&r&&u!==r&&(u=r,this.targets=i),u}},_checkTarget:function(e,t,r){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,r.x,r.y))return!0}},_searchPossibleTargets:function(e,r){for(var n,i,o=e.length;o--;){var a=e[o],s=a.group?this._normalizePointer(a.group,r):r;if(this._checkTarget(s,a,r)){(n=e[o]).subTargetCheck&&n instanceof t.Group&&(i=this._searchPossibleTargets(n._objects,r))&&this.targets.push(i);break}}return n},restorePointerVpt:function(e){return t.util.transformPoint(e,t.util.invertTransform(this.viewportTransform))},getPointer:function(t,r){if(this._absolutePointer&&!r)return this._absolutePointer;if(this._pointer&&r)return this._pointer;var n,i=e(t),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,l=a.height||0;(!s||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),i.x=i.x-this._offset.left,i.y=i.y-this._offset.top,r||(i=this.restorePointerVpt(i));var c=this.getRetinaScaling();return 1!==c&&(i.x/=c,i.y/=c),n=0===s||0===l?{width:1,height:1}:{width:o.width/s,height:o.height/l},{x:i.x*n.width,y:i.y*n.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),r=this.lowerCanvasEl,n=this.upperCanvasEl;n?n.className="":(n=this._createCanvasElement(),this.upperCanvasEl=n),t.util.addClass(n,"upper-canvas "+e),this.wrapperEl.appendChild(n),this._copyCanvasStyle(r,n),this._applyCanvasStyle(n),this.contextTop=n.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=t.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),t.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),t.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var r=this.width||e.width,n=this.height||e.height;t.util.setStyle(e,{position:"absolute",width:r+"px",height:n+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=r,e.height=n,t.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var r=!1,n=this.getActiveObjects(),i=[],o=[];e.forEach(function(e){-1===n.indexOf(e)&&(r=!0,e.fire("deselected",{e:t,target:e}),o.push(e))}),n.forEach(function(n){-1===e.indexOf(n)&&(r=!0,n.fire("selected",{e:t,target:n}),i.push(n))}),e.length>0&&n.length>0?r&&this.fire("selection:updated",{e:t,selected:i,deselected:o}):n.length>0?this.fire("selection:created",{e:t,selected:i}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:o})},setActiveObject:function(e,t){var r=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(r,t),this},_setActiveObject:function(e,t){return!(this._activeObject===e||!this._discardActiveObject(t,e)||e.onSelect({e:t}))&&(this._activeObject=e,!0)},_discardActiveObject:function(e,t){var r=this._activeObject;if(r){if(r.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),r=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:r,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,t.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,r){var n=this._realizeGroupTransformOnObject(e),i=this.callSuper("_toObject",e,t,r);return this._unwindGroupTransformOnObject(e,n),i},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var r={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(t){r[t]=e[t]}),t.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),r}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,r){var n=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,r),this._unwindGroupTransformOnObject(t,n)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),t.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),t.StaticCanvas)"prototype"!==i&&(t.Canvas[i]=t.StaticCanvas[i])}(),function(){var e=t.util.addListener,r=t.util.removeListener,n={passive:!1};function i(e,t){return e.button&&e.button===t-1}t.util.object.extend(t.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,r){var i=this.upperCanvasEl,o=this._getEventPrefix();e(t.window,"resize",this._onResize),e(i,o+"down",this._onMouseDown),e(i,o+"move",this._onMouseMove,n),e(i,o+"out",this._onMouseOut),e(i,o+"enter",this._onMouseEnter),e(i,"wheel",this._onMouseWheel),e(i,"contextmenu",this._onContextMenu),e(i,"dblclick",this._onDoubleClick),e(i,"dragover",this._onDragOver),e(i,"dragenter",this._onDragEnter),e(i,"dragleave",this._onDragLeave),e(i,"drop",this._onDrop),this.enablePointerEvents||e(i,"touchstart",this._onTouchStart,n),typeof eventjs<"u"&&r in eventjs&&(eventjs[r](i,"gesture",this._onGesture),eventjs[r](i,"drag",this._onDrag),eventjs[r](i,"orientation",this._onOrientationChange),eventjs[r](i,"shake",this._onShake),eventjs[r](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(r,"remove");var e=this._getEventPrefix();r(t.document,e+"up",this._onMouseUp),r(t.document,"touchend",this._onTouchEnd,n),r(t.document,e+"move",this._onMouseMove,n),r(t.document,"touchmove",this._onMouseMove,n)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var r=this;this._hoveredTargets.forEach(function(n){r.fire("mouse:out",{target:t,e:e}),n&&t.fire("mouseout",{e:e})}),this._hoveredTargets=[]},_onMouseEnter:function(e){!this._currentTransform&&!this.findTarget(e)&&(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onDrop:function(e){return this._simpleEventHandler("drop:before",e),this._simpleEventHandler("drop",e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId)},_onTouchStart:function(i){i.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();e(t.document,"touchend",this._onTouchEnd,n),e(t.document,"touchmove",this._onMouseMove,n),r(o,a+"down",this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();r(o,a+"move",this._onMouseMove,n),e(t.document,a+"up",this._onMouseUp),e(t.document,a+"move",this._onMouseMove,n)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var o=this._getEventPrefix();r(t.document,"touchend",this._onTouchEnd,n),r(t.document,"touchmove",this._onMouseMove,n);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){e(a.upperCanvasEl,o+"down",a._onMouseDown),a._willAddMouseDown=0},400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(i)&&(r(t.document,a+"up",this._onMouseUp),r(t.document,a+"move",this._onMouseMove,n),e(o,a+"move",this._onMouseMove,n))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var r,n=this._currentTransform,o=this._groupSelector,a=!1,s=!o||0===o.left&&0===o.top;if(this._cacheTransformEventData(e),r=this._target,this._handleEvent(e,"up:before"),i(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,s);else{if(i(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(n&&(this._finalizeCurrentTransform(e),a=n.actionPerformed),!s){var l=r===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(r)||!l&&r===this._activeObject)}var c,u;if(r){if(c=r._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e)),r.selectable&&r!==this._activeObject&&"up"===r.activeOn)this.setActiveObject(r,e),a=!0;else{var d=r.controls[c],h=d&&d.getMouseUpHandler(e,r,d);h&&h(e,n,(u=this.getPointer(e)).x,u.y)}r.isMoving=!1}if(n&&(n.target!==r||n.corner!==c)){var f=n.target&&n.target.controls[n.corner],p=f&&f.getMouseUpHandler(e,r,d);u=u||this.getPointer(e),p&&p(e,n,u.x,u.y)}this._setCursorFromEvent(e,r),this._handleEvent(e,"up",1,s),this._groupSelector=null,this._currentTransform=null,r&&(r.__corner=0),a?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(e,t){var r=this.findTarget(t),n=this.targets,i={e:t,target:r,subTargets:n};if(this.fire(e,i),r&&r.fire(e,i),!n)return r;for(var o=0;o<n.length;o++)n[o].fire(e,i);return r},_handleEvent:function(e,t,r,n){var i=this._target,o=this.targets||[],a={e:e,target:i,subTargets:o,button:r||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(a.currentTarget=this.findTarget(e),a.currentSubTargets=this.targets),this.fire("mouse:"+t,a),i&&i.fire("mouse"+t,a);for(var s=0;s<o.length;s++)o[s].fire("mouse"+t,a)},_finalizeCurrentTransform:function(e){var t=this._currentTransform,r=t.target,n={e:e,target:r,transform:t,action:t.action};r._scaling&&(r._scaling=!1),r.setCoords(),(t.actionPerformed||this.stateful&&r.hasStateChanged())&&this._fire("modified",n)},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e:e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e:e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var r=this._target;if(i(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(i(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var n=this._pointer;this._previousPointer=n;var o=this._shouldRender(r),a=this._shouldGroup(e,r);if(this._shouldClearSelection(e,r)?this.discardActiveObject(e):a&&(this._handleGrouping(e,r),r=this._activeObject),this.selection&&(!r||!r.selectable&&!r.isEditing&&r!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),r){var s=r===this._activeObject;r.selectable&&"down"===r.activeOn&&this.setActiveObject(r,e);var l=r._findTargetCorner(this.getPointer(e,!0),t.util.isTouchEvent(e));if(r.__corner=l,r===this._activeObject&&(l||!a)){this._setupCurrentTransform(e,r,s);var c=r.controls[l],u=(n=this.getPointer(e),c&&c.getMouseDownHandler(e,r,c));u&&u(e,this._currentTransform,n.x,n.y)}}this._handleEvent(e,"down"),(o||a)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e:e,transform:t})},__onMouseMove:function(e){var t,r;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var n=this._groupSelector;n?(r=this._absolutePointer,n.left=r.x-n.ex,n.top=r.y-n.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var r=this._hoveredTarget,n=this._hoveredTargets,i=this.targets,o=Math.max(n.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:r,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:n[a],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var r=this._draggedoverTarget,n=this._hoveredTargets,i=this.targets,o=Math.max(n.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:r,evtOut:"dragleave",evtIn:"dragenter"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:n[a],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,r){var n,i,o,a=r.oldTarget,s=a!==e,l=r.canvasEvtIn,c=r.canvasEvtOut;s&&(n={e:t,target:e,previousTarget:a},i={e:t,target:a,nextTarget:e}),o=e&&s,a&&s&&(c&&this.fire(c,i),a.fire(r.evtOut,i)),o&&(l&&this.fire(l,n),e.fire(r.evtIn,n))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),r=this._currentTransform;r.reset=!1,r.shiftKey=e.shiftKey,r.altKey=e[this.centeredKey],this._performTransformAction(e,r,t),r.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,r){var n=r.x,i=r.y,o=t.action,a=!1,s=t.actionHandler;s&&(a=s(e,t,n,i)),"drag"===o&&a&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||a},_fire:t.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var r=t.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,i=(!n||!n.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));i?this.setCursor(this.getCornerCursor(i,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map(function(e){r=e.hoverCursor||r}),this.setCursor(r))},getCornerCursor:function(e,t,r){var n=t.controls[e];return n.cursorStyleHandler(r,n,t)}})}(),function(){var e=Math.min,r=Math.max;t.util.object.extend(t.Canvas.prototype,{_shouldGroup:function(e,t){var r=this._activeObject;return r&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(r!==t||"activeSelection"===r.type)&&!t.onSelect({e:e})},_handleGrouping:function(e,t){var r=this._activeObject;r.__corner||t===r&&(!(t=this.findTarget(e,!0))||!t.selectable)||(r&&"activeSelection"===r.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var r=this._activeObject,n=r._objects.slice(0);r.contains(e)?(r.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===r.size()&&this._setActiveObject(r.item(0),t)):(r.addWithUpdate(e),this._hoveredTarget=r,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,t)},_createActiveSelection:function(e,t){var r=this.getActiveObjects(),n=this._createGroup(e);this._hoveredTarget=n,this._setActiveObject(n,t),this._fireSelectionEvents(r,t)},_createGroup:function(e){var r=this._objects,n=r.indexOf(this._activeObject)<r.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new t.ActiveSelection(n,{canvas:this})},_groupSelectedObjects:function(e){var r,n=this._collectObjects(e);1===n.length?this.setActiveObject(n[0],e):n.length>1&&(r=new t.ActiveSelection(n.reverse(),{canvas:this}),this.setActiveObject(r,e))},_collectObjects:function(n){for(var i,o=[],a=this._groupSelector.ex,s=this._groupSelector.ey,l=a+this._groupSelector.left,c=s+this._groupSelector.top,u=new t.Point(e(a,l),e(s,c)),d=new t.Point(r(a,l),r(s,c)),h=!this.selectionFullyContained,f=a===l&&s===c,p=this._objects.length;p--&&!((i=this._objects[p])&&i.selectable&&i.visible&&(h&&i.intersectsWithRect(u,d,!0)||i.isContainedWithinRect(u,d,!0)||h&&i.containsPoint(u,null,!0)||h&&i.containsPoint(d,null,!0))&&(o.push(i),f)););return o.length>1&&(o=o.filter(function(e){return!e.onSelect({e:n})})),o},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),t.util.object.extend(t.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var r=e.format||"png",n=e.quality||1,i=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),o=this.toCanvasElement(i,e);return t.util.toDataURL(o,r,n)},toCanvasElement:function(e,r){e=e||1;var n=((r=r||{}).width||this.width)*e,i=(r.height||this.height)*e,o=this.getZoom(),a=this.width,s=this.height,l=o*e,c=this.viewportTransform,u=(c[4]-(r.left||0))*e,d=(c[5]-(r.top||0))*e,h=this.interactive,f=[l,0,0,l,u,d],p=this.enableRetinaScaling,g=t.util.createCanvasElement(),m=this.contextTop;return g.width=n,g.height=i,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=n,this.height=i,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=c,this.width=a,this.height=s,this.calcViewportBoundaries(),this.interactive=h,this.enableRetinaScaling=p,this.contextTop=m,g}}),t.util.object.extend(t.StaticCanvas.prototype,{loadFromJSON:function(e,r,n){if(e){var i="string"==typeof e?JSON.parse(e):t.util.object.clone(e),o=this,a=i.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete i.clipPath,this._enlivenObjects(i.objects,function(e){o.clear(),o._setBgOverlay(i,function(){a?o._enlivenObjects([a],function(t){o.clipPath=t[0],o.__setupCanvas.call(o,i,e,s,r)}):o.__setupCanvas.call(o,i,e,s,r)})},n),this}},__setupCanvas:function(e,t,r,n){var i=this;t.forEach(function(e,t){i.insertAt(e,t)}),this.renderOnAddRemove=r,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),n&&n()},_setBgOverlay:function(e,t){var r={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var n=function(){r.backgroundImage&&r.overlayImage&&r.backgroundColor&&r.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,r,n),this.__setBgOverlay("overlayImage",e.overlayImage,r,n),this.__setBgOverlay("backgroundColor",e.background,r,n),this.__setBgOverlay("overlayColor",e.overlay,r,n)}else t&&t()},__setBgOverlay:function(e,r,n,i){var o=this;if(!r)return n[e]=!0,void(i&&i());"backgroundImage"===e||"overlayImage"===e?t.util.enlivenObjects([r],function(t){o[e]=t[0],n[e]=!0,i&&i()}):this["set"+t.util.string.capitalize(e,!0)](r,function(){n[e]=!0,i&&i()})},_enlivenObjects:function(e,r,n){e&&0!==e.length?t.util.enlivenObjects(e,function(e){r&&r(e)},null,n):r&&r([])},_toDataURL:function(e,t){this.clone(function(r){t(r.toDataURL(e))})},_toDataURLWithMultiplier:function(e,t,r){this.clone(function(n){r(n.toDataURLWithMultiplier(e,t))})},clone:function(e,t){var r=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(r,function(){e&&e(t)})})},cloneWithoutData:function(e){var r=t.util.createCanvasElement();r.width=this.width,r.height=this.height;var n=new t.Canvas(r);this.backgroundImage?(n.setBackgroundImage(this.backgroundImage.src,function(){n.renderAll(),e&&e(n)}),n.backgroundImageOpacity=this.backgroundImageOpacity,n.backgroundImageStretch=this.backgroundImageStretch):e&&e(n)}}),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.object.clone,i=t.util.toFixed,o=t.util.string.capitalize,a=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var r=t.perfLimitSizeTotal,n=e.width,i=e.height,o=t.maxCacheSideLimit,a=t.minCacheSideLimit;if(n<=o&&i<=o&&n*i<=r)return n<a&&(e.width=a),i<a&&(e.height=a),e;var s=n/i,l=t.util.limitDimsByArea(s,r),c=t.util.capValue,u=c(a,l.x,o),d=c(a,l.y,o);return n>u&&(e.zoomX/=n/u,e.width=u,e.capped=!0),i>d&&(e.zoomY/=i/d,e.height=d,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),r=t.x*e.scaleX/this.scaleX,n=t.y*e.scaleY/this.scaleY;return{width:r+2,height:n+2,zoomX:e.scaleX,zoomY:e.scaleY,x:r,y:n}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var r=e._currentTransform.target,n=e._currentTransform.action;if(this===r&&n.slice&&"scale"===n.slice(0,5))return!1}var i,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=s.width,u=s.height,d=s.zoomX,h=s.zoomY,f=c!==this.cacheWidth||u!==this.cacheHeight,p=this.zoomX!==d||this.zoomY!==h,g=f||p,m=0,v=0,y=!1;if(f){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||u>w;y=x||(c<.9*b||u<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||u>l)&&(m=.1*c,v=.1*u)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,m+=this.getHeightOfLine(0)*this.zoomX,v+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(a.width=Math.ceil(c+m),a.height=Math.ceil(u+v)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),i=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-i)+i,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=c,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(d,h),this.zoomX=d,this.zoomY=h,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,r=this.calcTransformMatrix(!t);e.transform(r[0],r[1],r[2],r[3],r[4],r[5])},toObject:function(e){var r=t.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:i(this.left,r),top:i(this.top,r),width:i(this.width,r),height:i(this.height,r),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,r),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,r),scaleX:i(this.scaleX,r),scaleY:i(this.scaleY,r),angle:i(this.angle,r),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,r),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,r),skewY:i(this.skewY,r)};return this.clipPath&&!this.clipPath.excludeFromExport&&(n.clipPath=this.clipPath.toObject(e),n.clipPath.inverted=this.clipPath.inverted,n.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,n,e),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var r=t.util.getKlass(e.type).prototype;return r.stateProperties.forEach(function(t){"left"===t||"top"===t||(e[t]===r[t]&&delete e[t],Array.isArray(e[t])&&Array.isArray(r[t])&&0===e[t].length&&0===r[t].length&&delete e[t])}),e},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,r=e.scaleY;if(this.canvas){var n=this.canvas.getZoom(),i=this.canvas.getRetinaScaling();t*=n*i,r*=n*i}return{scaleX:t,scaleY:r}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,r){var n="scaleX"===e||"scaleY"===e,i=this[e]!==r,o=!1;return n&&(r=this._constrainScale(r)),"scaleX"===e&&r<0?(this.flipX=!this.flipX,r*=-1):"scaleY"===e&&r<0?(this.flipY=!this.flipY,r*=-1):"shadow"!==e||!r||r instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",r):r=new t.Shadow(r),this[e]=r,i&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!!("stroke"===this.paintFirst&&this.hasFill()&&this.hasStroke()&&"object"==typeof this.shadow||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e,r){if(e.save(),r.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",r.absolutePositioned){var n=t.util.invertTransform(this.calcTransformMatrix());e.transform(n[0],n[1],n[2],n[3],n[4],n[5])}r.transform(e),e.scale(1/r.zoomX,1/r.zoomY),e.drawImage(r._cacheCanvas,-r.cacheTranslationX,-r.cacheTranslationY),e.restore()},drawObject:function(e,t){var r=this.fill,n=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e,this.clipPath),this.fill=r,this.stroke=n},_drawClipPath:function(e,t){t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e,t))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!e){var t=this.cacheWidth/this.zoomX,r=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-r/2,t,r)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var r=t.stroke;r&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,r.toLive?"percentage"===r.gradientUnits||r.gradientTransform||r.patternTransform?this._applyPatternForTransformedGradient(e,r):(e.strokeStyle=r.toLive(e,this),this._applyPatternGradientTransform(e,r)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var r=t.fill;r&&(r.toLive?(e.fillStyle=r.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=r)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){!t||0===t.length||(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,r){var n,i,o,s=this.getViewportTransform(),l=this.calcTransformMatrix();i=typeof(r=r||{}).hasBorders<"u"?r.hasBorders:this.hasBorders,o=typeof r.hasControls<"u"?r.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),n=t.util.qrDecompose(l),e.save(),e.translate(n.translateX,n.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(n.angle-=180),e.rotate(a(this.group?n.angle:this.angle)),r.forActiveSelection||this.group?i&&this.drawBordersInGroup(e,n,r):i&&this.drawBorders(e,r),o&&this.drawControls(e,r),e.restore()},_setShadow:function(e){if(this.shadow){var r,n=this.shadow,i=this.canvas,o=i&&i.viewportTransform[0]||1,a=i&&i.viewportTransform[3]||1;r=n.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),i&&i._isRetinaScaling()&&(o*=t.devicePixelRatio,a*=t.devicePixelRatio),e.shadowColor=n.color,e.shadowBlur=n.blur*t.browserShadowBlurConstant*(o+a)*(r.scaleX+r.scaleY)/4,e.shadowOffsetX=n.offsetX*o*r.scaleX,e.shadowOffsetY=n.offsetY*a*r.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var r=t.gradientTransform||t.patternTransform,n=-this.width/2+t.offsetX||0,i=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,n,i):e.transform(1,0,0,1,n,i),r&&e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),{offsetX:n,offsetY:i}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,r){var n,i=this._limitCacheSize(this._getCacheCanvasDimensions()),o=t.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=i.x/this.scaleX/a,l=i.y/this.scaleY/a;o.width=s,o.height=l,(n=o.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(s,0),n.lineTo(s,l),n.lineTo(0,l),n.closePath(),n.translate(s/2,l/2),n.scale(i.zoomX/this.scaleX/a,i.zoomY/this.scaleY/a),this._applyPatternGradientTransform(n,r),n.fillStyle=r.toLive(e),n.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(a*this.scaleX/i.zoomX,a*this.scaleY/i.zoomY),e.strokeStyle=n.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var r=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),r=t.util.transformPoint(r,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,r.x+=e.offsetLeft,r.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(r,"center","center")},clone:function(e,r){var n=this.toObject(r);this.constructor.fromObject?this.constructor.fromObject(n,e):t.Object._fromObject("Object",n,e)},cloneAsImage:function(e,r){var n=this.toCanvasElement(r);return e&&e(new t.Image(n)),this},toCanvasElement:function(e){e||(e={});var r=t.util,n=r.saveObjectTransform(this),i=this.group,o=this.shadow,a=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&r.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,u,d,h=t.util.createCanvasElement(),f=this.getBoundingRect(!0,!0),p=this.shadow,g={x:0,y:0};p&&(c=p.blur,l=p.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(a(p.offsetX)+c)*a(l.scaleX),g.y=2*Math.round(a(p.offsetY)+c)*a(l.scaleY)),u=f.width+g.x,d=f.height+g.y,h.width=Math.ceil(u),h.height=Math.ceil(d);var m=new t.StaticCanvas(h,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(m.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(m.width/2,m.height/2),"center","center");var v=this.canvas;m.add(this);var y=m.toCanvasElement(s||1,e);return this.shadow=o,this.set("canvas",v),i&&(this.group=i),this.set(n).setCoords(),m._objects=[],m.dispose(),m=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,r){r=r||this.canvas.getPointer(e);var n=new t.Point(r.x,r.y),i=this._getLeftTopCoords();return this.angle&&(n=t.util.rotatePoint(n,i,a(-this.angle))),{x:n.x-i.x,y:n.y-i.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){t.runningAnimations&&t.runningAnimations.cancelByTarget(this)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),r(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object.ENLIVEN_PROPS=["clipPath"],t.Object._fromObject=function(e,r,i,o){var a=t[e];r=n(r,!0),t.util.enlivenPatterns([r.fill,r.stroke],function(e){typeof e[0]<"u"&&(r.fill=e[0]),typeof e[1]<"u"&&(r.stroke=e[1]),t.util.enlivenObjectEnlivables(r,r,function(){var e=o?new a(r[o],r):new a(r);i&&i(e)})})},t.Object.__uid=0)}(e),function(){var e=t.util.degreesToRadians,r={left:-.5,center:0,right:.5},n={top:-.5,center:0,bottom:.5};t.util.object.extend(t.Object.prototype,{translateToGivenOrigin:function(e,i,o,a,s){var l,c,u,d=e.x,h=e.y;return"string"==typeof i?i=r[i]:i-=.5,"string"==typeof a?a=r[a]:a-=.5,"string"==typeof o?o=n[o]:o-=.5,"string"==typeof s?s=n[s]:s-=.5,c=s-o,((l=a-i)||c)&&(u=this._getTransformedDimensions(),d=e.x+l*u.x,h=e.y+c*u.y),new t.Point(d,h)},translateToCenterPoint:function(r,n,i){var o=this.translateToGivenOrigin(r,n,i,"center","center");return this.angle?t.util.rotatePoint(o,r,e(this.angle)):o},translateToOriginPoint:function(r,n,i){var o=this.translateToGivenOrigin(r,"center","center",n,i);return this.angle?t.util.rotatePoint(o,r,e(this.angle)):o},getCenterPoint:function(){var e=new t.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var r=this.getCenterPoint();return this.translateToOriginPoint(r,e,t)},toLocalPoint:function(r,n,i){var o,a,s=this.getCenterPoint();return o=typeof n<"u"&&typeof i<"u"?this.translateToGivenOrigin(s,"center","center",n,i):new t.Point(this.left,this.top),a=new t.Point(r.x,r.y),this.angle&&(a=t.util.rotatePoint(a,s,-e(this.angle))),a.subtractEquals(o)},setPositionByOrigin:function(e,t,r){var n=this.translateToCenterPoint(e,t,r),i=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",i.x),this.set("top",i.y)},adjustPosition:function(n){var i,o,a=e(this.angle),s=this.getScaledWidth(),l=t.util.cos(a)*s,c=t.util.sin(a)*s;i="string"==typeof this.originX?r[this.originX]:this.originX-.5,o="string"==typeof n?r[n]:n-.5,this.left+=l*(o-i),this.top+=c*(o-i),this.setCoords(),this.originX=n},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){var e=t.util,r=e.degreesToRadians,n=e.multiplyTransformMatrices,i=e.transformPoint;e.object.extend(t.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,r){return function(e){return[new t.Point(e.tl.x,e.tl.y),new t.Point(e.tr.x,e.tr.y),new t.Point(e.br.x,e.br.y),new t.Point(e.bl.x,e.bl.y)]}(this._getCoords(e,r))},intersectsWithRect:function(e,r,n,i){var o=this.getCoords(n,i);return"Intersection"===t.Intersection.intersectPolygonRectangle(o,e,r).status},intersectsWithObject:function(e,r,n){return"Intersection"===t.Intersection.intersectPolygonPolygon(this.getCoords(r,n),e.getCoords(r,n)).status||e.isContainedWithinObject(this,r,n)||this.isContainedWithinObject(e,r,n)},isContainedWithinObject:function(e,t,r){for(var n=this.getCoords(t,r),i=t?e.aCoords:e.lineCoords,o=0,a=e._getImageLines(i);o<4;o++)if(!e.containsPoint(n[o],a))return!1;return!0},isContainedWithinRect:function(e,t,r,n){var i=this.getBoundingRect(r,n);return i.left>=e.x&&i.left+i.width<=t.x&&i.top>=e.y&&i.top+i.height<=t.y},containsPoint:function(e,t,r,n){var i=this._getCoords(r,n),o=(t=t||this._getImageLines(i),this._findCrossPoints(e,t));return 0!==o&&o%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,r=this.canvas.vptCoords.br;return!(!this.getCoords(!0,e).some(function(e){return e.x<=r.x&&e.x>=t.x&&e.y<=r.y&&e.y>=t.y})&&!this.intersectsWithRect(t,r,!0,e))||this._containsCenterOfCanvas(t,r,e)},_containsCenterOfCanvas:function(e,t,r){var n={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(n,null,!0,r)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,r=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,r,!0,e)||this.getCoords(!0,e).every(function(e){return(e.x>=r.x||e.x<=t.x)&&(e.y>=r.y||e.y<=t.y)})&&this._containsCenterOfCanvas(t,r,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var r,n,i,o,a,s=0;for(var l in t)if(!((a=t[l]).o.y<e.y&&a.d.y<e.y||a.o.y>=e.y&&a.d.y>=e.y||(a.o.x===a.d.x&&a.o.x>=e.x?o=a.o.x:(r=(a.d.y-a.o.y)/(a.d.x-a.o.x),n=e.y-0*e.x,i=a.o.y-r*a.o.x,o=-(n-i)/(0-r)),o>=e.x&&(s+=1),2!==s)))break;return s},getBoundingRect:function(t,r){var n=this.getCoords(t,r);return e.makeBoundingBoxFromPoints(n)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var r=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/r)},scaleToHeight:function(e,t){var r=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/r)},calcLineCoords:function(){var t=this.getViewportTransform(),n=this.padding,o=r(this.angle),a=e.cos(o)*n,s=e.sin(o)*n,l=a+s,c=a-s,u=this.calcACoords(),d={tl:i(u.tl,t),tr:i(u.tr,t),bl:i(u.bl,t),br:i(u.br,t)};return n&&(d.tl.x-=c,d.tl.y-=l,d.tr.x+=l,d.tr.y-=c,d.bl.x-=l,d.bl.y+=c,d.br.x+=c,d.br.y+=l),d},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=this.getViewportTransform(),i=n(r,t),o=n(i,e),a=(o=n(o,[1/r[0],0,0,1/r[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl(function(e,t,r){s[t]=e.positionHandler(a,o,r)}),s},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),r=n(t,e),o=this._getTransformedDimensions(),a=o.x/2,s=o.y/2;return{tl:i({x:-a,y:-s},r),tr:i({x:a,y:-s},r),bl:i({x:-a,y:s},r),br:i({x:a,y:s},r)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="_",r="";return!e&&this.group&&(r=this.group.transformMatrixKey(e)+t),r+this.top+t+this.left+t+this.scaleX+t+this.scaleY+t+this.skewX+t+this.skewY+t+this.angle+t+this.originX+t+this.originY+t+this.width+t+this.height+t+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var r=this.transformMatrixKey(e),i=this.matrixCache||(this.matrixCache={});return i.key===r?i.value:(this.group&&(t=n(this.group.calcTransformMatrix(!1),t)),i.key=r,i.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),r=this.ownMatrixCache||(this.ownMatrixCache={});if(r.key===t)return r.value;var n=this._calcTranslateMatrix(),i={angle:this.angle,translateX:n[4],translateY:n[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return r.key=t,r.value=e.composeMatrix(i),r.value},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,r){typeof t>"u"&&(t=this.skewX),typeof r>"u"&&(r=this.skewY);var n,i,o,a=0===t&&0===r;if(this.strokeUniform?(i=this.width,o=this.height):(i=(n=this._getNonTransformedDimensions()).x,o=n.y),a)return this._finalizeDimensions(i*this.scaleX,o*this.scaleY);var s=e.sizeAfterTransform(i,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:r});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return i(t,e,!0).scalarAdd(2*this.padding)}})}(),t.util.object.extend(t.Object.prototype,{sendToBack:function(){return this.group?t.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?t.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?t.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?t.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?t.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,r){if(r){if(r.toLive)return e+": url(#SVGID_"+r.id+"); ";var n=new t.Color(r),i=e+": "+n.toRgb()+"; ",o=n.getAlpha();return 1!==o&&(i+=e+"-opacity: "+o.toString()+"; "),i}return e+": none; "}var r=t.util.toFixed;t.util.object.extend(t.Object.prototype,{getSvgStyles:function(t){var r=this.fillRule?this.fillRule:"nonzero",n=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",a=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=t?"":this.getSvgFilter(),h=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",i,"; ","stroke-linecap: ",a,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",h,"fill-rule: ",r,"; ","opacity: ",c,";",d,u].join("")},getSvgSpanStyles:function(t,r){var n="; ",i=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+n:"",o=t.strokeWidth?"stroke-width: "+t.strokeWidth+n:"",a=t.fontSize?"font-size: "+t.fontSize+"px"+n:"",s=t.fontStyle?"font-style: "+t.fontStyle+n:"",l=t.fontWeight?"font-weight: "+t.fontWeight+n:"",c=t.fill?e("fill",t.fill):"",u=t.stroke?e("stroke",t.stroke):"",d=this.getSvgTextDecoration(t);return d&&(d="text-decoration: "+d+n),[u,o,i,a,s,l,d,c,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",r?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter(function(t){return e[t.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(e,r){var n=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+t.util.matrixToSVG(n)+(r||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var n=t.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',r(-this.width/2,n),'" y="',r(-this.height/2,n),'" width="',r(this.width,n),'" height="',r(this.height,n),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var r=(t=t||{}).reviver,n=t.additionalTransform||"",i=[this.getSvgTransform(!0,n),this.getSvgCommons()].join(""),o=e.indexOf("COMMON_PARTS");return e[o]=i,r?r(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,r){var n,i,o=(r=r||{}).noStyle,a=r.reviver,s=o?"":'style="'+this.getSvgStyles()+'" ',l=r.withShadow?'style="'+this.getSvgFilter()+'" ':"",c=this.clipPath,u=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",d=c&&c.absolutePositioned,h=this.stroke,f=this.fill,p=this.shadow,g=[],m=e.indexOf("COMMON_PARTS"),v=r.additionalTransform;return c&&(c.clipPathId="CLIPPATH_"+t.Object.__uid++,i='<clipPath id="'+c.clipPathId+'" >\n'+c.toClipPathSVG(a)+"</clipPath>\n"),d&&g.push("<g ",l,this.getSvgCommons()," >\n"),g.push("<g ",this.getSvgTransform(!1),d?"":l+this.getSvgCommons()," >\n"),n=[s,u,o?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),e[m]=n,f&&f.toLive&&g.push(f.toSVG(this)),h&&h.toLive&&g.push(h.toSVG(this)),p&&g.push(p.toSVG(this)),c&&g.push(i),g.push(e.join("")),g.push("</g>\n"),d&&g.push("</g>\n"),a?a(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=t.util.object.extend,r="stateProperties";function n(t,r,n){var i={};n.forEach(function(e){i[e]=t[e]}),e(t[r],i,!0)}function i(e,t,r){if(e===t)return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(!i(e[n],t[n]))return!1;return!0}if(e&&"object"==typeof e){var a,s=Object.keys(e);if(!t||"object"!=typeof t||!r&&s.length!==Object.keys(t).length)return!1;for(n=0,o=s.length;n<o;n++)if("canvas"!==(a=s[n])&&"group"!==a&&!i(e[a],t[a]))return!1;return!0}}t.util.object.extend(t.Object.prototype,{hasStateChanged:function(e){var t="_"+(e=e||r);return Object.keys(this[t]).length<this[e].length||!i(this[t],this,!0)},saveState:function(e){var t=e&&e.propertySet||r,i="_"+t;return this[i]?(n(this,i,this[t]),e&&e.stateProperties&&n(this,i,e.stateProperties),this):this.setupState(e)},setupState:function(e){var t=(e=e||{}).propertySet||r;return e.propertySet=t,this["_"+t]={},this.saveState(e),this}})}(),function(){var e=t.util.degreesToRadians;t.util.object.extend(t.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var r,n,i,o=e.x,a=e.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(i=s[l],this.isControlVisible(i)&&(n=this._getImageLines(t?this.oCoords[i].touchCorner:this.oCoords[i].corner),0!==(r=this._findCrossPoints({x:o,y:a},n))&&r%2==1))return this.__corner=i,i;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var r=this.controls[t];e[t].corner=r.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=r.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var r=this.getCenterPoint(),n=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return t.translate(r.x,r.y),t.scale(1/i[0],1/i[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-n.x/2,-n.y/2,n.x,n.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var r=this._calculateCurrentDimensions(),n=this.borderScaleFactor,i=r.x+n,o=r.y+n,a=typeof t.hasControls<"u"?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-i/2,-o/2,i,o),a&&(e.beginPath(),this.forEachControl(function(t,r,n){t.withConnection&&t.getVisibility(n,r)&&(s=!0,e.moveTo(t.x*i,t.y*o),e.lineTo(t.x*i+t.offsetX,t.y*o+t.offsetY))}),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,r,n){n=n||{};var i=t.util.sizeAfterTransform(this.width,this.height,r),o=this.strokeWidth,a=this.strokeUniform,s=this.borderScaleFactor,l=i.x+o*(a?this.canvas.getZoom():r.scaleX)+s,c=i.y+o*(a?this.canvas.getZoom():r.scaleY)+s;return e.save(),this._setLineDash(e,n.borderDashArray||this.borderDashArray),e.strokeStyle=n.borderColor||this.borderColor,e.strokeRect(-l/2,-c/2,l,c),e.restore(),this},drawControls:function(e,r){r=r||{},e.save();var n,i,o=this.canvas.getRetinaScaling();return e.setTransform(o,0,0,o,0,0),e.strokeStyle=e.fillStyle=r.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=r.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,r.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(n=this.group.calcTransformMatrix()),this.forEachControl(function(o,a,s){i=s.oCoords[a],o.getVisibility(s,a)&&(n&&(i=t.util.transformPoint(i,n)),o.render(e,i.x,i.y,r,s))}),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),t.util.object.extend(t.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,r){var n=function(){},i=(r=r||{}).onComplete||n,o=r.onChange||n,a=this;return t.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxCenterObjectV:function(e,r){var n=function(){},i=(r=r||{}).onComplete||n,o=r.onChange||n,a=this;return t.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxRemove:function(e,r){var n=function(){},i=(r=r||{}).onComplete||n,o=r.onChange||n,a=this;return t.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),o()},onComplete:function(){a.remove(e),i()}})}}),t.util.object.extend(t.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,r=[],n=[];for(e in arguments[0])r.push(e);for(var i=0,o=r.length;i<o;i++)e=r[i],t=i!==o-1,n.push(this._animate(e,arguments[0][e],arguments[1],t));return n}return this._animate.apply(this,arguments)},_animate:function(e,r,n,i){var o,a=this;r=r.toString(),n=n?t.util.object.clone(n):{},~e.indexOf(".")&&(o=e.split("."));var s=a.colorProperties.indexOf(e)>-1||o&&a.colorProperties.indexOf(o[1])>-1,l=o?this.get(o[0])[o[1]]:this.get(e);"from"in n||(n.from=l),s||(r=~r.indexOf("=")?l+parseFloat(r.replace("=","")):parseFloat(r));var c={target:this,startValue:n.from,endValue:r,byValue:n.by,easing:n.easing,duration:n.duration,abort:n.abort&&function(e,t,r){return n.abort.call(a,e,t,r)},onChange:function(t,r,s){o?a[o[0]][o[1]]=t:a.set(e,t),!i&&n.onChange&&n.onChange(t,r,s)},onComplete:function(e,t,r){i||(a.setCoords(),n.onComplete&&n.onComplete(e,t,r))}};return s?t.util.animateColor(c.startValue,c.endValue,c.duration,c):t.util.animate(c)}}),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function o(e,t){var r=e.origin,n=e.axis1,i=e.axis2,o=e.dimension,a=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(r)){case a:return Math.min(this.get(n),this.get(i));case s:return Math.min(this.get(n),this.get(i))+.5*this.get(o);case l:return Math.max(this.get(n),this.get(i))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),typeof i[e]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var r=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=r},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return r(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,r=e*this.width*.5,n=t*this.height*.5;return{x1:r,x2:e*this.width*-.5,y1:n,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,n,i){i=i||{};var o=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];n(new t.Line(a,r(o,i)))},t.Line.fromObject=function(e,r){var i=n(e,!0);i.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",i,function(e){delete e.points,r&&r(e)},"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.degreesToRadians;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,n=(this.endAngle-this.startAngle)%360;if(0===n)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var i=r(this.startAngle),o=r(this.endAngle),a=this.radius;e=['<path d="M '+t.util.cos(i)*a+" "+t.util.sin(i)*a," A "+a+" "+a," 0 ",+(n>180?"1":"0")+" 1"," "+t.util.cos(o)*a+" "+t.util.sin(o)*a,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,r(this.startAngle),r(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,r){var n=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!function(e){return"radius"in e&&e.radius>=0}(n))throw new Error("value of `r` attribute is required and can not be negative");n.left=(n.left||0)-n.radius,n.top=(n.top||0)-n.radius,r(new t.Circle(n))},t.Circle.fromObject=function(e,r){t.Object._fromObject("Circle",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,r=this.height/2;e.beginPath(),e.moveTo(-t,r),e.lineTo(0,-r),e.lineTo(t,r),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,r){return t.Object._fromObject("Triangle",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={}),r=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,r,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,r){var n=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,r(new t.Ellipse(n))},t.Ellipse.fromObject=function(e,r){t.Object._fromObject("Ellipse",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,r=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,i=this.height,o=-this.width/2,a=-this.height/2,s=0!==t||0!==r,l=.4477152502;e.beginPath(),e.moveTo(o+t,a),e.lineTo(o+n-t,a),s&&e.bezierCurveTo(o+n-l*t,a,o+n,a+l*r,o+n,a+r),e.lineTo(o+n,a+i-r),s&&e.bezierCurveTo(o+n,a+i-l*r,o+n-l*t,a+i,o+n-t,a+i),e.lineTo(o+t,a+i),s&&e.bezierCurveTo(o+l*t,a+i,o,a+i-l*r,o,a+i-r),e.lineTo(o,a+r),s&&e.bezierCurveTo(o,a+l*r,o+l*t,a,o+t,a),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,n,i){if(!e)return n(null);i=i||{};var o=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new t.Rect(r(i?t.util.object.clone(i):{},o));a.visible=a.visible&&a.width>0&&a.height>0,n(a)},t.Rect.fromObject=function(e,r){return t.Object._fromObject("Rect",e,r)})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.util.array.min,i=t.util.array.max,o=t.util.toFixed,a=t.util.projectStrokeOnPoints;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_projectStrokeOnPoints:function(){return a(this.points,this,!0)},_setPositionDimensions:function(e){var t,r=this._calcDimensions(e),n=this.exactBoundingBox?this.strokeWidth:0;this.width=r.width-n,this.height=r.height-n,e.fromSVG||(t=this.translateToGivenOrigin({x:r.left-this.strokeWidth/2+n/2,y:r.top-this.strokeWidth/2+n/2},"left","top",this.originX,this.originY)),typeof e.left>"u"&&(this.left=e.fromSVG?r.left:t.x),typeof e.top>"u"&&(this.top=e.fromSVG?r.top:t.y),this.pathOffset={x:r.left+this.width/2+n/2,y:r.top+this.height/2+n/2}},_calcDimensions:function(){var e=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,t=n(e,"x")||0,r=n(e,"y")||0;return{left:t,top:r,width:(i(e,"x")||0)-t,height:(i(e,"y")||0)-r}},toObject:function(e){return r(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],r=this.pathOffset.x,n=this.pathOffset.y,i=t.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a<s;a++)e.push(o(this.points[a].x-r,i),",",o(this.points[a].y-n,i)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,r=this.points.length,n=this.pathOffset.x,i=this.pathOffset.y;if(!r||isNaN(this.points[r-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-n,this.points[0].y-i);for(var o=0;o<r;o++)t=this.points[o],e.lineTo(t.x-n,t.y-i);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(n,i,o){if(!n)return i(null);o||(o={});var a=t.parsePointsAttribute(n.getAttribute("points")),s=t.parseAttributes(n,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,i(new t[e](a,r(s,o)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,r){return t.Object._fromObject("Polyline",e,r,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.projectStrokeOnPoints;t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_projectStrokeOnPoints:function(){return r(this.points,this)},_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,r){t.Object._fromObject("Polygon",e,r,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.array.min,n=t.util.array.max,i=t.util.object.extend,o=t.util.object.clone,a=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,t){delete(t=o(t||{})).path,this.callSuper("initialize",t),this._setPath(e||[],t)},_setPath:function(e,r){this.path=t.util.makePathSimpler(Array.isArray(e)?e:t.util.parsePath(e)),t.Polyline.prototype._setPositionDimensions.call(this,r||{})},_renderPathCommands:function(e){var t,r=0,n=0,i=0,o=0,a=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var u=0,d=this.path.length;u<d;++u)switch(t=this.path[u],t[0]){case"L":i=t[1],o=t[2],e.lineTo(i+l,o+c);break;case"M":r=i=t[1],n=o=t[2],e.moveTo(i+l,o+c);break;case"C":i=t[5],o=t[6],a=t[3],s=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,a+l,s+c,i+l,o+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),i=t[3],o=t[4],a=t[1],s=t[2];break;case"z":case"Z":i=r,o=n,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return i(this.callSuper("toObject",e),{path:this.path.map(function(e){return e.slice()})})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,e)+", "+a(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,i,o=[],a=[],s=0,l=0,c=0,u=0,d=0,h=this.path.length;d<h;++d){switch((e=this.path[d])[0]){case"L":c=e[1],u=e[2],i=[];break;case"M":s=c=e[1],l=u=e[2],i=[];break;case"C":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],u=e[6];break;case"Q":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],u=e[4];break;case"z":case"Z":c=s,u=l}i.forEach(function(e){o.push(e.x),a.push(e.y)}),o.push(c),a.push(u)}var f=r(o)||0,p=r(a)||0;return{left:f,top:p,width:(n(o)||0)-f,height:(n(a)||0)-p}}}),t.Path.fromObject=function(e,r){if("string"==typeof e.sourcePath){var n=e.sourcePath;t.loadSVGFromURL(n,function(n){var i=n[0];i.setOptions(e),e.clipPath?t.util.enlivenObjects([e.clipPath],function(e){i.clipPath=e[0],r&&r(i)}):r&&r(i)})}else t.Object._fromObject("Path",e,r,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,r,n){var o=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,r(new t.Path(o.d,i(o,n)))})}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.array.min,n=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,r){t=t||{},this._objects=[],r&&this.callSuper("initialize",t),this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;if(r)this._updateObjectsACoords();else{var i=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),i||this._calcBounds(),this._updateObjectsCoords(i),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var r=e.left,n=e.top;e.set({left:r-t.x,top:n-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var r=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(r&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,r?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,r){var n=this._objects.length;if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(e,r);if("canvas"===e)for(;n--;)this._objects[n]._set(e,r);t.Object.prototype._set.call(this,e,r)},toObject:function(e){var r=this.includeDefaultValues,n=this._objects.filter(function(e){return!e.excludeFromExport}).map(function(t){var n=t.includeDefaultValues;t.includeDefaultValues=r;var i=t.toObject(e);return t.includeDefaultValues=n,i}),i=t.Object.prototype.toObject.call(this,e);return i.objects=n,i},toDatalessObject:function(e){var r,n=this.sourcePath;if(n)r=n;else{var i=this.includeDefaultValues;r=this._objects.map(function(t){var r=t.includeDefaultValues;t.includeDefaultValues=i;var n=t.toDatalessObject(e);return t.includeDefaultValues=r,n})}var o=t.Object.prototype.toDatalessObject.call(this,e);return o.objects=r,o},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var r=0,n=this._objects.length;r<n;r++)if(this._objects[r].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,r=this._objects.length;e<r;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,r=this._objects.length;t<r;t++)this._objects[t].render(e);this._drawClipPath(e,this.clipPath)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,r=this._objects.length;t<r;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var n=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-n/2,-i/2,n,i)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(r){t.util.addTransformToObject(r,e),delete r.group,r.setCoords()}),this},destroy:function(){return this._objects.forEach(function(e){e.set("dirty",!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper("dispose"),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[]},toActiveSelection:function(){if(this.canvas){var e=this._objects,r=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var i=new t.ActiveSelection([]);return i.set(n),i.type="activeSelection",r.remove(this),e.forEach(function(e){e.group=i,e.dirty=!0,r.add(e)}),i.canvas=r,i._objects=e,r._activeObject=i,i.setCoords(),i}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(e){e.setCoords(!0)}),this},_calcBounds:function(e){for(var t,r,n,i,o=[],a=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,u=s.length;l<c;++l){for(n=(t=this._objects[l]).calcACoords(),i=0;i<u;i++)r=s[i],o.push(n[r].x),a.push(n[r].y);t.aCoords=n}this._getBounds(o,a,e)},_getBounds:function(e,i,o){var a=new t.Point(r(e),r(i)),s=new t.Point(n(e),n(i)),l=a.y||0,c=a.x||0,u=s.x-a.x||0,d=s.y-a.y||0;this.width=u,this.height=d,o||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],r=0,n=this._objects.length;r<n;r++)t.push("\t\t",this._objects[r].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=typeof this.opacity<"u"&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],r=0,n=this._objects.length;r<n;r++)t.push("\t",this._objects[r].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,r){var n=e.objects,i=t.util.object.clone(e,!0);delete i.objects,"string"!=typeof n?t.util.enlivenObjects(n,function(n){t.util.enlivenObjectEnlivables(e,i,function(){r&&r(new t.Group(n,i,!0))})}):t.loadSVGFromURL(n,function(o){var a=t.util.groupSVGElements(o,e,n),s=i.clipPath;delete i.clipPath,a.set(i),s?t.util.enlivenObjects([s],function(e){a.clipPath=e[0],r&&r(a)}):r&&r(a)})})}(e),function(e){var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,r){r=r||{},this._objects=e||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;r.originX&&(this.originX=r.originX),r.originY&&(this.originY=r.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,r),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var r=t.Object.prototype.toObject.call(this),n=new t.Group([]);if(delete r.type,n.set(r),e.forEach(function(e){e.canvas.remove(e),e.group=n}),n._objects=e,!this.canvas)return n;var i=this.canvas;return i.add(n),i._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,r){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),typeof(r=r||{}).hasControls>"u"&&(r.hasControls=!1),r.forActiveSelection=!0;for(var n=0,i=this._objects.length;n<i;n++)this._objects[n]._renderControls(e,r);e.restore()}}),t.ActiveSelection.fromObject=function(e,r){t.util.enlivenObjects(e.objects,function(n){delete e.objects,r&&r(new t.ActiveSelection(n,e,!0))})})}(e),function(e){var r=t.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?t.warn("fabric.Image is already defined."):(t.Image=t.util.createClass(t.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:t.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:t.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,r){r||(r={}),this.filters=[],this.cacheKey="texture"+t.Object.__uid++,this.callSuper("initialize",r),this._initElement(e,r)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var r=t.filterBackend;r&&r.evictCachesForKey&&r.evictCachesForKey(e)},dispose:function(){this.callSuper("dispose"),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){t.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,r=this.height/2;e.beginPath(),e.moveTo(-t,-r),e.lineTo(t,-r),e.lineTo(t,r),e.lineTo(-t,r),e.lineTo(-t,-r),e.closePath()}},toObject:function(e){var t=[];this.filters.forEach(function(e){e&&t.push(e.toObject())});var n=r(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:t});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,r=[],n=[],i=this._element,o=-this.width/2,a=-this.height/2,s="",l="";if(!i)return[];if(this.hasCrop()){var c=t.Object.__uid++;r.push('<clipPath id="imageCrop_'+c+'">\n','\t<rect x="'+o+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),s=' clip-path="url(#imageCrop_'+c+')" '}if(this.imageSmoothing||(l='" image-rendering="optimizeSpeed'),n.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',o-this.cropX,'" y="',a-this.cropY,'" width="',i.width||i.naturalWidth,'" height="',i.height||i.height,l,'"',s,"></image>\n"),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=["\t<rect ",'x="',o,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=u}return"fill"!==this.paintFirst?r.concat(e,n):r.concat(n,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,r,n){return t.util.loadImage(e,function(e,t){this.setElement(e,n),this._setWidthHeight(),r&&r(this,t)},this,n&&n.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,r=this.minimumScaleTrigger,n=this.getTotalObjectScaling(),i=n.scaleX,o=n.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||i>r&&o>r)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=o);t.filterBackend||(t.filterBackend=t.initFilterBackend());var s=t.util.createCanvasElement(),l=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,c=a.width,u=a.height;s.width=c,s.height=u,this._element=s,this._lastScaleX=e.scaleX=i,this._lastScaleY=e.scaleY=o,t.filterBackend.applyFilters([e],a,c,u,this._element,l),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter(function(e){return e&&!e.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var r=this._originalElement,n=r.naturalWidth||r.width,i=r.naturalHeight||r.height;if(this._element===this._originalElement){var o=t.util.createCanvasElement();o.width=n,o.height=i,this._element=o,this._filteredEl=o}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,n,i),this._lastScaleX=1,this._lastScaleY=1;return t.filterBackend||(t.filterBackend=t.initFilterBackend()),t.filterBackend.applyFilters(e,this._originalElement,n,i,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){t.util.setImageSmoothing(e,this.imageSmoothing),t.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var r=this._filterScalingX,n=this._filterScalingY,i=this.width,o=this.height,a=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),u=t.naturalWidth||t.width,d=t.naturalHeight||t.height,h=l*r,f=c*n,p=a(i*r,u-h),g=a(o*n,d-f),m=-i/2,v=-o/2,y=a(i,u/r-l),b=a(o,d/n-c);t&&e.drawImage(t,h,f,p,g,m,v,y,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,r){this.setElement(t.util.getById(e),r),t.util.addClass(this.getElement(),t.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,r){e&&e.length?t.util.enlivenObjects(e,function(e){r&&r(e)},"fabric.Image.filters"):r&&r()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,r=t.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),n=this._element.width,i=this._element.height,o=1,a=1,s=0,l=0,c=0,u=0,d=this.width,h=this.height,f={width:d,height:h};return!r||"none"===r.alignX&&"none"===r.alignY?(o=d/n,a=h/i):("meet"===r.meetOrSlice&&(e=(d-n*(o=a=t.util.findScaleToFit(this._element,f)))/2,"Min"===r.alignX&&(s=-e),"Max"===r.alignX&&(s=e),e=(h-i*a)/2,"Min"===r.alignY&&(l=-e),"Max"===r.alignY&&(l=e)),"slice"===r.meetOrSlice&&(e=n-d/(o=a=t.util.findScaleToCover(this._element,f)),"Mid"===r.alignX&&(c=e/2),"Max"===r.alignX&&(c=e),e=i-h/a,"Mid"===r.alignY&&(u=e/2),"Max"===r.alignY&&(u=e),n=d/o,i=h/a)),{width:n,height:i,scaleX:o,scaleY:a,offsetLeft:s,offsetTop:l,cropX:c,cropY:u}}}),t.Image.CSS_CANVAS="canvas-img",t.Image.prototype.getSvgSrc=t.Image.prototype.getSrc,t.Image.fromObject=function(e,r){var n=t.util.object.clone(e);t.util.loadImage(n.src,function(e,i){i?r&&r(null,!0):t.Image.prototype._initFilters.call(n,n.filters,function(i){n.filters=i||[],t.Image.prototype._initFilters.call(n,[n.resizeFilter],function(i){n.resizeFilter=i[0],t.util.enlivenObjectEnlivables(n,n,function(){var i=new t.Image(e,n);r(i,!1)})})})},null,n.crossOrigin)},t.Image.fromURL=function(e,r,n){t.util.loadImage(e,function(e,i){r&&r(new t.Image(e,n),i)},null,n&&n.crossOrigin)},t.Image.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),t.Image.fromElement=function(e,n,i){var o=t.parseAttributes(e,t.Image.ATTRIBUTE_NAMES);t.Image.fromURL(o["xlink:href"],n,r(i?t.util.object.clone(i):{},o))})}(e),t.util.object.extend(t.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(e){var r=function(){},n=(e=e||{}).onComplete||r,i=e.onChange||r,o=this;return t.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){o.rotate(e),i()},onComplete:function(){o.setCoords(),n()}})}}),t.util.object.extend(t.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function e(e,t){var r="precision "+t+" float;\nvoid main(){}",n=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,r),e.compileShader(n),!!e.getShaderParameter(n,e.COMPILE_STATUS)}function r(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}t.isWebglSupported=function(r){if(t.isLikelyNode)return!1;r=r||t.WebglFilterBackend.prototype.tileSize;var n=document.createElement("canvas"),i=n.getContext("webgl")||n.getContext("experimental-webgl"),o=!1;if(i){t.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),o=t.maxTextureSize>=r;for(var a=["highp","mediump","lowp"],s=0;s<3;s++)if(e(i,a[s])){t.webGlPrecision=a[s];break}}return this.isSupported=o,o},t.WebglFilterBackend=r,r.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,r){var o,a=typeof window.performance<"u";try{new ImageData(1,1),o=!0}catch{o=!1}var s=typeof ArrayBuffer<"u",l=typeof Uint8ClampedArray<"u";if(a&&o&&s&&l){var c=t.util.createCanvasElement(),u=new ArrayBuffer(e*r*4);if(t.forceGLPutImageData)return this.imageBuffer=u,void(this.copyGLTo2D=i);var d,h,f={imageBuffer:u,destinationWidth:e,destinationHeight:r,targetCanvas:c};c.width=e,c.height=r,d=window.performance.now(),n.call(f,this.gl,f),h=window.performance.now()-d,d=window.performance.now(),i.call(f,this.gl,f),h>window.performance.now()-d?(this.imageBuffer=u,this.copyGLTo2D=i):this.copyGLTo2D=n}},createWebGLCanvas:function(e,r){var n=t.util.createCanvasElement();n.width=e,n.height=r;var i={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=n.getContext("webgl",i);o||(o=n.getContext("experimental-webgl",i)),o&&(o.clearColor(0,0,0,0),this.canvas=n,this.gl=o)},applyFilters:function(e,t,r,n,i,o){var a,s=this.gl;o&&(a=this.getCachedTexture(o,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:r,sourceHeight:n,destinationWidth:r,destinationHeight:n,context:s,sourceTexture:this.createTexture(s,r,n,!a&&t),targetTexture:this.createTexture(s,r,n),originalTexture:a||this.createTexture(s,r,n,!a&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),e.forEach(function(e){e&&e.applyTo(l)}),function(e){var t=e.targetCanvas,r=t.width,n=t.height,i=e.destinationWidth,o=e.destinationHeight;(r!==i||n!==o)&&(t.width=i,t.height=o)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),i.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,r,n,i){var o=e.createTexture();return e.bindTexture(e.TEXTURE_2D,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,r,0,e.RGBA,e.UNSIGNED_BYTE,null),o},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var r=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=r,r},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:n,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var r=e.getExtension("WEBGL_debug_renderer_info");if(r){var n=e.getParameter(r.UNMASKED_RENDERER_WEBGL),i=e.getParameter(r.UNMASKED_VENDOR_WEBGL);n&&(t.renderer=n.toLowerCase()),i&&(t.vendor=i.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){var e=function(){};function r(){}t.Canvas2dFilterBackend=r,r.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,r,n,i){var o=i.getContext("2d");o.drawImage(t,0,0,r,n);var a={sourceWidth:r,sourceHeight:n,imageData:o.getImageData(0,0,r,n),originalEl:t,originalImageData:o.getImageData(0,0,r,n),canvasEl:i,ctx:o,filterBackend:this};return e.forEach(function(e){e.applyTo(a)}),(a.imageData.width!==r||a.imageData.height!==n)&&(i.width=a.imageData.width,i.height=a.imageData.height),o.putImageData(a.imageData,0,0),a}}}(),t.Image=t.Image||{},t.Image.filters=t.Image.filters||{},t.Image.filters.BaseFilter=t.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,r,n){r=r||this.fragmentSource,n=n||this.vertexSource,"highp"!==t.webGlPrecision&&(r=r.replace(/precision highp float/g,"precision "+t.webGlPrecision+" float"));var i=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(i,n),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(i));var o=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(o,r),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(o));var a=e.createProgram();if(e.attachShader(a,i),e.attachShader(a,o),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var s=this.getAttributeLocations(e,a),l=this.getUniformLocations(e,a)||{};return l.uStepW=e.getUniformLocation(a,"uStepW"),l.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:s,uniformLocations:l}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,r){var n=t.aPosition,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,r,n=e.context;e.passes>1?(t=e.destinationWidth,r=e.destinationHeight,(e.sourceWidth!==t||e.sourceHeight!==r)&&(n.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(n,t,r)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,r=t.Image.filters[this.type].prototype;if(e){if(Array.isArray(r[e])){for(var n=r[e].length;n--;)if(this[e][n]!==r[e][n])return!1;return!0}return r[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,r=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(r.program),this.sendAttributeData(t,r.attributeLocations,e.aPosition),t.uniform1f(r.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(r.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,r.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,r){e.activeTexture(r),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),t.Image.filters.BaseFilter.fromObject=function(e,r){var n=new t.Image.filters[e.type](e);return r&&r(n),n},function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.ColorMatrix=n(r.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,r,n,i,o,a=e.imageData.data,s=a.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<s;o+=4)t=a[o],r=a[o+1],n=a[o+2],c?(a[o]=t*l[0]+r*l[1]+n*l[2]+255*l[4],a[o+1]=t*l[5]+r*l[6]+n*l[7]+255*l[9],a[o+2]=t*l[10]+r*l[11]+n*l[12]+255*l[14]):(i=a[o+3],a[o]=t*l[0]+r*l[1]+n*l[2]+i*l[3]+255*l[4],a[o+1]=t*l[5]+r*l[6]+n*l[7]+i*l[8]+255*l[9],a[o+2]=t*l[10]+r*l[11]+n*l[12]+i*l[13]+255*l[14],a[o+3]=t*l[15]+r*l[16]+n*l[17]+i*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var r=this.matrix,n=[r[0],r[1],r[2],r[3],r[5],r[6],r[7],r[8],r[10],r[11],r[12],r[13],r[15],r[16],r[17],r[18]],i=[r[4],r[9],r[14],r[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,n),e.uniform4fv(t.uConstants,i)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Brightness=n(r.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,r=e.imageData.data,n=r.length,i=Math.round(255*this.brightness);for(t=0;t<n;t+=4)r[t]=r[t]+i,r[t+1]=r[t+1]+i,r[t+2]=r[t+2]+i}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.Image.filters,i=t.util.createClass;n.Convolute=i(n.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),r=this.type+"_"+t+"_"+(this.opaque?1:0),n=this.fragmentSource[r];return e.programCache.hasOwnProperty(r)||(e.programCache[r]=this.createProgram(e.context,n)),e.programCache[r]},applyTo2d:function(e){var t,r,n,i,o,a,s,l,c,u,d,h,f,p=e.imageData,g=p.data,m=this.matrix,v=Math.round(Math.sqrt(m.length)),y=Math.floor(v/2),b=p.width,w=p.height,x=e.ctx.createImageData(b,w),C=x.data,_=this.opaque?1:0;for(d=0;d<w;d++)for(u=0;u<b;u++){for(o=4*(d*b+u),t=0,r=0,n=0,i=0,f=0;f<v;f++)for(h=0;h<v;h++)a=u+h-y,!((s=d+f-y)<0||s>=w||a<0||a>=b)&&(l=4*(s*b+a),c=m[f*v+h],t+=g[l]*c,r+=g[l+1]*c,n+=g[l+2]*c,_||(i+=g[l+3]*c));C[o]=t,C[o+1]=r,C[o+2]=n,C[o+3]=_?g[o+3]:i}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return r(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Grayscale=n(r.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,r,n=e.imageData.data,i=n.length,o=this.mode;for(t=0;t<i;t+=4)"average"===o?r=(n[t]+n[t+1]+n[t+2])/3:"lightness"===o?r=(Math.min(n[t],n[t+1],n[t+2])+Math.max(n[t],n[t+1],n[t+2]))/2:"luminosity"===o&&(r=.21*n[t]+.72*n[t+1]+.07*n[t+2]),n[t]=r,n[t+1]=r,n[t+2]=r},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var r=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,r)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Invert=n(r.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,r=e.imageData.data,n=r.length;for(t=0;t<n;t+=4)r[t]=255-r[t],r[t+1]=255-r[t+1],r[t+2]=255-r[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.Image.filters,i=t.util.createClass;n.Noise=i(n.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,r,n=e.imageData.data,i=n.length,o=this.noise;for(t=0,i=n.length;t<i;t+=4)r=(.5-Math.random())*o,n[t]+=r,n[t+1]+=r,n[t+2]+=r}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return r(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Pixelate=n(r.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,r,n,i,o,a,s,l,c,u,d,h=e.imageData,f=h.data,p=h.height,g=h.width;for(r=0;r<p;r+=this.blocksize)for(n=0;n<g;n+=this.blocksize)for(i=f[t=4*r*g+4*n],o=f[t+1],a=f[t+2],s=f[t+3],u=Math.min(r+this.blocksize,p),d=Math.min(n+this.blocksize,g),l=r;l<u;l++)for(c=n;c<d;c++)f[t=4*l*g+4*c]=i,f[t+1]=o,f[t+2]=a,f[t+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.extend,n=t.Image.filters,i=t.util.createClass;n.RemoveColor=i(n.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var r,n,i,o,a=e.imageData.data,s=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],u=[l[0]+s,l[1]+s,l[2]+s];for(r=0;r<a.length;r+=4)n=a[r],i=a[r+1],o=a[r+2],n>c[0]&&i>c[1]&&o>c[2]&&n<u[0]&&i<u[1]&&o<u[2]&&(a[r+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,r){var n=new t.Color(this.color).getSource(),i=parseFloat(this.distance),o=[0+n[0]/255-i,0+n[1]/255-i,0+n[2]/255-i,1],a=[n[0]/255+i,n[1]/255+i,n[2]/255+i,1];e.uniform4fv(r.uLow,o),e.uniform4fv(r.uHigh,a)},toObject:function(){return r(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass,i={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var o in i)r[o]=n(r.ColorMatrix,{type:o,matrix:i[o],mainParameter:!1,colorsOnly:!0}),t.Image.filters[o].fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,r=t.Image.filters,n=t.util.createClass;r.BlendColor=n(r.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,r=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(r)||(t=this.buildSource(this.mode),e.programCache[r]=this.createProgram(e.context,t)),e.programCache[r]},applyTo2d:function(e){var r,n,i,o,a,s,l,c=e.imageData.data,u=c.length,d=1-this.alpha;r=(l=new t.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,i=l[2]*this.alpha;for(var h=0;h<u;h+=4)switch(o=c[h],a=c[h+1],s=c[h+2],this.mode){case"multiply":c[h]=o*r/255,c[h+1]=a*n/255,c[h+2]=s*i/255;break;case"screen":c[h]=255-(255-o)*(255-r)/255,c[h+1]=255-(255-a)*(255-n)/255,c[h+2]=255-(255-s)*(255-i)/255;break;case"add":c[h]=o+r,c[h+1]=a+n,c[h+2]=s+i;break;case"diff":case"difference":c[h]=Math.abs(o-r),c[h+1]=Math.abs(a-n),c[h+2]=Math.abs(s-i);break;case"subtract":c[h]=o-r,c[h+1]=a-n,c[h+2]=s-i;break;case"darken":c[h]=Math.min(o,r),c[h+1]=Math.min(a,n),c[h+2]=Math.min(s,i);break;case"lighten":c[h]=Math.max(o,r),c[h+1]=Math.max(a,n),c[h+2]=Math.max(s,i);break;case"overlay":c[h]=r<128?2*o*r/255:255-2*(255-o)*(255-r)/255,c[h+1]=n<128?2*a*n/255:255-2*(255-a)*(255-n)/255,c[h+2]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255;break;case"exclusion":c[h]=r+o-2*r*o/255,c[h+1]=n+a-2*n*a/255,c[h+2]=i+s-2*i*s/255;break;case"tint":c[h]=r+o*d,c[h+1]=n+a*d,c[h+2]=i+s*d}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,r){var n=new t.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,e.uniform4fv(r.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,r=t.Image.filters,n=t.util.createClass;r.BlendImage=n(r.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,r=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,r)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,r=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,r,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,r=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/r,1]},applyTo2d:function(e){var r,n,i,o,a,s,l,c,u,d,h,f=e.imageData,p=e.filterBackend.resources,g=f.data,m=g.length,v=f.width,y=f.height,b=this.image;p.blendImage||(p.blendImage=t.util.createCanvasElement()),d=(u=p.blendImage).getContext("2d"),u.width!==v||u.height!==y?(u.width=v,u.height=y):d.clearRect(0,0,v,y),d.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),d.drawImage(b._element,0,0,v,y),h=d.getImageData(0,0,v,y).data;for(var w=0;w<m;w+=4)switch(a=g[w],s=g[w+1],l=g[w+2],c=g[w+3],r=h[w],n=h[w+1],i=h[w+2],o=h[w+3],this.mode){case"multiply":g[w]=a*r/255,g[w+1]=s*n/255,g[w+2]=l*i/255,g[w+3]=c*o/255;break;case"mask":g[w+3]=o}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var r=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,r)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,r){t.Image.fromObject(e.image,function(n){var i=t.util.object.clone(e);i.image=n,r(new t.Image.filters.BlendImage(i))})}}(e),function(e){var t=e.fabric||(e.fabric={}),r=Math.pow,n=Math.floor,i=Math.sqrt,o=Math.abs,a=Math.round,s=Math.sin,l=Math.ceil,c=t.Image.filters,u=t.util.createClass;c.Resize=u(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),r=this.type+"_"+t;if(!e.programCache.hasOwnProperty(r)){var n=this.generateShader(t);e.programCache[r]=this.createProgram(e.context,n)}return e.programCache[r]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,r=this.getFilterWindow(),n=new Array(r),i=1;i<=r;i++)n[i-1]=e(i*t);return n},generateShader:function(e){for(var t=new Array(e),r=this.fragmentSourceTOP,n=1;n<=e;n++)t[n-1]=n+".0 * uDelta";return r+="uniform float uTaps["+e+"];\n",r+="void main() {\n",r+=" vec4 color = texture2D(uTexture, vTexCoord);\n",r+=" float sum = 1.0;\n",t.forEach(function(e,t){r+=" color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",r+=" color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",r+=" sum += 2.0 * uTaps["+t+"];\n"}),r+=" gl_FragColor = color / sum;\n",r+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var r=(t*=Math.PI)/e;return s(t)/t*s(r)/r}},applyTo2d:function(e){var t=e.imageData,r=this.scaleX,n=this.scaleY;this.rcpScaleX=1/r,this.rcpScaleY=1/n;var i,o=t.width,s=t.height,l=a(o*r),c=a(s*n);"sliceHack"===this.resizeType?i=this.sliceByTwo(e,o,s,l,c):"hermite"===this.resizeType?i=this.hermiteFastResize(e,o,s,l,c):"bilinear"===this.resizeType?i=this.bilinearFiltering(e,o,s,l,c):"lanczos"===this.resizeType&&(i=this.lanczosResize(e,o,s,l,c)),e.imageData=i},sliceByTwo:function(e,r,i,o,a){var s,l,c=e.imageData,u=.5,d=!1,h=!1,f=r*u,p=i*u,g=t.filterBackend.resources,m=0,v=0,y=r,b=0;for(g.sliceByTwo||(g.sliceByTwo=document.createElement("canvas")),((s=g.sliceByTwo).width<1.5*r||s.height<i)&&(s.width=1.5*r,s.height=i),(l=s.getContext("2d")).clearRect(0,0,1.5*r,i),l.putImageData(c,0,0),o=n(o),a=n(a);!d||!h;)r=f,i=p,o<n(f*u)?f=n(f*u):(f=o,d=!0),a<n(p*u)?p=n(p*u):(p=a,h=!0),l.drawImage(s,m,v,r,i,y,b,f,p),m=y,v=b,b+=p;return l.getImageData(m,v,o,a)},lanczosResize:function(e,t,a,s,c){var u=e.imageData.data,d=e.ctx.createImageData(s,c),h=d.data,f=this.lanczosCreate(this.lanczosLobes),p=this.rcpScaleX,g=this.rcpScaleY,m=2/this.rcpScaleX,v=2/this.rcpScaleY,y=l(p*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},C={};return function e(l){var _,S,A,k,E,I,j,T,F,O,M;for(x.x=(l+.5)*p,C.x=n(x.x),_=0;_<c;_++){for(x.y=(_+.5)*g,C.y=n(x.y),E=0,I=0,j=0,T=0,F=0,S=C.x-y;S<=C.x+y;S++)if(!(S<0||S>=t)){O=n(1e3*o(S-x.x)),w[O]||(w[O]={});for(var P=C.y-b;P<=C.y+b;P++)P<0||P>=a||(M=n(1e3*o(P-x.y)),w[O][M]||(w[O][M]=f(i(r(O*m,2)+r(M*v,2))/1e3)),(A=w[O][M])>0&&(E+=A,I+=A*u[k=4*(P*t+S)],j+=A*u[k+1],T+=A*u[k+2],F+=A*u[k+3]))}h[k=4*(_*s+l)]=I/E,h[k+1]=j/E,h[k+2]=T/E,h[k+3]=F/E}return++l<s?e(l):d}(0)},bilinearFiltering:function(e,t,r,i,o){var a,s,l,c,u,d,h,f,p,g=0,m=this.rcpScaleX,v=this.rcpScaleY,y=4*(t-1),b=e.imageData.data,w=e.ctx.createImageData(i,o),x=w.data;for(l=0;l<o;l++)for(c=0;c<i;c++)for(u=m*c-(a=n(m*c)),d=v*l-(s=n(v*l)),p=4*(s*t+a),h=0;h<4;h++)f=b[p+h]*(1-u)*(1-d)+b[p+4+h]*u*(1-d)+b[p+y+h]*d*(1-u)+b[p+y+4+h]*u*d,x[g++]=f;return w},hermiteFastResize:function(e,t,r,a,s){for(var c=this.rcpScaleX,u=this.rcpScaleY,d=l(c/2),h=l(u/2),f=e.imageData.data,p=e.ctx.createImageData(a,s),g=p.data,m=0;m<s;m++)for(var v=0;v<a;v++){for(var y=4*(v+m*a),b=0,w=0,x=0,C=0,_=0,S=0,A=0,k=(m+.5)*u,E=n(m*u);E<(m+1)*u;E++)for(var I=o(k-(E+.5))/h,j=(v+.5)*c,T=I*I,F=n(v*c);F<(v+1)*c;F++){var O=o(j-(F+.5))/d,M=i(T+O*O);M>1&&M<-1||(b=2*M*M*M-3*M*M+1)>0&&(A+=b*f[3+(O=4*(F+E*t))],x+=b,f[O+3]<255&&(b=b*f[O+3]/250),C+=b*f[O],_+=b*f[O+1],S+=b*f[O+2],w+=b)}g[y]=C/w,g[y+1]=_/w,g[y+2]=S/w,g[y+3]=A/x}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Contrast=n(r.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,r=e.imageData.data,n=r.length,i=Math.floor(255*this.contrast),o=259*(i+255)/(255*(259-i));for(t=0;t<n;t+=4)r[t]=o*(r[t]-128)+128,r[t+1]=o*(r[t+1]-128)+128,r[t+2]=o*(r[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Saturation=n(r.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,r,n=e.imageData.data,i=n.length,o=-this.saturation;for(t=0;t<i;t+=4)r=Math.max(n[t],n[t+1],n[t+2]),n[t]+=r!==n[t]?(r-n[t])*o:0,n[t+1]+=r!==n[t+1]?(r-n[t+1])*o:0,n[t+2]+=r!==n[t+2]?(r-n[t+2])*o:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Vibrance=n(r.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,r,n,i,o=e.imageData.data,a=o.length,s=-this.vibrance;for(t=0;t<a;t+=4)r=Math.max(o[t],o[t+1],o[t+2]),n=(o[t]+o[t+1]+o[t+2])/3,i=2*Math.abs(r-n)/255*s,o[t]+=r!==o[t]?(r-o[t])*i:0,o[t+1]+=r!==o[t+1]?(r-o[t+1])*i:0,o[t+2]+=r!==o[t+2]?(r-o[t+2])*i:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Blur=n(r.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var r,n,i=e.filterBackend.resources,o=e.imageData.width,a=e.imageData.height;i.blurLayer1||(i.blurLayer1=t.util.createCanvasElement(),i.blurLayer2=t.util.createCanvasElement()),r=i.blurLayer1,n=i.blurLayer2,(r.width!==o||r.height!==a)&&(n.width=r.width=o,n.height=r.height=a);var s,l,c,u,d=r.getContext("2d"),h=n.getContext("2d"),f=15,p=.06*this.blur*.5;for(d.putImageData(e.imageData,0,0),h.clearRect(0,0,o,a),u=-f;u<=f;u++)c=p*(l=u/f)*o+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(r,c,s),d.drawImage(n,0,0),h.globalAlpha=1,h.clearRect(0,0,n.width,n.height);for(u=-f;u<=f;u++)c=p*(l=u/f)*a+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(r,s,c),d.drawImage(n,0,0),h.globalAlpha=1,h.clearRect(0,0,n.width,n.height);e.ctx.drawImage(r,0,0);var g=e.ctx.getImageData(0,0,r.width,r.height);return d.globalAlpha=1,d.clearRect(0,0,r.width,r.height),g},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var r=this.chooseRightDelta();e.uniform2fv(t.delta,r)},chooseRightDelta:function(){var e,t=1,r=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?r[0]=e:r[1]=e,r}}),r.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Gamma=n(r.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],r.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,r=e.imageData.data,n=this.gamma,i=r.length,o=1/n[0],a=1/n[1],s=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,i=256;t<i;t++)this.rVals[t]=255*Math.pow(t/255,o),this.gVals[t]=255*Math.pow(t/255,a),this.bVals[t]=255*Math.pow(t/255,s);for(t=0,i=r.length;t<i;t+=4)r[t]=this.rVals[r[t]],r[t+1]=this.gVals[r[t+1]],r[t+2]=this.bVals[r[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.Composed=n(r.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(e){return e.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(e){return!e.isNeutralState()})}}),t.Image.filters.Composed.fromObject=function(e,r){var n=(e.subFilters||[]).map(function(e){return new t.Image.filters[e.type](e)}),i=new t.Image.filters.Composed({subFilters:n});return r&&r(i),i}}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.Image.filters,n=t.util.createClass;r.HueRotation=n(r.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,r=t.util.cos(e),n=t.util.sin(e),i=1/3,o=Math.sqrt(i)*n,a=1-r;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=r+a/3,this.matrix[1]=i*a-o,this.matrix[2]=i*a+o,this.matrix[5]=i*a+o,this.matrix[6]=r+i*a,this.matrix[7]=i*a-o,this.matrix[10]=i*a-o,this.matrix[11]=i*a+o,this.matrix[12]=r+i*a},isNeutralState:function(e){return this.calculateMatrix(),r.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),r.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),r=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var n="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:t.Object.prototype.stateProperties.concat(n),cacheProperties:t.Object.prototype.cacheProperties.concat(n),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,r,n,i,o,a,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(n=0,i=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(a=this.textLines[s].match(this._reSpacesAndTabs)))){r=a.length,e=(this.width-t)/r;for(var c=0,u=i.length;c<=u;c++)o=this.__charBounds[s][c],this._reSpaceAndTab.test(i[c])?(o.width+=e,o.kernedWidth+=e,o.left+=n,n+=e):o.left+=n}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,r){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom"}e.font=this._getFontDeclaration(t,r)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,r=this._textLines.length;t<r;t++){var n=this.getLineWidth(t);n>e&&(e=n)}return e},_renderTextLine:function(e,t,r,n,i,o){this._renderChars(e,t,r,n,i,o)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,r,n,i,o,a,s,l=e.fillStyle,c=this._getLeftOffset(),u=this._getTopOffset(),d=0,h=0,f=this.path,p=0,g=this._textLines.length;p<g;p++)if(t=this.getHeightOfLine(p),this.textBackgroundColor||this.styleHas("textBackgroundColor",p)){n=this._textLines[p],r=this._getLineLeftOffset(p),h=0,d=0,i=this.getValueOfPropertyAt(p,0,"textBackgroundColor");for(var m=0,v=n.length;m<v;m++)o=this.__charBounds[p][m],a=this.getValueOfPropertyAt(p,m,"textBackgroundColor"),f?(e.save(),e.translate(o.renderLeft,o.renderTop),e.rotate(o.angle),e.fillStyle=a,a&&e.fillRect(-o.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),o.width,t/this.lineHeight),e.restore()):a!==i?(s=c+r+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=i,i&&e.fillRect(s,u,h,t/this.lineHeight),d=o.left,h=o.width,i=a):h+=o.kernedWidth;a&&!f&&(s=c+r+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=a,e.fillRect(s,u,h,t/this.lineHeight)),u+=t}else u+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var r=e.fontFamily.toLowerCase();t.charWidthsCache[r]||(t.charWidthsCache[r]={});var n=t.charWidthsCache[r],i=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return n[i]||(n[i]={}),n[i]},_measureChar:function(e,t,r,n){var i,o,a,s,l=this.getFontCache(t),c=r+e,u=this._getFontDeclaration(t)===this._getFontDeclaration(n),d=t.fontSize/this.CACHE_FONT_SIZE;if(r&&void 0!==l[r]&&(a=l[r]),void 0!==l[e]&&(s=i=l[e]),u&&void 0!==l[c]&&(s=(o=l[c])-a),void 0===i||void 0===a||void 0===o){var h=this.getMeasuringContext();this._setTextStyles(h,t,!0)}return void 0===i&&(s=i=h.measureText(e).width,l[e]=i),void 0===a&&u&&r&&(a=h.measureText(r).width,l[r]=a),u&&void 0===o&&(o=h.measureText(c).width,l[c]=o,s=o-a),{width:i*d,kernedWidth:s*d}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var r,n,i,o,a,s,l=0,c=this._textLines[e],u=new Array(c.length),d=0,h=this.path,f="right"===this.pathSide;for(this.__charBounds[e]=u,r=0;r<c.length;r++)n=c[r],o=this._getGraphemeBox(n,e,r,i),u[r]=o,l+=o.kernedWidth,i=n;if(u[r]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},h){switch(s=h.segmentsInfo[h.segmentsInfo.length-1].length,(a=t.util.getPointOnPath(h.path,0,h.segmentsInfo)).x+=h.pathOffset.x,a.y+=h.pathOffset.y,this.textAlign){case"left":d=f?s-l:0;break;case"center":d=(s-l)/2;break;case"right":d=f?0:s-l}for(d+=this.pathStartOffset*(f?-1:1),r=f?c.length-1:0;f?r>=0:r<c.length;f?r--:r++)o=u[r],d>s?d%=s:d<0&&(d+=s),this._setGraphemeOnPath(d,o,a),d+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,r,n){var i=e+r.kernedWidth/2,o=this.path,a=t.util.getPointOnPath(o.path,i,o.segmentsInfo);r.renderLeft=a.x-n.x,r.renderTop=a.y-n.y,r.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,r,n,i){var o,a=this.getCompleteStyleDeclaration(t,r),s=n?this.getCompleteStyleDeclaration(t,r-1):{},l=this._measureChar(e,a,n,s),c=l.kernedWidth,u=l.width;0!==this.charSpacing&&(u+=o=this._getWidthOfCharSpacing(),c+=o);var d={width:u,left:0,height:a.fontSize,kernedWidth:c,deltaY:a.deltaY};if(r>0&&!i){var h=this.__charBounds[t][r-1];d.left=h.left+h.width+l.kernedWidth-l.width}return d},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],r=this.getHeightOfChar(e,0),n=1,i=t.length;n<i;n++)r=Math.max(this.getHeightOfChar(e,n),r);return this.__lineHeights[e]=r*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,r=0,n=this._textLines.length;r<n;r++)e=this.getHeightOfLine(r),t+=r===n-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var r=0,n=this._getLeftOffset(),i=this._getTopOffset(),o=0,a=this._textLines.length;o<a;o++){var s=this.getHeightOfLine(o),l=s/this.lineHeight,c=this._getLineLeftOffset(o);this._renderTextLine(t,e,this._textLines[o],n+c,i+r+l,o),r+=s}e.restore()},_renderTextFill:function(e){!this.fill&&!this.styleHas("fill")||this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(!this.stroke||0===this.strokeWidth)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,r,n,i,o,a){var s,l,c,u,d,h=this.getHeightOfLine(a),f=-1!==this.textAlign.indexOf("justify"),p="",g=0,m=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(a)&&!m,y="ltr"===this.direction,b="ltr"===this.direction?1:-1,w=r.canvas.getAttribute("dir");if(r.save(),w!==this.direction&&(r.canvas.setAttribute("dir",y?"ltr":"rtl"),r.direction=y?"ltr":"rtl",r.textAlign=y?"left":"right"),o-=h*this._fontSizeFraction/this.lineHeight,v)return this._renderChar(e,r,a,0,n.join(""),i,o,h),void r.restore();for(var x=0,C=n.length-1;x<=C;x++)u=x===C||this.charSpacing||m,p+=n[x],c=this.__charBounds[a][x],0===g?(i+=b*(c.kernedWidth-c.width),g+=c.width):g+=c.kernedWidth,f&&!u&&this._reSpaceAndTab.test(n[x])&&(u=!0),u||(s=s||this.getCompleteStyleDeclaration(a,x),l=this.getCompleteStyleDeclaration(a,x+1),u=t.util.hasStyleChanged(s,l,!1)),u&&(m?(r.save(),r.translate(c.renderLeft,c.renderTop),r.rotate(c.angle),this._renderChar(e,r,a,x,p,-g/2,0,h),r.restore()):(d=i,this._renderChar(e,r,a,x,p,d,o,h)),p="",s=l,i+=b*g,g=0);r.restore()},_applyPatternGradientTransformText:function(e){var r,n=t.util.createCanvasElement(),i=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return n.width=i,n.height=o,(r=n.getContext("2d")).beginPath(),r.moveTo(0,0),r.lineTo(i,0),r.lineTo(i,o),r.lineTo(0,o),r.closePath(),r.translate(i/2,o/2),r.fillStyle=e.toLive(r),this._applyPatternGradientTransform(r,e),r.fill(),r.createPattern(n,"no-repeat")},handleFiller:function(e,t,r){var n,i;return r.toLive?"percentage"===r.gradientUnits||r.gradientTransform||r.patternTransform?(n=-this.width/2,i=-this.height/2,e.translate(n,i),e[t]=this._applyPatternGradientTransformText(r),{offsetX:n,offsetY:i}):(e[t]=r.toLive(e,this),this._applyPatternGradientTransform(e,r)):(e[t]=r,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,r,n,i,o,a){var s,l,c=this._getStyleDeclaration(r,n),u=this.getCompleteStyleDeclaration(r,n),d="fillText"===e&&u.fill,h="strokeText"===e&&u.stroke&&u.strokeWidth;!h&&!d||(t.save(),d&&(s=this._setFillStyles(t,u)),h&&(l=this._setStrokeStyles(t,u)),t.font=this._getFontDeclaration(u),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(a+=c.deltaY),d&&t.fillText(i,o-s.offsetX,a-s.offsetY),h&&t.strokeText(i,o-l.offsetX,a-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,r){var n=this.get2DCursorLocation(e,!0),i=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),o=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),a={fontSize:i*r.size,deltaY:o+i*r.baseline};return this.setSelectionStyles(a,e,t),this},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),r=this.width-t,n=this.textAlign,i=this.direction,o=0,a=this.isEndOfWrapping(e);return"justify"===n||"justify-center"===n&&!a||"justify-right"===n&&!a||"justify-left"===n&&!a?0:("center"===n&&(o=r/2),"right"===n&&(o=r),"justify-center"===n&&(o=r/2),"justify-right"===n&&(o=r),"rtl"===i&&(o-=r),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){if(void 0!==this.__lineWidths[e])return this.__lineWidths[e];var t=this.measureLine(e).width;return this.__lineWidths[e]=t,t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,r){var n=this._getStyleDeclaration(e,t);return n&&typeof n[r]<"u"?n[r]:this[r]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[t],_=0,S=this._textLines.length;_<S;_++)if(r=this.getHeightOfLine(_),this[t]||this.styleHas(t,_)){l=this._textLines[_],g=r/this.lineHeight,o=this._getLineLeftOffset(_),d=0,h=0,c=this.getValueOfPropertyAt(_,0,t),v=this.getValueOfPropertyAt(_,0,"fill"),u=b+g*(1-this._fontSizeFraction),n=this.getHeightOfChar(_,0),a=this.getValueOfPropertyAt(_,0,"deltaY");for(var A=0,k=l.length;A<k;A++)if(f=this.__charBounds[_][A],p=this.getValueOfPropertyAt(_,A,t),m=this.getValueOfPropertyAt(_,A,"fill"),i=this.getHeightOfChar(_,A),s=this.getValueOfPropertyAt(_,A,"deltaY"),w&&p&&m)e.save(),e.fillStyle=v,e.translate(f.renderLeft,f.renderTop),e.rotate(f.angle),e.fillRect(-f.kernedWidth/2,C*i+s,f.kernedWidth,this.fontSize/15),e.restore();else if((p!==c||m!==v||i!==n||s!==a)&&h>0){var E=y+o+d;"rtl"===this.direction&&(E=this.width-E-h),c&&v&&(e.fillStyle=v,e.fillRect(E,u+C*n+a,h,this.fontSize/15)),d=f.left,h=f.width,c=p,v=m,n=i,a=s}else h+=f.kernedWidth;E=y+o+d,"rtl"===this.direction&&(E=this.width-E-h),e.fillStyle=m,p&&m&&e.fillRect(E,u+C*n+a,h-x,this.fontSize/15),b+=r}else b+=r;this._removeShadow(e)}},_getFontDeclaration:function(e,r){var n=e||this,i=this.fontFamily,o=t.Text.genericFonts.indexOf(i.toLowerCase())>-1,a=void 0===i||i.indexOf("'")>-1||i.indexOf(",")>-1||i.indexOf('"')>-1||o?n.fontFamily:'"'+n.fontFamily+'"';return[t.isLikelyNode?n.fontWeight:n.fontStyle,t.isLikelyNode?n.fontStyle:n.fontWeight,r?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",a].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var r=e.split(this._reNewline),n=new Array(r.length),i=["\n"],o=[],a=0;a<r.length;a++)n[a]=t.util.string.graphemeSplit(r[a]),o=o.concat(n[a],i);return o.pop(),{_unwrappedLines:n,lines:r,graphemeText:o,graphemeLines:n}},toObject:function(e){var r=n.concat(e),i=this.callSuper("toObject",r);return i.styles=t.util.stylesToArray(this.styles,this.text),i.path&&(i.path=this.path.toObject()),i},set:function(e,t){this.callSuper("set",e,t);var r=!1,n=!1;if("object"==typeof e)for(var i in e)"path"===i&&this.setPathInfo(),r=r||-1!==this._dimensionAffectingProps.indexOf(i),n=n||"path"===i;else r=-1!==this._dimensionAffectingProps.indexOf(e),n="path"===e;return n&&this.setPathInfo(),r&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,n,i){if(!e)return n(null);var o=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),a=o.textAnchor||"left";if((i=t.util.object.extend(i?r(i):{},o)).top=i.top||0,i.left=i.left||0,o.textDecoration){var s=o.textDecoration;-1!==s.indexOf("underline")&&(i.underline=!0),-1!==s.indexOf("overline")&&(i.overline=!0),-1!==s.indexOf("line-through")&&(i.linethrough=!0),delete i.textDecoration}"dx"in o&&(i.left+=o.dx),"dy"in o&&(i.top+=o.dy),"fontSize"in i||(i.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=i.strokeWidth;i.strokeWidth=0;var u=new t.Text(l,i),d=u.getScaledHeight()/u.height,h=((u.height+u.strokeWidth)*u.lineHeight-u.height)*d,f=u.getScaledHeight()+h,p=0;"center"===a&&(p=u.getScaledWidth()/2),"right"===a&&(p=u.getScaledWidth()),u.set({left:u.left-p,top:u.top-(f-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:typeof c<"u"?c:1}),n(u)},t.Text.fromObject=function(e,n){var i=r(e),o=e.path;return delete i.path,t.Object._fromObject("Text",i,function(r){r.styles=t.util.stylesFromArray(e.styles,e.text),o?t.Object._fromObject("Path",o,function(e){r.set("path",e),n(r)},"path"):n(r)},"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(e),t.util.object.extend(t.Text.prototype,{isEmptyStyles:function(e){if(!this.styles||typeof e<"u"&&!this.styles[e])return!0;var t=typeof e>"u"?this.styles:{line:this.styles[e]};for(var r in t)for(var n in t[r])for(var i in t[r][n])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e||typeof t<"u"&&!this.styles[t])return!1;var r=typeof t>"u"?this.styles:{0:this.styles[t]};for(var n in r)for(var i in r[n])if(typeof r[n][i][e]<"u")return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,r,n=this.styles,i=0,o=!0,a=0;for(var s in n){for(var l in t=0,n[s]){var c;i++,(c=n[s][l]).hasOwnProperty(e)?(r?c[e]!==r&&(o=!1):r=c[e],c[e]===this[e]&&delete c[e]):o=!1,0!==Object.keys(c).length?t++:delete n[s][l]}0===t&&delete n[s]}for(var u=0;u<this._textLines.length;u++)a+=this._textLines[u].length;o&&i===a&&(this[e]=r,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,r,n,i=this.styles;for(r in i){for(n in t=i[r])delete t[n][e],0===Object.keys(t[n]).length&&delete t[n];0===Object.keys(t).length&&delete i[r]}}},_extendStyles:function(e,r){var n=this.get2DCursorLocation(e);this._getLineStyle(n.lineIndex)||this._setLineStyle(n.lineIndex),this._getStyleDeclaration(n.lineIndex,n.charIndex)||this._setStyleDeclaration(n.lineIndex,n.charIndex,{}),t.util.object.extend(this._getStyleDeclaration(n.lineIndex,n.charIndex),r)},get2DCursorLocation:function(e,t){typeof e>"u"&&(e=this.selectionStart);for(var r=t?this._unwrappedTextLines:this._textLines,n=r.length,i=0;i<n;i++){if(e<=r[i].length)return{lineIndex:i,charIndex:e};e-=r[i].length+this.missingNewlineOffset(i)}return{lineIndex:i-1,charIndex:r[i-1].length<e?r[i-1].length:e}},getSelectionStyles:function(e,t,r){typeof e>"u"&&(e=this.selectionStart||0),typeof t>"u"&&(t=this.selectionEnd||e);for(var n=[],i=e;i<t;i++)n.push(this.getStyleAtPosition(i,r));return n},getStyleAtPosition:function(e,t){var r=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(r.lineIndex,r.charIndex):this._getStyleDeclaration(r.lineIndex,r.charIndex))||{}},setSelectionStyles:function(e,t,r){typeof t>"u"&&(t=this.selectionStart||0),typeof r>"u"&&(r=this.selectionEnd||t);for(var n=t;n<r;n++)this._extendStyles(n,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var r=this.styles&&this.styles[e];return r?r[t]:null},getCompleteStyleDeclaration:function(e,t){for(var r,n=this._getStyleDeclaration(e,t)||{},i={},o=0;o<this._styleProperties.length;o++)i[r=this._styleProperties[o]]=typeof n[r]>"u"?this[r]:n[r];return i},_setStyleDeclaration:function(e,t,r){this.styles[e][t]=r},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}t.IText=t.util.createClass(t.Text,t.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,r=this.canvas.viewportTransform;t.save(),t.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,r=this.height+4;e.clearRect(-t/2,-r/2,t,r)},_getCursorBoundaries:function(e){typeof e>"u"&&(e=this.selectionStart);var t=this._getLeftOffset(),r=this._getTopOffset(),n=this._getCursorBoundariesOffsets(e);return{left:t,top:r,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,r,n,i,o=0,a=0,s=this.get2DCursorLocation(e);n=s.charIndex,r=s.lineIndex;for(var l=0;l<r;l++)o+=this.getHeightOfLine(l);t=this._getLineLeftOffset(r);var c=this.__charBounds[r][n];return c&&(a=c.left),0!==this.charSpacing&&n===this._textLines[r].length&&(a-=this._getWidthOfCharSpacing()),i={top:o,left:t+(a>0?a:0)},"rtl"===this.direction&&(i.left*=-1),this.cursorOffsetCache=i,this.cursorOffsetCache},renderCursor:function(e,t){var r=this.get2DCursorLocation(),n=r.lineIndex,i=r.charIndex>0?r.charIndex-1:0,o=this.getValueOfPropertyAt(n,i,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,l=e.topOffset,c=this.getValueOfPropertyAt(n,i,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,i,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+c,s,o)},renderSelection:function(e,t){for(var r=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,i=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(r),a=this.get2DCursorLocation(n),s=o.lineIndex,l=a.lineIndex,c=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex,d=s;d<=l;d++){var h,f=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),g=0,m=0;if(d===s&&(g=this.__charBounds[s][c].left),d>=s&&d<l)m=i&&!this.isEndOfWrapping(d)?this.width:this.getLineWidth(d)||5;else if(d===l)if(0===u)m=this.__charBounds[l][u].left;else{var v=this._getWidthOfCharSpacing();m=this.__charBounds[l][u-1].left+this.__charBounds[l][u-1].width-v}h=p,(this.lineHeight<1||d===l&&this.lineHeight>1)&&(p/=this.lineHeight);var y=e.left+f+g,b=m-g,w=p,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=p):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),t.fillRect(y,e.top+e.topOffset+x,b,w),e.topOffset+=h}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),t.IText.fromObject=function(r,n){var i=t.util.stylesFromArray(r.styles,r.text),o=Object.assign({},r,{styles:i});if(e(o),o.styles)for(var a in o.styles)for(var s in o.styles[a])e(o.styles[a][s]);t.Object._fromObject("IText",o,n,"text")}}(),function(){var e=t.util.object.clone;t.util.object.extend(t.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on("removed",function(){var r=e.canvas;r&&(r._iTextInstances=r._iTextInstances||[],t.util.removeFromArray(r._iTextInstances,e),0===r._iTextInstances.length&&(r._hasITextHandlers=!1,e._removeCanvasHandlers(r)))})},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.__isMousedown=!1})},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,r,n){var i;return i={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:r,onComplete:function(){i.isAborted||e[n]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return i.isAborted}}),i},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(e){var t=this,r=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){t._tick()},r)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,r=e-1;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)t++,r--;for(;/\S/.test(this._text[r])&&r>-1;)t++,r--;return e-t},findWordBoundaryRight:function(e){var t=0,r=e;if(this._reSpace.test(this._text[r]))for(;this._reSpace.test(this._text[r]);)t++,r++;for(;/\S/.test(this._text[r])&&r<this._text.length;)t++,r++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,r=e-1;!/\n/.test(this._text[r])&&r>-1;)t++,r--;return e-t},findLineBoundaryRight:function(e){for(var t=0,r=e;!/\n/.test(this._text[r])&&r<this._text.length;)t++,r++;return e+t},searchWordBoundary:function(e,r){for(var n=this._text,i=this._reSpace.test(n[e])?e-1:e,o=n[i],a=t.reNonWord;!a.test(o)&&i>0&&i<n.length;)o=n[i+=r];return a.test(o)&&(i+=1===r?0:1),i},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),r=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=r,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),r=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=r,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.selected=!1,e.isEditing&&e.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){document.activeElement!==this.hiddenTextarea&&this.hiddenTextarea.focus();var t=this.getSelectionStartFromPointer(e.e),r=this.selectionStart,n=this.selectionEnd;(t!==this.__selectionStartOnMouseDown||r===n)&&(r===t||n===t)||(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==r||this.selectionEnd!==n)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,r,n){var i=n.slice(0,e),o=t.util.string.graphemeSplit(i).length;if(e===r)return{selectionStart:o,selectionEnd:o};var a=n.slice(e,r);return{selectionStart:o,selectionEnd:o+t.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,r){var n=r.slice(0,e).join("").length;return e===t?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+r.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,r=this._getCursorBoundaries(e),n=this.get2DCursorLocation(e),i=n.lineIndex,o=n.charIndex,a=this.getValueOfPropertyAt(i,o,"fontSize")*this.lineHeight,s=r.leftOffset,l=this.calcTransformMatrix(),c={x:r.left+s,y:r.top+r.topOffset+a},u=this.canvas.getRetinaScaling(),d=this.canvas.upperCanvasEl,h=d.width/u,f=d.height/u,p=h-a,g=f-a,m=d.clientWidth/h,v=d.clientHeight/f;return c=t.util.transformPoint(c,l),(c=t.util.transformPoint(c,this.canvas.viewportTransform)).x*=m,c.y*=v,c.x<0&&(c.x=0),c.x>p&&(c.x=p),c.y<0&&(c.y=0),c.y>g&&(c.y=g),c.x+=this.canvas._offset.left,c.y+=this.canvas._offset.top,{left:c.x+"px",top:c.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var r,n,i=this.get2DCursorLocation(e,!0),o=this.get2DCursorLocation(t,!0),a=i.lineIndex,s=i.charIndex,l=o.lineIndex,c=o.charIndex;if(a!==l){if(this.styles[a])for(r=s;r<this._unwrappedTextLines[a].length;r++)delete this.styles[a][r];if(this.styles[l])for(r=c;r<this._unwrappedTextLines[l].length;r++)(n=this.styles[l][r])&&(this.styles[a]||(this.styles[a]={}),this.styles[a][s+r-c]=n);for(r=a+1;r<=l;r++)delete this.styles[r];this.shiftLineStyles(l,a-l)}else if(this.styles[a]){n=this.styles[a];var u,d,h=c-s;for(r=s;r<c;r++)delete n[r];for(d in this.styles[a])(u=parseInt(d,10))>=c&&(n[u-h]=n[d],delete n[d])}},shiftLineStyles:function(t,r){var n=e(this.styles);for(var i in this.styles){var o=parseInt(i,10);o>t&&(this.styles[o+r]=n[o],n[o-r]||delete this.styles[o])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(t,r,n,i){var o,a={},s=!1,l=this._unwrappedTextLines[t].length===r;for(var c in n||(n=1),this.shiftLineStyles(t,n),this.styles[t]&&(o=this.styles[t][0===r?r:r-1]),this.styles[t]){var u=parseInt(c,10);u>=r&&(s=!0,a[u-r]=this.styles[t][c],l&&0===r||delete this.styles[t][c])}var d=!1;for(s&&!l&&(this.styles[t+n]=a,d=!0),d&&n--;n>0;)i&&i[n-1]?this.styles[t+n]={0:e(i[n-1])}:o?this.styles[t+n]={0:e(o)}:delete this.styles[t+n],n--;this._forceClearCache=!0},insertCharStyleObject:function(t,r,n,i){this.styles||(this.styles={});var o=this.styles[t],a=o?e(o):{};for(var s in n||(n=1),a){var l=parseInt(s,10);l>=r&&(o[l+n]=a[l],a[l-n]||delete o[l])}if(this._forceClearCache=!0,i)for(;n--;)Object.keys(i[n]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][r+n]=e(i[n]));else if(o)for(var c=o[r?r-1:1];c&&n--;)this.styles[t][r+n]=e(c)},insertNewStyleBlock:function(e,t,r){for(var n=this.get2DCursorLocation(t,!0),i=[0],o=0,a=0;a<e.length;a++)"\n"===e[a]?i[++o]=0:i[o]++;for(i[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,i[0],r),r=r&&r.slice(i[0]+1)),o&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+i[0],o),a=1;a<o;a++)i[a]>0?this.insertCharStyleObject(n.lineIndex+a,0,i[a],r):r&&this.styles[n.lineIndex+a]&&r[0]&&(this.styles[n.lineIndex+a][0]=r[0]),r=r&&r.slice(i[a]+1);i[a]>0&&this.insertCharStyleObject(n.lineIndex+a,0,i[a],r)},setSelectionStartEndWithShift:function(e,t,r){r<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=r):r>e&&r<t?"right"===this._selectionDirection?this.selectionEnd=r:this.selectionStart=r:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=r)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),t.util.object.extend(t.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),r=this.selectionStart,n=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(r,n,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,r=this.getLocalPointer(e),n=0,i=0,o=0,a=0,s=0,l=0,c=this._textLines.length;l<c&&o<=r.y;l++)o+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(a+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));i=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(r.x=this.width*this.scaleX-r.x+i);for(var u=0,d=t.length;u<d&&(n=i,(i+=this.__charBounds[s][u].kernedWidth*this.scaleX)<=r.x);u++)a++;return this._getNewSelectionStartFromOffset(r,n,i,a,d)},_getNewSelectionStartFromOffset:function(e,t,r,n,i){var o=e.x-t,a=r-e.x,s=n+(a>o||a<0?0:1);return this.flipX&&(s=i-s),s>this._text.length&&(s=this._text.length),s}}),t.util.object.extend(t.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=t.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):t.document.body.appendChild(this.hiddenTextarea),t.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),t.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),t.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),t.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),t.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),t.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(t.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var r=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var n,i,o,a,s,l=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,c=this._text.length,u=l.length,d=u-c,h=this.selectionStart,f=this.selectionEnd,p=h!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),m=h>g.selectionStart;p?(n=this._text.slice(h,f),d+=f-h):u<c&&(n=m?this._text.slice(f+d,f):this._text.slice(h,h-d)),i=l.slice(g.selectionEnd-d,g.selectionEnd),n&&n.length&&(i.length&&(o=this.getSelectionStyles(h,h+1,!1),o=i.map(function(){return o[0]})),p?(a=h,s=f):m?(a=f-n.length,s=f):(a=f,s=f+n.length),this.removeStyleFromTo(a,s)),i.length&&(r&&i.join("")===t.copiedText&&!t.disableStyleCopyPaste&&(o=t.copiedTextStyle),this.insertNewStyleBlock(i,h,o)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(t.copiedText=this.getSelectedText(),t.disableStyleCopyPaste?t.copiedTextStyle=null:t.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||t.window.clipboardData},_getWidthBeforeCursor:function(e,t){var r,n=this._getLineLeftOffset(e);return t>0&&(n+=(r=this.__charBounds[e][t-1]).left+r.width),n},getDownCursorOffset:function(e,t){var r=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(r),i=n.lineIndex;if(i===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-r;var o=n.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i+1,a);return this._textLines[i].slice(o).length+s+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var r=this._getSelectionForOffset(e,t),n=this.get2DCursorLocation(r),i=n.lineIndex;if(0===i||e.metaKey||33===e.keyCode)return-r;var o=n.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i-1,a),l=this._textLines[i].slice(0,o),c=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+s-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var r,n,i=this._textLines[e],o=this._getLineLeftOffset(e),a=0,s=0,l=i.length;s<l;s++)if((o+=r=this.__charBounds[e][s].width)>t){n=!0;var c=o-r,u=o,d=Math.abs(c-t);a=Math.abs(u-t)<d?s:s-1;break}return n||(a=i.length-1),a},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var r=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(r):this.moveCursorWithoutShift(r),0!==r&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,r){var n;if(e.altKey)n=this["findWordBoundary"+r](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===r?-1:1,!0;n=this["findLineBoundary"+r](this[t])}if(typeof n<"u"&&this[t]!==n)return this[t]=n,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var r="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?r+="Shift":r+="outShift",this[r](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){typeof t>"u"&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,r,n,i){typeof i>"u"&&(i=n),i>n&&this.removeStyleFromTo(n,i);var o=t.util.string.graphemeSplit(e);this.insertNewStyleBlock(o,n,r),this._text=[].concat(this._text.slice(0,n),o,this._text.slice(i)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var e=t.util.toFixed,r=/ +/g;t.util.object.extend(t.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var r,n=[],i=[],o=e;this._setSVGBg(i);for(var a=0,s=this._textLines.length;a<s;a++)r=this._getLineLeftOffset(a),(this.textBackgroundColor||this.styleHas("textBackgroundColor",a))&&this._setSVGTextLineBg(i,a,t+r,o),this._setSVGTextLineText(n,a,t+r,o),o+=this.getHeightOfLine(a);return{textSpans:n,textBgRects:i}},_createTextCharSpan:function(n,i,o,a){var s=n!==n.trim()||n.match(r),l=this.getSvgSpanStyles(i,s),c=l?'style="'+l+'"':"",u=i.deltaY,d="",h=t.Object.NUM_FRACTION_DIGITS;return u&&(d=' dy="'+e(u,h)+'" '),['<tspan x="',e(o,h),'" y="',e(a,h),'" ',d,c,">",t.util.string.escapeXml(n),"</tspan>"].join("")},_setSVGTextLineText:function(e,r,n,i){var o,a,s,l,c,u=this.getHeightOfLine(r),d=-1!==this.textAlign.indexOf("justify"),h="",f=0,p=this._textLines[r];i+=u*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,m=p.length-1;g<=m;g++)c=g===m||this.charSpacing,h+=p[g],s=this.__charBounds[r][g],0===f?(n+=s.kernedWidth-s.width,f+=s.width):f+=s.kernedWidth,d&&!c&&this._reSpaceAndTab.test(p[g])&&(c=!0),c||(o=o||this.getCompleteStyleDeclaration(r,g),a=this.getCompleteStyleDeclaration(r,g+1),c=t.util.hasStyleChanged(o,a,!0)),c&&(l=this._getStyleDeclaration(r,g)||{},e.push(this._createTextCharSpan(h,l,n,i)),h="",o=a,n+=f,f=0)},_pushTextBgRect:function(r,n,i,o,a,s){var l=t.Object.NUM_FRACTION_DIGITS;r.push("\t\t<rect ",this._getFillAttributes(n),' x="',e(i,l),'" y="',e(o,l),'" width="',e(a,l),'" height="',e(s,l),'"></rect>\n')},_setSVGTextLineBg:function(e,t,r,n){for(var i,o,a=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,u=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),d=0,h=a.length;d<h;d++)i=this.__charBounds[t][d],(o=this.getValueOfPropertyAt(t,d,"textBackgroundColor"))!==u?(u&&this._pushTextBgRect(e,u,r+c,n,l,s),c=i.left,l=i.width,u=o):l+=i.kernedWidth;o&&this._pushTextBgRect(e,o,r+c,n,l,s)},_getFillAttributes:function(e){var r=e&&"string"==typeof e?new t.Color(e):"";return r&&r.getSource()&&1!==r.getAlpha()?'opacity="'+r.getAlpha()+'" fill="'+r.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,r=0,n=0;n<e;n++)r+=this.getHeightOfLine(n);return t=this.getHeightOfLine(n),{lineTop:r,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return t.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}})}(),function(e){var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,r=0,n=0,i={},o=0;o<e.graphemeLines.length;o++)"\n"===e.graphemeText[n]&&o>0?(r=0,n++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[n])&&o>0&&(r++,n++),i[o]={line:t,offset:r},n+=e.graphemeLines[o].length,r+=e.graphemeLines[o].length;return i},styleHas:function(e,r){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[r];n&&(r=n.line)}return t.Text.prototype.styleHas.call(this,e,r)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,r,n=0,i=!1,o=this._styleMap[e],a=this._styleMap[e+1];for(var s in o&&(e=o.line,n=o.offset),a&&(i=a.line===e,t=a.offset),r=typeof e>"u"?this.styles:{line:this.styles[e]})for(var l in r[s])if(l>=n&&(!i||l<t))for(var c in r[s][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var r=this._styleMap[e];if(!r)return null;e=r.line,t=r.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,r){var n=this._styleMap[e];e=n.line,t=n.offset+t,this.styles[e][t]=r},_deleteStyleDeclaration:function(e,t){var r=this._styleMap[e];e=r.line,t=r.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var r,n=[];for(this.isWrapping=!0,r=0;r<e.length;r++)n=n.concat(this._wrapLine(e[r],r,t));return this.isWrapping=!1,n},_measureWord:function(e,t,r){var n,i=0;r=r||0;for(var o=0,a=e.length;o<a;o++)i+=this._getGraphemeBox(e[o],t,o+r,n,!0).kernedWidth,n=e[o];return i},_wrapLine:function(e,r,n,i){var o=0,a=this.splitByGrapheme,s=[],l=[],c=a?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),u="",d=0,h=a?"":" ",f=0,p=0,g=0,m=!0,v=this._getWidthOfCharSpacing();i=i||0,0===c.length&&c.push([]),n-=i;for(var y=0;y<c.length;y++)u=a?c[y]:t.util.string.graphemeSplit(c[y]),f=this._measureWord(u,r,d),d+=u.length,(o+=p+f-v)>n&&!m?(s.push(l),l=[],o=f,m=!0):o+=v,!m&&!a&&l.push(h),l=l.concat(u),p=a?0:this._measureWord([h],r,d),d++,m=!1,f>g&&(g=f);return y&&s.push(l),g+i>this.dynamicMinWidth&&(this.dynamicMinWidth=g-v+i),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var r=t.Text.prototype._splitTextIntoLines.call(this,e),n=this._wrapText(r.lines,this.width),i=new Array(n.length),o=0;o<n.length;o++)i[o]=n[o].join("");return r.lines=i,r.graphemeLines=n,r},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,r){var n=t.util.stylesFromArray(e.styles,e.text),i=Object.assign({},e,{styles:n});return t.Object._fromObject("Textbox",i,r,"text")}}(e),function(){var e=t.controlsUtils,r=e.scaleSkewCursorStyleHandler,n=e.scaleCursorStyleHandler,i=e.scalingEqually,o=e.scalingYOrSkewingX,a=e.scalingXOrSkewingY,s=e.scaleOrSkewActionName,l=t.Object.prototype.controls;if(l.ml=new t.Control({x:-.5,y:0,cursorStyleHandler:r,actionHandler:a,getActionName:s}),l.mr=new t.Control({x:.5,y:0,cursorStyleHandler:r,actionHandler:a,getActionName:s}),l.mb=new t.Control({x:0,y:.5,cursorStyleHandler:r,actionHandler:o,getActionName:s}),l.mt=new t.Control({x:0,y:-.5,cursorStyleHandler:r,actionHandler:o,getActionName:s}),l.tl=new t.Control({x:-.5,y:-.5,cursorStyleHandler:n,actionHandler:i}),l.tr=new t.Control({x:.5,y:-.5,cursorStyleHandler:n,actionHandler:i}),l.bl=new t.Control({x:-.5,y:.5,cursorStyleHandler:n,actionHandler:i}),l.br=new t.Control({x:.5,y:.5,cursorStyleHandler:n,actionHandler:i}),l.mtr=new t.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),t.Textbox){var c=t.Textbox.prototype.controls={};c.mtr=l.mtr,c.tr=l.tr,c.br=l.br,c.tl=l.tl,c.bl=l.bl,c.mt=l.mt,c.mb=l.mb,c.mr=new t.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:r,actionName:"resizing"}),c.ml=new t.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:r,actionName:"resizing"})}}()}(Qw);const ex={lockScalingFlip:!0,originY:"center",originX:"center",lockMovementX:!0,lockMovementY:!0,borderColor:"transparent"};function tx(e=36){let t="";for(let r=0;r<e;r+=1)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}let rx=null;function nx(e){rx=e}class ix{constructor(){zs(this,"maxZoom",2),zs(this,"minZoom",1),zs(this,"step",.05),this.allowUserZoom&&this.bindMouseWheel(),Eg.subscribe(e=>e.stageSize,()=>{setTimeout(()=>{this.fitToScreen()},1)})}get allowUserZoom(){var e,t,r;return(null==(r=null==(t=null==(e=Ig().config)?void 0:e.tools)?void 0:t.zoom)?void 0:r.allowUserZoom)??!0}get currentZoom(){return Ig().zoom}zoomIn(e=this.step){this.set(this.currentZoom+e)}canZoomIn(e=this.step){return this.currentZoom+e<=this.maxZoom}canZoomOut(e=this.step){return this.currentZoom-e>=this.minZoom}zoomOut(e=this.step){this.set(this.currentZoom-e)}set(e,t=!0){if(e<this.minZoom||e>this.maxZoom)return;const r=Ys(Ig().original.width*e,0),n=Ys(Ig().original.height*e,0);Tg().setZoom(e),t&&Tg().setDimensions({width:r,height:n}),Ig().setZoom(e)}fitToScreen(){var e,t;if(null==(t=null==(e=Ig().config.tools)?void 0:e.zoom)||!t.fitImageToScreen)return;const{width:r,height:n}=Ig().stageSize,i=Math.max(n,1),o=Math.max(r,1);if(Ig().original.height>i||Ig().original.width>o){const e=Math.min(i/Ig().original.height,o/Ig().original.width);this.minZoom=Math.min(e,1)}else this.minZoom=1;this.set(this.minZoom)}bindMouseWheel(){Tg().on("mouse:wheel",e=>{e.e.preventDefault(),e.e.stopPropagation(),null==rx&&(e.e.deltaY<0?this.zoomIn():this.zoomOut())})}}function ox(e){return new Promise(t=>{Qw.fabric.util.loadImage(e,e=>t(new Qw.fabric.Image(e)),null,Ig().config.crossOrigin?"anonymous":void 0)})}function ax(){return!(Ig().config.image||Ig().config.blankCanvasSize||Tg()&&0!==Tg().getObjects().length)}class sx{constructor(){zs(this,"minWidth",50),zs(this,"minHeight",50)}resize(e,t,{applyZoom:r=!1,resizeHelper:n=!0}={}){const i=Ig().zoom;Tg().setWidth(e*(r?i:1)),Tg().setHeight(t*(r?i:1)),Ig().setOriginal(e,t),n&&jg().transform.resetStraightenAnchor()}async addMainImage(e,t="mainImage"){var r,n;Ig().toggleLoading(t);const i=await ox(e);if(i)return this.clear(),i.set(Mg),i.name=_p.MainImage,Tg().add(i),this.resize(i.width,i.height),i.center(),i.setCoords(),jg().zoom.fitToScreen(),Ig().toggleLoading(!1),null==(n=(r=Ig().config).onMainImageLoaded)||n.call(r,i),i}openNew(e,t,r){return e=Math.max(this.minWidth,e),t=Math.max(this.minHeight,t),this.clear(),this.resize(e,t),Tg().backgroundColor=r,jg().zoom.fitToScreen(),Ig().toggleLoading("newCanvas"),requestAnimationFrame(()=>{Ig().toggleLoading(!1)}),Promise.resolve({width:e,height:t})}getMainImage(){return Tg().getObjects().find(e=>e.name===_p.MainImage)}render(){Tg().requestRenderAll()}async loadInitialContent(){var e,t;const r=Ig().config.image,n=Ig().config.blankCanvasSize,i=Ig().config.state;if(r&&r.endsWith("json")){const e=await Og(r);await jg().import.loadState(e)}else r&&r.startsWith('{"canvas')?await jg().import.loadState(r):r?await this.addMainImage(r):i?await jg().import.loadState(i):n&&await this.openNew(n.width,n.height);return ax()&&null!=(t=null==(e=Ig().config.ui)?void 0:e.openImageDialog)&&t.show&&Ig().togglePanel("newImage",!0),new Promise(e=>{setTimeout(()=>{jg().history.addInitial(),e()},10)})}clear(){Tg().clear(),jg().frame.remove(),jg().transform.resetStraightenAnchor()}}const lx=["fontSize","fontFamily","left","top","width","height","scaleX","scaleY","flipX","flipY","angle","src","strokeWidth"];function cx(e={}){Tg().fire("object:modified",function(e){return{values:e,sizeOrPositionChanged:ux(e)}}(e))}function ux(e){return Object.keys(e).some(e=>lx.includes(e))}function dx(e){var t,r;const[n]=Lg(null==(t=e.selected)?void 0:t[0]),i=n===Ig().activeTool;return!(!Ig().dirty||null!=(r=e.selected)&&r[0]&&i)&&(e.deselected&&jg().objects.select(e.deselected[0]),!0)}function hx(e){(null==e?void 0:e.data.id)!==Ig().objects.active.id&&(Ig().objects.setActive(e??null),Ig().activeTool!==fh.DRAW&&Rg())}class fx{constructor(){this.syncObjects(),Ig().fabric.on("selection:created",e=>{var t;null!=(t=e.selected)&&t[0]&&!dx(e)&&hx(e.selected[0])}),Ig().fabric.on("selection:updated",e=>{var t;dx(e)||hx(null==(t=e.selected)?void 0:t[0])}),Ig().fabric.on("selection:cleared",()=>{hx()}),Ig().fabric.on("text:editing:entered",()=>{Ig().objects.setIsEditingText(!0)}),Ig().fabric.on("text:editing:exited",()=>{Ig().objects.setIsEditingText(!1)}),Ig().fabric.on("object:added",()=>{this.syncObjects()}),Ig().fabric.on("object:removed",()=>{this.syncObjects()})}getAll(){return Tg().getObjects().filter(e=>{var t;return!(null!=(t=null==e?void 0:e.data)&&t.pixieInternal)})}get(e){return this.getAll().find(t=>t.name===e)}getById(e){return this.getAll().find(t=>t.data.id===e)}isActive(e){var t;const r="string"==typeof e?e:e.data.id;return(null==(t=Ig().objects.active)?void 0:t.id)===r}getActive(){return Tg().getActiveObject()}has(e){return this.getAll().findIndex(t=>t.name===e)>-1}select(e){const t="string"==typeof e?this.getById(e):e;t&&(Tg().setActiveObject(t),Tg().requestRenderAll())}deselectActive(){Tg().discardActiveObject(),Tg().requestRenderAll()}setValues(e,t){if(!(t=t||this.getActive()))return;let r=!1;(function(e){return e.name===_p.Sticker&&"forEachObject"in e})(t)&&e.fill&&e.fill!==t.fill&&t.forEachObject(t=>t.set("fill",e.fill)),Cp(t)?((e.fontFamily!==t.fontFamily||e.fontSize!==t.fontSize)&&(r=!0),t.selectionStart!==t.selectionEnd?t.setSelectionStyles(e):t.set(e)):t.set(e),r?setTimeout(()=>{Tg().requestRenderAll()},50):Tg().requestRenderAll(),Ig().objects.setActive(t),cx(e)}move(e,t=1,r){(r=r||this.getActive())&&("up"===e?this.setValues({top:r.top-t}):"down"===e?this.setValues({top:r.top+t}):"left"===e?this.setValues({left:r.left-t}):"right"===e&&this.setValues({left:r.left+t}),jg().canvas.render())}bringToFront(e){(e=e||this.getActive())&&(e.bringToFront(),jg().canvas.render())}sendToBack(e){(e=e||this.getActive())&&(e.sendToBack(),jg().canvas.render())}flipHorizontally(e){(e=e||this.getActive())&&(this.setValues({flipX:!e.flipX}),jg().canvas.render())}duplicate(e){const t=e||this.getActive();t&&(this.deselectActive(),t.clone(e=>{e.set({left:t.left+40,top:t.top+40,data:{...t.data,id:tx(10)},name:t.name}),Tg().add(e),this.select(e),jg().canvas.render()}))}delete(e){(e=e||this.getActive())&&(this.deselectActive(),Tg().remove(e),Tg().requestRenderAll(),jg().history.addHistoryItem({name:"deletedObject"}))}syncObjects(){const e=this.getAll().map(e=>({name:e.name,selectable:e.selectable??!1,id:e.data.id}));Eg.setState({objects:{...Ig().objects,all:e}})}}const px={frame:null,fonts:[]};function gx(e){return e.state||(e.state=Pg()),{...e.state||Pg(),name:e.name,id:tx(15)}}function mx(e){return!!e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e)}function vx(e){return e?mx(e)?e:`${Ig().config.baseUrl?`${Ig().config.baseUrl}/`:""}${e}`:""}function yx(e,t){return t||btoa(e.split("/").pop())}const bx=new class{constructor(){zs(this,"loadedAssets",{})}loadAsset(e,t={type:"js"}){var r;e=e.startsWith("//")?`${window.location.protocol}${e}`:e;const n=null==(r=this.loadedAssets[e])?void 0:r.state;return"loaded"!==n||t.force?!n||this.loadedAssets[e].doc!==t.document||t.force&&"loaded"===n?(this.loadedAssets[e]={state:new Promise(r=>{const n={url:mx(e)?e:`assets/${e}`,id:yx(e,t.id),resolve:r,parentEl:t.parentEl,document:t.document};"css"===t.type?this.loadStyleAsset(n):this.loadScriptAsset(n)}),doc:t.document},this.loadedAssets[e].state):this.loadedAssets[e].state:new Promise(e=>e())}isLoadingOrLoaded(e){return null!=this.loadedAssets[e]}loadStyleAsset(e){var t;const r=e.document||document,n=e.parentEl||r.head,i=r.createElement("link"),o=yx(e.url,e.id);i.rel="stylesheet",i.id=o,i.href=e.url;try{n.querySelector(`#${o}`)&&(null==(t=n.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},n.appendChild(i)}loadScriptAsset(e){var t;const r=e.document||document,n=e.parentEl||r.body,i=r.createElement("script"),o=yx(e.url,e.id);i.async=!0,i.id=o,i.src=e.url;try{n.querySelector(`#${o}`)&&(null==(t=n.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},(n||n).appendChild(i)}};function wx(e){return`be-fonts-${e}`}function xx(e,t){const r=t.document||document,n=[],i=[];let o=[];if(e.forEach(e=>{"google"in e&&e.google?n.push(e):"src"in e&&i.push(e)}),null!=n&&n.length){const n=t.weights||[400],i=e.map(e=>`${e.family}:${n.join(",")}`).join("|"),a=bx.loadAsset(`https://fonts.googleapis.com/css?family=${i}&display=swap`,{type:"css",id:wx(t.id),force:t.forceAssetLoad,document:r});o.push(a)}if(null!=i&&i.length){const e=i.map(async e=>{const n=Array.from(r.fonts.values()).find(t=>t.family===e.family);if(n)return n.loaded;const i=new FontFace(e.family,`url(${null!=t&&t.prefixSrc?t.prefixSrc(e.src):e.src})`,e.descriptors);return r.fonts.add(i),i.load()});o=o.concat(e)}return Promise.all(o)}class Cx{async undo(){if(this.canUndo()){const e=Ig().history.items[Ig().history.pointer-1];await this.load(e)}}async redo(){if(this.canRedo()){const e=Ig().history.items[Ig().history.pointer+1];await this.load(e)}}canUndo(){return Ig().history.canUndo}canRedo(){return Ig().history.canRedo}reload(){return this.load(Ig().history.items[Ig().history.pointer])}replaceCurrent(){const e=Ig().history.items[Ig().history.pointer];[...Ig().history.items][Ig().history.pointer]=gx({name:e.name,state:e})}addHistoryItem(e){const t=gx(e),r=[...Ig().history.items.slice(0,Ig().history.pointer+1),t];Ig().history.update(r.length-1,r)}load(e){return e={...e,editor:e.editor||px},new Promise(t=>{xx(function(e){const t=[];return e.forEach(e=>{var r,n,i;if(!Cp(e))return;const o=null==(i=null==(n=null==(r=Ig().config.tools)?void 0:r.text)?void 0:n.items)?void 0:i.find(t=>t.family===e.fontFamily);o&&t.push(o)}),t}(e.canvas.objects),{prefixSrc:vx,id:"pixie-fonts"}).finally(()=>{Tg().loadFromJSON(e.canvas,()=>{jg().zoom.set(1),e.canvasWidth&&e.canvasHeight&&jg().canvas.resize(e.canvasWidth,e.canvasHeight,{resizeHelper:!1,applyZoom:!1}),jg().frame.remove(),e.editor.frame&&jg().frame.add(e.editor.frame.name,e.editor.frame.sizePercent),jg().objects.syncObjects(),jg().objects.getAll().forEach(e=>{var t,r;if(!e.data.pixieInternal&&"left"===e.originX&&"top"===e.originY){const t=e.getPointByOrigin("center","center");e.set("left",t.x),e.set("top",t.y)}e.set({...ex}),"i-text"===e.type&&(e.padding=null==(r=null==(t=Ig().config.tools)?void 0:t.text)?void 0:r.controlsPadding)}),jg().canvas.render(),Tg().calcOffset(),jg().zoom.fitToScreen(),Ig().history.updatePointerById(e.id),jg().transform.resetStraightenAnchor(),t()})})})}addInitial(e){!Ig().history.items.find(e=>"initial"===e.name)&&(e||!ax())&&this.addHistoryItem({name:"initial",state:e})}}class _x{canMerge(){return jg().objects.getAll().filter(e=>e.name!==_p.MainImage).length>0}async apply(){Ig().toggleLoading("merge");const e=jg().export.getDataUrl();e&&await jg().canvas.addMainImage(e,"merge")}}const Sx=[{name:"grayscale"},{name:"blackWhite",fabricType:"blackwhite"},{name:"sharpen",uses:"Convolute",matrix:[0,-1,0,-1,5,-1,0,-1,0]},{name:"invert"},{name:"vintage"},{name:"polaroid"},{name:"kodachrome"},{name:"technicolor"},{name:"brownie"},{name:"sepia"},{name:"removeColor",fabricType:"removecolor",options:{distance:{type:"slider",current:.1,min:0,max:1,step:.01},color:{current:"#fff",type:"colorPicker"}}},{name:"brightness",options:{brightness:{type:"slider",current:.1,min:-1,max:1,step:.1}}},{name:"gamma",options:{red:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},green:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},blue:{type:"slider",current:.1,min:.2,max:2.2,step:.003921}},apply:e=>{e.gamma=[e.red,e.green,e.blue]}},{name:"noise",options:{noise:{type:"slider",current:40,min:1,max:600}}},{name:"pixelate",options:{blocksize:{type:"slider",min:1,max:40,current:6}}},{name:"blur",uses:"Convolute",matrix:[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9]},{name:"emboss",uses:"Convolute",matrix:[1,1,1,1,.7,-1,-1,-1,-1]},{name:"blendColor",fabricType:"blendcolor",options:{alpha:{type:"slider",current:.5,min:.1,max:1,step:.1},mode:{current:"add",type:"select",available:[{key:"add"},{key:"multiply"},{key:"subtract"},{key:"diff"},{key:"screen"},{key:"lighten"},{key:"darken"}]},color:{type:"colorPicker",current:"#FF4081"}}}],Ax={grayscale:sh("grayscale"),blackWhite:sh("Black & White"),sharpen:sh("Sharpen"),invert:sh("Invert"),vintage:sh("Vintage"),polaroid:sh("Polaroid"),kodachrome:sh("Kodachrome"),technicolor:sh("Technicolor"),brownie:sh("Brownie"),sepia:sh("Sepia"),removeColor:sh("Remove Color"),brightness:sh("Brightness"),gamma:sh("Gamma"),noise:sh("Noise"),pixelate:sh("Pixelate"),blur:sh("Blur"),emboss:sh("Emboss"),blendColor:sh("Blend Color")},kx={distance:sh("distance"),color:sh("color"),brightness:sh("brightness"),red:sh("red"),green:sh("green"),blue:sh("blue"),noise:sh("noise"),blocksize:sh("blocksize"),mode:sh("mode"),alpha:sh("alpha")};function Ex(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}class Ix{constructor(){Eg.subscribe(e=>e.history.pointer,()=>{this.syncState()})}apply(e){Ig().filter.select(e,this.hasOptions(e));const t=this.getByName(e);if(this.isApplied(t.name))return void this.remove(t.name);const r=this.create(t);this.getImages().forEach(e=>{var t;null==(t=e.filters)||t.push(r),e.applyFilters()}),this.syncState(),jg().canvas.render()}remove(e){Ig().filter.deselect(e);const t=this.getByName(e);this.getImages().forEach(e=>{var r;const n=this.findFilterIndex(t.name,e.filters);null==(r=e.filters)||r.splice(n,1),e.applyFilters()}),this.syncState(),jg().canvas.render()}getAll(){return Sx}getByName(e){return Sx.find(t=>t.name===e)}isApplied(e){const t=jg().canvas.getMainImage();return!!t&&this.findFilterIndex(e,t.filters)>-1}applyValue(e,t,r){const n=this.getByName(e);this.getImages().forEach(e=>{const i=(e.filters||[]).find(e=>e.type.toLowerCase()===n.name.toLowerCase());i&&(i[t]=r,n.apply&&n.apply(i,t,r),e.applyFilters())}),jg().canvas.render()}addCustom(e,t,r,n){const i=Qw.fabric.Image.filters;i[Ex(e)]=Qw.fabric.util.createClass(i.BaseFilter,t),i[Ex(e)].fromObject=i.BaseFilter.fromObject,Sx.push({name:e,options:r,initialConfig:n})}create(e){const t=e.initialConfig||{};let r;return e.uses?(t.matrix=e.matrix,r=new(Qw.fabric.Image.filters[Ex(e.uses)])(t)):(Object.entries(e.options||{}).forEach(([e,r])=>{t[e]=r.current}),r=new(Qw.fabric.Image.filters[Ex(e.name)])(t)),r.name=e.name,r}hasOptions(e){return!!this.getByName(e).options}findFilterIndex(e,t){if(null==t||!t.length)return-1;const r=this.getByName(e);return t.findIndex(e=>this.configMatchesFabricFilter(r,e))}syncState(){var e;const t=[];((null==(e=this.getImages()[0])?void 0:e.filters)||[]).forEach(e=>{const r=this.getByFabricFilter(e);r&&t.push(r.name)}),Eg.setState({filter:{...Ig().filter,applied:t}})}getByFabricFilter(e){return Sx.find(t=>this.configMatchesFabricFilter(t,e))}configMatchesFabricFilter(e,t){const r=t.type.toLowerCase().replace(" ","");return r===e.fabricType||r===e.name||"convolute"===r&&this.matrixAreEqual(e.matrix,t.matrix)}matrixAreEqual(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=e.length;r--;)if(e[r]!==t[r])return!1;return!0}getImages(){return jg().objects.getAll().filter(e=>e.name===_p.Image||e.name===_p.MainImage)}}function jx(e){var t,r;const n=(null==(r=null==(t=Ig().config.tools)?void 0:t.resize)?void 0:r.minWidth)||50;return e?Math.ceil(100*n/Ig().original.width):n}function Tx(e){var t,r;const n=(null==(r=null==(t=Ig().config.tools)?void 0:t.resize)?void 0:r.maxWidth)||2400;return e?Math.ceil(100*n/Ig().original.width):n}function Fx(e){var t,r;const n=(null==(r=null==(t=Ig().config.tools)?void 0:t.resize)?void 0:r.minHeight)||50;return e?Math.ceil(100*n/Ig().original.height):n}function Ox(e){var t,r;const n=(null==(r=null==(t=Ig().config.tools)?void 0:t.resize)?void 0:r.maxHeight)||2400;return e?Math.ceil(100*n/Ig().original.height):n}function Mx(e,t){if(t)return e;const r=Ig().original.height/e;return Math.floor(Ig().original.width/r)}function Px(e,t){if(t)return e;const r=Ig().original.width/e;return Math.floor(Ig().original.height/r)}class Rx{apply(e){const{width:t,height:r,usePercentages:n}=function(e){return e.width<jx(e.usePercentages)&&(e.width=jx(e.usePercentages),e.maintainAspect&&(e.height=Px(e.width,e.usePercentages))),e.width>Tx(e.usePercentages)&&(e.width=Tx(e.usePercentages),e.maintainAspect&&(e.height=Px(e.width,e.usePercentages))),e.height<Fx(e.usePercentages)&&(e.height=Fx(e.usePercentages),e.maintainAspect&&(e.width=Mx(e.height,e.usePercentages))),e.height>Ox(e.usePercentages)&&(e.height=Ox(e.usePercentages),e.maintainAspect&&(e.width=Mx(e.height,e.usePercentages))),e}(e),i=Math.ceil(Ig().original.width),o=Math.ceil(Ig().original.height),a=Math.ceil(t),s=Math.ceil(r);let l,c;n?(l=t/100,c=r/100):(l=t/Ig().original.width,c=r/Ig().original.height),(i!==a||o!==s)&&this.resize(l,c)}resize(e,t){jg().zoom.set(1,!1);const r=Math.round(Ig().original.height*t),n=Math.round(Ig().original.width*e);jg().canvas.resize(n,r,{applyZoom:!1,resizeHelper:!0}),jg().objects.getAll().forEach(r=>{const n=r.scaleX||1,i=r.scaleY||1,o=r.left||0,a=r.top||0,s=n*e,l=i*t,c=o*e,u=a*t;r.scaleX=s,r.scaleY=l,r.left=c,r.top=u,r.setCoords()}),jg().zoom.fitToScreen(),Tg().requestRenderAll()}}function Lx(e,t,r){let n=t,i=r;return e&&(r*e>t?i=t/e:n=r*e),{width:Math.floor(n),height:Math.floor(i)}}function Nx(e){if(!e)return null;const t=e.split(":");return parseInt(t[0])/parseInt(t[1])}class Dx{constructor(){zs(this,"refs",null)}apply(e){var t;const r=null==(t=jg().frame.active.config)?void 0:t.name,n=jg().frame.active.currentSizeInPercent;return jg().frame.active.hide(),jg().merge.apply().then(()=>{jg().canvas.resize(Math.round(e.width),Math.round(e.height),{applyZoom:!0,resizeHelper:!0});const t=jg().canvas.getMainImage();t.cropX=Math.round(e.left),t.cropY=Math.round(e.top),t.width=Math.round(e.width),t.height=Math.round(e.height),t.viewportCenter(),r&&jg().frame.add(r,n),jg().zoom.fitToScreen(),jg().canvas.render()})}drawZone(e){var t;null!=(t=this.refs)&&t.current&&(Ig().crop.setCropzoneRect(e),function(e,t){null!==t.innerZone&&(function(e,t){t.innerZone.style.width=`${e.width}px`,t.innerZone.style.height=`${e.height}px`,t.innerZone.style.transform=`translate(${e.left}px, ${e.top}px)`}(e,t),function(e,t){const r=Ig().canvasSize.width,n=Ig().canvasSize.height;t.maskTop.style.height=`${e.top}px`,t.maskTop.style.width=`${r}px`,t.maskLeft.style.top=`${e.top}px`,t.maskLeft.style.height=`${e.height}px`,t.maskLeft.style.width=`${e.left}px`;const i=e.left+e.width;t.maskRight.style.left=`${i}px`,t.maskRight.style.top=`${e.top}px`,t.maskRight.style.height=`${e.height}px`,t.maskRight.style.width=r-i+"px",t.maskBottom.style.height=n-(e.top+e.height)+"px",t.maskBottom.style.width=`${r}px`}(e,t),function(e,t){const r=(e.width-2)/3;t.lineVer1.style.height=`${e.height}px`,t.lineVer1.style.transform=`translate(${r}px, 0)`,t.lineVer2.style.height=`${e.height}px`,t.lineVer2.style.transform=`translate(${2*r}px, 0)`;const n=(e.height-2)/3;t.lineHor1.style.width=`${e.width}px`,t.lineHor1.style.transform=`translate(0, ${n}px)`,t.lineHor2.style.width=`${e.width}px`,t.lineHor2.style.transform=`translate(0, ${2*n}px)`}(e,t))}(e,this.refs.current))}resetCropzone(e){const t=Ig().canvasSize,r=Nx(e);if(!t)return;Ig().crop.setAspectRatio(e);const n=function(e,t=null){const r={width:e.width,height:e.height,top:0,left:0,angle:0};if(t){const e=Lx(t,r.width,r.height);r.width=e.width,r.height=e.height}return r.left=(e.width-r.width)/2,r.top=(e.height-r.height)/2,r}(t,r);this.drawZone(n)}registerRefs(e){this.refs=e}}class zx{getShapeByName(e){var t,r;const n=null==(r=null==(t=Ig().config.tools)?void 0:t.shapes)?void 0:r.items;return(null==n?void 0:n.find(t=>t.name===e))||null}addBasicShape(e){var t;const r=this.getShapeByName(e);if(!r)return null;const{width:n,height:i,...o}=(null==(t=Ig().config.objectDefaults)?void 0:t.shape)||{},a={...o,...r.options};let s;if("circle"===r.name)s=new Qw.fabric.Circle({...a,radius:100});else if("ellipse"===r.name)s=new Qw.fabric.Ellipse({...a,rx:100,ry:50});else if("Path"===r.type)s=new Qw.fabric.Path(a.path,{displayName:r.name,...a});else{const e=r.type;s=new Qw.fabric[e]({...a,width:150,height:150})}return this.addAndPositionShape(s,_p.Shape,{width:n,height:i}),s}addSticker(e,t){var r,n,i;const o=null==(i=null==(n=null==(r=Ig().config.tools)?void 0:r.stickers)?void 0:n.items)?void 0:i.find(t=>t.name===e);if(!o)return Promise.resolve();if("svg"===o.type){const e=Bx(o,t);return this.addSvgSticker(e)}return this.addRegularSticker(o,t)}addRegularSticker(e,t){return new Promise(r=>{Qw.fabric.util.loadImage(Bx(e,t),e=>{var t;const{width:n,height:i,...o}=(null==(t=Ig().config.objectDefaults)?void 0:t.sticker)||{},a=new Qw.fabric.Image(e,o);this.addAndPositionShape(a,_p.Sticker,{width:n,height:i}),r()})})}addSvgSticker(e,t=_p.Sticker){return new Promise(r=>{Qw.fabric.loadSVGFromURL(e,(e,n)=>{var i;const{width:o,height:a,...s}=(null==(i=Ig().config.objectDefaults)?void 0:i.sticker)||{},l=Qw.fabric.util.groupSVGElements(e,n);l.set(s),this.addAndPositionShape(l,t,{width:o,height:a}),r()})})}addAndPositionShape(e,t,{width:r}){e.name=t,e.scaleX=1,e.scaleY=1,Tg().add(e);const n=r||Ig().original.width*Ig().zoom/4;e.scaleToWidth(Math.min(150,n)),e.viewportCenter(),e.setCoords(),jg().canvas.render(),Tg().setActiveObject(e)}}function Bx(e,t){return vx(`images/stickers/${e.name}/${t}.${e.type}`)}class Ux{constructor(e){zs(this,"patternCache",[]),this.activeFrame=e}fillParts(e){this.patternCache.forEach(t=>{this.fillPartWithPattern(t,e)})}fillPartWithPattern(e,t){if(!this.activeFrame.parts)return;e.canvas=new Qw.fabric.StaticCanvas(null),e.canvas.add(e.img);const r=new Qw.fabric.Pattern({source:e.canvas.getElement(),repeat:"repeat"===t?"repeat":"no-repeat"});this.activeFrame.parts[e.name]&&this.activeFrame.parts[e.name].set("fill",r)}scale(e){if(!this.activeFrame.config||!this.patternCache)return;const t=this.activeFrame.config.mode;e/=Tg().getRetinaScaling(),this.patternCache.forEach(r=>{this.activeFrame.parts&&("top"===r.name||"bottom"===r.name?"stretch"===t?(this.scalePatternToWidth(r.img,this.activeFrame.parts.top.getScaledWidth()),this.scalePatternToHeight(r.img,e)):r.img.scaleToHeight(e):"left"===r.name||"right"===r.name?"stretch"===t?(this.scalePatternToWidth(r.img,e),this.scalePatternToHeight(r.img,this.activeFrame.parts.left.getScaledHeight())):r.img.scaleToWidth(e):"stretch"===t?(this.scalePatternToWidth(r.img,e),this.scalePatternToHeight(r.img,e)):r.img.scaleToWidth(e),r.canvas.setDimensions({width:r.img.getScaledWidth(),height:r.img.getScaledHeight()}))}),jg().canvas.render()}scalePatternToWidth(e,t){if(!e.width)return;const r=e.getBoundingRect().width/e.getScaledWidth();e.set("scaleX",t/e.width/r),e.setCoords()}scalePatternToHeight(e,t){if(!e.height)return;const r=e.getBoundingRect().height/e.getScaledHeight();e.set("scaleY",t/e.height/r),e.setCoords()}load(e){const t=this.activeFrame.getPartNames().map(t=>new Promise(r=>{const n={...Mg,originX:"left",originY:"top"};Ig().config.crossOrigin&&(n.crossOrigin="anonymous"),Qw.fabric.Image.fromURL(this.getPartUrl(e,t),e=>{r({name:t,img:e})},n)}));return Promise.all(t).then(t=>{this.patternCache=t,this.fillParts(e.mode)})}getPartUrl(e,t){return vx(`images/frames/${e.name}/${t}.png`)}}class Vx{constructor(e,t){this.activeFrame=e,this.patterns=t}get defaultColor(){var e,t;return null==(t=null==(e=Ig().config.objectDefaults)?void 0:e.global)?void 0:t.fill}build(e,t){this.createParts(e),this.resize(t),this.activeFrame.config=e,"basic"!==e.mode?this.patterns.load(e).then(()=>{this.patterns.scale(t),jg().canvas.render()}):jg().canvas.render()}createParts(e){const t={};this.activeFrame.getPartNames().forEach(r=>{const n="basic"===e.mode?this.defaultColor:void 0;t[r]=new Qw.fabric.Rect({...Mg,fill:n,originX:"left",originY:"top",name:`frame.rect.${r}`,objectCaching:!1,data:{pixieInternal:!0}}),Tg().add(t[r])}),this.activeFrame.parts=t}resize(e){const t=Ig().original.width,r=Ig().original.height,n=this.activeFrame,i=e;n.parts&&(n.parts.topLeft.set({width:i,height:i}),n.parts.topRight.set({left:t-n.parts.topLeft.getScaledWidth(),width:i,height:i}),n.parts.top.set({left:n.parts.topLeft.getScaledWidth()-1,width:t-n.parts.topLeft.getScaledWidth()-n.parts.topRight.getScaledWidth()+3,height:i}),n.parts.bottomLeft.set({top:r-n.parts.topLeft.getScaledHeight(),width:i,height:i}),n.parts.left.set({top:n.parts.topLeft.getScaledHeight()-1,width:i,height:r-n.parts.topLeft.getScaledHeight()-n.parts.bottomLeft.getScaledHeight()+3}),n.parts.bottomRight.set({left:t-n.parts.bottomLeft.getScaledWidth(),top:r-n.parts.topRight.getScaledWidth(),width:i,height:i}),n.parts.bottom.set({left:n.parts.top.left,top:r-n.parts.top.getScaledHeight(),width:n.parts.top.getScaledWidth(),height:i}),n.parts.right.set({left:t-n.parts.left.getScaledWidth(),top:n.parts.left.top,width:n.parts.left.width,height:n.parts.left.getScaledHeight()}))}}class Hx{constructor(){zs(this,"corners",["topLeft","topRight","bottomLeft","bottomRight"]),zs(this,"sides",["top","right","bottom","left"]),zs(this,"parts",null),zs(this,"config",null),zs(this,"currentSizeInPercent",100)}getPartNames(){return[...this.corners,...this.sides]}hide(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!1})),jg().canvas.render())}show(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!0})),jg().canvas.render())}remove(){this.parts&&(this.config=null,Object.values(this.parts).forEach(e=>{Tg().remove(e)}),this.parts=null,jg().canvas.render())}is(e){return!!this.config&&this.config.name===e.name}changeColor(e){var t;"basic"!==(null==(t=this.config)?void 0:t.mode)||!this.parts||(Object.values(this.parts).forEach(t=>{t.set("fill",e)}),jg().canvas.render())}getMinSize(){var e;return(null==(e=this.config)?void 0:e.size.min)??1}getMaxSize(){var e;return(null==(e=this.config)?void 0:e.size.max)??35}}class Wx{constructor(){zs(this,"patterns"),zs(this,"builder"),zs(this,"active"),this.active=new Hx,this.patterns=new Ux(this.active),this.builder=new Vx(this.active,this.patterns),Tg().on("object:added",()=>{Object.values(this.active.parts||[]).forEach(e=>e.moveTo(98))})}add(e,t){const r=this.getByName(e);if(!r||this.active.is(r))return;this.active.remove(),this.active.currentSizeInPercent=t??r.size.default;const n=this.calcFrameSizeInPixels(this.active.currentSizeInPercent);this.builder.build(r,n),Ig().frame.select(r)}resize(e){if(!this.active.parts||!this.active.config)return;e?this.active.currentSizeInPercent=e:e=this.active.currentSizeInPercent;const t=this.calcFrameSizeInPixels(e);this.builder.resize(t),this.patterns.scale(t),jg().canvas.render()}changeColor(e){this.active.changeColor(e)}remove(){this.active.remove(),Ig().frame.deselect()}getByName(e){var t,r;const n=null==(r=null==(t=Ig().config.tools)?void 0:t.frame)?void 0:r.items;if(n)return n.find(t=>t.name===e)}getActiveFrameConfig(){return this.active.config}calcFrameSizeInPixels(e){const t=Math.min(Ig().original.width,Ig().original.height);return Math.ceil(e/100*t)}}class $x{constructor(){zs(this,"minWidth",250)}add(e,t={}){var r,n,i,o,a;if(!(e=e||(null==(n=null==(r=Ig().config.tools)?void 0:r.text)?void 0:n.defaultText)))return;const s={...null==(i=Ig().config.objectDefaults)?void 0:i.text,...t,name:_p.Text,padding:null==(a=null==(o=Ig().config.tools)?void 0:o.text)?void 0:a.controlsPadding,editingBorderColor:ch.fill},l=new Qw.fabric.IText(e,s);Tg().add(l),null==t.left&&null==t.top&&this.autoPositionText(l),jg().objects.select(l)}autoPositionText(e){const t=Tg().getWidth(),r=Tg().getHeight(),n=Math.min(Tg().getWidth(),this.minWidth);e.scaleToWidth(Math.max(t/3,n)),e.getScaledHeight()>r&&e.scaleToHeight(r-e.getScaledHeight()-20),e.viewportCenter(),Tg().getObjects("i-text").forEach(t=>{if(t!==e&&t.intersectsWithObject(e)){const r=t.top-e.top+t.getScaledHeight();let n=e.top+r;n>Ig().original.height-t.getScaledHeight()&&(n=0),e.set("top",n),e.setCoords()}})}selectOrAddText(e,t={}){if(Ig().objects.active.isText)return!1;const r=jg().objects.getAll().find(e=>Cp(e));return r?(jg().objects.select(r),!1):(this.add(e,t),!0)}}const qx=e=>{const t=new Qw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=Qw.fabric.document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(0,5),t.lineTo(10,5),t.closePath(),t.stroke(),e},t},Gx=e=>{const t=new Qw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(5,0),t.lineTo(5,10),t.closePath(),t.stroke(),e},t},Yx=e=>{const t=new Qw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=this.width/2,t=document.createElement("canvas"),r=new Qw.fabric.Rect({width:e,height:e,angle:45,fill:this.color}),n=r.getBoundingRect().width;t.width=n+5,t.height=n+5,r.set({left:n/2,top:n/2});const i=t.getContext("2d");return r.render(i),t},t},Xx=e=>{const t=new Qw.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=12,e.height=12;const t=e.getContext("2d");return t.fillStyle=this.color,t.fillRect(0,0,10,10),e},t};var Kx,Zx;class Qx{constructor(){zs(this,"customBrushes",{VLineBrush:qx,HLineBrush:Gx,DiamondBrush:Yx,SquareBrush:Xx}),zs(this,"currentBrush",{type:"PencilBrush",color:null==(Zx=null==(Kx=Ig().config.objectDefaults)?void 0:Kx.global)?void 0:Zx.fill,width:uh[1]}),zs(this,"onPathCreated",e=>{e.path.name=_p.Drawing,e.path.set(function(){const e={...Mg};return delete e.strokeWidth,e}()),Ig().setDirty(!0)})}enable(){Tg().on("path:created",this.onPathCreated),Tg().isDrawingMode=!0,this.setBrushType(this.currentBrush.type),this.setBrushSize(this.currentBrush.width)}disable(){Tg().off("path:created",this.onPathCreated),Tg().isDrawingMode=!1}getBrushType(){return this.currentBrush.type}setBrushType(e){this.currentBrush.type=e,Tg().freeDrawingBrush=e in Qw.fabric?new Qw.fabric[e](Tg()):this.customBrushes[e](Tg()),this.applyBrushStyles()}applyBrushStyles(){Object.keys(this.currentBrush).forEach(e=>{Tg().freeDrawingBrush[e]=this.currentBrush[e]});const e=Tg().freeDrawingBrush;e.getPatternSrc&&(e.source=e.getPatternSrc.call(e))}setBrushSize(e){this.currentBrush.width=e,this.applyBrushStyles()}getBrushSize(){return this.currentBrush.width}setBrushColor(e){this.currentBrush.color=e,this.applyBrushStyles()}getBrushColor(){return this.currentBrush.color}}async function Jx(e,t=!0,r=!0){const n=await ox(e);if(n)return new Promise(e=>{n.name=_p.Image,n.opacity=0;const i=Ig().original.width,o=Ig().original.height;if(t&&(n.width>=i||n.height>=o)){const e=i-.1*i,t=o-.1*o,r=1/Math.min(t/n.getScaledHeight(),e/n.getScaledWidth());n.scaleX*=1/r,n.scaleY*=1/r}Ig().fabric.add(n),r&&Ig().fabric.setActiveObject(n),n.viewportCenter(),n.setCoords(),Ig().fabric.requestRenderAll(),jg().zoom.fitToScreen(),n.animate("opacity","1",{duration:425,onChange:()=>{Ig().fabric.requestRenderAll()},onComplete:()=>{e(n)}})})}function eC(e){var t;return(null==(t=/(?:\.([^.]+))?$/.exec(e))?void 0:t[1])||""}class tC{constructor(e,t){zs(this,"id"),zs(this,"fingerprint"),zs(this,"name"),zs(this,"relativePath",""),zs(this,"size"),zs(this,"mime",""),zs(this,"extension",""),zs(this,"native"),zs(this,"lastModified"),zs(this,"cachedData"),this.id=Ng(),this.name=e.name,this.size=e.size,this.mime=function(e){const t={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",yaml:"text/yaml",yml:"text/yaml",log:"text/plain"},r=e.name?eC(e.name):null;return e.type?e.type:r&&r in t?t[r]:"application/octet-stream"}(e),this.lastModified=e.lastModified,this.extension=eC(e.name)||"bin",this.native=e,(t=(t=t||e.webkitRelativePath||"").replace(/^\/+/g,""))&&t.split("/").length>1&&(this.relativePath=t),this.fingerprint=function({name:e,mime:t,size:r,relativePath:n,lastModified:i}){let o="be";return"string"==typeof e&&(o+=`-${rC(e.toLowerCase())}`),t&&(o+=`-${t}`),"string"==typeof n&&(o+=`-${rC(n.toLowerCase())}`),void 0!==r&&(o+=`-${r}`),void 0!==i&&(o+=`-${i}`),o}({name:this.name,size:this.size,mime:this.mime,lastModified:this.lastModified})}get data(){return new Promise(e=>{this.cachedData&&e(this.cachedData);const t=new FileReader;t.addEventListener("load",()=>{this.cachedData=t.result,e(this.cachedData)}),"json"===this.extension?t.readAsText(this.native):t.readAsDataURL(this.native)})}}function rC(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}var nC=(e=>(e.image="image/*",e.audio="audio/*",e.text="text/*",e.json="application/json",e.video="video/mp4,video/mpeg,video/x-m4v,video/*",e))(nC||{});function iC(e,t=1){if(null==e||Number.isNaN(e))return"";const r=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(r&&(e=-e),e<1)return(r?"-":"")+e+" B";const i=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,i));const o=n[i];return e>=10||e%1==0?`${(r?"-":"")+e.toFixed(0)} ${o}`:`${(r?"-":"")+e.toFixed(t)} ${o}`}function oC(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}oC.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t<o;t++)"*"!==i[t]&&(n=t<r.length&&i[t]===r[t]);n=n&&r}else n=!1;else if("function"==typeof e.splice)for(n=[],t=e.length;t--;)this.match(e[t])&&(n[n.length]=e[t]);else if("object"==typeof e)for(var a in n={},e)this.match(a)&&(n[a]=e[a]);return n};var aC=/[\/\+\.]/;const sC=ih(function(e,t){function r(t){var r=function(e,t,r){var n=new oC(e,r||/[\/\.]/);return typeof t<"u"?n.match(t):n}(t,e,aC);return r&&r.length>=2}return t?r(t.split(";")[0]):r});function lC(e,t){return t.map(e=>e.split(",")).flat().some(t=>{if(t.includes("/"))return!!e.mime&&sC(e.mime.replace(/;.*?$/,""),t);const r=t.replace(".","").toLowerCase();return!(!r||!e.extension)&&e.extension.toLowerCase()===r})}class cC{async uploadAndAddImage(e=!0){const t=await this.openUploadWindow();await this.openUploadedFile(t,e)}async uploadAndReplaceMainImage(){const e=await this.openUploadWindow();e&&await this.openBackgroundImage(e)}async uploadAndOpenStateFile(){const e=await this.openUploadWindow(uC);e&&await this.loadState(await e.data)}async addImageFromUrl(e,t=!0){var r,n;await Jx(e,(null==(n=null==(r=Ig().config.tools)?void 0:r.import)?void 0:n.fitOverlayToScreen)??!0,t),jg().history.addHistoryItem({name:"overlayImage"})}async addImageFromData(e,t=!0){var r,n;await Jx(e,(null==(n=null==(r=Ig().config.tools)?void 0:r.import)?void 0:n.fitOverlayToScreen)??!0,t),jg().history.addHistoryItem({name:"overlayImage"})}async openUploadedFile(e,t=!0){if(!e)return;const r=await e.data;switch(e.extension){case"json":await this.loadState(r);break;case"svg":await jg().shape.addSvgSticker(r,_p.Image),jg().history.addHistoryItem({name:"overlayImage"});break;default:await this.addImageFromData(r,t)}}async loadState(e){let t;Ig().toggleLoading("state"),await Fg(),t="string"==typeof e?e.endsWith(".json")?await Og(e):JSON.parse(e):e,t.history?Ig().history.reset(t.history):await jg().history.addInitial(t),await jg().history.reload(),Ig().toggleLoading(!1)}async openUploadWindow(e){var t,r;e=e||function(){var e,t;const r=null==(t=null==(e=Ig().config.tools)?void 0:e.import)?void 0:t.validImgExtensions;return r?{extensions:r}:{types:[nC.image]}}();const n=(await function(e={}){return new Promise(t=>{const r=function(e={}){const t=document.querySelector("#hidden-file-upload-input");t&&t.remove();const r=document.createElement("input");return r.type="file",r.multiple=e.multiple??!1,r.classList.add("hidden"),r.style.display="none",r.style.visibility="hidden",r.id="hidden-file-upload-input",r.accept=function({extensions:e=[],types:t=[]}){const r=[];return null!=e&&e.length&&(e=e.map(e=>e.startsWith(".")?e:`.${e}`),r.push(e.join(","))),null!=t&&t.length&&r.push(t.join(",")),r.join(",")}(e),e.directory&&(r.webkitdirectory=!0),document.body.appendChild(r),r}(e);r.onchange=e=>{const n=e.target.files;if(!n)return t([]);const i=Array.from(n).filter(e=>".DS_Store"!==e.name).map(e=>new tC(e));t(i),r.remove()},document.body.appendChild(r),r.click()})}(e))[0];return this.fileIsValid(n)?(null==(r=(t=Ig().config).onFileOpen)||r.call(t,n),n):null}async openBackgroundImage(e){let t;await Fg(),t=e instanceof HTMLImageElement?e.src:e instanceof tC?await e.data:e;const r=await jg().canvas.addMainImage(t);return await jg().history.addInitial(),r}fileIsValid(e){var t,r,n,i;const o=function(e,t){if(!t)return;const{maxFileSize:r,allowedFileTypes:n,blockedFileTypes:i}=t;return r&&null!=e.size&&e.size>r?sh("`:file` exceeds maximum allowed size of :size",{values:{file:e.name,size:iC(r)}}):null!=n&&n.length&&!lC(e,n)||null!=i&&i.length&&lC(e,i)?sh("This file type is not allowed"):void 0}(e,{maxFileSize:(null==(r=null==(t=Ig().config.tools)?void 0:t.import)?void 0:r.maxFileSize)??10485760,allowedFileTypes:[...(null==(i=null==(n=Ig().config.tools)?void 0:n.import)?void 0:i.validImgExtensions)??[],"json"]});return!o||(Ug.danger(o),!1)}}const uC={types:[".json",nC.json]};class dC{constructor(){zs(this,"watermark",null),zs(this,"lineStyle",{stroke:"rgba(255,255,255,0.3)",strokeWidth:5,strokeLineCap:"round",strokeLineJoin:"round"})}add(e){this.createGroup(),this.addText(e),this.addLines(),Tg().add(this.watermark),jg().canvas.render()}remove(){this.watermark&&(Tg().remove(this.watermark),this.watermark=null,jg().canvas.render())}createGroup(){this.watermark=new Qw.fabric.Group(void 0,{...Mg,width:Ig().original.width,height:Ig().original.height,excludeFromExport:!0,top:0,left:0,originX:"left",originY:"top"})}addText(e){var t;const r=new Qw.fabric.Text(e,{fill:"rgba(255,255,255,0.3)",strokeWidth:2,stroke:"rgba(255,255,255,0.4)",originX:"center",originY:"center",fontWeight:600,fontSize:150,fontFamily:"Courier New"});r.scaleToWidth(Ig().original.width/2),null==(t=this.watermark)||t.add(r)}addLines(){var e;if(!this.watermark)return;const t=null==(e=this.watermark)?void 0:e.getObjects("text")[0],r=Ig().original.width/2,n=Ig().original.height/2,i=100,o=t.width/4,a=new Qw.fabric.Line(void 0,this.lineStyle),s=new Qw.fabric.Line(void 0,this.lineStyle),l=new Qw.fabric.Line(void 0,this.lineStyle),c=new Qw.fabric.Line(void 0,this.lineStyle);this.watermark.add(a,s,l,c),a.set({x1:o,y1:-i,x2:r,y2:-n}),s.set({x1:o,y1:i,x2:r,y2:n}),l.set({x1:-o,y1:-i,x2:-r,y2:-n}),c.set({x1:-o,y1:i,x2:-r,y2:n})}}var hC={exports:{}};!function(e){!function(){function t(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){a(n.response,t,r)},n.onerror=function(){},n.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function n(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof nh&&nh.global===nh?nh:void 0,o=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,o,a){var s=i.URL||i.webkitURL,l=document.createElement("a");o=o||e.name||"download",l.download=o,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?n(l):r(l.href)?t(e,o,a):n(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(l.href)},4e4),setTimeout(function(){n(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,i,o){if(i=i||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return typeof t>"u"?t={autoBom:!1}:"object"!=typeof t&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,o),i);else if(r(e))t(e,i,o);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout(function(){n(a)})}}:function(e,r,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,r,n);var s="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&l||o)&&typeof FileReader<"u"){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var d=i.URL||i.webkitURL,h=d.createObjectURL(e);a?a.location=h:location.href=h,a=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});i.saveAs=a.saveAs=a,e.exports=a}()}(hC);var fC=hC.exports;class pC{save(e,t,r){var n,i,o;const a=null==(n=Ig().config.tools)?void 0:n.export;e=e||(null==a?void 0:a.defaultName),t=this.getFormat(t),r=this.getQuality(r);const s=`${e}.${t}`;this.applyWaterMark();const l="json"===t?this.getJsonState():this.getDataUrl(t,r);if(jg().watermark.remove(),l)if(Ig().config.saveUrl)fetch(Ig().config.saveUrl,{method:"POST",body:JSON.stringify({data:l,filename:s,format:t})});else if(Ig().config.onSave)null==(o=(i=Ig().config).onSave)||o.call(i,l,s,t);else{const e=this.getCanvasBlob(t,l);fC.saveAs(e,s)}}getDataUrl(e,t){try{return"svg"===e?Tg().toSVG():Tg().toDataURL({format:this.getFormat(e),quality:this.getQuality(t),multiplier:Math.max(Ig().original.width/Tg().width,Ig().original.height/Tg().height)})}catch(e){e.message.toLowerCase().includes("tainted")&&Ug.danger(sh("Could not export canvas with external image."))}return null}getCanvasBlob(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const r=`image/${e}`;return function(e,t,r){t=t||"",r=r||512;const n=atob(e),i=[];for(let o=0;o<n.length;o+=r){const e=n.slice(o,o+r),t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);const a=new Uint8Array(t);i.push(a)}return new Blob(i,{type:t})}(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),r)}getJsonState(){return JSON.stringify({...Pg(),history:Ig().history})}applyWaterMark(){const e=Ig().config.watermarkText;e&&jg().watermark.add(e)}getFormat(e){var t;const r=null==(t=Ig().config.tools)?void 0:t.export;return"jpg"===(e=e||(null==r?void 0:r.defaultFormat)||"png")&&(e="jpeg"),e}getQuality(e){var t;const r=null==(t=Ig().config.tools)?void 0:t.export;return e||(null==r?void 0:r.defaultQuality)||.8}}class gC{constructor(){zs(this,"previewRect",null)}async apply(e){this.previewRect||this.showPreview(),this.updatePreview(e),Tg().remove(this.previewRect),Tg().clipPath=this.previewRect;const t=jg().export.getDataUrl();t&&jg().canvas.clear(),this.hidePreview(),t&&await jg().canvas.addMainImage(t),Tg().clipPath=void 0}getPreviewRadius(){var e;return(null==(e=this.previewRect)?void 0:e.rx)||0}updatePreview(e){this.previewRect&&(this.previewRect.set({rx:e,ry:e}),jg().canvas.render())}showPreview(){const e=.04*Ig().original.width;this.previewRect=new Qw.fabric.Rect({width:Ig().original.width,height:Ig().original.height,rx:e,ry:e,objectCaching:!1,fill:"transparent",name:"round.rect",data:{pixieInternal:!0},stroke:"rgba(255,255,255,0.8)",strokeWidth:3,strokeDashArray:[4,4],selectable:!1,evented:!1}),Tg().add(this.previewRect),this.previewRect.moveTo(99),this.previewRect.viewportCenter(),jg().canvas.render()}hidePreview(){this.previewRect&&(Tg().remove(this.previewRect),jg().canvas.render(),this.previewRect=null)}}class mC{get straightenAnchor(){return Tg().getObjects().find(e=>e.name===_p.StraightenAnchor)}rotateLeft(){this.rotateFixed(-90)}rotateRight(){this.rotateFixed(90)}straighten(e){this.storeObjectsRelationToHelper(),jg().objects.deselectActive();const t=(this.straightenAnchor.data.rotateAngle||0)+e,r=this.getImageScale(t,this.straightenAnchor);this.straightenAnchor.angle=t,this.straightenAnchor.scaleX=r,this.straightenAnchor.scaleY=r,this.straightenAnchor.data.straightenAngle=e,this.transformObjectsBasedOnHelper()}flip(e){const t="horizontal"===e?"flipY":"flipX";jg().objects.getAll().forEach(e=>{e[t]=!e[t]}),jg().canvas.render()}rotateFixed(e){jg().zoom.set(1,!1),jg().objects.deselectActive();const t=this.straightenAnchor.data.rotateAngle||0;e=90*Math.round(e/90);const r=t+(this.straightenAnchor.data.straightenAngle||0)+e;jg().canvas.resize(Ig().original.height,Ig().original.width,{applyZoom:!1,resizeHelper:!1}),this.storeObjectsRelationToHelper(),this.straightenAnchor.rotate(r),this.straightenAnchor.data.rotateAngle=t+e,this.straightenAnchor.center(),this.transformObjectsBasedOnHelper(),jg().frame.resize(jg().frame.active.currentSizeInPercent),requestAnimationFrame(()=>{jg().zoom.fitToScreen()})}getImageScale(e,t){e=Qw.fabric.util.degreesToRadians(e);const r=Ig().original.width/2,n=Ig().original.height/2,i=t.width/2,o=t.height/2,a=Math.sqrt(r**2+n**2),s=Math.asin(n/a);let l=(e%(2*Math.PI)+4*Math.PI)%(2*Math.PI);l>Math.PI&&(l-=Math.PI),l>Math.PI/2&&l<=Math.PI&&(l=Math.PI/2-(l-Math.PI/2));const c=Math.PI/2-s-Math.abs(l),u=Math.abs(s-Math.abs(l)),d=Math.cos(c)*a,h=Math.cos(u)*a;return Math.max(h/i,d/o)}storeObjectsRelationToHelper(){jg().objects.getAll().forEach(e=>{if(e!==this.straightenAnchor){const t=Qw.fabric.util.multiplyTransformMatrices(Qw.fabric.util.invertTransform(this.straightenAnchor.calcTransformMatrix()),e.calcTransformMatrix());e.data={...e.data,relationToCanvas:t}}})}transformObjectsBasedOnHelper(){jg().objects.getAll().forEach(e=>{if(e.data.relationToCanvas){const t=Qw.fabric.util.multiplyTransformMatrices(this.straightenAnchor.calcTransformMatrix(),e.data.relationToCanvas),r=Qw.fabric.util.qrDecompose(t);e.set({flipX:!1,flipY:!1}),e.setPositionByOrigin({x:r.translateX,y:r.translateY},"center","center"),e.set(r),e.setCoords(),e.data.relationToCanvas=null}})}resetStraightenAnchor(){const e=this.straightenAnchor;e&&Tg().remove(e);const t=new Qw.fabric.Rect({...Mg,name:_p.StraightenAnchor,visible:!1,width:Ig().original.width,height:Ig().original.height,data:{pixieInternal:!0,straightenAngle:0,rotateAngle:0}});Tg().add(t),t.viewportCenter()}}function vC(e,t){const r=new ResizeObserver(e=>{const r=e[0].contentRect;t({width:r.width,height:r.height})});return e.current&&r.observe(e.current),()=>{e.current&&r.unobserve(e.current)}}function yC(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}const bC="flex flex-shrink-0 items-center justify-between px-12 py-[9px] w-full h-[54px]",wC={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{type:"tween",duration:.15}};function xC(e,{padding:t,equalWidth:r,variant:n}={}){switch(e){case"2xs":return"link"===n?"text-xs":`text-xs h-24 ${r?"w-24":t||"px-10"}`;case"xs":return"link"===n?"text-xs":`text-xs h-30 ${r?"w-30":t||"px-14"}`;case"sm":return"link"===n?"text-sm":`text-sm h-36 ${r?"w-36":t||"px-18"}`;case"md":return"link"===n?"text-base":`text-base h-42 ${r?"w-42":t||"px-22"}`;case"lg":return"link"===n?"text-lg":`text-base h-50 ${r?"w-50":t||"px-26"}`;case"xl":return"link"===n?"text-xl":`text-lg h-60 ${r?"w-60":t||"px-32"}`;default:return e||""}}function CC(e){const{variant:t,shadow:r,whitespace:n="whitespace-nowrap",display:i="inline-flex"}=e,o={...e,border:e.border||"border"};let a=[];return"outline"===t?a=function({color:e,border:t}){const r="disabled:text-disabled disabled:bg-transparent disabled:border-disabled-bg";switch(e){case"primary":return[`text-primary bg-transparent ${t} border-primary/50`,"hover:bg-primary/hover hover:border-primary",r];case"danger":return[`text-danger bg-transparent ${t} border-danger/50`,"hover:bg-danger/4 hover:border-danger",r];case"positive":return[`text-positive bg-transparent ${t} border-positive/50`,"hover:bg-positive/4 hover:border-positive",r];case"paper":return[`text bg-paper ${t}`,"hover:bg-hover",r];case"white":return["text-white bg-transparent border border-white","hover:bg-white/20","disabled:text-white/70 disabled:border-white/70 disabled:bg-transparent"];default:return[`bg-transparent ${t}`,"hover:bg-hover",r]}}(o):"text"===t?a=function({color:e}){const t="disabled:text-disabled disabled:bg-transparent";switch(e){case"primary":return["text-primary bg-transparent border-transparent","hover:bg-primary/4",t];case"danger":return["text-danger bg-transparent border-transparent","hover:bg-danger/4",t];case"positive":return["text-positive bg-transparent border-transparent","hover:bg-positive/4",t];case"white":return["text-white bg-transparent border-transparent","hover:bg-white/20","disabled:text-white/70 disabled:bg-transparent"];default:return["bg-transparent border-transparent","hover:bg-hover",t]}}(o):"flat"===t||"raised"===t?a=function({color:e,border:t}){const r="disabled:text-disabled disabled:bg-disabled disabled:border-transparent disabled:shadow-none";switch(e){case"primary":return[`text-on-primary bg-primary ${t} border-primary`,"hover:bg-primary-dark hover:border-primary-dark",r];case"danger":return[`text-white bg-danger ${t} border-danger`,"hover:bg-danger/90 hover:border-danger/90",r];case"chip":return[`text-main bg-chip ${t} border-chip`,"hover:bg-chip/90 hover:border-chip/90",r];case"paper":return[`text-main bg-paper ${t} border-paper`,"hover:bg-paper/90 hover:border-paper/90",r];case"white":return[`text-black bg-white ${t} border-white`,"hover:bg-white",r];default:return[`bg ${t} border-background`,"hover:bg-hover",r]}}(o):"link"===t&&(a=function({color:e}){switch(e){case"primary":return["text-primary","hover:underline","disabled:text-disabled"];case"danger":return["text-danger","hover:underline","disabled:text-disabled"];default:return["text-main","hover:underline","disabled:text-disabled"]}}(o)),[...a,r||"raised"===t&&"shadow-md",n,i,t&&"align-middle flex-shrink-0 items-center transition-button duration-200","select-none appearance-none no-underline outline-none disabled:pointer-events-none disabled:cursor-default"]}function _C(e){return e&&(t=>{t.currentTarget.contains(t.target)&&e(t)})}const SC=(0,o.forwardRef)((e,t)=>{const{children:r,color:n=null,variant:o,radius:a,shadow:s,whitespace:l,justify:c="justify-center",className:u,href:d,form:h,border:f,elementType:p,to:g,relative:m,replace:v,end:y,display:b,type:w="button",onClick:x,onPointerDown:C,onPointerUp:_,onKeyDown:S,...A}=e,k=p||(d?"a":"button"),E="a"===k;return(0,i.jsx)(k,{ref:t,form:E?void 0:h,href:d,to:g,relative:m,type:E?void 0:w,replace:v,end:y,onPointerDown:_C(C),onPointerUp:_C(_),onClick:_C(x),onKeyDown:_C(S),className:gh("focus-visible:ring",CC({variant:o,color:n,border:f,whitespace:l,display:b}),a,c,u),...A,children:r})}),AC=o.forwardRef(({children:e,startIcon:t,endIcon:r,size:n="sm",sizeClassName:o,className:a,equalWidth:s=!1,radius:l="rounded-button",variant:c="text",disabled:u,elementType:d,to:h,replace:f,href:p,download:g,...m},v)=>{const y=gh("font-semibold",o||xC(n,{equalWidth:s,variant:c}),a);return(0,i.jsxs)(SC,{className:y,ref:v,radius:l,variant:c,disabled:u,to:u?void 0:h,href:u?void 0:p,download:u?void 0:g,elementType:u?void 0:d,replace:u?void 0:f,...m,children:[t&&(0,i.jsx)(kC,{position:"start",icon:t,size:n}),e,r&&(0,i.jsx)(kC,{position:"end",icon:r,size:n})]})});function kC({icon:e,position:t,size:r}){const n=gh("m-auto",{"-ml-4 mr-8":"start"===t,"-mr-4 ml-8":"end"===t},e.props.className);return o.cloneElement(e,{className:n,size:r})}const EC=(0,o.createContext)(null);function IC(){return(0,o.useContext)(EC)}const jC=yh((0,i.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}),"CheckOutlined"),TC=o.forwardRef((e,t)=>{let{startIcon:r,capitalizeFirst:n,children:o,description:a,endIcon:s,endSection:l,isDisabled:c,isActive:u,isSelected:d,showCheckmark:h,elementType:f="div",radius:p,padding:g,...m}=e;!r&&h&&(r=(0,i.jsx)(jC,{size:"sm",className:gh("text-primary",!d&&"invisible")}));const v=gh("icon-sm rounded overflow-hidden flex-shrink-0",!c&&"text-muted"),y=gh(!c&&"text-muted");return(0,i.jsxs)(f,{...m,"aria-disabled":c,className:FC(e),ref:t,children:[r&&(0,i.jsx)("div",{className:v,children:r}),(0,i.jsxs)("div",{className:gh("min-w-auto mr-auto w-full overflow-hidden overflow-ellipsis",n&&"first-letter:capitalize"),children:[o,a&&(0,i.jsx)("div",{className:gh("mt-4 whitespace-normal text-xs",c?"text-disabled":"text-muted"),children:a})]}),(s||l)&&(0,i.jsx)("div",{className:s?v:y,children:s||l})]})});function FC({className:e,isSelected:t,isActive:r,isDisabled:n,showCheckmark:i,endIcon:o,endSection:a,radius:s,padding:l}){let c,u="";return u=n?"text-disabled pointer-events-none":t?r?"bg-primary/focus":"bg-primary/selected hover:bg-primary/focus":r?"hover:bg-fg-base/15 bg-focus":"hover:bg-hover",c=l||(i?o||a?"pl-8 pr-8 py-8":"pl-8 pr-24 py-8":"px-20 py-8"),gh("w-full select-none outline-none cursor-pointer","text-sm truncate flex items-center gap-10",!n&&"text-main",c,u,e,s)}function OC({children:e,value:t,startIcon:r,endIcon:n,endSection:o,description:a,capitalizeFirst:s,textLabel:l,isDisabled:c,onSelected:u,onClick:d,...h}){var f;const{collection:p,showCheckmark:g,virtualFocus:m,listboxId:v,role:y,listItemsRef:b,handleItemSelection:w,state:{selectedValues:x,activeIndex:C,setActiveIndex:_}}=IC(),S=x.includes(t),A=null==(f=p.get(t))?void 0:f.index,k=C===A;return null==A?null:(0,i.jsx)(TC,{...h,onFocus:()=>{m||_(A)},onPointerEnter:e=>{_(A),m||e.currentTarget.focus()},onPointerDown:e=>{m&&e.preventDefault()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),w(t),null==u||u())},onClick:e=>{w(t),null==u||u(),null==d||d(e)},ref:e=>b.current[A]=e,id:`${v}-${A}`,role:"menu"===y?"menuitem":"option",tabIndex:m?void 0:k&&!c?-1:0,"aria-selected":k&&S,showCheckmark:g,isDisabled:c,isActive:k,isSelected:S,startIcon:r,description:a,endIcon:n,endSection:o,capitalizeFirst:s,"data-value":t,children:e})}var MC={exports:{}};!function(e){(function(){var t=Object.assign;function r(e,r){r||(r={});var n,i,o,a=r.vargs||function(e){var t=e+"",r=t.indexOf("...");return r>=0&&(r<t.indexOf(")")||t.indexOf("arguments")>=0)}(e),s=Object.create(null),l=[],c=[],u=new WeakMap,d=r.maxAge>0&&r.maxAge<1/0?function(e,t,n){return setTimeout(function(){if(n)return t.splice(e,1),void n.splice(e,1);t instanceof WeakMap?t.delete(e):delete t[e]},r.maxAge)}:0,h=r.equals?r.equals:function(e,t){return e===t},f=r.maxArgs,p=r.serializer;return 1!==e.length||r.equals||a?i=function(){var t=arguments.length;if(!t&&null!=n)return c[n];var r,i=f||t;for(r=l.length-1;r>=0;r--)if(f||l[r].length===i)for(var o=i-1;o>=0&&h(l[r][o],arguments[o]);o--)if(0===o)return c[r];return r=l.length-(r+1),!t&&null==n&&(n=r),!d||d(r,c,l),c[r]=e.apply(this,l[r]=arguments)}.bind(this):(i=function(t){var r,n=typeof t;if(!p&&("object"===n&&t||"function"===n))return u.get(t)||(!d||d(t,u),u.set(t,r=e.call(this,t)),r);var i="number"===n||"boolean"===n||null==t?t:"string"===n?JSON.stringify(t):p(t);return s[i]||(!d||d(i,s),s[i]=e.call(this,t))}.bind(this),o=1),i.clear=function(){u=new WeakMap,s=Object.create(null),l=[],c=[],n=void 0},i.keys=function(){return o?null:l.slice()},i.values=function(){return o?null:c.slice()},i.keyValues=function(){return o?{primitives:t({},s),objects:u}:null},i}"function"!=typeof t&&(t=function(){var e=arguments,t=arguments[0];if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var r=1;r<e.length;r++)if(e[r]&&"object"==typeof e[r])for(var n in e[r])t[n]=e[r][n];return t}),e.exports=r,typeof window<"u"&&(window.nanomemoize=r)}).call(nh)}(MC);const PC=ih(MC.exports);function RC({children:e,label:t,index:r}){const n=(0,o.useId)();return(0,i.jsxs)("div",{role:"group",className:gh(0!==r&&"border-t my-4"),"aria-labelledby":t?`be-select-${n}`:void 0,children:[t&&(0,i.jsx)("div",{className:"block uppercase text-muted text-xs px-16 py-10",role:"presentation",id:`be-select-${n}`,"aria-hidden":"true",children:t}),e]})}const LC=PC(({maxItems:e,children:t,items:r,inputValue:n})=>{let i=DC({children:t,items:r}),o=NC({collection:i,inputValue:n});return e&&(i=new Map([...i.entries()].slice(0,e)),o=new Map([...o.entries()].slice(0,e))),{collection:i,filteredCollection:o}}),NC=PC(({collection:e,inputValue:t})=>{let r=new Map;const n=t?`${t}`.toLowerCase().trim():"";if(n){let t=0;e.forEach((e,i)=>{(e.item?JSON.stringify(e.item):e.textLabel).toLowerCase().trim().includes(n)&&r.set(i,{...e,index:t++})})}else r=e;return r}),DC=PC(({children:e,items:t})=>{let r;r=t&&"function"==typeof e?t.map(t=>e(t)):e;const n=new Map;let i=0;const a=(e,r,o,a)=>{const s=i++,l=r?null==t?void 0:t[o].items[a]:null==t?void 0:t[s];n.set(e.props.value,{index:s,element:e,textLabel:zC(e),item:l,section:r,isDisabled:e.props.isDisabled,value:e.props.value})};return o.Children.forEach(r,(e,t)=>{(0,o.isValidElement)(e)&&(e.type===RC?o.Children.forEach(e.props.children,(r,n)=>{a(r,e,t,n)}):a(e))}),n});function zC(e){var t;const r=e.props.children;return e.props.textLabel?e.props.textLabel:null!=(t=null==r?void 0:r.props)&&t.message?r.props.message:`${r}`||""}const BC=Math.min,UC=Math.max,VC=Math.round,HC=Math.floor,WC=e=>({x:e,y:e}),$C={left:"right",right:"left",bottom:"top",top:"bottom"},qC={start:"end",end:"start"};function GC(e,t,r){return UC(e,BC(t,r))}function YC(e,t){return"function"==typeof e?e(t):e}function XC(e){return e.split("-")[0]}function KC(e){return e.split("-")[1]}function ZC(e){return"x"===e?"y":"x"}function QC(e){return"y"===e?"height":"width"}function JC(e){return["top","bottom"].includes(XC(e))?"y":"x"}function e_(e){return ZC(JC(e))}function t_(e){return e.replace(/start|end/g,e=>qC[e])}function r_(e){return e.replace(/left|right|bottom|top/g,e=>$C[e])}function n_(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function i_(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function o_(e,t,r){let{reference:n,floating:i}=e;const o=JC(t),a=e_(t),s=QC(a),l=XC(t),c="y"===o,u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,h=n[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:n.y-i.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}switch(KC(t)){case"start":f[a]-=h*(r&&c?-1:1);break;case"end":f[a]+=h*(r&&c?-1:1)}return f}async function a_(e,t){var r;void 0===t&&(t={});const{x:n,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=YC(t,e),p=n_(f),g=s[h?"floating"===d?"reference":"floating":d],m=i_(await o.getClippingRect({element:null==(r=await(null==o.isElement?void 0:o.isElement(g)))||r?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},w=i_(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+p.top)/b.y,bottom:(w.bottom-m.bottom+p.bottom)/b.y,left:(m.left-w.left+p.left)/b.x,right:(w.right-m.right+p.right)/b.x}}function s_(e){return u_(e)?(e.nodeName||"").toLowerCase():"#document"}function l_(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function c_(e){var t;return null==(t=(u_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function u_(e){return e instanceof Node||e instanceof l_(e).Node}function d_(e){return e instanceof Element||e instanceof l_(e).Element}function h_(e){return e instanceof HTMLElement||e instanceof l_(e).HTMLElement}function f_(e){return!(typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof l_(e).ShadowRoot)}function p_(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=b_(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function g_(e){return["table","td","th"].includes(s_(e))}function m_(e){const t=v_(),r=b_(e);return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some(e=>(r.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(r.contain||"").includes(e))}function v_(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function y_(e){return["html","body","#document"].includes(s_(e))}function b_(e){return l_(e).getComputedStyle(e)}function w_(e){return d_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function x_(e){if("html"===s_(e))return e;const t=e.assignedSlot||e.parentNode||f_(e)&&e.host||c_(e);return f_(t)?t.host:t}function C_(e){const t=x_(e);return y_(t)?e.ownerDocument?e.ownerDocument.body:e.body:h_(t)&&p_(t)?t:C_(t)}function __(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const i=C_(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),a=l_(i);return o?t.concat(a,a.visualViewport||[],p_(i)?i:[],a.frameElement&&r?__(a.frameElement):[]):t.concat(i,__(i,[],r))}function S_(e){const t=b_(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=h_(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=VC(r)!==o||VC(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function A_(e){return d_(e)?e:e.contextElement}function k_(e){const t=A_(e);if(!h_(t))return WC(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=S_(t);let a=(o?VC(r.width):r.width)/n,s=(o?VC(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const E_=WC(0);function I_(e){const t=l_(e);return v_()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:E_}function j_(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const i=e.getBoundingClientRect(),o=A_(e);let a=WC(1);t&&(n?d_(n)&&(a=k_(n)):a=k_(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==l_(e))&&t}(o,r,n)?I_(o):WC(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const e=l_(o),t=n&&d_(n)?l_(n):n;let r=e,i=r.frameElement;for(;i&&n&&t!==r;){const e=k_(i),t=i.getBoundingClientRect(),n=b_(i),o=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=a,r=l_(i),i=r.frameElement}}return i_({width:u,height:d,x:l,y:c})}const T_=[":popover-open",":modal"];function F_(e){return T_.some(t=>{try{return e.matches(t)}catch{return!1}})}function O_(e){return j_(c_(e)).left+w_(e).scrollLeft}function M_(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=l_(e),n=c_(e),i=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=v_();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=c_(e),r=w_(e),n=e.ownerDocument.body,i=UC(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=UC(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+O_(e);const s=-r.scrollTop;return"rtl"===b_(n).direction&&(a+=UC(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:s}}(c_(e));else if(d_(t))n=function(e,t){const r=j_(e,!0,"fixed"===t),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=h_(e)?k_(e):WC(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:n*o.y}}(t,r);else{const r=I_(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return i_(n)}function P_(e,t){const r=x_(e);return!(r===t||!d_(r)||y_(r))&&("fixed"===b_(r).position||P_(r,t))}function R_(e,t){const r=t.get(e);if(r)return r;let n=__(e,[],!1).filter(e=>d_(e)&&"body"!==s_(e)),i=null;const o="fixed"===b_(e).position;let a=o?x_(e):e;for(;d_(a)&&!y_(a);){const t=b_(a),r=m_(a);!r&&"fixed"===t.position&&(i=null),(o?!r&&!i:!r&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||p_(a)&&!r&&P_(e,a))?n=n.filter(e=>e!==a):i=t,a=x_(a)}return t.set(e,n),n}function L_(e,t,r){const n=h_(t),i=c_(t),o="fixed"===r,a=j_(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=WC(0);if(n||!n&&!o)if(("body"!==s_(t)||p_(i))&&(s=w_(t)),n){const e=j_(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=O_(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function N_(e){return"static"===b_(e).position}function D_(e,t){return h_(e)&&"fixed"!==b_(e).position?t?t(e):e.offsetParent:null}function z_(e,t){const r=l_(e);if(F_(e))return r;if(!h_(e)){let t=x_(e);for(;t&&!y_(t);){if(d_(t)&&!N_(t))return t;t=x_(t)}return r}let n=D_(e,t);for(;n&&g_(n)&&N_(n);)n=D_(n,t);return n&&y_(n)&&N_(n)&&!m_(n)?r:n||function(e){let t=x_(e);for(;h_(t)&&!y_(t);){if(m_(t))return t;t=x_(t)}return null}(e)||r}const B_={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o="fixed"===i,a=c_(n),s=!!t&&F_(t.floating);if(n===a||s&&o)return r;let l={scrollLeft:0,scrollTop:0},c=WC(1);const u=WC(0),d=h_(n);if((d||!d&&!o)&&(("body"!==s_(n)||p_(a))&&(l=w_(n)),h_(n))){const e=j_(n);c=k_(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x,y:r.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:c_,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[..."clippingAncestors"===r?F_(t)?[]:R_(t,this._c):[].concat(r),n],a=o[0],s=o.reduce((e,r)=>{const n=M_(t,r,i);return e.top=UC(n.top,e.top),e.right=BC(n.right,e.right),e.bottom=BC(n.bottom,e.bottom),e.left=UC(n.left,e.left),e},M_(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:z_,getElementRects:async function(e){const t=this.getOffsetParent||z_,r=this.getDimensions,n=await r(e.floating);return{reference:L_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=S_(e);return{width:t,height:r}},getScale:k_,isElement:d_,isRTL:function(e){return"rtl"===b_(e).direction}};function U_(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=A_(e),u=i||o?[...c?__(c):[],...__(t)]:[];u.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),o&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const i=c_(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const f={rootMargin:-HC(u)+"px "+-HC(i.clientWidth-(c+d))+"px "+-HC(i.clientHeight-(u+h))+"px "+-HC(c)+"px",threshold:UC(0,BC(1,l))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return a();t?a(!1,t):r=setTimeout(()=>{a(!1,1e-7)},1e3)}p=!1}try{n=new IntersectionObserver(g,{...f,root:i.ownerDocument})}catch{n=new IntersectionObserver(g,f)}n.observe(e)}(!0),o}(c,r):null;let h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),r()}),c&&!l&&f.observe(c),f.observe(t));let p,g=l?j_(e):null;return l&&function t(){const n=j_(e);g&&(n.x!==g.x||n.y!==g.y||n.width!==g.width||n.height!==g.height)&&r(),g=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener("scroll",r),o&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const V_=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:i}=e,o=await(null==n.isRTL?void 0:n.isRTL(i.floating)),a=XC(r),s=KC(r),l="y"===JC(r),c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=YC(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return a===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},H_=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=YC(e,t),c={x:r,y:n},u=await a_(t,l),d=JC(XC(i)),h=ZC(d);let f=c[h],p=c[d];if(o){const e="y"===h?"bottom":"right";f=GC(f+u["y"===h?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";p=GC(p+u["y"===d?"top":"left"],p,p-u[e])}const g=s.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-r,y:g.y-n}}}}},W_=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=YC(e,t);if(null!=(r=o.arrow)&&r.alignmentOffset)return{};const v=XC(i),y=XC(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(y||!g?[r_(s)]:function(e){const t=r_(e);return[t_(e),t,t_(t)]}(s));!h&&"none"!==p&&w.push(...function(e,t,r,n){const i=KC(e);let o=function(e,t,r){const n=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:a;default:return[]}}(XC(e),"start"===r,n);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(t_)))),o}(s,g,p,b));const x=[s,...w],C=await a_(t,m),_=[];let S=(null==(n=o.flip)?void 0:n.overflows)||[];if(u&&_.push(C[v]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=KC(e),i=e_(e),o=QC(i);let a="x"===i?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=r_(a)),[a,r_(a)]}(i,a,b);_.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:i,overflows:_}],!_.every(e=>e<=0)){var A,k;const e=((null==(A=o.flip)?void 0:A.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let r=null==(k=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!r)switch(f){case"bestFit":{var E;const e=null==(E=S.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:E[0];e&&(r=e);break}case"initialPlacement":r=s}if(i!==r)return{reset:{placement:r}}}return{}}}},$_=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=YC(e,t),l=await a_(t,s),c=XC(r),u=KC(r),d="y"===JC(r),{width:h,height:f}=n.floating;let p,g;"top"===c||"bottom"===c?(p=c,g=u===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p="end"===u?"top":"bottom");const m=f-l.top-l.bottom,v=h-l.left-l.right,y=BC(f-l[p],m),b=BC(h-l[g],v),w=!t.middlewareData.shift;let x=y,C=b;if(d?C=u||w?BC(b,v):v:x=u||w?BC(y,m):m,w&&!u){const e=UC(l.left,0),t=UC(l.right,0),r=UC(l.top,0),n=UC(l.bottom,0);d?C=h-2*(0!==e||0!==t?e+t:UC(l.left,l.right)):x=f-2*(0!==r||0!==n?r+n:UC(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:x});const _=await i.getDimensions(o.floating);return h!==_.width||f!==_.height?{reset:{rects:!0}}:{}}}},q_=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=YC(e,t)||{};if(null==c)return{};const d=n_(u),h={x:r,y:n},f=e_(i),p=QC(f),g=await a.getDimensions(c),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[f]-h[f]-o.floating[p],x=h[f]-o.reference[f],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let _=C?C[b]:0;(!_||!await(null==a.isElement?void 0:a.isElement(C)))&&(_=s.floating[b]||o.floating[p]);const S=w/2-x/2,A=_/2-g[p]/2-1,k=BC(d[v],A),E=BC(d[y],A),I=k,j=_-g[p]-E,T=_/2-g[p]/2+S,F=GC(I,T,j),O=!l.arrow&&null!=KC(i)&&T!==F&&o.reference[p]/2-(T<I?k:E)-g[p]/2<0,M=O?T<I?T-I:T-j:0;return{[f]:h[f]+M,data:{[f]:F,centerOffset:T-F-M,...O&&{alignmentOffset:M}},reset:O}}});var G_=typeof document<"u"?o.useLayoutEffect:o.useEffect;function Y_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;0!==n--;)if(!Y_(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;0!==n--;){const r=i[n];if(!("_owner"===r&&e.$$typeof||Y_(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function X_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function K_(e,t){const r=X_(e);return Math.round(t*r)/r}function Z_(e){const t=o.useRef(e);return G_(()=>{t.current=e}),t}function Q_({floatingWidth:e,ref:t,disablePositioning:r=!1,placement:n="bottom",offset:i=2,showArrow:a=!1,maxHeight:s,shiftCrossAxis:l=!0,fallbackPlacements:c}){const u=(0,o.useRef)(null),d={placement:n,strategy:"fixed"};r||(d.whileElementsMounted=U_,d.middleware=[V_(i),H_({padding:16,crossAxis:l,mainAxis:!0}),W_({padding:16,fallbackPlacements:c}),$_({apply({rects:t,availableHeight:r,availableWidth:n,elements:i}){"matchTrigger"===e&&null!=s?Object.assign(i.floating.style,{width:`${t.reference.width}px`,maxWidth:`${n}`,maxHeight:`${Math.min(r,s)}px`}):null!=s&&Object.assign(i.floating.style,{maxHeight:`${Math.min(r,s)}px`})},padding:16})],a&&d.middleware.push((e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?q_({element:r.current,padding:n}).fn(t):{}:r?q_({element:r,padding:n}).fn(t):{}}}))({element:u})));const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=o.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=o.useState(n);Y_(f,n)||p(n);const[g,m]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback(e=>{e!=_.current&&(_.current=e,m(e))},[m]),w=o.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[y]),x=a||g,C=s||v,_=o.useRef(null),S=o.useRef(null),A=o.useRef(d),k=Z_(c),E=Z_(i),I=o.useCallback(()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:r,middleware:f};E.current&&(e.platform=E.current),((e,t,r)=>{const n=new Map,i={platform:B_,...r},o={...i.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=o_(c,n,l),h=n,f={},p=0;for(let g=0;g<s.length;g++){const{name:r,fn:o}=s[g],{x:m,y:v,data:y,reset:b}=await o({x:u,y:d,initialPlacement:n,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=m??u,d=v??d,f={...f,[r]:{...f[r],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=o_(c,h,l))),g=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{...i,platform:o})})(_.current,S.current,e).then(e=>{const t={...e,isPositioned:!0};j.current&&!Y_(A.current,t)&&(A.current=t,le.flushSync(()=>{h(t)}))})},[f,t,r,E]);G_(()=>{!1===u&&A.current.isPositioned&&(A.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const j=o.useRef(!1);G_(()=>(j.current=!0,()=>{j.current=!1}),[]),G_(()=>{if(x&&(_.current=x),C&&(S.current=C),x&&C){if(k.current)return k.current(x,C,I);I()}},[x,C,I,k]);const T=o.useMemo(()=>({reference:_,floating:S,setReference:b,setFloating:w}),[b,w]),F=o.useMemo(()=>({reference:x,floating:C}),[x,C]),O=o.useMemo(()=>{const e={position:r,left:0,top:0};if(!F.floating)return e;const t=K_(F.floating,d.x),n=K_(F.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...X_(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,F.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:I,refs:T,elements:F,floatingStyles:O}),[d,I,T,F,O])}(d),f=(0,o.useMemo)(()=>function(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}([t,h.refs.setReference]),[h.refs.setReference,t]),{x:p,y:g}=h.middlewareData.arrow||{},m={top:"bottom",right:"left",bottom:"top",left:"right"}[h.placement.split("-")[0]],v={left:p,top:g,right:"",bottom:"",[m]:"-4px"};return{...h,reference:f,arrowRef:u,arrowStyle:v}}function J_(e,t){const{children:r,items:n,role:i="listbox",virtualFocus:a,focusLoopingMode:s="stay",autoFocusFirstItem:l=!0,onItemSelected:c,clearInputOnItemSelection:u,blurReferenceOnItemSelection:d,floatingWidth:h="matchTrigger",floatingMinWidth:f,floatingMaxHeight:p,offset:g,placement:m,showCheckmark:v,showEmptyMessage:y,maxItems:b,isAsync:w,allowCustomValue:x,clearSelectionOnInputClear:C}=e,_=e.selectionMode||"none",S=`${(0,o.useId)()}-listbox`,[A,k]=Yw(e.inputValue,e.defaultInputValue||"",e.onInputValueChange),[E,I]=(0,o.useState)("all"),j=LC({children:r,items:n,inputValue:w?void 0:A,maxItems:b}),T="all"===E?j.collection:j.filteredCollection,F=(0,o.useRef)([]),O=(0,o.useMemo)(()=>[...T.values()].map(e=>e.isDisabled?null:e.textLabel),[T]),{selectedValues:M,selectValues:P}=function(e){const{selectionMode:t,allowEmptySelection:r}=e,n="single"===t||"multiple"===t,[i,a]=Yw(n?e.selectedValue:void 0,n?e.defaultSelectedValue:void 0,n?e.onSelectionChange:void 0),s=(0,o.useMemo)(()=>typeof i>"u"?[]:Array.isArray(i)?i:[i],[i]),l=(0,o.useCallback)(e=>{const n=Array.isArray(e)?e:[e];"single"===t?a(n[0]):n.forEach(e=>{const t=s.indexOf(e);-1===t?(s.push(e),a([...s])):(s.length>1||r)&&(s.splice(t,1),a([...s]))})},[r,s,t,a]);return{selectedValues:s,selectValues:l}}(e),[R,L]=Yw(e.isOpen,e.defaultIsOpen,e.onOpenChange),[N,D]=(0,o.useState)(null),z=Q_({floatingWidth:h,ref:t,placement:m,offset:g,maxHeight:p??420,shiftCrossAxis:!a}),{refs:B,strategy:U,x:V,y:H}=z,W="none"===_?void 0:T.get(M[0]),$="none"===_||null==W?void 0:W.index,q=(0,o.useCallback)((e,t)=>{var r,n;const i=[...T.values()],o=!i.find(e=>!e.isDisabled),l=T.size-1;null==t||!T.size||t>l||t<0||o?D(null):(t=function(e,t,r,n){var i;const o=e.length-1;for(;null!=(i=e[t])&&i.isDisabled;)if("increment"===n){if(++t>=o){if("loop"!==r)return"stay"===r?t-1:null;t=0}}else if(--t<0){if("loop"!==r)return"stay"===r?t+1:null;t=o}return t}(i,t,s,e),D(t),null!=t&&(a?null==(r=F.current[t])||r.scrollIntoView({block:"nearest"}):null==(n=F.current[t])||n.focus()))},[T,a,s]);return{handleItemSelection:e=>{const t=B.reference.current;"none"!==_?P(e):t&&"focus"in t&&t.focus(),a&&(k(u?"":`${e}`),d&&t&&"blur"in t&&t.blur()),I("all"),L(!1),null==c||c(e),D(null)},onInputChange:(0,o.useCallback)(e=>{k(e.target.value),I(e.target.value.trim()?"filtered":"all"),e.target.value?L(!0):C&&P(""),l&&null==N?q("increment",0):D(null)},[k,L,I,P,C,q,l,N]),focusLoopingMode:s,floatingWidth:h,floatingMinWidth:f,floatingMaxHeight:p,showCheckmark:v,collection:T,collections:j,virtualFocus:a,focusItem:q,showEmptyMessage:y&&!!A,allowCustomValue:x,refs:B,reference:z.reference,floating:B.setFloating,positionStyle:{position:U,top:H??"",left:V??""},listContent:O,listItemsRef:F,listboxId:S,role:i,state:{activeIndex:N,setActiveIndex:D,selectedIndex:$,setSelectedIndex:e=>{if("none"!==_){const t=[...T.values()][e];t&&P(t.value)}},selectionMode:_,selectedValues:M,selectValues:P,inputValue:A,setInputValue:k,isOpen:R,setIsOpen:L,setActiveCollection:I}}}let eS=null,tS=new Set,rS=new Map,nS=!1,iS=!1;function oS(e,t){for(let r of tS)r(e,t)}function aS(e){nS=!0,function(e){return!(e.metaKey||!Bw()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(eS="keyboard",oS("keyboard",e))}function sS(e){eS="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(nS=!0,oS("pointer",e))}function lS(e){(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(function(e){var t;return!(typeof window>"u"||null==window.navigator)&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some(t=>e.test(t.brand)))||e.test(window.navigator.userAgent))}(/Android/i)&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)})(e)&&(nS=!0,eS="virtual")}function cS(e){e.target===window||e.target===document||(!nS&&!iS&&(eS="virtual",oS("virtual",e)),nS=!1,iS=!1)}function uS(){nS=!1,iS=!0}function dS(e){if(typeof window>"u"||rS.get(Lw(e)))return;const t=Lw(e),r=Rw(e);let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){nS=!0,n.apply(this,arguments)},r.addEventListener("keydown",aS,!0),r.addEventListener("keyup",aS,!0),r.addEventListener("click",lS,!0),t.addEventListener("focus",cS,!0),t.addEventListener("blur",uS,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",sS,!0),r.addEventListener("pointermove",sS,!0),r.addEventListener("pointerup",sS,!0)):(r.addEventListener("mousedown",sS,!0),r.addEventListener("mousemove",sS,!0),r.addEventListener("mouseup",sS,!0)),t.addEventListener("beforeunload",()=>{hS(e)},{once:!0}),rS.set(t,{focus:n})}const hS=(e,t)=>{const r=Lw(e),n=Rw(e);t&&n.removeEventListener("DOMContentLoaded",t),rS.has(r)&&(r.HTMLElement.prototype.focus=rS.get(r).focus,n.removeEventListener("keydown",aS,!0),n.removeEventListener("keyup",aS,!0),n.removeEventListener("click",lS,!0),r.removeEventListener("focus",cS,!0),r.removeEventListener("blur",uS,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",sS,!0),n.removeEventListener("pointermove",sS,!0),n.removeEventListener("pointerup",sS,!0)):(n.removeEventListener("mousedown",sS,!0),n.removeEventListener("mousemove",sS,!0),n.removeEventListener("mouseup",sS,!0)),rS.delete(r))};function fS(e,t){return"#comment"!==e.nodeName&&function(e){const t=Lw(e);if(!(e instanceof t.HTMLElement||e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,i="none"!==r&&"hidden"!==n&&"collapse"!==n;if(i){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:r,visibility:n}=t(e);i="none"!==r&&"hidden"!==n&&"collapse"!==n}return i}(e)&&function(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||fS(e.parentElement,e))}typeof document<"u"&&function(e){const t=Rw(e);let r;"loading"!==t.readyState?dS(e):(r=()=>{dS(e)},t.addEventListener("DOMContentLoaded",r))}();const pS=o.createContext(null);let gS=null;function mS(e){let{children:t,contain:r,restoreFocus:n,autoFocus:i}=e,a=(0,o.useRef)(null),s=(0,o.useRef)(null),l=(0,o.useRef)([]),{parentNode:c}=(0,o.useContext)(pS)||{},u=(0,o.useMemo)(()=>new TS({scopeRef:l}),[l]);kw(()=>{let e=c||FS.root;if(FS.getTreeNode(e.scopeRef)&&gS&&!AS(gS,e.scopeRef)){let t=FS.getTreeNode(gS);t&&(e=t)}e.addChild(u),FS.addNode(u)},[u,c]),kw(()=>{let e=FS.getTreeNode(l);e&&(e.contain=!!r)},[r]),kw(()=>{var e;let t=null===(e=a.current)||void 0===e?void 0:e.nextSibling,r=[];for(;t&&t!==s.current;)r.push(t),t=t.nextSibling;l.current=r},[t]),function(e,t,r){kw(()=>{if(t||r)return;let n=e.current;const i=Rw(n?n[0]:void 0);let o=t=>{let r=t.target;_S(r,e.current)?gS=e:CS(r)||(gS=null)};return i.addEventListener("focusin",o,!1),null==n||n.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==n||n.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,t,r])}(l,n,r),function(e,t){let r=(0,o.useRef)(),n=(0,o.useRef)();kw(()=>{let i=e.current;if(!t)return void(n.current&&(cancelAnimationFrame(n.current),n.current=void 0));const o=Rw(i?i[0]:void 0);let a=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!xS(e)||t.isComposing)return;let r=o.activeElement,n=e.current;if(!n||!_S(r,n))return;let i=IS(wS(n),{tabbable:!0},n);if(!r)return;i.currentNode=r;let a=t.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=t.shiftKey?n[n.length-1].nextElementSibling:n[0].previousElementSibling,a=t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),a&&kS(a,!0)},s=t=>{gS&&!AS(gS,e)||!_S(t.target,e.current)?xS(e)&&!SS(t.target,e)?r.current?r.current.focus():gS&&gS.current&&ES(gS.current):xS(e)&&(r.current=t.target):(gS=e,r.current=t.target)},l=t=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>{if(o.activeElement&&xS(e)&&!SS(o.activeElement,e))if(gS=e,o.body.contains(t.target)){var n;r.current=t.target,null===(n=r.current)||void 0===n||n.focus()}else gS.current&&ES(gS.current)})};return o.addEventListener("keydown",a,!1),o.addEventListener("focusin",s,!1),null==i||i.forEach(e=>e.addEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.addEventListener("focusout",l,!1)),()=>{o.removeEventListener("keydown",a,!1),o.removeEventListener("focusin",s,!1),null==i||i.forEach(e=>e.removeEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.removeEventListener("focusout",l,!1))}},[e,t]),kw(()=>()=>{n.current&&cancelAnimationFrame(n.current)},[n])}(l,r),function(e,t,r){const n=(0,o.useRef)(typeof document<"u"?Rw(e.current?e.current[0]:void 0).activeElement:null);kw(()=>{let n=e.current;const i=Rw(n?n[0]:void 0);if(!t||r)return;let o=()=>{(!gS||AS(gS,e))&&_S(i.activeElement,e.current)&&(gS=e)};return i.addEventListener("focusin",o,!1),null==n||n.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==n||n.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,r]),kw(()=>{const n=Rw(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!xS(e)||t.isComposing)return;let r=n.activeElement;if(!_S(r,e.current))return;let i=FS.getTreeNode(e);if(!i)return;let o=i.nodeToRestore,a=IS(n.body,{tabbable:!0});a.currentNode=r;let s=t.shiftKey?a.previousNode():a.nextNode();if((!o||!n.body.contains(o)||o===n.body)&&(o=void 0,i.nodeToRestore=void 0),(!s||!_S(s,e.current))&&o){a.currentNode=o;do{s=t.shiftKey?a.previousNode():a.nextNode()}while(_S(s,e.current));t.preventDefault(),t.stopPropagation(),s?kS(s,!0):CS(o)?kS(o,!0):r.blur()}};return r||n.addEventListener("keydown",i,!0),()=>{r||n.removeEventListener("keydown",i,!0)}},[e,t,r]),kw(()=>{const r=Rw(e.current?e.current[0]:void 0);if(!t)return;let i=FS.getTreeNode(e);var o;return i?(i.nodeToRestore=null!==(o=n.current)&&void 0!==o?o:void 0,()=>{let n=FS.getTreeNode(e);if(!n)return;let i=n.nodeToRestore;if(t&&i&&(_S(r.activeElement,e.current)||r.activeElement===r.body&&function(e){let t=FS.getTreeNode(gS);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}(e))){let t=FS.clone();requestAnimationFrame(()=>{if(r.activeElement===r.body){let r=t.getTreeNode(e);for(;r;){if(r.nodeToRestore&&r.nodeToRestore.isConnected)return void kS(r.nodeToRestore);r=r.parent}for(r=t.getTreeNode(e);r;){if(r.scopeRef&&r.scopeRef.current&&FS.getTreeNode(r.scopeRef))return void ES(r.scopeRef.current,!0);r=r.parent}}})}}):void 0},[e,t])}(l,n,r),function(e,t){const r=o.useRef(t);(0,o.useEffect)(()=>{r.current&&(gS=e,!_S(Rw(e.current?e.current[0]:void 0).activeElement,gS.current)&&e.current&&ES(e.current)),r.current=!1},[e])}(l,i),(0,o.useEffect)(()=>{const e=Rw(l.current?l.current[0]:void 0).activeElement;let t=null;if(_S(e,l.current)){for(let r of FS.traverse())r.scopeRef&&_S(e,r.scopeRef.current)&&(t=r);t===FS.getTreeNode(l)&&(gS=t.scopeRef)}},[l]),kw(()=>()=>{var e,t,r;let n=null!==(r=null===(t=FS.getTreeNode(l))||void 0===t||null===(e=t.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==r?r:null;(l===gS||AS(l,gS))&&(!n||FS.getTreeNode(n))&&(gS=n),FS.removeTreeNode(l)},[l]);let d=(0,o.useMemo)(()=>function(e){return{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||Rw(r[0]).activeElement,l=r[0].previousElementSibling,c=IS(wS(r),{tabbable:i,accept:a},r);c.currentNode=_S(s,r)?s:l;let u=c.nextNode();return!u&&o&&(c.currentNode=l,u=c.nextNode()),u&&kS(u,!0),u},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||Rw(r[0]).activeElement,l=r[r.length-1].nextElementSibling,c=IS(wS(r),{tabbable:i,accept:a},r);c.currentNode=_S(s,r)?s:l;let u=c.previousNode();return!u&&o&&(c.currentNode=l,u=c.previousNode()),u&&kS(u,!0),u},focusFirst(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=IS(wS(r),{tabbable:n,accept:i},r);o.currentNode=r[0].previousElementSibling;let a=o.nextNode();return a&&kS(a,!0),a},focusLast(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=IS(wS(r),{tabbable:n,accept:i},r);o.currentNode=r[r.length-1].nextElementSibling;let a=o.previousNode();return a&&kS(a,!0),a}}}(l),[]),h=(0,o.useMemo)(()=>({focusManager:d,parentNode:u}),[u,d]);return o.createElement(pS.Provider,{value:h},o.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,o.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}const vS=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],yS=vS.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";vS.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const bS=vS.join(':not([hidden]):not([tabindex="-1"]),');function wS(e){return e[0].parentElement}function xS(e){let t=FS.getTreeNode(gS);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function CS(e){return SS(e)}function _S(e,t){return!(!e||!t)&&t.some(t=>t.contains(e))}function SS(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of FS.traverse(FS.getTreeNode(t)))if(r&&_S(e,r.current))return!0;return!1}function AS(e,t){var r;let n=null===(r=FS.getTreeNode(t))||void 0===r?void 0:r.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function kS(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{!function(e){const t=Rw(e);if("virtual"===eS){let r=t.activeElement;!function(e){requestAnimationFrame(()=>{0===Uw.size?e():Vw.add(e)})}(()=>{t.activeElement===r&&e.isConnected&&Dw(e)})}else Dw(e)}(e)}catch{}}function ES(e,t=!0){let r=e[0].previousElementSibling,n=wS(e),i=IS(n,{tabbable:t},e);i.currentNode=r;let o=i.nextNode();t&&!o&&(n=wS(e),i=IS(n,{tabbable:!1},e),i.currentNode=r,o=i.nextNode()),kS(o)}function IS(e,t,r){let n=null!=t&&t.tabbable?bS:yS,i=Rw(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var i;return null!=t&&null!==(i=t.from)&&void 0!==i&&i.contains(e)?NodeFilter.FILTER_REJECT:!e.matches(n)||!fS(e)||r&&!_S(e,r)||null!=t&&t.accept&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return null!=t&&t.from&&(i.currentNode=t.from),i}class jS{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,r){let n=this.fastMap.get(t??null);if(!n)return;let i=new TS({scopeRef:e});n.addChild(i),i.parent=n,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let r=t.parent;for(let i of this.traverse())i!==t&&t.nodeToRestore&&i.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&_S(i.nodeToRestore,t.scopeRef.current)&&(i.nodeToRestore=t.nodeToRestore);let n=t.children;r&&(r.removeChild(t),n.size>0&&n.forEach(e=>r&&r.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){var e;let t=new jS;var r;for(let n of this.traverse())t.addTreeNode(n.scopeRef,null!==(r=null===(e=n.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==r?r:null,n.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new TS({scopeRef:null}),this.fastMap.set(null,this.root)}}class TS{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let FS=new jS;function OS(){const{width:e,height:t}=function(){let e=Fw(),[t,r]=(0,o.useState)(()=>e?{width:0,height:0}:Gw());return(0,o.useEffect)(()=>{let e=()=>{r(e=>{let t=Gw();return t.width===e.width&&t.height===e.height?e:t})};return qw?qw.addEventListener("resize",e):window.addEventListener("resize",e),()=>{qw?qw.removeEventListener("resize",e):window.removeEventListener("resize",e)}},[]),t}();return{"--be-viewport-height":`${t}px`,"--be-viewport-width":`${e}px`}}const MS={initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:"tween",duration:.125}},PS=(0,o.forwardRef)(({children:e,style:t,autoFocus:r=!1,restoreFocus:n=!0,isDismissable:a,isContextMenu:s,isOpen:l,onClose:c,triggerRef:u,arrowRef:d,arrowStyle:h,onPointerLeave:f,onPointerEnter:p},g)=>{const m=OS(),v=$w(g),{domProps:y}=function({onClose:e,isDismissable:t=!0,triggerRef:r,isContextMenu:n=!1},i){const a=(0,o.useRef)({isPointerDown:!1,isContextMenu:n,onClose:e}),s=a.current;s.isContextMenu=n,s.onClose=e;const l=(0,o.useCallback)(e=>{const t=e.target;if(t){const e=t.ownerDocument;if(!e||!e.documentElement.contains(t))return!1}return i.current&&!i.current.contains(t)},[i]),c=(0,o.useCallback)(()=>RS[RS.length-1]===i,[i]),u=(0,o.useCallback)(()=>{c()&&s.onClose()},[c,s]),d=(0,o.useCallback)(e=>{var t,n;return!(!r.current||!("contains"in r.current))&&(null==(n=(t=r.current).contains)?void 0:n.call(t,e))},[r]),h=(0,o.useCallback)(e=>{d(e.target)||c()&&(e.stopPropagation(),e.preventDefault())},[d,c]),f=(0,o.useCallback)(e=>{d(e.target)||(c()&&(e.stopPropagation(),e.preventDefault()),(!s.isContextMenu||2!==e.button)&&u())},[d,u,s,c]);return(0,o.useEffect)(()=>{RS.push(i);const e=e=>{l(e)&&(h(e),a.current.isPointerDown=!0)},t=e=>{a.current.isPointerDown&&l(e)&&(a.current.isPointerDown=!1,f(e))},n=e=>{e.preventDefault(),l(e)&&u()},o=e=>{if(!r.current)return;const t=e.target;let n;r.current instanceof Node?n=r.current:"contextElement"in r.current&&(n=r.current.contextElement),(!(t instanceof Node)||!n||t.contains(n))&&s.onClose()};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointerup",t,!0),document.addEventListener("contextmenu",n,!0),document.addEventListener("scroll",o,!0),()=>{const r=RS.indexOf(i);r>=0&&RS.splice(r,1),document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerup",t,!0),document.removeEventListener("contextmenu",n,!0),document.removeEventListener("scroll",o,!0)}},[i,l,s,f,h,r,d,u]),{domProps:{onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),u())}}}}({isDismissable:a,onClose:c,triggerRef:u,isContextMenu:s},v);return(0,i.jsx)(gw.div,{className:"isolate z-popover",role:"presentation",ref:v,style:{...m,...t,position:"fixed"},...MS,...Nw(y,{onPointerLeave:f,onPointerEnter:p}),children:(0,i.jsx)(mS,{restoreFocus:n,autoFocus:r,contain:!1,children:e})})}),RS=[],LS={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}};function NS({position:e="absolute",className:t,isTransparent:r=!1,disableInitialTransition:n,...o}){return(0,i.jsx)(gw.div,{...o,className:gh(t,!r&&"bg-background/80","inset-0 z-10 h-full w-full",e,"backdrop-blur-sm"),"aria-hidden":!0,initial:n?void 0:{opacity:0},animate:{opacity:1},exit:{opacity:0},...LS,transition:{duration:.15}})}const DS=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:r=!0,isDismissable:n,isOpen:o,onClose:a},s)=>{const l=OS(),c=$w(s);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-tray",style:l,children:[(0,i.jsx)(NS,{onClick:()=>{n&&a()}},"tray-underlay"),(0,i.jsx)(gw.div,{ref:c,className:"absolute bottom-0 left-0 right-0 z-20 mx-auto max-h-tray w-full max-w-375 overflow-hidden rounded-t pb-safe-area",role:"presentation",initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},transition:{type:"tween",duration:.2},children:(0,i.jsx)(mS,{restoreFocus:r,autoFocus:t,contain:!0,children:e})})]})});function zS(e,t){if(e===t)return!0;if(!e||!t)return!1;const r=Object.keys(e),n=Object.keys(t),i=r.length;if(n.length!==i)return!1;for(let o=0;o<i;o++){const n=r[o];if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1}return!0}function BS(){const{i18n:e}=_g(e=>e.data);return{locale:e,localeCode:(null==e?void 0:e.language)||"en",lines:null==e?void 0:e.lines}}function US(e,{message:t,values:r}){const n=t.match(/\[(.+?)]/),i=null==r?void 0:r.count;if(n&&n[1]&&!Number.isNaN(i)){const[r,o]=n,a=o.split("|");if(!a.length)return t;const s=VS(e).select(i);let l=a.find(e=>e.startsWith(s));l||(l=a[0]);const c=l.substring(l.indexOf(" ")+1);return t.replace(r,c)}return t}const VS=PC(e=>new Intl.PluralRules(e));function HS(e,t){return null!=e&&(void 0!==Object.hasOwn?Object.hasOwn(e,t):Object.hasOwnProperty(t))}const WS=(0,o.memo)(e=>{const{message:t,values:r}=e,{lines:n,localeCode:a}=BS();let s;if(s=HS(n,t)?null==n?void 0:n[t]:HS(n,null==t?void 0:t.toLowerCase())?null==n?void 0:n[null==t?void 0:t.toLowerCase()]:t,!r||!s)return(0,i.jsx)(o.Fragment,{children:s});s=US(a,{message:s,values:r});const l=[],c=[];if(Object.entries(r).forEach(([e,t])=>{"function"==typeof t?c.push(e):(0,o.isValidElement)(t)?l.push(e):null!=t&&(s=null==s?void 0:s.replace(`:${e}`,`${t}`))}),c.length||l.length){const e=[];if(c.length){const t=c.join("");e.push(`(<[${t}]>.+?<\\/[${t}]>)`)}if(l.length){const t=l.join("|");e.push(`(:(?:${t}))`)}const t=new RegExp(e.join("|"),"gm"),n=s.split(t).filter(Boolean).map((e,t)=>{if(e.startsWith("<")&&e.endsWith(">")){const n=e.match(/<([a-z]+)>(.+?)<\/([a-z]+)>/);if(n){const[,e,i]=n,a=null==r?void 0:r[e];if("function"==typeof a){const e=a(i);return(0,o.cloneElement)(e,{key:t})}}}if(e.startsWith(":")){const n=e.replace(":",""),i=null==r?void 0:r[n];if((0,o.isValidElement)(i))return(0,o.cloneElement)(i,{key:t})}return e});return(0,i.jsx)(o.Fragment,{children:n})}return(0,i.jsx)(o.Fragment,{children:s})},function(e,t){const{values:r,...n}=e,{values:i,...o}=t;return zS(i,r)&&zS(n,o)});function $S({listbox:e,children:t,isLoading:r,mobileOverlay:n=DS,searchField:a,onClose:s,prepend:l,className:c,...u}){const d=Fw()||typeof window>"u"?_g.getState().data.is_mobile_device??!1:window.screen.width<=768,{floatingWidth:h,floatingMinWidth:f="min-w-180",collection:p,showEmptyMessage:g,state:{isOpen:m,setIsOpen:v},positionStyle:y,floating:b,refs:w}=e,x=!l&&d?n:PS,C=gh("text-base sm:text-sm outline-none bg max-h-inherit flex flex-col",!l&&"shadow-xl border py-4",c,x===PS&&"rounded-panel",x===PS&&"auto"===h?`max-w-288 ${f}`:""),_=(0,o.useMemo)(()=>{let e=0;const t=[];return[...p.values()].reduce((r,n)=>{if(n.section){if(!t.includes(n.section)){const i=(0,o.cloneElement)(n.section,{key:n.section.key||e,index:e});r.push(i),t.push(n.section),e++}}else r.push((0,o.cloneElement)(n.element,{key:n.element.key||n.element.props.value}));return r},[])},[p]),S=_.length>0||g&&!r,A=S?(0,i.jsxs)("div",{className:C,role:"presentation",children:[a,(0,i.jsx)(qS,{isLoading:r,...u,children:_})]}):null;return(0,i.jsxs)(EC.Provider,{value:e,children:[t,l?A:xg&&(0,le.createPortal)((0,i.jsx)(Cw,{children:m&&S&&(0,i.jsx)(x,{triggerRef:w.reference,restoreFocus:!0,isOpen:m,onClose:()=>{null==s||s(),v(!1)},isDismissable:!0,style:y,ref:b,children:A})}),xg)]})}function qS({className:e,children:t,isLoading:r,...n}){const{role:a,listboxId:s,virtualFocus:l,focusItem:c,state:{activeIndex:u,setActiveIndex:d,selectedIndex:h}}=IC(),f=(0,o.useRef)(!0),p=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>d(null),[d]),(0,o.useEffect)(()=>{if(f.current){const e=u??h;null!=e||l?null!=e&&requestAnimationFrame(()=>{c("increment",e)}):requestAnimationFrame(()=>{var e;null==(e=p.current)||e.focus({preventScroll:!0})})}f.current=!1},[u,h,c,l]),(0,i.jsx)("div",{tabIndex:l?void 0:-1,role:a,id:s,className:"flex-auto overflow-y-auto overscroll-contain outline-none",ref:p,...n,children:t.length?t:(0,i.jsx)(GS,{})})}function GS(){return(0,i.jsx)("div",{className:"px-8 py-4 text-sm italic text-muted",children:(0,i.jsx)(WS,{message:"There are no items matching your query"})})}function YS({state:{isOpen:e,setIsOpen:t,selectedIndex:r,activeIndex:n,setInputValue:i,setActiveIndex:o},focusLoopingMode:a,collection:s,focusItem:l,handleItemSelection:c,allowCustomValue:u}){const d=n=>{if(!e&&n.currentTarget.contains(n.target)){if("ArrowDown"===n.key)return n.preventDefault(),t(!0),l("increment",r??0),!0;if("ArrowUp"===n.key)return n.preventDefault(),t(!0),l("decrement",r??s.size-1),!0;if("Enter"===n.key||"Space"===n.key)return n.preventDefault(),t(!0),l("increment",r??0),!0}},h=r=>{const i=Math.max(0,s.size-1);if(e&&r.currentTarget.contains(r.target))switch(r.key){case"ArrowDown":return r.preventDefault(),null==n?l("increment",0):n>=i?"loop"===a?l("increment",0):"deselect"===a&&o(null):l("increment",n+1),!0;case"ArrowUp":return r.preventDefault(),null==n?l("decrement",i):n<=0?"loop"===a?l("decrement",i):"deselect"===a&&o(null):l("decrement",n-1),!0;case"Home":return r.preventDefault(),l("increment",0),!0;case"End":return r.preventDefault(),l("decrement",i),!0;case"Tab":return t(!1),!0}};return{handleTriggerKeyDown:d,handleListboxKeyboardNavigation:h,handleListboxSearchFieldKeydown:r=>{var o,a;if("Enter"===r.key&&null!=n&&s.size){r.preventDefault();const[e,t]=[...s.entries()][n];return void(e&&(c(e),null==(a=(o=t.element.props).onSelected)||a.call(o)))}"Escape"===r.key&&e&&(t(!1),u||i("")),d(r)||h(r)}}}const XS=new Map;function KS(){const e=function(e){const{localeCode:t}=BS(),r=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(XS.has(r))return XS.get(r);const n=new Intl.Collator(t,e);return XS.set(r,n),n}({usage:"search",sensitivity:"base"}),t=(0,o.useRef)({search:"",timeout:void 0}).current,r=(r,n)=>{let i=n??0;for(;null!=i;){const n=r[i],o=null==n?void 0:n.slice(0,t.search.length);if(o&&0===e.compare(o,t.search))return i;if(!(i<r.length-1))return null;i++}return null};return{findMatchingItem:(e,n,i=0)=>{const o=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(e.key);if(!o||e.ctrlKey||e.metaKey)return null;" "===o&&t.search.trim().length>0&&(e.preventDefault(),e.stopPropagation()),t.search+=o;let a=r(n,i);return null==a&&(a=r(n,0)),clearTimeout(t.timeout),t.timeout=setTimeout(()=>{t.search=""},500),a??null}}}function ZS(e){return function(e,{noSSR:t}={noSSR:!0}){const r=typeof window<"u"&&"function"==typeof window.matchMedia,[n,i]=(0,o.useState)(t?()=>!!r&&window.matchMedia(e).matches:null);return(0,o.useEffect)(()=>{if(!r)return;const n=window.matchMedia(e),o=()=>{i(n.matches)};return n.addEventListener("change",o),t||o(),()=>{n.removeEventListener("change",o)}},[r,e,t]),typeof window>"u"?null:n}("(max-width: 768px)",e)}const QS=yh((0,i.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"SearchOutlined");var JS=e=>null==e,eA=e=>!JS(e)&&!Array.isArray(e)&&(e=>"object"==typeof e)(e)&&!(e=>e instanceof Date)(e),tA=e=>eA(e)&&e.target?(e=>"checkbox"===e.type)(e.target)?e.target.checked:e.target.value:e,rA=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function nA(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(rA&&(e instanceof Blob||e instanceof FileList)||!r&&!eA(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return eA(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=nA(e[r]));else t=e}return t}var iA=e=>Array.isArray(e)?e.filter(Boolean):[],oA=e=>void 0===e,aA=(e,t,r)=>{if(!t||!eA(e))return r;const n=iA(t.split(/[,[\].]+?/)).reduce((e,t)=>JS(e)?e:e[t],e);return oA(n)||n===e?oA(e[t])?r:e[t]:n},sA=e=>"boolean"==typeof e,lA=(e,t,r)=>{let n=-1;const i=(e=>/^\w*$/.test(e))(t)?[t]:(e=>iA(e.replace(/["|']|\]/g,"").split(/\.|\[/)))(t),o=i.length,a=o-1;for(;++n<o;){const t=i[n];let o=r;if(n!==a){const r=e[t];o=eA(r)||Array.isArray(r)?r:isNaN(+i[n+1])?{}:[]}if("__proto__"===t)return;e[t]=o,e=e[t]}return e};const cA=o.createContext(null),uA=()=>o.useContext(cA);var dA=(e,t,r)=>!e||!t||e===t||(e=>Array.isArray(e)?e:[e])(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e)));function hA(e){const t=o.useRef(e);t.current=e,o.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function fA(e){const t=uA(),{control:r=t.control,disabled:n,name:i,exact:a}=e||{},[s,l]=o.useState(r._formState),c=o.useRef(!0),u=o.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=o.useRef(i);return d.current=i,hA({disabled:n,next:e=>c.current&&dA(d.current,e.name,a)&&((e,t,r)=>{r(e);const{name:n,...i}=e;return(e=>eA(e)&&!Object.keys(e).length)(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>!0===t[e])})(e,u.current,r._updateFormState)&&l({...r._formState,...e}),subject:r._subjects.state}),o.useEffect(()=>(c.current=!0,u.current.isValid&&r._updateValid(!0),()=>{c.current=!1}),[r]),((e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return"all"!==t._proxyFormState[i]&&(t._proxyFormState[i]=!n||"all"),r&&(r[i]=!0),e[i]}});return i})(s,r,u.current,!1)}function pA(e={}){const{size:t="md",startAppend:r,endAppend:n,className:i,labelPosition:o,labelDisplay:a="block",inputClassName:s,inputWrapperClassName:l,unstyled:c,invalid:u,disabled:d,background:h="bg-transparent",flexibleHeight:f,inputShadow:p="shadow-sm",descriptionPosition:g="bottom",inputRing:m,inputFontSize:v,labelSuffix:y}={...e};if(c)return{label:"",input:s||"",wrapper:i||"",inputWrapper:l||"",adornment:"",append:{size:"",radius:""},size:{font:"",height:""},description:"",error:""};const b=function({size:e,flexibleHeight:t}){switch(e){case"2xs":return{font:"text-xs",height:t?"min-h-24":"h-24"};case"xs":return{font:"text-xs",height:t?"min-h-30":"h-30"};case"sm":return{font:"text-sm",height:t?"min-h-36":"h-36"};case"lg":return{font:"text-md md:text-lg",height:t?"min-h-50":"h-50"};case"xl":return{font:"text-xl",height:t?"min-h-60":"h-60"};default:return{font:"text-sm",height:t?"min-h-42":"h-42"}}}({size:e.size,flexibleHeight:f});v&&(b.font=v);const w=r||n,x=m||"focus:ring "+(u?"focus:ring-danger/focus focus:border-danger/60":"focus:ring-primary/focus focus:border-primary/60"),C=function(e){const{startAppend:t,endAppend:r,inputRadius:n}=e,i=t||r;return"rounded-full"===n?{input:gh(!i&&"rounded-full",t&&"rounded-r-full rounded-l-none",r&&"rounded-l-full rounded-r-none"),append:t?"rounded-l-full":"rounded-r-full"}:"rounded-none"===n?{input:"",append:""}:n?{input:n,append:n}:{input:gh(!i&&"rounded-input",t&&"rounded-r-input rounded-l-none",r&&"rounded-l-input rounded-r-none"),append:t?"rounded-l-input":"rounded-r-input"}}(e);return{label:gh(a,"first-letter:capitalize text-left whitespace-nowrap",d&&"text-disabled",b.font,y?"":"side"===o?"mr-16":"mb-4"),input:gh("block text-left relative w-full appearance-none transition-shadow text",h,C.input,gA(e),!d&&`${x} focus:outline-none ${p}`,d&&"text-disabled cursor-not-allowed",s,b.font,b.height,mA(e)),adornment:vA(t),append:{size:xC(t),radius:C.append},wrapper:gh(i,b.font,{"flex items-center":"side"===o}),inputWrapper:gh("isolate relative",l,w&&"flex items-stretch"),size:b,description:`text-muted ${"bottom"===g?"pt-10":"pb-10"} text-xs`,error:"text-danger pt-10 text-xs"}}function gA({startAppend:e,endAppend:t,inputBorder:r,invalid:n}){if(r)return r;const i=n?"border-danger":"border-divider";return e||t?e?`${i} border-y border-r`:`${i} border-y border-l`:`${i} border`}function mA({startAdornment:e,endAdornment:t,inputRadius:r}){return"rounded-full"===r?gh(e?"pl-54":"pl-28",t?"pr-54":"pr-28"):gh(e?"pl-46":"pl-12",t?"pr-46":"pr-12")}function vA(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":case"md":return"icon-sm";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return""}}function yA({children:e,direction:t,className:r,position:n=("start"===t?"left-0":"right-0")}){return e?(0,i.jsx)("div",{className:gh("pointer-events-none absolute top-0 z-10 flex h-full min-w-42 items-center justify-center text-muted",n,r),children:e}):null}function bA(e,t){const r={...e};return Object.keys(r).forEach(e=>{const t=e;(null==r[t]||""===r[t])&&delete r[t]}),r}const wA=o.forwardRef((e,t)=>{const{children:r,description:n,errorMessage:o,descriptionProps:a={},errorMessageProps:s={},startAdornment:l,endAdornment:c,adornmentPosition:u,startAppend:d,endAppend:h,fieldClassNames:f,disabled:p,wrapperProps:g}=e;return(0,i.jsxs)("div",{className:f.wrapper,ref:t,...g,children:[(0,i.jsx)(xA,{...e}),(0,i.jsxs)("div",{className:f.inputWrapper,children:[(0,i.jsx)(yA,{direction:"start",className:f.adornment,position:u,children:l}),d&&(0,i.jsx)(CA,{style:f.append,disabled:p,children:d}),r,h&&(0,i.jsx)(CA,{style:f.append,disabled:p,children:h}),(0,i.jsx)(yA,{direction:"end",className:f.adornment,position:u,children:c})]}),n&&!o&&(0,i.jsx)("div",{className:f.description,...a,children:n}),o&&(0,i.jsx)("div",{className:f.error,...s,children:o})]})});function xA({labelElementType:e,fieldClassNames:t,labelProps:r,label:n,labelSuffix:o,labelSuffixPosition:a="spaced",required:s}){if(!n)return null;const l=(0,i.jsxs)(e||"label",{className:t.label,...r,children:[n,s&&(0,i.jsx)("span",{className:"text-danger",children:" *"})]});return o?(0,i.jsxs)("div",{className:gh("mb-4 flex w-full gap-4","spaced"===a?"items-end":"items-center"),children:[l,(0,i.jsx)("div",{className:gh("text-xs text-muted","spaced"===a?"ml-auto":""),children:o})]}):l}function CA({children:e,style:t,disabled:r}){return o.cloneElement(e,{...e.props,disabled:e.props.disabled||r,...bA(t)})}function _A({autoFocus:e,autoSelectText:t},r){const n=(0,o.useRef)(e);(0,o.useEffect)(()=>{n.current&&r.current&&requestAnimationFrame(()=>{var e,n;null==(e=r.current)||e.focus(),t&&"input"===(null==(n=r.current)?void 0:n.nodeName.toLowerCase())&&r.current.select()}),n.current=!1},[r,t])}function SA(e){const{focusRef:t,labelElementType:r="label",label:n,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:A,disabled:k,id:E,inputRadius:I,inputBorder:j,inputShadow:T,inputRing:F,inputFontSize:O,...M}=e;_A(e,t);const P=(0,o.useId)(),R=E||P,L={id:`${R}-label`,htmlFor:"label"===r?R:void 0},N={id:`${R}-description`},D={id:`${R}-error`},z={"aria-label":e.label||e["aria-label"]||!e.placeholder?e["aria-label"]:e.placeholder,"aria-invalid":A||void 0,id:R,disabled:k,...M},B=[];n&&B.push(L.id),z["aria-labelledby"]&&B.push(z["aria-labelledby"]),z["aria-labelledby"]=B.length?B.join(" "):void 0;const U=[];return f&&U.push(N.id),h&&U.push(D.id),z["aria-describedby"]&&U.push(z["aria-describedby"]),z["aria-describedby"]=U.length?U.join(" "):void 0,{fieldProps:{errorMessageProps:D,descriptionProps:N,labelProps:L,disabled:k,label:n,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:A},inputProps:z}}const AA=(0,o.forwardRef)(({inputElementType:e="input",flexibleHeight:t,inputRef:r,inputTestId:n,...o},a)=>{const s=$w(r),{fieldProps:l,inputProps:c}=SA({...o,focusRef:s}),u="textarea"===e,d=u?"textarea":"input",h=pA({...o,flexibleHeight:t||"textarea"===e});return"textarea"===e&&!o.unstyled&&(h.input=`${h.input} py-12`),(0,i.jsx)(wA,{ref:a,fieldClassNames:h,...l,children:(0,i.jsx)(d,{"data-testid":n,ref:s,...c,rows:u?c.rows||4:void 0,className:h.input})})});o.forwardRef(({name:e,...t},r)=>{const{field:{onChange:n,onBlur:a,value:s="",ref:l},fieldState:{invalid:c,error:u}}=function(e){const t=uA(),{name:r,disabled:n,control:i=t.control,shouldUnregister:a}=e,s=((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(i._names.array,r),l=function(e){const t=uA(),{control:r=t.control,name:n,defaultValue:i,disabled:a,exact:s}=e||{},l=o.useRef(n);l.current=n,hA({disabled:a,subject:r._subjects.values,next:e=>{dA(l.current,e.name,s)&&u(nA(((e,t,r,n,i)=>(e=>"string"==typeof e)(e)?aA(r,e,i):Array.isArray(e)?e.map(e=>aA(r,e)):r)(l.current,r._names,e.values||r._formValues,0,i)))}});const[c,u]=o.useState(r._getWatch(n,i));return o.useEffect(()=>r._removeUnmounted()),c}({control:i,name:r,defaultValue:aA(i._formValues,r,aA(i._defaultValues,r,e.defaultValue)),exact:!0}),c=fA({control:i,name:r}),u=o.useRef(i.register(r,{...e.rules,value:l,...sA(e.disabled)?{disabled:e.disabled}:{}}));return o.useEffect(()=>{const e=i._options.shouldUnregister||a,t=(e,t)=>{const r=aA(i._fields,e);r&&(r._f.mount=t)};if(t(r,!0),e){const e=nA(aA(i._options.defaultValues,r));lA(i._defaultValues,r,e),oA(aA(i._formValues,r))&&lA(i._formValues,r,e)}return()=>{(s?e&&!i._state.action:e)?i.unregister(r):t(r,!1)}},[r,i,s,a]),o.useEffect(()=>{aA(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:aA(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:l,...sA(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:o.useCallback(e=>u.current.onChange({target:{value:tA(e),name:r},type:"change"}),[r]),onBlur:o.useCallback(()=>u.current.onBlur({target:{value:aA(i._formValues,r),name:r},type:"blur"}),[r,i]),ref:e=>{const t=aA(i._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!aA(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!aA(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!aA(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!aA(c.validatingFields,r)},error:{enumerable:!0,get:()=>aA(c.errors,r)}})}}({name:e}),d={onChange:n,onBlur:a,value:s??"",invalid:c,errorMessage:null==u?void 0:u.message,inputRef:l,name:e};return(0,i.jsx)(AA,{ref:r,...Nw(d,t)})});const kA=(0,o.forwardRef)((e,t)=>{const{searchPlaceholder:r,showSearchField:n,children:[a,s],floatingWidth:l="auto",isLoading:c}=e,u=(0,o.useId)(),d=ZS(),h=J_({...e,clearInputOnItemSelection:!0,showEmptyMessage:n,floatingWidth:d?"auto":l,virtualFocus:n,role:n?"listbox":"menu",focusLoopingMode:n?"stay":"loop",children:s.props.children},t),{state:{isOpen:f,setIsOpen:p,activeIndex:g,inputValue:m,setInputValue:v},listboxId:y,focusItem:b,listContent:w,reference:x,onInputChange:C}=h,{handleTriggerKeyDown:_,handleListboxKeyboardNavigation:S,handleListboxSearchFieldKeydown:A}=YS(h),{findMatchingItem:k}=KS();return(0,i.jsx)($S,{onClick:e=>e.stopPropagation(),listbox:h,onKeyDownCapture:n?void 0:e=>{if(!f)return;const t=k(e,w,g);null!=t&&b("increment",t)},onKeyDown:S,onClose:n?()=>v(""):void 0,"aria-labelledby":u,isLoading:c,searchField:n?(0,i.jsx)(AA,{size:"sm",placeholder:r,startAdornment:(0,i.jsx)(QS,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":f?"true":"false","aria-haspopup":"listbox","aria-controls":f?y:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:m,onChange:C,onKeyDown:e=>{A(e)}}):null,children:(0,o.cloneElement)(a,{id:u,"aria-expanded":f?"true":"false","aria-haspopup":"menu","aria-controls":f?y:void 0,ref:x,onKeyDown:_,onClick:_C(e=>{var t,r;null==(r=null==(t=a.props)?void 0:t.onClick)||r.call(t,e),p(!f)})})})});function EA({children:e}){return e}function IA({item:e,button:t}){return(0,i.jsxs)(kA,{children:[t,(0,i.jsx)(EA,{children:(e.menuItems||[]).map(e=>(0,i.jsx)(OC,{value:e.label,onSelected:()=>{e.action(Ig().editor)},children:e.label},e.label))})]})}const jA=(0,o.forwardRef)(({children:e,size:t="md",iconSize:r=(t&&t.length<=3?t:"md"),variant:n="text",radius:a="rounded-button",className:s,padding:l,equalWidth:c=!0,badge:u,...d},h)=>{const f=gh(xC(t,{padding:l,equalWidth:c,variant:n}),s,u&&"relative");return(0,i.jsxs)(SC,{...d,ref:h,radius:a,variant:n,className:f,children:[(0,o.cloneElement)(e,{size:r}),u]})}),TA=o.memo(function({icon:e,className:t,size:r}){let n;return n=o.isValidElement(e)?o.cloneElement(e,{className:"svg-iconEl"}):"string"==typeof e?(0,i.jsx)("img",{className:"w-font h-font",src:e,alt:""}):Array.isArray(e)?o.createElement(bh(e),{size:r}):o.createElement(e,{size:r}),(0,i.jsx)("span",{className:gh(t,"leading-none"),children:n})});function FA({value:e}){return e?(0,i.jsx)(WS,"string"==typeof e?{message:e}:{...e}):null}function OA({item:e}){const t=e.label?(0,i.jsx)(PA,{item:e}):(0,i.jsx)(MA,{item:e});return e.menuItems?(0,i.jsx)(IA,{item:e,button:t}):o.cloneElement(t,{onClick:()=>{var t;null==(t=e.action)||t.call(e,Ig().editor)}})}const MA=(0,o.forwardRef)(({item:e,...t},r)=>(0,i.jsx)(jA,{ref:r,radius:"rounded-full",size:"sm",...t,children:(0,i.jsx)(TA,{icon:e.icon})})),PA=(0,o.forwardRef)(({item:e,...t},r)=>(0,i.jsx)(AC,{ref:r,radius:"rounded-full",size:"xs",color:e.buttonColor||"primary",variant:e.buttonVariant||"flat",startIcon:e.icon&&(0,i.jsx)(TA,{icon:e.icon}),...t,children:(0,i.jsx)(FA,{value:e.label})}));function RA({children:e,color:t,variant:r,radius:n="rounded-button",size:a,className:s,value:l,onChange:c,multiple:u,disabled:d}){const h=o.Children.map(e,(i,s)=>{if(o.isValidElement(i)){const h=(e=>void 0!==l&&(u?l.includes(e):e===l))(i.props.value),f=h?"primary":t;return o.cloneElement(i,{color:h?"primary":t,variant:r,size:a,radius:null,disabled:i.props.disabled||d,...i.props,onClick:e=>{i.props.onClick&&i.props.onClick(e),c&&(u?null==c||c((e=>{const t=[...l],r=l.indexOf(e);return r>-1?t.splice(r,1):t.push(e),t})(i.props.value)):null==c||c(i.props.value))},className:gh(i.props.className,h?"z-20":"z-10",LA(s,e,n,f))})}});return(0,i.jsx)("div",{className:gh(n,"isolate inline-flex",s),children:h})}function LA(e,t,r,n){return 0===e?gh(r,"rounded-tr-none rounded-br-none",!n&&"border-r-transparent disabled:border-r-transparent"):e===t.length-1?gh(r,"rounded-tl-none rounded-bl-none -ml-1"):gh("rounded-none -ml-1",!n&&"border-r-transparent disabled:border-r-transparent")}const NA=yh((0,i.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"}),"UndoOutlined"),DA=yh((0,i.jsx)("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"}),"RedoOutlined");function zA(){const e=Eg(e=>e.history.canUndo),t=Eg(e=>e.history.canRedo);return(0,i.jsxs)(RA,{variant:"outline",children:[(0,i.jsx)(jA,{equalWidth:!1,size:"xs",padding:"pl-12 pr-10",radius:"rounded-full",disabled:!e,onClick:()=>{jg().history.undo()},children:(0,i.jsx)(NA,{})},"undo"),(0,i.jsx)(jA,{equalWidth:!1,padding:"pl-10 pr-12",size:"xs",radius:"rounded-full",disabled:!t,onClick:()=>{jg().history.redo()},children:(0,i.jsx)(DA,{})},"redo")]})}const BA=yh((0,i.jsx)("path",{d:"M19 13H5v-2h14v2z"}),"RemoveOutlined"),UA=yh((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"AddOutlined");function VA(){var e,t;const r=Eg(e=>e.zoom)||1;return Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.zoom)?void 0:r.allowUserZoom})??1?(0,i.jsxs)("div",{className:"flex items-center select-none",children:[(0,i.jsx)(jA,{size:"sm",disabled:!(null!=(e=jg().zoom)&&e.canZoomOut()),onClick:()=>{jg().zoom.zoomOut(jg().zoom.step)},children:(0,i.jsx)(BA,{})}),(0,i.jsxs)("div",{className:"w-[4ch] text-sm text-center",children:[Math.round(100*r),"%"]}),(0,i.jsx)(jA,{size:"sm",disabled:!(null!=(t=jg().zoom)&&t.canZoomIn()),onClick:()=>{jg().zoom.zoomIn(jg().zoom.step)},children:(0,i.jsx)(UA,{})})]}):null}function HA({item:e}){switch(e.type){case"undoWidget":return(0,i.jsx)(zA,{});case"zoomWidget":return(0,i.jsx)(VA,{});case"button":return(0,i.jsx)(OA,{item:e});case"image":return(0,i.jsx)("img",{className:"h-30 object-cover",src:vx(e.src),alt:""});default:return null}}const WA=yh((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}),"CloseOutlined");function $A(){var e;let t=Eg(e=>{var t;return(null==(t=e.config.ui)?void 0:t.mode)===oh.OVERLAY});const{width:r}=Eg(e=>e.stageSize),n=r<=700;return n&&null!=(e=Ig().config.ui)&&e.forceOverlayModeOnMobile&&(t=!0),{isModal:t,isMobile:n}}function qA(){const{isModal:e,isMobile:t}=$A(),r=Eg(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,n=Eg(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.items}),{left:a,center:s,right:l}=(0,o.useMemo)(()=>function(e,t){const r={left:[],center:[],right:[]};(e||[]).filter(e=>!t&&!e.mobileOnly||t&&!e.desktopOnly).forEach(e=>{"left"===e.align?r.left.push({...e,position:e.position??1}):"right"===e.align?r.right.push({...e,position:e.position??1}):r.center.push({...e,position:e.position??1})});const n=Object.entries(r).map(([e,t])=>[e,t.sort((e,t)=>(e.position??0)-(t.position??0))]);return Object.fromEntries(n)}(n||[],t),[n,t]),c=e&&t&&r&&(0,i.jsx)(jA,{size:"sm",className:"ml-10",onClick:()=>{Ig().editor.close()},children:(0,i.jsx)(WA,{})});return(0,i.jsxs)(gw.div,{className:bC,...wC,children:[(0,i.jsx)("div",{className:"mr-auto flex items-center gap-8",children:a.map((e,t)=>(0,i.jsx)(HA,{item:e},t))}),(0,i.jsx)("div",{className:"flex items-center gap-10",children:s.map((e,t)=>(0,i.jsx)(HA,{item:e},t))}),(0,i.jsx)("div",{className:"ml-auto flex items-center gap-8",children:l.map((e,t)=>(0,i.jsx)(HA,{item:e},t))}),c]})}function GA(){const e=Eg(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.width})||1,t=Eg(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.height})||1;return(0,i.jsx)("div",{className:"text-sm",children:`${e}x${t}`})}function YA(){const e=Eg(e=>e.activeTool);return(0,i.jsxs)(gw.div,{className:bC,...wC,children:[(0,i.jsx)(XA,{}),KA(e),(0,i.jsx)(ZA,{})]})}function XA(){const{isMobile:e}=$A(),t=Eg(e=>e.dirty);return e?(0,i.jsx)(jA,{size:"sm",onClick:()=>{Ig().cancelChanges()},children:(0,i.jsx)(WA,{})}):(0,i.jsx)(AC,{variant:"outline",size:"xs",startIcon:(0,i.jsx)(WA,{}),radius:"rounded-full",className:"min-w-92",onClick:()=>{Ig().cancelChanges()},children:(0,i.jsx)(WS,t?{message:"Cancel"}:{message:"Close"})})}function KA(e){var t,r;if(!e)return null;const n=(0,i.jsx)("div",{className:"capitalize text-sm",children:(0,i.jsx)(WS,{message:e})});return e===fh.CROP&&((null==(r=null==(t=Ig().config.tools)?void 0:t.crop)?void 0:r.allowCustomRatio)??1)?(0,i.jsx)(GA,{}):n}function ZA(){const{isMobile:e}=$A(),t=Eg(e=>e.dirty);return e?(0,i.jsx)(jA,{size:"sm",disabled:!t,onClick:()=>{Ig().applyChanges()},children:(0,i.jsx)(jC,{})}):(0,i.jsx)(AC,{variant:"flat",color:"primary",size:"xs",disabled:!t,startIcon:(0,i.jsx)(jC,{}),radius:"rounded-full",onClick:()=>{Ig().applyChanges()},children:(0,i.jsx)(WS,{message:"Apply"})})}function QA(){const e=Eg(e=>e.activeTool);return(0,i.jsx)(Cw,{initial:!1,children:e?(0,i.jsx)(YA,{},"activeToolbar"):(0,i.jsx)(qA,{},"mainToolbar")})}const JA={newCanvas:sh("Loading Canvas"),mainImage:sh("Loading Image"),state:sh("Loading State"),merge:sh("Processing Image")};function ek(){const[e,t]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{Eg.subscribe(e=>e.loading,e=>{e&&t(e)})},[]),(0,i.jsx)(Cw,{children:e&&(0,i.jsx)(gw.div,{initial:{y:"60%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-60%",opacity:0},transition:{type:"tween",duration:.3},onAnimationComplete:()=>{setTimeout(()=>{t(!1)},400)},className:"absolute z-loading-indicator inset-0 m-auto p-6 w-144 h-32 text-center text-sm bg-paper rounded-full shadow-lg",children:(0,i.jsx)(WS,{...JA[e]})})})}const tk={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function rk(e,t,r){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*r):e*t*r/(t+r*e)}function nk(e,t,r,n=.15){return 0===n?function(e,t,r){return Math.max(t,Math.min(e,r))}(e,t,r):e<t?-rk(t-e,r-t,n)+t:e>r?+rk(e-r,r-t,n)+r:e}function ik(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ok(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ak(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ok(Object(r),!0).forEach(function(t){ik(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ok(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}const sk={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function lk(e){return e?e[0].toUpperCase()+e.slice(1):""}const ck=["enter","leave"];const uk=["gotpointercapture","lostpointercapture"];function dk(e){let t=e.substring(2).toLowerCase();const r=!!~t.indexOf("passive");r&&(t=t.replace("passive",""));const n=uk.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(n);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:r}}function hk(e){return"touches"in e}function fk(e){return hk(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function pk(e){return hk(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function gk(e,t){try{const r=t.clientX-e.clientX,n=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,o=(t.clientY+e.clientY)/2,a=Math.hypot(r,n);return{angle:-180*Math.atan2(r,n)/Math.PI,distance:a,origin:[i,o]}}catch{}return null}function mk(e,t){const[r,n]=Array.from(e.touches).filter(e=>t.includes(e.identifier));return gk(r,n)}function vk(e){const t=pk(e);return hk(e)?t.identifier:t.pointerId}function yk(e){const t=pk(e);return[t.clientX,t.clientY]}function bk(e){let{deltaX:t,deltaY:r,deltaMode:n}=e;return 1===n?(t*=40,r*=40):2===n&&(t*=800,r*=800),[t,r]}function wk(e,...t){return"function"==typeof e?e(...t):e}function xk(){}function Ck(...e){return 0===e.length?xk:1===e.length?e[0]:function(){let t;for(const r of e)t=r.apply(this,arguments)||t;return t}}function _k(e,t){return Object.assign({},t,e||{})}class Sk{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:n}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=n,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?wk(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:n}=this;t.args=this.args;let i=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:n,metaKey:i,ctrlKey:o}=e;Object.assign(t,{shiftKey:r,altKey:n,metaKey:i,ctrlKey:o})}return t}(e)),n.down=n.pressed=n.buttons%2==1||n.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);tk.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[o,a]=t._movement,[s,l]=r.threshold,{_step:c,values:u}=t;if(r.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(o)>=s&&u[0]),!1===c[1]&&(c[1]=Math.abs(a)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(o)>=s&&Math.sign(o)*s),!1===c[1]&&(c[1]=Math.abs(a)>=l&&Math.sign(a)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?o-c[0]:0,d[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const h=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=n[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=wk(r.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[p,g]=t.offset,[[m,v],[y,b]]=t._bounds;t.overflow=[p<m?-1:p>v?1:0,g<y?-1:g>b?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const w=t._active&&r.rubberband||[0,0];if(t.offset=function(e,[t,r],[n,i]){const[[o,a],[s,l]]=e;return[nk(t,o,a,n),nk(r,s,l,i)]}(t._bounds,t.offset,w),t.delta=tk.sub(t.offset,h),this.computeMovement(),f&&(!t.last||i>32)){t.delta=tk.sub(t.offset,h);const e=t.delta.map(Math.abs);tk.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const n=this.handler(ak(ak(ak({},t),e),{},{[this.aliasKey]:e.values}));void 0!==n&&(e.memo=n)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class Ak extends Sk{constructor(...e){super(...e),ik(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=tk.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=tk.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const n="object"==typeof r.axisThreshold?r.axisThreshold[fk(e)]:r.axisThreshold;t.axis=function([e,t],r){const n=Math.abs(e),i=Math.abs(t);return n>i&&n>r?"x":i>n&&i>r?"y":void 0}(t._movement,n)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const kk=e=>e,Ek={enabled:(e=!0)=>e,eventOptions:(e,t,r)=>ak(ak({},r.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return tk.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?tk.toVector(e):void 0,transform(e,t,r){const n=e||r.shared.transform;return this.hasCustomTransform=!!n,n||kk},threshold:e=>tk.toVector(e,0)},Ik=ak(ak({},Ek),{},{axis(e,t,{axis:r}){if(this.lockDirection="lock"===r,!this.lockDirection)return r},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Ik.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:r=1/0,top:n=-1/0,bottom:i=1/0}=e;return[[t,r],[n,i]]}}),jk={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},Tk=typeof window<"u"&&window.document&&window.document.createElement;function Fk(){return Tk&&"ontouchstart"in window}const Ok={isBrowser:Tk,gesture:function(){try{return"constructor"in GestureEvent}catch{return!1}}(),touch:Fk(),touchscreen:Fk()||Tk&&window.navigator.maxTouchPoints>1,pointer:Tk&&"onpointerdown"in window,pointerLock:Tk&&"exitPointerLock"in window.document},Mk={mouse:0,touch:0,pen:8},Pk=ak(ak({},Ik),{},{device(e,t,{pointer:{touch:r=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&Ok.pointerLock,Ok.touch&&r?"touch":this.pointerLock?"mouse":Ok.pointer&&!i?"pointer":Ok.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:r}){if(this.preventScrollDelay="number"==typeof r?r:r||void 0===r&&e?250:void 0,Ok.touchscreen&&!1!==r)return e||(void 0!==r?"y":void 0)},pointerCapture(e,t,{pointer:{capture:r=!0,buttons:n=1,keys:i=!0}={}}){return this.pointerButtons=n,this.keys=i,!this.pointerLock&&"pointer"===this.device&&r},threshold(e,t,{filterTaps:r=!1,tapsThreshold:n=3,axis:i}){const o=tk.toVector(e,r?n:i?1:0);return this.filterTaps=r,this.tapsThreshold=n,o},swipe({velocity:e=.5,distance:t=50,duration:r=250}={}){return{velocity:this.transform(tk.toVector(e)),distance:this.transform(tk.toVector(t)),duration:r}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?ak(ak({},Mk),e):Mk,keyboardDisplacement:(e=10)=>e}),Rk=ak(ak({},Ek),{},{device(e,t,{shared:r,pointer:{touch:n=!1}={}}){if(r.target&&!Ok.touch&&Ok.gesture)return"gesture";if(Ok.touch&&n)return"touch";if(Ok.touchscreen){if(Ok.pointer)return"pointer";if(Ok.touch)return"touch"}},bounds(e,t,{scaleBounds:r={},angleBounds:n={}}){const i=e=>{const t=_k(wk(r,e),{min:-1/0,max:1/0});return[t.min,t.max]},o=e=>{const t=_k(wk(n,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof r&&"function"!=typeof n?[i(),o()]:e=>[i(e),o(e)]},threshold(e,t,r){return this.lockDirection="lock"===r.axis,tk.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});ak(ak({},Ik),{},{mouseOnly:(e=!0)=>e}),ak(ak({},Ik),{},{mouseOnly:(e=!0)=>e});const Lk=new Map,Nk=new Map;function Dk(e){Lk.set(e.key,e.engine),Nk.set(e.key,e.resolver)}const zk={key:"drag",engine:class extends Ak{constructor(...e){super(...e),ik(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),n={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Ik.bounds(n)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const n=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(n&&n.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=vk(e),r._pointerActive=!0,this.computeValues(yk(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==fk(e)?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const n=vk(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;const i=yk(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=tk.sub(i,t._values),this.computeValues(i)),tk.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):r.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===r.preventScrollAxis||"xy"===r.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const n=vk(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,o]=t._distance;if(t.tap=i<=r.tapsThreshold&&o<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[e,n]=t._delta,[i,o]=t._movement,[a,s]=r.swipe.velocity,[l,c]=r.swipe.distance,u=r.swipe.duration;if(t.elapsedTime<u){const r=Math.abs(e/t.timeDelta),u=Math.abs(n/t.timeDelta);r>a&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(o)>c&&(t.swipe[1]=Math.sign(n))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=jk[e.key];if(t){const r=this.state,n=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,n),r._keyboardActive=!0,tk.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in jk&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Pk},Bk={key:"pinch",engine:class extends Sk{constructor(...e){super(...e),ik(this,"ingKey","pinching"),ik(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:r}=this.state;this.state.offset="wheel"===e?tk.add(t,r):[(1+t[0])*r[0],t[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,r]=e._movement;if(!e.axis){const n=30*Math.abs(t)-Math.abs(r);n<0?e.axis="angle":n>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,r=this.ctrl.touchIds;if(t._active&&t._touchIds.every(e=>r.has(e))||r.size<2)return;this.start(e),t._touchIds=Array.from(r).slice(0,2);const n=mk(e,t._touchIds);n&&this.pinchStart(e,n)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,r=t._pointerEvents,n=this.ctrl.pointerIds;if(t._active&&Array.from(r.keys()).every(e=>n.has(e))||(r.size<2&&r.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const i=gk(...Array.from(r.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=mk(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const r=gk(...Array.from(t.values()));r&&this.pinchMove(e,r)}pinchMove(e,t){const r=this.state,n=r._values[1],i=t.angle-n;let o=0;Math.abs(i)>270&&(o+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*o]),r.origin=t.origin,r.turns=o,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(e=>!this.ctrl.touchIds.has(e))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const r=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=tk.sub(t._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(t=>e[t]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-bk(e)[1]/100*t.offset[0],0],tk.addTo(t._movement,t._delta),function(e){const[t,r]=e.overflow,[n,i]=e._delta,[o,a]=e._direction;(t<0&&n>0&&o<0||t>0&&n<0&&o>0)&&(e._movement[0]=e._movementBound[0]),(r<0&&i>0&&a<0||r>0&&i<0&&a>0)&&(e._movement[1]=e._movementBound[1])}(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:Rk};const Uk={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Ok.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},Vk=["target","eventOptions","window","enabled","transform"];function Hk(e={},t){const r={};for(const[n,i]of Object.entries(t))switch(typeof i){case"function":r[n]=i.call(r,e[n],n,e);break;case"object":r[n]=Hk(e[n],i);break;case"boolean":i&&(r[n]=e[n])}return r}class Wk{constructor(e,t){ik(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,n,i){const o=this._listeners,a=function(e,t=""){const r=sk[e];return e+(r&&r[t]||t)}(t,r),s=ak(ak({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(a,n,s);const l=()=>{e.removeEventListener(a,n,s),o.delete(l)};return o.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class $k{constructor(){ik(this,"_timeouts",new Map)}add(e,t,r=140,...n){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...n))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>{window.clearTimeout(e)}),this._timeouts.clear()}}class qk{constructor(e){ik(this,"gestures",new Set),ik(this,"_targetEventStore",new Wk(this)),ik(this,"gestureEventStores",{}),ik(this,"gestureTimeoutStores",{}),ik(this,"handlers",{}),ik(this,"config",{}),ik(this,"pointerIds",new Set),ik(this,"touchIds",new Set),ik(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&Gk(e,"drag"),t.wheel&&Gk(e,"wheel"),t.scroll&&Gk(e,"scroll"),t.move&&Gk(e,"move"),t.pinch&&Gk(e,"pinch"),t.hover&&Gk(e,"hover")}(this,e)}setEventIds(e){return hk(e)?(this.touchIds=new Set(function(e){return function(e){return Array.from(e.touches).filter(t=>{var r,n;return t.target===e.currentTarget||(null===(r=e.currentTarget)||void 0===r||null===(n=r.contains)||void 0===n?void 0:n.call(r,t.target))})}(e).map(e=>e.identifier)}(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,r={}){const n=e,{target:i,eventOptions:o,window:a,enabled:s,transform:l}=n,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(n,Vk);if(r.shared=Hk({target:i,eventOptions:o,window:a,enabled:s,transform:l},Uk),t){const e=Nk.get(t);r[t]=Hk(ak({shared:r.shared},c),e)}else for(const u in c){const e=Nk.get(u);e&&(r[u]=Hk(ak({shared:r.shared},c[u]),e))}return r}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let n;if(!t.target||(n=t.target(),n)){if(t.enabled){for(const t of this.gestures){const i=this.config[t],o=Yk(r,i.eventOptions,!!n);i.enabled&&new(Lk.get(t))(this,e,t).bind(o)}const i=Yk(r,t.eventOptions,!!n);for(const t in this.nativeHandlers)i(t,"",r=>this.nativeHandlers[t](ak(ak({},this.state.shared),{},{event:r,args:e})),void 0,!0)}for(const e in r)r[e]=Ck(...r[e]);if(!n)return r;for(const e in r){const{device:t,capture:i,passive:o}=dk(e);this._targetEventStore.add(n,t,"",r[e],{capture:i,passive:o})}}}}function Gk(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Wk(e,t),e.gestureTimeoutStores[t]=new $k}const Yk=(e,t,r)=>(n,i,o,a={},s=!1)=>{var l,c;const u=null!==(l=a.capture)&&void 0!==l?l:t.capture,d=null!==(c=a.passive)&&void 0!==c?c:t.passive;let h=s?n:function(e,t="",r=!1){const n=sk[e],i=n&&n[t]||t;return"on"+lk(e)+lk(i)+(function(e=!1,t){return e&&!ck.includes(t)}(r,i)?"Capture":"")}(n,i,u);r&&d&&(h+="Passive"),e[h]=e[h]||[],e[h].push(o)},Xk=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Kk(e,t,r,n,i,o){if(!e.has(r)||!Lk.has(n))return;const a=r+"Start",s=r+"End";i[n]=e=>{let n;return e.first&&a in t&&t[a](e),r in t&&(n=t[r](e)),e.last&&s in t&&t[s](e),n},o[n]=o[n]||{}}function Zk({e:e,rect:t,deltaX:r,deltaY:n}){return{rect:t,x:e.clientX,y:e.clientY,deltaX:r??0,deltaY:n??0,nativeEvent:e}}function Qk({onMoveStart:e,onMove:t,onMoveEnd:r,minimumMovement:n=0,preventDefault:i,stopPropagation:a=!0,onPress:s,onLongPress:l,...c}){const u=(0,o.useRef)({lastPosition:{x:0,y:0},started:!1,longPressTriggered:!1}).current,{addGlobalListener:d,removeGlobalListener:h}=Ww(),f=r=>{if(r.pointerId===u.id){const i=r.clientX-u.lastPosition.x,o=r.clientY-u.lastPosition.y;(Math.abs(i)>=n||Math.abs(o)>=n)&&!u.started&&(t=>{!u.el||!1===(null==e?void 0:e(t,u.el))||(u.originalTouchAction=u.el.style.touchAction,u.el.style.touchAction="none",u.originalUserSelect=document.documentElement.style.userSelect,document.documentElement.style.userSelect="none",u.started=!0)})(r),u.started&&(null==t||t(r,i,o),u.lastPosition={x:r.clientX,y:r.clientY})}},p=e=>{var t;if(e.pointerId===u.id){u.longPressTimer&&clearTimeout(u.longPressTimer);const n=u.longPressTriggered;u.longPressTriggered=!1,u.started&&(null==r||r(e)),u.el&&("pointercancel"!==e.type&&(null==(t=c.onPointerUp)||t.call(c,e,u.el),e.target&&u.el.contains(e.target)&&(n?null==l||l(e,u.el):null==s||s(e,u.el))),document.documentElement.style.userSelect=u.originalUserSelect||"",u.el.style.touchAction=u.originalTouchAction||""),u.id=void 0,u.started=!1,h(window,"pointermove",f,!1),h(window,"pointerup",p,!1),h(window,"pointercancel",p,!1)}};return{domProps:{onPointerDown:_C(r=>{var n;if(0===r.button&&null==u.id){if(u.started=!1,!1===(null==(n=c.onPointerDown)?void 0:n.call(c,r)))return;a&&r.stopPropagation(),i&&r.preventDefault(),u.id=r.pointerId,u.el=r.currentTarget,u.lastPosition={x:r.clientX,y:r.clientY},l&&(u.longPressTimer=setTimeout(()=>{l(r,u.el),u.longPressTriggered=!0},400)),(e||t)&&d(window,"pointermove",f,!1),d(window,"pointerup",p,!1),d(window,"pointercancel",p,!1)}})}}}function Jk(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}var eE=(e=>(e.topLeft="topLeft",e.topRight="topRight",e.bottomLeft="bottomLeft",e.bottomRight="bottomRight",e))(eE||{});let tE={};const rE=(e={})=>{nx(null),tE=e};function nE({aspectRatio:e,boundaryRef:t,boundaryRect:r,restrictWithinBoundary:n=!0,minWidth:i=50,minHeight:o=50,...a}){const s={onMoveStart:(e,n)=>{var i;const o=e.target;if(!o.dataset.resizeHandle||rx||(rE({currentRect:Jk(n.getBoundingClientRect()),resizeDir:o.dataset.resizeHandle}),!tE.currentRect))return!1;nx("resize"),r?tE.boundaryRect=r:null!=t&&t.current&&(tE.boundaryRect=Jk(t.current.getBoundingClientRect())),tE.currentRect&&tE.boundaryRect&&(tE.currentRect.left-=tE.boundaryRect.left,tE.currentRect.top-=tE.boundaryRect.top),tE.initialAspectRatio=tE.currentRect.width/tE.currentRect.height,null==(i=a.onResizeStart)||i.call(a,Zk({rect:tE.currentRect,e:e}))},onMove:(t,r,n)=>{var s;if(!tE.resizeDir||!tE.currentRect)return;const l="initial"===e?tE.initialAspectRatio:e,c=function(e,t,r,n){const i={...e},o={...e};return"topRight"===tE.resizeDir?(o.width=Math.floor(o.width+t),o.height=n?Math.floor(o.width/n):Math.floor(o.height-r),o.top=Math.floor(o.top+(i.height-o.height))):"bottomRight"===tE.resizeDir?(o.width=Math.floor(o.width+t),o.height=n?Math.floor(o.width/n):Math.floor(o.height+r)):"topLeft"===tE.resizeDir?(o.width=Math.floor(o.width-t),o.height=n?Math.floor(o.width/n):Math.floor(o.height-r),o.left=Math.floor(o.left+(i.width-o.width)),o.top=Math.floor(o.top+(i.height-o.height))):"bottomLeft"===tE.resizeDir&&(o.width=Math.floor(o.width-t),o.height=n?Math.floor(o.width/n):Math.floor(o.height+r),o.left=Math.floor(o.left+t)),o}(tE.currentRect,r,n,l),u=function(e,t,r,n){const i="bottomLeft"===tE.resizeDir||"topLeft"===tE.resizeDir,o="topRight"===tE.resizeDir||"topLeft"===tE.resizeDir;let a={...e};a.width=Math.max(t,e.width),a.height=Math.max(r,e.height);const s=a.width-e.width;i&&s>0&&(a.left-=s);const l=a.height-e.height;if(o&&l>0&&(a.top-=l),tE.boundaryRect&&(a=function(e,t){const r={...e};r.left=Math.max(0,r.left);const n=r.left-e.left;n>0&&(r.width-=n),r.top=Math.max(0,r.top);const i=r.top-e.top;return i>0&&(r.height-=i),r.width=Math.min(r.width,t.width-r.left),r.height=Math.min(r.height,t.height-r.top),r}(a,tE.boundaryRect)),n){const e=a.width,t=a.height,r=Lx(n,a.width,a.height);a.width=r.width,a.height=r.height,o&&(a.top+=t-a.height),i&&(a.left+=e-a.width)}return a}(c,i,o,l);null==(s=a.onResize)||s.call(a,Zk({rect:u,e:t,deltaX:r,deltaY:n})),tE.currentRect=c},onMoveEnd:e=>{var t;tE.currentRect&&(null==(t=a.onResizeEnd)||t.call(a,Zk({rect:tE.currentRect,e:e}))),rE()}},{domProps:l}=Qk(s);return{resizeProps:l}}function iE({position:e,inset:t=!1}){const r=function(e,t){const r=t?"left-0":"-left-5",n=t?"top-0":"-top-5",i=t?"bottom-0":"-bottom-5",o=t?"right-0":"-right-5";switch(e){case eE.topLeft:return`${r} ${n} border-l-4 border-t-4 cursor-nwse-resize`;case eE.topRight:return`${o} ${n} border-r-4 border-t-4 cursor-nesw-resize`;case eE.bottomRight:return`${o} ${i} border-r-4 border-b-4 cursor-se-resize`;case eE.bottomLeft:return`${r} ${i} border-l-4 border-b-4 cursor-sw-resize`;default:return""}}(e,t);return(0,i.jsx)("div",{"data-resize-handle":e,className:`border-white absolute w-20 h-20 ${r}`})}var oE=(e=>(e.top="maskTop",e.right="maskRight",e.bottom="maskBottom",e.left="maskLeft",e))(oE||{});function aE({position:e,refs:t}){const r=function(e){switch(e){case"maskTop":return"left-0 top-0";case"maskBottom":return"bottom-0 left-0";default:return""}}(e);return(0,i.jsx)("div",{className:`cropzone-transition bg-black/50 bottom absolute ${r}`,ref:r=>t.current[e]=r})}function sE({name:e,refs:t}){const r=gh("cropzone-transition pointer-events-none absolute left-0 top-0 bg-white/50",e.startsWith("lineHor")?"h-px":"w-px");return(0,i.jsx)("div",{className:r,ref:r=>{t.current[e]=r}})}function lE(e,t,r){return Math.min(Math.max(e,t),r)}let cE={};function uE({boundaryRef:e,boundaryRect:t,minimumMovement:r,restrictWithinBoundary:n=!0,...i}){const o={minimumMovement:r,onMoveStart:(r,n)=>{var o;if(rx)return!1;cE={currentRect:Jk(n.getBoundingClientRect())},nx("move"),t?cE.boundaryRect=t:null!=e&&e.current&&(cE.boundaryRect=Jk(e.current.getBoundingClientRect())),cE.currentRect&&cE.boundaryRect&&(cE.currentRect.left-=cE.boundaryRect.left,cE.currentRect.top-=cE.boundaryRect.top),null==(o=i.onMoveStart)||o.call(i,Zk({rect:cE.currentRect,e:r}))},onMove:(e,t,r)=>{var o;if(!cE.currentRect)return;const a={...cE.currentRect,left:cE.currentRect.left+t,top:cE.currentRect.top+r},s={...a};cE.boundaryRect&&n&&(s.left=lE(a.left,0,cE.boundaryRect.width-a.width),s.top=lE(a.top,0,cE.boundaryRect.height-a.height)),null==(o=i.onMove)||o.call(i,Zk({rect:s,e:e,deltaX:t,deltaY:r})),cE.currentRect=a},onMoveEnd:e=>{var t;cE.currentRect&&(null==(t=i.onMoveEnd)||t.call(i,Zk({rect:cE.currentRect,e:e})),nx(null),cE={})}},{domProps:a}=Qk(o);return{moveProps:a}}function dE(){const e=(0,o.useRef)({}),[t,r]=(0,o.useState)(!0),n=Eg(e=>e.canvasSize),a=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.cropzone}),s=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.defaultRatio})||null,l=Eg(e=>e.crop.selectedAspectRatio)||null,{moveProps:c}=uE({boundaryRect:n,onMoveStart:()=>r(!0),onMove:e=>jg().crop.drawZone(e.rect),onMoveEnd:()=>r(!1)}),{resizeProps:u}=nE({boundaryRect:n,minHeight:50,minWidth:50,aspectRatio:Nx(l),onResizeStart:()=>r(!0),onResize:e=>jg().crop.drawZone(e.rect),onResizeEnd:()=>r(!1)});(0,o.useLayoutEffect)(()=>{jg().crop.registerRefs(e),jg().crop.resetCropzone(s)},[s,n]);const d=gh("cropzone absolute z-cropzone isolate left-0 top-0 w-full h-full overflow-hidden",t&&"moving");return(0,i.jsxs)("div",{className:d,onPointerDown:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,i.jsxs)("div",{className:"cropzone-transition border-white/50 absolute z-10 left-0 top-0 border",...Nw(u,c),ref:t=>e.current.innerZone=t,children:[!(null!=a&&a.hideTopLeft)&&(0,i.jsx)(iE,{position:eE.topLeft,inset:!0}),!(null!=a&&a.hideTopRight)&&(0,i.jsx)(iE,{position:eE.topRight,inset:!0}),!(null!=a&&a.hideBottomLeft)&&(0,i.jsx)(iE,{position:eE.bottomLeft,inset:!0}),!(null!=a&&a.hideBottomRight)&&(0,i.jsx)(iE,{position:eE.bottomRight,inset:!0}),(0,i.jsx)(sE,{name:"lineVer1",refs:e}),(0,i.jsx)(sE,{name:"lineVer2",refs:e}),(0,i.jsx)(sE,{name:"lineHor1",refs:e}),(0,i.jsx)(sE,{name:"lineHor2",refs:e})]}),(0,i.jsx)(aE,{refs:e,position:oE.top}),(0,i.jsx)(aE,{refs:e,position:oE.left}),(0,i.jsx)(aE,{refs:e,position:oE.right}),(0,i.jsx)(aE,{refs:e,position:oE.bottom})]})}const hE=yh((0,i.jsx)("path",{d:"M 7 2 C 6.448 2 6 2.448 6 3 C 6 3.552 6.448 4 7 4 L 20 4 L 20 17 C 20 17.552 20.448 18 21 18 C 21.552 18 22 17.552 22 17 L 22 4 C 22 2.895 21.105 2 20 2 L 7 2 z M 4 6 C 2.895 6 2 6.895 2 8 L 2 20 C 2 21.105 2.895 22 4 22 L 16 22 C 17.105 22 18 21.105 18 20 L 18 8 C 18 6.895 17.105 6 16 6 L 4 6 z M 10 10 C 10.552 10 11 10.448 11 11 L 11 13 L 13 13 C 13.552 13 14 13.448 14 14 C 14 14.552 13.552 15 13 15 L 11 15 L 11 17 C 11 17.552 10.552 18 10 18 C 9.448 18 9 17.552 9 17 L 9 15 L 7 15 C 6.448 15 6 14.552 6 14 C 6 13.448 6.448 13 7 13 L 9 13 L 9 11 C 9 10.448 9.448 10 10 10 z"})),fE=yh((0,i.jsx)("path",{d:"M 11 3 L 2 21 L 11 21 L 11 3 z M 13 3 L 13 21 L 22 21 L 13 3 z M 9 11.472656 L 9 19 L 5.2363281 19 L 9 11.472656 z"})),pE=yh((0,i.jsx)("path",{d:"M 16.476562 2.4511719 C 16.392047 2.4657656 16.308531 2.5061719 16.238281 2.5761719 L 14.130859 4.6835938 C 13.956859 4.8575938 13.956859 5.1394531 14.130859 5.3144531 L 16.238281 7.4238281 C 16.519281 7.7048281 17 7.5054219 17 7.1074219 L 17 6 L 20 6 L 20 9 A 1.0001 1.0001 0 1 0 22 9 L 22 6 C 22 4.9069372 21.093063 4 20 4 L 17 4 L 17 2.8925781 C 17 2.5940781 16.730109 2.4073906 16.476562 2.4511719 z M 4 5 C 2.9069372 5 2 5.9069372 2 7 L 2 14 C 2 15.093063 2.9069372 16 4 16 L 7 16 L 7 19 C 7 20.105 7.895 21 9 21 L 16 21 C 17.105 21 18 20.105 18 19 L 18 12 C 18 10.895 17.105 10 16 10 L 13 10 L 13 7 C 13 5.9069372 12.093063 5 11 5 L 4 5 z M 4 7 L 11 7 L 11 14 L 4 14 L 4 7 z"})),gE=yh((0,i.jsx)("path",{d:"M 10 2 L 9 3 L 3 3 L 3 5 L 21 5 L 21 3 L 15 3 L 14 2 L 10 2 z M 4.3652344 7 L 5.8925781 20.263672 C 6.0245781 21.253672 6.877 22 7.875 22 L 16.123047 22 C 17.121047 22 17.974422 21.254859 18.107422 20.255859 L 19.634766 7 L 4.3652344 7 z"})),mE={width:120,height:30},vE=[{name:"Duplicate",icon:hE,onClick:()=>{jg().objects.duplicate()}},{name:"Flip",icon:fE,onClick:()=>{jg().objects.flipHorizontally()}},{name:"Bring to front",icon:pE,onClick:()=>{jg().objects.bringToFront()}},{name:"Delete",icon:gE,onClick:()=>{jg().objects.delete()}}],yE=o.forwardRef((e,t)=>{const r=Eg(e=>e.objects.active.isMoving)?"opacity-0":"opacity-100";return(0,i.jsx)("div",{ref:t,className:`${r} absolute z-obj-box left-0 top-0 flex items-center text-white bg-controls rounded shadow transition-opacity overflow-hidden`,children:vE.map(e=>{const t=e.icon;return(0,i.jsx)(jA,{size:"sm",className:"w-30 h-30 hover:bg-white/hover",radius:"rounded-none",onClick:e.onClick,children:(0,i.jsx)(t,{})},e.name)})})});function bE(e,t){const r=jg().objects.getActive();if(!r||!e.current)return;const n=e.current,i=Qw.fabric.util.degreesToRadians(r.angle??0);let o=Math.round(r.getScaledWidth()*Ig().zoom),a=Math.round(r.getScaledHeight()*Ig().zoom),s=Math.round((r.left??0)*Ig().zoom),l=Math.round((r.top??0)*Ig().zoom);const c="center"===r.originX?o/2:0,u="center"===r.originY?a/2:0;r.padding&&(o+=2*r.padding,a+=2*r.padding,s-=r.padding,l-=r.padding),n.style.width=`${o}px`,n.style.height=`${a}px`,n.style.transform=`translate(${s-c}px, ${l-u}px) rotate(${i}rad)`,jg().canvas.render(),function(e,t){if(!t)return;const r=e.angle||0,n=r>168&&r<188?-30:-15,i=Ig().canvasSize,o=Ig().stageSize,a=mE,s=i.top-o.top,l=i.left-o.left,c=o.width-(l+i.width),u=o.height-(s+i.height),d=-s,h=-(i.left-o.left),f=i.width-a.width+c,p=i.height-a.height+u,g=e.getBoundingRect();let m=g.top-a.height+n,v=g.left+g.width/2-a.width/2;m=Math.min(p,Math.max(d,m)),v=Math.min(f,Math.max(h,v)),t.style.transform=`translate(${v}px, ${m}px) rotate(0deg)`}(r,t.current)}function wE(){return(0,i.jsx)("div",{className:"absolute -bottom-20 left-1/2 w-2 h-20 bg-white cursor-default -translate-x-1/2",children:(0,i.jsx)("div",{"data-rotate-handle":!0,className:"w-18 h-18 absolute -bottom-10 -left-8 bg-white rounded-full cursor-move"})})}let xE={};function CE(e){const t=xE.centerX||0,r=xE.centerY||0;return Math.atan2(r-e.pageY,t-e.pageX)-(xE.startAngle||0)}const _E=(e={})=>{nx(null),xE=e};function SE(){const e=(0,o.useRef)(null),t=(0,o.useRef)(null),r=Eg(e=>e.objects.active.id),n=Eg(e=>e.objects.isEditingText),a=Eg(e=>e.zoom),s=function(){const e=jg().objects.getActive();if(!e||!e.name)return{};const t=Ig().config.objectControls||{},r=e.name;return{...t.global,...t[r]}}(),l=(0,o.useRef)(null),c=(0,o.useCallback)(()=>{l.current?(clearTimeout(l.current),l.current=null,function(){var e;const t=jg().objects.getActive();Cp(t)&&(t.enterEditing(),null==(e=t.hiddenTextarea)||e.focus())}()):l.current=setTimeout(()=>{l.current=null},300)},[]);let{moveProps:u}=uE({boundaryRef:Ig().canvasRef,restrictWithinBoundary:!1,onMoveEnd:()=>{Ig().objects.setActiveIsMoving(!1)},onMove:e=>{Ig().objects.setActiveIsMoving(!0),function(e){const t=e.rect.width/2,r=e.rect.height/2;jg().objects.setValues({left:(e.rect.left+t)/Ig().zoom,top:(e.rect.top+r)/Ig().zoom})}(e)}});s.lockMovement&&(u={});const{resizeProps:d}=nE({minWidth:50,minHeight:50,aspectRatio:s.unlockAspectRatio?null:"initial",boundaryRef:s.containWithinCanvas?Ig().canvasRef:void 0,restrictWithinBoundary:!1,onResizeEnd:()=>{Ig().objects.setActiveIsMoving(!1)},onResize:e=>{Ig().objects.setActiveIsMoving(!0),function(e){const t=jg().objects.getActive();if(!t)return;const r={};Cp(t)?(e.deltaX>0||t.getScaledHeight()>=20&&t.getScaledWidth()>=20)&&(r.fontSize=(t.fontSize||1)+e.deltaX):(t.width&&(r.scaleX=e.rect.width/Ig().zoom/t.width),t.height&&(r.scaleY=e.rect.height/Ig().zoom/t.height)),jg().objects.setValues(r)}(e)}}),{rotateProps:h}=function(e){const t={onMoveStart:(t,r)=>{var n,i;if(!t.target.dataset.rotateHandle||rx)return!1;const o=Jk(r.getBoundingClientRect());if(!o)return!1;const a=null==(n=r.style.transform.match(/rotate\((.+?)\)/))?void 0:n[1],[s="0"]=a?a.split(","):[];_E({currentRect:o,centerX:o.left+o.width/2,centerY:o.top+o.height/2,startAngle:parseFloat(s)}),nx("rotate"),xE.startAngle=CE(t),null==(i=e.onRotateStart)||i.call(e,Zk({rect:o,e:t}))},onMove:(t,r,n)=>{var i;if(!xE.currentRect)return;const o={...xE.currentRect};o.angle=CE(t),o.left+=r,o.top+=n,null==(i=e.onRotate)||i.call(e,Zk({rect:o,e:t,deltaX:r,deltaY:n})),xE.currentRect=o},onMoveEnd:t=>{var r;xE.currentRect&&(null==(r=e.onRotateEnd)||r.call(e,Zk({rect:xE.currentRect,e:t}))),_E()}},{domProps:r}=Qk(t);return{rotateProps:r}}({boundaryRef:Ig().canvasRef,onRotateEnd:()=>{Ig().objects.setActiveIsMoving(!1)},onRotate:e=>{Ig().objects.setActiveIsMoving(!0),function(e){const t=jg().objects.getActive();if(!t||!e.rect.angle)return;const r=Qw.fabric.util.radiansToDegrees(e.rect.angle);r!==t.angle&&jg().objects.setValues({angle:r})}(e)}});return(0,o.useEffect)(()=>{Tg()&&Ig().editor.on("object:modified",r=>{r.sizeOrPositionChanged&&bE(e,t)})},[]),(0,o.useEffect)(()=>{bE(e,t)},[r,a,n]),(0,i.jsxs)("div",{className:r&&!n?"block":"hidden",children:[(0,i.jsxs)("div",{ref:e,...Nw(h,d,u),onClick:c,className:"absolute z-obj-box border-2 border-white shadow-md cursor-move",children:[!s.hideTopLeft&&(0,i.jsx)(iE,{position:eE.topLeft}),!s.hideTopRight&&(0,i.jsx)(iE,{position:eE.topRight}),!s.hideBottomLeft&&(0,i.jsx)(iE,{position:eE.bottomLeft}),!s.hideBottomRight&&(0,i.jsx)(iE,{position:eE.bottomRight}),!s.hideRotatingPoint&&(0,i.jsx)(wE,{})]}),(0,i.jsx)(yE,{ref:t})]})}function AE(){const e=Eg(e=>e.activeTool===fh.CROP),t=Eg(e=>e.objects.active.id);return(0,i.jsxs)("div",{children:[e&&(0,i.jsx)(dE,{}),t&&(0,i.jsx)(SE,{})]})}const kE=function(e){return e.forEach(Dk),function(e,t){const{handlers:r,nativeHandlers:n,config:i}=function(e,t){const[r,n,i]=function(e){const t={},r={},n=new Set;for(let i in e)Xk.test(i)?(n.add(RegExp.lastMatch),r[i]=e[i]):t[i]=e[i];return[r,t,n]}(e),o={};return Kk(i,r,"onDrag","drag",o,t),Kk(i,r,"onWheel","wheel",o,t),Kk(i,r,"onScroll","scroll",o,t),Kk(i,r,"onPinch","pinch",o,t),Kk(i,r,"onMove","move",o,t),Kk(i,r,"onHover","hover",o,t),{handlers:o,config:t,nativeHandlers:n}}(e,t||{});return function(e,t={},r,n){const i=o.useMemo(()=>new qk(e),[]);if(i.applyHandlers(e,n),i.applyConfig(t,r),o.useEffect(i.effect.bind(i)),o.useEffect(()=>i.clean.bind(i),[]),void 0===t.target)return i.bind.bind(i)}(r,i,void 0,n)}}([zk,Bk]),EE=o.forwardRef((e,t)=>{const[r,n]=(0,o.useState)(!1);return(0,o.useEffect)(()=>Eg.subscribe(e=>e.loading,e=>{n(!e)}),[]),(0,i.jsx)(IE,{children:(0,i.jsxs)(gw.div,{initial:{opacity:0},variants:{visible:{opacity:1,transition:{duration:.35,delay:.5}},hidden:{opacity:0,transition:{duration:0}}},animate:r?"visible":"hidden",className:"relative m-auto w-max",style:{backgroundImage:`url(${vx("images/empty-canvas-bg.png")})`},children:[(0,i.jsx)(AE,{}),(0,i.jsx)("canvas",{ref:t})]})})});function IE({children:e}){const t=(0,o.useRef)(null),r=kE({onPinch:e=>{if(!jg().zoom.allowUserZoom||!jE(e))return e.cancel();1===e.direction[0]?jg().zoom.zoomIn(.01):jg().zoom.zoomOut(.01),e.event.stopPropagation(),e.event.preventDefault()},onDrag:e=>{if(e.pinching||!jE(e))return e.cancel();t.current.scrollLeft-=e.delta[0],t.current.scrollTop-=e.delta[1]}});return(0,i.jsx)("div",{ref:t,className:"w-full h-full overflow-hidden touch-none flex",...r(),children:e})}function jE(e){return!(Tg().findTarget(e.event,!1)||Tg().isDrawingMode)}function TE({actionBtn:e,children:t,className:r}){return(0,i.jsxs)("div",{className:gh(r,"flex gap-16 items-center h-full"),children:[e&&(0,i.jsx)("div",{className:"flex-shrink-0",children:e}),(0,i.jsx)("div",{className:"w-full flex-auto",children:t}),e&&(0,i.jsx)("div",{className:"w-96"})]})}function FE(){return(FE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function OE(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}function ME(e){var t=(0,o.useRef)(e),r=(0,o.useRef)(function(e){t.current&&t.current(e)});return t.current=e,r.current}var PE,RE,LE,NE,DE,zE,BE,UE,VE,HE,WE,$E,qE,GE,YE,XE,KE,ZE,QE,JE,eI,tI,rI,nI,iI,oI,aI,sI,lI,cI,uI,dI,hI,fI,pI,gI=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e<t?t:e},mI=function(e){return"touches"in e},vI=function(e){return e&&e.ownerDocument.defaultView||self},yI=function(e,t,r){var n=e.getBoundingClientRect(),i=mI(t)?function(e,t){for(var r=0;r<e.length;r++)if(e[r].identifier===t)return e[r];return e[0]}(t.touches,r):t;return{left:gI((i.pageX-(n.left+vI(e).pageXOffset))/n.width),top:gI((i.pageY-(n.top+vI(e).pageYOffset))/n.height)}},bI=function(e){!mI(e)&&e.preventDefault()},wI=o.memo(function(e){var t=e.onMove,r=e.onKey,n=OE(e,["onMove","onKey"]),i=(0,o.useRef)(null),a=ME(t),s=ME(r),l=(0,o.useRef)(null),c=(0,o.useRef)(!1),u=(0,o.useMemo)(function(){var e=function(e){bI(e),(mI(e)?e.touches.length>0:e.buttons>0)&&i.current?a(yI(i.current,e,l.current)):r(!1)},t=function(){return r(!1)};function r(r){var n=c.current,o=vI(i.current),a=r?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",t)}return[function(e){var t,n=e.nativeEvent,o=i.current;if(o&&(bI(n),t=n,(!c.current||mI(t))&&o)){if(mI(n)){c.current=!0;var s=n.changedTouches||[];s.length&&(l.current=s[0].identifier)}o.focus(),a(yI(o,n,l.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]},[s,a]),d=u[0],h=u[1],f=u[2];return(0,o.useEffect)(function(){return f},[f]),o.createElement("div",FE({},n,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),xI=function(e){return e.filter(Boolean).join(" ")},CI=function(e){var t=e.color,r=e.left,n=e.top,i=void 0===n?.5:n,a=xI(["react-colorful__pointer",e.className]);return o.createElement("div",{className:a,style:{top:100*i+"%",left:100*r+"%"}},o.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},_I=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},SI=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?_I(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?_I(parseInt(e.substring(6,8),16)/255,2):1}},AI=function(e){var t=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:_I(e.h),s:_I(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:_I(i/2),a:_I(n,2)}}(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},kI=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},EI=o.memo(function(e){var t=e.hue,r=e.onChange,n=xI(["react-colorful__hue",e.className]);return o.createElement("div",{className:n},o.createElement(wI,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:gI(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":_I(t),"aria-valuemax":"360","aria-valuemin":"0"},o.createElement(CI,{className:"react-colorful__hue-pointer",left:t/360,color:AI({h:t,s:100,v:100,a:1})})))}),II=o.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:AI({h:t.h,s:100,v:100,a:1})};return o.createElement("div",{className:"react-colorful__saturation",style:n},o.createElement(wI,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:gI(t.s+100*e.left,0,100),v:gI(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+_I(t.s)+"%, Brightness "+_I(t.v)+"%"},o.createElement(CI,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:AI(t)})))}),jI=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},TI=typeof window<"u"?o.useLayoutEffect:o.useEffect,FI=new Map,OI=function(e){var t=e.className,n=e.colorModel,i=e.color,a=void 0===i?n.defaultColor:i,s=e.onChange,l=OE(e,["className","colorModel","color","onChange"]),c=(0,o.useRef)(null);!function(e){TI(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!FI.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',FI.set(t,n);var i=r.nc;i&&n.setAttribute("nonce",i),t.head.appendChild(n)}},[])}(c);var u=function(e,t,r){var n=ME(r),i=(0,o.useState)(function(){return e.toHsva(t)}),a=i[0],s=i[1],l=(0,o.useRef)({color:t,hsva:a});(0,o.useEffect)(function(){if(!e.equal(t,l.current.color)){var r=e.toHsva(t);l.current={hsva:r,color:t},s(r)}},[t,e]),(0,o.useEffect)(function(){var t;jI(a,l.current.hsva)||e.equal(t=e.fromHsva(a),l.current.color)||(l.current={hsva:a,color:t},n(t))},[a,e,n]);var c=(0,o.useCallback)(function(e){s(function(t){return Object.assign({},t,e)})},[]);return[a,c]}(n,a,s),d=u[0],h=u[1],f=xI(["react-colorful",t]);return o.createElement("div",FE({},l,{ref:c,className:f}),o.createElement(II,{hsva:d,onChange:h}),o.createElement(EI,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},MI={defaultColor:"000",toHsva:function(e){return function(e){var t=e.r,r=e.g,n=e.b,i=e.a,o=Math.max(t,r,n),a=o-Math.min(t,r,n),s=a?o===t?(r-n)/a:o===r?2+(n-t)/a:4+(t-r)/a:0;return{h:_I(60*(s<0?s+6:s)),s:_I(o?a/o*100:0),v:_I(o/255*100),a:i}}(SI(e))},fromHsva:function(e){return function(e){return function(e){var t=e.r,r=e.g,n=e.b,i=e.a,o=i<1?kI(_I(255*i)):"";return"#"+kI(t)+kI(r)+kI(n)+o}(function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var o=Math.floor(t),a=n*(1-r),s=n*(1-(t-o)*r),l=n*(1-(1-t+o)*r),c=o%6;return{r:_I(255*[n,s,a,a,l,n][c]),g:_I(255*[l,n,n,s,a,a][c]),b:_I(255*[a,a,l,n,n,s][c]),a:_I(i,2)}}(e))}({h:e.h,s:e.s,v:e.v,a:1})},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||jI(SI(e),SI(t))}},PI=function(e){return o.createElement(OI,FE({},e,{colorModel:MI}))},RI=/^#?([0-9A-F]{3,8})$/i,LI=function(e){var t=e.color,r=void 0===t?"":t,n=e.onChange,i=e.onBlur,a=e.escape,s=e.validate,l=e.format,c=e.process,u=OE(e,["color","onChange","onBlur","escape","validate","format","process"]),d=(0,o.useState)(function(){return a(r)}),h=d[0],f=d[1],p=ME(n),g=ME(i),m=(0,o.useCallback)(function(e){var t=a(e.target.value);f(t),s(t)&&p(c?c(t):t)},[a,c,s,p]),v=(0,o.useCallback)(function(e){s(e.target.value)||f(a(r)),g(e)},[r,a,s,g]);return(0,o.useEffect)(function(){f(a(r))},[r,a]),o.createElement("input",FE({},u,{value:l?l(h):h,spellCheck:"false",onChange:m,onBlur:v}))},NI=function(e){return"#"+e},DI=function(e){var t=e.prefixed,r=e.alpha,n=OE(e,["prefixed","alpha"]),i=(0,o.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,r?8:6)},[r]),a=(0,o.useCallback)(function(e){return function(e,t){var r=RI.exec(e),n=r?r[1].length:0;return 3===n||6===n||!!t&&4===n||!!t&&8===n}(e,r)},[r]);return o.createElement(LI,FE({},n,{escape:i,format:t?NI:void 0,process:NI,validate:a}))};PE={alpha:"\u0623\u0644\u0641\u0627",black:"\u0623\u0633\u0648\u062f",blue:"\u0623\u0632\u0631\u0642","blue purple":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0645\u0632\u0631\u0642",brightness:"\u0627\u0644\u0633\u0637\u0648\u0639",brown:"\u0628\u0646\u064a","brown yellow":"\u0623\u0635\u0641\u0631 \u0628\u0646\u064a",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0633\u0645\u0627\u0648\u064a","cyan blue":"\u0623\u0632\u0631\u0642 \u0633\u0645\u0627\u0648\u064a",dark:"\u062f\u0627\u0643\u0646",gray:"\u0631\u0645\u0627\u062f\u064a",grayish:"\u0645\u0627\u0626\u0644 \u0644\u0644\u0631\u0645\u0627\u062f\u064a",green:"\u0623\u062e\u0636\u0631","green cyan":"\u0633\u0645\u0627\u0648\u064a \u0645\u062e\u0636\u0631",hue:"\u062f\u0631\u062c\u0629 \u0627\u0644\u0644\u0648\u0646",light:"\u0641\u0627\u062a\u062d",lightness:"\u0627\u0644\u0625\u0636\u0627\u0621\u0629",magenta:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","magenta pink":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0648\u0631\u062f\u064a",orange:"\u0628\u0631\u062a\u0642\u0627\u0644\u064a","orange yellow":"\u0623\u0635\u0641\u0631 \u0628\u0631\u062a\u0642\u0627\u0644\u064a",pale:"\u0628\u0627\u0647\u062a",pink:"\u0648\u0631\u062f\u064a","pink red":"\u0623\u062d\u0645\u0631 \u0648\u0631\u062f\u064a",purple:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","purple magenta":"\u0628\u0646\u0641\u0633\u062c\u064a",red:"\u0623\u062d\u0645\u0631","red orange":"\u0628\u0631\u062a\u0642\u0627\u0644\u064a \u0645\u062d\u0645\u0631",saturation:"\u0627\u0644\u062a\u0634\u0628\u0639",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u0634\u0641\u0627\u0641`,"very dark":"\u062f\u0627\u0643\u0646 \u062c\u062f\u064b\u0627","very light":"\u0641\u0627\u062a\u062d \u062c\u062f\u064b\u0627",vibrant:"\u0633\u0627\u0637\u0639",white:"\u0623\u0628\u064a\u0636",yellow:"\u0623\u0635\u0641\u0631","yellow green":"\u0623\u062e\u0636\u0631 \u0645\u0635\u0641\u0631"},RE={alpha:"\u0410\u043b\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u043e",blue:"\u0421\u0438\u043d\u044c\u043e","blue purple":"\u0441\u0438\u043d\u044c\u043e \u043b\u0438\u043b\u0430\u0432\u043e",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442",brown:"\u043a\u0430\u0444\u044f\u0432\u043e","brown yellow":"\u043a\u0430\u0444\u044f\u0432\u043e \u0436\u044a\u043b\u0442\u043e",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0446\u0438\u0430\u043d","cyan blue":"\u0446\u0438\u0430\u043d \u0441\u0438\u043d\u044c\u043e",dark:"\u0442\u044a\u043c\u043d\u043e",gray:"\u0441\u0438\u0432\u043e",grayish:"\u0441\u0438\u0432\u043a\u0430\u0432",green:"\u0417\u0435\u043b\u0435\u043d\u043e","green cyan":"\u0437\u0435\u043b\u0435\u043d \u0446\u0438\u0430\u043d",hue:"\u041e\u0442\u0442\u0435\u043d\u044a\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u043e",lightness:"\u041b\u0435\u043a\u043e\u0442\u0430",magenta:"\u043c\u0430\u0433\u0435\u043d\u0442\u0430","magenta pink":"\u043c\u0430\u0433\u0435\u043d\u0442\u0430 \u0440\u043e\u0437\u043e\u0432\u043e",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e \u0436\u044a\u043b\u0442\u043e",pale:"\u0431\u043b\u0435\u0434\u043e",pink:"\u0440\u043e\u0437\u043e\u0432\u043e","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e \u0447\u0435\u0440\u0432\u0435\u043d\u043e",purple:"\u043b\u0438\u043b\u0430\u0432\u043e","purple magenta":"\u043b\u0438\u043b\u0430\u0432\u043e \u043c\u0430\u0433\u0435\u043d\u0442\u0430",red:"\u0427\u0435\u0440\u0432\u0435\u043d\u043e","red orange":"\u0447\u0435\u0440\u0432\u0435\u043d \u043f\u043e\u0440\u0442\u043e\u043a\u0430\u043b",saturation:"\u041d\u0430\u0441\u0438\u0442\u0435\u043d\u043e\u0441\u0442",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u0435\u043d`,"very dark":"\u043c\u043d\u043e\u0433\u043e \u0442\u044a\u043c\u043d\u043e","very light":"\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u043b\u043e",vibrant:" \u044f\u0440\u043a\u043e",white:"\u0431\u044f\u043b\u043e",yellow:"\u0436\u044a\u043b\u0442\u043e","yellow green":"\u0436\u044a\u043b\u0442\u043e \u0437\u0435\u043b\u0435\u043d"},LE={alpha:"Alfa",black:"\u010dern\xe1",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hn\u011bd\xe1","brown yellow":"hn\u011bdo\u017elut\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"tyrkysov\xe1","cyan blue":"tyrkysovomodr\xe1",dark:"tmav\xe1",gray:"\u0161ed\xe1",grayish:"na\u0161edl\xe1",green:"Zelen\xe1","green cyan":"zelenotyrkysov\xe1",hue:"Odst\xedn",light:"sv\u011btl\xe1",lightness:"Sv\u011btlost",magenta:"purpurov\xe1","magenta pink":"purpurov\u011b r\u016f\u017eov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elut\xe1",pale:"bled\xe1",pink:"r\u016f\u017eov\xe1","pink red":"r\u016f\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\u011b purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"Sytost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} pr\u016fhledn\xe9`,"very dark":"velmi tmav\xe1","very light":"velmi sv\u011btl\xe1",vibrant:"z\xe1\u0159iv\xe1",white:"b\xedl\xe1",yellow:"\u017elut\xe1","yellow green":"\u017elutozelen\xe1"},NE={alpha:"Alfa",black:"sort",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyan bl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5lig",green:"Gr\xf8n","green cyan":"gr\xf8n cyan",hue:"Tone",light:"lys",lightness:"Lyshed",magenta:"magenta","magenta pink":"magenta pink",orange:"orange","orange yellow":"orangegul",pale:"bleg",pink:"lyser\xf8d","pink red":"lyser\xf8dlig r\xf8d",purple:"lilla","purple magenta":"lilla magenta",red:"R\xf8d","red orange":"r\xf8dorange",saturation:"Farvem\xe6tning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gennemsigtig`,"very dark":"meget m\xf8rk","very light":"meget lys",vibrant:"klar",white:"hvid",yellow:"gul","yellow green":"gulgr\xf8n"},DE={alpha:"Alpha",black:"Schwarz",blue:"Blau","blue purple":"Blaulila",brightness:"Helligkeit",brown:"Braun","brown yellow":"Braungelb",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Cyanblau",dark:"dunkles",gray:"Grau",grayish:"gr\xe4uliches",green:"Gr\xfcn","green cyan":"Gr\xfcncyan",hue:"Farbton",light:"helles",lightness:"Leuchtkraft",magenta:"Magenta","magenta pink":"Magentarosa",orange:"Orange","orange yellow":"Orangegelb",pale:"blasses",pink:"Rosa","pink red":"Rosarot",purple:"Lila","purple magenta":"Lilamagenta",red:"Rot","red orange":"Rotorange",saturation:"S\xe4ttigung",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, zu ${e.percentTransparent} transparent`,"very dark":"sehr dunkles","very light":"sehr helles",vibrant:"lebhaftes",white:"Wei\xdf",yellow:"Gelb","yellow green":"Gelbgr\xfcn"},zE={alpha:"\u0386\u03bb\u03c6\u03b1",black:"\u03bc\u03b1\u03cd\u03c1\u03bf",blue:"\u039c\u03c0\u03bb\u03b5","blue purple":"\u03bc\u03c0\u03bb\u03b5 \u03bc\u03c9\u03b2",brightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",brown:"\u03ba\u03b1\u03c6\u03ad","brown yellow":"\u03ba\u03b1\u03c6\u03ad \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u03ba\u03c5\u03b1\u03bd\u03cc","cyan blue":"\u03ba\u03c5\u03b1\u03bd\u03cc \u03bc\u03c0\u03bb\u03b5",dark:"\u03c3\u03ba\u03bf\u03cd\u03c1\u03bf",gray:"\u03b3\u03ba\u03c1\u03b9",grayish:"\u03b3\u03ba\u03c1\u03b9\u03b6\u03c9\u03c0\u03cc",green:"\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf","green cyan":"\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf \u03ba\u03c5\u03b1\u03bd\u03cc",hue:"\u03a4\u03cc\u03bd\u03bf\u03c2",light:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",lightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",magenta:"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1","magenta pink":"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1 \u03c1\u03bf\u03b6",orange:"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af","orange yellow":"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",pale:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",pink:"\u03c1\u03bf\u03b6","pink red":"\u03c1\u03bf\u03b6 \u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf",purple:"\u03bc\u03c9\u03b2","purple magenta":"\u03bc\u03c9\u03b2 \u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1",red:"\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf","red orange":"\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf \u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af",saturation:"\u039a\u03bf\u03c1\u03b5\u03c3\u03bc\u03cc\u03c2",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2`,"very dark":"\u03c0\u03bf\u03bb\u03cd \u03c3\u03ba\u03bf\u03cd\u03c1\u03bf","very light":"\u03c0\u03bf\u03bb\u03cd \u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",vibrant:"\u03ad\u03bd\u03c4\u03bf\u03bd\u03bf",white:"\u03bb\u03b5\u03c5\u03ba\u03cc",yellow:"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf","yellow green":"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf \u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"},BE={hue:"Hue",saturation:"Saturation",lightness:"Lightness",brightness:"Brightness",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"very dark",dark:"dark",light:"light","very light":"very light",pale:"pale",grayish:"grayish",vibrant:"vibrant",black:"black",white:"white",gray:"gray",pink:"pink","pink red":"pink red","red orange":"red orange",brown:"brown",orange:"orange","orange yellow":"orange yellow","brown yellow":"brown yellow",yellow:"yellow","yellow green":"yellow green","green cyan":"green cyan",cyan:"cyan","cyan blue":"cyan blue","blue purple":"blue purple",purple:"purple","purple magenta":"purple magenta",magenta:"magenta","magenta pink":"magenta pink"},UE={alpha:"Alpha",black:"negro",blue:"Azul","blue purple":"p\xfarpura azulado",brightness:"Brillo",brown:"marr\xf3n","brown yellow":"amarillo amarronado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"azul cian",dark:"oscuro",gray:"gris",grayish:"gris\xe1ceo",green:"Verde","green cyan":"cian verdoso",hue:"Tono",light:"claro",lightness:"Luminosidad",magenta:"magenta","magenta pink":"rosa magenta",orange:"naranja","orange yellow":"amarillo anaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rojo rosado",purple:"morado","purple magenta":"magenta viol\xe1ceo",red:"Rojo","red orange":"naranja rojizo",saturation:"Saturaci\xf3n",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muy oscuro","very light":"muy claro",vibrant:"intenso",white:"blanco",yellow:"amarillo","yellow green":"verde amarillento"},VE={alpha:"Alfa",black:"must",blue:"Sinine","blue purple":"sinakaslilla",brightness:"Heledus",brown:"pruun","brown yellow":"pruunikaskollane",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ts\xfcaan","cyan blue":"ts\xfcaansinine",dark:"tume",gray:"hall",grayish:"hallikas",green:"Roheline","green cyan":"ts\xfcaanroheline",hue:"V\xe4rv",light:"valgus",lightness:"Valgus",magenta:"magentapunane","magenta pink":"magentaroosa",orange:"oran\u017e","orange yellow":"oran\u017eikaskollane",pale:"kahvatu",pink:"roosa","pink red":"vaarikapunane",purple:"lilla","purple magenta":"purpurne magenta",red:"Punane","red orange":"punakasoran\u017e",saturation:"K\xfcllastus",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4bipaistev`,"very dark":"v\xe4ga tume","very light":"v\xe4ga hele",vibrant:"ere",white:"valge",yellow:"kollane","yellow green":"kollakasroheline"},HE={alpha:"Alpha",black:"musta",blue:"Sininen","blue purple":"sinivioletti",brightness:"Kirkkaus",brown:"ruskea","brown yellow":"ruskeankeltainen",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"syaani","cyan blue":"syaaninsininen",dark:"tumma",gray:"harmaa",grayish:"harmahtava",green:"Vihre\xe4","green cyan":"vihre\xe4nsyaani",hue:"S\xe4vy",light:"vaalea",lightness:"Valom\xe4\xe4r\xe4",magenta:"magenta","magenta pink":"magentapinkki",orange:"oranssi","orange yellow":"oranssinkeltainen",pale:"vaalea",pink:"pinkki","pink red":"vaaleanpunainen",purple:"violetti","purple magenta":"violettimagenta",red:"Punainen","red orange":"punaoranssi",saturation:"V\xe4rikyll\xe4isyys",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4pin\xe4kyv\xe4`,"very dark":"hyvin tumma","very light":"eritt\xe4in vaalea",vibrant:"eloisa",white:"valkea",yellow:"keltainen","yellow green":"keltavihre\xe4"},WE={alpha:"Alpha",black:"Noir",blue:"Bleu","blue purple":"Violet bleu",brightness:"Luminosit\xe9",brown:"Brun","brown yellow":"Jaune brun",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Bleu cyan",dark:"Sombre",gray:"Gris",grayish:"Gris\xe2tre",green:"Vert","green cyan":"Cyan vert",hue:"Teinte",light:"Clair",lightness:"Luminosit\xe9",magenta:"Magenta","magenta pink":"Rose magenta",orange:"Orange","orange yellow":"Jaune orang\xe9",pale:"P\xe2le",pink:"Rose","pink red":"Rouge ros\xe9",purple:"Violet","purple magenta":"Magenta violet",red:"Rouge","red orange":"Orange rouge",saturation:"Saturation",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"Tr\xe8s sombre","very light":"Tr\xe8s clair",vibrant:"Vif",white:"Blanc",yellow:"Jaune","yellow green":"Vert jaune"},$E={alpha:"\u05d0\u05dc\u05e4\u05d0",black:"\u05e9\u05d7\u05d5\u05e8",blue:"\u05db\u05d7\u05d5\u05dc","blue purple":"\u05db\u05d7\u05d5\u05dc \u05e1\u05d2\u05d5\u05dc",brightness:"\u05d1\u05d4\u05d9\u05e8\u05d5\u05ea",brown:"\u05d7\u05d5\u05dd","brown yellow":"\u05d7\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u05d8\u05d5\u05e8\u05e7\u05d9\u05d6","cyan blue":"\u05db\u05d7\u05d5\u05dc \u05e6\u05d9\u05d0\u05df",dark:"\u05db\u05d4\u05d4",gray:"\u05d0\u05e4\u05d5\u05e8",grayish:"\u05d0\u05e4\u05e8\u05e4\u05e8",green:"\u05d9\u05e8\u05d5\u05e7","green cyan":"\u05e6\u05d9\u05d0\u05df \u05d9\u05e8\u05d5\u05e7",hue:"\u05d2\u05d5\u05d5\u05df",light:"\u05d0\u05d5\u05e8",lightness:"\u05db\u05de\u05d5\u05ea \u05d0\u05d5\u05e8",magenta:"\u05de\u05d2'\u05e0\u05d8\u05d4","magenta pink":"\u05d5\u05e8\u05d5\u05d3 \u05de\u05d2'\u05e0\u05d8\u05d4",orange:"\u05db\u05ea\u05d5\u05dd","orange yellow":"\u05db\u05ea\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",pale:"\u05d7\u05d9\u05d5\u05d5\u05e8",pink:"\u05d5\u05e8\u05d5\u05d3","pink red":"\u05d5\u05e8\u05d5\u05d3 \u05d0\u05d3\u05d5\u05dd",purple:"\u05e1\u05d2\u05d5\u05dc","purple magenta":"\u05de\u05d2'\u05e0\u05d8\u05d4 \u05e1\u05d2\u05d5\u05dc",red:"\u05d0\u05d3\u05d5\u05dd","red orange":"\u05db\u05ea\u05d5\u05dd \u05d0\u05d3\u05d5\u05dd",saturation:"\u05e8\u05d5\u05d5\u05d9\u05d4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u05e9\u05e7\u05d5\u05e3`,"very dark":"\u05db\u05d4\u05d4 \u05de\u05d0\u05d5\u05d3","very light":"\u05d1\u05d4\u05d9\u05e8 \u05de\u05d0\u05d5\u05d3",vibrant:"\u05ea\u05d5\u05e1\u05e1",white:"\u05dc\u05d1\u05df",yellow:"\u05e6\u05d4\u05d5\u05d1","yellow green":"\u05e6\u05d4\u05d5\u05d1 \u05d9\u05e8\u05d5\u05e7"},qE={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavo ljubi\u010dasta",brightness:"Svjetlina",brown:"sme\u0111a","brown yellow":"sme\u0111e \u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasto",green:"Zelena","green cyan":"zelena cijan",hue:"Nijansa",light:"svjetlo",lightness:"Osvijetljenost",magenta:"magenta","magenta pink":"magentno ru\u017ei\u010dasta",orange:"naran\u010dasta","orange yellow":"naran\u010dasto \u017euta",pale:"blijeda",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dasto crvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crveno naran\u010dasta",saturation:"Zasi\u0107enost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirnosti`,"very dark":"jako tamna","very light":"vrlo svijetlo",vibrant:"vibrantna",white:"bijela",yellow:"\u017euto","yellow green":"\u017euto zelena"},GE={alpha:"Alfa",black:"fekete",blue:"K\xe9k","blue purple":"k\xe9k lila",brightness:"F\xe9nyess\xe9g",brown:"barna","brown yellow":"barna s\xe1rga",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\xe1nk\xe9k","cyan blue":"ci\xe1nk\xe9k",dark:"s\xf6t\xe9t",gray:"sz\xfcrke",grayish:"sz\xfcrk\xe9s",green:"Z\xf6ld","green cyan":"z\xf6ld ci\xe1nk\xe9k",hue:"Sz\xedn\xe1rnyalat",light:"vil\xe1gos",lightness:"Vil\xe1goss\xe1g",magenta:"b\xedbor","magenta pink":"b\xedbor r\xf3zsasz\xedn",orange:"narancs","orange yellow":"narancss\xe1rga",pale:"halv\xe1ny",pink:"r\xf3zsasz\xedn","pink red":"r\xf3zsasz\xedn piros",purple:"lila","purple magenta":"lila b\xedbor",red:"Piros","red orange":"piros narancs",saturation:"Tel\xedtetts\xe9g",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \xe1tl\xe1tsz\xf3`,"very dark":"nagyon s\xf6t\xe9t","very light":"nagyon vil\xe1gos",vibrant:"\xe9l\xe9nk",white:"feh\xe9r",yellow:"s\xe1rga","yellow green":"s\xe1rga z\xf6ld"},YE={alpha:"Alfa",black:"nero",blue:"Blu","blue purple":"blu viola",brightness:"Luminosit\xe0",brown:"marrone","brown yellow":"giallo bruno",colorName:e=>`${e.hue} ${e.chroma} ${e.lightness}`,cyan:"ciano","cyan blue":"blu ciano",dark:"scuro",gray:"grigio",grayish:"grigiastro",green:"Verde","green cyan":"verde ciano",hue:"Tonalit\xe0",light:"chiaro",lightness:"Luminosit\xe0",magenta:"magenta","magenta pink":"rosa magenta",orange:"arancio","orange yellow":"giallo arancio",pale:"tenue",pink:"rosa","pink red":"rosa rosso",purple:"viola","purple magenta":"viola magenta",red:"Rosso","red orange":"rosso arancio",saturation:"Saturazione",transparentColorName:e=>`${e.hue} ${e.chroma} ${e.lightness}, trasparenza ${e.percentTransparent}`,"very dark":"molto scuro","very light":"molto chiaro",vibrant:"vivace",white:"bianco",yellow:"giallo","yellow green":"giallo verde"},XE={alpha:"\u30a2\u30eb\u30d5\u30a1",black:"\u30d6\u30e9\u30c3\u30af",blue:"\u9752","blue purple":"\u30d6\u30eb\u30fc\u30d1\u30fc\u30d7\u30eb",brightness:"\u660e\u308b\u3055",brown:"\u30d6\u30e9\u30a6\u30f3","brown yellow":"\u30d6\u30e9\u30a6\u30f3\u30a4\u30a8\u30ed\u30fc",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u30b7\u30a2\u30f3","cyan blue":"\u30b7\u30a2\u30f3\u30d6\u30eb\u30fc",dark:"\u30c0\u30fc\u30af",gray:"\u30b0\u30ec\u30fc",grayish:"\u30b0\u30ec\u30a4\u30c3\u30b7\u30e5",green:"\u7dd1","green cyan":"\u30b0\u30ea\u30fc\u30f3\u30b7\u30a2\u30f3",hue:"\u8272\u76f8",light:"\u30e9\u30a4\u30c8",lightness:"\u660e\u5ea6",magenta:"\u30de\u30bc\u30f3\u30bf","magenta pink":"\u30de\u30bc\u30f3\u30bf\u30d4\u30f3\u30af",orange:"\u30aa\u30ec\u30f3\u30b8","orange yellow":"\u30aa\u30ec\u30f3\u30b8\u30a4\u30a8\u30ed\u30fc",pale:"\u30da\u30fc\u30eb",pink:"\u30d4\u30f3\u30af","pink red":"\u30d4\u30f3\u30af\u30ec\u30c3\u30c9",purple:"\u30d1\u30fc\u30d7\u30eb","purple magenta":"\u30d1\u30fc\u30d7\u30eb\u30de\u30bc\u30f3\u30bf",red:"\u8d64","red orange":"\u30ec\u30c3\u30c9\u30aa\u30ec\u30f3\u30b8",saturation:"\u5f69\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u6700\u3082\u6697\u3044","very light":"\u30d9\u30ea\u30fc\u30e9\u30a4\u30c8",vibrant:"\u9bae\u3084\u304b",white:"\u30db\u30ef\u30a4\u30c8",yellow:"\u30a4\u30a8\u30ed\u30fc","yellow green":"\u30a4\u30a8\u30ed\u30fc\u30b0\u30ea\u30fc\u30f3"},KE={alpha:"\uc54c\ud30c",black:"\uac80\uc740\uc0c9",blue:"\ud30c\ub791","blue purple":"\uccad\uc790\uc0c9",brightness:"\uba85\ub3c4",brown:"\uac08\uc0c9","brown yellow":"\ud669\uac08\uc0c9",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\uccad\ub85d\uc0c9","cyan blue":"\uccad\ub85d\uc0c9",dark:"\ub2e4\ud06c",gray:"\ud68c\uc0c9",grayish:"\ud68c\uac08\uc0c9",green:"\ucd08\ub85d","green cyan":"\uccad\ub85d\uc0c9",hue:"\uc0c9\uc870",light:"\ub77c\uc774\ud2b8",lightness:"\ubc1d\uae30",magenta:"\uc790\ud64d\uc0c9","magenta pink":"\ub9c8\uc820\ud0c0 \ud551\ud06c",orange:"\uc8fc\ud669\uc0c9","orange yellow":"\ubd88\uadf8\uc2a4\ub984\ud55c \ub178\ub791",pale:"\ud759\uc0c9",pink:"\ubd84\ud64d\uc0c9","pink red":"\ud551\ud06c \ub808\ub4dc",purple:"\uc790\uc8fc\uc0c9","purple magenta":"\ubcf4\ub77c\ube5b \uc790\ud64d\uc0c9",red:"\ube68\uac15","red orange":"\ubd89\uc740 \uc8fc\ud669\uc0c9",saturation:"\ucc44\ub3c4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \ud22c\uba85\ub3c4`,"very dark":"\ub9e4\uc6b0 \uc5b4\ub450\uc6b4","very light":"\ub9e4\uc6b0 \uc5f0\ud568",vibrant:"\uac15\ub82c\ud55c",white:"\ud770\uc0c9",yellow:"\ub178\ub780\uc0c9","yellow green":"\uc5f0\ub450\uc0c9"},ZE={alpha:"Alfa",black:"juoda",blue:"M\u0117lyna","blue purple":"melsvai violetin\u0117",brightness:"Ry\u0161kumas",brown:"ruda","brown yellow":"rusvai geltona",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u017ealsvai m\u0117lyna","cyan blue":"\u017ealsvai m\u0117lyna",dark:"tamsi",gray:"pilka",grayish:"pilk\u0161va",green:"\u017dalia","green cyan":"\u017ealsvai m\u0117lyna",hue:"Atspalvis",light:"\u0161viesi",lightness:"\u0160viesumas",magenta:"rausvai raudona","magenta pink":"purpurin\u0117",orange:"oran\u017ein\u0117","orange yellow":"oran\u017einio atspalvio geltona",pale:"bly\u0161ki",pink:"ro\u017ein\u0117","pink red":"ro\u017ein\u0117 raudona",purple:"violetin\u0117","purple magenta":"purpurin\u0117 rausvai raudona",red:"Raudona","red orange":"rausvai oran\u017ein\u0117",saturation:"\u012esotinimas",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} skaidri`,"very dark":"labai tamsi","very light":"labai \u0161viesi",vibrant:"ry\u0161ki",white:"balta",yellow:"geltona","yellow green":"gelsvai \u017ealia"},QE={alpha:"Alfa",black:"melns",blue:"Zila","blue purple":"zili violets",brightness:"Spilgtums",brown:"br\u016bns","brown yellow":"br\u016bni dzeltens",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\u0101ns","cyan blue":"ci\u0101na zils",dark:"tum\u0161s",gray:"pel\u0113ks",grayish:"pel\u0113c\u012bgs",green:"Za\u013ca","green cyan":"za\u013c\u0161 ci\u0101ns",hue:"Nokr\u0101sa",light:"gai\u0161s",lightness:"Gai\u0161ums",magenta:"fuksiju","magenta pink":"fuksiju roz\u0101",orange:"oran\u017es","orange yellow":"oran\u017ei dzeltens",pale:"b\u0101ls",pink:"roz\u0101","pink red":"roz\u012bgi sarkans",purple:"violets","purple magenta":"violets fuksiju",red:"Sarkana","red orange":"sarkan\u012bgi oran\u017es",saturation:"Pies\u0101tin\u0101jums",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} caursp\u012bd\u012bgs`,"very dark":"\u013coti tum\u0161s","very light":"\u013coti gai\u0161s",vibrant:"ko\u0161s",white:"balts",yellow:"dzeltens","yellow green":"dzelteni za\u013c\u0161"},JE={alpha:"Alfa",black:"svart",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf8nn","green cyan":"gr\xf8nncyan",hue:"Fargetone",light:"lys",lightness:"Lyshet",magenta:"magenta","magenta pink":"magentarosa",orange:"oransje","orange yellow":"oransjegul",pale:"blek",pink:"rosa","pink red":"rosar\xf8d",purple:"lilla","purple magenta":"lillamagenta",red:"R\xf8d","red orange":"r\xf8doransje",saturation:"Metning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gjennomsiktig`,"very dark":"sv\xe6rt m\xf8rk","very light":"sv\xe6rt lys",vibrant:"levende",white:"hvit",yellow:"gul","yellow green":"gulgr\xf8nn"},eI={alpha:"Alfa",black:"zwart",blue:"Blauw","blue purple":"paarsblauw",brightness:"Helderheid",brown:"bruin","brown yellow":"bruingeel",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyaan","cyan blue":"cyaanblauw",dark:"donker",gray:"grijs",grayish:"grijsachtig",green:"Groen","green cyan":"cyaangroen",hue:"Kleurtoon",light:"licht",lightness:"Lichtsterkte",magenta:"magenta","magenta pink":"magentaroze",orange:"oranje","orange yellow":"oranjegeel",pale:"bleek",pink:"roze","pink red":"rozerood",purple:"paars","purple magenta":"magentapaars",red:"Rood","red orange":"roodoranje",saturation:"Verzadiging",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparant`,"very dark":"heel donker","very light":"heel licht",vibrant:"levendig",white:"wit",yellow:"geel","yellow green":"geelgroen"},tI={alpha:"Alfa",black:"czarny",blue:"Niebieski","blue purple":"niebiesko-fioletowy",brightness:"Jasno\u015b\u0107",brown:"br\u0105zowy","brown yellow":"br\u0105zowo-\u017c\xf3\u0142ty",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyjanowy","cyan blue":"cyjanowo-niebieski",dark:"ciemny",gray:"szary",grayish:"szarawy",green:"Zielony","green cyan":"zielono-cyjanowy",hue:"Odcie\u0144",light:"jasny",lightness:"Jaskrawo\u015b\u0107",magenta:"purpurowy","magenta pink":"purpurowo-r\xf3\u017cowy",orange:"pomara\u0144czowy","orange yellow":"pomara\u0144czowo-\u017c\xf3\u0142ty",pale:"blady",pink:"r\xf3\u017cowy","pink red":"r\xf3\u017cowo-czerwony",purple:"fioletowy","purple magenta":"fioletowo-purpurowy",red:"Czerwony","red orange":"czerwono-pomara\u0144czowy",saturation:"Nasycenie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} przezroczysto\u015bci`,"very dark":"bardzo ciemny","very light":"bardzo jasny",vibrant:"intensywny",white:"bia\u0142y",yellow:"\u017c\xf3\u0142ty","yellow green":"\u017c\xf3\u0142to-zielony"},rI={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"roxo azulado",brightness:"Brilho",brown:"marrom","brown yellow":"marrom amarelado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinza",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Matiz",light:"claro",lightness:"Luminosidade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo alaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rosa avermelhado",purple:"roxo","purple magenta":"roxo-magenta",red:"Vermelho","red orange":"laranja avermelhado",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde amarelado"},nI={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"azul-p\xfarpura",brightness:"Luminosidade",brown:"castanho","brown yellow":"amarelo-castanho",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinzento",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Tonalidade",light:"claro",lightness:"Claridade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo-laranja",pale:"p\xe1lido",pink:"cor-de-rosa","pink red":"vermelho-rosa",purple:"p\xfarpura","purple magenta":"p\xfarpura-magenta",red:"Vermelho","red orange":"laranja-vermelho",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde-amarelo"},iI={alpha:"Alfa",black:"negru",blue:"Albastru","blue purple":"albastru-violet",brightness:"Luminozitate",brown:"maro","brown yellow":"galben maro",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"bleu","cyan blue":"albastru-bleu",dark:"\xeenchis",gray:"gri",grayish:"cenu\u0219iu",green:"Verde","green cyan":"verde bleu",hue:"Nuan\u021b\u0103",light:"deschis",lightness:"Luminozitate",magenta:"fucsia","magenta pink":"roz-fucsia",orange:"portocaliu","orange yellow":"galben-portocaliu",pale:"pal",pink:"roz","pink red":"roz-ro\u0219u",purple:"violet","purple magenta":"violet-fucsia",red:"Ro\u0219u","red orange":"portocaliu-ro\u0219u",saturation:"Satura\u021bie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"foarte \xeenchis","very light":"foarte deschis",vibrant:"plin de via\u021b\u0103",white:"alb",yellow:"galben","yellow green":"galben-verde"},oI={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u044b\u0439",blue:"\u0421\u0438\u043d\u0438\u0439","blue purple":"\u0441\u0438\u043d\u0435-\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0433\u043e\u043b\u0443\u0431\u043e\u0439","cyan blue":"\u0446\u0432\u0435\u0442 \u043c\u043e\u0440\u0441\u043a\u043e\u0439 \u0432\u043e\u043b\u043d\u044b",dark:"\u0442\u0435\u043c\u043d\u044b\u0439",gray:"\u0441\u0435\u0440\u044b\u0439",grayish:"\u0441\u0435\u0440\u043e\u0432\u0430\u0442\u044b\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439","green cyan":"\u0441\u0438\u043d\u0435-\u0437\u0435\u043b\u0435\u043d\u044b\u0439",hue:"\u041e\u0442\u0442\u0435\u043d\u043e\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u044b\u0439",lightness:"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u043e-\u0440\u043e\u0437\u043e\u0432\u044b\u0439",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",pale:"\u0431\u043b\u0435\u0434\u043d\u044b\u0439",pink:"\u0440\u043e\u0437\u043e\u0432\u044b\u0439","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e-\u043a\u0440\u0430\u0441\u043d\u044b\u0439",purple:"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439","purple magenta":"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439","red orange":"\u043a\u0440\u0430\u0441\u043d\u043e-\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",saturation:"\u041d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u043e\u0447\u0435\u043d\u044c \u0442\u0435\u043c\u043d\u044b\u0439","very light":"\u043e\u0447\u0435\u043d\u044c \u0441\u0432\u0435\u0442\u043b\u044b\u0439",vibrant:"\u044f\u0440\u043a\u0438\u0439",white:"\u0431\u0435\u043b\u044b\u0439",yellow:"\u0436\u0435\u043b\u0442\u044b\u0439","yellow green":"\u0436\u0435\u043b\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u044b\u0439"},aI={alpha:"Alfa",black:"\u010dierna",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hned\xe1","brown yellow":"hnedo\u017elt\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"az\xfarov\xe1","cyan blue":"az\xfarov\xe1 modr\xe1",dark:"tmav\xe1",gray:"siv\xe1",grayish:"sivast\xe1",green:"Zelen\xe1","green cyan":"zelen\xe1 az\xfarov\xe1",hue:"Odtie\u0148",light:"svetl\xe1",lightness:"Svetlos\u0165",magenta:"purpurov\xe1","magenta pink":"ru\u017eov\xe1 purpurov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elt\xe1",pale:"bled\xe1",pink:"ru\u017eov\xe1","pink red":"ru\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\xe1 purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"S\xfdtos\u0165",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prieh\u013eadn\xe1`,"very dark":"ve\u013emi tmav\xe1","very light":"ve\u013emi svetl\xe1",vibrant:"energick\xe1",white:"biela",yellow:"\u017elt\xe1","yellow green":"\u017eltozelen\xe1"},sI={alpha:"Alfa",black:"\u010drna",blue:"Modra","blue purple":"modro vijoli\u010dna",brightness:"Svetlost",brown:"rjava","brown yellow":"rjavo rumena",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"cian modra",dark:"temna",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zelena cian",hue:"Barva",light:"svetla",lightness:"Lahkost",magenta:"\u0161krlatna","magenta pink":"\u0161krlatno roza",orange:"oran\u017ena","orange yellow":"oran\u017eno rumena",pale:"bleda",pink:"roza","pink red":"roza rde\u010da",purple:"vijoli\u010dna","purple magenta":"vijoli\u010dno \u0161krlatna",red:"Rde\u010da","red orange":"rde\u010de oran\u017ena",saturation:"Nasi\u010denost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozorna`,"very dark":"zelo temna","very light":"zelo svetla",vibrant:"\u017eivahna",white:"bela",yellow:"rumena","yellow green":"rumeno zelena"},lI={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavoljubi\u010dasta",brightness:"Osvetljenost",brown:"sme\u0111a","brown yellow":"sme\u0111e\u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zeleno cijan",hue:"Nijansa",light:"svetla",lightness:"Osvetljenje",magenta:"purpurnocrvena","magenta pink":"magenta ru\u017ei\u010dasta",orange:"narand\u017easta","orange yellow":"narand\u017easto\u017euta",pale:"bledo",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dastocrvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crvenonarand\u017easta",saturation:"Zasi\u0107enje",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirna`,"very dark":"veoma tamno","very light":"vrlo svetlo",vibrant:"\u017eivopisna",white:"bela",yellow:"\u017euto","yellow green":"\u017eutozelena"},cI={alpha:"Alfa",black:"svart",blue:"Bl\xe5tt","blue purple":"bl\xe5lila",brightness:"Ljusstyrka",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf6rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf6nt","green cyan":"gr\xf6n cyan",hue:"Nyans",light:"ljus",lightness:"Ljushet",magenta:"magenta","magenta pink":"magentarosa",orange:"orange","orange yellow":"orangegul",pale:"blek",pink:"rosa","pink red":"rosar\xf6d",purple:"lila","purple magenta":"lila magenta",red:"R\xf6tt","red orange":"r\xf6dorange",saturation:"M\xe4ttnad",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} genomskinlig`,"very dark":"mycket m\xf6rk","very light":"mycket ljus",vibrant:"livfull",white:"vit",yellow:"gul","yellow green":"gulgr\xf6n"},uI={alpha:"Alfa",black:"siyah",blue:"Mavi","blue purple":"mavi mor",brightness:"Parlakl\u0131k",brown:"kahverengi","brown yellow":"kahverengi sar\u0131",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"camg\xf6be\u011fi","cyan blue":"camg\xf6be\u011fi mavi",dark:"koyu",gray:"gri",grayish:"grimsi",green:"Ye\u015fil","green cyan":"ye\u015fil camg\xf6be\u011fi",hue:"Ton",light:"a\xe7\u0131k",lightness:"Canl\u0131l\u0131k",magenta:"eflatun","magenta pink":"eflatun pembe",orange:"turuncu","orange yellow":"turuncu sar\u0131",pale:"solgun",pink:"pembe","pink red":"pembe k\u0131rm\u0131z\u0131",purple:"mor","purple magenta":"mor eflatun",red:"K\u0131rm\u0131z\u0131","red orange":"k\u0131rm\u0131z\u0131 portakal",saturation:"Doygunluk",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} saydam`,"very dark":"\xe7ok koyu","very light":"\xe7ok a\xe7\u0131k",vibrant:"canl\u0131",white:"beyaz",yellow:"sar\u0131","yellow green":"sar\u0131 ye\u015fil"},dI={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u043e\u0440\u043d\u0438\u0439",blue:"\u0421\u0438\u043d\u0456\u0439","blue purple":"\u0441\u0438\u043d\u044c\u043e-\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",brightness:"\u042f\u0441\u043a\u0440\u0430\u0432\u0456\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u0438\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439","cyan blue":"\u0441\u0438\u043d\u044c\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",dark:"\u0442\u0435\u043c\u043d\u0438\u0439",gray:"\u0441\u0456\u0440\u0438\u0439",grayish:"\u0441\u0456\u0440\u0443\u0432\u0430\u0442\u0438\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439","green cyan":"\u0437\u0435\u043b\u0435\u043d\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",hue:"\u0422\u043e\u043d",light:"\u0441\u0432\u0456\u0442\u043b\u0438\u0439",lightness:"\u041e\u0441\u0432\u0456\u0442\u043b\u0435\u043d\u0456\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u043e-\u0440\u043e\u0436\u0435\u0432\u0438\u0439",orange:"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439","orange yellow":"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",pale:"\u0431\u043b\u0456\u0434\u0438\u0439",pink:"\u0440\u043e\u0436\u0435\u0432\u0438\u0439","pink red":"\u0440\u043e\u0436\u0435\u0432\u043e-\u0447\u0435\u0440\u0432\u043e\u043d\u0438\u0439",purple:"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439","purple magenta":"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439",red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439","red orange":"\u0447\u0435\u0440\u0432\u043e\u043d\u043e-\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",saturation:"\u041d\u0430\u0441\u0438\u0447\u0435\u043d\u0456\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u043e\u0440\u0438\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u0434\u0443\u0436\u0435 \u0442\u0435\u043c\u043d\u0438\u0439","very light":"\u0434\u0443\u0436\u0435 \u0441\u0432\u0456\u0442\u043b\u0438\u0439",vibrant:"\u044f\u0441\u043a\u0440\u0430\u0432\u0438\u0439",white:"\u0431\u0456\u043b\u0438\u0439",yellow:"\u0436\u043e\u0432\u0442\u0438\u0439","yellow green":"\u0436\u043e\u0432\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u0438\u0439"},hI={alpha:"Alpha",black:"\u9ed1\u8272",blue:"\u84dd\u8272","blue purple":"\u84dd\u7d2b\u8272",brightness:"\u4eae\u5ea6",brown:"\u68d5\u8272\u7684","brown yellow":"\u68d5\u9ec4\u8272",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u84dd\u7eff\u8272","cyan blue":"\u9752\u84dd\u8272",dark:"\u6df1\u8272",gray:"\u7070\u8272",grayish:"\u6d45\u7070\u8272\u7684",green:"\u7eff\u8272","green cyan":"\u7eff\u9752\u8272",hue:"\u8272\u76f8",light:"\u6d45\u8272",lightness:"\u660e\u4eae\u5ea6",magenta:"\u7d2b\u7ea2\u8272","magenta pink":"\u7d2b\u7c89\u8272",orange:"\u6a59\u8272","orange yellow":"\u6a59\u9ec4\u8272",pale:"\u82cd\u767d\u7684",pink:"\u7c89\u8272","pink red":"\u7c89\u7ea2\u8272",purple:"\u7d2b\u8272","purple magenta":"\u7d2b\u6d0b\u7ea2\u8272",red:"\u7ea2\u8272","red orange":"\u7ea2\u6a59\u8272",saturation:"\u9971\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6d45",vibrant:"\u751f\u673a\u52c3\u52c3",white:"\u767d\u8272",yellow:"\u9ec4\u8272","yellow green":"\u9ec4\u8272/\u7eff\u8272"},fI={alpha:"Alpha",black:"\u9ed1",blue:"\u85cd\u8272","blue purple":"\u85cd\u7d2b",brightness:"\u4eae\u5ea6",brown:"\u68d5","brown yellow":"\u68d5\u9ec3",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u9752","cyan blue":"\u9752\u85cd",dark:"\u6697",gray:"\u7070",grayish:"\u504f\u7070",green:"\u7da0\u8272","green cyan":"\u9752\u7da0",hue:"\u8272\u76f8",light:"\u6dfa",lightness:"\u660e\u4eae",magenta:"\u6d0b\u7d05","magenta pink":"\u6dfa\u6d0b\u7d05",orange:"\u6a59","orange yellow":"\u6a59\u9ec3",pale:"\u6de1",pink:"\u7c89\u7d05","pink red":"\u7c89\u7d05",purple:"\u7d2b","purple magenta":"\u7d2b\u6d0b\u7d05",red:"\u7d05\u8272","red orange":"\u6a59\u7d05",saturation:"\u98fd\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6dfa",vibrant:"\u9bae\u8c54",white:"\u767d",yellow:"\u9ec3","yellow green":"\u9ec3\u7da0"},pI={"ar-AE":PE,"bg-BG":RE,"cs-CZ":LE,"da-DK":NE,"de-DE":DE,"el-GR":zE,"en-US":BE,"es-ES":UE,"et-EE":VE,"fi-FI":HE,"fr-FR":WE,"he-IL":$E,"hr-HR":qE,"hu-HU":GE,"it-IT":YE,"ja-JP":XE,"ko-KR":KE,"lt-LT":ZE,"lv-LV":QE,"nb-NO":JE,"nl-NL":eI,"pl-PL":tI,"pt-BR":rI,"pt-PT":nI,"ro-RO":iI,"ru-RU":oI,"sk-SK":aI,"sl-SI":sI,"sr-SP":lI,"sv-SE":cI,"tr-TR":uI,"uk-UA":dI,"zh-CN":hI,"zh-TW":fI};const zI=Symbol.for("react-aria.i18n.locale"),BI=Symbol.for("react-aria.i18n.strings");let UI;class VI{getStringForLocale(e,t){let r=this.getStringsForLocale(t)[e];if(!r)throw new Error(`Could not find intl message ${e} in ${t} locale`);return r}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,r="en-US"){if(t[e])return t[e];let n=function(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}(e);if(t[n])return t[n];for(let i in t)if(i.startsWith(n+"-"))return t[i];return t[r]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let t=window[zI];if(void 0===UI){let e=window[BI];if(!e)return null;UI={};for(let r in e)UI[r]=new VI({[t]:e[r]},t)}let r=null==UI?void 0:UI[e];if(!r)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}}const HI=new Map,WI=new Map;class $I{format(e,t){let r=this.strings.getStringForLocale(e,this.locale);return"function"==typeof r?r(t,this):r}plural(e,t,r="cardinal"){let n=t["="+e];if(n)return"function"==typeof n?n():n;let i=this.locale+":"+r,o=HI.get(i);return o||(o=new Intl.PluralRules(this.locale,{type:r}),HI.set(i,o)),n=t[o.select(e)]||t.other,"function"==typeof n?n():n}number(e){let t=WI.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),WI.set(this.locale,t)),t.format(e)}select(e,t){let r=e[t]||e.other;return"function"==typeof r?r():r}constructor(e,t){this.locale=e,this.strings=t}}let qI=new Map,GI=!1;try{GI="exceptZero"===new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay}catch{}let YI=!1;try{YI="unit"===new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style}catch{}const XI={degree:{narrow:{default:"\xb0","ja-JP":" \u5ea6","zh-TW":"\u5ea6","sl-SI":" \xb0"}}};class KI{format(e){let t="";if(t=GI||null==this.options.signDisplay?this.numberFormatter.format(e):function(e,t,r){if("auto"===t)return e.format(r);if("never"===t)return e.format(Math.abs(r));{let n=!1;if("always"===t?n=r>0||Object.is(r,0):"exceptZero"===t&&(Object.is(r,-0)||Object.is(r,0)?r=Math.abs(r):n=r>0),n){let t=e.format(-r),n=e.format(r),i=t.replace(n,"").replace(/\u200e|\u061C/,"");return t.replace(n,"!!!").replace(i,"+").replace("!!!",n)}return e.format(r)}}(this.numberFormatter,this.options.signDisplay,e),"unit"===this.options.style&&!YI){var r;let{unit:e,unitDisplay:n="short",locale:i}=this.resolvedOptions();if(!e)return t;let o=null===(r=XI[e])||void 0===r?void 0:r[n];t+=o[i]||o.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.numberFormatter.formatRange)return this.numberFormatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} \u2013 ${this.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.numberFormatter.formatRangeToParts)return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(e),n=this.numberFormatter.formatToParts(t);return[...r.map(e=>({...e,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...n.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!GI&&null!=this.options.signDisplay&&(e={...e,signDisplay:this.options.signDisplay}),!YI&&"unit"===this.options.style&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=function(e,t={}){let{numberingSystem:r}=t;if(r&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${r}`),"unit"===t.style&&!YI){var n;let{unit:e,unitDisplay:r="short"}=t;if(!e)throw new Error('unit option must be provided with style: "unit"');if(null===(n=XI[e])||void 0===n||!n[r])throw new Error(`Unsupported unit ${e} with unitDisplay = ${r}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(qI.has(i))return qI.get(i);let o=new Intl.NumberFormat(e,t);return qI.set(i,o),o}(e,t),this.options=t}}let ZI=new VI(function(e){return e&&e.__esModule?e.default:e}(pI));const QI=[[0,"pink"],[15,"red"],[48,"orange"],[94,"yellow"],[135,"green"],[175,"cyan"],[264,"blue"],[284,"purple"],[320,"magenta"],[349,"pink"]];class JI{toHexInt(){return this.toFormat("rgb").toHexInt()}getChannelValue(e){if(e in this)return this[e];throw new Error("Unsupported color channel: "+e)}withChannelValue(e,t){if(e in this){let r=this.clone();return r[e]=t,r}throw new Error("Unsupported color channel: "+e)}getChannelName(e,t){return(VI.getGlobalDictionaryForPackage("@react-stately/color")||ZI).getStringForLocale(e,t)}getColorSpaceAxes(e){let{xChannel:t,yChannel:r}=e,n=t||this.getColorChannels().find(e=>e!==r),i=r||this.getColorChannels().find(e=>e!==n),o=this.getColorChannels().find(e=>e!==n&&e!==i);return{xChannel:n,yChannel:i,zChannel:o}}getColorName(e){let t,[r,n,i]=aj(this),o=VI.getGlobalDictionaryForPackage("@react-stately/color")||ZI;if(r>.999)return o.getStringForLocale("white",e);if(r<.001)return o.getStringForLocale("black",e);[t,r]=this.getOklchHue(r,n,i,e);let a="",s="";n<=.1&&n>=.001?s=r>=.7?"pale":"grayish":n>=.15&&(s="vibrant"),r<.3?a="very dark":r<.55?a="dark":r<.7||(a=r<.85?"light":"very light"),s&&(s=o.getStringForLocale(s,e)),a&&(a=o.getStringForLocale(a,e));let l=this.getChannelValue("alpha"),c=new $I(e,o);if(l<1){let r=new KI(e,{style:"percent"}).format(1-l);return c.format("transparentColorName",{lightness:a,chroma:s,hue:t,percentTransparent:r}).replace(/\s+/g," ").trim()}return c.format("colorName",{lightness:a,chroma:s,hue:t}).replace(/\s+/g," ").trim()}getOklchHue(e,t,r,n){let i=VI.getGlobalDictionaryForPackage("@react-stately/color")||ZI;if(t<.001)return[i.getStringForLocale("gray",n),e];for(let o=0;o<QI.length;o++){let[t,a]=QI[o],[s,l]=QI[o+1]||[360,"pink"];if(r>=t&&r<s)return"orange"===a&&(e<.68?a="brown":e=e-.68+.55),r>t+(s-t)/2&&a!==l?a=`${a} ${l}`:"yellow"===a&&e<.85&&(a="yellow green"),[i.getStringForLocale(a,n).toLocaleLowerCase(n),e]}throw new Error("Unexpected hue")}getHueName(e){let[t,r,n]=aj(this),[i]=this.getOklchHue(t,r,n,e);return i}}class ej extends JI{static parse(e){let t=[];if(/^#[\da-f]+$/i.test(e)&&[4,5,7,9].includes(e.length)){const r=(e.length<6?e.replace(/[^#]/gi,"$&$&"):e).slice(1).split("");for(;r.length>0;)t.push(parseInt(r.splice(0,2).join(""),16));t[3]=void 0!==t[3]?t[3]/255:void 0}const r=e.match(/^rgba?\((.*)\)$/);var n;return null!=r&&r[1]&&(t=r[1].split(",").map(e=>Number(e.trim())),t=t.map((e,t)=>Xw(e,0,t<3?255:1))),t.length<3?void 0:new ej(t[0],t[1],t[2],null!==(n=t[3])&&void 0!==n?n:1)}toString(e="css"){switch(e){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(255*this.alpha).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hex":case"hexa":case"rgb":case"rgba":return this;case"hsb":case"hsba":return this.toHSB();case"hsl":case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const e=this.red/255,t=this.green/255,r=this.blue/255,n=Math.min(e,t,r),i=Math.max(e,t,r),o=i-n,a=0===i?0:o/i;let s=0;if(0!==o){switch(i){case e:s=(t-r)/o+(t<r?6:0);break;case t:s=(r-e)/o+2;break;case r:s=(e-t)/o+4}s/=6}return new rj(Zw(360*s,2),Zw(100*a,2),Zw(100*i,2),this.alpha)}toHSL(){const e=this.red/255,t=this.green/255,r=this.blue/255,n=Math.min(e,t,r),i=Math.max(e,t,r),o=(i+n)/2,a=i-n;let s,l;if(0===a)s=l=0;else{switch(l=a/(o<.5?i+n:2-i-n),i){case e:s=(t-r)/a+(t<r?6:0);break;case t:s=(r-e)/a+2;break;case r:s=(e-t)/a+4}s/=6}return new oj(Zw(360*s,2),Zw(100*l,2),Zw(100*o,2),this.alpha)}clone(){return new ej(this.red,this.green,this.blue,this.alpha)}getChannelRange(e){switch(e){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let r=this.getChannelFormatOptions(e),n=this.getChannelValue(e);return new KI(t,r).format(n)}getColorSpace(){return"rgb"}getColorChannels(){return ej.colorChannels}constructor(e,t,r,n){super(),this.red=e,this.green=t,this.blue=r,this.alpha=n}}ej.colorChannels=["red","green","blue"];const tj=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;class rj extends JI{static parse(e){let t;if(t=e.match(tj)){var r;const[e,n,i,o]=(null!==(r=t[1])&&void 0!==r?r:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new rj(ij(e,360),Xw(n,0,100),Xw(i,0,100),Xw(o??1,0,1))}}toString(e="css"){switch(e){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${Zw(this.saturation,2)}%, ${Zw(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${Zw(this.saturation,2)}%, ${Zw(this.brightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsb":case"hsba":return this;case"hsl":case"hsla":return this.toHSL();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+e)}}toHSL(){let e=this.saturation/100,t=this.brightness/100,r=t*(1-e/2);return e=0===r||1===r?0:(t-r)/Math.min(r,1-r),new oj(Zw(this.hue,2),Zw(100*e,2),Zw(100*r,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,r=this.brightness/100,n=(n,i=(n+e/60)%6)=>r-t*r*Math.max(Math.min(i,4-i,1),0);return new ej(Math.round(255*n(5)),Math.round(255*n(3)),Math.round(255*n(1)),this.alpha)}clone(){return new rj(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let r=this.getChannelFormatOptions(e),n=this.getChannelValue(e);return("saturation"===e||"brightness"===e)&&(n/=100),new KI(t,r).format(n)}getColorSpace(){return"hsb"}getColorChannels(){return rj.colorChannels}constructor(e,t,r,n){super(),this.hue=e,this.saturation=t,this.brightness=r,this.alpha=n}}rj.colorChannels=["hue","saturation","brightness"];const nj=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;function ij(e,t){return(e%t+t)%t}class oj extends JI{static parse(e){let t;if(t=e.match(nj)){var r;const[e,n,i,o]=(null!==(r=t[1])&&void 0!==r?r:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new oj(ij(e,360),Xw(n,0,100),Xw(i,0,100),Xw(o??1,0,1))}}toString(e="css"){switch(e){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${Zw(this.saturation,2)}%, ${Zw(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${Zw(this.saturation,2)}%, ${Zw(this.lightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsl":case"hsla":return this;case"hsb":case"hsba":return this.toHSB();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+e)}}toHSB(){let e=this.saturation/100,t=this.lightness/100,r=t+e*Math.min(t,1-t);return e=0===r?0:2*(1-t/r),new rj(Zw(this.hue,2),Zw(100*e,2),Zw(100*r,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,r=this.lightness/100,n=t*Math.min(r,1-r),i=(t,i=(t+e/30)%12)=>r-n*Math.max(Math.min(i-3,9-i,1),-1);return new ej(Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4)),this.alpha)}clone(){return new oj(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let r=this.getChannelFormatOptions(e),n=this.getChannelValue(e);return("saturation"===e||"lightness"===e)&&(n/=100),new KI(t,r).format(n)}getColorSpace(){return"hsl"}getColorChannels(){return oj.colorChannels}constructor(e,t,r,n){super(),this.hue=e,this.saturation=t,this.lightness=r,this.alpha=n}}function aj(e){let t=e.toFormat("rgb"),r=t.getChannelValue("red")/255,n=t.getChannelValue("green")/255,i=t.getChannelValue("blue")/255;[r,n,i]=function(e,t,r){return[sj(e),sj(t),sj(r)]}(r,n,i);let[o,a,s]=function(e,t,r){return lj([.4123907992659595,.35758433938387796,.1804807884018343,.21263900587151036,.7151686787677559,.07219231536073371,.01933081871559185,.11919477979462599,.9505321522496606],e,t,r)}(r,n,i),[l,c,u]=function(e,t,r){let[n,i,o]=lj([.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],e,t,r);return lj([.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],Math.cbrt(n),Math.cbrt(i),Math.cbrt(o))}(o,a,s);return function(e,t,r){var n=180*Math.atan2(r,t)/Math.PI;return[e,Math.sqrt(t**2+r**2),n>=0?n:n+360]}(l,c,u)}function sj(e){let t=e<0?-1:1,r=Math.abs(e);return r<=.04045?e/12.92:t*Math.pow((r+.055)/1.055,2.4)}function lj(e,t,r,n){return[e[0]*t+e[1]*r+e[2]*n,e[3]*t+e[4]*r+e[5]*n,e[6]*t+e[7]*r+e[8]*n]}function cj({onChange:e,value:t,colors:r}){const n=r.map(r=>{const n=t===r;return(0,i.jsx)(SC,{onClick:()=>{null==e||e(r)},className:gh("relative block flex-shrink-0 w-26 h-26 border rounded",n&&"shadow-md"),style:{backgroundColor:r},children:n&&(0,i.jsx)("span",{className:"absolute inset-0 m-auto rounded-full w-8 h-8 bg-white"})},r)});return(0,i.jsx)("div",{className:"flex flex-wrap gap-6",children:n})}oj.colorChannels=["hue","saturation","lightness"];const uj=[{color:"rgb(255, 255, 255)",name:sh("White")},{color:"rgb(239,245,245)",name:sh("Solitude")},{color:"rgb(245,213,174)",name:sh("Wheat")},{color:"rgb(253,227,167)",name:sh("Cape Honey")},{color:"rgb(242,222,186)",name:sh("Milk punch")},{color:"rgb(97,118,75)",name:sh("Dingy"),foreground:"rgb(255, 255, 255)"},{color:"rgb(4, 147, 114)",name:sh("Aquamarine"),foreground:"rgb(255, 255, 255)"},{color:"rgb(222,245,229)",name:sh("Cosmic Latte")},{color:"rgb(233,119,119)",name:sh("Geraldine"),foreground:"rgb(90,14,14)"},{color:"rgb(247,164,164)",name:sh("Sundown")},{color:"rgb(30,139,195)",name:sh("Pelorous"),foreground:"rgb(255, 255, 255)"},{color:"rgb(142,68,173)",name:sh("Deep Lilac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(108,74,182)",name:sh("Blue marguerite"),foreground:"rgb(255, 255, 255)"},{color:"rgb(139,126,116)",name:sh("Americano"),foreground:"rgb(255, 255, 255)"},{color:"rgb(0,0,0)",name:sh("Black"),foreground:"rgb(255, 255, 255)"},{color:"rgb(64,66,88)",name:sh("Blue zodiac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(101,100,124)",name:sh("Comet"),foreground:"rgb(255, 255, 255)"}].map(({color:e})=>e).slice(0,14);function dj({defaultValue:e,onChange:t,colorPresets:r,showInput:n}){const[a,s]=(0,o.useState)(e),l=r||uj,c=pA({size:"sm"});return(0,i.jsxs)("div",{children:[(0,i.jsx)(PI,{className:"!w-auto",color:a,onChange:e=>{null==t||t(e),s(e)}}),(0,i.jsxs)("div",{className:"px-12 py-20",children:[l&&(0,i.jsx)(cj,{colors:l,onChange:e=>{if(e){const r=function(e){let t=ej.parse(e)||rj.parse(e)||oj.parse(e);if(t)return t;throw new Error("Invalid color value: "+e)}(e).toString("hex");null==t||t(r),s(r)}},value:a}),n&&(0,i.jsx)("div",{className:"pt-20",children:(0,i.jsx)(DI,{autoComplete:"off",role:"textbox",autoCorrect:"off",spellCheck:"false",required:!0,"aria-label":"Hex color",prefixed:!0,className:c.input,color:a,onChange:e=>{null==t||t(e),s(e)}})})]})]})}const hj=o.createContext(null);function fj(){return(0,o.useContext)(hj)}function pj(){const{lines:e,localeCode:t}=BS();return{trans:(0,o.useCallback)(r=>gj({...r,lines:e,localeCode:t}),[e,t])}}const gj=PC(e=>{let{lines:t,message:r,values:n,localeCode:i}=e;return null==r?"":(r=(null==t?void 0:t[r])||(null==t?void 0:t[r.toLowerCase()])||r,n&&(r=US(i,e),Object.entries(n).forEach(([e,t])=>{r=r.replace(`:${e}`,`${t}`)})),r)},{equals:zS,callTimeout:0});function mj({onDismiss:e}){const{trans:t}=pj();return(0,i.jsx)("button",{className:"sr-only","aria-label":t(sh("Dismiss")),tabIndex:-1,onClick:()=>{e&&e()}})}function vj(e){const{type:t="modal",dialogProps:r,...n}=(0,o.useContext)(hj),{children:a,className:s,size:l="md",background:c,radius:u="rounded",maxWidth:d="max-w-dialog",...h}=e;let f=null;("popover"===t||"tray"===t)&&(f=(0,i.jsx)(mj,{onDismiss:n.close}));const p="fullscreenTakeover"===l||"tray"===t,g=gh("mx-auto pointer-events-auto outline-none flex flex-col overflow-hidden",c||"bg","tray"!==t&&function(e){switch(e){case"2xs":return"w-256";case"xs":return"w-320";case"sm":return"w-384";case"md":return"w-440";case"lg":return"w-620";case"xl":return"w-780";case"2xl":return"w-850";case"fullscreen":return"w-1280";case"fullscreenTakeover":return"w-full h-full";default:return e}}(l),"tray"===t&&"rounded-t border-b-bg","fullscreenTakeover"!==l&&"shadow-2xl border max-h-dialog",!p&&`${u} ${d}`,s);return(0,i.jsxs)("div",{...Nw({role:"dialog",tabIndex:-1},r,h),style:{...e.style,"--be-dialog-padding":"24px"},"aria-modal":!0,className:g,children:[o.Children.toArray(a).map(e=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{size:e.props.size??l}):e),f]})}const yj=yh((0,i.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDownOutlined"),bj=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:r=!0,isDismissable:n=!0,isOpen:o=!1,placement:a="center",onClose:s},l)=>{const c=OS(),u=$w(l);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-modal",style:c,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),s())},children:[(0,i.jsx)(NS,{onClick:()=>{n&&s()}},"modal-underlay"),(0,i.jsx)(gw.div,{ref:u,className:gh("pointer-events-none absolute inset-0 z-20 flex h-full w-full","center"===a&&"items-center justify-center","top"===a&&"items-start justify-center pt-40"),role:"presentation",initial:{opacity:0,scale:"top"===a?1:.7},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1},transition:{duration:.1},children:(0,i.jsx)(mS,{restoreFocus:r,autoFocus:t,contain:!0,children:e})})]})});function wj(e){let{children:t,type:r,disableInitialTransition:n,isDismissable:a=!0,moveFocusToDialog:s=!0,returnFocusToTrigger:l=!0,triggerOnHover:c=!1,triggerOnContextMenu:u=!1,usePortal:d=!0,mobileType:h,alwaysReturnCurrentValueOnClose:f}=e;const p=(0,o.useRef)(null),g=u&&!e.triggerRef?p:e.triggerRef,m=(0,o.useRef)(e.value),[v,y]=Yw(e.isOpen,e.defaultIsOpen,e.onOpenChange),[b,w]=Yw(e.value,e.defaultValue,e.onValueChange);ZS()&&"popover"===r&&(r=h||"modal");const x=(0,o.useRef)(null),{x:C,y:_,reference:S,strategy:A,refs:k}=Q_({...e,disablePositioning:"modal"===r}),E="popover"===r?{position:A,top:_??"",left:C??""}:{},I=(0,o.useId)(),j=`${I}-label`,T=`${I}-description`,F=`${I}-form`,O=function(e){const t=(0,o.useRef)(e);return(0,o.useEffect)(()=>{t.current=e}),(0,o.useMemo)(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}(e.onClose),M=(0,o.useCallback)(e=>{typeof e>"u"&&f&&(e=b);const t=typeof e<"u"?e:m.current;null==O||O(t,{initialValue:m.current,valueChanged:t!==m.current}),y(!1)},[O,y,b,f]),P=(0,o.useCallback)(()=>{y(!0),m.current=e.value},[e.value,y]);kw(()=>{null!=g&&g.current&&k.reference.current!==g.current&&S(g.current)},[S,null==g?void 0:g.current,k]);const R=(0,o.useMemo)(()=>({"aria-labelledby":j,"aria-describedby":T}),[j,T]);let L;L="modal"===r?bj:"tray"===r?DS:PS;const N=(0,o.useMemo)(()=>({dialogProps:R,type:r,labelId:j,descriptionId:T,isDismissable:a,close:M,value:b,initialValue:m.current,setValue:w,formId:F}),[M,T,R,F,j,r,a,b,w]);c=c&&"popover"===r;const D={onPointerEnter:_C(e=>{P()}),onPointerLeave:_C(e=>{x.current=setTimeout(()=>{M()},150)})},z={onPointerEnter:_C(e=>{x.current&&clearTimeout(x.current)}),onPointerLeave:_C(e=>{M()})},B={onContextMenu:_C(e=>{e.preventDefault(),p.current=function({x:e,y:t},r){return{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,right:e,bottom:t,left:e}),contextElement:r}}({x:e.clientX,y:e.clientY},e.currentTarget),P()})},U={onClick:_C(e=>{e.stopPropagation(),v?M():P()})},{dialogTrigger:V,dialog:H}=function(e,t){const r=Array.isArray(e)?e:o.Children.toArray(e);let n=2===r.length?r[1]:r[0];return n="function"==typeof n?n(t):n,2===r.length?{dialogTrigger:r[0],dialog:n}:{dialog:n}}(t,N),W=(0,i.jsx)(Cw,{initial:!n,children:v&&(0,i.jsx)(hj.Provider,{value:N,children:(0,i.jsx)(L,{...c?z:{},ref:k.setFloating,triggerRef:k.reference,style:E,restoreFocus:l,autoFocus:s,isOpen:v,onClose:M,isDismissable:a,isContextMenu:u,placement:e.placement,children:H})})});return(0,i.jsxs)(o.Fragment,{children:[V&&(0,o.cloneElement)(V,Nw({...g||u?{}:{ref:S},...u?{}:U,...c?D:{},...u?B:{}},{...V.props})),d?xg&&(0,le.createPortal)(W,xg):W]})}function xj(e){const{label:t,className:r,value:n,onChange:a,size:s,width:l="w-max"}=e,c=Eg(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.colorPresets)?void 0:r.items})||[],u=pA({size:s}),[d,h]=(0,o.useState)(n),[f,p]=(0,o.useState)(!1);return(0,i.jsxs)("div",{className:gh(r,l),children:[t&&(0,i.jsx)("span",{className:u.label,children:t}),(0,i.jsxs)(wj,{type:"popover",isOpen:f,onOpenChange:p,children:[(0,i.jsxs)(SC,{className:gh(u.input,"inline-flex items-center"),"aria-label":e["aria-label"],children:[(0,i.jsx)("span",{className:"block flex-shrink-0 mr-5 border rounded h-2/4 aspect-square",style:{backgroundColor:d}}),(0,i.jsx)(Cj,{isActive:f,className:u.adornment})]}),(0,i.jsx)(vj,{size:"auto",children:(0,i.jsx)(dj,{onChange:e=>{h(e),null==a||a(e)},defaultValue:d,colorPresets:c})})]})]})}function Cj({isActive:e,className:t}){return(0,i.jsx)(yj,{size:"sm",className:`transition-transform ml-auto flex-shrink-0 ${e?"rotate-180":"rotate-0"} ${t}`})}function _j(e){const{size:t="md",inline:r,label:n,showValueLabel:o=!!n,className:a,width:s="w-full",slider:l,children:c,trackColor:u="primary",fillColor:d="primary"}=e,{domProps:h,trackRef:f,getThumbPercent:p,getThumbValueLabel:g,labelId:m,groupId:v,thumbIds:y,isDisabled:b,numberFormatter:w,minValue:x,maxValue:C,step:_,values:S,getValueLabel:A}=l;let k="",E=Math.max([...w.format(x)].length,[...w.format(C)].length,[...w.format(_)].length);A?k=A(S[0]):1===S.length?k=g(0):2===S.length&&(k=`${g(0)} \u2013 ${g(1)}`,E=3+2*Math.max(E,[...w.format(x)].length,[...w.format(C)].length));const I=pA({size:t,disabled:b,labelDisplay:"flex"}),j=gh("touch-none",a,s,{"flex items-center":r});return(0,i.jsxs)("div",{className:j,role:"group",id:v,children:[(n||o)&&(0,i.jsxs)("div",{className:gh(I.label,"select-none"),children:[n&&(0,i.jsx)("label",{onClick:()=>{var e;null==(e=document.getElementById(y[0]))||e.focus()},id:m,htmlFor:v,children:n}),o&&(0,i.jsx)("output",{htmlFor:y[0],className:"ml-auto text-right","aria-live":"off",style:E?{width:`${E}ch`,minWidth:`${E}ch`}:void 0,children:k})]}),(0,i.jsxs)("div",{ref:f,className:gh("relative",Sj(e)),...h,role:"presentation",children:[(0,i.jsx)("div",{className:gh("absolute inset-0 m-auto rounded",kj(u,b),Aj(t))}),(0,i.jsx)("div",{className:gh("absolute inset-0 my-auto rounded",Ej(d,b),Aj(t)),style:{width:`${Math.max(100*p(0),0)}%`}}),c]})]})}function Sj({size:e,wrapperHeight:t}){if(t)return t;switch(e){case"xs":return"h-14";case"sm":return"h-20";default:return"h-30"}}function Aj(e){switch(e){case"xs":return"h-2";case"sm":return"h-3";default:return"h-4"}}function kj(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled/60";case"primary":return"bg-primary-light";case"neutral":return"bg-divider";default:return e}}function Ej(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled";case"primary":return"bg-primary";default:return e}}function Ij(e={}){const{localeCode:t}=BS();return(0,o.useMemo)(()=>new KI(t,e),[t,e])}function jj({minValue:e=0,maxValue:t=100,isDisabled:r=!1,step:n=1,formatOptions:i,onChangeEnd:a,onPointerDown:s,label:l,getValueLabel:c,showThumbOnHoverOnly:u,thumbSize:d,onPointerMove:h,...f}){const[p,g]=(0,o.useState)(!1),m=Ij(i),{addGlobalListener:v,removeGlobalListener:y}=Ww(),b=(0,o.useRef)(null),[w,x]=Yw(f.value?f.value:void 0,f.defaultValue??[e],f.onChange),C=(0,o.useRef)(null);C.current=w;const[_,S]=(0,o.useState)(new Array(w.length).fill(!1)),A=(0,o.useRef)(null);A.current=_;const k=t=>0===t?e:w[t-1],E=e=>e===w.length-1?t:w[e+1],I=(e,t)=>{!r&&R(e)&&C.current&&(t=function(e,t,r,n){t=Number(t),r=Number(r);let i=(e-(isNaN(t)?0:t))%n,o=Kw(2*Math.abs(i)>=n?e+Math.sign(i)*(n-Math.abs(i)):e-i,n);return isNaN(t)?!isNaN(r)&&o>r&&(o=Math.floor(Kw(r/n,n))*n):o<t?o=t:!isNaN(r)&&o>r&&(o=t+Math.floor(Kw((r-t)/n,n))*n),o=Kw(o,n),o}(t,k(e),E(e),n),C.current=Tj(C.current,e,t),x(C.current))},j=(e,t)=>{var n;if(r||!R(e))return;const i=null==(n=A.current)?void 0:n[e];A.current=Tj(A.current||[],e,t),S(A.current),a&&i&&!A.current.some(Boolean)&&a(C.current||[])},[T,F]=(0,o.useState)(void 0),O=r=>(r=>{const n=Math.min(1,(r-e)/(t-e));return isNaN(n)?0:n})(C.current[r]),M=r=>lE((t=>Math.round((t-e)/n)*n+e)(r*(t-e)+e),e,t),P=(0,o.useRef)(new Array(w.length).fill(!0)),R=e=>P.current[e],L=(0,o.useRef)(null),N=(0,o.useRef)(void 0),D=(0,o.useRef)(null),{domProps:z}=Qk({onPointerDown:e=>{if(("mouse"!==e.pointerType||!(0!==e.button||e.altKey||e.ctrlKey||e.metaKey))&&(null==s||s(),b.current&&!r&&w.every((e,t)=>!_[t]))){const t=b.current.offsetWidth,r=b.current.getBoundingClientRect().left,n=(e.clientX-r)/t,i=M(n);let o;const a=w.findIndex(e=>i-e<0);if(0===a)o=a;else if(-1===a)o=w.length-1;else{const e=w[a-1],t=w[a];o=Math.abs(e-i)<Math.abs(t-i)?a-1:a}o>=0&&R(o)?(e.preventDefault(),L.current=o,F(o),N.current=e.pointerId,j(L.current,!0),I(o,i),v(window,"pointerup",U,!1)):L.current=null}},onMoveStart(){D.current=null},onMove(e,t){var r;const n=(null==(r=b.current)?void 0:r.offsetWidth)||0;if(null==D.current&&(D.current=O(L.current||0)*n),D.current+=t,null!=L.current&&b.current){const e=lE(D.current/n,0,1);((e,t)=>{I(e,M(t))})(L.current,e)}},onMoveEnd(){null!=L.current&&(j(L.current,!1),L.current=null)}}),B=Nw(z,{onPointerEnter:()=>{g(!0)},onPointerLeave:()=>{g(!1)},onPointerMove:e=>{null==h||h(e)}}),U=e=>{e.pointerId===N.current&&(null!=L.current&&(j(L.current,!1),L.current=null),y(window,"pointerup",U,!1))},V=(0,o.useId)(),H=l?`${V}-label`:void 0,W=`${V}-group`,$=[...Array(w.length)].map((e,t)=>`${V}-thumb-${t}`);return{domProps:B,trackRef:b,isDisabled:r,step:n,values:w,minValue:e,maxValue:t,focusedThumb:T,labelId:H,groupId:W,thumbIds:$,numberFormatter:m,getThumbPercent:O,getThumbMinValue:k,getThumbMaxValue:E,getThumbValueLabel:e=>function(e){return m.format(e)}(w[e]),isThumbDragging:e=>{var t;return(null==(t=A.current)?void 0:t[e])||!1},setThumbValue:I,updateDraggedThumbs:j,setThumbEditable:(e,t)=>{P.current[e]=t},setFocusedThumb:F,getValueLabel:c,isPointerOver:p,showThumbOnHoverOnly:u,thumbSize:d}}function Tj(e,t,r){return e[t]===r?e:[...e.slice(0,t),r,...e.slice(t+1)]}function Fj({index:e,slider:t,isDisabled:r,ariaLabel:n,inputRef:a,onBlur:s,fillColor:l="primary"}){const c=$w(a),{addGlobalListener:u,removeGlobalListener:d}=Ww(),{step:h,values:f,focusedThumb:p,labelId:g,thumbIds:m,isDisabled:v,getThumbPercent:y,getThumbMinValue:b,getThumbMaxValue:w,getThumbValueLabel:x,setThumbValue:C,updateDraggedThumbs:_,isThumbDragging:S,setThumbEditable:A,setFocusedThumb:k,isPointerOver:E,showThumbOnHoverOnly:I,thumbSize:j="w-18 h-18"}=t,T=S(e),F=f[e];A(e,!r);const O=r||v,M=(0,o.useCallback)(()=>{c.current&&c.current.focus({preventScroll:!0})},[c]),P=p===e;(0,o.useEffect)(()=>{P&&M()},[P,M]);const R=(0,o.useRef)(void 0),L=t=>{t.pointerId===R.current&&(M(),_(e,!1),d(window,"pointerup",L,!1))},N=gh("outline-none rounded-full top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200",j,!O&&"shadow-md",function({isDisabled:e,isDragging:t,fillColor:r}){return e?"bg-slider-disabled cursor-default":r&&"primary"!==r?r:gh("hover:bg-primary-dark",t?"bg-primary-dark":"bg-primary")}({fillColor:l,isDisabled:O,isDragging:T}),!I||I&&T||E?"visible":"invisible");return(0,i.jsx)("div",{role:"presentation",className:N,style:{left:`${Math.max(100*y(e),0)}%`},onPointerDown:t=>{0!==t.button||t.altKey||t.ctrlKey||t.metaKey||(M(),R.current=t.pointerId,_(e,!0),u(window,"pointerup",L,!1))},children:(0,i.jsx)("input",{id:m[e],onKeyDown:_C(()=>{_(e,!0)}),onKeyUp:_C(()=>{_(e,!1)}),ref:c,tabIndex:O?void 0:0,min:b(e),max:w(e),step:h,value:F,disabled:O,"aria-label":n,"aria-labelledby":g,"aria-orientation":"horizontal","aria-valuetext":x(e),onFocus:()=>{k(e)},onBlur:t=>{k(void 0),_(e,!1),null==s||s(t)},onChange:t=>{C(e,parseFloat(t.target.value))},type:"range",className:"sr-only"})})}function Oj({inputRef:e,onBlur:t,...r}){const{onChange:n,onChangeEnd:o,value:a,defaultValue:s,...l}=r,c={...l,value:null!=a?[a]:void 0,defaultValue:null!=s?[s]:void 0,onChange:e=>{null==n||n(e[0])},onChangeEnd:e=>{null==o||o(e[0])}},u=jj(c);return(0,i.jsx)(_j,{...c,slider:u,children:(0,i.jsx)(Fj,{fillColor:r.fillColor,index:0,slider:u,inputRef:e,onBlur:t})})}const Mj=o.forwardRef((e,t)=>{let{value:r=0,minValue:n=0,maxValue:o=100,size:a="md",isIndeterminate:s=!1,className:l,position:c="relative",trackColor:u,fillColor:d="border-primary",...h}=e;r=lE(r,n,o);const f=function(e){switch(e){case"xs":return"w-20 h-20";case"sm":return"w-24 h-24";case"md":return"w-32 h-32";case"lg":return"w-42 h-42";default:return e}}(a),p=(r-n)/(o-n),g=Ij({style:"percent"});let m="";!s&&!m&&(m=g.format(p));const v={},y={};if(!s){const e=(r-n)/(o-n)*100;let t;e>0&&e<=50?(t=e/50*180-180,v.transform=`rotate(${t}deg)`,y.transform="rotate(-180deg)"):e>50&&(t=(e-50)/50*180-180,v.transform="rotate(0deg)",y.transform=`rotate(${t}deg)`)}return(0,i.jsxs)("div",{...h,"aria-valuenow":s?void 0:r,"aria-valuemin":n,"aria-valuemax":o,"aria-valuetext":s?void 0:m,role:"progressbar",ref:t,className:gh("progress-circle",c,f,s&&"indeterminate",l),children:[(0,i.jsx)("div",{className:gh(f,u,"rounded-full border-4")}),(0,i.jsxs)("div",{className:gh("fills absolute left-0 top-0 h-full w-full",s&&"progress-circle-fills-animate"),children:[(0,i.jsx)(Pj,{circleSize:f,subMaskStyle:v,isIndeterminate:s,className:"rotate-180",fillColor:d,subMaskClassName:gh(s&&"progress-circle-fill-submask-1-animate")}),(0,i.jsx)(Pj,{circleSize:f,subMaskStyle:y,isIndeterminate:s,fillColor:d,subMaskClassName:gh(s&&"progress-circle-fill-submask-2-animate")})]})]})});function Pj({subMaskStyle:e,subMaskClassName:t,className:r,circleSize:n,isIndeterminate:o,fillColor:a}){return(0,i.jsx)("div",{className:gh("absolute h-full w-1/2 origin-[100%] overflow-hidden",r),children:(0,i.jsx)("div",{className:gh("h-full w-full origin-[100%] rotate-180 overflow-hidden",!o&&"transition-transform duration-100",t),style:e,children:(0,i.jsx)("div",{className:gh(n,a,"rounded-full border-4")})})})}function Rj({isLoading:e,icon:t}){const r=(0,o.useRef)(null),{trans:n}=pj(),[a,s]=(0,o.useState)(!1),{state:{isOpen:l,inputValue:c}}=IC(),u=(0,o.useRef)(c);return(0,o.useEffect)(()=>{e&&!a?(null===r.current&&(r.current=setTimeout(()=>{s(!0)},500)),c!==u.current&&(clearTimeout(r.current),r.current=setTimeout(()=>{s(!0)},500))):e||(s(!1),clearTimeout(r.current),r.current=null),u.current=c},[e,a,c]),a&&(l||e)?(0,i.jsx)(Mj,{"aria-label":n({message:"Loading"}),size:"sm",isIndeterminate:!0}):t||(0,i.jsx)(yj,{})}const Lj=o.forwardRef(function(e,t){const r=ZS(),{hideCaret:n,placeholder:o=(0,i.jsx)(WS,{message:"Select an option..."}),selectedValue:a,onItemSelected:s,onOpenChange:l,onInputValueChange:c,onSelectionChange:u,selectionMode:d,minWidth:h="min-w-128",children:f,searchPlaceholder:p,showEmptyMessage:g,showSearchField:m,defaultInputValue:v,inputValue:y,isLoading:b,isAsync:w,valueClassName:x,floatingWidth:C=(r?"auto":"matchTrigger"),..._}=e,S=J_({...e,clearInputOnItemSelection:!0,showEmptyMessage:g||m,floatingWidth:C,selectionMode:"single",role:"listbox",virtualFocus:m},t),{state:{selectedValues:A,isOpen:k,setIsOpen:E,activeIndex:I,setSelectedIndex:j,inputValue:T,setInputValue:F},collections:O,focusItem:M,listboxId:P,reference:R,refs:L,listContent:N,onInputChange:D}=S,{fieldProps:z,inputProps:B}=SA({..._,focusRef:L.reference}),U=O.collection.get(A[0]),V=U?(0,i.jsxs)("span",{className:"flex items-center gap-10",children:[U.element.props.startIcon,(0,i.jsx)("span",{className:gh("overflow-hidden overflow-ellipsis whitespace-nowrap",x),children:U.element.props.children})]}):(0,i.jsx)("span",{className:"italic",children:o}),H=pA({...e,endAdornment:!0}),{handleTriggerKeyDown:W,handleListboxKeyboardNavigation:$,handleListboxSearchFieldKeydown:q}=YS(S),{findMatchingItem:G}=KS();return(0,i.jsx)($S,{listbox:S,onKeyDownCapture:m?void 0:e=>{if(!k)return;const t=G(e,N,I);null!=t&&M("increment",t)},onKeyDown:$,onClose:m?()=>F(""):void 0,isLoading:b,searchField:m&&(0,i.jsx)(AA,{size:"xs"===e.size||"sm"===e.size?"xs":"sm",placeholder:p,startAdornment:(0,i.jsx)(QS,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":k?"true":"false","aria-haspopup":"listbox","aria-controls":k?P:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:T,onChange:D,onKeyDown:e=>{q(e)}}),children:(0,i.jsx)(wA,{fieldClassNames:H,...z,endAdornment:!n&&(0,i.jsx)(Rj,{isLoading:b}),children:(0,i.jsx)("button",{...B,type:"button","data-selected-value":null==U?void 0:U.value,"aria-expanded":k?"true":"false","aria-haspopup":"listbox","aria-controls":k?P:void 0,ref:R,onKeyDown:W,onKeyDownCapture:m?void 0:e=>{if(k)return;const t=G(e,N,I);null!=t&&j(t)},disabled:_.disabled,onClick:()=>{E(!k)},className:gh(H.input,!z.unstyled&&h),children:V})})})});function Nj(){const e=Eg(e=>e.filter.selected);if(!e)return null;const t=jg().filter.getByName(e).options,r=(t,r)=>{var n;null==(n=jg().filter)||n.applyValue(e,t,r),Ig().setDirty(!0)},n=jg().canvas.getMainImage().filters,o=jg().filter.findFilterIndex(e,n),a=null==n?void 0:n[o];if(t){const e=Object.entries(t).map(([e,t])=>{let n;const o=a?a[e]:t.current;return"slider"===t.type?n=(0,i.jsx)(Oj,{label:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(WS,{...kx[e]})}),minValue:t.min,maxValue:t.max,step:t.step,defaultValue:o,formatOptions:{style:"percent"},size:"sm",onChange:t=>{r(e,t)}}):"colorPicker"===t.type?n=(0,i.jsx)(xj,{label:(0,i.jsx)(WS,{...kx[e]}),size:"sm",width:"w-full",value:o,onChange:t=>{r(e,t)}}):"select"===t.type&&(n=(0,i.jsx)(Lj,{selectionMode:"single",size:"sm",label:(0,i.jsx)(WS,{...kx[e]}),defaultValue:o,onSelectionChange:t=>{r(e,t)},children:t.available.map(e=>(0,i.jsx)(OC,{value:e.key,children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(WS,{message:e.key})})},e.key))})),(0,i.jsx)("div",{className:"pb-10",children:n},e)});return(0,i.jsx)(TE,{children:(0,i.jsx)("div",{className:"max-w-240 pt-10 mx-auto",children:e})})}return null}function Dj(){const e=Eg(e=>e.frame.active),t="basic"===(null==e?void 0:e.mode),r=(0,o.useCallback)(e=>`${e}%`,[]);return(0,i.jsx)(TE,{className:"pb-18 pt-6",children:(0,i.jsxs)("div",{className:"max-w-288 m-auto",children:[t&&(0,i.jsx)(xj,{className:"mb-20",width:"w-full",size:"sm",label:(0,i.jsx)(WS,{message:"Color"}),value:jg().frame.builder.defaultColor,onChange:e=>{jg().frame.active.changeColor(e)}}),(0,i.jsx)(Oj,{size:"sm",label:(0,i.jsx)(WS,{message:"Size"}),step:1,minValue:jg().frame.active.getMinSize(),maxValue:jg().frame.active.getMaxSize(),defaultValue:jg().frame.active.currentSizeInPercent,getValueLabel:r,onChange:e=>{jg().frame.resize(e)}})]})})}const zj=o.createContext(null);function Bj(){const{tabsRef:e,selectedTab:t}=(0,o.useContext)(zj),[r,n]=(0,o.useState)({width:void 0,transform:void 0,className:void 0});return kw(()=>{if(null!=t&&e.current){const r=e.current[t];if(!r)return;n(e=>({width:`${r.offsetWidth}px`,transform:`translateX(${r.offsetLeft}px)`,className:void 0===e.width?"":"transition-all"}))}},[n,t,e]),(0,i.jsx)("div",{className:gh("absolute bottom-0 left-0 h-2 bg-primary",r.className),role:"presentation",style:{width:r.width,transform:r.transform}})}function Uj({children:e,center:t,expand:r,className:n}){const a=o.Children.toArray(e);return(0,i.jsx)(mS,{children:(0,i.jsxs)("div",{className:gh("flex relative max-w-full overflow-auto border-b max-sm:hidden-scrollbar md:compact-scrollbar",n),role:"tablist","aria-orientation":"horizontal",children:[a.map((e,n)=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{index:n,className:gh(e.props.className,r&&"flex-auto",t&&0===n&&"ml-auto",t&&n===a.length-1&&"mr-auto")}):null),(0,i.jsx)(Bj,{})]})})}function Vj(e){const{size:t="md",children:r,className:n,isLazy:a,overflow:s="overflow-hidden"}=e,l=(0,o.useRef)([]),c=(0,o.useId)(),[u,d]=Yw(e.selectedTab,e.defaultSelectedTab||0,e.onTabChange),h=(0,o.useMemo)(()=>({selectedTab:u,setSelectedTab:d,tabsRef:l,size:t,isLazy:a,id:c}),[u,c,a,d,t]);return(0,i.jsx)(zj.Provider,{value:h,children:(0,i.jsx)("div",{className:gh(n,s,"max-w-full"),children:r})})}const Hj=yh((0,i.jsx)("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}),"FormatUnderlinedOutlined"),Wj=yh((0,i.jsx)("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"}),"FormatStrikethroughOutlined"),$j=yh((0,i.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"}),"FormatItalicOutlined"),qj=yh((0,i.jsx)("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}),"FormatAlignRightOutlined"),Gj=yh((0,i.jsx)("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}),"FormatAlignLeftOutlined"),Yj=yh((0,i.jsx)("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}),"FormatAlignCenterOutlined");function Xj(){return(0,i.jsxs)("div",{className:"flex gap-20 justify-center",children:[(0,i.jsx)(Kj,{}),(0,i.jsx)(Zj,{}),(0,i.jsx)(Qj,{})]})}function Kj(){const e=Eg(e=>e.objects.active.editableProps.fontSize)??40,{trans:t}=pj();return(0,i.jsx)(AA,{type:"number",size:"xs","aria-label":t({message:"Font Size"}),min:1,max:300,className:"w-64 flex-shrink-0",value:e,onChange:e=>{jg().objects.setValues({fontSize:e.target.valueAsNumber}),Ig().setDirty(!0)}})}function Zj(){const e=Eg(e=>e.objects.active.editableProps.fontStyle),t=Eg(e=>e.objects.active.editableProps.underline),r=Eg(e=>e.objects.active.editableProps.linethrough),[n,a]=(0,o.useState)([e,t&&"underline",r&&"linethrough"]);return(0,i.jsxs)(RA,{size:"xs",variant:"outline",radius:"rounded",value:n,multiple:!0,onChange:e=>{a(e),jg().objects.setValues({underline:e.includes("underline"),linethrough:e.includes("linethrough"),fontStyle:e.includes("italic")?"italic":""}),Ig().setDirty(!0)},children:[(0,i.jsx)(jA,{value:"underline",children:(0,i.jsx)(Hj,{})}),(0,i.jsx)(jA,{value:"linethrough",children:(0,i.jsx)(Wj,{})}),(0,i.jsx)(jA,{value:"italic",children:(0,i.jsx)($j,{})})]})}function Qj(){const e=Eg(e=>e.objects.active.editableProps.textAlign);return(0,i.jsxs)(RA,{size:"xs",variant:"outline",radius:"rounded",value:e,onChange:e=>{jg().objects.setValues({textAlign:e}),Ig().setDirty(!0)},children:[(0,i.jsx)(jA,{value:"left",children:(0,i.jsx)(Gj,{})}),(0,i.jsx)(jA,{value:"center",children:(0,i.jsx)(Yj,{})}),(0,i.jsx)(jA,{value:"right",children:(0,i.jsx)(qj,{})})]})}function Jj({children:e,className:t}){const{selectedTab:r,isLazy:n}=(0,o.useContext)(zj),a=o.Children.toArray(e).filter(e=>!!e);let s;if(n){const e=a[r];s=(0,o.isValidElement)(e)?(0,o.cloneElement)(a[r],{index:r}):null}else s=a.map((e,t)=>{if((0,o.isValidElement)(e)){const n=t===r;return(0,o.cloneElement)(e,{index:t,"aria-hidden":!n,className:n?e.props.className:gh(e.props.className,"hidden")})}return null});return(0,i.jsx)("div",{className:t,children:s})}function eT({className:e,children:t,index:r,...n}){const{id:a}=(0,o.useContext)(zj),[s,l]=(0,o.useState)(0),c=(0,o.useRef)(null);return kw(()=>{if(null!=c&&c.current){const e=()=>{const e=IS(c.current,{tabbable:!0});l(e.nextNode()?void 0:0)};e();const t=new MutationObserver(e);return t.observe(c.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{t.disconnect()}}},[c]),(0,i.jsx)("div",{tabIndex:s,ref:c,id:`${a}-${r}-tabpanel`,"aria-labelledby":`${a}-${r}-tab`,className:gh(e,"focus-visible:outline-primary-light"),role:"tabpanel",...n,children:t})}const tT=[{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{color:"#ffe47b",offset:0},{color:"rgb(111,154,211)",offset:1}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{color:"#ff4040",offset:0},{color:"#e6399b",offset:1}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#200772"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#FF4F4F"},{offset:1,color:"rgb(255, 239, 64)"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:20,y2:20},colorStops:[{offset:0,color:"#ffe47b"},{offset:.5,color:"rgb(111,154,211)"},{offset:1,color:"rgb(166,111,213)"}]},{type:"radial",coords:{r1:50,r2:80,x1:45,y1:45,x2:52,y2:50},colorStops:[{offset:0,color:"rgb(155, 237, 0)"},{offset:1,color:"rgba(0, 164, 128,0.4)"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"#9ecb2d"},{offset:.5,color:"#72aa00"},{offset:1,color:"#bfd255"}]},{type:"radial",coords:{r1:100,r2:50,x1:30,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#aebcbf"},{offset:1,color:"#0a0809"}]},{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{offset:0,color:"#ffffff"},{offset:1,color:"#f6f6f6"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#fefcea"},{offset:1,color:"#f1da36"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#ff1a00"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#b7deed"},{offset:1,color:"#21b4e2"}]},{type:"linear",coords:{x1:-80,y1:100,x2:80,y2:-100},colorStops:[{offset:0,color:"#ffe47b"},{offset:1,color:"rgb(111,154,211)"}]}],rT=yh((0,i.jsx)("path",{d:"M19.51 3.08 3.08 19.51c.09.34.27.65.51.9.25.24.56.42.9.51L20.93 4.49c-.19-.69-.73-1.23-1.42-1.41zM11.88 3 3 11.88v2.83L14.71 3h-2.83zM5 3c-1.1 0-2 .9-2 2v2l4-4H5zm14 18c.55 0 1.05-.22 1.41-.59.37-.36.59-.86.59-1.41v-2l-4 4h2zm-9.71 0h2.83L21 12.12V9.29L9.29 21z"}),"TextureOutlined"),nT=yh((0,i.jsx)("path",{d:"M11 9h2v2h-2V9zm-2 2h2v2H9v-2zm4 0h2v2h-2v-2zm2-2h2v2h-2V9zM7 9h2v2H7V9zm12-6H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 18H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm2-7h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2H9v-2H7v2H5v-2h2v-2H5V5h14v6z"}),"GradientOutlined"),iT=yh((0,i.jsx)("path",{d:"M18 20H4V6h9V4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2v9zm-7.79-3.17-1.96-2.36L5.5 18h11l-3.54-4.71zM20 4V1h-2v3h-3c.01.01 0 2 0 2h3v2.99c.01.01 2 0 2 0V6h3V4h-3z"}),"AddPhotoAlternateOutlined");function oT({property:e}){const{trans:t}=pj(),r=Eg(t=>t.objects.active.editableProps[e]);return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-14",children:[(0,i.jsx)(xj,{className:"flex-shrink-0",size:"xs","aria-label":t({message:"Color"}),value:"string"==typeof r?r:ch.fill,onChange:t=>{jg().objects.setValues({[e]:t}),Ig().setDirty(!0)}}),(0,i.jsx)(aT,{type:"gradient",property:e}),(0,i.jsx)(aT,{type:"texture",property:e})]})}function aT({type:e,property:t}){return(0,i.jsx)(o.Fragment,{children:(0,i.jsxs)(wj,{type:"popover",children:[(0,i.jsx)(AC,{className:"flex-shrink-0",id:`${e}-panel-trigger`,variant:"outline",size:"xs",startIcon:(0,i.jsx)("texture"===e?rT:nT,{}),endIcon:(0,i.jsx)(yj,{}),children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)(WS,"gradient"===e?{message:"Gradient"}:{message:"Texture"})})}),(0,i.jsx)(vj,{size:"auto",children:(0,i.jsx)("div",{className:"grid gap-8 grid-cols-5-min-content p-10 bg-paper rounded shadow-md",children:(0,i.jsx)(sT,{property:t,type:e})})})]})})}function sT({type:e,property:t}){const{close:r}=fj(),n=Array.from(Array("gradient"===e?tT.length:28).keys()),a="w-56 h-56 bg border shadow-sm hover:scale-110",s=n.map(n=>{const o=vx(`images/${e}s/${n}.png`);return(0,i.jsx)(SC,{radius:"rounded",className:a,style:{backgroundImage:`url(${o})`},"aria-label":`Select ${e} #${n}`,onClick:async()=>{r();const i="gradient"===e?new Qw.fabric.Gradient(tT[n]):await cT(o);jg().objects.setValues({[t]:i}),Ig().setDirty(!0)}},n)});return"texture"===e&&s.unshift((0,i.jsx)(lT,{property:t,className:a},"upload-btn")),(0,i.jsx)(o.Fragment,{children:s})}function lT({className:e,property:t}){const{close:r}=fj();return(0,i.jsx)(SC,{radius:"rounded",className:e,"aria-label":"Upload an image",onClick:async()=>{const e=await jg().import.openUploadWindow();if(r(),e){const r=await cT(await e.data);jg().objects.setValues({[t]:r})}},children:(0,i.jsx)(iT,{className:"icon-md"})})}function cT(e){return new Promise(t=>{Qw.fabric.util.loadImage(e,e=>{const r=new Qw.fabric.Pattern({source:e,repeat:"repeat"});t(r)})})}function uT(){const e=Eg(e=>e.objects.active.editableProps.opacity);return(0,i.jsx)(Oj,{className:"max-w-240 w-full mx-auto","aria-label":"Opacity",value:e,minValue:.1,step:.1,maxValue:1,onChange:e=>{jg().objects.setValues({opacity:e}),Ig().setDirty(!0)}})}function dT(){const{trans:e}=pj(),t=Eg(e=>e.objects.active.editableProps.stroke),r=Eg(e=>e.objects.active.editableProps.strokeWidth);return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(xj,{className:"ml-auto flex-shrink-0",size:"xs",value:t,"aria-label":e({message:"Outline Color"}),onChange:e=>{jg().objects.setValues({stroke:e}),Ig().setDirty(!0)}}),(0,i.jsx)(Oj,{"aria-label":"Outline Width",className:"max-w-240 mr-auto flex-shrink-0",value:r,onChange:e=>{jg().objects.setValues({strokeWidth:e}),Ig().setDirty(!0)}})]})}const hT=yh((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}),"ImageOutlined");function fT(){return(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(AC,{type:"button",variant:"outline",size:"xs",startIcon:(0,i.jsx)(hT,{}),radius:"rounded-full",onClick:async()=>{const e=await jg().import.openUploadWindow();if(e){const t=jg().objects.getActive();if(t&&"setSrc"in t){const r=await e.data;t.setSrc(r,()=>{cx({src:r}),jg().canvas.render()})}}},children:(0,i.jsx)(WS,{message:"Replace Image"})})})}const pT={color:"rgba(0, 0, 0, 0.6)",blur:3,offsetX:-1,offsetY:0};function gT(){const{trans:e}=pj(),t=Eg(e=>e.objects.active.editableProps.shadow)||pT;return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(xj,{className:"ml-auto flex-shrink-0",value:t.color,size:"xs","aria-label":e({message:"Shadow Color"}),onChange:e=>{jg().objects.setValues({shadow:mT({color:e})}),Ig().setDirty(!0)}}),(0,i.jsx)(Oj,{"aria-label":"Shadow Blur",className:"max-w-240 mr-auto flex-shrink-0",defaultValue:t.blur,onChange:e=>{jg().objects.setValues({shadow:mT({blur:e})}),Ig().setDirty(!0)}})]})}function mT(e){var t;const r=null==(t=jg().objects.getActive())?void 0:t.shadow;return r?(Object.entries(e).forEach(([e,t])=>{r[e]=t}),r):new Qw.fabric.Shadow({...pT,...e})}function vT({index:e,className:t,isDisabled:r,children:n,padding:a,elementType:s="button",to:l,relative:c,width:u="min-w-min"}){const{selectedTab:d,setSelectedTab:h,tabsRef:f,size:p="md",id:g}=(0,o.useContext)(zj),m=e===d,v=function(){var e;return null===(e=(0,o.useContext)(pS))||void 0===e?void 0:e.focusManager}(),y=a||("sm"===p?"px-12":"px-18"),b=gh("tracking-wide overflow-hidden capitalize text-sm flex items-center justify-center outline-none transition-colors","focus-visible:ring focus-visible:ring-2 ring-inset rounded whitespace-nowrap cursor-pointer",u,function({isDisabled:e,isSelected:t}){return e?"text-disabled cursor-default":t?"text-primary":"text-muted hover:text-main"}({isDisabled:r,isSelected:m}),t,"md"===p&&`${y} h-48`,"sm"===p&&`${y} h-32`,r&&"pointer-events-none");return(0,i.jsx)(s,{disabled:r,id:`${g}-${e}-tab`,"aria-controls":`${g}-${e}-tabpanel`,type:"button",role:"tab","aria-selected":m,tabIndex:r?void 0:m?0:-1,onKeyDown:e=>{switch(e.key){case"ArrowLeft":null==v||v.focusPrevious();break;case"ArrowRight":null==v||v.focusNext();break;case"Home":null==v||v.focusFirst();break;case"End":null==v||v.focusLast()}},onClick:()=>{h(e)},to:l,relative:c,className:b,ref:t=>{f.current&&t&&(f.current[e]=t)},children:n})}function yT(){const e=Eg(e=>e.objects.active);return(0,i.jsxs)(Vj,{size:"sm",className:"pb-18 pt-6",children:[(0,i.jsxs)(Uj,{center:!0,children:[e.isText&&(0,i.jsx)(vT,{children:(0,i.jsx)(WS,{message:"Font"})}),!e.isImage&&(0,i.jsx)(vT,{children:(0,i.jsx)(WS,{message:"Color"})}),!e.isImage&&(0,i.jsx)(vT,{children:(0,i.jsx)(WS,{message:"Background"})}),e.isImage&&(0,i.jsx)(vT,{children:(0,i.jsx)(WS,{message:"Image"})}),(0,i.jsx)(vT,{children:(0,i.jsx)(WS,{message:"Opacity"})}),(0,i.jsx)(vT,{children:(0,i.jsx)(WS,{message:"Outline"})}),(0,i.jsx)(vT,{children:(0,i.jsx)(WS,{message:"Shadow"})})]}),(0,i.jsxs)(Jj,{className:"pt-16 h-50",children:[e.isText&&(0,i.jsx)(eT,{children:(0,i.jsx)(Xj,{})},"font"),!e.isImage&&(0,i.jsx)(eT,{children:(0,i.jsx)(oT,{property:"fill"})}),!e.isImage&&(0,i.jsx)(eT,{children:(0,i.jsx)(oT,{property:"backgroundColor"})}),e.isImage&&(0,i.jsx)(eT,{children:(0,i.jsx)(fT,{})}),(0,i.jsx)(eT,{children:(0,i.jsx)(uT,{})}),(0,i.jsx)(eT,{children:(0,i.jsx)(dT,{})}),(0,i.jsx)(eT,{children:(0,i.jsx)(gT,{})})]})]})}function bT(){const e=!ZS()&&(0,i.jsx)(AC,{size:"sm",color:"primary",variant:"outline",onClick:()=>{jg().text.add(),Ig().setDirty(!0)},children:(0,i.jsx)(WS,{message:"New Text"})});return(0,i.jsx)(TE,{actionBtn:e,children:(0,i.jsx)(yT,{})})}const wT=yh((0,i.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownwardOutlined"),xT={};let CT=!1,_T=null,ST=null;const AT=e=>{var t;for(const r in xT)r!==e&&(null==(t=xT[r])||t.call(xT,!0),delete xT[r])},kT=(0,o.forwardRef)(({children:e,label:t,placement:r="top",offset:n=10,variant:a="neutral",delay:s=1500,isDisabled:l,usePortal:c=!0,...u},d)=>{const{x:h,y:f,reference:p,strategy:g,arrowRef:m,arrowStyle:v,refs:y}=Q_({placement:r,offset:n,ref:d,showArrow:!0}),[b,w]=(0,o.useState)(!1),x=(0,o.useId)(),C=(0,o.useRef)(),_=()=>{clearTimeout(C.current),C.current=void 0,AT(x),xT[x]=S,CT=!0,w(!0),_T&&(clearTimeout(_T),_T=null),ST&&(clearTimeout(ST),ST=null)},S=(0,o.useCallback)(e=>{e?(clearTimeout(C.current),C.current=void 0,w(!1)):C.current||(C.current=setTimeout(()=>{C.current=void 0,w(!1)},500)),_T&&(clearTimeout(_T),_T=null),CT&&(ST&&clearTimeout(ST),ST=setTimeout(()=>{delete xT[x],ST=null,CT=!1},500))},[x]),A=e=>{!e&&s>0&&!C.current?(AT(x),xT[x]=S,b||_T||CT?b||_():_T=setTimeout(()=>{_T=null,CT=!0,_()},s)):_()};(0,o.useEffect)(()=>()=>{clearTimeout(C.current),xT[x]&&delete xT[x]},[x]),(0,o.useEffect)(()=>{const e=e=>{"Escape"===e.key&&S(!0)};if(b)return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[b,S]);const k=(0,i.jsx)(Cw,{children:b&&(0,i.jsxs)(gw.div,{...MS,ref:y.setFloating,id:x,role:"tooltip",onPointerEnter:()=>{A(!0)},onPointerLeave:()=>{S()},className:gh("z-tooltip my-4 max-w-240 break-words rounded px-8 py-4 text-xs text-white shadow","positive"===a&&"bg-positive","danger"===a&&"bg-danger","neutral"===a&&"bg-toast"),style:{position:g,top:f??"",left:h??""},children:[(0,i.jsx)("div",{ref:m,className:"absolute h-8 w-8 rotate-45 bg-inherit",style:v}),t]})});return(0,i.jsxs)(o.Fragment,{children:[(0,o.cloneElement)(e,Nw({"aria-describedby":b?x:void 0,ref:p,onPointerEnter:e=>{"mouse"===e.pointerType&&A()},onFocus:e=>{e.target.matches(":focus-visible")&&A(!0)},onPointerLeave:e=>{"mouse"===e.pointerType&&S()},onPointerDown:()=>{S(!0)},onBlur:()=>{S()},"aria-label":"string"==typeof t?t:t.props.message},u)),c?xg&&(0,le.createPortal)(k,xg):k]})});function ET(){const e=Eg(e=>e.activeToolOverlay),t=Eg(e=>e.objects.active.id),r=function(e,t){switch(e){case vp.Filter:return(0,i.jsx)(Nj,{});case vp.Frame:return(0,i.jsx)(Dj,{});case vp.Text:return t&&(0,i.jsx)(bT,{});case vp.ActiveObject:return t&&(0,i.jsx)(yT,{});default:return null}}(e,t),[n,a]=(0,o.useState)(!0);return(0,i.jsxs)("div",{className:"relative z-tool-overlay text-sm",children:[r&&(0,i.jsx)("div",{className:gh("absolute right-16 text-muted z-50 transition-all",!n&&"rotate-180",n?"-top-144":"-top-40"),children:(0,i.jsx)(kT,{label:(0,i.jsx)(WS,n?{message:"Hide options"}:{message:"Show options"}),children:(0,i.jsx)(jA,{variant:"outline",radius:"rounded-lg",size:"xs",onClick:()=>{a(!n)},children:(0,i.jsx)(wT,{})})})}),(0,i.jsx)(Cw,{children:r&&n&&(0,i.jsx)(gw.div,{initial:{y:0,opacity:0},animate:{y:"-100%",opacity:1},exit:{y:0,opacity:0},transition:{type:"tween",duration:.15},className:"absolute inset-x-0 gap-16 px-5vw bg bg-opacity-95 border-t",children:r},"tool-controls-overlay")})]})}const IT=yh((0,i.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function jT({filter:e}){const t=Eg(t=>t.filter.applied.includes(e)),r=jg().filter.hasOptions(e),n=gh("block flex-shrink-0 rounded",{"text-primary border-primary":t}),a=Ax[e],s=(0,i.jsxs)(o.Fragment,{children:[(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(TT,{filter:e}),t&&(0,i.jsx)(FT,{filter:e,hasOptions:r})]}),(0,i.jsx)("div",{className:"mt-4 text-center text-xs capitalize",children:a?(0,i.jsx)(WS,{...a}):e})]});return t&&r?(0,i.jsx)("div",{className:n,children:s}):(0,i.jsx)(SC,{className:n,onClick:()=>{t?jg().filter.remove(e):jg().filter.apply(e)},children:s})}function TT({filter:e}){const t=Eg(t=>t.filter.selected===e),r=gh("m-auto w-96 h-56 border rounded object-cover",{shadow:t});return(0,i.jsx)("img",{src:vx(`images/filter/${e}.jpg`),className:r,alt:""})}function FT({filter:e,hasOptions:t}){return(0,i.jsxs)("div",{className:"flex items-center justify-center bg-background/70 absolute inset-0 border-2 border-primary rounded",children:[t?(0,i.jsx)(jA,{color:"primary",size:"md",onClick:()=>{jg().filter.remove(e)},children:(0,i.jsx)(IT,{})}):(0,i.jsx)(IT,{className:"svg-icon icon-md"}),t&&(0,i.jsx)(OT,{filter:e,hasOptions:t})]})}function OT({filter:e,hasOptions:t}){return(0,i.jsx)(jA,{color:"primary",size:"md",onClick:()=>{Ig().activeToolOverlay===vp.Filter&&Ig().filter.selected===e?Ig().setActiveTool(Ig().activeTool,null):Ig().filter.select(e,t)},children:(0,i.jsx)(xh,{})})}const MT=(0,o.forwardRef)(({children:e,className:t,gap:r="gap-10"},n)=>{const a=o.Children.map(e,(t,r)=>o.isValidElement(t)?o.cloneElement(t,{isFirst:0===r,isLast:o.Children.count(e)===r+1}):t);return(0,i.jsx)("div",{ref:n,className:gh("tiny-scrollbar pb-4 overflow-x-auto relative flex items-center",r,t),children:a})});function PT({isFirst:e,isLast:t,children:r,className:n}){const o=gh(n,"flex-shrink-0",{"ml-auto":e,"mr-auto":t});return(0,i.jsx)("div",{className:o,children:r})}function RT(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.filter)?void 0:r.items})||[];(0,o.useEffect)(()=>{jg().filter.syncState()},[]);const t=e.map(e=>(0,i.jsx)(PT,{children:(0,i.jsx)(jT,{filter:e})},e));return(0,i.jsx)(MT,{children:t})}const LT=yh((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOutlined"),NT=yh((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOpenOutlined"),DT=yh((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlankOutlined"),zT=yh((0,i.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),BT=yh((0,i.jsx)("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M17,13H7v-2h10V13z"}),"CheckBox"),UT=(0,o.forwardRef)((e,t)=>{const{size:r="md",children:n,className:a,icon:s,checkedIcon:l,disabled:c,isIndeterminate:u,errorMessage:d,invalid:h,orientation:f="horizontal",onChange:p,autoFocus:g,required:m,value:v,name:y,inputTestId:b}=e,w=pA({...e,label:n}),x=s||DT,C=l||(u?BT:zT),_=$w(t);_A({autoFocus:g},_),(0,o.useEffect)(()=>{_.current&&(_.current.indeterminate=u||!1)});const[S,A]=Yw(e.checked,e.defaultChecked||!1),k=(0,o.useCallback)(e=>{null==p||p(e),A(e.target.checked)},[p,A]),E=gh("select-none",a,h&&"text-danger",!h&&c&&"text-disabled");let I,j=h?"text-danger":null;return u?(I=BT,j=j||"text-primary"):S?(I=C,j=j||"text-primary"):(I=x,j=j||"text-muted"),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:E,children:(0,i.jsxs)("div",{className:gh("relative flex items-center","vertical"===f&&"flex-col flex-col-reverse"),children:[(0,i.jsx)("input",{className:"absolute left-0 top-0 h-24 w-24 appearance-none overflow-hidden rounded outline-none ring-inset transition-shadow focus-visible:ring",type:"checkbox","aria-checked":u?"mixed":S,"aria-invalid":h||void 0,onChange:k,ref:_,required:m,disabled:c,value:v,name:y,"data-testid":b}),(0,i.jsx)(I,{size:r,className:gh("pointer-events-none",c?"text-disabled":j)}),n&&(0,i.jsx)("div",{className:gh("first-letter:capitalize",w.size.font,"vertical"===f?"mb-6":"ml-6"),children:n})]})}),d&&(0,i.jsx)("div",{className:w.error,children:d})]})});function VT(){const{trans:e}=pj(),{minWidth:t=50,minHeight:r=50,maxHeight:n=2400,maxWidth:a=2400}=Eg(e=>{var t;return null==(t=e.config.tools)?void 0:t.resize})||{},s=Eg(e=>e.original),l=Eg(e=>e.resize.formValue);return(0,o.useEffect)(()=>{Ig().resize.setFormValue({...s})},[s]),(0,o.useEffect)(()=>{Ig().setDirty(!0)},[]),(0,i.jsxs)("form",{className:"flex items-center justify-center gap-16 w-full",onSubmit:e=>{e.preventDefault(),Ig().applyChanges()},children:[(0,i.jsx)(AA,{type:"number",min:t,max:a,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)(WS,{message:"Width"}),value:l.width,onChange:e=>{(e=>{const t={...l,width:e};l.maintainAspect&&(t.height=Px(e,l.usePercentages)),Ig().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("div",{className:"mt-24",children:(0,i.jsx)(UT,{size:"md",checked:l.maintainAspect,onChange:e=>{(e=>{const t={...l,maintainAspect:e};e&&(t.height=Px(t.width,t.usePercentages)),Ig().resize.setFormValue(t)})(!l.maintainAspect)},"aria-label":e({message:"Maintain aspect ratio"}),checkedIcon:LT,icon:NT})}),(0,i.jsx)(AA,{type:"number",min:r,max:n,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)(WS,{message:"Height"}),value:l.height,onChange:e=>{(e=>{const t={...l,height:e};e&&l.maintainAspect&&(t.width=Mx(e,l.usePercentages)),Ig().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("button",{type:"submit",className:"hidden",children:(0,i.jsx)(WS,{message:"Resize"})})]})}function HT(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.presets})||[],t=Eg(e=>e.crop.selectedAspectRatio),r=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.crop)?void 0:r.allowCustomRatio})??!0,n=e.filter(e=>e.ratio||!e.ratio&&r).map(e=>(0,i.jsx)(PT,{children:(0,i.jsxs)(SC,{onClick:()=>jg().crop.resetCropzone(e.ratio),className:"flex flex-col items-center justify-between cursor-pointer h-56",children:[(0,i.jsx)(WT,{preset:e,selectedRatio:t}),(0,i.jsx)($T,{preset:e,selectedRatio:t})]})},e.ratio||e.name));return(0,i.jsx)(MT,{gap:"gap-18",children:n})}function WT({preset:e,selectedRatio:t}){let r=40,n=30;if(e.ratio){const t=Nx(e.ratio);({width:r,height:n}=Lx(t,r,n))}const o=gh("border-2",{"border-dotted":null===e.ratio,"border-primary":t===e.ratio});return(0,i.jsx)("div",{style:{width:`${r}px`,height:`${n}px`},className:o})}function $T({preset:e,selectedRatio:t}){const r=gh("mt-4 text-center text-xs",{"text-primary":t===e.ratio});return(0,i.jsx)("div",{className:r,children:e.name?(0,i.jsx)(WS,{message:e.name}):e.ratio})}const qT=yh((0,i.jsx)("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}),"FlipOutlined");function GT(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(jA,{size:"sm",onClick:()=>{jg().transform.flip("vertical"),Ig().setDirty(!0)},children:(0,i.jsx)(qT,{})}),(0,i.jsx)(jA,{size:"sm",onClick:()=>{jg().transform.flip("horizontal"),Ig().setDirty(!0)},children:(0,i.jsx)(qT,{className:"rotate-90"})})]})}const YT=yh((0,i.jsx)("path",{d:"M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z"}),"RotateLeftOutlined"),XT=yh((0,i.jsx)("path",{d:"M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"}),"RotateRightOutlined");function KT(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(jA,{size:"sm",onClick:()=>{jg().transform.rotateLeft(),Ig().setDirty(!0)},children:(0,i.jsx)(YT,{})}),(0,i.jsx)(jA,{size:"sm",onClick:()=>{jg().transform.rotateRight(),Ig().setDirty(!0)},children:(0,i.jsx)(XT,{})})]})}function ZT(){return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-16",children:[(0,i.jsx)(GT,{}),(0,i.jsx)(QT,{}),(0,i.jsx)(KT,{})]})}function QT(){const e=(0,o.useRef)(null),{domProps:t,groupId:r,thumbIds:n,trackRef:a,getThumbValueLabel:s}=jj({minValue:-45,maxValue:45,step:1,defaultValue:[Ig().crop.straightenAngle],onChange:t=>{const r=t[0];jg().transform.straighten(r),Ig().crop.setTransformAngle(r),Ig().setDirty(!0),e.current.style.transform=`translateX(${r}px)`}});return(0,i.jsx)("div",{id:r,role:"group",className:"flex-auto flex-shrink-0 max-w-320 touch-none isolate",children:(0,i.jsxs)("div",{...t,ref:a,className:"h-36 relative",children:[(0,i.jsxs)("output",{htmlFor:n[0],"aria-live":"off",className:"absolute left-1/2 top-1/2 w-40 text-center bg -translate-x-1/2 -translate-y-1/2 z-10",children:[s(0),"\xb0"]}),(0,i.jsx)(JT,{ref:e})]})})}const JT=o.forwardRef((e,t)=>{const r=[...Array(80).keys()],n=r.map(e=>(0,i.jsx)("circle",{cx:2+10*e,cy:"20",r:e%5?.75:2},e));return(0,i.jsx)("div",{className:"relative h-full cursor-pointer overflow-hidden",children:(0,i.jsx)("svg",{ref:t,style:{width:10*r.length},className:"absolute -left-80 h-full fill-current",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:n})})});function eF(){return(0,o.useEffect)(()=>(Ig().setDirty(!0),jg().frame.active.hide(),()=>{jg().frame.active.show()}),[]),(0,i.jsxs)("div",{className:"pb-16",children:[(0,i.jsx)("div",{className:"mb-10",children:(0,i.jsx)(ZT,{})}),(0,i.jsx)(HT,{})]})}const tF=yh((0,i.jsx)("path",{d:"M 16 6 C 12.484375 6 9.273438 7.070313 6.90625 8.84375 C 4.539063 10.617188 3 13.15625 3 16 C 3 18.84375 4.539063 21.382813 6.90625 23.15625 C 9.273438 24.929688 12.484375 26 16 26 C 19.515625 26 22.726563 24.929688 25.09375 23.15625 C 27.460938 21.382813 29 18.84375 29 16 C 29 13.15625 27.460938 10.617188 25.09375 8.84375 C 22.726563 7.070313 19.515625 6 16 6 Z M 16 8 C 19.109375 8 21.898438 8.957031 23.875 10.4375 C 25.851563 11.917969 27 13.875 27 16 C 27 18.125 25.851563 20.082031 23.875 21.5625 C 21.898438 23.042969 19.109375 24 16 24 C 12.890625 24 10.101563 23.042969 8.125 21.5625 C 6.148438 20.082031 5 18.125 5 16 C 5 13.875 6.148438 11.917969 8.125 10.4375 C 10.101563 8.957031 12.890625 8 16 8 Z "})),rF=yh((0,i.jsx)("path",{d:"M 16 4 C 9.382813 4 4 9.382813 4 16 C 4 22.617188 9.382813 28 16 28 C 22.617188 28 28 22.617188 28 16 C 28 9.382813 22.617188 4 16 4 Z M 16 6 C 21.535156 6 26 10.464844 26 16 C 26 21.535156 21.535156 26 16 26 C 10.464844 26 6 21.535156 6 16 C 6 10.464844 10.464844 6 16 6 Z "})),nF=yh((0,i.jsx)("path",{d:"M 3 6 L 3 26 L 29 26 L 29 6 Z M 5 8 L 27 8 L 27 24 L 5 24 Z "})),iF=yh((0,i.jsx)("path",{d:"M 16 4.90625 L 15.125 6.40625 L 4.71875 24.5 L 3.875 26 L 28.125 26 L 27.28125 24.5 L 16.875 6.40625 Z M 16 8.9375 L 24.65625 24 L 7.34375 24 Z "}));function oF(){const e=(Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.shapes)?void 0:r.items})||[]).map(e=>(0,i.jsx)(PT,{children:(0,i.jsx)(jA,{variant:"outline",radius:"rounded-2xl",size:"xl",onClick:()=>{jg().shape.addBasicShape(e.name),Ig().setDirty(!0)},children:(0,i.jsx)(aF,{shape:e})})},e.name));return(0,i.jsx)(MT,{children:e})}function aF({shape:e}){var t;return"Path"===e.type?(0,i.jsx)("svg",{className:"m-auto w-36 h-36",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -100 512 700",children:(0,i.jsx)("path",{className:"fill-transparent stroke-current",d:null==(t=e.options)?void 0:t.path,strokeWidth:25})}):o.cloneElement(sF[e.name],{className:"w-30 h-30"})}const sF={circle:(0,i.jsx)(rF,{viewBox:"0 0 32 32"}),square:(0,i.jsx)(nF,{viewBox:"0 0 32 32"}),triangle:(0,i.jsx)(iF,{viewBox:"0 0 32 32"}),ellipse:(0,i.jsx)(tF,{viewBox:"0 0 32 32"})};function lF(e,t,r){let n,i=r.initialDeps??[];return()=>{var o,a,s,l;let c;r.key&&null!=(o=r.debug)&&o.call(r)&&(c=Date.now());const u=e();if(u.length===i.length&&!u.some((e,t)=>i[t]!==e))return n;let d;if(i=u,r.key&&null!=(a=r.debug)&&a.call(r)&&(d=Date.now()),n=t(...u),r.key&&null!=(s=r.debug)&&s.call(r)){Math.round(100*(Date.now()-c)),Math.round(100*(Date.now()-d))}return null==(l=null==r?void 0:r.onChange)||l.call(r,n),n}}function cF(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const uF=(e,t,r)=>{let n;return function(...i){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,i),r)}},dF=e=>e,hF=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let i=t;i<=r;i++)n.push(i);return n},fF=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const i=e=>{const{width:r,height:n}=e;t({width:Math.round(r),height:Math.round(n)})};if(i(r.getBoundingClientRect()),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(e=>{const t=e[0];if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void i({width:e.inlineSize,height:e.blockSize})}i(r.getBoundingClientRect())});return o.observe(r,{box:"border-box"}),()=>{o.unobserve(r)}},pF={passive:!0},gF=typeof window>"u"||"onscrollend"in window,mF=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let i=0;const o=gF?()=>{}:uF(n,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=n=>()=>{i=r[e.options.horizontal?"scrollLeft":"scrollTop"],o(),t(i,n)},s=a(!0),l=a(!1);return l(),r.addEventListener("scroll",s,pF),r.addEventListener("scrollend",l,pF),()=>{r.removeEventListener("scroll",s),r.removeEventListener("scrollend",l)}},vF=(e,t,r)=>{if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[r.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[r.options.horizontal?"width":"height"])},yF=(e,{adjustments:t=0,behavior:r},n)=>{var i,o;const a=e+t;null==(o=null==(i=n.scrollElement)?void 0:i.scrollTo)||o.call(i,{[n.options.horizontal?"left":"top"]:a,behavior:r})};class bF{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var e;return null==(e=t())?void 0:e.disconnect()},observe:e=>{var r;return null==(r=t())?void 0:r.observe(e,{box:"border-box"})},unobserve:e=>{var r;return null==(r=t())?void 0:r.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,r])=>{typeof r>"u"&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dF,rangeExtractor:hF,onChange:()=>{},measureElement:vF,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var r,n;const{startIndex:i,endIndex:o}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(e||i!==(null==a?void 0:a.startIndex)||o!==(null==a?void 0:a.endIndex))&&(null==(n=(r=this.options).onChange)||n.call(r,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{var e;const t=this.options.getScrollElement();this.scrollElement!==t&&(this.cleanup(),this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?"forward":"backward":null,this.scrollOffset=e;const r=this.isScrolling;this.isScrolling=t,this.notify(r!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurementOptions=lF(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,r,n)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:r,getItemKey:n}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{const r=new Map,n=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(r.has(t.lane))continue;const o=n.get(t.lane);if(null==o||t.end>o.end?n.set(t.lane,t):t.end<o.end&&r.set(t.lane,!0),r.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=lF(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:r,getItemKey:n},i)=>{const o=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const a=this.measurementsCache.slice(0,o);for(let s=o;s<e;s++){const e=n(s),o=1===this.options.lanes?a[s-1]:this.getFurthestMeasurement(a,s),l=o?o.end+this.options.gap:t+r,c=i.get(e),u="number"==typeof c?c:this.options.estimateSize(s),d=l+u,h=o?o.lane:s%this.options.lanes;a[s]={index:s,start:l,size:u,end:d,key:e,lane:h}}return this.measurementsCache=a,a},{key:!1,debug:()=>this.options.debug}),this.calculateRange=lF(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:r}){const n=e.length-1,i=wF(0,n,t=>e[t].start,r);let o=i;for(;o<n&&e[o].end<r+t;)o++;return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:r}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=lF(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,r,n)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:r,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,r=e.getAttribute(t);return r?parseInt(r,10):-1},this._measureElement=(e,t)=>{const r=this.measurementsCache[this.indexFromElement(e)];if(!r||!e.isConnected)return void this.measureElementCache.forEach((t,r)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(r))});const n=this.measureElementCache.get(r.key);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.measureElementCache.set(r.key,e));const i=this.options.measureElement(e,t,this);this.resizeItem(r,i)},this.resizeItem=(e,t)=>{const r=t-(this.itemSizeCache.get(e.key)??e.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(e,r,this):e.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=lF(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{const r=[];for(let n=0,i=e.length;n<i;n++){const i=t[e[n]];r.push(i)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();return cF(t[wF(0,t.length-1,e=>cF(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{const r=this.getSize();"auto"===t&&(t=e<=this.scrollOffset?"start":e>=this.scrollOffset+r?"end":"start"),"start"===t||("end"===t?e-=r:"center"===t&&(e-=r/2));const n=this.options.horizontal?"scrollWidth":"scrollHeight",i=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[n]:this.scrollElement[n]:0)-this.getSize();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=cF(this.getMeasurements()[e]);if("auto"===t)if(r.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t="start"}const n="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:r}={})=>{this.cancelScrollToIndex(),"smooth"===r&&this.isDynamicMode(),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:r})},this.scrollToIndex=(e,{align:t="auto",behavior:r}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===r&&this.isDynamicMode();const[n,i]=this.getOffsetForIndex(e,t);this._scrollToOffset(n,{adjustments:void 0,behavior:r}),"smooth"!==r&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){const[t]=this.getOffsetForIndex(e,i);((e,t)=>Math.abs(e-t)<1)(t,this.scrollOffset)||this.scrollToIndex(e,{align:i,behavior:r})}else this.scrollToIndex(e,{align:i,behavior:r})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode(),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let r;return r=0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)),r-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:r})=>{this.options.scrollToFn(e,{behavior:r,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,null==(t=(e=this.options).onChange)||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset="function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}}const wF=(e,t,r,n)=>{for(;e<=t;){const i=(e+t)/2|0,o=r(i);if(o<n)e=i+1;else{if(!(o>n))return i;t=i-1}}return e>0?e-1:0},xF=typeof document<"u"?o.useLayoutEffect:o.useEffect;function CF(){const e=Eg(e=>{var t;return null==(t=e.config.ui)?void 0:t.activeTheme});return Eg(t=>{var r;return((null==(r=t.config.ui)?void 0:r.themes)||[]).find(t=>t.name===e)})}function _F({category:e}){const t=CF(),r=e.name,n=e.list?e.list:Array.from(Array(e.items).keys()),a=(0,o.useRef)(null),s=function(e){return function(e){const t=o.useReducer(()=>({}),{})[1],r={...e,onChange:(r,n)=>{var i;n?(0,le.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,r,n)}},[n]=o.useState(()=>new bF(r));return n.setOptions(r),o.useEffect(()=>n._didMount(),[]),xF(()=>n._willUpdate()),n}({observeElementRect:fF,observeElementOffset:mF,scrollToFn:yF,...e})}({horizontal:!0,count:n.length,getScrollElement:()=>a.current,estimateSize:(0,o.useCallback)(()=>52,[]),overscan:5});return(0,o.useEffect)(()=>{s.scrollToIndex(0)},[r]),(0,i.jsx)(o.Fragment,{children:(0,i.jsx)("div",{ref:a,className:"tiny-scrollbar overflow-x-auto overflow-y-hidden",style:{height:"52px"},children:(0,i.jsx)("div",{className:"h-full relative mx-auto",style:{width:`${s.getTotalSize()}px`},children:s.getVirtualItems().map(r=>{const o=`${n[r.index]}`;return(0,i.jsx)("div",{className:"absolute top-0 left-0 h-full",style:{width:`${r.size}px`,transform:`translateX(${r.start}px)`},children:(0,i.jsx)(AC,{variant:"outline",radius:"rounded-xl",size:"md",equalWidth:!0,onClick:async()=>{await jg().shape.addSticker(e.name,o),Ig().setDirty(!0)},children:(0,i.jsx)("img",{className:gh("m-auto m-auto w-28 h-28",e.invertPreview&&(null==t?void 0:t.isDark)&&"invert"),src:Bx(e,o),alt:o})})},r.index)})})})})}function SF(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.stickers)?void 0:r.items})||[],[t,r]=(0,o.useState)(e[0]),n=e.map(e=>{const r=t===e,n=lh[e.name];return(0,i.jsx)(AC,{size:"xs",color:r?"primary":null,value:e,children:(0,i.jsx)("span",{className:"capitalize",children:n?(0,i.jsx)(WS,{...n}):e.name})},e.name)});return(0,i.jsxs)("div",{className:"h-92",children:[(0,i.jsx)("div",{className:"mb-10 w-full hide-scrollbar overflow-x-auto overflow-y-hidden flex",children:(0,i.jsx)(RA,{value:t,onChange:e=>r(e),variant:"outline",radius:"rounded-full",className:"mx-auto",children:n})}),t&&(0,i.jsx)(_F,{category:t})]})}function AF(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.frame)?void 0:r.items})||[],t=Eg(e=>e.frame.active);(0,o.useEffect)(()=>{Ig().frame.active&&Ig().frame.showOptionsPanel()},[]);const r=e.map(e=>{const r=vx(`images/frames/${e.name}/thumbnail.png`),n=(null==t?void 0:t.name)===e.name;return(0,i.jsx)(PT,{children:(0,i.jsxs)("button",{type:"button",className:"border-2 overflow-hidden relative rounded border cursor-pointer "+(n?"border-primary":""),onClick:()=>{Ig().setDirty(!0),n?jg().frame.remove():jg().frame.add(e.name)},children:[n&&(0,i.jsx)(kF,{}),(0,i.jsx)("img",{draggable:"false",className:"w-64 h-64",src:r,alt:e.name})]})},e.name)});return(0,i.jsx)(MT,{children:r})}function kF(){return(0,i.jsx)("span",{className:"bg-background/70 absolute inset-0 text-primary",children:(0,i.jsx)(IT,{className:"svg-icon icon-md absolute inset-0 block m-auto"})})}function EF(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.text)?void 0:r.items});(0,o.useEffect)(()=>{e&&xx(e,{prefixSrc:vx,id:"pixie-fonts"}).catch(()=>{})},[e]),(0,o.useEffect)(()=>{jg().text.selectOrAddText()&&Ig().setDirty(!0)},[]);const t=(e||[]).map(e=>(0,i.jsx)(PT,{children:(0,i.jsx)(IF,{fontConfig:e})},e.family));return(0,i.jsx)(MT,{className:"pt-6",children:t})}function IF({fontConfig:e}){var t;const r=Eg(e=>e.objects.active.editableProps.fontFamily),n=gh("block px-6 w-110 h-68 text-sm bg border rounded-2xl",{"border-primary":r===e.family,"text-primary":r===e.family});return(0,i.jsx)("button",{type:"button",className:n,style:{fontFamily:e.family.includes('"')?e.family:`"${e.family}"`,fontWeight:(null==(t=e.descriptors)?void 0:t.weight)||"normal"},onClick:async()=>{jg().text.selectOrAddText(),Ig().setDirty(!0),jg().objects.setValues({fontFamily:e.family})},children:e.family})}const jF=yh((0,i.jsx)("path",{d:"M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7H288h9.4H512c17.7 0 32-14.3 32-32s-14.3-32-32-32H387.9L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416H288l-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"}),"EraserFA","0 0 576 512");function TF(){return(0,o.useEffect)(()=>(jg().draw.enable(),()=>{jg().draw.disable()}),[]),(0,i.jsxs)(MT,{gap:"gap-16",children:[(0,i.jsx)(PT,{children:(0,i.jsx)(xj,{size:"sm",label:(0,i.jsx)(WS,{message:"Brush Color"}),value:jg().draw.currentBrush.color,onChange:e=>{jg().draw.setBrushColor(e)}})}),(0,i.jsx)(PT,{children:(0,i.jsx)(OF,{})}),(0,i.jsx)(PT,{children:(0,i.jsx)(FF,{})})]})}function FF(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.draw)?void 0:r.brushSizes})||[],[t,r]=(0,o.useState)(jg().draw.currentBrush.width);return(0,i.jsx)(Lj,{selectionMode:"single",selectedValue:t,onSelectionChange:e=>{r(e),jg().draw.setBrushSize(e)},size:"sm",label:(0,i.jsx)(WS,{message:"Brush Size"}),children:e.map(e=>(0,i.jsx)(OC,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"flex-shrink-0 mr-8 border-[3px] rounded-full",style:{width:`${e}px`,height:`${e}px`}}),e]})},e))})}function OF(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.tools)?void 0:t.draw)?void 0:r.brushTypes})||[],t=CF(),[r,n]=(0,o.useState)(jg().draw.currentBrush.type);return(0,i.jsx)(Lj,{selectionMode:"single",selectedValue:r,onSelectionChange:e=>{n(e),jg().draw.setBrushType(e)},size:"sm",label:(0,i.jsx)(WS,{message:"Brush Type"}),children:e.map(e=>(0,i.jsx)(OC,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:["EraserBrush"===e?(0,i.jsx)(jF,{className:"mr-8"}):(0,i.jsx)("img",{className:"flex-shrink-0 mr-8 w-24 h-24",src:MF(e,null==t?void 0:t.isDark),alt:""}),(0,i.jsx)(WS,{message:e.replace(/([A-Z])/g," $1").trim()})]})},e))})}function MF(e,t=!1){return vx(`images/brushes/${t?"white":"black"}/${e.replace("Brush","").toLowerCase()}.png`)}function PF(){const{trans:e}=pj(),t=Eg(e=>e.corners.radius);return(0,o.useEffect)(()=>(Ig().setDirty(!0),jg().corners.showPreview(),()=>jg().corners.hidePreview()),[]),(0,i.jsx)("div",{className:"max-w-320 mx-auto",children:(0,i.jsx)(Oj,{minValue:1,maxValue:300,label:e({message:"Radius"}),getValueLabel:e=>`${e}px`,onChange:e=>{jg().corners.updatePreview(e),Ig().corners.setRadius(e)},value:t})})}const RF={initial:{y:"130%",opacity:0},animate:{y:0,opacity:1},exit:{y:"130%",opacity:0,left:0,position:"absolute",overflowY:"hidden"},transition:{type:"tween",duration:.15}};function LF({activeTool:e}){const t=function(e){switch(e){case fh.FILTER:return(0,i.jsx)(RT,{});case fh.RESIZE:return(0,i.jsx)(VT,{});case fh.CROP:return(0,i.jsx)(eF,{});case fh.DRAW:return(0,i.jsx)(TF,{});case fh.TEXT:return(0,i.jsx)(EF,{});case fh.SHAPES:return(0,i.jsx)(oF,{});case fh.STICKERS:return(0,i.jsx)(SF,{});case fh.FRAME:return(0,i.jsx)(AF,{});case fh.CORNERS:return(0,i.jsx)(PF,{});default:return null}}(e);return(0,i.jsx)(gw.div,{className:"relative h-full w-full text-sm bg select-none overflow-hidden",...RF,children:t})}function NF({className:e}){const t=Eg(e=>e.activeTool);return(0,i.jsx)("nav",{className:gh("z-navbar min-h-86 flex-shrink-0 px-16 relative overflow-hidden",e),children:(0,i.jsx)(Cw,{initial:!1,children:t?(0,i.jsx)(LF,{activeTool:t},"tool-controls"):(0,i.jsx)(DF,{},"nav-items")})})}function DF(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.items})||[];return(0,i.jsx)(gw.div,{className:"w-full h-full bg-inherit",...RF,children:(0,i.jsx)(MT,{children:e.map(e=>(0,i.jsx)(PT,{children:(0,i.jsx)(zF,{item:e})},e.name))})})}function zF({item:e}){const t=Dh[e.name];return(0,i.jsxs)(SC,{variant:"outline",color:"paper",className:"flex-col flex-shrink-0 w-68 h-68",radius:"rounded-2xl",onClick:()=>{"string"==typeof e.action?Rg(e.action):"function"==typeof e.action&&e.action(Ig().editor)},children:[(0,i.jsx)("div",{className:"mb-1",children:(0,i.jsx)(TA,{className:"icon-md",icon:e.icon})}),(0,i.jsx)("div",{className:"mt-6 text-xs capitalize max-w-[90%] overflow-hidden overflow-ellipsis",children:t?(0,i.jsx)(WS,{...t}):e.name})]})}function BF(){const e=Eg(e=>e.history.items),t=Eg(e=>e.history.pointer);return(0,i.jsxs)(gw.div,{...MS,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)(WS,{message:"History"}),(0,i.jsx)(jA,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{Ig().togglePanel("history",!1)},children:(0,i.jsx)(WA,{})})]}),(0,i.jsx)("div",{className:"p-10",children:e.map(r=>{const n=r.id===e[t].id,a=Lh[r.name],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(AC,{onClick:()=>{n||jg().history.load(r)},variant:"outline",color:n?"primary":null,size:"sm",className:gh("w-full mb-8",n&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)(WS,{...a.name})},r.id)})})]})}function UF(e){const{children:t,className:r,color:n,onDismiss:a,leftAdornment:s,rightAdornment:l,hideDismissButton:c=!1,size:u,showDivider:d,justify:h="justify-between",titleFontWeight:f="font-semibold",titleTextSize:p=("xs"===u?"text-xs":"text-sm"),closeButtonSize:g=("xs"===u?"xs":"sm"),actions:m}=e,{labelId:v,isDismissable:y,close:b}=(0,o.useContext)(hj);return(0,i.jsxs)("div",{className:gh(r,"flex flex-shrink-0 items-center gap-10",f,d&&"border-b",VF(e),n||"text-main",h),children:[s,(0,i.jsx)("h3",{id:v,className:gh(p,"mr-auto leading-5 opacity-90"),children:t}),l,m,y&&!c&&(0,i.jsx)(jA,{"aria-label":"Dismiss",onClick:()=>{a?a():b()},size:g,className:gh("-mr-8 text-muted",l&&"sr-only"),children:(0,i.jsx)(WA,{})})]})}function VF({size:e,padding:t}){if(t)return t;switch(e){case"2xs":case"xs":return"px-14 py-4";case"sm":return"px-18 py-4";default:return"px-24 py-6"}}const HF=(0,o.forwardRef)((e,t)=>{const{children:r,className:n,padding:o,size:a,...s}=e;return(0,i.jsx)("div",{...s,ref:t,className:gh(n,WF(e),"overflow-y-auto overflow-x-hidden overscroll-contain text-sm flex-auto"),children:r})});function WF({size:e,padding:t}){if(t)return t;switch(e){case"xs":return"p-14";case"sm":return"p-18";default:return"px-24 py-20"}}function $F(){const e=Eg(e=>e.openPanels.newImage);return(0,i.jsx)(wj,{isOpen:e,disableInitialTransition:!0,type:"modal",isDismissable:!1,children:(0,i.jsx)(qF,{})})}function qF(){const[e,t]=(0,o.useState)("default");return(0,i.jsxs)(vj,{className:"text-center max-w-max text-main",size:"auto",children:[(0,i.jsx)(UF,{padding:"px-24 pt-24 pb-12",showDivider:!1,children:(0,i.jsx)(WS,{message:"Open a photo or design to get started"})}),(0,i.jsx)(HF,{children:(0,i.jsx)("default"===e?GF:XF,{setActivePanel:t})})]})}function GF({setActivePanel:e}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(AC,{className:"mr-20",size:"sm",variant:"raised",color:"primary",onClick:()=>{jg().import.uploadAndReplaceMainImage()},children:(0,i.jsx)(WS,{message:"Open Photo"})}),(0,i.jsx)(AC,{variant:"outline",size:"sm",color:"primary",onClick:()=>{e("newCanvas")},children:(0,i.jsx)(WS,{message:"Create New"})}),(0,i.jsx)(YF,{})]})}function YF(){const e=Eg(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.openImageDialog)?void 0:r.sampleImages});return null!=e&&e.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"relative py-20 text-main",children:[(0,i.jsx)("hr",{className:"absolute h-1 border-none bg-divider w-full top inset-0 m-auto"}),(0,i.jsx)("span",{className:"text-sm bg px-6 relative",children:(0,i.jsx)(WS,{message:"or use sample"})})]}),(0,i.jsx)("ul",{className:"flex items-center gap-16",children:e.map(e=>(0,i.jsx)("li",{className:"shrink-0",children:(0,i.jsx)("button",{type:"button",onClick:async()=>{"function"==typeof e.action?e.action():e.url.endsWith(".json")?(await Og(vx(e.url)),Ig().togglePanel("newImage",!1)):(await jg().import.openBackgroundImage(vx(e.url)),Ig().togglePanel("newImage",!1))},children:(0,i.jsx)("img",{className:"w-80 h-80 rounded overflow-hidden transition-shadow hover:shadow-md",src:vx(e.thumbnail),alt:""})})},e.url||e.thumbnail))})]}):null}function XF({setActivePanel:e}){const[t,r]=(0,o.useState)({width:800,height:600,bgColor:"transparent"});return(0,i.jsxs)("form",{onSubmit:e=>{e.preventDefault();const{width:r,height:n,bgColor:i}=t;r&&n&&(Ig().setConfig({blankCanvasSize:{width:r,height:n}}),jg().canvas.openNew(r,n,i),Ig().togglePanel("newImage",!1),jg().history.addInitial())},children:[(0,i.jsx)(AA,{type:"number",label:(0,i.jsx)(WS,{message:"Width"}),value:t.width,min:1,required:!0,className:"mb-16",onChange:e=>{r({...t,width:e.target.valueAsNumber})}}),(0,i.jsx)(AA,{type:"number",label:(0,i.jsx)(WS,{message:"Height"}),value:t.height,min:1,required:!0,className:"mb-16",onChange:e=>{r({...t,height:e.target.valueAsNumber})}}),(0,i.jsx)(xj,{onChange:e=>{r({...t,bgColor:e})},className:"mb-16",value:t.bgColor,label:(0,i.jsx)(WS,{message:"Background color"})}),(0,i.jsxs)("div",{className:"text-right",children:[(0,i.jsx)(AC,{size:"sm",variant:"text",className:"mr-10",onClick:()=>{e("default")},children:(0,i.jsx)(WS,{message:"Cancel"})}),(0,i.jsx)(AC,{size:"sm",type:"submit",variant:"raised",color:"primary",children:(0,i.jsx)(WS,{message:"Create"})})]})]})}const KF=(0,o.forwardRef)((e,t)=>{const r=pA(e),{label:n,children:a,size:s,className:l,orientation:c="horizontal",disabled:u,required:d,invalid:h,errorMessage:f,description:p}=e,g=(0,o.useId)(),m=e.name||g;return(0,i.jsxs)("fieldset",{"aria-describedby":p?`${g}-description`:void 0,ref:t,className:gh("text-left",l),children:[n&&(0,i.jsx)("legend",{className:r.label,children:n}),(0,i.jsx)("div",{className:gh("flex",n?"mt-6":"mt-0","vertical"===c?"flex-col gap-10":"flex-row gap-16"),children:o.Children.map(a,e=>{if((0,o.isValidElement)(e))return(0,o.cloneElement)(e,{name:m,size:s,invalid:e.props.invalid||h||void 0,disabled:e.props.disabled||u,required:e.props.required||d})})}),p&&!f&&(0,i.jsx)("div",{className:r.description,id:`${g}-description`,children:p}),f&&(0,i.jsx)("div",{className:r.error,children:f})]})}),ZF=(0,o.forwardRef)((e,t)=>{const{children:r,autoFocus:n,size:o,invalid:a,isFirst:s,...l}=e,c=$w(t);_A({autoFocus:n},c);const u=function(e){switch(e){case"xs":return{circle:"h-12 w-12",label:"text-xs"};case"sm":return{circle:"h-16 w-16",label:"text-sm"};case"lg":return{circle:"h-24 w-24",label:"text-lg"};default:return{circle:"h-20 w-20",label:"text-base"}}}(o);return(0,i.jsxs)("label",{className:gh("inline-flex gap-8 select-none items-center whitespace-nowrap align-middle",u.label,e.disabled&&"text-disabled pointer-events-none",e.invalid&&"text-danger"),children:[(0,i.jsx)("input",{type:"radio",className:gh("focus-visible:ring outline-none","rounded-full transition-button border-2 appearance-none","border-text-muted disabled:border-disabled-fg checked:border-primary checked:hover:border-primary-dark","before:bg-primary disabled:before:bg-disabled-fg before:hover:bg-primary-dark","before:h-full before:w-full before:block before:rounded-full before:scale-10 before:opacity-0 before:transition before:duration-200","checked:before:scale-[.65] checked:before:opacity-100",u.circle),ref:c,...l}),r&&(0,i.jsx)("span",{children:r})]})});function QF(){const e=Eg(e=>e.openPanels.export);return(0,i.jsx)(wj,{isOpen:e,onOpenChange:e=>{e||Ig().togglePanel("export",!1)},type:"modal",children:(0,i.jsx)(JF,{})})}function JF(){const[e,t]=(0,o.useState)(()=>{var e,t,r,n,i,o;return{filename:(null==(t=null==(e=Ig().config.tools)?void 0:e.export)?void 0:t.defaultName)||"image",format:(null==(n=null==(r=Ig().config.tools)?void 0:r.export)?void 0:n.defaultFormat)||"jpeg",quality:(null==(o=null==(i=Ig().config.tools)?void 0:i.export)?void 0:o.defaultQuality)||.8}});return(0,i.jsx)(vj,{className:"text-center max-w-max text-main",size:"auto",children:(0,i.jsx)(HF,{children:(0,i.jsxs)("form",{onSubmit:t=>{t.preventDefault(),jg().export.save(e.filename,e.format,e.quality),Ig().togglePanel("export",!1)},children:[(0,i.jsx)(AA,{required:!0,size:"sm",label:(0,i.jsx)(WS,{message:"Save As"}),value:e.filename,onChange:r=>{t({...e,filename:r.target.value})}}),(0,i.jsxs)(KF,{size:"sm",className:"my-20","aria-label":"Image format",children:[(0,i.jsx)(ZF,{value:"jpeg",checked:"jpeg"===e.format,onChange:r=>{t({...e,format:r.target.value})},children:"JPEG"}),(0,i.jsx)(ZF,{value:"png",checked:"png"===e.format,onChange:r=>{t({...e,format:r.target.value})},children:"PNG"}),(0,i.jsx)(ZF,{value:"json",checked:"json"===e.format,onChange:r=>{t({...e,format:r.target.value})},children:"JSON"})]}),(0,i.jsx)(Oj,{size:"sm",minValue:.1,step:.1,maxValue:1,value:e.quality,onChange:r=>{t({...e,quality:r})},formatOptions:{style:"percent"},label:(0,i.jsx)(WS,{message:"Quality"})}),(0,i.jsx)(AC,{variant:"raised",color:"primary",type:"submit",className:"mt-20 w-full",size:"sm",children:(0,i.jsx)(WS,{message:"Save"})})]})})})}function eO(){const e=Eg(e=>e.objects.all),t=Eg(e=>e.objects.active.id);return(0,i.jsxs)(gw.div,{...MS,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)(WS,{message:"Objects"}),(0,i.jsx)(jA,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{Ig().togglePanel("objects",!1)},children:(0,i.jsx)(WA,{})})]}),(0,i.jsx)("div",{className:"p-8",children:e.map(e=>{const r=e.id===t,n=e.name;if(!n)return null;const a=Sp[n],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(AC,{onClick:()=>{r||!e.selectable||jg().objects.select(e.id)},variant:"outline",color:r?"primary":null,size:"sm",className:gh("w-full mb-8",(r||!e.selectable)&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)(WS,{...a.name})},e.id)})})]})}function tO(){const e=Eg(e=>e.openPanels.history),t=Eg(e=>e.openPanels.objects);return(0,i.jsxs)("div",{className:"z-modal",children:[(0,i.jsxs)(Cw,{children:[e&&(0,i.jsx)(BF,{},"historyPanel"),t&&(0,i.jsx)(eO,{},"objListPanel")]}),(0,i.jsx)($F,{}),(0,i.jsx)(QF,{})]})}function rO(){return rO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rO.apply(this,arguments)}var nO,iO;function oO(e,t){if(!1===e||null===e||typeof e>"u")throw new Error(t)}function aO(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function sO(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function lO(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function cO(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function uO(e,t){let r=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?r.map((t,r)=>r===e.length-1?t.pathname:t.pathnameBase):r.map(e=>e.pathnameBase)}function dO(e,t,r,n){let i;void 0===n&&(n=!1),"string"==typeof e?i=sO(e):(i=rO({},e),oO(!i.pathname||!i.pathname.includes("?"),cO("?","pathname","search",i)),oO(!i.pathname||!i.pathname.includes("#"),cO("#","pathname","hash",i)),oO(!i.search||!i.search.includes("#"),cO("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:i=""}="string"==typeof e?sO(e):e;return{pathname:r?r.startsWith("/")?r:lO(r,t):t,search:fO(n),hash:pO(i)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(nO||(nO={})),function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(iO||(iO={}));const hO=e=>e.join("/").replace(/\/\/+/g,"/"),fO=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",pO=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",gO=["post","put","patch","delete"];new Set(gO);const mO=["get",...gO];function vO(){return vO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vO.apply(this,arguments)}new Set(mO);const yO=o.createContext(null),bO=o.createContext(null),wO=o.createContext(null),xO=o.createContext({outlet:null,matches:[],isDataRoute:!1});function CO(){return null!=o.useContext(wO)}function _O(){return CO()||oO(!1),o.useContext(wO).location}function SO(e){o.useContext(bO).static||o.useLayoutEffect(e)}function AO(e,t){let{relative:r}=void 0===t?{}:t,{future:n}=o.useContext(bO),{matches:i}=o.useContext(xO),{pathname:a}=_O(),s=JSON.stringify(uO(i,n.v7_relativeSplatPath));return o.useMemo(()=>dO(e,JSON.parse(s),a,"path"===r),[e,s,a,r])}var kO=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(kO||{}),EO=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(EO||{});function IO(){return IO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IO.apply(this,arguments)}new Promise(()=>{});const jO=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const TO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",FO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,OO=o.forwardRef(function(e,t){let r,{onClick:n,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&(i[r]=e[r]);return i}(e,jO),{basename:p}=o.useContext(bO),g=!1;if("string"==typeof u&&FO.test(u)&&(r=u,TO))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=function(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}(t.pathname,p);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:g=!0}catch{}let m=function(e,t){let{relative:r}=void 0===t?{}:t;CO()||oO(!1);let{basename:n,navigator:i}=o.useContext(bO),{hash:a,pathname:s,search:l}=AO(e,{relative:r}),c=s;return"/"!==n&&(c="/"===s?n:hO([n,s])),i.createHref({pathname:c,search:l,hash:a})}(u,{relative:i}),v=function(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=function(){let{isDataRoute:e}=o.useContext(xO);return e?function(){let{router:e}=function(){let e=o.useContext(yO);return e||oO(!1),e}(kO.UseNavigateStable),t=function(){let e=function(){let e=o.useContext(xO);return e||oO(!1),e}(),t=e.matches[e.matches.length-1];return t.route.id||oO(!1),t.route.id}(EO.UseNavigateStable),r=o.useRef(!1);return SO(()=>{r.current=!0}),o.useCallback(function(n,i){void 0===i&&(i={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,vO({fromRouteId:t},i)))},[e,t])}():function(){CO()||oO(!1);let e=o.useContext(yO),{basename:t,future:r,navigator:n}=o.useContext(bO),{matches:i}=o.useContext(xO),{pathname:a}=_O(),s=JSON.stringify(uO(i,r.v7_relativeSplatPath)),l=o.useRef(!1);return SO(()=>{l.current=!0}),o.useCallback(function(r,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof r)return void n.go(r);let o=dO(r,JSON.parse(s),a,"path"===i.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:hO([t,o.pathname])),(i.replace?n.replace:n.push)(o,i.state,i)},[t,n,s,a,e])}()}(),u=_O(),d=AO(e,{relative:s});return o.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let r=void 0!==n?n:aO(u)===aO(d);c(e,{replace:r,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,n,i,r,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:i,unstable_viewTransition:h});return o.createElement("a",IO({},f,{href:r||m,onClick:g||a?n:function(e){n&&n(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var MO,PO;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(MO||(MO={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(PO||(PO={}));const RO=yh((0,i.jsx)("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutlineOutlined"),LO=yh((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined"),NO={opacity:0,y:50,scale:.3},DO={opacity:1,y:0,scale:1},zO={opacity:0,scale:.5};function BO(){const e=zg(e=>e.toasts);return(0,i.jsx)("div",{className:"pointer-events-none relative",children:(0,i.jsx)(Cw,{initial:!1,children:e.map(e=>(0,i.jsx)("div",{className:gh("fixed z-toast mx-auto p-20","bottom-center"===e.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:(0,i.jsxs)(gw.div,{initial:e.disableEnterAnimation?void 0:NO,animate:e.disableEnterAnimation?void 0:DO,exit:e.disableExitAnimation?void 0:zO,className:gh("pointer-events-auto mx-auto flex max-h-100 min-h-50 w-min min-w-288 max-w-500 items-center gap-10 rounded-lg border bg-paper bg-paper py-6 pl-16 pr-6 text-sm text-main shadow-lg"),onPointerEnter:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onPointerLeave:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},role:"alert","aria-live":"danger"===e.type?"assertive":"polite",children:["danger"===e.type&&(0,i.jsx)(RO,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===e.type&&(0,i.jsx)(Mj,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===e.type&&(0,i.jsx)(LO,{className:"flex-shrink-0 text-positive",size:"md"}),(0,i.jsx)("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:(0,i.jsx)(FA,{value:e.message})}),e.action&&(0,i.jsx)(AC,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},onClick:()=>Bg().remove(e.id),elementType:OO,to:e.action.action,children:(0,i.jsx)(FA,{value:e.action.label})}),"loading"!==e.type&&(0,i.jsx)(jA,{onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{Bg().remove(e.id)},size:"sm",children:(0,i.jsx)(WA,{})})]})},e.id))})})}function UO(e){return Bw()?e.metaKey:e.ctrlKey}function VO(e){switch(e.key){case"z":UO(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?jg().history.redo():jg().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),jg().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),jg().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),jg().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),jg().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),jg().objects.delete();break;case"v":UO(e)&&(e.preventDefault(),e.stopPropagation(),async function(){try{const e=await navigator.clipboard.read();for(const t of e)for(const e of t.types)if(e.startsWith("image/")){const r=await t.getType(e),n=new FileReader;return n.onload=e=>{var t;null!=(t=e.target)&&t.result&&jg().import.addImageFromData(e.target.result)},void n.readAsDataURL(r)}}catch(e){}}())}}const HO=new Map,WO=new Map,$O={};async function*qO(e){const t=e.createReader();let r;do{r=await new Promise((e,r)=>{t.readEntries(e,r)});for(const e of r)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await GO(e);yield new tC(t,e.fullPath)}else e.isDirectory&&(yield*qO(e))}while(r.length>0)}function GO(e){return new Promise((t,r)=>e.file(t,r))}function YO(e){return null!=$O.dragTargetId?HO.get($O.dragTargetId):e.dataTransfer.types.includes("Files")?{type:"nativeFile",el:null,ref:null,getData:()=>async function(e){const t=[];for await(const r of e)t.push(r);return t}(async function*(e){const t=[];for(const r of e.items)if("file"===r.kind){const e=r.webkitGetAsEntry();e&&t.push(e)}for(const r of t)if(r.isFile){if(".DS_Store"===r.name)continue;const e=await GO(r);yield new tC(e,r.fullPath)}else r.isDirectory&&(yield*qO(r))}(e.dataTransfer))}:void 0}function XO(){const e=Eg(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,t=Eg(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.position})??"bottom",r=Eg(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.position})??"top",n=Eg(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,a=(0,o.useRef)(null),s=(0,o.useRef)(null),{isModal:l,isMobile:c}=$A(),u=(0,o.useCallback)(async e=>{var t,r;if(Ig().activeTool||Ig().dirty||"nativeFile"!==e.type)return;const n=await e.getData();jg().import.fileIsValid(n[0])&&((null==(r=null==(t=Ig().config.tools)?void 0:t.import)?void 0:r.openDroppedImageAsBackground)?await jg().import.openBackgroundImage(n[0]):await jg().import.openUploadedFile(n[0]))},[]),{droppableProps:d}=function({id:e,disabled:t,ref:r,...n}){const i=(0,o.useRef)({dragOverElements:new Set,dropActivateTimer:void 0}).current,a=(0,o.useRef)(n);a.current=n,(0,o.useLayoutEffect)(()=>(WO.set(e,{...WO.get(e),disabled:t,id:e,ref:r}),()=>{WO.delete(e)}),[e,a,t,r]);const s=e=>{var t;const n=a.current,i=n.allowDragEventsFromItself||r.current!==(null==(t=e.ref)?void 0:t.current);return!(!(null!=e&&e.type&&i&&n.types.includes(e.type))||n.acceptsDrop&&!n.acceptsDrop(e))},l=e=>{var t,r;const n=YO(e);n&&(null==(r=(t=a.current).onDragLeave)||r.call(t,n))};return{droppableProps:t?{}:{onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation();const n=YO(e);n&&s(n)&&(null==(r=(t=a.current).onDragOver)||r.call(t,n,e))},onDragEnter:e=>{var t,r;if(e.stopPropagation(),i.dragOverElements.add(e.target),i.dragOverElements.size>1)return;const n=YO(e);n&&s(n)&&(null==(r=(t=a.current).onDragEnter)||r.call(t,n),clearTimeout(i.dropActivateTimer),"function"==typeof a.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;n&&(null==(t=(e=a.current).onDropActivate)||t.call(e,n))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const r of i.dragOverElements)e.currentTarget.contains(r)||i.dragOverElements.delete(r);if(i.dragOverElements.size>0)return;const t=YO(e);t&&s(t)&&(l(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,r,n,o;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),l(e),clearTimeout(i.dropActivateTimer);const c=YO(e);c&&(null==(r=(t=a.current).onDragLeave)||r.call(t,c),s(c)&&(null==(o=(n=a.current).onDrop)||o.call(n,c)))}}}}({id:"pixie-root",ref:s,types:["nativeFile"],onDrop:u});(0,o.useEffect)(()=>{var e,t;Ig().fabric||(Eg.setState({canvasRef:a}),function(e){const t=function(e){var t;const r=new Qw.fabric.Canvas(e,{width:1,height:1});r.preserveObjectStacking=!0,r.selection=!1,r.renderOnAddRemove=!1;const n=Ig().config.textureSize;n&&(Qw.fabric.textureSize=n);const i={...null==(t=Ig().config.objectDefaults)?void 0:t.global,...ex};Object.keys(i).forEach(e=>{Qw.fabric.Object.prototype[e]=i[e]}),r.on("object:added",e=>{var t,r;e.target&&(null==(r=null==(t=e.target)?void 0:t.data)||!r.id)&&(e.target.data||(e.target.data={}),e.target.data.id=tx(10))});const o=Qw.fabric.Object.prototype.controls;return Object.keys(o).forEach(e=>{delete o[e]}),r}(e);Ig().editor.fabric=t,Eg.setState({fabric:t}),Ig().editor.tools={canvas:new sx,objects:new fx,zoom:new ix,history:new Cx,filter:new Ix,resize:new Rx,crop:new Dx,merge:new _x,shape:new zx,frame:new Wx,text:new $x,draw:new Qx,transform:new mC,import:new cC,watermark:new dC,export:new pC,corners:new gC}}(a.current),null!=(e=Ig().config.ui)&&e.defaultTool&&Ig().setActiveTool(null==(t=Ig().config.ui)?void 0:t.defaultTool,null),jg().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=Ig().config).onLoad)||t.call(e,Ig().editor)}));const r=vC(s,()=>{Ig().setStageSize(yC(s.current))}),n=vC(a,()=>{Ig().setCanvasSize(yC(a.current))});return()=>{r(),n()}},[s]);const h=gh("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!l,"fixed inset-0 w-full h-full z-20":l,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":l&&!c});return(0,i.jsxs)(_w,{features:Aw,strict:!0,children:[l&&e&&!c&&n&&(0,i.jsx)(jA,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{Ig().editor.close()},children:(0,i.jsx)(WA,{})}),l&&e&&(0,i.jsx)(NS,{position:"fixed",disableInitialTransition:!0}),(0,i.jsxs)(gw.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:e?"visible":"hidden",className:h,children:["top"===r&&(0,i.jsx)(QA,{}),"top"===t&&(0,i.jsx)(NF,{className:"pt-14"}),(0,i.jsxs)("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...Nw(d,{onKeyDownCapture:VO}),ref:s,children:[(0,i.jsx)(ek,{}),(0,i.jsx)(EE,{ref:a})]}),(0,i.jsx)(ET,{}),"bottom"===t&&(0,i.jsx)(NF,{}),"bottom"===r&&(0,i.jsx)(QA,{}),(0,i.jsx)(tO,{}),(0,i.jsx)(BO,{})]})]})}!function(){fabric.Object.ENLIVEN_PROPS.push("eraser");var e=fabric.Object.prototype._drawClipPath,t=fabric.Object.prototype.needsItsOwnCache,r=fabric.Object.prototype.toObject,n=fabric.Object.prototype.getSvgCommons,i=fabric.Object.prototype._createBaseClipPathSVGMarkup,o=fabric.Object.prototype._createBaseSVGMarkup;fabric.Object.prototype.cacheProperties.push("eraser"),fabric.Object.prototype.stateProperties.push("eraser"),fabric.util.object.extend(fabric.Object.prototype,{erasable:!0,eraser:void 0,needsItsOwnCache:function(){return t.call(this)||!!this.eraser},_drawClipPath:function(t,r){if(e.call(this,t,r),this.eraser){var n=this._getNonTransformedDimensions();this.eraser.isType("eraser")&&this.eraser.set({width:n.x,height:n.y}),e.call(this,t,this.eraser)}},toObject:function(e){var t=r.call(this,["erasable"].concat(e));return this.eraser&&!this.eraser.excludeFromExport&&(t.eraser=this.eraser.toObject(e)),t},getSvgCommons:function(){return n.call(this)+(this.eraser?'mask="url(#'+this.eraser.clipPathId+')" ':"")},_createEraserSVGMarkup:function(e){return this.eraser?(this.eraser.clipPathId="MASK_"+fabric.Object.__uid++,['<mask id="',this.eraser.clipPathId,'" >',this.eraser.toSVG(e),"</mask>","\n"].join("")):""},_createBaseClipPathSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),i.call(this,e,t)].join("")},_createBaseSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),o.call(this,e,t)].join("")}});var a=fabric.Group.prototype._restoreObjectsState;fabric.util.object.extend(fabric.Group.prototype,{_addEraserPathToObjects:function(e){this._objects.forEach(function(t){fabric.EraserBrush.prototype._addPathToObjectEraser.call(fabric.EraserBrush.prototype,t,e)})},applyEraserToObjects:function(){var e=this,t=this.eraser;if(t){delete this.eraser;var r=e.calcTransformMatrix();t.clone(function(t){var n=e.clipPath;t.getObjects("path").forEach(function(t){var i=fabric.util.multiplyTransformMatrices(r,t.calcTransformMatrix());fabric.util.applyTransformToObject(t,i),n?n.clone(function(n){var i=fabric.EraserBrush.prototype.applyClipPathToPath.call(fabric.EraserBrush.prototype,t,n,r);e._addEraserPathToObjects(i)},["absolutePositioned","inverted"]):e._addEraserPathToObjects(t)})})}},_restoreObjectsState:function(){return!0===this.erasable&&this.applyEraserToObjects(),a.call(this)}}),fabric.Eraser=fabric.util.createClass(fabric.Group,{type:"eraser",originX:"center",originY:"center",drawObject:function(e){e.save(),e.fillStyle="black",e.fillRect(-this.width/2,-this.height/2,this.width,this.height),e.restore(),this.callSuper("drawObject",e)},_getBounds:function(){},_toSVG:function(e){var t=["<g ","COMMON_PARTS"," >\n"],r=["<rect ",'fill="white" ','x="',-this.width/2,'" y="',-this.height/2,'" width="',this.width,'" height="',this.height,'" />\n'].join("");t.push("\t\t",r);for(var n=0,i=this._objects.length;n<i;n++)t.push("\t\t",this._objects[n].toSVG(e));return t.push("</g>\n"),t}}),fabric.Eraser.fromObject=function(e,t){var r=e.objects;fabric.util.enlivenObjects(r,function(r){var n=fabric.util.object.clone(e,!0);delete n.objects,fabric.util.enlivenObjectEnlivables(e,n,function(){t&&t(new fabric.Eraser(r,n,!0))})})};var s=fabric.Canvas.prototype._renderOverlay;fabric.util.object.extend(fabric.Canvas.prototype,{isErasing:function(){return this.isDrawingMode&&this.freeDrawingBrush&&"eraser"===this.freeDrawingBrush.type&&this.freeDrawingBrush._isErasing},_renderOverlay:function(e){s.call(this,e),this.isErasing()&&!this.freeDrawingBrush.inverted&&this.freeDrawingBrush._render()}}),fabric.EraserBrush=fabric.util.createClass(fabric.PencilBrush,{type:"eraser",inverted:!1,_isErasing:!1,_isErasable:function(e){return!1!==e.erasable},_prepareCollectionTraversal:function(e,t,r){e.forEachObject(function(n){n.forEachObject&&"deep"===n.erasable?this._prepareCollectionTraversal(n,t,r):!this.inverted&&n.erasable&&n.visible?(n.visible=!1,e.dirty=!0,r.visibility.push(n),r.collection.push(e)):this.inverted&&n.visible&&(n.erasable&&n.eraser?(n.eraser.inverted=!0,n.dirty=!0,e.dirty=!0,r.eraser.push(n),r.collection.push(e)):(n.visible=!1,e.dirty=!0,r.visibility.push(n),r.collection.push(e)))},this)},preparePattern:function(){this._patternCanvas||(this._patternCanvas=fabric.util.createCanvasElement());var e=this._patternCanvas;e.width=this.canvas.width,e.height=this.canvas.height;var t=e.getContext("2d");if(this.canvas._isRetinaScaling()){var r=this.canvas.getRetinaScaling();this.canvas.__initRetinaScaling(r,e,t)}var n=this.canvas.backgroundImage,i=n&&this._isErasable(n),o=this.canvas.overlayImage,a=o&&this._isErasable(o);if(!this.inverted&&(n&&!i||this.canvas.backgroundColor))i&&(this.canvas.backgroundImage=void 0),this.canvas._renderBackground(t),i&&(this.canvas.backgroundImage=n);else if(this.inverted&&n&&i){var l=this.canvas.backgroundColor;this.canvas.backgroundColor=void 0,this.canvas._renderBackground(t),this.canvas.backgroundColor=l}t.save(),t.transform.apply(t,this.canvas.viewportTransform);var c={visibility:[],eraser:[],collection:[]};this._prepareCollectionTraversal(this.canvas,t,c),this.canvas._renderObjects(t,this.canvas._objects),c.visibility.forEach(function(e){e.visible=!0}),c.eraser.forEach(function(e){e.eraser.inverted=!1,e.dirty=!0}),c.collection.forEach(function(e){e.dirty=!0}),t.restore(),!this.inverted&&(o&&!a||this.canvas.overlayColor)?(a&&(this.canvas.overlayImage=void 0),s.call(this.canvas,t),a&&(this.canvas.overlayImage=o)):this.inverted&&o&&a&&(l=this.canvas.overlayColor,this.canvas.overlayColor=void 0,s.call(this.canvas,t),this.canvas.overlayColor=l)},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle="black"},_saveAndTransform:function(e){this.callSuper("_saveAndTransform",e),this._setBrushStyles(e),e.globalCompositeOperation=e===this.canvas.getContext()?"destination-out":"source-over"},needsFullRender:function(){return!0},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this.preparePattern(),this._isErasing=!0,this.canvas.fire("erasing:start"),this._render())},_render:function(){var e;this.inverted||(e=this.canvas.getContext(),this.callSuper("_render",e)),e=this.canvas.contextTop,this.canvas.clearContext(e),this.callSuper("_render",e),e.save();var t=1/this.canvas.getRetinaScaling();e.scale(t,t),e.globalCompositeOperation="source-in",e.drawImage(this._patternCanvas,0,0),e.restore()},createPath:function(e){var t=this.callSuper("createPath",e);return t.globalCompositeOperation=this.inverted?"source-over":"destination-out",t.stroke=this.inverted?"white":"black",t},applyClipPathToPath:function(e,t,r){var n=fabric.util.invertTransform(e.calcTransformMatrix()),i=t.calcTransformMatrix(),o=t.absolutePositioned?n:fabric.util.multiplyTransformMatrices(n,r);return t.absolutePositioned=!1,fabric.util.applyTransformToObject(t,fabric.util.multiplyTransformMatrices(o,i)),e.clipPath=e.clipPath?fabric.util.mergeClipPaths(t,e.clipPath):t,e},clonePathWithClipPath:function(e,t,r){var n=t.calcTransformMatrix(),i=t.clipPath,o=this;e.clone(function(e){i.clone(function(t){r(o.applyClipPathToPath(e,t,n))},["absolutePositioned","inverted"])})},_addPathToObjectEraser:function(e,t){var r=this;if(e.forEachObject&&"deep"===e.erasable){var n=e._objects.filter(function(e){return e.erasable});n.length>0&&e.clipPath?this.clonePathWithClipPath(t,e,function(e){n.forEach(function(t){r._addPathToObjectEraser(t,e)})}):n.length>0&&n.forEach(function(e){r._addPathToObjectEraser(e,t)})}else{var i=e.eraser;i||(i=new fabric.Eraser,e.eraser=i),t.clone(function(t){var n=fabric.util.multiplyTransformMatrices(fabric.util.invertTransform(e.calcTransformMatrix()),t.calcTransformMatrix());fabric.util.applyTransformToObject(t,n),i.addWithUpdate(t),e.set("dirty",!0),e.fire("erasing:end",{path:t}),e.group&&Array.isArray(r.__subTargets)&&r.__subTargets.push(e)})}},applyEraserToCanvas:function(e){var t=this.canvas,r={};return["backgroundImage","overlayImage"].forEach(function(n){var i=t[n];i&&i.erasable&&(this._addPathToObjectEraser(i,e),r[n]=i)},this),r},_finalizeAndAddPath:function(){var e=this.canvas.contextTop,t=this.canvas;e.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate)),t.clearContext(t.contextTop),this._isErasing=!1;var r=this._points&&this._points.length>1?this.convertPointsToSVGPath(this._points):null;if(!r||this._isEmptySVGPath(r))return t.fire("erasing:end"),void t.requestRenderAll();var n=this.createPath(r);n.setCoords(),t.fire("before:path:created",{path:n});var i=this.applyEraserToCanvas(n),o=this;this.__subTargets=[];var a=[];t.forEachObject(function(e){e.erasable&&e.intersectsWithObject(n,!0,!0)&&(o._addPathToObjectEraser(e,n),a.push(e))}),t.fire("erasing:end",{path:n,targets:a,subTargets:this.__subTargets,drawables:i}),delete this.__subTargets,t.requestRenderAll(),this._resetShadow(),t.fire("path:created",{path:n})}})}(),Xs(!1);const KO=class e{constructor(e){if(zs(this,"tools",{}),zs(this,"fabric",null),e.sentryDsn&&function(e){const t={...e};qu(t,"react"),rh(t)}({dsn:e.sentryDsn}),function(e,t){void 0===t&&(t={});var r=t.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/.pi *,.pi :after,.pi :before{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));border-style:solid;border-width:0;box-sizing:border-box}.pi :after,.pi :before{--tw-content:""}.pi hr{border-top-width:1px;color:inherit;height:0}.pi abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6{font-size:inherit;font-weight:inherit}.pi a{color:inherit;text-decoration:inherit}.pi b,.pi strong{font-weight:bolder}.pi code,.pi kbd,.pi pre,.pi samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.pi small{font-size:80%}.pi sub,.pi sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.pi sub{bottom:-.25em}.pi sup{top:-.5em}.pi table{border-collapse:collapse;border-color:inherit;text-indent:0}.pi button,.pi input,.pi optgroup,.pi select,.pi textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}.pi button,.pi select{text-transform:none}.pi [type=button],.pi [type=reset],.pi [type=submit],.pi button{-webkit-appearance:button;background-color:transparent;background-image:none}.pi :-moz-focusring{outline:auto}.pi :-moz-ui-invalid{box-shadow:none}.pi progress{vertical-align:baseline}.pi ::-webkit-inner-spin-button,.pi ::-webkit-outer-spin-button{height:auto}.pi [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.pi ::-webkit-search-decoration{-webkit-appearance:none}.pi ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.pi summary{display:list-item}.pi blockquote,.pi dd,.pi dl,.pi figure,.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6,.pi hr,.pi p,.pi pre{margin:0}.pi fieldset{margin:0;padding:0}.pi legend{padding:0}.pi menu,.pi ol,.pi ul{list-style:none;margin:0;padding:0}.pi textarea{resize:vertical}.pi input::-moz-placeholder,.pi textarea::-moz-placeholder{color:#9ca3af;opacity:1}.pi input::placeholder,.pi textarea::placeholder{color:#9ca3af;opacity:1}.pi [role=button],.pi button{cursor:pointer}.pi :disabled{cursor:default}.pi audio,.pi canvas,.pi embed,.pi iframe,.pi img,.pi object,.pi svg,.pi video{display:block;vertical-align:middle}.pi img,.pi video{height:auto;max-width:100%}.pi [hidden]{display:none}.pi *,.pi :after,.pi :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi .\\!container{width:100%!important}.pi .container{width:100%}@media (min-width:640px){.pi .\\!container{max-width:640px!important}.pi .container{max-width:640px}}@media (min-width:768px){.pi .\\!container{max-width:768px!important}.pi .container{max-width:768px}}@media (min-width:1024px){.pi .\\!container{max-width:1024px!important}.pi .container{max-width:1024px}}@media (min-width:1280px){.pi .\\!container{max-width:1280px!important}.pi .container{max-width:1280px}}@media (min-width:1536px){.pi .\\!container{max-width:1536px!important}.pi .container{max-width:1536px}}.pi .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pi .pointer-events-none{pointer-events:none}.pi .pointer-events-auto{pointer-events:auto}.pi .\\!visible{visibility:visible!important}.pi .visible{visibility:visible}.pi .invisible{visibility:hidden}.pi .collapse{visibility:collapse}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .inset-0{top:0;right:0;bottom:0;left:0}.pi .inset-x-0{left:0;right:0}.pi .-bottom-10{bottom:-10px}.pi .-bottom-20{bottom:-20px}.pi .-bottom-5{bottom:-5px}.pi .-left-5{left:-5px}.pi .-left-8{left:-8px}.pi .-left-80{left:-80px}.pi .-right-5{right:-5px}.pi .-top-144{top:-144px}.pi .-top-40{top:-40px}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .bottom-20{bottom:20px}.pi .left-0{left:0}.pi .left-1\\/2{left:50%}.pi .left-20{left:20px}.pi .right-0{right:0}.pi .right-16{right:16px}.pi .right-2{right:2px}.pi .right-20{right:20px}.pi .right-4{right:4px}.pi .top-0{top:0}.pi .top-1\\/2{top:50%}.pi .top-2{top:2px}.pi .isolate{isolation:isolate}.pi .z-10{z-index:10}.pi .z-20{z-index:20}.pi .z-50{z-index:50}.pi .z-cropzone{z-index:10}.pi .z-loading-indicator{z-index:50}.pi .z-modal{z-index:110}.pi .z-navbar{z-index:40}.pi .z-obj-box{z-index:20}.pi .z-popover{z-index:130}.pi .z-toast{z-index:160}.pi .z-tool-overlay{z-index:30}.pi .z-tooltip{z-index:150}.pi .z-tray{z-index:120}.pi .m-auto{margin:auto}.pi .mx-20{margin-left:20px;margin-right:20px}.pi .mx-8{margin-left:8px;margin-right:8px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .my-4{margin-bottom:4px;margin-top:4px}.pi .my-6{margin-bottom:6px;margin-top:6px}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .-ml-1{margin-left:-1px}.pi .-ml-10{margin-left:-10px}.pi .-ml-12{margin-left:-12px}.pi .-ml-3{margin-left:-3px}.pi .-ml-4{margin-left:-4px}.pi .-ml-6{margin-left:-6px}.pi .-mr-4{margin-right:-4px}.pi .-mr-8{margin-right:-8px}.pi .mb-1{margin-bottom:1px}.pi .mb-10{margin-bottom:10px}.pi .mb-16{margin-bottom:16px}.pi .mb-2{margin-bottom:2px}.pi .mb-20{margin-bottom:20px}.pi .mb-24{margin-bottom:24px}.pi .mb-4{margin-bottom:4px}.pi .mb-6{margin-bottom:6px}.pi .mb-8{margin-bottom:8px}.pi .ml-10{margin-left:10px}.pi .ml-12{margin-left:12px}.pi .ml-4{margin-left:4px}.pi .ml-6{margin-left:6px}.pi .ml-8{margin-left:8px}.pi .ml-auto{margin-left:auto}.pi .mr-10{margin-right:10px}.pi .mr-16{margin-right:16px}.pi .mr-20{margin-right:20px}.pi .mr-4{margin-right:4px}.pi .mr-5{margin-right:5px}.pi .mr-6{margin-right:6px}.pi .mr-8{margin-right:8px}.pi .mr-auto{margin-right:auto}.pi .mt-0{margin-top:0}.pi .mt-10{margin-top:10px}.pi .mt-14{margin-top:14px}.pi .mt-20{margin-top:20px}.pi .mt-24{margin-top:24px}.pi .mt-4{margin-top:4px}.pi .mt-6{margin-top:6px}.pi .box-content{box-sizing:content-box}.pi .block{display:block}.pi .inline-block{display:inline-block}.pi .inline{display:inline}.pi .flex{display:flex}.pi .inline-flex{display:inline-flex}.pi .grid{display:grid}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-1{height:1px}.pi .h-12{height:12px}.pi .h-128{height:128px}.pi .h-14{height:14px}.pi .h-16{height:16px}.pi .h-18{height:18px}.pi .h-2{height:2px}.pi .h-2\\/4{height:50%}.pi .h-20{height:20px}.pi .h-22{height:22px}.pi .h-24{height:24px}.pi .h-26{height:26px}.pi .h-28{height:28px}.pi .h-3{height:3px}.pi .h-30{height:30px}.pi .h-32{height:32px}.pi .h-36{height:36px}.pi .h-38{height:2.375rem}.pi .h-4{height:4px}.pi .h-40{height:40px}.pi .h-42{height:42px}.pi .h-48{height:48px}.pi .h-50{height:50px}.pi .h-56{height:56px}.pi .h-6{height:6px}.pi .h-60{height:60px}.pi .h-64{height:64px}.pi .h-68{height:68px}.pi .h-8{height:8px}.pi .h-80{height:80px}.pi .h-84{height:84px}.pi .h-92{height:92px}.pi .h-\\[54px\\]{height:54px}.pi .h-font{height:1em}.pi .h-full{height:100%}.pi .h-px{height:1px}.pi .h-screen{height:100dvh}.pi .max-h-100{max-height:6.25rem}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-dialog{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-full{max-height:100%}.pi .max-h-inherit{max-height:inherit}.pi .max-h-tray{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .min-h-24{min-height:24px}.pi .min-h-30{min-height:30px}.pi .min-h-36{min-height:36px}.pi .min-h-42{min-height:42px}.pi .min-h-50{min-height:50px}.pi .min-h-60{min-height:60px}.pi .min-h-86{min-height:86px}.pi .\\!w-auto{width:auto!important}.pi .w-1\\/2{width:50%}.pi .w-110{width:110px}.pi .w-12{width:12px}.pi .w-1280{width:80rem}.pi .w-14{width:14px}.pi .w-144{width:144px}.pi .w-16{width:16px}.pi .w-18{width:18px}.pi .w-2{width:2px}.pi .w-20{width:20px}.pi .w-22{width:22px}.pi .w-224{width:224px}.pi .w-24{width:24px}.pi .w-256{width:256px}.pi .w-26{width:26px}.pi .w-28{width:28px}.pi .w-280{width:17.5rem}.pi .w-30{width:30px}.pi .w-32{width:32px}.pi .w-320{width:320px}.pi .w-36{width:36px}.pi .w-38{width:2.375rem}.pi .w-384{width:384px}.pi .w-40{width:40px}.pi .w-42{width:42px}.pi .w-440{width:27.5rem}.pi .w-46{width:2.875rem}.pi .w-50{width:50px}.pi .w-56{width:56px}.pi .w-60{width:60px}.pi .w-620{width:38.75rem}.pi .w-64{width:64px}.pi .w-68{width:68px}.pi .w-780{width:48.75rem}.pi .w-8{width:8px}.pi .w-80{width:80px}.pi .w-850{width:53.125rem}.pi .w-96{width:96px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-auto{width:auto}.pi .w-font{width:1em}.pi .w-full{width:100%}.pi .w-max{width:-moz-max-content;width:max-content}.pi .w-min{width:-moz-min-content;width:min-content}.pi .w-px{width:1px}.pi .w-screen{width:100vw}.pi .min-w-0{min-width:0}.pi .min-w-128{min-width:128px}.pi .min-w-180{min-width:11.25rem}.pi .min-w-192{min-width:192px}.pi .min-w-288{min-width:288px}.pi .min-w-30{min-width:30px}.pi .min-w-4{min-width:4px}.pi .min-w-42{min-width:42px}.pi .min-w-92{min-width:92px}.pi .min-w-min{min-width:-moz-min-content;min-width:min-content}.pi .max-w-112{max-width:112px}.pi .max-w-240{max-width:240px}.pi .max-w-288{max-width:288px}.pi .max-w-320{max-width:320px}.pi .max-w-375{max-width:375px}.pi .max-w-500{max-width:31.25rem}.pi .max-w-\\[90\\%\\]{max-width:90%}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-dialog{max-width:calc(var(--be-viewport-width, 100vw)*.9)}.pi .max-w-full{max-width:100%}.pi .max-w-max{max-width:-moz-max-content;max-width:max-content}.pi .flex-\\[1_1_60px\\]{flex:1 1 60px}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .origin-\\[0_55\\%\\]{transform-origin:0 55%}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .-translate-x-1\\/2{--tw-translate-x:-50%}.pi .-translate-x-1\\/2,.pi .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .-translate-y-1\\/2{--tw-translate-y:-50%}.pi .rotate-0{--tw-rotate:0deg}.pi .rotate-0,.pi .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-180{--tw-rotate:180deg}.pi .rotate-45{--tw-rotate:45deg}.pi .rotate-45,.pi .rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-90{--tw-rotate:90deg}.pi .scale-y-\\[0\\.6\\]{--tw-scale-y:.6}.pi .scale-y-\\[0\\.6\\],.pi .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .cursor-default{cursor:default}.pi .cursor-move{cursor:move}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-not-allowed{cursor:not-allowed}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-pointer{cursor:pointer}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.pi .grid-cols-5-min-content{grid-template-columns:repeat(5,min-content)}.pi .flex-row{flex-direction:row}.pi .flex-col{flex-direction:column}.pi .flex-col-reverse{flex-direction:column-reverse}.pi .flex-wrap{flex-wrap:wrap}.pi .flex-nowrap{flex-wrap:nowrap}.pi .items-start{align-items:flex-start}.pi .items-end{align-items:flex-end}.pi .items-center{align-items:center}.pi .items-stretch{align-items:stretch}.pi .justify-start{justify-content:flex-start}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-10{gap:10px}.pi .gap-14{gap:14px}.pi .gap-16{gap:16px}.pi .gap-18{gap:18px}.pi .gap-20{gap:20px}.pi .gap-36{gap:36px}.pi .gap-4{gap:4px}.pi .gap-40{gap:40px}.pi .gap-6{gap:6px}.pi .gap-8{gap:8px}.pi .space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.pi .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.pi .overflow-x-auto{overflow-x:auto}.pi .overflow-y-auto{overflow-y:auto}.pi .overflow-x-hidden{overflow-x:hidden}.pi .overflow-y-hidden{overflow-y:hidden}.pi .overscroll-contain{overscroll-behavior:contain}.pi .truncate{overflow:hidden;white-space:nowrap}.pi .overflow-ellipsis,.pi .text-ellipsis,.pi .truncate{text-overflow:ellipsis}.pi .whitespace-normal{white-space:normal}.pi .whitespace-nowrap{white-space:nowrap}.pi .break-words{overflow-wrap:break-word}.pi .rounded{border-radius:4px}.pi .rounded-2xl{border-radius:16px}.pi .rounded-3xl{border-radius:24px}.pi .rounded-button{border-radius:var(--be-button-radius,.25rem)}.pi .rounded-full{border-radius:9999px}.pi .rounded-input{border-radius:var(--be-input-radius,.25rem)}.pi .rounded-lg{border-radius:8px}.pi .rounded-md{border-radius:6px}.pi .rounded-none{border-radius:0}.pi .rounded-panel{border-radius:var(--be-panel-radius,.25rem)}.pi .rounded-xl{border-radius:12px}.pi .rounded-l{border-bottom-left-radius:4px;border-top-left-radius:4px}.pi .rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.pi .rounded-l-input{border-bottom-left-radius:var(--be-input-radius,.25rem);border-top-left-radius:var(--be-input-radius,.25rem)}.pi .rounded-l-none{border-bottom-left-radius:0;border-top-left-radius:0}.pi .rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.pi .rounded-r-input{border-bottom-right-radius:var(--be-input-radius,.25rem);border-top-right-radius:var(--be-input-radius,.25rem)}.pi .rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.pi .rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-tr-none{border-top-right-radius:0}.pi .border{border-width:1px}.pi .border-2{border-width:2px}.pi .border-4{border-width:4px}.pi .border-\\[3px\\]{border-width:3px}.pi .border-y{border-top-width:1px}.pi .border-b,.pi .border-y{border-bottom-width:1px}.pi .border-b-4{border-bottom-width:4px}.pi .border-l{border-left-width:1px}.pi .border-l-4{border-left-width:4px}.pi .border-r{border-right-width:1px}.pi .border-r-4{border-right-width:4px}.pi .border-t{border-top-width:1px}.pi .border-t-4{border-top-width:4px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-bg-alt{--tw-border-opacity:1;border-color:rgb(var(--be-background-alt)/var(--tw-border-opacity))}.pi .border-chip{--tw-border-opacity:1;border-color:rgb(var(--be-background-chip)/var(--tw-border-opacity))}.pi .border-danger{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-danger\\/50{border-color:#ef444480}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-paper{--tw-border-opacity:1;border-color:rgb(var(--be-paper)/var(--tw-border-opacity))}.pi .border-positive\\/50{border-color:#22c55e80}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-transparent{border-color:transparent}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-white\\/50{border-color:#ffffff80}.pi .border-b-bg{--tw-border-opacity:1;border-bottom-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-b-transparent{border-bottom-color:transparent}.pi .border-r-transparent{border-right-color:transparent}.pi .bg{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .bg-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-background\\/80{background-color:rgb(var(--be-background)/.8)}.pi .bg-black\\/50{background-color:#00000080}.pi .bg-black\\/80{background-color:#000c}.pi .bg-chip{--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-danger{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .bg-danger-lighter{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-fg-base\\/4{background-color:rgb(var(--be-foreground-base)/4%)}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-inherit{background-color:inherit}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg-positive{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pi .bg-positive-lighter{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .bg-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-slider-disabled\\/60{background-color:#bdbdbd99}.pi .bg-toast{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-warning{--tw-bg-opacity:1;background-color:rgb(243 164 50/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-white\\/50{background-color:#ffffff80}.pi .bg-opacity-95{--tw-bg-opacity:.95}.pi .bg-no-repeat{background-repeat:no-repeat}.pi .fill-current{fill:currentColor}.pi .fill-transparent{fill:transparent}.pi .stroke-current{stroke:currentColor}.pi .object-contain{-o-object-fit:contain;object-fit:contain}.pi .object-cover{-o-object-fit:cover;object-fit:cover}.pi .p-0{padding:0}.pi .p-10{padding:10px}.pi .p-14{padding:14px}.pi .p-16{padding:16px}.pi .p-18{padding:18px}.pi .p-2{padding:2px}.pi .p-20{padding:20px}.pi .p-4{padding:4px}.pi .p-40{padding:40px}.pi .p-6{padding:6px}.pi .p-8{padding:8px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .px-12{padding-left:12px;padding-right:12px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .px-4{padding-left:4px;padding-right:4px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-10{padding-bottom:10px;padding-top:10px}.pi .py-12{padding-bottom:12px;padding-top:12px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .py-2{padding-bottom:2px;padding-top:2px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .py-3{padding-bottom:3px;padding-top:3px}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .py-5{padding-bottom:5px;padding-top:5px}.pi .py-6{padding-bottom:6px;padding-top:6px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .pb-10{padding-bottom:10px}.pi .pb-12{padding-bottom:12px}.pi .pb-14{padding-bottom:14px}.pi .pb-16{padding-bottom:16px}.pi .pb-18{padding-bottom:18px}.pi .pb-20{padding-bottom:20px}.pi .pb-4{padding-bottom:4px}.pi .pb-8{padding-bottom:8px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pl-10{padding-left:10px}.pi .pl-12{padding-left:12px}.pi .pl-14{padding-left:14px}.pi .pl-16{padding-left:16px}.pi .pl-18{padding-left:18px}.pi .pl-28{padding-left:28px}.pi .pl-46{padding-left:2.875rem}.pi .pl-54{padding-left:3.375rem}.pi .pl-8{padding-left:8px}.pi .pr-10{padding-right:10px}.pi .pr-12{padding-right:12px}.pi .pr-18{padding-right:18px}.pi .pr-24{padding-right:24px}.pi .pr-28{padding-right:28px}.pi .pr-46{padding-right:2.875rem}.pi .pr-54{padding-right:3.375rem}.pi .pr-6{padding-right:6px}.pi .pr-8{padding-right:8px}.pi .pt-10{padding-top:10px}.pi .pt-12{padding-top:12px}.pi .pt-14{padding-top:14px}.pi .pt-16{padding-top:16px}.pi .pt-20{padding-top:20px}.pi .pt-24{padding-top:24px}.pi .pt-4{padding-top:4px}.pi .pt-40{padding-top:40px}.pi .pt-6{padding-top:6px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-middle{vertical-align:middle}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xl{font-size:20px;line-height:28px}.pi .text-xs{font-size:12px;line-height:16px}.pi .font-bold{font-weight:700}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.pi .uppercase{text-transform:uppercase}.pi .capitalize{text-transform:capitalize}.pi .italic{font-style:italic}.pi .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.pi .leading-5{line-height:1.25rem}.pi .leading-none{line-height:1}.pi .tracking-wide{letter-spacing:.025em}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.pi .text-black\\/30{color:#0000004d}.pi .text-danger{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.pi .text-danger-darker{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-link{--tw-text-opacity:1;color:rgb(var(--be-link-color,var(--be-primary))/var(--tw-text-opacity))}.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-positive{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.pi .text-positive-darker{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.pi .underline{text-decoration-line:underline}.pi .no-underline{text-decoration-line:none}.pi .caret-transparent{caret-color:transparent}.pi .opacity-0{opacity:0}.pi .opacity-100{opacity:1}.pi .opacity-70{opacity:.7}.pi .opacity-80{opacity:.8}.pi .opacity-90{opacity:.9}.pi .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.pi .shadow,.pi .shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.pi .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.pi .shadow-lg,.pi .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.pi .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.pi .shadow-sm,.pi .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.pi .outline-none{outline:2px solid transparent;outline-offset:2px}.pi .outline{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring-inset{--tw-ring-inset:inset}.pi .blur{--tw-blur:blur(8px)}.pi .blur,.pi .grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .grayscale{--tw-grayscale:grayscale(100%)}.pi .invert{--tw-invert:invert(100%)}.pi .invert,.pi .sepia{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .sepia{--tw-sepia:sepia(100%)}.pi .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.pi .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-button{transition-duration:.15s;transition-property:background-color,box-shadow,border-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-width{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .duration-100{transition-duration:.1s}.pi .duration-200{transition-duration:.2s}.pi .will-change-transform{will-change:transform}.pi .icon-2xs{font-size:.75rem}.pi .icon-xs{font-size:1rem}.pi .icon-sm{font-size:1.25rem}.pi .icon-md{font-size:1.5rem}.pi .icon-lg{font-size:2.1875rem}.pi .icon-xl{font-size:2.6875rem}.pi .no-tap-highlight{-webkit-tap-highlight-color:transparent}@media only screen and (min-device-width:768px){.pi .tiny-scrollbar{scrollbar-color:rgba(0,0,0,.2) transparent;scrollbar-width:thin}.pi .tiny-scrollbar::-webkit-scrollbar{background-color:transparent;height:6px;width:6px}.pi .tiny-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--be-foreground-base)/.2);border-radius:10px}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:start{background:transparent}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:end{background:transparent}}.pi .hide-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;display:none;height:0;width:0}.pi .svg-icon{display:inline-block;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;fill:currentColor;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .cropzone:not(.moving) .cropzone-transition{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .first-letter\\:capitalize:first-letter{text-transform:capitalize}.pi .file\\:mr-10::file-selector-button{margin-right:10px}.pi .file\\:h-24::file-selector-button{height:24px}.pi .file\\:rounded::file-selector-button{border-radius:4px}.pi .file\\:border-none::file-selector-button{border-style:none}.pi .file\\:bg-primary::file-selector-button{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .file\\:px-10::file-selector-button{padding-left:10px;padding-right:10px}.pi .file\\:text-sm::file-selector-button{font-size:14px;line-height:20px}.pi .file\\:font-semibold::file-selector-button{font-weight:600}.pi .file\\:text-on-primary::file-selector-button{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .before\\:z-10:before{content:var(--tw-content);z-index:10}.pi .before\\:block:before{content:var(--tw-content);display:block}.pi .before\\:h-12:before{content:var(--tw-content);height:12px}.pi .before\\:h-14:before{content:var(--tw-content);height:14px}.pi .before\\:h-18:before{content:var(--tw-content);height:18px}.pi .before\\:h-22:before{content:var(--tw-content);height:22px}.pi .before\\:h-28:before{content:var(--tw-content);height:28px}.pi .before\\:h-full:before{content:var(--tw-content);height:100%}.pi .before\\:w-12:before{content:var(--tw-content);width:12px}.pi .before\\:w-14:before{content:var(--tw-content);width:14px}.pi .before\\:w-18:before{content:var(--tw-content);width:18px}.pi .before\\:w-22:before{content:var(--tw-content);width:22px}.pi .before\\:w-28:before{content:var(--tw-content);width:28px}.pi .before\\:w-full:before{content:var(--tw-content);width:100%}.pi .before\\:translate-x-2:before{--tw-translate-x:2px}.pi .before\\:scale-10:before,.pi .before\\:translate-x-2:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:scale-10:before{--tw-scale-x:.1;--tw-scale-y:.1}.pi .before\\:rounded-3xl:before{border-radius:24px;content:var(--tw-content)}.pi .before\\:rounded-full:before{border-radius:9999px;content:var(--tw-content)}.pi .before\\:border:before{border-width:1px;content:var(--tw-content)}.pi .before\\:bg-primary:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .before\\:opacity-0:before{content:var(--tw-content);opacity:0}.pi .before\\:transition:before{content:var(--tw-content);transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:transition-transform:before{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.pi .after\\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.pi .after\\:absolute:after{content:var(--tw-content);position:absolute}.pi .after\\:inset-0:after{content:var(--tw-content);top:0;right:0;bottom:0;left:0}.pi .checked\\:border-danger:checked{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .checked\\:border-primary:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .checked\\:bg-danger:checked{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .checked\\:bg-primary:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .checked\\:before\\:translate-x-14:checked:before{--tw-translate-x:14px}.pi .checked\\:before\\:translate-x-14:checked:before,.pi .checked\\:before\\:translate-x-20:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-20:checked:before{--tw-translate-x:20px}.pi .checked\\:before\\:translate-x-24:checked:before{--tw-translate-x:24px}.pi .checked\\:before\\:translate-x-24:checked:before,.pi .checked\\:before\\:translate-x-30:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-30:checked:before{--tw-translate-x:30px}.pi .checked\\:before\\:translate-x-36:checked:before{--tw-translate-x:36px}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before,.pi .checked\\:before\\:translate-x-36:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before{--tw-scale-x:.65;--tw-scale-y:.65}.pi .checked\\:before\\:border-white:checked:before{content:var(--tw-content);--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .checked\\:before\\:opacity-100:checked:before{content:var(--tw-content);opacity:1}.pi .focus-within\\:border-primary\\/60:focus-within{border-color:rgb(var(--be-primary)/.6)}.pi .focus-within\\:ring:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-within\\:ring-primary\\/focus:focus-within{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .hover\\:border-chip\\/90:hover{border-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:border-danger:hover{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .hover\\:border-danger\\/90:hover{border-color:#ef4444e6}.pi .hover\\:border-paper\\/90:hover{border-color:rgb(var(--be-paper)/.9)}.pi .hover\\:border-positive:hover{--tw-border-opacity:1;border-color:rgb(34 197 94/var(--tw-border-opacity))}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .hover\\:border-primary-dark:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .hover\\:bg-chip\\/90:hover{background-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-danger\\/4:hover{background-color:#ef44440a}.pi .hover\\:bg-danger\\/90:hover{background-color:#ef4444e6}.pi .hover\\:bg-fg-base\\/15:hover{background-color:rgb(var(--be-foreground-base)/15%)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-paper\\/90:hover{background-color:rgb(var(--be-paper)/.9)}.pi .hover\\:bg-positive\\/4:hover{background-color:#22c55e0a}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary\\/focus:hover{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .hover\\:bg-white\\/20:hover{background-color:#fff3}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:text-main:hover{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .hover\\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(var(--be-primary-dark)/var(--tw-text-opacity))}.pi .hover\\:underline:hover{text-decoration-line:underline}.pi .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .before\\:hover\\:bg-primary-dark:hover:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:after\\:bg-black\\/5:hover:after{background-color:#0000000d;content:var(--tw-content)}.pi .checked\\:hover\\:border-primary-dark:hover:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .focus\\:border-danger\\/60:focus{border-color:#ef444499}.pi .focus\\:border-primary\\/60:focus{border-color:rgb(var(--be-primary)/.6)}.pi .focus\\:bg-primary:focus{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .focus\\:text-on-primary:focus{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.pi .focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus\\:ring-danger\\/focus:focus{--tw-ring-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .focus\\:ring-primary\\/focus:focus{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus\\:after\\:bg-black\\/10:focus:after{background-color:#0000001a;content:var(--tw-content)}.pi .focus-visible\\:bg-primary\\/focus:focus-visible{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-visible\\:outline:focus-visible{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .focus-visible\\:outline-primary-light:focus-visible{outline-color:rgb(var(--be-primary-light)/1)}.pi .focus-visible\\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.pi .disabled\\:pointer-events-none:disabled{pointer-events:none}.pi .disabled\\:cursor-default:disabled{cursor:default}.pi .disabled\\:border-disabled-bg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:border-disabled-fg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-white\\/70:disabled{border-color:#ffffffb3}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:text-white\\/70:disabled{color:#ffffffb3}.pi .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .disabled\\:before\\:bg-disabled-fg:disabled:before{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity));content:var(--tw-content)}.pi :is(.dark .dark\\:bg-chip){--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi :is(.dark .dark\\:text-white\\/50){color:#ffffff80}.pi :is(.dark .dark\\:checked\\:border-primary-dark:checked){--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi :is(.dark .dark\\:checked\\:bg-primary-dark:checked){--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}@media (min-width:640px){.pi .sm\\:text-sm{font-size:14px;line-height:20px}}@media (min-width:768px){.pi .md\\:text-lg{font-size:18px;line-height:28px}}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-2:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-inset:focus-visible>.tree-label{--tw-ring-inset:inset}\n'),!e.selector)throw new Error('Pixie required "selector" option.');const t=document.querySelector(e.selector);t&&(t.classList.add("pi"),function(e){xg=e,Cg=e}(t),this.setConfig(e),Eg.setState({editor:this}),(0,a.H)(t).render((0,i.jsx)(o.StrictMode,{children:(0,i.jsx)(XO,{})})))}get state(){return Ig()}get defaultConfig(){return e.defaultConfig}open(e={}){return new Promise(async t=>{var r;Object.keys(e).length?await this.resetEditor({...hp(e,{ui:{visible:!0},image:e.image||Ig().config.image,state:e.state||Ig().config.state,blankCanvasSize:e.blankCanvasSize||Ig().config.blankCanvasSize})}):null!=(r=Ig().config.ui)&&r.visible||Ig().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,r;null!=(e=Ig().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(r=(t=Ig().config).onClose)||r.call(t))}setConfig(e){Ig().setConfig(e)}uploadAndAddImage(){return jg().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return jg().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return jg().import.uploadAndOpenStateFile()}newCanvas(e,t,r){return jg().canvas.openNew(e,t,r)}getState(e){return JSON.stringify(Pg(e))}setState(e){return jg().import.loadState(e)}async setStateFromUrl(e){const t=await Og(e);return jg().import.loadState(t)}openTool(e){Rg(e)}applyChanges(){Ig().applyChanges()}cancelChanges(){Ig().cancelChanges()}async resetEditor(e){await Fg(e),await jg().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&Ig().togglePanel("history",!1),"history"===e&&Ig().togglePanel("objects",!1),Ig().togglePanel(e,t)}on(e,t){var r;null==(r=this.fabric)||r.on(e,t)}isDirty(){return Ig().dirty}get(e){return this.tools[e]}notify(e){return Ug(e)}static init(e){return new Promise(t=>{const r=e.onLoad;e.onLoad=e=>{null==r||r(e),t(e)},new this(e)})}};zs(KO,"defaultConfig",Bh),zs(KO,"version","3.0.5");let ZO=KO;function QO(e){if(!this.backgroundColor)return;const t=this._getNonTransformedDimensions(),r=-t.x/2,n=-t.y/2,i=t.x,o=t.y,a=this.backgroundColor;if("string"==typeof a||a instanceof CanvasGradient||a instanceof CanvasPattern)e.fillStyle=a,e.fillRect(r,n,i,o);else if("object"!=typeof a||!("type"in a)||"linear"!==a.type&&"radial"!==a.type){if("source"in a&&(a.source instanceof HTMLImageElement||a.source instanceof HTMLCanvasElement))if(a.repeat){const t=e.createPattern(a.source,a.repeat);t&&(e.fillStyle=t,e.fillRect(r,n,i,o))}else e.drawImage(a.source,r,n,i,o)}else{const t=function(e,t,r,n){var i,o;if("linear"===t.type){const i=e.createLinearGradient(r+t.coords.x1,n+t.coords.y1,r+t.coords.x2,n+t.coords.y2);return t.colorStops.forEach(e=>i.addColorStop(e.offset,e.color)),i}if("radial"===t.type){const a=e.createRadialGradient(r+t.coords.x1,n+t.coords.y1,null!==(i=t.coords.r1)&&void 0!==i?i:0,r+t.coords.x2,n+t.coords.y2,null!==(o=t.coords.r2)&&void 0!==o?o:0);return t.colorStops.forEach(e=>a.addColorStop(e.offset,e.color)),a}throw new Error("Unknown gradient type")}(e,a,r,n);e.fillStyle=t,e.fillRect(r,n,i,o)}this._removeShadow(e)}const JO="fm-pixie-editor",eM=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(JO),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${JO}`}get canvas(){var e,t;return null===(t=null===(e=this._instance)||void 0===e?void 0:e.state.canvasRef)||void 0===t?void 0:t.current}get tools(){var e;return null===(e=this._instance)||void 0===e?void 0:e.tools}isLoaded(){return!!this._instance}async _setConfig(e){var t;this._instance?await this._instance.resetEditor(e):this._instance=await ZO.init(Object.assign(Object.assign({},e),{selector:this.className})),(t=this._instance).fabric&&t.fabric.on("object:added",e=>{const t=e.target;t&&"text"===t.name&&(t._renderBackground=QO)})}async show(e,t,r=t.firstChild){t.insertBefore(this._container,r),await this._setConfig(e),this._instance.open()}close(){var e;null===(e=this._container.parentNode)||void 0===e||e.removeChild(this._container)}};function tM(e,t){return e?t?`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`:e:t}function rM(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const n=function(e){const t=r.p;if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let n=tM(t,e||"");return!n||n.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)||(n="/"+n),n}(e),i=tM(n,t);return!i||i.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(i)?i:"/"+i}var nM,iM;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(nM||(nM={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(iM||(iM={}));const oM=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());function aM(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>{var e;return r(null!==(e=n.error)&&void 0!==e?e:new Error("Failed to convert blob to data URL"))},n.readAsDataURL(e)})}const sM=({visible:e,onClose:t,file:r,onSave:n,onSaveCopy:a})=>{var s;const{t:l}=Sn(),c=o.useRef(null),u=so(),d=Ea(),{options:h,actions:f}=Xi(),{i18n:p}=Sn(),{config:g}=h,{setCurrentMenuFile:v}=f,{getFileData:y,resolveFileForEditByUrl:b}=d,[w,x]=o.useState(!1),[C,_]=o.useState(null),[S,A]=o.useState(""),[k,E]=o.useState(!1),[I,T]=o.useState(!1),[F,O]=o.useState(null),M=o.useRef(!1),P=o.useRef(),R=o.useRef(),L=o.useRef("saveCopy"),N=o.useRef(void 0);P.current=n,R.current=a,o.useEffect(()=>{r&&!M.current&&(async()=>{if(N.current!==r)if("object"!=typeof r){N.current=r,x(!0);try{if(r.startsWith("data:"))O({thumbnail:r,saveWithoutFolder:!0});else{const e=await b(r);N.current===r&&O(e)}}catch(At){N.current===r&&(N.current=null),null==t||t()}finally{x(!1)}}else O(r)})()},[r,t,b]);const D=o.useCallback(async e=>{try{if("string"==typeof e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await y(e.id,!0);if(!t)throw new Error(l("Error loading image"));return new Promise(e=>{const r=new FileReader;r.onload=()=>e(r.result),r.readAsDataURL(t)})}catch(e){throw e}},[y,l]);o.useEffect(()=>{if(!C&&e&&F){let e=!1;const n=async()=>{var n,i,o;x(!0);try{const t=await D(F);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid image data: empty or null");if(!t.startsWith("data:"))throw new Error("Invalid image data: not a valid data URL");const r=t.match(/^data:([^;]+);base64,(.+)$/);if(!r)throw new Error("Invalid image data: malformed data URL format");const[,n,i]=r;if(!n.startsWith("image/"))throw new Error(`Invalid image data: unsupported MIME type ${n}`);if(i.length<10)throw new Error("Invalid image data: base64 content too short");if(!/^[A-Za-z0-9+/]+=*$/.test(i))throw new Error("Invalid image data: corrupted base64 content");if(!e){_(t);const e=aa(F,"image/png");A(e.mimeType)}}catch(r){e||(u.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:r,message:l("Error loading image"),placement:"bottomRight",data:{itemId:null!==(n=null==F?void 0:F.id)&&void 0!==n?n:void 0,itemName:null!==(i=null==F?void 0:F.name)&&void 0!==i?i:void 0,folderId:null!==(o=null==F?void 0:F.folderId)&&void 0!==o?o:null,thumbnail:null==F?void 0:F.thumbnail}}),null==t||t())}finally{x(!1)}};return n(),()=>{e=!0}}},[F,D,C,t,l,e]);const z=o.useCallback(async(e,t,r)=>{var n;let i=await function(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});let r=`image/${e}`;if(t.startsWith("data:")){const e=tr(t);e&&e.startsWith("image/")&&(r=e);const n=t.replace(/data:image\/[^;]+;base64,/,"");return oM(n,er(r))}return oM(t,er(r))}(r,e),o=er(i.type||`image/${r}`);const a=null!==(n=null==g?void 0:g.compessorUrl)&&void 0!==n?n:null==g?void 0:g.compressorUrl;if(o.startsWith("image/"))try{const e=new File([i],t,{type:o}),r=await ma(e,{maxSizeMB:null==g?void 0:g.compressMaxSize,maxWidthOrHeight:null==g?void 0:g.compressMaxWidthOrHeight,mimeType:o,fileName:t,libURL:a,enableCompression:Boolean(g)&&"image/gif"!==o});i=r,o=r.type}catch(e){}return{blob:i,mimeType:o,thumbnailDataUrl:await aM(i)}},[g]),B=o.useCallback(async(e,t,r,n)=>{var i,o,a,s,c,d;const h="save"===n?P.current:R.current;if(!F||!h)return;const f="object"==typeof F&&null!==F?F:null;let p=null;try{x(!0);const{blob:o,mimeType:a,thumbnailDataUrl:s}=await z(e,t,r),c=Object.assign(Object.assign({},F),{thumbnail:s,size:o.size,date:(new Date).toISOString().split("T")[0],type:a,folderId:F.folderId||"",name:F.name||t,extension:F.extension||(null===(i=(F.name||t).split(".").pop())||void 0===i?void 0:i.toLowerCase())||""});p=c;const u={blob:o,mimeType:a,thumbnail:s,mode:n},d=await h(c,u);if(d)return x(!1),d;throw new Error(l("saveCopy"===n?"Failed to save image copy":"Failed to save changes"))}catch(e){const r=null!=p?p:f;if(!(null==e?void 0:e.notificationShown)){const i=fo(e),h=null!==(a=null!==(o=uo(null==i?void 0:i.code,l))&&void 0!==o?o:null==i?void 0:i.message)&&void 0!==a?a:l("saveCopy"===n?"Failed to save image copy":"Error saving image");u.error({id:"saveCopy"===n?"IMAGE_SAVE_COPY_FAILED":"IMAGE_SAVE_FAILED",message:h,placement:"bottomRight",data:{itemId:null!==(s=null==r?void 0:r.id)&&void 0!==s?s:void 0,itemName:null!==(c=null==r?void 0:r.name)&&void 0!==c?c:t,folderId:null!==(d=null==r?void 0:r.folderId)&&void 0!==d?d:null,thumbnail:null==r?void 0:r.thumbnail},innerException:e})}x(!1)}},[F,u,z,l]),U=o.useCallback(async e=>{var t;if(!eM.isLoaded()||!F)return;L.current=e;const r=F.name||"edited-image",n=aa(F,S);try{await(null===(t=eM.tools)||void 0===t?void 0:t.export.save(r.replace(/\.[^/.]+$/,""),n.pixieFormat,sa.QUALITY))}catch(t){try{const t=eM.canvas,i=t?t.toDataURL(n.mimeType):null;i&&await B(i,r,n.extension,e)}catch(e){}}},[F,S,B]),V=o.useCallback(async()=>{var r;if(C&&e&&k&&!M.current)try{M.current=!0;const e=c.current;let n=0;for(;n<20&&(0===e.clientWidth||0===e.clientHeight);)await new Promise(e=>setTimeout(e,50)),n++;const o=(null==g?void 0:g.locale)?null==g?void 0:g.locale.replace("_","-"):"en",a=matchMedia(Wt).matches?Vt:Ut,s=(null==g?void 0:g.theme)===Ht?a:null==g?void 0:g.theme,l=((null==g?void 0:g.locale)||p.language||"en").split("-")[0].split("_")[0],u=(p.getResourceBundle(l,"translation")||{}).pixie||{},d=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),h={};Object.entries(u).forEach(([e,t])=>{const r=d(e);h[r]=t,h[e]=t});const f={[o]:h},m=aa(F,S),v={selector:"#pixie-editor",baseUrl:rM((null==g?void 0:g.baseUrl)||"",(null==g?void 0:g.assetsUrl)||"assets/image-editor"),image:C,activeLanguage:o,languages:f,ui:{activeTheme:s,mode:"inline",forceOverlayModeOnMobile:!1,visible:!0,menubar:{replaceDefaultItems:!0,position:nM.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>(0,i.jsx)(te.A,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>(0,i.jsx)(J.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:t}]},nav:{position:iM.TOP}},tools:{export:{defaultFormat:m.pixieFormat,defaultQuality:sa.QUALITY,defaultName:(null===(r=null==F?void 0:F.name)||void 0===r?void 0:r.replace(/\.[^/.]+$/,""))||"image"},text:{replaceDefaultItems:!0,defaultText:"Handwriting",items:[{family:"Inter",src:"fonts/inter-v20-cyrillic_latin-regular.woff2"},{family:"Commissioner",src:"fonts/commissioner-v24-cyrillic_latin-regular.woff2"},{family:"Montserrat Light",src:"fonts/Montserrat-Light.woff2"},{family:"Montserrat Regular",src:"fonts/Montserrat-Regular.woff2"},{family:"Montserrat Bold",src:"fonts/Montserrat-Bold.woff2"},{family:"Montserrat Black",src:"fonts/Montserrat-Black.woff2"},{family:"Roboto Light",src:"fonts/Roboto-Light.woff2"},{family:"Roboto Regular",src:"fonts/Roboto-Regular.woff2"},{family:"Roboto Bold",src:"fonts/Roboto-Bold.woff2"},{family:"Roboto Black",src:"fonts/Roboto-Black.woff2"},{family:"Lato Light",src:"fonts/Lato-Light.woff2"},{family:"Lato Regular",src:"fonts/Lato-Regular.woff2"},{family:"Lato Bold",src:"fonts/Lato-Bold.woff2"},{family:"Lato Black",src:"fonts/Lato-Black.woff2"},{family:"Rubik Light",src:"fonts/Rubik-Light.woff2"},{family:"Rubik Regular",src:"fonts/Rubik-Regular.woff2"},{family:"Rubik Bold",src:"fonts/Rubik-Bold.woff2"},{family:"Rubik Black",src:"fonts/Rubik-Black.woff2"},{family:"Bebas Neue Light",src:"fonts/BebasNeueLight.woff2"},{family:"Bebas Neue Regular",src:"fonts/BebasNeueRegular.woff2"},{family:"Bebas Neue Book",src:"fonts/BebasNeueBook.woff2"},{family:"Bebas Neue Bold",src:"fonts/BebasNeueBold.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Lobster",src:"fonts/Lobster.woff2"},{family:"Pacifico",src:"fonts/pacifico-v23-cyrillic_latin-regular.woff2"},{family:"Playfair Display",src:"fonts/playfair-display-v40-cyrillic_latin-regular.woff2"},{family:"Oswald",src:"fonts/oswald-v57-cyrillic_latin-regular.woff2"},{family:"Caveat",src:"fonts/caveat-v23-cyrillic_latin-regular.woff2"}]}},onSave:async function(e,t,r){try{return x(!0),await B(e,t,r,L.current)}catch(e){throw x(!1),e}}};try{T(!1),await eM.show(v,c.current);const e=eM.canvas;e&&e.focus(),T(!0),x(!1)}catch(At){}}catch(At){u.error({id:"EDITOR_INIT_FAILED",message:l("Error initializing editor"),placement:"bottomRight",innerException:At}),M.current=!1,null==t||t()}},[F,S,C,e,k,null==g?void 0:g.locale,null==g?void 0:g.theme,null==g?void 0:g.baseUrl,null==g?void 0:g.assetsUrl,t,B,u,p,l]);o.useEffect(()=>{e&&C&&k&&V()},[e,C,k,V]),o.useEffect(()=>{if(!e){try{eM.close()}catch(At){}x(!1),_(null),A(""),M.current=!1,E(!1),T(!1)}return()=>{try{eM.close()}catch(At){}}},[e]);const H=Boolean(null==F?void 0:F.id)&&!1!==(null===(s=null==g?void 0:g.features)||void 0===s?void 0:s.enableUpdateFile);return(0,i.jsx)(j.A,{title:(null==F?void 0:F.name)?l("Editing: {{name}}",{name:F.name}):l("Editing image"),open:e,closeIcon:null,onCancel:t,afterOpenChange:e=>E(e),forceRender:!0,width:"100vw",style:{top:0,height:"100vh",maxWidth:"none",padding:10},styles:{body:{height:"85vh",padding:0}},footer:[(0,i.jsx)(m.Ay,{onClick:t,disabled:!k||w,children:l("Cancel")},"cancel"),(0,i.jsx)(m.Ay,{type:"primary",onClick:()=>U("saveCopy"),loading:w,children:l("Save as copy and choose")},"save-copy"),...H?[(0,i.jsx)(m.Ay,{type:"primary",onClick:()=>U("save"),loading:w,children:l("Save and choose")},"save")]:[]],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{v&&v("")},children:(0,i.jsxs)("div",{ref:c,style:{position:"relative",width:"100%",height:"100%"},children:[e&&!I?(0,i.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.45)",backdropFilter:"blur(1px)",pointerEvents:"all",zIndex:10},children:(0,i.jsx)("span",{style:{fontSize:14,color:"#555"},children:l("Loading editor...")})}):null,w&&I&&(0,i.jsx)(Ts,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})};const{Text:lM}=f.A,cM=({visible:e,files:t,totalFiles:r,completedFiles:n,onClose:o,onMinimize:a,onInsert:s,minimized:c=!1})=>{var u;const{token:d}=l.A.useToken(),{t:h}=Sn();if(!e)return null;const f=e=>{switch(e){case"success":return(0,i.jsx)("div",{className:"uploadProgress__status-icon",children:(0,i.jsx)(re.A,{style:{color:d.colorSuccess}})});case"error":return(0,i.jsx)(ne.A,{style:{color:d.colorError}});default:return(0,i.jsx)(ie.A,{style:{color:"#1890ff"}})}};if(c)return(0,i.jsx)("div",{className:"uploadProgress__minimized",children:(0,i.jsx)(m.Ay,{type:"primary",size:"small",onClick:a,className:"uploadProgress__minimized-button",children:h("Upload progress",{completed:n,total:r})})});const p=t.filter(e=>"uploading"===e.status).length,g=t.filter(e=>"success"===e.status).length,v=t.filter(e=>"error"===e.status).length,y=t.filter(e=>"error"===e.status),b=y.length>1&&y.every(e=>{var t;return e.error&&e.error===(null===(t=y[0])||void 0===t?void 0:t.error)}),w=b?null===(u=y[0])||void 0===u?void 0:u.error:null;return(0,i.jsx)("div",{className:"uploadProgress fm-upload-progress",children:(0,i.jsxs)("div",{className:"uploadProgress__card",children:[(0,i.jsxs)("div",{className:"uploadProgress__header",children:[(0,i.jsx)(lM,{strong:!0,className:"uploadProgress__header-title",children:p>0?h("Uploading files",{completed:n,total:r}):g>0?h("Uploaded files",{success:g,total:r}):h("Upload error files",{errorCount:v})}),(0,i.jsx)("div",{className:"uploadProgress__header-buttons",children:(0,i.jsx)(m.Ay,{type:"text",size:"small",icon:(0,i.jsx)(J.A,{className:"uploadProgress__close-icon"}),onClick:o,className:"uploadProgress__header-button"})})]}),(0,i.jsxs)("div",{className:"uploadProgress__body "+(t.some(e=>"error"===e.status)?"uploadProgress__body--error":""),children:[(0,i.jsx)("div",{className:"uploadProgress__list-wrapper",children:(0,i.jsx)(M.A,{className:"uploadProgress__file-list",size:"small",dataSource:t,renderItem:e=>{const t="error"===e.status,r=t?(e=>{if(!e)return null;const t=e.toLowerCase();return t.includes("type")||t.includes("format")||t.includes("\u0444\u043e\u0440\u043c\u0430\u0442")||t.includes("\u0442\u0438\u043f")||t.includes("not allowed")||t.includes("\u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d")||t.includes("name")||t.includes("invalid")||t.includes("\u043d\u0430\u0437\u0432\u0430")||t.includes("\u043d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c")||t.includes("allowed characters")?null:t.includes("large")||t.includes("size")||t.includes("\u0440\u043e\u0437\u043c\u0456\u0440")||t.includes("\u0440\u0430\u0437\u043c\u0435\u0440")?h("upload_error_hint_size"):t.includes("exists")||t.includes("\u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454")||t.includes("\u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442")?h("upload_error_hint_exists"):null})(e.error):null;return(0,i.jsx)(M.A.Item,{className:"uploadProgress__file-item "+(t?"uploadProgress__file-item--error":""),actions:(n=e,"success"===n.status?[(0,i.jsx)(m.Ay,{type:"primary",size:"small",onClick:()=>s(n),children:h("Insert")},"insert")]:[]),children:(0,i.jsx)(M.A.Item.Meta,{avatar:(0,i.jsx)(P.A,{size:"small",icon:f(e.status),className:"uploadProgress__file-avatar"}),title:(0,i.jsxs)("div",{className:"uploadProgress__file-info",children:[(0,i.jsx)(lM,{ellipsis:!0,className:"uploadProgress__file-name",children:e.name}),(0,i.jsx)(lM,{type:"secondary",className:"uploadProgress__file-size",children:void 0!==e.size?$n(e.size):""})]}),description:"uploading"===e.status?(0,i.jsx)(T.A,{percent:e.progress,size:"small",status:"active",showInfo:!1,className:"uploadProgress__progress-bar"}):t?b?null:(0,i.jsxs)("div",{className:"uploadProgress__error-item",children:[(0,i.jsx)(lM,{type:"danger",className:"uploadProgress__error-message",children:e.error||h("Error")}),r&&(0,i.jsx)(lM,{type:"secondary",className:"uploadProgress__error-hint",children:r})]}):null})});var n}})}),w&&(0,i.jsxs)("div",{className:"uploadProgress__common-error",children:[(0,i.jsxs)("div",{className:"uploadProgress__common-error-row",children:[(0,i.jsx)(ne.A,{style:{color:d.colorError,marginRight:8,flexShrink:0}}),(0,i.jsx)(lM,{type:"danger",children:w})]}),(0,i.jsx)(lM,{type:"secondary",className:"uploadProgress__common-error-hint",children:h("Applies to all {{count}} files",{count:y.length})})]})]})]})})},{Header:uM}=R.A,{Title:dM}=f.A,hM=({activeLibraryItem:e,selectedFolder:t,isTrashFolder:r,onClearTrash:n,files:a,loading:s,onRefresh:l,refreshDisabled:c,showRefresh:u=!1})=>{const{t:d}=Sn(),h=e===Mt&&(null!=r?r:t===Bt),[f,p]=o.useState(!1),v={[Mt]:d("My files"),[Pt]:d("GIF"),[Rt]:d("Stock images"),[Lt]:d("Icons"),[Dt]:d("QR & Barcode"),[Nt]:d("AI image generation")};let y;return o.useEffect(()=>{const e=setTimeout(()=>{p(h&&a.length>0&&!s)},200);return()=>clearTimeout(e)},[h,a.length,s]),y=e===Mt?h?d("Trash"):t:v[e],(0,i.jsx)(uM,{className:"actions-header",children:(0,i.jsxs)("div",{className:"header-title-container",children:[(0,i.jsx)(dM,{level:5,className:"header-title",children:y}),f&&n&&(0,i.jsx)(m.Ay,{type:"default",onClick:n,className:"clear-trash-button","aria-label":d("Clear Trash"),children:d("Clear")}),e===Mt&&u&&l&&(0,i.jsx)(g.A,{title:d("Refresh"),children:(0,i.jsx)(m.Ay,{type:"text",className:"folder-refresh-button",icon:(0,i.jsx)(ui,{size:16}),onClick:l,disabled:c})})]})})};function fM(e,t){return!e||!t||e<=0||t<=0?1:e/t}const pM=1200;function gM({items:e,getId:t,getPreviewSrc:r,getAltText:n,getWidth:i,getHeight:a,layoutMode:s="masonry",minColumnWidth:l=240,estimatedItemHeight:c=240,gap:u=20,overscanPx:d=800,prefetchThresholdPx:h=1200,resolveColumnCount:f,virtualizationThreshold:p=40}){var g,m;const[v,y]=(0,o.useState)({scrollTop:0,viewportHeight:800,viewportWidth:pM,scrollHeight:0}),b=(0,o.useMemo)(()=>function(e){return{getId:e,buildSignature:(t,r)=>{var n,i;const o=r.getPreviewSrc(t)||"",a=r.getAltText(t),s=null===(n=r.getWidth)||void 0===n?void 0:n.call(r,t),l=null===(i=r.getHeight)||void 0===i?void 0:i.call(r,t);return[e(t),o,a,null!=s?s:"",null!=l?l:""].join("::")},buildRowModel:(e,t,r)=>{var n,i;const o=null===(n=t.getWidth)||void 0===n?void 0:n.call(t,e),a=null===(i=t.getHeight)||void 0===i?void 0:i.call(t,e);return{id:r.id,signature:r.signature,item:e,previewSrc:t.getPreviewSrc(e),altText:t.getAltText(e),width:o,height:a,aspectRatio:fM(o,a)}}}}(t),[t]),w=(0,o.useMemo)(()=>({getPreviewSrc:r,getAltText:n,getWidth:i,getHeight:a}),[n,a,r,i]),x=(0,o.useMemo)(()=>{const e=Math.max(1,v.viewportWidth||pM);return f?Math.max(1,f(e)):Math.max(1,Math.floor((e+u)/(l+u)))},[u,l,f,v.viewportWidth]),C=(0,o.useMemo)(()=>{const e=Math.max(1,v.viewportWidth||pM);return Math.max(1,(e-u*Math.max(0,x-1))/x)},[x,u,v.viewportWidth]),_=(0,o.useMemo)(()=>{const t=new Array(x).fill(0),r=[];e:for(let o=0;o<e.length;o+=1){const n=e[o],l=null==i?void 0:i(n),d=null==a?void 0:a(n),h=l&&d&&l>0&&d>0?l/d:void 0,f=h?C/h:c;if("grid"===s){const e=Math.floor(o/x)*(f+u),t=o%x*(C+u);r.push({index:o,top:e,left:t,width:C,height:f,bottom:e+f});continue e}let p=0;for(let e=1;e<t.length;e+=1)t[e]<t[p]&&(p=e);const g=t[p],m=p*(C+u);t[p]=g+f+u,r.push({index:o,top:g,left:m,width:C,height:f,bottom:g+f})}const n=0===r.length?0:"grid"===s?Math.max(...r.map(e=>e.bottom)):Math.max(0,...t.map(e=>e-u));return{positionedItems:r,containerHeight:n}},[x,C,c,u,a,i,e,s]),S=(0,o.useMemo)(()=>e.length<=p?{renderStrategy:"full"}:{renderStrategy:"positioned",positioned:{layout:_.positionedItems,viewportTop:v.scrollTop,viewportBottom:v.scrollTop+v.viewportHeight,overscanPx:d,containerHeight:_.containerHeight}},[e.length,_.containerHeight,_.positionedItems,d,v.scrollTop,v.viewportHeight,p]),{rowModels:A,renderWindow:k}=ws({items:e,context:w,adapter:b,options:S}),E=null!==(g=k.positionedItems)&&void 0!==g?g:A.map((e,t)=>{var r;return{row:e,layout:null!==(r=_.positionedItems[t])&&void 0!==r?r:{index:t,top:0,left:0,width:C,height:c,bottom:c}}}),I=null!==(m=k.containerHeight)&&void 0!==m?m:_.containerHeight,j=I>0&&v.scrollTop+v.viewportHeight>=I-h;return{rowModels:A,renderRows:k.rows,renderWindow:k,positionedItems:E,containerHeight:I,isNearEnd:j,viewportMetrics:v,handleViewportChange:e=>{y(t=>t.scrollTop===e.scrollTop&&t.viewportHeight===e.viewportHeight&&t.viewportWidth===e.viewportWidth&&t.scrollHeight===e.scrollHeight?t:e)}}}const mM=e=>{var t,{imageId:r,sourceUrl:n,shouldLoad:a=!0,loader:s,onLoad:l}=e,c=is(e,["imageId","sourceUrl","shouldLoad","loader","onLoad"]);const u=Va((0,o.useMemo)(()=>[n],[n])),[d,h]=(0,o.useState)(()=>s.getSnapshot(r,n)),f=(0,o.useRef)(null);return(0,o.useEffect)(()=>(h(s.getSnapshot(r,n)),s.subscribe(r,n,h)),[r,s,n]),(0,o.useEffect)(()=>(s.setActive(r,n,a),()=>{s.setActive(r,n,!1),s.release(r)}),[r,s,a,n]),d.shouldLoad&&u.src?(0,i.jsx)("img",Object.assign({},c,{ref:f,src:u.src,loading:null!==(t=c.loading)&&void 0!==t?t:"lazy",onLoad:e=>{u.handleLoad(),s.markLoaded(r),null==l||l(e)},onError:async e=>{var t;(await u.handleError()).exhausted&&s.markError(r),null===(t=c.onError)||void 0===t||t.call(c,e)}})):null};var vM={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",virtualCanvas:"virtualCanvas",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const yM=e=>{const t="undefined"!=typeof window?window.innerWidth:e;return t<=700?1:t<=1100?2:t<=1600?3:4},bM=e=>e.images.downsized.url,wM=({setImageGifList:e,imageGifList:t=[],currentReqGif:r,setCurrentReqGif:n,inputRef:a,customRequest:l})=>{const{t:c}=Sn(),{GifPlayIcon:u}=Zi(),{options:f}=Xi(),{config:p}=f,g=za({maxConcurrent:6}),[m,v]=(0,o.useState)(null),[y,b]=(0,o.useState)(new Set),[w,x]=(0,o.useState)(!1),[C,_]=(0,o.useState)(!1),[S,A]=(0,o.useState)(!1),[k]=d.A.useForm(),E=(0,o.useRef)(r),I=(0,o.useRef)(null),j=(0,o.useRef)(null),T=(0,o.useRef)(null),F=(0,o.useRef)(0),O=(0,o.useRef)(0),M=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{E.current=r},[r]),(0,o.useEffect)(()=>{k.setFieldsValue({keywords:r.keywords})},[]);const P=null==p?void 0:p.handleProxyUrl,R=null==p?void 0:p.fetchWithProxy,L=async e=>P?Promise.resolve(P(e)):e,N=(0,o.useCallback)(async e=>R?Promise.resolve(R(e,void 0,{intent:"metadata"})):fetch(await L(e)),[R,L]),D=async function({query:e,page:t}){var r;const n=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null!==(r=null==p?void 0:p.REACT_APP_GIPHY_KEY)&&void 0!==r?r:"Nh77eBlPeMn1ed9MBAvL542NUGeNO26F"}&q=${encodeURIComponent(n)}&limit=50&offset=${t}&lang=en`,i=await N(e);return{data:await i.json()}}catch(e){}},{positionedItems:z,containerHeight:B,isNearEnd:U,viewportMetrics:V,handleViewportChange:H}=gM({items:t,getId:e=>e.id,getPreviewSrc:bM,getAltText:e=>e.title,getWidth:e=>e.images.downsized.width?Number(e.images.downsized.width):void 0,getHeight:e=>e.images.downsized.height?Number(e.images.downsized.height):void 0,layoutMode:"masonry",minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:yM}),W=Ka(H,[t.length]),$=()=>{I.current&&(clearTimeout(I.current),I.current=null)},q=e=>!M.current.has(e)&&(M.current.add(e),!0),G=e=>{M.current.delete(e)},Y=(0,o.useCallback)(async()=>{var t,r,n;const i=null===(t=E.current.keywords)||void 0===t?void 0:t.trim();if(!i||w||C||!S)return;const o=`gif:${i}:${O.current}`;if(!q(o))return;const a=F.current;_(!0);try{const t=await D({query:E.current,page:O.current});if(a!==F.current)return;const i=null!==(n=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.data)&&void 0!==n?n:[];if(!Array.isArray(i)||0===i.length)return void A(!1);const o=i;if(a!==F.current)return;e(e=>{const t=new Set(e.map(e=>e.id)),r=o.filter(e=>!t.has(e.id));return r.length>0?[...e,...r]:e}),O.current+=i.length,A(50===i.length)}finally{G(o),a===F.current&&_(!1)}},[S,w,C,e]),X=async()=>{var t,r;$();const n=null===(t=E.current.keywords)||void 0===t?void 0:t.trim();if(!n)return j.current=null,T.current=null,F.current+=1,O.current=0,e([]),b(new Set),A(!1),void _(!1);if(T.current===n)return;if(j.current===n||w&&j.current===n)return;const i=`gif:${n}:0`;if(!q(i))return;const o=F.current+1;F.current=o,j.current=n,O.current=0,e([]),b(new Set),A(!1),_(!1),x(!0);try{const t=await D({query:E.current,page:0});if(o!==F.current)return;const i=null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.data;if(Array.isArray(i)&&i.length>0){const t=i;if(o!==F.current)return;e(t),O.current=i.length,A(50===i.length)}else e([]),A(!1);T.current=n}catch(t){A(!1)}finally{G(i),j.current===n&&(j.current=null),x(!1)}};return(0,o.useEffect)(()=>()=>{$()},[]),(0,o.useEffect)(()=>{!w&&!C&&S&&t.length>0&&U&&Y()},[S,t.length,U,Y,w,C]),(0,i.jsx)("div",{className:vM.gifTab,children:(0,i.jsx)("div",{className:vM.searchOutputWrapper,children:(0,i.jsxs)("div",{id:"scrollableDiv",ref:W,className:vM.scrollableDiv,children:[(0,i.jsxs)(d.A,{form:k,onValuesChange:e=>{if(void 0!==e.keywords){const t=Object.assign(Object.assign({},E.current),{keywords:e.keywords});n(t),E.current=t,$(),I.current=setTimeout(X,800)}},className:t.length>0?vM.searchResults:vM.search,children:[(0,i.jsx)(d.A.Item,{name:"keywords",className:vM.gifSearchInput,children:(0,i.jsx)(h.A,{onPressEnter:()=>{X()},allowClear:!0,placeholder:c("Search GIFs"),ref:a,spellCheck:"false",prefix:(0,i.jsx)(hi,{size:16,strokeWidth:null==p?void 0:p.iconStrokeWidth,onClick:()=>{X()}})})}),t.length>0&&!w&&(0,i.jsx)("div",{className:`ant-divider ${vM.divider}`,role:"separator"})]}),!t.length&&!w&&(0,i.jsx)(i.Fragment,{children:r.keywords?(0,i.jsx)(Qi,{}):(0,i.jsxs)("div",{className:vM.resultsContainer,children:[(0,i.jsx)("div",{className:vM.videoIcon,children:(0,i.jsx)(u,{className:vM.playButton})}),(0,i.jsx)("h1",{className:vM.title,children:c("Over 350,000 live images")}),(0,i.jsx)("p",{className:vM.subtitle,children:c("Enter a search query and we'll find the perfect image for you")})]})}),!t.length&&w&&(0,i.jsx)(Ts,{}),t.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:vM.virtualCanvas,style:{height:B},children:z.map(({row:e,layout:t})=>{const r=e.item,n=y.has(r.id),o=bM(r),a=t.bottom>=V.scrollTop-240&&t.top<=V.scrollTop+V.viewportHeight+240;return(0,i.jsxs)("div",{className:`${vM.listItem} ${n?vM.loaded:""}`,onClick:()=>(async(e,t)=>{var r;v(t),setTimeout(()=>{v(null)},2e3);let n=e.split("?")[0].split("#")[0].split("/"),i=n[n.length-1]||"uploaded-file";i.includes(".")&&(null===(r=i.split(".").pop())||void 0===r?void 0:r.length)&&i.split(".").pop().length<=5||(i+=".gif"),l(e,i)})(r.images.downsized.url,r.id,r.title),style:{position:"absolute",top:t.top,left:t.left,width:t.width,height:t.height,minHeight:t.height,maxHeight:"none",marginBottom:0},children:[(0,i.jsx)(mM,{imageId:r.id,sourceUrl:o,shouldLoad:a,loader:g,className:m===r.id?vM.loadedImage:"",width:"100%",height:"100%",alt:r.title,decoding:"async",onLoad:()=>{b(e=>{if(e.has(r.id))return e;const t=new Set(e);return t.add(r.id),t})}}),(0,i.jsx)("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),m===r.id&&(0,i.jsx)(s.A,{className:vM.antSpin})]},r.id)})}),C&&(0,i.jsx)(Ts,{})]})]})})})};var xM={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",virtualCanvas:"virtualCanvas",scrollableDiv:"scrollableDiv",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",creatorInfo:"creatorInfo",stockColorFilter:"stockColorFilter",allColors:"allColors",blackColor:"blackColor",bwColor:"bwColor",whiteColor:"whiteColor",orangeColor:"orangeColor",redColor:"redColor",purpleColor:"purpleColor",magentaColor:"magentaColor",greenColor:"greenColor",tealColor:"tealColor",blueColor:"blueColor",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const CM=e=>{const t="undefined"!=typeof window?window.innerWidth:e;return t<=650?1:t<=1e3?2:t<=1450?3:4},_M=(e,t)=>{const r=new URL(e);return r.searchParams.set("w",t.toString()),r.toString()},SM=({imageStockList:e,setImageStockList:t,currentReq:r,setCurrentReq:n,inputRef:a,customRequest:l})=>{var c,u;const{t:f}=Sn(),{StockBigIcon:p,MixedViewIcon:m,LandscapeViewIcon:v,PortraitViewIcon:y,SquareViewIcon:b}=Zi(),{options:w}=Xi(),{config:x}=w,_=za({maxConcurrent:6}),[A,k]=(0,o.useState)(!1),[E,I]=(0,o.useState)(!1),[j,T]=(0,o.useState)(!1),[F,O]=(0,o.useState)(null),[M,P]=(0,o.useState)(new Set),[R]=d.A.useForm(),N=null==x?void 0:x.fetchWithProxy,D=null==x?void 0:x.handleProxyUrl,z=null!==(c=null==x?void 0:x.UNSPLASH_KEY)&&void 0!==c?c:"HX2_qqq3F3ljmtYtfmb9P6h0dn2u9mnnOl36IdV8el0",B=(null===(u=null==x?void 0:x.locale)||void 0===u?void 0:u.slice(0,2))||"ru",U=(0,o.useRef)(r),V=(0,o.useRef)(null),H=(0,o.useRef)(null),W=(0,o.useRef)(0),$=(0,o.useRef)(1),q=(0,o.useRef)(new Set),G=async e=>D?Promise.resolve(D(e)):e,Y=(0,o.useCallback)(async e=>N?Promise.resolve(N(e,void 0,{intent:"metadata"})):fetch(await G(e)),[N,G]),X=()=>{V.current&&(clearTimeout(V.current),V.current=null)},K=e=>!q.current.has(e)&&(q.current.add(e),!0),Z=e=>{q.current.delete(e)},Q=e=>e.map(e=>Object.assign(Object.assign({},e),{urls:{raw:_M(e.urls.raw,1200),small:_M(e.urls.raw,540)}}));(0,o.useEffect)(()=>{U.current=r},[r]),(0,o.useEffect)(()=>{0===e.length&&R.setFieldsValue({color:"",orientation:""})},[e,R]),(0,o.useEffect)(()=>{R.setFieldsValue({keywords:r.keywords,color:r.color,orientation:r.orientation})},[]);const J=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let n=`https://api.unsplash.com/search/photos?client_id=${z}&lang=${B}&per_page=30&query=${encodeURIComponent(r)}&page=${t}`;""!==e.color&&(n+=`&color=${e.color}`),""!==e.orientation&&(n+=`&orientation=${e.orientation}`);const i=await Y(n);return{data:await i.json()}}catch(e){}},{positionedItems:ee,containerHeight:te,isNearEnd:re,viewportMetrics:ne,handleViewportChange:ie}=gM({items:e,getId:e=>e.id,getPreviewSrc:e=>e.urls.small,getAltText:e=>e.description||e.user.name,getWidth:e=>e.width,getHeight:e=>e.height,layoutMode:"masonry",minColumnWidth:240,estimatedItemHeight:220,prefetchThresholdPx:320,resolveColumnCount:CM}),oe=Ka(ie,[e.length]),ae=(0,o.useCallback)(async()=>{var e,r;if(A||E||!j||!U.current.keywords.trim())return;const n=W.current,i=$.current,o=`stock:${U.current.keywords.trim()}|${U.current.color}|${U.current.orientation}:${i}`;if(K(o)){I(!0);try{const o=await J({query:U.current,page:i});if(n!==W.current)return;const a=null!==(r=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.results)&&void 0!==r?r:[];if(0===a.length)return void T(!1);const s=Q(a);if(n!==W.current)return;t(e=>{const t=new Set(e.map(e=>e.id)),r=s.filter(e=>!t.has(e.id));return r.length>0?[...e,...r]:e}),$.current=i+1,T(30===a.length)}finally{Z(o),n===W.current&&I(!1)}}},[j,A,E,t]),se=async()=>{var e,r;X();const n=`${U.current.keywords.trim()}|${U.current.color}|${U.current.orientation}`;if(!U.current.keywords.trim())return void(H.current=null);if(H.current===n)return;const i=`stock:${n}:1`;if(!K(i))return;const o=W.current+1;W.current=o,k(!0),I(!1),T(!1),$.current=1,t([]),P(new Set);try{const i=await J({query:U.current,page:1});if(o!==W.current)return;const a=null!==(r=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.results)&&void 0!==r?r:[];if(a.length>0){const e=Q(a);if(o!==W.current)return;t(e),$.current=2,T(30===a.length)}else T(!1);H.current=n}finally{Z(i),k(!1)}};(0,o.useEffect)(()=>()=>{X()},[]),(0,o.useEffect)(()=>{!A&&!E&&j&&e.length>0&&re&&ae()},[j,e.length,re,ae,A,E]);return(0,i.jsx)("div",{className:xM.stockTab,children:(0,i.jsx)("div",{className:xM.searchOutputWrapper,children:(0,i.jsxs)("div",{className:xM.scrollableDiv,id:"scrollableDiv",ref:oe,children:[(0,i.jsxs)(d.A,{form:R,initialValues:Yt,onValuesChange:(e,r)=>{const i=Object.assign(Object.assign({},Yt),r);n(i),U.current=i,X(),""!==i.keywords?V.current=setTimeout(se,800):(H.current=null,W.current+=1,$.current=1,t([]),P(new Set),T(!1),I(!1),n(Object.assign({},Yt)),U.current=Yt,R.resetFields())},className:e.length>0?xM.searchResults:xM.search,children:[(0,i.jsxs)(S.A,{gutter:24,children:[(0,i.jsx)(C.A,{span:e.length>0?void 0:24,children:(0,i.jsx)(d.A.Item,{name:"keywords",className:xM.stockSearchInput,children:(0,i.jsx)(h.A,{allowClear:!0,placeholder:f("Search image"),ref:a,spellCheck:"false",prefix:(0,i.jsx)(hi,{size:16,strokeWidth:null==x?void 0:x.iconStrokeWidth})})})}),!!e.length&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(C.A,{children:(0,i.jsx)(d.A.Item,{name:"orientation",children:(0,i.jsxs)(L.Ay.Group,{onChange:e=>n(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[(0,i.jsx)(g.A,{title:f("All"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"",children:(0,i.jsx)(m,{})})}),(0,i.jsx)(g.A,{title:f("Landscape"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"landscape",children:(0,i.jsx)(v,{})})}),(0,i.jsx)(g.A,{title:f("Portrait"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"portrait",children:(0,i.jsx)(y,{})})}),(0,i.jsx)(g.A,{title:f("Squarish"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{value:"squarish",children:(0,i.jsx)(b,{})})})]})})}),(0,i.jsx)(C.A,{children:(0,i.jsx)(d.A.Item,{name:"color",children:(0,i.jsxs)(L.Ay.Group,{className:xM.stockColorFilter,onChange:e=>n(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[(0,i.jsx)(g.A,{title:f("All"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.allColors,value:"",children:"All"})}),(0,i.jsx)(g.A,{title:f("Black"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.blackColor,value:"black",children:"B"})}),(0,i.jsx)(g.A,{title:f("Black and White"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.bwColor,value:"black_and_white",children:"B&W"})}),(0,i.jsx)(g.A,{title:f("White"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.whiteColor,value:"white",children:"W"})}),(0,i.jsx)(g.A,{title:f("Orange"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.orangeColor,value:"orange",children:"O"})}),(0,i.jsx)(g.A,{title:f("Red"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.redColor,value:"red",children:"R"})}),(0,i.jsx)(g.A,{title:f("Purple"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.purpleColor,value:"purple",children:"P"})}),(0,i.jsx)(g.A,{title:f("Magenta"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.magentaColor,value:"magenta",children:"M"})}),(0,i.jsx)(g.A,{title:f("Green"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.greenColor,value:"green",children:"G"})}),(0,i.jsx)(g.A,{title:f("Teal"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.tealColor,value:"teal",children:"T"})}),(0,i.jsx)(g.A,{title:f("Blue"),placement:"top",children:(0,i.jsx)(L.Ay.Button,{className:xM.blueColor,value:"blue",children:"B"})})]})})})]})]}),e.length>0&&!A&&(0,i.jsx)("div",{className:`ant-divider ${xM.divider}`,role:"separator"})]}),!e.length&&!A&&(0,i.jsx)(i.Fragment,{children:r.keywords?(0,i.jsx)(Qi,{}):(0,i.jsxs)("div",{className:xM.resultsContainer,children:[(0,i.jsx)("div",{className:xM.videoIcon,children:(0,i.jsx)(p,{className:xM.playButton})}),(0,i.jsx)("h1",{className:xM.title,children:f("Millions of free stock images")}),(0,i.jsx)("p",{className:xM.subtitle,children:f("Enter a search query and we'll find the perfect image for you")})]})}),!e.length&&A&&(0,i.jsx)(Ts,{}),e.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:xM.virtualCanvas,style:{height:te},children:ee.map(({row:e,layout:t})=>{const r=e.item,n=M.has(r.id),o=t.bottom>=ne.scrollTop-240&&t.top<=ne.scrollTop+ne.viewportHeight+240;return(0,i.jsxs)("div",{className:`${xM.listItem} ${n?xM.loaded:""}`,onClick:()=>(async(e,t,r)=>{var n;!async function(e){try{const t=`${e}${e.includes("?")?"&":"?"}client_id=${z}`,r=await Y(t);return{data:await r.json()}}catch(e){}}(t.download_location),O(r),setTimeout(()=>O(null),2e3);const i=e.raw,o=i.split("?")[0].split("#")[0].split("/");let a=o[o.length-1]||"uploaded-file";a.includes(".")&&(null===(n=a.split(".").pop())||void 0===n?void 0:n.length)&&a.split(".").pop().length<=5||(a+=".jpg"),l(i,a)})(r.urls,r.links,r.id,r.description),style:{position:"absolute",top:t.top,left:t.left,width:t.width,height:t.height,minHeight:t.height,maxHeight:"none",marginBottom:0},children:[(0,i.jsx)(mM,{imageId:r.id,sourceUrl:r.urls.small,shouldLoad:o,loader:_,className:F===r.id?xM.loadedImage:"",width:"100%",height:"100%",alt:r.description,decoding:"async",onLoad:()=>{P(e=>{if(e.has(r.id))return e;const t=new Set(e);return t.add(r.id),t})}}),(0,i.jsxs)("p",{className:xM.creatorInfo,onClick:e=>e.stopPropagation(),children:[f("Photo by")," ",(0,i.jsx)("a",{target:"_blank",href:`${r.user.links.html}?utm_source=${null==x?void 0:x.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:r.user.name})," ",f("on")," ",(0,i.jsx)("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==x?void 0:x.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),F===r.id&&(0,i.jsx)(s.A,{className:xM.antSpin})]},r.id)})}),E&&(0,i.jsx)(Ts,{})]})]})})})};const AM=({images:e,transitionDuration:t=1e3,frameHeight:r})=>{const[n,a]=(0,o.useState)([]),[s,l]=(0,o.useState)(r);(0,o.useEffect)(()=>{const e=()=>{if("undefined"==typeof window)return void l(r);const e=window.innerHeight,t=Math.max(e-260,130);if("number"==typeof r){const e=Math.min(r,t);l(e)}else l(t)};if(e(),"undefined"!=typeof window)return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[r]);const c=()=>{a(e=>e.map((t,r)=>r===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return(0,o.useEffect)(()=>{if(e.length>0){const t=e[e.length-1];a(e=>[...e,{src:t,opacity:0}]),setTimeout(c,1e3)}else a([])},[e]),(0,i.jsx)("div",{className:"slideshowContainer",style:{height:s,minHeight:130},children:n.map((e,r)=>(0,i.jsx)("img",{src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${r+1}`,className:"slideshowImage",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`,display:"block"}},r))})},kM=e=>{var{className:t,style:r,color:n,text:o,bordered:a}=e,s=is(e,["className","style","color","text","bordered"]);const l=o||"";return(0,i.jsx)(N.A,Object.assign({style:r,color:n,bordered:a,className:t},s,{children:l}))},EM=({text:e,counter:t,limits:r,wrapperStyles:n})=>{const{t:o}=Sn(),{options:a}=Xi(),s=a.config,{token:c}=l.A.useToken(),u=+r>0,d=!u||t<+r,h=(null==s?void 0:s.billingPageUrl)||"/billing",f=t+" "+o("of")+" "+(u?r:"\u221e")+" "+(e||o("tests",{count:r}))+" "+o("was used",{count:t});return(0,i.jsxs)("div",{className:"limits-couter-wrapper",style:n,children:[(0,i.jsx)(kM,{bordered:!1,text:f,className:"limit-counter",style:{color:d?c.colorText:"white"},color:d?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&(0,i.jsx)("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(h),children:o("Need more?")})]})};var IM={imageAi:"imageAi",imageAiExample:"imageAiExample",imageItem:"imageItem",textAreaInputHybrid:"textAreaInputHybrid",loading:"loading",carousel:"carousel",arrow:"arrow",arrowNext:"arrowNext",arrowPrev:"arrowPrev",arrowBtn:"arrowBtn",arrowBtnNext:"arrowBtnNext",arrowBtnPrev:"arrowBtnPrev",row:"row",inputAffixWrapper:"inputAffixWrapper",textarea:"textarea",inputIcon:"inputIcon"};const jM=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${IM.arrow} ${IM.arrowNext} ${e||""}`,onClick:t,children:(0,i.jsx)(m.Ay,{className:`${IM.arrowBtn} ${IM.arrowBtnNext}`,size:"large",icon:(0,i.jsx)(oe.A,{})})}));jM.displayName="SampleNextArrow";const TM=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${IM.arrow} ${IM.arrowPrev} ${e||""}`,onClick:t,children:(0,i.jsx)(m.Ay,{className:`${IM.arrowBtn} ${IM.arrowBtnPrev}`,size:"large",icon:(0,i.jsx)(ae.A,{})})}));TM.displayName="SamplePrevArrow";const FM=({customRequest:e,inputAiRef:t,isImageUploaded:r,setIsImageUploaded:n,aiImageRequest:a,setAiImageRequest:s,imageAiList:l,setImageAiList:c,isLoadingAi:u,setIsLoadingAi:f})=>{const{t:p}=Sn(),{AiIcon_2:g}=Zi(),v=o.useRef(null),[y,b]=(0,o.useState)("auto"),{aiImageCounter:w,currentAiImgLimits:x,loadingDuringGeneration:_,requestStatus:A,handleGenerate:k,convertBase64ToFile:E,isShiftPressed:I,setIsShiftPressed:j,limitsInPlugin:T}=function({setFrameHeight:e,customRequest:t,aiTabRef:r,isImageUploaded:n,setIsImageUploaded:i,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u}){const{t:d}=Sn(),{options:h}=Xi(),f=h.config,p=so(),g=(()=>{const{options:e}=Xi(),t=e.config;return(0,o.useCallback)((e,r)=>{!1!==(null==t?void 0:t.pushToGTM)&&((e,t)=>{const r=()=>{try{const t=Object.assign(Object.assign({},e),{appLabel:"blocks_app"});window.dataLayer&&"function"==typeof window.dataLayer.push&&window.dataLayer.push(t)}catch(e){}};t?setTimeout(r,t):r()})(e,r)},[null==t?void 0:t.pushToGTM])})(),{messages:m}=h.config,[v,y]=(0,o.useState)([]),[b,w]=(0,o.useState)(0),[x,C]=(0,o.useState)(null),[_,S]=(0,o.useState)(!1),[A,k]=(0,o.useState)(d("Evaluating the task")),[E,I]=(0,o.useState)(!1),j=(0,o.useRef)(new Set),T=(0,o.useRef)(new Set),F=(0,o.useRef)(new Set);(0,o.useEffect)(()=>{y(m)},[m]),(0,o.useEffect)(()=>{s.length||x||(y([]),j.current.clear(),T.current.clear(),F.current.clear(),P.current=-1)},[s,x]);const O=(0,o.useMemo)(()=>f&&"function"==typeof(null==f?void 0:f.sendAIImageRequest)?null==f?void 0:f.sendAIImageRequest:()=>Promise.resolve({}),[f]),M=(0,o.useCallback)(e=>{const t=`${x}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!F.current.has(t))if(F.current.add(t),"error"!==e.status&&"Canceled"!==e.status){if(e.images){if(k(String(e.status)),100===e.progress){u(!1),l(e.images);const t=x,r=Array.isArray(e.images)?e.images:[];r.length>0&&t&&!j.current.has(t)&&(j.current.add(t),p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:r}})),C(null),I(!1)}}else if(e.data&&(l([String(e.data)]),100===e.progress)){u(!1);const t=x,r=e.data?[String(e.data)]:[];r.length>0&&t&&!j.current.has(t)&&(j.current.add(t),p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:r}})),C(null),I(!1)}}else u(!1),I(!1),x&&!T.current.has(x)&&(T.current.add(x),p.error({id:"AI_RESPONSE_INVALID",message:d("Something went wrong, please try again"),placement:"bottomRight",description:String(x)||void 0,data:{requestId:x,request:a,response:e},innerException:e}))},[a,l,k,d,u,x,p,I]),P=(0,o.useRef)(-1);(0,o.useEffect)(()=>{if(v.length>0){const e=v.length-1;e>P.current&&(P.current=e,M(v[e]))}},[M,v]);const R=(0,o.useMemo)(()=>{if(f&&"function"==typeof(null==f?void 0:f.sseQuery)){const e=null==f?void 0:f.sseQuery;return t=>e(t)}return e=>{}},[f]),L=(0,o.useMemo)(()=>f&&"object"==typeof(null==f?void 0:f.handleLimitUsageEmitter)?null==f?void 0:f.handleLimitUsageEmitter:{fire:()=>{}},[f]),N=null==f?void 0:f.elementId,{projectId:D}=f,{limits:z}=(null==f?void 0:f.limits)?f:{limits:{ai_img_limit:0}},{ai_img_limit:B}=z,U=B>0&&b>=B,V=!(!(null==f?void 0:f.limits)||!f.counters)&&false,H=(0,o.useCallback)(()=>{L.fire({name:"AiImgCount",count:b+1})},[L,b]),W=(0,o.useMemo)(()=>!U&&!V,[U,V,b,B]),$=(0,o.useCallback)(async()=>{k(d("Evaluating the task")),""===a||c||(u(!0),I(!0),l([]),y([]),g({event:"submit_form",action:"ai_image_generation",entity_id:N,project_id:D}),O({body:{project_id:D,request:"create-image",connection:"midjourney",message:a}}).then(e=>{var t,r,n,i,o,s,c,h,f;const{data:g,error:m}=e||{};if(m)throw m;const v=g;if(401===(null==v?void 0:v.status)||401===(null===(t=null==v?void 0:v.data)||void 0===t?void 0:t.status))throw new Error("ERROR");const y=null!==(r=null==v?void 0:v.data)&&void 0!==r?r:v;if((null==y?void 0:y._eventResult)&&Array.isArray(null===(n=y.task)||void 0===n?void 0:n.images)&&(null!==(o=null===(i=y.task.images)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0){const e=y.task.images;return l(e),u(!1),I(!1),void C(null)}const b=(null==v?void 0:v.task)||(null===(s=null==v?void 0:v.data)||void 0===s?void 0:s.task),w=null!==(h=null!==(c=null==b?void 0:b.id)&&void 0!==c?c:x)&&void 0!==h?h:void 0;200===(null==v?void 0:v.status)||200===(null===(f=null==v?void 0:v.data)||void 0===f?void 0:f.status)?((null==b?void 0:b.id)&&(k(b.message),C(b.id)),(null==v?void 0:v.message)&&p.success({id:"AI_IMAGE_GENERATION_STARTED",message:v.message,placement:"bottomRight",data:{request:a,taskId:w,response:null==v?void 0:v.data}}),R({task_id:null==b?void 0:b.id,entity_id:N})):(u(!1),I(!1),w&&!T.current.has(w)&&(T.current.add(w),p.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==v?void 0:v.message)||d("Something went wrong, please try again"),placement:"bottomRight",description:a,data:{request:a,taskId:w,response:v},innerException:v})))}).catch(e=>{u(!1),I(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&x&&!T.current.has(x)&&(T.current.add(x),null==p||p.error({id:"AI_IMAGE_GENERATION_FAILED",message:d("Something went wrong, please try again"),placement:"bottomRight",description:a,innerException:e,data:{request:a,taskId:x,response:null==t?void 0:t.data,error:fo(null==t?void 0:t.error)}})),t}))},[a,c,u,I,l,g,N,D,O,p,R,d,x]),q=(0,o.useCallback)(()=>{W&&$()},[W,V,w,H,$,p,d]);(0,o.useEffect)(()=>{},[f,V]);const G=(0,o.useCallback)(e=>{if(n)return;const r=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!r)return;const o=r[1],a=r[2],s=atob(a),l=new Array(s.length);for(let t=0;t<s.length;t++)l[t]=s.charCodeAt(t);const c=new Uint8Array(l),u=new Blob([c],{type:`image/${o}`}),d=new File([u],"image.jpeg",{type:u.type,lastModified:Date.now()});i(!0),(async()=>{try{"function"==typeof t&&await Promise.resolve(t({file:d}))}catch(e){}finally{i(!1)}})()},[n,i,t]);return(0,o.useEffect)(()=>{(c||s.length>0)&&setTimeout(()=>{var t,n;let i=350;if(r.current){const e=null===(t=r.current)||void 0===t?void 0:t.firstChild;e&&e instanceof HTMLElement&&(i=(null===(n=r.current.getBoundingClientRect())||void 0===n?void 0:n.height)-48-e.clientHeight)}e(i)},0)},[r,s.length,c,e]),{aiImageCounter:b,setAiImageCounter:w,currentAiImgLimits:B,isFieldsDisabled:U,canGenerateImage:W,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u,loadingDuringGeneration:E,setLoadingDuringGeneration:I,requestStatus:A,setRequestStatus:k,handleGenerate:q,handleLimitAiImgCount:H,convertBase64ToFile:G,isShiftPressed:_,setIsShiftPressed:S,currentReqId:x,setCurrentReqId:C,limitsInPlugin:V}}({setFrameHeight:b,customRequest:e,aiTabRef:v,isImageUploaded:r,setIsImageUploaded:n,aiImageRequest:a,imageAiList:l,setImageAiList:c,isLoadingAi:u,setIsLoadingAi:f});(0,o.useEffect)(()=>{},[r]);const[F,O]=(0,o.useState)(!1),M=(0,o.useCallback)(()=>O(!0),[]),P=(0,o.useCallback)(()=>O(!1),[]),R=(0,o.useCallback)(e=>s(e.target.value),[s]),L=(0,o.useCallback)(e=>{"Shift"===e.key?j(!0):"Enter"!==e.key||I||(e.preventDefault(),k())},[I,k,j]),N=(0,o.useCallback)(e=>{"Shift"===e.key&&j(!1)},[j]);return(0,i.jsxs)("div",{className:IM.imageAi,ref:v,children:[T&&(0,i.jsx)(EM,{text:"images",counter:w,limits:x,wrapperStyles:{marginTop:-25}}),(0,i.jsx)(S.A,{gutter:24,className:IM.row,children:(0,i.jsxs)(C.A,{span:24,children:[(0,i.jsx)(d.A.Item,{children:(0,i.jsxs)("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${IM.inputAffixWrapper}${F?" ant-input-affix-wrapper-focused":""}`,children:[(0,i.jsx)(h.A.TextArea,{ref:t,onKeyDown:L,onKeyUp:N,onFocus:M,onBlur:P,autoSize:!0,allowClear:!0,className:`${IM.textAreaInputHybrid} ${IM.textarea}`,placeholder:p("Generate image"),value:a,onChange:R,spellCheck:"false"}),(0,i.jsx)("span",{className:`ant-input-suffix ${IM.inputSuffix}`,children:u||_?(0,i.jsx)(B.A,{className:`${IM.inputIcon} input-icon`,spin:!0}):(0,i.jsx)(g,{className:`${IM.inputIcon} input-icon`,onClick:k})})]})}),(0,i.jsxs)("div",{className:IM.imageAiExample,children:[(0,i.jsx)("span",{children:p("For example:")})," ",p("A beautiful image of a sunset over a calm ocean.")]})]})}),(u||l.length>0)&&(0,i.jsxs)(D.A,{dotPosition:"top",arrows:!0,nextArrow:(0,i.jsx)(jM,{}),prevArrow:(0,i.jsx)(TM,{}),className:IM.carousel,infinite:!1,children:[u&&!l.length&&(0,i.jsx)("div",{className:IM.loading,children:(0,i.jsxs)("div",{className:"spin",children:[(0,i.jsx)(B.A,{style:{fontSize:48},spin:!0}),(0,i.jsx)("p",{className:"status",children:A})]})}),l.length>0&&l.map((e,t)=>(0,i.jsxs)("div",{className:IM.imageItem,children:[(0,i.jsx)(AM,{images:l,frameHeight:y}),(0,i.jsx)("div",{className:"buttons",children:l.length>0&&!u&&(0,i.jsx)(m.Ay,{onClick:()=>E(`data:image/jpeg;base64, ${e}`),loading:r,icon:(0,i.jsx)(se.A,{}),children:p("Use this variant")})})]},t))]})]})},{Sider:OM,Content:MM}=R.A,PM=o.lazy(()=>r.e(3195).then(r.bind(r,53195))),RM=o.lazy(()=>r.e(7251).then(r.bind(r,37251))),LM={keywords:""},NM=()=>{var e,t,r;const n=Co(),a=(()=>{const{state:e}=Xi(),{files:t,loading:r,isUrlModalVisible:n}=e,i=Ea(),a=(()=>{const{state:e}=Xi(),t=e.multiSelect,r=Oa(e=>e.selectedFiles),n=Oa(e=>e.toggleFileSelection),i=Oa(e=>e.setMultiSelect);return(0,o.useEffect)(()=>{i(!1!==t)},[t,i]),{state:{selectedFiles:r},actions:{toggleFileSelection:n}}})(),s=Da(i.fetchFiles);return{state:{files:t||[],selectedFiles:a.state.selectedFiles,loading:r||!1,isAddingFileByUrl:n||!1,isRenamingFile:s.state.isRenamingFile,fileToRename:s.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:a.actions.toggleFileSelection,showRenameModal:s.actions.showRenameModal,handleRenameCancel:s.actions.handleRenameCancel,handleRenameOk:s.actions.handleRenameOk,showMoveModal:s.actions.showMoveModal,handleMoveCancel:s.actions.handleMoveCancel,handleMoveOk:s.actions.handleMoveOk,showCopyModal:s.actions.showCopyModal,handleCopyCancel:s.actions.handleCopyCancel,handleCopyOk:s.actions.handleCopyOk,showDeleteConfirm:s.actions.showDeleteConfirm,handleDeleteConfirmCancel:s.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:s.actions.handleDeleteConfirmOk}}})(),l=(()=>{var e,t;const{state:r,actions:n,options:i}=Xi(),{selectedFolder:a,pathHistory:s,folders:l}=r,{t:c}=Sn(),{setSelectedFolder:u,setPathHistory:d}=n,h=(0,o.useCallback)(()=>{var e;return`em_fm:lastFolder:${(null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId)||"default"}`},[null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId]),f=(0,o.useCallback)((e,t=new Set)=>{if(t.has(e))return[];const r=(Array.isArray(l)?l:[]).find(t=>t.id===e);if(!r)return[];const n=new Set(t);return n.add(e),r.parentId?r.parentId===r.id?[{id:r.id,name:r.name+" (\u043e\u0448\u0438\u0431\u043a\u0430)"}]:[...f(r.parentId,n),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},[l]),p=(0,o.useCallback)(e=>{var t;if("undefined"==typeof window)return;const r=!0===(null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder),n=h();try{if(!r)return void localStorage.removeItem(n);e?localStorage.setItem(n,e):localStorage.removeItem(n)}catch(e){}},[h,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder]),g=(0,o.useCallback)(e=>{if("folders"===e){const e=[{id:"folders",name:c("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}if(!(Array.isArray(l)?l:[]).find(t=>t.id===e))return;const t=f(e),r=[{id:"folders",name:c("Folders")},...t];null==d||d(r),i.onPathChange&&i.onPathChange(r.map(e=>e.name))},[l,f,d,i,c]),m=(0,o.useCallback)(e=>{const t="folders"===e?null:e;t!==a&&(null==u||u(t),p(t),g(e))},[p,a,u,g]),v=(0,o.useCallback)(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:c("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=s.slice(0,e+1),r=t[t.length-1],n="folders"===r.id?void 0:r.id;null==u||u(n||null),null==d||d(t),i.onPathChange&&i.onPathChange(t.map(e=>e.name))}},[i,s,d,u,c]),y=(0,o.useCallback)(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...s,t];d(e)}if(i.onPathChange){const t=[...s.map(e=>e.name),e.name];i.onPathChange(t)}},[i,s,d,u]);return{state:{selectedFolder:a,pathHistory:s},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:a,pathHistory:s,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}})(),c=(()=>{const{state:e,actions:t}=Xi(),{pagination:r}=e,{setPagination:n}=t,i=(0,o.useCallback)((e,t)=>{const i=t||r.pageSize;null==n||n({current:e,pageSize:i,total:r.total})},[r.pageSize,r.total,n]);return{state:{pagination:r},actions:{handlePaginationChange:i}}})(),u=(()=>{const[e,t]=(0,o.useState)([]),[r,n]=(0,o.useState)(!1),[i,a]=(0,o.useState)(!1),s=(0,o.useRef)(0),l=(0,o.useRef)(new Map),c=(0,o.useCallback)(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),u=(0,o.useCallback)(e=>$n(e.size),[]),d=(0,o.useCallback)((e,r)=>{const i=r.map(t=>({id:c(),folderId:e,name:t.name,size:u(t),status:"uploading",progress:0}));return t(i),n(!0),a(!1),i.map(e=>e.id)},[c,u]),h=(0,o.useCallback)((e,r)=>{const i={id:c(),folderId:e,name:r,size:void 0,status:"uploading",progress:0};return t(e=>[...e,i]),n(!0),a(!1),i.id},[c]),f=(0,o.useCallback)((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,r))}):t))},[]),p=(0,o.useCallback)((e,r)=>{r&&l.current.set(e,r),t(t=>t.map(t=>{if(t.id===e){const e=Object.assign(Object.assign({},t),{status:"success",progress:100});return(null==r?void 0:r.name)&&(e.name=r.name),(null==r?void 0:r.size)&&void 0===t.size&&(e.size=$n(r.size)),e}return t}))},[]),g=(0,o.useCallback)((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:r}):t))},[]),m=(0,o.useCallback)(()=>{n(!1),a(!1),setTimeout(()=>{t([]),l.current.clear()},300)},[]),v=(0,o.useCallback)(()=>{a(e=>!e)},[]),y=(0,o.useCallback)(e=>l.current.get(e),[]),b=e.length,w=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:r,isUploadMinimized:i,totalFiles:b,completedFiles:w,startUpload:d,startUploadByUrl:h,updateProgress:f,markAsSuccess:p,markAsError:g,getUploadedFile:y,closeUpload:m,minimizeUpload:v}})(),d=Ea(),{deleteItems:h}=_o(),f=so(),{t:p}=Sn(),{options:g,state:m,actions:v}=Xi(),y=g,b=null==y?void 0:y.onChangeSelection,w=m,x=null==y?void 0:y.config,{dataProviders:C}=y,{form:_,urlForm:S,renameForm:A,moveForm:k,renameFolderForm:E,copyForm:I,isModalVisible:j,isUrlModalVisible:T,isMoveModalVisible:F,isRenameFolderModalVisible:M,isCopyModalVisible:P,isDeleteConfirmVisible:L,folderToRename:N,activeLibraryItem:D}=m,{setIsUrlModalVisible:z,setActiveLibraryItem:B}=v,{config:U}=g,{DropZoneFileIcon:V}=Zi(),[H,W]=(0,o.useState)(!1),[$,q]=(0,o.useState)(!1),[G,Y]=(0,o.useState)(!1),X=(0,o.useRef)(0),K=(0,o.useRef)(!1);K.current=$;const Z=o.useRef(null),Q=o.useRef([]),[J,ee]=(0,o.useState)(!1),[te,re]=(0,o.useState)(!1),ne=Oa(e=>e.selectedFiles),ie=Oa(e=>e.clearSelection),oe=Oa(e=>e.syncVisibleFiles),{folders:ae,loading:se}=n.state,{fetchFolders:ce,fetchChildFolders:ue,handleCreateFolder:de,handleModalOk:he,handleModalCancel:fe,generateMenuItems:pe}=n.actions,ge=(e=>{var t;const{state:r,actions:n,options:i}=Xi(),{t:a}=Sn(),s=so(),{folders:l,folderToRename:c,renameFolderForm:u,isRenameFolderModalVisible:d}=r,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=n,{apiEndpoints:p,dataProviders:g,config:m}=i,v=(0,o.useCallback)(e=>{null==h||h(e),null==f||f(!0);const t=null==l?void 0:l.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,l,u]),y=(0,o.useCallback)(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=(0,o.useCallback)(async()=>{var t,r;if(c&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:c,folderName:null==i?void 0:i.newFolderName,reason:"emptyName"}});if(!1===(null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error(a("renameFolder is not implemented in dataProviders"));const o=await g.renameFolder(c,i.newFolderName.trim());if(!(null==o?void 0:o.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:i.newFolderName,error:{message:"invalidResponse"}}});s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:o.id,itemName:o.name,folderId:null!==(r=o.parentId)&&void 0!==r?r:null}}),y(),await e(),c!==o.id&&n.setSelectedFolder&&n.setSelectedFolder(o.id)}catch(e){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=c?c:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),error:{message:e instanceof Error?e.message:String(e)}}})}},[c,u,p,y,e,a,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,s]);return{state:{isRenamingFolder:d||!1,folderToRename:c},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(ce),{files:me,loading:ve,isRenamingFile:ye,fileToRename:be}=a.state,{fetchFiles:we,handleDeleteFile:xe,handleDeleteFolder:Ce,handleAddFile:_e,handleAddFileByUrl:Se,showRenameModal:Ae,handleRenameCancel:ke,handleRenameOk:Ee,handleDroppedFiles:Ie,showMoveModal:je,handleMoveCancel:Te,handleMoveOk:Fe,handleCopyOk:Oe,handleCopyCancel:Me,showDeleteConfirm:Pe,handleDeleteConfirmCancel:Re,handleDeleteConfirmOk:Le}=a.actions,{selectedFolder:Ne,pathHistory:De}=l.state,{handleFolderSelect:ze,handleItemClick:Be}=l.actions,{pagination:Ue}=c.state,Ve=io(we),{searchTerm:He,sortBy:We,sortOrder:$e}=Ve.state,{handleSearch:qe,handleSort:Ge,handlePaginationChange:Ye}=Ve.actions,Xe=(0,o.useCallback)(async()=>{const e=(e=>yo(e))(De||[]);try{await xo({options:y,pathFolder:e,dataProviders:null==y?void 0:y.dataProviders})}catch(e){}await ce(),await we({folderId:Ne||"",page:Ue.current,limit:Ue.pageSize,search:He,sortBy:We,sortOrder:$e,itemType:"all"})},[we,ce,y,Ue,De,He,Ne,We,$e]),Ke=(({files:e,fetchFiles:t,selectedFolder:r})=>{var n;const{t:i}=Sn(),a=so(),{options:s,actions:l,state:c}=o.useContext(Yi),{setActiveLibraryItem:u}=l,{activeLibraryItem:d}=c,h=Ea(),[f,p]=o.useState(!1),[g,m]=o.useState(null),v=o.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return qt.includes(t)}const r=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!r&&qt.includes(r)},[]),y=o.useCallback(async(e,t)=>{var r,n;const{dataProviders:o}=s;if(!1===(null===(n=null===(r=s.config)||void 0===r?void 0:r.features)||void 0===n?void 0:n.enableUpdateFile))throw new So(i("Updating files is disabled by configuration"),"UnsupportedOperation");if(!e.id||!e.thumbnail||!(null==o?void 0:o.updateFile))throw new So(i("Failed to save changes"),"UnsupportedOperation");const a=(null==t?void 0:t.mimeType)||rr(e.thumbnail,e.type),l=nr(a),c=e.name.lastIndexOf("."),u=`${c>0?e.name.substring(0,c):e.name}.${l}`,d=(null==t?void 0:t.blob)||lr(e.thumbnail,a);return o.updateFile(e.id,{name:u,type:a,data:d})},[s,i]),b=o.useCallback(async(e,t)=>{var r,n,o;if(!e.thumbnail)throw new So(i("Failed to save changes"),"ValidationError");const a=!(!0===(null===(r=s.config)||void 0===r?void 0:r.saveCopyToCurrentFolder))||(null!==(n=e.saveWithoutFolder)&&void 0!==n?n:!e.id),l=a?void 0:null!==(o=e.folderId)&&void 0!==o?o:void 0,c=(null==t?void 0:t.mimeType)||rr(e.thumbnail,e.type),u=(null==t?void 0:t.blob)||lr(e.thumbnail,c),d=new File([u],e.name,{type:c,lastModified:Date.now()}),f=await h.uploadFileWithProvider(d,l,void 0,a);if(!f)throw new So(i("Failed to save image copy"),"FileWriteError");return f},[h,null===(n=s.config)||void 0===n?void 0:n.saveCopyToCurrentFolder,i]),w=o.useCallback(t=>{let r;if(t)r=t;else{const t=Oa.getState().selectedFiles;if(1!==t.size)return;const n=Array.from(t)[0];if(r=e.find(e=>e.id===n),!r||r.isFolder||!v(r))return}u&&u(zt),m(r),p(!0)},[e,v,p,u]),x=o.useCallback(()=>{u&&d===zt&&u(Mt),p(!1),m(null)},[d,u]),C=o.useCallback(async(e,n)=>{var o,l,c,u,d,h;try{const c=await y(e,n);return a.success({id:"IMAGE_UPDATE_SUCCESS",message:i("Success"),description:i("Image updated successfully"),placement:"bottomRight",data:{itemId:null!==(o=null==c?void 0:c.id)&&void 0!==o?o:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&s.onEditorOk&&s.onEditorOk(c,{mode:n.mode}),await t({folderId:r||""}),x(),null!=c?c:void 0}catch(t){const n=fo(t),o=null!==(u=null!==(c=uo(null==n?void 0:n.code,i))&&void 0!==c?c:null==n?void 0:n.message)&&void 0!==u?u:i("Failed to save changes");throw a.error({id:"IMAGE_SAVE_FAILED",message:o,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[y,s,t,r,a,x,i]),_=o.useCallback(async(e,n)=>{var o,l,c,u,d,h;try{const c=await b(e,n);return a.success({id:"IMAGE_SAVE_COPY_SUCCESS",message:i("Success"),description:i("Image copy saved successfully"),placement:"bottomRight",data:{itemId:null!==(o=null==c?void 0:c.id)&&void 0!==o?o:void 0,itemName:null==c?void 0:c.name,folderId:null!==(l=null==c?void 0:c.folderId)&&void 0!==l?l:null,thumbnail:null==c?void 0:c.thumbnail}}),c&&s.onEditorOk&&s.onEditorOk(c,{mode:n.mode}),await t({folderId:r||""}),x(),null!=c?c:void 0}catch(t){const n=fo(t),o=null!==(u=null!==(c=uo(null==n?void 0:n.code,i))&&void 0!==c?c:null==n?void 0:n.message)&&void 0!==u?u:i("Failed to save image copy");throw a.error({id:"IMAGE_SAVE_COPY_FAILED",message:o,innerException:t,placement:"bottomRight",data:{itemId:null!==(d=e.id)&&void 0!==d?d:void 0,itemName:e.name,folderId:null!==(h=e.folderId)&&void 0!==h?h:null,thumbnail:e.thumbnail}}),t.notificationShown=!0,t}},[b,s,t,r,a,x,i]);return{isPixieEditorVisible:f,editingFile:g,handleEdit:w,handlePixieEditorSave:C,handlePixieEditorSaveCopy:_,handlePixieEditorClose:x}})({files:me||[],fetchFiles:we,selectedFolder:Ne||null}),[Ze,Qe]=(0,o.useState)(!1),Je=(0,o.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!e.dataTransfer||!e.dataTransfer.types||!e.dataTransfer.types.includes("Files"))return;e.dataTransfer.dropEffect="copy";const t=e.relatedTarget,r=e.currentTarget;t&&r.contains(t)||(X.current+=1,X.current>0&&W(!0))},[]),et=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation();const t=e.relatedTarget,r=e.currentTarget;if(t&&!r.contains(t))X.current=Math.max(0,X.current-1),X.current<=0&&W(!1);else if(t){const e=t.closest('[class*="dragOverlay"]');if(e&&r.contains(e))return}},[]),tt=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},[]),rt=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),W(!1),X.current=0;const t=(()=>{var t;const r=e.dataTransfer;if(!r)return[];if(null===(t=r.files)||void 0===t?void 0:t.length)return Array.from(r.files);const n=[];if(r.items)for(let e=0;e<r.items.length;e++){const t=r.items[e].getAsFile();t&&n.push(t)}return n})();t.length&&(Qe(!0),Ie(t).catch(e=>{null==e||e.name}).finally(()=>{Qe(!1)}))},[Ie]),nt=(0,o.useCallback)(()=>{W(!1),X.current=0,document.body.removeAttribute("data-fm-dragging"),Y(!1),q(!1)},[]);o.useEffect(()=>{Q.current=me||[]},[me]);const it=null==w?void 0:w.activeLibraryItem;(0,o.useEffect)(()=>{const e=e=>{e?document.body.setAttribute("data-fm-dragging","true"):document.body.removeAttribute("data-fm-dragging")};let t=!1;const r=r=>{var n,i;!t&&(null===(i=null===(n=r.dataTransfer)||void 0===n?void 0:n.types)||void 0===i?void 0:i.includes("Files"))&&(t=!0,Y(!0),e(!0),it===Mt&&q(!0))},n=r=>{const n=r.relatedTarget;(!n||!document.documentElement.contains(n))&&t&&(t=!1,Y(!1),q(!1),e(!1))};return window.addEventListener("dragenter",r,!0),window.addEventListener("dragleave",n,!0),()=>{window.removeEventListener("dragenter",r,!0),window.removeEventListener("dragleave",n,!0),document.body.removeAttribute("data-fm-dragging")}},[it]),(0,o.useEffect)(()=>{const e=e=>{var t,r;if(document.body.removeAttribute("data-fm-dragging"),Y(!1),!(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files")))return;e.preventDefault();const n=(e=>{var t;if(!e)return[];if(null===(t=e.files)||void 0===t?void 0:t.length)return Array.from(e.files);const r=[];if(e.items)for(let n=0;n<e.items.length;n++){const t=e.items[n].getAsFile();t&&r.push(t)}return r})(e.dataTransfer);if(!n.length)return;const i=e.target,o=i.closest(`.${Ja.filesContainer.replace(/\s+/g,".")}`)||i.closest("[data-files-container]"),a=i.closest(".em-filemanager")||i.closest(".file-manager__layout")||i.closest("[data-drop-overlay]")||i.closest("[data-drag-capture]");(K.current||H||o||a)&&(e.preventDefault(),e.stopPropagation(),q(!1),W(!1),X.current=0,Qe(!0),Ie(n).catch(e=>{null==e||e.name}).finally(()=>Qe(!1)))},t=e=>{var t,r;(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",document.body.hasAttribute("data-fm-dragging")||(document.body.setAttribute("data-fm-dragging","true"),Y(!0)),it!==Mt||K.current||q(!0))},r=e=>{var t,r;(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",document.body.setAttribute("data-fm-dragging","true"),Y(!0))},n={capture:!0,passive:!1};return window.addEventListener("drop",e,n),window.addEventListener("dragover",t,n),window.addEventListener("dragenter",r,n),()=>{window.removeEventListener("drop",e,n),window.removeEventListener("dragover",t,n),window.removeEventListener("dragenter",r,n)}},[H,Ie,it]),(0,o.useEffect)(()=>{const e=e=>{H&&nt(),q(!1),Y(!1),document.body.removeAttribute("data-fm-dragging")};return window.addEventListener("dragend",e,!0),()=>window.removeEventListener("dragend",e,!0)},[H,nt]),(0,o.useEffect)(()=>{let e=null;const t=t=>{H&&(e=setTimeout(()=>{H&&nt()},200))};return document.addEventListener("mouseup",t,!0),()=>{document.removeEventListener("mouseup",t,!0),e&&clearTimeout(e)}},[H,nt]),(0,o.useEffect)(()=>{const e=e=>{"Escape"===e.key&&H&&nt()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[H,nt]),(0,o.useEffect)(()=>{const e=e=>{H&&setTimeout(()=>{H&&nt()},100)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[H,nt]);const ot=o.useCallback(async()=>{await Le(),await ce(),Ne===Bt&&ue&&await ue(Bt),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var e,t;return null===(t=null===(e=Z.current)||void 0===e?void 0:e.refreshFileCounts)||void 0===t?void 0:t.call(e)})})},[ce,ue,Le,Ne]),at=o.useCallback(()=>{re(!0)},[]),st=o.useCallback(async()=>{var e,t;if(Ne===Bt)try{if(null==C?void 0:C.cleanTrash){const t=await C.cleanTrash();await we({folderId:Bt}),await(null===(e=Z.current)||void 0===e?void 0:e.refreshFileCounts()),t.success?f.success({id:"TRASH_CLEARED_SUCCESS",message:p("Trash cleared successfully"),description:p("{{count}} items permanently deleted",{count:t.deletedCount||0}),placement:"bottomRight"}):f.error({id:"TRASH_CLEAR_FAILED",message:p("Failed to clear trash"),placement:"bottomRight"})}else{const e=Q.current||[];if(0===e.length)return void re(!1);const r=e.map(e=>({id:e.id,isFolder:e.isFolder})),n=await h({items:r,selectedFolder:Bt,getItemNameById:t=>{var r;return(null===(r=e.find(e=>e.id===t))||void 0===r?void 0:r.name)||t||""},showNotifications:!1});await we({folderId:Bt}),await(null===(t=Z.current)||void 0===t?void 0:t.refreshFileCounts());const{successCount:i,failCount:o}=n;0===o?f.success({id:"TRASH_CLEARED_SUCCESS",message:p("Trash cleared successfully"),description:p("{{count}} items permanently deleted",{count:i}),placement:"bottomRight"}):i>0?f.warning({id:"TRASH_CLEARED_PARTIAL",message:p("Trash partially cleared"),description:p("{{succeeded}} items deleted, {{failed}} items failed",{succeeded:i,failed:o}),placement:"bottomRight"}):f.error({id:"TRASH_CLEAR_FAILED",message:p("Failed to clear trash"),placement:"bottomRight"})}re(!1)}catch(e){f.error({id:"TRASH_CLEAR_ERROR",message:p("Error clearing trash"),placement:"bottomRight"}),re(!1)}else re(!1)},[Ne,C,we,f,p,h]),lt=o.useCallback(()=>{re(!1)},[]),ct=o.useCallback(async e=>{var t;await Fe(e),await(null===(t=Z.current)||void 0===t?void 0:t.refreshFileCounts())},[Fe]),ut=o.useCallback(async e=>{var t;await Oe(e),await(null===(t=Z.current)||void 0===t?void 0:t.refreshFileCounts())},[Oe]),dt=o.useCallback(async()=>{let e=[],t=new Map;const r=null==y?void 0:y.config;await _e({onStartBatch:n=>{e=u.startUpload(Ne||void 0,n),t=new Map,n.forEach((n,i)=>{const o=e[i];o&&(t.set(n.name,o),t.set(fr(n.name,r),o))})},onStart:n=>{if(0===e.length){e=u.startUpload(Ne||void 0,[n]);const i=e[0];i&&(t.set(n.name,i),t.set(fr(n.name,r),i))}},onProgress:(e,r)=>{const n=t.get(e);n&&u.updateProgress(n,r)},onComplete:async e=>{var r;const n=t.get(e);if(n){await new Promise(e=>setTimeout(e,100));const t=null==me?void 0:me.find(t=>t.name===e&&!t.isFolder);u.markAsSuccess(n,t)}await(null===(r=Z.current)||void 0===r?void 0:r.refreshFileCounts())},onError:(r,n,i)=>{var o;const a=null!==(o=t.get(r))&&void 0!==o?o:null!=i&&i<e.length?e[i]:void 0;a&&u.markAsError(a,n)},onBatchComplete:async r=>{var n,i,o,a,s,l,c,d;for(let h=0;h<r.successes.length;h++){const d=r.successes[h],f=null===(n=r.uploadedFiles)||void 0===n?void 0:n.get(d),p=null!==(a=null!==(o=null!==(i=t.get(d))&&void 0!==i?i:(null==f?void 0:f.originalFileName)?t.get(f.originalFileName):void 0)&&void 0!==o?o:null!=(null==f?void 0:f.originalIndex)&&f.originalIndex<e.length?e[f.originalIndex]:void 0)&&void 0!==a?a:h<e.length?e[h]:void 0;if(p){let e;if(null==f?void 0:f.id){const t=f;e={id:t.id,name:null!==(s=t.name)&&void 0!==s?s:d,folderId:null!==(c=null!==(l=t.folderId)&&void 0!==l?l:Ne)&&void 0!==c?c:null,isFolder:!1,size:t.size}}else await new Promise(e=>setTimeout(e,100)),e=null==me?void 0:me.find(e=>e.name===d&&!e.isFolder);u.updateProgress(p,100),u.markAsSuccess(p,e)}}r.errors.forEach(({fileName:e,error:r})=>{const n=t.get(e);n&&u.markAsError(n,r)}),await(null===(d=Z.current)||void 0===d?void 0:d.refreshFileCounts())}})},[_e,u,me,Ne,null==y?void 0:y.config]),ht=o.useCallback(async(e,t,r,n)=>{var i,o;try{ee(!0);let a=r||"uploaded-file";if(!r&&e){const t=e.split("?")[0].split("#")[0].split("/");a=t[t.length-1]||"uploaded-file",a.includes(".")&&(null===(i=a.split(".").pop())||void 0===i?void 0:i.length)&&a.split(".").pop().length<=5||(a+=".jpg")}const s=u.startUploadByUrl(Ne||void 0,a);try{const r=await Se(e,t,!0,null!=n?n:"uploadByUrl");if(u.updateProgress(s,100),r){await new Promise(e=>setTimeout(e,100));const e=(null==me?void 0:me.find(e=>e.id===r.id&&!e.isFolder))||r;u.markAsSuccess(s,e)}else u.markAsSuccess(s);await(null===(o=Z.current)||void 0===o?void 0:o.refreshFileCounts())}catch(e){const t=fo(e),r=vo(t,p);u.markAsError(s,r)}}finally{ee(!1)}},[Se,u,Ne,me,p]),ft=o.useCallback(async({file:e})=>{var t;const r=u.startUpload(Ne||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),u.updateProgress(r,n)},200);try{const n=await d.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),u.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==me?void 0:me.find(e=>e.id===n.id&&!e.isFolder))||n;u.markAsSuccess(r,e)}else u.markAsSuccess(r);const o=n&&n.folderId||Ne||null;return ze&&ze(o&&"folders"!==o?o:"folders"),await(null===(t=Z.current)||void 0===t?void 0:t.refreshFileCounts()),n}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw u.markAsError(r,t),e}},[d,u,Ne,me,ze]),pt=o.useCallback(async e=>{var t;if(Ie){const r=u.startUpload(Ne||void 0,e);e.forEach(async(e,t)=>{const n=r[t];if(!n)return;let i=0;const o=setInterval(()=>{i=Math.min(i+10+Math.floor(Date.now()%10),85),u.updateProgress(n,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await Ie(e),r.forEach(e=>{u.updateProgress(e,100),u.markAsSuccess(e)}),await(null===(t=Z.current)||void 0===t?void 0:t.refreshFileCounts())}},[Ie,u,Ne]),gt=o.useCallback(async e=>{var t;await Ce(e),await ce(),await(null===(t=Z.current)||void 0===t?void 0:t.refreshFileCounts())},[Ce,ce]),mt=(({files:e,clearSelection:t,showRenameModal:r,showMoveModal:n,showCopyModal:i,handleDeleteFile:a,handleDeleteFolder:s,showDeleteConfirm:l,onEdit:c})=>{const u=o.useCallback(()=>{t()},[t]),d=o.useCallback(e=>{const t=Oa.getState().selectedFiles;if(t&&1===t.size||e){const n=e||Array.from(t)[0];r(n)}},[r]),h=o.useCallback(t=>{const r=Oa.getState().selectedFiles;if(r&&r.size>0||(null==t?void 0:t.id)){if(l)return void l();(t?[t.id]:r).forEach(t=>{const r=e.find(e=>e.id===t);r&&(r.isFolder?s(t):a(t))})}},[e,a,s,l]);return{handleClearSelection:u,handleRename:d,handleDeleteSelected:h,handleCopy:o.useCallback(()=>{i()},[i]),handleMove:o.useCallback(()=>{n()},[n]),handleEdit:o.useCallback(()=>{c()},[c])}})({files:me||[],clearSelection:ie,showRenameModal:Ae,showMoveModal:je,showCopyModal:a.actions.showCopyModal||(()=>{}),handleDeleteFile:xe,handleDeleteFolder:gt,showDeleteConfirm:Pe,onEdit:Ke.handleEdit}),vt=se||ve||Ze;(0,o.useEffect)(()=>{Jt()},[]),(0,o.useLayoutEffect)(()=>{D!==Mt?ie():oe(me||[])},[D,me,oe,ie]),(0,o.useEffect)(()=>{if(!b||D!==Mt)return;if(!ar.current)return void(ar.current=!0);const e=(Array.isArray(me)?me:[]).filter(e=>ne.has(e.id));b(e)},[D,me,ne,b]),o.useEffect(()=>{if(!ze||0===ae.length)return;const e=!1!==(null==x?void 0:x.rememberLastFolder),t=`em_fm:lastFolder:${(null==x?void 0:x.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t),r=e&&ae.some(t=>t.id===e);if(r)return void ze(e)}catch(e){}Ne||ze("folders")},[Ne,ze,ae,null==x?void 0:x.rememberLastFolder,null==x?void 0:x.projectId]);const{handleRenameFolderCancel:yt,handleRenameFolderOk:bt}=ge.actions;(0,o.useEffect)(()=>{const e=async e=>{if(D!==Mt)return;const t=document.activeElement;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||"true"===(null==t?void 0:t.getAttribute("contenteditable")))return;const r=e.clipboardData;if(!r)return;const n=Array.from(r.items),i=n.filter(e=>e.type.startsWith("image/"));if(i.length>0){const t=i.map(e=>e.getAsFile()).filter(e=>null!==e);return void(t.length>0&&(e.preventDefault(),await pt(t)))}const o=n.find(e=>"text/plain"===e.type);o&&o.getAsString(async t=>{const r=t.trim();if(r.startsWith("http://")||r.startsWith("https://"))e.preventDefault(),await ht(r);else if(r.includes("<meta")||r.includes("http")){const t=r.match(/https?:\/\/[^\s"']+/);t&&(e.preventDefault(),await ht(t[0]))}})};return document.addEventListener("paste",e),()=>{document.removeEventListener("paste",e)}},[D,ht,pt]);const wt=(0,o.useRef)(Ue);(0,o.useEffect)(()=>{wt.current=Ue},[Ue]);const xt=(0,o.useCallback)(e=>{Ye(e.current||wt.current.current,e.pageSize||wt.current.pageSize)},[Ye]),Ct=(0,o.useCallback)(e=>{null==Be||Be(e)},[Be]),_t=o.useCallback(e=>{const{sortBy:t,sortOrder:r}=(e=>{const[t,r]=e.split("-");return{sortBy:t,sortOrder:r}})(e);Ge(t,r)},[Ge]),[St,At]=(0,o.useState)(LM),[kt,Et]=(0,o.useState)([]),It=(0,o.useRef)(null),[jt,Tt]=(0,o.useState)(Yt),[Ft,Ot]=(0,o.useState)([]),Ut=(0,o.useRef)(null),[Vt,Ht]=(0,o.useState)(""),Wt=(0,o.useRef)(null),[$t,Gt]=(0,o.useState)(""),[Xt,Kt]=(0,o.useState)([]),Zt=o.useRef(void 0),[Qt,er]=(0,o.useState)(!1),[tr,ir]=(0,o.useState)(!1),or=o.useRef(null),ar=o.useRef(!1),[sr,cr]=(0,o.useState)({mode:"qr",rawText:"",foregroundHex:"#000000",backgroundHex:"#ffffff",transparentBackground:!1,qrSidePx:200,barcodeBarHeightPx:60}),ur=o.useRef(D),dr=o.useCallback(e=>{const t=e.indexOf(",");if(-1===t)return null;const r=e.substring(0,t),n=r.match(/^data:([^;]+)/),i=n&&n[1]||"image/svg+xml";let o,a="svg";if(i.includes("png")?a="png":(i.includes("jpeg")||i.includes("jpg"))&&(a="jpg"),/;base64/i.test(r)){const r=e.substring(t+1),n=atob(r),a=new Uint8Array(n.length);for(let e=0;e<n.length;e+=1)a[e]=n.charCodeAt(e);o=new Blob([a],{type:i})}else{const r=decodeURIComponent(e.substring(t+1));o=new Blob([r],{type:i})}return new File([o],`icon_${Date.now()}.${a}`,{type:i})},[]),hr=o.useCallback(async e=>{var t;const r=u.startUpload(Ne||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),u.updateProgress(r,n)},200);try{const n=await d.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),u.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==me?void 0:me.find(e=>e.id===n.id&&!e.isFolder))||n;u.markAsSuccess(r,e)}else u.markAsSuccess(r);await(null===(t=Z.current)||void 0===t?void 0:t.refreshFileCounts())}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw u.markAsError(r,t),e}},[u,me,d,Ne]),pr=(0,o.useCallback)(async e=>{if(Boolean(e&&e.startsWith("data:"))){const t=dr(e);if(!t)return;return void await hr(t)}e&&await ht(e,void 0,void 0,"iconStock")},[dr,ht,hr]),gr=(0,o.useCallback)(async()=>{const e=null==U?void 0:U.fileForEdit;if(Zt.current!==e&&D===zt&&e&&!Ke.editingFile){Zt.current=e;try{if("string"==typeof e){if(e.startsWith("data:"))return void(null==Ke||Ke.handleEdit({thumbnail:e,saveWithoutFolder:!0}));const t=await d.resolveFileForEditByUrl(e);Zt.current===e&&(null==Ke||Ke.handleEdit(t))}}catch(t){Zt.current===e&&(Zt.current=null),null==Ke||Ke.handlePixieEditorClose()}}},[null==U?void 0:U.fileForEdit,D,Ke,d]);(0,o.useEffect)(()=>{gr()},[gr]),(0,o.useEffect)(()=>{var e,t,r,n;const i=ur.current;ur.current=D,D===Mt?(Et([]),At(LM),Ot([]),Tt(Yt),Kt([]),Gt(""),ir(!1),er(!1),i===Mt||i!==Rt&&i!==Pt&&i!==Nt||qe("")):D===Nt?null===(e=or.current)||void 0===e||e.focus():D===Pt?null===(t=It.current)||void 0===t||t.focus():D===Rt?null===(r=Ut.current)||void 0===r||r.focus():D===Lt&&(null===(n=Wt.current)||void 0===n||n.focus())},[D,qe]);const mr=o.useCallback(async()=>{var e;await bt(),await(null===(e=Z.current)||void 0===e?void 0:e.refreshFileCounts())},[bt]),vr=(0,o.useCallback)(e=>{var t;return e?(null===(t=e.files)||void 0===t?void 0:t.length)?Array.from(e.files):e.items?Array.from(e.items).map(e=>e.getAsFile()).filter(e=>Boolean(e)):[]:[]},[]);return(0,i.jsxs)(i.Fragment,{children:[G&&it===Mt&&(0,le.createPortal)((0,i.jsx)("div",{className:Ja.dragCaptureLayer,"data-drag-capture":"true",onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy"),(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&!K.current&&q(!0)},onDragEnter:e=>{var t,r;e.preventDefault(),e.stopPropagation(),(null===(r=null===(t=e.dataTransfer)||void 0===t?void 0:t.types)||void 0===r?void 0:r.includes("Files"))&&q(!0)},onDragLeave:e=>{const t=e.relatedTarget;t&&document.documentElement.contains(t)||(q(!1),Y(!1),document.body.removeAttribute("data-fm-dragging"))},onDrop:e=>{e.preventDefault(),e.stopPropagation(),Y(!1),q(!1),document.body.removeAttribute("data-fm-dragging");const t=vr(e.dataTransfer);t.length&&(Qe(!0),Ie(t).catch(e=>{null==e||e.name}).finally(()=>Qe(!1)))},"aria-hidden":"true"}),document.body),$&&(0,le.createPortal)((0,i.jsx)("div",{className:Ja.dragOverlayGlobal,"data-drop-overlay":"true",onDragOver:e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},onDragEnter:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),e.stopPropagation(),q(!1),Y(!1),document.body.removeAttribute("data-fm-dragging");const t=vr(e.dataTransfer);t.length&&(Qe(!0),Ie(t).catch(e=>{null==e||e.name}).finally(()=>Qe(!1)))},"aria-hidden":"true",children:(0,i.jsxs)("div",{className:Ja.dragOverlayInner,children:[(0,i.jsx)("div",{className:Ja.uploadIcon,children:(0,i.jsx)(V,{})}),(0,i.jsx)("div",{className:Ja.textTitle,children:p("Drop files here to upload")}),(0,i.jsx)("div",{className:Ja.textDescription,children:p("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),document.body),(0,i.jsx)(R.A,{className:"file-manager__layout",children:(0,i.jsxs)("div",{className:Ja.filesContainer,"data-files-container":"true",onDragOver:tt,onDragLeave:et,onDragEnter:Je,onDrop:rt,children:[H&&(0,i.jsx)("div",{className:Ja.dragOverlay,children:(0,i.jsxs)("div",{className:Ja.dragOverlayInner,children:[(0,i.jsx)("div",{className:Ja.uploadIcon,children:(0,i.jsx)(V,{})}),(0,i.jsx)("div",{className:Ja.textTitle,children:p("Drop files here to upload")}),(0,i.jsx)("div",{className:Ja.textDescription,children:p("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),(0,i.jsxs)(R.A,{className:"file-manager__content",children:[(0,i.jsx)(OM,{width:320,theme:"light",className:"file-manager-sider",children:(0,i.jsx)(Ns,{ref:Z,selectedFolder:Ne||"folders",generateMenuItems:pe,onFolderSelect:e=>null==ze?void 0:ze(e),folders:ae||[],fetchFolders:ce,fetchChildFolders:ue,handleAddFile:dt,setIsUrlModalVisible:e=>null==z?void 0:z(e),handleDeleteFolder:gt,handleCreateFolder:de,activeLibraryItem:D,setActiveLibraryItem:e=>null==B?void 0:B(e)})}),(0,i.jsxs)(R.A,{className:"file-manager__main-content",children:[Ze&&(0,i.jsx)(Ts,{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,zIndex:100,background:"var(--colorBgLayout)"}}),(0,i.jsxs)(MM,{className:"main-content",children:[(0,i.jsx)(hM,{activeLibraryItem:D,selectedFolder:(null===(e=null==ae?void 0:ae.find(e=>(null==e?void 0:e.id)===Ne))||void 0===e?void 0:e.name)||p("Folders"),isTrashFolder:"Trash"===Ne,onClearTrash:at,files:me||[],loading:vt,onRefresh:Xe,refreshDisabled:ve||se,showRefresh:!(!(null===(t=null==y?void 0:y.apiEndpoints)||void 0===t?void 0:t.clearCache)&&!(null===(r=null==y?void 0:y.dataProviders)||void 0===r?void 0:r.clearCache))}),(0,i.jsx)(O.A,{className:"zero-divider"}),D===Mt&&(0,i.jsx)(As,{searchTerm:He,handleAddFile:dt,files:me||[],handleSearch:qe,sortBy:We,sortOrder:$e,handleSortOptionChange:_t,pagination:Ue,setPagination:xt,loading:vt,handleItemClick:Ct,onClearSelection:mt.handleClearSelection,onRename:mt.handleRename,onCopy:mt.handleCopy,onMove:mt.handleMove,onDelete:mt.handleDeleteSelected,showRenameModal:Ae,showDeleteConfirm:Pe,showCopyModal:a.actions.showCopyModal||(()=>{}),showMoveModal:je,onEdit:Ke.handleEdit,getFileData:d.getFileData}),D===Pt&&(0,i.jsx)(wM,{imageGifList:kt,setImageGifList:Et,currentReqGif:St,setCurrentReqGif:At,inputRef:It,customRequest:(e,t)=>ht(e,void 0,t,"gif")}),D===Rt&&(0,i.jsx)(SM,{imageStockList:Ft,setImageStockList:Ot,currentReq:jt,setCurrentReq:Tt,inputRef:Ut,customRequest:(e,t)=>ht(e,void 0,t,"imageStock")}),D===Lt&&(0,i.jsx)(o.Suspense,{fallback:(0,i.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"48px 0"},children:(0,i.jsx)(s.A,{size:"large"})}),children:(0,i.jsx)(PM,{customRequest:pr,query:Vt,setQuery:Ht,inputRef:Wt})}),D===Dt&&(0,i.jsx)(o.Suspense,{fallback:(0,i.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"48px 0"},children:(0,i.jsx)(s.A,{size:"large"})}),children:(0,i.jsx)(RM,{customRequest:ft,state:sr,setState:cr})}),D===Nt&&!!(null==U?void 0:U.sseQuery)&&(0,i.jsx)(FM,{imageAiList:Xt,setImageAiList:Kt,aiImageRequest:$t,setAiImageRequest:Gt,inputAiRef:or,customRequest:ft,isLoadingAi:Qt,setIsLoadingAi:er,isImageUploaded:tr,setIsImageUploaded:ir}),D===zt&&(0,i.jsx)(i.Fragment,{})]})]})]}),J&&!u.isUploadVisible&&(0,i.jsx)("div",{style:{position:"fixed",inset:0,zIndex:1500,backgroundColor:"rgba(255, 255, 255, 0.5)",pointerEvents:"all",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,i.jsx)(s.A,{size:"large"})}),(0,i.jsx)(Rs,{isModalVisible:j,handleModalOk:he,handleModalCancel:fe,form:_,selectedFolder:Ne||null,folders:ae||[],isUrlModalVisible:T,setIsUrlModalVisible:e=>null==z?void 0:z(e),handleAddFileByUrl:ht,urlForm:S,isRenameModalVisible:ye,handleRenameOk:()=>null==Ee?void 0:Ee(),handleRenameCancel:()=>null==ke?void 0:ke(),renameForm:A,fileToRename:be,files:me||[],isMoveModalVisible:F,handleMoveOk:ct,handleMoveCancel:Te,moveForm:k,selectedFiles:ne||new Set,isRenameFolderModalVisible:M,handleRenameFolderOk:mr,handleRenameFolderCancel:yt,renameFolderForm:E,folderToRename:N,isCopyModalVisible:P,handleCopyOk:ut,handleCopyCancel:Me,copyForm:I,isDeleteConfirmVisible:L,handleDeleteConfirmOk:ot,handleDeleteConfirmCancel:()=>null==Re?void 0:Re(),isClearTrashConfirmVisible:te,handleClearTrashConfirm:st,handleClearTrashCancel:lt,fetchChildFolders:ue}),(0,i.jsx)(sM,{visible:Ke.isPixieEditorVisible,onClose:Ke.handlePixieEditorClose,file:Ke.editingFile,onSave:Ke.handlePixieEditorSave,onSaveCopy:Ke.handlePixieEditorSaveCopy}),(0,i.jsx)(cM,{files:u.uploadFiles,visible:u.isUploadVisible,minimized:u.isUploadMinimized,totalFiles:u.totalFiles,completedFiles:u.completedFiles,onClose:u.closeUpload,onMinimize:u.minimizeUpload,onInsert:e=>{var t;const r=u.getUploadedFile(e.id)||e;null===(t=g.onEditorOk)||void 0===t||t.call(g,r)}})]})})]})},DM=(0,o.memo)(({config:e={},onPathChange:t,onChangeSelection:r,onEditorOk:n,searchQuery:a="",sortBySize:s="name",apiEndpoints:l={},customIcons:d,dragDropIcon:h,dataProviders:f,handleNotify:p,handleError:g,handleSuccess:m})=>{const v=o.useMemo(()=>Object.assign({folderTreeLoading:"lazy",expandAllFoldersOnInit:!1,expandRootFolderOnInit:!1,iconStrokeWidth:1.4,availableImageExtensions:["jpg","jpeg","png","gif"],fileNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.fileNameProcessing),folderNameProcessing:Object.assign(Object.assign({},{transliterate:!0,replaceSpaces:!0,removeForbiddenChars:!0,toLowerCase:!0}),e.folderNameProcessing)},e),[e]);o.useEffect(()=>{v.theme&&(e=>{if("system"===e){const t=matchMedia(Wt).matches?Vt:Ut;e=e===Ht?t:e}document.documentElement.setAttribute("data-theme",e)})(v.theme),(e=>{(null==e?void 0:e.customTheme)&&((e={})=>{const t=document.querySelector("head");if(!t)return;const r=document.createElement("style");if(r.type="text/css",r.dataset.themeVariablesFm="true",r.setAttribute("data-file-manager","true"),Object.entries(e).length){let n="";Object.entries(e).forEach(([e,t])=>{"object"!=typeof t&&(n+=`\t--${e}: ${t};\n`)}),n=`.em-filemanager {\n${n}}`,r.appendChild(document.createTextNode(n));const i=t.querySelector('[data-theme-variables-fm="true"]');i?t.replaceChild(r,i):t.insertBefore(r,t.firstChild)}})(null==e?void 0:e.customTheme)})(v)},[v]),(0,o.useEffect)(()=>{v.locale&&v.locale!==an.language&&an.changeLanguage(v.locale),v.customLocale&&v.locale&&an.addResourceBundle(v.locale,"translation",v.customLocale,!0,!0)},[v.locale,v.customLocale]);const y=(0,o.useRef)(null),b=o.useMemo(()=>({apiEndpoints:l,searchQuery:a,sortBySize:s,onPathChange:t,onChangeSelection:r,onEditorOk:n,config:v,customIcons:d,dragDropIcon:h,dataProviders:f,handleNotify:p,handleError:g,handleSuccess:m}),[l,a,s,t,r,n,v,d,h,f,p,g,m]);return(0,i.jsx)(u.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Ay,{getPopupContainer:()=>y.current||document.body,children:(0,i.jsx)(Ki,{options:b,children:(0,i.jsx)(NM,{})})}),(0,i.jsx)("div",{ref:y,className:"file-manager-modal-root"})]})})});DM.displayName="FileManagerApp";const zM=e=>{var t,r,n;return(0,i.jsx)(An,{i18n:an,children:(0,i.jsx)(Zt,{externalTheme:null!==(r=null===(t=e.config)||void 0===t?void 0:t.theme)&&void 0!==r?r:"light",customThemeToken:null===(n=e.config)||void 0===n?void 0:n.customTheme,children:(0,i.jsx)(z.A,{children:(0,i.jsx)(DM,Object.assign({},e))})})})},BM=(new Map,new Map,e=>{const{onClose:t,onSave:r,dataProviders:n,theme:a,locale:s,hasPagination:l,disablePagination:d,paginationAvailable:h,dedupeUploadNamesOnClient:f,saveCopyToCurrentFolder:p}=e,g=o.useMemo(()=>{var t,r;return{theme:null!=a?a:"light",locale:s,baseUrl:e.baseUrl,assetsUrl:e.assetsUrl,compressMaxSize:e.compressMaxSize,compressMaxWidthOrHeight:e.compressMaxWidthOrHeight,compessorUrl:null!==(t=e.compessorUrl)&&void 0!==t?t:e.compressorUrl,compressorUrl:null!==(r=e.compressorUrl)&&void 0!==r?r:e.compessorUrl,showNotifications:e.showNotifications,fetchWithProxy:e.fetchWithProxy,handleFileProxy:e.handleFileProxy,hasPagination:l,disablePagination:d,paginationAvailable:h,dedupeUploadNamesOnClient:f,saveCopyToCurrentFolder:p}},[a,s,e.baseUrl,e.assetsUrl,e.compressMaxSize,e.compressMaxWidthOrHeight,e.compessorUrl,e.compressorUrl,e.showNotifications,e.fetchWithProxy,e.handleFileProxy,l,d,h,f,p]),m=o.useCallback(async(e,t,r,i)=>{if(!e&&!t||!(null==n?void 0:n.getFiles))return null;try{const o=await n.getFiles({folderId:i?void 0:null!=r?r:void 0,noFolder:i,search:t||void 0,itemType:"file",page:1,limit:1}),[a]=o.files;return a?e&&a.id!==e?null:a:null}catch(e){return null}},[n]),v=o.useMemo(()=>{if(e.file)return e.file;const t=e.name||"edited-image",r=e.extension||(e.type?e.type.split("/")[1]:"png"),n=e.type||`image/${r}`;return{thumbnail:e.imageDataUrl||"",name:t,id:void 0,type:n,extension:r,saveWithoutFolder:!0}},[e.file,e.imageDataUrl,e.name,e.extension,e.type]),y=o.useCallback(async(e,t)=>{if((null==n?void 0:n.updateFile)&&e.thumbnail)try{const r=(null==t?void 0:t.mimeType)||rr(e.thumbnail,e.type),i=nr(r),o=e.name.substring(0,e.name.lastIndexOf("."))+"."+i,a=(null==t?void 0:t.blob)||lr(e.thumbnail,r);return await n.updateFile(e.id,{name:o,type:r,data:a})}catch(e){return null}return null},[n]),b=o.useCallback(async(e,t)=>{var r,i,o,a,s,l;if(!e.thumbnail)return null;try{const c=!0!==g.saveCopyToCurrentFolder||(null!==(r=e.saveWithoutFolder)&&void 0!==r?r:!e.id),u=c?"":e.folderId||"",d=(null==t?void 0:t.mimeType)||rr(e.thumbnail,e.type),h=(null==t?void 0:t.blob)||lr(e.thumbnail,d),f=fr(e.name,g),p=await Gn(n,f,u,c,gr(g)),v=new File([h],p,{type:d,lastModified:Date.now()});if(null==n?void 0:n.uploadFiles){const t=await n.uploadFiles({items:[{name:v.name,size:v.size,type:v.type,folderId:u,noFolder:c,data:v,extension:nr(d)}],folderId:u}),r=null===(i=t.detailed)||void 0===i?void 0:i[0];if(t.success&&(null==r?void 0:r.success)&&r.data){const t=r.data;if(t.url||t.thumbnailUrl||t.thumbnail)return{id:t.id||e.id||"",name:t.name||e.name,folderId:null!==(o=t.folderId)&&void 0!==o?o:u,type:t.type||v.type,size:null!==(a=t.size)&&void 0!==a?a:v.size,extension:t.extension||nr(d),url:t.url,thumbnailUrl:t.thumbnailUrl,thumbnail:t.thumbnail,date:t.date,dimensions:t.dimensions,aspectRatio:t.aspectRatio,sourceUrl:t.sourceUrl,isFolder:!1,selected:!1};return await m(r.data.id,r.data.name||v.name,null!==(s=r.data.folderId)&&void 0!==s?s:u,c)||{id:r.data.id||e.id||"",name:r.data.name||e.name,folderId:null!==(l=r.data.folderId)&&void 0!==l?l:u,type:v.type,size:v.size,extension:nr(d),url:r.data.url,thumbnailUrl:r.data.thumbnailUrl,thumbnail:r.data.thumbnail,isFolder:!1,selected:!1}}}return(null==n?void 0:n.uploadFile)?await n.uploadFile({name:v.name,size:v.size,type:v.type,folderId:u,noFolder:c,data:v,extension:nr(d)}):null}catch(e){return null}},[n,m,g]),w=o.useCallback(async(e,i)=>{if((null==n?void 0:n.updateFile)&&e.id&&e.thumbnail)try{const t=await y(e,i);t&&(e=t)}catch(e){}return r&&await r(e,i),t&&t(),e},[n,r,t,y]),x=o.useCallback(async(e,n)=>{let i=e;if(e.thumbnail)try{const t=await b(e,n);t&&(i=t)}catch(e){}return r&&await r(i,n),t&&t(),i},[t,r,b]),C=(0,o.useRef)(null);return(0,o.useEffect)(()=>{s&&s!==an.language&&an.changeLanguage(s)},[s]),(0,i.jsx)(u.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Ay,{getPopupContainer:()=>C.current||document.body,children:(0,i.jsx)(An,{i18n:an,children:(0,i.jsx)(Zt,{externalTheme:null!=a?a:"light",children:(0,i.jsx)(z.A,{children:(0,i.jsx)(Ki,{options:{dataProviders:n,handleNotify:e.handleNotify,handleError:e.handleError,handleSuccess:e.handleSuccess,config:g},children:(0,i.jsx)(sM,{visible:!0,onClose:t,file:v,onSave:w,onSaveCopy:x})})})})})}),(0,i.jsx)("div",{ref:C,className:"file-manager-modal-root"})]})})})}}]);
|
|
3
|
+
//# sourceMappingURL=8559.f5ef7cd8.js.map
|