@emailmaker/filemanager 0.10.44 → 0.10.45
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/components/UploadProgress/UploadProgress.d.ts +1 -1
- package/file-manager.esm.js +3 -3
- package/file-manager.esm.js.map +1 -1
- package/file-manager.js +1 -1
- package/hooks/core/files/useFilesAPI.d.ts +1 -1
- package/hooks/core/useFiles.d.ts +2 -2
- package/hooks/useFileUpload.d.ts +1 -0
- package/package.json +1 -1
- package/types.d.ts +3 -2
package/file-manager.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from
|
|
|
6
6
|
* Released under MIT license <https://lodash.com/license>
|
|
7
7
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
8
8
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
9
|
-
*/var vi=(pi||(pi=1,function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,h=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],p="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",y="[object Error]",b="[object Function]",w="[object GeneratorFunction]",x="[object Map]",C="[object Number]",_="[object Object]",S="[object Promise]",A="[object RegExp]",k="[object Set]",E="[object String]",I="[object Symbol]",T="[object WeakMap]",F="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",j="[object Int32Array]",D="[object Uint8Array]",N="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,q=RegExp(W.source),G=RegExp($.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),re=/^\s+/,ne=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",ke="\\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",Ee="['’]",Ie="["+we+"]",Te="["+ke+"]",Fe="["+xe+"]",Oe="\\d+",Pe="["+Ce+"]",Me="["+_e+"]",Re="[^"+we+ke+Oe+Ce+_e+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",De="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ue="(?:"+Me+"|"+Re+")",Ve="(?:"+ze+"|"+Re+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",$e="(?:"+Fe+"|"+Le+")?",qe="["+Ae+"]?",Ge=qe+$e+"(?:"+Be+"(?:"+[je,De,Ne].join("|")+")"+qe+$e+")*",Ye="(?:"+[Pe,De,Ne].join("|")+")"+Ge,Xe="(?:"+[je+Fe+"?",Fe,De,Ne,Ie].join("|")+")",Ke=RegExp(Ee,"g"),Ze=RegExp(Fe,"g"),Je=RegExp(Le+"(?="+Le+")|"+Xe+Ge,"g"),Qe=RegExp([ze+"?"+Me+"+"+He+"(?="+[Te,ze,"$"].join("|")+")",Ve+"+"+We+"(?="+[Te,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+He,ze+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ye].join("|"),"g"),et=RegExp("["+Be+we+xe+Ae+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["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"],nt=-1,it={};it[P]=it[M]=it[R]=it[L]=it[j]=it[D]=it[N]=it[z]=it[B]=!0,it[p]=it[g]=it[F]=it[m]=it[O]=it[v]=it[y]=it[b]=it[x]=it[C]=it[_]=it[A]=it[k]=it[E]=it[T]=!1;var ot={};ot[p]=ot[g]=ot[F]=ot[O]=ot[m]=ot[v]=ot[P]=ot[M]=ot[R]=ot[L]=ot[j]=ot[x]=ot[C]=ot[_]=ot[A]=ot[k]=ot[E]=ot[I]=ot[D]=ot[N]=ot[z]=ot[B]=!0,ot[y]=ot[b]=ot[T]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Er&&Er&&Er.Object===Object&&Er,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,ft=ht&&e&&!e.nodeType&&e,pt=ft&&ft.exports===ht,gt=pt&&ct.process,mt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||gt&>.binding&>.binding("util")}catch(e){}}(),vt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,wt=mt&&mt.isRegExp,xt=mt&&mt.isSet,Ct=mt&&mt.isTypedArray;function _t(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 St(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 At(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Et(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 It(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 Tt(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Ft(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 Ot(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 Pt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Mt(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 Rt(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 Lt(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 jt=Ht("length");function Dt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Nt(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 zt(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):Nt(e,Ut,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?qt(e,t)/r:d}function Ht(e){return function(t){return null==t?r:t[e]}}function Wt(e){return function(t){return null==e?r:e[t]}}function $t(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function qt(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 Gt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,dr(e)+1).replace(re,""):e}function Xt(e){return function(t){return e(t)}}function Kt(e,t){return Ot(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var r=-1,n=e.length;++r<n&&zt(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&zt(t,e[r],0)>-1;);return r}var er=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function or(e,t){return function(r){return e(t(r))}}function ar(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 sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}function cr(e){return nr(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):jt(e)}function ur(e){return nr(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dr(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var hr=Wt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),fr=function e(t){var ne,we=(t=null==t?dt:fr.defaults(dt.Object(),t,fr.pick(dt,rt))).Array,xe=t.Date,Ce=t.Error,_e=t.Function,Se=t.Math,Ae=t.Object,ke=t.RegExp,Ee=t.String,Ie=t.TypeError,Te=we.prototype,Fe=_e.prototype,Oe=Ae.prototype,Pe=t["__core-js_shared__"],Me=Fe.toString,Re=Oe.hasOwnProperty,Le=0,je=(ne=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",De=Oe.toString,Ne=Me.call(Ae),ze=dt._,Be=ke("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=pt?t.Buffer:r,Ve=t.Symbol,He=t.Uint8Array,We=Ue?Ue.allocUnsafe:r,$e=or(Ae.getPrototypeOf,Ae),qe=Ae.create,Ge=Oe.propertyIsEnumerable,Ye=Te.splice,Xe=Ve?Ve.isConcatSpreadable:r,Je=Ve?Ve.iterator:r,et=Ve?Ve.toStringTag:r,at=function(){try{var e=uo(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=xe&&xe.now!==dt.Date.now&&xe.now,ht=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=Se.ceil,gt=Se.floor,mt=Ae.getOwnPropertySymbols,jt=Ue?Ue.isBuffer:r,Wt=t.isFinite,pr=Te.join,gr=or(Ae.keys,Ae),mr=Se.max,vr=Se.min,yr=xe.now,br=t.parseInt,wr=Se.random,xr=Te.reverse,Cr=uo(t,"DataView"),_r=uo(t,"Map"),Sr=uo(t,"Promise"),Ar=uo(t,"Set"),kr=uo(t,"WeakMap"),Er=uo(Ae,"create"),Ir=kr&&new kr,Tr={},Fr=Do(Cr),Or=Do(_r),Pr=Do(Sr),Mr=Do(Ar),Rr=Do(kr),Lr=Ve?Ve.prototype:r,jr=Lr?Lr.valueOf:r,Dr=Lr?Lr.toString:r;function Nr(e){if(es(e)&&!Ha(e)&&!(e instanceof Vr)){if(e instanceof Ur)return e;if(Re.call(e,"__wrapped__"))return No(e)}return new Ur(e)}var zr=function(){function e(){}return function(t){if(!Qa(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function Ur(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Vr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}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.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $r(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 qr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new $r;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new Wr(e);this.size=t.size}function Yr(e,t){var r=Ha(e),n=!r&&Va(e),i=!r&&!n&&Ga(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?Gt(e.length,Ee):[],l=s.length;for(var c in e)!t&&!Re.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yo(c,l))||s.push(c);return s}function Xr(e){var t=e.length;return t?e[Gn(0,t-1)]:r}function Kr(e,t){return Ro(Ii(e),an(t,0,e.length))}function Zr(e){return Ro(Ii(e))}function Jr(e,t,n){(n!==r&&!za(e[t],n)||n===r&&!(t in e))&&nn(e,t,n)}function Qr(e,t,n){var i=e[t];Re.call(e,t)&&za(i,n)&&(n!==r||t in e)||nn(e,t,n)}function en(e,t){for(var r=e.length;r--;)if(za(e[r][0],t))return r;return-1}function tn(e,t,r,n){return dn(e,function(e,i,o){t(n,e,r(e),o)}),n}function rn(e,t){return e&&Ti(t,Fs(t),e)}function nn(e,t,r){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function on(e,t){for(var n=-1,i=t.length,o=we(i),a=null==e;++n<i;)o[n]=a?r:As(e,t[n]);return o}function an(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function sn(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(!Qa(e))return e;var d=Ha(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Re.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ii(e,s)}else{var h=po(e),f=h==b||h==w;if(Ga(e))return Ci(e,l);if(h==_||h==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Ti(e,fo(e),t)}(e,function(e,t){return e&&Ti(t,Os(t),e)}(s,e)):function(e,t){return Ti(e,ho(e),t)}(e,rn(s,e))}else{if(!ot[h])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case F:return _i(e);case m:case v:return new i(+e);case O:return function(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case M:case R:case L:case j:case D:case N:case z:case B:return Si(e,r);case x:return new i;case C:case E:return new i(e);case A:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case k:return new i;case I:return n=e,jr?Ae(jr.call(n)):{}}}(e,h,l)}}a||(a=new Gr);var g=a.get(e);if(g)return g;a.set(e,s),os(e)?e.forEach(function(r){s.add(sn(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,i){s.set(i,sn(r,t,n,i,e,a))});var y=d?r:(u?c?no:ro:c?Os:Fs)(e);return At(y||e,function(r,i){y&&(r=e[i=r]),Qr(s,i,sn(r,t,n,i,e,a))}),s}function ln(e,t,n){var i=n.length;if(null==e)return!i;for(e=Ae(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 cn(e,t,i){if("function"!=typeof e)throw new Ie(n);return Fo(function(){e.apply(r,i)},t)}function un(e,t,r,n){var i=-1,o=Tt,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=Ot(t,Xt(r))),n?(o=Ft,a=!1):t.length>=200&&(o=Zt,a=!1,t=new qr(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}Nr.templateSettings={escape:Y,evaluate:X,interpolate:K,variable:"",imports:{_:Nr}},Nr.prototype=Br.prototype,Nr.prototype.constructor=Nr,Ur.prototype=zr(Br.prototype),Ur.prototype.constructor=Ur,Vr.prototype=zr(Br.prototype),Vr.prototype.constructor=Vr,Hr.prototype.clear=function(){this.__data__=Er?Er(null):{},this.size=0},Hr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hr.prototype.get=function(e){var t=this.__data__;if(Er){var n=t[e];return n===i?r:n}return Re.call(t,e)?t[e]:r},Hr.prototype.has=function(e){var t=this.__data__;return Er?t[e]!==r:Re.call(t,e)},Hr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Er&&t===r?i:t,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=en(t,e);return!(r<0||(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,0))},Wr.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},Wr.prototype.has=function(e){return en(this.__data__,e)>-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(_r||Wr),string:new Hr}},$r.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return lo(this,e).get(e)},$r.prototype.has=function(e){return lo(this,e).has(e)},$r.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var dn=Pi(bn),hn=Pi(wn,!0);function fn(e,t){var r=!0;return dn(e,function(e,n,i){return r=!!t(e,n,i)}),r}function pn(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&&!ss(s):n(s,l)))var l=s,c=a}return c}function gn(e,t){var r=[];return dn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function mn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=vo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?mn(s,t-1,r,n,i):Pt(i,s):n||(i[i.length]=s)}return i}var vn=Mi(),yn=Mi(!0);function bn(e,t){return e&&vn(e,t,Fs)}function wn(e,t){return e&&yn(e,t,Fs)}function xn(e,t){return It(t,function(t){return Ka(e[t])})}function Cn(e,t){for(var n=0,i=(t=yi(t,e)).length;null!=e&&n<i;)e=e[jo(t[n++])];return n&&n==i?e:r}function _n(e,t,r){var n=t(e);return Ha(e)?n:Pt(n,r(e))}function Sn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in Ae(e)?function(e){var t=Re.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var o=De.call(e);return i&&(t?e[et]=n:delete e[et]),o}(e):function(e){return De.call(e)}(e)}function An(e,t){return e>t}function kn(e,t){return null!=e&&Re.call(e,t)}function En(e,t){return null!=e&&t in Ae(e)}function In(e,t,n){for(var i=n?Ft:Tt,o=e[0].length,a=e.length,s=a,l=we(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Ot(d,Xt(t))),c=vr(d.length,c),l[s]=!n&&(t||o>=120&&d.length>=120)?new qr(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?Zt(f,g):i(u,g,n))){for(s=a;--s;){var m=l[s];if(!(m?Zt(m,g):i(e[s],g,n)))continue e}f&&f.push(g),u.push(p)}}return u}function Tn(e,t,n){var i=null==(e=Eo(e,t=yi(t,e)))?e:e[jo(Xo(t))];return null==i?r:_t(i,e,n)}function Fn(e){return es(e)&&Sn(e)==p}function On(e,t,n,i,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ha(e),l=Ha(t),c=s?g:po(e),u=l?g:po(t),d=(c=c==p?_:c)==_,h=(u=u==p?_:u)==_,f=c==u;if(f&&Ga(e)){if(!Ga(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new Gr),s||ls(e)?eo(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case F:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case m:case v:case C:return za(+e,+t);case y:return e.name==t.name&&e.message==t.message;case A:case E:return e==t+"";case x:var s=ir;case k:var l=1&n;if(s||(s=sr),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=eo(s(e),s(t),n,i,o,a);return a.delete(e),u;case I:if(jr)return jr.call(e)==jr.call(t)}return!1}(e,t,c,n,i,o,a);if(!(1&n)){var b=d&&Re.call(e,"__wrapped__"),w=h&&Re.call(t,"__wrapped__");if(b||w){var S=b?e.value():e,T=w?t.value():t;return a||(a=new Gr),o(S,T,n,i,a)}}return!!f&&(a||(a=new Gr),function(e,t,n,i,o,a){var s=1&n,l=ro(e),c=l.length,u=ro(t),d=u.length;if(c!=d&&!s)return!1;for(var h=c;h--;){var f=l[h];if(!(s?f in t:Re.call(t,f)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=s;++h<c;){var y=e[f=l[h]],b=t[f];if(i)var w=s?i(b,y,f,t,e,a):i(y,b,f,e,t,a);if(!(w===r?y===b||o(y,b,n,i,a):w)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var x=e.constructor,C=t.constructor;x==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,i,o,a))}(e,t,n,i,On,o))}function Pn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Ae(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 Gr;if(i)var f=i(u,d,c,e,t,h);if(!(f===r?On(d,u,3,i,h):f))return!1}}return!0}function Mn(e){return!(!Qa(e)||(t=e,je&&je in t))&&(Ka(e)?Be:pe).test(Do(e));var t}function Rn(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Ha(e)?Bn(e[0],e[1]):zn(e):dl(e)}function Ln(e){if(!_o(e))return gr(e);var t=[];for(var r in Ae(e))Re.call(e,r)&&"constructor"!=r&&t.push(r);return t}function jn(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var r in Ae(e))t.push(r);return t}(e);var t=_o(e),r=[];for(var n in e)("constructor"!=n||!t&&Re.call(e,n))&&r.push(n);return r}function Dn(e,t){return e<t}function Nn(e,t){var r=-1,n=$a(e)?we(e.length):[];return dn(e,function(e,i,o){n[++r]=t(e,i,o)}),n}function zn(e){var t=co(e);return 1==t.length&&t[0][2]?Ao(t[0][0],t[0][1]):function(r){return r===e||Pn(r,e,t)}}function Bn(e,t){return wo(e)&&So(t)?Ao(jo(e),t):function(n){var i=As(n,e);return i===r&&i===t?ks(n,e):On(t,i,3)}}function Un(e,t,n,i,o){e!==t&&vn(t,function(a,s){if(o||(o=new Gr),Qa(a))!function(e,t,n,i,o,a,s){var l=Io(e,n),c=Io(t,n),u=s.get(c);if(u)Jr(e,n,u);else{var d=a?a(l,c,n+"",e,t,s):r,h=d===r;if(h){var f=Ha(c),p=!f&&Ga(c),g=!f&&!p&&ls(c);d=c,f||p||g?Ha(l)?d=l:qa(l)?d=Ii(l):p?(h=!1,d=Ci(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ns(c)||Va(c)?(d=l,Va(l)?d=ms(l):Qa(l)&&!Ka(l)||(d=mo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Jr(e,n,d)}}(e,t,s,n,Un,i,o);else{var l=i?i(Io(e,s),a,s+"",e,t,o):r;l===r&&(l=a),Jr(e,s,l)}},Os)}function Vn(e,t){var n=e.length;if(n)return yo(t+=t<0?n:0,n)?e[t]:r}function Hn(e,t,r){t=t.length?Ot(t,function(e){return Ha(e)?function(t){return Cn(t,1===e.length?e[0]:e)}:e}):[rl];var n=-1;t=Ot(t,Xt(so()));var i=Nn(e,function(e,r,i){var o=Ot(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=Ai(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 Wn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=Cn(e,a);r(s,a)&&Jn(o,yi(a,e),s)}return o}function $n(e,t,r,n){var i=n?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ii(t)),r&&(s=Ot(e,Xt(r)));++o<a;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(s,u,l,n))>-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function qn(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;yo(i)?Ye.call(e,i,1):ui(e,i)}}return e}function Gn(e,t){return e+gt(wr()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(ko(e,t,rl),e+"")}function Kn(e){return Xr(zs(e))}function Zn(e,t){var r=zs(e);return Ro(r,an(t,0,r.length))}function Jn(e,t,n,i){if(!Qa(e))return e;for(var o=-1,a=(t=yi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=jo(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=Qa(d)?d:yo(t[o+1])?[]:{})}Qr(l,c,u),l=l[c]}return e}var Qn=Ir?function(e,t){return Ir.set(e,t),e}:rl,ei=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Qs(t),writable:!0})}:rl;function ti(e){return Ro(zs(e))}function ri(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=we(i);++n<i;)o[n]=e[n+t];return o}function ni(e,t){var r;return dn(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function ii(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&&!ss(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return oi(e,t,rl,r)}function oi(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=ss(t),u=t===r;o<a;){var d=gt((o+a)/2),h=n(e[d]),f=h!==r,p=null===h,g=h==h,m=ss(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 vr(a,4294967294)}function ai(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||!za(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function si(e){return"number"==typeof e?e:ss(e)?d:+e}function li(e){if("string"==typeof e)return e;if(Ha(e))return Ot(e,li)+"";if(ss(e))return Dr?Dr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,r){var n=-1,i=Tt,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Ft;else if(o>=200){var c=t?null:Yi(e);if(c)return sr(c);a=!1,i=Zt,l=new qr}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 ui(e,t){return null==(e=Eo(e,t=yi(t,e)))||delete e[jo(Xo(t))]}function di(e,t,r,n){return Jn(e,t,r(Cn(e,t)),n)}function hi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ri(e,n?0:o,n?o+1:i):ri(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Vr&&(r=r.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))},r)}function pi(e,t,r){var n=e.length;if(n<2)return n?ci(e[0]):[];for(var i=-1,o=we(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=un(o[i]||a,e[s],t,r));return ci(mn(o,1),t,r)}function gi(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 mi(e){return qa(e)?e:[]}function vi(e){return"function"==typeof e?e:rl}function yi(e,t){return Ha(e)?e:wo(e,t)?[e]:Lo(vs(e))}var bi=Xn;function wi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ri(e,t,n)}var xi=ct||function(e){return dt.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function _i(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Si(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ai(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=ss(e),s=t!==r,l=null===t,c=t==t,u=ss(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 ki(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,l=t.length,c=mr(o-a,0),u=we(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 Ei(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,l=-1,c=t.length,u=mr(o-s,0),d=we(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 Ii(e,t){var r=-1,n=e.length;for(t||(t=we(n));++r<n;)t[r]=e[r];return t}function Ti(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?nn(n,l,c):Qr(n,l,c)}return n}function Fi(e,t){return function(r,n){var i=Ha(r)?St:tn,o=t?t():{};return i(r,e,so(n,2),o)}}function Oi(e){return Xn(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&&bo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Ae(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t})}function Pi(e,t){return function(r,n){if(null==r)return r;if(!$a(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Ae(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Mi(e){return function(t,r,n){for(var i=-1,o=Ae(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 Ri(e){return function(t){var n=nr(t=vs(t))?ur(t):r,i=n?n[0]:t.charAt(0),o=n?wi(n,1).join(""):t.slice(1);return i[e]()+o}}function Li(e){return function(t){return Mt(Ks(Vs(t).replace(Ke,"")),e,"")}}function ji(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=zr(e.prototype),n=e.apply(r,t);return Qa(n)?n:r}}function Di(e){return function(t,n,i){var o=Ae(t);if(!$a(t)){var a=so(n,3);t=Fs(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 Ni(e){return to(function(t){var i=t.length,o=i,a=Ur.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!l&&"wrapper"==oo(s))var l=new Ur([],!0)}for(o=l?o:i;++o<i;){var c=oo(s=t[o]),u="wrapper"==c?io(s):r;l=u&&xo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[oo(u[0])].apply(l,u[3]):1==s.length&&xo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ha(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 zi(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:ji(e);return function s(){for(var y=arguments.length,b=we(y),w=y;w--;)b[w]=arguments[w];if(g)var x=ao(s),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,x);if(i&&(b=ki(b,i,o,g)),a&&(b=Ei(b,a,l,g)),y-=C,g&&y<d){var _=ar(b,x);return qi(e,t,zi,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=vr(t.length,n),o=Ii(e);i--;){var a=t[i];e[i]=yo(a,n)?o[a]:r}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==dt&&this instanceof s&&(A=v||ji(A)),A.apply(S,b)}}function Bi(e,t){return function(r,n){return function(e,t,r,n){return bn(e,function(e,i,o){t(n,r(e),i,o)}),n}(r,e,t(n),{})}}function Ui(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=li(n),i=li(i)):(n=si(n),i=si(i)),o=e(n,i)}return o}}function Vi(e){return to(function(t){return t=Ot(t,Xt(so())),Xn(function(r){var n=this;return e(t,function(e){return _t(e,n,r)})})})}function Hi(e,t){var n=(t=t===r?" ":li(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,ft(e/cr(t)));return nr(t)?wi(ur(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(t,n,i){return i&&"number"!=typeof i&&bo(t,n,i)&&(n=i=r),t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r,n){for(var i=-1,o=mr(ft((t-e)/(r||1)),0),a=we(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:hs(i),e)}}function $i(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function qi(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 xo(e)&&To(p,f),p.placeholder=i,Po(p,e,t)}function Gi(e){var t=Se[e];return function(e,r){if(e=gs(e),(r=null==r?0:vr(fs(r),292))&&Wt(e)){var n=(vs(e)+"e").split("e");return+((n=(vs(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Ar&&1/sr(new Ar([,-0]))[1]==c?function(e){return new Ar(e)}:sl;function Xi(e){return function(t){var r=po(t);return r==x?ir(t):r==k?lr(t):function(e,t){return Ot(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ki(e,t,i,c,u,d,h,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Ie(n);var g=c?c.length:0;if(g||(t&=-97,c=u=r),h=h===r?h:mr(fs(h),0),f=f===r?f:fs(f),g-=u?u.length:0,64&t){var m=c,v=u;c=u=r}var y=p?r:io(e),b=[e,t,i,c,u,m,v,d,h,f];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,c=n==s&&8==r||n==s&&r==l&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!c)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var d=e[3];e[3]=d?ki(d,u,t[4]):u,e[4]=d?ar(e[3],o):t[4]}(u=t[5])&&(d=e[5],e[5]=d?Ei(d,u,t[6]):u,e[6]=d?ar(e[5],o):t[6]),(u=t[7])&&(e[7]=u),n&s&&(e[8]=null==e[8]?t[8]:vr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],i=b[2],c=b[3],u=b[4],!(f=b[9]=b[9]===r?p?0:e.length:mr(b[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(e,t,n){var i=ji(e);return function o(){for(var a=arguments.length,s=we(a),l=a,c=ao(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:ar(s,c);return(a-=u.length)<n?qi(e,t,zi,o.placeholder,r,s,u,r,r,n-a):_t(this&&this!==dt&&this instanceof o?i:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zi.apply(r,b):function(e,t,r,n){var i=1&t,o=ji(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=n.length,u=we(c+s),d=this&&this!==dt&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;s--;)u[l++]=arguments[++a];return _t(d,i?r:this,u)}}(e,t,i,c);else var w=function(e,t,r){var n=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Po((y?Qn:To)(w,b),e,t)}function Zi(e,t,n,i){return e===r||za(e,Oe[n])&&!Re.call(i,n)?t:e}function Ji(e,t,n,i,o,a){return Qa(e)&&Qa(t)&&(a.set(t,e),Un(e,t,r,Ji,a),a.delete(t)),e}function Qi(e){return ns(e)?r:e}function eo(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 qr: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(!Lt(t,function(e,t){if(!Zt(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 to(e){return Oo(ko(e,r,Wo),e+"")}function ro(e){return _n(e,Fs,ho)}function no(e){return _n(e,Os,fo)}var io=Ir?function(e){return Ir.get(e)}:sl;function oo(e){for(var t=e.name+"",r=Tr[t],n=Re.call(Tr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function ao(e){return(Re.call(Nr,"placeholder")?Nr:e).placeholder}function so(){var e=Nr.iteratee||nl;return e=e===nl?Rn:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(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 co(e){for(var t=Fs(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Mn(n)?n:r}var ho=mt?function(e){return null==e?[]:(e=Ae(e),It(mt(e),function(t){return Ge.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Pt(t,ho(e)),e=$e(e);return t}:pl,po=Sn;function go(e,t,r){for(var n=-1,i=(t=yi(t,e)).length,o=!1;++n<i;){var a=jo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ja(i)&&yo(a,i)&&(Ha(e)||Va(e))}function mo(e){return"function"!=typeof e.constructor||_o(e)?{}:zr($e(e))}function vo(e){return Ha(e)||Va(e)||!!(Xe&&e&&e[Xe])}function yo(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&me.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,r){if(!Qa(r))return!1;var n=typeof t;return!!("number"==n?$a(r)&&yo(t,r.length):"string"==n&&t in r)&&za(r[t],e)}function wo(e,t){if(Ha(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||J.test(e)||!Z.test(e)||null!=t&&e in Ae(t)}function xo(e){var t=oo(e),r=Nr[t];if("function"!=typeof r||!(t in Vr.prototype))return!1;if(e===r)return!0;var n=io(r);return!!n&&e===n[0]}(Cr&&po(new Cr(new ArrayBuffer(1)))!=O||_r&&po(new _r)!=x||Sr&&po(Sr.resolve())!=S||Ar&&po(new Ar)!=k||kr&&po(new kr)!=T)&&(po=function(e){var t=Sn(e),n=t==_?e.constructor:r,i=n?Do(n):"";if(i)switch(i){case Fr:return O;case Or:return x;case Pr:return S;case Mr:return k;case Rr:return T}return t});var Co=Pe?Ka:gl;function _o(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)}function So(e){return e==e&&!Qa(e)}function Ao(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in Ae(n))}}function ko(e,t,n){return t=mr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=mr(r.length-t,0),a=we(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=we(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),_t(e,this,s)}}function Eo(e,t){return t.length<2?e:Cn(e,ri(t,0,-1))}function Io(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var To=Mo(Qn),Fo=ht||function(e,t){return dt.setTimeout(e,t)},Oo=Mo(ei);function Po(e,t,r){var n=t+"";return Oo(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(ie,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return At(f,function(r){var n="_."+r[0];t&r[1]&&!Tt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(n),r)))}function Mo(e){var t=0,n=0;return function(){var i=yr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ro(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=Gn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Lo=function(e){var t=Ma(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,r,n,i){t.push(n?i.replace(ce,"$1"):r||e)}),t});function jo(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Do(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Vr)return e.clone();var t=new Ur(e.__wrapped__,e.__chain__);return t.__actions__=Ii(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Xn(function(e,t){return qa(e)?un(e,mn(t,1,qa,!0)):[]}),Bo=Xn(function(e,t){var n=Xo(t);return qa(n)&&(n=r),qa(e)?un(e,mn(t,1,qa,!0),so(n,2)):[]}),Uo=Xn(function(e,t){var n=Xo(t);return qa(n)&&(n=r),qa(e)?un(e,mn(t,1,qa,!0),r,n):[]});function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),Nt(e,so(t,3),i)}function Ho(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=fs(n),o=n<0?mr(i+o,0):vr(o,i-1)),Nt(e,so(t,3),o,!0)}function Wo(e){return null!=e&&e.length?mn(e,1):[]}function $o(e){return e&&e.length?e[0]:r}var qo=Xn(function(e){var t=Ot(e,mi);return t.length&&t[0]===e[0]?In(t):[]}),Go=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return t===Xo(n)?t=r:n.pop(),n.length&&n[0]===e[0]?In(n,so(t,2)):[]}),Yo=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?In(n,r,t):[]});function Xo(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=Xn(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?$n(e,t):e}var Jo=to(function(e,t){var r=null==e?0:e.length,n=on(e,t);return qn(e,Ot(t,function(e){return yo(e,r)?+e:e}).sort(Ai)),n});function Qo(e){return null==e?e:xr.call(e)}var ea=Xn(function(e){return ci(mn(e,1,qa,!0))}),ta=Xn(function(e){var t=Xo(e);return qa(t)&&(t=r),ci(mn(e,1,qa,!0),so(t,2))}),ra=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,ci(mn(e,1,qa,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=It(e,function(e){if(qa(e))return t=mr(e.length,t),!0}),Gt(t,function(t){return Ot(e,Ht(t))})}function ia(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:Ot(n,function(e){return _t(t,r,e)})}var oa=Xn(function(e,t){return qa(e)?un(e,t):[]}),aa=Xn(function(e){return pi(It(e,qa))}),sa=Xn(function(e){var t=Xo(e);return qa(t)&&(t=r),pi(It(e,qa),so(t,2))}),la=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,pi(It(e,qa),r,t)}),ca=Xn(na),ua=Xn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)});function da(e){var t=Nr(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var fa=to(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Vr&&yo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:r}),new Ur(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),pa=Fi(function(e,t,r){Re.call(e,r)?++e[r]:nn(e,r,1)}),ga=Di(Vo),ma=Di(Ho);function va(e,t){return(Ha(e)?At:dn)(e,so(t,3))}function ya(e,t){return(Ha(e)?kt:hn)(e,so(t,3))}var ba=Fi(function(e,t,r){Re.call(e,r)?e[r].push(t):nn(e,r,[t])}),wa=Xn(function(e,t,r){var n=-1,i="function"==typeof t,o=$a(e)?we(e.length):[];return dn(e,function(e){o[++n]=i?_t(t,e,r):Tn(e,t,r)}),o}),xa=Fi(function(e,t,r){nn(e,r,t)});function Ca(e,t){return(Ha(e)?Ot:Nn)(e,so(t,3))}var _a=Fi(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),Sa=Xn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&bo(e,t[0],t[1])?t=[]:r>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Hn(e,mn(t,1),[])}),Aa=ut||function(){return dt.Date.now()};function ka(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,s,r,r,r,r,t)}function Ea(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn(function(e,t,r){var n=1;if(r.length){var i=ar(r,ao(Ia));n|=a}return Ki(e,n,t,r,i)}),Ta=Xn(function(e,t,r){var n=3;if(r.length){var i=ar(r,ao(Ta));n|=a}return Ki(t,n,e,r,i)});function Fa(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ie(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=Aa();if(m(e))return y(e);c=Fo(v,function(e){var r=t-(e-u);return f?vr(r,s-(e-d)):r}(e))}function y(e){return c=r,p&&o?g(e):(o=a=r,l)}function b(){var e=Aa(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=Fo(v,t),h?g(e):l}(u);if(f)return xi(c),c=Fo(v,t),g(u)}return c===r&&(c=Fo(v,t)),l}return t=gs(t)||0,Qa(i)&&(h=!!i.leading,s=(f="maxWait"in i)?mr(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==r&&xi(c),d=0,o=u=a=c=r},b.flush=function(){return c===r?l:y(Aa())},b}var Oa=Xn(function(e,t){return cn(e,1,t)}),Pa=Xn(function(e,t,r){return cn(e,gs(t)||0,r)});function Ma(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(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(Ma.Cache||$r),r}function Ra(e){if("function"!=typeof e)throw new Ie(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)}}Ma.Cache=$r;var La=bi(function(e,t){var r=(t=1==t.length&&Ha(t[0])?Ot(t[0],Xt(so())):Ot(mn(t,1),Xt(so()))).length;return Xn(function(n){for(var i=-1,o=vr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return _t(e,this,n)})}),ja=Xn(function(e,t){var n=ar(t,ao(ja));return Ki(e,a,r,t,n)}),Da=Xn(function(e,t){var n=ar(t,ao(Da));return Ki(e,64,r,t,n)}),Na=to(function(e,t){return Ki(e,l,r,r,r,t)});function za(e,t){return e===t||e!=e&&t!=t}var Ba=$i(An),Ua=$i(function(e,t){return e>=t}),Va=Fn(function(){return arguments}())?Fn:function(e){return es(e)&&Re.call(e,"callee")&&!Ge.call(e,"callee")},Ha=we.isArray,Wa=vt?Xt(vt):function(e){return es(e)&&Sn(e)==F};function $a(e){return null!=e&&Ja(e.length)&&!Ka(e)}function qa(e){return es(e)&&$a(e)}var Ga=jt||gl,Ya=yt?Xt(yt):function(e){return es(e)&&Sn(e)==v};function Xa(e){if(!es(e))return!1;var t=Sn(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Qa(e))return!1;var t=Sn(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==fs(e)}function Ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Xt(bt):function(e){return es(e)&&po(e)==x};function rs(e){return"number"==typeof e||es(e)&&Sn(e)==C}function ns(e){if(!es(e)||Sn(e)!=_)return!1;var t=$e(e);if(null===t)return!0;var r=Re.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==Ne}var is=wt?Xt(wt):function(e){return es(e)&&Sn(e)==A},os=xt?Xt(xt):function(e){return es(e)&&po(e)==k};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sn(e)==E}function ss(e){return"symbol"==typeof e||es(e)&&Sn(e)==I}var ls=Ct?Xt(Ct):function(e){return es(e)&&Ja(e.length)&&!!it[Sn(e)]},cs=$i(Dn),us=$i(function(e,t){return e<=t});function ds(e){if(!e)return[];if($a(e))return as(e)?ur(e):Ii(e);if(Je&&e[Je])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Je]());var t=po(e);return(t==x?ir:t==k?sr:zs)(e)}function hs(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=hs(e),r=t%1;return t==t?r?t-r:t:0}function ps(e){return e?an(fs(e),0,h):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return d;if(Qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=fe.test(e);return r||ge.test(e)?lt(e.slice(2),r?2:8):he.test(e)?d:+e}function ms(e){return Ti(e,Os(e))}function vs(e){return null==e?"":li(e)}var ys=Oi(function(e,t){if(_o(t)||$a(t))Ti(t,Fs(t),e);else for(var r in t)Re.call(t,r)&&Qr(e,r,t[r])}),bs=Oi(function(e,t){Ti(t,Os(t),e)}),ws=Oi(function(e,t,r,n){Ti(t,Os(t),e,n)}),xs=Oi(function(e,t,r,n){Ti(t,Fs(t),e,n)}),Cs=to(on),_s=Xn(function(e,t){e=Ae(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&bo(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Os(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===r||za(d,Oe[u])&&!Re.call(e,u))&&(e[u]=a[u])}return e}),Ss=Xn(function(e){return e.push(r,Ji),_t(Ms,r,e)});function As(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function ks(e,t){return null!=e&&go(e,t,En)}var Es=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=r},Qs(rl)),Is=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),Re.call(e,t)?e[t].push(r):e[t]=[r]},so),Ts=Xn(Tn);function Fs(e){return $a(e)?Yr(e):Ln(e)}function Os(e){return $a(e)?Yr(e,!0):jn(e)}var Ps=Oi(function(e,t,r){Un(e,t,r)}),Ms=Oi(function(e,t,r,n){Un(e,t,r,n)}),Rs=to(function(e,t){var r={};if(null==e)return r;var n=!1;t=Ot(t,function(t){return t=yi(t,e),n||(n=t.length>1),t}),Ti(e,no(e),r),n&&(r=sn(r,7,Qi));for(var i=t.length;i--;)ui(r,t[i]);return r}),Ls=to(function(e,t){return null==e?{}:function(e,t){return Wn(e,t,function(t,r){return ks(e,r)})}(e,t)});function js(e,t){if(null==e)return{};var r=Ot(no(e),function(e){return[e]});return t=so(t),Wn(e,r,function(e,r){return t(e,r[0])})}var Ds=Xi(Fs),Ns=Xi(Os);function zs(e){return null==e?[]:Kt(e,Fs(e))}var Bs=Li(function(e,t,r){return t=t.toLowerCase(),e+(r?Us(t):t)});function Us(e){return Xs(vs(e).toLowerCase())}function Vs(e){return(e=vs(e))&&e.replace(ve,er).replace(Ze,"")}var Hs=Li(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Ws=Li(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),$s=Ri("toLowerCase"),qs=Li(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),Gs=Li(function(e,t,r){return e+(r?" ":"")+Xs(t)}),Ys=Li(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Xs=Ri("toUpperCase");function Ks(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Zs=Xn(function(e,t){try{return _t(e,r,t)}catch(e){return Xa(e)?e:new Ce(e)}}),Js=to(function(e,t){return At(t,function(t){t=jo(t),nn(e,t,Ia(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Ni(),tl=Ni(!0);function rl(e){return e}function nl(e){return Rn("function"==typeof e?e:sn(e,1))}var il=Xn(function(e,t){return function(r){return Tn(r,e,t)}}),ol=Xn(function(e,t){return function(r){return Tn(e,r,t)}});function al(e,t,r){var n=Fs(t),i=xn(t,n);null!=r||Qa(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=xn(t,Fs(t)));var o=!(Qa(r)&&"chain"in r&&!r.chain),a=Ka(e);return At(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__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})}),e}function sl(){}var ll=Vi(Ot),cl=Vi(Et),ul=Vi(Lt);function dl(e){return wo(e)?Ht(jo(e)):function(e){return function(t){return Cn(t,e)}}(e)}var hl=Wi(),fl=Wi(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Ui(function(e,t){return e+t},0),yl=Gi("ceil"),bl=Ui(function(e,t){return e/t},1),wl=Gi("floor"),xl=Ui(function(e,t){return e*t},1),Cl=Gi("round"),_l=Ui(function(e,t){return e-t},0);return Nr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Nr.ary=ka,Nr.assign=ys,Nr.assignIn=bs,Nr.assignInWith=ws,Nr.assignWith=xs,Nr.at=Cs,Nr.before=Ea,Nr.bind=Ia,Nr.bindAll=Js,Nr.bindKey=Ta,Nr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Nr.chain=da,Nr.chunk=function(e,t,n){t=(n?bo(e,t,n):t===r)?1:mr(fs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=we(ft(i/t));o<i;)s[a++]=ri(e,o,o+=t);return s},Nr.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},Nr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=we(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Pt(Ha(r)?Ii(r):[r],mn(t,1))},Nr.cond=function(e){var t=null==e?0:e.length,r=so();return e=t?Ot(e,function(e){if("function"!=typeof e[1])throw new Ie(n);return[r(e[0]),e[1]]}):[],Xn(function(r){for(var n=-1;++n<t;){var i=e[n];if(_t(i[0],this,r))return _t(i[1],this,r)}})},Nr.conforms=function(e){return function(e){var t=Fs(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Nr.constant=Qs,Nr.countBy=pa,Nr.create=function(e,t){var r=zr(e);return null==t?r:rn(r,t)},Nr.curry=function e(t,n,i){var o=Ki(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.curryRight=function e(t,n,i){var o=Ki(t,16,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.debounce=Fa,Nr.defaults=_s,Nr.defaultsDeep=Ss,Nr.defer=Oa,Nr.delay=Pa,Nr.difference=zo,Nr.differenceBy=Bo,Nr.differenceWith=Uo,Nr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=n||t===r?1:fs(t))<0?0:t,i):[]},Nr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,0,(t=i-(t=n||t===r?1:fs(t)))<0?0:t):[]},Nr.dropRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0,!0):[]},Nr.dropWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0):[]},Nr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&bo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=fs(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:fs(i))<0&&(i+=o),i=n>i?0:ps(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Nr.filter=function(e,t){return(Ha(e)?It:gn)(e,so(t,3))},Nr.flatMap=function(e,t){return mn(Ca(e,t),1)},Nr.flatMapDeep=function(e,t){return mn(Ca(e,t),c)},Nr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),mn(Ca(e,t),n)},Nr.flatten=Wo,Nr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Nr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===r?1:fs(t)):[]},Nr.flip=function(e){return Ki(e,512)},Nr.flow=el,Nr.flowRight=tl,Nr.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},Nr.functions=function(e){return null==e?[]:xn(e,Fs(e))},Nr.functionsIn=function(e){return null==e?[]:xn(e,Os(e))},Nr.groupBy=ba,Nr.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Nr.intersection=qo,Nr.intersectionBy=Go,Nr.intersectionWith=Yo,Nr.invert=Es,Nr.invertBy=Is,Nr.invokeMap=wa,Nr.iteratee=nl,Nr.keyBy=xa,Nr.keys=Fs,Nr.keysIn=Os,Nr.map=Ca,Nr.mapKeys=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,t(e,n,i),e)}),r},Nr.mapValues=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,n,t(e,n,i))}),r},Nr.matches=function(e){return zn(sn(e,1))},Nr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Nr.memoize=Ma,Nr.merge=Ps,Nr.mergeWith=Ms,Nr.method=il,Nr.methodOf=ol,Nr.mixin=al,Nr.negate=Ra,Nr.nthArg=function(e){return e=fs(e),Xn(function(t){return Vn(t,e)})},Nr.omit=Rs,Nr.omitBy=function(e,t){return js(e,Ra(so(t)))},Nr.once=function(e){return Ea(2,e)},Nr.orderBy=function(e,t,n,i){return null==e?[]:(Ha(t)||(t=null==t?[]:[t]),Ha(n=i?r:n)||(n=null==n?[]:[n]),Hn(e,t,n))},Nr.over=ll,Nr.overArgs=La,Nr.overEvery=cl,Nr.overSome=ul,Nr.partial=ja,Nr.partialRight=Da,Nr.partition=_a,Nr.pick=Ls,Nr.pickBy=js,Nr.property=dl,Nr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Nr.pull=Ko,Nr.pullAll=Zo,Nr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?$n(e,t,so(r,2)):e},Nr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?$n(e,t,r,n):e},Nr.pullAt=Jo,Nr.range=hl,Nr.rangeRight=fl,Nr.rearg=Na,Nr.reject=function(e,t){return(Ha(e)?It:gn)(e,Ra(so(t,3)))},Nr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=so(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return qn(e,i),r},Nr.rest=function(e,t){if("function"!=typeof e)throw new Ie(n);return Xn(e,t=t===r?t:fs(t))},Nr.reverse=Qo,Nr.sampleSize=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),(Ha(e)?Kr:Zn)(e,t)},Nr.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Nr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Nr.shuffle=function(e){return(Ha(e)?Zr:ti)(e)},Nr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bo(e,t,n)?(t=0,n=i):(t=null==t?0:fs(t),n=n===r?i:fs(n)),ri(e,t,n)):[]},Nr.sortBy=Sa,Nr.sortedUniq=function(e){return e&&e.length?ai(e):[]},Nr.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},Nr.split=function(e,t,n){return n&&"number"!=typeof n&&bo(e,t,n)&&(t=n=r),(n=n===r?h:n>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&nr(e)?wi(ur(e),0,n):e.split(t,n):[]},Nr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:mr(fs(t),0),Xn(function(r){var n=r[t],i=wi(r,0,t);return n&&Pt(i,n),_t(e,this,i)})},Nr.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Nr.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Nr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=i-(t=n||t===r?1:fs(t)))<0?0:t,i):[]},Nr.takeRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!1,!0):[]},Nr.takeWhile=function(e,t){return e&&e.length?hi(e,so(t,3)):[]},Nr.tap=function(e,t){return t(e),e},Nr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return Qa(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Fa(e,t,{leading:i,maxWait:t,trailing:o})},Nr.thru=ha,Nr.toArray=ds,Nr.toPairs=Ds,Nr.toPairsIn=Ns,Nr.toPath=function(e){return Ha(e)?Ot(e,jo):ss(e)?[e]:Ii(Lo(vs(e)))},Nr.toPlainObject=ms,Nr.transform=function(e,t,r){var n=Ha(e),i=n||Ga(e)||ls(e);if(t=so(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qa(e)&&Ka(o)?zr($e(e)):{}}return(i?At:bn)(e,function(e,n,i){return t(r,e,n,i)}),r},Nr.unary=function(e){return ka(e,1)},Nr.union=ea,Nr.unionBy=ta,Nr.unionWith=ra,Nr.uniq=function(e){return e&&e.length?ci(e):[]},Nr.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},Nr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ci(e,r,t):[]},Nr.unset=function(e,t){return null==e||ui(e,t)},Nr.unzip=na,Nr.unzipWith=ia,Nr.update=function(e,t,r){return null==e?e:di(e,t,vi(r))},Nr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:di(e,t,vi(n),i)},Nr.values=zs,Nr.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Nr.without=oa,Nr.words=Ks,Nr.wrap=function(e,t){return ja(vi(t),e)},Nr.xor=aa,Nr.xorBy=sa,Nr.xorWith=la,Nr.zip=ca,Nr.zipObject=function(e,t){return gi(e||[],t||[],Qr)},Nr.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Nr.zipWith=ua,Nr.entries=Ds,Nr.entriesIn=Ns,Nr.extend=bs,Nr.extendWith=ws,al(Nr,Nr),Nr.add=vl,Nr.attempt=Zs,Nr.camelCase=Bs,Nr.capitalize=Us,Nr.ceil=yl,Nr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=gs(n))==n?n:0),t!==r&&(t=(t=gs(t))==t?t:0),an(gs(e),t,n)},Nr.clone=function(e){return sn(e,4)},Nr.cloneDeep=function(e){return sn(e,5)},Nr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Nr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Nr.conformsTo=function(e,t){return null==t||ln(e,t,Fs(t))},Nr.deburr=Vs,Nr.defaultTo=function(e,t){return null==e||e!=e?t:e},Nr.divide=bl,Nr.endsWith=function(e,t,n){e=vs(e),t=li(t);var i=e.length,o=n=n===r?i:an(fs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Nr.eq=za,Nr.escape=function(e){return(e=vs(e))&&G.test(e)?e.replace($,tr):e},Nr.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Nr.every=function(e,t,n){var i=Ha(e)?Et:fn;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Nr.find=ga,Nr.findIndex=Vo,Nr.findKey=function(e,t){return Dt(e,so(t,3),bn)},Nr.findLast=ma,Nr.findLastIndex=Ho,Nr.findLastKey=function(e,t){return Dt(e,so(t,3),wn)},Nr.floor=wl,Nr.forEach=va,Nr.forEachRight=ya,Nr.forIn=function(e,t){return null==e?e:vn(e,so(t,3),Os)},Nr.forInRight=function(e,t){return null==e?e:yn(e,so(t,3),Os)},Nr.forOwn=function(e,t){return e&&bn(e,so(t,3))},Nr.forOwnRight=function(e,t){return e&&wn(e,so(t,3))},Nr.get=As,Nr.gt=Ba,Nr.gte=Ua,Nr.has=function(e,t){return null!=e&&go(e,t,kn)},Nr.hasIn=ks,Nr.head=$o,Nr.identity=rl,Nr.includes=function(e,t,r,n){e=$a(e)?e:zs(e),r=r&&!n?fs(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),as(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&zt(e,t,r)>-1},Nr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),zt(e,t,i)},Nr.inRange=function(e,t,n){return t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r){return e>=vr(t,r)&&e<mr(t,r)}(e=gs(e),t,n)},Nr.invoke=Ts,Nr.isArguments=Va,Nr.isArray=Ha,Nr.isArrayBuffer=Wa,Nr.isArrayLike=$a,Nr.isArrayLikeObject=qa,Nr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sn(e)==m},Nr.isBuffer=Ga,Nr.isDate=Ya,Nr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Nr.isEmpty=function(e){if(null==e)return!0;if($a(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||Ga(e)||ls(e)||Va(e)))return!e.length;var t=po(e);if(t==x||t==k)return!e.size;if(_o(e))return!Ln(e).length;for(var r in e)if(Re.call(e,r))return!1;return!0},Nr.isEqual=function(e,t){return On(e,t)},Nr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?On(e,t,r,n):!!i},Nr.isError=Xa,Nr.isFinite=function(e){return"number"==typeof e&&Wt(e)},Nr.isFunction=Ka,Nr.isInteger=Za,Nr.isLength=Ja,Nr.isMap=ts,Nr.isMatch=function(e,t){return e===t||Pn(e,t,co(t))},Nr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Pn(e,t,co(t),n)},Nr.isNaN=function(e){return rs(e)&&e!=+e},Nr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mn(e)},Nr.isNil=function(e){return null==e},Nr.isNull=function(e){return null===e},Nr.isNumber=rs,Nr.isObject=Qa,Nr.isObjectLike=es,Nr.isPlainObject=ns,Nr.isRegExp=is,Nr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},Nr.isSet=os,Nr.isString=as,Nr.isSymbol=ss,Nr.isTypedArray=ls,Nr.isUndefined=function(e){return e===r},Nr.isWeakMap=function(e){return es(e)&&po(e)==T},Nr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sn(e)},Nr.join=function(e,t){return null==e?"":pr.call(e,t)},Nr.kebabCase=Hs,Nr.last=Xo,Nr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=fs(n))<0?mr(i+o,0):vr(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):Nt(e,Ut,o,!0)},Nr.lowerCase=Ws,Nr.lowerFirst=$s,Nr.lt=cs,Nr.lte=us,Nr.max=function(e){return e&&e.length?pn(e,rl,An):r},Nr.maxBy=function(e,t){return e&&e.length?pn(e,so(t,2),An):r},Nr.mean=function(e){return Vt(e,rl)},Nr.meanBy=function(e,t){return Vt(e,so(t,2))},Nr.min=function(e){return e&&e.length?pn(e,rl,Dn):r},Nr.minBy=function(e,t){return e&&e.length?pn(e,so(t,2),Dn):r},Nr.stubArray=pl,Nr.stubFalse=gl,Nr.stubObject=function(){return{}},Nr.stubString=function(){return""},Nr.stubTrue=function(){return!0},Nr.multiply=xl,Nr.nth=function(e,t){return e&&e.length?Vn(e,fs(t)):r},Nr.noConflict=function(){return dt._===this&&(dt._=ze),this},Nr.noop=sl,Nr.now=Aa,Nr.pad=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Hi(gt(i),r)+e+Hi(ft(i),r)},Nr.padEnd=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?e+Hi(t-n,r):e},Nr.padStart=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?Hi(t-n,r)+e:e},Nr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(vs(e).replace(re,""),t||0)},Nr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bo(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=hs(e),t===r?(t=e,e=0):t=hs(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=wr();return vr(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Gn(e,t)},Nr.reduce=function(e,t,r){var n=Ha(e)?Mt:$t,i=arguments.length<3;return n(e,so(t,4),r,i,dn)},Nr.reduceRight=function(e,t,r){var n=Ha(e)?Rt:$t,i=arguments.length<3;return n(e,so(t,4),r,i,hn)},Nr.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),Yn(vs(e),t)},Nr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nr.result=function(e,t,n){var i=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[jo(t[i])];a===r&&(i=o,a=n),e=Ka(a)?a.call(e):a}return e},Nr.round=Cl,Nr.runInContext=e,Nr.sample=function(e){return(Ha(e)?Xr:Kn)(e)},Nr.size=function(e){if(null==e)return 0;if($a(e))return as(e)?cr(e):e.length;var t=po(e);return t==x||t==k?e.size:Ln(e).length},Nr.snakeCase=qs,Nr.some=function(e,t,n){var i=Ha(e)?Lt:ni;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Nr.sortedIndex=function(e,t){return ii(e,t)},Nr.sortedIndexBy=function(e,t,r){return oi(e,t,so(r,2))},Nr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ii(e,t);if(n<r&&za(e[n],t))return n}return-1},Nr.sortedLastIndex=function(e,t){return ii(e,t,!0)},Nr.sortedLastIndexBy=function(e,t,r){return oi(e,t,so(r,2),!0)},Nr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ii(e,t,!0)-1;if(za(e[r],t))return r}return-1},Nr.startCase=Gs,Nr.startsWith=function(e,t,r){return e=vs(e),r=null==r?0:an(fs(r),0,e.length),t=li(t),e.slice(r,r+t.length)==t},Nr.subtract=_l,Nr.sum=function(e){return e&&e.length?qt(e,rl):0},Nr.sumBy=function(e,t){return e&&e.length?qt(e,so(t,2)):0},Nr.template=function(e,t,n){var i=Nr.templateSettings;n&&bo(e,t,n)&&(t=r),e=vs(e),t=ws({},t,i,Zi);var o,a,s=ws({},t.imports,i.imports,Zi),l=Fs(s),c=Kt(s,l),u=0,d=t.interpolate||ye,h="__p += '",f=ke((t.escape||ye).source+"|"+d.source+"|"+(d===K?ue:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),p="//# sourceURL="+(Re.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(f,function(t,r,n,i,s,l){return n||(n=i),h+=e.slice(u,l).replace(be,rr),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=Re.call(t,"variable")&&t.variable;if(g){if(le.test(g))throw new Ce("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(U,""):h).replace(V,"$1").replace(H,"$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=Zs(function(){return _e(l,p+"return "+h).apply(r,c)});if(m.source=h,Xa(m))throw m;return m},Nr.times=function(e,t){if((e=fs(e))<1||e>u)return[];var r=h,n=vr(e,h);t=so(t),e-=h;for(var i=Gt(n,t);++r<e;)t(r);return i},Nr.toFinite=hs,Nr.toInteger=fs,Nr.toLength=ps,Nr.toLower=function(e){return vs(e).toLowerCase()},Nr.toNumber=gs,Nr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,u):0===e?e:0},Nr.toString=vs,Nr.toUpper=function(e){return vs(e).toUpperCase()},Nr.trim=function(e,t,n){if((e=vs(e))&&(n||t===r))return Yt(e);if(!e||!(t=li(t)))return e;var i=ur(e),o=ur(t);return wi(i,Jt(i,o),Qt(i,o)+1).join("")},Nr.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.slice(0,dr(e)+1);if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,0,Qt(i,ur(t))+1).join("")},Nr.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.replace(re,"");if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,Jt(i,ur(t))).join("")},Nr.truncate=function(e,t){var n=30,i="...";if(Qa(t)){var o="separator"in t?t.separator:o;n="length"in t?fs(t.length):n,i="omission"in t?li(t.omission):i}var a=(e=vs(e)).length;if(nr(e)){var s=ur(e);a=s.length}if(n>=a)return e;var l=n-cr(i);if(l<1)return i;var c=s?wi(s,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=ke(o.source,vs(de.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(li(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Nr.unescape=function(e){return(e=vs(e))&&q.test(e)?e.replace(W,hr):e},Nr.uniqueId=function(e){var t=++Le;return vs(e)+t},Nr.upperCase=Ys,Nr.upperFirst=Xs,Nr.each=va,Nr.eachRight=ya,Nr.first=$o,al(Nr,(ml={},bn(Nr,function(e,t){Re.call(Nr.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),Nr.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nr[e].placeholder=Nr}),At(["drop","take"],function(e,t){Vr.prototype[e]=function(n){n=n===r?1:mr(fs(n),0);var i=this.__filtered__&&!t?new Vr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,h),type:e+(i.__dir__<0?"Right":"")}),i},Vr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),At(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Vr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),At(["head","last"],function(e,t){var r="take"+(t?"Right":"");Vr.prototype[e]=function(){return this[r](1).value()[0]}}),At(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Vr.prototype[e]=function(){return this.__filtered__?new Vr(this):this[r](1)}}),Vr.prototype.compact=function(){return this.filter(rl)},Vr.prototype.find=function(e){return this.filter(e).head()},Vr.prototype.findLast=function(e){return this.reverse().find(e)},Vr.prototype.invokeMap=Xn(function(e,t){return"function"==typeof e?new Vr(this):this.map(function(r){return Tn(r,e,t)})}),Vr.prototype.reject=function(e){return this.filter(Ra(so(e)))},Vr.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vr.prototype.toArray=function(){return this.take(h)},bn(Vr.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Nr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Nr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Vr,c=s[0],u=l||Ha(t),d=function(e){var t=o.apply(Nr,Pt([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 Vr(this);var m=e.apply(t,s);return m.__actions__.push({func:ha,args:[d],thisArg:r}),new Ur(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),At(["pop","push","shift","sort","splice","unshift"],function(e){var t=Te[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Nr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[r](function(r){return t.apply(Ha(r)?r:[],e)})}}),bn(Vr.prototype,function(e,t){var r=Nr[t];if(r){var n=r.name+"";Re.call(Tr,n)||(Tr[n]=[]),Tr[n].push({name:t,func:r})}}),Tr[zi(r,2).name]=[{name:"wrapper",func:r}],Vr.prototype.clone=function(){var e=new Vr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Vr.prototype.reverse=function(){if(this.__filtered__){var e=new Vr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ha(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=vr(t,e+a);break;case"takeRight":e=mr(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=vr(l,this.__takeCount__);if(!r||!n&&i==l&&f==l)return fi(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},Nr.prototype.at=fa,Nr.prototype.chain=function(){return da(this)},Nr.prototype.commit=function(){return new Ur(this.value(),this.__chain__)},Nr.prototype.next=function(){this.__values__===r&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Nr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=No(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Nr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vr){var t=e;return this.__actions__.length&&(t=new Vr(this)),(t=t.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:r}),new Ur(t,this.__chain__)}return this.thru(Qo)},Nr.prototype.toJSON=Nr.prototype.valueOf=Nr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Nr.prototype.first=Nr.prototype.head,Je&&(Nr.prototype[Je]=function(){return this}),Nr}();ft?((ft.exports=fr)._=fr,ht._=fr):dt._=fr}).call(mi)}(gi,gi.exports)),gi.exports);const yi=s({state:{},actions:{},options:{}}),bi=()=>l(yi),wi=({children:t,options:r})=>{var n;const[s,l]=o([]),[u,d]=o([]),[h,f]=o(null),[p,g]=o(r.searchQuery||""),[m,v]=o(r.sortBySize||"name"),{config:y}=r,[b,w]=o("date"),[x,C]=o("desc"),[_,S]=o([{id:"folders",name:"Папки"}]),[A,k]=o(new Set),[E,I]=o("");i.useEffect(()=>{k(new Set)},[]);const F=i.useRef(null);i.useEffect(()=>{if(r.onChangeSelection&&F.current!==A){if(null!==F.current){const e=(Array.isArray(u)?u:[]).filter(e=>A.has(e.id));r.onChangeSelection(e)}F.current=A}},[u,A,r.onChangeSelection,r]);const[O,P]=o(!1),[M,R]=o(Qt);a(()=>{(null==y?void 0:y.activeLibraryItem)&&R&&R(null==y?void 0:y.activeLibraryItem)},[null==y?void 0:y.activeLibraryItem,R]);const[L,j]=o({current:1,pageSize:12,total:0}),[D]=T.useForm(),[N]=T.useForm(),[z]=T.useForm(),[B]=T.useForm(),[U]=T.useForm(),[V]=T.useForm(),[H,W]=o(!1),[$,q]=o(!1),[G,Y]=o(!1),[X,K]=o(!1),[Z,J]=o(!1),[Q,ee]=o(!1),[te,re]=o(!1),[ne,ie]=o(null),[oe,ae]=o(null),[se,le]=o(null),ce=c(e=>{j(t=>Object.assign(Object.assign({},t),e))},[j]),ue=c(e=>{k(null!=e?e:new Set)},[k]);a(()=>{ue()},[M,ue]);const de={folders:s,files:u,selectedFolder:h,searchTerm:p,sortField:m,sortBy:b,sortOrder:x,pathHistory:_,selectedFiles:A,currentMenuFile:E,loading:O,pagination:L,isModalVisible:H,isUrlModalVisible:$,isRenameModalVisible:G,isMoveModalVisible:X,isRenameFolderModalVisible:Z,isCopyModalVisible:Q,isDeleteConfirmVisible:te,form:D,urlForm:N,renameForm:z,moveForm:B,renameFolderForm:U,copyForm:V,fileToRename:ne,folderToRename:oe,activeLibraryItem:M,multiSelect:null===(n=null==y?void 0:y.multiSelect)||void 0===n||n,undoDeletion:se},he={setFolders:l,setFiles:d,setSelectedFolder:f,setSearchTerm:g,setSortField:v,setSortBy:w,setSortOrder:C,setPathHistory:S,setSelectedFiles:ue,setLoading:P,setPagination:ce,setIsModalVisible:W,setIsUrlModalVisible:q,setIsRenameModalVisible:Y,setIsMoveModalVisible:K,setIsRenameFolderModalVisible:J,setIsCopyModalVisible:ee,setIsDeleteConfirmVisible:re,setFileToRename:ie,setFolderToRename:ae,setUndoDeletion:le,updatePathHistoryOnFolderRename:(e,t)=>{S(r=>r.map(r=>r.id===e?Object.assign(Object.assign({},r),{name:t}):r))},setActiveLibraryItem:R,setCurrentMenuFile:I},fe={state:de,actions:he,options:r};return e(yi.Provider,{value:fe,children:t})},xi=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Ci=async(e,t,r)=>{var n;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!r)return console.warn("🔍 getFolders is not available!"),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(xi);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:""}));if("folder"===(null==t?void 0:t.itemType))return a;return[...a,...e]},_i=e=>{var t,r,n,i;const{state:o,actions:s,options:l}=bi(),{searchTerm:d,sortBy:h,sortOrder:f,selectedFolder:p,pagination:g}=o,{setSearchTerm:m,setSortBy:v,setSortOrder:y,setPagination:b}=s,w=e||s.fetchFiles,x=u(null),C=u(vi.debounce(e=>{const t=JSON.stringify(e);x.current!==t&&(x.current=t,null==w||w(e))},150)).current,_=c(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:p||"",search:(null==d?void 0:d.trim())||void 0,page:t?void 0:g.current,limit:t?void 0:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}},[p,d,g.current,g.pageSize,h,f,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),S=c(e=>{var t,r;if(m&&m(e),b&&b({current:1,pageSize:g.pageSize,total:0}),w){const n={folderId:p||"",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:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"};w(n)}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[m,b,g.pageSize,w,p,h,f,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),A=c((e,t)=>{var r,n;null==v||v(e),null==y||y(t),w&&C({folderId:p||"",search:(null==d?void 0:d.trim())||void 0,page:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:g.current,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:g.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[v,y,C,p,d,g.current,g.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),k=c((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(b&&b({current:e,pageSize:t||g.pageSize,total:g.total}),w&&C({folderId:p||"",search:(null==d?void 0:d.trim())||void 0,page:e,limit:t||g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}))},[b,g.pageSize,g.total,C,p,d,h,f,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return a(()=>{if(w){const e=_();C(Object.assign(Object.assign({},e),{page:1}))}},[p]),a(()=>{w&&C(_())},[]),a(()=>()=>{var e;null===(e=C.cancel)||void 0===e||e.call(C)},[C]),{state:{searchTerm:d||"",sortBy:h||"name",sortOrder:f||"asc"},actions:{setSearchTerm:m||(()=>{}),setSortBy:v||(()=>{}),setSortOrder:y||(()=>{}),handleSearch:S,handleSort:A,handlePaginationChange:k,getCurrentQueryParams:_}}},Si=()=>{var e;const{notification:t}=I.useApp(),r=bi(),{options:n}=r,i=c(async e=>{let t;if(n.handleNotify){try{t=await n.handleNotify(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&n.handleError){try{t=await n.handleError(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&n.handleSuccess){try{t=await n.handleSuccess(e)}catch(e){console.error(e)}if(t)return!1}return t},[n]),o=c(async function(e,r=!1){var o;try{void 0===e.visibility&&(e.visibility=!r);const a=await i(e);"object"==typeof a&&(e=a);if(!(!1!==e.visibility&&!1!==a&&!1!==(null===(o=n.config)||void 0===o?void 0:o.showNotifications)))return e;const s=t[e.type];"function"==typeof s?s(e):console.warn(`Unknown notification type: ${e.type}`,e)}catch(e){console.error(e)}return e},[t,i,null===(e=n.config)||void 0===e?void 0:e.showNotifications]);return d(()=>({error:(e,t=!1)=>o(Object.assign(Object.assign({},e),{type:"error"}),t),success:(e,t=!1)=>o(Object.assign(Object.assign({},e),{type:"success"}),t),warning:(e,t=!1)=>o(Object.assign(Object.assign({},e),{type:"warning"}),t),notify:o}),[o])},Ai={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid.",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 to upload.",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.",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.",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:"Request payload is too large.",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."},ki=(e,t)=>{if(!e)return;const r=Ai[e];return r?t(r):void 0},Ei=e=>{var t,r,n,i,o,a,s,l;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!==(a=null!==(o=t.message)&&void 0!==o?o:t.error)&&void 0!==a?a:t.reason,n=null!==(s=t.status)&&void 0!==s?s:t.httpStatus,i=t.code,c=t.stack,u=null!==(l=t.raw)&&void 0!==l?l:e;if(r||i||n||c||u)return{message:r,code:i,status:n,stack:c,raw:u}}return{message:String(e),raw:e}},Ii=()=>{var e,t;const{state:r,actions:i,options:o}=bi(),{t:a}=Hr(),s=Si(),{folders:l,selectedFolder:u,pathHistory:d,form:h,loading:f,isModalVisible:p}=r,{setFolders:g,setLoading:m,setIsModalVisible:v}=i,{dataProviders:y,config:b}=o,w=c(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})),[]),x=c(async()=>{null==m||m(!0);try{let e=[];const t="lazy"===(null==b?void 0:b.folderTreeLoading);if(!(null==y?void 0:y.getFolders)){if(null==y?void 0:y.getFiles){const e=async r=>{const{files:n}=await y.getFiles({itemType:"folder",folderId:r||void 0}),i=w(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(g&&g(e=>{const n=Array.isArray(e)?e:[];if(!t){const e=r,t=e.filter(e=>e.id===e.parentId);return t.length>0&&console.warn("Folders with cyclic dependencies detected:",t),e}new Set(r.map(e=>e.id));const i=n.filter(e=>e.parentId),o=[...i,...r],a=o.filter(e=>e.id===e.parentId);return a.length>0&&console.warn("Folders with cyclic dependencies detected:",a),o}))}return void console.error("DataProvider for folders is not defined")}{const r=!t;e=await y.getFolders({parentId:null,deep:r})}const r=Array.isArray(e)?e:[];null==g||g(r);const n=r.filter(e=>e.id===e.parentId);n.length>0&&console.warn("Folders with cyclic dependencies detected:",n)}catch(e){console.error("Error loading folders:",e);const t=Ei(e),r=ki(null==t?void 0:t.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=r?r:a("Failed to load folders"),placement:"bottomRight",innerException:e,data:{reason:e instanceof Error?e.message:String(e)}})}finally{null==m||m(!1)}},[null==y?void 0:y.getFiles,null==y?void 0:y.getFolders,g,m,null==b?void 0:b.folderTreeLoading,w,s,a]),C=c(async e=>{try{if(null==y?void 0:y.getFolders){const t=await y.getFolders({parentId:e,deep:!1}),r=Array.isArray(l)?l:[],n=new Set(t.map(e=>e.id)),i=r.filter(t=>t.parentId!==e||n.has(t.id)),o=[...i,...t.filter(e=>!i.some(t=>t.id===e.id))];return null==g||g(o),t}if(null==y?void 0:y.getFiles){const{files:t}=await y.getFiles({itemType:"folder",folderId:e||void 0}),r=w(t),n=Array.isArray(l)?l:[],i=new Set(r.map(e=>e.id)),o=n.filter(t=>t.parentId!==e||i.has(t.id)),a=[...o,...r.filter(e=>!o.some(t=>t.id===e.id))];return null==g||g(a),r}return[]}catch(e){return console.error("Error loading child folders:",e),[]}},[y,l,g,w]),_=c(()=>{var e;const t=null!==(e=null==b?void 0:b.defaultFolderName)&&void 0!==e?e:a("Новая папка");h.setFieldsValue({folderName:t}),null==v||v(!0)},[h,v,a,null==b?void 0:b.defaultFolderName]),S=c(async e=>{const t=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==g||g(t),e.parentId&&(await C(e.parentId),await new Promise(e=>setTimeout(e,50))),i.setSelectedFolder&&i.setSelectedFolder(e.id),i.setPathHistory){const r=Array.isArray(t)?t:[],n=(e,t=new Set)=>{if(t.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const i=r.find(t=>t.id===e);if(!i)return[];const o=new Set(t);return o.add(e),i.parentId?[...n(i.parentId,o),{id:i.id,name:i.name}]:[{id:i.id,name:i.name}]},o=n(e.id),s=[{id:"folders",name:a("Folders")},...o];i.setPathHistory(s)}},[l,g,i,r.pathHistory,C,a]),A=c(async e=>{try{if(null==y?void 0:y.getFolders){const t=await y.getFolders(),r=Array.isArray(t)?t:[];return r.some(t=>t.id===e)}if(null==y?void 0:y.getFiles){const t=new Set,r=async n=>{const{files:i}=await y.getFiles({itemType:"folder",folderId:n||void 0}),o=w(i);for(const n of o){if(t.has(n.id))continue;if(t.add(n.id),n.id===e)return!0;if(await r(n.id))return!0}return!1};return await r(null)}}catch(e){console.warn("⚠️ Error checking the folder:",e)}return!1},[null==y?void 0:y.getFolders,null==y?void 0:y.getFiles,w]),k=c(async e=>{var t;let r,n=null;try{const i=await(e?e.validateFields():h.validateFields());if(r=i.folderName.trim(),!r){const e=i.targetFolder||(u&&"folders"!==u?u: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:!!i.is_force_create}})}const o=i.targetFolder;if(o)n="folders"!==o?o:null;else if(u&&"folders"!==u)n=u;else if(Array.isArray(d)&&d.length>1){const e=d[d.length-1];n=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}let c;if(!(null==y?void 0:y.createFolder))return void s.error({id:"FOLDER_CREATE_PROVIDER_NOT_CONFIGURED",message:a("Folder creation provider is not configured"),placement:"bottomRight",data:{folderName:r,folderId:null!=n?n:null,is_force_create:!!i.is_force_create}});c=await y.createFolder({name:r,parentId:n,is_force_create:!!i.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 console.error("Обнаружена циклическая зависимость: папка является родителем сама для себя"),new Error(a("Error: folder cannot be its own parent"))})(c);const f={id:c.id,name:c.name,parentId:null!=n?n:null,childCount:c.childCount},p=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==f.id),f];if(null==g||g(p),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[f.id],folderId:null!==(t=f.parentId)&&void 0!==t?t:null,folderName:f.name}}),e||null==v||v(!1),(async()=>{try{await S(f),await x(),await new Promise(e=>setTimeout(e,200));await A(c.id)||console.warn("⚠️ Could not confirm the creation of the folder on the server, but continuing...")}catch(e){console.error("Error performing background operations after creating the folder:",e)}})(),e)return c}catch(e){console.error("❌ Error creating the folder:",e);const t=Ei(e),i=ki(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=i?i:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:r,folderId:null!=n?n:null,reason:e instanceof Error?e.message:String(e)}})}},[h,u,y,S,x,A,v,s,a,l,g]),E=c(()=>{null==v||v(!1)},[v]),I=c((e,t=new Set)=>{const r=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return console.warn(`Cycle detected in the folder structure with id=${e.id}. Skipping child elements processing.`),{key:e.id,label:e.name+" "+a("(error)"),icon:n.createElement(ae,{style:{color:"red"}})};const i=new Set(t);i.add(e.id);const o=r.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:o.length>0?I(o,i):void 0}})},[l]),T=c(()=>{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]),F=c(async(e,t)=>{var r,n,c,u;try{const d=t.trim(),h=null==l?void 0:l.find(t=>t.id===e);if(!d)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(!(!1!==(null===(r=null==b?void 0:b.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!==(n=null==h?void 0:h.name)&&void 0!==n?n:d}});if(!(null===(c=o.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 f=await o.dataProviders.renameFolder(e,d);if(!(null==f?void 0:f.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!==f.id&&i.setSelectedFolder&&i.setSelectedFolder(f.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:f.id,itemName:f.name,folderId:null!==(u=f.parentId)&&void 0!==u?u:null}})}catch(r){console.error("Error renaming the folder:",r),s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:r,data:{itemId:e,itemName:t,error:{message:r instanceof Error?r.message:String(r)}}})}},[x,l,null===(e=o.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==b?void 0:b.features)||void 0===t?void 0:t.enableRenameFolder,i.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:p,loading:f},actions:{fetchFolders:x,fetchChildFolders:C,handleCreateFolder:_,handleModalOk:k,handleModalCancel:E,generateMenuItems:T,renameFolder:F}}},Ti=()=>{const{options:e,actions:t}=bi(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:o}=Hr(),a=Si(),s=c(async({items:e,selectedFolder:t,getItemNameById:s,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).length;c+=e;const t=i.filter(e=>!e.success);return u+=t.length,void t.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=Ei(n);d.push({itemId:r,itemName:s(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(t){u+=e.length;const r=Ei(t);d.push({error:r})}else u+=e.length}return}catch(r){const n=t?"Ошибка при удалении":"Ошибка при перемещении в корзину";console.error(n,r),u+=e.length;const i=Ei(r);d.push({error:i})}const n=t?"DataProvider для удаления файлов не настроен":"DataProvider для перемещения не настроен";console.warn(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&&a.success({id:"FILES_DELETE_SUCCESS",message:o("Files deleted"),placement:"bottomRight",data:{successCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&a.error({id:"FILES_DELETE_ERROR",message:o("Error when deleting a file"),placement:"bottomRight",data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>s(e.id)),folderId:t||null,errors:d}})),{successCount:c,failCount:u,errorDetails:d}},[r,n,i,o,a]);return{deleteItems:s}};function Fi(e,t){return new Promise(function(r,n){let i;return Oi(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 Oi=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 Pi={},Mi={get exports(){return Pi},set exports(e){Pi=e}};!function(){var e,t,r={};Mi.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 T=0;T<m;T++)x(l,c+3*T,b.itree[1+(b.ordr[T]<<1)]);c+=3*m,c=r.F._codeTiny(v,b.itree,l,c),c=r.F._codeTiny(y,b.itree,l,c)}for(var F=a,O=0;O<n;O+=2){for(var P=t[O],M=P>>>23,R=F+(8388607&P);F<R;)c=r.F._writeLit(o[F++],E,l,c);if(0!=M){var L=t[O+1],j=L>>16,D=L>>8&255,N=255&L;x(l,c=r.F._writeLit(257+D,E,l,c),M-b.of0[D]),c+=b.exb[D],w(l,c=r.F._writeLit(N,I,l,c),j-b.df0[N]),c+=b.dxb[N],F+=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++);0!=o&&console.log("debt left")},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 T=f[u(e,_)&w];_+=15&T;var F=T>>>4;if(F>>>8==0)t[C++]=F;else{if(256==F)break;var O=C+F-254;if(F>264){var P=d.ldef[F-257];O=C+(P>>>3)+a(e,_,7&P),_+=7&P}var M=p[u(e,_)&x];_+=15&M;var R=M>>>4,L=d.ddef[R],j=(L>>>4)+o(e,_,15&L);for(_+=15&L,h&&(t=r.F._check(t,C+(1<<17)));C<O;)t[C]=t[C++-j],t[C]=t[C++-j],t[C]=t[C++-j],t[C]=t[C++-j];C=O}}}else{7&_&&(_+=8-(7&_));var D=4+(_>>>3),N=e[D-4]|e[D-3]<<8;h&&(t=r.F._check(t,C+N)),t.set(new n(e.buffer,e.byteOffset+D,N),C),_=D+N<<3,C+=N}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 Ri=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:Pi},[Pi]);const Li=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 i=0;i<n;i++)o+=`%${e.pad(t[r+i].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 t=0;t<i;t++)if(c=r+t*l,u=c+t+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 r=0;r<u;r++)for(let o=0;o<c;o++)if(a>=0&&s>=0?(d=r*t+o<<2,h=(s+r)*i+a+o<<2):(d=(-s+r)*t-a+o<<2,h=r*i+o<<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 e=s.readUint(o,a);a+=4;const t=s.readASCII(o,a,4);if(a+=4,"IHDR"==t)l(o,a,d);else if("iCCP"==t){for(var y=a;0!=o[y];)y++;s.readASCII(o,a,y-a),o[y+1];const r=o.slice(y+2,a+e);let l=null;try{l=n(r)}catch(e){l=i(r)}d.tabs[t]=l}else if("CgBI"==t)d.tabs[t]=o.slice(a,a+4);else if("IDAT"==t){for(v=0;v<e;v++)h[p+v]=o[a+v];p+=e}else if("acTL"==t)d.tabs[t]={num_frames:u(o,a),num_plays:u(o,a+4)},f=new Uint8Array(o.length);else if("fcTL"==t){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"==t){for(v=0;v<e-4;v++)f[g+v]=o[a+v+4];g+=e-4}else if("pHYs"==t)d.tabs[t]=[s.readUint(o,a),s.readUint(o,a+4),o[a+8]];else if("cHRM"==t)for(d.tabs[t]=[],v=0;v<8;v++)d.tabs[t].push(s.readUint(o,a+4*v));else if("tEXt"==t||"zTXt"==t){null==d.tabs[t]&&(d.tabs[t]={});var b=s.nextZero(o,a),w=s.readASCII(o,a,b-a),x=a+e-b-1;if("tEXt"==t)_=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[t][w]=_}else if("iTXt"==t){null==d.tabs[t]&&(d.tabs[t]={}),b=0,y=a,b=s.nextZero(o,y),w=s.readASCII(o,y,b-y);const r=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=e-((y=b+1)-a),0==r?_=s.readUTF8(o,y,x):(C=n(o.slice(y,y+x)),_=s.readUTF8(C,0,C.length)),d.tabs[t][w]=_}else if("PLTE"==t)d.tabs[t]=s.readBytes(o,a,e);else if("hIST"==t){const e=d.tabs.PLTE.length/3;for(d.tabs[t]=[],v=0;v<e;v++)d.tabs[t].push(c(o,a+2*v))}else if("tRNS"==t)3==d.ctype?d.tabs[t]=s.readBytes(o,a,e):0==d.ctype?d.tabs[t]=c(o,a):2==d.ctype&&(d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==t)d.tabs[t]=s.readUint(o,a)/1e5;else if("sRGB"==t)d.tabs[t]=o[a];else if("bKGD"==t)0==d.ctype||4==d.ctype?d.tabs[t]=[c(o,a)]:2==d.ctype||6==d.ctype?d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]:3==d.ctype&&(d.tabs[t]=o[a]);else if("IEND"==t)break;a+=e,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}=Li,{_bin:t}=Li,r=Li._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 s=0;s<r;s++)for(let w=0;w<t;w++){var b;h=4*(s*t+w),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&s)+(3&w)],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&&(w!=t-1&&i(_,v,h+4,7),s!=r-1&&(0!=w&&i(_,v,h+4*t-4,3),i(_,v,h+4*t,5),w!=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 T=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>T&&t==e[x-T])E[x]=E[x-T];else{let e=S[t];if(null==e&&(S[t]=e=A.length,A.push(t),A.length>=300))break;E[x]=e}}}const F=A.length;for(F<=256&&0==f&&(v=F<=2?1:F<=4?2:F<=16?4:8,v=Math.max(v,u)),b=0;b<_.length;b++){(I=_[b]).rect.x,I.rect.y,T=I.rect.width;const e=I.rect.height;let t=I.img;new Uint32Array(t.buffer);let r=4*T,n=4;if(F<=256&&0==f){r=Math.ceil(v*T/8);var O=new Uint8Array(r*e);const i=k[b];for(let t=0;t<e;t++){x=t*r;const e=t*T;if(8==v)for(var P=0;P<T;P++)O[x+P]=i[e+P];else if(4==v)for(P=0;P<T;P++)O[x+(P>>1)]|=i[e+P]<<4-4*(1&P);else if(2==v)for(P=0;P<T;P++)O[x+(P>>2)]|=i[e+P]<<6-2*(3&P);else if(1==v)for(P=0;P<T;P++)O[x+(P>>3)]|=i[e+P]<<7-1*(7&P)}t=O,m=3,n=1}else if(0==C&&1==_.length){O=new Uint8Array(T*e*3);const i=T*e;for(x=0;x<i;x++){const e=3*x,r=4*x;O[e]=t[r],O[e+1]=t[r+1],O[e+2]=t[r+2]}t=O,m=2,n=3,r=3*T}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=Ri;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 o=t;o<r;o+=4){const t=e[o]*(1/255),r=e[o+1]*(1/255),a=e[o+2]*(1/255),s=e[o+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=a,i[3]+=s,n[0]+=t*t,n[1]+=t*r,n[2]+=t*a,n[3]+=t*s,n[5]+=r*r,n[6]+=r*a,n[7]+=r*s,n[10]+=a*a,n[11]+=a*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 e=0;e<16&&(h=d.multVec(u,h),p=Math.sqrt(d.dot(h,h)),h=d.sml(1/p,h),!(0!=e&&Math.abs(p-f)<1e-9));e++)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]]};Li.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)},Li.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 n=0;n<e.length;n++)u.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[n]),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)},Li.encode.compress=u,Li.encode.dither=s,Li.quantize=g,Li.quantize.getKDtree=m,Li.quantize.getNearest=v}();const ji={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,ji._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var Di={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Ni={[Di.CHROME]:16384,[Di.FIREFOX]:11180,[Di.DESKTOP_SAFARI]:16384,[Di.IE]:8192,[Di.IOS]:4096,[Di.ETC]:8192};const zi="undefined"!=typeof window,Bi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Ui=zi&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Vi=(zi||Bi)&&(Ui&&Ui.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),Hi=(zi||Bi)&&(Ui&&Ui.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function Wi(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 $i(e){return new Promise((t,r)=>{const n=new Hi;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function qi(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function Gi(){if(void 0!==Gi.cachedResult)return Gi.cachedResult;let e=Di.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=Di.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=Di.IOS:/Safari/i.test(t)?e=Di.DESKTOP_SAFARI:/Firefox/i.test(t)?e=Di.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=Di.IE),Gi.cachedResult=e,Gi.cachedResult}function Yi(e,t){const r=Gi(),n=Ni[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 Xi(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 Ki(e,t){const{width:r,height:n}=Yi(e.width,e.height),[i,o]=Xi(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 Zi(){return void 0!==Zi.cachedResult||(Zi.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),Zi.cachedResult}function Ji(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=Ki(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 $i(e).then(function(e){try{return t=e,qi(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(Zi()||[Di.DESKTOP_SAFARI,Di.MOBILE_SAFARI].includes(Gi()))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 Qi(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=Li.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=>ji.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),Wi(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 eo(e){e.width=0,e.height=0}function to(){return new Promise(function(e,t){let r,n,i,o;return void 0!==to.cachedResult?e(to.cachedResult):Wi("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,Ji(r).then(function(a){try{return n=a[1],Qi(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,eo(n),Ji(i).then(function(r){try{return o=r[0],to.cachedResult=1===o.width&&2===o.height,e(to.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 ro(e){return new Promise((t,r)=>{const n=new Hi;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 no(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]=Xi(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),eo(e)),a}function io(e,t){const{width:r}=e,{height:n}=e,[i,o]=Xi(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),eo(e),i}function oo(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(),Ji(e,t).then(function(r){try{return[,l]=r,A(),c=no(l,t),A(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return ro(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(),to().then(function(r){try{return d=r?c:io(c,u),A(),h=t.initialQuality||1,f=t.fileType||e.type,Qi(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 u(){if(a--&&(b>s||b>v)){let t,r;return t=S?.95*_.width:_.width,r=S?.95*_.height:_.height,[x,C]=Xi(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,Qi(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,eo(_),_=x,b=w.size,k(Math.min(99,Math.floor((y-b)/(y-s)*100))),u}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()?E.call(this):e;e=u}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(u);function E(){return eo(_),eo(x),eo(c),eo(d),eo(l),k(100),n(w)}}}catch(I){return i(I)}}.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 ao;function so(e,t){return new Promise((r,n)=>{ao||(ao=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\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"));const i=new Worker(ao);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}})})}function lo(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 Vi))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 oo(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 oo(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",so(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=Fi(e,o))}catch(e){}return r(o)}})}async function co(e,t={}){const{maxSizeMB:r=.5,maxWidthOrHeight:n=2e3}=t;if(!(e&&e instanceof File))return e;if("image/gif"===e.type)return e;try{const t=await lo(e,{maxSizeMB:r,maxWidthOrHeight:n,useWebWorker:!0});return t instanceof File?t:new File([t],e.name,{type:t.type||e.type})}catch(t){return console.error("compressImageWithLimits failed",t),e}}lo.getDataUrlFromFile=$i,lo.getFilefromDataUrl=Wi,lo.loadImage=qi,lo.drawImageInCanvas=Ki,lo.drawFileInCanvas=Ji,lo.canvasToFile=Qi,lo.getExifOrientation=ro,lo.handleMaxWidthOrHeight=no,lo.followExifOrientation=io,lo.cleanupCanvasMemory=eo,lo.isAutoOrientationInBrowser=to,lo.approximateBelowMaximumCanvasSizeOfBrowser=Yi,lo.copyExifWithoutOrientation=Fi,lo.getBrowserName=Gi,lo.version="2.0.2";const uo=()=>{var e,t;const{state:r,actions:n,options:o}=bi(),a=_i(),{sortBy:s,sortOrder:l}=a.state,{actions:{fetchFolders:u}}=Ii(),{t:d}=Hr(),h=Si(),{deleteItems:f}=Ti(),{selectedFolder:p,urlForm:g,pagination:m,files:v}=r,y=i.useRef(null);y.current=m;const{setFiles:b,setLoading:w,setIsUrlModalVisible:x,setSelectedFiles:C,setActiveLibraryItem:_,setPagination:S}=n,{dataProviders:A}=o,k=c(async e=>{var t,r,n;if(!(null==A?void 0:A.getFiles))return[];const i=null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.disablePagination,{files:a,pagination:s}=await A.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,search:(null===(r=null==e?void 0:e.search)||void 0===r?void 0:r.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:i||null==e?void 0:e.page,limit:i||null==e?void 0:e.limit,itemType:(null==e?void 0:e.itemType)||"all"});return S&&((null===(n=null==o?void 0:o.config)||void 0===n?void 0:n.disablePagination)?S({current:1,pageSize:a.length||1,total:a.length||0}):s&&S({current:s.page,pageSize:s.limit,total:s.total})),a},[A,null===(e=null==o?void 0:o.config)||void 0===e?void 0:e.disablePagination,S]),E=c(async e=>{try{null==w||w(!0);let t=[];if(!(null==A?void 0:A.getFiles))return void console.error("DataProvider for getting files is not defined");t=await k(e);const r=null!=e?e:{folderId:p||"",itemType:"all"};"file"!==r.itemType&&(t=await Ci(t,r,null==A?void 0:A.getFolders)),"Trash"!==(p||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==b||b(t),null==C||C(new Set)}catch(t){console.error("Error loading files:",t);const r=Ei(t),n=ki(null==r?void 0:r.code,d);h.error({id:"FILES_FETCH_FAILED",message:null!=n?n:d("Failed to load files"),placement:"bottomRight",innerException:t,data:{params:e}})}finally{null==w||w(!1)}},[A,b,w,C,k,p,h,d]),I=c(async e=>{const t=y.current;try{const r=v.find(t=>t.id===e),n=e=>{if(!e)return;const t=v.find(t=>t.id===e);return null==t?void 0:t.name};await f({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:p,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===v.length&&(o=i.current>1?i.current-1:1),await E({folderId:p||"",page:o,limit:t.pageSize,sortBy:s,sortOrder:l})}catch(t){console.error("ОError when deleting a file:",t);const r=t;(null==r?void 0:r.notificationShown)||h.error({id:"FILES_DELETE_ERROR",message:d("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:p||null,errors:[{itemId:e,error:Ei(t)}]}})}},[f,E,p,d,h,v,s,l]),T=c(async e=>{try{const t=y.current;if(!(null==A?void 0:A.deleteFolder))return void h.error({id:"FOLDER_DELETE_ERROR",message:d("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await A.deleteFolder(e)){const e=new Error("Не удалось удалить папку");throw e.notificationShown=!1,e}h.success({id:"FOLDER_DELETE_SUCCESS",message:d("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}});p===e?await E({page:t.current,limit:t.pageSize,sortBy:s,sortOrder:l}):await E({folderId:p||"",sortBy:s,sortOrder:l,page:t.current,limit:t.pageSize})}catch(t){console.error("Error when deleting a folder:",t);const r=t;(null==r?void 0:r.notificationShown)||h.error({id:"FOLDER_DELETE_ERROR",message:d("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:Ei(t)}]}})}},[A,p,h,d,E,s,l]),F=c(async(e,t)=>{var r,n;try{if(null==A?void 0:A.getFileData){const t=await A.getFileData(e);if(t)return t;throw new Error(d("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(d("Error loading image"));return await t.blob()}}catch(i){console.error("Error when loading a file:",i);const o=v.find(t=>t.id===e);h.error({id:"FILE_DOWNLOAD_FAILED",message:d("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,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)}},[A,h,d,v]),O=c(async(e,t,n)=>{var i,a,s,l,c,u,f,g,m,v,y,b;if("Trash"===(null!=t?t:p||""))throw new Error(d("Upload to Trash is forbidden"));const w=e.name.split(".").pop()||"",x=null!=t?t:p||"";let C=e;try{if((null===(a=null===(i=e.type)||void 0===i?void 0:i.startsWith)||void 0===a?void 0:a.call(i,"image/"))&&"image/gif"!==e.type){const t=null!==(l=null===(s=null==o?void 0:o.config)||void 0===s?void 0:s.compressMaxSize)&&void 0!==l?l:.7,r=null!==(u=null===(c=null==o?void 0:o.config)||void 0===c?void 0:c.compressMaxWidthOrHeight)&&void 0!==u?u:2e3;C=await co(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:e.type})}}catch(e){console.warn("Image compression failed, uploading original file",e)}try{if(null==A?void 0:A.uploadFiles)try{const t=await A.uploadFiles({items:[{name:C.name,size:C.size,type:C.type||e.type,folderId:x,data:C,extension:w}],folderId:x});if(t.success&&t.detailed&&t.detailed.length>0){const i=t.detailed[0];if(!i.success||!i.data){if(!n){const e=(null==i?void 0:i.error)?String(i.error):d("Failed to upload file");h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:C.name,innerException:null==i?void 0:i.error,data:{itemName:C.name,folderId:x||null}})}return void(_&&_(Qt))}{const t=i.data;if(t.id){const n=(null!==(f=t.folderId)&&void 0!==f?f:x)||void 0;await E({folderId:n});let i=r.files.find(e=>e.id===t.id);if(!i)try{i=(await k({folderId:n,itemType:"file"})).find(e=>e.id===t.id)}catch(e){console.warn("uploadFileWithProvider: не удалось получить свежий список файлов",e)}return _&&_(Qt),i||Object.assign(Object.assign({},t),{id:t.id,name:t.name||C.name,folderId:null!==(m=null!==(g=t.folderId)&&void 0!==g?g:x)&&void 0!==m?m:null,type:C.type||e.type,size:C.size,extension:w||C.name.split(".").pop()||"",thumbnail:null!==(v=t.thumbnail)&&void 0!==v?v:void 0,url:null!==(y=t.url)&&void 0!==y?y:void 0,thumbnailUrl:null!==(b=t.thumbnailUrl)&&void 0!==b?b:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!n){const e=t.error?String(t.error):d("Failed to upload file");h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:C.name,innerException:t.error,data:{itemName:C.name,folderId:x||null}})}return void(_&&_(Qt))}return void(_&&_(Qt))}catch(e){throw e}if(null==A?void 0:A.uploadFile){const t=await A.uploadFile({name:C.name,size:C.size,type:C.type||e.type,folderId:x,data:C,extension:w});return _&&_(Qt),t}return void(n||h.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:d("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=Ei(e),r=ki(null==t?void 0:t.code,d);return n?void 0:void h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=r?r:d("Failed to upload file"),placement:"bottomRight",description:C.name,innerException:e,data:{itemName:C.name,folderId:x||null,error:Ei(e)}})}},[A,p,_,r.files,E,k,h,d]),P=c(async(e,t)=>{var r;if(!(null==A?void 0:A.getFolders)||!(null==A?void 0:A.createFolder))return e||"";try{const n=await A.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 A.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 console.warn("ensureFolderPath: unable to guarantee the path",t),e||""}},[A]),M=c(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 P(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[P]),R=c(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 M(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)}},[M]),L=c(async(e,t)=>{var r,n,i,a,s,l,c,u,f,g,m,v,y,b,w,x,C,S,k,E,I,T,F,O,P,R,L,j,D,N;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 z=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},B=[];for(let r=0;r<e.length;r++){const d=e[r];if(!(null===(i=null===(n=d.type)||void 0===n?void 0:n.startsWith)||void 0===i?void 0:i.call(n,"image/"))){const e=await h.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:"Unsupported file type",placement:"bottomRight",data:{itemName:d.name,fileType:d.type,folderId:p||null}});null===(a=null==t?void 0:t.onError)||void 0===a||a.call(t,d.name,e.message);continue}let v=d;try{if((null===(l=null===(s=d.type)||void 0===s?void 0:s.startsWith)||void 0===l?void 0:l.call(s,"image/"))&&"image/gif"!==d.type){const e=null!==(u=null===(c=null==o?void 0:o.config)||void 0===c?void 0:c.compressMaxSize)&&void 0!==u?u:.7,t=null!==(g=null===(f=null==o?void 0:o.config)||void 0===f?void 0:f.compressMaxWidthOrHeight)&&void 0!==g?g:2e3;v=await co(d,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:d.type})}}catch(e){console.warn("Image compression failed, uploading original file",e)}const y=`${Date.now()}-${r}-${Math.random().toString(36).slice(2,8)}`,b=await M(v,p);null===(m=null==t?void 0:t.onStart)||void 0===m||m.call(t,v),B.push({file:v,targetFolderId:b,requestId:y})}const U=B.length;if(0===U)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const V=!t,H=1===U&&V,W=[],$=[],q=[],G=[],Y=new Map;let X=0,K=0;const Z=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};X++,W.push(e),$.push(null!=n?n:e),await((e,t,r,n)=>{var i;return h.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${d("File")} ${e} ${d("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:p)&&void 0!==i?i:null}},n||!V)})(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))},J=async(e,r,n,i,o)=>{var a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=o?o:{};K++;const c=Ei(i),u=await((e,t,r,n,i)=>{var o;const a=Ei(n),s=ki(null==a?void 0:a.code,d);return h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=s?s:d("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(o=null!=t?t:p)&&void 0!==o?o:null,error:a},innerException:n},i||!V)})(e,r,0,i,!l);s&&(null===(a=null==t?void 0:t.onError)||void 0===a||a.call(t,e,u.message)),G.push({itemId:void 0,itemName:e,error:c}),q.push({fileName:e,error:u.message})};if(!(null==A?void 0:A.uploadFiles))return h.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:d("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:U,successes:[],errors:[],totalCount:U};try{const e=await A.uploadFiles({items:B.map(e=>{var t,r;return{requestId:e.requestId,name:e.file.name,size:e.file.size,type:e.file.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:p)&&void 0!==r?r:null,data:e.file,extension:e.file.name.split(".").pop()||""}}),folderId:null!=p?p:null}),t=null!==(v=e.detailed)&&void 0!==v?v:[],r=new Map(t.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(t.length>0)for(let e=0;e<B.length;e++){const n=B[e],i=null!==(y=n.requestId?r.get(n.requestId):void 0)&&void 0!==y?y:t[e];if(i&&i.success){const e=i.data,t=n.file.name,r=null!==(x=null!==(w=null!==(b=null==e?void 0:e.folderId)&&void 0!==b?b:n.targetFolderId)&&void 0!==w?w:p)&&void 0!==x?x:null,o=null==e?void 0:e.id;Y.set(t,{id:o,name:null!==(C=null==e?void 0:e.name)&&void 0!==C?C:t,folderId:r}),await Z(t,r,o,{emitNotification:H})}else{(null==i?void 0:i.error)?String(i.error):d("Error uploading file");const e=null==i?void 0:i.data,t=n.file.name,r=null!==(E=null!==(k=null!==(S=null==e?void 0:e.folderId)&&void 0!==S?S:n.targetFolderId)&&void 0!==k?k:p)&&void 0!==E?E:null;await J(t,r,0,null==i?void 0:i.error,{emitNotification:H})}}else if(e.success)for(const e of B){const t=e.file.name,r=null!==(T=null!==(I=e.targetFolderId)&&void 0!==I?I:p)&&void 0!==T?T:null;await Z(t,r,void 0,{emitNotification:H})}else{e.error?String(e.error):d("Error uploading file");for(const t of B){const r=t.file.name,n=null!==(O=null!==(F=t.targetFolderId)&&void 0!==F?F:p)&&void 0!==O?O:null;await J(r,n,0,e.error,{emitNotification:H})}}}catch(e){e instanceof Error?e.message:String(e);for(const t of B){const r=t.file.name,n=null!==(R=null!==(P=t.targetFolderId)&&void 0!==P?P:p)&&void 0!==R?R:null;await J(r,n,0,e,{emitNotification:H})}}if(X>0&&(_&&_(Qt),U>1&&V)){const e=z(W),t=e?d("Uploaded",{names:e}):d("uploads_success_summary",{successCount:X,totalCount:U});h.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:X,totalCount:U,itemIds:$,itemNames:W,folderId:null!=p?p:null}})}if(K>0&&!H&&V)if(U>1){const e=q.map(e=>e.fileName),t=z(e),r=t?d("Failed",{names:t}):d("uploads_fail_summary",{failCount:K,totalCount:U});h.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:K,totalCount:U,itemNames:e,folderId:null!=p?p:null,errors:G}})}else if(1===U&&G.length>0&&(null===(L=G[0].error)||void 0===L?void 0:L.code)){const e=ki(null===(j=G[0].error)||void 0===j?void 0:j.code,d),t=null!==(N=null===(D=q[0])||void 0===D?void 0:D.fileName)&&void 0!==N?N:"",r=null!=e?e:t?`${d("Failed to upload files")}: ${t}`:d("Failed to upload files");h.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:K,totalCount:U,itemNames:[t],folderId:null!=p?p:null,errors:G}})}return{successCount:X,failCount:K,successes:W,errors:q,totalCount:U,uploadedFiles:Y.size>0?Y:void 0}},[A,null==A?void 0:A.uploadFiles,h,M,p,_,d,R,O]),j=c(async e=>{var t;if(!(null==A?void 0:A.uploadFiles))return void h.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:d("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===p)return void h.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:d("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:p||null,reason:"Upload to Trash is not allowed"}});const r=y.current,n=document.createElement("input");n.type="file",n.accept="image/*",n.multiple=!0;try{!(!(null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.features)||!o.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==w||w(!0);const{successes:t,errors:i,uploadedFiles:a}=await L(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 u(),await E({folderId:p||"",sortBy:s,sortOrder:l,page:r.current,limit:r.pageSize})}catch(e){console.error("Error when loading files:",e)}finally{null==w||w(!1)}},n.click()},[null==A?void 0:A.uploadFile,null==A?void 0:A.uploadFiles,p,h,d,w,E,u,s,l,L,null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.features]),D=c(async(e,t)=>{const r=y.current;let n,i=null!=e?e:null;try{if(!t&&"Trash"===p)return void h.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:d("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:p||null,reason:"Upload to Trash is not allowed"}});let e;if(!i&&g&&(e=await g.validateFields(),i=null==e?void 0:e.fileUrl),!i)return void h.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:d("Please fill in all fields"),placement:"bottomRight",data:{url:null!=i?i:null,folderId:p||null}});if(null==w||w(!0),!(null==A?void 0:A.uploadFileByUrl))return void h.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:d("Upload by URL is not supported"),placement:"bottomRight",data:{url:i,folderId:p||null}});n=await A.uploadFileByUrl({url:i,folderId:p||"",noFolder:t});const o=(null==e?void 0:e.name)||(null==n?void 0:n.name)||"unnamed file";return h.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${d("File")} ${o} ${d("successfully uploaded")}`,placement:"bottomRight",data:{itemName:o,itemId:null==n?void 0:n.id,folderId:p||null}}),e&&(null==x||x(!1),null==g||g.resetFields()),_&&_(Qt),await E({folderId:p||"",sortBy:s,sortOrder:l,page:r.current,limit:r.pageSize}),n}catch(e){console.error("Error when loading a file by URL:",e),h.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:d("Error when downloading a file by URL"),placement:"bottomRight",data:{url:null!=i?i:null,folderId:p||null,error:Ei(e)},innerException:e})}finally{null==w||w(!1)}},[g,w,A,h,d,x,_,E,p,s,l]),N=c(async e=>{if(!e.length)return;const t=y.current;"Trash"!==p?(await L(e),await E({folderId:p||"",sortBy:s,sortOrder:l,page:t.current,limit:t.pageSize})):h.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:d("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:p||null,reason:"Upload to Trash is not allowed"}})},[E,p,s,l,L,h,d]);return{fetchFiles:E,handleDeleteFile:I,handleDeleteFolder:T,handleAddFile:j,handleAddFileByUrl:D,handleDroppedFiles:N,getFileData:F,uploadFileWithProvider:O}},ho=e=>{var t,r,n,i;const{state:o,actions:a,options:s}=bi(),{t:l}=Hr(),u=Ii(),d=Si(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=bi(),{dataProviders:t}=e,{t:r}=Hr(),n=c(async({itemId:e,newName:n,isFolder:i})=>{var o,a,s,l,c,u,d,h;try{if(i){if(!(null==t?void 0:t.renameFolder))throw new Error(r("renameFolder is not implemented in dataProviders"));const i=await t.renameFolder(e,n.trim());return{success:!0,renamedItem:{id:i.id,name:null!==(o=i.name)&&void 0!==o?o:n,parentId:null!==(a=i.parentId)&&void 0!==a?a:null,folderId:null!==(s=i.parentId)&&void 0!==s?s:null}}}if(!(null==t?void 0:t.renameFile))throw new Error(r("renameFile is not implemented in dataProviders"));const f=await t.renameFile(e,n);return{success:!0,renamedItem:{id:null!==(l=null==f?void 0:f.id)&&void 0!==l?l:e,name:null!==(c=null==f?void 0:f.name)&&void 0!==c?c:n,folderId:null!==(u=null==f?void 0:f.folderId)&&void 0!==u?u:null,parentId:null!==(h=null!==(d=null==f?void 0:f.parentId)&&void 0!==d?d:null==f?void 0:f.folderId)&&void 0!==h?h:null}}}catch(e){return{success:!1,error:Ei(e)}}},[t,r]);return{renameItem:n}})(),{files:p,selectedFolder:g,fileToRename:m,renameForm:v,isRenameModalVisible:y,pagination:b}=o,{setFileToRename:w,setIsRenameModalVisible:x}=a,{dataProviders:C,config:_}=s,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=c(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:l("Folder rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFolder))throw new Error(l("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:l("File rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFile))throw new Error(l("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,l]),E=c(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),I=c(async()=>{var t,r,n,i,o,s,c,u,y;if(!m||!v)return;const w=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 x=(null==w?void 0:w.isFolder)||m.startsWith("folder_");if(x){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:l("Folder rename is disabled by config"),placement:"bottomRight",data:A(w,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:l("File rename is disabled by config"),placement:"bottomRight",data:A(w,m)})}const C=await f({itemId:m,newName:p.newFileName,isFolder:x});if(!C.success){const e=ki(null===(n=C.error)||void 0===n?void 0:n.code,l);return void d.error({id:"ITEM_RENAME_FAILED",message:null!==(o=null!=e?e:null===(i=C.error)||void 0===i?void 0:i.message)&&void 0!==o?o:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(w,m)),{error:C.error}),innerException:C.error})}const S=C.renamedItem;x?(d.success({id:"FOLDER_RENAME_SUCCESS",message:l(`${l("Folder renamed to")} ${p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(s=null==S?void 0:S.id)&&void 0!==s?s:m,itemName:null!==(c=null==S?void 0:S.name)&&void 0!==c?c:p.newFileName,folderId:null!==(y=null!==(u=null==S?void 0:S.parentId)&&void 0!==u?u:null==S?void 0:S.folderId)&&void 0!==y?y:null}}),await h(),(null==S?void 0:S.id)&&S.id!==m&&a.setSelectedFolder&&a.setSelectedFolder(S.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${l("File renamed to")} ${p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},A(w,m)),{itemName:p.newFileName})}),E(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){console.error("Error when renaming:",e);const t=Ei(e),r=ki(null==t?void 0:t.code,l);d.error({id:"ITEM_RENAME_FAILED",message:null!=r?r:e instanceof Error?e.message:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(w,m)),{error:t}),innerException:e})}},[m,v,p,a,E,e,g,l,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}}},fo=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}},po=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),go=(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}),mo=()=>{const e=Si(),{t:t}=Hr(),{actions:{fetchFolders:r,fetchChildFolders:n}}=Ii();return{refreshFolders:c(async({parentIds:i,selectedFolder:o})=>{try{if(await r(),i&&n)for(const e of i)e&&await n(e)}catch(r){console.error("Error when updating the folder tree:",r),e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh folder tree"),placement:"bottomRight",innerException:r,data:{params:{folderId:o||void 0}}})}},[e,t]),refreshFiles:c(async({fetchFiles:r,selectedFolder:n,page:i,limit:o})=>{try{await r({folderId:n||"",page:i,limit:o})}catch(r){console.error("Ошибка при обновлении списка файлов:",r),e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh file list"),placement:"bottomRight",innerException:r,data:{params:{folderId:n||void 0,page:i,limit:o}}})}},[e,t])}},vo=()=>{var e,t;const{state:r,actions:n,options:i}=bi(),{selectedFolder:o,pathHistory:a,folders:s}=r,{t:l}=Hr(),{setSelectedFolder:u,setPathHistory:d}=n,h=c(()=>{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=c((e,t=new Set)=>{if(t.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const r=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!r)return[];const n=new Set(t);return n.add(e),r.parentId?r.parentId===r.id?(console.warn(`Cycle detected: folder ${r.id} is a parent of itself`),[{id:r.id,name:r.name+" (ошибка)"}]):[...f(r.parentId,n),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},[s]),p=c(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=c(e=>{if("folders"===e){const e=[{id:"folders",name:l("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}const t=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!t)return void console.warn("⚠️ Folder not found:",e);const r=f(e),n=[{id:"folders",name:l("Folders")},...r];null==d||d(n),i.onPathChange&&i.onPathChange(n.map(e=>e.name))},[s,f,d,i,l]),m=c(e=>{const t="folders"===e?null:e;t!==o&&(null==u||u(t),p(t),g(e))},[p,o,u,g]),v=c(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:l("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=a.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,a,d,u,l]),y=c(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...a,t];d(e)}if(i.onPathChange){const t=[...a.map(e=>e.name),e.name];i.onPathChange(t)}},[i,a,d,u]);return{state:{selectedFolder:o,pathHistory:a},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:o,pathHistory:a,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}},yo=e=>{const{state:t,actions:r}=bi(),{t:n}=Hr(),i=Si(),{files:o,selectedFolder:a,selectedFiles:s,moveForm:l,pagination:u,currentMenuFile:d}=t,{setIsMoveModalVisible:h,setSelectedFiles:f,setPagination:p}=r,{moveItems:g}=(()=>{const{options:e}=bi(),{dataProviders:t}=e,{t:r}=Hr(),n=Si(),i=c(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=Ei(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=Ei(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Ei(t);c.push({error:r})}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:m,refreshFiles:v}=mo(),{handleFolderSelect:y}=vo(),{getItemNameById:b,getItemNamesByIds:w,getNamesPreview:x}=fo(o),C=c(()=>{null==h||h(!0)},[h]),_=c(()=>{null==h||h(!1),null==l||l.resetFields()},[h,l]),S=c(async t=>{var r,c,h;if(!((null==d?void 0:d.length)||s&&0!==s.size))return;const C=o.length,S=Object.assign({},u),A=Array.from((null==d?void 0:d.length)?[d]:s),k=A.length;let E=0,I=0;const T=[],F=A.map(e=>o.find(t=>t.id===e)).filter(e=>Boolean(e)),O=F.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let o=t;if(!t){const e=await l.validateFields();o=null==e?void 0:e.targetFolder}if(!o)return void i.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:n("Select destination folder"),placement:"bottomRight"});const s="folders"===o?null:o,u=null!=s?s:a,d=await g({items:F,targetFolderId:o,getItemNameById:b,showNotifications:!1});if(E=d.successCount,I=d.failCount,T.push(...d.errorDetails),E>0){const e=w(A),t=x(e),r=t?n("Moved",{names:t}):n("move_success_summary",{successCount:E,totalCount:k});i.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:po(A,E,k,s,e)})}if(I>0){const e=w(A),t=x(e);let o;if(1===k&&T.length>0&&(null===(r=T[0].error)||void 0===r?void 0:r.code)){const e=ki(null===(c=T[0].error)||void 0===c?void 0:c.code,n);o=null!=e?e:t?n("Failed",{names:t}):n("move_fail_summary",{failCount:I,totalCount:k})}else o=t?n("Failed",{names:t}):n("move_fail_summary",{failCount:I,totalCount:k});i.error({id:"FILES_MOVE_ERROR",message:o,placement:"bottomRight",innerException:T.length?T:void 0,data:go(A,I,k,s,T.length?T:void 0,e)})}_(),null==f||f(new Set);let P=S.current;if(E>0&&C>0&&E>=C&&S.current>1&&(P=S.current-1),E>0&&S.total>=E){const e=Math.max(0,(null!==(h=S.total)&&void 0!==h?h:0)-E);null==p||p({current:P,pageSize:S.pageSize,total:e})}O&&await m({parentIds:void 0,selectedFolder:u});const M=null!=s?s:"folders";M!==(null!=a?a:"folders")&&y(M),await v({fetchFiles:e,selectedFolder:u,page:P,limit:S.pageSize})}catch(e){console.error("Error when moving:",e);const t=ki(Ei(e).code,n);i.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=t?t:n("Error moving"),placement:"bottomRight",data:go(A,k,k,a||null,[{error:Ei(e)}],w(A))})}},[d,s,l,f,e,a,u,o,i,p,n,g,h,y]);return{actions:{showMoveModal:C,handleMoveCancel:_,handleMoveOk:S}}},bo=e=>{const{state:t,actions:r}=bi(),{t:n}=Hr(),i=Si(),{files:o,selectedFolder:a,selectedFiles:s,copyForm:l,pagination:u,currentMenuFile:d}=t,{setIsCopyModalVisible:h,setSelectedFiles:f}=r,{copyItems:p}=(()=>{const{options:e}=bi(),{dataProviders:t}=e,{t:r}=Hr(),n=Si(),i=c(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=>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=Ei(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=Ei(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Ei(t);c.push({error:r})}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})?s++:l++}catch(e){l++;const t=Ei(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:g,refreshFiles:m}=mo(),{handleFolderSelect:v}=vo(),{getItemNameById:y,getItemNamesByIds:b,getNamesPreview:w}=fo(o),x=c(()=>{null==h||h(!0)},[h]),C=c(()=>{null==h||h(!1),null==l||l.resetFields()},[h,l]),_=c(async t=>{var r,c;if(!((null==d?void 0:d.length)||s&&0!==s.size))return;const h=Array.from((null==d?void 0:d.length)?[d]:s),x=h.length;let _=0,S=0;const A=[],k=h.map(e=>o.find(t=>t.id===e)).filter(e=>Boolean(e)),E=k.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let o=t;if(!t){const e=await l.validateFields();o=null==e?void 0:e.targetFolder}if(!o)return void i.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:n("Select destination folder"),placement:"bottomRight"});const s="folders"===o?null:o,d=null!=s?s:a,I=await p({items:k,targetFolderId:o,getItemNameById:y,showNotifications:!1});if(_=I.successCount,S=I.failCount,A.push(...I.errorDetails),_>0){const e=b(h),t=w(e),r=t?n("Copied",{names:t}):n("copy_success_summary",{successCount:_,totalCount:x});i.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:po(h,_,x,s,e)})}if(S>0){const e=b(h),t=w(e);let o;if(1===x&&A.length>0&&(null===(r=A[0].error)||void 0===r?void 0:r.code)){const e=ki(null===(c=A[0].error)||void 0===c?void 0:c.code,n);o=null!=e?e:t?n("Failed",{names:t}):n("copy_fail_summary",{failCount:S,totalCount:x})}else o=t?n("Failed",{names:t}):n("copy_fail_summary",{failCount:S,totalCount:x});i.error({id:"FILES_COPY_ERROR",message:o,placement:"bottomRight",innerException:A.length?A:void 0,data:go(h,S,x,s,A.length?A:void 0,e)})}C(),null==f||f(new Set),E&&await g({parentIds:void 0,selectedFolder:d});const T=null!=s?s:"folders";T!==(null!=a?a:"folders")&&v(T),await m({fetchFiles:e,selectedFolder:d,page:u.current,limit:u.pageSize})}catch(e){console.error("Error when copying:",e);const t=ki(Ei(e).code,n);i.error({id:"FILES_COPY_ERROR",message:null!=t?t:n("Error copying"),innerException:e,placement:"bottomRight",data:go(h,x,x,a||null,[{error:Ei(e)}],b(h))})}},[d,s,l,f,e,a,u,o,i,n,p,h,v]);return{actions:{showCopyModal:x,handleCopyCancel:C,handleCopyOk:_}}},wo=e=>{const t=ho(e),r=yo(e),n=bo(e),i=(e=>{const{state:t,actions:r,options:n}=bi(),{t:i}=Hr(),o=Si(),{files:a,selectedFolder:s,selectedFiles:l,pagination:u,currentMenuFile:d}=t,{setSelectedFiles:h,setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=Ti(),{refreshFolders:y,refreshFiles:b}=mo(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=fo(a),_=c(()=>{null==f||f(!0)},[f]),S=c(()=>{null==f||f(!1)},[f]),A=c(async()=>{var t,r,n;if(!((null==d?void 0:d.length)||l&&0!==l.size))return void(null==f||f(!1));const c=a.length,_=Object.assign({},u),S=Array.from(d?[d]:l),A=S.map(e=>a.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 T=[];try{const a=await v({items:A,selectedFolder:s,getItemNameById:w,showNotifications:!1});E=a.successCount,I=a.failCount,T.push(...a.errorDetails);const l=(null==m?void 0:m.enableTrashFolder)&&"Trash"===s;if(E>0&&(null==m?void 0:m.enableTrashFolder)&&!l&&(null==p||p({itemIds:S,sourceFolderId:s||"folders"})),E>0){const e=S.length;(null==m?void 0:m.enableTrashFolder)&&!l?await o.success({id:"FILES_DELETE_SUCCESS",message:i("moved_to_trash",{count:E}),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:s||null}}):await o.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:s||null}})}if(I>0){const e=x(S),n=C(e),a=S.length,s=1===a&&T.length>0&&(null===(t=T[0].error)||void 0===t?void 0:t.code),c=(null==m?void 0:m.enableTrashFolder)&&!l,u=i(c?"При перемещении в корзину произошли ошибки":"При удалении произошли ошибки"),d=s?ki(null===(r=T[0].error)||void 0===r?void 0:r.code,i):void 0,h=null!=d?d:n?i("Failed",{names:n}):u;o.error({id:"FILES_DELETE_ERROR",message:h,placement:"bottomRight",innerException:T.length?T:void 0,data:{failCount:I,isTrashMove:c,totalCount:a,itemNames:e,errors:T.length?T:void 0}})}null==h||h(new Set),null==f||f(!1),await y({parentIds:Array.from(k),selectedFolder:s});let u=_.current;if(E>0&&c>0&&E>=c&&_.current>1&&(u=_.current-1),E>0&&_.total>=E){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-E);null==g||g({current:u,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:s,page:u,limit:_.pageSize})}catch(e){console.error("Error when deleting:",e),o.error({id:"FILES_DELETE_ERROR",message:i("Error deleting"),placement:"bottomRight",innerException:e,data:{failCount:I,totalCount:A.length}})}},[d,l,f,e,s,u,p,g,a,i,o,v,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)}},xo=()=>{const{state:e}=bi(),{files:t,loading:r,isUrlModalVisible:n}=e,i=uo(),o=(()=>{const{state:e,actions:t}=bi(),{selectedFiles:r,files:n,multiSelect:i}=e,{setSelectedFiles:o}=t,a=u(null),s=c((e,t,r)=>{const i=Array.isArray(n)?n:[],o=i.findIndex(t=>t.id===e),a=i.findIndex(e=>e.id===t);if(-1===o||-1===a)return r;const[s,l]=o<a?[o,a]:[a,o],c=i.slice(s,l+1).map(e=>e.id),u=new Set(r);return c.forEach(e=>u.add(e)),u},[n]),l=c((e,t)=>{if(!r||!o)return;const n=!1!==i,l=!!(null==t?void 0:t.shiftKey)&&n&&a.current;let c=new Set(n?r:[]);l&&a.current?c=s(a.current,e,c):c.has(e)?c.delete(e):c.add(e),a.current=e,o(c)},[i,r,o,s]);return{state:{selectedFiles:r||new Set},actions:{toggleFileSelection:l}}})(),a=wo(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.state.selectedFiles,loading:r||!1,isAddingFileByUrl:n||!1,isRenamingFile:a.state.isRenamingFile,fileToRename:a.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:o.actions.toggleFileSelection,showRenameModal:a.actions.showRenameModal,handleRenameCancel:a.actions.handleRenameCancel,handleRenameOk:a.actions.handleRenameOk,showMoveModal:a.actions.showMoveModal,handleMoveCancel:a.actions.handleMoveCancel,handleMoveOk:a.actions.handleMoveOk,showCopyModal:a.actions.showCopyModal,handleCopyCancel:a.actions.handleCopyCancel,handleCopyOk:a.actions.handleCopyOk,showDeleteConfirm:a.actions.showDeleteConfirm,handleDeleteConfirmCancel:a.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:a.actions.handleDeleteConfirmOk}}},Co="filemanager_sidebar_width",_o=({onSearch:t,placeholder:r,className:n})=>{const{t:i}=Hr(),[s,l]=o(""),c=u(null),{options:d}=bi(),{config:h}=d,f=r||i("Search files...");a(()=>(c.current=vi.debounce(e=>{t(e)},500),()=>{var e;null===(e=c.current)||void 0===e||e.cancel()}),[t]);return e(F,{value:s,onChange:e=>{var t;const r=e.target.value;l(r),null===(t=c.current)||void 0===t||t.call(c,r)},placeholder:f,prefix:e(ci,{size:16,strokeWidth:null==h?void 0:h.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{l(""),t("")}})},So=new Map,Ao=(e,t)=>{So.set(e,t),So.size>350&&(Array.from(So.keys()).slice(0,50).forEach(e=>So.delete(e)),console.warn("Image cache cleared. Removed 50 oldest records."))},ko=e=>{if(e.type&&e.type.startsWith("image/"))return!0;if(e.name){const t=e.name.toLowerCase().split(".").pop();return ur.includes(t||"")}return!1},Eo=({thumbnailSrc:t,previewSrc:r,alt:n,className:s,width:l,height:u,preview:d=!1,file:h})=>{const{t:f}=Hr(),p=uo(),[g,m]=o(!1),v=null==h?void 0:h.id,y=null==h?void 0:h.type,b=null==h?void 0:h.name,[w,x]=o(t),[C,_]=o(r),[S,A]=o(!1),[k,E]=o(!1),I=i.useRef(!1),T=i.useRef(!1),F=i.useRef(!1),P=c(async(e,t,r)=>{if((e=>So.has(e))(e))return(e=>So.get(e))(e);if(!e||t&&!ko({type:t}))return console.warn("File is not an image:",r,t),dr;try{const t=await p.getFileData(e,!0);if(!t)throw new Error(f("Error loading image"));return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>{const t=i.result;Ao(e,t),r(t)},i.onerror=()=>n(new Error("Ошибка чтения файла")),i.readAsDataURL(t)})}catch(e){throw console.error("Error loading the image:",e),e}},[p.getFileData,f]),M=c(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),R=c(e=>{if(e&&e!==dr)return e.startsWith("data:image/")?M(e)?e:void console.warn("Invalid base64 data:",e.substring(0,50)+"..."):e.startsWith("blob:")||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:void 0},[M]);a(()=>{A(!1),m(!1),E(!1),I.current=!1,T.current=!1,F.current=!1;const e=R(t);e?x(e):v&&ko({name:b,type:y})&&!F.current?(F.current=!0,E(!0),A(!0),P(v,y,b).then(e=>{x(e),A(!1)}).catch(()=>{x(dr),m(!0),A(!1)}).finally(()=>E(!1))):(x(dr),m(!0));const n=R(r);if(n)_(n);else{const e=R(t);e?_(e):v&&ko({name:b,type:y})?P(v,y,b).then(e=>{_(e)}).catch(()=>{_(dr)}):_(dr)}},[t,r,v,y,b,P,R]);const L=c(()=>{if(w!==dr){if(console.warn("Error loading the image:",(null==w?void 0:w.substring(0,50))+"..."),I.current)return x(dr),void m(!0);I.current=!0,v&&ko({name:b,type:y})&&!F.current?(F.current=!0,E(!0),A(!0),P(v,y,b).then(e=>{x(e),m(!1),A(!1)}).catch(()=>{x(dr),m(!0),A(!1)}).finally(()=>E(!1))):(x(dr),m(!0))}},[w,v,y,b,P]);c(()=>{if(C===dr)return;if(console.warn("Error loading preview image:",(null==C?void 0:C.substring(0,50))+"..."),T.current)return void _(dr);T.current=!0;const e=R(t);e&&!I.current?_(e):v&&ko({name:b,type:y})?P(v,y,b).then(e=>{_(e)}).catch(()=>{_(dr)}):_(dr)},[C,t,v,y,b,P,R]);const j=c(()=>{if(C&&C!==dr&&!T.current)return C;const e=R(t);return e&&!I.current?e:cr},[C,t,R]),D=w===dr?cr:w,N=j()||cr;return e(O,{className:s,src:D,alt:n,width:l,height:u,preview:d&&{src:N,toolbarRender:()=>null,destroyOnHidden:!0,mask:e(se,{style:{fontSize:"20px"}})},onError:L,fallback:cr,loading:S?"lazy":void 0})},Io=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),To=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),Fo=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),Oo=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),Po=()=>t("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[e("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"}),e("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"}),e("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"}),e("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"})]}),Mo=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Ro=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Lo=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),jo=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),Do=()=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),No=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),zo=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),e("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"})]}),Bo=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),e("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"})]}),Uo=()=>t("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"})]}),Vo=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),Ho=t=>e(ie,Object.assign({component:Io},t)),Wo=t=>e(ie,Object.assign({component:To},t)),$o=t=>e(ie,Object.assign({component:Fo},t)),qo=t=>e(ie,Object.assign({component:Oo},t)),Go=t=>e(ie,Object.assign({component:Po},t)),Yo=t=>e(ie,Object.assign({component:Mo},t)),Xo=t=>e(ie,Object.assign({component:Ro},t)),Ko=t=>e(ie,Object.assign({component:Lo},t)),Zo=t=>e(ie,Object.assign({component:jo},t)),Jo=t=>e(ie,Object.assign({component:Do},t)),Qo=t=>e(ie,Object.assign({component:No},t)),ea=t=>e(ie,Object.assign({component:zo},t)),ta=t=>e(ie,Object.assign({component:Bo},t)),ra=t=>e(ie,Object.assign({component:Uo},t)),na=t=>e(ie,Object.assign({component:Vo},t)),ia=()=>{const{options:e}=bi(),{customIcons:t}=e,r=(e,r,n)=>{const o=null==t?void 0:t[e];return o?i.createElement(o,n):i.createElement(r,n)};return{RootFolderIcon:e=>r("rootFolder",ae,e),FolderIcon:e=>r("folder",Ko,e),FolderOpenIcon:e=>r("folderOpen",me,e),AddFolderIcon:e=>r("addFolder",ge,e),FileIcon:e=>r("file",pe,e),UploadIcon:e=>r("upload",fe,e),UploadByUrlIcon:e=>r("uploadByUrl",he,e),ExpandArrowIcon:e=>r("expandArrow",de,e),CollapseArrowIcon:e=>r("collapseArrow",ue,e),ExpandFolderIcon:e=>r("expandArrow",ei,e),CollapseFolderIcon:e=>r("collapseArrow",Qn,e),FolderPreviewIcon:e=>r("folderPreview",Zo,e),EmptyFolderIcon:e=>r("folderPreview",Jo,e),GridViewIcon:e=>r("gridView",ce,e),ListViewIcon:e=>r("listView",le,e),DropZoneFileIcon:e=>r("folderPreview",Qo,e),BigStockIcon:e=>r("folderPreview",ea,e),BigAIIcon:e=>r("folderPreview",ta,e),GifPlayIcon:e=>r("folderPreview",ra,e),StockBigIcon:e=>r("folderPreview",na,e),MixedViewIcon:e=>r("mixedView",Ho,e),LandscapeViewIcon:e=>r("landscapeView",Wo,e),PortraitViewIcon:e=>r("portraitView",$o,e),SquareViewIcon:e=>r("squareView",qo,e),LightModeIcon:e=>r("lightMode",Yo,e),DarkModeIcon:e=>r("darkMode",Xo,e),AiIcon_2:e=>r("aiIcon_2",Go,e),NoFilesIcon:e=>r("noFiles",ti,e),getCustomIcon:r}};var oa="noFilesContainer",aa="noFilesImage",sa="noFilesTitle",la="noFilesDescription";const ca=()=>{const{t:r}=Hr(),{NoFilesIcon:n}=ia();return t("div",{className:oa,children:[e(n,{className:aa,size:48,strokeWidth:1.4}),e("h2",{className:sa,children:r("There's nothing here")}),e("div",{className:la,children:r("Try using a different search query.")})]})},ua="filemanager_view_mode";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 da=e=>{if(!e||e<=0)return"";const t=1048576;if(e<t){return`${Math.round(e/1024)} Kb`}return`${(e/t).toFixed(2)} Mb`};var ha={headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",noFiles:"noFiles",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",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",noFilesIcon:"noFilesIcon",textTitle_trash:"textTitle_trash",textDescription_trash:"textDescription_trash"};const{Text:fa}=P,{Option:pa}=M,ga=({files:n,searchTerm:s,handleSearch:l,handleSort:u,sortBy:d,sortOrder:h,handleSortOptionChange:f,pagination:p,setPagination:g,loading:m,handleItemClick:v,selectedFiles:y,toggleFileSelection:b,handleDroppedFiles:w,onRename:x,onDelete:C,onCopy:_,onMove:S,onEdit:A,fileUpload:k,handleAddFile:I})=>{var T;const{t:F}=Hr(),{DropZoneFileIcon:O,BigStockIcon:P,BigAIIcon:q,FolderIcon:G}=ia(),{options:Y,actions:X,state:K}=bi(),{dataProviders:Z,config:J}=Y,Q=null==J?void 0:J.disablePagination,{setCurrentMenuFile:ee,setSelectedFiles:te,setActiveLibraryItem:re}=X,ne="Trash"===(null==K?void 0:K.selectedFolder),{viewMode:ie,setViewMode:oe}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(ua)||"table"}catch(e){return"table"}}),r=c(e=>{t(e);try{localStorage.setItem(ua,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),n=c(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[ae,se]=o({}),[le,ce]=o(null),[ue,de]=o(!1);a(()=>{const e=()=>{de(window.innerWidth<1200)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const he=y.size,fe=(null==J?void 0:J.features)||{},pe=i.useMemo(()=>Array.from(y)[0],[y]),ge=i.useMemo(()=>pe?n.find(e=>e.id===pe):void 0,[pe,n]),me=(null==ge?void 0:ge.isFolder)?!1!==(null==fe?void 0:fe.enableRenameFolder):!1!==(null==fe?void 0:fe.enableRenameFile),ve=null==J?void 0:J.iconStrokeWidth,ye=e=>{const t=e.extension?e.extension:e.name&&e.name.includes(".")?e.name.split(".").pop():e.type?(e=>{var t,r;if(e&&e.startsWith("image/"))return null===(r=null===(t=e.split("/")[1])||void 0===t?void 0:t.split(";")[0])||void 0===r?void 0:r.trim()})(e.type):void 0,r=(e=>!!e&&ur.includes(e.toLowerCase()))(t);return r},be=i.useMemo(()=>!(1!==he||!ge||ge.isFolder)&&ye(ge),[he,ge]),we=`${d}-${h}`,xe=i.useMemo(()=>Array.isArray(n)&&n.some(e=>(e=>{if(!e)return!1;const t=new Date(e);return!Number.isNaN(t.getTime())})(e.date)),[n]),Ce=c(async e=>{try{if(null==Z?void 0:Z.getChildrenCount)return await Z.getChildrenCount("folders"===e?void 0:e);if(null==Z?void 0:Z.getFiles){const{files:t,pagination:r}=await Z.getFiles({folderId:"folders"===e?void 0:e,itemType:"all"});return(null==r?void 0:r.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Error getting the number of files for the folder ${e}:`,t),0}},[Z]),_e=c(async()=>{const e=n.filter(e=>e.isFolder);if(0===e.length)return;const t={},r=e.map(async e=>{t[e.id]=await Ce(e.id)});await Promise.all(r),se(t)},[n,Ce]);a(()=>{_e()},[_e]);const Se=c((e=()=>{})=>{if(le)return;const t=setTimeout(()=>{e(),ce(null)},300);ce(t)},[le]),Ae=c(e=>{le&&(clearTimeout(le),ce(null)),e()},[le]),ke=c(t=>{const r=[];!t.isFolder&&!1!==(null==fe?void 0:fe.enableEdit)&&ye(t)&&r.push({key:"edit",label:F("Edit"),icon:e(Kn,{size:16,strokeWidth:ve})}),(t.isFolder?!1!==(null==fe?void 0:fe.enableMoveFolder):!1!==(null==fe?void 0:fe.enableMoveItem))&&r.push({key:"move",label:F("Move to"),icon:e(Jn,{size:16,strokeWidth:ve})}),(t.isFolder?!1!==(null==fe?void 0:fe.enableCopyFolder):!1!==(null==fe?void 0:fe.enableCopyItem))&&r.push({key:"copy",label:F("Copy"),icon:e(Xn,{size:16,strokeWidth:ve})});return(t.isFolder?!1!==(null==fe?void 0:fe.enableRenameFolder):!1!==(null==fe?void 0:fe.enableRenameFile))&&r.push({key:"rename",label:F("Rename"),icon:e(di,{size:16,strokeWidth:ve})}),!1!==fe.enableDelete&&r.push({key:"delete",label:F("Delete"),icon:e(hi,{size:16,strokeWidth:ve}),style:{color:"#ff4d4f"}}),r},[fe,F,ve]),Ee=e=>({key:t})=>{const r=n.find(t=>t.id===e);switch(ee&&(null==r?void 0:r.id)&&ee(null==r?void 0:r.id),t){case"edit":A(r);break;case"move":S();break;case"copy":_();break;case"rename":x(e);break;case"delete":C(r);break;default:ee&&ee("")}},Ie=[{key:"selection",width:46,render:(t,r)=>e(R,{checked:y.has(r.id),onChange:()=>b(r.id)})},{key:"preview",width:60,render:(t,r)=>r.isFolder?e("div",{className:ha.fileManagerTableFolder,children:e("div",{className:ha.fileManagerTableFolderInner,children:e(G,{className:ha.tableFolderIcon,style:{width:40,height:40}})})}):e(Eo,{className:`${ha.imagePreview} ${ha.tableImagePreview}`,thumbnailSrc:r.thumbnailUrl||r.thumbnail,previewSrc:r.url,alt:r.name,width:40,height:40,preview:!0,file:r})},{title:F("Name"),width:"calc(100% - 430px)",dataIndex:"name",key:"name",className:ha.fileNameCol,render:(e,r)=>{const n=r.isFolder&&ae[r.id]||0,i=F(1===n?"item":"items");return t("div",{className:ha.fileName,children:[e||F("No name"),r.isFolder&&t("div",{className:ha.fileItemCount,children:[n," ",i]})]})}},{title:F("Dimensions"),key:"dimensions",width:100,render:(t,r)=>r.dimensions&&e("div",{className:ha.fileSize,children:r.dimensions})},{title:F("Size"),key:"size",width:90,render:(t,r)=>!(null==r?void 0:r.size)||r.isFolder?null:e("div",{className:ha.fileSize,children:da(r.size)})},{title:F("Type"),key:"type",width:90,render:(t,r)=>{var n,i,o;if(r.isFolder)return e("div",{className:ha.fileSize,children:F("Folder")});const a=r.extension||(null===(n=r.name.split(".").pop())||void 0===n?void 0:n.toLowerCase())||(r.url?null===(o=null===(i=r.url.split("?")[0].split("/").pop())||void 0===i?void 0:i.split(".").pop())||void 0===o?void 0:o.toLowerCase():"")||"";return e("div",{className:ha.fileSize,children:a})}},...xe?[{title:F("Date"),dataIndex:"date",key:"date",width:200,render:(t,r)=>{const n=r.date;if(!n)return null;const i=new Date(n);if(isNaN(i.getTime()))return null;const o=e=>`${e.getDate()} ${[F("months.january"),F("months.february"),F("months.march"),F("months.april"),F("months.may"),F("months.june"),F("months.july"),F("months.august"),F("months.september"),F("months.october"),F("months.november"),F("months.december")][e.getMonth()]} ${e.getFullYear()}`;return e(L,{title:F("Added",{date:o(i)}),placement:"bottom",className:ha.fileDate,children:F("Added",{date:o(i)})})}}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(t,r)=>e(j,{arrow:!0,placement:"bottom",menu:{items:ke(r),onClick:Ee(r.id)},trigger:["hover"],children:e("span",{className:`${ha.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(Zn,{size:16,strokeWidth:ve})})})}],Te="table"===ie?e(E,{renderEmpty:()=>e(V,{image:e(r,{}),description:""}),children:e(U,{dataSource:n,columns:Ie,rowKey:"id",pagination:!1,loading:m,rowClassName:e=>(null==y?void 0:y.has(e.id))?ha.selectedRow:"",tableLayout:"fixed",onRow:e=>({onClick:t=>{const r=t.target;Se(()=>{t.stopPropagation(),t.preventDefault();const n=!!r.closest(".ant-image")||!!r.closest(".ant-image-preview-wrap"),i=!!r.closest(".tableMenuButton"),o=!!r.closest(".ant-dropdown-menu");n||i||o||b(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{Ae(()=>{t.stopPropagation(),t.preventDefault();const r=t.target;r.closest(".ant-checkbox-wrapper")||r.closest(".tableMenu")||(e.isFolder?v(e):r.closest(".ant-image")||r.closest(".ant-image-preview-wrap")||!Y.onEditorOk||Y.onEditorOk(e))})}}),showHeader:!1})}):e(H,{gutter:[16,16],className:ha.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:n.map(n=>e(W,{className:ha.gridCard_col,style:{padding:0},children:t($,{hoverable:!0,cover:e("div",{className:n.isFolder?ha.gridPreviewContainerFolder:ha.gridPreviewContainer,onClick:e=>{e.stopPropagation(),n.isFolder&&Se(()=>{b(n.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey})})},onDoubleClick:e=>{e.stopPropagation(),Ae(()=>{n.isFolder&&v(n)})},children:n.isFolder?e("div",{className:ha.gridFolderIcon,children:e(G,{className:ha.gridFolderIconImage})}):e(Eo,{thumbnailSrc:n.thumbnailUrl||n.thumbnail,previewSrc:n.url,alt:n.name,className:ha.gridImagePreview,preview:!0,file:n})}),className:`${ha.gridCard} ${(null==y?void 0:y.has(n.id))?ha.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||Se(()=>b(n.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},onDoubleClick:e=>{e.stopPropagation(),Ae(()=>{n.isFolder&&v(n)})},children:[t("div",{className:ha.gridCardContent,onDoubleClick:e=>{e.stopPropagation(),e.preventDefault(),Ae(()=>{n.isFolder?v(n):Y.onEditorOk&&Y.onEditorOk(n)})},onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||Se(()=>b(n.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},children:[e("div",{className:ha.gridFileName,children:n.name||F("Untitled")}),e("div",{className:ha.gridFileInfo,children:n.isFolder?(()=>{const e=ae[n.id]||0;return`${e} ${F(1===e?"item":"items")}`})():t(r,{children:[n.dimensions&&`${n.dimensions} • `,n.size&&`${da(n.size)} • `,n.extension&&`${n.extension}`]})})]}),e("div",{className:ha.gridFileMenu,children:e(j,{menu:{items:ke(n),onClick:Ee(n.id)},arrow:!0,placement:"bottom",trigger:["hover"],children:e(D,{type:"default",className:`${ha.gridFileMenuButton} gridFileMenuButton`,onClick:()=>{},children:e(Zn,{size:16,strokeWidth:ve})})},n.id)}),e("div",{onClick:e=>{e.stopPropagation()},className:ha.gridCheckbox,children:e(R,{checked:y.has(n.id),style:{height:20},onChange:e=>{e.stopPropagation(),b(n.id)}})})]})},n.id))}),Fe=null===(T=null==J?void 0:J.availableImageExtensions)||void 0===T?void 0:T.map(e=>"."+e).join(", "),Oe=t("div",ne?{className:`${ha.noFiles} ant-layout-sider-light`,children:[e(fi,{size:48,className:ha.noFilesIcon}),e("div",{className:`${ha.textTitle_trash} ant-menu-submenu-title`,children:F("Trash is empty")}),e("div",{className:`${ha.textDescription_trash} ant-menu-submenu-title`,children:F("Deleted files will be displayed here")})]}:{className:ha.uploadContainer,children:[t("div",{className:`${ha.uploadArea} `,onClick:I,children:[e("div",{className:ha.uploadIcon,children:e(O,{})}),e("div",{className:ha.textTitle,children:F("Select a file or drag and drop it here")}),e("div",{className:ha.textDescription,children:F("Supported files:")+" "+(Fe||"jpeg, .svg, .png")})]}),t("div",{className:ha.buttons,children:[t("button",{className:ha.btnPhoto,onClick:()=>{re&&re(tr)},children:[e("div",{className:ha.icon,children:e(P,{})}),t("div",{className:ha.blockText,children:[e("div",{className:ha.textTitle,children:F("Stock")}),e("div",{className:ha.textDescription,children:F("Select an image from our library")})]})]}),t("button",{className:ha.btnAi,onClick:()=>{re&&re(rr)},children:[e("div",{className:ha.icon,children:e(q,{})}),t("div",{className:ha.blockText,children:[e("div",{className:ha.textTitle,children:F("AI generation")}),e("div",{className:ha.textDescription,children:F("Creating an image on demand")})]})]})]})]});return e("div",{className:"content-layout",children:m||0!==(null==n?void 0:n.length)||s?t("div",{className:ha.tableContainer,children:[t("div",he?{className:`header-container ${ha.headerContainer}`,children:[t(fa,{type:"secondary",className:"selected-text",children:[t("div",{children:[he," ",F("selected")]}),e(L,{title:ue?F("Deselected"):null,children:e(D,{className:ha.buttonDeselected,icon:e(li,{size:16,strokeWidth:ve}),onClick:()=>te&&te(new Set),children:F("Deselected")})})]}),t(N,{children:[be&&!1!==(null==fe?void 0:fe.enableEdit)&&e(L,{title:ue?F("Edit"):null,children:e(D,{icon:e(Kn,{size:16,strokeWidth:ve}),onClick:()=>{A(ge)},disabled:!be,children:F("Edit")})}),Array.from(y).every(e=>{const t=n.find(t=>t.id===e);return!!t&&(t.isFolder?!1!==(null==fe?void 0:fe.enableMoveFolder):!1!==(null==fe?void 0:fe.enableMoveItem))})&&e(L,{title:ue?F("Move to"):null,children:e(D,{icon:e(Jn,{size:16,strokeWidth:ve}),onClick:S,children:F("Move to")})}),Array.from(y).every(e=>{const t=n.find(t=>t.id===e);return!!t&&(t.isFolder?!1!==(null==fe?void 0:fe.enableCopyFolder):!1!==(null==fe?void 0:fe.enableCopyItem))})&&e(L,{title:ue?F("Copy"):null,children:e(D,{icon:e(Xn,{size:16,strokeWidth:ve}),onClick:_,children:F("Copy")})}),1===he&&me&&e(L,{title:ue?F("Rename"):null,children:e(D,{icon:e(di,{size:16,strokeWidth:ve}),onClick:()=>x(),disabled:1!==he||!me,children:F("Rename")})}),!1!==(null==fe?void 0:fe.enableDelete)&&e(L,{title:ue?F("Delete"):null,children:e(D,{danger:!0,icon:e(hi,{size:16,strokeWidth:ve}),onClick:e=>{e.stopPropagation(),e.preventDefault(),C()},children:F("Delete")})})]})]}:{className:ha.headerContainer,children:[e("div",{className:"search-container",children:e(_o,{placeholder:F("Search file or folder"),onSearch:l,className:ha.searchInput})}),t("div",{className:ha.actionsBox,children:[e("div",{className:"sort-container",children:t(M,{value:we,onChange:f,className:ha.sortSelect,popupMatchSelectWidth:!1,suffixIcon:e(Gn,{size:16,strokeWidth:ve}),children:[e(pa,{value:"date-desc",children:F("Newest first")}),e(pa,{value:"date-asc",children:F("Oldest first")}),e(pa,{value:"size-desc",children:F("Largest first")}),e(pa,{value:"size-asc",children:F("Smallest first")}),e(pa,{value:"name-asc",children:F("A-Z")}),e(pa,{value:"name-desc",children:F("Z-A")}),e(pa,{value:"type-asc",children:F("By type")})]})}),e("div",{className:ha.actionsContainer,children:e(z,{options:[{value:"grid",icon:e(ri,{size:16,strokeWidth:ve})},{value:"table",icon:e(oi,{size:20,strokeWidth:ve})}],value:ie,onChange:e=>oe(e)})})]})]}),s&&!n.length?e(ca,{}):Te,!Q&&p.total>p.pageSize&&e("div",{className:ha.paginationContainer,children:e(B,{current:p.current,pageSize:p.pageSize,total:p.total,onChange:(e,t)=>g({current:e,pageSize:t,total:p.total}),showSizeChanger:!0,showTotal:e=>F("total pages",{total:e})})})]}):Oe})};var ma="folderTree",va="emptyFolderContainer",ya="folderItemContainer",ba="folderLabel",wa="folderLabelItem",xa="fileCount",Ca="foldersTitle",_a="foldersTitleItem",Sa="folderMenu";const Aa=({selectedFolder:r,onSelect:n,onExpand:i,generateMenuItems:s,fetchChildFolders:l,disabledFolders:u=[],showFileCounts:h=!1,folderFileCounts:f={},className:p="",expandedKeys:g,setExpandedKeys:m,showTrashFolder:v=!1,mode:y="navigation",defaultExpandAll:b=!1})=>{const{t:w}=Hr(),{options:x}=bi(),{config:C}=x,{ExpandArrowIcon:_,CollapseArrowIcon:S,CollapseFolderIcon:A,ExpandFolderIcon:k,EmptyFolderIcon:E}=ia(),I=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[T,F]=o(()=>{if(b||"selection"===y&&b){const e=s();return I(e)}return[]}),O=void 0!==g?g:T,P=void 0!==m?m:F;a(()=>{if(b||"selection"===y&&b){const e=s(),t=I(e);void 0===g&&F(t)}},[b,y,s,I,g]);const M=c(async e=>{const t=e[0];t&&"empty"!==t&&!t.endsWith("_input")&&(null==n||n(e),await(null==l?void 0:l("folders"===t?null:t)))},[n,l]),R=c(async(e,t)=>{var r;P(e),null==i||i(e,t);if(!("lazy"===(null==C?void 0:C.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==l?void 0:l(n))}catch(e){console.warn("Failed to load child folders for",n,e)}},[null==C?void 0:C.folderTreeLoading,l,i,P]),L=c(()=>{var n,i;const o=s(),a=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?a(e.children):void 0})),l=v?a(o):o,c=e=>{"selection"!==y?(O.includes(e)&&r===e?P(O.filter(t=>t!==e)):O.includes(e)||P([...O,e]),M([e])):M([e])},d=0===l.length||1===l.length&&(!l[0].children||0===l[0].children.length),p=r=>{var n;const i=h&&f[r.key]||0,o=O.includes(r.key),a=u.includes(r.key),s=(()=>{var t;return(null===(t=r.children)||void 0===t?void 0:t.length)?e(o?A:k,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}):e(E,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth})})(),l=t("div",{className:`${ya} folder-item-container`,onClick:()=>!a&&c(r.key),style:{opacity:a?.5:1,cursor:a?"not-allowed":"pointer"},children:[t("div",{className:ba,children:[r.icon||s,e("span",{className:wa,children:r.label})]}),h&&e("div",{className:xa,title:`${i} ${1===i?"file":"files"}`,children:i})]});return{key:r.key,title:l,children:null===(n=r.children)||void 0===n?void 0:n.map(p),disabled:a}},g=O.includes("folders"),m=e("div",{className:Ca,onClick:()=>c("folders"),children:t("div",{className:_a,children:[e(g?A:k,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:`${wa} folder-label-item`,children:"folders"===(null===(n=l[0])||void 0===n?void 0:n.key)?l[0].label:w("Folders")})]})}),b=()=>({key:"Trash",title:e("div",{className:Ca,onClick:()=>c("Trash"),children:t("div",{className:_a,children:[e(hi,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:wa,children:w("Trash")})]})}),children:void 0});if(d){if(!v)return[{key:"empty",title:e("div",{className:va,children:w("No folders yet")}),disabled:!0}];const t=[];return l.length>0&&"folders"===l[0].key&&t.push({key:"folders",title:m,children:[]}),t.push(b()),t}if(l.length>0&&"folders"===l[0].key){const e=[{key:"folders",title:m,children:null===(i=l[0].children)||void 0===i?void 0:i.map(p)}];return v&&e.push(b()),e}return l.map(p)},[s,O,A,null==C?void 0:C.iconStrokeWidth,k,w,r,M,h,f,E,u,v,y,P]),j=d(()=>L(),[L]);return e(q,{className:`${ma} ${Sa} ${p}`,selectedKeys:r?[r]:[],expandedKeys:O,onSelect:M,onExpand:R,treeData:j,switcherIcon:({expanded:t})=>e(t?S:_,{}),showLine:!1})},ka=({style:t={},wrap:r=!1})=>{const n=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},t);return e(N,{size:"large",style:n,wrap:r,children:e(A,{})})};var Ea={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField",closeIcon:"closeIcon",modalContentWithLoader:"modalContentWithLoader",modalLoaderOverlay:"modalLoaderOverlay"};const Ia=f(({folderId:n,activeFormField:i,EmptyFolderIcon:o,targetForm:a,handleModalOk:s,onComplete:l,t:u,setIsLoading:d})=>{const h=c(()=>{a.setFieldsValue({folderName:""})},[a]),f=c(()=>{d(!0),s(a).then(e=>l(null==e?void 0:e.id)).finally(()=>d(!1))},[s,a,l,d]);return e(T.Item,{className:"form-item form-item-moveto "+(i===n?"form-item_active":""),name:"folderName",initialValue:u("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(u("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(o,{style:{marginRight:6}}),suffix:t(r,{children:[e(L,{placement:"top",title:"Clean",children:e(D,{icon:e(ve,{style:{fontSize:10}}),className:Ea.inputButtonClose,type:"text",onClick:h})}),e(D,{className:Ea.inputButtonOk,type:"text",onClick:()=>{d(!0),f()},children:"Создать"})]})})})});Ia.displayName="CustomFolderInput";const Ta=({isModalVisible:n,handleModalOk:i,handleModalCancel:s,form:l,selectedFolder:u,folders:h,isUrlModalVisible:f,setIsUrlModalVisible:p,handleAddFileByUrl:g,urlForm:m,isRenameModalVisible:v,handleRenameOk:y,handleRenameCancel:b,renameForm:w,fileToRename:x,files:C,isMoveModalVisible:_,handleMoveOk:S,handleMoveCancel:A,moveForm:k,selectedFiles:E,isRenameFolderModalVisible:I,handleRenameFolderOk:O,handleRenameFolderCancel:P,renameFolderForm:M,folderToRename:R,isCopyModalVisible:L,handleCopyOk:j,handleCopyCancel:N,copyForm:z,isDeleteConfirmVisible:B,handleDeleteConfirmOk:U,handleDeleteConfirmCancel:V,fetchChildFolders:H})=>{var W,$,q;const{t:Y}=Hr(),{state:X,actions:K,options:Z}=bi(),{setCurrentMenuFile:J}=K,{config:Q}=Z,{currentMenuFile:ee}=X,te=T.useWatch("folderName",l),{EmptyFolderIcon:re}=ia(),[ne,ie]=o(""),[oe,ae]=o(!1),se=!te||0===String(te).trim().length,le=d(()=>Array.isArray(C)?C:[],[C]),ce=x?null===(W=le.find(e=>e.id===x))||void 0===W?void 0:W.name:"",ue=Array.isArray(h)?h:[],de=R?null===($=ue.find(e=>e.id===R))||void 0===$?void 0:$.name:"";a(()=>{if(B){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)}},[B]);const he=x?le.find(e=>e.id===x):null,fe=(null==he?void 0:he.isFolder)||(null==x?void 0:x.startsWith("folder_")),pe=c(async e=>{e.length>0&&(k.setFieldsValue({targetFolder:e[0]}),ne!==e[0].toString()&&ie(""))},[k,ne]),ge=c(async e=>{e.length>0&&(z.setFieldsValue({targetFolder:e[0]}),ne!==e[0].toString()&&ie(""))},[ne,z]),me=d(()=>Array.from(E).filter(e=>{const t=le.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||h.some(t=>t.id===e)}),[E,le,h]),ye=c((t,r)=>{const n=n=>e(Ia,{folderId:n,activeFormField:ne,EmptyFolderIcon:re,targetForm:t,handleModalOk:i,onComplete:r,setIsLoading:ae,t:Y},n);return n.displayName="CustomInputComponent",n},[re,ne,i,Y]),be=c(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),ie(t),r.setFieldsValue({folderName:Y("New folder"),targetFolder:t})},handleSelectFolder:async e=>{e.preventDefault(),e.stopPropagation(),ae(!0);try{await n([t]),await i(t)}finally{ae(!1)}}}},[Y,ae]),we=c(n=>{const{targetForm:i,onTreeSelect:o,onComplete:a,actionButtonText:s}=n,l=ye(i,a),c=(n=null,d=new Set)=>h.filter(e=>{if("Trash"===e.id)return!1;const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(d.has(n.id))return{key:n.id,label:`${n.name} ${Y("(circular reference)")}`};const h=new Set(d);h.add(n.id);const f=c(n.id,h),{handleAddFolder:p,handleSelectFolder:g}=be({folderId:n.id,targetForm:i,onTreeSelect:o,onComplete:a}),m=ne===n.id?[{key:`${n.id}_input`,label:l(n.id),icon:null},...f]:f;return{key:n.id,label:t(r,{children:[n.name,u!==n.id&&t("div",{className:`${Ea.folderToolsField} folder-tools-field`,children:[e(D,{onClick:p,children:"+"}),e(D,{onClick:g,children:s})]})]}),children:m}}),d=c();console.log("treeNodes",d);const{handleAddFolder:f,handleSelectFolder:p}=be({folderId:"folders",targetForm:i,onTreeSelect:o,onComplete:a}),g="folders"===ne?[{key:"folders_input",label:l("folders"),icon:null},...d]:d;return[{key:"folders",label:t(r,{children:[Y("Folders"),"folders"!==u&&t("div",{className:`${Ea.folderToolsField} folder-tools-field`,children:[e(D,{onClick:f,children:"+"}),e(D,{onClick:p,children:s})]})]}),children:g}]},[Y,u,ne,h,ye,be]);return t(r,{children:[e(G,{title:e("div",{className:"modal-title",children:Y("Creating a new folder")}),open:n,onOk:()=>i(),onCancel:s,okText:Y("Create"),cancelText:Y("Cancel"),okButtonProps:{disabled:se,loading:oe},cancelButtonProps:{disabled:oe},afterClose:()=>ae(!1),children:t(T,{form:l,layout:"vertical",children:[e(T.Item,{name:"folderName",label:e("div",{className:"form-label",children:Y("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(Y("Enter the name of the folder"))):Promise.resolve()}],initialValue:Y("New folder"),className:"form-item",style:{marginBottom:5},children:e(F,{autoFocus:!0,className:"form-input",disabled:oe,onPressEnter:async()=>{ae(!0);try{await l.validateFields(),se||await i()}catch(e){ae(!1)}}})}),e("div",{children:u&&"folders"!==u?t("p",{className:"fm-note",children:[Y("A folder will be created inside:")," ",(null===(q=ue.find(e=>e.id===u))||void 0===q?void 0:q.name)||Y("selected folder"),"."]}):e("p",{className:"fm-note",children:Y("The folder will be created in the root directory.")})})]})}),e(G,{title:e("div",{className:"modal-title",children:Y("Upload file by URL")}),open:f,onOk:async()=>{ae(!0);try{await m.validateFields();await g(null)||ae(!1)}catch(e){ae(!1)}},onCancel:()=>p(!1),okText:Y("Download"),okButtonProps:{loading:oe},cancelText:Y("Cancel"),cancelButtonProps:{disabled:oe},afterClose:()=>ae(!1),children:e(T,{form:m,layout:"vertical",children:e(T.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:Y("File URL")}),rules:[{required:!0,message:Y("Enter the URL of the image")}],className:"form-item",children:e(F,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:oe,onPressEnter:async()=>{ae(!0);try{await m.validateFields();await g(null)||ae(!1)}catch(e){ae(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:fe?`${Y("Rename folder")} ${ce}`:Y("Rename file",{currentFileName:ce})}),open:v,onOk:y,okText:Y("Rename"),okButtonProps:{loading:oe},onCancel:b,cancelText:Y("Cancel"),cancelButtonProps:{disabled:oe},afterClose:()=>{ae(!1),J&&J("")},children:e(T,{form:w,layout:"vertical",children:e(T.Item,{name:"newFileName",label:e("div",{className:"form-label",children:Y(fe?"New folder name":"New file name")}),rules:[{required:!0,message:Y(fe?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:oe,onPressEnter:async()=>{ae(!0);try{await w.validateFields(),y()}catch(e){ae(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:Y("Move to")}),open:_,onCancel:A,footer:t("div",{className:Ea.formFooter,children:[t(D,{className:Ea.folderButton,onClick:()=>{k.setFieldsValue({targetFolder:"folders",folderName:Y("New folder"),is_force_create:!0}),setTimeout(()=>{ae(!0),i(k).then(e=>S(null==e?void 0:e.id)).finally(()=>ae(!1))},0)},loading:oe,children:[e(ei,{size:18,strokeWidth:null==Q?void 0:Q.iconStrokeWidth}),Y("Create folder")]}),e(D,{type:"primary",className:Ea.folderButton,onClick:A,loading:oe,children:Y("Done")})]}),afterClose:()=>{J&&J(""),ie(""),ae(!1)},loading:oe,children:t("div",{className:Ea.modalContentWithLoader,children:[oe&&e("div",{className:Ea.modalLoaderOverlay,children:e(ka,{})}),e(T,{form:k,layout:"vertical",initialValues:{targetFolder:"folders",folderName:Y("New folder"),is_force_create:!1},children:t("div",{className:Ea.foldersWrapper,children:[e(T.Item,{name:"targetFolder",rules:[{required:!0,message:Y("Select the destination folder")}],className:Ea.formItem,children:e(Aa,{onSelect:pe,generateMenuItems:()=>we({targetForm:k,onTreeSelect:pe,onComplete:S,actionButtonText:Y("Move here")}),fetchChildFolders:H,disabledFolders:me,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(T.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(Y("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(T.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:e("div",{className:"modal-title",children:Y("Copy to folder")}),open:L,onCancel:N,footer:t("div",{className:Ea.formFooter,children:[t(D,{className:Ea.folderButton,onClick:()=>{z.setFieldsValue({targetFolder:"folders",folderName:Y("New folder"),is_force_create:!0}),setTimeout(()=>{ae(!0),i(z).then(e=>j(null==e?void 0:e.id)).finally(()=>ae(!1))},0)},loading:oe,children:[e(ei,{size:18,strokeWidth:null==Q?void 0:Q.iconStrokeWidth}),Y("Create folder")]}),e(D,{type:"primary",className:Ea.folderButton,onClick:N,loading:oe,children:Y("Done")})]}),afterClose:()=>{J&&J(""),ie(""),ae(!1)},loading:oe,children:t("div",{className:Ea.modalContentWithLoader,children:[oe&&e("div",{className:Ea.modalLoaderOverlay,children:e(ka,{})}),e(T,{form:z,layout:"vertical",initialValues:{targetFolder:"folders",folderName:Y("New folder"),is_force_create:!1},children:t("div",{className:Ea.foldersWrapper,children:[e(T.Item,{name:"targetFolder",rules:[{required:!0,message:Y("Select the destination folder")}],className:Ea.formItem,children:e(Aa,{onSelect:ge,generateMenuItems:()=>we({targetForm:z,onTreeSelect:ge,onComplete:j,actionButtonText:Y("Copy here")}),fetchChildFolders:H,disabledFolders:me,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(T.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(Y("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(T.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:t("div",{className:"modal-title",children:[Y("Rename folder")," ",de]}),open:I,onOk:O,onCancel:P,okText:Y("Rename"),cancelText:Y("Cancel"),okButtonProps:{loading:oe},cancelButtonProps:{disabled:oe},afterClose:()=>{ae(!1),J&&J("")},children:e(T,{form:M,layout:"vertical",children:e(T.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:Y("New folder name")}),rules:[{required:!0,message:Y("Enter a new folder name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:oe,onPressEnter:async()=>{ae(!0);try{await M.validateFields(),O()}catch(e){ae(!1)}}})})})}),e(G,{className:`${Ea.deleteModal} deleteModal`,title:(()=>{const t=!!(null==Q?void 0:Q.enableTrashFolder)&&"Trash"===u||!(null==Q?void 0:Q.enableTrashFolder),r=Y(t?"Permanently delete":"Move to Trash");return e("div",{className:"modal-title",children:r})})(),open:!!B,onOk:()=>{ae(!0);try{U&&U()}catch(e){console.error(e),ae(!1)}},onCancel:()=>V&&V(),okText:(null==Q?void 0:Q.enableTrashFolder)&&"Trash"===u?Y("Delete permanently"):(null==Q?void 0:Q.enableTrashFolder)?Y("Move to Trash"):Y("Delete"),cancelText:Y("Cancel"),okButtonProps:{danger:!(null==Q?void 0:Q.enableTrashFolder)||"Trash"===u,loading:oe},cancelButtonProps:{disabled:oe},afterClose:()=>{ae(!1),J&&J("")},closeIcon:e(ve,{className:Ea.closeIcon}),children:(()=>{var t,r;const n=(ee?[ee]:Array.from(E||[])).map(e=>le.find(t=>t.id===e)).filter(e=>!!e),i=n.filter(e=>e.isFolder||e.id.startsWith("folder_")),o=n.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),a=n.length,s=i.length,l=o.length,c=!!(null==Q?void 0:Q.enableTrashFolder);if(!c||c&&"Trash"===u){if(1===a&&1===s){const r=i[0],n=(null==r?void 0:r.name)||"",o=null!==(t=null==r?void 0:r.childCount)&&void 0!==t?t:0;return e("div",{children:Y("delete_folder_permanent",{name:n,count:o})})}return e("div",0===s&&l>0?{children:Y("delete_files_permanent",{count:l})}:{children:Y("delete_mixed_permanent",{total:a,folders:s,images:l})})}if(1===a&&1===s){const t=i[0],n=(null==t?void 0:t.name)||"",o=null!==(r=null==t?void 0:t.childCount)&&void 0!==r?r:0;return e("div",{children:Y("move_folder_to_trash",{name:n,count:o})})}return e("div",0===s&&l>0?{children:Y("move_files_to_trash",{count:l})}:{children:Y("move_mixed_to_trash",{total:a,folders:s,images:l})})})()})]})};var Fa={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const Oa=f(p(({selectedFolder:r,generateMenuItems:n,onFolderSelect:i,folders:s,fetchChildFolders:l,handleAddFile:h,setIsUrlModalVisible:f,handleCreateFolder:p,activeLibraryItem:m,setActiveLibraryItem:v},y)=>{const b=d(()=>Array.isArray(s)?s:[],[s]),{t:w}=Hr(),x=Si(),[C,_]=o({}),{options:S}=bi(),{dataProviders:A,config:k}=S,E=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[I,T]=o(()=>{if(!0===(null==k?void 0:k.expandAllFoldersOnInit)&&"lazy"!==(null==k?void 0:k.folderTreeLoading)){const e=n();return E(e)}return!0===(null==k?void 0:k.expandRootFolderOnInit)?["folders"]:[]}),F=u(!1),O=u(!1);a(()=>{if(F.current)return;"lazy"===(null==k?void 0:k.folderTreeLoading)&&!0===(null==k?void 0:k.expandRootFolderOnInit)&&(F.current=!0,(async()=>{try{await(null==l?void 0:l(null))}catch(e){console.warn("Could not load the root child folders during initialization",e)}})())},[null==k?void 0:k.folderTreeLoading,null==k?void 0:k.expandRootFolderOnInit,l]),a(()=>{!0===(null==k?void 0:k.expandRootFolderOnInit)&&Array.isArray(b)&&b.length>0&&(O.current||I&&0!==I.length||(O.current=!0,T(["folders"])))},[null==k?void 0:k.expandRootFolderOnInit,b,I]),a(()=>{if(!0===(null==k?void 0:k.expandAllFoldersOnInit)&&"lazy"!==(null==k?void 0:k.folderTreeLoading)){const e=n(),t=E(e);return void T(t)}!0===(null==k?void 0:k.expandRootFolderOnInit)&&T(e=>e&&e.length>0?[...e]:["folders"])},[b,n,E,null==k?void 0:k.expandAllFoldersOnInit,null==k?void 0:k.folderTreeLoading,null==k?void 0:k.expandRootFolderOnInit]);const P=c(async e=>{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:t,pagination:r}=await A.getFiles({folderId:"folders"===e?void 0:e,itemType:"all"});return(null==r?void 0:r.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Error getting the number of files for the folder ${e}:`,t),x.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:w("Failed to load folder items count"),placement:"bottomRight",innerException:t,data:{folderId:"folders"===e?null:e,reason:t instanceof Error?t.message:String(t)}}),0}},[A,x,w]),M=c(async()=>{if(0===b.length)return;const e={};e.folders=await P("folders");const t=b.map(async t=>{const r=await P(t.id);e[t.id]=r});await Promise.all(t),_(e)},[b,P]),R=c(async e=>{const t=await P(e);_(r=>Object.assign(Object.assign({},r),{[e]:t}))},[P]);g(y,()=>({refreshFileCounts:M}),[M]),a(()=>{M()},[M]),a(()=>{if(!r||"folders"===r)return;const e=(t,r=new Set)=>{if(r.has(t))return console.warn(`Cycle detected in the path to the folder with id=${t}`),[];const n=b.find(e=>e.id===t);if(!n)return[];if(!n.parentId)return[];const i=new Set(r);i.add(t);return[...e(n.parentId,i),n.parentId]},t=e(r);t.length>0?T(e=>{const r=new Set(e);return t.forEach(e=>r.add(e)),r.add("folders"),Array.from(r)}):T(e=>e.includes("folders")?e:[...e,"folders"])},[r,b]);const L=c(async()=>{await h(),r?await R(r):await R("folders")},[h,r,R]),j=[{key:Qt,label:w("My files"),icon:e(ni,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth})},{key:er,label:w("GIF"),icon:e(ai,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth})},{key:tr,label:w("Stock images"),icon:e(Yn,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth})},{key:rr,label:w("AI"),icon:e(ui,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth}),disabled:!(null==k?void 0:k.sseQuery)}],N=c(async e=>{const t=e[0];t&&"empty"!==t&&(m!==Qt&&v(Qt),null==i||i(t),await(null==l?void 0:l(t)))},[i,m,v,l]),z=c(({key:e})=>{v(e)},[v]),B=c(async(e,t)=>{var r;T(e);if(!("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==l?void 0:l(n))}catch(e){console.warn("Could not load the child folders for",n,e),x.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:w("Failed to load subfolders"),placement:"bottomRight",innerException:e,data:{folderId:n,reason:e instanceof Error?e.message:String(e)}})}},[null==k?void 0:k.folderTreeLoading,l,x,w]);return t("div",{className:"sidebar-container",children:[t("div",{className:Fa.buttonWrapper,children:[e(D,{type:"primary",size:"large",icon:e(si,{size:24,strokeWidth:null==k?void 0:k.iconStrokeWidth}),onClick:L,className:Fa.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r,children:e("span",{className:Fa.uploadButtonTitle,children:w("Upload file")})}),e(D,{type:"primary",size:"large",icon:e(ii,{size:24,strokeWidth:null==k?void 0:k.iconStrokeWidth}),onClick:()=>null==f?void 0:f(!0),className:Fa.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r})]}),e(Y,{className:"folder-menu",items:j,defaultSelectedKeys:[Qt],onSelect:({key:e})=>z({key:e}),selectedKeys:[m]}),e(X,{className:Fa.divider}),t("div",{className:Fa.foldersContainer,children:[e(Aa,{selectedFolder:r,onSelect:N,onExpand:B,generateMenuItems:n,fetchChildFolders:l,showFileCounts:!0,folderFileCounts:C,expandedKeys:I,setExpandedKeys:T,showTrashFolder:null==k?void 0:k.enableTrashFolder}),e("div",{className:Fa.folderActions,children:e(D,{onClick:e=>{e.stopPropagation(),p()},className:Fa.button,icon:e(ei,{size:18,strokeWidth:null==k?void 0:k.iconStrokeWidth}),size:"middle"})})]})]})}));Oa.displayName="FolderSidebar";var Pa=Object.defineProperty,Ma=(e,t,r)=>(((e,t,r)=>{t in e?Pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function Ra(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function La(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function ja(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=La(e);return t>0?Ra(Number(e)*Math.pow(10,t)):Number(e)}function Da(e){Ha&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function Na(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 za=Na(function(e,t){var r=ja(e),n=ja(t),i=La(e)+La(t),o=r*n;return Da(o),o/Math.pow(10,i)}),Ba=Na(function(e,t){var r=Math.pow(10,Math.max(La(e),La(t)));return(za(e,r)+za(t,r))/r}),Ua=Na(function(e,t){var r=Math.pow(10,Math.max(La(e),La(t)));return(za(e,r)-za(t,r))/r}),Va=Na(function(e,t){var r=ja(e),n=ja(t);return Da(r),Da(n),za(r/n,Ra(Math.pow(10,La(t)-La(e))))});var Ha=!0;var Wa={strip:Ra,plus:Ba,minus:Ua,times:za,divide:Va,round:function(e,t){var r=Math.pow(10,t),n=Va(Math.round(Math.abs(za(e,r))),r);return e<0&&0!==n&&(n=za(n,-1)),n},digitLength:La,float2Fixed:ja,enableBoundaryChecking:function(e){void 0===e&&(e=!0),Ha=e}};const $a=Object.prototype.toString;function qa(e){switch($a.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return rs(e,Error)}}function Ga(e,t){return $a.call(e)===`[object ${t}]`}function Ya(e){return Ga(e,"ErrorEvent")}function Xa(e){return Ga(e,"DOMError")}function Ka(e){return Ga(e,"String")}function Za(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ja(e){return null===e||Za(e)||"object"!=typeof e&&"function"!=typeof e}function Qa(e){return Ga(e,"Object")}function es(e){return typeof Event<"u"&&rs(e,Event)}function ts(e){return!(!e||!e.then||"function"!=typeof e.then)}function rs(e,t){try{return e instanceof t}catch{return!1}}function ns(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function is(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function os(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{ns(n)?r.push("[VueViewModel]"):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function as(e,t,r=!1){return!!Ka(e)&&(function(e){return Ga(e,"RegExp")}(t)?t.test(e):!!Ka(t)&&(r?e===t:e.includes(t)))}function ss(e,t=[],r=!1){return t.some(t=>as(e,t,r))}function ls(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&rs(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=is(e.value,t)),e))}(cs(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function cs(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(rs(n[i],Error)){us(a,s);const o=e(t,n[i]),c=l.length;ds(o,i,c,s),l=cs(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(rs(n,Error)){us(a,s);const c=e(t,n),u=l.length;ds(c,`errors[${o}]`,u,s),l=cs(e,t,r,n,i,[c,...l],c,u)}}),l}function us(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 ds(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 hs(e){return e&&e.Math==Math?e:void 0}const fs="object"==typeof globalThis&&hs(globalThis)||"object"==typeof window&&hs(window)||"object"==typeof self&&hs(self)||"object"==typeof global&&hs(global)||function(){return this}()||{};function ps(){return fs}function gs(e,t,r){const n=r||fs,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const ms=ps();function vs(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=ys(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 ys(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(ms.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&&Ka(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 bs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ws=["debug","info","warn","error","log","assert","trace"],xs={};function Cs(e){if(!("console"in fs))return e();const t=fs.console,r={},n=Object.keys(xs);n.forEach(e=>{const n=xs[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const _s=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return bs?ws.forEach(r=>{t[r]=(...t)=>{e&&Cs(()=>{fs.console[r](`Sentry Logger [${r}]:`,...t)})}}):ws.forEach(e=>{t[e]=()=>{}}),t}(),Ss=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function As(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 ks(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Es(e){const t="string"==typeof e?function(e){const t=Ss.exec(e);if(!t)return void Cs(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});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 ks({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):ks(e);if(t&&function(e){if(!bs)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(_s.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(_s.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(_s.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(_s.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}class Is 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 Ts(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&Os(i,n),e[t]=i}function Fs(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{bs&&_s.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Os(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,Fs(e,"__sentry_original__",t)}catch{}}function Ps(e){return e.__sentry_original__}function Ms(e){if(qa(e))return{message:e.message,name:e.name,stack:e.stack,...Ls(e)};if(es(e)){const t={type:e.type,target:Rs(e.target),currentTarget:Rs(e.currentTarget),...Ls(e)};return typeof CustomEvent<"u"&&rs(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Rs(e){try{return function(e){return typeof Element<"u"&&rs(e,Element)}(e)?vs(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Ls(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 js(e){return Ds(e,new Map)}function Ds(e,t){if(function(e){if(!Qa(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 r of Object.keys(e))typeof e[r]<"u"&&(n[r]=Ds(e[r],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(Ds(e,t))}),n}return e}const Ns=/\(error: (.*)\)/,zs=/captureMessage|captureException/;function Bs(...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 e=r;e<i.length;e++){const r=i[e];if(r.length>1024)continue;const o=Ns.test(r)?r.replace(Ns,"$1"):r;if(!o.match(/\S*Error: /)){for(const e of t){const t=e(o);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(),zs.test(t[t.length-1].function||"")&&(t.pop(),zs.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 Us(e){return Array.isArray(e)?Bs(...e):e}const Vs="<anonymous>";function Hs(e){try{return e&&"function"==typeof e&&e.name||Vs}catch{return Vs}}const Ws={},$s={};function qs(e,t){Ws[e]=Ws[e]||[],Ws[e].push(t)}function Gs(e,t){$s[e]||(t(),$s[e]=!0)}function Ys(e,t){const r=e&&Ws[e];if(r)for(const n of r)try{n(t)}catch(t){bs&&_s.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Hs(n)}\nError:`,t)}}function Xs(){"console"in fs&&ws.forEach(function(e){e in fs.console&&Ts(fs.console,e,function(t){return xs[e]=t,function(...t){Ys("console",{args:t,level:e});const r=xs[e];r&&r.apply(fs.console,t)}})})}function Ks(){const e=fs,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 Zs(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Js(e){const{message:t,event_id:r}=e;if(t)return t;const n=Zs(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Qs(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 el(e,t){const r=Zs(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 tl(e){if(e&&e.__sentry_captured__)return!0;try{Fs(e,"__sentry_captured__",!0)}catch{}return!1}function rl(e){return Array.isArray(e)?e:[e]}const nl=fs;let il,ol,al;function sl(){if(!nl.document)return;const e=Ys.bind(null,"dom"),t=ll(e,!0);nl.document.addEventListener("click",t,!1),nl.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=nl[t]&&nl[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ts(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=ll(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),Ts(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 ll(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;Fs(r,"_sentryCaptured",!0),n&&!n._sentryId&&Fs(n,"_sentryId",Ks());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==ol)return!1;try{if(!e.target||e.target._sentryId!==al)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),ol=r.type,al=n?n._sentryId:void 0),clearTimeout(il),il=nl.setTimeout(()=>{al=void 0,ol=void 0},1e3)}}const cl=ps();function ul(){if(!("fetch"in cl))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function dl(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function hl(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!ul())return!1;if(dl(cl.fetch))return!0;let e=!1;const t=cl.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=dl(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){bs&&_s.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&Ts(fs,"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:pl(t),method:fl(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:pl(t),method:fl(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Ys("fetch",{...i}),e.apply(fs,t).then(e=>(Ys("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Ys("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function fl(e,t){return!!e&&"object"==typeof e&&!!e[t]}function pl(e){return"string"==typeof e?e:e?fl(e,"url")?e.url:e.toString?e.toString():"":""}let gl=null;function ml(){gl=fs.onerror,fs.onerror=function(e,t,r,n,i){return Ys("error",{column:n,error:i,line:r,msg:e,url:t}),!(!gl||gl.__SENTRY_LOADER__)&&gl.apply(this,arguments)},fs.onerror.__SENTRY_INSTRUMENTED__=!0}let vl=null;function yl(){vl=fs.onunhandledrejection,fs.onunhandledrejection=function(e){return Ys("unhandledrejection",e),!(vl&&!vl.__SENTRY_LOADER__)||vl.apply(this,arguments)},fs.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const bl=ps();const wl=fs;let xl;function Cl(e){const t="history";qs(t,e),Gs(t,_l)}function _l(){if(!function(){const e=bl.chrome,t=e&&e.app&&e.app.runtime,r="history"in bl&&!!bl.history.pushState&&!!bl.history.replaceState;return!t&&r}())return;const e=wl.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=xl,t=String(r);xl=t,Ys("history",{from:e,to:t})}return e.apply(this,t)}}wl.onpopstate=function(...t){const r=wl.location.href,n=xl;if(xl=r,Ys("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},Ts(wl.history,"pushState",t),Ts(wl.history,"replaceState",t)}const Sl=fs,Al="__sentry_xhr_v3__";function kl(){if(!Sl.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Ts(e,"open",function(e){return function(...t){const r=Date.now(),n=Ka(t[0])?t[0].toUpperCase():void 0,i=function(e){if(Ka(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[Al]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[Al];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}Ys("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?Ts(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),Ts(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[Al];return i&&Ka(r)&&Ka(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),Ts(e,"send",function(e){return function(...t){const r=this[Al];if(!r)return e.apply(this,t);void 0!==t[0]&&(r.body=t[0]);return Ys("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}function El(e,t=100,r=1/0){try{return Tl("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Il(e,t=3,r=102400){const n=El(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?Il(e,t-1,r):n}function Tl(e,t,r=1/0,n=1/0,i=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[o,a]=i;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const s=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(ns(t))return"[VueViewModel]";if(function(e){return Qa(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: ${Hs(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===l)return s.replace("object ","");if(o(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return Tl("",c.toJSON(),l-1,n,i)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=Ms(t);for(const e in h){if(!Object.prototype.hasOwnProperty.call(h,e))continue;if(d>=n){u[e]="[MaxProperties ~]";break}const t=h[e];u[e]=Tl(e,t,l-1,n,i),d++}return a(t),u}var Fl;function Ol(e){return new Ml(t=>{t(e)})}function Pl(e){return new Ml((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Fl||(Fl={}));class Ml{constructor(e){Ml.prototype.__init.call(this),Ml.prototype.__init2.call(this),Ml.prototype.__init3.call(this),Ml.prototype.__init4.call(this),this._state=Fl.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Ml((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 Ml((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(Fl.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Fl.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===Fl.PENDING){if(ts(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Fl.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Fl.RESOLVED&&e[1](this._value),this._state===Fl.REJECTED&&e[2](this._value),e[0]=!0)})}}}function Rl(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 Pl(new Is("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 Ml((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{Ol(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}function Ll(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 jl=["fatal","error","warning","log","info","debug"];function Dl(e){return"warn"===e?"warning":jl.includes(e)?e:"log"}function Nl(){return Date.now()/1e3}const zl=function(){const{performance:e}=fs;if(!e||!e.now)return Nl;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function Bl(e,t=[]){return[e,t]}function Ul(e,t){const[r,n]=e;return[r,[...n,t]]}function Vl(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function Hl(e,t){return(t||new TextEncoder).encode(e)}function Wl(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Hl(i,t),e]:i.push("string"==typeof e?Hl(e,t):e)}for(const e of n){const[t,r]=e;if(o(`\n${JSON.stringify(t)}\n`),"string"==typeof r||r instanceof Uint8Array)o(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(El(r))}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 t of e)r.set(t,n),n+=t.length;return r}(i)}function $l(e,t){const r="string"==typeof e.data?Hl(e.data,t):e.data;return[js({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=fs;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 ql={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 Gl(e){return ql[e]}function Yl(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function Xl(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 e of o.trim().split(",")){const[t,r,,,o]=e.split(":",5),a=parseInt(t,10),s=1e3*(isNaN(a)?60:a);if(r)for(const e of r.split(";"))"metric_bucket"===e?(!o||o.split(";").includes("custom"))&&(i[e]=n+s):i[e]=n+s;else i.all=n+s}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}const Kl=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Zl="production";function Jl(){return gs("globalEventProcessors",()=>[])}function Ql(e){Jl().push(e)}function ec(e,t,r,n=0){return new Ml((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);Kl&&a.id&&null===s&&_s.log(`Event processor "${a.id}" dropped event`),ts(s)?s.then(t=>ec(e,t,r,n+1).then(i)).then(null,o):ec(e,s,r,n+1).then(i).then(null,o)}})}function tc(e){const t=zl(),r={sid:Ks(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return js({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&&rc(r,e),r}function rc(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||zl(),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:Ks()),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 nc(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),rc(e,r)}function ic(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=oc(e);return js({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function oc(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function ac(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||Ks(),timestamp:t.timestamp||Nl()},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:Zl),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=is(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=is(a.value,o));const s=e.request;s&&s.url&&(s.url=is(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=fs._sentryDebugIds;if(!r)return;let n;const i=sc.get(t);i?n=i:(n=new Map,sc.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 _c;return r.update(t),r}(n,r.captureContext);r.mechanism&&el(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(Cc||(Cc=new _c),Cc).getScopeData();if(o){wc(h,o.getScopeData())}if(u){wc(h,u.getScopeData())}const f=[...r.attachments||[],...h.attachments];f.length&&(r.attachments=f),bc(l,h);return ec([...d,...Jl(),...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:El(e.data,t,r)}}))},...e.user&&{user:El(e.user,t,r)},...e.contexts&&{contexts:El(e.contexts,t,r)},...e.extra&&{extra:El(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=El(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=oc(e).data;return n&&(e.data=El(n,t,r)),e})),n}(e,a,s):e))}const sc=new WeakMap;function lc(e,t){return Oc().captureEvent(e,t)}function cc(e,t){Oc().addBreadcrumb(e,t)}function uc(){return Oc().getClient()}function dc(){return Oc().getScope()}function hc(e){const t=uc(),r=Pc(),n=dc(),{release:i,environment:o=Zl}=t&&t.getOptions()||{},{userAgent:a}=fs.navigator||{},s=tc({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&rc(l,{status:"exited"}),fc(),r.setSession(s),n.setSession(s),s}function fc(){const e=Pc(),t=dc(),r=t.getSession()||e.getSession();r&&nc(r),pc(),e.setSession(),t.setSession()}function pc(){const e=Pc(),t=dc(),r=uc(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function gc(e=!1){e?fc():pc()}function mc(e){return e.transaction}function vc(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=js({environment:n.environment||Zl,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function yc(e){const t=uc();if(!t)return{};const r=vc(oc(e).trace_id||"",t,dc()),n=mc(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=oc(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 bc(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=js(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=js(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=js(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=js(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:ic(t),...e.contexts};const r=mc(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:yc(t),...e.sdkProcessingMetadata};const n=oc(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?rl(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 wc(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;xc(e,"extra",r),xc(e,"tags",n),xc(e,"user",i),xc(e,"contexts",o),xc(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 xc(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 Cc;class _c{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Sc()}static clone(e){return e?e.clone():new _c}clone(){const e=new _c;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&&rc(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 _c){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(Qa(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=Sc(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:Nl(),...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=[]){bc(e,this.getScopeData());return ec([...r,...Jl(),...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:Ks();if(!this._client)return _s.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:Ks();if(!this._client)return _s.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:Ks();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(_s.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 Sc(){return{traceId:Ks(),spanId:Ks().substring(16)}}const Ac="7.116.0",kc=parseFloat(Ac),Ec=100;class Ic{constructor(e,t,r,n=kc){let i,o;this._version=n,t?i=t:(i=new _c,i.setClient(e)),r?o=r:(o=new _c,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 ts(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:Ks(),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:Ks(),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:Ks();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=Ec}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:Nl(),...e},s=i?Cs(()=>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=Fc(this);try{e(this)}finally{Fc(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Kl&&_s.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return Kl&&!r&&(this.getClient()?_s.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):_s.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&&nc(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Zl}=r&&r.getOptions()||{},{userAgent:o}=fs.navigator||{},a=tc({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&rc(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=Tc().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Kl&&_s.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Tc(){return fs.__SENTRY__=fs.__SENTRY__||{extensions:{},hub:void 0},fs}function Fc(e){const t=Tc(),r=Mc(t);return Rc(t,e),r}function Oc(){const e=Tc();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Tc()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||Mc(e).isOlderThan(kc))&&Rc(e,new Ic),Mc(e)}(e)}function Pc(){return Oc().getIsolationScope()}function Mc(e){return gs("hub",()=>new Ic,e)}function Rc(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function Lc(e,t,r,n){const i=Yl(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:As(n)},...i&&{trace:js({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,Bl(a,[[{type:o},e]])}function jc(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}`}})}const Dc=[];function Nc(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?rl(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 zc(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function Bc(e,t,r){if(r[t.name])Kl&&_s.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===Dc.indexOf(t.name)&&(t.setupOnce(Ql,Oc),Dc.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)}Kl&&_s.log(`Integration installed: ${t.name}`)}}function Uc(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}function Vc(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=As(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 Bl(i,[o])}const Hc="Not capturing exception because it's already been captured.";class Wc{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Es(e.dsn):Kl&&_s.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)}?${jc(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(tl(e))return void(Kl&&_s.log(Hc));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=Za(e)?e:String(e),a=Ja(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&&tl(t.originalException))return void(Kl&&_s.log(Hc));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?Kl&&_s.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),rc(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))):Ol(!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 Kl&&_s.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Bc(this,e,this._integrations),t||zc(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=Lc(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=Ul(r,$l(e,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=Yl(r);return Bl({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:As(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}`;Kl&&_s.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){Kl&&_s.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=Vc(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&&Bc(e,t,r)}),r}(this,e),zc(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)&&(rc(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Ml(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=Pc()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),ac(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||vc(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(Kl){const t=e;"log"===t.logLevel?_s.log(t.message):_s.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=qc(e),a=$c(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),Pl(new Is(`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 Is("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 $c(t)&&n?n(t,r):qc(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(ts(e))return e.then(e=>{if(!Qa(e)&&null!==e)throw new Is(r);return e},e=>{throw new Is(`${t} rejected with ${e}`)});if(!Qa(e)&&null!==e)throw new Is(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new Is(`${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 Is?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Is(`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=>{Kl&&_s.error("Error while sending event:",e)});Kl&&_s.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 $c(e){return void 0===e.type}function qc(e){return"transaction"===e.type}function Gc(e,t){!0===t.debug&&(Kl?_s.enable():Cs(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),dc().update(t.initialScope);const r=new e(t);(function(e){const t=Oc().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)}function Yc(e,t,r=Rl(e.bufferSize||30)){let n={};function i(i){const o=[];if(Vl(i,(t,r)=>{const i=Gl(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=Xc(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return Ol();const a=Bl(i[0],o),s=t=>{Vl(a,(r,n)=>{const i=Xc(r,n);e.recordDroppedEvent(t,Gl(n),i)})};return r.add(()=>t({body:Wl(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Kl&&_s.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=Xl(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof Is)return Kl&&_s.error("Skipped sending event because buffer is full."),s("queue_overflow"),Ol();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function Xc(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function Kc(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:Ac})),version:Ac}),e._metadata=i}const Zc=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Jc=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Qc="InboundFilters",eu=(e={})=>({name:Qc,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?[]:Zc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Jc],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)?(Kl&&_s.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Js(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}`)),Kl&&0===t.length&&_s.error(`Could not extract message for event ${Js(e)}`),t}(e).some(e=>ss(e,t))}(e,t.ignoreErrors)?(Kl&&_s.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Js(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&ss(r,t)}(e,t.ignoreTransactions)?(Kl&&_s.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Js(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=tu(e);return!!r&&ss(r,t)}(e,t.denyUrls)?(Kl&&_s.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Js(e)}.\nUrl: ${tu(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=tu(e);return!r||ss(r,t)}(e,t.allowUrls)&&(Kl&&_s.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Js(e)}.\nUrl: ${tu(e)}`),!0)}(t,o)?null:t}});function tu(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 Kl&&_s.error(`Cannot extract url for event ${Js(e)}`),null}}let ru;Uc(Qc,eu);const nu="FunctionToString",iu=new WeakMap,ou=()=>({name:nu,setupOnce(){ru=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ps(this),r=iu.has(uc())&&void 0!==t?t:this;return ru.apply(r,e)}}catch{}},setup(e){iu.set(e,!0)}});Uc(nu,ou);const au=fs;let su=0;function lu(){return su>0}function cu(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(Ps(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=>cu(e,t));return e.apply(this,i)}catch(e){throw su++,setTimeout(()=>{su--}),function(...e){const t=Oc();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])}(r=>{r.addEventProcessor(e=>(t.mechanism&&(Qs(e,void 0),el(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){Oc().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}Os(n,e),Fs(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const uu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function du(e,t){const r=fu(e,t),n={type:t&&t.name,value:gu(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function hu(e,t){return{exception:{values:[du(e,t)]}}}function fu(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(pu.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const pu=/Minified React error #\d+;/i;function gu(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function mu(e,t,r,n,i){let o;if(Ya(t)&&t.error)return hu(e,t.error);if(Xa(t)||function(e){return Ga(e,"DOMException")}(t)){const i=t;if("stack"in t)o=hu(e,t);else{const t=i.name||(Xa(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=vu(e,a,r,n),Qs(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return qa(t)?hu(e,t):Qa(t)||es(t)?(o=function(e,t,r,n){const i=uc(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:es(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:yu(t,{isUnhandledRejection:n})}]},extra:{__serialized__:Il(t,o)}};if(r){const t=fu(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),el(o,{synthetic:!0}),o):(o=vu(e,t,r,n),Qs(o,`${t}`),el(o,{synthetic:!0}),o)}function vu(e,t,r,n){const i={};if(n&&r){const n=fu(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(Za(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 yu(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(Ms(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return is(r[0],t);for(let e=r.length;e>0;e--){const n=r.slice(0,e).join(", ");if(!(n.length>t))return e===r.length?n:is(n,t)}return""}(e),n=t?"promise rejection":"exception";return Ya(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:es(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 bu extends Wc{constructor(e){Kc(e,"browser",["browser"],au.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&au.document&&au.document.addEventListener("visibilitychange",()=>{"hidden"===au.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=mu(e,t,r&&r.syntheticException||void 0,n);return el(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),Ol(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=vu(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Ol(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(uu&&_s.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:As(n)}},o=function(e){return[{type:"user_report"},e]}(e);return Bl(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(uu&&_s.log("No outcomes to send"));if(!this._dsn)return void(uu&&_s.log("No dsn provided, will not send outcomes"));uu&&_s.log("Sending outcomes:",e);const t=function(e,t){return Bl(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:Nl(),discarded_events:e}]])}(e,this._options.tunnel&&As(this._dsn));this._sendEnvelope(t)}}let wu;function xu(e,t=function(){if(wu)return wu;if(dl(au.fetch))return wu=au.fetch.bind(au);const e=au.document;let t=au.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){uu&&_s.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return wu=t.bind(au)}()){let r=0,n=0;return Yc(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 wu=void 0,r-=o,n--,Pl(e)}})}function Cu(e){return Yc(e,function(t){return new Ml((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 _u="?";function Su(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 Au=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ku=/\((\S*)(?::(\d+))(?::(\d+))\)/,Eu=[30,e=>{const t=Au.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=ku.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=Ru(t[1]||_u,t[2]);return Su(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Iu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fu=[50,e=>{const t=Iu.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Tu.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]||_u;return[r,e]=Ru(r,e),Su(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Ou=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Pu=[40,e=>{const t=Ou.exec(e);return t?Su(t[2],t[1]||_u,+t[3],t[4]?+t[4]:void 0):void 0}],Mu=Bs(...[Eu,Fu,Pu]),Ru=(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]:_u,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Lu=1024,ju="Breadcrumbs",Du=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:ju,setupOnce(){},setup(e){t.console&&function(e){const t="console";qs(t,e),Gs(t,Xs)}(function(e){return function(t){if(uc()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:Dl(t.level),message:os(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${os(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}cc(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){qs("dom",e),Gs("dom",sl)}(function(e,t){return function(r){if(uc()!==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>Lu&&(uu&&_s.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=Lu),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=vs(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!ms.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){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}),cc(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){qs("xhr",e),Gs("xhr",kl)}(function(e){return function(t){if(uc()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[Al];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;cc({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";qs(t,e),Gs(t,hl)}(function(e){return function(t){if(uc()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){cc({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n})}else{const e=t.response;cc({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&Cl(function(e){return function(t){if(uc()!==e)return;let r=t.from,n=t.to;const i=Ll(au.location.href);let o=r?Ll(r):void 0;const a=Ll(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),cc({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){uc()===e&&cc({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Js(t)},{event:t})}}(e))}}};Uc(ju,Du);const Nu="Dedupe",zu=()=>{let e;return{name:Nu,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||!Uu(e,t)||!Bu(e,t))}(e,t)&&!function(e,t){const r=Vu(t),n=Vu(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&Uu(e,t)&&Bu(e,t))}(e,t))}(t,e))return uu&&_s.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function Bu(e,t){let r=Hu(e),n=Hu(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=r[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Uu(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 Vu(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Hu(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}Uc(Nu,zu);const Wu="GlobalHandlers",$u=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Wu,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";qs(t,e),Gs(t,ml)}(t=>{const{stackParser:r,attachStacktrace:n}=Yu();if(uc()!==e||lu())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&Ka(i)?function(e,t,r,n){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Ya(e)?e.message:e,a="Error";const s=o.match(i);return s&&(a=s[1],o=s[2]),qu({exception:{values:[{type:a,value:o}]}},t,r,n)}(i,o,a,s):qu(mu(r,l||i,void 0,n,!1),o,a,s);c.level="error",lc(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Gu("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";qs(t,e),Gs(t,yl)}(t=>{const{stackParser:r,attachStacktrace:n}=Yu();if(uc()!==e||lu())return;const i=function(e){if(Ja(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=Ja(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):mu(r,i,void 0,n,!0);o.level="error",lc(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Gu("onunhandledrejection"))}}};function qu(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=Ka(t)&&t.length>0?t:function(){try{return ms.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Gu(e){uu&&_s.log(`Global Handler attached: ${e}`)}function Yu(){const e=uc();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}Uc(Wu,$u);const Xu="HttpContext",Ku=()=>({name:Xu,setupOnce(){},preprocessEvent(e){if(!au.navigator&&!au.location&&!au.document)return;const t=e.request&&e.request.url||au.location&&au.location.href,{referrer:r}=au.document||{},{userAgent:n}=au.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}});Uc(Xu,Ku);const Zu="LinkedErrors",Ju=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:Zu,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();ls(du,o.stackParser,o.maxValueLength,r,t,e,n)}}};Uc(Zu,Ju);const Qu=["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"],ed="TryCatch",td=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:ed,setupOnce(){t.setTimeout&&Ts(au,"setTimeout",rd),t.setInterval&&Ts(au,"setInterval",rd),t.requestAnimationFrame&&Ts(au,"requestAnimationFrame",nd),t.XMLHttpRequest&&"XMLHttpRequest"in au&&Ts(XMLHttpRequest.prototype,"send",id);const e=t.eventTarget;e&&(Array.isArray(e)?e:Qu).forEach(od)}}};function rd(e){return function(...t){const r=t[0];return t[0]=cu(r,{mechanism:{data:{function:Hs(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function nd(e){return function(t){return e.apply(this,[cu(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Hs(e)},handled:!1,type:"instrument"}})])}}function id(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&Ts(r,e,function(t){const r={mechanism:{data:{function:e,handler:Hs(t)},handled:!1,type:"instrument"}},n=Ps(t);return n&&(r.mechanism.data.handler=Hs(n)),cu(t,r)})}),e.apply(this,t)}}function od(e){const t=au,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ts(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=cu(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Hs(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,cu(n,{mechanism:{data:{function:"addEventListener",handler:Hs(n),target:e},handled:!1,type:"instrument"}}),i])}}),Ts(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)}}))}Uc(ed,td);const ad=[eu(),ou(),td(),Du(),$u(),Ju(),zu(),Ku()];function sd(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...ad]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),au.SENTRY_RELEASE&&au.SENTRY_RELEASE.id&&(e.release=au.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Us(e.stackParser||Mu),integrations:Nc(e),transport:e.transport||(ul()?xu:Cu)};Gc(bu,t),e.autoSessionTracking&&function(){if(typeof au.document>"u")return void(uu&&_s.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));hc({ignoreDuration:!0}),gc(),Cl(({from:e,to:t})=>{void 0!==e&&e!==t&&(hc({ignoreDuration:!0}),gc())})}()}var ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ud(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}var dd=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(dd||{}),hd=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(hd||{});function fd(e,t){return{...t,message:e}}const pd=[{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}],gd={emoticons:fd("Emoticons"),doodles:fd("Doodles"),landmarks:fd("Landmarks"),bubbles:fd("Bubbles"),transportation:fd("Transportation"),beach:fd("Beach")},md={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},vd=[1,8,15,20,25];var yd=(e=>(e.DARK="dark",e.LIGHT="light",e))(yd||{});const bd=[{name:yd.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:yd.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 wd=(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))(wd||{});function xd(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=xd(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Cd(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=xd(e))&&(n&&(n+=" "),n+=t);return n}const _d=p((r,n)=>{const{attr:i,size:o,title:a,className:s,color:l,style:c,children:u,viewBox:d,width:h,height:f,...p}=r;return t("svg",{"aria-hidden":!a,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:d||"0 0 24 24",...i,...p,className:Cd("svg-icon",s,Sd(o)),style:{color:l,...c},ref:n,height:f||"1em",width:h||"1em",children:[a&&e("title",{children:a}),u]})});function Sd(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 Ad(t,r="",n){return i.memo(i.forwardRef((i,o)=>e(_d,{"data-testid":`${r}Icon`,ref:o,viewBox:n,...i,size:i.size||"md",children:t})))}function kd(e,t=""){return Ad(Ed(e),t)}function Ed(e){return(null==e?void 0:e.map)&&e.map((e,t)=>i.createElement(e.tag,{key:t,...e.attr},Ed(e.child)))}const Id=Ad(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),Td=Ad(e("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"),Fd=Ad(e("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),Od=Ad(e("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),Pd=Ad(e("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"),Md=Ad(e("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"),Rd=Ad(e("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"),Ld=Ad(e("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"),jd=Ad(e("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"),Dd=Ad(e("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"),Nd=Ad(e("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"),zd=Ad([e("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"),e("circle",{cx:"11",cy:"9",r:"1"},"1"),e("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),Bd=Ad(e("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"),Ud=Ad(e("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"),Vd=Ad(e("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),Hd={[wd.FILTER]:{name:fd("Applied Filters"),icon:Id},[wd.RESIZE]:{name:fd("Resized Image"),icon:Td},[wd.CROP]:{name:fd("Cropped Image"),icon:Fd},[wd.DRAW]:{name:fd("Added Drawing"),icon:Ud},[wd.TEXT]:{name:fd("Added Text"),icon:Od},[wd.SHAPES]:{name:fd("Added Shape"),icon:Pd},[wd.STICKERS]:{name:fd("Added Sticker"),icon:Md},[wd.FRAME]:{name:fd("Added Frame"),icon:Rd},[wd.MERGE]:{name:fd("Merged Objects"),icon:Ld},[wd.CORNERS]:{name:fd("Rounded Corner"),icon:jd},bgImage:{name:fd("Replaced Background Image"),icon:Dd},overlayImage:{name:fd("Added Image"),icon:Dd},initial:{name:fd("Initial"),icon:Vd},loadedState:{name:fd("Loaded State"),icon:Nd},objectStyle:{name:fd("Changed Style"),icon:zd},deletedObject:{name:fd("Deleted object"),icon:Bd}},Wd=Object.values(wd).map(e=>({name:e,icon:Hd[e].icon,action:e===wd.MERGE?e=>{e.tools.merge.apply()}:e})),$d={filter:fd("filter"),resize:fd("resize"),crop:fd("crop"),draw:fd("draw"),text:fd("text"),shapes:fd("shapes"),stickers:fd("stickers"),frame:fd("frame"),corners:fd("corners"),merge:fd("merge")},qd=Ad(e("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"),Gd="3.0.5",Yd={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:dd.INLINE,forceOverlayModeOnMobile:!0,activeTheme:yd.LIGHT,themes:bd,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:Nd,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:qd,label:fd("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:hd.BOTTOM,items:[...Wd]},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:{...md},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:vd,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:pd},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}}]}}},Xd=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 Kd={exports:{}},Zd={},Jd={exports:{}},Qd={},eh=i;
|
|
9
|
+
*/var vi=(pi||(pi=1,function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,h=4294967295,f=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",l]],p="[object Arguments]",g="[object Array]",m="[object Boolean]",v="[object Date]",y="[object Error]",b="[object Function]",w="[object GeneratorFunction]",x="[object Map]",C="[object Number]",_="[object Object]",S="[object Promise]",A="[object RegExp]",k="[object Set]",E="[object String]",I="[object Symbol]",T="[object WeakMap]",F="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",j="[object Int32Array]",D="[object Uint8Array]",N="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,q=RegExp(W.source),G=RegExp($.source),Y=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ee=/[\\^$.*+?()[\]{}|]/g,te=RegExp(ee.source),re=/^\s+/,ne=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,le=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,ue=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,pe=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,me=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ye=/($^)/,be=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",ke="\\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",Ee="['’]",Ie="["+we+"]",Te="["+ke+"]",Fe="["+xe+"]",Oe="\\d+",Pe="["+Ce+"]",Me="["+_e+"]",Re="[^"+we+ke+Oe+Ce+_e+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",je="[^"+we+"]",De="(?:\\ud83c[\\udde6-\\uddff]){2}",Ne="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ue="(?:"+Me+"|"+Re+")",Ve="(?:"+ze+"|"+Re+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",$e="(?:"+Fe+"|"+Le+")?",qe="["+Ae+"]?",Ge=qe+$e+"(?:"+Be+"(?:"+[je,De,Ne].join("|")+")"+qe+$e+")*",Ye="(?:"+[Pe,De,Ne].join("|")+")"+Ge,Xe="(?:"+[je+Fe+"?",Fe,De,Ne,Ie].join("|")+")",Ke=RegExp(Ee,"g"),Ze=RegExp(Fe,"g"),Je=RegExp(Le+"(?="+Le+")|"+Xe+Ge,"g"),Qe=RegExp([ze+"?"+Me+"+"+He+"(?="+[Te,ze,"$"].join("|")+")",Ve+"+"+We+"(?="+[Te,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+He,ze+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Oe,Ye].join("|"),"g"),et=RegExp("["+Be+we+xe+Ae+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["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"],nt=-1,it={};it[P]=it[M]=it[R]=it[L]=it[j]=it[D]=it[N]=it[z]=it[B]=!0,it[p]=it[g]=it[F]=it[m]=it[O]=it[v]=it[y]=it[b]=it[x]=it[C]=it[_]=it[A]=it[k]=it[E]=it[T]=!1;var ot={};ot[p]=ot[g]=ot[F]=ot[O]=ot[m]=ot[v]=ot[P]=ot[M]=ot[R]=ot[L]=ot[j]=ot[x]=ot[C]=ot[_]=ot[A]=ot[k]=ot[E]=ot[I]=ot[D]=ot[N]=ot[z]=ot[B]=!0,ot[y]=ot[b]=ot[T]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Er&&Er&&Er.Object===Object&&Er,ut="object"==typeof self&&self&&self.Object===Object&&self,dt=ct||ut||Function("return this")(),ht=t&&!t.nodeType&&t,ft=ht&&e&&!e.nodeType&&e,pt=ft&&ft.exports===ht,gt=pt&&ct.process,mt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||gt&>.binding&>.binding("util")}catch(e){}}(),vt=mt&&mt.isArrayBuffer,yt=mt&&mt.isDate,bt=mt&&mt.isMap,wt=mt&&mt.isRegExp,xt=mt&&mt.isSet,Ct=mt&&mt.isTypedArray;function _t(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 St(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 At(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Et(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 It(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 Tt(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Ft(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 Ot(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 Pt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Mt(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 Rt(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 Lt(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 jt=Ht("length");function Dt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Nt(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 zt(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):Nt(e,Ut,r)}function Bt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function Ut(e){return e!=e}function Vt(e,t){var r=null==e?0:e.length;return r?qt(e,t)/r:d}function Ht(e){return function(t){return null==t?r:t[e]}}function Wt(e){return function(t){return null==e?r:e[t]}}function $t(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function qt(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 Gt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,dr(e)+1).replace(re,""):e}function Xt(e){return function(t){return e(t)}}function Kt(e,t){return Ot(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var r=-1,n=e.length;++r<n&&zt(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&zt(t,e[r],0)>-1;);return r}var er=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function or(e,t){return function(r){return e(t(r))}}function ar(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 sr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}function cr(e){return nr(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):jt(e)}function ur(e){return nr(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dr(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var hr=Wt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),fr=function e(t){var ne,we=(t=null==t?dt:fr.defaults(dt.Object(),t,fr.pick(dt,rt))).Array,xe=t.Date,Ce=t.Error,_e=t.Function,Se=t.Math,Ae=t.Object,ke=t.RegExp,Ee=t.String,Ie=t.TypeError,Te=we.prototype,Fe=_e.prototype,Oe=Ae.prototype,Pe=t["__core-js_shared__"],Me=Fe.toString,Re=Oe.hasOwnProperty,Le=0,je=(ne=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",De=Oe.toString,Ne=Me.call(Ae),ze=dt._,Be=ke("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=pt?t.Buffer:r,Ve=t.Symbol,He=t.Uint8Array,We=Ue?Ue.allocUnsafe:r,$e=or(Ae.getPrototypeOf,Ae),qe=Ae.create,Ge=Oe.propertyIsEnumerable,Ye=Te.splice,Xe=Ve?Ve.isConcatSpreadable:r,Je=Ve?Ve.iterator:r,et=Ve?Ve.toStringTag:r,at=function(){try{var e=uo(Ae,"defineProperty");return e({},"",{}),e}catch(e){}}(),ct=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=xe&&xe.now!==dt.Date.now&&xe.now,ht=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=Se.ceil,gt=Se.floor,mt=Ae.getOwnPropertySymbols,jt=Ue?Ue.isBuffer:r,Wt=t.isFinite,pr=Te.join,gr=or(Ae.keys,Ae),mr=Se.max,vr=Se.min,yr=xe.now,br=t.parseInt,wr=Se.random,xr=Te.reverse,Cr=uo(t,"DataView"),_r=uo(t,"Map"),Sr=uo(t,"Promise"),Ar=uo(t,"Set"),kr=uo(t,"WeakMap"),Er=uo(Ae,"create"),Ir=kr&&new kr,Tr={},Fr=Do(Cr),Or=Do(_r),Pr=Do(Sr),Mr=Do(Ar),Rr=Do(kr),Lr=Ve?Ve.prototype:r,jr=Lr?Lr.valueOf:r,Dr=Lr?Lr.toString:r;function Nr(e){if(es(e)&&!Ha(e)&&!(e instanceof Vr)){if(e instanceof Ur)return e;if(Re.call(e,"__wrapped__"))return No(e)}return new Ur(e)}var zr=function(){function e(){}return function(t){if(!Qa(t))return{};if(qe)return qe(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Br(){}function Ur(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Vr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}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.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $r(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 qr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new $r;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new Wr(e);this.size=t.size}function Yr(e,t){var r=Ha(e),n=!r&&Va(e),i=!r&&!n&&Ga(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?Gt(e.length,Ee):[],l=s.length;for(var c in e)!t&&!Re.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yo(c,l))||s.push(c);return s}function Xr(e){var t=e.length;return t?e[Gn(0,t-1)]:r}function Kr(e,t){return Ro(Ii(e),an(t,0,e.length))}function Zr(e){return Ro(Ii(e))}function Jr(e,t,n){(n!==r&&!za(e[t],n)||n===r&&!(t in e))&&nn(e,t,n)}function Qr(e,t,n){var i=e[t];Re.call(e,t)&&za(i,n)&&(n!==r||t in e)||nn(e,t,n)}function en(e,t){for(var r=e.length;r--;)if(za(e[r][0],t))return r;return-1}function tn(e,t,r,n){return dn(e,function(e,i,o){t(n,e,r(e),o)}),n}function rn(e,t){return e&&Ti(t,Fs(t),e)}function nn(e,t,r){"__proto__"==t&&at?at(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function on(e,t){for(var n=-1,i=t.length,o=we(i),a=null==e;++n<i;)o[n]=a?r:As(e,t[n]);return o}function an(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function sn(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(!Qa(e))return e;var d=Ha(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Re.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Ii(e,s)}else{var h=po(e),f=h==b||h==w;if(Ga(e))return Ci(e,l);if(h==_||h==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Ti(e,fo(e),t)}(e,function(e,t){return e&&Ti(t,Os(t),e)}(s,e)):function(e,t){return Ti(e,ho(e),t)}(e,rn(s,e))}else{if(!ot[h])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case F:return _i(e);case m:case v:return new i(+e);case O:return function(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case P:case M:case R:case L:case j:case D:case N:case z:case B:return Si(e,r);case x:return new i;case C:case E:return new i(e);case A:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case k:return new i;case I:return n=e,jr?Ae(jr.call(n)):{}}}(e,h,l)}}a||(a=new Gr);var g=a.get(e);if(g)return g;a.set(e,s),os(e)?e.forEach(function(r){s.add(sn(r,t,n,r,e,a))}):ts(e)&&e.forEach(function(r,i){s.set(i,sn(r,t,n,i,e,a))});var y=d?r:(u?c?no:ro:c?Os:Fs)(e);return At(y||e,function(r,i){y&&(r=e[i=r]),Qr(s,i,sn(r,t,n,i,e,a))}),s}function ln(e,t,n){var i=n.length;if(null==e)return!i;for(e=Ae(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 cn(e,t,i){if("function"!=typeof e)throw new Ie(n);return Fo(function(){e.apply(r,i)},t)}function un(e,t,r,n){var i=-1,o=Tt,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=Ot(t,Xt(r))),n?(o=Ft,a=!1):t.length>=200&&(o=Zt,a=!1,t=new qr(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}Nr.templateSettings={escape:Y,evaluate:X,interpolate:K,variable:"",imports:{_:Nr}},Nr.prototype=Br.prototype,Nr.prototype.constructor=Nr,Ur.prototype=zr(Br.prototype),Ur.prototype.constructor=Ur,Vr.prototype=zr(Br.prototype),Vr.prototype.constructor=Vr,Hr.prototype.clear=function(){this.__data__=Er?Er(null):{},this.size=0},Hr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hr.prototype.get=function(e){var t=this.__data__;if(Er){var n=t[e];return n===i?r:n}return Re.call(t,e)?t[e]:r},Hr.prototype.has=function(e){var t=this.__data__;return Er?t[e]!==r:Re.call(t,e)},Hr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Er&&t===r?i:t,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=en(t,e);return!(r<0||(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,0))},Wr.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},Wr.prototype.has=function(e){return en(this.__data__,e)>-1},Wr.prototype.set=function(e,t){var r=this.__data__,n=en(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(_r||Wr),string:new Hr}},$r.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return lo(this,e).get(e)},$r.prototype.has=function(e){return lo(this,e).has(e)},$r.prototype.set=function(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},qr.prototype.add=qr.prototype.push=function(e){return this.__data__.set(e,i),this},qr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var dn=Pi(bn),hn=Pi(wn,!0);function fn(e,t){var r=!0;return dn(e,function(e,n,i){return r=!!t(e,n,i)}),r}function pn(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&&!ss(s):n(s,l)))var l=s,c=a}return c}function gn(e,t){var r=[];return dn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function mn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=vo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?mn(s,t-1,r,n,i):Pt(i,s):n||(i[i.length]=s)}return i}var vn=Mi(),yn=Mi(!0);function bn(e,t){return e&&vn(e,t,Fs)}function wn(e,t){return e&&yn(e,t,Fs)}function xn(e,t){return It(t,function(t){return Ka(e[t])})}function Cn(e,t){for(var n=0,i=(t=yi(t,e)).length;null!=e&&n<i;)e=e[jo(t[n++])];return n&&n==i?e:r}function _n(e,t,r){var n=t(e);return Ha(e)?n:Pt(n,r(e))}function Sn(e){return null==e?e===r?"[object Undefined]":"[object Null]":et&&et in Ae(e)?function(e){var t=Re.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var o=De.call(e);return i&&(t?e[et]=n:delete e[et]),o}(e):function(e){return De.call(e)}(e)}function An(e,t){return e>t}function kn(e,t){return null!=e&&Re.call(e,t)}function En(e,t){return null!=e&&t in Ae(e)}function In(e,t,n){for(var i=n?Ft:Tt,o=e[0].length,a=e.length,s=a,l=we(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Ot(d,Xt(t))),c=vr(d.length,c),l[s]=!n&&(t||o>=120&&d.length>=120)?new qr(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?Zt(f,g):i(u,g,n))){for(s=a;--s;){var m=l[s];if(!(m?Zt(m,g):i(e[s],g,n)))continue e}f&&f.push(g),u.push(p)}}return u}function Tn(e,t,n){var i=null==(e=Eo(e,t=yi(t,e)))?e:e[jo(Xo(t))];return null==i?r:_t(i,e,n)}function Fn(e){return es(e)&&Sn(e)==p}function On(e,t,n,i,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=Ha(e),l=Ha(t),c=s?g:po(e),u=l?g:po(t),d=(c=c==p?_:c)==_,h=(u=u==p?_:u)==_,f=c==u;if(f&&Ga(e)){if(!Ga(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new Gr),s||ls(e)?eo(e,t,n,i,o,a):function(e,t,r,n,i,o,a){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case F:return!(e.byteLength!=t.byteLength||!o(new He(e),new He(t)));case m:case v:case C:return za(+e,+t);case y:return e.name==t.name&&e.message==t.message;case A:case E:return e==t+"";case x:var s=ir;case k:var l=1&n;if(s||(s=sr),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=eo(s(e),s(t),n,i,o,a);return a.delete(e),u;case I:if(jr)return jr.call(e)==jr.call(t)}return!1}(e,t,c,n,i,o,a);if(!(1&n)){var b=d&&Re.call(e,"__wrapped__"),w=h&&Re.call(t,"__wrapped__");if(b||w){var S=b?e.value():e,T=w?t.value():t;return a||(a=new Gr),o(S,T,n,i,a)}}return!!f&&(a||(a=new Gr),function(e,t,n,i,o,a){var s=1&n,l=ro(e),c=l.length,u=ro(t),d=u.length;if(c!=d&&!s)return!1;for(var h=c;h--;){var f=l[h];if(!(s?f in t:Re.call(t,f)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);for(var v=s;++h<c;){var y=e[f=l[h]],b=t[f];if(i)var w=s?i(b,y,f,t,e,a):i(y,b,f,e,t,a);if(!(w===r?y===b||o(y,b,n,i,a):w)){m=!1;break}v||(v="constructor"==f)}if(m&&!v){var x=e.constructor,C=t.constructor;x==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,i,o,a))}(e,t,n,i,On,o))}function Pn(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Ae(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 Gr;if(i)var f=i(u,d,c,e,t,h);if(!(f===r?On(d,u,3,i,h):f))return!1}}return!0}function Mn(e){return!(!Qa(e)||(t=e,je&&je in t))&&(Ka(e)?Be:pe).test(Do(e));var t}function Rn(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Ha(e)?Bn(e[0],e[1]):zn(e):dl(e)}function Ln(e){if(!_o(e))return gr(e);var t=[];for(var r in Ae(e))Re.call(e,r)&&"constructor"!=r&&t.push(r);return t}function jn(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var r in Ae(e))t.push(r);return t}(e);var t=_o(e),r=[];for(var n in e)("constructor"!=n||!t&&Re.call(e,n))&&r.push(n);return r}function Dn(e,t){return e<t}function Nn(e,t){var r=-1,n=$a(e)?we(e.length):[];return dn(e,function(e,i,o){n[++r]=t(e,i,o)}),n}function zn(e){var t=co(e);return 1==t.length&&t[0][2]?Ao(t[0][0],t[0][1]):function(r){return r===e||Pn(r,e,t)}}function Bn(e,t){return wo(e)&&So(t)?Ao(jo(e),t):function(n){var i=As(n,e);return i===r&&i===t?ks(n,e):On(t,i,3)}}function Un(e,t,n,i,o){e!==t&&vn(t,function(a,s){if(o||(o=new Gr),Qa(a))!function(e,t,n,i,o,a,s){var l=Io(e,n),c=Io(t,n),u=s.get(c);if(u)Jr(e,n,u);else{var d=a?a(l,c,n+"",e,t,s):r,h=d===r;if(h){var f=Ha(c),p=!f&&Ga(c),g=!f&&!p&&ls(c);d=c,f||p||g?Ha(l)?d=l:qa(l)?d=Ii(l):p?(h=!1,d=Ci(c,!0)):g?(h=!1,d=Si(c,!0)):d=[]:ns(c)||Va(c)?(d=l,Va(l)?d=ms(l):Qa(l)&&!Ka(l)||(d=mo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Jr(e,n,d)}}(e,t,s,n,Un,i,o);else{var l=i?i(Io(e,s),a,s+"",e,t,o):r;l===r&&(l=a),Jr(e,s,l)}},Os)}function Vn(e,t){var n=e.length;if(n)return yo(t+=t<0?n:0,n)?e[t]:r}function Hn(e,t,r){t=t.length?Ot(t,function(e){return Ha(e)?function(t){return Cn(t,1===e.length?e[0]:e)}:e}):[rl];var n=-1;t=Ot(t,Xt(so()));var i=Nn(e,function(e,r,i){var o=Ot(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=Ai(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 Wn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=Cn(e,a);r(s,a)&&Jn(o,yi(a,e),s)}return o}function $n(e,t,r,n){var i=n?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ii(t)),r&&(s=Ot(e,Xt(r)));++o<a;)for(var l=0,c=t[o],u=r?r(c):c;(l=i(s,u,l,n))>-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function qn(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;yo(i)?Ye.call(e,i,1):ui(e,i)}}return e}function Gn(e,t){return e+gt(wr()*(t-e+1))}function Yn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(ko(e,t,rl),e+"")}function Kn(e){return Xr(zs(e))}function Zn(e,t){var r=zs(e);return Ro(r,an(t,0,r.length))}function Jn(e,t,n,i){if(!Qa(e))return e;for(var o=-1,a=(t=yi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=jo(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=Qa(d)?d:yo(t[o+1])?[]:{})}Qr(l,c,u),l=l[c]}return e}var Qn=Ir?function(e,t){return Ir.set(e,t),e}:rl,ei=at?function(e,t){return at(e,"toString",{configurable:!0,enumerable:!1,value:Qs(t),writable:!0})}:rl;function ti(e){return Ro(zs(e))}function ri(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=we(i);++n<i;)o[n]=e[n+t];return o}function ni(e,t){var r;return dn(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function ii(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&&!ss(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return oi(e,t,rl,r)}function oi(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=ss(t),u=t===r;o<a;){var d=gt((o+a)/2),h=n(e[d]),f=h!==r,p=null===h,g=h==h,m=ss(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 vr(a,4294967294)}function ai(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||!za(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function si(e){return"number"==typeof e?e:ss(e)?d:+e}function li(e){if("string"==typeof e)return e;if(Ha(e))return Ot(e,li)+"";if(ss(e))return Dr?Dr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,r){var n=-1,i=Tt,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Ft;else if(o>=200){var c=t?null:Yi(e);if(c)return sr(c);a=!1,i=Zt,l=new qr}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 ui(e,t){return null==(e=Eo(e,t=yi(t,e)))||delete e[jo(Xo(t))]}function di(e,t,r,n){return Jn(e,t,r(Cn(e,t)),n)}function hi(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ri(e,n?0:o,n?o+1:i):ri(e,n?o+1:0,n?i:o)}function fi(e,t){var r=e;return r instanceof Vr&&(r=r.value()),Mt(t,function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))},r)}function pi(e,t,r){var n=e.length;if(n<2)return n?ci(e[0]):[];for(var i=-1,o=we(n);++i<n;)for(var a=e[i],s=-1;++s<n;)s!=i&&(o[i]=un(o[i]||a,e[s],t,r));return ci(mn(o,1),t,r)}function gi(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 mi(e){return qa(e)?e:[]}function vi(e){return"function"==typeof e?e:rl}function yi(e,t){return Ha(e)?e:wo(e,t)?[e]:Lo(vs(e))}var bi=Xn;function wi(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:ri(e,t,n)}var xi=ct||function(e){return dt.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var r=e.length,n=We?We(r):new e.constructor(r);return e.copy(n),n}function _i(e){var t=new e.constructor(e.byteLength);return new He(t).set(new He(e)),t}function Si(e,t){var r=t?_i(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ai(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=ss(e),s=t!==r,l=null===t,c=t==t,u=ss(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 ki(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,l=t.length,c=mr(o-a,0),u=we(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 Ei(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,l=-1,c=t.length,u=mr(o-s,0),d=we(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 Ii(e,t){var r=-1,n=e.length;for(t||(t=we(n));++r<n;)t[r]=e[r];return t}function Ti(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?nn(n,l,c):Qr(n,l,c)}return n}function Fi(e,t){return function(r,n){var i=Ha(r)?St:tn,o=t?t():{};return i(r,e,so(n,2),o)}}function Oi(e){return Xn(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&&bo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Ae(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t})}function Pi(e,t){return function(r,n){if(null==r)return r;if(!$a(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Ae(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Mi(e){return function(t,r,n){for(var i=-1,o=Ae(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 Ri(e){return function(t){var n=nr(t=vs(t))?ur(t):r,i=n?n[0]:t.charAt(0),o=n?wi(n,1).join(""):t.slice(1);return i[e]()+o}}function Li(e){return function(t){return Mt(Ks(Vs(t).replace(Ke,"")),e,"")}}function ji(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=zr(e.prototype),n=e.apply(r,t);return Qa(n)?n:r}}function Di(e){return function(t,n,i){var o=Ae(t);if(!$a(t)){var a=so(n,3);t=Fs(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 Ni(e){return to(function(t){var i=t.length,o=i,a=Ur.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!l&&"wrapper"==oo(s))var l=new Ur([],!0)}for(o=l?o:i;++o<i;){var c=oo(s=t[o]),u="wrapper"==c?io(s):r;l=u&&xo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[oo(u[0])].apply(l,u[3]):1==s.length&&xo(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ha(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 zi(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:ji(e);return function s(){for(var y=arguments.length,b=we(y),w=y;w--;)b[w]=arguments[w];if(g)var x=ao(s),C=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(b,x);if(i&&(b=ki(b,i,o,g)),a&&(b=Ei(b,a,l,g)),y-=C,g&&y<d){var _=ar(b,x);return qi(e,t,zi,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=vr(t.length,n),o=Ii(e);i--;){var a=t[i];e[i]=yo(a,n)?o[a]:r}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==dt&&this instanceof s&&(A=v||ji(A)),A.apply(S,b)}}function Bi(e,t){return function(r,n){return function(e,t,r,n){return bn(e,function(e,i,o){t(n,r(e),i,o)}),n}(r,e,t(n),{})}}function Ui(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=li(n),i=li(i)):(n=si(n),i=si(i)),o=e(n,i)}return o}}function Vi(e){return to(function(t){return t=Ot(t,Xt(so())),Xn(function(r){var n=this;return e(t,function(e){return _t(e,n,r)})})})}function Hi(e,t){var n=(t=t===r?" ":li(t)).length;if(n<2)return n?Yn(t,e):t;var i=Yn(t,ft(e/cr(t)));return nr(t)?wi(ur(i),0,e).join(""):i.slice(0,e)}function Wi(e){return function(t,n,i){return i&&"number"!=typeof i&&bo(t,n,i)&&(n=i=r),t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r,n){for(var i=-1,o=mr(ft((t-e)/(r||1)),0),a=we(o);o--;)a[n?o:++i]=e,e+=r;return a}(t,n,i=i===r?t<n?1:-1:hs(i),e)}}function $i(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function qi(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 xo(e)&&To(p,f),p.placeholder=i,Po(p,e,t)}function Gi(e){var t=Se[e];return function(e,r){if(e=gs(e),(r=null==r?0:vr(fs(r),292))&&Wt(e)){var n=(vs(e)+"e").split("e");return+((n=(vs(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Yi=Ar&&1/sr(new Ar([,-0]))[1]==c?function(e){return new Ar(e)}:sl;function Xi(e){return function(t){var r=po(t);return r==x?ir(t):r==k?lr(t):function(e,t){return Ot(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ki(e,t,i,c,u,d,h,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Ie(n);var g=c?c.length:0;if(g||(t&=-97,c=u=r),h=h===r?h:mr(fs(h),0),f=f===r?f:fs(f),g-=u?u.length:0,64&t){var m=c,v=u;c=u=r}var y=p?r:io(e),b=[e,t,i,c,u,m,v,d,h,f];if(y&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,c=n==s&&8==r||n==s&&r==l&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!c)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var d=e[3];e[3]=d?ki(d,u,t[4]):u,e[4]=d?ar(e[3],o):t[4]}(u=t[5])&&(d=e[5],e[5]=d?Ei(d,u,t[6]):u,e[6]=d?ar(e[5],o):t[6]),(u=t[7])&&(e[7]=u),n&s&&(e[8]=null==e[8]?t[8]:vr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,y),e=b[0],t=b[1],i=b[2],c=b[3],u=b[4],!(f=b[9]=b[9]===r?p?0:e.length:mr(b[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(e,t,n){var i=ji(e);return function o(){for(var a=arguments.length,s=we(a),l=a,c=ao(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:ar(s,c);return(a-=u.length)<n?qi(e,t,zi,o.placeholder,r,s,u,r,r,n-a):_t(this&&this!==dt&&this instanceof o?i:e,this,s)}}(e,t,f):t!=a&&33!=t||u.length?zi.apply(r,b):function(e,t,r,n){var i=1&t,o=ji(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=n.length,u=we(c+s),d=this&&this!==dt&&this instanceof t?o:e;++l<c;)u[l]=n[l];for(;s--;)u[l++]=arguments[++a];return _t(d,i?r:this,u)}}(e,t,i,c);else var w=function(e,t,r){var n=1&t,i=ji(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,i);return Po((y?Qn:To)(w,b),e,t)}function Zi(e,t,n,i){return e===r||za(e,Oe[n])&&!Re.call(i,n)?t:e}function Ji(e,t,n,i,o,a){return Qa(e)&&Qa(t)&&(a.set(t,e),Un(e,t,r,Ji,a),a.delete(t)),e}function Qi(e){return ns(e)?r:e}function eo(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 qr: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(!Lt(t,function(e,t){if(!Zt(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 to(e){return Oo(ko(e,r,Wo),e+"")}function ro(e){return _n(e,Fs,ho)}function no(e){return _n(e,Os,fo)}var io=Ir?function(e){return Ir.get(e)}:sl;function oo(e){for(var t=e.name+"",r=Tr[t],n=Re.call(Tr,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function ao(e){return(Re.call(Nr,"placeholder")?Nr:e).placeholder}function so(){var e=Nr.iteratee||nl;return e=e===nl?Rn:e,arguments.length?e(arguments[0],arguments[1]):e}function lo(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 co(e){for(var t=Fs(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,So(i)]}return t}function uo(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return Mn(n)?n:r}var ho=mt?function(e){return null==e?[]:(e=Ae(e),It(mt(e),function(t){return Ge.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Pt(t,ho(e)),e=$e(e);return t}:pl,po=Sn;function go(e,t,r){for(var n=-1,i=(t=yi(t,e)).length,o=!1;++n<i;){var a=jo(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ja(i)&&yo(a,i)&&(Ha(e)||Va(e))}function mo(e){return"function"!=typeof e.constructor||_o(e)?{}:zr($e(e))}function vo(e){return Ha(e)||Va(e)||!!(Xe&&e&&e[Xe])}function yo(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&me.test(e))&&e>-1&&e%1==0&&e<t}function bo(e,t,r){if(!Qa(r))return!1;var n=typeof t;return!!("number"==n?$a(r)&&yo(t,r.length):"string"==n&&t in r)&&za(r[t],e)}function wo(e,t){if(Ha(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||J.test(e)||!Z.test(e)||null!=t&&e in Ae(t)}function xo(e){var t=oo(e),r=Nr[t];if("function"!=typeof r||!(t in Vr.prototype))return!1;if(e===r)return!0;var n=io(r);return!!n&&e===n[0]}(Cr&&po(new Cr(new ArrayBuffer(1)))!=O||_r&&po(new _r)!=x||Sr&&po(Sr.resolve())!=S||Ar&&po(new Ar)!=k||kr&&po(new kr)!=T)&&(po=function(e){var t=Sn(e),n=t==_?e.constructor:r,i=n?Do(n):"";if(i)switch(i){case Fr:return O;case Or:return x;case Pr:return S;case Mr:return k;case Rr:return T}return t});var Co=Pe?Ka:gl;function _o(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Oe)}function So(e){return e==e&&!Qa(e)}function Ao(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in Ae(n))}}function ko(e,t,n){return t=mr(t===r?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=mr(r.length-t,0),a=we(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=we(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),_t(e,this,s)}}function Eo(e,t){return t.length<2?e:Cn(e,ri(t,0,-1))}function Io(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var To=Mo(Qn),Fo=ht||function(e,t){return dt.setTimeout(e,t)},Oo=Mo(ei);function Po(e,t,r){var n=t+"";return Oo(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(ie,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return At(f,function(r){var n="_."+r[0];t&r[1]&&!Tt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(n),r)))}function Mo(e){var t=0,n=0;return function(){var i=yr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ro(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=Gn(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Lo=function(e){var t=Ma(e,function(e){return 500===r.size&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Q,function(e,r,n,i){t.push(n?i.replace(ce,"$1"):r||e)}),t});function jo(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Do(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function No(e){if(e instanceof Vr)return e.clone();var t=new Ur(e.__wrapped__,e.__chain__);return t.__actions__=Ii(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Xn(function(e,t){return qa(e)?un(e,mn(t,1,qa,!0)):[]}),Bo=Xn(function(e,t){var n=Xo(t);return qa(n)&&(n=r),qa(e)?un(e,mn(t,1,qa,!0),so(n,2)):[]}),Uo=Xn(function(e,t){var n=Xo(t);return qa(n)&&(n=r),qa(e)?un(e,mn(t,1,qa,!0),r,n):[]});function Vo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),Nt(e,so(t,3),i)}function Ho(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=fs(n),o=n<0?mr(i+o,0):vr(o,i-1)),Nt(e,so(t,3),o,!0)}function Wo(e){return null!=e&&e.length?mn(e,1):[]}function $o(e){return e&&e.length?e[0]:r}var qo=Xn(function(e){var t=Ot(e,mi);return t.length&&t[0]===e[0]?In(t):[]}),Go=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return t===Xo(n)?t=r:n.pop(),n.length&&n[0]===e[0]?In(n,so(t,2)):[]}),Yo=Xn(function(e){var t=Xo(e),n=Ot(e,mi);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?In(n,r,t):[]});function Xo(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ko=Xn(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?$n(e,t):e}var Jo=to(function(e,t){var r=null==e?0:e.length,n=on(e,t);return qn(e,Ot(t,function(e){return yo(e,r)?+e:e}).sort(Ai)),n});function Qo(e){return null==e?e:xr.call(e)}var ea=Xn(function(e){return ci(mn(e,1,qa,!0))}),ta=Xn(function(e){var t=Xo(e);return qa(t)&&(t=r),ci(mn(e,1,qa,!0),so(t,2))}),ra=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,ci(mn(e,1,qa,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=It(e,function(e){if(qa(e))return t=mr(e.length,t),!0}),Gt(t,function(t){return Ot(e,Ht(t))})}function ia(e,t){if(!e||!e.length)return[];var n=na(e);return null==t?n:Ot(n,function(e){return _t(t,r,e)})}var oa=Xn(function(e,t){return qa(e)?un(e,t):[]}),aa=Xn(function(e){return pi(It(e,qa))}),sa=Xn(function(e){var t=Xo(e);return qa(t)&&(t=r),pi(It(e,qa),so(t,2))}),la=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,pi(It(e,qa),r,t)}),ca=Xn(na),ua=Xn(function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,ia(e,n)});function da(e){var t=Nr(e);return t.__chain__=!0,t}function ha(e,t){return t(e)}var fa=to(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return on(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Vr&&yo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:ha,args:[o],thisArg:r}),new Ur(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(o)}),pa=Fi(function(e,t,r){Re.call(e,r)?++e[r]:nn(e,r,1)}),ga=Di(Vo),ma=Di(Ho);function va(e,t){return(Ha(e)?At:dn)(e,so(t,3))}function ya(e,t){return(Ha(e)?kt:hn)(e,so(t,3))}var ba=Fi(function(e,t,r){Re.call(e,r)?e[r].push(t):nn(e,r,[t])}),wa=Xn(function(e,t,r){var n=-1,i="function"==typeof t,o=$a(e)?we(e.length):[];return dn(e,function(e){o[++n]=i?_t(t,e,r):Tn(e,t,r)}),o}),xa=Fi(function(e,t,r){nn(e,r,t)});function Ca(e,t){return(Ha(e)?Ot:Nn)(e,so(t,3))}var _a=Fi(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),Sa=Xn(function(e,t){if(null==e)return[];var r=t.length;return r>1&&bo(e,t[0],t[1])?t=[]:r>2&&bo(t[0],t[1],t[2])&&(t=[t[0]]),Hn(e,mn(t,1),[])}),Aa=ut||function(){return dt.Date.now()};function ka(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,s,r,r,r,r,t)}function Ea(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn(function(e,t,r){var n=1;if(r.length){var i=ar(r,ao(Ia));n|=a}return Ki(e,n,t,r,i)}),Ta=Xn(function(e,t,r){var n=3;if(r.length){var i=ar(r,ao(Ta));n|=a}return Ki(t,n,e,r,i)});function Fa(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ie(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=Aa();if(m(e))return y(e);c=Fo(v,function(e){var r=t-(e-u);return f?vr(r,s-(e-d)):r}(e))}function y(e){return c=r,p&&o?g(e):(o=a=r,l)}function b(){var e=Aa(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=Fo(v,t),h?g(e):l}(u);if(f)return xi(c),c=Fo(v,t),g(u)}return c===r&&(c=Fo(v,t)),l}return t=gs(t)||0,Qa(i)&&(h=!!i.leading,s=(f="maxWait"in i)?mr(gs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==r&&xi(c),d=0,o=u=a=c=r},b.flush=function(){return c===r?l:y(Aa())},b}var Oa=Xn(function(e,t){return cn(e,1,t)}),Pa=Xn(function(e,t,r){return cn(e,gs(t)||0,r)});function Ma(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(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(Ma.Cache||$r),r}function Ra(e){if("function"!=typeof e)throw new Ie(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)}}Ma.Cache=$r;var La=bi(function(e,t){var r=(t=1==t.length&&Ha(t[0])?Ot(t[0],Xt(so())):Ot(mn(t,1),Xt(so()))).length;return Xn(function(n){for(var i=-1,o=vr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return _t(e,this,n)})}),ja=Xn(function(e,t){var n=ar(t,ao(ja));return Ki(e,a,r,t,n)}),Da=Xn(function(e,t){var n=ar(t,ao(Da));return Ki(e,64,r,t,n)}),Na=to(function(e,t){return Ki(e,l,r,r,r,t)});function za(e,t){return e===t||e!=e&&t!=t}var Ba=$i(An),Ua=$i(function(e,t){return e>=t}),Va=Fn(function(){return arguments}())?Fn:function(e){return es(e)&&Re.call(e,"callee")&&!Ge.call(e,"callee")},Ha=we.isArray,Wa=vt?Xt(vt):function(e){return es(e)&&Sn(e)==F};function $a(e){return null!=e&&Ja(e.length)&&!Ka(e)}function qa(e){return es(e)&&$a(e)}var Ga=jt||gl,Ya=yt?Xt(yt):function(e){return es(e)&&Sn(e)==v};function Xa(e){if(!es(e))return!1;var t=Sn(e);return t==y||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Ka(e){if(!Qa(e))return!1;var t=Sn(e);return t==b||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==fs(e)}function Ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Xt(bt):function(e){return es(e)&&po(e)==x};function rs(e){return"number"==typeof e||es(e)&&Sn(e)==C}function ns(e){if(!es(e)||Sn(e)!=_)return!1;var t=$e(e);if(null===t)return!0;var r=Re.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==Ne}var is=wt?Xt(wt):function(e){return es(e)&&Sn(e)==A},os=xt?Xt(xt):function(e){return es(e)&&po(e)==k};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sn(e)==E}function ss(e){return"symbol"==typeof e||es(e)&&Sn(e)==I}var ls=Ct?Xt(Ct):function(e){return es(e)&&Ja(e.length)&&!!it[Sn(e)]},cs=$i(Dn),us=$i(function(e,t){return e<=t});function ds(e){if(!e)return[];if($a(e))return as(e)?ur(e):Ii(e);if(Je&&e[Je])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Je]());var t=po(e);return(t==x?ir:t==k?sr:zs)(e)}function hs(e){return e?(e=gs(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function fs(e){var t=hs(e),r=t%1;return t==t?r?t-r:t:0}function ps(e){return e?an(fs(e),0,h):0}function gs(e){if("number"==typeof e)return e;if(ss(e))return d;if(Qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=fe.test(e);return r||ge.test(e)?lt(e.slice(2),r?2:8):he.test(e)?d:+e}function ms(e){return Ti(e,Os(e))}function vs(e){return null==e?"":li(e)}var ys=Oi(function(e,t){if(_o(t)||$a(t))Ti(t,Fs(t),e);else for(var r in t)Re.call(t,r)&&Qr(e,r,t[r])}),bs=Oi(function(e,t){Ti(t,Os(t),e)}),ws=Oi(function(e,t,r,n){Ti(t,Os(t),e,n)}),xs=Oi(function(e,t,r,n){Ti(t,Fs(t),e,n)}),Cs=to(on),_s=Xn(function(e,t){e=Ae(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&bo(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=Os(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===r||za(d,Oe[u])&&!Re.call(e,u))&&(e[u]=a[u])}return e}),Ss=Xn(function(e){return e.push(r,Ji),_t(Ms,r,e)});function As(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function ks(e,t){return null!=e&&go(e,t,En)}var Es=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),e[t]=r},Qs(rl)),Is=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=De.call(t)),Re.call(e,t)?e[t].push(r):e[t]=[r]},so),Ts=Xn(Tn);function Fs(e){return $a(e)?Yr(e):Ln(e)}function Os(e){return $a(e)?Yr(e,!0):jn(e)}var Ps=Oi(function(e,t,r){Un(e,t,r)}),Ms=Oi(function(e,t,r,n){Un(e,t,r,n)}),Rs=to(function(e,t){var r={};if(null==e)return r;var n=!1;t=Ot(t,function(t){return t=yi(t,e),n||(n=t.length>1),t}),Ti(e,no(e),r),n&&(r=sn(r,7,Qi));for(var i=t.length;i--;)ui(r,t[i]);return r}),Ls=to(function(e,t){return null==e?{}:function(e,t){return Wn(e,t,function(t,r){return ks(e,r)})}(e,t)});function js(e,t){if(null==e)return{};var r=Ot(no(e),function(e){return[e]});return t=so(t),Wn(e,r,function(e,r){return t(e,r[0])})}var Ds=Xi(Fs),Ns=Xi(Os);function zs(e){return null==e?[]:Kt(e,Fs(e))}var Bs=Li(function(e,t,r){return t=t.toLowerCase(),e+(r?Us(t):t)});function Us(e){return Xs(vs(e).toLowerCase())}function Vs(e){return(e=vs(e))&&e.replace(ve,er).replace(Ze,"")}var Hs=Li(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Ws=Li(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),$s=Ri("toLowerCase"),qs=Li(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),Gs=Li(function(e,t,r){return e+(r?" ":"")+Xs(t)}),Ys=Li(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Xs=Ri("toUpperCase");function Ks(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Zs=Xn(function(e,t){try{return _t(e,r,t)}catch(e){return Xa(e)?e:new Ce(e)}}),Js=to(function(e,t){return At(t,function(t){t=jo(t),nn(e,t,Ia(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Ni(),tl=Ni(!0);function rl(e){return e}function nl(e){return Rn("function"==typeof e?e:sn(e,1))}var il=Xn(function(e,t){return function(r){return Tn(r,e,t)}}),ol=Xn(function(e,t){return function(r){return Tn(e,r,t)}});function al(e,t,r){var n=Fs(t),i=xn(t,n);null!=r||Qa(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=xn(t,Fs(t)));var o=!(Qa(r)&&"chain"in r&&!r.chain),a=Ka(e);return At(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__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Pt([this.value()],arguments))})}),e}function sl(){}var ll=Vi(Ot),cl=Vi(Et),ul=Vi(Lt);function dl(e){return wo(e)?Ht(jo(e)):function(e){return function(t){return Cn(t,e)}}(e)}var hl=Wi(),fl=Wi(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Ui(function(e,t){return e+t},0),yl=Gi("ceil"),bl=Ui(function(e,t){return e/t},1),wl=Gi("floor"),xl=Ui(function(e,t){return e*t},1),Cl=Gi("round"),_l=Ui(function(e,t){return e-t},0);return Nr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Nr.ary=ka,Nr.assign=ys,Nr.assignIn=bs,Nr.assignInWith=ws,Nr.assignWith=xs,Nr.at=Cs,Nr.before=Ea,Nr.bind=Ia,Nr.bindAll=Js,Nr.bindKey=Ta,Nr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Nr.chain=da,Nr.chunk=function(e,t,n){t=(n?bo(e,t,n):t===r)?1:mr(fs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=we(ft(i/t));o<i;)s[a++]=ri(e,o,o+=t);return s},Nr.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},Nr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=we(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Pt(Ha(r)?Ii(r):[r],mn(t,1))},Nr.cond=function(e){var t=null==e?0:e.length,r=so();return e=t?Ot(e,function(e){if("function"!=typeof e[1])throw new Ie(n);return[r(e[0]),e[1]]}):[],Xn(function(r){for(var n=-1;++n<t;){var i=e[n];if(_t(i[0],this,r))return _t(i[1],this,r)}})},Nr.conforms=function(e){return function(e){var t=Fs(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Nr.constant=Qs,Nr.countBy=pa,Nr.create=function(e,t){var r=zr(e);return null==t?r:rn(r,t)},Nr.curry=function e(t,n,i){var o=Ki(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.curryRight=function e(t,n,i){var o=Ki(t,16,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nr.debounce=Fa,Nr.defaults=_s,Nr.defaultsDeep=Ss,Nr.defer=Oa,Nr.delay=Pa,Nr.difference=zo,Nr.differenceBy=Bo,Nr.differenceWith=Uo,Nr.drop=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=n||t===r?1:fs(t))<0?0:t,i):[]},Nr.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,0,(t=i-(t=n||t===r?1:fs(t)))<0?0:t):[]},Nr.dropRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0,!0):[]},Nr.dropWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0):[]},Nr.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&bo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=fs(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:fs(i))<0&&(i+=o),i=n>i?0:ps(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Nr.filter=function(e,t){return(Ha(e)?It:gn)(e,so(t,3))},Nr.flatMap=function(e,t){return mn(Ca(e,t),1)},Nr.flatMapDeep=function(e,t){return mn(Ca(e,t),c)},Nr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),mn(Ca(e,t),n)},Nr.flatten=Wo,Nr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Nr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===r?1:fs(t)):[]},Nr.flip=function(e){return Ki(e,512)},Nr.flow=el,Nr.flowRight=tl,Nr.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},Nr.functions=function(e){return null==e?[]:xn(e,Fs(e))},Nr.functionsIn=function(e){return null==e?[]:xn(e,Os(e))},Nr.groupBy=ba,Nr.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Nr.intersection=qo,Nr.intersectionBy=Go,Nr.intersectionWith=Yo,Nr.invert=Es,Nr.invertBy=Is,Nr.invokeMap=wa,Nr.iteratee=nl,Nr.keyBy=xa,Nr.keys=Fs,Nr.keysIn=Os,Nr.map=Ca,Nr.mapKeys=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,t(e,n,i),e)}),r},Nr.mapValues=function(e,t){var r={};return t=so(t,3),bn(e,function(e,n,i){nn(r,n,t(e,n,i))}),r},Nr.matches=function(e){return zn(sn(e,1))},Nr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Nr.memoize=Ma,Nr.merge=Ps,Nr.mergeWith=Ms,Nr.method=il,Nr.methodOf=ol,Nr.mixin=al,Nr.negate=Ra,Nr.nthArg=function(e){return e=fs(e),Xn(function(t){return Vn(t,e)})},Nr.omit=Rs,Nr.omitBy=function(e,t){return js(e,Ra(so(t)))},Nr.once=function(e){return Ea(2,e)},Nr.orderBy=function(e,t,n,i){return null==e?[]:(Ha(t)||(t=null==t?[]:[t]),Ha(n=i?r:n)||(n=null==n?[]:[n]),Hn(e,t,n))},Nr.over=ll,Nr.overArgs=La,Nr.overEvery=cl,Nr.overSome=ul,Nr.partial=ja,Nr.partialRight=Da,Nr.partition=_a,Nr.pick=Ls,Nr.pickBy=js,Nr.property=dl,Nr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Nr.pull=Ko,Nr.pullAll=Zo,Nr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?$n(e,t,so(r,2)):e},Nr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?$n(e,t,r,n):e},Nr.pullAt=Jo,Nr.range=hl,Nr.rangeRight=fl,Nr.rearg=Na,Nr.reject=function(e,t){return(Ha(e)?It:gn)(e,Ra(so(t,3)))},Nr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=so(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return qn(e,i),r},Nr.rest=function(e,t){if("function"!=typeof e)throw new Ie(n);return Xn(e,t=t===r?t:fs(t))},Nr.reverse=Qo,Nr.sampleSize=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),(Ha(e)?Kr:Zn)(e,t)},Nr.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Nr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Nr.shuffle=function(e){return(Ha(e)?Zr:ti)(e)},Nr.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&bo(e,t,n)?(t=0,n=i):(t=null==t?0:fs(t),n=n===r?i:fs(n)),ri(e,t,n)):[]},Nr.sortBy=Sa,Nr.sortedUniq=function(e){return e&&e.length?ai(e):[]},Nr.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},Nr.split=function(e,t,n){return n&&"number"!=typeof n&&bo(e,t,n)&&(t=n=r),(n=n===r?h:n>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=li(t))&&nr(e)?wi(ur(e),0,n):e.split(t,n):[]},Nr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:mr(fs(t),0),Xn(function(r){var n=r[t],i=wi(r,0,t);return n&&Pt(i,n),_t(e,this,i)})},Nr.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Nr.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Nr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ri(e,(t=i-(t=n||t===r?1:fs(t)))<0?0:t,i):[]},Nr.takeRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!1,!0):[]},Nr.takeWhile=function(e,t){return e&&e.length?hi(e,so(t,3)):[]},Nr.tap=function(e,t){return t(e),e},Nr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return Qa(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Fa(e,t,{leading:i,maxWait:t,trailing:o})},Nr.thru=ha,Nr.toArray=ds,Nr.toPairs=Ds,Nr.toPairsIn=Ns,Nr.toPath=function(e){return Ha(e)?Ot(e,jo):ss(e)?[e]:Ii(Lo(vs(e)))},Nr.toPlainObject=ms,Nr.transform=function(e,t,r){var n=Ha(e),i=n||Ga(e)||ls(e);if(t=so(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qa(e)&&Ka(o)?zr($e(e)):{}}return(i?At:bn)(e,function(e,n,i){return t(r,e,n,i)}),r},Nr.unary=function(e){return ka(e,1)},Nr.union=ea,Nr.unionBy=ta,Nr.unionWith=ra,Nr.uniq=function(e){return e&&e.length?ci(e):[]},Nr.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},Nr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ci(e,r,t):[]},Nr.unset=function(e,t){return null==e||ui(e,t)},Nr.unzip=na,Nr.unzipWith=ia,Nr.update=function(e,t,r){return null==e?e:di(e,t,vi(r))},Nr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:di(e,t,vi(n),i)},Nr.values=zs,Nr.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Nr.without=oa,Nr.words=Ks,Nr.wrap=function(e,t){return ja(vi(t),e)},Nr.xor=aa,Nr.xorBy=sa,Nr.xorWith=la,Nr.zip=ca,Nr.zipObject=function(e,t){return gi(e||[],t||[],Qr)},Nr.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Nr.zipWith=ua,Nr.entries=Ds,Nr.entriesIn=Ns,Nr.extend=bs,Nr.extendWith=ws,al(Nr,Nr),Nr.add=vl,Nr.attempt=Zs,Nr.camelCase=Bs,Nr.capitalize=Us,Nr.ceil=yl,Nr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=gs(n))==n?n:0),t!==r&&(t=(t=gs(t))==t?t:0),an(gs(e),t,n)},Nr.clone=function(e){return sn(e,4)},Nr.cloneDeep=function(e){return sn(e,5)},Nr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Nr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Nr.conformsTo=function(e,t){return null==t||ln(e,t,Fs(t))},Nr.deburr=Vs,Nr.defaultTo=function(e,t){return null==e||e!=e?t:e},Nr.divide=bl,Nr.endsWith=function(e,t,n){e=vs(e),t=li(t);var i=e.length,o=n=n===r?i:an(fs(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Nr.eq=za,Nr.escape=function(e){return(e=vs(e))&&G.test(e)?e.replace($,tr):e},Nr.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Nr.every=function(e,t,n){var i=Ha(e)?Et:fn;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Nr.find=ga,Nr.findIndex=Vo,Nr.findKey=function(e,t){return Dt(e,so(t,3),bn)},Nr.findLast=ma,Nr.findLastIndex=Ho,Nr.findLastKey=function(e,t){return Dt(e,so(t,3),wn)},Nr.floor=wl,Nr.forEach=va,Nr.forEachRight=ya,Nr.forIn=function(e,t){return null==e?e:vn(e,so(t,3),Os)},Nr.forInRight=function(e,t){return null==e?e:yn(e,so(t,3),Os)},Nr.forOwn=function(e,t){return e&&bn(e,so(t,3))},Nr.forOwnRight=function(e,t){return e&&wn(e,so(t,3))},Nr.get=As,Nr.gt=Ba,Nr.gte=Ua,Nr.has=function(e,t){return null!=e&&go(e,t,kn)},Nr.hasIn=ks,Nr.head=$o,Nr.identity=rl,Nr.includes=function(e,t,r,n){e=$a(e)?e:zs(e),r=r&&!n?fs(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),as(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&zt(e,t,r)>-1},Nr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:fs(r);return i<0&&(i=mr(n+i,0)),zt(e,t,i)},Nr.inRange=function(e,t,n){return t=hs(t),n===r?(n=t,t=0):n=hs(n),function(e,t,r){return e>=vr(t,r)&&e<mr(t,r)}(e=gs(e),t,n)},Nr.invoke=Ts,Nr.isArguments=Va,Nr.isArray=Ha,Nr.isArrayBuffer=Wa,Nr.isArrayLike=$a,Nr.isArrayLikeObject=qa,Nr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sn(e)==m},Nr.isBuffer=Ga,Nr.isDate=Ya,Nr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Nr.isEmpty=function(e){if(null==e)return!0;if($a(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||Ga(e)||ls(e)||Va(e)))return!e.length;var t=po(e);if(t==x||t==k)return!e.size;if(_o(e))return!Ln(e).length;for(var r in e)if(Re.call(e,r))return!1;return!0},Nr.isEqual=function(e,t){return On(e,t)},Nr.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?On(e,t,r,n):!!i},Nr.isError=Xa,Nr.isFinite=function(e){return"number"==typeof e&&Wt(e)},Nr.isFunction=Ka,Nr.isInteger=Za,Nr.isLength=Ja,Nr.isMap=ts,Nr.isMatch=function(e,t){return e===t||Pn(e,t,co(t))},Nr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Pn(e,t,co(t),n)},Nr.isNaN=function(e){return rs(e)&&e!=+e},Nr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mn(e)},Nr.isNil=function(e){return null==e},Nr.isNull=function(e){return null===e},Nr.isNumber=rs,Nr.isObject=Qa,Nr.isObjectLike=es,Nr.isPlainObject=ns,Nr.isRegExp=is,Nr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},Nr.isSet=os,Nr.isString=as,Nr.isSymbol=ss,Nr.isTypedArray=ls,Nr.isUndefined=function(e){return e===r},Nr.isWeakMap=function(e){return es(e)&&po(e)==T},Nr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sn(e)},Nr.join=function(e,t){return null==e?"":pr.call(e,t)},Nr.kebabCase=Hs,Nr.last=Xo,Nr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=fs(n))<0?mr(i+o,0):vr(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):Nt(e,Ut,o,!0)},Nr.lowerCase=Ws,Nr.lowerFirst=$s,Nr.lt=cs,Nr.lte=us,Nr.max=function(e){return e&&e.length?pn(e,rl,An):r},Nr.maxBy=function(e,t){return e&&e.length?pn(e,so(t,2),An):r},Nr.mean=function(e){return Vt(e,rl)},Nr.meanBy=function(e,t){return Vt(e,so(t,2))},Nr.min=function(e){return e&&e.length?pn(e,rl,Dn):r},Nr.minBy=function(e,t){return e&&e.length?pn(e,so(t,2),Dn):r},Nr.stubArray=pl,Nr.stubFalse=gl,Nr.stubObject=function(){return{}},Nr.stubString=function(){return""},Nr.stubTrue=function(){return!0},Nr.multiply=xl,Nr.nth=function(e,t){return e&&e.length?Vn(e,fs(t)):r},Nr.noConflict=function(){return dt._===this&&(dt._=ze),this},Nr.noop=sl,Nr.now=Aa,Nr.pad=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Hi(gt(i),r)+e+Hi(ft(i),r)},Nr.padEnd=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?e+Hi(t-n,r):e},Nr.padStart=function(e,t,r){e=vs(e);var n=(t=fs(t))?cr(e):0;return t&&n<t?Hi(t-n,r)+e:e},Nr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(vs(e).replace(re,""),t||0)},Nr.random=function(e,t,n){if(n&&"boolean"!=typeof n&&bo(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=hs(e),t===r?(t=e,e=0):t=hs(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=wr();return vr(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Gn(e,t)},Nr.reduce=function(e,t,r){var n=Ha(e)?Mt:$t,i=arguments.length<3;return n(e,so(t,4),r,i,dn)},Nr.reduceRight=function(e,t,r){var n=Ha(e)?Rt:$t,i=arguments.length<3;return n(e,so(t,4),r,i,hn)},Nr.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),Yn(vs(e),t)},Nr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nr.result=function(e,t,n){var i=-1,o=(t=yi(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[jo(t[i])];a===r&&(i=o,a=n),e=Ka(a)?a.call(e):a}return e},Nr.round=Cl,Nr.runInContext=e,Nr.sample=function(e){return(Ha(e)?Xr:Kn)(e)},Nr.size=function(e){if(null==e)return 0;if($a(e))return as(e)?cr(e):e.length;var t=po(e);return t==x||t==k?e.size:Ln(e).length},Nr.snakeCase=qs,Nr.some=function(e,t,n){var i=Ha(e)?Lt:ni;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Nr.sortedIndex=function(e,t){return ii(e,t)},Nr.sortedIndexBy=function(e,t,r){return oi(e,t,so(r,2))},Nr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ii(e,t);if(n<r&&za(e[n],t))return n}return-1},Nr.sortedLastIndex=function(e,t){return ii(e,t,!0)},Nr.sortedLastIndexBy=function(e,t,r){return oi(e,t,so(r,2),!0)},Nr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ii(e,t,!0)-1;if(za(e[r],t))return r}return-1},Nr.startCase=Gs,Nr.startsWith=function(e,t,r){return e=vs(e),r=null==r?0:an(fs(r),0,e.length),t=li(t),e.slice(r,r+t.length)==t},Nr.subtract=_l,Nr.sum=function(e){return e&&e.length?qt(e,rl):0},Nr.sumBy=function(e,t){return e&&e.length?qt(e,so(t,2)):0},Nr.template=function(e,t,n){var i=Nr.templateSettings;n&&bo(e,t,n)&&(t=r),e=vs(e),t=ws({},t,i,Zi);var o,a,s=ws({},t.imports,i.imports,Zi),l=Fs(s),c=Kt(s,l),u=0,d=t.interpolate||ye,h="__p += '",f=ke((t.escape||ye).source+"|"+d.source+"|"+(d===K?ue:ye).source+"|"+(t.evaluate||ye).source+"|$","g"),p="//# sourceURL="+(Re.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(f,function(t,r,n,i,s,l){return n||(n=i),h+=e.slice(u,l).replace(be,rr),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=Re.call(t,"variable")&&t.variable;if(g){if(le.test(g))throw new Ce("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(U,""):h).replace(V,"$1").replace(H,"$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=Zs(function(){return _e(l,p+"return "+h).apply(r,c)});if(m.source=h,Xa(m))throw m;return m},Nr.times=function(e,t){if((e=fs(e))<1||e>u)return[];var r=h,n=vr(e,h);t=so(t),e-=h;for(var i=Gt(n,t);++r<e;)t(r);return i},Nr.toFinite=hs,Nr.toInteger=fs,Nr.toLength=ps,Nr.toLower=function(e){return vs(e).toLowerCase()},Nr.toNumber=gs,Nr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,u):0===e?e:0},Nr.toString=vs,Nr.toUpper=function(e){return vs(e).toUpperCase()},Nr.trim=function(e,t,n){if((e=vs(e))&&(n||t===r))return Yt(e);if(!e||!(t=li(t)))return e;var i=ur(e),o=ur(t);return wi(i,Jt(i,o),Qt(i,o)+1).join("")},Nr.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.slice(0,dr(e)+1);if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,0,Qt(i,ur(t))+1).join("")},Nr.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.replace(re,"");if(!e||!(t=li(t)))return e;var i=ur(e);return wi(i,Jt(i,ur(t))).join("")},Nr.truncate=function(e,t){var n=30,i="...";if(Qa(t)){var o="separator"in t?t.separator:o;n="length"in t?fs(t.length):n,i="omission"in t?li(t.omission):i}var a=(e=vs(e)).length;if(nr(e)){var s=ur(e);a=s.length}if(n>=a)return e;var l=n-cr(i);if(l<1)return i;var c=s?wi(s,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=ke(o.source,vs(de.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(li(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Nr.unescape=function(e){return(e=vs(e))&&q.test(e)?e.replace(W,hr):e},Nr.uniqueId=function(e){var t=++Le;return vs(e)+t},Nr.upperCase=Ys,Nr.upperFirst=Xs,Nr.each=va,Nr.eachRight=ya,Nr.first=$o,al(Nr,(ml={},bn(Nr,function(e,t){Re.call(Nr.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),Nr.VERSION="4.17.21",At(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Nr[e].placeholder=Nr}),At(["drop","take"],function(e,t){Vr.prototype[e]=function(n){n=n===r?1:mr(fs(n),0);var i=this.__filtered__&&!t?new Vr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,h),type:e+(i.__dir__<0?"Right":"")}),i},Vr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),At(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;Vr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:so(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),At(["head","last"],function(e,t){var r="take"+(t?"Right":"");Vr.prototype[e]=function(){return this[r](1).value()[0]}}),At(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");Vr.prototype[e]=function(){return this.__filtered__?new Vr(this):this[r](1)}}),Vr.prototype.compact=function(){return this.filter(rl)},Vr.prototype.find=function(e){return this.filter(e).head()},Vr.prototype.findLast=function(e){return this.reverse().find(e)},Vr.prototype.invokeMap=Xn(function(e,t){return"function"==typeof e?new Vr(this):this.map(function(r){return Tn(r,e,t)})}),Vr.prototype.reject=function(e){return this.filter(Ra(so(e)))},Vr.prototype.slice=function(e,t){e=fs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Vr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=fs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Vr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vr.prototype.toArray=function(){return this.take(h)},bn(Vr.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Nr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Nr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Vr,c=s[0],u=l||Ha(t),d=function(e){var t=o.apply(Nr,Pt([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 Vr(this);var m=e.apply(t,s);return m.__actions__.push({func:ha,args:[d],thisArg:r}),new Ur(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),At(["pop","push","shift","sort","splice","unshift"],function(e){var t=Te[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Nr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ha(i)?i:[],e)}return this[r](function(r){return t.apply(Ha(r)?r:[],e)})}}),bn(Vr.prototype,function(e,t){var r=Nr[t];if(r){var n=r.name+"";Re.call(Tr,n)||(Tr[n]=[]),Tr[n].push({name:t,func:r})}}),Tr[zi(r,2).name]=[{name:"wrapper",func:r}],Vr.prototype.clone=function(){var e=new Vr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Vr.prototype.reverse=function(){if(this.__filtered__){var e=new Vr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ha(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=vr(t,e+a);break;case"takeRight":e=mr(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=vr(l,this.__takeCount__);if(!r||!n&&i==l&&f==l)return fi(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},Nr.prototype.at=fa,Nr.prototype.chain=function(){return da(this)},Nr.prototype.commit=function(){return new Ur(this.value(),this.__chain__)},Nr.prototype.next=function(){this.__values__===r&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Nr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=No(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Nr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vr){var t=e;return this.__actions__.length&&(t=new Vr(this)),(t=t.reverse()).__actions__.push({func:ha,args:[Qo],thisArg:r}),new Ur(t,this.__chain__)}return this.thru(Qo)},Nr.prototype.toJSON=Nr.prototype.valueOf=Nr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Nr.prototype.first=Nr.prototype.head,Je&&(Nr.prototype[Je]=function(){return this}),Nr}();ft?((ft.exports=fr)._=fr,ht._=fr):dt._=fr}).call(mi)}(gi,gi.exports)),gi.exports);const yi=s({state:{},actions:{},options:{}}),bi=()=>l(yi),wi=({children:t,options:r})=>{var n;const[s,l]=o([]),[u,d]=o([]),[h,f]=o(null),[p,g]=o(r.searchQuery||""),[m,v]=o(r.sortBySize||"name"),{config:y}=r,[b,w]=o("date"),[x,C]=o("desc"),[_,S]=o([{id:"folders",name:"Папки"}]),[A,k]=o(new Set),[E,I]=o("");i.useEffect(()=>{k(new Set)},[]);const F=i.useRef(null);i.useEffect(()=>{if(r.onChangeSelection&&F.current!==A){if(null!==F.current){const e=(Array.isArray(u)?u:[]).filter(e=>A.has(e.id));r.onChangeSelection(e)}F.current=A}},[u,A,r.onChangeSelection,r]);const[O,P]=o(!1),[M,R]=o(Qt);a(()=>{(null==y?void 0:y.activeLibraryItem)&&R&&R(null==y?void 0:y.activeLibraryItem)},[null==y?void 0:y.activeLibraryItem,R]);const[L,j]=o({current:1,pageSize:12,total:0}),[D]=T.useForm(),[N]=T.useForm(),[z]=T.useForm(),[B]=T.useForm(),[U]=T.useForm(),[V]=T.useForm(),[H,W]=o(!1),[$,q]=o(!1),[G,Y]=o(!1),[X,K]=o(!1),[Z,J]=o(!1),[Q,ee]=o(!1),[te,re]=o(!1),[ne,ie]=o(null),[oe,ae]=o(null),[se,le]=o(null),ce=c(e=>{j(t=>Object.assign(Object.assign({},t),e))},[j]),ue=c(e=>{k(null!=e?e:new Set)},[k]);a(()=>{ue()},[M,ue]);const de={folders:s,files:u,selectedFolder:h,searchTerm:p,sortField:m,sortBy:b,sortOrder:x,pathHistory:_,selectedFiles:A,currentMenuFile:E,loading:O,pagination:L,isModalVisible:H,isUrlModalVisible:$,isRenameModalVisible:G,isMoveModalVisible:X,isRenameFolderModalVisible:Z,isCopyModalVisible:Q,isDeleteConfirmVisible:te,form:D,urlForm:N,renameForm:z,moveForm:B,renameFolderForm:U,copyForm:V,fileToRename:ne,folderToRename:oe,activeLibraryItem:M,multiSelect:null===(n=null==y?void 0:y.multiSelect)||void 0===n||n,undoDeletion:se},he={setFolders:l,setFiles:d,setSelectedFolder:f,setSearchTerm:g,setSortField:v,setSortBy:w,setSortOrder:C,setPathHistory:S,setSelectedFiles:ue,setLoading:P,setPagination:ce,setIsModalVisible:W,setIsUrlModalVisible:q,setIsRenameModalVisible:Y,setIsMoveModalVisible:K,setIsRenameFolderModalVisible:J,setIsCopyModalVisible:ee,setIsDeleteConfirmVisible:re,setFileToRename:ie,setFolderToRename:ae,setUndoDeletion:le,updatePathHistoryOnFolderRename:(e,t)=>{S(r=>r.map(r=>r.id===e?Object.assign(Object.assign({},r),{name:t}):r))},setActiveLibraryItem:R,setCurrentMenuFile:I},fe={state:de,actions:he,options:r};return e(yi.Provider,{value:fe,children:t})},xi=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Ci=async(e,t,r)=>{var n;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!r)return console.warn("🔍 getFolders is not available!"),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(xi);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:""}));if("folder"===(null==t?void 0:t.itemType))return a;return[...a,...e]},_i=e=>{var t,r,n,i;const{state:o,actions:s,options:l}=bi(),{searchTerm:d,sortBy:h,sortOrder:f,selectedFolder:p,pagination:g}=o,{setSearchTerm:m,setSortBy:v,setSortOrder:y,setPagination:b}=s,w=e||s.fetchFiles,x=u(null),C=u(vi.debounce(e=>{const t=JSON.stringify(e);x.current!==t&&(x.current=t,null==w||w(e))},150)).current,_=c(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:p||"",search:(null==d?void 0:d.trim())||void 0,page:t?void 0:g.current,limit:t?void 0:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}},[p,d,g.current,g.pageSize,h,f,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),S=c(e=>{var t,r;if(m&&m(e),b&&b({current:1,pageSize:g.pageSize,total:0}),w){const n={folderId:p||"",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:g.pageSize,sortBy:h,sortOrder:f,itemType:"all"};w(n)}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[m,b,g.pageSize,w,p,h,f,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),A=c((e,t)=>{var r,n;null==v||v(e),null==y||y(t),w&&C({folderId:p||"",search:(null==d?void 0:d.trim())||void 0,page:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:g.current,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:g.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[v,y,C,p,d,g.current,g.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),k=c((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(b&&b({current:e,pageSize:t||g.pageSize,total:g.total}),w&&C({folderId:p||"",search:(null==d?void 0:d.trim())||void 0,page:e,limit:t||g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}))},[b,g.pageSize,g.total,C,p,d,h,f,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return a(()=>{if(w){const e=_();C(Object.assign(Object.assign({},e),{page:1}))}},[p]),a(()=>{w&&C(_())},[]),a(()=>()=>{var e;null===(e=C.cancel)||void 0===e||e.call(C)},[C]),{state:{searchTerm:d||"",sortBy:h||"name",sortOrder:f||"asc"},actions:{setSearchTerm:m||(()=>{}),setSortBy:v||(()=>{}),setSortOrder:y||(()=>{}),handleSearch:S,handleSort:A,handlePaginationChange:k,getCurrentQueryParams:_}}},Si=()=>{var e;const{notification:t}=I.useApp(),r=bi(),{options:n}=r,i=c(async e=>{let t;if(n.handleNotify){try{t=await n.handleNotify(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&n.handleError){try{t=await n.handleError(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&n.handleSuccess){try{t=await n.handleSuccess(e)}catch(e){console.error(e)}if(t)return!1}return t},[n]),o=c(async function(e,r=!1){var o;try{void 0===e.visibility&&(e.visibility=!r);const a=await i(e);"object"==typeof a&&(e=a);if(!(!1!==e.visibility&&!1!==a&&!1!==(null===(o=n.config)||void 0===o?void 0:o.showNotifications)))return e;const s=t[e.type];"function"==typeof s?s(e):console.warn(`Unknown notification type: ${e.type}`,e)}catch(e){console.error(e)}return e},[t,i,null===(e=n.config)||void 0===e?void 0:e.showNotifications]);return d(()=>({error:(e,t=!1)=>o(Object.assign(Object.assign({},e),{type:"error"}),t),success:(e,t=!1)=>o(Object.assign(Object.assign({},e),{type:"success"}),t),warning:(e,t=!1)=>o(Object.assign(Object.assign({},e),{type:"warning"}),t),notify:o}),[o])},Ai={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid.",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 to upload.",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.",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.",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:"Request payload is too large.",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."},ki=(e,t)=>{if(!e)return;const r=Ai[e];return r?t(r):void 0},Ei=e=>{var t,r,n,i,o,a,s,l;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!==(a=null!==(o=t.message)&&void 0!==o?o:t.error)&&void 0!==a?a:t.reason,n=null!==(s=t.status)&&void 0!==s?s:t.httpStatus,i=t.code,c=t.stack,u=null!==(l=t.raw)&&void 0!==l?l:e;if(r||i||n||c||u)return{message:r,code:i,status:n,stack:c,raw:u}}return{message:String(e),raw:e}},Ii=()=>{var e,t;const{state:r,actions:i,options:o}=bi(),{t:a}=Hr(),s=Si(),{folders:l,selectedFolder:u,pathHistory:d,form:h,loading:f,isModalVisible:p}=r,{setFolders:g,setLoading:m,setIsModalVisible:v}=i,{dataProviders:y,config:b}=o,w=c(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})),[]),x=c(async()=>{null==m||m(!0);try{let e=[];const t="lazy"===(null==b?void 0:b.folderTreeLoading);if(!(null==y?void 0:y.getFolders)){if(null==y?void 0:y.getFiles){const e=async r=>{const{files:n}=await y.getFiles({itemType:"folder",folderId:r||void 0}),i=w(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(g&&g(e=>{const n=Array.isArray(e)?e:[];if(!t){const e=r,t=e.filter(e=>e.id===e.parentId);return t.length>0&&console.warn("Folders with cyclic dependencies detected:",t),e}new Set(r.map(e=>e.id));const i=n.filter(e=>e.parentId),o=[...i,...r],a=o.filter(e=>e.id===e.parentId);return a.length>0&&console.warn("Folders with cyclic dependencies detected:",a),o}))}return void console.error("DataProvider for folders is not defined")}{const r=!t;e=await y.getFolders({parentId:null,deep:r})}const r=Array.isArray(e)?e:[];null==g||g(r);const n=r.filter(e=>e.id===e.parentId);n.length>0&&console.warn("Folders with cyclic dependencies detected:",n)}catch(e){console.error("Error loading folders:",e);const t=Ei(e),r=ki(null==t?void 0:t.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=r?r:a("Failed to load folders"),placement:"bottomRight",innerException:e,data:{reason:e instanceof Error?e.message:String(e)}})}finally{null==m||m(!1)}},[null==y?void 0:y.getFiles,null==y?void 0:y.getFolders,g,m,null==b?void 0:b.folderTreeLoading,w,s,a]),C=c(async e=>{try{if(null==y?void 0:y.getFolders){const t=await y.getFolders({parentId:e,deep:!1}),r=Array.isArray(l)?l:[],n=new Set(t.map(e=>e.id)),i=r.filter(t=>t.parentId!==e||n.has(t.id)),o=[...i,...t.filter(e=>!i.some(t=>t.id===e.id))];return null==g||g(o),t}if(null==y?void 0:y.getFiles){const{files:t}=await y.getFiles({itemType:"folder",folderId:e||void 0}),r=w(t),n=Array.isArray(l)?l:[],i=new Set(r.map(e=>e.id)),o=n.filter(t=>t.parentId!==e||i.has(t.id)),a=[...o,...r.filter(e=>!o.some(t=>t.id===e.id))];return null==g||g(a),r}return[]}catch(e){return console.error("Error loading child folders:",e),[]}},[y,l,g,w]),_=c(()=>{var e;const t=null!==(e=null==b?void 0:b.defaultFolderName)&&void 0!==e?e:a("Новая папка");h.setFieldsValue({folderName:t}),null==v||v(!0)},[h,v,a,null==b?void 0:b.defaultFolderName]),S=c(async e=>{const t=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==g||g(t),e.parentId&&(await C(e.parentId),await new Promise(e=>setTimeout(e,50))),i.setSelectedFolder&&i.setSelectedFolder(e.id),i.setPathHistory){const r=Array.isArray(t)?t:[],n=(e,t=new Set)=>{if(t.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const i=r.find(t=>t.id===e);if(!i)return[];const o=new Set(t);return o.add(e),i.parentId?[...n(i.parentId,o),{id:i.id,name:i.name}]:[{id:i.id,name:i.name}]},o=n(e.id),s=[{id:"folders",name:a("Folders")},...o];i.setPathHistory(s)}},[l,g,i,r.pathHistory,C,a]),A=c(async e=>{try{if(null==y?void 0:y.getFolders){const t=await y.getFolders(),r=Array.isArray(t)?t:[];return r.some(t=>t.id===e)}if(null==y?void 0:y.getFiles){const t=new Set,r=async n=>{const{files:i}=await y.getFiles({itemType:"folder",folderId:n||void 0}),o=w(i);for(const n of o){if(t.has(n.id))continue;if(t.add(n.id),n.id===e)return!0;if(await r(n.id))return!0}return!1};return await r(null)}}catch(e){console.warn("⚠️ Error checking the folder:",e)}return!1},[null==y?void 0:y.getFolders,null==y?void 0:y.getFiles,w]),k=c(async e=>{var t;let r,n=null;try{const i=await(e?e.validateFields():h.validateFields());if(r=i.folderName.trim(),!r){const e=i.targetFolder||(u&&"folders"!==u?u: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:!!i.is_force_create}})}const o=i.targetFolder;if(o)n="folders"!==o?o:null;else if(u&&"folders"!==u)n=u;else if(Array.isArray(d)&&d.length>1){const e=d[d.length-1];n=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}let c;if(!(null==y?void 0:y.createFolder))return void s.error({id:"FOLDER_CREATE_PROVIDER_NOT_CONFIGURED",message:a("Folder creation provider is not configured"),placement:"bottomRight",data:{folderName:r,folderId:null!=n?n:null,is_force_create:!!i.is_force_create}});c=await y.createFolder({name:r,parentId:n,is_force_create:!!i.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 console.error("Обнаружена циклическая зависимость: папка является родителем сама для себя"),new Error(a("Error: folder cannot be its own parent"))})(c);const f={id:c.id,name:c.name,parentId:null!=n?n:null,childCount:c.childCount},p=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==f.id),f];if(null==g||g(p),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[f.id],folderId:null!==(t=f.parentId)&&void 0!==t?t:null,folderName:f.name}}),e||null==v||v(!1),(async()=>{try{await S(f),await x(),await new Promise(e=>setTimeout(e,200));await A(c.id)||console.warn("⚠️ Could not confirm the creation of the folder on the server, but continuing...")}catch(e){console.error("Error performing background operations after creating the folder:",e)}})(),e)return c}catch(e){console.error("❌ Error creating the folder:",e);const t=Ei(e),i=ki(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=i?i:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:r,folderId:null!=n?n:null,reason:e instanceof Error?e.message:String(e)}})}},[h,u,y,S,x,A,v,s,a,l,g]),E=c(()=>{null==v||v(!1)},[v]),I=c((e,t=new Set)=>{const r=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return console.warn(`Cycle detected in the folder structure with id=${e.id}. Skipping child elements processing.`),{key:e.id,label:e.name+" "+a("(error)"),icon:n.createElement(ae,{style:{color:"red"}})};const i=new Set(t);i.add(e.id);const o=r.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:o.length>0?I(o,i):void 0}})},[l]),T=c(()=>{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]),F=c(async(e,t)=>{var r,n,c,u;try{const d=t.trim(),h=null==l?void 0:l.find(t=>t.id===e);if(!d)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(!(!1!==(null===(r=null==b?void 0:b.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!==(n=null==h?void 0:h.name)&&void 0!==n?n:d}});if(!(null===(c=o.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 f=await o.dataProviders.renameFolder(e,d);if(!(null==f?void 0:f.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!==f.id&&i.setSelectedFolder&&i.setSelectedFolder(f.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:f.id,itemName:f.name,folderId:null!==(u=f.parentId)&&void 0!==u?u:null}})}catch(r){console.error("Error renaming the folder:",r),s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:r,data:{itemId:e,itemName:t,error:{message:r instanceof Error?r.message:String(r)}}})}},[x,l,null===(e=o.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==b?void 0:b.features)||void 0===t?void 0:t.enableRenameFolder,i.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:p,loading:f},actions:{fetchFolders:x,fetchChildFolders:C,handleCreateFolder:_,handleModalOk:k,handleModalCancel:E,generateMenuItems:T,renameFolder:F}}},Ti=()=>{const{options:e,actions:t}=bi(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:o}=Hr(),a=Si(),s=c(async({items:e,selectedFolder:t,getItemNameById:s,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).length;c+=e;const t=i.filter(e=>!e.success);return u+=t.length,void t.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=Ei(n);d.push({itemId:r,itemName:s(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(t){u+=e.length;const r=Ei(t);d.push({error:r})}else u+=e.length}return}catch(r){const n=t?"Ошибка при удалении":"Ошибка при перемещении в корзину";console.error(n,r),u+=e.length;const i=Ei(r);d.push({error:i})}const n=t?"DataProvider для удаления файлов не настроен":"DataProvider для перемещения не настроен";console.warn(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&&a.success({id:"FILES_DELETE_SUCCESS",message:o("Files deleted"),placement:"bottomRight",data:{successCount:c,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:t||null}}),u>0&&a.error({id:"FILES_DELETE_ERROR",message:o("Error when deleting a file"),placement:"bottomRight",data:{failCount:u,totalCount:e.length,itemIds:e.map(e=>e.id),itemNames:e.map(e=>s(e.id)),folderId:t||null,errors:d}})),{successCount:c,failCount:u,errorDetails:d}},[r,n,i,o,a]);return{deleteItems:s}};function Fi(e,t){return new Promise(function(r,n){let i;return Oi(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 Oi=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 Pi={},Mi={get exports(){return Pi},set exports(e){Pi=e}};!function(){var e,t,r={};Mi.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 T=0;T<m;T++)x(l,c+3*T,b.itree[1+(b.ordr[T]<<1)]);c+=3*m,c=r.F._codeTiny(v,b.itree,l,c),c=r.F._codeTiny(y,b.itree,l,c)}for(var F=a,O=0;O<n;O+=2){for(var P=t[O],M=P>>>23,R=F+(8388607&P);F<R;)c=r.F._writeLit(o[F++],E,l,c);if(0!=M){var L=t[O+1],j=L>>16,D=L>>8&255,N=255&L;x(l,c=r.F._writeLit(257+D,E,l,c),M-b.of0[D]),c+=b.exb[D],w(l,c=r.F._writeLit(N,I,l,c),j-b.df0[N]),c+=b.dxb[N],F+=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++);0!=o&&console.log("debt left")},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 T=f[u(e,_)&w];_+=15&T;var F=T>>>4;if(F>>>8==0)t[C++]=F;else{if(256==F)break;var O=C+F-254;if(F>264){var P=d.ldef[F-257];O=C+(P>>>3)+a(e,_,7&P),_+=7&P}var M=p[u(e,_)&x];_+=15&M;var R=M>>>4,L=d.ddef[R],j=(L>>>4)+o(e,_,15&L);for(_+=15&L,h&&(t=r.F._check(t,C+(1<<17)));C<O;)t[C]=t[C++-j],t[C]=t[C++-j],t[C]=t[C++-j],t[C]=t[C++-j];C=O}}}else{7&_&&(_+=8-(7&_));var D=4+(_>>>3),N=e[D-4]|e[D-3]<<8;h&&(t=r.F._check(t,C+N)),t.set(new n(e.buffer,e.byteOffset+D,N),C),_=D+N<<3,C+=N}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 Ri=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:Pi},[Pi]);const Li=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 i=0;i<n;i++)o+=`%${e.pad(t[r+i].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 t=0;t<i;t++)if(c=r+t*l,u=c+t+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 r=0;r<u;r++)for(let o=0;o<c;o++)if(a>=0&&s>=0?(d=r*t+o<<2,h=(s+r)*i+a+o<<2):(d=(-s+r)*t-a+o<<2,h=r*i+o<<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 e=s.readUint(o,a);a+=4;const t=s.readASCII(o,a,4);if(a+=4,"IHDR"==t)l(o,a,d);else if("iCCP"==t){for(var y=a;0!=o[y];)y++;s.readASCII(o,a,y-a),o[y+1];const r=o.slice(y+2,a+e);let l=null;try{l=n(r)}catch(e){l=i(r)}d.tabs[t]=l}else if("CgBI"==t)d.tabs[t]=o.slice(a,a+4);else if("IDAT"==t){for(v=0;v<e;v++)h[p+v]=o[a+v];p+=e}else if("acTL"==t)d.tabs[t]={num_frames:u(o,a),num_plays:u(o,a+4)},f=new Uint8Array(o.length);else if("fcTL"==t){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"==t){for(v=0;v<e-4;v++)f[g+v]=o[a+v+4];g+=e-4}else if("pHYs"==t)d.tabs[t]=[s.readUint(o,a),s.readUint(o,a+4),o[a+8]];else if("cHRM"==t)for(d.tabs[t]=[],v=0;v<8;v++)d.tabs[t].push(s.readUint(o,a+4*v));else if("tEXt"==t||"zTXt"==t){null==d.tabs[t]&&(d.tabs[t]={});var b=s.nextZero(o,a),w=s.readASCII(o,a,b-a),x=a+e-b-1;if("tEXt"==t)_=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[t][w]=_}else if("iTXt"==t){null==d.tabs[t]&&(d.tabs[t]={}),b=0,y=a,b=s.nextZero(o,y),w=s.readASCII(o,y,b-y);const r=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=e-((y=b+1)-a),0==r?_=s.readUTF8(o,y,x):(C=n(o.slice(y,y+x)),_=s.readUTF8(C,0,C.length)),d.tabs[t][w]=_}else if("PLTE"==t)d.tabs[t]=s.readBytes(o,a,e);else if("hIST"==t){const e=d.tabs.PLTE.length/3;for(d.tabs[t]=[],v=0;v<e;v++)d.tabs[t].push(c(o,a+2*v))}else if("tRNS"==t)3==d.ctype?d.tabs[t]=s.readBytes(o,a,e):0==d.ctype?d.tabs[t]=c(o,a):2==d.ctype&&(d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==t)d.tabs[t]=s.readUint(o,a)/1e5;else if("sRGB"==t)d.tabs[t]=o[a];else if("bKGD"==t)0==d.ctype||4==d.ctype?d.tabs[t]=[c(o,a)]:2==d.ctype||6==d.ctype?d.tabs[t]=[c(o,a),c(o,a+2),c(o,a+4)]:3==d.ctype&&(d.tabs[t]=o[a]);else if("IEND"==t)break;a+=e,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}=Li,{_bin:t}=Li,r=Li._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 s=0;s<r;s++)for(let w=0;w<t;w++){var b;h=4*(s*t+w),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&s)+(3&w)],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&&(w!=t-1&&i(_,v,h+4,7),s!=r-1&&(0!=w&&i(_,v,h+4*t-4,3),i(_,v,h+4*t,5),w!=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 T=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>T&&t==e[x-T])E[x]=E[x-T];else{let e=S[t];if(null==e&&(S[t]=e=A.length,A.push(t),A.length>=300))break;E[x]=e}}}const F=A.length;for(F<=256&&0==f&&(v=F<=2?1:F<=4?2:F<=16?4:8,v=Math.max(v,u)),b=0;b<_.length;b++){(I=_[b]).rect.x,I.rect.y,T=I.rect.width;const e=I.rect.height;let t=I.img;new Uint32Array(t.buffer);let r=4*T,n=4;if(F<=256&&0==f){r=Math.ceil(v*T/8);var O=new Uint8Array(r*e);const i=k[b];for(let t=0;t<e;t++){x=t*r;const e=t*T;if(8==v)for(var P=0;P<T;P++)O[x+P]=i[e+P];else if(4==v)for(P=0;P<T;P++)O[x+(P>>1)]|=i[e+P]<<4-4*(1&P);else if(2==v)for(P=0;P<T;P++)O[x+(P>>2)]|=i[e+P]<<6-2*(3&P);else if(1==v)for(P=0;P<T;P++)O[x+(P>>3)]|=i[e+P]<<7-1*(7&P)}t=O,m=3,n=1}else if(0==C&&1==_.length){O=new Uint8Array(T*e*3);const i=T*e;for(x=0;x<i;x++){const e=3*x,r=4*x;O[e]=t[r],O[e+1]=t[r+1],O[e+2]=t[r+2]}t=O,m=2,n=3,r=3*T}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=Ri;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 o=t;o<r;o+=4){const t=e[o]*(1/255),r=e[o+1]*(1/255),a=e[o+2]*(1/255),s=e[o+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=a,i[3]+=s,n[0]+=t*t,n[1]+=t*r,n[2]+=t*a,n[3]+=t*s,n[5]+=r*r,n[6]+=r*a,n[7]+=r*s,n[10]+=a*a,n[11]+=a*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 e=0;e<16&&(h=d.multVec(u,h),p=Math.sqrt(d.dot(h,h)),h=d.sml(1/p,h),!(0!=e&&Math.abs(p-f)<1e-9));e++)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]]};Li.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)},Li.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 n=0;n<e.length;n++)u.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[n]),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)},Li.encode.compress=u,Li.encode.dither=s,Li.quantize=g,Li.quantize.getKDtree=m,Li.quantize.getNearest=v}();const ji={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,ji._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var Di={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Ni={[Di.CHROME]:16384,[Di.FIREFOX]:11180,[Di.DESKTOP_SAFARI]:16384,[Di.IE]:8192,[Di.IOS]:4096,[Di.ETC]:8192};const zi="undefined"!=typeof window,Bi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Ui=zi&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Vi=(zi||Bi)&&(Ui&&Ui.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),Hi=(zi||Bi)&&(Ui&&Ui.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function Wi(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 $i(e){return new Promise((t,r)=>{const n=new Hi;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function qi(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function Gi(){if(void 0!==Gi.cachedResult)return Gi.cachedResult;let e=Di.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=Di.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=Di.IOS:/Safari/i.test(t)?e=Di.DESKTOP_SAFARI:/Firefox/i.test(t)?e=Di.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=Di.IE),Gi.cachedResult=e,Gi.cachedResult}function Yi(e,t){const r=Gi(),n=Ni[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 Xi(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 Ki(e,t){const{width:r,height:n}=Yi(e.width,e.height),[i,o]=Xi(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 Zi(){return void 0!==Zi.cachedResult||(Zi.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),Zi.cachedResult}function Ji(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=Ki(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 $i(e).then(function(e){try{return t=e,qi(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(Zi()||[Di.DESKTOP_SAFARI,Di.MOBILE_SAFARI].includes(Gi()))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 Qi(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=Li.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=>ji.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),Wi(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 eo(e){e.width=0,e.height=0}function to(){return new Promise(function(e,t){let r,n,i,o;return void 0!==to.cachedResult?e(to.cachedResult):Wi("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,Ji(r).then(function(a){try{return n=a[1],Qi(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,eo(n),Ji(i).then(function(r){try{return o=r[0],to.cachedResult=1===o.width&&2===o.height,e(to.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 ro(e){return new Promise((t,r)=>{const n=new Hi;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 no(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]=Xi(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),eo(e)),a}function io(e,t){const{width:r}=e,{height:n}=e,[i,o]=Xi(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),eo(e),i}function oo(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(),Ji(e,t).then(function(r){try{return[,l]=r,A(),c=no(l,t),A(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return ro(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(),to().then(function(r){try{return d=r?c:io(c,u),A(),h=t.initialQuality||1,f=t.fileType||e.type,Qi(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 u(){if(a--&&(b>s||b>v)){let t,r;return t=S?.95*_.width:_.width,r=S?.95*_.height:_.height,[x,C]=Xi(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,Qi(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,eo(_),_=x,b=w.size,k(Math.min(99,Math.floor((y-b)/(y-s)*100))),u}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()?E.call(this):e;e=u}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(u);function E(){return eo(_),eo(x),eo(c),eo(d),eo(l),k(100),n(w)}}}catch(I){return i(I)}}.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 ao;function so(e,t){return new Promise((r,n)=>{ao||(ao=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\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"));const i=new Worker(ao);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}})})}function lo(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 Vi))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 oo(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 oo(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",so(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=Fi(e,o))}catch(e){}return r(o)}})}async function co(e,t={}){const{maxSizeMB:r=.5,maxWidthOrHeight:n=2e3}=t;if(!(e&&e instanceof File))return e;if("image/gif"===e.type)return e;try{const t=await lo(e,{maxSizeMB:r,maxWidthOrHeight:n,useWebWorker:!0});return t instanceof File?t:new File([t],e.name,{type:t.type||e.type})}catch(t){return console.error("compressImageWithLimits failed",t),e}}lo.getDataUrlFromFile=$i,lo.getFilefromDataUrl=Wi,lo.loadImage=qi,lo.drawImageInCanvas=Ki,lo.drawFileInCanvas=Ji,lo.canvasToFile=Qi,lo.getExifOrientation=ro,lo.handleMaxWidthOrHeight=no,lo.followExifOrientation=io,lo.cleanupCanvasMemory=eo,lo.isAutoOrientationInBrowser=to,lo.approximateBelowMaximumCanvasSizeOfBrowser=Yi,lo.copyExifWithoutOrientation=Fi,lo.getBrowserName=Gi,lo.version="2.0.2";const uo=()=>{var e,t;const{state:r,actions:n,options:o}=bi(),a=_i(),{sortBy:s,sortOrder:l}=a.state,{actions:{fetchFolders:u}}=Ii(),{t:d}=Hr(),h=Si(),{deleteItems:f}=Ti(),{selectedFolder:p,urlForm:g,pagination:m,files:v}=r,y=i.useRef(null);y.current=m;const{setFiles:b,setLoading:w,setIsUrlModalVisible:x,setSelectedFiles:C,setActiveLibraryItem:_,setPagination:S}=n,{dataProviders:A}=o,k=c(async e=>{var t,r,n;if(!(null==A?void 0:A.getFiles))return[];const i=null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.disablePagination,{files:a,pagination:s}=await A.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,search:(null===(r=null==e?void 0:e.search)||void 0===r?void 0:r.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:i||null==e?void 0:e.page,limit:i||null==e?void 0:e.limit,itemType:(null==e?void 0:e.itemType)||"all"});return S&&((null===(n=null==o?void 0:o.config)||void 0===n?void 0:n.disablePagination)?S({current:1,pageSize:a.length||1,total:a.length||0}):s&&S({current:s.page,pageSize:s.limit,total:s.total})),a},[A,null===(e=null==o?void 0:o.config)||void 0===e?void 0:e.disablePagination,S]),E=c(async e=>{try{null==w||w(!0);let t=[];if(!(null==A?void 0:A.getFiles))return void console.error("DataProvider for getting files is not defined");t=await k(e);const r=null!=e?e:{folderId:p||"",itemType:"all"};"file"!==r.itemType&&(t=await Ci(t,r,null==A?void 0:A.getFolders)),"Trash"!==(p||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==b||b(t),null==C||C(new Set)}catch(t){console.error("Error loading files:",t);const r=Ei(t),n=ki(null==r?void 0:r.code,d);h.error({id:"FILES_FETCH_FAILED",message:null!=n?n:d("Failed to load files"),placement:"bottomRight",innerException:t,data:{params:e}})}finally{null==w||w(!1)}},[A,b,w,C,k,p,h,d]),I=c(async e=>{const t=y.current;try{const r=v.find(t=>t.id===e),n=e=>{if(!e)return;const t=v.find(t=>t.id===e);return null==t?void 0:t.name};await f({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:p,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===v.length&&(o=i.current>1?i.current-1:1),await E({folderId:p||"",page:o,limit:t.pageSize,sortBy:s,sortOrder:l})}catch(t){console.error("ОError when deleting a file:",t);const r=t;(null==r?void 0:r.notificationShown)||h.error({id:"FILES_DELETE_ERROR",message:d("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:p||null,errors:[{itemId:e,error:Ei(t)}]}})}},[f,E,p,d,h,v,s,l]),T=c(async e=>{try{const t=y.current;if(!(null==A?void 0:A.deleteFolder))return void h.error({id:"FOLDER_DELETE_ERROR",message:d("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await A.deleteFolder(e)){const e=new Error("Не удалось удалить папку");throw e.notificationShown=!1,e}h.success({id:"FOLDER_DELETE_SUCCESS",message:d("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}});p===e?await E({page:t.current,limit:t.pageSize,sortBy:s,sortOrder:l}):await E({folderId:p||"",sortBy:s,sortOrder:l,page:t.current,limit:t.pageSize})}catch(t){console.error("Error when deleting a folder:",t);const r=t;(null==r?void 0:r.notificationShown)||h.error({id:"FOLDER_DELETE_ERROR",message:d("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:Ei(t)}]}})}},[A,p,h,d,E,s,l]),F=c(async(e,t)=>{var r,n;try{if(null==A?void 0:A.getFileData){const t=await A.getFileData(e);if(t)return t;throw new Error(d("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(d("Error loading image"));return await t.blob()}}catch(i){console.error("Error when loading a file:",i);const o=v.find(t=>t.id===e);h.error({id:"FILE_DOWNLOAD_FAILED",message:d("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,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)}},[A,h,d,v]),O=c(async(e,t,n)=>{var i,a,s,l,c,u,f,g,m,v,y,b;if("Trash"===(null!=t?t:p||""))throw new Error(d("Upload to Trash is forbidden"));const w=e.name.split(".").pop()||"",x=null!=t?t:p||"";let C=e;try{if((null===(a=null===(i=e.type)||void 0===i?void 0:i.startsWith)||void 0===a?void 0:a.call(i,"image/"))&&"image/gif"!==e.type){const t=null!==(l=null===(s=null==o?void 0:o.config)||void 0===s?void 0:s.compressMaxSize)&&void 0!==l?l:.7,r=null!==(u=null===(c=null==o?void 0:o.config)||void 0===c?void 0:c.compressMaxWidthOrHeight)&&void 0!==u?u:2e3;C=await co(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:e.type})}}catch(e){console.warn("Image compression failed, uploading original file",e)}try{if(null==A?void 0:A.uploadFiles)try{const t=await A.uploadFiles({items:[{name:C.name,size:C.size,type:C.type||e.type,folderId:x,data:C,extension:w}],folderId:x});if(t.success&&t.detailed&&t.detailed.length>0){const i=t.detailed[0];if(!i.success||!i.data){if(!n){const e=(null==i?void 0:i.error)?String(i.error):d("Failed to upload file");h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:C.name,innerException:null==i?void 0:i.error,data:{itemName:C.name,folderId:x||null}})}return void(_&&_(Qt))}{const t=i.data;if(t.id){const n=(null!==(f=t.folderId)&&void 0!==f?f:x)||void 0;await E({folderId:n});let i=r.files.find(e=>e.id===t.id);if(!i)try{i=(await k({folderId:n,itemType:"file"})).find(e=>e.id===t.id)}catch(e){console.warn("uploadFileWithProvider: не удалось получить свежий список файлов",e)}return _&&_(Qt),i||Object.assign(Object.assign({},t),{id:t.id,name:t.name||C.name,folderId:null!==(m=null!==(g=t.folderId)&&void 0!==g?g:x)&&void 0!==m?m:null,type:C.type||e.type,size:C.size,extension:w||C.name.split(".").pop()||"",thumbnail:null!==(v=t.thumbnail)&&void 0!==v?v:void 0,url:null!==(y=t.url)&&void 0!==y?y:void 0,thumbnailUrl:null!==(b=t.thumbnailUrl)&&void 0!==b?b:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!n){const e=t.error?String(t.error):d("Failed to upload file");h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:C.name,innerException:t.error,data:{itemName:C.name,folderId:x||null}})}return void(_&&_(Qt))}return void(_&&_(Qt))}catch(e){throw e}if(null==A?void 0:A.uploadFile){const t=await A.uploadFile({name:C.name,size:C.size,type:C.type||e.type,folderId:x,data:C,extension:w});return _&&_(Qt),t}return void(n||h.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:d("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=Ei(e),r=ki(null==t?void 0:t.code,d);return n?void 0:void h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=r?r:d("Failed to upload file"),placement:"bottomRight",description:C.name,innerException:e,data:{itemName:C.name,folderId:x||null,error:Ei(e)}})}},[A,p,_,r.files,E,k,h,d]),P=c(async(e,t)=>{var r;if(!(null==A?void 0:A.getFolders)||!(null==A?void 0:A.createFolder))return e||"";try{const n=await A.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 A.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 console.warn("ensureFolderPath: unable to guarantee the path",t),e||""}},[A]),M=c(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 P(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[P]),R=c(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 M(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)}},[M]),L=c(async(e,t)=>{var r,n,i,a,s,l,c,u,f,g,m,v,y,b,w,x,C,S,k,E,I,T,F,O,P,R,L,j,D,N;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 z=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},B=[];for(let r=0;r<e.length;r++){const d=e[r];if(!(null===(i=null===(n=d.type)||void 0===n?void 0:n.startsWith)||void 0===i?void 0:i.call(n,"image/"))){const e=await h.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:"Unsupported file type",placement:"bottomRight",data:{itemName:d.name,fileType:d.type,folderId:p||null}});null===(a=null==t?void 0:t.onError)||void 0===a||a.call(t,d.name,e.message);continue}let v=d;try{if((null===(l=null===(s=d.type)||void 0===s?void 0:s.startsWith)||void 0===l?void 0:l.call(s,"image/"))&&"image/gif"!==d.type){const e=null!==(u=null===(c=null==o?void 0:o.config)||void 0===c?void 0:c.compressMaxSize)&&void 0!==u?u:.7,t=null!==(g=null===(f=null==o?void 0:o.config)||void 0===f?void 0:f.compressMaxWidthOrHeight)&&void 0!==g?g:2e3;v=await co(d,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:d.type})}}catch(e){console.warn("Image compression failed, uploading original file",e)}const y=`${Date.now()}-${r}-${Math.random().toString(36).slice(2,8)}`,b=await M(v,p);null===(m=null==t?void 0:t.onStart)||void 0===m||m.call(t,v),B.push({file:v,targetFolderId:b,requestId:y})}const U=B.length;if(0===U)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const V=!t,H=1===U&&V,W=[],$=[],q=[],G=[],Y=new Map;let X=0,K=0;const Z=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};X++,W.push(e),$.push(null!=n?n:e),await((e,t,r,n)=>{var i;return h.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${d("File")} ${e} ${d("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:p)&&void 0!==i?i:null}},n||!V)})(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))},J=async(e,r,n,i,o)=>{var a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=o?o:{};K++;const c=Ei(i),u=await((e,t,r,n,i)=>{var o;const a=Ei(n),s=ki(null==a?void 0:a.code,d);return h.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=s?s:d("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(o=null!=t?t:p)&&void 0!==o?o:null,error:a},innerException:n},i||!V)})(e,r,0,i,!l);s&&(null===(a=null==t?void 0:t.onError)||void 0===a||a.call(t,e,u.message)),G.push({itemId:void 0,itemName:e,error:c}),q.push({fileName:e,error:u.message})};if(!(null==A?void 0:A.uploadFiles))return h.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:d("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:U,successes:[],errors:[],totalCount:U};try{const e=await A.uploadFiles({items:B.map(e=>{var t,r;return{requestId:e.requestId,name:e.file.name,size:e.file.size,type:e.file.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:p)&&void 0!==r?r:null,data:e.file,extension:e.file.name.split(".").pop()||""}}),folderId:null!=p?p:null}),t=null!==(v=e.detailed)&&void 0!==v?v:[],r=new Map(t.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(t.length>0)for(let e=0;e<B.length;e++){const n=B[e],i=null!==(y=n.requestId?r.get(n.requestId):void 0)&&void 0!==y?y:t[e];if(i&&i.success){const e=i.data,t=n.file.name,r=null!==(x=null!==(w=null!==(b=null==e?void 0:e.folderId)&&void 0!==b?b:n.targetFolderId)&&void 0!==w?w:p)&&void 0!==x?x:null,o=null==e?void 0:e.id;Y.set(t,{id:o,name:null!==(C=null==e?void 0:e.name)&&void 0!==C?C:t,folderId:r}),await Z(t,r,o,{emitNotification:H})}else{(null==i?void 0:i.error)?String(i.error):d("Error uploading file");const e=null==i?void 0:i.data,t=n.file.name,r=null!==(E=null!==(k=null!==(S=null==e?void 0:e.folderId)&&void 0!==S?S:n.targetFolderId)&&void 0!==k?k:p)&&void 0!==E?E:null;await J(t,r,0,null==i?void 0:i.error,{emitNotification:H})}}else if(e.success)for(const e of B){const t=e.file.name,r=null!==(T=null!==(I=e.targetFolderId)&&void 0!==I?I:p)&&void 0!==T?T:null;await Z(t,r,void 0,{emitNotification:H})}else{e.error?String(e.error):d("Error uploading file");for(const t of B){const r=t.file.name,n=null!==(O=null!==(F=t.targetFolderId)&&void 0!==F?F:p)&&void 0!==O?O:null;await J(r,n,0,e.error,{emitNotification:H})}}}catch(e){e instanceof Error?e.message:String(e);for(const t of B){const r=t.file.name,n=null!==(R=null!==(P=t.targetFolderId)&&void 0!==P?P:p)&&void 0!==R?R:null;await J(r,n,0,e,{emitNotification:H})}}if(X>0&&(_&&_(Qt),U>1&&V)){const e=z(W),t=e?d("Uploaded",{names:e}):d("uploads_success_summary",{successCount:X,totalCount:U});h.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:X,totalCount:U,itemIds:$,itemNames:W,folderId:null!=p?p:null}})}if(K>0&&!H&&V)if(U>1){const e=q.map(e=>e.fileName),t=z(e),r=t?d("Failed",{names:t}):d("uploads_fail_summary",{failCount:K,totalCount:U});h.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:K,totalCount:U,itemNames:e,folderId:null!=p?p:null,errors:G}})}else if(1===U&&G.length>0&&(null===(L=G[0].error)||void 0===L?void 0:L.code)){const e=ki(null===(j=G[0].error)||void 0===j?void 0:j.code,d),t=null!==(N=null===(D=q[0])||void 0===D?void 0:D.fileName)&&void 0!==N?N:"",r=null!=e?e:t?`${d("Failed to upload files")}: ${t}`:d("Failed to upload files");h.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:K,totalCount:U,itemNames:[t],folderId:null!=p?p:null,errors:G}})}return{successCount:X,failCount:K,successes:W,errors:q,totalCount:U,uploadedFiles:Y.size>0?Y:void 0}},[A,null==A?void 0:A.uploadFiles,h,M,p,_,d,R,O]),j=c(async e=>{var t;if(!(null==A?void 0:A.uploadFiles))return void h.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:d("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===p)return void h.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:d("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:p||null,reason:"Upload to Trash is not allowed"}});const r=y.current,n=document.createElement("input");n.type="file",n.accept="image/*",n.multiple=!0;try{!(!(null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.features)||!o.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==w||w(!0);const{successes:t,errors:i,uploadedFiles:a}=await L(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 u(),await E({folderId:p||"",sortBy:s,sortOrder:l,page:r.current,limit:r.pageSize})}catch(e){console.error("Error when loading files:",e)}finally{null==w||w(!1)}},n.click()},[null==A?void 0:A.uploadFile,null==A?void 0:A.uploadFiles,p,h,d,w,E,u,s,l,L,null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.features]),D=c(async(e,t,r)=>{const n=y.current;let i,o=null!=e?e:null;try{if(!t&&"Trash"===p)return void(r||h.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:d("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:p||null,reason:"Upload to Trash is not allowed"}}));let e;if(!o&&g&&(e=await g.validateFields(),o=null==e?void 0:e.fileUrl),!o)return void(r||h.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:d("Please fill in all fields"),placement:"bottomRight",data:{url:null!=o?o:null,folderId:p||null}}));if(null==w||w(!0),!(null==A?void 0:A.uploadFileByUrl))return void(r||h.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:d("Upload by URL is not supported"),placement:"bottomRight",data:{url:o,folderId:p||null}}));i=await A.uploadFileByUrl({url:o,folderId:p||"",noFolder:t});const a=(null==e?void 0:e.name)||(null==i?void 0:i.name)||"unnamed file";return r||h.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${d("File")} ${a} ${d("successfully uploaded")}`,placement:"bottomRight",data:{itemName:a,itemId:null==i?void 0:i.id,folderId:p||null}}),e&&(null==x||x(!1),null==g||g.resetFields()),_&&_(Qt),await E({folderId:p||"",sortBy:s,sortOrder:l,page:n.current,limit:n.pageSize}),i}catch(e){console.error("Error when loading a file by URL:",e),r||h.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:d("Error when downloading a file by URL"),placement:"bottomRight",data:{url:null!=o?o:null,folderId:p||null,error:Ei(e)},innerException:e})}finally{null==w||w(!1)}},[g,w,A,h,d,x,_,E,p,s,l]),N=c(async e=>{if(!e.length)return;const t=y.current;"Trash"!==p?(await L(e),await E({folderId:p||"",sortBy:s,sortOrder:l,page:t.current,limit:t.pageSize})):h.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:d("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:p||null,reason:"Upload to Trash is not allowed"}})},[E,p,s,l,L,h,d]);return{fetchFiles:E,handleDeleteFile:I,handleDeleteFolder:T,handleAddFile:j,handleAddFileByUrl:D,handleDroppedFiles:N,getFileData:F,uploadFileWithProvider:O}},ho=e=>{var t,r,n,i;const{state:o,actions:a,options:s}=bi(),{t:l}=Hr(),u=Ii(),d=Si(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=bi(),{dataProviders:t}=e,{t:r}=Hr(),n=c(async({itemId:e,newName:n,isFolder:i})=>{var o,a,s,l,c,u,d,h;try{if(i){if(!(null==t?void 0:t.renameFolder))throw new Error(r("renameFolder is not implemented in dataProviders"));const i=await t.renameFolder(e,n.trim());return{success:!0,renamedItem:{id:i.id,name:null!==(o=i.name)&&void 0!==o?o:n,parentId:null!==(a=i.parentId)&&void 0!==a?a:null,folderId:null!==(s=i.parentId)&&void 0!==s?s:null}}}if(!(null==t?void 0:t.renameFile))throw new Error(r("renameFile is not implemented in dataProviders"));const f=await t.renameFile(e,n);return{success:!0,renamedItem:{id:null!==(l=null==f?void 0:f.id)&&void 0!==l?l:e,name:null!==(c=null==f?void 0:f.name)&&void 0!==c?c:n,folderId:null!==(u=null==f?void 0:f.folderId)&&void 0!==u?u:null,parentId:null!==(h=null!==(d=null==f?void 0:f.parentId)&&void 0!==d?d:null==f?void 0:f.folderId)&&void 0!==h?h:null}}}catch(e){return{success:!1,error:Ei(e)}}},[t,r]);return{renameItem:n}})(),{files:p,selectedFolder:g,fileToRename:m,renameForm:v,isRenameModalVisible:y,pagination:b}=o,{setFileToRename:w,setIsRenameModalVisible:x}=a,{dataProviders:C,config:_}=s,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=c(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:l("Folder rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFolder))throw new Error(l("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:l("File rename is disabled by config"),placement:"bottomRight",data:A(n,e)});if(!(null==C?void 0:C.renameFile))throw new Error(l("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,l]),E=c(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),I=c(async()=>{var t,r,n,i,o,s,c,u,y;if(!m||!v)return;const w=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 x=(null==w?void 0:w.isFolder)||m.startsWith("folder_");if(x){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:l("Folder rename is disabled by config"),placement:"bottomRight",data:A(w,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:l("File rename is disabled by config"),placement:"bottomRight",data:A(w,m)})}const C=await f({itemId:m,newName:p.newFileName,isFolder:x});if(!C.success){const e=ki(null===(n=C.error)||void 0===n?void 0:n.code,l);return void d.error({id:"ITEM_RENAME_FAILED",message:null!==(o=null!=e?e:null===(i=C.error)||void 0===i?void 0:i.message)&&void 0!==o?o:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(w,m)),{error:C.error}),innerException:C.error})}const S=C.renamedItem;x?(d.success({id:"FOLDER_RENAME_SUCCESS",message:l(`${l("Folder renamed to")} ${p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(s=null==S?void 0:S.id)&&void 0!==s?s:m,itemName:null!==(c=null==S?void 0:S.name)&&void 0!==c?c:p.newFileName,folderId:null!==(y=null!==(u=null==S?void 0:S.parentId)&&void 0!==u?u:null==S?void 0:S.folderId)&&void 0!==y?y:null}}),await h(),(null==S?void 0:S.id)&&S.id!==m&&a.setSelectedFolder&&a.setSelectedFolder(S.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${l("File renamed to")} ${p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},A(w,m)),{itemName:p.newFileName})}),E(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){console.error("Error when renaming:",e);const t=Ei(e),r=ki(null==t?void 0:t.code,l);d.error({id:"ITEM_RENAME_FAILED",message:null!=r?r:e instanceof Error?e.message:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},A(w,m)),{error:t}),innerException:e})}},[m,v,p,a,E,e,g,l,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}}},fo=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}},po=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),go=(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}),mo=()=>{const e=Si(),{t:t}=Hr(),{actions:{fetchFolders:r,fetchChildFolders:n}}=Ii();return{refreshFolders:c(async({parentIds:i,selectedFolder:o})=>{try{if(await r(),i&&n)for(const e of i)e&&await n(e)}catch(r){console.error("Error when updating the folder tree:",r),e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh folder tree"),placement:"bottomRight",innerException:r,data:{params:{folderId:o||void 0}}})}},[e,t]),refreshFiles:c(async({fetchFiles:r,selectedFolder:n,page:i,limit:o})=>{try{await r({folderId:n||"",page:i,limit:o})}catch(r){console.error("Ошибка при обновлении списка файлов:",r),e.error({id:"FILES_FETCH_FAILED",message:t("Failed to refresh file list"),placement:"bottomRight",innerException:r,data:{params:{folderId:n||void 0,page:i,limit:o}}})}},[e,t])}},vo=()=>{var e,t;const{state:r,actions:n,options:i}=bi(),{selectedFolder:o,pathHistory:a,folders:s}=r,{t:l}=Hr(),{setSelectedFolder:u,setPathHistory:d}=n,h=c(()=>{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=c((e,t=new Set)=>{if(t.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const r=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!r)return[];const n=new Set(t);return n.add(e),r.parentId?r.parentId===r.id?(console.warn(`Cycle detected: folder ${r.id} is a parent of itself`),[{id:r.id,name:r.name+" (ошибка)"}]):[...f(r.parentId,n),{id:r.id,name:r.name}]:[{id:r.id,name:r.name}]},[s]),p=c(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=c(e=>{if("folders"===e){const e=[{id:"folders",name:l("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}const t=(Array.isArray(s)?s:[]).find(t=>t.id===e);if(!t)return void console.warn("⚠️ Folder not found:",e);const r=f(e),n=[{id:"folders",name:l("Folders")},...r];null==d||d(n),i.onPathChange&&i.onPathChange(n.map(e=>e.name))},[s,f,d,i,l]),m=c(e=>{const t="folders"===e?null:e;t!==o&&(null==u||u(t),p(t),g(e))},[p,o,u,g]),v=c(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:l("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=a.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,a,d,u,l]),y=c(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...a,t];d(e)}if(i.onPathChange){const t=[...a.map(e=>e.name),e.name];i.onPathChange(t)}},[i,a,d,u]);return{state:{selectedFolder:o,pathHistory:a},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:o,pathHistory:a,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}},yo=e=>{const{state:t,actions:r}=bi(),{t:n}=Hr(),i=Si(),{files:o,selectedFolder:a,selectedFiles:s,moveForm:l,pagination:u,currentMenuFile:d}=t,{setIsMoveModalVisible:h,setSelectedFiles:f,setPagination:p}=r,{moveItems:g}=(()=>{const{options:e}=bi(),{dataProviders:t}=e,{t:r}=Hr(),n=Si(),i=c(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=Ei(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=Ei(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Ei(t);c.push({error:r})}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:m,refreshFiles:v}=mo(),{handleFolderSelect:y}=vo(),{getItemNameById:b,getItemNamesByIds:w,getNamesPreview:x}=fo(o),C=c(()=>{null==h||h(!0)},[h]),_=c(()=>{null==h||h(!1),null==l||l.resetFields()},[h,l]),S=c(async t=>{var r,c,h;if(!((null==d?void 0:d.length)||s&&0!==s.size))return;const C=o.length,S=Object.assign({},u),A=Array.from((null==d?void 0:d.length)?[d]:s),k=A.length;let E=0,I=0;const T=[],F=A.map(e=>o.find(t=>t.id===e)).filter(e=>Boolean(e)),O=F.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let o=t;if(!t){const e=await l.validateFields();o=null==e?void 0:e.targetFolder}if(!o)return void i.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:n("Select destination folder"),placement:"bottomRight"});const s="folders"===o?null:o,u=null!=s?s:a,d=await g({items:F,targetFolderId:o,getItemNameById:b,showNotifications:!1});if(E=d.successCount,I=d.failCount,T.push(...d.errorDetails),E>0){const e=w(A),t=x(e),r=t?n("Moved",{names:t}):n("move_success_summary",{successCount:E,totalCount:k});i.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:po(A,E,k,s,e)})}if(I>0){const e=w(A),t=x(e);let o;if(1===k&&T.length>0&&(null===(r=T[0].error)||void 0===r?void 0:r.code)){const e=ki(null===(c=T[0].error)||void 0===c?void 0:c.code,n);o=null!=e?e:t?n("Failed",{names:t}):n("move_fail_summary",{failCount:I,totalCount:k})}else o=t?n("Failed",{names:t}):n("move_fail_summary",{failCount:I,totalCount:k});i.error({id:"FILES_MOVE_ERROR",message:o,placement:"bottomRight",innerException:T.length?T:void 0,data:go(A,I,k,s,T.length?T:void 0,e)})}_(),null==f||f(new Set);let P=S.current;if(E>0&&C>0&&E>=C&&S.current>1&&(P=S.current-1),E>0&&S.total>=E){const e=Math.max(0,(null!==(h=S.total)&&void 0!==h?h:0)-E);null==p||p({current:P,pageSize:S.pageSize,total:e})}O&&await m({parentIds:void 0,selectedFolder:u});const M=null!=s?s:"folders";M!==(null!=a?a:"folders")&&y(M),await v({fetchFiles:e,selectedFolder:u,page:P,limit:S.pageSize})}catch(e){console.error("Error when moving:",e);const t=ki(Ei(e).code,n);i.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=t?t:n("Error moving"),placement:"bottomRight",data:go(A,k,k,a||null,[{error:Ei(e)}],w(A))})}},[d,s,l,f,e,a,u,o,i,p,n,g,h,y]);return{actions:{showMoveModal:C,handleMoveCancel:_,handleMoveOk:S}}},bo=e=>{const{state:t,actions:r}=bi(),{t:n}=Hr(),i=Si(),{files:o,selectedFolder:a,selectedFiles:s,copyForm:l,pagination:u,currentMenuFile:d}=t,{setIsCopyModalVisible:h,setSelectedFiles:f}=r,{copyItems:p}=(()=>{const{options:e}=bi(),{dataProviders:t}=e,{t:r}=Hr(),n=Si(),i=c(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=>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=Ei(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=Ei(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Ei(t);c.push({error:r})}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})?s++:l++}catch(e){l++;const t=Ei(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:g,refreshFiles:m}=mo(),{handleFolderSelect:v}=vo(),{getItemNameById:y,getItemNamesByIds:b,getNamesPreview:w}=fo(o),x=c(()=>{null==h||h(!0)},[h]),C=c(()=>{null==h||h(!1),null==l||l.resetFields()},[h,l]),_=c(async t=>{var r,c;if(!((null==d?void 0:d.length)||s&&0!==s.size))return;const h=Array.from((null==d?void 0:d.length)?[d]:s),x=h.length;let _=0,S=0;const A=[],k=h.map(e=>o.find(t=>t.id===e)).filter(e=>Boolean(e)),E=k.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let o=t;if(!t){const e=await l.validateFields();o=null==e?void 0:e.targetFolder}if(!o)return void i.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:n("Select destination folder"),placement:"bottomRight"});const s="folders"===o?null:o,d=null!=s?s:a,I=await p({items:k,targetFolderId:o,getItemNameById:y,showNotifications:!1});if(_=I.successCount,S=I.failCount,A.push(...I.errorDetails),_>0){const e=b(h),t=w(e),r=t?n("Copied",{names:t}):n("copy_success_summary",{successCount:_,totalCount:x});i.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:po(h,_,x,s,e)})}if(S>0){const e=b(h),t=w(e);let o;if(1===x&&A.length>0&&(null===(r=A[0].error)||void 0===r?void 0:r.code)){const e=ki(null===(c=A[0].error)||void 0===c?void 0:c.code,n);o=null!=e?e:t?n("Failed",{names:t}):n("copy_fail_summary",{failCount:S,totalCount:x})}else o=t?n("Failed",{names:t}):n("copy_fail_summary",{failCount:S,totalCount:x});i.error({id:"FILES_COPY_ERROR",message:o,placement:"bottomRight",innerException:A.length?A:void 0,data:go(h,S,x,s,A.length?A:void 0,e)})}C(),null==f||f(new Set),E&&await g({parentIds:void 0,selectedFolder:d});const T=null!=s?s:"folders";T!==(null!=a?a:"folders")&&v(T),await m({fetchFiles:e,selectedFolder:d,page:u.current,limit:u.pageSize})}catch(e){console.error("Error when copying:",e);const t=ki(Ei(e).code,n);i.error({id:"FILES_COPY_ERROR",message:null!=t?t:n("Error copying"),innerException:e,placement:"bottomRight",data:go(h,x,x,a||null,[{error:Ei(e)}],b(h))})}},[d,s,l,f,e,a,u,o,i,n,p,h,v]);return{actions:{showCopyModal:x,handleCopyCancel:C,handleCopyOk:_}}},wo=e=>{const t=ho(e),r=yo(e),n=bo(e),i=(e=>{const{state:t,actions:r,options:n}=bi(),{t:i}=Hr(),o=Si(),{files:a,selectedFolder:s,selectedFiles:l,pagination:u,currentMenuFile:d}=t,{setSelectedFiles:h,setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=Ti(),{refreshFolders:y,refreshFiles:b}=mo(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=fo(a),_=c(()=>{null==f||f(!0)},[f]),S=c(()=>{null==f||f(!1)},[f]),A=c(async()=>{var t,r,n;if(!((null==d?void 0:d.length)||l&&0!==l.size))return void(null==f||f(!1));const c=a.length,_=Object.assign({},u),S=Array.from(d?[d]:l),A=S.map(e=>a.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 T=[];try{const a=await v({items:A,selectedFolder:s,getItemNameById:w,showNotifications:!1});E=a.successCount,I=a.failCount,T.push(...a.errorDetails);const l=(null==m?void 0:m.enableTrashFolder)&&"Trash"===s;if(E>0&&(null==m?void 0:m.enableTrashFolder)&&!l&&(null==p||p({itemIds:S,sourceFolderId:s||"folders"})),E>0){const e=S.length;(null==m?void 0:m.enableTrashFolder)&&!l?await o.success({id:"FILES_DELETE_SUCCESS",message:i("moved_to_trash",{count:E}),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:s||null}}):await o.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:E,totalCount:e,itemIds:S,folderId:s||null}})}if(I>0){const e=x(S),n=C(e),a=S.length,s=1===a&&T.length>0&&(null===(t=T[0].error)||void 0===t?void 0:t.code),c=(null==m?void 0:m.enableTrashFolder)&&!l,u=i(c?"При перемещении в корзину произошли ошибки":"При удалении произошли ошибки"),d=s?ki(null===(r=T[0].error)||void 0===r?void 0:r.code,i):void 0,h=null!=d?d:n?i("Failed",{names:n}):u;o.error({id:"FILES_DELETE_ERROR",message:h,placement:"bottomRight",innerException:T.length?T:void 0,data:{failCount:I,isTrashMove:c,totalCount:a,itemNames:e,errors:T.length?T:void 0}})}null==h||h(new Set),null==f||f(!1),await y({parentIds:Array.from(k),selectedFolder:s});let u=_.current;if(E>0&&c>0&&E>=c&&_.current>1&&(u=_.current-1),E>0&&_.total>=E){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-E);null==g||g({current:u,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:s,page:u,limit:_.pageSize})}catch(e){console.error("Error when deleting:",e),o.error({id:"FILES_DELETE_ERROR",message:i("Error deleting"),placement:"bottomRight",innerException:e,data:{failCount:I,totalCount:A.length}})}},[d,l,f,e,s,u,p,g,a,i,o,v,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)}},xo=()=>{const{state:e}=bi(),{files:t,loading:r,isUrlModalVisible:n}=e,i=uo(),o=(()=>{const{state:e,actions:t}=bi(),{selectedFiles:r,files:n,multiSelect:i}=e,{setSelectedFiles:o}=t,a=u(null),s=c((e,t,r)=>{const i=Array.isArray(n)?n:[],o=i.findIndex(t=>t.id===e),a=i.findIndex(e=>e.id===t);if(-1===o||-1===a)return r;const[s,l]=o<a?[o,a]:[a,o],c=i.slice(s,l+1).map(e=>e.id),u=new Set(r);return c.forEach(e=>u.add(e)),u},[n]),l=c((e,t)=>{if(!r||!o)return;const n=!1!==i,l=!!(null==t?void 0:t.shiftKey)&&n&&a.current;let c=new Set(n?r:[]);l&&a.current?c=s(a.current,e,c):c.has(e)?c.delete(e):c.add(e),a.current=e,o(c)},[i,r,o,s]);return{state:{selectedFiles:r||new Set},actions:{toggleFileSelection:l}}})(),a=wo(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.state.selectedFiles,loading:r||!1,isAddingFileByUrl:n||!1,isRenamingFile:a.state.isRenamingFile,fileToRename:a.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:o.actions.toggleFileSelection,showRenameModal:a.actions.showRenameModal,handleRenameCancel:a.actions.handleRenameCancel,handleRenameOk:a.actions.handleRenameOk,showMoveModal:a.actions.showMoveModal,handleMoveCancel:a.actions.handleMoveCancel,handleMoveOk:a.actions.handleMoveOk,showCopyModal:a.actions.showCopyModal,handleCopyCancel:a.actions.handleCopyCancel,handleCopyOk:a.actions.handleCopyOk,showDeleteConfirm:a.actions.showDeleteConfirm,handleDeleteConfirmCancel:a.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:a.actions.handleDeleteConfirmOk}}},Co="filemanager_sidebar_width",_o=({onSearch:t,placeholder:r,className:n})=>{const{t:i}=Hr(),[s,l]=o(""),c=u(null),{options:d}=bi(),{config:h}=d,f=r||i("Search files...");a(()=>(c.current=vi.debounce(e=>{t(e)},500),()=>{var e;null===(e=c.current)||void 0===e||e.cancel()}),[t]);return e(F,{value:s,onChange:e=>{var t;const r=e.target.value;l(r),null===(t=c.current)||void 0===t||t.call(c,r)},placeholder:f,prefix:e(ci,{size:16,strokeWidth:null==h?void 0:h.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{l(""),t("")}})},So=new Map,Ao=(e,t)=>{So.set(e,t),So.size>350&&(Array.from(So.keys()).slice(0,50).forEach(e=>So.delete(e)),console.warn("Image cache cleared. Removed 50 oldest records."))},ko=e=>{if(e.type&&e.type.startsWith("image/"))return!0;if(e.name){const t=e.name.toLowerCase().split(".").pop();return ur.includes(t||"")}return!1},Eo=({thumbnailSrc:t,previewSrc:r,alt:n,className:s,width:l,height:u,preview:d=!1,file:h})=>{const{t:f}=Hr(),p=uo(),[g,m]=o(!1),v=null==h?void 0:h.id,y=null==h?void 0:h.type,b=null==h?void 0:h.name,[w,x]=o(t),[C,_]=o(r),[S,A]=o(!1),[k,E]=o(!1),I=i.useRef(!1),T=i.useRef(!1),F=i.useRef(!1),P=c(async(e,t,r)=>{if((e=>So.has(e))(e))return(e=>So.get(e))(e);if(!e||t&&!ko({type:t}))return console.warn("File is not an image:",r,t),dr;try{const t=await p.getFileData(e,!0);if(!t)throw new Error(f("Error loading image"));return new Promise((r,n)=>{const i=new FileReader;i.onload=()=>{const t=i.result;Ao(e,t),r(t)},i.onerror=()=>n(new Error("Ошибка чтения файла")),i.readAsDataURL(t)})}catch(e){throw console.error("Error loading the image:",e),e}},[p.getFileData,f]),M=c(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),R=c(e=>{if(e&&e!==dr)return e.startsWith("data:image/")?M(e)?e:void console.warn("Invalid base64 data:",e.substring(0,50)+"..."):e.startsWith("blob:")||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:void 0},[M]);a(()=>{A(!1),m(!1),E(!1),I.current=!1,T.current=!1,F.current=!1;const e=R(t);e?x(e):v&&ko({name:b,type:y})&&!F.current?(F.current=!0,E(!0),A(!0),P(v,y,b).then(e=>{x(e),A(!1)}).catch(()=>{x(dr),m(!0),A(!1)}).finally(()=>E(!1))):(x(dr),m(!0));const n=R(r);if(n)_(n);else{const e=R(t);e?_(e):v&&ko({name:b,type:y})?P(v,y,b).then(e=>{_(e)}).catch(()=>{_(dr)}):_(dr)}},[t,r,v,y,b,P,R]);const L=c(()=>{if(w!==dr){if(console.warn("Error loading the image:",(null==w?void 0:w.substring(0,50))+"..."),I.current)return x(dr),void m(!0);I.current=!0,v&&ko({name:b,type:y})&&!F.current?(F.current=!0,E(!0),A(!0),P(v,y,b).then(e=>{x(e),m(!1),A(!1)}).catch(()=>{x(dr),m(!0),A(!1)}).finally(()=>E(!1))):(x(dr),m(!0))}},[w,v,y,b,P]);c(()=>{if(C===dr)return;if(console.warn("Error loading preview image:",(null==C?void 0:C.substring(0,50))+"..."),T.current)return void _(dr);T.current=!0;const e=R(t);e&&!I.current?_(e):v&&ko({name:b,type:y})?P(v,y,b).then(e=>{_(e)}).catch(()=>{_(dr)}):_(dr)},[C,t,v,y,b,P,R]);const j=c(()=>{if(C&&C!==dr&&!T.current)return C;const e=R(t);return e&&!I.current?e:cr},[C,t,R]),D=w===dr?cr:w,N=j()||cr;return e(O,{className:s,src:D,alt:n,width:l,height:u,preview:d&&{src:N,toolbarRender:()=>null,destroyOnHidden:!0,mask:e(se,{style:{fontSize:"20px"}})},onError:L,fallback:cr,loading:S?"lazy":void 0})},Io=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),To=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),Fo=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),Oo=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),Po=()=>t("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[e("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"}),e("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"}),e("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"}),e("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"})]}),Mo=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Ro=()=>e("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:e("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"})}),Lo=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),jo=()=>t("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"}),e("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"})]}),Do=()=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),No=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),zo=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),e("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"})]}),Bo=()=>t("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),e("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"})]}),Uo=()=>t("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("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"}),e("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"})]}),Vo=()=>e("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})}),Ho=t=>e(ie,Object.assign({component:Io},t)),Wo=t=>e(ie,Object.assign({component:To},t)),$o=t=>e(ie,Object.assign({component:Fo},t)),qo=t=>e(ie,Object.assign({component:Oo},t)),Go=t=>e(ie,Object.assign({component:Po},t)),Yo=t=>e(ie,Object.assign({component:Mo},t)),Xo=t=>e(ie,Object.assign({component:Ro},t)),Ko=t=>e(ie,Object.assign({component:Lo},t)),Zo=t=>e(ie,Object.assign({component:jo},t)),Jo=t=>e(ie,Object.assign({component:Do},t)),Qo=t=>e(ie,Object.assign({component:No},t)),ea=t=>e(ie,Object.assign({component:zo},t)),ta=t=>e(ie,Object.assign({component:Bo},t)),ra=t=>e(ie,Object.assign({component:Uo},t)),na=t=>e(ie,Object.assign({component:Vo},t)),ia=()=>{const{options:e}=bi(),{customIcons:t}=e,r=(e,r,n)=>{const o=null==t?void 0:t[e];return o?i.createElement(o,n):i.createElement(r,n)};return{RootFolderIcon:e=>r("rootFolder",ae,e),FolderIcon:e=>r("folder",Ko,e),FolderOpenIcon:e=>r("folderOpen",me,e),AddFolderIcon:e=>r("addFolder",ge,e),FileIcon:e=>r("file",pe,e),UploadIcon:e=>r("upload",fe,e),UploadByUrlIcon:e=>r("uploadByUrl",he,e),ExpandArrowIcon:e=>r("expandArrow",de,e),CollapseArrowIcon:e=>r("collapseArrow",ue,e),ExpandFolderIcon:e=>r("expandArrow",ei,e),CollapseFolderIcon:e=>r("collapseArrow",Qn,e),FolderPreviewIcon:e=>r("folderPreview",Zo,e),EmptyFolderIcon:e=>r("folderPreview",Jo,e),GridViewIcon:e=>r("gridView",ce,e),ListViewIcon:e=>r("listView",le,e),DropZoneFileIcon:e=>r("folderPreview",Qo,e),BigStockIcon:e=>r("folderPreview",ea,e),BigAIIcon:e=>r("folderPreview",ta,e),GifPlayIcon:e=>r("folderPreview",ra,e),StockBigIcon:e=>r("folderPreview",na,e),MixedViewIcon:e=>r("mixedView",Ho,e),LandscapeViewIcon:e=>r("landscapeView",Wo,e),PortraitViewIcon:e=>r("portraitView",$o,e),SquareViewIcon:e=>r("squareView",qo,e),LightModeIcon:e=>r("lightMode",Yo,e),DarkModeIcon:e=>r("darkMode",Xo,e),AiIcon_2:e=>r("aiIcon_2",Go,e),NoFilesIcon:e=>r("noFiles",ti,e),getCustomIcon:r}};var oa="noFilesContainer",aa="noFilesImage",sa="noFilesTitle",la="noFilesDescription";const ca=()=>{const{t:r}=Hr(),{NoFilesIcon:n}=ia();return t("div",{className:oa,children:[e(n,{className:aa,size:48,strokeWidth:1.4}),e("h2",{className:sa,children:r("There's nothing here")}),e("div",{className:la,children:r("Try using a different search query.")})]})},ua="filemanager_view_mode";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 da=e=>{if(!e||e<=0)return"";const t=1048576;if(e<t){return`${Math.round(e/1024)} Kb`}return`${(e/t).toFixed(2)} Mb`};var ha={headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",noFiles:"noFiles",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",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",noFilesIcon:"noFilesIcon",textTitle_trash:"textTitle_trash",textDescription_trash:"textDescription_trash"};const{Text:fa}=P,{Option:pa}=M,ga=({files:n,searchTerm:s,handleSearch:l,handleSort:u,sortBy:d,sortOrder:h,handleSortOptionChange:f,pagination:p,setPagination:g,loading:m,handleItemClick:v,selectedFiles:y,toggleFileSelection:b,handleDroppedFiles:w,onRename:x,onDelete:C,onCopy:_,onMove:S,onEdit:A,fileUpload:k,handleAddFile:I})=>{var T;const{t:F}=Hr(),{DropZoneFileIcon:O,BigStockIcon:P,BigAIIcon:q,FolderIcon:G}=ia(),{options:Y,actions:X,state:K}=bi(),{dataProviders:Z,config:J}=Y,Q=null==J?void 0:J.disablePagination,{setCurrentMenuFile:ee,setSelectedFiles:te,setActiveLibraryItem:re}=X,ne="Trash"===(null==K?void 0:K.selectedFolder),{viewMode:ie,setViewMode:oe}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(ua)||"table"}catch(e){return"table"}}),r=c(e=>{t(e);try{localStorage.setItem(ua,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),n=c(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[ae,se]=o({}),[le,ce]=o(null),[ue,de]=o(!1);a(()=>{const e=()=>{de(window.innerWidth<1200)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const he=y.size,fe=(null==J?void 0:J.features)||{},pe=i.useMemo(()=>Array.from(y)[0],[y]),ge=i.useMemo(()=>pe?n.find(e=>e.id===pe):void 0,[pe,n]),me=(null==ge?void 0:ge.isFolder)?!1!==(null==fe?void 0:fe.enableRenameFolder):!1!==(null==fe?void 0:fe.enableRenameFile),ve=null==J?void 0:J.iconStrokeWidth,ye=e=>{const t=e.extension?e.extension:e.name&&e.name.includes(".")?e.name.split(".").pop():e.type?(e=>{var t,r;if(e&&e.startsWith("image/"))return null===(r=null===(t=e.split("/")[1])||void 0===t?void 0:t.split(";")[0])||void 0===r?void 0:r.trim()})(e.type):void 0,r=(e=>!!e&&ur.includes(e.toLowerCase()))(t);return r},be=i.useMemo(()=>!(1!==he||!ge||ge.isFolder)&&ye(ge),[he,ge]),we=`${d}-${h}`,xe=i.useMemo(()=>Array.isArray(n)&&n.some(e=>(e=>{if(!e)return!1;const t=new Date(e);return!Number.isNaN(t.getTime())})(e.date)),[n]),Ce=c(async e=>{try{if(null==Z?void 0:Z.getChildrenCount)return await Z.getChildrenCount("folders"===e?void 0:e);if(null==Z?void 0:Z.getFiles){const{files:t,pagination:r}=await Z.getFiles({folderId:"folders"===e?void 0:e,itemType:"all"});return(null==r?void 0:r.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Error getting the number of files for the folder ${e}:`,t),0}},[Z]),_e=c(async()=>{const e=n.filter(e=>e.isFolder);if(0===e.length)return;const t={},r=e.map(async e=>{t[e.id]=await Ce(e.id)});await Promise.all(r),se(t)},[n,Ce]);a(()=>{_e()},[_e]);const Se=c((e=()=>{})=>{if(le)return;const t=setTimeout(()=>{e(),ce(null)},300);ce(t)},[le]),Ae=c(e=>{le&&(clearTimeout(le),ce(null)),e()},[le]),ke=c(t=>{const r=[];!t.isFolder&&!1!==(null==fe?void 0:fe.enableEdit)&&ye(t)&&r.push({key:"edit",label:F("Edit"),icon:e(Kn,{size:16,strokeWidth:ve})}),(t.isFolder?!1!==(null==fe?void 0:fe.enableMoveFolder):!1!==(null==fe?void 0:fe.enableMoveItem))&&r.push({key:"move",label:F("Move to"),icon:e(Jn,{size:16,strokeWidth:ve})}),(t.isFolder?!1!==(null==fe?void 0:fe.enableCopyFolder):!1!==(null==fe?void 0:fe.enableCopyItem))&&r.push({key:"copy",label:F("Copy"),icon:e(Xn,{size:16,strokeWidth:ve})});return(t.isFolder?!1!==(null==fe?void 0:fe.enableRenameFolder):!1!==(null==fe?void 0:fe.enableRenameFile))&&r.push({key:"rename",label:F("Rename"),icon:e(di,{size:16,strokeWidth:ve})}),!1!==fe.enableDelete&&r.push({key:"delete",label:F("Delete"),icon:e(hi,{size:16,strokeWidth:ve}),style:{color:"#ff4d4f"}}),r},[fe,F,ve]),Ee=e=>({key:t})=>{const r=n.find(t=>t.id===e);switch(ee&&(null==r?void 0:r.id)&&ee(null==r?void 0:r.id),t){case"edit":A(r);break;case"move":S();break;case"copy":_();break;case"rename":x(e);break;case"delete":C(r);break;default:ee&&ee("")}},Ie=[{key:"selection",width:46,render:(t,r)=>e(R,{checked:y.has(r.id),onChange:()=>b(r.id)})},{key:"preview",width:60,render:(t,r)=>r.isFolder?e("div",{className:ha.fileManagerTableFolder,children:e("div",{className:ha.fileManagerTableFolderInner,children:e(G,{className:ha.tableFolderIcon,style:{width:40,height:40}})})}):e(Eo,{className:`${ha.imagePreview} ${ha.tableImagePreview}`,thumbnailSrc:r.thumbnailUrl||r.thumbnail,previewSrc:r.url,alt:r.name,width:40,height:40,preview:!0,file:r})},{title:F("Name"),width:"calc(100% - 430px)",dataIndex:"name",key:"name",className:ha.fileNameCol,render:(e,r)=>{const n=r.isFolder&&ae[r.id]||0,i=F(1===n?"item":"items");return t("div",{className:ha.fileName,children:[e||F("No name"),r.isFolder&&t("div",{className:ha.fileItemCount,children:[n," ",i]})]})}},{title:F("Dimensions"),key:"dimensions",width:100,render:(t,r)=>r.dimensions&&e("div",{className:ha.fileSize,children:r.dimensions})},{title:F("Size"),key:"size",width:90,render:(t,r)=>!(null==r?void 0:r.size)||r.isFolder?null:e("div",{className:ha.fileSize,children:da(r.size)})},{title:F("Type"),key:"type",width:90,render:(t,r)=>{var n,i,o;if(r.isFolder)return e("div",{className:ha.fileSize,children:F("Folder")});const a=r.extension||(null===(n=r.name.split(".").pop())||void 0===n?void 0:n.toLowerCase())||(r.url?null===(o=null===(i=r.url.split("?")[0].split("/").pop())||void 0===i?void 0:i.split(".").pop())||void 0===o?void 0:o.toLowerCase():"")||"";return e("div",{className:ha.fileSize,children:a})}},...xe?[{title:F("Date"),dataIndex:"date",key:"date",width:200,render:(t,r)=>{const n=r.date;if(!n)return null;const i=new Date(n);if(isNaN(i.getTime()))return null;const o=e=>`${e.getDate()} ${[F("months.january"),F("months.february"),F("months.march"),F("months.april"),F("months.may"),F("months.june"),F("months.july"),F("months.august"),F("months.september"),F("months.october"),F("months.november"),F("months.december")][e.getMonth()]} ${e.getFullYear()}`;return e(L,{title:F("Added",{date:o(i)}),placement:"bottom",className:ha.fileDate,children:F("Added",{date:o(i)})})}}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(t,r)=>e(j,{arrow:!0,placement:"bottom",menu:{items:ke(r),onClick:Ee(r.id)},trigger:["hover"],children:e("span",{className:`${ha.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(Zn,{size:16,strokeWidth:ve})})})}],Te="table"===ie?e(E,{renderEmpty:()=>e(V,{image:e(r,{}),description:""}),children:e(U,{dataSource:n,columns:Ie,rowKey:"id",pagination:!1,loading:m,rowClassName:e=>(null==y?void 0:y.has(e.id))?ha.selectedRow:"",tableLayout:"fixed",onRow:e=>({onClick:t=>{const r=t.target;Se(()=>{t.stopPropagation(),t.preventDefault();const n=!!r.closest(".ant-image")||!!r.closest(".ant-image-preview-wrap"),i=!!r.closest(".tableMenuButton"),o=!!r.closest(".ant-dropdown-menu");n||i||o||b(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{Ae(()=>{t.stopPropagation(),t.preventDefault();const r=t.target;r.closest(".ant-checkbox-wrapper")||r.closest(".tableMenu")||(e.isFolder?v(e):r.closest(".ant-image")||r.closest(".ant-image-preview-wrap")||!Y.onEditorOk||Y.onEditorOk(e))})}}),showHeader:!1})}):e(H,{gutter:[16,16],className:ha.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:n.map(n=>e(W,{className:ha.gridCard_col,style:{padding:0},children:t($,{hoverable:!0,cover:e("div",{className:n.isFolder?ha.gridPreviewContainerFolder:ha.gridPreviewContainer,onClick:e=>{e.stopPropagation(),n.isFolder&&Se(()=>{b(n.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey})})},onDoubleClick:e=>{e.stopPropagation(),Ae(()=>{n.isFolder&&v(n)})},children:n.isFolder?e("div",{className:ha.gridFolderIcon,children:e(G,{className:ha.gridFolderIconImage})}):e(Eo,{thumbnailSrc:n.thumbnailUrl||n.thumbnail,previewSrc:n.url,alt:n.name,className:ha.gridImagePreview,preview:!0,file:n})}),className:`${ha.gridCard} ${(null==y?void 0:y.has(n.id))?ha.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||Se(()=>b(n.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},onDoubleClick:e=>{e.stopPropagation(),Ae(()=>{n.isFolder&&v(n)})},children:[t("div",{className:ha.gridCardContent,onDoubleClick:e=>{e.stopPropagation(),e.preventDefault(),Ae(()=>{n.isFolder?v(n):Y.onEditorOk&&Y.onEditorOk(n)})},onClick:e=>{e.stopPropagation(),e.preventDefault();const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||Se(()=>b(n.id,{metaKey:e.metaKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}))},children:[e("div",{className:ha.gridFileName,children:n.name||F("Untitled")}),e("div",{className:ha.gridFileInfo,children:n.isFolder?(()=>{const e=ae[n.id]||0;return`${e} ${F(1===e?"item":"items")}`})():t(r,{children:[n.dimensions&&`${n.dimensions} • `,n.size&&`${da(n.size)} • `,n.extension&&`${n.extension}`]})})]}),e("div",{className:ha.gridFileMenu,children:e(j,{menu:{items:ke(n),onClick:Ee(n.id)},arrow:!0,placement:"bottom",trigger:["hover"],children:e(D,{type:"default",className:`${ha.gridFileMenuButton} gridFileMenuButton`,onClick:()=>{},children:e(Zn,{size:16,strokeWidth:ve})})},n.id)}),e("div",{onClick:e=>{e.stopPropagation()},className:ha.gridCheckbox,children:e(R,{checked:y.has(n.id),style:{height:20},onChange:e=>{e.stopPropagation(),b(n.id)}})})]})},n.id))}),Fe=null===(T=null==J?void 0:J.availableImageExtensions)||void 0===T?void 0:T.map(e=>"."+e).join(", "),Oe=t("div",ne?{className:`${ha.noFiles} ant-layout-sider-light`,children:[e(fi,{size:48,className:ha.noFilesIcon}),e("div",{className:`${ha.textTitle_trash} ant-menu-submenu-title`,children:F("Trash is empty")}),e("div",{className:`${ha.textDescription_trash} ant-menu-submenu-title`,children:F("Deleted files will be displayed here")})]}:{className:ha.uploadContainer,children:[t("div",{className:`${ha.uploadArea} `,onClick:I,children:[e("div",{className:ha.uploadIcon,children:e(O,{})}),e("div",{className:ha.textTitle,children:F("Select a file or drag and drop it here")}),e("div",{className:ha.textDescription,children:F("Supported files:")+" "+(Fe||"jpeg, .svg, .png")})]}),t("div",{className:ha.buttons,children:[t("button",{className:ha.btnPhoto,onClick:()=>{re&&re(tr)},children:[e("div",{className:ha.icon,children:e(P,{})}),t("div",{className:ha.blockText,children:[e("div",{className:ha.textTitle,children:F("Stock")}),e("div",{className:ha.textDescription,children:F("Select an image from our library")})]})]}),t("button",{className:ha.btnAi,onClick:()=>{re&&re(rr)},children:[e("div",{className:ha.icon,children:e(q,{})}),t("div",{className:ha.blockText,children:[e("div",{className:ha.textTitle,children:F("AI generation")}),e("div",{className:ha.textDescription,children:F("Creating an image on demand")})]})]})]})]});return e("div",{className:"content-layout",children:m||0!==(null==n?void 0:n.length)||s?t("div",{className:ha.tableContainer,children:[t("div",he?{className:`header-container ${ha.headerContainer}`,children:[t(fa,{type:"secondary",className:"selected-text",children:[t("div",{children:[he," ",F("selected")]}),e(L,{title:ue?F("Deselected"):null,children:e(D,{className:ha.buttonDeselected,icon:e(li,{size:16,strokeWidth:ve}),onClick:()=>te&&te(new Set),children:F("Deselected")})})]}),t(N,{children:[be&&!1!==(null==fe?void 0:fe.enableEdit)&&e(L,{title:ue?F("Edit"):null,children:e(D,{icon:e(Kn,{size:16,strokeWidth:ve}),onClick:()=>{A(ge)},disabled:!be,children:F("Edit")})}),Array.from(y).every(e=>{const t=n.find(t=>t.id===e);return!!t&&(t.isFolder?!1!==(null==fe?void 0:fe.enableMoveFolder):!1!==(null==fe?void 0:fe.enableMoveItem))})&&e(L,{title:ue?F("Move to"):null,children:e(D,{icon:e(Jn,{size:16,strokeWidth:ve}),onClick:S,children:F("Move to")})}),Array.from(y).every(e=>{const t=n.find(t=>t.id===e);return!!t&&(t.isFolder?!1!==(null==fe?void 0:fe.enableCopyFolder):!1!==(null==fe?void 0:fe.enableCopyItem))})&&e(L,{title:ue?F("Copy"):null,children:e(D,{icon:e(Xn,{size:16,strokeWidth:ve}),onClick:_,children:F("Copy")})}),1===he&&me&&e(L,{title:ue?F("Rename"):null,children:e(D,{icon:e(di,{size:16,strokeWidth:ve}),onClick:()=>x(),disabled:1!==he||!me,children:F("Rename")})}),!1!==(null==fe?void 0:fe.enableDelete)&&e(L,{title:ue?F("Delete"):null,children:e(D,{danger:!0,icon:e(hi,{size:16,strokeWidth:ve}),onClick:e=>{e.stopPropagation(),e.preventDefault(),C()},children:F("Delete")})})]})]}:{className:ha.headerContainer,children:[e("div",{className:"search-container",children:e(_o,{placeholder:F("Search file or folder"),onSearch:l,className:ha.searchInput})}),t("div",{className:ha.actionsBox,children:[e("div",{className:"sort-container",children:t(M,{value:we,onChange:f,className:ha.sortSelect,popupMatchSelectWidth:!1,suffixIcon:e(Gn,{size:16,strokeWidth:ve}),children:[e(pa,{value:"date-desc",children:F("Newest first")}),e(pa,{value:"date-asc",children:F("Oldest first")}),e(pa,{value:"size-desc",children:F("Largest first")}),e(pa,{value:"size-asc",children:F("Smallest first")}),e(pa,{value:"name-asc",children:F("A-Z")}),e(pa,{value:"name-desc",children:F("Z-A")}),e(pa,{value:"type-asc",children:F("By type")})]})}),e("div",{className:ha.actionsContainer,children:e(z,{options:[{value:"grid",icon:e(ri,{size:16,strokeWidth:ve})},{value:"table",icon:e(oi,{size:20,strokeWidth:ve})}],value:ie,onChange:e=>oe(e)})})]})]}),s&&!n.length?e(ca,{}):Te,!Q&&p.total>p.pageSize&&e("div",{className:ha.paginationContainer,children:e(B,{current:p.current,pageSize:p.pageSize,total:p.total,onChange:(e,t)=>g({current:e,pageSize:t,total:p.total}),showSizeChanger:!0,showTotal:e=>F("total pages",{total:e})})})]}):Oe})};var ma="folderTree",va="emptyFolderContainer",ya="folderItemContainer",ba="folderLabel",wa="folderLabelItem",xa="fileCount",Ca="foldersTitle",_a="foldersTitleItem",Sa="folderMenu";const Aa=({selectedFolder:r,onSelect:n,onExpand:i,generateMenuItems:s,fetchChildFolders:l,disabledFolders:u=[],showFileCounts:h=!1,folderFileCounts:f={},className:p="",expandedKeys:g,setExpandedKeys:m,showTrashFolder:v=!1,mode:y="navigation",defaultExpandAll:b=!1})=>{const{t:w}=Hr(),{options:x}=bi(),{config:C}=x,{ExpandArrowIcon:_,CollapseArrowIcon:S,CollapseFolderIcon:A,ExpandFolderIcon:k,EmptyFolderIcon:E}=ia(),I=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[T,F]=o(()=>{if(b||"selection"===y&&b){const e=s();return I(e)}return[]}),O=void 0!==g?g:T,P=void 0!==m?m:F;a(()=>{if(b||"selection"===y&&b){const e=s(),t=I(e);void 0===g&&F(t)}},[b,y,s,I,g]);const M=c(async e=>{const t=e[0];t&&"empty"!==t&&!t.endsWith("_input")&&(null==n||n(e),await(null==l?void 0:l("folders"===t?null:t)))},[n,l]),R=c(async(e,t)=>{var r;P(e),null==i||i(e,t);if(!("lazy"===(null==C?void 0:C.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==l?void 0:l(n))}catch(e){console.warn("Failed to load child folders for",n,e)}},[null==C?void 0:C.folderTreeLoading,l,i,P]),L=c(()=>{var n,i;const o=s(),a=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?a(e.children):void 0})),l=v?a(o):o,c=e=>{"selection"!==y?(O.includes(e)&&r===e?P(O.filter(t=>t!==e)):O.includes(e)||P([...O,e]),M([e])):M([e])},d=0===l.length||1===l.length&&(!l[0].children||0===l[0].children.length),p=r=>{var n;const i=h&&f[r.key]||0,o=O.includes(r.key),a=u.includes(r.key),s=(()=>{var t;return(null===(t=r.children)||void 0===t?void 0:t.length)?e(o?A:k,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}):e(E,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth})})(),l=t("div",{className:`${ya} folder-item-container`,onClick:()=>!a&&c(r.key),style:{opacity:a?.5:1,cursor:a?"not-allowed":"pointer"},children:[t("div",{className:ba,children:[r.icon||s,e("span",{className:wa,children:r.label})]}),h&&e("div",{className:xa,title:`${i} ${1===i?"file":"files"}`,children:i})]});return{key:r.key,title:l,children:null===(n=r.children)||void 0===n?void 0:n.map(p),disabled:a}},g=O.includes("folders"),m=e("div",{className:Ca,onClick:()=>c("folders"),children:t("div",{className:_a,children:[e(g?A:k,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:`${wa} folder-label-item`,children:"folders"===(null===(n=l[0])||void 0===n?void 0:n.key)?l[0].label:w("Folders")})]})}),b=()=>({key:"Trash",title:e("div",{className:Ca,onClick:()=>c("Trash"),children:t("div",{className:_a,children:[e(hi,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:wa,children:w("Trash")})]})}),children:void 0});if(d){if(!v)return[{key:"empty",title:e("div",{className:va,children:w("No folders yet")}),disabled:!0}];const t=[];return l.length>0&&"folders"===l[0].key&&t.push({key:"folders",title:m,children:[]}),t.push(b()),t}if(l.length>0&&"folders"===l[0].key){const e=[{key:"folders",title:m,children:null===(i=l[0].children)||void 0===i?void 0:i.map(p)}];return v&&e.push(b()),e}return l.map(p)},[s,O,A,null==C?void 0:C.iconStrokeWidth,k,w,r,M,h,f,E,u,v,y,P]),j=d(()=>L(),[L]);return e(q,{className:`${ma} ${Sa} ${p}`,selectedKeys:r?[r]:[],expandedKeys:O,onSelect:M,onExpand:R,treeData:j,switcherIcon:({expanded:t})=>e(t?S:_,{}),showLine:!1})},ka=({style:t={},wrap:r=!1})=>{const n=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},t);return e(N,{size:"large",style:n,wrap:r,children:e(A,{})})};var Ea={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField",closeIcon:"closeIcon",modalContentWithLoader:"modalContentWithLoader",modalLoaderOverlay:"modalLoaderOverlay"};const Ia=f(({folderId:n,activeFormField:i,EmptyFolderIcon:o,targetForm:a,handleModalOk:s,onComplete:l,t:u,setIsLoading:d})=>{const h=c(()=>{a.setFieldsValue({folderName:""})},[a]),f=c(()=>{d(!0),s(a).then(e=>l(null==e?void 0:e.id)).finally(()=>d(!1))},[s,a,l,d]);return e(T.Item,{className:"form-item form-item-moveto "+(i===n?"form-item_active":""),name:"folderName",initialValue:u("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(u("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(o,{style:{marginRight:6}}),suffix:t(r,{children:[e(L,{placement:"top",title:"Clean",children:e(D,{icon:e(ve,{style:{fontSize:10}}),className:Ea.inputButtonClose,type:"text",onClick:h})}),e(D,{className:Ea.inputButtonOk,type:"text",onClick:()=>{d(!0),f()},children:"Создать"})]})})})});Ia.displayName="CustomFolderInput";const Ta=({isModalVisible:n,handleModalOk:i,handleModalCancel:s,form:l,selectedFolder:u,folders:h,isUrlModalVisible:f,setIsUrlModalVisible:p,handleAddFileByUrl:g,urlForm:m,isRenameModalVisible:v,handleRenameOk:y,handleRenameCancel:b,renameForm:w,fileToRename:x,files:C,isMoveModalVisible:_,handleMoveOk:S,handleMoveCancel:A,moveForm:k,selectedFiles:E,isRenameFolderModalVisible:I,handleRenameFolderOk:O,handleRenameFolderCancel:P,renameFolderForm:M,folderToRename:R,isCopyModalVisible:L,handleCopyOk:j,handleCopyCancel:N,copyForm:z,isDeleteConfirmVisible:B,handleDeleteConfirmOk:U,handleDeleteConfirmCancel:V,fetchChildFolders:H})=>{var W,$,q;const{t:Y}=Hr(),{state:X,actions:K,options:Z}=bi(),{setCurrentMenuFile:J}=K,{config:Q}=Z,{currentMenuFile:ee}=X,te=T.useWatch("folderName",l),{EmptyFolderIcon:re}=ia(),[ne,ie]=o(""),[oe,ae]=o(!1),se=!te||0===String(te).trim().length,le=d(()=>Array.isArray(C)?C:[],[C]),ce=x?null===(W=le.find(e=>e.id===x))||void 0===W?void 0:W.name:"",ue=Array.isArray(h)?h:[],de=R?null===($=ue.find(e=>e.id===R))||void 0===$?void 0:$.name:"";a(()=>{if(B){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)}},[B]);const he=x?le.find(e=>e.id===x):null,fe=(null==he?void 0:he.isFolder)||(null==x?void 0:x.startsWith("folder_")),pe=c(async e=>{e.length>0&&(k.setFieldsValue({targetFolder:e[0]}),ne!==e[0].toString()&&ie(""))},[k,ne]),ge=c(async e=>{e.length>0&&(z.setFieldsValue({targetFolder:e[0]}),ne!==e[0].toString()&&ie(""))},[ne,z]),me=d(()=>Array.from(E).filter(e=>{const t=le.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||h.some(t=>t.id===e)}),[E,le,h]),ye=c((t,r)=>{const n=n=>e(Ia,{folderId:n,activeFormField:ne,EmptyFolderIcon:re,targetForm:t,handleModalOk:i,onComplete:r,setIsLoading:ae,t:Y},n);return n.displayName="CustomInputComponent",n},[re,ne,i,Y]),be=c(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),ie(t),r.setFieldsValue({folderName:Y("New folder"),targetFolder:t})},handleSelectFolder:async e=>{e.preventDefault(),e.stopPropagation(),ae(!0);try{await n([t]),await i(t)}finally{ae(!1)}}}},[Y,ae]),we=c(n=>{const{targetForm:i,onTreeSelect:o,onComplete:a,actionButtonText:s}=n,l=ye(i,a),c=(n=null,d=new Set)=>h.filter(e=>{if("Trash"===e.id)return!1;const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(d.has(n.id))return{key:n.id,label:`${n.name} ${Y("(circular reference)")}`};const h=new Set(d);h.add(n.id);const f=c(n.id,h),{handleAddFolder:p,handleSelectFolder:g}=be({folderId:n.id,targetForm:i,onTreeSelect:o,onComplete:a}),m=ne===n.id?[{key:`${n.id}_input`,label:l(n.id),icon:null},...f]:f;return{key:n.id,label:t(r,{children:[n.name,u!==n.id&&t("div",{className:`${Ea.folderToolsField} folder-tools-field`,children:[e(D,{onClick:p,children:"+"}),e(D,{onClick:g,children:s})]})]}),children:m}}),d=c();console.log("treeNodes",d);const{handleAddFolder:f,handleSelectFolder:p}=be({folderId:"folders",targetForm:i,onTreeSelect:o,onComplete:a}),g="folders"===ne?[{key:"folders_input",label:l("folders"),icon:null},...d]:d;return[{key:"folders",label:t(r,{children:[Y("Folders"),"folders"!==u&&t("div",{className:`${Ea.folderToolsField} folder-tools-field`,children:[e(D,{onClick:f,children:"+"}),e(D,{onClick:p,children:s})]})]}),children:g}]},[Y,u,ne,h,ye,be]);return t(r,{children:[e(G,{title:e("div",{className:"modal-title",children:Y("Creating a new folder")}),open:n,onOk:()=>i(),onCancel:s,okText:Y("Create"),cancelText:Y("Cancel"),okButtonProps:{disabled:se,loading:oe},cancelButtonProps:{disabled:oe},afterClose:()=>ae(!1),children:t(T,{form:l,layout:"vertical",children:[e(T.Item,{name:"folderName",label:e("div",{className:"form-label",children:Y("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(Y("Enter the name of the folder"))):Promise.resolve()}],initialValue:Y("New folder"),className:"form-item",style:{marginBottom:5},children:e(F,{autoFocus:!0,className:"form-input",disabled:oe,onPressEnter:async()=>{ae(!0);try{await l.validateFields(),se||await i()}catch(e){ae(!1)}}})}),e("div",{children:u&&"folders"!==u?t("p",{className:"fm-note",children:[Y("A folder will be created inside:")," ",(null===(q=ue.find(e=>e.id===u))||void 0===q?void 0:q.name)||Y("selected folder"),"."]}):e("p",{className:"fm-note",children:Y("The folder will be created in the root directory.")})})]})}),e(G,{title:e("div",{className:"modal-title",children:Y("Upload file by URL")}),open:f,onOk:async()=>{ae(!0);try{await m.validateFields();await g(null)||ae(!1)}catch(e){ae(!1)}},onCancel:()=>p(!1),okText:Y("Download"),okButtonProps:{loading:oe},cancelText:Y("Cancel"),cancelButtonProps:{disabled:oe},afterClose:()=>ae(!1),children:e(T,{form:m,layout:"vertical",children:e(T.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:Y("File URL")}),rules:[{required:!0,message:Y("Enter the URL of the image")}],className:"form-item",children:e(F,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:oe,onPressEnter:async()=>{ae(!0);try{await m.validateFields();await g(null)||ae(!1)}catch(e){ae(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:fe?`${Y("Rename folder")} ${ce}`:Y("Rename file",{currentFileName:ce})}),open:v,onOk:y,okText:Y("Rename"),okButtonProps:{loading:oe},onCancel:b,cancelText:Y("Cancel"),cancelButtonProps:{disabled:oe},afterClose:()=>{ae(!1),J&&J("")},children:e(T,{form:w,layout:"vertical",children:e(T.Item,{name:"newFileName",label:e("div",{className:"form-label",children:Y(fe?"New folder name":"New file name")}),rules:[{required:!0,message:Y(fe?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:oe,onPressEnter:async()=>{ae(!0);try{await w.validateFields(),y()}catch(e){ae(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:Y("Move to")}),open:_,onCancel:A,footer:t("div",{className:Ea.formFooter,children:[t(D,{className:Ea.folderButton,onClick:()=>{k.setFieldsValue({targetFolder:"folders",folderName:Y("New folder"),is_force_create:!0}),setTimeout(()=>{ae(!0),i(k).then(e=>S(null==e?void 0:e.id)).finally(()=>ae(!1))},0)},loading:oe,children:[e(ei,{size:18,strokeWidth:null==Q?void 0:Q.iconStrokeWidth}),Y("Create folder")]}),e(D,{type:"primary",className:Ea.folderButton,onClick:A,loading:oe,children:Y("Done")})]}),afterClose:()=>{J&&J(""),ie(""),ae(!1)},loading:oe,children:t("div",{className:Ea.modalContentWithLoader,children:[oe&&e("div",{className:Ea.modalLoaderOverlay,children:e(ka,{})}),e(T,{form:k,layout:"vertical",initialValues:{targetFolder:"folders",folderName:Y("New folder"),is_force_create:!1},children:t("div",{className:Ea.foldersWrapper,children:[e(T.Item,{name:"targetFolder",rules:[{required:!0,message:Y("Select the destination folder")}],className:Ea.formItem,children:e(Aa,{onSelect:pe,generateMenuItems:()=>we({targetForm:k,onTreeSelect:pe,onComplete:S,actionButtonText:Y("Move here")}),fetchChildFolders:H,disabledFolders:me,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(T.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(Y("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(T.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:e("div",{className:"modal-title",children:Y("Copy to folder")}),open:L,onCancel:N,footer:t("div",{className:Ea.formFooter,children:[t(D,{className:Ea.folderButton,onClick:()=>{z.setFieldsValue({targetFolder:"folders",folderName:Y("New folder"),is_force_create:!0}),setTimeout(()=>{ae(!0),i(z).then(e=>j(null==e?void 0:e.id)).finally(()=>ae(!1))},0)},loading:oe,children:[e(ei,{size:18,strokeWidth:null==Q?void 0:Q.iconStrokeWidth}),Y("Create folder")]}),e(D,{type:"primary",className:Ea.folderButton,onClick:N,loading:oe,children:Y("Done")})]}),afterClose:()=>{J&&J(""),ie(""),ae(!1)},loading:oe,children:t("div",{className:Ea.modalContentWithLoader,children:[oe&&e("div",{className:Ea.modalLoaderOverlay,children:e(ka,{})}),e(T,{form:z,layout:"vertical",initialValues:{targetFolder:"folders",folderName:Y("New folder"),is_force_create:!1},children:t("div",{className:Ea.foldersWrapper,children:[e(T.Item,{name:"targetFolder",rules:[{required:!0,message:Y("Select the destination folder")}],className:Ea.formItem,children:e(Aa,{onSelect:ge,generateMenuItems:()=>we({targetForm:z,onTreeSelect:ge,onComplete:j,actionButtonText:Y("Copy here")}),fetchChildFolders:H,disabledFolders:me,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(T.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(Y("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(T.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:t("div",{className:"modal-title",children:[Y("Rename folder")," ",de]}),open:I,onOk:O,onCancel:P,okText:Y("Rename"),cancelText:Y("Cancel"),okButtonProps:{loading:oe},cancelButtonProps:{disabled:oe},afterClose:()=>{ae(!1),J&&J("")},children:e(T,{form:M,layout:"vertical",children:e(T.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:Y("New folder name")}),rules:[{required:!0,message:Y("Enter a new folder name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:oe,onPressEnter:async()=>{ae(!0);try{await M.validateFields(),O()}catch(e){ae(!1)}}})})})}),e(G,{className:`${Ea.deleteModal} deleteModal`,title:(()=>{const t=!!(null==Q?void 0:Q.enableTrashFolder)&&"Trash"===u||!(null==Q?void 0:Q.enableTrashFolder),r=Y(t?"Permanently delete":"Move to Trash");return e("div",{className:"modal-title",children:r})})(),open:!!B,onOk:()=>{ae(!0);try{U&&U()}catch(e){console.error(e),ae(!1)}},onCancel:()=>V&&V(),okText:(null==Q?void 0:Q.enableTrashFolder)&&"Trash"===u?Y("Delete permanently"):(null==Q?void 0:Q.enableTrashFolder)?Y("Move to Trash"):Y("Delete"),cancelText:Y("Cancel"),okButtonProps:{danger:!(null==Q?void 0:Q.enableTrashFolder)||"Trash"===u,loading:oe},cancelButtonProps:{disabled:oe},afterClose:()=>{ae(!1),J&&J("")},closeIcon:e(ve,{className:Ea.closeIcon}),children:(()=>{var t,r;const n=(ee?[ee]:Array.from(E||[])).map(e=>le.find(t=>t.id===e)).filter(e=>!!e),i=n.filter(e=>e.isFolder||e.id.startsWith("folder_")),o=n.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),a=n.length,s=i.length,l=o.length,c=!!(null==Q?void 0:Q.enableTrashFolder);if(!c||c&&"Trash"===u){if(1===a&&1===s){const r=i[0],n=(null==r?void 0:r.name)||"",o=null!==(t=null==r?void 0:r.childCount)&&void 0!==t?t:0;return e("div",{children:Y("delete_folder_permanent",{name:n,count:o})})}return e("div",0===s&&l>0?{children:Y("delete_files_permanent",{count:l})}:{children:Y("delete_mixed_permanent",{total:a,folders:s,images:l})})}if(1===a&&1===s){const t=i[0],n=(null==t?void 0:t.name)||"",o=null!==(r=null==t?void 0:t.childCount)&&void 0!==r?r:0;return e("div",{children:Y("move_folder_to_trash",{name:n,count:o})})}return e("div",0===s&&l>0?{children:Y("move_files_to_trash",{count:l})}:{children:Y("move_mixed_to_trash",{total:a,folders:s,images:l})})})()})]})};var Fa={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const Oa=f(p(({selectedFolder:r,generateMenuItems:n,onFolderSelect:i,folders:s,fetchChildFolders:l,handleAddFile:h,setIsUrlModalVisible:f,handleCreateFolder:p,activeLibraryItem:m,setActiveLibraryItem:v},y)=>{const b=d(()=>Array.isArray(s)?s:[],[s]),{t:w}=Hr(),x=Si(),[C,_]=o({}),{options:S}=bi(),{dataProviders:A,config:k}=S,E=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[I,T]=o(()=>{if(!0===(null==k?void 0:k.expandAllFoldersOnInit)&&"lazy"!==(null==k?void 0:k.folderTreeLoading)){const e=n();return E(e)}return!0===(null==k?void 0:k.expandRootFolderOnInit)?["folders"]:[]}),F=u(!1),O=u(!1);a(()=>{if(F.current)return;"lazy"===(null==k?void 0:k.folderTreeLoading)&&!0===(null==k?void 0:k.expandRootFolderOnInit)&&(F.current=!0,(async()=>{try{await(null==l?void 0:l(null))}catch(e){console.warn("Could not load the root child folders during initialization",e)}})())},[null==k?void 0:k.folderTreeLoading,null==k?void 0:k.expandRootFolderOnInit,l]),a(()=>{!0===(null==k?void 0:k.expandRootFolderOnInit)&&Array.isArray(b)&&b.length>0&&(O.current||I&&0!==I.length||(O.current=!0,T(["folders"])))},[null==k?void 0:k.expandRootFolderOnInit,b,I]),a(()=>{if(!0===(null==k?void 0:k.expandAllFoldersOnInit)&&"lazy"!==(null==k?void 0:k.folderTreeLoading)){const e=n(),t=E(e);return void T(t)}!0===(null==k?void 0:k.expandRootFolderOnInit)&&T(e=>e&&e.length>0?[...e]:["folders"])},[b,n,E,null==k?void 0:k.expandAllFoldersOnInit,null==k?void 0:k.folderTreeLoading,null==k?void 0:k.expandRootFolderOnInit]);const P=c(async e=>{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:t,pagination:r}=await A.getFiles({folderId:"folders"===e?void 0:e,itemType:"all"});return(null==r?void 0:r.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return console.error(`Error getting the number of files for the folder ${e}:`,t),x.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:w("Failed to load folder items count"),placement:"bottomRight",innerException:t,data:{folderId:"folders"===e?null:e,reason:t instanceof Error?t.message:String(t)}}),0}},[A,x,w]),M=c(async()=>{if(0===b.length)return;const e={};e.folders=await P("folders");const t=b.map(async t=>{const r=await P(t.id);e[t.id]=r});await Promise.all(t),_(e)},[b,P]),R=c(async e=>{const t=await P(e);_(r=>Object.assign(Object.assign({},r),{[e]:t}))},[P]);g(y,()=>({refreshFileCounts:M}),[M]),a(()=>{M()},[M]),a(()=>{if(!r||"folders"===r)return;const e=(t,r=new Set)=>{if(r.has(t))return console.warn(`Cycle detected in the path to the folder with id=${t}`),[];const n=b.find(e=>e.id===t);if(!n)return[];if(!n.parentId)return[];const i=new Set(r);i.add(t);return[...e(n.parentId,i),n.parentId]},t=e(r);t.length>0?T(e=>{const r=new Set(e);return t.forEach(e=>r.add(e)),r.add("folders"),Array.from(r)}):T(e=>e.includes("folders")?e:[...e,"folders"])},[r,b]);const L=c(async()=>{await h(),r?await R(r):await R("folders")},[h,r,R]),j=[{key:Qt,label:w("My files"),icon:e(ni,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth})},{key:er,label:w("GIF"),icon:e(ai,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth})},{key:tr,label:w("Stock images"),icon:e(Yn,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth})},{key:rr,label:w("AI"),icon:e(ui,{size:20,strokeWidth:null==k?void 0:k.iconStrokeWidth}),disabled:!(null==k?void 0:k.sseQuery)}],N=c(async e=>{const t=e[0];t&&"empty"!==t&&(m!==Qt&&v(Qt),null==i||i(t),await(null==l?void 0:l(t)))},[i,m,v,l]),z=c(({key:e})=>{v(e)},[v]),B=c(async(e,t)=>{var r;T(e);if(!("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==l?void 0:l(n))}catch(e){console.warn("Could not load the child folders for",n,e),x.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:w("Failed to load subfolders"),placement:"bottomRight",innerException:e,data:{folderId:n,reason:e instanceof Error?e.message:String(e)}})}},[null==k?void 0:k.folderTreeLoading,l,x,w]);return t("div",{className:"sidebar-container",children:[t("div",{className:Fa.buttonWrapper,children:[e(D,{type:"primary",size:"large",icon:e(si,{size:24,strokeWidth:null==k?void 0:k.iconStrokeWidth}),onClick:L,className:Fa.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r,children:e("span",{className:Fa.uploadButtonTitle,children:w("Upload file")})}),e(D,{type:"primary",size:"large",icon:e(ii,{size:24,strokeWidth:null==k?void 0:k.iconStrokeWidth}),onClick:()=>null==f?void 0:f(!0),className:Fa.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r})]}),e(Y,{className:"folder-menu",items:j,defaultSelectedKeys:[Qt],onSelect:({key:e})=>z({key:e}),selectedKeys:[m]}),e(X,{className:Fa.divider}),t("div",{className:Fa.foldersContainer,children:[e(Aa,{selectedFolder:r,onSelect:N,onExpand:B,generateMenuItems:n,fetchChildFolders:l,showFileCounts:!0,folderFileCounts:C,expandedKeys:I,setExpandedKeys:T,showTrashFolder:null==k?void 0:k.enableTrashFolder}),e("div",{className:Fa.folderActions,children:e(D,{onClick:e=>{e.stopPropagation(),p()},className:Fa.button,icon:e(ei,{size:18,strokeWidth:null==k?void 0:k.iconStrokeWidth}),size:"middle"})})]})]})}));Oa.displayName="FolderSidebar";var Pa=Object.defineProperty,Ma=(e,t,r)=>(((e,t,r)=>{t in e?Pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function Ra(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function La(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function ja(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=La(e);return t>0?Ra(Number(e)*Math.pow(10,t)):Number(e)}function Da(e){Ha&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&console.warn(e+" is beyond boundary when transfer to integer, the results may not be accurate")}function Na(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 za=Na(function(e,t){var r=ja(e),n=ja(t),i=La(e)+La(t),o=r*n;return Da(o),o/Math.pow(10,i)}),Ba=Na(function(e,t){var r=Math.pow(10,Math.max(La(e),La(t)));return(za(e,r)+za(t,r))/r}),Ua=Na(function(e,t){var r=Math.pow(10,Math.max(La(e),La(t)));return(za(e,r)-za(t,r))/r}),Va=Na(function(e,t){var r=ja(e),n=ja(t);return Da(r),Da(n),za(r/n,Ra(Math.pow(10,La(t)-La(e))))});var Ha=!0;var Wa={strip:Ra,plus:Ba,minus:Ua,times:za,divide:Va,round:function(e,t){var r=Math.pow(10,t),n=Va(Math.round(Math.abs(za(e,r))),r);return e<0&&0!==n&&(n=za(n,-1)),n},digitLength:La,float2Fixed:ja,enableBoundaryChecking:function(e){void 0===e&&(e=!0),Ha=e}};const $a=Object.prototype.toString;function qa(e){switch($a.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return rs(e,Error)}}function Ga(e,t){return $a.call(e)===`[object ${t}]`}function Ya(e){return Ga(e,"ErrorEvent")}function Xa(e){return Ga(e,"DOMError")}function Ka(e){return Ga(e,"String")}function Za(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ja(e){return null===e||Za(e)||"object"!=typeof e&&"function"!=typeof e}function Qa(e){return Ga(e,"Object")}function es(e){return typeof Event<"u"&&rs(e,Event)}function ts(e){return!(!e||!e.then||"function"!=typeof e.then)}function rs(e,t){try{return e instanceof t}catch{return!1}}function ns(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function is(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function os(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{ns(n)?r.push("[VueViewModel]"):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function as(e,t,r=!1){return!!Ka(e)&&(function(e){return Ga(e,"RegExp")}(t)?t.test(e):!!Ka(t)&&(r?e===t:e.includes(t)))}function ss(e,t=[],r=!1){return t.some(t=>as(e,t,r))}function ls(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&rs(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=is(e.value,t)),e))}(cs(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function cs(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(rs(n[i],Error)){us(a,s);const o=e(t,n[i]),c=l.length;ds(o,i,c,s),l=cs(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(rs(n,Error)){us(a,s);const c=e(t,n),u=l.length;ds(c,`errors[${o}]`,u,s),l=cs(e,t,r,n,i,[c,...l],c,u)}}),l}function us(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 ds(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 hs(e){return e&&e.Math==Math?e:void 0}const fs="object"==typeof globalThis&&hs(globalThis)||"object"==typeof window&&hs(window)||"object"==typeof self&&hs(self)||"object"==typeof global&&hs(global)||function(){return this}()||{};function ps(){return fs}function gs(e,t,r){const n=r||fs,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const ms=ps();function vs(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=ys(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 ys(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(ms.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&&Ka(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 bs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ws=["debug","info","warn","error","log","assert","trace"],xs={};function Cs(e){if(!("console"in fs))return e();const t=fs.console,r={},n=Object.keys(xs);n.forEach(e=>{const n=xs[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const _s=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return bs?ws.forEach(r=>{t[r]=(...t)=>{e&&Cs(()=>{fs.console[r](`Sentry Logger [${r}]:`,...t)})}}):ws.forEach(e=>{t[e]=()=>{}}),t}(),Ss=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function As(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 ks(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Es(e){const t="string"==typeof e?function(e){const t=Ss.exec(e);if(!t)return void Cs(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});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 ks({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):ks(e);if(t&&function(e){if(!bs)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(_s.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(_s.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(_s.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(_s.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}class Is 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 Ts(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&Os(i,n),e[t]=i}function Fs(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{bs&&_s.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Os(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,Fs(e,"__sentry_original__",t)}catch{}}function Ps(e){return e.__sentry_original__}function Ms(e){if(qa(e))return{message:e.message,name:e.name,stack:e.stack,...Ls(e)};if(es(e)){const t={type:e.type,target:Rs(e.target),currentTarget:Rs(e.currentTarget),...Ls(e)};return typeof CustomEvent<"u"&&rs(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Rs(e){try{return function(e){return typeof Element<"u"&&rs(e,Element)}(e)?vs(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Ls(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 js(e){return Ds(e,new Map)}function Ds(e,t){if(function(e){if(!Qa(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 r of Object.keys(e))typeof e[r]<"u"&&(n[r]=Ds(e[r],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(Ds(e,t))}),n}return e}const Ns=/\(error: (.*)\)/,zs=/captureMessage|captureException/;function Bs(...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 e=r;e<i.length;e++){const r=i[e];if(r.length>1024)continue;const o=Ns.test(r)?r.replace(Ns,"$1"):r;if(!o.match(/\S*Error: /)){for(const e of t){const t=e(o);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(),zs.test(t[t.length-1].function||"")&&(t.pop(),zs.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 Us(e){return Array.isArray(e)?Bs(...e):e}const Vs="<anonymous>";function Hs(e){try{return e&&"function"==typeof e&&e.name||Vs}catch{return Vs}}const Ws={},$s={};function qs(e,t){Ws[e]=Ws[e]||[],Ws[e].push(t)}function Gs(e,t){$s[e]||(t(),$s[e]=!0)}function Ys(e,t){const r=e&&Ws[e];if(r)for(const n of r)try{n(t)}catch(t){bs&&_s.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Hs(n)}\nError:`,t)}}function Xs(){"console"in fs&&ws.forEach(function(e){e in fs.console&&Ts(fs.console,e,function(t){return xs[e]=t,function(...t){Ys("console",{args:t,level:e});const r=xs[e];r&&r.apply(fs.console,t)}})})}function Ks(){const e=fs,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 Zs(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Js(e){const{message:t,event_id:r}=e;if(t)return t;const n=Zs(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Qs(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 el(e,t){const r=Zs(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 tl(e){if(e&&e.__sentry_captured__)return!0;try{Fs(e,"__sentry_captured__",!0)}catch{}return!1}function rl(e){return Array.isArray(e)?e:[e]}const nl=fs;let il,ol,al;function sl(){if(!nl.document)return;const e=Ys.bind(null,"dom"),t=ll(e,!0);nl.document.addEventListener("click",t,!1),nl.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=nl[t]&&nl[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ts(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=ll(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),Ts(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 ll(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;Fs(r,"_sentryCaptured",!0),n&&!n._sentryId&&Fs(n,"_sentryId",Ks());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==ol)return!1;try{if(!e.target||e.target._sentryId!==al)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),ol=r.type,al=n?n._sentryId:void 0),clearTimeout(il),il=nl.setTimeout(()=>{al=void 0,ol=void 0},1e3)}}const cl=ps();function ul(){if(!("fetch"in cl))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function dl(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function hl(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!ul())return!1;if(dl(cl.fetch))return!0;let e=!1;const t=cl.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=dl(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){bs&&_s.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&Ts(fs,"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:pl(t),method:fl(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:pl(t),method:fl(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Ys("fetch",{...i}),e.apply(fs,t).then(e=>(Ys("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Ys("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function fl(e,t){return!!e&&"object"==typeof e&&!!e[t]}function pl(e){return"string"==typeof e?e:e?fl(e,"url")?e.url:e.toString?e.toString():"":""}let gl=null;function ml(){gl=fs.onerror,fs.onerror=function(e,t,r,n,i){return Ys("error",{column:n,error:i,line:r,msg:e,url:t}),!(!gl||gl.__SENTRY_LOADER__)&&gl.apply(this,arguments)},fs.onerror.__SENTRY_INSTRUMENTED__=!0}let vl=null;function yl(){vl=fs.onunhandledrejection,fs.onunhandledrejection=function(e){return Ys("unhandledrejection",e),!(vl&&!vl.__SENTRY_LOADER__)||vl.apply(this,arguments)},fs.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const bl=ps();const wl=fs;let xl;function Cl(e){const t="history";qs(t,e),Gs(t,_l)}function _l(){if(!function(){const e=bl.chrome,t=e&&e.app&&e.app.runtime,r="history"in bl&&!!bl.history.pushState&&!!bl.history.replaceState;return!t&&r}())return;const e=wl.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=xl,t=String(r);xl=t,Ys("history",{from:e,to:t})}return e.apply(this,t)}}wl.onpopstate=function(...t){const r=wl.location.href,n=xl;if(xl=r,Ys("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},Ts(wl.history,"pushState",t),Ts(wl.history,"replaceState",t)}const Sl=fs,Al="__sentry_xhr_v3__";function kl(){if(!Sl.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Ts(e,"open",function(e){return function(...t){const r=Date.now(),n=Ka(t[0])?t[0].toUpperCase():void 0,i=function(e){if(Ka(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[Al]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[Al];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}Ys("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?Ts(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),Ts(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[Al];return i&&Ka(r)&&Ka(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),Ts(e,"send",function(e){return function(...t){const r=this[Al];if(!r)return e.apply(this,t);void 0!==t[0]&&(r.body=t[0]);return Ys("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}function El(e,t=100,r=1/0){try{return Tl("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Il(e,t=3,r=102400){const n=El(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?Il(e,t-1,r):n}function Tl(e,t,r=1/0,n=1/0,i=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[o,a]=i;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const s=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(ns(t))return"[VueViewModel]";if(function(e){return Qa(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: ${Hs(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===l)return s.replace("object ","");if(o(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return Tl("",c.toJSON(),l-1,n,i)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=Ms(t);for(const e in h){if(!Object.prototype.hasOwnProperty.call(h,e))continue;if(d>=n){u[e]="[MaxProperties ~]";break}const t=h[e];u[e]=Tl(e,t,l-1,n,i),d++}return a(t),u}var Fl;function Ol(e){return new Ml(t=>{t(e)})}function Pl(e){return new Ml((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Fl||(Fl={}));class Ml{constructor(e){Ml.prototype.__init.call(this),Ml.prototype.__init2.call(this),Ml.prototype.__init3.call(this),Ml.prototype.__init4.call(this),this._state=Fl.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Ml((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 Ml((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(Fl.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Fl.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===Fl.PENDING){if(ts(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Fl.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Fl.RESOLVED&&e[1](this._value),this._state===Fl.REJECTED&&e[2](this._value),e[0]=!0)})}}}function Rl(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 Pl(new Is("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 Ml((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{Ol(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}function Ll(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 jl=["fatal","error","warning","log","info","debug"];function Dl(e){return"warn"===e?"warning":jl.includes(e)?e:"log"}function Nl(){return Date.now()/1e3}const zl=function(){const{performance:e}=fs;if(!e||!e.now)return Nl;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function Bl(e,t=[]){return[e,t]}function Ul(e,t){const[r,n]=e;return[r,[...n,t]]}function Vl(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function Hl(e,t){return(t||new TextEncoder).encode(e)}function Wl(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Hl(i,t),e]:i.push("string"==typeof e?Hl(e,t):e)}for(const e of n){const[t,r]=e;if(o(`\n${JSON.stringify(t)}\n`),"string"==typeof r||r instanceof Uint8Array)o(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(El(r))}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 t of e)r.set(t,n),n+=t.length;return r}(i)}function $l(e,t){const r="string"==typeof e.data?Hl(e.data,t):e.data;return[js({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=fs;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 ql={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 Gl(e){return ql[e]}function Yl(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function Xl(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 e of o.trim().split(",")){const[t,r,,,o]=e.split(":",5),a=parseInt(t,10),s=1e3*(isNaN(a)?60:a);if(r)for(const e of r.split(";"))"metric_bucket"===e?(!o||o.split(";").includes("custom"))&&(i[e]=n+s):i[e]=n+s;else i.all=n+s}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}const Kl=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Zl="production";function Jl(){return gs("globalEventProcessors",()=>[])}function Ql(e){Jl().push(e)}function ec(e,t,r,n=0){return new Ml((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);Kl&&a.id&&null===s&&_s.log(`Event processor "${a.id}" dropped event`),ts(s)?s.then(t=>ec(e,t,r,n+1).then(i)).then(null,o):ec(e,s,r,n+1).then(i).then(null,o)}})}function tc(e){const t=zl(),r={sid:Ks(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return js({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&&rc(r,e),r}function rc(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||zl(),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:Ks()),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 nc(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),rc(e,r)}function ic(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=oc(e);return js({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function oc(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function ac(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||Ks(),timestamp:t.timestamp||Nl()},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:Zl),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=is(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=is(a.value,o));const s=e.request;s&&s.url&&(s.url=is(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=fs._sentryDebugIds;if(!r)return;let n;const i=sc.get(t);i?n=i:(n=new Map,sc.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 _c;return r.update(t),r}(n,r.captureContext);r.mechanism&&el(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(Cc||(Cc=new _c),Cc).getScopeData();if(o){wc(h,o.getScopeData())}if(u){wc(h,u.getScopeData())}const f=[...r.attachments||[],...h.attachments];f.length&&(r.attachments=f),bc(l,h);return ec([...d,...Jl(),...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:El(e.data,t,r)}}))},...e.user&&{user:El(e.user,t,r)},...e.contexts&&{contexts:El(e.contexts,t,r)},...e.extra&&{extra:El(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=El(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=oc(e).data;return n&&(e.data=El(n,t,r)),e})),n}(e,a,s):e))}const sc=new WeakMap;function lc(e,t){return Oc().captureEvent(e,t)}function cc(e,t){Oc().addBreadcrumb(e,t)}function uc(){return Oc().getClient()}function dc(){return Oc().getScope()}function hc(e){const t=uc(),r=Pc(),n=dc(),{release:i,environment:o=Zl}=t&&t.getOptions()||{},{userAgent:a}=fs.navigator||{},s=tc({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&rc(l,{status:"exited"}),fc(),r.setSession(s),n.setSession(s),s}function fc(){const e=Pc(),t=dc(),r=t.getSession()||e.getSession();r&&nc(r),pc(),e.setSession(),t.setSession()}function pc(){const e=Pc(),t=dc(),r=uc(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function gc(e=!1){e?fc():pc()}function mc(e){return e.transaction}function vc(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=js({environment:n.environment||Zl,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function yc(e){const t=uc();if(!t)return{};const r=vc(oc(e).trace_id||"",t,dc()),n=mc(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=oc(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 bc(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=js(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=js(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=js(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=js(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:ic(t),...e.contexts};const r=mc(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:yc(t),...e.sdkProcessingMetadata};const n=oc(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?rl(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 wc(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;xc(e,"extra",r),xc(e,"tags",n),xc(e,"user",i),xc(e,"contexts",o),xc(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 xc(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 Cc;class _c{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Sc()}static clone(e){return e?e.clone():new _c}clone(){const e=new _c;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&&rc(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 _c){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(Qa(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=Sc(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:Nl(),...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=[]){bc(e,this.getScopeData());return ec([...r,...Jl(),...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:Ks();if(!this._client)return _s.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:Ks();if(!this._client)return _s.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:Ks();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(_s.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 Sc(){return{traceId:Ks(),spanId:Ks().substring(16)}}const Ac="7.116.0",kc=parseFloat(Ac),Ec=100;class Ic{constructor(e,t,r,n=kc){let i,o;this._version=n,t?i=t:(i=new _c,i.setClient(e)),r?o=r:(o=new _c,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 ts(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:Ks(),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:Ks(),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:Ks();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=Ec}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:Nl(),...e},s=i?Cs(()=>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=Fc(this);try{e(this)}finally{Fc(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Kl&&_s.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return Kl&&!r&&(this.getClient()?_s.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):_s.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&&nc(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Zl}=r&&r.getOptions()||{},{userAgent:o}=fs.navigator||{},a=tc({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&rc(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=Tc().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Kl&&_s.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Tc(){return fs.__SENTRY__=fs.__SENTRY__||{extensions:{},hub:void 0},fs}function Fc(e){const t=Tc(),r=Mc(t);return Rc(t,e),r}function Oc(){const e=Tc();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Tc()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||Mc(e).isOlderThan(kc))&&Rc(e,new Ic),Mc(e)}(e)}function Pc(){return Oc().getIsolationScope()}function Mc(e){return gs("hub",()=>new Ic,e)}function Rc(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function Lc(e,t,r,n){const i=Yl(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:As(n)},...i&&{trace:js({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,Bl(a,[[{type:o},e]])}function jc(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}`}})}const Dc=[];function Nc(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?rl(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 zc(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function Bc(e,t,r){if(r[t.name])Kl&&_s.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===Dc.indexOf(t.name)&&(t.setupOnce(Ql,Oc),Dc.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)}Kl&&_s.log(`Integration installed: ${t.name}`)}}function Uc(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}function Vc(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=As(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 Bl(i,[o])}const Hc="Not capturing exception because it's already been captured.";class Wc{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Es(e.dsn):Kl&&_s.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)}?${jc(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(tl(e))return void(Kl&&_s.log(Hc));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=Za(e)?e:String(e),a=Ja(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&&tl(t.originalException))return void(Kl&&_s.log(Hc));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?Kl&&_s.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),rc(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))):Ol(!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 Kl&&_s.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Bc(this,e,this._integrations),t||zc(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=Lc(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=Ul(r,$l(e,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=Yl(r);return Bl({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:As(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}`;Kl&&_s.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){Kl&&_s.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=Vc(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&&Bc(e,t,r)}),r}(this,e),zc(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)&&(rc(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Ml(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=Pc()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),ac(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||vc(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(Kl){const t=e;"log"===t.logLevel?_s.log(t.message):_s.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=qc(e),a=$c(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),Pl(new Is(`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 Is("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 $c(t)&&n?n(t,r):qc(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(ts(e))return e.then(e=>{if(!Qa(e)&&null!==e)throw new Is(r);return e},e=>{throw new Is(`${t} rejected with ${e}`)});if(!Qa(e)&&null!==e)throw new Is(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new Is(`${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 Is?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Is(`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=>{Kl&&_s.error("Error while sending event:",e)});Kl&&_s.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 $c(e){return void 0===e.type}function qc(e){return"transaction"===e.type}function Gc(e,t){!0===t.debug&&(Kl?_s.enable():Cs(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),dc().update(t.initialScope);const r=new e(t);(function(e){const t=Oc().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)}function Yc(e,t,r=Rl(e.bufferSize||30)){let n={};function i(i){const o=[];if(Vl(i,(t,r)=>{const i=Gl(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=Xc(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return Ol();const a=Bl(i[0],o),s=t=>{Vl(a,(r,n)=>{const i=Xc(r,n);e.recordDroppedEvent(t,Gl(n),i)})};return r.add(()=>t({body:Wl(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Kl&&_s.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=Xl(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof Is)return Kl&&_s.error("Skipped sending event because buffer is full."),s("queue_overflow"),Ol();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function Xc(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function Kc(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:Ac})),version:Ac}),e._metadata=i}const Zc=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],Jc=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Qc="InboundFilters",eu=(e={})=>({name:Qc,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?[]:Zc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Jc],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)?(Kl&&_s.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${Js(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}`)),Kl&&0===t.length&&_s.error(`Could not extract message for event ${Js(e)}`),t}(e).some(e=>ss(e,t))}(e,t.ignoreErrors)?(Kl&&_s.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Js(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&ss(r,t)}(e,t.ignoreTransactions)?(Kl&&_s.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Js(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=tu(e);return!!r&&ss(r,t)}(e,t.denyUrls)?(Kl&&_s.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Js(e)}.\nUrl: ${tu(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=tu(e);return!r||ss(r,t)}(e,t.allowUrls)&&(Kl&&_s.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Js(e)}.\nUrl: ${tu(e)}`),!0)}(t,o)?null:t}});function tu(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 Kl&&_s.error(`Cannot extract url for event ${Js(e)}`),null}}let ru;Uc(Qc,eu);const nu="FunctionToString",iu=new WeakMap,ou=()=>({name:nu,setupOnce(){ru=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ps(this),r=iu.has(uc())&&void 0!==t?t:this;return ru.apply(r,e)}}catch{}},setup(e){iu.set(e,!0)}});Uc(nu,ou);const au=fs;let su=0;function lu(){return su>0}function cu(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(Ps(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=>cu(e,t));return e.apply(this,i)}catch(e){throw su++,setTimeout(()=>{su--}),function(...e){const t=Oc();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])}(r=>{r.addEventProcessor(e=>(t.mechanism&&(Qs(e,void 0),el(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){Oc().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}Os(n,e),Fs(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const uu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function du(e,t){const r=fu(e,t),n={type:t&&t.name,value:gu(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function hu(e,t){return{exception:{values:[du(e,t)]}}}function fu(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(pu.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const pu=/Minified React error #\d+;/i;function gu(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function mu(e,t,r,n,i){let o;if(Ya(t)&&t.error)return hu(e,t.error);if(Xa(t)||function(e){return Ga(e,"DOMException")}(t)){const i=t;if("stack"in t)o=hu(e,t);else{const t=i.name||(Xa(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=vu(e,a,r,n),Qs(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return qa(t)?hu(e,t):Qa(t)||es(t)?(o=function(e,t,r,n){const i=uc(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:es(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:yu(t,{isUnhandledRejection:n})}]},extra:{__serialized__:Il(t,o)}};if(r){const t=fu(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),el(o,{synthetic:!0}),o):(o=vu(e,t,r,n),Qs(o,`${t}`),el(o,{synthetic:!0}),o)}function vu(e,t,r,n){const i={};if(n&&r){const n=fu(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(Za(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 yu(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(Ms(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return is(r[0],t);for(let e=r.length;e>0;e--){const n=r.slice(0,e).join(", ");if(!(n.length>t))return e===r.length?n:is(n,t)}return""}(e),n=t?"promise rejection":"exception";return Ya(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:es(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 bu extends Wc{constructor(e){Kc(e,"browser",["browser"],au.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&au.document&&au.document.addEventListener("visibilitychange",()=>{"hidden"===au.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=mu(e,t,r&&r.syntheticException||void 0,n);return el(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),Ol(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=vu(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Ol(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(uu&&_s.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:As(n)}},o=function(e){return[{type:"user_report"},e]}(e);return Bl(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(uu&&_s.log("No outcomes to send"));if(!this._dsn)return void(uu&&_s.log("No dsn provided, will not send outcomes"));uu&&_s.log("Sending outcomes:",e);const t=function(e,t){return Bl(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:Nl(),discarded_events:e}]])}(e,this._options.tunnel&&As(this._dsn));this._sendEnvelope(t)}}let wu;function xu(e,t=function(){if(wu)return wu;if(dl(au.fetch))return wu=au.fetch.bind(au);const e=au.document;let t=au.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){uu&&_s.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return wu=t.bind(au)}()){let r=0,n=0;return Yc(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 wu=void 0,r-=o,n--,Pl(e)}})}function Cu(e){return Yc(e,function(t){return new Ml((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 _u="?";function Su(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 Au=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ku=/\((\S*)(?::(\d+))(?::(\d+))\)/,Eu=[30,e=>{const t=Au.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=ku.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=Ru(t[1]||_u,t[2]);return Su(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Iu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Fu=[50,e=>{const t=Iu.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Tu.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]||_u;return[r,e]=Ru(r,e),Su(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Ou=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Pu=[40,e=>{const t=Ou.exec(e);return t?Su(t[2],t[1]||_u,+t[3],t[4]?+t[4]:void 0):void 0}],Mu=Bs(...[Eu,Fu,Pu]),Ru=(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]:_u,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Lu=1024,ju="Breadcrumbs",Du=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:ju,setupOnce(){},setup(e){t.console&&function(e){const t="console";qs(t,e),Gs(t,Xs)}(function(e){return function(t){if(uc()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:Dl(t.level),message:os(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${os(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}cc(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){qs("dom",e),Gs("dom",sl)}(function(e,t){return function(r){if(uc()!==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>Lu&&(uu&&_s.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=Lu),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=vs(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!ms.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){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}),cc(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){qs("xhr",e),Gs("xhr",kl)}(function(e){return function(t){if(uc()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[Al];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;cc({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";qs(t,e),Gs(t,hl)}(function(e){return function(t){if(uc()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){cc({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n})}else{const e=t.response;cc({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&Cl(function(e){return function(t){if(uc()!==e)return;let r=t.from,n=t.to;const i=Ll(au.location.href);let o=r?Ll(r):void 0;const a=Ll(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),cc({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){uc()===e&&cc({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:Js(t)},{event:t})}}(e))}}};Uc(ju,Du);const Nu="Dedupe",zu=()=>{let e;return{name:Nu,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||!Uu(e,t)||!Bu(e,t))}(e,t)&&!function(e,t){const r=Vu(t),n=Vu(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&Uu(e,t)&&Bu(e,t))}(e,t))}(t,e))return uu&&_s.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function Bu(e,t){let r=Hu(e),n=Hu(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=r[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function Uu(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 Vu(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Hu(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}Uc(Nu,zu);const Wu="GlobalHandlers",$u=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Wu,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";qs(t,e),Gs(t,ml)}(t=>{const{stackParser:r,attachStacktrace:n}=Yu();if(uc()!==e||lu())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&Ka(i)?function(e,t,r,n){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Ya(e)?e.message:e,a="Error";const s=o.match(i);return s&&(a=s[1],o=s[2]),qu({exception:{values:[{type:a,value:o}]}},t,r,n)}(i,o,a,s):qu(mu(r,l||i,void 0,n,!1),o,a,s);c.level="error",lc(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Gu("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";qs(t,e),Gs(t,yl)}(t=>{const{stackParser:r,attachStacktrace:n}=Yu();if(uc()!==e||lu())return;const i=function(e){if(Ja(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=Ja(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):mu(r,i,void 0,n,!0);o.level="error",lc(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Gu("onunhandledrejection"))}}};function qu(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=Ka(t)&&t.length>0?t:function(){try{return ms.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Gu(e){uu&&_s.log(`Global Handler attached: ${e}`)}function Yu(){const e=uc();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}Uc(Wu,$u);const Xu="HttpContext",Ku=()=>({name:Xu,setupOnce(){},preprocessEvent(e){if(!au.navigator&&!au.location&&!au.document)return;const t=e.request&&e.request.url||au.location&&au.location.href,{referrer:r}=au.document||{},{userAgent:n}=au.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}});Uc(Xu,Ku);const Zu="LinkedErrors",Ju=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:Zu,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();ls(du,o.stackParser,o.maxValueLength,r,t,e,n)}}};Uc(Zu,Ju);const Qu=["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"],ed="TryCatch",td=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:ed,setupOnce(){t.setTimeout&&Ts(au,"setTimeout",rd),t.setInterval&&Ts(au,"setInterval",rd),t.requestAnimationFrame&&Ts(au,"requestAnimationFrame",nd),t.XMLHttpRequest&&"XMLHttpRequest"in au&&Ts(XMLHttpRequest.prototype,"send",id);const e=t.eventTarget;e&&(Array.isArray(e)?e:Qu).forEach(od)}}};function rd(e){return function(...t){const r=t[0];return t[0]=cu(r,{mechanism:{data:{function:Hs(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function nd(e){return function(t){return e.apply(this,[cu(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Hs(e)},handled:!1,type:"instrument"}})])}}function id(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&Ts(r,e,function(t){const r={mechanism:{data:{function:e,handler:Hs(t)},handled:!1,type:"instrument"}},n=Ps(t);return n&&(r.mechanism.data.handler=Hs(n)),cu(t,r)})}),e.apply(this,t)}}function od(e){const t=au,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ts(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=cu(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Hs(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,cu(n,{mechanism:{data:{function:"addEventListener",handler:Hs(n),target:e},handled:!1,type:"instrument"}}),i])}}),Ts(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)}}))}Uc(ed,td);const ad=[eu(),ou(),td(),Du(),$u(),Ju(),zu(),Ku()];function sd(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...ad]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),au.SENTRY_RELEASE&&au.SENTRY_RELEASE.id&&(e.release=au.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Us(e.stackParser||Mu),integrations:Nc(e),transport:e.transport||(ul()?xu:Cu)};Gc(bu,t),e.autoSessionTracking&&function(){if(typeof au.document>"u")return void(uu&&_s.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));hc({ignoreDuration:!0}),gc(),Cl(({from:e,to:t})=>{void 0!==e&&e!==t&&(hc({ignoreDuration:!0}),gc())})}()}var ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ud(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}var dd=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(dd||{}),hd=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(hd||{});function fd(e,t){return{...t,message:e}}const pd=[{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}],gd={emoticons:fd("Emoticons"),doodles:fd("Doodles"),landmarks:fd("Landmarks"),bubbles:fd("Bubbles"),transportation:fd("Transportation"),beach:fd("Beach")},md={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},vd=[1,8,15,20,25];var yd=(e=>(e.DARK="dark",e.LIGHT="light",e))(yd||{});const bd=[{name:yd.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:yd.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 wd=(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))(wd||{});function xd(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=xd(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Cd(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=xd(e))&&(n&&(n+=" "),n+=t);return n}const _d=p((r,n)=>{const{attr:i,size:o,title:a,className:s,color:l,style:c,children:u,viewBox:d,width:h,height:f,...p}=r;return t("svg",{"aria-hidden":!a,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:d||"0 0 24 24",...i,...p,className:Cd("svg-icon",s,Sd(o)),style:{color:l,...c},ref:n,height:f||"1em",width:h||"1em",children:[a&&e("title",{children:a}),u]})});function Sd(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 Ad(t,r="",n){return i.memo(i.forwardRef((i,o)=>e(_d,{"data-testid":`${r}Icon`,ref:o,viewBox:n,...i,size:i.size||"md",children:t})))}function kd(e,t=""){return Ad(Ed(e),t)}function Ed(e){return(null==e?void 0:e.map)&&e.map((e,t)=>i.createElement(e.tag,{key:t,...e.attr},Ed(e.child)))}const Id=Ad(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),Td=Ad(e("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"),Fd=Ad(e("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),Od=Ad(e("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),Pd=Ad(e("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"),Md=Ad(e("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"),Rd=Ad(e("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"),Ld=Ad(e("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"),jd=Ad(e("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"),Dd=Ad(e("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"),Nd=Ad(e("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"),zd=Ad([e("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"),e("circle",{cx:"11",cy:"9",r:"1"},"1"),e("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),Bd=Ad(e("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"),Ud=Ad(e("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"),Vd=Ad(e("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),Hd={[wd.FILTER]:{name:fd("Applied Filters"),icon:Id},[wd.RESIZE]:{name:fd("Resized Image"),icon:Td},[wd.CROP]:{name:fd("Cropped Image"),icon:Fd},[wd.DRAW]:{name:fd("Added Drawing"),icon:Ud},[wd.TEXT]:{name:fd("Added Text"),icon:Od},[wd.SHAPES]:{name:fd("Added Shape"),icon:Pd},[wd.STICKERS]:{name:fd("Added Sticker"),icon:Md},[wd.FRAME]:{name:fd("Added Frame"),icon:Rd},[wd.MERGE]:{name:fd("Merged Objects"),icon:Ld},[wd.CORNERS]:{name:fd("Rounded Corner"),icon:jd},bgImage:{name:fd("Replaced Background Image"),icon:Dd},overlayImage:{name:fd("Added Image"),icon:Dd},initial:{name:fd("Initial"),icon:Vd},loadedState:{name:fd("Loaded State"),icon:Nd},objectStyle:{name:fd("Changed Style"),icon:zd},deletedObject:{name:fd("Deleted object"),icon:Bd}},Wd=Object.values(wd).map(e=>({name:e,icon:Hd[e].icon,action:e===wd.MERGE?e=>{e.tools.merge.apply()}:e})),$d={filter:fd("filter"),resize:fd("resize"),crop:fd("crop"),draw:fd("draw"),text:fd("text"),shapes:fd("shapes"),stickers:fd("stickers"),frame:fd("frame"),corners:fd("corners"),merge:fd("merge")},qd=Ad(e("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"),Gd="3.0.5",Yd={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:dd.INLINE,forceOverlayModeOnMobile:!0,activeTheme:yd.LIGHT,themes:bd,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:Nd,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:qd,label:fd("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:hd.BOTTOM,items:[...Wd]},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:{...md},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:vd,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:pd},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}}]}}},Xd=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 Kd={exports:{}},Zd={},Jd={exports:{}},Qd={},eh=i;
|
|
10
10
|
/**
|
|
11
11
|
* @license React
|
|
12
12
|
* use-sync-external-store-shim.production.min.js
|
|
@@ -58,7 +58,7 @@ function fP(){return fP=Object.assign?Object.assign.bind():function(e){for(var t
|
|
|
58
58
|
*
|
|
59
59
|
* @license MIT
|
|
60
60
|
*/
|
|
61
|
-
function AP(){return AP=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},AP.apply(this,arguments)}new Promise(()=>{});const kP=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const EP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",IP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,TP=n.forwardRef(function(e,t){let r,{onClick:i,relative:o,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,kP),{basename:p}=n.useContext(gP),g=!1;if("string"==typeof u&&IP.test(u)&&(r=u,EP))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;yP()||tP(!1);let{basename:i,navigator:o}=n.useContext(gP),{hash:a,pathname:s,search:l}=CP(e,{relative:r}),c=s;return"/"!==i&&(c="/"===s?i:lP([i,s])),o.createHref({pathname:c,search:l,hash:a})}(u,{relative:o}),v=function(e,t){let{target:r,replace:i,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=xP(),u=bP(),d=CP(e,{relative:s});return n.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!==i?i:rP(u)===rP(d);c(e,{replace:r,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,i,o,r,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});return n.createElement("a",AP({},f,{href:r||m,onClick:g||a?i:function(e){i&&i(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var FP,OP;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(FP||(FP={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(OP||(OP={}));const PP=Ad(e("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"),MP=Ad(e("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"),RP={opacity:0,y:50,scale:.3},LP={opacity:1,y:0,scale:1},jP={opacity:0,scale:.5};function DP(){const r=Zp(e=>e.toasts);return e("div",{className:"pointer-events-none relative",children:e(Yb,{initial:!1,children:r.map(r=>e("div",{className:Cd("fixed z-toast mx-auto p-20","bottom-center"===r.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:t(Ub.div,{initial:r.disableEnterAnimation?void 0:RP,animate:r.disableEnterAnimation?void 0:LP,exit:r.disableExitAnimation?void 0:jP,className:Cd("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 e;return null==(e=r.timer)?void 0:e.pause()},onPointerLeave:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},role:"alert","aria-live":"danger"===r.type?"assertive":"polite",children:["danger"===r.type&&e(PP,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===r.type&&e(IT,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===r.type&&e(MP,{className:"flex-shrink-0 text-positive",size:"md"}),e("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:e(vA,{value:r.message})}),r.action&&e(nC,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},onClick:()=>Jp().remove(r.id),elementType:TP,to:r.action.action,children:e(vA,{value:r.action.label})}),"loading"!==r.type&&e(gA,{onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{Jp().remove(r.id)},size:"sm",children:e(FA,{})})]})},r.id))})})}function NP(e){return hw()?e.metaKey:e.ctrlKey}function zP(e){switch(e.key){case"z":NP(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?Up().history.redo():Up().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),Up().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),Up().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),Up().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),Up().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),Up().objects.delete();break;case"v":NP(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&&Up().import.addImageFromData(e.target.result)},void n.readAsDataURL(r)}}catch(e){console.error(e)}}())}}const BP=new Map,UP=new Map,VP={};async function*HP(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 WP(e);yield new Tx(t,e.fullPath)}else e.isDirectory&&(yield*HP(e))}while(r.length>0)}function WP(e){return new Promise((t,r)=>e.file(t,r))}function $P(e){return null!=VP.dragTargetId?BP.get(VP.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 e of t)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await WP(e);yield new Tx(t,e.fullPath)}else e.isDirectory&&(yield*HP(e))}(e.dataTransfer))}:void 0}function qP(){const r=zp(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,n=zp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.position})??"bottom",i=zp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.position})??"top",o=zp(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,s=u(null),l=u(null),{isModal:d,isMobile:h}=OA(),f=c(async e=>{var t,r;if(Bp().activeTool||Bp().dirty||"nativeFile"!==e.type)return;const n=await e.getData();Up().import.fileIsValid(n[0])&&((null==(r=null==(t=Bp().config.tools)?void 0:t.import)?void 0:r.openDroppedImageAsBackground)?await Up().import.openBackgroundImage(n[0]):await Up().import.openUploadedFile(n[0]))},[]),{droppableProps:p}=function({id:e,disabled:t,ref:r,...n}){const i=u({dragOverElements:new Set,dropActivateTimer:void 0}).current,o=u(n);o.current=n,x(()=>(UP.set(e,{...UP.get(e),disabled:t,id:e,ref:r}),()=>{UP.delete(e)}),[e,o,t,r]);const a=e=>{var t;const n=o.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))},s=e=>{var t,r;const n=$P(e);n&&(null==(r=(t=o.current).onDragLeave)||r.call(t,n))};return{droppableProps:t?{}:{onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation();const n=$P(e);n&&a(n)&&(null==(r=(t=o.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=$P(e);n&&a(n)&&(null==(r=(t=o.current).onDragEnter)||r.call(t,n),clearTimeout(i.dropActivateTimer),"function"==typeof o.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;n&&(null==(t=(e=o.current).onDropActivate)||t.call(e,n))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const t of i.dragOverElements)e.currentTarget.contains(t)||i.dragOverElements.delete(t);if(i.dragOverElements.size>0)return;const t=$P(e);t&&a(t)&&(s(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,r,n,l;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),s(e),clearTimeout(i.dropActivateTimer);const c=$P(e);c&&(null==(r=(t=o.current).onDragLeave)||r.call(t,c),a(c)&&(null==(l=(n=o.current).onDrop)||l.call(n,c)))}}}}({id:"pixie-root",ref:l,types:["nativeFile"],onDrop:f});a(()=>{var e,t;Bp().fabric||(zp.setState({canvasRef:s}),Yx(s.current),null!=(e=Bp().config.ui)&&e.defaultTool&&Bp().setActiveTool(null==(t=Bp().config.ui)?void 0:t.defaultTool,null),Up().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=Bp().config).onLoad)||t.call(e,Bp().editor)}));const r=Xx(l,()=>{Bp().setStageSize(Kx(l.current))}),n=Xx(s,()=>{Bp().setCanvasSize(Kx(s.current))});return()=>{r(),n()}},[l]);const g=Cd("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!d,"fixed inset-0 w-full h-full z-20":d,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":d&&!h});return t(Xb,{features:Zb,strict:!0,children:[d&&r&&!h&&o&&e(gA,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{Bp().editor.close()},children:e(FA,{})}),d&&r&&e(yS,{position:"fixed",disableInitialTransition:!0}),t(Ub.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:r?"visible":"hidden",className:g,children:["top"===i&&e(NA,{}),"top"===n&&e(MO,{className:"pt-14"}),t("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...cw(p,{onKeyDownCapture:zP}),ref:l,children:[e(BA,{}),e(yE,{ref:s})]}),e(CF,{}),"bottom"===n&&e(MO,{}),"bottom"===i&&e(NA,{}),e(ZO,{}),e(DP,{})]})]})}!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:[]};if(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);else if(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})}})}(),Wa.enableBoundaryChecking(!1);const GP=class t{constructor(t){if(Ma(this,"tools",{}),Ma(this,"fabric",null),t.sentryDsn&&function(e){const t={...e};Kc(t,"react"),sd(t)}({dsn:t.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'),!t.selector)throw new Error('Pixie required "selector" option.');const r=document.querySelector(t.selector);r&&(r.classList.add("pi"),function(e){Pp=e,Mp=e}(r),this.setConfig(t),zp.setState({editor:this}),S(r).render(e(i.StrictMode,{children:e(qP,{})})))}get state(){return Bp()}get defaultConfig(){return t.defaultConfig}open(e={}){return new Promise(async t=>{var r;Object.keys(e).length?await this.resetEditor({...Cf(e,{ui:{visible:!0},image:e.image||Bp().config.image,state:e.state||Bp().config.state,blankCanvasSize:e.blankCanvasSize||Bp().config.blankCanvasSize})}):null!=(r=Bp().config.ui)&&r.visible||Bp().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,r;null!=(e=Bp().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(r=(t=Bp().config).onClose)||r.call(t))}setConfig(e){Bp().setConfig(e)}uploadAndAddImage(){return Up().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return Up().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return Up().import.uploadAndOpenStateFile()}newCanvas(e,t,r){return Up().canvas.openNew(e,t,r)}getState(e){return JSON.stringify(qp(e))}setState(e){return Up().import.loadState(e)}async setStateFromUrl(e){const t=await Wp(e);return Up().import.loadState(t)}openTool(e){Gp(e)}applyChanges(){Bp().applyChanges()}cancelChanges(){Bp().cancelChanges()}async resetEditor(e){await Hp(e),await Up().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&Bp().togglePanel("history",!1),"history"===e&&Bp().togglePanel("objects",!1),Bp().togglePanel(e,t)}on(e,t){var r;null==(r=this.fabric)||r.on(e,t)}isDirty(){return Bp().dirty}get(e){return this.tools[e]}notify(e){return Qp(e)}static init(e){return new Promise(t=>{const r=e.onLoad;e.onLoad=e=>{null==r||r(e),t(e)},new this(e)})}};Ma(GP,"defaultConfig",Yd),Ma(GP,"version",Gd);let YP=GP;function XP(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 KP="fm-pixie-editor";const ZP=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(KP),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${KP}`}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 YP.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=XP)}):console.warn("Pixie fabric instance is not available")}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 JP(e,t){if(!e)return t;if(!t)return e;return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function QP(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const r=function(e){const t="undefined"!=typeof __webpack_public_path__?__webpack_public_path__:"";if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let r=JP(t,e||"");return!r||r.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(r)||(r="/"+r),r}(e),n=JP(r,t);return!n||n.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)?n:"/"+n}var eM,tM;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(eM||(eM={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(tM||(tM={}));const rM=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());const nM=({visible:r,onClose:n,file:o,onSave:s})=>{const{t:l}=Hr(),c=i.useRef(null),u=Si(),d=uo(),{options:h,actions:f,state:p}=bi(),{i18n:g}=Hr(),{config:m}=h,{setCurrentMenuFile:v,setLoading:y}=f,{loading:b}=p,{handleAddFileByUrl:w,getFileData:x}=d,[C,_]=i.useState(null),[S,A]=i.useState(""),[k,E]=i.useState(!1),[I,T]=i.useState(!1),[F,O]=i.useState(null),P=i.useRef(!1),M=i.useRef(),R=i.useRef(void 0);M.current=s,i.useEffect(()=>{o&&!P.current&&(y&&!b&&y(!0),(async()=>{if(R.current!==o)if("object"!=typeof o)try{if(R.current=o,o.startsWith("data:"))O({thumbnail:o});else{const e=await w(o,!0);if(!e)throw new Error(l("Failed to download file"));R.current===o&&O(e)}}finally{R.current===o&&(R.current=null,y&&y(!1))}else O(o)})())},[o,w,b,O,y,l]);const L=i.useCallback(async e=>{try{if(e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await x(e.id);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 console.error("Error getting the image data:",e),e}},[x,l]);i.useEffect(()=>{if(!C&&r){const e=async()=>{var e,t,r;null==y||y(!0);try{const e=F?await L(F):null;_(e);const t=F?F.type:"";A(t||"image/png")}catch(i){console.error("🎨 Error loading the image:",i),u.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:i,message:l("Error loading image"),placement:"bottomRight",data:{itemId:null!==(e=null==F?void 0:F.id)&&void 0!==e?e:void 0,itemName:null!==(t=null==F?void 0:F.name)&&void 0!==t?t:void 0,folderId:null!==(r=null==F?void 0:F.folderId)&&void 0!==r?r:null,thumbnail:null==F?void 0:F.thumbnail}}),null==n||n()}};e()}},[F,L,C,b,u,n,y,l,r]);const j=i.useCallback(async(e,t,r)=>{var i,o,a;if(!F||!M.current)return;const s="object"==typeof F&&null!==F?F:null;let c=null;try{null==y||y(!0);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("jpg"===e&&(r="image/jpeg"),t.startsWith("data:")){const e=t.match(/^data:([^;]+)/);e&&e[1].startsWith("image/")&&(r=e[1]);const n=t.replace(/data:image\/[^;]+;base64,/,"");return rM(n,r)}return rM(t,r)}(r,e),o=i.type||`image/${r}`;if("jpg"===r&&(o="image/jpeg"),"image/gif"!==o&&m)try{const e=new File([i],t,{type:o});i=await co(e,{maxSizeMB:m.compressMaxSize||.5,maxWidthOrHeight:m.compressMaxWidthOrHeight||2e3,mimeType:o})}catch(e){console.warn("Image compression failed, using original:",e)}const a=e.startsWith("data:")?e:`data:${o};base64,${e}`,s=Object.assign(Object.assign({},F),{thumbnail:a,size:i.size,date:(new Date).toISOString().split("T")[0],type:o,folderId:F.folderId||"",name:F.name,extension:F.extension||F.name.split(".").pop()||""});c=s;const l=await M.current(s);if(l)return h.onEditorOk&&h.onEditorOk(l),null==y||y(!1),l;null==y||y(!1),null==n||n()}catch(e){console.error("Error saving:",e);const r=null!=c?c:s;u.error({id:"IMAGE_SAVE_FAILED",message:l("Error saving image"),placement:"bottomRight",data:{itemId:null!==(i=null==r?void 0:r.id)&&void 0!==i?i:void 0,itemName:null!==(o=null==r?void 0:r.name)&&void 0!==o?o:t,folderId:null!==(a=null==r?void 0:r.folderId)&&void 0!==a?a:null,thumbnail:null==r?void 0:r.thumbnail},innerException:e}),null==y||y(!1)}},[m,F,u,n,h,y,l]),N=i.useCallback(async()=>{var e;if(!ZP.isLoaded()||!F)return void console.error("❌ Pixie instance or file is missing");const t=F.name||"edited-image",r=F.extension||S.split("/")[1]||"png";try{let n;n="jpg"===r?"jpeg":["png","jpeg","json","svg"].includes(r)?r:"jpeg",await(null===(e=ZP.tools)||void 0===e?void 0:e.export.save(t.replace(/\.[^/.]+$/,""),n,.8))}catch(e){console.error("🎨 Error saving through the button:",e);try{const e=ZP.canvas,n=e?e.toDataURL(`image/${r}`):null;n&&await j(n,t,r)}catch(e){console.error("🎨 Alternative method also did not work:",e)}}},[F,S,j]),z=i.useCallback(async()=>{if(C&&r&&k&&!P.current)try{P.current=!0;const t=c.current;let r=0;for(;r<20&&(0===t.clientWidth||0===t.clientHeight);)await new Promise(e=>setTimeout(e,50)),r++;const i=(null==m?void 0:m.locale)?null==m?void 0:m.locale.replace("_","-"):"en",o=matchMedia(sr).matches?or:ir,a=(null==m?void 0:m.theme)===ar?o:null==m?void 0:m.theme,s=((null==m?void 0:m.locale)||g.language||"en").split("-")[0].split("_")[0],l=(g.getResourceBundle(s,"translation")||{}).pixie||{},u=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),d={};Object.entries(l).forEach(([e,t])=>{const r=u(e);d[r]=t,d[e]=t});const h={[i]:d},f={selector:"#pixie-editor",baseUrl:QP((null==m?void 0:m.baseUrl)||"",(null==m?void 0:m.assetsUrl)||"assets/image-editor"),image:C,activeLanguage:i,languages:h,ui:{activeTheme:a,mode:"inline",forceOverlayModeOnMobile:!1,visible:!0,menubar:{replaceDefaultItems:!0,position:eM.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>e(ye,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>e(ve,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:n}]},nav:{position:tM.TOP}},tools:{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{null==y||y(!0);return await j(e,t,r)}catch(e){throw console.error("🎨 PIXIE onSave ERROR:",e),null==y||y(!1),e}}};try{T(!1),await ZP.show(f,c.current);const e=ZP.canvas;e&&e.focus(),T(!0),y&&y(!1)}catch(e){console.error("init pixie failed:",e)}}catch(e){console.error("Error initializing Pixie:",e),u.error({id:"EDITOR_INIT_FAILED",message:l("Error initializing editor"),placement:"bottomRight",innerException:e}),P.current=!1,null==n||n()}},[C,r,k,null==m?void 0:m.locale,null==m?void 0:m.theme,null==m?void 0:m.baseUrl,null==m?void 0:m.assetsUrl,n,y,j,u,g,l]);return i.useEffect(()=>{r&&C&&k&&z()},[r,C,k,z]),i.useEffect(()=>{if(!r){try{ZP.close()}catch(e){console.warn("Error closing Pixie:",e)}_(null),A(""),P.current=!1,E(!1),T(!1)}return()=>{try{ZP.close()}catch(e){console.warn("Error closing Pixie when unmounting:",e)}}},[r]),a(()=>{I&&y&&y(!1)},[I,y]),e(G,{title:(null==F?void 0:F.name)?l("Editing: {{name}}",{name:F.name}):l("Editing image"),open:r,closeIcon:null,onCancel:n,afterOpenChange:e=>E(e),forceRender:!0,width:"100vw",style:{top:0,height:"100vh",maxWidth:"none",padding:10},styles:{body:{height:"85vh",padding:0}},footer:[e(D,{onClick:n,disabled:!k||b,children:l("Cancel")},"cancel"),e(D,{type:"primary",onClick:N,loading:b,children:l("Save")},"save")],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{v&&v("")},children:t("div",{ref:c,style:{position:"relative",width:"100%",height:"100%"},children:[r&&!I?e("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:e("span",{style:{fontSize:14,color:"#555"},children:l("Loading editor...")})}):null,b&&e(ka,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})};var iM="uploadProgress",oM="uploadProgress__card",aM="uploadProgress__header",sM="uploadProgress__header-title",lM="uploadProgress__header-buttons",cM="uploadProgress__header-button",uM="uploadProgress__close-icon",dM="uploadProgress__body",hM="uploadProgress__list-wrapper",fM="uploadProgress__status-icon",pM="uploadProgress__file-item",gM="uploadProgress__body--error",mM="uploadProgress__file-avatar",vM="uploadProgress__file-info",yM="uploadProgress__file-name",bM="uploadProgress__file-size",wM="uploadProgress__progress-bar",xM="uploadProgress__error-note",CM="uploadProgress__minimized",_M="uploadProgress__minimized-button",SM="uploadProgress__file-list";const{Text:AM}=P,kM=({visible:r,files:n,totalFiles:i,completedFiles:o,onClose:a,onMinimize:s,onInsert:l,minimized:c=!1})=>{const{token:u}=k.useToken(),{t:d}=Hr();if(!r)return null;const h=t=>{switch(t){case"success":return e("div",{className:fM,children:e(xe,{style:{color:u.colorSuccess}})});case"error":return e(we,{style:{color:u.colorError}});default:return e(be,{style:{color:"#1890ff"}})}},f=e=>{if(e.includes(d("KB"))||e.includes("MB")||e.includes("GB"))return e;const t=parseInt(e);return isNaN(t)?e:`${(t/1024).toFixed(2)} ${d("KB")}`},p=t=>"success"===t.status?[e(D,{type:"primary",size:"small",onClick:()=>l(t),children:d("Insert")},"insert")]:"error"===t.status?[e(AM,{type:"danger",style:{fontSize:"12px"},children:t.error||d("Error")},"error")]:[];if(c)return e("div",{className:CM,children:e(D,{type:"primary",size:"small",onClick:s,className:_M,children:d("Upload progress",{completed:o,total:i})})});const g=n.filter(e=>"uploading"===e.status).length,m=n.filter(e=>"success"===e.status).length,v=n.filter(e=>"error"===e.status).length;return e("div",{className:iM+" fm-upload-progress",children:t("div",{className:oM,children:[t("div",{className:aM,children:[e(AM,{strong:!0,className:sM,children:g>0?d("Uploading files",{completed:o,total:i}):m>0?d("Uploaded files",{success:m,total:i}):d("Upload error files",{errorCount:v})}),e("div",{className:lM,children:e(D,{type:"text",size:"small",icon:e(ve,{className:uM}),onClick:a,className:cM})})]}),t("div",{className:`${dM} ${n.some(e=>"error"===e.status)?gM:""}`,children:[e("div",{className:hM,children:e(K,{className:SM,size:"small",dataSource:n,renderItem:r=>e(K.Item,{className:pM,actions:p(r),children:e(K.Item.Meta,{avatar:e(J,{size:"small",icon:h(r.status),className:mM}),title:t("div",{className:vM,children:[e(AM,{ellipsis:!0,className:yM,children:r.name}),e(AM,{type:"secondary",className:bM,children:f(r.size)})]}),description:"uploading"===r.status&&e(Z,{percent:r.progress,size:"small",status:"active",showInfo:!1,className:wM})})})})}),n.some(e=>"error"===e.status)&&e("div",{className:xM,children:e(AM,{type:"danger",style:{fontSize:"12px"},children:d("Some files failed to upload")})})]})]})})},{Header:EM}=Q,{Title:IM}=P,TM=({activeLibraryItem:t,selectedFolder:r,isTrashFolder:n})=>{const{t:i}=Hr(),o=t===Qt&&(null!=n?n:"Trash"===r),a={[Qt]:i("My files"),[er]:i("GIF"),[tr]:i("Stock images"),[rr]:i("AI image generation")};let s;return s=t===Qt?o?i("Deleted"):r:a[t],e(EM,{className:"actions-header",children:e("div",{className:"header-title-container",children:e(IM,{level:5,className:"header-title",children:s})})})};
|
|
61
|
+
function AP(){return AP=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},AP.apply(this,arguments)}new Promise(()=>{});const kP=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const EP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",IP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,TP=n.forwardRef(function(e,t){let r,{onClick:i,relative:o,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,kP),{basename:p}=n.useContext(gP),g=!1;if("string"==typeof u&&IP.test(u)&&(r=u,EP))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;yP()||tP(!1);let{basename:i,navigator:o}=n.useContext(gP),{hash:a,pathname:s,search:l}=CP(e,{relative:r}),c=s;return"/"!==i&&(c="/"===s?i:lP([i,s])),o.createHref({pathname:c,search:l,hash:a})}(u,{relative:o}),v=function(e,t){let{target:r,replace:i,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=xP(),u=bP(),d=CP(e,{relative:s});return n.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!==i?i:rP(u)===rP(d);c(e,{replace:r,state:o,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,i,o,r,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});return n.createElement("a",AP({},f,{href:r||m,onClick:g||a?i:function(e){i&&i(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var FP,OP;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(FP||(FP={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(OP||(OP={}));const PP=Ad(e("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"),MP=Ad(e("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"),RP={opacity:0,y:50,scale:.3},LP={opacity:1,y:0,scale:1},jP={opacity:0,scale:.5};function DP(){const r=Zp(e=>e.toasts);return e("div",{className:"pointer-events-none relative",children:e(Yb,{initial:!1,children:r.map(r=>e("div",{className:Cd("fixed z-toast mx-auto p-20","bottom-center"===r.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:t(Ub.div,{initial:r.disableEnterAnimation?void 0:RP,animate:r.disableEnterAnimation?void 0:LP,exit:r.disableExitAnimation?void 0:jP,className:Cd("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 e;return null==(e=r.timer)?void 0:e.pause()},onPointerLeave:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},role:"alert","aria-live":"danger"===r.type?"assertive":"polite",children:["danger"===r.type&&e(PP,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===r.type&&e(IT,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===r.type&&e(MP,{className:"flex-shrink-0 text-positive",size:"md"}),e("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:e(vA,{value:r.message})}),r.action&&e(nC,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},onClick:()=>Jp().remove(r.id),elementType:TP,to:r.action.action,children:e(vA,{value:r.action.label})}),"loading"!==r.type&&e(gA,{onFocus:()=>{var e;return null==(e=r.timer)?void 0:e.pause()},onBlur:()=>{var e;return null==(e=r.timer)?void 0:e.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{Jp().remove(r.id)},size:"sm",children:e(FA,{})})]})},r.id))})})}function NP(e){return hw()?e.metaKey:e.ctrlKey}function zP(e){switch(e.key){case"z":NP(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?Up().history.redo():Up().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),Up().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),Up().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),Up().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),Up().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),Up().objects.delete();break;case"v":NP(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&&Up().import.addImageFromData(e.target.result)},void n.readAsDataURL(r)}}catch(e){console.error(e)}}())}}const BP=new Map,UP=new Map,VP={};async function*HP(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 WP(e);yield new Tx(t,e.fullPath)}else e.isDirectory&&(yield*HP(e))}while(r.length>0)}function WP(e){return new Promise((t,r)=>e.file(t,r))}function $P(e){return null!=VP.dragTargetId?BP.get(VP.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 e of t)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await WP(e);yield new Tx(t,e.fullPath)}else e.isDirectory&&(yield*HP(e))}(e.dataTransfer))}:void 0}function qP(){const r=zp(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,n=zp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.nav)?void 0:r.position})??"bottom",i=zp(e=>{var t,r;return null==(r=null==(t=e.config.ui)?void 0:t.menubar)?void 0:r.position})??"top",o=zp(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,s=u(null),l=u(null),{isModal:d,isMobile:h}=OA(),f=c(async e=>{var t,r;if(Bp().activeTool||Bp().dirty||"nativeFile"!==e.type)return;const n=await e.getData();Up().import.fileIsValid(n[0])&&((null==(r=null==(t=Bp().config.tools)?void 0:t.import)?void 0:r.openDroppedImageAsBackground)?await Up().import.openBackgroundImage(n[0]):await Up().import.openUploadedFile(n[0]))},[]),{droppableProps:p}=function({id:e,disabled:t,ref:r,...n}){const i=u({dragOverElements:new Set,dropActivateTimer:void 0}).current,o=u(n);o.current=n,x(()=>(UP.set(e,{...UP.get(e),disabled:t,id:e,ref:r}),()=>{UP.delete(e)}),[e,o,t,r]);const a=e=>{var t;const n=o.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))},s=e=>{var t,r;const n=$P(e);n&&(null==(r=(t=o.current).onDragLeave)||r.call(t,n))};return{droppableProps:t?{}:{onDragOver:e=>{var t,r;e.preventDefault(),e.stopPropagation();const n=$P(e);n&&a(n)&&(null==(r=(t=o.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=$P(e);n&&a(n)&&(null==(r=(t=o.current).onDragEnter)||r.call(t,n),clearTimeout(i.dropActivateTimer),"function"==typeof o.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;n&&(null==(t=(e=o.current).onDropActivate)||t.call(e,n))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const t of i.dragOverElements)e.currentTarget.contains(t)||i.dragOverElements.delete(t);if(i.dragOverElements.size>0)return;const t=$P(e);t&&a(t)&&(s(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,r,n,l;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),s(e),clearTimeout(i.dropActivateTimer);const c=$P(e);c&&(null==(r=(t=o.current).onDragLeave)||r.call(t,c),a(c)&&(null==(l=(n=o.current).onDrop)||l.call(n,c)))}}}}({id:"pixie-root",ref:l,types:["nativeFile"],onDrop:f});a(()=>{var e,t;Bp().fabric||(zp.setState({canvasRef:s}),Yx(s.current),null!=(e=Bp().config.ui)&&e.defaultTool&&Bp().setActiveTool(null==(t=Bp().config.ui)?void 0:t.defaultTool,null),Up().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=Bp().config).onLoad)||t.call(e,Bp().editor)}));const r=Xx(l,()=>{Bp().setStageSize(Kx(l.current))}),n=Xx(s,()=>{Bp().setCanvasSize(Kx(s.current))});return()=>{r(),n()}},[l]);const g=Cd("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!d,"fixed inset-0 w-full h-full z-20":d,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":d&&!h});return t(Xb,{features:Zb,strict:!0,children:[d&&r&&!h&&o&&e(gA,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{Bp().editor.close()},children:e(FA,{})}),d&&r&&e(yS,{position:"fixed",disableInitialTransition:!0}),t(Ub.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:r?"visible":"hidden",className:g,children:["top"===i&&e(NA,{}),"top"===n&&e(MO,{className:"pt-14"}),t("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...cw(p,{onKeyDownCapture:zP}),ref:l,children:[e(BA,{}),e(yE,{ref:s})]}),e(CF,{}),"bottom"===n&&e(MO,{}),"bottom"===i&&e(NA,{}),e(ZO,{}),e(DP,{})]})]})}!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:[]};if(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);else if(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})}})}(),Wa.enableBoundaryChecking(!1);const GP=class t{constructor(t){if(Ma(this,"tools",{}),Ma(this,"fabric",null),t.sentryDsn&&function(e){const t={...e};Kc(t,"react"),sd(t)}({dsn:t.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'),!t.selector)throw new Error('Pixie required "selector" option.');const r=document.querySelector(t.selector);r&&(r.classList.add("pi"),function(e){Pp=e,Mp=e}(r),this.setConfig(t),zp.setState({editor:this}),S(r).render(e(i.StrictMode,{children:e(qP,{})})))}get state(){return Bp()}get defaultConfig(){return t.defaultConfig}open(e={}){return new Promise(async t=>{var r;Object.keys(e).length?await this.resetEditor({...Cf(e,{ui:{visible:!0},image:e.image||Bp().config.image,state:e.state||Bp().config.state,blankCanvasSize:e.blankCanvasSize||Bp().config.blankCanvasSize})}):null!=(r=Bp().config.ui)&&r.visible||Bp().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,r;null!=(e=Bp().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(r=(t=Bp().config).onClose)||r.call(t))}setConfig(e){Bp().setConfig(e)}uploadAndAddImage(){return Up().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return Up().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return Up().import.uploadAndOpenStateFile()}newCanvas(e,t,r){return Up().canvas.openNew(e,t,r)}getState(e){return JSON.stringify(qp(e))}setState(e){return Up().import.loadState(e)}async setStateFromUrl(e){const t=await Wp(e);return Up().import.loadState(t)}openTool(e){Gp(e)}applyChanges(){Bp().applyChanges()}cancelChanges(){Bp().cancelChanges()}async resetEditor(e){await Hp(e),await Up().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&Bp().togglePanel("history",!1),"history"===e&&Bp().togglePanel("objects",!1),Bp().togglePanel(e,t)}on(e,t){var r;null==(r=this.fabric)||r.on(e,t)}isDirty(){return Bp().dirty}get(e){return this.tools[e]}notify(e){return Qp(e)}static init(e){return new Promise(t=>{const r=e.onLoad;e.onLoad=e=>{null==r||r(e),t(e)},new this(e)})}};Ma(GP,"defaultConfig",Yd),Ma(GP,"version",Gd);let YP=GP;function XP(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 KP="fm-pixie-editor";const ZP=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(KP),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${KP}`}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 YP.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=XP)}):console.warn("Pixie fabric instance is not available")}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 JP(e,t){if(!e)return t;if(!t)return e;return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function QP(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const r=function(e){const t="undefined"!=typeof __webpack_public_path__?__webpack_public_path__:"";if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let r=JP(t,e||"");return!r||r.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(r)||(r="/"+r),r}(e),n=JP(r,t);return!n||n.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(n)?n:"/"+n}var eM,tM;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(eM||(eM={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(tM||(tM={}));const rM=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob());const nM=({visible:r,onClose:n,file:o,onSave:s})=>{const{t:l}=Hr(),c=i.useRef(null),u=Si(),d=uo(),{options:h,actions:f,state:p}=bi(),{i18n:g}=Hr(),{config:m}=h,{setCurrentMenuFile:v,setLoading:y}=f,{loading:b}=p,{handleAddFileByUrl:w,getFileData:x}=d,[C,_]=i.useState(null),[S,A]=i.useState(""),[k,E]=i.useState(!1),[I,T]=i.useState(!1),[F,O]=i.useState(null),P=i.useRef(!1),M=i.useRef(),R=i.useRef(void 0);M.current=s,i.useEffect(()=>{o&&!P.current&&(y&&!b&&y(!0),(async()=>{if(R.current!==o)if("object"!=typeof o)try{if(R.current=o,o.startsWith("data:"))O({thumbnail:o});else{const e=await w(o,!0);if(!e)throw new Error(l("Failed to download file"));R.current===o&&O(e)}}finally{R.current===o&&(R.current=null,y&&y(!1))}else O(o)})())},[o,w,b,O,y,l]);const L=i.useCallback(async e=>{try{if(e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await x(e.id);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 console.error("Error getting the image data:",e),e}},[x,l]);i.useEffect(()=>{if(!C&&r){const e=async()=>{var e,t,r;null==y||y(!0);try{const e=F?await L(F):null;_(e);const t=F?F.type:"";A(t||"image/png")}catch(i){console.error("🎨 Error loading the image:",i),u.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:i,message:l("Error loading image"),placement:"bottomRight",data:{itemId:null!==(e=null==F?void 0:F.id)&&void 0!==e?e:void 0,itemName:null!==(t=null==F?void 0:F.name)&&void 0!==t?t:void 0,folderId:null!==(r=null==F?void 0:F.folderId)&&void 0!==r?r:null,thumbnail:null==F?void 0:F.thumbnail}}),null==n||n()}};e()}},[F,L,C,b,u,n,y,l,r]);const j=i.useCallback(async(e,t,r)=>{var i,o,a;if(!F||!M.current)return;const s="object"==typeof F&&null!==F?F:null;let c=null;try{null==y||y(!0);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("jpg"===e&&(r="image/jpeg"),t.startsWith("data:")){const e=t.match(/^data:([^;]+)/);e&&e[1].startsWith("image/")&&(r=e[1]);const n=t.replace(/data:image\/[^;]+;base64,/,"");return rM(n,r)}return rM(t,r)}(r,e),o=i.type||`image/${r}`;if("jpg"===r&&(o="image/jpeg"),"image/gif"!==o&&m)try{const e=new File([i],t,{type:o});i=await co(e,{maxSizeMB:m.compressMaxSize||.5,maxWidthOrHeight:m.compressMaxWidthOrHeight||2e3,mimeType:o})}catch(e){console.warn("Image compression failed, using original:",e)}const a=e.startsWith("data:")?e:`data:${o};base64,${e}`,s=Object.assign(Object.assign({},F),{thumbnail:a,size:i.size,date:(new Date).toISOString().split("T")[0],type:o,folderId:F.folderId||"",name:F.name,extension:F.extension||F.name.split(".").pop()||""});c=s;const l=await M.current(s);if(l)return h.onEditorOk&&h.onEditorOk(l),null==y||y(!1),l;null==y||y(!1),null==n||n()}catch(e){console.error("Error saving:",e);const r=null!=c?c:s;u.error({id:"IMAGE_SAVE_FAILED",message:l("Error saving image"),placement:"bottomRight",data:{itemId:null!==(i=null==r?void 0:r.id)&&void 0!==i?i:void 0,itemName:null!==(o=null==r?void 0:r.name)&&void 0!==o?o:t,folderId:null!==(a=null==r?void 0:r.folderId)&&void 0!==a?a:null,thumbnail:null==r?void 0:r.thumbnail},innerException:e}),null==y||y(!1)}},[m,F,u,n,h,y,l]),N=i.useCallback(async()=>{var e;if(!ZP.isLoaded()||!F)return void console.error("❌ Pixie instance or file is missing");const t=F.name||"edited-image",r=F.extension||S.split("/")[1]||"png";try{let n;n="jpg"===r?"jpeg":["png","jpeg","json","svg"].includes(r)?r:"jpeg",await(null===(e=ZP.tools)||void 0===e?void 0:e.export.save(t.replace(/\.[^/.]+$/,""),n,.8))}catch(e){console.error("🎨 Error saving through the button:",e);try{const e=ZP.canvas,n=e?e.toDataURL(`image/${r}`):null;n&&await j(n,t,r)}catch(e){console.error("🎨 Alternative method also did not work:",e)}}},[F,S,j]),z=i.useCallback(async()=>{if(C&&r&&k&&!P.current)try{P.current=!0;const t=c.current;let r=0;for(;r<20&&(0===t.clientWidth||0===t.clientHeight);)await new Promise(e=>setTimeout(e,50)),r++;const i=(null==m?void 0:m.locale)?null==m?void 0:m.locale.replace("_","-"):"en",o=matchMedia(sr).matches?or:ir,a=(null==m?void 0:m.theme)===ar?o:null==m?void 0:m.theme,s=((null==m?void 0:m.locale)||g.language||"en").split("-")[0].split("_")[0],l=(g.getResourceBundle(s,"translation")||{}).pixie||{},u=e=>e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),d={};Object.entries(l).forEach(([e,t])=>{const r=u(e);d[r]=t,d[e]=t});const h={[i]:d},f={selector:"#pixie-editor",baseUrl:QP((null==m?void 0:m.baseUrl)||"",(null==m?void 0:m.assetsUrl)||"assets/image-editor"),image:C,activeLanguage:i,languages:h,ui:{activeTheme:a,mode:"inline",forceOverlayModeOnMobile:!1,visible:!0,menubar:{replaceDefaultItems:!0,position:eM.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>e(ye,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>e(ve,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:n}]},nav:{position:tM.TOP}},tools:{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{null==y||y(!0);return await j(e,t,r)}catch(e){throw console.error("🎨 PIXIE onSave ERROR:",e),null==y||y(!1),e}}};try{T(!1),await ZP.show(f,c.current);const e=ZP.canvas;e&&e.focus(),T(!0),y&&y(!1)}catch(e){console.error("init pixie failed:",e)}}catch(e){console.error("Error initializing Pixie:",e),u.error({id:"EDITOR_INIT_FAILED",message:l("Error initializing editor"),placement:"bottomRight",innerException:e}),P.current=!1,null==n||n()}},[C,r,k,null==m?void 0:m.locale,null==m?void 0:m.theme,null==m?void 0:m.baseUrl,null==m?void 0:m.assetsUrl,n,y,j,u,g,l]);return i.useEffect(()=>{r&&C&&k&&z()},[r,C,k,z]),i.useEffect(()=>{if(!r){try{ZP.close()}catch(e){console.warn("Error closing Pixie:",e)}_(null),A(""),P.current=!1,E(!1),T(!1)}return()=>{try{ZP.close()}catch(e){console.warn("Error closing Pixie when unmounting:",e)}}},[r]),a(()=>{I&&y&&y(!1)},[I,y]),e(G,{title:(null==F?void 0:F.name)?l("Editing: {{name}}",{name:F.name}):l("Editing image"),open:r,closeIcon:null,onCancel:n,afterOpenChange:e=>E(e),forceRender:!0,width:"100vw",style:{top:0,height:"100vh",maxWidth:"none",padding:10},styles:{body:{height:"85vh",padding:0}},footer:[e(D,{onClick:n,disabled:!k||b,children:l("Cancel")},"cancel"),e(D,{type:"primary",onClick:N,loading:b,children:l("Save")},"save")],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{v&&v("")},children:t("div",{ref:c,style:{position:"relative",width:"100%",height:"100%"},children:[r&&!I?e("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:e("span",{style:{fontSize:14,color:"#555"},children:l("Loading editor...")})}):null,b&&e(ka,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})};var iM="uploadProgress",oM="uploadProgress__card",aM="uploadProgress__header",sM="uploadProgress__header-title",lM="uploadProgress__header-buttons",cM="uploadProgress__header-button",uM="uploadProgress__close-icon",dM="uploadProgress__body",hM="uploadProgress__list-wrapper",fM="uploadProgress__status-icon",pM="uploadProgress__file-item",gM="uploadProgress__body--error",mM="uploadProgress__file-avatar",vM="uploadProgress__file-info",yM="uploadProgress__file-name",bM="uploadProgress__file-size",wM="uploadProgress__progress-bar",xM="uploadProgress__error-note",CM="uploadProgress__minimized",_M="uploadProgress__minimized-button",SM="uploadProgress__file-list";const{Text:AM}=P,kM=({visible:r,files:n,totalFiles:i,completedFiles:o,onClose:a,onMinimize:s,onInsert:l,minimized:c=!1})=>{const{token:u}=k.useToken(),{t:d}=Hr();if(!r)return null;const h=t=>{switch(t){case"success":return e("div",{className:fM,children:e(xe,{style:{color:u.colorSuccess}})});case"error":return e(we,{style:{color:u.colorError}});default:return e(be,{style:{color:"#1890ff"}})}},f=e=>{if(e.includes(d("KB"))||e.includes("MB")||e.includes("GB"))return e;const t=parseInt(e);return isNaN(t)?e:`${(t/1024).toFixed(2)} ${d("KB")}`},p=t=>"success"===t.status?[e(D,{type:"primary",size:"small",onClick:()=>l(t),children:d("Insert")},"insert")]:"error"===t.status?[e(AM,{type:"danger",style:{fontSize:"12px"},children:t.error||d("Error")},"error")]:[];if(c)return e("div",{className:CM,children:e(D,{type:"primary",size:"small",onClick:s,className:_M,children:d("Upload progress",{completed:o,total:i})})});const g=n.filter(e=>"uploading"===e.status).length,m=n.filter(e=>"success"===e.status).length,v=n.filter(e=>"error"===e.status).length;return e("div",{className:iM+" fm-upload-progress",children:t("div",{className:oM,children:[t("div",{className:aM,children:[e(AM,{strong:!0,className:sM,children:g>0?d("Uploading files",{completed:o,total:i}):m>0?d("Uploaded files",{success:m,total:i}):d("Upload error files",{errorCount:v})}),e("div",{className:lM,children:e(D,{type:"text",size:"small",icon:e(ve,{className:uM}),onClick:a,className:cM})})]}),t("div",{className:`${dM} ${n.some(e=>"error"===e.status)?gM:""}`,children:[e("div",{className:hM,children:e(K,{className:SM,size:"small",dataSource:n,renderItem:r=>e(K.Item,{className:pM,actions:p(r),children:e(K.Item.Meta,{avatar:e(J,{size:"small",icon:h(r.status),className:mM}),title:t("div",{className:vM,children:[e(AM,{ellipsis:!0,className:yM,children:r.name}),e(AM,{type:"secondary",className:bM,children:void 0!==r.size?f(r.size):""})]}),description:"uploading"===r.status&&e(Z,{percent:r.progress,size:"small",status:"active",showInfo:!1,className:wM})})})})}),n.some(e=>"error"===e.status)&&e("div",{className:xM,children:e(AM,{type:"danger",style:{fontSize:"12px"},children:d("Some files failed to upload")})})]})]})})},{Header:EM}=Q,{Title:IM}=P,TM=({activeLibraryItem:t,selectedFolder:r,isTrashFolder:n})=>{const{t:i}=Hr(),o=t===Qt&&(null!=n?n:"Trash"===r),a={[Qt]:i("My files"),[er]:i("GIF"),[tr]:i("Stock images"),[rr]:i("AI image generation")};let s;return s=t===Qt?o?i("Deleted"):r:a[t],e(EM,{className:"actions-header",children:e("div",{className:"header-title-container",children:e(IM,{level:5,className:"header-title",children:s})})})};
|
|
62
62
|
/*! *****************************************************************************
|
|
63
63
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
64
64
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -73,5 +73,5 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
73
73
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
74
74
|
and limitations under the License.
|
|
75
75
|
***************************************************************************** */
|
|
76
|
-
var FM=function(e,t){return FM=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},FM(e,t)};var OM=function(){return OM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},OM.apply(this,arguments)};var PM="Pixel",MM="Percent",RM={unit:MM,value:.8};function LM(e){return"number"==typeof e?{unit:MM,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:PM,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:MM,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),RM):(console.warn("scrollThreshold should be string or number"),RM)}var jM=function(e){function t(t){var r=e.call(this,t)||this;return r.lastScrollTop=0,r.actionTriggered=!1,r.startY=0,r.currentY=0,r.dragging=!1,r.maxPullDownDistance=0,r.getScrollableTarget=function(){return r.props.scrollableTarget instanceof HTMLElement?r.props.scrollableTarget:"string"==typeof r.props.scrollableTarget?document.getElementById(r.props.scrollableTarget):(null===r.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},r.onStart=function(e){r.lastScrollTop||(r.dragging=!0,e instanceof MouseEvent?r.startY=e.pageY:e instanceof TouchEvent&&(r.startY=e.touches[0].pageY),r.currentY=r.startY,r._infScroll&&(r._infScroll.style.willChange="transform",r._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},r.onMove=function(e){r.dragging&&(e instanceof MouseEvent?r.currentY=e.pageY:e instanceof TouchEvent&&(r.currentY=e.touches[0].pageY),r.currentY<r.startY||(r.currentY-r.startY>=Number(r.props.pullDownToRefreshThreshold)&&r.setState({pullToRefreshThresholdBreached:!0}),r.currentY-r.startY>1.5*r.maxPullDownDistance||r._infScroll&&(r._infScroll.style.overflow="visible",r._infScroll.style.transform="translate3d(0px, "+(r.currentY-r.startY)+"px, 0px)")))},r.onEnd=function(){r.startY=0,r.currentY=0,r.dragging=!1,r.state.pullToRefreshThresholdBreached&&(r.props.refreshFunction&&r.props.refreshFunction(),r.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){r._infScroll&&(r._infScroll.style.overflow="auto",r._infScroll.style.transform="none",r._infScroll.style.willChange="unset")})},r.onScrollListener=function(e){"function"==typeof r.props.onScroll&&setTimeout(function(){return r.props.onScroll&&r.props.onScroll(e)},0);var t=r.props.height||r._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;r.actionTriggered||((r.props.inverse?r.isElementAtTop(t,r.props.scrollThreshold):r.isElementAtBottom(t,r.props.scrollThreshold))&&r.props.hasMore&&(r.actionTriggered=!0,r.setState({showLoader:!0}),r.props.next&&r.props.next()),r.lastScrollTop=t.scrollTop)},r.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},r.throttledOnScrollListener=function(e,t,r,n){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var l=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),r.apply(l,u)}o||(n&&!i&&d(),s(),void 0===n&&c>e?d():!0!==t&&(i=setTimeout(n?function(){i=void 0}:d,void 0===n?e-c:e)))}return"boolean"!=typeof t&&(n=r,r=t,t=void 0),l.cancel=function(){s(),o=!0},l}(150,r.onScrollListener).bind(r),r.onStart=r.onStart.bind(r),r.onMove=r.onMove.bind(r),r.onEnd=r.onEnd.bind(r),r}return function(e,t){function r(){this.constructor=e}FM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?OM(OM({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var r=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,n=LM(t);return n.unit===PM?e.scrollTop<=n.value+r-e.scrollHeight+1:e.scrollTop<=n.value/100+r-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var r=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,n=LM(t);return n.unit===PM?e.scrollTop+r>=e.scrollHeight-n.value:e.scrollTop+r>=n.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=OM({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),r=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),n=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return i.createElement("div",{style:n,className:"infinite-scroll-component__outerdiv"},i.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&i.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},i.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!r&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(_);function DM(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}function NM(){return NM=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},NM.apply(this,arguments)}function zM(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 BM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zM(Object(r),!0).forEach(function(t){UM(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zM(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function UM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VM={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};class HM extends i.Component{constructor(e){let t;super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:t}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const e=window&&window.innerWidth||1/0;let t=this.props.breakpointCols;"object"!=typeof t&&(t={default:parseInt(t)||2});let r=1/0,n=t.default||2;for(let i in t){const o=parseInt(i);o>0&&e<=o&&o<r&&(r=o,n=t[i])}n=Math.max(1,parseInt(n)||1),this.state.columnCount!==n&&this.setState({columnCount:n})}itemsInColumns(){const e=this.state.columnCount,t=new Array(e),r=i.Children.toArray(this.props.children);for(let n=0;n<r.length;n++){const i=n%e;t[i]||(t[i]=[]),t[i].push(r[n])}return t}renderColumns(){const{column:e,columnAttrs:t={},columnClassName:r}=this.props,n=this.itemsInColumns(),o=100/n.length+"%";let a=r;a&&"string"!=typeof a&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===a&&(a="my-masonry-grid_column"));const s=BM(BM(BM({},e),t),{},{style:BM(BM({},t.style),{},{width:o}),className:a});return n.map((e,t)=>i.createElement("div",NM({},s,{key:t}),e))}logDeprecated(e){console.error("[Masonry]",e)}render(){const e=this.props,{children:t,breakpointCols:r,columnClassName:n,columnAttrs:o,column:a,className:s}=e,l=DM(e,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let c=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(c="my-masonry-grid")),i.createElement("div",NM({},l,{className:c}),this.renderColumns())}}HM.defaultProps=VM;var WM={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const $M={default:4,1600:3,1100:2,700:1},qM=({setImageGifList:n,imageGifList:i=[],currentReqGif:s,setCurrentReqGif:l,inputRef:c,customRequest:u})=>{const{t:d}=Hr(),{GifPlayIcon:h}=ia(),{options:f}=bi(),{config:p}=f,[g,m]=o(null),[v,y]=o(!1),[b,w]=o(25),[x,C]=o(null),_=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null==p?void 0:p.REACT_APP_GIPHY_KEY}&q=${r}&limit=25&offset=${t}&lang=en`,n=await fetch(e);return{data:await n.json()}}catch(e){console.warn(e)}},S=async()=>{var e,t;const r=await _({query:s,page:0});(null===(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.data)||void 0===t?void 0:t.length)&&r.data.data.length>0&&n(r.data.data)};return a(()=>()=>{x&&clearTimeout(x)},[x]),e("div",{className:WM.gifTab,children:e("div",{className:WM.searchOutputWrapper,children:t("div",{id:"scrollableDiv",className:WM.scrollableDiv,children:[t(T,{onValuesChange:e=>{if(void 0!==e.keywords){l(t=>Object.assign(Object.assign({},t),{keywords:e.keywords})),x&&clearTimeout(x);const t=setTimeout(S,800);C(t)}},className:i.length>0?WM.searchResults:WM.search,children:[e(T.Item,{name:"keywords",className:WM.gifSearchInput,children:e(F,{onKeyDown:e=>"Space"===e.code&&S(),onPressEnter:e=>S(),allowClear:!0,placeholder:d("Search GIFs"),ref:c,spellCheck:"false",prefix:e(ci,{size:16,strokeWidth:null==p?void 0:p.iconStrokeWidth,onClick:S})})}),i.length>0&&!v&&e("div",{className:`ant-divider ${WM.divider}`,role:"separator"})]}),!i.length&&!v&&e(r,{children:s.keywords?e(ca,{}):t("div",{className:WM.resultsContainer,children:[e("div",{className:WM.videoIcon,children:e(h,{className:WM.playButton})}),e("h1",{className:WM.title,children:d("Over 350,000 live images")}),e("p",{className:WM.subtitle,children:d("Enter a search query and we'll find the perfect image for you")})]})}),!i.length&&v&&e(ka,{}),i.length>0&&e(jM,{dataLength:i&&i.length,next:async()=>{v||(y(!0),_({query:s,page:b}).then(e=>{e&&e.data&&e.data.data&&n(t=>[...t,...e.data.data]),y(!1),w(e=>e+25)}).catch(()=>{y(!1)}))},hasMore:!!i,endMessage:t(X,{plain:!0,children:[d("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(ka,{}),children:e(HM,{breakpointCols:$M,className:WM.myMasonryGrid,columnClassName:WM.myMasonryGridColumn,children:i.map((r,n)=>t("div",{className:WM.listItem,onClick:()=>((e,t)=>{m(t),setTimeout(()=>{m(null)},2e3),u(e)})(r.images.downsized.url,r.id),children:[e("img",{className:g===r.id?WM.loadedImage:"",width:"100%",src:`${r.images.downsized.url}`,alt:r.title,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(WM.loaded)}}),e("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),g===r.id&&e(A,{className:WM.antSpin})]},r.id+n))})})]})})})};var GM={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",scrollableDiv:"scrollableDiv",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",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 YM={default:4,1600:3,1100:2,700:1},XM=({imageStockList:n,setImageStockList:i,currentReq:s,setCurrentReq:l,inputRef:c,customRequest:d})=>{var h;const{t:f}=Hr(),{StockBigIcon:p,MixedViewIcon:g,LandscapeViewIcon:m,PortraitViewIcon:v,SquareViewIcon:y}=ia(),{options:b}=bi(),{config:w}=b,[x,C]=o(!1),[_,S]=o(2),[k,E]=o(null),[I,O]=o(null),[P,M]=o(!0),[R]=T.useForm(),j=u(s),D=(e,t,r)=>{try{const n=new URL(e),i=n.pathname.split("/").filter(Boolean),o=i.pop()||"",a=i.join("/"),s=`https://${n.host}${a?"/"+a:""}`,l=`https://px0.useblocks.io/${o}`,c=n.search?n.search.slice(1):"",u=c?`${c}&w=${t}&q=${r}`:`w=${t}&q=${r}`;return`${l}?${`${u}&proxy_url=${s}`}`}catch(t){return e}};a(()=>{j.current=s},[s]),a(()=>{0===n.length&&R.setFieldsValue({color:"",orientation:""})},[n,R]);const N=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{let n=`https://px0.useblocks.io/photos?client_id=${null==w?void 0:w.UNSPLASH_KEY}&lang=ru&per_page=18&query=${r}&page=${t}&proxy_url=https://api.unsplash.com/search`;""!==e.color&&(n+=`&color=${e.color}`),""!==e.orientation&&(n+=`&orientation=${e.orientation}`);const i=await fetch(n);return{data:await i.json()}}catch(e){console.warn(e)}finally{C(!1)}},z=async()=>{var e,t,r;C(!0);const n=await N({query:j.current,page:1});(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.results)&&(i(n.data.results),M(18===n.data.results.length),(null===(r=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.results)||void 0===r?void 0:r.length)&&n.data.results.length>0&&S(2))};a(()=>()=>{I&&clearTimeout(I)},[I]);const B=(e,t,r)=>{!async function(e){try{const t=await fetch(`${e}&client_id=${null==w?void 0:w.UNSPLASH_KEY}`);return{data:await t.json()}}catch(e){console.warn(e)}}(t.download_location),E(r),setTimeout(()=>E(null),2e3);const n=D(e.raw,1200,96);d(n)};return e("div",{className:GM.stockTab,children:e("div",{className:GM.searchOutputWrapper,children:t("div",{className:GM.scrollableDiv,id:"scrollableDiv",children:[t(T,{form:R,initialValues:hr,onValuesChange:(e,t)=>{if(l(Object.assign(Object.assign({},hr),t)),I&&clearTimeout(I),""!==t.keywords){const e=setTimeout(z,800);O(e)}else n.length||(l(Object.assign({},hr)),R.resetFields())},className:n.length>0?GM.searchResults:GM.search,children:[t(H,{gutter:24,children:[e(W,{span:n.length>0?void 0:24,children:e(T.Item,{name:"keywords",className:GM.stockSearchInput,children:e(F,{allowClear:!0,placeholder:f("Search image"),ref:c,spellCheck:"false",prefix:e(ci,{size:16,strokeWidth:null==w?void 0:w.iconStrokeWidth})})})}),!!n.length&&t(r,{children:[e(W,{children:e(T.Item,{name:"orientation",children:t(ee.Group,{onChange:e=>l(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[e(L,{title:f("All"),placement:"top",children:e(ee.Button,{value:"",children:e(g,{})})}),e(L,{title:f("Landscape"),placement:"top",children:e(ee.Button,{value:"landscape",children:e(m,{})})}),e(L,{title:f("Portrait"),placement:"top",children:e(ee.Button,{value:"portrait",children:e(v,{})})}),e(L,{title:f("Squarish"),placement:"top",children:e(ee.Button,{value:"squarish",children:e(y,{})})})]})})}),e(W,{children:e(T.Item,{name:"color",children:t(ee.Group,{className:GM.stockColorFilter,onChange:e=>l(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[e(L,{title:f("All"),placement:"top",children:e(ee.Button,{className:GM.allColors,value:"",children:"All"})}),e(L,{title:f("Black"),placement:"top",children:e(ee.Button,{className:GM.blackColor,value:"black",children:"B"})}),e(L,{title:f("Black and White"),placement:"top",children:e(ee.Button,{className:GM.bwColor,value:"black_and_white",children:"B&W"})}),e(L,{title:f("White"),placement:"top",children:e(ee.Button,{className:GM.whiteColor,value:"white",children:"W"})}),e(L,{title:f("Orange"),placement:"top",children:e(ee.Button,{className:GM.orangeColor,value:"orange",children:"O"})}),e(L,{title:f("Red"),placement:"top",children:e(ee.Button,{className:GM.redColor,value:"red",children:"R"})}),e(L,{title:f("Purple"),placement:"top",children:e(ee.Button,{className:GM.purpleColor,value:"purple",children:"P"})}),e(L,{title:f("Magenta"),placement:"top",children:e(ee.Button,{className:GM.magentaColor,value:"magenta",children:"M"})}),e(L,{title:f("Green"),placement:"top",children:e(ee.Button,{className:GM.greenColor,value:"green",children:"G"})}),e(L,{title:f("Teal"),placement:"top",children:e(ee.Button,{className:GM.tealColor,value:"teal",children:"T"})}),e(L,{title:f("Blue"),placement:"top",children:e(ee.Button,{className:GM.blueColor,value:"blue",children:"B"})})]})})})]})]}),n.length>0&&!x&&e("div",{className:`ant-divider ${GM.divider}`,role:"separator"})]}),!n.length&&!x&&e(r,{children:s.keywords?e(ca,{}):t("div",{className:GM.resultsContainer,children:[e("div",{className:GM.videoIcon,children:e(p,{className:GM.playButton})}),e("h1",{className:GM.title,children:f("Millions of free stock images")}),e("p",{className:GM.subtitle,children:f("Enter a search query and we'll find the perfect image for you")})]})}),!n.length&&x&&e(ka,{}),n.length>0&&e(jM,{dataLength:n&&n.length,next:async()=>{if(x||""===j.current.keywords)return C(!1),void(""===j.current.keywords&&M(!1));C(!0),N({query:j.current,page:_}).then(e=>{e&&e.data&&e.data.results&&(i(t=>[...t,...e.data.results]),M(18===e.data.results.length)),S(e=>e+1)}).catch(e=>{console.warn("catch",e)}).finally(()=>{C(!1)})},hasMore:P&&""!==(null===(h=j.current)||void 0===h?void 0:h.keywords),endMessage:t(X,{plain:!0,children:[f("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(ka,{}),children:e(HM,{breakpointCols:YM,className:GM.myMasonryGrid,columnClassName:GM.myMasonryGridColumn,children:n.map((r,n)=>t("div",{className:GM.listItem,onClick:()=>B(r.urls,r.links,r.id),children:[e("img",{className:k===r.id?GM.loadedImage:"",width:"100%",src:D(r.urls.raw,644,96),alt:r.description,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(GM.loaded)}}),t("p",{className:GM.creatorInfo,onClick:e=>e.stopPropagation(),children:[f("Photo by")," ",e("a",{target:"_blank",href:`${r.user.links.html}?utm_source=${null==w?void 0:w.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:r.user.name})," ",f("on")," ",e("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==w?void 0:w.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),k===r.id&&e(A,{className:GM.antSpin})]},r.id+n))})})]})})})},KM=()=>{const{options:e}=bi(),t=e.config;return c((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){console.error("Ошибка при вызове GTM:",e)}};t?setTimeout(r,t):r()})(e,r)},[null==t?void 0:t.pushToGTM])};var ZM="slideshowContainer",JM="slideshowImage";const QM=({images:t,transitionDuration:r=1e3,frameHeight:n})=>{const[i,s]=o([]),[l,c]=o(n);a(()=>{const e=()=>{if("undefined"==typeof window)return void c(n);const e=window.innerHeight,t=Math.max(e-260,130);if("number"==typeof n){const e=Math.min(n,t);c(e)}else c(t)};if(e(),"undefined"!=typeof window)return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n]);const u=()=>{s(e=>e.map((t,r)=>r===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return a(()=>{if(t.length>0){const e=t[t.length-1];s(t=>[...t,{src:e,opacity:0}]),setTimeout(u,1e3)}else s([])},[t]),e("div",{className:ZM,style:{height:l,minHeight:130},children:i.map((t,n)=>e("img",{src:`data:image/jpeg;base64, ${t.src}`,alt:`Slide ${n+1}`,className:JM,style:{opacity:t.opacity,transition:`opacity ${r}ms linear`,display:"block"}},n))})};"function"==typeof SuppressedError&&SuppressedError;const eR=t=>{var{className:r,style:n,color:i,text:o,bordered:a}=t,s=function(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}(t,["className","style","color","text","bordered"]);const l=o||"";return e(te,Object.assign({style:n,color:i,bordered:a,className:r},s,{children:l}))},tR=({text:r,counter:n,limits:i,wrapperStyles:o})=>{const{t:a}=Hr(),{options:s}=bi(),l=s.config,{token:c}=k.useToken(),u=+i>0,d=!u||n<+i,h=(null==l?void 0:l.billingPageUrl)||"/billing",f=n+" "+a("of")+" "+(u?i:"∞")+" "+(r||a("tests",{count:i}))+" "+a("was used",{count:n});return t("div",{className:"limits-couter-wrapper",style:o,children:[e(eR,{bordered:!1,text:f,className:"limit-counter",style:{color:d?c.colorText:"white"},color:d?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&e("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(h),children:a("Need more?")})]})};var rR={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 nR=f(({className:t,onClick:r})=>e("div",{className:`${rR.arrow} ${rR.arrowNext} ${t||""}`,onClick:r,children:e(D,{className:`${rR.arrowBtn} ${rR.arrowBtnNext}`,size:"large",icon:e(Ce,{})})}));nR.displayName="SampleNextArrow";const iR=f(({className:t,onClick:r})=>e("div",{className:`${rR.arrow} ${rR.arrowPrev} ${t||""}`,onClick:r,children:e(D,{className:`${rR.arrowBtn} ${rR.arrowBtnPrev}`,size:"large",icon:e(_e,{})})}));iR.displayName="SamplePrevArrow";const oR=({customRequest:r,inputAiRef:n,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,setAiImageRequest:f,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v})=>{const{t:y}=Hr(),{AiIcon_2:b}=ia(),w=i.useRef(null),[x,C]=o("auto"),{aiImageCounter:_,currentAiImgLimits:S,loadingDuringGeneration:A,requestStatus:k,handleGenerate:E,convertBase64ToFile:I,isShiftPressed:O,setIsShiftPressed:P,limitsInPlugin:M}=function({setFrameHeight:e,customRequest:t,aiTabRef:r,isImageUploaded:n,setIsImageUploaded:i,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p}){const{t:g}=Hr(),{options:m}=bi(),v=m.config,y=Si(),b=KM(),{messages:w}=m.config,[x,C]=o([]),[_,S]=o(0),[A,k]=o(null),[E,I]=o(!1),[T,F]=o(g("Evaluating the task")),[O,P]=o(!1),M=u(new Set),R=u(new Set),L=u(new Set);a(()=>{C(w)},[w]),a(()=>{l.length||A||(C([]),M.current.clear(),R.current.clear(),L.current.clear(),N.current=-1)},[l,A]);const j=d(()=>v&&"function"==typeof(null==v?void 0:v.sendAIImageRequest)?null==v?void 0:v.sendAIImageRequest:()=>Promise.resolve({}),[v]),D=c(e=>{const t=`${A}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!L.current.has(t))if(L.current.add(t),"error"!==e.status&&"Canceled"!==e.status){if(e.images){if(F(String(e.status)),100===e.progress){p(!1),h(e.images);const t=A,r=Array.isArray(e.images)?e.images:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),k(null),P(!1)}}else if(e.data&&(h([String(e.data)]),100===e.progress)){p(!1);const t=A,r=e.data?[String(e.data)]:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),k(null),P(!1)}}else p(!1),P(!1),A&&!R.current.has(A)&&(R.current.add(A),y.error({id:"AI_RESPONSE_INVALID",message:g("Something went wrong, please try again"),placement:"bottomRight",description:String(A)||void 0,data:{requestId:A,request:s,response:e},innerException:e}))},[s,h,F,g,p,A,y,P]),N=u(-1);a(()=>{if(x.length>0){const e=x.length-1;e>N.current&&(N.current=e,D(x[e]))}},[D,x]);const z=d(()=>{if(v&&"function"==typeof(null==v?void 0:v.sseQuery)){const e=null==v?void 0:v.sseQuery;return t=>e(t)}return e=>{}},[v]),B=d(()=>v&&"object"==typeof(null==v?void 0:v.handleLimitUsageEmitter)?null==v?void 0:v.handleLimitUsageEmitter:{fire:()=>{}},[v]),U=null==v?void 0:v.elementId,{projectId:V}=v,{limits:H}=(null==v?void 0:v.limits)?v:{limits:{ai_img_limit:0}},{ai_img_limit:W}=H,$=W>0&&_>=W,q=!(!(null==v?void 0:v.limits)||!v.counters)&&lr,G=c(()=>{B.fire({name:"AiImgCount",count:_+1})},[B,_]),Y=d(()=>!$&&!q,[$,q,_,W]),X=c(async()=>{F(g("Evaluating the task")),""===s||f||(p(!0),P(!0),h([]),C([]),b({event:"submit_form",action:"ai_image_generation",entity_id:U,project_id:V}),j({body:{project_id:V,request:"create-image",connection:"midjourney",message:s}}).then(e=>{var t,r,n,i,o;const{data:a,error:l}=e||{};if(l)throw l;const c=a;if(401===(null==c?void 0:c.status)||401===(null===(t=null==c?void 0:c.data)||void 0===t?void 0:t.status))throw new Error("ERROR");const u=(null==c?void 0:c.task)||(null===(r=null==c?void 0:c.data)||void 0===r?void 0:r.task),d=null!==(i=null!==(n=null==u?void 0:u.id)&&void 0!==n?n:A)&&void 0!==i?i:void 0;200===(null==c?void 0:c.status)||200===(null===(o=null==c?void 0:c.data)||void 0===o?void 0:o.status)?((null==u?void 0:u.id)&&(F(u.message),k(u.id)),(null==c?void 0:c.message)&&y.success({id:"AI_IMAGE_GENERATION_STARTED",message:c.message,placement:"bottomRight",data:{request:s,taskId:d,response:null==c?void 0:c.data}}),z({task_id:null==u?void 0:u.id,entity_id:U})):(p(!1),P(!1),d&&!R.current.has(d)&&(R.current.add(d),y.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==c?void 0:c.message)||g("Something went wrong, please try again"),placement:"bottomRight",description:s,data:{request:s,taskId:d,response:c},innerException:c})))}).catch(e=>{p(!1),P(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&A&&!R.current.has(A)&&(R.current.add(A),null==y||y.error({id:"AI_IMAGE_GENERATION_FAILED",message:g("Something went wrong, please try again"),placement:"bottomRight",description:s,innerException:e,data:{request:s,taskId:A,response:null==t?void 0:t.data,error:Ei(null==t?void 0:t.error)}})),t}))},[s,f,p,P,h,b,U,V,j,y,z,g,A]),K=c(()=>{Y&&X()},[Y,q,S,G,X,y,g]);a(()=>{},[v,q]);const Z=c(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 e=0;e<s.length;e++)l[e]=s.charCodeAt(e);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){console.error("FM AI: customRequest error",e)}finally{i(!1)}})()},[n,i,t]);return a(()=>{(f||l.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,l.length,f,e]),{aiImageCounter:_,setAiImageCounter:S,currentAiImgLimits:W,isFieldsDisabled:$,canGenerateImage:Y,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p,loadingDuringGeneration:O,setLoadingDuringGeneration:P,requestStatus:T,setRequestStatus:F,handleGenerate:K,handleLimitAiImgCount:G,convertBase64ToFile:Z,isShiftPressed:E,setIsShiftPressed:I,currentReqId:A,setCurrentReqId:k,limitsInPlugin:q}}({setFrameHeight:C,customRequest:r,aiTabRef:w,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v});a(()=>{},[s]);const[R,L]=o(!1),j=c(()=>L(!0),[]),N=c(()=>L(!1),[]),z=c(e=>f(e.target.value),[f]),B=c(e=>{"Shift"===e.key?P(!0):"Enter"!==e.key||O||(e.preventDefault(),E())},[O,E,P]),U=c(e=>{"Shift"===e.key&&P(!1)},[P]);return t("div",{className:rR.imageAi,ref:w,children:[M&&e(tR,{text:"images",counter:_,limits:S,wrapperStyles:{marginTop:-25}}),e(H,{gutter:24,className:rR.row,children:t(W,{span:24,children:[e(T.Item,{children:t("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${rR.inputAffixWrapper}${R?" ant-input-affix-wrapper-focused":""}`,children:[e(F.TextArea,{ref:n,onKeyDown:B,onKeyUp:U,onFocus:j,onBlur:N,autoSize:!0,allowClear:!0,className:`${rR.textAreaInputHybrid} ${rR.textarea}`,placeholder:y("Generate image"),value:h,onChange:z,spellCheck:"false"}),e("span",{className:`ant-input-suffix ${rR.inputSuffix}`,children:m||A?e(oe,{className:`${rR.inputIcon} input-icon`,spin:!0}):e(b,{className:`${rR.inputIcon} input-icon`,onClick:E})})]})}),t("div",{className:rR.imageAiExample,children:[e("span",{children:y("For example:")})," ",y("A beautiful image of a sunset over a calm ocean.")]})]})}),(m||p.length>0)&&t(re,{dotPosition:"top",arrows:!0,nextArrow:e(nR,{}),prevArrow:e(iR,{}),className:rR.carousel,infinite:!1,children:[m&&!p.length&&e("div",{className:rR.loading,children:t("div",{className:"spin",children:[e(oe,{style:{fontSize:48},spin:!0}),e("p",{className:"status",children:k})]})}),p.length>0&&p.map((r,n)=>t("div",{className:rR.imageItem,children:[e(QM,{images:p,frameHeight:x}),e("div",{className:"buttons",children:p.length>0&&!m&&e(D,{onClick:()=>I(`data:image/jpeg;base64, ${r}`),loading:s,icon:e(Se,{}),children:y("Use this variant")})})]},n))]})]})},aR=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)},{Sider:sR,Content:lR}=Q,cR={keywords:""},uR=()=>{var s;const l=Ii(),d=xo(),h=vo(),f=(()=>{const{state:e,actions:t}=bi(),{pagination:r}=e,{setPagination:n}=t,i=c((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}}})(),p=(()=>{const[e,t]=n.useState(()=>{const e=localStorage.getItem(Co);return e?Math.max(290,parseInt(e,10)):298}),[r,i]=n.useState(!1),[o,a]=n.useState(!1),[s,l]=n.useState(0),c=n.useCallback(()=>{t(298),localStorage.setItem(Co,298..toString())},[]),u=n.useCallback(r=>{r.preventDefault(),r.stopPropagation(),i(!0),document.body.classList.add("resizing");const n=r.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const r=Math.max(Math.min(o+e.clientX-n,600),290);s=r,t(r),l(e.clientX),a(!0)},u=()=>{i(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(Co,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return n.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:r,showResizeGuide:o,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),g=(()=>{const[e,t]=o([]),[r,n]=o(!1),[i,a]=o(!1),s=u(0),l=u(new Map),d=c(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),h=c(e=>`${(e.size/1024).toFixed(2)} КБ`,[]),f=c((e,r)=>{const i=r.map(t=>({id:d(),folderId:e,name:t.name,size:h(t),status:"uploading",progress:0}));return t(i),n(!0),a(!1),i.map(e=>e.id)},[d,h]),p=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,r))}):t))},[]),g=c((e,r)=>{r&&l.current.set(e,r),t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"success",progress:100}):t))},[]),m=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:r}):t))},[]),v=c(()=>{n(!1),a(!1),setTimeout(()=>{t([]),l.current.clear()},300)},[]),y=c(()=>{a(e=>!e)},[]),b=c(e=>l.current.get(e),[]),w=e.length,x=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:r,isUploadMinimized:i,totalFiles:w,completedFiles:x,startUpload:f,updateProgress:p,markAsSuccess:g,markAsError:m,getUploadedFile:b,closeUpload:v,minimizeUpload:y}})(),m=uo(),{t:v}=Hr(),{options:y}=i.useContext(yi),b=null==y?void 0:y.config,{DropZoneFileIcon:w}=ia(),[x,C]=o(!1),_=u(0),S=i.useRef(null),[k,E]=o(!1),{folders:I,loading:T}=l.state,{fetchFolders:F,fetchChildFolders:O,handleCreateFolder:P,handleModalOk:M,handleModalCancel:R,generateMenuItems:L}=l.actions,j=(e=>{var t;const{state:r,actions:n,options:i}=bi(),{t:o}=Hr(),a=Si(),{folders:s,folderToRename:l,renameFolderForm:u,isRenameFolderModalVisible:d}=r,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=n,{apiEndpoints:p,dataProviders:g,config:m}=i,v=c(e=>{null==h||h(e),null==f||f(!0);const t=null==s?void 0:s.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,s,u]),y=c(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=c(async()=>{var t,r;if(l&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void a.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:o("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:l,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 a.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:o("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error(o("renameFolder is not implemented in dataProviders"));const s=await g.renameFolder(l,i.newFolderName.trim());if(!(null==s?void 0:s.id))return void a.error({id:"FOLDER_RENAME_FAILED",message:o("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:i.newFolderName,error:{message:"invalidResponse"}}});a.success({id:"FOLDER_RENAME_SUCCESS",message:o("Folder renamed"),placement:"bottomRight",data:{itemId:s.id,itemName:s.name,folderId:null!==(r=s.parentId)&&void 0!==r?r:null}}),y(),await e(),l!==s.id&&n.setSelectedFolder&&n.setSelectedFolder(s.id)}catch(e){console.error("Ошибка при переименовании папки:",e),a.error({id:"FOLDER_RENAME_FAILED",message:o("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=l?l:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),error:{message:e instanceof Error?e.message:String(e)}}})}},[l,u,p,y,e,o,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,a]);return{state:{isRenamingFolder:d||!1,folderToRename:l},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(F),{files:N,selectedFiles:z,loading:B,isRenamingFile:U,fileToRename:V}=d.state,{fetchFiles:H,handleDeleteFile:W,handleDeleteFolder:$,handleAddFile:q,handleAddFileByUrl:G,uploadFileWithProvider:Y,toggleFileSelection:K,showRenameModal:Z,handleRenameCancel:J,handleRenameOk:ee,handleDroppedFiles:te,showMoveModal:re,handleMoveCancel:ne,handleMoveOk:ie,handleCopyOk:oe,handleCopyCancel:ae,showDeleteConfirm:se,handleDeleteConfirmCancel:le,handleDeleteConfirmOk:ce}=d.actions,{selectedFolder:ue,pathHistory:de}=h.state,{handleFolderSelect:he,handleBreadcrumbClick:fe,handleItemClick:pe}=h.actions,{pagination:ge}=f.state,me=_i(H),{searchTerm:ve,sortBy:ye,sortOrder:be}=me.state,{handleSearch:we,handleSort:xe,handlePaginationChange:Ce}=me.actions,_e=(({files:e,selectedFiles:t,fetchFiles:r,selectedFolder:i})=>{const{t:o}=Hr(),a=Si(),{options:s,actions:l,state:c}=n.useContext(yi),{setActiveLibraryItem:u}=l,{activeLibraryItem:d}=c,h=uo(),[f,p]=n.useState(!1),[g,m]=n.useState(null),v=n.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return ur.includes(t)}const r=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!r&&ur.includes(r)},[]),y=n.useCallback(async e=>{var t,r,n,i;const{dataProviders:o}=s;if(!1!==(null===(r=null===(t=s.config)||void 0===t?void 0:t.features)||void 0===r?void 0:r.enableUpdateFile)&&(null==o?void 0:o.updateFile)&&e.thumbnail)try{const t=xr(e.thumbnail,e.type),r=Cr(t),n=e.name.substring(0,e.name.lastIndexOf("."))+"."+r,i=kr(e.thumbnail,t);return await o.updateFile(e.id,{name:n,type:t,data:i})}catch(e){return console.error("Error updating the file through updateFile:",e),null}else if(e.thumbnail)try{const t=xr(e.thumbnail,e.type),r=kr(e.thumbnail,t),n=new File([r],e.name,{type:t,lastModified:Date.now()});return await h.uploadFileWithProvider(n,e.folderId||void 0)||null}catch(e){return console.error("Error saving the file:",e),null}else if(!1!==(null===(i=null===(n=s.config)||void 0===n?void 0:n.features)||void 0===i?void 0:i.enableRenameFile)&&(null==o?void 0:o.renameFile))try{return await o.renameFile(e.id,e.name)}catch(e){return console.error("Error renaming the file:",e),null}return console.warn("DataProvider for updating files is not configured"),null},[s,h]),b=n.useCallback(r=>{let n;if(r)n=r;else{if(1!==t.size)return;const r=Array.from(t)[0];if(n=e.find(e=>e.id===r),!n||n.isFolder||!v(n))return}u&&u(nr),m(n),p(!0)},[t,e,v,p,u]),w=n.useCallback(()=>{u&&d===nr&&u(Qt),p(!1),m(null)},[d,u]),x=n.useCallback(async e=>{var t,n,l,c;try{const l=await y(e);if(l)return a.success({id:"IMAGE_UPDATE_SUCCESS",message:o("Success"),description:o("Image updated successfully"),placement:"bottomRight",data:{itemId:null!==(t=l.id)&&void 0!==t?t:void 0,itemName:l.name,folderId:null!==(n=l.folderId)&&void 0!==n?n:null,thumbnail:l.thumbnail}}),s.onEditorOk&&s.onEditorOk(l),await r({folderId:i||""}),w(),l}catch(t){console.error("Error saving the file:",t),a.error({id:"IMAGE_SAVE_FAILED",message:o("Error"),description:o("Failed to save changes",{error:t}),innerException:t,placement:"bottomRight",data:{itemId:null!==(l=e.id)&&void 0!==l?l:void 0,itemName:e.name,folderId:null!==(c=e.folderId)&&void 0!==c?c:null,thumbnail:e.thumbnail}})}},[y,s,r,i,a,w]);return{isPixieEditorVisible:f,editingFile:g,handleEdit:b,handlePixieEditorSave:x,handlePixieEditorClose:w}})({files:N||[],selectedFiles:z||new Set,fetchFiles:H,selectedFolder:ue||null}),[Se,Ae]=o(!1),ke=c(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)||(_.current+=1,_.current>0&&C(!0))},[]),Ee=c(e=>{e.preventDefault(),e.stopPropagation();const t=e.relatedTarget,r=e.currentTarget;if(t&&!r.contains(t))_.current=Math.max(0,_.current-1),_.current<=0&&C(!1);else if(t){const e=t.closest('[class*="dragOverlay"]');if(e&&r.contains(e))return}},[]),Ie=c(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},[]),Te=c(e=>{if(e.preventDefault(),e.stopPropagation(),C(!1),_.current=0,e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);Ae(!0),te(t).catch(e=>{console.error("Ошибка при загрузке файлов:",e)}).finally(()=>{Ae(!1)})}},[te]),Fe=c(()=>{C(!1),_.current=0},[]);a(()=>{const e=e=>{if(x&&e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length>0){e.preventDefault(),e.stopPropagation();const t=e.target,r=t.closest(`.${ha.filesContainer.replace(/\s+/g,".")}`)||t.closest("[data-files-container]");if(r||x){const n=Object.assign(Object.assign({},e),{preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),dataTransfer:e.dataTransfer,currentTarget:r||t,target:t});Te(n)}}},t=e=>{e.dataTransfer&&e.dataTransfer.types&&e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy")};return document.addEventListener("drop",e,!0),document.addEventListener("dragover",t,!0),()=>{document.removeEventListener("drop",e,!0),document.removeEventListener("dragover",t,!0)}},[x,Te]),a(()=>{const e=e=>{x&&Fe()};return document.addEventListener("dragend",e,!0),()=>{document.removeEventListener("dragend",e,!0)}},[x,Fe]),a(()=>{let e=null;const t=t=>{x&&(e=setTimeout(()=>{x&&Fe()},200))};return document.addEventListener("mouseup",t,!0),()=>{document.removeEventListener("mouseup",t,!0),e&&clearTimeout(e)}},[x,Fe]),a(()=>{const e=e=>{x&&Fe()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[x,Fe]),a(()=>{const e=e=>{x&&setTimeout(()=>{x&&Fe()},100)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[x,Fe]);const Oe=i.useCallback(async()=>{var e;await ce(),await F(),await(null===(e=S.current)||void 0===e?void 0:e.refreshFileCounts())},[F,ce]),Pe=i.useCallback(async e=>{var t;await ie(e),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[ie]),Me=i.useCallback(async e=>{var t;await oe(e),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[oe]),Re=i.useCallback(async()=>{let e=[],t=new Map;await q({onStartBatch:r=>{e=g.startUpload(ue||void 0,r),t=new Map(r.map((t,r)=>[t.name,e[r]]))},onStart:r=>{0===e.length&&(e=g.startUpload(ue||void 0,[r]),t.set(r.name,e[0]))},onProgress:(e,r)=>{const n=t.get(e);n&&g.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==N?void 0:N.find(t=>t.name===e&&!t.isFolder);g.markAsSuccess(n,t)}await(null===(r=S.current)||void 0===r?void 0:r.refreshFileCounts())},onError:(e,r)=>{const n=t.get(e);n&&g.markAsError(n,r)},onBatchComplete:async e=>{var r,n,i,o,a;for(const a of e.successes){const s=t.get(a);if(s){const t=null===(r=e.uploadedFiles)||void 0===r?void 0:r.get(a);let l;(null==t?void 0:t.id)?l={id:t.id,name:null!==(n=t.name)&&void 0!==n?n:a,folderId:null!==(o=null!==(i=t.folderId)&&void 0!==i?i:ue)&&void 0!==o?o:null,isFolder:!1}:(await new Promise(e=>setTimeout(e,100)),l=null==N?void 0:N.find(e=>e.name===a&&!e.isFolder)),g.updateProgress(s,100),g.markAsSuccess(s,l)}}e.errors.forEach(({fileName:e,error:r})=>{const n=t.get(e);n&&g.markAsError(n,r)}),await(null===(a=S.current)||void 0===a?void 0:a.refreshFileCounts())}})},[q,g,N,ue]),Le=i.useCallback(async(e,t)=>{var r;try{E(!0);const n=await G(e,t);await(null===(r=S.current)||void 0===r?void 0:r.refreshFileCounts()),n&&(null==y?void 0:y.onEditorOk)&&y.onEditorOk(n)}finally{E(!1)}},[G,y]),je=i.useCallback(async({file:e})=>{var t;const r=await Y(e),n=r&&r.folderId||ue||null;return he&&he(n&&"folders"!==n?n:"folders"),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts()),r&&(null==y?void 0:y.onEditorOk)&&y.onEditorOk(r),r},[Y,he,ue,y]),De=i.useCallback(async e=>{var t;await W(e),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[W]),Ne=i.useCallback(async e=>{var t;if(te){const r=g.startUpload(ue||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),g.updateProgress(n,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await te(e),r.forEach(e=>{g.updateProgress(e,100),g.markAsSuccess(e)}),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())}},[te,g,ue]),ze=i.useCallback(async e=>{var t;await $(e),await F(),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[$,F]),Be=(({files:e,selectedFiles:t,toggleFileSelection:r,showRenameModal:i,showMoveModal:o,showCopyModal:a,handleDeleteFile:s,handleDeleteFolder:l,showDeleteConfirm:c,onEdit:u})=>{const d=n.useCallback(()=>{t&&t.size>0&&t.forEach(e=>{r(e)})},[t,r]),h=n.useCallback(e=>{if(t&&1===t.size||e){const r=e||Array.from(t)[0];i(r)}},[t,i]),f=n.useCallback(r=>{if(t&&t.size>0||(null==r?void 0:r.id)){if(c)return void c();(r?[r.id]:t).forEach(t=>{const r=e.find(e=>e.id===t);r?r.isFolder?l(t):s(t):console.warn(`Объект с ID ${t} не найден в списке файлов`)})}},[t,e,s,l,c]);return{handleClearSelection:d,handleRename:h,handleDeleteSelected:f,handleCopy:n.useCallback(()=>{a()},[a]),handleMove:n.useCallback(()=>{o()},[o]),handleEdit:n.useCallback(()=>{u()},[u])}})({files:N||[],selectedFiles:z||new Set,toggleFileSelection:K,showRenameModal:Z,showMoveModal:re,showCopyModal:d.actions.showCopyModal||(()=>{}),handleDeleteFile:W,handleDeleteFolder:ze,showDeleteConfirm:se,onEdit:_e.handleEdit}),Ue=T||B||Se;a(()=>{br()},[]),i.useEffect(()=>{if(!he||0===I.length)return;const e=!1!==(null==b?void 0:b.rememberLastFolder),t=`em_fm:lastFolder:${(null==b?void 0:b.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t),r=e&&I.some(t=>t.id===e);if(r)return void he(e)}catch(e){}ue||he("folders")},[ue,he,I,null==b?void 0:b.rememberLastFolder,null==b?void 0:b.projectId]);const{state:Ve,actions:He,options:We}=i.useContext(yi),{form:$e,urlForm:qe,renameForm:Ge,moveForm:Ye,renameFolderForm:Xe,copyForm:Ke,isModalVisible:Ze,isUrlModalVisible:Je,isMoveModalVisible:Qe,isRenameFolderModalVisible:et,isCopyModalVisible:tt,isDeleteConfirmVisible:rt,folderToRename:nt,activeLibraryItem:it}=Ve,{setIsUrlModalVisible:ot,setSortField:at,setActiveLibraryItem:st}=He,{config:lt}=We,{handleRenameFolderCancel:ct,handleRenameFolderOk:ut}=j.actions,dt=c(e=>{Ce(e.current||ge.current,e.pageSize||ge.pageSize)},[Ce,ge]),ht=i.useCallback(e=>{const{sortBy:t,sortOrder:r}=(e=>{const[t,r]=e.split("-");return{sortBy:t,sortOrder:r}})(e);xe(t,r)},[xe]),[ft,pt]=o(cR),[gt,mt]=o([]),vt=u(null),[yt,bt]=o(hr),[wt,xt]=o([]),Ct=u(null),[_t,St]=o(""),[At,kt]=o([]),Et=i.useRef(void 0),[It,Tt]=o(!1),[Ft,Ot]=o(!1),Pt=i.useRef(null),Mt=c(async()=>{const e=null==lt?void 0:lt.fileForEdit;if(Et.current!==e){Et.current=e;try{if(!(it===nr&&e&&!_e.editingFile))return;if("string"==typeof e){if(e.startsWith("data:"))return void(null==_e||_e.handleEdit({thumbnail:e}));const t=await m.handleAddFileByUrl(e,!0);if(!t)throw new Error(v("Failed to download file"));Et.current===e&&(null==_e||_e.handleEdit(t))}}finally{Et.current===e&&(Et.current=null)}}},[null==lt?void 0:lt.fileForEdit,it,_e,m,v]);a(()=>{Mt()},[Mt]),a(()=>{var e,t,r;it===Qt?(mt([]),pt(cR),xt([]),bt(hr),kt([]),St(""),Ot(!1),Tt(!1)):it===rr?null===(e=Pt.current)||void 0===e||e.focus():it===er?null===(t=vt.current)||void 0===t||t.focus():it===tr&&(null===(r=Ct.current)||void 0===r||r.focus())},[it]);const Rt=i.useCallback(async()=>{var e;await ut(),await(null===(e=S.current)||void 0===e?void 0:e.refreshFileCounts())},[ut]),Lt=z.size,jt=i.useMemo(()=>{var e,t,r;if(1!==Lt)return!1;const[n]=Array.from(z),i=N.find(e=>e.id===n);if(!i||i.isFolder)return!1;const o="string"==typeof i.name?i.name:"",a=o?null===(e=o.split(".").pop())||void 0===e?void 0:e.toLowerCase():void 0,s=null!==(r=null===(t=i.extension)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:a;return"string"==typeof i.type&&i.type.startsWith("image/")||"string"==typeof s&&ur.includes(s)},[Lt,z,N]);return e(Q,{className:"file-manager__layout",children:t("div",{className:ha.filesContainer,"data-files-container":"true",onDragOver:Ie,onDragLeave:Ee,onDragEnter:ke,onDrop:Te,children:[x&&e("div",{className:ha.dragOverlay,children:t("div",{className:ha.dragOverlayInner,children:[e("div",{className:ha.uploadIcon,children:e(w,{})}),e("div",{className:ha.textTitle,children:v("Drop files here to upload")}),e("div",{className:ha.textDescription,children:v("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),p.showResizeGuide&&e("div",{className:"resize-guide",style:{left:`${p.resizeGuidePosition}px`}}),t(Q,{className:"file-manager__content",children:[t(sR,{width:320,theme:"light",className:"file-manager-sider",children:[e(Oa,{ref:S,selectedFolder:ue||"folders",generateMenuItems:L,onFolderSelect:e=>null==he?void 0:he(e),folders:I||[],fetchFolders:F,fetchChildFolders:O,handleAddFile:Re,setIsUrlModalVisible:e=>null==ot?void 0:ot(e),handleDeleteFolder:ze,handleCreateFolder:P,activeLibraryItem:it,setActiveLibraryItem:e=>null==st?void 0:st(e)}),e("div",{className:"sidebar-resizer "+(p.isResizing?"resizing":""),onMouseDown:p.handleResizeStart,onDoubleClick:p.handleDoubleClick,children:e("div",{className:"sidebar-resizer-indicator"})})]}),t(Q,{className:"file-manager__main-content",children:[Se&&e(ka,{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,zIndex:100,background:"var(--colorBgLayout)"}}),t(lR,{className:"main-content",children:[e(TM,{activeLibraryItem:it,selectedFolder:(null===(s=null==I?void 0:I.find(e=>(null==e?void 0:e.id)===ue))||void 0===s?void 0:s.name)||v("Folders"),isTrashFolder:"Trash"===ue}),e(X,{className:"zero-divider"}),it===Qt&&e(ga,{searchTerm:ve,sortField:Ve.sortField||"name",setSortField:e=>null==at?void 0:at(e),pathHistory:de||[],handleBreadcrumbClick:e=>null==fe?void 0:fe(e),handleAddFile:Re,setIsUrlModalVisible:e=>null==ot?void 0:ot(e),files:N||[],handleSearch:we,handleSort:xe,sortBy:ye,sortOrder:be,handleSortOptionChange:ht,pagination:ge,setPagination:dt,loading:Ue,handleItemClick:e=>null==pe?void 0:pe(e),handleDeleteFile:De,selectedFiles:z||new Set,toggleFileSelection:e=>null==K?void 0:K(e),handleDroppedFiles:Ne,fileUpload:g,onClearSelection:Be.handleClearSelection,onRename:Be.handleRename,onCopy:Be.handleCopy,onMove:Be.handleMove,onDelete:Be.handleDeleteSelected,onEdit:_e.handleEdit}),it===er&&e(qM,{imageGifList:gt,setImageGifList:mt,currentReqGif:ft,setCurrentReqGif:pt,inputRef:vt,customRequest:Le}),it===tr&&e(XM,{imageStockList:wt,setImageStockList:xt,currentReq:yt,setCurrentReq:bt,inputRef:Ct,customRequest:Le}),it===rr&&!!(null==lt?void 0:lt.sseQuery)&&e(oR,{imageAiList:At,setImageAiList:kt,aiImageRequest:_t,setAiImageRequest:St,inputAiRef:Pt,customRequest:je,isLoadingAi:It,setIsLoadingAi:Tt,isImageUploaded:Ft,setIsImageUploaded:Ot}),it===nr&&e(r,{}),e("div",{children:jt&&t(r,{children:[e(X,{className:"zero-divider"}),e("div",{style:{display:"flex",justifyContent:"right",padding:"17px 24px",alignItems:"center"},children:e(D,{size:"large",type:"primary",style:{height:40},onClick:()=>{if(We.onEditorOk){const e=Array.from(z)[0],t=N.find(t=>t.id===e);t&&We.onEditorOk(t)}},children:v("Choose")})})]})})]})]})]}),k&&e("div",{style:{position:"fixed",inset:0,zIndex:1500,backgroundColor:"rgba(255, 255, 255, 0.5)",pointerEvents:"all",display:"flex",alignItems:"center",justifyContent:"center"},children:e(A,{size:"large"})}),e(Ta,{isModalVisible:Ze,handleModalOk:M,handleModalCancel:R,form:$e,selectedFolder:ue||null,folders:I||[],isUrlModalVisible:Je,setIsUrlModalVisible:e=>null==ot?void 0:ot(e),handleAddFileByUrl:Le,urlForm:qe,isRenameModalVisible:U,handleRenameOk:()=>null==ee?void 0:ee(),handleRenameCancel:()=>null==J?void 0:J(),renameForm:Ge,fileToRename:V,files:N||[],isMoveModalVisible:Qe,handleMoveOk:Pe,handleMoveCancel:ne,moveForm:Ye,selectedFiles:z||new Set,isRenameFolderModalVisible:et,handleRenameFolderOk:Rt,handleRenameFolderCancel:ct,renameFolderForm:Xe,folderToRename:nt,isCopyModalVisible:tt,handleCopyOk:Me,handleCopyCancel:ae,copyForm:Ke,isDeleteConfirmVisible:rt,handleDeleteConfirmOk:Oe,handleDeleteConfirmCancel:()=>null==le?void 0:le(),fetchChildFolders:O}),e(nM,{visible:_e.isPixieEditorVisible,onClose:_e.handlePixieEditorClose,file:_e.editingFile,onSave:_e.handlePixieEditorSave}),e(kM,{files:g.uploadFiles,visible:g.isUploadVisible,minimized:g.isUploadMinimized,totalFiles:g.totalFiles,completedFiles:g.completedFiles,onClose:g.closeUpload,onMinimize:g.minimizeUpload,onInsert:e=>{var t;const r=g.getUploadedFile(e.id)||e;null===(t=We.onEditorOk)||void 0===t||t.call(We,r)}})]})})},dR=f(({config:n={},onPathChange:o,onChangeSelection:s,onEditorOk:l,searchQuery:c="",sortBySize:d="name",apiEndpoints:h={},customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y})=>{const b=i.useMemo(()=>Object.assign({folderTreeLoading:"lazy",expandAllFoldersOnInit:!1,expandRootFolderOnInit:!1,iconStrokeWidth:1.4,availableImageExtensions:["jpg","jpeg","png","gif"]},n),[n]);i.useEffect(()=>{b.theme&&(e=>{if("system"===e){const t=matchMedia(sr).matches?or:ir;e=e===ar?t:e}document.documentElement.setAttribute("data-theme",e)})(b.theme),aR(b)},[b]),a(()=>{b.locale&&b.locale!==Ln.language&&Ln.changeLanguage(b.locale),b.customLocale&&b.locale&&Ln.addResourceBundle(b.locale,"translation",b.customLocale,!0,!0)},[b.locale,b.customLocale]);const w=u(null);return e(I,{className:"em-filemanager",children:t(r,{children:[e(E,{getPopupContainer:()=>w.current||document.body,children:e(wi,{options:{apiEndpoints:h,searchQuery:c,sortBySize:d,onPathChange:o,onChangeSelection:s,onEditorOk:l,config:b,customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y},children:e(uR,{})})}),e("div",{ref:w,className:"file-manager-modal-root"})]})})});dR.displayName="FileManagerApp";const hR=t=>{var r,n,i;return e(Wr,{i18n:Ln,children:e(gr,{externalTheme:null!==(n=null===(r=t.config)||void 0===r?void 0:r.theme)&&void 0!==n?n:"light",customThemeToken:null===(i=t.config)||void 0===i?void 0:i.customTheme,children:e(ne,{children:e(dR,Object.assign({},t))})})})},fR=new Map,pR=(t,r)=>{var n;let i;br();let o={};const a=e=>{const t=!e||"fileManager"!==e.mode&&"imageCenter"!==e.mode&&"plugin"!==e.mode?void 0:e.mode;return"imageCenter"===t?vr("imageCenter",e):vr(t)};if(t instanceof HTMLElement){i=t;o={config:a(r),apiEndpoints:null==r?void 0:r.apiEndpoints}}else{i=t.element;const e=a(t.config),r=Object.assign(Object.assign({},null===(n=t.config)||void 0===n?void 0:n.apiEndpoints),t.apiEndpoints);o={config:e,currentPath:t.currentPath,onPathChange:t.onPathChange,onChangeSelection:t.onChangeSelection,searchQuery:t.searchQuery,sortBySize:t.sortBySize,apiEndpoints:r,dataProviders:t.dataProviders,customIcons:t.customIcons,dragDropIcon:t.dragDropIcon,handleNotify:t.handleNotify,handleError:t.handleError,handleSuccess:t.handleSuccess}}const s=S(i);s.render(e(hR,Object.assign({},o))),fR.set(i.id||`container_${Date.now()}`,s)},gR=e=>{const t=e.id||Object.keys(fR).find(e=>e.startsWith("container_"));if(t&&fR.has(t)){const e=fR.get(t);null==e||e.unmount(),fR.delete(t)}else{console.warn("Couldn t find the root to unmount");try{S(e).unmount()}catch(e){console.error("Error unmounting the component:",e)}}},mR=new Map,vR=n=>{const{onClose:o,onSave:s,dataProviders:l,theme:c,locale:d}=n,h=i.useMemo(()=>{if(n.file)return n.file;const e=n.name||"edited-image",t=n.extension||(n.type?n.type.split("/")[1]:"png"),r=n.type||`image/${t}`;return{thumbnail:n.imageDataUrl||"",name:e,id:void 0,type:r,extension:t}},[n.file,n.imageDataUrl,n.name,n.extension,n.type]),f=i.useCallback(async e=>{if((null==l?void 0:l.updateFile)&&e.thumbnail)try{const t=xr(e.thumbnail,e.type),r=Cr(t),n=e.name.substring(0,e.name.lastIndexOf("."))+"."+r,i=kr(e.thumbnail,t);return await l.updateFile(e.id,{name:n,type:t,data:i})}catch(e){return console.error("Error updating the file through updateFile:",e),null}return console.warn("DataProvider for updating files is not configured"),null},[l]),p=i.useCallback(async e=>{if((null==l?void 0:l.updateFile)&&e.id&&e.thumbnail)try{const t=await f(e);t&&(e=t)}catch(e){console.error("Standalone Pixie: saveFileToServer error",e)}return s&&await s(e),o&&o(),e},[l,s,o,f]),g=u(null);return a(()=>{d&&d!==Ln.language&&Ln.changeLanguage(d)},[d]),e(I,{className:"em-filemanager",children:t(r,{children:[e(E,{getPopupContainer:()=>g.current||document.body,children:e(Wr,{i18n:Ln,children:e(gr,{externalTheme:null!=c?c:"light",children:e(ne,{children:e(wi,{options:{dataProviders:l,handleNotify:n.handleNotify,handleError:n.handleError,handleSuccess:n.handleSuccess,config:{theme:null!=c?c:"light",locale:d,baseUrl:n.baseUrl,assetsUrl:n.assetsUrl,showNotifications:n.showNotifications}},children:e(nM,{visible:!0,onClose:o,file:h,onSave:p})})})})})}),e("div",{ref:g,className:"file-manager-modal-root"})]})})},yR=t=>{br();const r=t.element,n=S(r);n.render(e(vR,Object.assign({},t))),mR.set(r.id||`pixie_container_${Date.now()}`,n)},bR=e=>{const t=Array.from(mR.keys()).find(e=>e.startsWith("pixie_container_")),r=e.id||t;if(r&&mR.has(r)){const e=mR.get(r);null==e||e.unmount(),mR.delete(r)}else{console.warn("Couldn t find the root to unmount Pixie");try{S(e).unmount()}catch(e){console.error("Error unmounting Pixie:",e)}}},wR=e=>{var t,r;const{mode:n,element:i,fileManager:o,pixieEditor:a,theme:s,dataProviders:l}=e;let c,u;const d={unmount:()=>{c&&gR(c),u&&bR(u)},unmountFileManager:void 0,unmountPixieEditor:void 0};switch(n){case"fileManager":c=i,pR(i,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),d.unmountFileManager=()=>gR(c);break;case"pixieEditor":u=i,yR(Object.assign({element:i,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountPixieEditor=()=>bR(u);break;case"both":{const e=document.createElement("div");e.id="file-manager-container",e.style.cssText="height: 50%; border-bottom: 1px solid #d9d9d9;";const t=document.createElement("div");t.id="pixie-editor-container",t.style.cssText="height: 50%;",i.appendChild(e),i.appendChild(t),c=e,u=t,pR(c,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(r=null==o?void 0:o.config)||void 0===r?void 0:r.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),yR(Object.assign({element:u,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountFileManager=()=>gR(c),d.unmountPixieEditor=()=>bR(u);break}}return d};class xR 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,xR)}}function CR(e,t="BackendError"){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 413:return"PayloadTooLarge";case 415:return"UnsupportedMediaType";case 429:return"RateLimitExceeded";case 500:return"BackendError";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return t}}var _R={init:pR,unmount:gR,initPixieEditor:yR,unmountPixieEditor:bR,initFileManager:wR};export{ga as FileContent,xR as FileManagerApiError,dR as FileManagerApp,hR as FileManagerAppWithContext,Ta as FileModals,Oa as FolderSidebar,vR as PixieOnlyApp,_R as default,pR as init,wR as initFileManager,yR as initPixieEditor,br as installResizeObserverErrorHandler,CR as mapHttpStatusToErrorCode,wr as uninstallResizeObserverErrorHandler,gR as unmount,bR as unmountPixieEditor};
|
|
76
|
+
var FM=function(e,t){return FM=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},FM(e,t)};var OM=function(){return OM=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},OM.apply(this,arguments)};var PM="Pixel",MM="Percent",RM={unit:MM,value:.8};function LM(e){return"number"==typeof e?{unit:MM,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:PM,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:MM,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),RM):(console.warn("scrollThreshold should be string or number"),RM)}var jM=function(e){function t(t){var r=e.call(this,t)||this;return r.lastScrollTop=0,r.actionTriggered=!1,r.startY=0,r.currentY=0,r.dragging=!1,r.maxPullDownDistance=0,r.getScrollableTarget=function(){return r.props.scrollableTarget instanceof HTMLElement?r.props.scrollableTarget:"string"==typeof r.props.scrollableTarget?document.getElementById(r.props.scrollableTarget):(null===r.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},r.onStart=function(e){r.lastScrollTop||(r.dragging=!0,e instanceof MouseEvent?r.startY=e.pageY:e instanceof TouchEvent&&(r.startY=e.touches[0].pageY),r.currentY=r.startY,r._infScroll&&(r._infScroll.style.willChange="transform",r._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},r.onMove=function(e){r.dragging&&(e instanceof MouseEvent?r.currentY=e.pageY:e instanceof TouchEvent&&(r.currentY=e.touches[0].pageY),r.currentY<r.startY||(r.currentY-r.startY>=Number(r.props.pullDownToRefreshThreshold)&&r.setState({pullToRefreshThresholdBreached:!0}),r.currentY-r.startY>1.5*r.maxPullDownDistance||r._infScroll&&(r._infScroll.style.overflow="visible",r._infScroll.style.transform="translate3d(0px, "+(r.currentY-r.startY)+"px, 0px)")))},r.onEnd=function(){r.startY=0,r.currentY=0,r.dragging=!1,r.state.pullToRefreshThresholdBreached&&(r.props.refreshFunction&&r.props.refreshFunction(),r.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){r._infScroll&&(r._infScroll.style.overflow="auto",r._infScroll.style.transform="none",r._infScroll.style.willChange="unset")})},r.onScrollListener=function(e){"function"==typeof r.props.onScroll&&setTimeout(function(){return r.props.onScroll&&r.props.onScroll(e)},0);var t=r.props.height||r._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;r.actionTriggered||((r.props.inverse?r.isElementAtTop(t,r.props.scrollThreshold):r.isElementAtBottom(t,r.props.scrollThreshold))&&r.props.hasMore&&(r.actionTriggered=!0,r.setState({showLoader:!0}),r.props.next&&r.props.next()),r.lastScrollTop=t.scrollTop)},r.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},r.throttledOnScrollListener=function(e,t,r,n){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var l=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),r.apply(l,u)}o||(n&&!i&&d(),s(),void 0===n&&c>e?d():!0!==t&&(i=setTimeout(n?function(){i=void 0}:d,void 0===n?e-c:e)))}return"boolean"!=typeof t&&(n=r,r=t,t=void 0),l.cancel=function(){s(),o=!0},l}(150,r.onScrollListener).bind(r),r.onStart=r.onStart.bind(r),r.onMove=r.onMove.bind(r),r.onEnd=r.onEnd.bind(r),r}return function(e,t){function r(){this.constructor=e}FM(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?OM(OM({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var r=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,n=LM(t);return n.unit===PM?e.scrollTop<=n.value+r-e.scrollHeight+1:e.scrollTop<=n.value/100+r-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var r=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,n=LM(t);return n.unit===PM?e.scrollTop+r>=e.scrollHeight-n.value:e.scrollTop+r>=n.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=OM({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),r=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),n=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return i.createElement("div",{style:n,className:"infinite-scroll-component__outerdiv"},i.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&i.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},i.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!r&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(_);function DM(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}function NM(){return NM=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},NM.apply(this,arguments)}function zM(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 BM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zM(Object(r),!0).forEach(function(t){UM(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zM(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function UM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VM={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};class HM extends i.Component{constructor(e){let t;super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:t}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const e=window&&window.innerWidth||1/0;let t=this.props.breakpointCols;"object"!=typeof t&&(t={default:parseInt(t)||2});let r=1/0,n=t.default||2;for(let i in t){const o=parseInt(i);o>0&&e<=o&&o<r&&(r=o,n=t[i])}n=Math.max(1,parseInt(n)||1),this.state.columnCount!==n&&this.setState({columnCount:n})}itemsInColumns(){const e=this.state.columnCount,t=new Array(e),r=i.Children.toArray(this.props.children);for(let n=0;n<r.length;n++){const i=n%e;t[i]||(t[i]=[]),t[i].push(r[n])}return t}renderColumns(){const{column:e,columnAttrs:t={},columnClassName:r}=this.props,n=this.itemsInColumns(),o=100/n.length+"%";let a=r;a&&"string"!=typeof a&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===a&&(a="my-masonry-grid_column"));const s=BM(BM(BM({},e),t),{},{style:BM(BM({},t.style),{},{width:o}),className:a});return n.map((e,t)=>i.createElement("div",NM({},s,{key:t}),e))}logDeprecated(e){console.error("[Masonry]",e)}render(){const e=this.props,{children:t,breakpointCols:r,columnClassName:n,columnAttrs:o,column:a,className:s}=e,l=DM(e,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let c=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(c="my-masonry-grid")),i.createElement("div",NM({},l,{className:c}),this.renderColumns())}}HM.defaultProps=VM;var WM={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle"};const $M={default:4,1600:3,1100:2,700:1},qM=({setImageGifList:n,imageGifList:i=[],currentReqGif:s,setCurrentReqGif:l,inputRef:c,customRequest:u})=>{const{t:d}=Hr(),{GifPlayIcon:h}=ia(),{options:f}=bi(),{config:p}=f,[g,m]=o(null),[v,y]=o(!1),[b,w]=o(25),[x,C]=o(null),_=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null==p?void 0:p.REACT_APP_GIPHY_KEY}&q=${r}&limit=25&offset=${t}&lang=en`,n=await fetch(e);return{data:await n.json()}}catch(e){console.warn(e)}},S=async()=>{var e,t;const r=await _({query:s,page:0});(null===(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.data)||void 0===t?void 0:t.length)&&r.data.data.length>0&&n(r.data.data)};return a(()=>()=>{x&&clearTimeout(x)},[x]),e("div",{className:WM.gifTab,children:e("div",{className:WM.searchOutputWrapper,children:t("div",{id:"scrollableDiv",className:WM.scrollableDiv,children:[t(T,{onValuesChange:e=>{if(void 0!==e.keywords){l(t=>Object.assign(Object.assign({},t),{keywords:e.keywords})),x&&clearTimeout(x);const t=setTimeout(S,800);C(t)}},className:i.length>0?WM.searchResults:WM.search,children:[e(T.Item,{name:"keywords",className:WM.gifSearchInput,children:e(F,{onKeyDown:e=>"Space"===e.code&&S(),onPressEnter:e=>S(),allowClear:!0,placeholder:d("Search GIFs"),ref:c,spellCheck:"false",prefix:e(ci,{size:16,strokeWidth:null==p?void 0:p.iconStrokeWidth,onClick:S})})}),i.length>0&&!v&&e("div",{className:`ant-divider ${WM.divider}`,role:"separator"})]}),!i.length&&!v&&e(r,{children:s.keywords?e(ca,{}):t("div",{className:WM.resultsContainer,children:[e("div",{className:WM.videoIcon,children:e(h,{className:WM.playButton})}),e("h1",{className:WM.title,children:d("Over 350,000 live images")}),e("p",{className:WM.subtitle,children:d("Enter a search query and we'll find the perfect image for you")})]})}),!i.length&&v&&e(ka,{}),i.length>0&&e(jM,{dataLength:i&&i.length,next:async()=>{v||(y(!0),_({query:s,page:b}).then(e=>{e&&e.data&&e.data.data&&n(t=>[...t,...e.data.data]),y(!1),w(e=>e+25)}).catch(()=>{y(!1)}))},hasMore:!!i,endMessage:t(X,{plain:!0,children:[d("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(ka,{}),children:e(HM,{breakpointCols:$M,className:WM.myMasonryGrid,columnClassName:WM.myMasonryGridColumn,children:i.map((r,n)=>t("div",{className:WM.listItem,onClick:()=>((e,t)=>{var r;m(t),setTimeout(()=>{m(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"),u(e,i)})(r.images.downsized.url,r.id,r.title),children:[e("img",{className:g===r.id?WM.loadedImage:"",width:"100%",src:`${r.images.downsized.url}`,alt:r.title,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(WM.loaded)}}),e("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),g===r.id&&e(A,{className:WM.antSpin})]},r.id+n))})})]})})})};var GM={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",scrollableDiv:"scrollableDiv",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",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 YM={default:4,1600:3,1100:2,700:1},XM=({imageStockList:n,setImageStockList:i,currentReq:s,setCurrentReq:l,inputRef:c,customRequest:d})=>{var h;const{t:f}=Hr(),{StockBigIcon:p,MixedViewIcon:g,LandscapeViewIcon:m,PortraitViewIcon:v,SquareViewIcon:y}=ia(),{options:b}=bi(),{config:w}=b,[x,C]=o(!1),[_,S]=o(2),[k,E]=o(null),[I,O]=o(null),[P,M]=o(!0),[R]=T.useForm(),j=(null==w?void 0:w.UNSLASH_PROXY_URL)||"https://px0.useblocks.io",D=u(s),N=(e,t,r)=>{try{const n=new URL(e),i=n.pathname.split("/").filter(Boolean),o=i.pop()||"",a=i.join("/"),s=`https://${n.host}${a?"/"+a:""}`,l=`${j}/${o}`,c=n.search?n.search.slice(1):"",u=c?`${c}&w=${t}&q=${r}`:`w=${t}&q=${r}`;return`${l}?${`${u}&proxy_url=${s}`}`}catch(t){return e}};a(()=>{D.current=s},[s]),a(()=>{0===n.length&&R.setFieldsValue({color:"",orientation:""})},[n,R]);const z=async function({query:e,page:t}){const r=e.keywords.replace(/[^\w\sа-яёА-ЯЁ]|_/g,"").replace(/[\s_-]+/g," ");try{let n=`${j}/photos?client_id=${null==w?void 0:w.UNSPLASH_KEY}&lang=ru&per_page=18&query=${r}&page=${t}&proxy_url=https://api.unsplash.com/search`;""!==e.color&&(n+=`&color=${e.color}`),""!==e.orientation&&(n+=`&orientation=${e.orientation}`);const i=await fetch(n);return{data:await i.json()}}catch(e){console.warn(e)}finally{C(!1)}},B=async()=>{var e,t,r;C(!0);const n=await z({query:D.current,page:1});(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.results)&&(i(n.data.results),M(18===n.data.results.length),(null===(r=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.results)||void 0===r?void 0:r.length)&&n.data.results.length>0&&S(2))};a(()=>()=>{I&&clearTimeout(I)},[I]);const U=(e,t,r,n)=>{var i;!async function(e){try{const t=await fetch(`${e}&client_id=${null==w?void 0:w.UNSPLASH_KEY}`);return{data:await t.json()}}catch(e){console.warn(e)}}(t.download_location),E(r),setTimeout(()=>E(null),2e3);const o=N(e.raw,1200,96);let a=o.split("?")[0].split("#")[0].split("/"),s=a[a.length-1]||"uploaded-file";s.includes(".")&&(null===(i=s.split(".").pop())||void 0===i?void 0:i.length)&&s.split(".").pop().length<=5||(s+=".jpg"),d(o,s)};return e("div",{className:GM.stockTab,children:e("div",{className:GM.searchOutputWrapper,children:t("div",{className:GM.scrollableDiv,id:"scrollableDiv",children:[t(T,{form:R,initialValues:hr,onValuesChange:(e,t)=>{if(l(Object.assign(Object.assign({},hr),t)),I&&clearTimeout(I),""!==t.keywords){const e=setTimeout(B,800);O(e)}else n.length||(l(Object.assign({},hr)),R.resetFields())},className:n.length>0?GM.searchResults:GM.search,children:[t(H,{gutter:24,children:[e(W,{span:n.length>0?void 0:24,children:e(T.Item,{name:"keywords",className:GM.stockSearchInput,children:e(F,{allowClear:!0,placeholder:f("Search image"),ref:c,spellCheck:"false",prefix:e(ci,{size:16,strokeWidth:null==w?void 0:w.iconStrokeWidth})})})}),!!n.length&&t(r,{children:[e(W,{children:e(T.Item,{name:"orientation",children:t(ee.Group,{onChange:e=>l(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[e(L,{title:f("All"),placement:"top",children:e(ee.Button,{value:"",children:e(g,{})})}),e(L,{title:f("Landscape"),placement:"top",children:e(ee.Button,{value:"landscape",children:e(m,{})})}),e(L,{title:f("Portrait"),placement:"top",children:e(ee.Button,{value:"portrait",children:e(v,{})})}),e(L,{title:f("Squarish"),placement:"top",children:e(ee.Button,{value:"squarish",children:e(y,{})})})]})})}),e(W,{children:e(T.Item,{name:"color",children:t(ee.Group,{className:GM.stockColorFilter,onChange:e=>l(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[e(L,{title:f("All"),placement:"top",children:e(ee.Button,{className:GM.allColors,value:"",children:"All"})}),e(L,{title:f("Black"),placement:"top",children:e(ee.Button,{className:GM.blackColor,value:"black",children:"B"})}),e(L,{title:f("Black and White"),placement:"top",children:e(ee.Button,{className:GM.bwColor,value:"black_and_white",children:"B&W"})}),e(L,{title:f("White"),placement:"top",children:e(ee.Button,{className:GM.whiteColor,value:"white",children:"W"})}),e(L,{title:f("Orange"),placement:"top",children:e(ee.Button,{className:GM.orangeColor,value:"orange",children:"O"})}),e(L,{title:f("Red"),placement:"top",children:e(ee.Button,{className:GM.redColor,value:"red",children:"R"})}),e(L,{title:f("Purple"),placement:"top",children:e(ee.Button,{className:GM.purpleColor,value:"purple",children:"P"})}),e(L,{title:f("Magenta"),placement:"top",children:e(ee.Button,{className:GM.magentaColor,value:"magenta",children:"M"})}),e(L,{title:f("Green"),placement:"top",children:e(ee.Button,{className:GM.greenColor,value:"green",children:"G"})}),e(L,{title:f("Teal"),placement:"top",children:e(ee.Button,{className:GM.tealColor,value:"teal",children:"T"})}),e(L,{title:f("Blue"),placement:"top",children:e(ee.Button,{className:GM.blueColor,value:"blue",children:"B"})})]})})})]})]}),n.length>0&&!x&&e("div",{className:`ant-divider ${GM.divider}`,role:"separator"})]}),!n.length&&!x&&e(r,{children:s.keywords?e(ca,{}):t("div",{className:GM.resultsContainer,children:[e("div",{className:GM.videoIcon,children:e(p,{className:GM.playButton})}),e("h1",{className:GM.title,children:f("Millions of free stock images")}),e("p",{className:GM.subtitle,children:f("Enter a search query and we'll find the perfect image for you")})]})}),!n.length&&x&&e(ka,{}),n.length>0&&e(jM,{dataLength:n&&n.length,next:async()=>{if(x||""===D.current.keywords)return C(!1),void(""===D.current.keywords&&M(!1));C(!0),z({query:D.current,page:_}).then(e=>{e&&e.data&&e.data.results&&(i(t=>[...t,...e.data.results]),M(18===e.data.results.length)),S(e=>e+1)}).catch(e=>{console.warn("catch",e)}).finally(()=>{C(!1)})},hasMore:P&&""!==(null===(h=D.current)||void 0===h?void 0:h.keywords),endMessage:t(X,{plain:!0,children:[f("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:e(ka,{}),children:e(HM,{breakpointCols:YM,className:GM.myMasonryGrid,columnClassName:GM.myMasonryGridColumn,children:n.map((r,n)=>t("div",{className:GM.listItem,onClick:()=>U(r.urls,r.links,r.id,r.description),children:[e("img",{className:k===r.id?GM.loadedImage:"",width:"100%",src:N(r.urls.raw,644,96),alt:r.description,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(GM.loaded)}}),t("p",{className:GM.creatorInfo,onClick:e=>e.stopPropagation(),children:[f("Photo by")," ",e("a",{target:"_blank",href:`${r.user.links.html}?utm_source=${null==w?void 0:w.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:r.user.name})," ",f("on")," ",e("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==w?void 0:w.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),k===r.id&&e(A,{className:GM.antSpin})]},r.id+n))})})]})})})},KM=()=>{const{options:e}=bi(),t=e.config;return c((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){console.error("Ошибка при вызове GTM:",e)}};t?setTimeout(r,t):r()})(e,r)},[null==t?void 0:t.pushToGTM])};var ZM="slideshowContainer",JM="slideshowImage";const QM=({images:t,transitionDuration:r=1e3,frameHeight:n})=>{const[i,s]=o([]),[l,c]=o(n);a(()=>{const e=()=>{if("undefined"==typeof window)return void c(n);const e=window.innerHeight,t=Math.max(e-260,130);if("number"==typeof n){const e=Math.min(n,t);c(e)}else c(t)};if(e(),"undefined"!=typeof window)return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n]);const u=()=>{s(e=>e.map((t,r)=>r===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return a(()=>{if(t.length>0){const e=t[t.length-1];s(t=>[...t,{src:e,opacity:0}]),setTimeout(u,1e3)}else s([])},[t]),e("div",{className:ZM,style:{height:l,minHeight:130},children:i.map((t,n)=>e("img",{src:`data:image/jpeg;base64, ${t.src}`,alt:`Slide ${n+1}`,className:JM,style:{opacity:t.opacity,transition:`opacity ${r}ms linear`,display:"block"}},n))})};"function"==typeof SuppressedError&&SuppressedError;const eR=t=>{var{className:r,style:n,color:i,text:o,bordered:a}=t,s=function(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}(t,["className","style","color","text","bordered"]);const l=o||"";return e(te,Object.assign({style:n,color:i,bordered:a,className:r},s,{children:l}))},tR=({text:r,counter:n,limits:i,wrapperStyles:o})=>{const{t:a}=Hr(),{options:s}=bi(),l=s.config,{token:c}=k.useToken(),u=+i>0,d=!u||n<+i,h=(null==l?void 0:l.billingPageUrl)||"/billing",f=n+" "+a("of")+" "+(u?i:"∞")+" "+(r||a("tests",{count:i}))+" "+a("was used",{count:n});return t("div",{className:"limits-couter-wrapper",style:o,children:[e(eR,{bordered:!1,text:f,className:"limit-counter",style:{color:d?c.colorText:"white"},color:d?c.colorFillSecondary:"rgb(255, 77, 79)"}),u&&e("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(h),children:a("Need more?")})]})};var rR={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 nR=f(({className:t,onClick:r})=>e("div",{className:`${rR.arrow} ${rR.arrowNext} ${t||""}`,onClick:r,children:e(D,{className:`${rR.arrowBtn} ${rR.arrowBtnNext}`,size:"large",icon:e(Ce,{})})}));nR.displayName="SampleNextArrow";const iR=f(({className:t,onClick:r})=>e("div",{className:`${rR.arrow} ${rR.arrowPrev} ${t||""}`,onClick:r,children:e(D,{className:`${rR.arrowBtn} ${rR.arrowBtnPrev}`,size:"large",icon:e(_e,{})})}));iR.displayName="SamplePrevArrow";const oR=({customRequest:r,inputAiRef:n,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,setAiImageRequest:f,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v})=>{const{t:y}=Hr(),{AiIcon_2:b}=ia(),w=i.useRef(null),[x,C]=o("auto"),{aiImageCounter:_,currentAiImgLimits:S,loadingDuringGeneration:A,requestStatus:k,handleGenerate:E,convertBase64ToFile:I,isShiftPressed:O,setIsShiftPressed:P,limitsInPlugin:M}=function({setFrameHeight:e,customRequest:t,aiTabRef:r,isImageUploaded:n,setIsImageUploaded:i,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p}){const{t:g}=Hr(),{options:m}=bi(),v=m.config,y=Si(),b=KM(),{messages:w}=m.config,[x,C]=o([]),[_,S]=o(0),[A,k]=o(null),[E,I]=o(!1),[T,F]=o(g("Evaluating the task")),[O,P]=o(!1),M=u(new Set),R=u(new Set),L=u(new Set);a(()=>{C(w)},[w]),a(()=>{l.length||A||(C([]),M.current.clear(),R.current.clear(),L.current.clear(),N.current=-1)},[l,A]);const j=d(()=>v&&"function"==typeof(null==v?void 0:v.sendAIImageRequest)?null==v?void 0:v.sendAIImageRequest:()=>Promise.resolve({}),[v]),D=c(e=>{const t=`${A}-${e.progress}-${JSON.stringify(e.images||e.data)}`;if(!L.current.has(t))if(L.current.add(t),"error"!==e.status&&"Canceled"!==e.status){if(e.images){if(F(String(e.status)),100===e.progress){p(!1),h(e.images);const t=A,r=Array.isArray(e.images)?e.images:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),k(null),P(!1)}}else if(e.data&&(h([String(e.data)]),100===e.progress)){p(!1);const t=A,r=e.data?[String(e.data)]:[];r.length>0&&t&&!M.current.has(t)&&(M.current.add(t),y.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:g("Images generated successfully"),placement:"bottomRight",data:{request:s,taskId:t,images:r}})),k(null),P(!1)}}else p(!1),P(!1),A&&!R.current.has(A)&&(R.current.add(A),y.error({id:"AI_RESPONSE_INVALID",message:g("Something went wrong, please try again"),placement:"bottomRight",description:String(A)||void 0,data:{requestId:A,request:s,response:e},innerException:e}))},[s,h,F,g,p,A,y,P]),N=u(-1);a(()=>{if(x.length>0){const e=x.length-1;e>N.current&&(N.current=e,D(x[e]))}},[D,x]);const z=d(()=>{if(v&&"function"==typeof(null==v?void 0:v.sseQuery)){const e=null==v?void 0:v.sseQuery;return t=>e(t)}return e=>{}},[v]),B=d(()=>v&&"object"==typeof(null==v?void 0:v.handleLimitUsageEmitter)?null==v?void 0:v.handleLimitUsageEmitter:{fire:()=>{}},[v]),U=null==v?void 0:v.elementId,{projectId:V}=v,{limits:H}=(null==v?void 0:v.limits)?v:{limits:{ai_img_limit:0}},{ai_img_limit:W}=H,$=W>0&&_>=W,q=!(!(null==v?void 0:v.limits)||!v.counters)&&lr,G=c(()=>{B.fire({name:"AiImgCount",count:_+1})},[B,_]),Y=d(()=>!$&&!q,[$,q,_,W]),X=c(async()=>{F(g("Evaluating the task")),""===s||f||(p(!0),P(!0),h([]),C([]),b({event:"submit_form",action:"ai_image_generation",entity_id:U,project_id:V}),j({body:{project_id:V,request:"create-image",connection:"midjourney",message:s}}).then(e=>{var t,r,n,i,o;const{data:a,error:l}=e||{};if(l)throw l;const c=a;if(401===(null==c?void 0:c.status)||401===(null===(t=null==c?void 0:c.data)||void 0===t?void 0:t.status))throw new Error("ERROR");const u=(null==c?void 0:c.task)||(null===(r=null==c?void 0:c.data)||void 0===r?void 0:r.task),d=null!==(i=null!==(n=null==u?void 0:u.id)&&void 0!==n?n:A)&&void 0!==i?i:void 0;200===(null==c?void 0:c.status)||200===(null===(o=null==c?void 0:c.data)||void 0===o?void 0:o.status)?((null==u?void 0:u.id)&&(F(u.message),k(u.id)),(null==c?void 0:c.message)&&y.success({id:"AI_IMAGE_GENERATION_STARTED",message:c.message,placement:"bottomRight",data:{request:s,taskId:d,response:null==c?void 0:c.data}}),z({task_id:null==u?void 0:u.id,entity_id:U})):(p(!1),P(!1),d&&!R.current.has(d)&&(R.current.add(d),y.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==c?void 0:c.message)||g("Something went wrong, please try again"),placement:"bottomRight",description:s,data:{request:s,taskId:d,response:c},innerException:c})))}).catch(e=>{p(!1),P(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&A&&!R.current.has(A)&&(R.current.add(A),null==y||y.error({id:"AI_IMAGE_GENERATION_FAILED",message:g("Something went wrong, please try again"),placement:"bottomRight",description:s,innerException:e,data:{request:s,taskId:A,response:null==t?void 0:t.data,error:Ei(null==t?void 0:t.error)}})),t}))},[s,f,p,P,h,b,U,V,j,y,z,g,A]),K=c(()=>{Y&&X()},[Y,q,S,G,X,y,g]);a(()=>{},[v,q]);const Z=c(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 e=0;e<s.length;e++)l[e]=s.charCodeAt(e);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){console.error("FM AI: customRequest error",e)}finally{i(!1)}})()},[n,i,t]);return a(()=>{(f||l.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,l.length,f,e]),{aiImageCounter:_,setAiImageCounter:S,currentAiImgLimits:W,isFieldsDisabled:$,canGenerateImage:Y,aiImageRequest:s,imageAiList:l,setImageAiList:h,isLoadingAi:f,setIsLoadingAi:p,loadingDuringGeneration:O,setLoadingDuringGeneration:P,requestStatus:T,setRequestStatus:F,handleGenerate:K,handleLimitAiImgCount:G,convertBase64ToFile:Z,isShiftPressed:E,setIsShiftPressed:I,currentReqId:A,setCurrentReqId:k,limitsInPlugin:q}}({setFrameHeight:C,customRequest:r,aiTabRef:w,isImageUploaded:s,setIsImageUploaded:l,aiImageRequest:h,imageAiList:p,setImageAiList:g,isLoadingAi:m,setIsLoadingAi:v});a(()=>{},[s]);const[R,L]=o(!1),j=c(()=>L(!0),[]),N=c(()=>L(!1),[]),z=c(e=>f(e.target.value),[f]),B=c(e=>{"Shift"===e.key?P(!0):"Enter"!==e.key||O||(e.preventDefault(),E())},[O,E,P]),U=c(e=>{"Shift"===e.key&&P(!1)},[P]);return t("div",{className:rR.imageAi,ref:w,children:[M&&e(tR,{text:"images",counter:_,limits:S,wrapperStyles:{marginTop:-25}}),e(H,{gutter:24,className:rR.row,children:t(W,{span:24,children:[e(T.Item,{children:t("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${rR.inputAffixWrapper}${R?" ant-input-affix-wrapper-focused":""}`,children:[e(F.TextArea,{ref:n,onKeyDown:B,onKeyUp:U,onFocus:j,onBlur:N,autoSize:!0,allowClear:!0,className:`${rR.textAreaInputHybrid} ${rR.textarea}`,placeholder:y("Generate image"),value:h,onChange:z,spellCheck:"false"}),e("span",{className:`ant-input-suffix ${rR.inputSuffix}`,children:m||A?e(oe,{className:`${rR.inputIcon} input-icon`,spin:!0}):e(b,{className:`${rR.inputIcon} input-icon`,onClick:E})})]})}),t("div",{className:rR.imageAiExample,children:[e("span",{children:y("For example:")})," ",y("A beautiful image of a sunset over a calm ocean.")]})]})}),(m||p.length>0)&&t(re,{dotPosition:"top",arrows:!0,nextArrow:e(nR,{}),prevArrow:e(iR,{}),className:rR.carousel,infinite:!1,children:[m&&!p.length&&e("div",{className:rR.loading,children:t("div",{className:"spin",children:[e(oe,{style:{fontSize:48},spin:!0}),e("p",{className:"status",children:k})]})}),p.length>0&&p.map((r,n)=>t("div",{className:rR.imageItem,children:[e(QM,{images:p,frameHeight:x}),e("div",{className:"buttons",children:p.length>0&&!m&&e(D,{onClick:()=>I(`data:image/jpeg;base64, ${r}`),loading:s,icon:e(Se,{}),children:y("Use this variant")})})]},n))]})]})},aR=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)},{Sider:sR,Content:lR}=Q,cR={keywords:""},uR=()=>{var s;const l=Ii(),d=xo(),h=vo(),f=(()=>{const{state:e,actions:t}=bi(),{pagination:r}=e,{setPagination:n}=t,i=c((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}}})(),p=(()=>{const[e,t]=n.useState(()=>{const e=localStorage.getItem(Co);return e?Math.max(290,parseInt(e,10)):298}),[r,i]=n.useState(!1),[o,a]=n.useState(!1),[s,l]=n.useState(0),c=n.useCallback(()=>{t(298),localStorage.setItem(Co,298..toString())},[]),u=n.useCallback(r=>{r.preventDefault(),r.stopPropagation(),i(!0),document.body.classList.add("resizing");const n=r.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const r=Math.max(Math.min(o+e.clientX-n,600),290);s=r,t(r),l(e.clientX),a(!0)},u=()=>{i(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem(Co,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return n.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:r,showResizeGuide:o,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),g=(()=>{const[e,t]=o([]),[r,n]=o(!1),[i,a]=o(!1),s=u(0),l=u(new Map),d=c(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),h=c(e=>da(e.size),[]),f=c((e,r)=>{const i=r.map(t=>({id:d(),folderId:e,name:t.name,size:h(t),status:"uploading",progress:0}));return t(i),n(!0),a(!1),i.map(e=>e.id)},[d,h]),p=c((e,r)=>{const i={id:d(),folderId:e,name:r,size:void 0,status:"uploading",progress:0};return t(e=>[...e,i]),n(!0),a(!1),i.id},[d]),g=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,r))}):t))},[]),m=c((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.size)&&void 0===t.size&&(e.size=da(r.size)),e}return t}))},[]),v=c((e,r)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:r}):t))},[]),y=c(()=>{n(!1),a(!1),setTimeout(()=>{t([]),l.current.clear()},300)},[]),b=c(()=>{a(e=>!e)},[]),w=c(e=>l.current.get(e),[]),x=e.length,C=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:r,isUploadMinimized:i,totalFiles:x,completedFiles:C,startUpload:f,startUploadByUrl:p,updateProgress:g,markAsSuccess:m,markAsError:v,getUploadedFile:w,closeUpload:y,minimizeUpload:b}})(),m=uo(),{t:v}=Hr(),{options:y}=i.useContext(yi),b=null==y?void 0:y.config,{DropZoneFileIcon:w}=ia(),[x,C]=o(!1),_=u(0),S=i.useRef(null),[k,E]=o(!1),{folders:I,loading:T}=l.state,{fetchFolders:F,fetchChildFolders:O,handleCreateFolder:P,handleModalOk:M,handleModalCancel:R,generateMenuItems:L}=l.actions,j=(e=>{var t;const{state:r,actions:n,options:i}=bi(),{t:o}=Hr(),a=Si(),{folders:s,folderToRename:l,renameFolderForm:u,isRenameFolderModalVisible:d}=r,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=n,{apiEndpoints:p,dataProviders:g,config:m}=i,v=c(e=>{null==h||h(e),null==f||f(!0);const t=null==s?void 0:s.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,s,u]),y=c(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=c(async()=>{var t,r;if(l&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void a.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:o("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:l,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 a.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:o("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error(o("renameFolder is not implemented in dataProviders"));const s=await g.renameFolder(l,i.newFolderName.trim());if(!(null==s?void 0:s.id))return void a.error({id:"FOLDER_RENAME_FAILED",message:o("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=l?l:void 0,itemName:i.newFolderName,error:{message:"invalidResponse"}}});a.success({id:"FOLDER_RENAME_SUCCESS",message:o("Folder renamed"),placement:"bottomRight",data:{itemId:s.id,itemName:s.name,folderId:null!==(r=s.parentId)&&void 0!==r?r:null}}),y(),await e(),l!==s.id&&n.setSelectedFolder&&n.setSelectedFolder(s.id)}catch(e){console.error("Ошибка при переименовании папки:",e),a.error({id:"FOLDER_RENAME_FAILED",message:o("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=l?l:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),error:{message:e instanceof Error?e.message:String(e)}}})}},[l,u,p,y,e,o,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,a]);return{state:{isRenamingFolder:d||!1,folderToRename:l},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(F),{files:N,selectedFiles:z,loading:B,isRenamingFile:U,fileToRename:V}=d.state,{fetchFiles:H,handleDeleteFile:W,handleDeleteFolder:$,handleAddFile:q,handleAddFileByUrl:G,toggleFileSelection:Y,showRenameModal:K,handleRenameCancel:Z,handleRenameOk:J,handleDroppedFiles:ee,showMoveModal:te,handleMoveCancel:re,handleMoveOk:ne,handleCopyOk:ie,handleCopyCancel:oe,showDeleteConfirm:ae,handleDeleteConfirmCancel:se,handleDeleteConfirmOk:le}=d.actions,{selectedFolder:ce,pathHistory:ue}=h.state,{handleFolderSelect:de,handleBreadcrumbClick:he,handleItemClick:fe}=h.actions,{pagination:pe}=f.state,ge=_i(H),{searchTerm:me,sortBy:ve,sortOrder:ye}=ge.state,{handleSearch:be,handleSort:we,handlePaginationChange:xe}=ge.actions,Ce=(({files:e,selectedFiles:t,fetchFiles:r,selectedFolder:i})=>{const{t:o}=Hr(),a=Si(),{options:s,actions:l,state:c}=n.useContext(yi),{setActiveLibraryItem:u}=l,{activeLibraryItem:d}=c,h=uo(),[f,p]=n.useState(!1),[g,m]=n.useState(null),v=n.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return ur.includes(t)}const r=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!r&&ur.includes(r)},[]),y=n.useCallback(async e=>{var t,r,n,i;const{dataProviders:o}=s;if(!1!==(null===(r=null===(t=s.config)||void 0===t?void 0:t.features)||void 0===r?void 0:r.enableUpdateFile)&&(null==o?void 0:o.updateFile)&&e.thumbnail)try{const t=xr(e.thumbnail,e.type),r=Cr(t),n=e.name.substring(0,e.name.lastIndexOf("."))+"."+r,i=kr(e.thumbnail,t);return await o.updateFile(e.id,{name:n,type:t,data:i})}catch(e){return console.error("Error updating the file through updateFile:",e),null}else if(e.thumbnail)try{const t=xr(e.thumbnail,e.type),r=kr(e.thumbnail,t),n=new File([r],e.name,{type:t,lastModified:Date.now()});return await h.uploadFileWithProvider(n,e.folderId||void 0)||null}catch(e){return console.error("Error saving the file:",e),null}else if(!1!==(null===(i=null===(n=s.config)||void 0===n?void 0:n.features)||void 0===i?void 0:i.enableRenameFile)&&(null==o?void 0:o.renameFile))try{return await o.renameFile(e.id,e.name)}catch(e){return console.error("Error renaming the file:",e),null}return console.warn("DataProvider for updating files is not configured"),null},[s,h]),b=n.useCallback(r=>{let n;if(r)n=r;else{if(1!==t.size)return;const r=Array.from(t)[0];if(n=e.find(e=>e.id===r),!n||n.isFolder||!v(n))return}u&&u(nr),m(n),p(!0)},[t,e,v,p,u]),w=n.useCallback(()=>{u&&d===nr&&u(Qt),p(!1),m(null)},[d,u]),x=n.useCallback(async e=>{var t,n,l,c;try{const l=await y(e);if(l)return a.success({id:"IMAGE_UPDATE_SUCCESS",message:o("Success"),description:o("Image updated successfully"),placement:"bottomRight",data:{itemId:null!==(t=l.id)&&void 0!==t?t:void 0,itemName:l.name,folderId:null!==(n=l.folderId)&&void 0!==n?n:null,thumbnail:l.thumbnail}}),s.onEditorOk&&s.onEditorOk(l),await r({folderId:i||""}),w(),l}catch(t){console.error("Error saving the file:",t),a.error({id:"IMAGE_SAVE_FAILED",message:o("Error"),description:o("Failed to save changes",{error:t}),innerException:t,placement:"bottomRight",data:{itemId:null!==(l=e.id)&&void 0!==l?l:void 0,itemName:e.name,folderId:null!==(c=e.folderId)&&void 0!==c?c:null,thumbnail:e.thumbnail}})}},[y,s,r,i,a,w]);return{isPixieEditorVisible:f,editingFile:g,handleEdit:b,handlePixieEditorSave:x,handlePixieEditorClose:w}})({files:N||[],selectedFiles:z||new Set,fetchFiles:H,selectedFolder:ce||null}),[_e,Se]=o(!1),Ae=c(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)||(_.current+=1,_.current>0&&C(!0))},[]),ke=c(e=>{e.preventDefault(),e.stopPropagation();const t=e.relatedTarget,r=e.currentTarget;if(t&&!r.contains(t))_.current=Math.max(0,_.current-1),_.current<=0&&C(!1);else if(t){const e=t.closest('[class*="dragOverlay"]');if(e&&r.contains(e))return}},[]),Ee=c(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},[]),Ie=c(e=>{if(e.preventDefault(),e.stopPropagation(),C(!1),_.current=0,e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);Se(!0),ee(t).catch(e=>{console.error("Ошибка при загрузке файлов:",e)}).finally(()=>{Se(!1)})}},[ee]),Te=c(()=>{C(!1),_.current=0},[]);a(()=>{const e=e=>{if(x&&e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length>0){e.preventDefault(),e.stopPropagation();const t=e.target,r=t.closest(`.${ha.filesContainer.replace(/\s+/g,".")}`)||t.closest("[data-files-container]");if(r||x){const n=Object.assign(Object.assign({},e),{preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),dataTransfer:e.dataTransfer,currentTarget:r||t,target:t});Ie(n)}}},t=e=>{e.dataTransfer&&e.dataTransfer.types&&e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy")};return document.addEventListener("drop",e,!0),document.addEventListener("dragover",t,!0),()=>{document.removeEventListener("drop",e,!0),document.removeEventListener("dragover",t,!0)}},[x,Ie]),a(()=>{const e=e=>{x&&Te()};return document.addEventListener("dragend",e,!0),()=>{document.removeEventListener("dragend",e,!0)}},[x,Te]),a(()=>{let e=null;const t=t=>{x&&(e=setTimeout(()=>{x&&Te()},200))};return document.addEventListener("mouseup",t,!0),()=>{document.removeEventListener("mouseup",t,!0),e&&clearTimeout(e)}},[x,Te]),a(()=>{const e=e=>{x&&Te()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[x,Te]),a(()=>{const e=e=>{x&&setTimeout(()=>{x&&Te()},100)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[x,Te]);const Fe=i.useCallback(async()=>{var e;await le(),await F(),await(null===(e=S.current)||void 0===e?void 0:e.refreshFileCounts())},[F,le]),Oe=i.useCallback(async e=>{var t;await ne(e),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[ne]),Pe=i.useCallback(async e=>{var t;await ie(e),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[ie]),Me=i.useCallback(async()=>{let e=[],t=new Map;await q({onStartBatch:r=>{e=g.startUpload(ce||void 0,r),t=new Map(r.map((t,r)=>[t.name,e[r]]))},onStart:r=>{0===e.length&&(e=g.startUpload(ce||void 0,[r]),t.set(r.name,e[0]))},onProgress:(e,r)=>{const n=t.get(e);n&&g.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==N?void 0:N.find(t=>t.name===e&&!t.isFolder);g.markAsSuccess(n,t)}await(null===(r=S.current)||void 0===r?void 0:r.refreshFileCounts())},onError:(e,r)=>{const n=t.get(e);n&&g.markAsError(n,r)},onBatchComplete:async e=>{var r,n,i,o,a;for(const a of e.successes){const s=t.get(a);if(s){const t=null===(r=e.uploadedFiles)||void 0===r?void 0:r.get(a);let l;(null==t?void 0:t.id)?l={id:t.id,name:null!==(n=t.name)&&void 0!==n?n:a,folderId:null!==(o=null!==(i=t.folderId)&&void 0!==i?i:ce)&&void 0!==o?o:null,isFolder:!1}:(await new Promise(e=>setTimeout(e,100)),l=null==N?void 0:N.find(e=>e.name===a&&!e.isFolder)),g.updateProgress(s,100),g.markAsSuccess(s,l)}}e.errors.forEach(({fileName:e,error:r})=>{const n=t.get(e);n&&g.markAsError(n,r)}),await(null===(a=S.current)||void 0===a?void 0:a.refreshFileCounts())}})},[q,g,N,ce]),Re=i.useCallback(async(e,t,r)=>{var n,i;try{E(!0);let o=r||"uploaded-file";if(!r&&e){const t=e.split("?")[0].split("#")[0].split("/");o=t[t.length-1]||"uploaded-file";o.includes(".")&&(null===(n=o.split(".").pop())||void 0===n?void 0:n.length)&&o.split(".").pop().length<=5||(o+=".jpg")}const a=g.startUploadByUrl(ce||void 0,o);try{const r=await G(e,t,!0);if(g.updateProgress(a,100),r){await new Promise(e=>setTimeout(e,100));const e=(null==N?void 0:N.find(e=>e.id===r.id&&!e.isFolder))||r;g.markAsSuccess(a,e)}else g.markAsSuccess(a);await(null===(i=S.current)||void 0===i?void 0:i.refreshFileCounts())}catch(e){const t=e instanceof Error?e.message:String(e);g.markAsError(a,t)}}finally{E(!1)}},[G,g,ce,N]),Le=i.useCallback(async({file:e})=>{var t;const r=g.startUpload(ce||void 0,[e])[0];let n=0;const i=setInterval(()=>{n=Math.min(n+10+Math.floor(Date.now()%10),90),g.updateProgress(r,n)},200);try{const n=await m.uploadFileWithProvider(e,void 0,!0);if(clearInterval(i),g.updateProgress(r,100),n){await new Promise(e=>setTimeout(e,100));const e=(null==N?void 0:N.find(e=>e.id===n.id&&!e.isFolder))||n;g.markAsSuccess(r,e)}else g.markAsSuccess(r);const o=n&&n.folderId||ce||null;return de&&de(o&&"folders"!==o?o:"folders"),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts()),n}catch(e){clearInterval(i);const t=e instanceof Error?e.message:String(e);throw g.markAsError(r,t),e}},[m,g,ce,N,de]),je=i.useCallback(async e=>{var t;await W(e),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[W]),De=i.useCallback(async e=>{var t;if(ee){const r=g.startUpload(ce||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),g.updateProgress(n,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await ee(e),r.forEach(e=>{g.updateProgress(e,100),g.markAsSuccess(e)}),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())}},[ee,g,ce]),Ne=i.useCallback(async e=>{var t;await $(e),await F(),await(null===(t=S.current)||void 0===t?void 0:t.refreshFileCounts())},[$,F]),ze=(({files:e,selectedFiles:t,toggleFileSelection:r,showRenameModal:i,showMoveModal:o,showCopyModal:a,handleDeleteFile:s,handleDeleteFolder:l,showDeleteConfirm:c,onEdit:u})=>{const d=n.useCallback(()=>{t&&t.size>0&&t.forEach(e=>{r(e)})},[t,r]),h=n.useCallback(e=>{if(t&&1===t.size||e){const r=e||Array.from(t)[0];i(r)}},[t,i]),f=n.useCallback(r=>{if(t&&t.size>0||(null==r?void 0:r.id)){if(c)return void c();(r?[r.id]:t).forEach(t=>{const r=e.find(e=>e.id===t);r?r.isFolder?l(t):s(t):console.warn(`Объект с ID ${t} не найден в списке файлов`)})}},[t,e,s,l,c]);return{handleClearSelection:d,handleRename:h,handleDeleteSelected:f,handleCopy:n.useCallback(()=>{a()},[a]),handleMove:n.useCallback(()=>{o()},[o]),handleEdit:n.useCallback(()=>{u()},[u])}})({files:N||[],selectedFiles:z||new Set,toggleFileSelection:Y,showRenameModal:K,showMoveModal:te,showCopyModal:d.actions.showCopyModal||(()=>{}),handleDeleteFile:W,handleDeleteFolder:Ne,showDeleteConfirm:ae,onEdit:Ce.handleEdit}),Be=T||B||_e;a(()=>{br()},[]),i.useEffect(()=>{if(!de||0===I.length)return;const e=!1!==(null==b?void 0:b.rememberLastFolder),t=`em_fm:lastFolder:${(null==b?void 0:b.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t),r=e&&I.some(t=>t.id===e);if(r)return void de(e)}catch(e){}ce||de("folders")},[ce,de,I,null==b?void 0:b.rememberLastFolder,null==b?void 0:b.projectId]);const{state:Ue,actions:Ve,options:He}=i.useContext(yi),{form:We,urlForm:$e,renameForm:qe,moveForm:Ge,renameFolderForm:Ye,copyForm:Xe,isModalVisible:Ke,isUrlModalVisible:Ze,isMoveModalVisible:Je,isRenameFolderModalVisible:Qe,isCopyModalVisible:et,isDeleteConfirmVisible:tt,folderToRename:rt,activeLibraryItem:nt}=Ue,{setIsUrlModalVisible:it,setSortField:ot,setActiveLibraryItem:at}=Ve,{config:st}=He,{handleRenameFolderCancel:lt,handleRenameFolderOk:ct}=j.actions,ut=c(e=>{xe(e.current||pe.current,e.pageSize||pe.pageSize)},[xe,pe]),dt=i.useCallback(e=>{const{sortBy:t,sortOrder:r}=(e=>{const[t,r]=e.split("-");return{sortBy:t,sortOrder:r}})(e);we(t,r)},[we]),[ht,ft]=o(cR),[pt,gt]=o([]),mt=u(null),[vt,yt]=o(hr),[bt,wt]=o([]),xt=u(null),[Ct,_t]=o(""),[St,At]=o([]),kt=i.useRef(void 0),[Et,It]=o(!1),[Tt,Ft]=o(!1),Ot=i.useRef(null),Pt=c(async()=>{const e=null==st?void 0:st.fileForEdit;if(kt.current!==e){kt.current=e;try{if(!(nt===nr&&e&&!Ce.editingFile))return;if("string"==typeof e){if(e.startsWith("data:"))return void(null==Ce||Ce.handleEdit({thumbnail:e}));const t=await m.handleAddFileByUrl(e,!0);if(!t)throw new Error(v("Failed to download file"));kt.current===e&&(null==Ce||Ce.handleEdit(t))}}finally{kt.current===e&&(kt.current=null)}}},[null==st?void 0:st.fileForEdit,nt,Ce,m,v]);a(()=>{Pt()},[Pt]),a(()=>{var e,t,r;nt===Qt?(gt([]),ft(cR),wt([]),yt(hr),At([]),_t(""),Ft(!1),It(!1)):nt===rr?null===(e=Ot.current)||void 0===e||e.focus():nt===er?null===(t=mt.current)||void 0===t||t.focus():nt===tr&&(null===(r=xt.current)||void 0===r||r.focus())},[nt]);const Mt=i.useCallback(async()=>{var e;await ct(),await(null===(e=S.current)||void 0===e?void 0:e.refreshFileCounts())},[ct]),Rt=z.size,Lt=i.useMemo(()=>{var e,t,r;if(1!==Rt)return!1;const[n]=Array.from(z),i=N.find(e=>e.id===n);if(!i||i.isFolder)return!1;const o="string"==typeof i.name?i.name:"",a=o?null===(e=o.split(".").pop())||void 0===e?void 0:e.toLowerCase():void 0,s=null!==(r=null===(t=i.extension)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:a;return"string"==typeof i.type&&i.type.startsWith("image/")||"string"==typeof s&&ur.includes(s)},[Rt,z,N]);return e(Q,{className:"file-manager__layout",children:t("div",{className:ha.filesContainer,"data-files-container":"true",onDragOver:Ee,onDragLeave:ke,onDragEnter:Ae,onDrop:Ie,children:[x&&e("div",{className:ha.dragOverlay,children:t("div",{className:ha.dragOverlayInner,children:[e("div",{className:ha.uploadIcon,children:e(w,{})}),e("div",{className:ha.textTitle,children:v("Drop files here to upload")}),e("div",{className:ha.textDescription,children:v("Supported files:")+" .jpg, .jpeg, .svg, .png"})]})}),p.showResizeGuide&&e("div",{className:"resize-guide",style:{left:`${p.resizeGuidePosition}px`}}),t(Q,{className:"file-manager__content",children:[t(sR,{width:320,theme:"light",className:"file-manager-sider",children:[e(Oa,{ref:S,selectedFolder:ce||"folders",generateMenuItems:L,onFolderSelect:e=>null==de?void 0:de(e),folders:I||[],fetchFolders:F,fetchChildFolders:O,handleAddFile:Me,setIsUrlModalVisible:e=>null==it?void 0:it(e),handleDeleteFolder:Ne,handleCreateFolder:P,activeLibraryItem:nt,setActiveLibraryItem:e=>null==at?void 0:at(e)}),e("div",{className:"sidebar-resizer "+(p.isResizing?"resizing":""),onMouseDown:p.handleResizeStart,onDoubleClick:p.handleDoubleClick,children:e("div",{className:"sidebar-resizer-indicator"})})]}),t(Q,{className:"file-manager__main-content",children:[_e&&e(ka,{style:{position:"absolute",width:"100%",height:"100%",top:0,left:0,zIndex:100,background:"var(--colorBgLayout)"}}),t(lR,{className:"main-content",children:[e(TM,{activeLibraryItem:nt,selectedFolder:(null===(s=null==I?void 0:I.find(e=>(null==e?void 0:e.id)===ce))||void 0===s?void 0:s.name)||v("Folders"),isTrashFolder:"Trash"===ce}),e(X,{className:"zero-divider"}),nt===Qt&&e(ga,{searchTerm:me,sortField:Ue.sortField||"name",setSortField:e=>null==ot?void 0:ot(e),pathHistory:ue||[],handleBreadcrumbClick:e=>null==he?void 0:he(e),handleAddFile:Me,setIsUrlModalVisible:e=>null==it?void 0:it(e),files:N||[],handleSearch:be,handleSort:we,sortBy:ve,sortOrder:ye,handleSortOptionChange:dt,pagination:pe,setPagination:ut,loading:Be,handleItemClick:e=>null==fe?void 0:fe(e),handleDeleteFile:je,selectedFiles:z||new Set,toggleFileSelection:e=>null==Y?void 0:Y(e),handleDroppedFiles:De,fileUpload:g,onClearSelection:ze.handleClearSelection,onRename:ze.handleRename,onCopy:ze.handleCopy,onMove:ze.handleMove,onDelete:ze.handleDeleteSelected,onEdit:Ce.handleEdit}),nt===er&&e(qM,{imageGifList:pt,setImageGifList:gt,currentReqGif:ht,setCurrentReqGif:ft,inputRef:mt,customRequest:(e,t)=>Re(e,void 0,t)}),nt===tr&&e(XM,{imageStockList:bt,setImageStockList:wt,currentReq:vt,setCurrentReq:yt,inputRef:xt,customRequest:(e,t)=>Re(e,void 0,t)}),nt===rr&&!!(null==st?void 0:st.sseQuery)&&e(oR,{imageAiList:St,setImageAiList:At,aiImageRequest:Ct,setAiImageRequest:_t,inputAiRef:Ot,customRequest:Le,isLoadingAi:Et,setIsLoadingAi:It,isImageUploaded:Tt,setIsImageUploaded:Ft}),nt===nr&&e(r,{}),e("div",{children:Lt&&t(r,{children:[e(X,{className:"zero-divider"}),e("div",{style:{display:"flex",justifyContent:"right",padding:"17px 24px",alignItems:"center"},children:e(D,{size:"large",type:"primary",style:{height:40},onClick:()=>{if(He.onEditorOk){const e=Array.from(z)[0],t=N.find(t=>t.id===e);t&&He.onEditorOk(t)}},children:v("Choose")})})]})})]})]})]}),k&&e("div",{style:{position:"fixed",inset:0,zIndex:1500,backgroundColor:"rgba(255, 255, 255, 0.5)",pointerEvents:"all",display:"flex",alignItems:"center",justifyContent:"center"},children:e(A,{size:"large"})}),e(Ta,{isModalVisible:Ke,handleModalOk:M,handleModalCancel:R,form:We,selectedFolder:ce||null,folders:I||[],isUrlModalVisible:Ze,setIsUrlModalVisible:e=>null==it?void 0:it(e),handleAddFileByUrl:Re,urlForm:$e,isRenameModalVisible:U,handleRenameOk:()=>null==J?void 0:J(),handleRenameCancel:()=>null==Z?void 0:Z(),renameForm:qe,fileToRename:V,files:N||[],isMoveModalVisible:Je,handleMoveOk:Oe,handleMoveCancel:re,moveForm:Ge,selectedFiles:z||new Set,isRenameFolderModalVisible:Qe,handleRenameFolderOk:Mt,handleRenameFolderCancel:lt,renameFolderForm:Ye,folderToRename:rt,isCopyModalVisible:et,handleCopyOk:Pe,handleCopyCancel:oe,copyForm:Xe,isDeleteConfirmVisible:tt,handleDeleteConfirmOk:Fe,handleDeleteConfirmCancel:()=>null==se?void 0:se(),fetchChildFolders:O}),e(nM,{visible:Ce.isPixieEditorVisible,onClose:Ce.handlePixieEditorClose,file:Ce.editingFile,onSave:Ce.handlePixieEditorSave}),e(kM,{files:g.uploadFiles,visible:g.isUploadVisible,minimized:g.isUploadMinimized,totalFiles:g.totalFiles,completedFiles:g.completedFiles,onClose:g.closeUpload,onMinimize:g.minimizeUpload,onInsert:e=>{var t;const r=g.getUploadedFile(e.id)||e;null===(t=He.onEditorOk)||void 0===t||t.call(He,r)}})]})})},dR=f(({config:n={},onPathChange:o,onChangeSelection:s,onEditorOk:l,searchQuery:c="",sortBySize:d="name",apiEndpoints:h={},customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y})=>{const b=i.useMemo(()=>Object.assign({folderTreeLoading:"lazy",expandAllFoldersOnInit:!1,expandRootFolderOnInit:!1,iconStrokeWidth:1.4,availableImageExtensions:["jpg","jpeg","png","gif"]},n),[n]);i.useEffect(()=>{b.theme&&(e=>{if("system"===e){const t=matchMedia(sr).matches?or:ir;e=e===ar?t:e}document.documentElement.setAttribute("data-theme",e)})(b.theme),aR(b)},[b]),a(()=>{b.locale&&b.locale!==Ln.language&&Ln.changeLanguage(b.locale),b.customLocale&&b.locale&&Ln.addResourceBundle(b.locale,"translation",b.customLocale,!0,!0)},[b.locale,b.customLocale]);const w=u(null);return e(I,{className:"em-filemanager",children:t(r,{children:[e(E,{getPopupContainer:()=>w.current||document.body,children:e(wi,{options:{apiEndpoints:h,searchQuery:c,sortBySize:d,onPathChange:o,onChangeSelection:s,onEditorOk:l,config:b,customIcons:f,dragDropIcon:p,dataProviders:g,handleNotify:m,handleError:v,handleSuccess:y},children:e(uR,{})})}),e("div",{ref:w,className:"file-manager-modal-root"})]})})});dR.displayName="FileManagerApp";const hR=t=>{var r,n,i;return e(Wr,{i18n:Ln,children:e(gr,{externalTheme:null!==(n=null===(r=t.config)||void 0===r?void 0:r.theme)&&void 0!==n?n:"light",customThemeToken:null===(i=t.config)||void 0===i?void 0:i.customTheme,children:e(ne,{children:e(dR,Object.assign({},t))})})})},fR=new Map,pR=(t,r)=>{var n;let i;br();let o={};const a=e=>{const t=!e||"fileManager"!==e.mode&&"imageCenter"!==e.mode&&"plugin"!==e.mode?void 0:e.mode;return"imageCenter"===t?vr("imageCenter",e):vr(t)};if(t instanceof HTMLElement){i=t;o={config:a(r),apiEndpoints:null==r?void 0:r.apiEndpoints}}else{i=t.element;const e=a(t.config),r=Object.assign(Object.assign({},null===(n=t.config)||void 0===n?void 0:n.apiEndpoints),t.apiEndpoints);o={config:e,currentPath:t.currentPath,onPathChange:t.onPathChange,onChangeSelection:t.onChangeSelection,searchQuery:t.searchQuery,sortBySize:t.sortBySize,apiEndpoints:r,dataProviders:t.dataProviders,customIcons:t.customIcons,dragDropIcon:t.dragDropIcon,handleNotify:t.handleNotify,handleError:t.handleError,handleSuccess:t.handleSuccess}}const s=S(i);s.render(e(hR,Object.assign({},o))),fR.set(i.id||`container_${Date.now()}`,s)},gR=e=>{const t=e.id||Object.keys(fR).find(e=>e.startsWith("container_"));if(t&&fR.has(t)){const e=fR.get(t);null==e||e.unmount(),fR.delete(t)}else{console.warn("Couldn t find the root to unmount");try{S(e).unmount()}catch(e){console.error("Error unmounting the component:",e)}}},mR=new Map,vR=n=>{const{onClose:o,onSave:s,dataProviders:l,theme:c,locale:d}=n,h=i.useMemo(()=>{if(n.file)return n.file;const e=n.name||"edited-image",t=n.extension||(n.type?n.type.split("/")[1]:"png"),r=n.type||`image/${t}`;return{thumbnail:n.imageDataUrl||"",name:e,id:void 0,type:r,extension:t}},[n.file,n.imageDataUrl,n.name,n.extension,n.type]),f=i.useCallback(async e=>{if((null==l?void 0:l.updateFile)&&e.thumbnail)try{const t=xr(e.thumbnail,e.type),r=Cr(t),n=e.name.substring(0,e.name.lastIndexOf("."))+"."+r,i=kr(e.thumbnail,t);return await l.updateFile(e.id,{name:n,type:t,data:i})}catch(e){return console.error("Error updating the file through updateFile:",e),null}return console.warn("DataProvider for updating files is not configured"),null},[l]),p=i.useCallback(async e=>{if((null==l?void 0:l.updateFile)&&e.id&&e.thumbnail)try{const t=await f(e);t&&(e=t)}catch(e){console.error("Standalone Pixie: saveFileToServer error",e)}return s&&await s(e),o&&o(),e},[l,s,o,f]),g=u(null);return a(()=>{d&&d!==Ln.language&&Ln.changeLanguage(d)},[d]),e(I,{className:"em-filemanager",children:t(r,{children:[e(E,{getPopupContainer:()=>g.current||document.body,children:e(Wr,{i18n:Ln,children:e(gr,{externalTheme:null!=c?c:"light",children:e(ne,{children:e(wi,{options:{dataProviders:l,handleNotify:n.handleNotify,handleError:n.handleError,handleSuccess:n.handleSuccess,config:{theme:null!=c?c:"light",locale:d,baseUrl:n.baseUrl,assetsUrl:n.assetsUrl,showNotifications:n.showNotifications}},children:e(nM,{visible:!0,onClose:o,file:h,onSave:p})})})})})}),e("div",{ref:g,className:"file-manager-modal-root"})]})})},yR=t=>{br();const r=t.element,n=S(r);n.render(e(vR,Object.assign({},t))),mR.set(r.id||`pixie_container_${Date.now()}`,n)},bR=e=>{const t=Array.from(mR.keys()).find(e=>e.startsWith("pixie_container_")),r=e.id||t;if(r&&mR.has(r)){const e=mR.get(r);null==e||e.unmount(),mR.delete(r)}else{console.warn("Couldn t find the root to unmount Pixie");try{S(e).unmount()}catch(e){console.error("Error unmounting Pixie:",e)}}},wR=e=>{var t,r;const{mode:n,element:i,fileManager:o,pixieEditor:a,theme:s,dataProviders:l}=e;let c,u;const d={unmount:()=>{c&&gR(c),u&&bR(u)},unmountFileManager:void 0,unmountPixieEditor:void 0};switch(n){case"fileManager":c=i,pR(i,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(t=null==o?void 0:o.config)||void 0===t?void 0:t.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),d.unmountFileManager=()=>gR(c);break;case"pixieEditor":u=i,yR(Object.assign({element:i,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountPixieEditor=()=>bR(u);break;case"both":{const e=document.createElement("div");e.id="file-manager-container",e.style.cssText="height: 50%; border-bottom: 1px solid #d9d9d9;";const t=document.createElement("div");t.id="pixie-editor-container",t.style.cssText="height: 50%;",i.appendChild(e),i.appendChild(t),c=e,u=t,pR(c,Object.assign(Object.assign({},null==o?void 0:o.config),{theme:s||(null===(r=null==o?void 0:o.config)||void 0===r?void 0:r.theme),apiEndpoints:null==o?void 0:o.apiEndpoints})),yR(Object.assign({element:u,theme:s||(null==a?void 0:a.theme),dataProviders:l||(null==a?void 0:a.dataProviders)},a)),d.unmountFileManager=()=>gR(c),d.unmountPixieEditor=()=>bR(u);break}}return d};class xR 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,xR)}}function CR(e,t="BackendError"){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 413:return"PayloadTooLarge";case 415:return"UnsupportedMediaType";case 429:return"RateLimitExceeded";case 500:return"BackendError";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return t}}var _R={init:pR,unmount:gR,initPixieEditor:yR,unmountPixieEditor:bR,initFileManager:wR};export{ga as FileContent,xR as FileManagerApiError,dR as FileManagerApp,hR as FileManagerAppWithContext,Ta as FileModals,Oa as FolderSidebar,vR as PixieOnlyApp,_R as default,pR as init,wR as initFileManager,yR as initPixieEditor,br as installResizeObserverErrorHandler,CR as mapHttpStatusToErrorCode,wr as uninstallResizeObserverErrorHandler,gR as unmount,bR as unmountPixieEditor};
|
|
77
77
|
//# sourceMappingURL=file-manager.esm.js.map
|