@emailmaker/filemanager 0.10.76 → 0.10.77

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.
@@ -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 Io=(So||(So=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]",k="[object RegExp]",A="[object Set]",I="[object String]",E="[object Symbol]",F="[object WeakMap]",T="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",D="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,G=RegExp($.source),q=RegExp(W.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",ke="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Ee="["+we+"]",Fe="["+Ae+"]",Te="["+xe+"]",Oe="\\d+",Pe="["+Ce+"]",Me="["+_e+"]",Re="[^"+we+Ae+Oe+Ce+_e+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ue="(?:"+Me+"|"+Re+")",Ve="(?:"+ze+"|"+Re+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Te+"|"+Le+")?",Ge="["+ke+"]?",qe=Ge+We+"(?:"+Be+"(?:"+[Ne,je,De].join("|")+")"+Ge+We+")*",Ye="(?:"+[Pe,je,De].join("|")+")"+qe,Xe="(?:"+[Ne+Te+"?",Te,je,De,Ee].join("|")+")",Ke=RegExp(Ie,"g"),Ze=RegExp(Te,"g"),Je=RegExp(Le+"(?="+Le+")|"+Xe+qe,"g"),Qe=RegExp([ze+"?"+Me+"+"+He+"(?="+[Fe,ze,"$"].join("|")+")",Ve+"+"+$e+"(?="+[Fe,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+He,ze+"+"+$e,"\\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+ke+"]"),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[N]=it[j]=it[D]=it[z]=it[B]=!0,it[p]=it[g]=it[T]=it[m]=it[O]=it[v]=it[y]=it[b]=it[x]=it[C]=it[_]=it[k]=it[A]=it[I]=it[F]=!1;var ot={};ot[p]=ot[g]=ot[T]=ot[O]=ot[m]=ot[v]=ot[P]=ot[M]=ot[R]=ot[L]=ot[N]=ot[x]=ot[C]=ot[_]=ot[k]=ot[A]=ot[I]=ot[E]=ot[j]=ot[D]=ot[z]=ot[B]=!0,ot[y]=ot[b]=ot[F]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Rn&&Rn&&Rn.Object===Object&&Rn,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&&gt.binding&&gt.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 kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function It(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 Et(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 Ft(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Tt(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 Nt=Ht("length");function jt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Dt(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):Dt(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?Gt(e,t)/r:d}function Ht(e){return function(t){return null==t?r:t[e]}}function $t(e){return function(t){return null==e?r:e[t]}}function Wt(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function Gt(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 qt(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=$t({"À":"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=$t({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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):Nt(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=$t({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),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,ke=t.Object,Ae=t.RegExp,Ie=t.String,Ee=t.TypeError,Fe=we.prototype,Te=_e.prototype,Oe=ke.prototype,Pe=t["__core-js_shared__"],Me=Te.toString,Re=Oe.hasOwnProperty,Le=0,Ne=(ne=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",je=Oe.toString,De=Me.call(ke),ze=dt._,Be=Ae("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=pt?t.Buffer:r,Ve=t.Symbol,He=t.Uint8Array,$e=Ue?Ue.allocUnsafe:r,We=or(ke.getPrototypeOf,ke),Ge=ke.create,qe=Oe.propertyIsEnumerable,Ye=Fe.splice,Xe=Ve?Ve.isConcatSpreadable:r,Je=Ve?Ve.iterator:r,et=Ve?Ve.toStringTag:r,at=function(){try{var e=uo(ke,"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=ke.getOwnPropertySymbols,Nt=Ue?Ue.isBuffer:r,$t=t.isFinite,pr=Fe.join,gr=or(ke.keys,ke),mr=Se.max,vr=Se.min,yr=xe.now,br=t.parseInt,wr=Se.random,xr=Fe.reverse,Cr=uo(t,"DataView"),_r=uo(t,"Map"),Sr=uo(t,"Promise"),kr=uo(t,"Set"),Ar=uo(t,"WeakMap"),Ir=uo(ke,"create"),Er=Ar&&new Ar,Fr={},Tr=jo(Cr),Or=jo(_r),Pr=jo(Sr),Mr=jo(kr),Rr=jo(Ar),Lr=Ve?Ve.prototype:r,Nr=Lr?Lr.valueOf:r,jr=Lr?Lr.toString:r;function Dr(e){if(es(e)&&!Ha(e)&&!(e instanceof Vr)){if(e instanceof Ur)return e;if(Re.call(e,"__wrapped__"))return Do(e)}return new Ur(e)}var zr=function(){function e(){}return function(t){if(!Qa(t))return{};if(Ge)return Ge(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 $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 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 Gr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Wr;++t<r;)this.add(e[t])}function qr(e){var t=this.__data__=new $r(e);this.size=t.size}function Yr(e,t){var r=Ha(e),n=!r&&Va(e),i=!r&&!n&&qa(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?qt(e.length,Ie):[],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[qn(0,t-1)]:r}function Kr(e,t){return Ro(Ei(e),an(t,0,e.length))}function Zr(e){return Ro(Ei(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&&Fi(t,Ts(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:ks(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 Ei(e,s)}else{var h=po(e),f=h==b||h==w;if(qa(e))return Ci(e,l);if(h==_||h==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Fi(e,fo(e),t)}(e,function(e,t){return e&&Fi(t,Os(t),e)}(s,e)):function(e,t){return Fi(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 T: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 N:case j:case D:case z:case B:return Si(e,r);case x:return new i;case C:case I:return new i(e);case k:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new i;case E:return n=e,Nr?ke(Nr.call(n)):{}}}(e,h,l)}}a||(a=new qr);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:Ts)(e);return kt(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=ke(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 Ee(n);return To(function(){e.apply(r,i)},t)}function un(e,t,r,n){var i=-1,o=Ft,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=Ot(t,Xt(r))),n?(o=Tt,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Gr(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}Dr.templateSettings={escape:Y,evaluate:X,interpolate:K,variable:"",imports:{_:Dr}},Dr.prototype=Br.prototype,Dr.prototype.constructor=Dr,Ur.prototype=zr(Br.prototype),Ur.prototype.constructor=Ur,Vr.prototype=zr(Br.prototype),Vr.prototype.constructor=Vr,Hr.prototype.clear=function(){this.__data__=Ir?Ir(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(Ir){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 Ir?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]=Ir&&t===r?i:t,this},$r.prototype.clear=function(){this.__data__=[],this.size=0},$r.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))},$r.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},$r.prototype.has=function(e){return en(this.__data__,e)>-1},$r.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},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(_r||$r),string:new Hr}},Wr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return lo(this,e).get(e)},Wr.prototype.has=function(e){return lo(this,e).has(e)},Wr.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},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.clear=function(){this.__data__=new $r,this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},qr.prototype.get=function(e){return this.__data__.get(e)},qr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $r){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(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,Ts)}function wn(e,t){return e&&yn(e,t,Ts)}function xn(e,t){return Et(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[No(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 ke(e)?function(e){var t=Re.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var o=je.call(e);return i&&(t?e[et]=n:delete e[et]),o}(e):function(e){return je.call(e)}(e)}function kn(e,t){return e>t}function An(e,t){return null!=e&&Re.call(e,t)}function In(e,t){return null!=e&&t in ke(e)}function En(e,t,n){for(var i=n?Tt:Ft,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 Gr(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 Fn(e,t,n){var i=null==(e=Io(e,t=yi(t,e)))?e:e[No(Xo(t))];return null==i?r:_t(i,e,n)}function Tn(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&&qa(e)){if(!qa(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new qr),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 T: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 k:case I:return e==t+"";case x:var s=ir;case A: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 E:if(Nr)return Nr.call(e)==Nr.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,F=w?t.value():t;return a||(a=new qr),o(S,F,n,i,a)}}return!!f&&(a||(a=new qr),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=ke(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 qr;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,Ne&&Ne in t))&&(Ka(e)?Be:pe).test(jo(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 ke(e))Re.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Nn(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var r in ke(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 jn(e,t){return e<t}function Dn(e,t){var r=-1,n=Wa(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]?ko(t[0][0],t[0][1]):function(r){return r===e||Pn(r,e,t)}}function Bn(e,t){return wo(e)&&So(t)?ko(No(e),t):function(n){var i=ks(n,e);return i===r&&i===t?As(n,e):On(t,i,3)}}function Un(e,t,n,i,o){e!==t&&vn(t,function(a,s){if(o||(o=new qr),Qa(a))!function(e,t,n,i,o,a,s){var l=Eo(e,n),c=Eo(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&&qa(c),g=!f&&!p&&ls(c);d=c,f||p||g?Ha(l)?d=l:Ga(l)?d=Ei(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(Eo(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=Dn(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=ki(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 $n(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 Wn(e,t,r,n){var i=n?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ei(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 Gn(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 qn(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(Ao(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=No(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=Er?function(e,t){return Er.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 jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,r){var n=-1,i=Ft,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Tt;else if(o>=200){var c=t?null:Yi(e);if(c)return sr(c);a=!1,i=Zt,l=new Gr}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=Io(e,t=yi(t,e)))||delete e[No(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 Ga(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=$e?$e(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 ki(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 Ai(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 Ii(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 Ei(e,t){var r=-1,n=e.length;for(t||(t=we(n));++r<n;)t[r]=e[r];return t}function Fi(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 Ti(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=ke(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(!Wa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=ke(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=ke(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 Ni(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 ji(e){return function(t,n,i){var o=ke(t);if(!Wa(t)){var a=so(n,3);t=Ts(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 Di(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 Ee(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:Ni(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=Ai(b,i,o,g)),a&&(b=Ii(b,a,l,g)),y-=C,g&&y<d){var _=ar(b,x);return Gi(e,t,zi,s.placeholder,n,b,_,c,u,d-y)}var S=f?n:this,k=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var n=e.length,i=vr(t.length,n),o=Ei(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&&(k=v||Ni(k)),k.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 $i(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 Wi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function Gi(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)&&Fo(p,f),p.placeholder=i,Po(p,e,t)}function qi(e){var t=Se[e];return function(e,r){if(e=gs(e),(r=null==r?0:vr(fs(r),292))&&$t(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=kr&&1/sr(new kr([,-0]))[1]==c?function(e){return new kr(e)}:sl;function Xi(e){return function(t){var r=po(t);return r==x?ir(t):r==A?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 Ee(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?Ai(d,u,t[4]):u,e[4]=d?ar(e[3],o):t[4]}(u=t[5])&&(d=e[5],e[5]=d?Ii(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=Ni(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?Gi(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=Ni(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=Ni(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:Fo)(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 Gr: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(Ao(e,r,$o),e+"")}function ro(e){return _n(e,Ts,ho)}function no(e){return _n(e,Os,fo)}var io=Er?function(e){return Er.get(e)}:sl;function oo(e){for(var t=e.name+"",r=Fr[t],n=Re.call(Fr,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(Dr,"placeholder")?Dr:e).placeholder}function so(){var e=Dr.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=Ts(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=ke(e),Et(mt(e),function(t){return qe.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Pt(t,ho(e)),e=We(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=No(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(We(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?Wa(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 ke(t)}function xo(e){var t=oo(e),r=Dr[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||kr&&po(new kr)!=A||Ar&&po(new Ar)!=F)&&(po=function(e){var t=Sn(e),n=t==_?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Tr:return O;case Or:return x;case Pr:return S;case Mr:return A;case Rr:return F}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 ko(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in ke(n))}}function Ao(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 Io(e,t){return t.length<2?e:Cn(e,ri(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Fo=Mo(Qn),To=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 kt(f,function(r){var n="_."+r[0];t&r[1]&&!Ft(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=qn(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 No(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Do(e){if(e instanceof Vr)return e.clone();var t=new Ur(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Xn(function(e,t){return Ga(e)?un(e,mn(t,1,Ga,!0)):[]}),Bo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!0),so(n,2)):[]}),Uo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!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)),Dt(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)),Dt(e,so(t,3),o,!0)}function $o(e){return null!=e&&e.length?mn(e,1):[]}function Wo(e){return e&&e.length?e[0]:r}var Go=Xn(function(e){var t=Ot(e,mi);return t.length&&t[0]===e[0]?En(t):[]}),qo=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]?En(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]?En(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?Wn(e,t):e}var Jo=to(function(e,t){var r=null==e?0:e.length,n=on(e,t);return Gn(e,Ot(t,function(e){return yo(e,r)?+e:e}).sort(ki)),n});function Qo(e){return null==e?e:xr.call(e)}var ea=Xn(function(e){return ci(mn(e,1,Ga,!0))}),ta=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),ci(mn(e,1,Ga,!0),so(t,2))}),ra=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,ci(mn(e,1,Ga,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=Et(e,function(e){if(Ga(e))return t=mr(e.length,t),!0}),qt(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 Ga(e)?un(e,t):[]}),aa=Xn(function(e){return pi(Et(e,Ga))}),sa=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),pi(Et(e,Ga),so(t,2))}),la=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,pi(Et(e,Ga),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=Dr(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=Ti(function(e,t,r){Re.call(e,r)?++e[r]:nn(e,r,1)}),ga=ji(Vo),ma=ji(Ho);function va(e,t){return(Ha(e)?kt:dn)(e,so(t,3))}function ya(e,t){return(Ha(e)?At:hn)(e,so(t,3))}var ba=Ti(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=Wa(e)?we(e.length):[];return dn(e,function(e){o[++n]=i?_t(t,e,r):Fn(e,t,r)}),o}),xa=Ti(function(e,t,r){nn(e,r,t)});function Ca(e,t){return(Ha(e)?Ot:Dn)(e,so(t,3))}var _a=Ti(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),[])}),ka=ut||function(){return dt.Date.now()};function Aa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,s,r,r,r,r,t)}function Ia(e,t){var i;if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ea=Xn(function(e,t,r){var n=1;if(r.length){var i=ar(r,ao(Ea));n|=a}return Ki(e,n,t,r,i)}),Fa=Xn(function(e,t,r){var n=3;if(r.length){var i=ar(r,ao(Fa));n|=a}return Ki(t,n,e,r,i)});function Ta(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ee(n);function g(t){var n=o,i=a;return o=a=r,d=t,l=e.apply(i,n)}function m(e){var n=e-u;return u===r||n>=t||n<0||f&&e-d>=s}function v(){var e=ka();if(m(e))return y(e);c=To(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=ka(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=To(v,t),h?g(e):l}(u);if(f)return xi(c),c=To(v,t),g(u)}return c===r&&(c=To(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(ka())},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 Ee(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ma.Cache||Wr),r}function Ra(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ma.Cache=Wr;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)})}),Na=Xn(function(e,t){var n=ar(t,ao(Na));return Ki(e,a,r,t,n)}),ja=Xn(function(e,t){var n=ar(t,ao(ja));return Ki(e,64,r,t,n)}),Da=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=Wi(kn),Ua=Wi(function(e,t){return e>=t}),Va=Tn(function(){return arguments}())?Tn:function(e){return es(e)&&Re.call(e,"callee")&&!qe.call(e,"callee")},Ha=we.isArray,$a=vt?Xt(vt):function(e){return es(e)&&Sn(e)==T};function Wa(e){return null!=e&&Ja(e.length)&&!Ka(e)}function Ga(e){return es(e)&&Wa(e)}var qa=Nt||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=We(e);if(null===t)return!0;var r=Re.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==De}var is=wt?Xt(wt):function(e){return es(e)&&Sn(e)==k},os=xt?Xt(xt):function(e){return es(e)&&po(e)==A};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sn(e)==I}function ss(e){return"symbol"==typeof e||es(e)&&Sn(e)==E}var ls=Ct?Xt(Ct):function(e){return es(e)&&Ja(e.length)&&!!it[Sn(e)]},cs=Wi(jn),us=Wi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(Wa(e))return as(e)?ur(e):Ei(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==A?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 Fi(e,Os(e))}function vs(e){return null==e?"":li(e)}var ys=Oi(function(e,t){if(_o(t)||Wa(t))Fi(t,Ts(t),e);else for(var r in t)Re.call(t,r)&&Qr(e,r,t[r])}),bs=Oi(function(e,t){Fi(t,Os(t),e)}),ws=Oi(function(e,t,r,n){Fi(t,Os(t),e,n)}),xs=Oi(function(e,t,r,n){Fi(t,Ts(t),e,n)}),Cs=to(on),_s=Xn(function(e,t){e=ke(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 ks(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function As(e,t){return null!=e&&go(e,t,In)}var Is=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r},Qs(rl)),Es=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Re.call(e,t)?e[t].push(r):e[t]=[r]},so),Fs=Xn(Fn);function Ts(e){return Wa(e)?Yr(e):Ln(e)}function Os(e){return Wa(e)?Yr(e,!0):Nn(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}),Fi(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 $n(e,t,function(t,r){return As(e,r)})}(e,t)});function Ns(e,t){if(null==e)return{};var r=Ot(no(e),function(e){return[e]});return t=so(t),$n(e,r,function(e,r){return t(e,r[0])})}var js=Xi(Ts),Ds=Xi(Os);function zs(e){return null==e?[]:Kt(e,Ts(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()}),$s=Li(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Ws=Ri("toLowerCase"),Gs=Li(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),qs=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 kt(t,function(t){t=No(t),nn(e,t,Ea(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Di(),tl=Di(!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 Fn(r,e,t)}}),ol=Xn(function(e,t){return function(r){return Fn(e,r,t)}});function al(e,t,r){var n=Ts(t),i=xn(t,n);null!=r||Qa(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=xn(t,Ts(t)));var o=!(Qa(r)&&"chain"in r&&!r.chain),a=Ka(e);return kt(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__=Ei(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(It),ul=Vi(Lt);function dl(e){return wo(e)?Ht(No(e)):function(e){return function(t){return Cn(t,e)}}(e)}var hl=$i(),fl=$i(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Ui(function(e,t){return e+t},0),yl=qi("ceil"),bl=Ui(function(e,t){return e/t},1),wl=qi("floor"),xl=Ui(function(e,t){return e*t},1),Cl=qi("round"),_l=Ui(function(e,t){return e-t},0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Aa,Dr.assign=ys,Dr.assignIn=bs,Dr.assignInWith=ws,Dr.assignWith=xs,Dr.at=Cs,Dr.before=Ia,Dr.bind=Ea,Dr.bindAll=Js,Dr.bindKey=Fa,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Dr.chain=da,Dr.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},Dr.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},Dr.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)?Ei(r):[r],mn(t,1))},Dr.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 Ee(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)}})},Dr.conforms=function(e){return function(e){var t=Ts(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Dr.constant=Qs,Dr.countBy=pa,Dr.create=function(e,t){var r=zr(e);return null==t?r:rn(r,t)},Dr.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},Dr.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},Dr.debounce=Ta,Dr.defaults=_s,Dr.defaultsDeep=Ss,Dr.defer=Oa,Dr.delay=Pa,Dr.difference=zo,Dr.differenceBy=Bo,Dr.differenceWith=Uo,Dr.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):[]},Dr.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):[]},Dr.dropRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0,!0):[]},Dr.dropWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0):[]},Dr.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)):[]},Dr.filter=function(e,t){return(Ha(e)?Et:gn)(e,so(t,3))},Dr.flatMap=function(e,t){return mn(Ca(e,t),1)},Dr.flatMapDeep=function(e,t){return mn(Ca(e,t),c)},Dr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),mn(Ca(e,t),n)},Dr.flatten=$o,Dr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Dr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===r?1:fs(t)):[]},Dr.flip=function(e){return Ki(e,512)},Dr.flow=el,Dr.flowRight=tl,Dr.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},Dr.functions=function(e){return null==e?[]:xn(e,Ts(e))},Dr.functionsIn=function(e){return null==e?[]:xn(e,Os(e))},Dr.groupBy=ba,Dr.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Dr.intersection=Go,Dr.intersectionBy=qo,Dr.intersectionWith=Yo,Dr.invert=Is,Dr.invertBy=Es,Dr.invokeMap=wa,Dr.iteratee=nl,Dr.keyBy=xa,Dr.keys=Ts,Dr.keysIn=Os,Dr.map=Ca,Dr.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},Dr.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},Dr.matches=function(e){return zn(sn(e,1))},Dr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Dr.memoize=Ma,Dr.merge=Ps,Dr.mergeWith=Ms,Dr.method=il,Dr.methodOf=ol,Dr.mixin=al,Dr.negate=Ra,Dr.nthArg=function(e){return e=fs(e),Xn(function(t){return Vn(t,e)})},Dr.omit=Rs,Dr.omitBy=function(e,t){return Ns(e,Ra(so(t)))},Dr.once=function(e){return Ia(2,e)},Dr.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))},Dr.over=ll,Dr.overArgs=La,Dr.overEvery=cl,Dr.overSome=ul,Dr.partial=Na,Dr.partialRight=ja,Dr.partition=_a,Dr.pick=Ls,Dr.pickBy=Ns,Dr.property=dl,Dr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Dr.pull=Ko,Dr.pullAll=Zo,Dr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Wn(e,t,so(r,2)):e},Dr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Wn(e,t,r,n):e},Dr.pullAt=Jo,Dr.range=hl,Dr.rangeRight=fl,Dr.rearg=Da,Dr.reject=function(e,t){return(Ha(e)?Et:gn)(e,Ra(so(t,3)))},Dr.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 Gn(e,i),r},Dr.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Xn(e,t=t===r?t:fs(t))},Dr.reverse=Qo,Dr.sampleSize=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),(Ha(e)?Kr:Zn)(e,t)},Dr.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Dr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Dr.shuffle=function(e){return(Ha(e)?Zr:ti)(e)},Dr.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)):[]},Dr.sortBy=Sa,Dr.sortedUniq=function(e){return e&&e.length?ai(e):[]},Dr.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},Dr.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):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ee(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)})},Dr.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Dr.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Dr.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):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?hi(e,so(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return Qa(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ta(e,t,{leading:i,maxWait:t,trailing:o})},Dr.thru=ha,Dr.toArray=ds,Dr.toPairs=js,Dr.toPairsIn=Ds,Dr.toPath=function(e){return Ha(e)?Ot(e,No):ss(e)?[e]:Ei(Lo(vs(e)))},Dr.toPlainObject=ms,Dr.transform=function(e,t,r){var n=Ha(e),i=n||qa(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(We(e)):{}}return(i?kt:bn)(e,function(e,n,i){return t(r,e,n,i)}),r},Dr.unary=function(e){return Aa(e,1)},Dr.union=ea,Dr.unionBy=ta,Dr.unionWith=ra,Dr.uniq=function(e){return e&&e.length?ci(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ci(e,r,t):[]},Dr.unset=function(e,t){return null==e||ui(e,t)},Dr.unzip=na,Dr.unzipWith=ia,Dr.update=function(e,t,r){return null==e?e:di(e,t,vi(r))},Dr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:di(e,t,vi(n),i)},Dr.values=zs,Dr.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Dr.without=oa,Dr.words=Ks,Dr.wrap=function(e,t){return Na(vi(t),e)},Dr.xor=aa,Dr.xorBy=sa,Dr.xorWith=la,Dr.zip=ca,Dr.zipObject=function(e,t){return gi(e||[],t||[],Qr)},Dr.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Dr.zipWith=ua,Dr.entries=js,Dr.entriesIn=Ds,Dr.extend=bs,Dr.extendWith=ws,al(Dr,Dr),Dr.add=vl,Dr.attempt=Zs,Dr.camelCase=Bs,Dr.capitalize=Us,Dr.ceil=yl,Dr.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)},Dr.clone=function(e){return sn(e,4)},Dr.cloneDeep=function(e){return sn(e,5)},Dr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Dr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Dr.conformsTo=function(e,t){return null==t||ln(e,t,Ts(t))},Dr.deburr=Vs,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=bl,Dr.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},Dr.eq=za,Dr.escape=function(e){return(e=vs(e))&&q.test(e)?e.replace(W,tr):e},Dr.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Dr.every=function(e,t,n){var i=Ha(e)?It:fn;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.find=ga,Dr.findIndex=Vo,Dr.findKey=function(e,t){return jt(e,so(t,3),bn)},Dr.findLast=ma,Dr.findLastIndex=Ho,Dr.findLastKey=function(e,t){return jt(e,so(t,3),wn)},Dr.floor=wl,Dr.forEach=va,Dr.forEachRight=ya,Dr.forIn=function(e,t){return null==e?e:vn(e,so(t,3),Os)},Dr.forInRight=function(e,t){return null==e?e:yn(e,so(t,3),Os)},Dr.forOwn=function(e,t){return e&&bn(e,so(t,3))},Dr.forOwnRight=function(e,t){return e&&wn(e,so(t,3))},Dr.get=ks,Dr.gt=Ba,Dr.gte=Ua,Dr.has=function(e,t){return null!=e&&go(e,t,An)},Dr.hasIn=As,Dr.head=Wo,Dr.identity=rl,Dr.includes=function(e,t,r,n){e=Wa(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},Dr.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)},Dr.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)},Dr.invoke=Fs,Dr.isArguments=Va,Dr.isArray=Ha,Dr.isArrayBuffer=$a,Dr.isArrayLike=Wa,Dr.isArrayLikeObject=Ga,Dr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sn(e)==m},Dr.isBuffer=qa,Dr.isDate=Ya,Dr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Dr.isEmpty=function(e){if(null==e)return!0;if(Wa(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||qa(e)||ls(e)||Va(e)))return!e.length;var t=po(e);if(t==x||t==A)return!e.size;if(_o(e))return!Ln(e).length;for(var r in e)if(Re.call(e,r))return!1;return!0},Dr.isEqual=function(e,t){return On(e,t)},Dr.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},Dr.isError=Xa,Dr.isFinite=function(e){return"number"==typeof e&&$t(e)},Dr.isFunction=Ka,Dr.isInteger=Za,Dr.isLength=Ja,Dr.isMap=ts,Dr.isMatch=function(e,t){return e===t||Pn(e,t,co(t))},Dr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Pn(e,t,co(t),n)},Dr.isNaN=function(e){return rs(e)&&e!=+e},Dr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mn(e)},Dr.isNil=function(e){return null==e},Dr.isNull=function(e){return null===e},Dr.isNumber=rs,Dr.isObject=Qa,Dr.isObjectLike=es,Dr.isPlainObject=ns,Dr.isRegExp=is,Dr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},Dr.isSet=os,Dr.isString=as,Dr.isSymbol=ss,Dr.isTypedArray=ls,Dr.isUndefined=function(e){return e===r},Dr.isWeakMap=function(e){return es(e)&&po(e)==F},Dr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sn(e)},Dr.join=function(e,t){return null==e?"":pr.call(e,t)},Dr.kebabCase=Hs,Dr.last=Xo,Dr.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):Dt(e,Ut,o,!0)},Dr.lowerCase=$s,Dr.lowerFirst=Ws,Dr.lt=cs,Dr.lte=us,Dr.max=function(e){return e&&e.length?pn(e,rl,kn):r},Dr.maxBy=function(e,t){return e&&e.length?pn(e,so(t,2),kn):r},Dr.mean=function(e){return Vt(e,rl)},Dr.meanBy=function(e,t){return Vt(e,so(t,2))},Dr.min=function(e){return e&&e.length?pn(e,rl,jn):r},Dr.minBy=function(e,t){return e&&e.length?pn(e,so(t,2),jn):r},Dr.stubArray=pl,Dr.stubFalse=gl,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=xl,Dr.nth=function(e,t){return e&&e.length?Vn(e,fs(t)):r},Dr.noConflict=function(){return dt._===this&&(dt._=ze),this},Dr.noop=sl,Dr.now=ka,Dr.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)},Dr.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},Dr.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},Dr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(vs(e).replace(re,""),t||0)},Dr.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 qn(e,t)},Dr.reduce=function(e,t,r){var n=Ha(e)?Mt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,dn)},Dr.reduceRight=function(e,t,r){var n=Ha(e)?Rt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,hn)},Dr.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),Yn(vs(e),t)},Dr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.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[No(t[i])];a===r&&(i=o,a=n),e=Ka(a)?a.call(e):a}return e},Dr.round=Cl,Dr.runInContext=e,Dr.sample=function(e){return(Ha(e)?Xr:Kn)(e)},Dr.size=function(e){if(null==e)return 0;if(Wa(e))return as(e)?cr(e):e.length;var t=po(e);return t==x||t==A?e.size:Ln(e).length},Dr.snakeCase=Gs,Dr.some=function(e,t,n){var i=Ha(e)?Lt:ni;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.sortedIndex=function(e,t){return ii(e,t)},Dr.sortedIndexBy=function(e,t,r){return oi(e,t,so(r,2))},Dr.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},Dr.sortedLastIndex=function(e,t){return ii(e,t,!0)},Dr.sortedLastIndexBy=function(e,t,r){return oi(e,t,so(r,2),!0)},Dr.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},Dr.startCase=qs,Dr.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},Dr.subtract=_l,Dr.sum=function(e){return e&&e.length?Gt(e,rl):0},Dr.sumBy=function(e,t){return e&&e.length?Gt(e,so(t,2)):0},Dr.template=function(e,t,n){var i=Dr.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=Ts(s),c=Kt(s,l),u=0,d=t.interpolate||ye,h="__p += '",f=Ae((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},Dr.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=qt(n,t);++r<e;)t(r);return i},Dr.toFinite=hs,Dr.toInteger=fs,Dr.toLength=ps,Dr.toLower=function(e){return vs(e).toLowerCase()},Dr.toNumber=gs,Dr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,u):0===e?e:0},Dr.toString=vs,Dr.toUpper=function(e){return vs(e).toUpperCase()},Dr.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("")},Dr.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("")},Dr.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("")},Dr.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=Ae(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},Dr.unescape=function(e){return(e=vs(e))&&G.test(e)?e.replace($,hr):e},Dr.uniqueId=function(e){var t=++Le;return vs(e)+t},Dr.upperCase=Ys,Dr.upperFirst=Xs,Dr.each=va,Dr.eachRight=ya,Dr.first=Wo,al(Dr,(ml={},bn(Dr,function(e,t){Re.call(Dr.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),Dr.VERSION="4.17.21",kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dr[e].placeholder=Dr}),kt(["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()}}),kt(["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}}),kt(["head","last"],function(e,t){var r="take"+(t?"Right":"");Vr.prototype[e]=function(){return this[r](1).value()[0]}}),kt(["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 Fn(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=Dr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Dr.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(Dr,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)})}),kt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Fe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dr.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=Dr[t];if(r){var n=r.name+"";Re.call(Fr,n)||(Fr[n]=[]),Fr[n].push({name:t,func:r})}}),Fr[zi(r,2).name]=[{name:"wrapper",func:r}],Vr.prototype.clone=function(){var e=new Vr(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(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},Dr.prototype.at=fa,Dr.prototype.chain=function(){return da(this)},Dr.prototype.commit=function(){return new Ur(this.value(),this.__chain__)},Dr.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__++]}},Dr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=Do(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Dr.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)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,Je&&(Dr.prototype[Je]=function(){return this}),Dr}();ft?((ft.exports=fr)._=fr,ht._=fr):dt._=fr}).call(Ao)}(ko,ko.exports)),ko.exports);const Eo=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Fo=async(e,t,r)=>{var n;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!r)return e;{const e=await r({parentId:t.folderId});i=Array.isArray(e)?e:[]}let o=((e,t)=>{const r=Array.isArray(e)?e:[];return(n=t.folderId)&&"root"!==n&&"folders"!==n&&"null"!==n&&null!==n?r.filter(e=>e.parentId===t.folderId):r.filter(Eo);var n})(i,t);if(null===(n=null==t?void 0:t.search)||void 0===n?void 0:n.trim()){const e=t.search.trim().toLowerCase();o=o.filter(t=>{var r;return null===(r=t.name)||void 0===r?void 0:r.toLowerCase().includes(e)})}if(0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:void 0,date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:"",childCount:e.childCount}));if("folder"===(null==t?void 0:t.itemType))return a;const s=e.filter(e=>!e.isFolder);return[...a,...s]},To=e=>{var t,r,n,i;const{state:o,actions:s,options:l}=mo(),{searchTerm:d,sortBy:h,sortOrder:f,selectedFolder:p,pagination:g,pathHistory:m}=o,{setSearchTerm:v,setSortBy:y,setSortOrder:b,setPagination:w}=s,x=e||s.fetchFiles,C=u(null),_=u(Io.debounce(e=>{const t=JSON.stringify(e);C.current!==t&&(C.current=t,null==x||x(e))},150)).current,S=c(()=>{const e=p||"";if(!e)return;const t=[...Array.isArray(m)?m:[]].reverse().find(t=>t.id===e);return null==t?void 0:t.name},[p,m]),k=c(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:p||"",folderName:S(),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,S,d,g.current,g.pageSize,h,f,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),A=c(e=>{var t,r;if(v&&v(e),w&&w({current:1,pageSize:g.pageSize,total:0}),x){const n={folderId:p||"",folderName:S(),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"};x(n)}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[v,w,g.pageSize,x,p,S,h,f,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),I=c((e,t)=>{var r,n;null==y||y(e),null==b||b(t),x&&_({folderId:p||"",folderName:S(),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"})},[y,b,_,p,S,d,g.current,g.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),E=c((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(w&&w({current:e,pageSize:t||g.pageSize,total:g.total}),x&&_({folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:e,limit:t||g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}))},[w,g.pageSize,g.total,_,p,S,d,h,f,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return a(()=>{if(x){const e=k();_(Object.assign(Object.assign({},e),{page:1}))}},[p]),a(()=>{x&&_(k())},[]),a(()=>()=>{var e;null===(e=_.cancel)||void 0===e||e.call(_)},[_]),{state:{searchTerm:d||"",sortBy:h||"name",sortOrder:f||"asc"},actions:{setSearchTerm:v||(()=>{}),setSortBy:y||(()=>{}),setSortOrder:b||(()=>{}),handleSearch:A,handleSort:I,handlePaginationChange:E,getCurrentQueryParams:k}}},Oo=new Map;function Po(e){const t="id"in e&&void 0!==e.id?String(e.id):"unknown",r="data"in e?e.data:void 0;return`${e.type}:${t}:${function(e){if(null==e)return"";try{return JSON.stringify(e,Object.keys(e).sort())}catch(t){return String(e)}}(r)}`}const Mo=()=>{var e,t;const{notification:r}=I.useApp(),n=mo(),{options:i}=n,o=c(async e=>{let t;if(i.handleNotify){try{t=await i.handleNotify(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&i.handleError){try{t=await i.handleError(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&i.handleSuccess){try{t=await i.handleSuccess(e)}catch(e){console.error(e)}if(t)return!1}return t},[i]),a=c(async function(e,t=!1){var n,a,s,l;try{void 0===e.visibility&&(e.visibility=!t);const c=await o(e);"object"==typeof c&&(e=c);const u=null!==(a=null===(n=i.config)||void 0===n?void 0:n.notificationDedupeTtlMs)&&void 0!==a?a:12e3,d="error"===e.type&&!0===e.notificationDedupe;d&&function(e,t){if(t<=0)return;const r=Po(e),n=Date.now(),i=Oo.get(r);void 0!==i&&n-i<t&&(e.visibility=!1)}(e,u);if(!(!1!==e.visibility&&!1!==c&&!1!==(null===(s=i.config)||void 0===s?void 0:s.showNotifications)))return e;const h=r[e.type];"function"==typeof h?(h(e),d&&(l=e,u<=0||Oo.set(Po(l),Date.now()))):console.warn(`Unknown notification type: ${e.type}`,e)}catch(e){console.error(e)}return e},[r,o,null===(e=i.config)||void 0===e?void 0:e.notificationDedupeTtlMs,null===(t=i.config)||void 0===t?void 0:t.showNotifications]);return d(()=>({error:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"error"}),t),success:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"success"}),t),warning:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"warning"}),t),notify:a}),[a])},Ro={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid. Allowed characters: {{allowedChars}}",FileAccessDenied:"You don't have permission to access this file.",FileReadError:"Failed to read the file.",FileWriteError:"Failed to write the file.",FileTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",FileTypeNotAllowed:"This file type is not allowed.",FileCorrupted:"The file appears to be corrupted.",FileChecksumMismatch:"File integrity check failed.",FileStorageQuotaExceeded:"Storage quota exceeded. Please free up space.",FileLocked:"File is locked by another process or user.",FileVersionConflict:"File version conflict. Please refresh and try again.",FolderNotFound:"Folder not found or no longer available.",FolderAlreadyExists:"Folder with this name already exists.",FolderInvalidName:"Folder name is not valid. Allowed characters: {{allowedChars}}",FolderAccessDenied:"You don't have permission to access this folder.",FolderReadError:"Failed to read the folder contents.",FolderWriteError:"Failed to write to the folder.",FolderQuotaExceeded:"Folder storage quota exceeded.",FolderNotEmpty:"Folder is not empty.",FolderBackendError:"Server error while processing the folder.",FolderTimeout:"Folder operation took too long.",RenameNotAllowed:"Renaming is not allowed for this item.",MoveNotAllowed:"Moving is not allowed for this item.",CopyNotAllowed:"Copying is not allowed for this item.",DeleteNotAllowed:"Deleting is not allowed for this item.",MoveIntoSelf:"Cannot move an item into itself.",MoveIntoDescendant:"Cannot move an item into its descendant folder.",CopyIntoSelf:"Cannot copy an item into itself.",UnsupportedOperation:"This operation is not supported.",ConfigError:"Configuration error occurred.",FileUploadQuotaExceeded:"You have exceeded the upload quota.",FileUploadNetworkError:"Network error while uploading the file.",FileUploadTimeout:"File upload took too long.",FileUploadBackendError:"Server error while uploading the file.",UploadUrlInvalid:"The specified URL is not valid.",UploadUrlNotReachable:"The specified URL is not reachable.",UploadUrlContentTypeNotAllowed:"Content type at the URL is not allowed.",UploadUrlDownloadFailed:"Failed to download file from the URL.",FileLookupFailed:"Failed to find existing file by URL.",FileProxyFailed:"Failed to load file through proxy.",FileProxyNotConfigured:"File proxy is not configured.",FileDownloadNetworkError:"Network error while downloading the file.",FileDownloadTimeout:"File download took too long.",FileDownloadBackendError:"Server error while downloading the file.",BatchPartialFailure:"Some items could not be processed.",BatchAllFailed:"Failed to process all items in the batch.",BatchConflict:"Some items in the batch are in a conflicting state.",BatchValidationFailed:"Some items in the batch did not pass validation.",BatchItemLimitExceeded:"Batch operation exceeds the maximum number of items allowed.",ValidationError:"Some of the provided data is invalid.",PayloadTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",UnsupportedMediaType:"This media type is not supported.",NetworkError:"Network error. Please check your connection and try again.",BackendError:"Server error. Please try again later.",Timeout:"The operation took too long. Please try again.",AuthenticationFailed:"Authentication failed. Please sign in again.",AuthorizationFailed:"You are not allowed to perform this action.",RateLimitExceeded:"Too many requests. Please try again a bit later.",ServiceUnavailable:"Service is temporarily unavailable. Please try again later.",AIResponseInvalid:"AI service returned an invalid response.",AIImageGenerationFailed:"Failed to generate image using AI.",AIImageGenerationLimitExceeded:"You have reached the AI image generation limit.",IntegrationError:"Error in external integration.",ThirdPartyError:"Error in a third-party service.",UnknownError:"An unknown error occurred."},Lo={FileTooLarge:"File is too large to upload.",PayloadTooLarge:"File is too large to upload."},No=(e,t,r)=>{var n,i,o;if(!e)return;const a=Ro[e];if(!a)return;const s=null!==(n=null==r?void 0:r.fileSize)&&void 0!==n?n:"",l=null!==(i=null==r?void 0:r.maxSize)&&void 0!==i?i:"";if(("FileTooLarge"===e||"PayloadTooLarge"===e)&&!(!!s&&!!l)){const r=Lo[e];return r?t(r):t(a,{fileSize:"?",maxSize:"?"})}return t(a,{allowedChars:null!==(o=null==r?void 0:r.allowedChars)&&void 0!==o?o:"a-z A-Z 0-9 . _ -",fileSize:s,maxSize:l})},jo=e=>{if(!e||"string"!=typeof e)return;const t=e.toLowerCase();return(t.includes("maximum number of files")||t.includes("number of files exceeded"))&&(t.includes("allowed")||t.includes("received"))?"BatchItemLimitExceeded":t.includes("exceeds")||t.includes("maximum")||t.includes("too large")||t.includes("size limit")||t.includes("object size")||t.includes("размер")||t.includes("превышен")?"PayloadTooLarge":t.includes("403")||t.includes("forbidden")||t.includes("access denied")||t.includes("доступ запрещён")?"AuthorizationFailed":t.includes("404")||t.includes("not found")||t.includes("не найден")?"UploadUrlNotReachable":t.includes("already exists")||t.includes("уже существует")||t.includes("дубликат")?"FileAlreadyExists":t.includes("invalid")&&(t.includes("name")||t.includes("имя")||t.includes("назва"))?"FileInvalidName":t.includes("type")&&(t.includes("not allowed")||t.includes("не поддерживается"))?"FileTypeNotAllowed":void 0},Do=e=>{var t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y;if(!e)return{message:"Unknown error",raw:e};if("string"==typeof e)return{message:e};if(e instanceof Error){const o=e;return{message:null!==(t=o.message)&&void 0!==t?t:e.message,code:o.code,status:null!==(r=o.status)&&void 0!==r?r:o.httpStatus,stack:null!==(n=o.stack)&&void 0!==n?n:e.stack,raw:null!==(i=o.raw)&&void 0!==i?i:e}}if("object"==typeof e){const t=e,r=null!==(o=t.data)&&void 0!==o?o:t,n=null!==(a=null==r?void 0:r.data)&&void 0!==a?a:r,i=null!==(c=null!==(l=null!==(s=t.message)&&void 0!==s?s:null==r?void 0:r.message)&&void 0!==l?l:t.error)&&void 0!==c?c:t.reason,b=null!==(h=null!==(d=null!==(u=t.status)&&void 0!==u?u:t.httpStatus)&&void 0!==d?d:null==n?void 0:n.status)&&void 0!==h?h:null==r?void 0:r.status,w=null!==(f=t.code)&&void 0!==f?f:null==r?void 0:r.code,x=t.stack,C=null!==(p=t.raw)&&void 0!==p?p:e,_=null!==(m=null!==(g=t.fileSize)&&void 0!==g?g:null==n?void 0:n.fileSize)&&void 0!==m?m:null==r?void 0:r.fileSize,S=null!==(y=null!==(v=t.maxSize)&&void 0!==v?v:null==n?void 0:n.maxSize)&&void 0!==y?y:null==r?void 0:r.maxSize;if(i||w||b||x||C)return Object.assign(Object.assign({message:i,code:w,status:b,stack:x,raw:C},null!=_&&{fileSize:_}),null!=S&&{maxSize:S})}return{message:String(e),raw:e}};const zo=(e,t,r)=>{const n=Do(e),i=null==n?void 0:n.code;if("FileTooLarge"===i&&null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize))return t("File too large ({{size}}). Maximum allowed size: {{maxSize}}",{size:ui(r.fileSize),maxSize:ui(r.maxSize)});if(("BatchItemLimitExceeded"===i||"exceeded_max_files"===i)&&(null==n?void 0:n.message)){const{allowed:e,received:r}=function(e){const t=e.match(/Allowed:\s*(\d+)/i),r=e.match(/received:\s*(\d+)/i);return{allowed:t?parseInt(t[1],10):void 0,received:r?parseInt(r[1],10):void 0}}(n.message);if(null!=e&&null!=r)return t("Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}",{allowed:e,received:r})}if((null==n?void 0:n.message)&&"Unknown error"!==n.message)return n.message;const o=null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize)?{fileSize:ui(r.fileSize),maxSize:ui(r.maxSize)}:void 0,a=No(i,t,o);return null!=a?a:t("Error uploading file")},Bo=e=>{const t=Do(e);return"path_folder_not_found"===(null==t?void 0:t.code)},Uo=["file_get_contents","open stream","failed to open stream","http request failed","curl_error"];const Vo=(e,t,r)=>{var n;if(!e)return t("Error when downloading a file by URL");const i=null!==(n=(e=>{const t=jo(e);if("AuthorizationFailed"===t){const t=(e||"").toLowerCase();if(t.includes("download")||t.includes("url")||t.includes("file_get_contents")||t.includes("failed to download"))return"UploadUrlNotReachable"}return t})(null==e?void 0:e.message))&&void 0!==n?n:null==e?void 0:e.code,o=No(i,t,r);if(o)return o;const a=(null==e?void 0:e.message)&&"string"==typeof e.message?e.message.trim():null;return a&&function(e){if(!e||e.length>200)return!1;const t=e.toLowerCase();return!Uo.some(e=>t.includes(e))}(a)?a:t("Failed to download file from the URL.")},Ho=e=>Array.isArray(e)?e.filter(e=>(null==e?void 0:e.id)&&"folders"!==e.id).map(e=>e.name).filter(Boolean).join("/"):"",$o=e=>{const t=e.trim();if(!t)return"";const r=t.toLowerCase(),n=[r.indexOf(" and "),r.indexOf(" or "),t.indexOf(","),t.indexOf(";"),r.indexOf(". ")].filter(e=>e>=0);if(0===n.length)return t;const i=Math.min(...n);return t.slice(0,i).trim()||t},Wo=(e,t)=>{const r=(e=>{var t,r,n,i;if(e&&"object"==typeof e){const o=e,a=null!==(n=null===(r=null===(t=o.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.path_folder)&&void 0!==n?n:null===(i=o.data)||void 0===i?void 0:i.path_folder;if("string"==typeof a&&a.trim())return $o(a)||null}const o=Do(e),a=null==o?void 0:o.message;if(!a)return null;const s=a.toLowerCase(),l=["не существует:","not exists:","not exist:","not found:"];for(const e of l){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return $o(r)||null}}const c=["not exists ","not exist ","not found "];for(const e of c){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return $o(r)||null}}return null})(e);return r?(e=>{const t=e.split("/").filter(Boolean);return t.length<=1?"":(t.pop(),t.join("/"))})(r):Ho(t)},Go=async e=>{var t;const{options:r,pathFolder:n,dataProviders:i}=e;if(null==i?void 0:i.clearCache)return void await i.clearCache(n||null);const o=null===(t=null==r?void 0:r.apiEndpoints)||void 0===t?void 0:t.clearCache;if(!o)return;const a=o.includes("?");let s=o;n&&n.length>0&&(s=`${o}${a?"&":"?"}path_folder=${encodeURIComponent(n)}`);const l=await fetch(s,{method:"POST"});if(!l.ok)throw new Error(`Cache clear failed: ${l.status}`)},qo=()=>{var e,t;const{state:r,actions:i,options:o}=mo(),{t:a}=Kn(),s=Mo(),{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(e=!1)=>{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:null!=r?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}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(t){console.error("Error loading folders:",t);const r=Do(t);if(!e&&(404===(null==r?void 0:r.status)||"FileNotFound"===(null==r?void 0:r.code))){const e=Wo(t,d||[]);try{return await Go({options:o,pathFolder:e,dataProviders:null==o?void 0:o.dataProviders}),void await x(!0)}catch(e){console.error("Cache clear failed:",e)}}const n=No(null==r?void 0:r.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=n?n:a("Failed to load folders"),description:a("Folders"),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{reason:t instanceof Error?t.message:String(t),folderId:null,folderName:a("Folders")}})}finally{null==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,d,o]),C=c(()=>x(),[x]),_=c(async e=>{try{let t,r;if(null==y?void 0:y.getFolders){t=await y.getFolders({parentId:e,deep:!1});const n=Array.isArray(l)?l:[],i=new Set(t.map(e=>e.id)),o=n.filter(t=>t.parentId!==e||i.has(t.id));r=[...o,...t.filter(e=>!o.some(t=>t.id===e.id))]}else{if(!(null==y?void 0:y.getFiles))return[];{const{files:n}=await y.getFiles({itemType:"folder",folderId:null!=e?e:void 0});t=w(n);const i=Array.isArray(l)?l:[],o=new Set(t.map(e=>e.id)),a=i.filter(t=>t.parentId!==e||o.has(t.id));r=[...a,...t.filter(e=>!a.some(t=>t.id===e.id))]}}let n=r,i=0;for(;i!==n.length;){i=n.length;const e=new Set(n.map(e=>e.id));n=n.filter(t=>!t.parentId||e.has(t.parentId))}return null==g||g(n),t}catch(e){return console.error("Error loading child folders:",e),[]}},[y,l,g,w]),S=c(()=>{var e;const t=null!==(e=null==b?void 0:b.defaultFolderName)&&void 0!==e?e:a("New folder");h.setFieldsValue({folderName:t}),null==v||v(!0)},[h,v,a,null==b?void 0:b.defaultFolderName]),k=c(async(e,t)=>{const r=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==g||g(r),e.parentId&&(await _(e.parentId),await new Promise(e=>setTimeout(e,50))),!(null==t?void 0:t.preserveSelection)&&i.setSelectedFolder&&i.setSelectedFolder(e.id),!(null==t?void 0:t.preserveSelection)&&i.setPathHistory){const t=Array.isArray(r)?r:[],n=(e,r=new Set)=>{if(r.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const i=t.find(t=>t.id===e);if(!i)return[];const o=new Set(r);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,_,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:null!=n?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]),I=c(async e=>{var t;let r,n,i=null;try{const o=await(e?e.validateFields():h.validateFields());if(r=o.folderName.trim(),!r){const e=o.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:!!o.is_force_create}})}n=Ur(r,b);const c=o.targetFolder;if(c)i="folders"!==c?c:null;else if(u&&"folders"!==u)i=u;else if(Array.isArray(d)&&d.length>1){const e=d[d.length-1];i=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}if(Vr(b)&&(null==y?void 0:y.getFolders))try{const e=(await y.getFolders({parentId:i,deep:!1})||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean);if(e.includes(r.trim().toLowerCase()))return void s.error({id:"FOLDER_ALREADY_EXISTS",message:a("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,folderId:i}})}catch(e){}let f;if(!(null==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:n,folderId:null!=i?i:null,is_force_create:!!o.is_force_create}});f=await y.createFolder({name:n,parentId:i,is_force_create:!!o.is_force_create}),(e=>{if(!e||!e.id)throw new Error(a("Invalid server response: folder ID is missing"));if(e.id===e.parentId&&e.parentId)throw console.error("Circular dependency detected: folder cannot be its own parent"),new Error(a("Error: folder cannot be its own parent"))})(f);const p={id:f.id,name:f.name,parentId:null!=i?i:null,childCount:f.childCount},m=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==p.id),p];if(null==g||g(m),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[p.id],folderId:null!==(t=p.parentId)&&void 0!==t?t:null,folderName:p.name}}),e||null==v||v(!1),(async()=>{try{await k(p,{preserveSelection:Boolean(e)}),await C(),await new Promise(e=>setTimeout(e,200));await A(f.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 f}catch(e){console.error("❌ Error creating the folder:",e);const t=Do(e),o=No(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=o?o:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:n||r,folderId:null!=i?i:null,reason:e instanceof Error?e.message:String(e)}})}},[h,u,y,k,C,A,v,s,a,l,g,b,d]),E=c(()=>{null==v||v(!1)},[v]),F=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(ve,{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?F(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=F(r),[t]},[l,a,F]),O=c(async(e,t)=>{var r,n,c,u;let d;try{const h=t.trim(),f=null==l?void 0:l.find(t=>t.id===e);if(!h)return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:e,folderName:t,reason:"emptyName"}});d=Ur(h,b);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==f?void 0:f.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 p=await o.dataProviders.renameFolder(e,d);if(!(null==p?void 0:p.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"invalidResponse"}}});await C(),e!==p.id&&i.setSelectedFolder&&i.setSelectedFolder(p.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:p.id,itemName:p.name,folderId:null!==(u=p.parentId)&&void 0!==u?u:null}})}catch(r){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:d||t,error:{message:r instanceof Error?r.message:String(r)}}})}},[C,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,b,i.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:p,loading:f},actions:{fetchFolders:C,fetchChildFolders:_,handleCreateFolder:S,handleModalOk:I,handleModalCancel:E,generateMenuItems:T,renameFolder:O}}},Yo=()=>{const{options:e,actions:t}=mo(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:o}=Kn(),a=Mo(),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),t=i.filter(e=>!e.success),r=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return Bo(r)}),n=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return!Bo(r)});return c+=e.length+r.length,u+=n.length,void n.forEach(e=>{var t;const r=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),n=null!==(t=e.innerException)&&void 0!==t?t:e.error,i=Do(n);d.push({itemId:r,itemName:s(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(Bo(t))c+=e.length;else if(t){u+=e.length;const r=Do(t);d.push({error:r})}else u+=e.length}return}catch(r){if(Bo(r))c+=e.length;else{const n=t?"Ошибка при удалении":"Ошибка при перемещении в корзину";console.error(n,r),u+=e.length;const i=Do(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}};class Xo 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,Xo)}}const Ko=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,Zo=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function Jo(e,t){const r=e.trim();if(!r)throw new Xo(t("Enter the URL of the image"),"UploadUrlInvalid");if(r.length>8192)throw new Xo(t("URL too long"),"UploadUrlInvalid");let n;try{n=new URL(r)}catch(e){throw new Xo(t("The specified URL is not valid."),"UploadUrlInvalid")}const i=n.protocol.toLowerCase();if("http:"!==i&&"https:"!==i)throw new Xo(t("Only http and https URLs are supported"),"UploadUrlInvalid");const o=n.hostname.toLowerCase();if(Ko.test(o)&&("undefined"==typeof window||!Ko.test(window.location.hostname.toLowerCase())))throw new Xo(t("Private and local URLs are not allowed"),"UploadUrlInvalid");if(Zo.test(o))throw new Xo(t("Private and local URLs are not allowed"),"UploadUrlInvalid")}function Qo(e,t){return new Promise(function(r,n){let i;return ea(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 ea=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 ta={},ra={get exports(){return ta},set exports(e){ta=e}};!function(){var e,t,r={};ra.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,k=65535&_;if(0!=_){k=65535&_;var A=s(S=_>>>16,a.of0);a.lhst[257+A]++;var I=s(k,a.df0);a.dhst[I]++,b+=a.exb[A]+a.dxb[I],f[m]=S<<23|c-d,f[m+1]=k<<16|A<<8|I,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 k=0;k<286;k++)b.lhst[k]=0;for(k=0;k<30;k++)b.dhst[k]=0;for(k=0;k<19;k++)b.ihst[k]=0;var A=C<_&&C<S?0:_<S?1:2;if(w(l,c,e),w(l,c+1,A),c+=3,0==A){for(;7&c;)c++;c=r.F._copyExact(o,a,s,l,c)}else{var I,E;if(1==A&&(I=b.fltree,E=b.fdtree),2==A){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),I=b.ltree,E=b.dtree,x(l,c,p-257),x(l,c+=5,g-1),x(l,c+=5,m-4),c+=4;for(var F=0;F<m;F++)x(l,c+3*F,b.itree[1+(b.ordr[F]<<1)]);c+=3*m,c=r.F._codeTiny(v,b.itree,l,c),c=r.F._codeTiny(y,b.itree,l,c)}for(var T=a,O=0;O<n;O+=2){for(var P=t[O],M=P>>>23,R=T+(8388607&P);T<R;)c=r.F._writeLit(o[T++],I,l,c);if(0!=M){var L=t[O+1],N=L>>16,j=L>>8&255,D=255&L;x(l,c=r.F._writeLit(257+j,I,l,c),M-b.of0[j]),c+=b.exb[j],w(l,c=r.F._writeLit(D,E,l,c),N-b.df0[D]),c+=b.dxb[D],T+=M}}c=r.F._writeLit(256,I,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 k=1;for(S=0;S<b;S++){var A=a(e,_+3*S,3);d.itree[1+(d.ordr[S]<<1)]=A,A>k&&(k=A)}_+=3*b,l(d.itree,k),c(d.itree,k,d.imap),f=d.lmap,p=d.dmap,_=s(d.imap,(1<<k)-1,v+y,e,_,d.ttree);var I=i._copyOut(d.ttree,0,v,d.ltree);w=(1<<I)-1;var E=i._copyOut(d.ttree,v,y,d.dtree);x=(1<<E)-1,l(d.ltree,I),c(d.ltree,I,f),l(d.dtree,E),c(d.dtree,E,p)}for(;;){var F=f[u(e,_)&w];_+=15&F;var T=F>>>4;if(T>>>8==0)t[C++]=T;else{if(256==T)break;var O=C+T-254;if(T>264){var P=d.ldef[T-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],N=(L>>>4)+o(e,_,15&L);for(_+=15&L,h&&(t=r.F._check(t,C+(1<<17)));C<O;)t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N];C=O}}}else{7&_&&(_+=8-(7&_));var j=4+(_>>>3),D=e[j-4]|e[j-3]<<8;h&&(t=r.F._check(t,C+D)),t.set(new n(e.buffer,e.byteOffset+j,D),C),_=j+D<<3,C+=D}return t.length==C?t:t.slice(0,C)},r.F._check=function(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n},r.F._decodeTiny=function(e,t,n,i,o,a){for(var s=r.F._bitsE,l=r.F._get17,c=0;c<n;){var u=e[l(i,o)&t];o+=15&u;var d=u>>>4;if(d<=15)a[c]=d,c++;else{var h=0,f=0;16==d?(f=3+s(i,o,2),o+=2,h=a[c-1]):17==d?(f=3+s(i,o,3),o+=3):18==d&&(f=11+s(i,o,7),o+=7);for(var p=c+f;c<p;)a[c]=h,c++}}return o},r.F._copyOut=function(e,t,r,n){for(var i=0,o=0,a=n.length>>>1;o<r;){var s=e[o+t];n[o<<1]=0,n[1+(o<<1)]=s,s>i&&(i=s),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},r.F.makeCodes=function(e,t){for(var n,i,o,a,s=r.F.U,l=e.length,c=s.bl_count,u=0;u<=t;u++)c[u]=0;for(u=1;u<l;u+=2)c[e[u]]++;var d=s.next_code;for(n=0,c[0]=0,i=1;i<=t;i++)n=n+c[i-1]<<1,d[i]=n;for(o=0;o<l;o+=2)0!=(a=e[o+1])&&(e[o]=d[a],d[a]++)},r.F.codes2map=function(e,t,n){for(var i=e.length,o=r.F.U.rev15,a=0;a<i;a+=2)if(0!=e[a+1])for(var s=a>>1,l=e[a+1],c=s<<4|l,u=t-l,d=e[a]<<u,h=d+(1<<u);d!=h;)n[o[d]>>>15-t]=c,d++},r.F.revCodes=function(e,t){for(var n=r.F.U.rev15,i=15-t,o=0;o<e.length;o+=2){var a=e[o]<<t-e[o+1];e[o]=n[a]>>>i}},r.F._putsE=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},r.F._putsF=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},r.F._bitsE=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},r.F._bitsF=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=r.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function i(e,t,r){for(;0!=t--;)e.push(0,r)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),i(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()}();var na=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:ta},[ta]);const ia=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 k=0;k<r;k++){var A=(_=255*(t[e+(k>>>3)]>>>7-(7&k)&1))==255*m?0:255;u[n+k]=A<<24|_<<16|_<<8|_}else if(2==h)for(k=0;k<r;k++)A=(_=85*(t[e+(k>>>2)]>>>6-((3&k)<<1)&3))==85*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(4==h)for(k=0;k<r;k++)A=(_=17*(t[e+(k>>>1)]>>>4-((1&k)<<2)&15))==17*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(8==h)for(k=0;k<r;k++)A=(_=t[e+k])==m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(16==h)for(k=0;k<r;k++)_=t[e+(k<<1)],A=f(t,e+(k<<1))==m?0:255,u[n+k]=A<<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}=ia,{_bin:t}=ia,r=ia._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={},k=[],A=[];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++)k.push(r.plte[x].est.rgba);let n=0;for(x=0;x<_.length;x++){const e=(E=_[x]).img.length;var I=new Uint8Array(r.inds.buffer,n>>2,e>>2);A.push(I);const t=new Uint8Array(r.abuf,n,e);p&&s(E.img,E.rect.width,E.rect.height,k,t,I),E.img.set(t),n+=e}}else for(b=0;b<_.length;b++){var E=_[b];const e=new Uint32Array(E.img.buffer);var F=E.rect.width;for(w=e.length,I=new Uint8Array(w),A.push(I),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])I[x]=I[x-1];else if(x>F&&t==e[x-F])I[x]=I[x-F];else{let e=S[t];if(null==e&&(S[t]=e=k.length,k.push(t),k.length>=300))break;I[x]=e}}}const T=k.length;for(T<=256&&0==f&&(v=T<=2?1:T<=4?2:T<=16?4:8,v=Math.max(v,u)),b=0;b<_.length;b++){(E=_[b]).rect.x,E.rect.y,F=E.rect.width;const e=E.rect.height;let t=E.img;new Uint32Array(t.buffer);let r=4*F,n=4;if(T<=256&&0==f){r=Math.ceil(v*F/8);var O=new Uint8Array(r*e);const i=A[b];for(let t=0;t<e;t++){x=t*r;const e=t*F;if(8==v)for(var P=0;P<F;P++)O[x+P]=i[e+P];else if(4==v)for(P=0;P<F;P++)O[x+(P>>1)]|=i[e+P]<<4-4*(1&P);else if(2==v)for(P=0;P<F;P++)O[x+(P>>2)]|=i[e+P]<<6-2*(3&P);else if(1==v)for(P=0;P<F;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(F*e*3);const i=F*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*F}E.img=t,E.bpl=r,E.bpp=n}return{ctype:m,depth:v,plte:k,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=na;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]]};ia.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)},ia.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)},ia.encode.compress=u,ia.encode.dither=s,ia.quantize=g,ia.quantize.getKDtree=m,ia.quantize.getNearest=v}();const oa={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,oa._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var aa={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},sa={[aa.CHROME]:16384,[aa.FIREFOX]:11180,[aa.DESKTOP_SAFARI]:16384,[aa.IE]:8192,[aa.IOS]:4096,[aa.ETC]:8192};const la="undefined"!=typeof window,ca="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,ua=la&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),da=(la||ca)&&(ua&&ua.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),ha=(la||ca)&&(ua&&ua.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function fa(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 pa(e){return new Promise((t,r)=>{const n=new ha;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function ga(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function ma(){if(void 0!==ma.cachedResult)return ma.cachedResult;let e=aa.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=aa.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=aa.IOS:/Safari/i.test(t)?e=aa.DESKTOP_SAFARI:/Firefox/i.test(t)?e=aa.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=aa.IE),ma.cachedResult=e,ma.cachedResult}function va(e,t){const r=ma(),n=sa[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 ya(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 ba(e,t){const{width:r,height:n}=va(e.width,e.height),[i,o]=ya(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 wa(){return void 0!==wa.cachedResult||(wa.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),wa.cachedResult}function xa(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=ba(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 pa(e).then(function(e){try{return t=e,ga(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(wa()||[aa.DESKTOP_SAFARI,aa.MOBILE_SAFARI].includes(ma()))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 Ca(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=ia.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=>oa.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),fa(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 _a(e){e.width=0,e.height=0}function Sa(){return new Promise(function(e,t){let r,n,i,o;return void 0!==Sa.cachedResult?e(Sa.cachedResult):fa("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,xa(r).then(function(a){try{return n=a[1],Ca(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,_a(n),xa(i).then(function(r){try{return o=r[0],Sa.cachedResult=1===o.width&&2===o.height,e(Sa.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 ka(e){return new Promise((t,r)=>{const n=new ha;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 Aa(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]=ya(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),_a(e)),a}function Ia(e,t){const{width:r}=e,{height:n}=e,[i,o]=ya(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),_a(e),i}function Ea(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 k(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function A(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,k(),xa(e,t).then(function(r){try{return[,l]=r,k(),c=Aa(l,t),k(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return ka(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,k(),Sa().then(function(r){try{return d=r?c:Ia(c,u),k(),h=t.initialQuality||1,f=t.fileType||e.type,Ca(d,f,e.name,e.lastModified,h).then(function(r){try{{if(p=r,k(),g=p.size>s,m=p.size>e.size,!g&&!m)return A(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]=ya(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,Ca(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,_a(_),_=x,b=w.size,A(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()?I.call(this):e;e=u}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(u);function I(){return _a(_),_a(x),_a(c),_a(d),_a(l),A(100),n(w)}}}catch(E){return i(E)}}.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 Fa;function Ta(e,t){return new Promise((r,n)=>{Fa||(Fa=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(Fa);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 Oa(e,t){return new Promise(function(r,n){let i,o,a,s,l,c;if(i={...t},a=0,({onProgress:s}=i),i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{a=e,"function"==typeof s&&s(a)},!(e instanceof Blob||e instanceof da))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 Ea(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 Ea(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",Ta(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=Qo(e,o))}catch(e){}return r(o)}})}function Pa(e,t){var r;if(null==e?void 0:e.extension){const t=e.extension.toLowerCase(),r={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.type){const t=Ar(e.type),r={"image/jpeg":{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},"image/png":{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},"image/gif":{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},"image/webp":{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},"image/svg+xml":{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.name){const t=null===(r=e.name.split(".").pop())||void 0===r?void 0:r.toLowerCase();if(t){const e={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(e[t])return e[t]}}if(t){const e=Ar(t),r=Fr(e);let n="jpeg";return"png"===r?n="png":"svg"===r?n="svg":"jpeg"===r&&(n="jpeg"),{extension:r,mimeType:e,format:r,pixieFormat:n}}return{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"}}Oa.getDataUrlFromFile=pa,Oa.getFilefromDataUrl=fa,Oa.loadImage=ga,Oa.drawImageInCanvas=ba,Oa.drawFileInCanvas=xa,Oa.canvasToFile=Ca,Oa.getExifOrientation=ka,Oa.handleMaxWidthOrHeight=Aa,Oa.followExifOrientation=Ia,Oa.cleanupCanvasMemory=_a,Oa.isAutoOrientationInBrowser=Sa,Oa.approximateBelowMaximumCanvasSizeOfBrowser=va,Oa.copyExifWithoutOrientation=Qo,Oa.getBrowserName=ma,Oa.version="2.0.2";const Ma={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},Ra=["gif","svg"];function La(e){if(!e)return null;const t=e.trim();if(t.endsWith("%"))return null;const r=parseFloat(t.replace(/px$/i,""));return Number.isFinite(r)&&r>0?r:null}function Na(e,t=2,r=4096){const{width:n,height:i}=function(e){var t,r,n,i,o;const a=null!==(r=null===(t=e.match(/<\s*svg\b[\s\S]*?>/i))||void 0===t?void 0:t[0])&&void 0!==r?r:"",s=null===(n=a.match(/\bwidth\s*=\s*["']([^"']*)["']/i))||void 0===n?void 0:n[1],l=null===(i=a.match(/\bheight\s*=\s*["']([^"']*)["']/i))||void 0===i?void 0:i[1],c=La(s),u=La(l);if(null!=c&&null!=u)return{width:c,height:u};const d=null===(o=e.match(/viewBox\s*=\s*["']([^"']+)["']/i))||void 0===o?void 0:o[1];if(d){const e=d.trim().split(/[\s,]+/);if(4===e.length){const t=parseFloat(e[2]),r=parseFloat(e[3]);if(Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0)return{width:t,height:r}}}return null!=c?{width:c,height:c}:null!=u?{width:u,height:u}:{width:300,height:300}}(e);let o=Math.max(1,Math.round(n*t)),a=Math.max(1,Math.round(i*t));const s=Math.max(64,r),l=Math.max(o,a);if(l>s){const e=s/l;o=Math.max(1,Math.round(o*e)),a=Math.max(1,Math.round(a*e))}return{width:o,height:a}}async function ja(e,t,r,n,i){var o;const a=null!==(o=null==i?void 0:i.canvasScale)&&void 0!==o?o:2,s=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(s);try{const e=new Image;await new Promise((t,r)=>{e.onload=()=>t(),e.onerror=()=>r(new Error("Failed to load SVG image")),e.src=l});const n=document.createElement("canvas"),i=Math.max(1,Math.round(t*a)),o=Math.max(1,Math.round(r*a));n.width=i,n.height=o;const s=n.getContext("2d");if(!s)throw new Error("Canvas 2D context is not available");return s.clearRect(0,0,i,o),s.drawImage(e,0,0,i,o),function(e){return new Promise((t,r)=>{e.toBlob(e=>{e?t(e):r(new Error("canvas.toBlob returned null"))},"image/png")})}(n)}finally{URL.revokeObjectURL(l)}}async function Da(e,t,r,n,i){const o=await ja(e,t,r,0,i);return a=o,new Promise((e,t)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>{var e;return t(null!==(e=r.error)&&void 0!==e?e:new Error("readAsDataURL failed"))},r.readAsDataURL(a)});var a}function za(e,t,r,n){return new File([e],t,{type:r,lastModified:n})}function Ba(e,t){return t&&t!==e.name?za(e,t,e.type,e.lastModified):e}async function Ua(e,t={}){const{maxSizeMB:r=Ma.MAX_SIZE_MB,maxWidthOrHeight:n=Ma.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0,convertSvgToPng:l=!1}=t;if(!(e&&e instanceof File))return e;let c=e,u=!1;if(l){const t=(c.type||"").toLowerCase(),r=/\.svg$/i.test(c.name.trim()),i=t.includes("svg");let a=!1;if(!i&&!r)try{const e=await async function(e,t=24e3){const r=Math.min(t,Math.max(0,e.size));return e.slice(0,r).text()}(c);a=function(e){const t=e.trimStart().replace(/^\uFEFF/,"");return!!t.startsWith("<")&&/<\s*svg[\s>/]/i.test(t)}(e)}catch(e){a=!1}if(i||r||a)try{c=await async function(e,t={}){var r,n,i;const o=null!==(r=t.pixelScale)&&void 0!==r?r:2,a=null!==(n=t.maxLongEdge)&&void 0!==n?n:4096,s=await e.text(),{width:l,height:c}=Na(s,o,a),u=await ja(s,l,c,0,{canvasScale:1}),d=null!==(i=t.outputFileName)&&void 0!==i?i:e.name,h=/\.svg$/i.test(d)?d.replace(/\.svg$/i,".png"):`${d}.png`;return new File([u],h,{type:"image/png",lastModified:e.lastModified})}(c,{maxLongEdge:n,outputFileName:null!=o?o:c.name}),u=!0}catch(t){console.warn("prepareImageForUpload: SVG to PNG conversion failed, using original",t),c=e}}if(u)return c;const d=(c.type&&""!==c.type.trim()?c.type:Tr(c.name))||i||"image/jpeg",h=Ar(d);if(!h.startsWith("image/"))return Ba(c,o);const f="image/webp"===(p=h)?"image/jpeg":p;var p;const g=Fr(h),m=Fr(f),v=f!==h?function(e,t){const r=t.startsWith(".")?t.slice(1):t,n=e.lastIndexOf(".");return n>0?`${e.substring(0,n)}.${r}`:`${e}.${r}`}(null!=o?o:c.name,m):null!=o?o:c.name,y=s&&(b=g,!Ra.includes(b));var b;if(!y&&!(f!==h))return Ba(c,v);try{const t={libURL:a,useWebWorker:!0,fileType:f};y?(t.maxSizeMB=r,t.maxWidthOrHeight=n):(t.maxSizeMB=Math.max(e.size/1048576+1,1),t.initialQuality=1,t.alwaysKeepResolution=!0);const i=await Oa(c,t);return function(e,t,r,n){const i=null!=n?n:t.name;return e instanceof File?e.type!==r||e.lastModified!==t.lastModified||e.name!==i?za(e,i,r,t.lastModified):e:za(e,i,r,t.lastModified)}(i,c,Ar(i.type||f),v)}catch(e){console.error("prepareImageForUpload failed",e);try{return Ba(c,v)}catch(e){return console.error("Failed to create File with normalized name after image preparation error",e),c}}}async function Va(e){const{folderId:t,dataProviders:r,folders:n,pathHistory:i,t:o}=e,a=null==t?"":String(t);if(!a||"folders"===a)return o("Folders");if("Trash"===a)return o("Trash");const s=i||[],l=s[s.length-1];if((null==l?void 0:l.id)===a&&l.name)return l.name;const c=[...s].reverse().find(e=>e.id===a);if(null==c?void 0:c.name)return c.name;const u=null==r?void 0:r.getItem;if(u)try{const e=await Promise.resolve(u(a));if(null==e?void 0:e.name)return e.name}catch(e){}const d=null==n?void 0:n.find(e=>e.id===a);return(null==d?void 0:d.name)?d.name:a}const Ha=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function $a(e){const t=new URL(e.trim());t.hash="",t.hostname=t.hostname.toLowerCase(),("https:"===t.protocol&&"443"===t.port||"http:"===t.protocol&&"80"===t.port)&&(t.port="");const r=Array.from(t.searchParams.entries()).filter(([e])=>!Ha.test(e)).sort(([e,t],[r,n])=>{const i=e.localeCompare(r);return 0!==i?i:t.localeCompare(n)});return t.search="",r.forEach(([e,r])=>t.searchParams.append(e,r)),t.toString()}function Wa(e){return!!(null==e?void 0:e.startsWith("image/"))&&"image/gif"!==e}function Ga(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch(t){return console.warn("Failed to create normalized File:",t),e}}function qa(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>{var e;return r(null!==(e=n.error)&&void 0!==e?e:new Error("Failed to read proxied file"))},n.readAsDataURL(e)})}function Ya(e){try{const t=new URL(e).pathname.split("/").pop();return t?decodeURIComponent(t):void 0}catch(e){return}}function Xa(e){return null==e||""===e||"folders"===e?null:e}async function Ka(e){const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Xo(`HTTP ${t.status}`,"UploadUrlDownloadFailed",t.status);return t.blob()}function Za(e,t){var r,n;if(!(e instanceof Blob)||0===e.size)throw new Xo(t("Failed to download file from the URL."),"UploadUrlDownloadFailed");const i=(null===(n=null===(r=e.type)||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim())||"image/png";if(!i.startsWith("image/"))throw new Xo(t("Content type at the URL is not allowed."),"UploadUrlContentTypeNotAllowed");return{blob:e,mimeType:i}}const Ja=()=>{var e,t,r,n;const{state:o,actions:a,options:s}=mo(),l=To(),{sortBy:u,sortOrder:d}=l.state,{actions:{fetchFolders:h}}=qo(),{t:f}=Kn(),p=Mo(),{deleteItems:g}=Yo(),{selectedFolder:m,urlForm:v,pagination:y,files:b,pathHistory:w,folders:x}=o,C=i.useRef(null),_=i.useRef([]);C.current=y,_.current=Array.isArray(b)?b:[];const S=i.useRef(null),{setFiles:k,setLoading:A,setIsUrlModalVisible:I,setActiveLibraryItem:E,setPagination:F,setSelectedFolder:T,setPathHistory:O}=a,{dataProviders:P}=s,M=c(async e=>{var t,r,n;if(!(null==P?void 0:P.getFiles))return[];const i=null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.disablePagination,{files:o,pagination:a}=await P.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,noFolder:null==e?void 0:e.noFolder,search:(null===(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 F&&((null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.disablePagination)?F({current:1,pageSize:o.length||1,total:o.length||0}):a&&F({current:a.page,pageSize:a.limit,total:a.total})),o},[P,null===(e=null==s?void 0:s.config)||void 0===e?void 0:e.disablePagination,F]),R=c(async(e,t,r)=>pi(P,e,t,r,Vr(null==s?void 0:s.config)),[P,null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient]),L=c(async(e,t=!1)=>{var r,n,i;try{null==A||A(!0);let t=[];if(!(null==P?void 0:P.getFiles))return void console.error("DataProvider for getting files is not defined");t=await M(e);const r=null!=e?e:{folderId:m||"",itemType:"all"};"file"!==r.itemType&&(t=await Fo(t,r,null==P?void 0:P.getFolders)),"Trash"!==(m||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==k||k(t);const n=Xa(r.folderId);if(n===Xa(m)){const e=Array.isArray(w)?w:[];S.current={selectedFolder:null!=m?m:null,pathHistory:e.map(e=>Object.assign({},e))}}}catch(o){if("StaleLoad"===(null==o?void 0:o.name))return;const a=Do(o),l=404===(null==a?void 0:a.status)||"FileNotFound"===(null==a?void 0:a.code)||"path_folder_not_found"===(null==a?void 0:a.code);if(l||console.error("Error loading files:",o),!t&&l){const t=Wo(o,w||[]);try{return await Go({options:s,pathFolder:t,dataProviders:null==s?void 0:s.dataProviders}),void await L(e,!0)}catch(e){console.error("Cache clear failed:",e)}}if(l&&T&&O){const t=Array.isArray(w)?w:[];if(t.length>1){const n=t.slice(0,-1),i=n[n.length-1],o=null!==(r=null==i?void 0:i.id)&&void 0!==r?r:"folders";return O(n),T(o),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to parent folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:o}),!1)}return O([{id:"folders",name:f("Folders")}]),T("folders"),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to root folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:"folders"}),!1)}const c=S.current;if(c&&T&&O){const e=Array.isArray(w)?w:[],t=(null!==(n=c.selectedFolder)&&void 0!==n?n:null)===(null!=m?m:null),r=function(e,t){return e.length===t.length&&e.every((e,r)=>{var n;return e.id===(null===(n=t[r])||void 0===n?void 0:n.id)})}(c.pathHistory,e);t&&r||(T(c.selectedFolder),O(c.pathHistory.map(e=>Object.assign({},e))),s.onPathChange&&s.onPathChange(c.pathHistory.map(e=>e.name)))}const u=No(null==a?void 0:a.code,f),d=null!=e?e:{folderId:m||"",itemType:"all"},g=void 0!==d.folderId&&""!==d.folderId?d.folderId:m||"",v=Array.isArray(w)?w.map(e=>Object.assign({},e)):[],y=null===(i=d.folderName)||void 0===i?void 0:i.trim(),b=y&&y.length>0?y:await Va({folderId:g,dataProviders:P,folders:Array.isArray(x)?x:[],pathHistory:v,t:f}),C=f("Failed to load files"),_=f("Failed to load files in folder",{folderName:b}),k=u&&u!==C?u:void 0;p.error({id:"FILES_FETCH_FAILED",message:_,description:k,placement:"bottomRight",innerException:o,notificationDedupe:!0,data:{params:Object.assign(Object.assign({},d),{folderName:b}),folderName:b}})}finally{null==A||A(!1)}},[P,k,A,T,O,M,h,m,x,p,f,w,s]),N=c(e=>L(e),[L]),j=c(async(e,t)=>{var r;if(!(null==P?void 0:P.findFileByUrl))return null;const n=$a(e);try{return null!==(r=await P.findFileByUrl(n))&&void 0!==r?r:null}catch(e){return console.warn("findFileByUrl failed, falling back to direct loading",e),null}},[P]),D=c(async(e,t)=>{var r,n;Jo(e,f);const i=$a(e),o=await j(i,t);if(o)return{kind:"existing",file:o,normalizedUrl:i};let a,l,c;const u=null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.handleFileProxy,d=null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.handleProxyUrl,h=function(e){if("undefined"==typeof window)return!1;try{return new URL(e).origin===window.location.origin}catch(e){return!1}}(i);if(!h&&u)try{const e=Za(await Promise.resolve(u(i)),f);a=e.blob,l=e.mimeType}catch(e){c=e,console.warn("handleFileProxy failed or returned a non-image blob, falling back to next strategy",e)}if(!h&&!a&&d)try{const e=await Promise.resolve(d(i)),t=Za(await Ka(e),f);a=t.blob,l=t.mimeType}catch(e){c=e,console.warn("handleProxyUrl fetch failed or returned a non-image blob, falling back to direct fetch",e)}if(!a)try{const e=Za(await Ka(i),f);a=e.blob,l=e.mimeType}catch(e){c=e}if(!a||!l)throw c instanceof Error?c:new Xo(f("Failed to download file from the URL."),"UploadUrlDownloadFailed");const p=Fr(l),g=Ya(i)||"uploaded-file",m=g.replace(/\.[^.]+$/,"")||"uploaded-file";return{kind:"blob",blob:a,normalizedUrl:i,mimeType:l,extension:p,fileName:Br(g.includes(".")?g:`${m}.${p}`,null==s?void 0:s.config)}},[j,null==s?void 0:s.config,f]),z=c(async(e,t)=>{var r,n,i,o;Jo(e,f);const a=$a(e);try{const e=await D(a,t);if("existing"===e.kind)return e.file;return{thumbnail:await qa(e.blob),name:e.fileName,type:e.mimeType,extension:e.extension,size:e.blob.size,sourceUrl:e.normalizedUrl,saveWithoutFolder:!0}}catch(e){let u=e;if(null==P?void 0:P.uploadFileByUrl)try{const e=null!=m?m:"",t=Br(Ya(a)||"uploaded-file",null==s?void 0:s.config),i=await R(t,e,!1),o=await P.uploadFileByUrl({url:a,folderId:e,name:i,eventSource:"pixie"}),l=Za(null!==(r=(null==o?void 0:o.id)&&P.getFileData?await P.getFileData(o.id):void 0)&&void 0!==r?r:(null==o?void 0:o.url)?await Ka(o.url):(null==o?void 0:o.thumbnailUrl)?await Ka(o.thumbnailUrl):(null==o?void 0:o.sourceUrl)?await Ka(o.sourceUrl):void 0,f),c=await qa(l.blob);return Object.assign(Object.assign({},o),{thumbnail:c,type:o.type||l.mimeType,extension:o.extension||Fr(l.mimeType),size:null!==(n=o.size)&&void 0!==n?n:l.blob.size,sourceUrl:o.sourceUrl||a})}catch(e){u=e,console.warn("Failed to prepare file for Pixie via uploadByUrl fallback",e)}const d=Do(u),h=(l=null==d?void 0:d.code,c="UploadUrlDownloadFailed","string"==typeof l?l:c),g=u instanceof Xo?u:new Xo(null!==(o=null!==(i=No(h,f))&&void 0!==i?i:null==d?void 0:d.message)&&void 0!==o?o:f("Failed to download file from the URL."),h,null==d?void 0:d.status);throw g.notificationShown=!0,await p.error({id:"EDITOR_PROXY_FILE_FAILED",message:g.message,placement:"bottomRight",data:{url:a,folderId:m||null,error:d,eventSource:"pixie"},innerException:u},t),g}var l,c},[P,p,null==s?void 0:s.config,D,R,m,f]),B=c(async e=>{const t=C.current;try{const r=_.current.find(t=>t.id===e),n=e=>{if(!e)return;const t=b.find(t=>t.id===e);return null==t?void 0:t.name};await g({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:m,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===b.length&&(o=i.current>1?i.current-1:1),await N({folderId:m||"",page:o,limit:t.pageSize,sortBy:u,sortOrder:d})}catch(t){console.error("ОError when deleting a file:",t);const r=t;(null==r?void 0:r.notificationShown)||p.error({id:"FILES_DELETE_ERROR",message:f("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:m||null,errors:[{itemId:e,error:Do(t)}]}})}},[g,N,m,f,p,b,u,d]),U=c(async e=>{try{const t=C.current;if(!(null==P?void 0:P.deleteFolder))return void p.error({id:"FOLDER_DELETE_ERROR",message:f("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await P.deleteFolder(e)){const e=new Error("Не удалось удалить папку");throw e.notificationShown=!1,e}p.success({id:"FOLDER_DELETE_SUCCESS",message:f("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}});m===e?await N({page:t.current,limit:t.pageSize,sortBy:u,sortOrder:d}):await N({folderId:m||"",sortBy:u,sortOrder:d,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)||p.error({id:"FOLDER_DELETE_ERROR",message:f("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:Do(t)}]}})}},[P,m,p,f,N,u,d]),V=c(async(e,t)=>{var r,n;try{if(null==P?void 0:P.getFileData){const t=await P.getFileData(e);if(t)return t;throw new Error(f("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(f("Error loading image"));return await t.blob()}}catch(i){console.error("Error when loading a file:",i);const o=_.current.find(t=>t.id===e);t||p.error({id:"FILE_DOWNLOAD_FAILED",message:f("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,notificationDedupe:!1,data:{itemId:e,itemName:(null==o?void 0:o.name)||e,folderId:null!==(r=null==o?void 0:o.folderId)&&void 0!==r?r:null,thumbnail:null!==(n=null==o?void 0:o.thumbnail)&&void 0!==n?n:null}},t)}},[P,p,f]),H=c(async(e,t,r,n)=>{var i,a,l,c,u,d,h,g,v,y,b,w,x,C;if("Trash"===(n?"":null!=t?t:m||""))throw new Error(f("Upload to Trash is forbidden"));const _=Br(e.name,null==s?void 0:s.config),S=_.split(".").pop()||"",k=n?"":null!=t?t:m||"";let A=e;try{if(Or(e)){const t=null!==(a=null===(i=null==s?void 0:s.config)||void 0===i?void 0:i.compressMaxSize)&&void 0!==a?a:Ma.MAX_SIZE_MB,r=null!==(c=null===(l=null==s?void 0:s.config)||void 0===l?void 0:l.compressMaxWidthOrHeight)&&void 0!==c?c:2e3,n=null!==(d=null===(u=null==s?void 0:s.config)||void 0===u?void 0:u.compessorUrl)&&void 0!==d?d:null===(h=null==s?void 0:s.config)||void 0===h?void 0:h.compressorUrl,o=(null===(g=e.type)||void 0===g?void 0:g.trim())||Tr(e.name)||e.type;A=await Ua(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:o,fileName:_,libURL:n,enableCompression:Wa(o),convertSvgToPng:!0})}else A=Ga(e,_)}catch(t){console.warn("Image preparation failed, uploading original file",t),A=Ga(e,_)}let I=A.name;const F=Vr(null==s?void 0:s.config);F&&(I=await R(I,k,n)),F&&(A=Ga(A,I));try{if(null==P?void 0:P.uploadFiles)try{const t=await P.uploadFiles({items:[{name:I,size:A.size,type:A.type||e.type,folderId:k,data:A,extension:S,noFolder:n}],folderId:k});if(t.success&&t.detailed&&t.detailed.length>0){const i=t.detailed[0];if(!i.success||!i.data){if(!r){const e=(null==i?void 0:i.error)?String(i.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:_,innerException:null==i?void 0:i.error,data:{itemName:_,folderId:k||null,eventSource:"upload"}})}return void(E&&E(rr))}{const t=i.data;if(t.id){const r=(null!==(v=t.folderId)&&void 0!==v?v:k)||void 0;await N({folderId:r,noFolder:n});let i=o.files.find(e=>e.id===t.id);if(!i)try{i=(await M({folderId:r,noFolder:n,itemType:"file"})).find(e=>e.id===t.id)}catch(e){console.warn("uploadFileWithProvider: не удалось получить свежий список файлов",e)}return E&&E(rr),i||Object.assign(Object.assign({},t),{id:t.id,name:t.name||_,folderId:null!==(b=null!==(y=t.folderId)&&void 0!==y?y:k)&&void 0!==b?b:null,type:A.type||e.type,size:A.size,extension:S||_.split(".").pop()||"",thumbnail:null!==(w=t.thumbnail)&&void 0!==w?w:void 0,url:null!==(x=t.url)&&void 0!==x?x:void 0,thumbnailUrl:null!==(C=t.thumbnailUrl)&&void 0!==C?C:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!r){const e=t.error?String(t.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:_,innerException:t.error,data:{itemName:_,folderId:k||null,eventSource:"upload"}})}return void(E&&E(rr))}return void(E&&E(rr))}catch(e){throw e}if(null==P?void 0:P.uploadFile){const t=await P.uploadFile({name:I,size:A.size,type:A.type||e.type,folderId:k,noFolder:n,data:A,extension:S});return E&&E(rr),t}return void(r||p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=Do(e),n=No(null==t?void 0:t.code,f);return r?void 0:void p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=n?n:f("Failed to upload file"),placement:"bottomRight",description:_,innerException:e,data:{itemName:_,folderId:k||null,error:Do(e),eventSource:"upload"}})}},[P,m,E,o.files,N,M,p,f,null==s?void 0:s.config]),$=c(async(e,t)=>{var r;if(!(null==P?void 0:P.getFolders)||!(null==P?void 0:P.createFolder))return e||"";try{const n=await P.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 P.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||""}},[P]),W=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 $(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[$]);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 W(f,p))&&void 0!==n?n:p)&&void 0!==i?i:null,y=null!==(o=null!=v?v:p)&&void 0!==o?o:null;let b;null===(a=null==m?void 0:m.onStart)||void 0===a||a.call(m,f);try{if(null==m?void 0:m.onProgress){let e=0;b=window.setInterval(()=>{var t;e=Math.min(e+10+Math.floor(Date.now()%10),90),null===(t=null==m?void 0:m.onProgress)||void 0===t||t.call(m,f.name,e)},200)}const e=await g(f,null!=y?y:void 0);return(null==m?void 0:m.onProgress)&&(null===(s=null==m?void 0:m.onProgress)||void 0===s||s.call(m,f.name,100)),null===(l=null==m?void 0:m.onComplete)||void 0===l||l.call(m,f.name),{success:!0,fileName:f.name,fileId:null==e?void 0:e.id,folderId:null!==(u=null!==(c=null==e?void 0:e.folderId)&&void 0!==c?c:y)&&void 0!==u?u:null}}catch(e){const t=e instanceof Error?e.message:String(e);return null===(d=null==m?void 0:m.onError)||void 0===d||d.call(m,f.name,t),{success:!1,fileName:f.name,folderId:null!==(h=null!=y?y:p)&&void 0!==h?h:null,error:t}}finally{void 0!==b&&clearInterval(b)}},[W]);const G=c(async(e,t)=>{var r,n,i,o,a,l,c,u,d,h,g,v,y,b,w,x,C,_,S,k,A,I,F,T,O,M,R,L,N,j,D,z,B,U,V;if(0===e.length)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};null===(r=null==t?void 0:t.onStartBatch)||void 0===r||r.call(t,e);const H=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},$=[];for(let r=0;r<e.length;r++){const v=e[r];if(!Or(v)){const e=await p.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:f("Unsupported file type"),placement:"bottomRight",data:{itemName:v.name,fileType:v.type,folderId:m||null}});null===(n=null==t?void 0:t.onError)||void 0===n||n.call(t,v.name,e.message);continue}const y=Br(v.name,null==s?void 0:s.config);let b=v;try{if(Or(v)){const e=null!==(o=null===(i=null==s?void 0:s.config)||void 0===i?void 0:i.compressMaxSize)&&void 0!==o?o:Ma.MAX_SIZE_MB,t=null!==(l=null===(a=null==s?void 0:s.config)||void 0===a?void 0:a.compressMaxWidthOrHeight)&&void 0!==l?l:2e3,r=null!==(u=null===(c=null==s?void 0:s.config)||void 0===c?void 0:c.compessorUrl)&&void 0!==u?u:null===(d=null==s?void 0:s.config)||void 0===d?void 0:d.compressorUrl,n=(null===(h=v.type)||void 0===h?void 0:h.trim())||Tr(v.name)||v.type;b=await Ua(v,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:n,fileName:y,libURL:r,enableCompression:Wa(n),convertSvgToPng:!0})}else b=Ga(v,y)}catch(e){console.warn("Image preparation failed, uploading original file",e),b=Ga(v,y)}const w=`${Date.now()}-${r}-${Math.random().toString(36).slice(2,8)}`,x=await W(b,m);null===(g=null==t?void 0:t.onStart)||void 0===g||g.call(t,b),$.push({file:b,targetFolderId:x,requestId:w,originalFileName:v.name,originalIndex:r})}const G=$.length;if(0===G)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const q=Vr(null==s?void 0:s.config),Y=new Map;if(q&&(null==P?void 0:P.getFiles)){const e=[...new Set($.map(e=>{var t,r;return null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:""}).filter(e=>null!=e))];for(const t of e)try{const{files:e}=await P.getFiles({folderId:""===t?"":null!=t?t:void 0,itemType:"all",page:1,limit:1e4});let r=(e||[]).map(e=>e.name).filter(e=>!!e);if(null==P?void 0:P.getFolders){const e=(await P.getFolders({parentId:t||null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);r=[...r,...e]}Y.set(t,r)}catch(e){console.warn("Could not fetch files for duplicate check:",e)}}const X=new Map,K=$.map(e=>{const t=q?((e,t)=>{const r=null!=e?e:"";let n=Y.get(r)||[],i=X.get(r);i||(i=new Set(n.map(e=>e.toLowerCase())),X.set(r,i));const o=fi(t,Array.from(i));return i.add(o.toLowerCase()),o})(e.targetFolderId,e.file.name):e.file.name,r=q?Ga(e.file,t):e.file;return Object.assign(Object.assign({},e),{resolvedUploadName:t,uploadFile:r})}),Z=!t,J=1===G&&Z,Q=[],ee=[],te=[],re=[],ne=new Map;let ie=0,oe=0;const ae=null!==(y=null===(v=null==s?void 0:s.config)||void 0===v?void 0:v.maxFileSize)&&void 0!==y?y:52428800,se=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};ie++,Q.push(e),ee.push(null!=n?n:e),await((e,t,r,n)=>{var i;return p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${e} ${f("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:m)&&void 0!==i?i:null,eventSource:"upload"}},n||!Z)})(e,r,n,!l),s&&(null===(o=null==t?void 0:t.onProgress)||void 0===o||o.call(t,e,100),null===(a=null==t?void 0:t.onComplete)||void 0===a||a.call(t,e))},le=async(e,r,n,i)=>{var o;const{emitProgress:a=!0,emitNotification:s=!0,fileSize:l,progressCallbackName:c,progressCallbackIndex:u}=null!=i?i:{};oe++;const d=null!=l?{fileSize:l,maxSize:ae}:void 0,h=await((e,t,r,n,i)=>{var o,a,s,l,c,u,d;const h=Do(r),g=null!==(o=null==i?void 0:i.fileSize)&&void 0!==o?o:null==h?void 0:h.fileSize,v=null!==(s=null!==(a=null==i?void 0:i.maxSize)&&void 0!==a?a:null==h?void 0:h.maxSize)&&void 0!==s?s:ae,y={allowedChars:"a-z A-Z 0-9 . _ -",fileSize:null!=g?ui(Number(g)):void 0,maxSize:null!=v?ui(Number(v)):void 0},b=null==h?void 0:h.code,w="BatchItemLimitExceeded"===b||"exceeded_max_files"===b?b:null!==(l=jo(null==h?void 0:h.message))&&void 0!==l?l:b,x="BatchItemLimitExceeded"===w||"exceeded_max_files"===w?zo(r,f):No(w,f,y),C=(null==h?void 0:h.message)&&"string"==typeof h.message&&h.message.length>0?h.message:null,_=r instanceof Error?r.message:"string"==typeof r?r:null,S=_&&"[object Object]"!==_?_:null;return p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!==(u=null!==(c=null!=C?C:x)&&void 0!==c?c:S)&&void 0!==u?u:f("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(d=null!=t?t:m)&&void 0!==d?d:null,error:Do(r),eventSource:"upload"},innerException:r},n||!Z)})(e,r,n,!s,d);a&&(null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,null!=c?c:e,h.message,u)),re.push({itemId:void 0,itemName:e,error:Do(n)}),te.push({fileName:e,error:h.message})};let ce;if(!(null==P?void 0:P.uploadFiles))return p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:G,successes:[],errors:[],totalCount:G};{const e=[];try{(null==t?void 0:t.onProgress)&&$.forEach(r=>{let n=0;const i=window.setInterval(()=>{var e;n=Math.min(n+10+Math.floor(Date.now()%10),90),null===(e=null==t?void 0:t.onProgress)||void 0===e||e.call(t,r.file.name,n)},200);e.push(i)}),ce=await P.uploadFiles({items:K.map(e=>{var t,r;return{requestId:e.requestId,name:e.resolvedUploadName,size:e.uploadFile.size,type:e.uploadFile.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:null,data:e.uploadFile,extension:e.uploadFile.name.split(".").pop()||""}}),folderId:null!=m?m:null}),e.forEach(e=>window.clearInterval(e)),e.length=0;const r=null!==(b=ce.detailed)&&void 0!==b?b:[],n=new Map(r.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(r.length>0)for(let e=0;e<K.length;e++){const t=K[e],i=null!==(w=t.requestId?n.get(t.requestId):void 0)&&void 0!==w?w:r[e];if(i&&i.success){const e=i.data,r=null!==(x=null==e?void 0:e.name)&&void 0!==x?x:t.resolvedUploadName,n=null!==(S=null!==(_=null!==(C=null==e?void 0:e.folderId)&&void 0!==C?C:t.targetFolderId)&&void 0!==_?_:m)&&void 0!==S?S:null,o=null==e?void 0:e.id;ne.set(r,{id:o,name:r,folderId:n,size:null==e?void 0:e.size,originalFileName:t.originalFileName,originalIndex:t.originalIndex}),await se(r,n,o,{emitNotification:J})}else{const e=null==i?void 0:i.data,r=null!==(k=null==e?void 0:e.name)&&void 0!==k?k:t.resolvedUploadName,n=null!==(F=null!==(I=null!==(A=null==e?void 0:e.folderId)&&void 0!==A?A:t.targetFolderId)&&void 0!==I?I:m)&&void 0!==F?F:null;await le(r,n,null!==(T=null==i?void 0:i.error)&&void 0!==T?T:new Error(f("Error uploading file")),{emitNotification:J,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}else if(ce.success)for(const e of K){const t=e.resolvedUploadName,r=null!==(M=null!==(O=e.targetFolderId)&&void 0!==O?O:m)&&void 0!==M?M:null;await se(t,r,void 0,{emitNotification:J})}else{const e=null!==(R=ce.error)&&void 0!==R?R:new Error(f("Error uploading file"));for(const t of K){const r=t.resolvedUploadName,n=null!==(N=null!==(L=t.targetFolderId)&&void 0!==L?L:m)&&void 0!==N?N:null;await le(r,n,e,{emitNotification:J,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}}catch(e){for(const t of K){const r=t.resolvedUploadName,n=null!==(D=null!==(j=t.targetFolderId)&&void 0!==j?j:m)&&void 0!==D?D:null;await le(r,n,null!=e?e:new Error(f("Error uploading file")),{emitNotification:J,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{e.forEach(e=>window.clearInterval(e))}}if(ie>0&&(E&&E(rr),G>1&&Z)){const e=H(Q),t=e?f("Uploaded",{names:e}):f("uploads_success_summary",{successCount:ie,totalCount:G});p.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:ie,totalCount:G,itemIds:ee,itemNames:Q,folderId:null!=m?m:null,eventSource:"upload"}})}if(oe>0&&Z&&!J)if(G>1){const e=te.map(e=>e.fileName),t=H(e),r=t?f("Failed",{names:t}):f("uploads_fail_summary",{failCount:oe,totalCount:G});p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:oe,totalCount:G,itemNames:e,folderId:null!=m?m:null,errors:re,eventSource:"upload"}})}else if(1===G&&re.length>0&&(null===(z=re[0].error)||void 0===z?void 0:z.code)){const e=No(null===(B=re[0].error)||void 0===B?void 0:B.code,f),t=null!==(V=null===(U=te[0])||void 0===U?void 0:U.fileName)&&void 0!==V?V:"",r=null!=e?e:t?`${f("Failed to upload files")}: ${t}`:f("Failed to upload files");p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:oe,totalCount:G,itemNames:[t],folderId:null!=m?m:null,errors:re,eventSource:"upload"}})}return{successCount:ie,failCount:oe,successes:Q,errors:te,totalCount:G,uploadedFiles:ne.size>0?ne:void 0}},[P,null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient,p,W,m,E,f,null==s?void 0:s.config]),q=c(async e=>{var t;if(!(null==P?void 0:P.uploadFiles))return void p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===m)return void p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}});const r=C.current,n=document.createElement("input");n.type="file",n.accept="image/*",n.multiple=!0;try{!(!(null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.features)||!s.config.features.enableDirectoryUpload)&&(n.webkitdirectory=!0)}catch(e){}n.onchange=async t=>{var n;const i=t.target.files;if(!i||0===i.length)return;const o=Array.from(i);try{null==A||A(!0);const{successes:t,errors:i,uploadedFiles:a}=await G(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 h(),await N({folderId:m||"",sortBy:u,sortOrder:d,page:r.current,limit:r.pageSize})}catch(e){console.error("Error when loading files:",e)}finally{null==A||A(!1)}},n.click()},[null==P?void 0:P.uploadFiles,m,p,f,A,N,h,u,d,G,null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.features]),Y=c(async(e,t,r,n="uploadByUrl")=>{const i=C.current,o=Boolean(e&&String(e).trim());let a,l=null!=e?e:null;try{if(!t&&"Trash"===m)throw r||p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}}),new Xo(f("Cannot upload files to Trash"),"UploadUrlDownloadFailed");let e,c;if(!l&&v&&(e=await v.validateFields(),l=null==e?void 0:e.fileUrl),!l)throw r||p.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:f("Please fill in all fields"),placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,eventSource:n}}),new Xo(f("Please fill in all fields"),"UploadUrlInvalid");if(Jo(l,f),l=$a(l),null==A||A(!0),l){const e=l.split("?")[0].split("#")[0].split("/");c=e[e.length-1]||"uploaded-file",c=Br(c,null==s?void 0:s.config)}const h=t?"":m||"",g=Boolean((null==P?void 0:P.uploadFiles)||(null==P?void 0:P.uploadFile)),y=Boolean(null==P?void 0:P.uploadFileByUrl);let b=c;b&&y&&(b=await R(b,h,t));try{const e=await D(l,r);if("existing"===e.kind)a=e.file;else if(g){const r=new File([e.blob],e.fileName,{type:e.mimeType,lastModified:Date.now()});try{a=await H(r,h,!0,t)}catch(e){throw e.uploadUrlStage="binaryUpload",e}if(!a){const e=new Xo(f("Failed to upload file"),"FileUploadBackendError");throw e.uploadUrlStage="binaryUpload",e}}else{if(!y)throw r||p.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:f("Upload by URL is not supported"),placement:"bottomRight",data:{url:l,folderId:m||null,eventSource:n}}),new Xo(f("Upload by URL is not supported"),"UploadUrlDownloadFailed");a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}}catch(e){const r=e;if("binaryUpload"===(null==r?void 0:r.uploadUrlStage)||!y)throw e;console.warn("Failed to fetch file by URL locally, falling back to uploadByUrl",e),a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}const w=(null==e?void 0:e.name)||(null==a?void 0:a.name)||"unnamed file";return a&&p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${w} ${f("successfully uploaded")}`,placement:"bottomRight",data:{itemName:w,itemId:null==a?void 0:a.id,folderId:m||null,eventSource:n}},r),(e||o)&&(null==I||I(!1),null==v||v.resetFields()),E&&E(rr),await N({folderId:m||"",noFolder:t,sortBy:u,sortOrder:d,page:i.current,limit:i.pageSize}),a}catch(e){if(console.error("Error when loading a file by URL:",e),!r){const t=Do(e),r=t,i=e,o=Number(null==r?void 0:r.fileSize),a=Number(null==r?void 0:r.maxSize),s=Number.isFinite(o)&&Number.isFinite(a)?{fileSize:o,maxSize:a}:void 0,c="binaryUpload"===(null==i?void 0:i.uploadUrlStage)?zo(t,f,s):Vo(t,f);p.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:c,placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,error:t,eventSource:n},innerException:e})}throw e}finally{null==A||A(!1)}},[v,A,P,p,f,I,E,N,m,u,d,R,D,H,null==s?void 0:s.config]),X=c(async e=>{if(!e.length)return;const t=C.current;"Trash"!==m?(await G(e),await N({folderId:m||"",sortBy:u,sortOrder:d,page:t.current,limit:t.pageSize})):p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}})},[N,m,u,d,G,p,f]);return{fetchFiles:N,handleDeleteFile:B,handleDeleteFolder:U,handleAddFile:q,handleAddFileByUrl:Y,handleDroppedFiles:X,getFileData:V,findFileByUrl:j,resolveFileForEditByUrl:z,uploadFileWithProvider:H}},Qa=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,i,o);return o},es=e=>e;const ts=e=>{const t=(e=>e?Qa(e):Qa)(e),r=e=>function(e,t=es){const r=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(r),r}(t,e);return Object.assign(r,t),r};function rs(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const ns=(is=e=>({selectedFiles:new Set,visibleFileIds:[],anchorId:null,multiSelect:!0,setMultiSelect:t=>{e(e=>{var r;if(e.multiSelect===t)return e;if(t)return{multiSelect:!0};const n=null!==(r=Array.from(e.selectedFiles)[0])&&void 0!==r?r:null;return{multiSelect:!1,selectedFiles:n?new Set([n]):new Set,anchorId:n}})},syncVisibleFiles:t=>{const r=Array.isArray(t)?t.map(e=>e.id):[];e(e=>{const t=new Set(r),n=new Set(Array.from(e.selectedFiles).filter(e=>t.has(e))),i=e.anchorId&&t.has(e.anchorId)?e.anchorId:null,o=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}(e.visibleFileIds,r),a=rs(e.selectedFiles,n),s=e.anchorId===i;return o&&a&&s?e:{visibleFileIds:r,selectedFiles:n,anchorId:i}})},setSelectedFiles:t=>{e(e=>{var r;const n=new Set(e.visibleFileIds),i=new Set(Array.from(t).filter(e=>n.has(e)));return rs(e.selectedFiles,i)?e:{selectedFiles:i,anchorId:null!==(r=Array.from(i)[0])&&void 0!==r?r:null}})},clearSelection:()=>{e(e=>0===e.selectedFiles.size&&null===e.anchorId?e:{selectedFiles:new Set,anchorId:null})},selectAllVisible:()=>{e(e=>{var t;const r=new Set(e.visibleFileIds),n=null!==(t=e.visibleFileIds[0])&&void 0!==t?t:null;return rs(e.selectedFiles,r)&&e.anchorId===n?e:{selectedFiles:r,anchorId:n}})},toggleFileSelection:(t,r)=>{e(e=>{const n=!1!==e.multiSelect,i=Boolean(null==r?void 0:r.shiftKey)&&n,o=Boolean(null==r?void 0:r.metaKey)||Boolean(null==r?void 0:r.ctrlKey)||Boolean(null==r?void 0:r.forceToggle),a=e.visibleFileIds,s=new Set(a);if(a.length>0&&!s.has(t))return e;if(!n){const r=new Set([t]);return rs(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(i&&e.anchorId&&s.has(e.anchorId)){const r=a.indexOf(e.anchorId),n=a.indexOf(t);if(-1===r||-1===n)return e;const[i,s]=r<n?[r,n]:[n,r],l=a.slice(i,s+1),c=o?new Set(e.selectedFiles):new Set;return l.forEach(e=>{c.add(e)}),rs(e.selectedFiles,c)?e:{selectedFiles:c}}if(i&&!e.anchorId){const r=new Set([t]);return rs(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(o){const r=new Set(e.selectedFiles);return r.has(t)?r.delete(t):r.add(t),rs(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}const l=new Set([t]);return rs(e.selectedFiles,l)&&e.anchorId===t?e:{selectedFiles:l,anchorId:t}})}}),is?ts(is):ts);var is;const os=e=>{var t,r,n,i;const{state:o,actions:a,options:s}=mo(),{t:l}=Kn(),u=qo(),d=Mo(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=mo(),{dataProviders:t}=e,{t:r}=Kn(),n=c(async({itemId:n,newName:i,isFolder:o})=>{var a,s,l,c,u,d,h,f;try{if(o){if(!(null==t?void 0:t.renameFolder))throw new Error(r("renameFolder is not implemented in dataProviders"));const o=Ur(i.trim(),e.config),c=await t.renameFolder(n,o);return{success:!0,renamedItem:{id:c.id,name:null!==(a=c.name)&&void 0!==a?a:o,parentId:null!==(s=c.parentId)&&void 0!==s?s:null,folderId:null!==(l=c.parentId)&&void 0!==l?l:null}}}if(!(null==t?void 0:t.renameFile))throw new Error(r("renameFile is not implemented in dataProviders"));const p=Br(i,e.config),g=await t.renameFile(n,p);return{success:!0,renamedItem:{id:null!==(c=null==g?void 0:g.id)&&void 0!==c?c:n,name:null!==(u=null==g?void 0:g.name)&&void 0!==u?u:p,folderId:null!==(d=null==g?void 0:g.folderId)&&void 0!==d?d:null,parentId:null!==(f=null!==(h=null==g?void 0:g.parentId)&&void 0!==h?h:null==g?void 0:g.folderId)&&void 0!==f?f:null}}}catch(e){return{success:!1,error:Do(e)}}},[t,r,e.config]);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},k=(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)}},A=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:k(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:k(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]),I=c(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),E=c(async()=>{var t,r,n,i,o,s,c,u,y,w,x,C;if(!m||!v)return;const S=null==p?void 0:p.find(e=>e.id===m);try{const p=await v.validateFields();if(!(null==p?void 0:p.newFileName))return;const A=(null==S?void 0:S.isFolder)||m.startsWith("folder_");if(A){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:k(S,m)})}else{if(!(!1!==(null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile)))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:l("File rename is disabled by config"),placement:"bottomRight",data:k(S,m)})}const E=await f({itemId:m,newName:p.newFileName,isFolder:A});if(!E.success){const e=No(null===(n=E.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=E.error)||void 0===i?void 0:i.message)&&void 0!==o?o:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{error:E.error}),innerException:E.error})}const F=E.renamedItem;A?(d.success({id:"FOLDER_RENAME_SUCCESS",message:l(`${l("Folder renamed to")} ${null!==(s=null==F?void 0:F.name)&&void 0!==s?s:p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(c=null==F?void 0:F.id)&&void 0!==c?c:m,itemName:null!==(u=null==F?void 0:F.name)&&void 0!==u?u:p.newFileName,folderId:null!==(w=null!==(y=null==F?void 0:F.parentId)&&void 0!==y?y:null==F?void 0:F.folderId)&&void 0!==w?w:null}}),await h(),(null==F?void 0:F.id)&&F.id!==m&&a.setSelectedFolder&&a.setSelectedFolder(F.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${l("File renamed to")} ${null!==(x=null==F?void 0:F.name)&&void 0!==x?x:p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{itemName:null!==(C=null==F?void 0:F.name)&&void 0!==C?C:p.newFileName})}),I(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){console.error("Error when renaming:",e);const t=Do(e),r=No(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({},k(S,m)),{error:t}),innerException:e})}},[m,v,p,a,I,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:A,handleRenameCancel:I,handleRenameOk:E}}},as=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}},ss=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),ls=(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}),cs=()=>{const e=Mo(),{t:t}=Kn(),{state:r,options:n}=mo(),{folders:i,pathHistory:o}=r,{dataProviders:a}=n,{actions:{fetchFolders:s,fetchChildFolders:l}}=qo();return{refreshFolders:c(async({parentIds:r,selectedFolder:n})=>{try{if(await s(),r&&l)for(const e of r)e&&await l(e)}catch(r){console.error("Error when updating the folder tree:",r);const n=t("Folders");e.error({id:"FOLDERS_FETCH_FAILED",message:t("Failed to refresh folder tree"),description:n,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{folderId:null,folderName:n,reason:r instanceof Error?r.message:String(r)}})}},[e,t,s,l]),refreshFiles:c(async({fetchFiles:r,selectedFolder:n,page:s,limit:l})=>{try{await r({folderId:n||"",page:s,limit:l})}catch(r){console.error("Ошибка при обновлении списка файлов:",r);const c=await Va({folderId:n||"",dataProviders:a,folders:Array.isArray(i)?i:[],pathHistory:o,t:t}),u=t("Failed to load files"),d=r instanceof Error?r.message:String(r);e.error({id:"FILES_FETCH_FAILED",message:t("Failed to load files in folder",{folderName:c}),description:d&&d!==u?d:void 0,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{params:{folderId:n||void 0,page:s,limit:l,folderName:c},folderName:c}})}},[e,t,a,i,o])}},us=e=>{var t;const{state:r,actions:n,options:i}=mo(),{t:o}=Kn(),a=Mo(),s=ns(e=>e.selectedFiles),l=ns(e=>e.clearSelection),{files:u,selectedFolder:d,moveForm:h,pagination:f,currentMenuFile:p}=r,{setIsMoveModalVisible:g,setPagination:m}=n,{dataProviders:v}=i,{moveItems:y}=(()=>{const{options:e}=mo(),{dataProviders:t}=e,{t:r}=Kn(),n=Mo(),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=Do(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=Do(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Do(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:b,refreshFiles:w}=cs(),{getItemNameById:x,getItemNamesByIds:C,getNamesPreview:_}=as(u),S=c(()=>{null==g||g(!0)},[g]),k=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),A=c(async t=>{var r,n,c,g,S,A,I,E;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const F=u.length,T=Object.assign({},f),O=Array.from((null==p?void 0:p.length)?[p]:s),P=O.length;let M=0,R=0;const L=[],N=O.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),j=N.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,f=null!=u?u:d,p=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(p&&(null==v?void 0:v.getFolders))try{const e=await v.getFolders({parentId:u,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const e of N){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||x(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_MOVE",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for move:",e)}if(p&&(null==v?void 0:v.getFiles)&&(null==v?void 0:v.renameFile))try{let e=[];if(null==v?void 0:v.getFiles){const{files:t}=await v.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(null==v?void 0:v.getFolders){const t=(await v.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const t=new Set(e.map(e=>null==e?void 0:e.toLowerCase()).filter(Boolean));for(const e of N){if(e.isFolder||(null===(S=(g=e.id).startsWith)||void 0===S?void 0:S.call(g,"folder_")))continue;const r=e.name||x(e.id)||"";if(!r||!t.has(r.toLowerCase())){t.add(r.toLowerCase());continue}const n=fi(r,Array.from(t));await v.renameFile(e.id,n),t.add(n.toLowerCase())}}catch(e){console.warn("Could not check duplicates for move:",e)}const D=await y({items:N,targetFolderId:s,getItemNameById:x,showNotifications:!1});if(M=D.successCount,R=D.failCount,L.push(...D.errorDetails),M>0){const e=C(O),t=_(e),r=t?o("Moved",{names:t}):o("move_success_summary",{successCount:M,totalCount:P});a.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:ss(O,M,P,u,e)})}if(R>0){const e=C(O),t=_(e);let r;if(1===P&&L.length>0&&(null===(A=L[0].error)||void 0===A?void 0:A.code)){const e=No(null===(I=L[0].error)||void 0===I?void 0:I.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P})}else r=t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P});a.error({id:"FILES_MOVE_ERROR",message:r,placement:"bottomRight",innerException:L.length?L:void 0,data:ls(O,R,P,u,L.length?L:void 0,e)})}k(),l();let z=T.current;if(M>0&&F>0&&M>=F&&T.current>1&&(z=T.current-1),M>0&&T.total>=M){const e=Math.max(0,(null!==(E=T.total)&&void 0!==E?E:0)-M);null==m||m({current:z,pageSize:T.pageSize,total:e})}j&&await b({parentIds:void 0,selectedFolder:f}),await w({fetchFiles:e,selectedFolder:d,page:z,limit:T.pageSize})}catch(e){console.error("Error when moving:",e);const t=No(Do(e).code,o);a.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=t?t:o("Error moving"),placement:"bottomRight",data:ls(O,P,P,d||null,[{error:Do(e)}],C(O))})}},[p,s,h,e,d,f,u,a,m,o,y,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==v?void 0:v.getFiles,null==v?void 0:v.renameFile,x]);return{actions:{showMoveModal:S,handleMoveCancel:k,handleMoveOk:A}}},ds=e=>{var t;const{state:r,actions:n,options:i}=mo(),{t:o}=Kn(),a=Mo(),s=ns(e=>e.selectedFiles),l=ns(e=>e.clearSelection),{files:u,selectedFolder:d,copyForm:h,pagination:f,currentMenuFile:p}=r,{setIsCopyModalVisible:g}=n,{dataProviders:m}=i,{copyItems:v}=(()=>{const{options:e}=mo(),{dataProviders:t}=e,{t:r}=Kn(),n=Mo(),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=>({id:e.id,newName:e.newName}))),n=r.detailed;if(n){const e=n.filter(e=>e.success),t=n.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),r=e.error,n=Do(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=Do(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Do(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,newName:r.newName})?s++:l++}catch(e){l++;const t=Do(e);c.push({itemId:r.id,itemName:o(r.id),error:t})}else l+=e.length,c.push({error:{message:"Copy provider is not configured"}});return a&&(s>0&&n.success({id:"FILES_COPY_SUCCESS",message:r("Files copied"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&n.error({id:"FILES_COPY_ERROR",message:r("Errors occurred while copying"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,n,r]);return{copyItems:i}})(),{refreshFolders:y,refreshFiles:b}=cs(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=as(u),_=c(()=>{null==g||g(!0)},[g]),S=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),k=c(async t=>{var r,n,c,g,_;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const k=Array.from((null==p?void 0:p.length)?[p]:s),A=k.length;let I=0,E=0;const F=[],T=k.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),O=T.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,p=null!=u?u:d;let P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const M=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(M&&(null==m?void 0:m.getFolders))try{const e=await m.getFolders({parentId:u,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const e of T){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||w(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_COPY",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for copy:",e)}if(M&&(null==m?void 0:m.getFiles))try{let e=[];const{files:t}=await m.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),null==m?void 0:m.getFolders){const t=(await m.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const r=[...e];P=T.map(e=>{var t,n;if(e.isFolder||(null===(n=(t=e.id).startsWith)||void 0===n?void 0:n.call(t,"folder_")))return{id:e.id,isFolder:!0};const i=T.find(t=>t.id===e.id),o=(null==i?void 0:i.name)||w(e.id)||"",a=fi(o,r);return r.push(a),{id:e.id,isFolder:!1,newName:a!==o?a:void 0}})}catch(e){console.warn("Could not check duplicates for copy:",e)}else P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const R=await v({items:P,targetFolderId:s,getItemNameById:w,showNotifications:!1});if(I=R.successCount,E=R.failCount,F.push(...R.errorDetails),I>0){const e=x(k),t=C(e),r=t?o("Copied",{names:t}):o("copy_success_summary",{successCount:I,totalCount:A});a.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:ss(k,I,A,u,e)})}if(E>0){const e=x(k),t=C(e);let r;if(1===A&&F.length>0&&(null===(g=F[0].error)||void 0===g?void 0:g.code)){const e=No(null===(_=F[0].error)||void 0===_?void 0:_.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A})}else r=t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A});a.error({id:"FILES_COPY_ERROR",message:r,placement:"bottomRight",innerException:F.length?F:void 0,data:ls(k,E,A,u,F.length?F:void 0,e)})}S(),l(),O&&await y({parentIds:void 0,selectedFolder:p}),await b({fetchFiles:e,selectedFolder:d,page:f.current,limit:f.pageSize})}catch(e){console.error("Error when copying:",e);const t=No(Do(e).code,o);a.error({id:"FILES_COPY_ERROR",message:null!=t?t:o("Error copying"),innerException:e,placement:"bottomRight",data:ls(k,A,A,d||null,[{error:Do(e)}],x(k))})}},[p,s,h,e,d,f,u,a,o,v,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==m?void 0:m.getFiles,w]);return{actions:{showCopyModal:_,handleCopyCancel:S,handleCopyOk:k}}},hs=e=>{const t=os(e),r=us(e),n=ds(e),i=(e=>{const{state:t,actions:r,options:n}=mo(),{t:i}=Kn(),o=Mo(),a=ns(e=>e.selectedFiles),s=ns(e=>e.clearSelection),{files:l,selectedFolder:u,pagination:d,currentMenuFile:h}=t,{setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=Yo(),{refreshFolders:y,refreshFiles:b}=cs(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=as(l),_=c(()=>{null==f||f(!0)},[f]),S=c(()=>{null==f||f(!1)},[f]),k=c(async()=>{var t,r,n;if(!((null==h?void 0:h.length)||a&&0!==a.size))return void(null==f||f(!1));const c=l.length,_=Object.assign({},d),S=Array.from(h?[h]:a),k=S.map(e=>l.find(t=>t.id===e)).filter(e=>Boolean(e)),A=new Set;k.forEach(e=>{(null==e?void 0:e.isFolder)&&A.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 I=0,E=0;const F=[];try{const a=await v({items:k,selectedFolder:u,getItemNameById:w,showNotifications:!1});I=a.successCount,E=a.failCount,F.push(...a.errorDetails);const l=(null==m?void 0:m.enableTrashFolder)&&"Trash"===u;if(I>0&&(null==m?void 0:m.enableTrashFolder)&&!l&&(null==p||p({itemIds:S,sourceFolderId:u||"folders"})),I>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:I}),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}}):await o.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}})}if(E>0){const e=x(S),n=C(e),a=S.length,s=1===a&&F.length>0&&(null===(t=F[0].error)||void 0===t?void 0:t.code),c=(null==m?void 0:m.enableTrashFolder)&&!l,u=i(c?"При перемещении в корзину произошли ошибки":"При удалении произошли ошибки"),d=s?No(null===(r=F[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:F.length?F:void 0,data:{failCount:E,isTrashMove:c,totalCount:a,itemNames:e,errors:F.length?F:void 0}})}s(),null==f||f(!1),await y({parentIds:Array.from(A),selectedFolder:u});let d=_.current;if(I>0&&c>0&&I>=c&&_.current>1&&(d=_.current-1),I>0&&_.total>=I){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-I);null==g||g({current:d,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:u,page:d,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:E,totalCount:k.length}})}},[h,a,f,e,u,d,p,g,l,i,o,v,s,null==m?void 0:m.enableTrashFolder]);return{actions:{showDeleteConfirm:_,handleDeleteConfirmCancel:S,handleDeleteConfirmOk:k}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),r.actions),n.actions),i.actions)}},fs=()=>{const{state:e}=mo(),{files:t,loading:r,isUrlModalVisible:n}=e,i=Ja(),o=(()=>{const{state:e}=mo(),t=e.multiSelect,r=ns(e=>e.selectedFiles),n=ns(e=>e.toggleFileSelection),i=ns(e=>e.setMultiSelect);return a(()=>{i(!1!==t)},[t,i]),{state:{selectedFiles:r},actions:{toggleFileSelection:n}}})(),s=hs(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.state.selectedFiles,loading:r||!1,isAddingFileByUrl:n||!1,isRenamingFile:s.state.isRenamingFile,fileToRename:s.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:o.actions.toggleFileSelection,showRenameModal:s.actions.showRenameModal,handleRenameCancel:s.actions.handleRenameCancel,handleRenameOk:s.actions.handleRenameOk,showMoveModal:s.actions.showMoveModal,handleMoveCancel:s.actions.handleMoveCancel,handleMoveOk:s.actions.handleMoveOk,showCopyModal:s.actions.showCopyModal,handleCopyCancel:s.actions.handleCopyCancel,handleCopyOk:s.actions.handleCopyOk,showDeleteConfirm:s.actions.showDeleteConfirm,handleDeleteConfirmCancel:s.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:s.actions.handleDeleteConfirmOk}}},ps="filemanager_sidebar_width";function gs({maxConcurrent:e=6}={}){const t=u(new Map),r=u([]),n=u(0),i=d(()=>{const i=e=>({status:e.status,shouldLoad:"loading"===e.status||"loaded"===e.status||"error"===e.status}),o=e=>{const t=i(e);e.listeners.forEach(e=>e(t))},a=e=>{0!==r.current.length&&(r.current=r.current.filter(t=>t!==e))},s=(e,r)=>{const n=t.current.get(e);if(!n){const n={id:e,src:r,status:"idle",listeners:new Set,active:!1};return t.current.set(e,n),n}return n.src!==r&&(a(e),n.src=r,n.status="idle"),n},l=()=>{for(;n.current<e&&r.current.length>0;){const e=r.current.shift();if(!e)break;const i=t.current.get(e);i&&i.active&&"queued"===i.status&&(i.status="loading",n.current+=1,o(i))}},c=(e,t)=>{"loading"===e.status&&(e.status=t,n.current=Math.max(0,n.current-1),o(e),l())};return{getSnapshot:(e,t)=>i(s(e,t)),subscribe:(e,r,n)=>{const o=s(e,r);return o.listeners.add(n),n(i(o)),()=>{const r=t.current.get(e);r&&(r.listeners.delete(n),r.active||0!==r.listeners.size||"loading"===r.status||t.current.delete(e))}},setActive:(e,t,i)=>{const c=s(e,t);c.active=i,i?"loaded"!==c.status&&"loading"!==c.status&&"queued"!==c.status?(c.status="queued",o(c),r.current.includes(e)||r.current.push(e),l()):o(c):"queued"===c.status?(a(e),c.status="idle",o(c)):"loading"===c.status&&(n.current=Math.max(0,n.current-1),c.status="idle",o(c),l())},markLoaded:e=>{const r=t.current.get(e);r&&c(r,"loaded")},markError:e=>{const r=t.current.get(e);r&&c(r,"error")},release:e=>{const r=t.current.get(e);r&&(r.active=!1,"queued"===r.status?(a(e),r.status="idle"):"loading"===r.status&&(n.current=Math.max(0,n.current-1),r.status="idle",l()),0===r.listeners.size&&t.current.delete(e))}}},[e]);return a(()=>()=>{r.current=[],t.current.clear(),n.current=0},[]),i}const ms=/(auto|scroll|overlay)/;function vs(e,t){const r=Math.max(0,null!=t?t:e.clientWidth);return Math.max(1,Math.round(r-function(e){if("undefined"==typeof window)return 0;const t=window.getComputedStyle(e);return(Number.parseFloat(t.paddingLeft||"0")||0)+(Number.parseFloat(t.paddingRight||"0")||0)}(e)))}function ys(e){if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return ms.test(t.overflowY)||ms.test(t.overflow)||ms.test(t.overflowX)}function bs(e){if("undefined"==typeof window)return e;let t=e;for(;t;){if(ys(t))return t;t=t.parentElement}return null}function ws(e){if("undefined"==typeof window)return[e];const t=bs(e);return t?t===e?[window,e]:[window,t]:[window]}function xs(e,t,r){Math.max(0,e.clientHeight),Math.max(0,Math.round(e.getBoundingClientRect().height));return Math.max(1,t)}function Cs(e,t){if(e===t){const r=function(e){var t;if("undefined"==typeof window)return Math.max(1,e.clientHeight);const r=e.getBoundingClientRect(),n=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,i=Math.max(0,r.top),o=Math.min(n,r.bottom);return Math.max(0,Math.round(o-i))}(t);return{scrollTop:t.scrollTop,viewportHeight:xs(e,Math.min(t.clientHeight,r||t.clientHeight)),viewportWidth:vs(t),scrollHeight:e.scrollHeight}}const r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=Math.max(r.top,n.top),o=Math.min(r.bottom,n.bottom),a=Math.max(r.left,n.left),s=Math.min(r.right,n.right),l=Math.max(0,Math.round(o-i)),c=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(i-n.top)),viewportHeight:xs(e,l),viewportWidth:vs(e,c||t.clientWidth||e.clientWidth),scrollHeight:e.scrollHeight}}function _s(e){if("undefined"==typeof window)return{scrollTop:e.scrollTop,viewportHeight:Math.max(1,e.clientHeight),viewportWidth:vs(e),scrollHeight:e.scrollHeight};const t=bs(e);return t&&function(e){return e.scrollHeight-e.clientHeight>1}(t)?Cs(e,t):function(e){var t,r;const n=e.getBoundingClientRect(),i=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,o=window.innerWidth||(null===(r=document.documentElement)||void 0===r?void 0:r.clientWidth)||n.width,a=Math.max(0,n.top),s=Math.min(i,n.bottom),l=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(-n.top)),viewportHeight:xs(e,l),viewportWidth:vs(e,Math.min(Math.round(n.width),o)),scrollHeight:e.scrollHeight}}(e)}function Ss(e,t){const r=u(null),n=c(t=>{e(_s(t))},[e]);return a(()=>{r.current&&n(r.current)},[n,...t]),a(()=>{if(!r.current||"undefined"==typeof ResizeObserver)return;const e=r.current,t=new ResizeObserver(()=>{n(e)});return t.observe(e),()=>t.disconnect()},[n]),a(()=>{const e=r.current;if(!e)return;const t=()=>{n(e)},i=ws(e);return i.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{i.forEach(e=>{e.removeEventListener("scroll",t)})}},[n,...t]),r}const ks=({onSearch:t,placeholder:r,className:n})=>{const{t:i}=Kn(),[s,l]=o(""),c=u(null),{options:d}=mo(),{config:h}=d,f=r||i("Search files...");a(()=>(c.current=Io.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(Pi,{size:16,strokeWidth:null==h?void 0:h.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{l(""),t("")}})},As=[{value:"date-desc",labelKey:"Newest first"},{value:"date-asc",labelKey:"Oldest first"},{value:"size-desc",labelKey:"Largest first"},{value:"size-asc",labelKey:"Smallest first"},{value:"name-asc",labelKey:"A-Z"},{value:"name-desc",labelKey:"Z-A"},{value:"type-asc",labelKey:"By type"}];var Is={contentLayout:"contentLayout",headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",emptyStateWrapper:"emptyStateWrapper",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",tableLoadingWrapper:"tableLoadingWrapper",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",buttonSelectAll:"buttonSelectAll",gridRow:"gridRow",gridCard:"gridCard",selectedRow:"selectedRow",gridCardSelected:"gridCardSelected",gridCheckbox:"gridCheckbox",gridCardContent:"gridCardContent",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",gridFileMenu:"gridFileMenu",gridFileMenuButton:"gridFileMenuButton",actionsBox:"actionsBox",uploadContainer:"uploadContainer",uploadArea:"uploadArea",blockText:"blockText",textTitle:"textTitle",textDescription:"textDescription",buttons:"buttons",btnAi:"btnAi",btnPhoto:"btnPhoto",dragOverlay:"dragOverlay",dragOverlayInner:"dragOverlayInner",dragCaptureLayer:"dragCaptureLayer",dragOverlayGlobal:"dragOverlayGlobal",noFiles:"noFiles",noFilesIcon:"noFilesIcon",textTitle_trash:"textTitle_trash",textDescription_trash:"textDescription_trash"};const{Text:Es}=T,{Option:Fs}=O;const Ts=i.memo(({files:r,filesById:n,currentSortOption:i,isSmallScreen:o,iconStrokeWidth:a,multiSelectEnabled:s=!0,features:l,viewMode:c,setViewMode:u,handleSearch:h,handleSortOptionChange:f,sortOptions:p,onClearSelection:g,onRename:m,onDelete:v,onCopy:y,onMove:b,onEdit:w,t:x})=>{const C=d(()=>(null==p?void 0:p.length)?As.filter(e=>p.includes(e.value)):As,[p]),_=d(()=>C.map(e=>e.value).join("|")||"all",[C]),S=ns(e=>e.selectedFiles),k=ns(e=>e.selectedFiles.size),A=ns(e=>e.selectAllVisible),I=r.length>0&&k===r.length,E=d(()=>Array.from(S)[0],[S]),F=d(()=>E?n.get(E):void 0,[n,E]),T=(null==F?void 0:F.isFolder)?!1!==(null==l?void 0:l.enableRenameFolder):!1!==(null==l?void 0:l.enableRenameFile),N=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableMoveFolder):!1!==(null==l?void 0:l.enableMoveItem))}),[l,n,S]),j=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableCopyFolder):!1!==(null==l?void 0:l.enableCopyItem))}),[l,n,S]),D=d(()=>1===k&&function(e){var t,r,n;if(!e||e.isFolder)return!1;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}(F),[k,F]);return t("div",k>0?{className:`header-container ${Is.headerContainer}`,children:[t(Es,{type:"secondary",className:"selected-text",children:[t("div",{children:[k," ",x("selected")]}),s&&e(P,{title:o?x("Select all"):null,children:e(M,{className:Is.buttonSelectAll,onClick:A,disabled:I||0===r.length,children:x("Select all")})}),e(P,{title:o?x("Deselected"):null,children:e(M,{className:Is.buttonDeselected,icon:e(Oi,{size:16,strokeWidth:a}),onClick:g,children:x("Deselected")})})]}),t(R,{children:[D&&!1!==(null==l?void 0:l.enableEdit)&&e(P,{title:o?x("Edit"):null,children:e(M,{icon:e(yi,{size:16,strokeWidth:a}),onClick:()=>w(F),disabled:!D,children:x("Edit")})}),N&&e(P,{title:o?x("Move to"):null,children:e(M,{icon:e(wi,{size:16,strokeWidth:a}),onClick:b,children:x("Move to")})}),j&&e(P,{title:o?x("Copy"):null,children:e(M,{icon:e(vi,{size:16,strokeWidth:a}),onClick:y,children:x("Copy")})}),1===k&&T&&e(P,{title:o?x("Rename"):null,children:e(M,{icon:e(Ri,{size:16,strokeWidth:a}),onClick:()=>m(),disabled:1!==k||!T,children:x("Rename")})}),!1!==(null==l?void 0:l.enableDelete)&&e(P,{title:o?x("Delete"):null,children:e(M,{danger:!0,icon:e(Ni,{size:16,strokeWidth:a}),onClick:e=>{e.stopPropagation(),e.preventDefault(),v()},children:x("Delete")})})]})]}:{className:Is.headerContainer,children:[e("div",{className:"search-container",children:e(ks,{placeholder:x("Search file or folder"),onSearch:h,className:Is.searchInput})}),t("div",{className:Is.actionsBox,children:[e("div",{className:"sort-container",children:e(O,{value:i,onChange:f,className:Is.sortSelect,popupMatchSelectWidth:!1,suffixIcon:e(gi,{size:16,strokeWidth:a}),children:C.map(({value:t,labelKey:r})=>e(Fs,{value:t,children:x(r)},t))},_)}),e("div",{className:Is.actionsContainer,children:e(L,{options:[{value:"grid",icon:e(Si,{size:16,strokeWidth:a})},{value:"table",icon:e(Ii,{size:20,strokeWidth:a})}],value:c,onChange:e=>u(e)})})]})]})});Ts.displayName="FileContentHeader";const Os=i.memo(({fileId:t,style:r})=>{const n=ns(e=>e.selectedFiles.has(t)),i=ns(e=>e.toggleFileSelection);return e(N,{checked:n,style:r,onClick:e=>{e.stopPropagation()},onChange:e=>{const r=e.nativeEvent;i(t,{metaKey:r.metaKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,forceToggle:!0})}})});function Ps(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}Os.displayName="FileSelectionCheckbox","function"==typeof SuppressedError&&SuppressedError;const Ms=i.memo(t=>{var{className:r}=t,n=Ps(t,["className"]);const i=n["data-row-key"],o=null==i?"":String(i),a=[r,ns(e=>!!o&&e.selectedFiles.has(o))?Is.selectedRow:""].filter(Boolean).join(" ");return e("tr",Object.assign({},n,{className:a}))});Ms.displayName="SelectableTableRow";const Rs=i.memo(({item:t,variant:r="table",t:n,iconStrokeWidth:i,setCurrentMenuFile:a,showMoveModal:s,showCopyModal:l,showRenameModal:u,showDeleteConfirm:h,onEdit:f})=>{const[p,g]=o(!1),m=d(()=>{if(!p)return[];const r=[];return t.canEdit&&r.push({key:"edit",label:n("Edit"),icon:e(yi,{size:16,strokeWidth:i})}),t.canMove&&r.push({key:"move",label:n("Move to"),icon:e(wi,{size:16,strokeWidth:i})}),t.canCopy&&r.push({key:"copy",label:n("Copy"),icon:e(vi,{size:16,strokeWidth:i})}),t.canRename&&r.push({key:"rename",label:n("Rename"),icon:e(Ri,{size:16,strokeWidth:i})}),t.canDelete&&r.push({key:"delete",label:n("Delete"),icon:e(Ni,{size:16,strokeWidth:i}),style:{color:"#ff4d4f"}}),r},[i,p,t.canCopy,t.canDelete,t.canEdit,t.canMove,t.canRename,n]),v=c(({key:e})=>{switch(t.id&&(null==a||a(t.id)),e){case"edit":f(t.file);break;case"move":s();break;case"copy":l();break;case"rename":u(t.id);break;case"delete":null==h||h();break;default:null==a||a("")}},[t,f,a,l,h,s,u]),y=d(()=>({items:m,onClick:v}),[v,m]);return e(j,{arrow:!0,placement:"bottom",menu:y,trigger:["hover"],onOpenChange:g,children:"grid"===r?e(M,{type:"default",className:`${Is.gridFileMenuButton} gridFileMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(bi,{size:16,strokeWidth:i})}):e("span",{className:`${Is.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(bi,{size:16,strokeWidth:i})})})});Rs.displayName="FileItemActionsDropdown";const Ls=({thumbnailSrc:t,previewSrc:r,lightboxSrc:n,alt:i,className:s,width:l,height:u,preview:h=!1})=>{const f=i,[p,g]=o(0),m=c(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),v=c(e=>{var t;if(e&&"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q=="!==e)return e.startsWith("data:image/")?m(e)?e:void 0:e.startsWith("blob:")?e:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?null!==(t=(e=>{if(e&&"string"==typeof e){if(e.startsWith("data:")||e.startsWith("blob:"))return e;try{if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")){const t=new URL(e.startsWith("/")?`https://x${e}`:e),r=e.startsWith("/")?"":`${t.protocol}//${t.host}`,n=t.pathname.split("/").map(e=>{if(!e)return"";try{return encodeURIComponent(decodeURIComponent(e))}catch(t){return encodeURIComponent(e)}}).join("/");return e.startsWith("/")?n+(t.search||"")+(t.hash||""):`${r}${n}${t.search}${t.hash}`}}catch(e){}return e}})(e))&&void 0!==t?t:e:void 0},[m]),y=d(()=>v(t),[t,v]),b=d(()=>v(r),[r,v]),w=d(()=>v(n),[n,v]),x=d(()=>[y,b].filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t),[y,b]);a(()=>{g(0)},[x]);const C=c((e,t)=>e&&e.toLowerCase().endsWith(".svg")||t&&(t.includes(".svg")||t.includes("image/svg+xml")),[]),_=x[p],S=null!=w?w:_,k=c(()=>{if(!_)return;const e=p+1;C(f,_),g(e)},[_,p,f,C]),A=null!=_?_:pr,I=!(!h||!S)&&{src:S,toolbarRender:()=>null,destroyOnHidden:!0,mask:e(ye,{style:{fontSize:"20px"}})};return e(D,{className:s,src:A,alt:i,width:l,height:u,preview:I,onError:k,fallback:pr})},Ns=i.memo(({item:t,variant:r="table",FolderIcon:n,getFileData:i,className:o,width:a,height:s})=>t.isFolder?e("div","grid"===r?{className:Is.gridFolderIcon,children:e(n,{className:Is.gridFolderIconImage})}:{className:Is.fileManagerTableFolder,children:e("div",{className:Is.fileManagerTableFolderInner,children:e(n,{className:Is.tableFolderIcon,style:{width:null!=a?a:40,height:null!=s?s:40}})})}):t.thumbnailSrc||t.previewSrc?e(Ls,{className:o,thumbnailSrc:t.thumbnailSrc,previewSrc:t.previewSrc,lightboxSrc:t.lightboxSrc,alt:t.file.name,width:a,height:s,preview:!0,file:t.file,getFileData:i}):null);function js(e){var t,r,n;if(e.isFolder)return!1;const i="string"==typeof e.name?e.name:"",o=i?null===(t=i.split(".").pop())||void 0===t?void 0:t.toLowerCase():void 0,a=null!==(n=null===(r=e.extension)||void 0===r?void 0:r.toLowerCase())&&void 0!==n?n:o;return"string"==typeof e.type&&e.type.startsWith("image/")||"string"==typeof a&&mr.includes(a)}Ns.displayName="FileItemPreview";const Ds=i.memo(({item:r,t:n,iconStrokeWidth:i,FolderIcon:o,handleItemClick:a,setCurrentMenuFile:s,showMoveModal:l,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f,onEditorOk:p,getFileData:g,showSelectionCheckbox:m=!0})=>{const v=ns(e=>e.selectedFiles.has(r.id)),y=c(e=>{const t=e.target;t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu")||1===e.detail&&(r.isFolder?a(r.file):p&&js(r.file)&&p(r.file))},[a,r.file,r.isFolder,p]);return e(z,{className:Is.gridCard_col,style:{padding:0},children:t(B,{hoverable:!0,cover:e("div",{className:r.isFolder?Is.gridPreviewContainerFolder:Is.gridPreviewContainer,onClick:e=>{e.stopPropagation(),y(e)},children:e(Ns,{item:r,variant:"grid",FolderIcon:o,getFileData:g,className:Is.gridImagePreview})}),className:`${Is.gridCard} ${v?Is.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),y(e)},children:[t("div",{className:Is.gridCardContent,onClick:e=>{e.stopPropagation(),e.preventDefault(),y(e)},children:[e("div",{className:Is.gridFileName,children:r.nameText||n("Untitled")}),e("div",{className:Is.gridFileInfo,children:r.gridInfoText})]}),e("div",{className:Is.gridFileMenu,onClick:e=>{e.stopPropagation()},children:e(Rs,{item:r,variant:"grid",t:n,iconStrokeWidth:i,setCurrentMenuFile:s,showMoveModal:l,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f})}),m?e("div",{onClick:e=>{e.stopPropagation()},className:Is.gridCheckbox,children:e(Os,{fileId:r.id,style:{height:20}})}):null]})})});Ds.displayName="FileGridItem";const zs=i.memo(({rows:t,topOffset:n=0,bottomOffset:i=0,t:o,iconStrokeWidth:a,FolderIcon:s,handleItemClick:l,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p,onEditorOk:g,getFileData:m,showSelectionCheckbox:v=!0})=>e(r,{children:e("div",{style:{paddingTop:n,paddingBottom:i},children:e(U,{gutter:[16,16],className:Is.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:t.map(t=>e(Ds,{item:t,handleItemClick:l,iconStrokeWidth:a,t:o,FolderIcon:s,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p,onEditorOk:g,getFileData:m,showSelectionCheckbox:v},t.id))})})}));zs.displayName="FileGridView";const Bs=i.memo(({rows:t,columns:n,loading:i,topOffset:o=0,bottomOffset:a=0,onRow:s,components:l})=>{const c=d(()=>e("div",{style:{paddingTop:o,paddingBottom:a},children:e(A,{renderEmpty:()=>e(H,{image:e(r,{}),description:""}),children:e(V,{dataSource:t,columns:n,rowKey:"id",pagination:!1,tableLayout:"fixed",onRow:s,components:l,showHeader:!1})})}),[a,n,l,s,t,o]);return e(S,{spinning:i,className:Is.tableLoadingWrapper,children:c})});Bs.displayName="FileTableView";const Us=i.memo(({item:t})=>t.dateText?e(P,{title:t.dateText,placement:"bottom",className:Is.fileDate,children:t.dateText}):null);Us.displayName="FileItemDate";const Vs=i.memo(({item:r})=>t("div",{className:Is.fileName,children:[r.nameText,r.isFolder&&e("div",{className:Is.fileItemCount,children:r.folderItemsText})]}));Vs.displayName="FileItemName";const Hs="filemanager_view_mode";class $s{constructor(){this.rowsById=new Map}reconcile(e,t,r){const n=new Map,i=[];for(const o of e){const e=t.getId(o),a=t.buildSignature(o,r),s=this.rowsById.get(e);if(s&&s.signature===a){n.set(e,s),i.push(s);continue}const l=t.buildRowModel(o,r,{id:e,signature:a});n.set(e,l),i.push(l)}return this.rowsById=n,i}}class Ws{createRenderWindow(e,t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S,k,A;const I=null!==(r=null==t?void 0:t.renderStrategy)&&void 0!==r?r:"full";if("windowed"!==I){if("positioned"===I){const r=null!==(i=null===(n=null==t?void 0:t.positioned)||void 0===n?void 0:n.layout)&&void 0!==i?i:[],v=null!==(a=null===(o=null==t?void 0:t.positioned)||void 0===o?void 0:o.viewportTop)&&void 0!==a?a:0,y=null!==(l=null===(s=null==t?void 0:t.positioned)||void 0===s?void 0:s.viewportBottom)&&void 0!==l?l:Number.MAX_SAFE_INTEGER,b=Math.max(0,null!==(u=null===(c=null==t?void 0:t.positioned)||void 0===c?void 0:c.overscanPx)&&void 0!==u?u:0),w=Math.max(0,null!==(h=null===(d=null==t?void 0:t.positioned)||void 0===d?void 0:d.containerHeight)&&void 0!==h?h:0),x=r.filter(e=>e.bottom>=v-b&&e.top<=y+b).map(t=>({row:e[t.index],layout:t})).filter(e=>Boolean(e.row)),C=null!==(p=null===(f=x[0])||void 0===f?void 0:f.layout.index)&&void 0!==p?p:-1,_=null!==(m=null===(g=x[x.length-1])||void 0===g?void 0:g.layout.index)&&void 0!==m?m:-1;return{rows:x.map(e=>e.row),startIndex:C,endIndex:_,topOffset:0,bottomOffset:0,totalCount:e.length,containerHeight:w,positionedItems:x}}return{rows:e,startIndex:0,endIndex:e.length>0?e.length-1:-1,topOffset:0,bottomOffset:0,totalCount:e.length}}const E=Math.max(0,null!==(y=null===(v=null==t?void 0:t.windowed)||void 0===v?void 0:v.startIndex)&&void 0!==y?y:0),F=null!==(w=null===(b=null==t?void 0:t.windowed)||void 0===b?void 0:b.endIndex)&&void 0!==w?w:e.length-1,T=Math.max(0,null!==(C=null===(x=null==t?void 0:t.windowed)||void 0===x?void 0:x.overscan)&&void 0!==C?C:0),O=Math.max(1,null!==(S=null===(_=null==t?void 0:t.windowed)||void 0===_?void 0:_.estimatedItemSize)&&void 0!==S?S:1),P=Math.max(1,null!==(A=null===(k=null==t?void 0:t.windowed)||void 0===k?void 0:k.itemsPerLane)&&void 0!==A?A:1),M=Math.ceil(e.length/P),R=Math.min(e.length-1,F),L=Math.floor(E/P),N=Math.floor(Math.max(E,R)/P),j=Math.max(0,L-T),D=Math.min(M-1,N+T),z=j*P,B=Math.min(e.length-1,(D+1)*P-1),U=Math.max(0,M-D-1);return{rows:e.slice(z,B+1),startIndex:z,endIndex:B,topOffset:j*O,bottomOffset:U*O,totalCount:e.length}}}function Gs({items:e,context:t,adapter:r,options:n}){const i=u(null),o=u(null);i.current||(i.current=new $s),o.current||(o.current=new Ws);const a=d(()=>i.current.reconcile(e,r,t),[r,t,e]),s=d(()=>o.current.createRenderWindow(a,n),[n,a]);return{rowModels:a,renderWindow:s}}function qs({totalCount:e,plan:t}){const[r,n]=o(null),i=d(()=>{var n,i;if(!t.enabled)return{renderStrategy:"full"};const o=function(e,t){var r;return Math.max(1,null!==(r=null==e?void 0:e.viewportHeight)&&void 0!==r?r:t)}(r,null!==(n=t.fallbackViewportHeight)&&void 0!==n?n:800),a=Math.max(1,Math.ceil(o/t.estimatedItemSize)),s=Math.max(1,Math.ceil(e/t.itemsPerLane)),l=Math.min(s-1,Math.max(0,Math.floor((null!==(i=null==r?void 0:r.scrollTop)&&void 0!==i?i:0)/t.estimatedItemSize))),c=l+a-1;return{renderStrategy:"windowed",windowed:{startIndex:l*t.itemsPerLane,endIndex:Math.min(e-1,(c+1)*t.itemsPerLane-1),overscan:t.overscan,estimatedItemSize:t.estimatedItemSize,itemsPerLane:t.itemsPerLane}}},[t.enabled,t.estimatedItemSize,t.fallbackViewportHeight,t.itemsPerLane,t.overscan,e,r]);return{engineOptions:i,handleViewportChange:c(e=>{n(t=>(null==t?void 0:t.viewportHeight)===e.viewportHeight&&(null==t?void 0:t.viewportWidth)===e.viewportWidth&&(null==t?void 0:t.scrollHeight)===e.scrollHeight&&(null==t?void 0:t.scrollTop)===e.scrollTop?t:e)},[])}}function Ys(e,t){if("number"==typeof e.childCount)return e.childCount;const r=t[e.id];return null===r?null:null!=r?r:0}function Xs(e){var t,r,n;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}function Ks(e,t){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=[t("months.january"),t("months.february"),t("months.march"),t("months.april"),t("months.may"),t("months.june"),t("months.july"),t("months.august"),t("months.september"),t("months.october"),t("months.november"),t("months.december")];return t("Added",{date:`${r.getDate()} ${n[r.getMonth()]} ${r.getFullYear()}`})}const Zs={getId:e=>e.id,buildSignature:(e,t)=>function(e,t){var r,n,i,o,a,s,l,c;const u=Boolean(e.isFolder),d=u?Ys(e,t.folderFileCounts):null,h=u?null===d?"u":String(d):"0",f=Ks(e.date,t.t),p=!u&&e.size?String(e.size):"",g=e.thumbnailUrl||e.thumbnail,m=e.url&&Xs(e)?e.url:"",v=t.previewFallbackToFileUrl?m:"",y=[!1!==(null===(r=t.features)||void 0===r?void 0:r.enableEdit),!1!==(null===(n=t.features)||void 0===n?void 0:n.enableMoveFolder),!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveItem),!1!==(null===(o=t.features)||void 0===o?void 0:o.enableCopyFolder),!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyItem),!1!==(null===(s=t.features)||void 0===s?void 0:s.enableRenameFolder),!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFile),!1!==(null===(c=t.features)||void 0===c?void 0:c.enableDelete)].join("|"),b=[g||"",v,m].join("::");return[e.id,e.name,e.folderId,e.type||"",e.extension||"",b,b,e.dimensions||"",p,f,u?"1":"0",h,y].join("::")}(e,t),buildRowModel:(e,t,r)=>{var n,i,o,a,s,l,c,u;const d=Boolean(e.isFolder),h=d?Ys(e,t.folderFileCounts):null,f=d&&null===h?"—":d?`${h} ${1===h?t.t("item"):t.t("items")}`:"",p=e.dimensions||"",g=!d&&e.size?hi(e.size):"",m=d?t.t("Folder"):function(e){var t,r,n;return e.extension||(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase())||(e.url?null===(n=null===(r=e.url.split("?")[0].split("/").pop())||void 0===r?void 0:r.split(".").pop())||void 0===n?void 0:n.toLowerCase():"")||""}(e),v=Ks(e.date,t.t),y=d?f:[p,g,m].filter(Boolean).join(" • "),b=e.thumbnailUrl||e.thumbnail,w=e.url&&Xs(e)?e.url:void 0,x=t.previewFallbackToFileUrl?w:void 0;return{id:r.id,signature:r.signature,item:e,file:e,isFolder:d,nameText:e.name||t.t("No name"),folderItemsText:f,dimensionsText:p,sizeText:g,typeText:m,dateText:v,gridInfoText:y,thumbnailSrc:b,previewSrc:x,lightboxSrc:w,canEdit:!d&&!1!==(null===(n=t.features)||void 0===n?void 0:n.enableEdit)&&Xs(e),canMove:d?!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveFolder):!1!==(null===(o=t.features)||void 0===o?void 0:o.enableMoveItem),canCopy:d?!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyFolder):!1!==(null===(s=t.features)||void 0===s?void 0:s.enableCopyItem),canRename:d?!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFolder):!1!==(null===(c=t.features)||void 0===c?void 0:c.enableRenameFile),canDelete:!1!==(null===(u=t.features)||void 0===u?void 0:u.enableDelete)}}};const Js=i.memo(({files:r,searchTerm:n,handleSearch:i,sortBy:s,sortOrder:l,handleSortOptionChange:h,pagination:f,setPagination:p,loading:g,handleItemClick:m,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,showRenameModal:C,showDeleteConfirm:_,showCopyModal:S,showMoveModal:k,onEdit:A,getFileData:I,handleAddFile:E})=>{var F;const{t:T}=Kn(),O=Mo(),{DropZoneFileIcon:P,BigStockIcon:M,BigAIIcon:R,FolderIcon:L}=yo(),{options:N,actions:j,state:D}=mo(),{dataProviders:z,config:B}=N,U=null==B?void 0:B.disablePagination,{setCurrentMenuFile:V,setActiveLibraryItem:H}=j,W="Trash"===(null==D?void 0:D.selectedFolder),G=!1!==(null==D?void 0:D.multiSelect),{viewMode:q,setViewMode:Y}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(Hs)||"table"}catch(e){return"table"}}),r=c(e=>{t(e);try{localStorage.setItem(Hs,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),n=c(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[X,K]=o({}),[Z,J]=o(!1),Q=u(0),ee=u(null);a(()=>{const e=window.matchMedia("(max-width: 1199px)"),t=e=>{J(e.matches)};t(e);const r=e=>t(e);return"function"==typeof e.addEventListener?(e.addEventListener("change",r),()=>e.removeEventListener("change",r)):(e.addListener(r),()=>e.removeListener(r))},[]);const te=d(()=>(null==B?void 0:B.features)||{},[null==B?void 0:B.features]),re=null==B?void 0:B.iconStrokeWidth,ne=null==B?void 0:B.sortOptions,ie=d(()=>(null==ne?void 0:ne.length)?new Set(ne):null,[ne]),oe=`${s}-${l}`;a(()=>{var e;if(ie&&!ie.has(oe)){const t=null===(e=As.find(e=>ie.has(e.value)))||void 0===e?void 0:e.value;t&&h(t)}},[ie,oe,h]);const ae=d(()=>new Map(r.map(e=>[e.id,e])),[r]),{renderRows:se,renderWindow:le,hasAnyValidDate:ce,handleViewportChange:ue}=function({files:e,folderFileCounts:t,features:r,t:n,viewMode:i,previewFallbackToFileUrl:a}){const s=d(()=>({folderFileCounts:t,features:r,t:n,previewFallbackToFileUrl:a}),[r,t,n,a]),[l,u]=o(()=>Math.max(1,Math.floor(5))),h=d(()=>{const t=e.length>150;return"table"===i?{enabled:t,estimatedItemSize:56,overscan:10,itemsPerLane:1,fallbackViewportHeight:800}:{enabled:t,estimatedItemSize:320,overscan:2,itemsPerLane:l,fallbackViewportHeight:800}},[e.length,l,i]),{engineOptions:f,handleViewportChange:p}=qs({totalCount:e.length,plan:h}),{rowModels:g,renderWindow:m}=Gs({items:e,context:s,adapter:Zs,options:f}),v=d(()=>g.some(e=>Boolean(e.dateText)),[g]),y=c(e=>{if("grid"===i){const t=Math.max(1,Math.floor(e.viewportWidth/240));u(e=>e===t?e:t)}p(e)},[p,i]);return{rowModels:g,renderRows:m.rows,renderWindow:m,hasAnyValidDate:v,handleViewportChange:y}}({files:r,folderFileCounts:X,features:te,t:T,viewMode:q,previewFallbackToFileUrl:null==B?void 0:B.previewFallbackToFileUrl}),de=c(async e=>{var t,r,n,i;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:r,pagination:n}=await z.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:U?void 0:1,limit:U?void 0:1});return U?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;if(404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.code)||404===(null===(i=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.status))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Va({folderId:e,dataProviders:z,folders:Array.isArray(D.folders)?D.folders:[],pathHistory:D.pathHistory,t:T});return O.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:T("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[z,U,O,D.folders,D.pathHistory,T]),he=c(async()=>{const e=Q.current+1;Q.current=e;const t=r.filter(e=>e.isFolder);if(0===t.length)return void K(e=>0===Object.keys(e).length?e:{});const n={},i=t.map(async e=>{"number"!=typeof e.childCount?n[e.id]=await de(e.id):n[e.id]=e.childCount});await Promise.all(i),Q.current===e&&K(e=>{const t=Object.keys(e),r=Object.keys(n);return t.length===r.length&&t.every(t=>e[t]===n[t])?e:n})},[r,de]);a(()=>{he()},[he]),a(()=>{ee.current&&ue(_s(ee.current))},[r.length,ue,q]),a(()=>{if(!ee.current||"undefined"==typeof ResizeObserver)return;const e=ee.current,t=new ResizeObserver(()=>{ue(_s(e))});return t.observe(e),()=>{t.disconnect()}},[ue]);const fe=c(e=>{const t=_s(e);ue(t)},[ue]);a(()=>{const e=ee.current;if(!e)return;const t=()=>{fe(e)},r=ws(e);return r.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{r.forEach(e=>{e.removeEventListener("scroll",t)})}},[r.length,fe,q]);const pe=c((e,t)=>e!==t,[]),ge=d(()=>[...G?[{key:"selection",width:46,shouldCellUpdate:pe,render:(t,r)=>e(Os,{fileId:r.id})}]:[],{key:"preview",width:60,shouldCellUpdate:pe,render:(t,r)=>e(Ns,{item:r,variant:"table",FolderIcon:L,getFileData:I,className:`${Is.imagePreview} ${Is.tableImagePreview}`,width:40,height:40})},{title:T("Name"),width:"calc(100% - 430px)",dataIndex:"nameText",key:"name",className:Is.fileNameCol,shouldCellUpdate:pe,render:(t,r)=>e(Vs,{item:r})},{title:T("Dimensions"),key:"dimensions",width:100,shouldCellUpdate:pe,render:(t,r)=>r.dimensionsText&&e("div",{className:Is.fileSize,children:r.dimensionsText})},{title:T("Size"),key:"size",width:90,shouldCellUpdate:pe,render:(t,r)=>r.sizeText?e("div",{className:Is.fileSize,children:r.sizeText}):null},{title:T("Type"),key:"type",width:90,shouldCellUpdate:pe,render:(t,r)=>e("div",{className:Is.fileSize,children:r.typeText})},...ce?[{title:T("Date"),dataIndex:"dateText",key:"date",width:200,shouldCellUpdate:pe,render:(t,r)=>e(Us,{item:r})}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),shouldCellUpdate:pe,render:(t,r)=>e(Rs,{item:r,variant:"table",t:T,iconStrokeWidth:re,setCurrentMenuFile:V,showMoveModal:k,showCopyModal:S,showRenameModal:C,showDeleteConfirm:_,onEdit:A})}],[L,I,ce,re,G,A,V,pe,S,_,k,C,T]),me=d(()=>({body:{row:Ms}}),[]),ve=c(e=>({onClick:t=>{if(t.stopPropagation(),t.preventDefault(),1!==t.detail)return;const r=t.target,n=Boolean(r.closest(".ant-checkbox-wrapper")),i=Boolean(r.closest(".ant-image"))||Boolean(r.closest(".ant-image-preview-wrap")),o=Boolean(r.closest(".tableMenuButton")),a=Boolean(r.closest(".ant-dropdown-menu"));n||i||o||a||(e.isFolder?m(e.file):N.onEditorOk&&js(e.file)&&N.onEditorOk(e.file))}}),[m,N]);let ye="table"===q?e(Bs,{rows:se,columns:ge,loading:g,topOffset:le.topOffset,bottomOffset:le.bottomOffset,onRow:ve,components:me}):e(zs,{rows:se,topOffset:le.topOffset,bottomOffset:le.bottomOffset,t:T,iconStrokeWidth:re,FolderIcon:L,handleItemClick:m,setCurrentMenuFile:V,showMoveModal:k,showCopyModal:S,showRenameModal:C,showDeleteConfirm:_,onEdit:A,onEditorOk:N.onEditorOk,getFileData:I,showSelectionCheckbox:G});n&&!r.length&&(ye=e(_o,{}));const be=null===(F=null==B?void 0:B.availableImageExtensions)||void 0===F?void 0:F.map(e=>"."+e).join(", "),we=t("div",W?{className:`${Is.noFiles} ant-layout-sider-light`,children:[e(ji,{size:48,className:Is.noFilesIcon}),e("div",{className:`${Is.textTitle_trash} ant-menu-submenu-title`,children:T("Trash is empty")}),e("div",{className:`${Is.textDescription_trash} ant-menu-submenu-title`,children:T("Deleted files will be displayed here")})]}:{className:Is.uploadContainer,children:[t("div",{className:`${Is.uploadArea} `,onClick:E,children:[e("div",{className:Is.uploadIcon,children:e(P,{})}),e("div",{className:Is.textTitle,children:T("Click here to select a file")}),e("div",{className:Is.textDescription,children:T("Supported files:")+" "+(be||"jpeg, .svg, .png")})]}),t("div",{className:Is.buttons,children:[t("button",{className:Is.btnPhoto,onClick:()=>{H&&H(ir)},children:[e("div",{className:Is.icon,children:e(M,{})}),t("div",{className:Is.blockText,children:[e("div",{className:Is.textTitle,children:T("Stock")}),e("div",{className:Is.textDescription,children:T("Select an image from our library")})]})]}),t("button",{className:Is.btnAi,onClick:()=>{H&&H(ar)},children:[e("div",{className:Is.icon,children:e(R,{})}),t("div",{className:Is.blockText,children:[e("div",{className:Is.textTitle,children:T("AI generation")}),e("div",{className:Is.textDescription,children:T("Creating an image on demand")})]})]})]})]});return e("div",{className:`content-layout ${Is.contentLayout}`,children:g||0!==(null==r?void 0:r.length)||n?t("div",{className:Is.tableContainer,children:[e(Ts,{files:r,filesById:ae,currentSortOption:oe,isSmallScreen:Z,iconStrokeWidth:re,multiSelectEnabled:G,features:te,viewMode:q,setViewMode:Y,handleSearch:i,handleSortOptionChange:h,sortOptions:ne,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,onEdit:A,t:T}),e("div",{ref:ee,className:Is.filesContainer,children:ye}),!U&&f.total>f.pageSize&&e("div",{className:Is.paginationContainer,children:e($,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>T("total pages",{total:e})})})]}):e("div",{className:Is.emptyStateWrapper,children:we})})});Js.displayName="FileContent";var Qs="folderTree",el="emptyFolderContainer",tl="folderItemContainer",rl="folderLabel",nl="folderLabelItem",il="fileCount",ol="foldersTitle",al="foldersTitleItem",sl="folderMenu";const ll=({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}=Kn(),{options:x}=mo(),{config:C}=x,{ExpandArrowIcon:_,CollapseArrowIcon:S,CollapseFolderIcon:k,ExpandFolderIcon:A,EmptyFolderIcon:I}=yo(),E=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[F,T]=o(()=>{if(b||"selection"===y&&b){const e=s();return E(e)}return[]}),O=void 0!==g?g:F,P=void 0!==m?m:T;a(()=>{if(b||"selection"===y&&b){const e=s(),t=E(e);void 0===g&&T(t)}},[b,y,s,E,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]:void 0,o=h&&null===i?null:h&&null!=i?i:0,a=O.includes(r.key),s=u.includes(r.key),l=(()=>{var t;return(null===(t=r.children)||void 0===t?void 0:t.length)?e(a?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}):e(I,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth})})(),d=t("div",{className:`${tl} folder-item-container`,onClick:()=>!s&&c(r.key),style:{opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[t("div",{className:rl,children:[void 0!==r.icon?r.icon:l,e("span",{className:nl,children:r.label})]}),h&&e("div",{className:il,title:null===o?void 0:`${o} ${w(1===o?"item":"items")}`,children:null===o?"—":o})]});return{key:r.key,title:d,children:null===(n=r.children)||void 0===n?void 0:n.map(p),disabled:s}},g=O.includes("folders"),m=e("div",{className:ol,onClick:()=>c("folders"),children:t("div",{className:al,children:[e(g?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:`${nl} 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:ol,onClick:()=>c("Trash"),children:t("div",{className:al,children:[e(Ni,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:nl,children:w("Trash")})]})}),children:void 0});if(d){if(!v)return[{key:"empty",title:e("div",{className:el,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,k,null==C?void 0:C.iconStrokeWidth,A,w,r,M,h,f,I,u,v,y,P]),N=d(()=>L(),[L]);return e(W,{className:`${Qs} ${sl} ${p}`,selectedKeys:r?[r]:[],expandedKeys:O,onSelect:M,onExpand:R,treeData:N,switcherIcon:({expanded:t})=>e(t?S:_,{}),showLine:!1})},cl=({style:t={},wrap:r=!1})=>{const n=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},t);return e(R,{size:"large",style:n,wrap:r,children:e(S,{})})};var ul={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField",inputButtonOk:"inputButtonOk",permanentDeleteWarning:"permanentDeleteWarning",clearTrashProgress:"clearTrashProgress",progressText:"progressText",closeIcon:"closeIcon",modalContentWithLoader:"modalContentWithLoader",modalLoaderOverlay:"modalLoaderOverlay"};const dl=({folderId:n,activeFormField:i,EmptyFolderIcon:o,targetForm:a,handleModalOk:s,onComplete:l,setIsLoading:c,t:u})=>e(E.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(P,{placement:"top",title:"Clean",children:e(M,{icon:e(be,{style:{fontSize:10}}),className:ul.inputButtonClose,type:"text",onClick:()=>{a.setFieldsValue({folderName:""})}})}),e(M,{className:ul.inputButtonOk,type:"text",onClick:()=>{c(!0),s(a).then(e=>{const t=null==e?void 0:e.id;l(t)}).finally(()=>c(!1))},children:u("Create")})]})})});function hl({folders:n,selectedFolder:o,EmptyFolderIcon:a,handleCreateFolderModalOk:s,setIsLoading:l,t:c}){const[u,d]=i.useState(""),h=i.useCallback((t,r)=>n=>e(dl,{folderId:n,activeFormField:u,EmptyFolderIcon:a,targetForm:t,handleModalOk:s,onComplete:r,setIsLoading:l,t:c},n),[a,u,s,l,c]),f=i.useCallback(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),d(t),r.setFieldsValue({folderName:c("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),n([t]).then(()=>i(t))}}},[c]),p=i.useCallback(i=>{const{targetForm:a,onTreeSelect:s,onComplete:l,actionButtonText:d}=i,p=h(a,l),g=Array.isArray(n)?n:[],m=(n=null,i=new Set)=>g.filter(e=>{const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(i.has(n.id))return{key:n.id,label:`${n.name} (циклическая ссылка)`};const c=new Set(i);c.add(n.id);const h=m(n.id,c),{handleAddFolder:g,handleSelectFolder:v}=f({folderId:n.id,targetForm:a,onTreeSelect:s,onComplete:l}),y=u===n.id?[{key:`${n.id}_input`,label:p(n.id),icon:null},...h]:h;return{key:n.id,label:t(r,{children:[n.name,o!==n.id&&t("div",{className:`${ul.folderToolsField} folder-tools-field`,children:[e(M,{onClick:g,children:"+"}),e(M,{onClick:v,children:d})]})]}),children:y}}),v=m(),{handleAddFolder:y,handleSelectFolder:b}=f({folderId:"folders",targetForm:a,onTreeSelect:s,onComplete:l}),w="folders"===u?[{key:"folders_input",label:p("folders"),icon:null},...v]:v;return[{key:"folders",label:t(r,{children:[c("Folders"),"folders"!==o&&null!==o&&t("div",{className:`${ul.folderToolsField} folder-tools-field`,children:[e(M,{onClick:y,children:"+"}),e(M,{onClick:b,children:d})]})]}),children:w}]},[u,h,f,n,o,c]);return{activeFormField:u,setActiveFormField:d,generateMenuItemsFromFolders:p}}const fl=f(({folderId:t,activeFormField:r,EmptyFolderIcon:n,targetForm:i,handleModalOk:o,onComplete:a,t:s,setIsLoading:l,defaultFolderName:u})=>{const d=c(()=>{l(!0),o(i).then(e=>a(null==e?void 0:e.id)).finally(()=>l(!1))},[o,i,a,l]);return e(E.Item,{className:"form-item form-item-moveto "+(r===t?"form-item_active":""),name:"folderName",initialValue:u,rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(s("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(n,{style:{marginRight:6}}),suffix:e(M,{className:ul.inputButtonOk,type:"text",onClick:()=>{l(!0),d()},children:s("Create")})})})});fl.displayName="CustomFolderInput";const pl=({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:k,moveForm:A,selectedFiles:I,isRenameFolderModalVisible:T,handleRenameFolderOk:O,handleRenameFolderCancel:P,renameFolderForm:R,folderToRename:L,isCopyModalVisible:N,handleCopyOk:j,handleCopyCancel:D,copyForm:z,isDeleteConfirmVisible:B,handleDeleteConfirmOk:U,handleDeleteConfirmCancel:V,isClearTrashConfirmVisible:H,handleClearTrashConfirm:$,handleClearTrashCancel:W,fetchChildFolders:Y})=>{var X,K,Z;const{t:J}=Kn(),{state:Q,actions:ee,options:te}=mo(),{setCurrentMenuFile:re}=ee,{config:ne}=te,{currentMenuFile:ie}=Q,oe=E.useWatch("folderName",l),{EmptyFolderIcon:ae}=yo(),[se,le]=o(!1),ce=d(()=>{var e;return(null===(e=null==ne?void 0:ne.defaultFolderName)||void 0===e?void 0:e.trim())||J("New folder")},[null==ne?void 0:ne.defaultFolderName,J]),ue=!oe||0===String(oe).trim().length,de=d(()=>Array.isArray(C)?C:[],[C]),he=x?null===(X=de.find(e=>e.id===x))||void 0===X?void 0:X.name:"",fe=Array.isArray(h)?h:[],pe=L?null===(K=fe.find(e=>e.id===L))||void 0===K?void 0:K.name:"",{activeFormField:ge,setActiveFormField:me,generateMenuItemsFromFolders:ve}=hl({folders:fe,selectedFolder:u,EmptyFolderIcon:ae,handleCreateFolderModalOk:i,setIsLoading:e=>le(Boolean(e)),t:J});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 ye=x?de.find(e=>e.id===x):null,we=(null==ye?void 0:ye.isFolder)||(null==x?void 0:x.startsWith("folder_")),xe=c(async e=>{e.length>0&&(A.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[A,ge,me]),Ce=c(async e=>{e.length>0&&(z.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[ge,z,me]),_e=c(async e=>{le(!0);try{await S(e)}finally{le(!1)}},[S]),Se=c(async e=>{le(!0);try{await j(e)}finally{le(!1)}},[j]),ke=d(()=>{const e=Array.from(I).filter(e=>{const t=de.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||h.some(t=>t.id===e)});return u&&"folders"!==u?e.push(u):u&&"folders"!==u||e.push("folders"),e},[I,de,h,u]);return t(r,{children:[e(G,{title:e("div",{className:"modal-title",children:J("Creating a new folder")}),open:n,onOk:()=>i(),onCancel:s,okText:J("Create"),cancelText:J("Cancel"),okButtonProps:{disabled:ue,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:t(E,{form:l,layout:"vertical",children:[e(E.Item,{name:"folderName",label:e("div",{className:"form-label",children:J("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],initialValue:ce,className:"form-item",style:{marginBottom:5},children:e(F,{autoFocus:!0,className:"form-input",disabled:se,placeholder:J("Enter the name"),onPressEnter:async()=>{le(!0);try{await l.validateFields(),ue||await i()}catch(e){le(!1)}}})}),e("div",{children:u&&"folders"!==u?t("p",{className:"fm-note",children:[J("A folder will be created inside:")," ",(null===(Z=fe.find(e=>e.id===u))||void 0===Z?void 0:Z.name)||J("selected folder"),"."]}):e("p",{className:"fm-note",children:J("The folder will be created in the root directory.")})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Upload file by URL")}),open:f,onOk:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}},onCancel:()=>p(!1),okText:J("Download"),okButtonProps:{loading:se},cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:e(E,{form:m,layout:"vertical",children:e(E.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:J("File URL")}),rules:[{required:!0,message:J("Enter the URL of the image")},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return Jo(String(t),J),Promise.resolve()}catch(e){return Promise.reject(new Error(e instanceof Error?e.message:J("The specified URL is not valid.")))}}}],validateTrigger:"onBlur",className:"form-item",children:e(F,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:se,onPressEnter:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:we?`${J("Rename folder")} ${he}`:J("Rename file",{currentFileName:he})}),open:v,onOk:y,okText:J("Rename"),okButtonProps:{loading:se},onCancel:b,cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:w,layout:"vertical",children:e(E.Item,{name:"newFileName",label:e("div",{className:"form-label",children:J(we?"New folder name":"New file name")}),rules:[{required:!0,message:J(we?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await w.validateFields(),y()}catch(e){le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:J("Move to")}),open:_,onCancel:k,footer:t("div",{className:ul.formFooter,children:[t(M,{className:ul.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),A.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(Ci,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:ul.folderButton,onClick:k,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:ul.modalContentWithLoader,children:[se&&e("div",{className:ul.modalLoaderOverlay,children:e(cl,{})}),e(E,{form:A,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:ul.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:ul.formItem,children:e(ll,{onSelect:xe,generateMenuItems:()=>ve({targetForm:A,onTreeSelect:xe,onComplete:_e,actionButtonText:J("Move here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Copy to folder")}),open:N,onCancel:D,footer:t("div",{className:ul.formFooter,children:[t(M,{className:ul.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),z.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(Ci,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:ul.folderButton,onClick:D,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:ul.modalContentWithLoader,children:[se&&e("div",{className:ul.modalLoaderOverlay,children:e(cl,{})}),e(E,{form:z,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:ul.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:ul.formItem,children:e(ll,{onSelect:Ce,generateMenuItems:()=>ve({targetForm:z,onTreeSelect:Ce,onComplete:Se,actionButtonText:J("Copy here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:t("div",{className:"modal-title",children:[J("Rename folder")," ",pe]}),open:T,onOk:O,onCancel:P,okText:J("Rename"),cancelText:J("Cancel"),okButtonProps:{loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:R,layout:"vertical",children:e(E.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:J("New folder name")}),rules:[{required:!0,message:J("Enter a new folder name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await R.validateFields(),O()}catch(e){le(!1)}}})})})}),e(G,{className:`${ul.deleteModal} deleteModal`,title:(()=>{const t=!!(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u||!(null==ne?void 0:ne.enableTrashFolder),r=J(t?"Permanently delete":"Move to Trash");return e("div",{className:"modal-title",children:r})})(),open:!!B,onOk:()=>{le(!0);try{U&&U()}catch(e){console.error(e),le(!1)}},onCancel:()=>V&&V(),okText:(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u?J("Delete permanently"):(null==ne?void 0:ne.enableTrashFolder)?J("Move to Trash"):J("Delete"),cancelText:J("Cancel"),okButtonProps:{danger:!(null==ne?void 0:ne.enableTrashFolder)||"Trash"===u,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},closeIcon:e(be,{className:ul.closeIcon}),children:(()=>{var r,n;const i=(ie?[ie]:Array.from(I||[])).map(e=>de.find(t=>t.id===e)).filter(e=>!!e),o=i.filter(e=>e.isFolder||e.id.startsWith("folder_")),a=i.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=i.length,l=o.length,c=a.length,d=!!(null==ne?void 0:ne.enableTrashFolder);if(!d||d&&"Trash"===u){let n;if(1===s&&1===l){const e=o[0],t=(null==e?void 0:e.name)||"",i=null!==(r=null==e?void 0:e.childCount)&&void 0!==r?r:0;n=J("delete_folder_permanent",{name:t,count:i})}else n=0===l&&c>0?J("delete_files_permanent",{count:c}):J("delete_mixed_permanent",{total:s,folders:l,images:c});return t("div",{children:[e("div",{children:n}),e("p",{className:ul.permanentDeleteWarning,children:J("permanent_delete_warning")})]})}if(1===s&&1===l){const t=o[0],r=(null==t?void 0:t.name)||"",i=null!==(n=null==t?void 0:t.childCount)&&void 0!==n?n:0;return e("div",{children:J("move_folder_to_trash",{name:r,count:i})})}return e("div",0===l&&c>0?{children:J("move_files_to_trash",{count:c})}:{children:J("move_mixed_to_trash",{total:s,folders:l,images:c})})})()}),t(G,{className:`${ul.deleteModal} deleteModal`,title:e("div",{className:"modal-title",children:J("Clear Trash")}),open:!!H,onOk:async()=>{le(!0),$&&await $(),le(!1)},onCancel:()=>W&&W(),okText:J("Delete permanently"),cancelText:J("Cancel"),okButtonProps:{danger:!0,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1)},closeIcon:e(be,{className:ul.closeIcon}),children:[e("div",{children:J("Are you sure you want to permanently delete all items from Trash?")}),se&&t("div",{className:ul.clearTrashProgress,children:[e(q,{percent:99,status:"active",showInfo:!1}),e("div",{className:ul.progressText,children:J("Deleting items...")})]})]})]})};var gl={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const ml=f(p(({selectedFolder:r,generateMenuItems:n,onFolderSelect:i,folders:s,fetchChildFolders:l,handleAddFile:h,setIsUrlModalVisible:f,handleCreateFolder:p,activeLibraryItem:m,setActiveLibraryItem:v},y)=>{var b,w,x;const C=d(()=>Array.isArray(s)?s:[],[s]),{t:_}=Kn(),S=Mo(),[k,A]=o({}),{options:I,state:E}=mo(),{dataProviders:F,config:T}=I,O=E.pathHistory,P=!1!==(null===(b=null==T?void 0:T.features)||void 0===b?void 0:b.enableGif)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("gif")),R=!1!==(null===(w=null==T?void 0:T.features)||void 0===w?void 0:w.enableStockImages)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("stock")),L=!1!==(null===(x=null==T?void 0:T.features)||void 0===x?void 0:x.enableIconStock)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("icons")),N=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[j,D]=o(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n();return N(e)}return!0===(null==T?void 0:T.expandRootFolderOnInit)?["folders"]:[]}),z=u(!1),B=u(!1);a(()=>{if(z.current)return;"lazy"===(null==T?void 0:T.folderTreeLoading)&&!0===(null==T?void 0:T.expandRootFolderOnInit)&&(z.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==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit,l]),a(()=>{!0===(null==T?void 0:T.expandRootFolderOnInit)&&Array.isArray(C)&&C.length>0&&(B.current||j&&0!==j.length||(B.current=!0,D(["folders"])))},[null==T?void 0:T.expandRootFolderOnInit,C,j]),a(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n(),t=N(e);return void D(t)}!0===(null==T?void 0:T.expandRootFolderOnInit)&&D(e=>e&&e.length>0?[...e]:["folders"])},[C,n,N,null==T?void 0:T.expandAllFoldersOnInit,null==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit]);const U=null==T?void 0:T.disablePagination,V=c(async e=>{var t,r,n,i;try{if(null==F?void 0:F.getChildrenCount)return await F.getChildrenCount("folders"===e?void 0:e);if(null==F?void 0:F.getFiles){const{files:r,pagination:n}=await F.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:U?void 0:1,limit:U?void 0:1});return U?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;if(404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.code)||404===(null===(i=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.status))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Va({folderId:e,dataProviders:F,folders:C,pathHistory:O,t:_});return S.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:_("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[F,U,S,O,C,_]),H=c(async()=>{if(0===C.length)return;const e={};e.folders=await V("folders");const t=C.map(async t=>{"number"!=typeof t.childCount?e[t.id]=await V(t.id):e[t.id]=t.childCount});await Promise.all(t),A(e)},[C,V]),$=c(async e=>{const t=await V(e);A(r=>Object.assign(Object.assign({},r),{[e]:t}))},[V]);g(y,()=>({refreshFileCounts:H}),[H]),a(()=>{H()},[H]),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=C.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?D(e=>{const r=new Set(e);return t.forEach(e=>r.add(e)),r.add("folders"),Array.from(r)}):D(e=>e.includes("folders")?e:[...e,"folders"])},[r,C]);const W=c(async()=>{await h(),r?await $(r):await $("folders")},[h,r,$]),G=[{key:rr,label:_("My files"),icon:e(ki,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth})},{key:nr,label:_("GIF"),icon:e(Ei,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!P},{key:ir,label:_("Stock images"),icon:e(mi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!R},{key:or,label:_("Icons"),icon:e(we,{size:20}),disabled:!L},{key:ar,label:_("AI"),icon:e(Mi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!(null==T?void 0:T.sseQuery)}].filter(e=>!e.disabled),q=c(async e=>{const t=e[0];t&&"empty"!==t&&(m!==rr&&v(rr),null==i||i(t),await(null==l?void 0:l(t)))},[i,m,v,l]),K=c(({key:e})=>{v(e)},[v]),Z=c(async(e,t)=>{var r;D(e);if(!("lazy"===(null==T?void 0:T.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);const t=await Va({folderId:n,dataProviders:F,folders:C,pathHistory:O,t:_});S.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:_("Failed to load subfolders in folder",{folderName:t}),placement:"bottomRight",innerException:e,notificationDedupe:!0,data:{folderId:n,folderName:t,reason:e instanceof Error?e.message:String(e)}})}},[null==T?void 0:T.folderTreeLoading,F,l,S,O,C,_]);return t("div",{className:"sidebar-container",children:[t("div",{className:gl.buttonWrapper,children:[e(M,{type:"primary",size:"large",icon:e(Fi,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:W,className:gl.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r,children:e("span",{className:gl.uploadButtonTitle,children:_("Upload file")})}),e(M,{type:"primary",size:"large",icon:e(Ai,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:()=>null==f?void 0:f(!0),className:gl.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r})]}),e(Y,{className:"folder-menu",items:G,defaultSelectedKeys:[rr],onSelect:({key:e})=>K({key:e}),selectedKeys:[m]}),e(X,{className:gl.divider}),t("div",{className:gl.foldersContainer,children:[e(ll,{selectedFolder:r,onSelect:q,onExpand:Z,generateMenuItems:n,fetchChildFolders:l,showFileCounts:!0,folderFileCounts:k,expandedKeys:j,setExpandedKeys:D,showTrashFolder:null==T?void 0:T.enableTrashFolder}),e("div",{className:gl.folderActions,children:e(M,{onClick:e=>{e.stopPropagation(),p()},className:gl.button,icon:e(Ci,{size:18,strokeWidth:null==T?void 0:T.iconStrokeWidth}),size:"middle"})})]})]})}));ml.displayName="FolderSidebar";var vl=Object.defineProperty,yl=(e,t,r)=>(((e,t,r)=>{t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function bl(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function wl(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function xl(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=wl(e);return t>0?bl(Number(e)*Math.pow(10,t)):Number(e)}function Cl(e){El&&(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 _l(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 Sl=_l(function(e,t){var r=xl(e),n=xl(t),i=wl(e)+wl(t),o=r*n;return Cl(o),o/Math.pow(10,i)}),kl=_l(function(e,t){var r=Math.pow(10,Math.max(wl(e),wl(t)));return(Sl(e,r)+Sl(t,r))/r}),Al=_l(function(e,t){var r=Math.pow(10,Math.max(wl(e),wl(t)));return(Sl(e,r)-Sl(t,r))/r}),Il=_l(function(e,t){var r=xl(e),n=xl(t);return Cl(r),Cl(n),Sl(r/n,bl(Math.pow(10,wl(t)-wl(e))))});var El=!0;var Fl={strip:bl,plus:kl,minus:Al,times:Sl,divide:Il,round:function(e,t){var r=Math.pow(10,t),n=Il(Math.round(Math.abs(Sl(e,r))),r);return e<0&&0!==n&&(n=Sl(n,-1)),n},digitLength:wl,float2Fixed:xl,enableBoundaryChecking:function(e){void 0===e&&(e=!0),El=e}};const Tl=Object.prototype.toString;function Ol(e){switch(Tl.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ul(e,Error)}}function Pl(e,t){return Tl.call(e)===`[object ${t}]`}function Ml(e){return Pl(e,"ErrorEvent")}function Rl(e){return Pl(e,"DOMError")}function Ll(e){return Pl(e,"String")}function Nl(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function jl(e){return null===e||Nl(e)||"object"!=typeof e&&"function"!=typeof e}function Dl(e){return Pl(e,"Object")}function zl(e){return typeof Event<"u"&&Ul(e,Event)}function Bl(e){return!(!e||!e.then||"function"!=typeof e.then)}function Ul(e,t){try{return e instanceof t}catch{return!1}}function Vl(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function Hl(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function $l(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{Vl(n)?r.push("[VueViewModel]"):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Wl(e,t,r=!1){return!!Ll(e)&&(function(e){return Pl(e,"RegExp")}(t)?t.test(e):!!Ll(t)&&(r?e===t:e.includes(t)))}function Gl(e,t=[],r=!1){return t.some(t=>Wl(e,t,r))}function ql(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&Ul(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=Hl(e.value,t)),e))}(Yl(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function Yl(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(Ul(n[i],Error)){Xl(a,s);const o=e(t,n[i]),c=l.length;Kl(o,i,c,s),l=Yl(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(Ul(n,Error)){Xl(a,s);const c=e(t,n),u=l.length;Kl(c,`errors[${o}]`,u,s),l=Yl(e,t,r,n,i,[c,...l],c,u)}}),l}function Xl(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 Kl(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 Zl(e){return e&&e.Math==Math?e:void 0}const Jl="object"==typeof globalThis&&Zl(globalThis)||"object"==typeof window&&Zl(window)||"object"==typeof self&&Zl(self)||"object"==typeof global&&Zl(global)||function(){return this}()||{};function Ql(){return Jl}function ec(e,t,r){const n=r||Jl,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const tc=Ql();function rc(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=nc(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 nc(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(tc.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&&Ll(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 ic=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,oc=["debug","info","warn","error","log","assert","trace"],ac={};function sc(e){if(!("console"in Jl))return e();const t=Jl.console,r={},n=Object.keys(ac);n.forEach(e=>{const n=ac[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const lc=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return ic?oc.forEach(r=>{t[r]=(...t)=>{e&&sc(()=>{Jl.console[r](`Sentry Logger [${r}]:`,...t)})}}):oc.forEach(e=>{t[e]=()=>{}}),t}(),cc=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function uc(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 dc(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function hc(e){const t="string"==typeof e?function(e){const t=cc.exec(e);if(!t)return void sc(()=>{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 dc({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):dc(e);if(t&&function(e){if(!ic)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(lc.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(lc.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(lc.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(lc.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}class fc 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 pc(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&mc(i,n),e[t]=i}function gc(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{ic&&lc.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function mc(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,gc(e,"__sentry_original__",t)}catch{}}function vc(e){return e.__sentry_original__}function yc(e){if(Ol(e))return{message:e.message,name:e.name,stack:e.stack,...wc(e)};if(zl(e)){const t={type:e.type,target:bc(e.target),currentTarget:bc(e.currentTarget),...wc(e)};return typeof CustomEvent<"u"&&Ul(e,CustomEvent)&&(t.detail=e.detail),t}return e}function bc(e){try{return function(e){return typeof Element<"u"&&Ul(e,Element)}(e)?rc(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function wc(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 xc(e){return Cc(e,new Map)}function Cc(e,t){if(function(e){if(!Dl(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]=Cc(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(Cc(e,t))}),n}return e}const _c=/\(error: (.*)\)/,Sc=/captureMessage|captureException/;function kc(...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=_c.test(r)?r.replace(_c,"$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(),Sc.test(t[t.length-1].function||"")&&(t.pop(),Sc.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 Ac(e){return Array.isArray(e)?kc(...e):e}const Ic="<anonymous>";function Ec(e){try{return e&&"function"==typeof e&&e.name||Ic}catch{return Ic}}const Fc={},Tc={};function Oc(e,t){Fc[e]=Fc[e]||[],Fc[e].push(t)}function Pc(e,t){Tc[e]||(t(),Tc[e]=!0)}function Mc(e,t){const r=e&&Fc[e];if(r)for(const n of r)try{n(t)}catch(t){ic&&lc.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ec(n)}\nError:`,t)}}function Rc(){"console"in Jl&&oc.forEach(function(e){e in Jl.console&&pc(Jl.console,e,function(t){return ac[e]=t,function(...t){Mc("console",{args:t,level:e});const r=ac[e];r&&r.apply(Jl.console,t)}})})}function Lc(){const e=Jl,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 Nc(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function jc(e){const{message:t,event_id:r}=e;if(t)return t;const n=Nc(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Dc(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 zc(e,t){const r=Nc(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 Bc(e){if(e&&e.__sentry_captured__)return!0;try{gc(e,"__sentry_captured__",!0)}catch{}return!1}function Uc(e){return Array.isArray(e)?e:[e]}const Vc=Jl;let Hc,$c,Wc;function Gc(){if(!Vc.document)return;const e=Mc.bind(null,"dom"),t=qc(e,!0);Vc.document.addEventListener("click",t,!1),Vc.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=Vc[t]&&Vc[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(pc(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=qc(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),pc(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 qc(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;gc(r,"_sentryCaptured",!0),n&&!n._sentryId&&gc(n,"_sentryId",Lc());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==$c)return!1;try{if(!e.target||e.target._sentryId!==Wc)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),$c=r.type,Wc=n?n._sentryId:void 0),clearTimeout(Hc),Hc=Vc.setTimeout(()=>{Wc=void 0,$c=void 0},1e3)}}const Yc=Ql();function Xc(){if(!("fetch"in Yc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Kc(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Zc(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!Xc())return!1;if(Kc(Yc.fetch))return!0;let e=!1;const t=Yc.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=Kc(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){ic&&lc.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&pc(Jl,"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:Qc(t),method:Jc(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Qc(t),method:Jc(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Mc("fetch",{...i}),e.apply(Jl,t).then(e=>(Mc("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Mc("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function Jc(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Qc(e){return"string"==typeof e?e:e?Jc(e,"url")?e.url:e.toString?e.toString():"":""}let eu=null;function tu(){eu=Jl.onerror,Jl.onerror=function(e,t,r,n,i){return Mc("error",{column:n,error:i,line:r,msg:e,url:t}),!(!eu||eu.__SENTRY_LOADER__)&&eu.apply(this,arguments)},Jl.onerror.__SENTRY_INSTRUMENTED__=!0}let ru=null;function nu(){ru=Jl.onunhandledrejection,Jl.onunhandledrejection=function(e){return Mc("unhandledrejection",e),!(ru&&!ru.__SENTRY_LOADER__)||ru.apply(this,arguments)},Jl.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const iu=Ql();const ou=Jl;let au;function su(e){const t="history";Oc(t,e),Pc(t,lu)}function lu(){if(!function(){const e=iu.chrome,t=e&&e.app&&e.app.runtime,r="history"in iu&&!!iu.history.pushState&&!!iu.history.replaceState;return!t&&r}())return;const e=ou.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=au,t=String(r);au=t,Mc("history",{from:e,to:t})}return e.apply(this,t)}}ou.onpopstate=function(...t){const r=ou.location.href,n=au;if(au=r,Mc("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},pc(ou.history,"pushState",t),pc(ou.history,"replaceState",t)}const cu=Jl,uu="__sentry_xhr_v3__";function du(){if(!cu.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;pc(e,"open",function(e){return function(...t){const r=Date.now(),n=Ll(t[0])?t[0].toUpperCase():void 0,i=function(e){if(Ll(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[uu]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[uu];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}Mc("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?pc(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),pc(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[uu];return i&&Ll(r)&&Ll(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),pc(e,"send",function(e){return function(...t){const r=this[uu];if(!r)return e.apply(this,t);void 0!==t[0]&&(r.body=t[0]);return Mc("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}function hu(e,t=100,r=1/0){try{return pu("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function fu(e,t=3,r=102400){const n=hu(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?fu(e,t-1,r):n}function pu(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(Vl(t))return"[VueViewModel]";if(function(e){return Dl(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: ${Ec(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 pu("",c.toJSON(),l-1,n,i)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=yc(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]=pu(e,t,l-1,n,i),d++}return a(t),u}var gu;function mu(e){return new yu(t=>{t(e)})}function vu(e){return new yu((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(gu||(gu={}));class yu{constructor(e){yu.prototype.__init.call(this),yu.prototype.__init2.call(this),yu.prototype.__init3.call(this),yu.prototype.__init4.call(this),this._state=gu.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new yu((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 yu((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(gu.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(gu.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===gu.PENDING){if(Bl(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===gu.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===gu.RESOLVED&&e[1](this._value),this._state===gu.REJECTED&&e[2](this._value),e[0]=!0)})}}}function bu(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 vu(new fc("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 yu((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{mu(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}function wu(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 xu=["fatal","error","warning","log","info","debug"];function Cu(e){return"warn"===e?"warning":xu.includes(e)?e:"log"}function _u(){return Date.now()/1e3}const Su=function(){const{performance:e}=Jl;if(!e||!e.now)return _u;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function ku(e,t=[]){return[e,t]}function Au(e,t){const[r,n]=e;return[r,[...n,t]]}function Iu(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function Eu(e,t){return(t||new TextEncoder).encode(e)}function Fu(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Eu(i,t),e]:i.push("string"==typeof e?Eu(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(hu(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 Tu(e,t){const r="string"==typeof e.data?Eu(e.data,t):e.data;return[xc({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=Jl;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 Ou={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 Pu(e){return Ou[e]}function Mu(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function Ru(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 Lu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Nu="production";function ju(){return ec("globalEventProcessors",()=>[])}function Du(e){ju().push(e)}function zu(e,t,r,n=0){return new yu((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);Lu&&a.id&&null===s&&lc.log(`Event processor "${a.id}" dropped event`),Bl(s)?s.then(t=>zu(e,t,r,n+1).then(i)).then(null,o):zu(e,s,r,n+1).then(i).then(null,o)}})}function Bu(e){const t=Su(),r={sid:Lc(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return xc({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&&Uu(r,e),r}function Uu(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||Su(),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:Lc()),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 Vu(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),Uu(e,r)}function Hu(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=$u(e);return xc({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function $u(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function Wu(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||Lc(),timestamp:t.timestamp||_u()},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:Nu),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Hl(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Hl(a.value,o));const s=e.request;s&&s.url&&(s.url=Hl(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=Jl._sentryDebugIds;if(!r)return;let n;const i=Gu.get(t);i?n=i:(n=new Map,Gu.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 ld;return r.update(t),r}(n,r.captureContext);r.mechanism&&zc(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(sd||(sd=new ld),sd).getScopeData();if(o){od(h,o.getScopeData())}if(u){od(h,u.getScopeData())}const f=[...r.attachments||[],...h.attachments];f.length&&(r.attachments=f),id(l,h);return zu([...d,...ju(),...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:hu(e.data,t,r)}}))},...e.user&&{user:hu(e.user,t,r)},...e.contexts&&{contexts:hu(e.contexts,t,r)},...e.extra&&{extra:hu(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=hu(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=$u(e).data;return n&&(e.data=hu(n,t,r)),e})),n}(e,a,s):e))}const Gu=new WeakMap;function qu(e,t){return md().captureEvent(e,t)}function Yu(e,t){md().addBreadcrumb(e,t)}function Xu(){return md().getClient()}function Ku(){return md().getScope()}function Zu(e){const t=Xu(),r=vd(),n=Ku(),{release:i,environment:o=Nu}=t&&t.getOptions()||{},{userAgent:a}=Jl.navigator||{},s=Bu({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&Uu(l,{status:"exited"}),Ju(),r.setSession(s),n.setSession(s),s}function Ju(){const e=vd(),t=Ku(),r=t.getSession()||e.getSession();r&&Vu(r),Qu(),e.setSession(),t.setSession()}function Qu(){const e=vd(),t=Ku(),r=Xu(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function ed(e=!1){e?Ju():Qu()}function td(e){return e.transaction}function rd(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=xc({environment:n.environment||Nu,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function nd(e){const t=Xu();if(!t)return{};const r=rd($u(e).trace_id||"",t,Ku()),n=td(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=$u(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 id(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=xc(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=xc(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=xc(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=xc(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:Hu(t),...e.contexts};const r=td(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:nd(t),...e.sdkProcessingMetadata};const n=$u(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?Uc(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 od(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;ad(e,"extra",r),ad(e,"tags",n),ad(e,"user",i),ad(e,"contexts",o),ad(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 ad(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 sd;class ld{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=cd()}static clone(e){return e?e.clone():new ld}clone(){const e=new ld;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&&Uu(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 ld){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(Dl(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=cd(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:_u(),...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=[]){id(e,this.getScopeData());return zu([...r,...ju(),...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:Lc();if(!this._client)return lc.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:Lc();if(!this._client)return lc.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:Lc();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(lc.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 cd(){return{traceId:Lc(),spanId:Lc().substring(16)}}const ud="7.116.0",dd=parseFloat(ud),hd=100;class fd{constructor(e,t,r,n=dd){let i,o;this._version=n,t?i=t:(i=new ld,i.setClient(e)),r?o=r:(o=new ld,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 Bl(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:Lc(),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:Lc(),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:Lc();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=hd}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:_u(),...e},s=i?sc(()=>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=gd(this);try{e(this)}finally{gd(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Lu&&lc.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return Lu&&!r&&(this.getClient()?lc.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):lc.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&&Vu(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Nu}=r&&r.getOptions()||{},{userAgent:o}=Jl.navigator||{},a=Bu({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&Uu(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=pd().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Lu&&lc.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function pd(){return Jl.__SENTRY__=Jl.__SENTRY__||{extensions:{},hub:void 0},Jl}function gd(e){const t=pd(),r=yd(t);return bd(t,e),r}function md(){const e=pd();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=pd()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||yd(e).isOlderThan(dd))&&bd(e,new fd),yd(e)}(e)}function vd(){return md().getIsolationScope()}function yd(e){return ec("hub",()=>new fd,e)}function bd(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function wd(e,t,r,n){const i=Mu(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:uc(n)},...i&&{trace:xc({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,ku(a,[[{type:o},e]])}function xd(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 Cd=[];function _d(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?Uc(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 Sd(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function kd(e,t,r){if(r[t.name])Lu&&lc.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===Cd.indexOf(t.name)&&(t.setupOnce(Du,md),Cd.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)}Lu&&lc.log(`Integration installed: ${t.name}`)}}function Ad(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}function Id(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=uc(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 ku(i,[o])}const Ed="Not capturing exception because it's already been captured.";class Fd{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=hc(e.dsn):Lu&&lc.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)}?${xd(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(Bc(e))return void(Lu&&lc.log(Ed));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=Nl(e)?e:String(e),a=jl(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&&Bc(t.originalException))return void(Lu&&lc.log(Ed));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?Lu&&lc.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Uu(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))):mu(!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 Lu&&lc.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];kd(this,e,this._integrations),t||Sd(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=wd(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=Au(r,Tu(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=Mu(r);return ku({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:uc(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}`;Lu&&lc.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){Lu&&lc.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=Id(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&&kd(e,t,r)}),r}(this,e),Sd(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)&&(Uu(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new yu(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=vd()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),Wu(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||rd(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(Lu){const t=e;"log"===t.logLevel?lc.log(t.message):lc.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=Od(e),a=Td(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),vu(new fc(`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 fc("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 Td(t)&&n?n(t,r):Od(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Bl(e))return e.then(e=>{if(!Dl(e)&&null!==e)throw new fc(r);return e},e=>{throw new fc(`${t} rejected with ${e}`)});if(!Dl(e)&&null!==e)throw new fc(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new fc(`${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 fc?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new fc(`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=>{Lu&&lc.error("Error while sending event:",e)});Lu&&lc.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 Td(e){return void 0===e.type}function Od(e){return"transaction"===e.type}function Pd(e,t){!0===t.debug&&(Lu?lc.enable():sc(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Ku().update(t.initialScope);const r=new e(t);(function(e){const t=md().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)}function Md(e,t,r=bu(e.bufferSize||30)){let n={};function i(i){const o=[];if(Iu(i,(t,r)=>{const i=Pu(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=Rd(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return mu();const a=ku(i[0],o),s=t=>{Iu(a,(r,n)=>{const i=Rd(r,n);e.recordDroppedEvent(t,Pu(n),i)})};return r.add(()=>t({body:Fu(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Lu&&lc.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=Ru(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof fc)return Lu&&lc.error("Skipped sending event because buffer is full."),s("queue_overflow"),mu();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function Rd(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function Ld(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:ud})),version:ud}),e._metadata=i}const Nd=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],jd=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Dd="InboundFilters",zd=(e={})=>({name:Dd,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?[]:Nd],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:jd],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)?(Lu&&lc.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${jc(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}`)),Lu&&0===t.length&&lc.error(`Could not extract message for event ${jc(e)}`),t}(e).some(e=>Gl(e,t))}(e,t.ignoreErrors)?(Lu&&lc.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${jc(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&Gl(r,t)}(e,t.ignoreTransactions)?(Lu&&lc.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${jc(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=Bd(e);return!!r&&Gl(r,t)}(e,t.denyUrls)?(Lu&&lc.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${jc(e)}.\nUrl: ${Bd(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=Bd(e);return!r||Gl(r,t)}(e,t.allowUrls)&&(Lu&&lc.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${jc(e)}.\nUrl: ${Bd(e)}`),!0)}(t,o)?null:t}});function Bd(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 Lu&&lc.error(`Cannot extract url for event ${jc(e)}`),null}}let Ud;Ad(Dd,zd);const Vd="FunctionToString",Hd=new WeakMap,$d=()=>({name:Vd,setupOnce(){Ud=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=vc(this),r=Hd.has(Xu())&&void 0!==t?t:this;return Ud.apply(r,e)}}catch{}},setup(e){Hd.set(e,!0)}});Ad(Vd,$d);const Wd=Jl;let Gd=0;function qd(){return Gd>0}function Yd(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(vc(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=>Yd(e,t));return e.apply(this,i)}catch(e){throw Gd++,setTimeout(()=>{Gd--}),function(...e){const t=md();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&&(Dc(e,void 0),zc(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){md().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}mc(n,e),gc(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const Xd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Kd(e,t){const r=Jd(e,t),n={type:t&&t.name,value:eh(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Zd(e,t){return{exception:{values:[Kd(e,t)]}}}function Jd(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Qd.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const Qd=/Minified React error #\d+;/i;function eh(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function th(e,t,r,n,i){let o;if(Ml(t)&&t.error)return Zd(e,t.error);if(Rl(t)||function(e){return Pl(e,"DOMException")}(t)){const i=t;if("stack"in t)o=Zd(e,t);else{const t=i.name||(Rl(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=rh(e,a,r,n),Dc(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return Ol(t)?Zd(e,t):Dl(t)||zl(t)?(o=function(e,t,r,n){const i=Xu(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:zl(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:nh(t,{isUnhandledRejection:n})}]},extra:{__serialized__:fu(t,o)}};if(r){const t=Jd(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),zc(o,{synthetic:!0}),o):(o=rh(e,t,r,n),Dc(o,`${t}`),zc(o,{synthetic:!0}),o)}function rh(e,t,r,n){const i={};if(n&&r){const n=Jd(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(Nl(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 nh(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(yc(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Hl(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:Hl(n,t)}return""}(e),n=t?"promise rejection":"exception";return Ml(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:zl(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 ih extends Fd{constructor(e){Ld(e,"browser",["browser"],Wd.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Wd.document&&Wd.document.addEventListener("visibilitychange",()=>{"hidden"===Wd.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=th(e,t,r&&r.syntheticException||void 0,n);return zc(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),mu(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=rh(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),mu(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Xd&&lc.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:uc(n)}},o=function(e){return[{type:"user_report"},e]}(e);return ku(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(Xd&&lc.log("No outcomes to send"));if(!this._dsn)return void(Xd&&lc.log("No dsn provided, will not send outcomes"));Xd&&lc.log("Sending outcomes:",e);const t=function(e,t){return ku(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:_u(),discarded_events:e}]])}(e,this._options.tunnel&&uc(this._dsn));this._sendEnvelope(t)}}let oh;function ah(e,t=function(){if(oh)return oh;if(Kc(Wd.fetch))return oh=Wd.fetch.bind(Wd);const e=Wd.document;let t=Wd.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){Xd&&lc.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return oh=t.bind(Wd)}()){let r=0,n=0;return Md(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 oh=void 0,r-=o,n--,vu(e)}})}function sh(e){return Md(e,function(t){return new yu((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 lh="?";function ch(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 uh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,dh=/\((\S*)(?::(\d+))(?::(\d+))\)/,hh=[30,e=>{const t=uh.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=dh.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=bh(t[1]||lh,t[2]);return ch(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],fh=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ph=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gh=[50,e=>{const t=fh.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ph.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]||lh;return[r,e]=bh(r,e),ch(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],mh=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,vh=[40,e=>{const t=mh.exec(e);return t?ch(t[2],t[1]||lh,+t[3],t[4]?+t[4]:void 0):void 0}],yh=kc(...[hh,gh,vh]),bh=(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]:lh,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},wh=1024,xh="Breadcrumbs",Ch=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:xh,setupOnce(){},setup(e){t.console&&function(e){const t="console";Oc(t,e),Pc(t,Rc)}(function(e){return function(t){if(Xu()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:Cu(t.level),message:$l(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${$l(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}Yu(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){Oc("dom",e),Pc("dom",Gc)}(function(e,t){return function(r){if(Xu()!==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>wh&&(Xd&&lc.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=wh),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=rc(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!tc.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}),Yu(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){Oc("xhr",e),Pc("xhr",du)}(function(e){return function(t){if(Xu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[uu];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;Yu({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";Oc(t,e),Pc(t,Zc)}(function(e){return function(t){if(Xu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){Yu({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n})}else{const e=t.response;Yu({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&su(function(e){return function(t){if(Xu()!==e)return;let r=t.from,n=t.to;const i=wu(Wd.location.href);let o=r?wu(r):void 0;const a=wu(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),Yu({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){Xu()===e&&Yu({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:jc(t)},{event:t})}}(e))}}};Ad(xh,Ch);const _h="Dedupe",Sh=()=>{let e;return{name:_h,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||!Ah(e,t)||!kh(e,t))}(e,t)&&!function(e,t){const r=Ih(t),n=Ih(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&Ah(e,t)&&kh(e,t))}(e,t))}(t,e))return Xd&&lc.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function kh(e,t){let r=Eh(e),n=Eh(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 Ah(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 Ih(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Eh(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}Ad(_h,Sh);const Fh="GlobalHandlers",Th=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Fh,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";Oc(t,e),Pc(t,tu)}(t=>{const{stackParser:r,attachStacktrace:n}=Mh();if(Xu()!==e||qd())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&Ll(i)?function(e,t,r,n){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Ml(e)?e.message:e,a="Error";const s=o.match(i);return s&&(a=s[1],o=s[2]),Oh({exception:{values:[{type:a,value:o}]}},t,r,n)}(i,o,a,s):Oh(th(r,l||i,void 0,n,!1),o,a,s);c.level="error",qu(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Ph("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";Oc(t,e),Pc(t,nu)}(t=>{const{stackParser:r,attachStacktrace:n}=Mh();if(Xu()!==e||qd())return;const i=function(e){if(jl(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=jl(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):th(r,i,void 0,n,!0);o.level="error",qu(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Ph("onunhandledrejection"))}}};function Oh(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=Ll(t)&&t.length>0?t:function(){try{return tc.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Ph(e){Xd&&lc.log(`Global Handler attached: ${e}`)}function Mh(){const e=Xu();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}Ad(Fh,Th);const Rh="HttpContext",Lh=()=>({name:Rh,setupOnce(){},preprocessEvent(e){if(!Wd.navigator&&!Wd.location&&!Wd.document)return;const t=e.request&&e.request.url||Wd.location&&Wd.location.href,{referrer:r}=Wd.document||{},{userAgent:n}=Wd.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}});Ad(Rh,Lh);const Nh="LinkedErrors",jh=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:Nh,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();ql(Kd,o.stackParser,o.maxValueLength,r,t,e,n)}}};Ad(Nh,jh);const Dh=["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"],zh="TryCatch",Bh=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:zh,setupOnce(){t.setTimeout&&pc(Wd,"setTimeout",Uh),t.setInterval&&pc(Wd,"setInterval",Uh),t.requestAnimationFrame&&pc(Wd,"requestAnimationFrame",Vh),t.XMLHttpRequest&&"XMLHttpRequest"in Wd&&pc(XMLHttpRequest.prototype,"send",Hh);const e=t.eventTarget;e&&(Array.isArray(e)?e:Dh).forEach($h)}}};function Uh(e){return function(...t){const r=t[0];return t[0]=Yd(r,{mechanism:{data:{function:Ec(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Vh(e){return function(t){return e.apply(this,[Yd(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Ec(e)},handled:!1,type:"instrument"}})])}}function Hh(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&pc(r,e,function(t){const r={mechanism:{data:{function:e,handler:Ec(t)},handled:!1,type:"instrument"}},n=vc(t);return n&&(r.mechanism.data.handler=Ec(n)),Yd(t,r)})}),e.apply(this,t)}}function $h(e){const t=Wd,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(pc(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=Yd(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ec(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,Yd(n,{mechanism:{data:{function:"addEventListener",handler:Ec(n),target:e},handled:!1,type:"instrument"}}),i])}}),pc(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)}}))}Ad(zh,Bh);const Wh=[zd(),$d(),Bh(),Ch(),Th(),jh(),Sh(),Lh()];function Gh(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Wh]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Wd.SENTRY_RELEASE&&Wd.SENTRY_RELEASE.id&&(e.release=Wd.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Ac(e.stackParser||yh),integrations:_d(e),transport:e.transport||(Xc()?ah:sh)};Pd(ih,t),e.autoSessionTracking&&function(){if(typeof Wd.document>"u")return void(Xd&&lc.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));Zu({ignoreDuration:!0}),ed(),su(({from:e,to:t})=>{void 0!==e&&e!==t&&(Zu({ignoreDuration:!0}),ed())})}()}var qh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xh(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 Kh=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(Kh||{}),Zh=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(Zh||{});function Jh(e,t){return{...t,message:e}}const Qh=[{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}],ef={emoticons:Jh("Emoticons"),doodles:Jh("Doodles"),landmarks:Jh("Landmarks"),bubbles:Jh("Bubbles"),transportation:Jh("Transportation"),beach:Jh("Beach")},tf={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},rf=[1,8,15,20,25];var nf=(e=>(e.DARK="dark",e.LIGHT="light",e))(nf||{});const of=[{name:nf.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:nf.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 af=(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))(af||{});function sf(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=sf(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function lf(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=sf(e))&&(n&&(n+=" "),n+=t);return n}const cf=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:lf("svg-icon",s,uf(o)),style:{color:l,...c},ref:n,height:f||"1em",width:h||"1em",children:[a&&e("title",{children:a}),u]})});function uf(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 df(t,r="",n){return i.memo(i.forwardRef((i,o)=>e(cf,{"data-testid":`${r}Icon`,ref:o,viewBox:n,...i,size:i.size||"md",children:t})))}function hf(e,t=""){return df(ff(e),t)}function ff(e){return(null==e?void 0:e.map)&&e.map((e,t)=>i.createElement(e.tag,{key:t,...e.attr},ff(e.child)))}const pf=df(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),gf=df(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"),mf=df(e("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),vf=df(e("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),yf=df(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"),bf=df(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"),wf=df(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"),xf=df(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"),Cf=df(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"),_f=df(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"),Sf=df(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"),kf=df([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"),Af=df(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"),If=df(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"),Ef=df(e("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),Ff={[af.FILTER]:{name:Jh("Applied Filters"),icon:pf},[af.RESIZE]:{name:Jh("Resized Image"),icon:gf},[af.CROP]:{name:Jh("Cropped Image"),icon:mf},[af.DRAW]:{name:Jh("Added Drawing"),icon:If},[af.TEXT]:{name:Jh("Added Text"),icon:vf},[af.SHAPES]:{name:Jh("Added Shape"),icon:yf},[af.STICKERS]:{name:Jh("Added Sticker"),icon:bf},[af.FRAME]:{name:Jh("Added Frame"),icon:wf},[af.MERGE]:{name:Jh("Merged Objects"),icon:xf},[af.CORNERS]:{name:Jh("Rounded Corner"),icon:Cf},bgImage:{name:Jh("Replaced Background Image"),icon:_f},overlayImage:{name:Jh("Added Image"),icon:_f},initial:{name:Jh("Initial"),icon:Ef},loadedState:{name:Jh("Loaded State"),icon:Sf},objectStyle:{name:Jh("Changed Style"),icon:kf},deletedObject:{name:Jh("Deleted object"),icon:Af}},Tf=Object.values(af).map(e=>({name:e,icon:Ff[e].icon,action:e===af.MERGE?e=>{e.tools.merge.apply()}:e})),Of={filter:Jh("filter"),resize:Jh("resize"),crop:Jh("crop"),draw:Jh("draw"),text:Jh("text"),shapes:Jh("shapes"),stickers:Jh("stickers"),frame:Jh("frame"),corners:Jh("corners"),merge:Jh("merge")},Pf=df(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"),Mf="3.0.5",Rf={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:Kh.INLINE,forceOverlayModeOnMobile:!0,activeTheme:nf.LIGHT,themes:of,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:Sf,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:Pf,label:Jh("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:Zh.BOTTOM,items:[...Tf]},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:{...tf},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:rf,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:Qh},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}}]}}},Lf=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 Nf={exports:{}},jf={},Df={exports:{}},zf={},Bf=i;
9
+ */var Io=(So||(So=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]",k="[object RegExp]",A="[object Set]",I="[object String]",E="[object Symbol]",F="[object WeakMap]",T="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",M="[object Float64Array]",R="[object Int8Array]",L="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",D="[object Uint8ClampedArray]",z="[object Uint16Array]",B="[object Uint32Array]",U=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,G=RegExp($.source),q=RegExp(W.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",ke="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Ee="["+we+"]",Fe="["+Ae+"]",Te="["+xe+"]",Oe="\\d+",Pe="["+Ce+"]",Me="["+_e+"]",Re="[^"+we+Ae+Oe+Ce+_e+Se+"]",Le="\\ud83c[\\udffb-\\udfff]",Ne="[^"+we+"]",je="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",ze="["+Se+"]",Be="\\u200d",Ue="(?:"+Me+"|"+Re+")",Ve="(?:"+ze+"|"+Re+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Te+"|"+Le+")?",Ge="["+ke+"]?",qe=Ge+We+"(?:"+Be+"(?:"+[Ne,je,De].join("|")+")"+Ge+We+")*",Ye="(?:"+[Pe,je,De].join("|")+")"+qe,Xe="(?:"+[Ne+Te+"?",Te,je,De,Ee].join("|")+")",Ke=RegExp(Ie,"g"),Ze=RegExp(Te,"g"),Je=RegExp(Le+"(?="+Le+")|"+Xe+qe,"g"),Qe=RegExp([ze+"?"+Me+"+"+He+"(?="+[Fe,ze,"$"].join("|")+")",Ve+"+"+$e+"(?="+[Fe,ze+Ue,"$"].join("|")+")",ze+"?"+Ue+"+"+He,ze+"+"+$e,"\\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+ke+"]"),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[N]=it[j]=it[D]=it[z]=it[B]=!0,it[p]=it[g]=it[T]=it[m]=it[O]=it[v]=it[y]=it[b]=it[x]=it[C]=it[_]=it[k]=it[A]=it[I]=it[F]=!1;var ot={};ot[p]=ot[g]=ot[T]=ot[O]=ot[m]=ot[v]=ot[P]=ot[M]=ot[R]=ot[L]=ot[N]=ot[x]=ot[C]=ot[_]=ot[k]=ot[A]=ot[I]=ot[E]=ot[j]=ot[D]=ot[z]=ot[B]=!0,ot[y]=ot[b]=ot[F]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof Rn&&Rn&&Rn.Object===Object&&Rn,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&&gt.binding&&gt.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 kt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function It(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 Et(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 Ft(e,t){return!(null==e||!e.length)&&zt(e,t,0)>-1}function Tt(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 Nt=Ht("length");function jt(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function Dt(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):Dt(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?Gt(e,t)/r:d}function Ht(e){return function(t){return null==t?r:t[e]}}function $t(e){return function(t){return null==e?r:e[t]}}function Wt(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function Gt(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 qt(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=$t({"À":"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=$t({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});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):Nt(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=$t({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),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,ke=t.Object,Ae=t.RegExp,Ie=t.String,Ee=t.TypeError,Fe=we.prototype,Te=_e.prototype,Oe=ke.prototype,Pe=t["__core-js_shared__"],Me=Te.toString,Re=Oe.hasOwnProperty,Le=0,Ne=(ne=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",je=Oe.toString,De=Me.call(ke),ze=dt._,Be=Ae("^"+Me.call(Re).replace(ee,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ue=pt?t.Buffer:r,Ve=t.Symbol,He=t.Uint8Array,$e=Ue?Ue.allocUnsafe:r,We=or(ke.getPrototypeOf,ke),Ge=ke.create,qe=Oe.propertyIsEnumerable,Ye=Fe.splice,Xe=Ve?Ve.isConcatSpreadable:r,Je=Ve?Ve.iterator:r,et=Ve?Ve.toStringTag:r,at=function(){try{var e=uo(ke,"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=ke.getOwnPropertySymbols,Nt=Ue?Ue.isBuffer:r,$t=t.isFinite,pr=Fe.join,gr=or(ke.keys,ke),mr=Se.max,vr=Se.min,yr=xe.now,br=t.parseInt,wr=Se.random,xr=Fe.reverse,Cr=uo(t,"DataView"),_r=uo(t,"Map"),Sr=uo(t,"Promise"),kr=uo(t,"Set"),Ar=uo(t,"WeakMap"),Ir=uo(ke,"create"),Er=Ar&&new Ar,Fr={},Tr=jo(Cr),Or=jo(_r),Pr=jo(Sr),Mr=jo(kr),Rr=jo(Ar),Lr=Ve?Ve.prototype:r,Nr=Lr?Lr.valueOf:r,jr=Lr?Lr.toString:r;function Dr(e){if(es(e)&&!Ha(e)&&!(e instanceof Vr)){if(e instanceof Ur)return e;if(Re.call(e,"__wrapped__"))return Do(e)}return new Ur(e)}var zr=function(){function e(){}return function(t){if(!Qa(t))return{};if(Ge)return Ge(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 $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 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 Gr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Wr;++t<r;)this.add(e[t])}function qr(e){var t=this.__data__=new $r(e);this.size=t.size}function Yr(e,t){var r=Ha(e),n=!r&&Va(e),i=!r&&!n&&qa(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?qt(e.length,Ie):[],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[qn(0,t-1)]:r}function Kr(e,t){return Ro(Ei(e),an(t,0,e.length))}function Zr(e){return Ro(Ei(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&&Fi(t,Ts(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:ks(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 Ei(e,s)}else{var h=po(e),f=h==b||h==w;if(qa(e))return Ci(e,l);if(h==_||h==p||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return Fi(e,fo(e),t)}(e,function(e,t){return e&&Fi(t,Os(t),e)}(s,e)):function(e,t){return Fi(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 T: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 N:case j:case D:case z:case B:return Si(e,r);case x:return new i;case C:case I:return new i(e);case k:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return new i;case E:return n=e,Nr?ke(Nr.call(n)):{}}}(e,h,l)}}a||(a=new qr);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:Ts)(e);return kt(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=ke(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 Ee(n);return To(function(){e.apply(r,i)},t)}function un(e,t,r,n){var i=-1,o=Ft,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;r&&(t=Ot(t,Xt(r))),n?(o=Tt,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Gr(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}Dr.templateSettings={escape:Y,evaluate:X,interpolate:K,variable:"",imports:{_:Dr}},Dr.prototype=Br.prototype,Dr.prototype.constructor=Dr,Ur.prototype=zr(Br.prototype),Ur.prototype.constructor=Ur,Vr.prototype=zr(Br.prototype),Vr.prototype.constructor=Vr,Hr.prototype.clear=function(){this.__data__=Ir?Ir(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(Ir){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 Ir?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]=Ir&&t===r?i:t,this},$r.prototype.clear=function(){this.__data__=[],this.size=0},$r.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))},$r.prototype.get=function(e){var t=this.__data__,n=en(t,e);return n<0?r:t[n][1]},$r.prototype.has=function(e){return en(this.__data__,e)>-1},$r.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},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Hr,map:new(_r||$r),string:new Hr}},Wr.prototype.delete=function(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return lo(this,e).get(e)},Wr.prototype.has=function(e){return lo(this,e).has(e)},Wr.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},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.clear=function(){this.__data__=new $r,this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},qr.prototype.get=function(e){return this.__data__.get(e)},qr.prototype.has=function(e){return this.__data__.has(e)},qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof $r){var n=r.__data__;if(!_r||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(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,Ts)}function wn(e,t){return e&&yn(e,t,Ts)}function xn(e,t){return Et(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[No(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 ke(e)?function(e){var t=Re.call(e,et),n=e[et];try{e[et]=r;var i=!0}catch(e){}var o=je.call(e);return i&&(t?e[et]=n:delete e[et]),o}(e):function(e){return je.call(e)}(e)}function kn(e,t){return e>t}function An(e,t){return null!=e&&Re.call(e,t)}function In(e,t){return null!=e&&t in ke(e)}function En(e,t,n){for(var i=n?Tt:Ft,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 Gr(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 Fn(e,t,n){var i=null==(e=Io(e,t=yi(t,e)))?e:e[No(Xo(t))];return null==i?r:_t(i,e,n)}function Tn(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&&qa(e)){if(!qa(t))return!1;s=!0,d=!1}if(f&&!d)return a||(a=new qr),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 T: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 k:case I:return e==t+"";case x:var s=ir;case A: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 E:if(Nr)return Nr.call(e)==Nr.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,F=w?t.value():t;return a||(a=new qr),o(S,F,n,i,a)}}return!!f&&(a||(a=new qr),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=ke(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 qr;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,Ne&&Ne in t))&&(Ka(e)?Be:pe).test(jo(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 ke(e))Re.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Nn(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var r in ke(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 jn(e,t){return e<t}function Dn(e,t){var r=-1,n=Wa(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]?ko(t[0][0],t[0][1]):function(r){return r===e||Pn(r,e,t)}}function Bn(e,t){return wo(e)&&So(t)?ko(No(e),t):function(n){var i=ks(n,e);return i===r&&i===t?As(n,e):On(t,i,3)}}function Un(e,t,n,i,o){e!==t&&vn(t,function(a,s){if(o||(o=new qr),Qa(a))!function(e,t,n,i,o,a,s){var l=Eo(e,n),c=Eo(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&&qa(c),g=!f&&!p&&ls(c);d=c,f||p||g?Ha(l)?d=l:Ga(l)?d=Ei(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(Eo(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=Dn(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=ki(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 $n(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 Wn(e,t,r,n){var i=n?Bt:zt,o=-1,a=t.length,s=e;for(e===t&&(t=Ei(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 Gn(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 qn(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(Ao(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=No(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=Er?function(e,t){return Er.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 jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ci(e,t,r){var n=-1,i=Ft,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Tt;else if(o>=200){var c=t?null:Yi(e);if(c)return sr(c);a=!1,i=Zt,l=new Gr}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=Io(e,t=yi(t,e)))||delete e[No(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 Ga(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=$e?$e(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 ki(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 Ai(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 Ii(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 Ei(e,t){var r=-1,n=e.length;for(t||(t=we(n));++r<n;)t[r]=e[r];return t}function Fi(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 Ti(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=ke(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(!Wa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=ke(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=ke(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 Ni(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 ji(e){return function(t,n,i){var o=ke(t);if(!Wa(t)){var a=so(n,3);t=Ts(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 Di(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 Ee(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:Ni(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=Ai(b,i,o,g)),a&&(b=Ii(b,a,l,g)),y-=C,g&&y<d){var _=ar(b,x);return Gi(e,t,zi,s.placeholder,n,b,_,c,u,d-y)}var S=f?n:this,k=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var n=e.length,i=vr(t.length,n),o=Ei(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&&(k=v||Ni(k)),k.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 $i(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 Wi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gs(t),r=gs(r)),e(t,r)}}function Gi(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)&&Fo(p,f),p.placeholder=i,Po(p,e,t)}function qi(e){var t=Se[e];return function(e,r){if(e=gs(e),(r=null==r?0:vr(fs(r),292))&&$t(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=kr&&1/sr(new kr([,-0]))[1]==c?function(e){return new kr(e)}:sl;function Xi(e){return function(t){var r=po(t);return r==x?ir(t):r==A?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 Ee(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?Ai(d,u,t[4]):u,e[4]=d?ar(e[3],o):t[4]}(u=t[5])&&(d=e[5],e[5]=d?Ii(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=Ni(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?Gi(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=Ni(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=Ni(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:Fo)(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 Gr: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(Ao(e,r,$o),e+"")}function ro(e){return _n(e,Ts,ho)}function no(e){return _n(e,Os,fo)}var io=Er?function(e){return Er.get(e)}:sl;function oo(e){for(var t=e.name+"",r=Fr[t],n=Re.call(Fr,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(Dr,"placeholder")?Dr:e).placeholder}function so(){var e=Dr.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=Ts(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=ke(e),Et(mt(e),function(t){return qe.call(e,t)}))}:pl,fo=mt?function(e){for(var t=[];e;)Pt(t,ho(e)),e=We(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=No(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(We(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?Wa(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 ke(t)}function xo(e){var t=oo(e),r=Dr[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||kr&&po(new kr)!=A||Ar&&po(new Ar)!=F)&&(po=function(e){var t=Sn(e),n=t==_?e.constructor:r,i=n?jo(n):"";if(i)switch(i){case Tr:return O;case Or:return x;case Pr:return S;case Mr:return A;case Rr:return F}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 ko(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in ke(n))}}function Ao(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 Io(e,t){return t.length<2?e:Cn(e,ri(t,0,-1))}function Eo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Fo=Mo(Qn),To=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 kt(f,function(r){var n="_."+r[0];t&r[1]&&!Ft(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=qn(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 No(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function jo(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Do(e){if(e instanceof Vr)return e.clone();var t=new Ur(e.__wrapped__,e.__chain__);return t.__actions__=Ei(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var zo=Xn(function(e,t){return Ga(e)?un(e,mn(t,1,Ga,!0)):[]}),Bo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!0),so(n,2)):[]}),Uo=Xn(function(e,t){var n=Xo(t);return Ga(n)&&(n=r),Ga(e)?un(e,mn(t,1,Ga,!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)),Dt(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)),Dt(e,so(t,3),o,!0)}function $o(e){return null!=e&&e.length?mn(e,1):[]}function Wo(e){return e&&e.length?e[0]:r}var Go=Xn(function(e){var t=Ot(e,mi);return t.length&&t[0]===e[0]?En(t):[]}),qo=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]?En(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]?En(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?Wn(e,t):e}var Jo=to(function(e,t){var r=null==e?0:e.length,n=on(e,t);return Gn(e,Ot(t,function(e){return yo(e,r)?+e:e}).sort(ki)),n});function Qo(e){return null==e?e:xr.call(e)}var ea=Xn(function(e){return ci(mn(e,1,Ga,!0))}),ta=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),ci(mn(e,1,Ga,!0),so(t,2))}),ra=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,ci(mn(e,1,Ga,!0),r,t)});function na(e){if(!e||!e.length)return[];var t=0;return e=Et(e,function(e){if(Ga(e))return t=mr(e.length,t),!0}),qt(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 Ga(e)?un(e,t):[]}),aa=Xn(function(e){return pi(Et(e,Ga))}),sa=Xn(function(e){var t=Xo(e);return Ga(t)&&(t=r),pi(Et(e,Ga),so(t,2))}),la=Xn(function(e){var t=Xo(e);return t="function"==typeof t?t:r,pi(Et(e,Ga),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=Dr(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=Ti(function(e,t,r){Re.call(e,r)?++e[r]:nn(e,r,1)}),ga=ji(Vo),ma=ji(Ho);function va(e,t){return(Ha(e)?kt:dn)(e,so(t,3))}function ya(e,t){return(Ha(e)?At:hn)(e,so(t,3))}var ba=Ti(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=Wa(e)?we(e.length):[];return dn(e,function(e){o[++n]=i?_t(t,e,r):Fn(e,t,r)}),o}),xa=Ti(function(e,t,r){nn(e,r,t)});function Ca(e,t){return(Ha(e)?Ot:Dn)(e,so(t,3))}var _a=Ti(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),[])}),ka=ut||function(){return dt.Date.now()};function Aa(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Ki(e,s,r,r,r,r,t)}function Ia(e,t){var i;if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ea=Xn(function(e,t,r){var n=1;if(r.length){var i=ar(r,ao(Ea));n|=a}return Ki(e,n,t,r,i)}),Fa=Xn(function(e,t,r){var n=3;if(r.length){var i=ar(r,ao(Fa));n|=a}return Ki(t,n,e,r,i)});function Ta(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ee(n);function g(t){var n=o,i=a;return o=a=r,d=t,l=e.apply(i,n)}function m(e){var n=e-u;return u===r||n>=t||n<0||f&&e-d>=s}function v(){var e=ka();if(m(e))return y(e);c=To(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=ka(),n=m(e);if(o=arguments,a=this,u=e,n){if(c===r)return function(e){return d=e,c=To(v,t),h?g(e):l}(u);if(f)return xi(c),c=To(v,t),g(u)}return c===r&&(c=To(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(ka())},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 Ee(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ma.Cache||Wr),r}function Ra(e){if("function"!=typeof e)throw new Ee(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ma.Cache=Wr;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)})}),Na=Xn(function(e,t){var n=ar(t,ao(Na));return Ki(e,a,r,t,n)}),ja=Xn(function(e,t){var n=ar(t,ao(ja));return Ki(e,64,r,t,n)}),Da=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=Wi(kn),Ua=Wi(function(e,t){return e>=t}),Va=Tn(function(){return arguments}())?Tn:function(e){return es(e)&&Re.call(e,"callee")&&!qe.call(e,"callee")},Ha=we.isArray,$a=vt?Xt(vt):function(e){return es(e)&&Sn(e)==T};function Wa(e){return null!=e&&Ja(e.length)&&!Ka(e)}function Ga(e){return es(e)&&Wa(e)}var qa=Nt||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=We(e);if(null===t)return!0;var r=Re.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Me.call(r)==De}var is=wt?Xt(wt):function(e){return es(e)&&Sn(e)==k},os=xt?Xt(xt):function(e){return es(e)&&po(e)==A};function as(e){return"string"==typeof e||!Ha(e)&&es(e)&&Sn(e)==I}function ss(e){return"symbol"==typeof e||es(e)&&Sn(e)==E}var ls=Ct?Xt(Ct):function(e){return es(e)&&Ja(e.length)&&!!it[Sn(e)]},cs=Wi(jn),us=Wi(function(e,t){return e<=t});function ds(e){if(!e)return[];if(Wa(e))return as(e)?ur(e):Ei(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==A?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 Fi(e,Os(e))}function vs(e){return null==e?"":li(e)}var ys=Oi(function(e,t){if(_o(t)||Wa(t))Fi(t,Ts(t),e);else for(var r in t)Re.call(t,r)&&Qr(e,r,t[r])}),bs=Oi(function(e,t){Fi(t,Os(t),e)}),ws=Oi(function(e,t,r,n){Fi(t,Os(t),e,n)}),xs=Oi(function(e,t,r,n){Fi(t,Ts(t),e,n)}),Cs=to(on),_s=Xn(function(e,t){e=ke(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 ks(e,t,n){var i=null==e?r:Cn(e,t);return i===r?n:i}function As(e,t){return null!=e&&go(e,t,In)}var Is=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r},Qs(rl)),Es=Bi(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Re.call(e,t)?e[t].push(r):e[t]=[r]},so),Fs=Xn(Fn);function Ts(e){return Wa(e)?Yr(e):Ln(e)}function Os(e){return Wa(e)?Yr(e,!0):Nn(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}),Fi(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 $n(e,t,function(t,r){return As(e,r)})}(e,t)});function Ns(e,t){if(null==e)return{};var r=Ot(no(e),function(e){return[e]});return t=so(t),$n(e,r,function(e,r){return t(e,r[0])})}var js=Xi(Ts),Ds=Xi(Os);function zs(e){return null==e?[]:Kt(e,Ts(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()}),$s=Li(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),Ws=Ri("toLowerCase"),Gs=Li(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),qs=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 kt(t,function(t){t=No(t),nn(e,t,Ea(e[t],e))}),e});function Qs(e){return function(){return e}}var el=Di(),tl=Di(!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 Fn(r,e,t)}}),ol=Xn(function(e,t){return function(r){return Fn(e,r,t)}});function al(e,t,r){var n=Ts(t),i=xn(t,n);null!=r||Qa(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=xn(t,Ts(t)));var o=!(Qa(r)&&"chain"in r&&!r.chain),a=Ka(e);return kt(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__=Ei(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(It),ul=Vi(Lt);function dl(e){return wo(e)?Ht(No(e)):function(e){return function(t){return Cn(t,e)}}(e)}var hl=$i(),fl=$i(!0);function pl(){return[]}function gl(){return!1}var ml,vl=Ui(function(e,t){return e+t},0),yl=qi("ceil"),bl=Ui(function(e,t){return e/t},1),wl=qi("floor"),xl=Ui(function(e,t){return e*t},1),Cl=qi("round"),_l=Ui(function(e,t){return e-t},0);return Dr.after=function(e,t){if("function"!=typeof t)throw new Ee(n);return e=fs(e),function(){if(--e<1)return t.apply(this,arguments)}},Dr.ary=Aa,Dr.assign=ys,Dr.assignIn=bs,Dr.assignInWith=ws,Dr.assignWith=xs,Dr.at=Cs,Dr.before=Ia,Dr.bind=Ea,Dr.bindAll=Js,Dr.bindKey=Fa,Dr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ha(e)?e:[e]},Dr.chain=da,Dr.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},Dr.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},Dr.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)?Ei(r):[r],mn(t,1))},Dr.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 Ee(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)}})},Dr.conforms=function(e){return function(e){var t=Ts(e);return function(r){return ln(r,e,t)}}(sn(e,1))},Dr.constant=Qs,Dr.countBy=pa,Dr.create=function(e,t){var r=zr(e);return null==t?r:rn(r,t)},Dr.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},Dr.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},Dr.debounce=Ta,Dr.defaults=_s,Dr.defaultsDeep=Ss,Dr.defer=Oa,Dr.delay=Pa,Dr.difference=zo,Dr.differenceBy=Bo,Dr.differenceWith=Uo,Dr.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):[]},Dr.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):[]},Dr.dropRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0,!0):[]},Dr.dropWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!0):[]},Dr.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)):[]},Dr.filter=function(e,t){return(Ha(e)?Et:gn)(e,so(t,3))},Dr.flatMap=function(e,t){return mn(Ca(e,t),1)},Dr.flatMapDeep=function(e,t){return mn(Ca(e,t),c)},Dr.flatMapDepth=function(e,t,n){return n=n===r?1:fs(n),mn(Ca(e,t),n)},Dr.flatten=$o,Dr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Dr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===r?1:fs(t)):[]},Dr.flip=function(e){return Ki(e,512)},Dr.flow=el,Dr.flowRight=tl,Dr.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},Dr.functions=function(e){return null==e?[]:xn(e,Ts(e))},Dr.functionsIn=function(e){return null==e?[]:xn(e,Os(e))},Dr.groupBy=ba,Dr.initial=function(e){return null!=e&&e.length?ri(e,0,-1):[]},Dr.intersection=Go,Dr.intersectionBy=qo,Dr.intersectionWith=Yo,Dr.invert=Is,Dr.invertBy=Es,Dr.invokeMap=wa,Dr.iteratee=nl,Dr.keyBy=xa,Dr.keys=Ts,Dr.keysIn=Os,Dr.map=Ca,Dr.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},Dr.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},Dr.matches=function(e){return zn(sn(e,1))},Dr.matchesProperty=function(e,t){return Bn(e,sn(t,1))},Dr.memoize=Ma,Dr.merge=Ps,Dr.mergeWith=Ms,Dr.method=il,Dr.methodOf=ol,Dr.mixin=al,Dr.negate=Ra,Dr.nthArg=function(e){return e=fs(e),Xn(function(t){return Vn(t,e)})},Dr.omit=Rs,Dr.omitBy=function(e,t){return Ns(e,Ra(so(t)))},Dr.once=function(e){return Ia(2,e)},Dr.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))},Dr.over=ll,Dr.overArgs=La,Dr.overEvery=cl,Dr.overSome=ul,Dr.partial=Na,Dr.partialRight=ja,Dr.partition=_a,Dr.pick=Ls,Dr.pickBy=Ns,Dr.property=dl,Dr.propertyOf=function(e){return function(t){return null==e?r:Cn(e,t)}},Dr.pull=Ko,Dr.pullAll=Zo,Dr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Wn(e,t,so(r,2)):e},Dr.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Wn(e,t,r,n):e},Dr.pullAt=Jo,Dr.range=hl,Dr.rangeRight=fl,Dr.rearg=Da,Dr.reject=function(e,t){return(Ha(e)?Et:gn)(e,Ra(so(t,3)))},Dr.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 Gn(e,i),r},Dr.rest=function(e,t){if("function"!=typeof e)throw new Ee(n);return Xn(e,t=t===r?t:fs(t))},Dr.reverse=Qo,Dr.sampleSize=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),(Ha(e)?Kr:Zn)(e,t)},Dr.set=function(e,t,r){return null==e?e:Jn(e,t,r)},Dr.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Jn(e,t,n,i)},Dr.shuffle=function(e){return(Ha(e)?Zr:ti)(e)},Dr.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)):[]},Dr.sortBy=Sa,Dr.sortedUniq=function(e){return e&&e.length?ai(e):[]},Dr.sortedUniqBy=function(e,t){return e&&e.length?ai(e,so(t,2)):[]},Dr.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):[]},Dr.spread=function(e,t){if("function"!=typeof e)throw new Ee(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)})},Dr.tail=function(e){var t=null==e?0:e.length;return t?ri(e,1,t):[]},Dr.take=function(e,t,n){return e&&e.length?ri(e,0,(t=n||t===r?1:fs(t))<0?0:t):[]},Dr.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):[]},Dr.takeRightWhile=function(e,t){return e&&e.length?hi(e,so(t,3),!1,!0):[]},Dr.takeWhile=function(e,t){return e&&e.length?hi(e,so(t,3)):[]},Dr.tap=function(e,t){return t(e),e},Dr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ee(n);return Qa(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Ta(e,t,{leading:i,maxWait:t,trailing:o})},Dr.thru=ha,Dr.toArray=ds,Dr.toPairs=js,Dr.toPairsIn=Ds,Dr.toPath=function(e){return Ha(e)?Ot(e,No):ss(e)?[e]:Ei(Lo(vs(e)))},Dr.toPlainObject=ms,Dr.transform=function(e,t,r){var n=Ha(e),i=n||qa(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(We(e)):{}}return(i?kt:bn)(e,function(e,n,i){return t(r,e,n,i)}),r},Dr.unary=function(e){return Aa(e,1)},Dr.union=ea,Dr.unionBy=ta,Dr.unionWith=ra,Dr.uniq=function(e){return e&&e.length?ci(e):[]},Dr.uniqBy=function(e,t){return e&&e.length?ci(e,so(t,2)):[]},Dr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?ci(e,r,t):[]},Dr.unset=function(e,t){return null==e||ui(e,t)},Dr.unzip=na,Dr.unzipWith=ia,Dr.update=function(e,t,r){return null==e?e:di(e,t,vi(r))},Dr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:di(e,t,vi(n),i)},Dr.values=zs,Dr.valuesIn=function(e){return null==e?[]:Kt(e,Os(e))},Dr.without=oa,Dr.words=Ks,Dr.wrap=function(e,t){return Na(vi(t),e)},Dr.xor=aa,Dr.xorBy=sa,Dr.xorWith=la,Dr.zip=ca,Dr.zipObject=function(e,t){return gi(e||[],t||[],Qr)},Dr.zipObjectDeep=function(e,t){return gi(e||[],t||[],Jn)},Dr.zipWith=ua,Dr.entries=js,Dr.entriesIn=Ds,Dr.extend=bs,Dr.extendWith=ws,al(Dr,Dr),Dr.add=vl,Dr.attempt=Zs,Dr.camelCase=Bs,Dr.capitalize=Us,Dr.ceil=yl,Dr.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)},Dr.clone=function(e){return sn(e,4)},Dr.cloneDeep=function(e){return sn(e,5)},Dr.cloneDeepWith=function(e,t){return sn(e,5,t="function"==typeof t?t:r)},Dr.cloneWith=function(e,t){return sn(e,4,t="function"==typeof t?t:r)},Dr.conformsTo=function(e,t){return null==t||ln(e,t,Ts(t))},Dr.deburr=Vs,Dr.defaultTo=function(e,t){return null==e||e!=e?t:e},Dr.divide=bl,Dr.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},Dr.eq=za,Dr.escape=function(e){return(e=vs(e))&&q.test(e)?e.replace(W,tr):e},Dr.escapeRegExp=function(e){return(e=vs(e))&&te.test(e)?e.replace(ee,"\\$&"):e},Dr.every=function(e,t,n){var i=Ha(e)?It:fn;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.find=ga,Dr.findIndex=Vo,Dr.findKey=function(e,t){return jt(e,so(t,3),bn)},Dr.findLast=ma,Dr.findLastIndex=Ho,Dr.findLastKey=function(e,t){return jt(e,so(t,3),wn)},Dr.floor=wl,Dr.forEach=va,Dr.forEachRight=ya,Dr.forIn=function(e,t){return null==e?e:vn(e,so(t,3),Os)},Dr.forInRight=function(e,t){return null==e?e:yn(e,so(t,3),Os)},Dr.forOwn=function(e,t){return e&&bn(e,so(t,3))},Dr.forOwnRight=function(e,t){return e&&wn(e,so(t,3))},Dr.get=ks,Dr.gt=Ba,Dr.gte=Ua,Dr.has=function(e,t){return null!=e&&go(e,t,An)},Dr.hasIn=As,Dr.head=Wo,Dr.identity=rl,Dr.includes=function(e,t,r,n){e=Wa(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},Dr.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)},Dr.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)},Dr.invoke=Fs,Dr.isArguments=Va,Dr.isArray=Ha,Dr.isArrayBuffer=$a,Dr.isArrayLike=Wa,Dr.isArrayLikeObject=Ga,Dr.isBoolean=function(e){return!0===e||!1===e||es(e)&&Sn(e)==m},Dr.isBuffer=qa,Dr.isDate=Ya,Dr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Dr.isEmpty=function(e){if(null==e)return!0;if(Wa(e)&&(Ha(e)||"string"==typeof e||"function"==typeof e.splice||qa(e)||ls(e)||Va(e)))return!e.length;var t=po(e);if(t==x||t==A)return!e.size;if(_o(e))return!Ln(e).length;for(var r in e)if(Re.call(e,r))return!1;return!0},Dr.isEqual=function(e,t){return On(e,t)},Dr.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},Dr.isError=Xa,Dr.isFinite=function(e){return"number"==typeof e&&$t(e)},Dr.isFunction=Ka,Dr.isInteger=Za,Dr.isLength=Ja,Dr.isMap=ts,Dr.isMatch=function(e,t){return e===t||Pn(e,t,co(t))},Dr.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Pn(e,t,co(t),n)},Dr.isNaN=function(e){return rs(e)&&e!=+e},Dr.isNative=function(e){if(Co(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mn(e)},Dr.isNil=function(e){return null==e},Dr.isNull=function(e){return null===e},Dr.isNumber=rs,Dr.isObject=Qa,Dr.isObjectLike=es,Dr.isPlainObject=ns,Dr.isRegExp=is,Dr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=u},Dr.isSet=os,Dr.isString=as,Dr.isSymbol=ss,Dr.isTypedArray=ls,Dr.isUndefined=function(e){return e===r},Dr.isWeakMap=function(e){return es(e)&&po(e)==F},Dr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==Sn(e)},Dr.join=function(e,t){return null==e?"":pr.call(e,t)},Dr.kebabCase=Hs,Dr.last=Xo,Dr.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):Dt(e,Ut,o,!0)},Dr.lowerCase=$s,Dr.lowerFirst=Ws,Dr.lt=cs,Dr.lte=us,Dr.max=function(e){return e&&e.length?pn(e,rl,kn):r},Dr.maxBy=function(e,t){return e&&e.length?pn(e,so(t,2),kn):r},Dr.mean=function(e){return Vt(e,rl)},Dr.meanBy=function(e,t){return Vt(e,so(t,2))},Dr.min=function(e){return e&&e.length?pn(e,rl,jn):r},Dr.minBy=function(e,t){return e&&e.length?pn(e,so(t,2),jn):r},Dr.stubArray=pl,Dr.stubFalse=gl,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=xl,Dr.nth=function(e,t){return e&&e.length?Vn(e,fs(t)):r},Dr.noConflict=function(){return dt._===this&&(dt._=ze),this},Dr.noop=sl,Dr.now=ka,Dr.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)},Dr.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},Dr.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},Dr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(vs(e).replace(re,""),t||0)},Dr.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 qn(e,t)},Dr.reduce=function(e,t,r){var n=Ha(e)?Mt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,dn)},Dr.reduceRight=function(e,t,r){var n=Ha(e)?Rt:Wt,i=arguments.length<3;return n(e,so(t,4),r,i,hn)},Dr.repeat=function(e,t,n){return t=(n?bo(e,t,n):t===r)?1:fs(t),Yn(vs(e),t)},Dr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dr.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[No(t[i])];a===r&&(i=o,a=n),e=Ka(a)?a.call(e):a}return e},Dr.round=Cl,Dr.runInContext=e,Dr.sample=function(e){return(Ha(e)?Xr:Kn)(e)},Dr.size=function(e){if(null==e)return 0;if(Wa(e))return as(e)?cr(e):e.length;var t=po(e);return t==x||t==A?e.size:Ln(e).length},Dr.snakeCase=Gs,Dr.some=function(e,t,n){var i=Ha(e)?Lt:ni;return n&&bo(e,t,n)&&(t=r),i(e,so(t,3))},Dr.sortedIndex=function(e,t){return ii(e,t)},Dr.sortedIndexBy=function(e,t,r){return oi(e,t,so(r,2))},Dr.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},Dr.sortedLastIndex=function(e,t){return ii(e,t,!0)},Dr.sortedLastIndexBy=function(e,t,r){return oi(e,t,so(r,2),!0)},Dr.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},Dr.startCase=qs,Dr.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},Dr.subtract=_l,Dr.sum=function(e){return e&&e.length?Gt(e,rl):0},Dr.sumBy=function(e,t){return e&&e.length?Gt(e,so(t,2)):0},Dr.template=function(e,t,n){var i=Dr.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=Ts(s),c=Kt(s,l),u=0,d=t.interpolate||ye,h="__p += '",f=Ae((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},Dr.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=qt(n,t);++r<e;)t(r);return i},Dr.toFinite=hs,Dr.toInteger=fs,Dr.toLength=ps,Dr.toLower=function(e){return vs(e).toLowerCase()},Dr.toNumber=gs,Dr.toSafeInteger=function(e){return e?an(fs(e),-9007199254740991,u):0===e?e:0},Dr.toString=vs,Dr.toUpper=function(e){return vs(e).toUpperCase()},Dr.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("")},Dr.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("")},Dr.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("")},Dr.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=Ae(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},Dr.unescape=function(e){return(e=vs(e))&&G.test(e)?e.replace($,hr):e},Dr.uniqueId=function(e){var t=++Le;return vs(e)+t},Dr.upperCase=Ys,Dr.upperFirst=Xs,Dr.each=va,Dr.eachRight=ya,Dr.first=Wo,al(Dr,(ml={},bn(Dr,function(e,t){Re.call(Dr.prototype,t)||(ml[t]=e)}),ml),{chain:!1}),Dr.VERSION="4.17.21",kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dr[e].placeholder=Dr}),kt(["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()}}),kt(["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}}),kt(["head","last"],function(e,t){var r="take"+(t?"Right":"");Vr.prototype[e]=function(){return this[r](1).value()[0]}}),kt(["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 Fn(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=Dr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Dr.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(Dr,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)})}),kt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Fe[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Dr.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=Dr[t];if(r){var n=r.name+"";Re.call(Fr,n)||(Fr[n]=[]),Fr[n].push({name:t,func:r})}}),Fr[zi(r,2).name]=[{name:"wrapper",func:r}],Vr.prototype.clone=function(){var e=new Vr(this.__wrapped__);return e.__actions__=Ei(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ei(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ei(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},Dr.prototype.at=fa,Dr.prototype.chain=function(){return da(this)},Dr.prototype.commit=function(){return new Ur(this.value(),this.__chain__)},Dr.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__++]}},Dr.prototype.plant=function(e){for(var t,n=this;n instanceof Br;){var i=Do(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Dr.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)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,Je&&(Dr.prototype[Je]=function(){return this}),Dr}();ft?((ft.exports=fr)._=fr,ht._=fr):dt._=fr}).call(Ao)}(ko,ko.exports)),ko.exports);const Eo=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Fo=async(e,t,r)=>{var n;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!r)return e;{const e=await r({parentId:t.folderId});i=Array.isArray(e)?e:[]}let o=((e,t)=>{const r=Array.isArray(e)?e:[];return(n=t.folderId)&&"root"!==n&&"folders"!==n&&"null"!==n&&null!==n?r.filter(e=>e.parentId===t.folderId):r.filter(Eo);var n})(i,t);if(null===(n=null==t?void 0:t.search)||void 0===n?void 0:n.trim()){const e=t.search.trim().toLowerCase();o=o.filter(t=>{var r;return null===(r=t.name)||void 0===r?void 0:r.toLowerCase().includes(e)})}if(0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:void 0,date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:"",childCount:e.childCount}));if("folder"===(null==t?void 0:t.itemType))return a;const s=e.filter(e=>!e.isFolder);return[...a,...s]},To=e=>{var t,r,n,i;const{state:o,actions:s,options:l}=mo(),{searchTerm:d,sortBy:h,sortOrder:f,selectedFolder:p,pagination:g,pathHistory:m}=o,{setSearchTerm:v,setSortBy:y,setSortOrder:b,setPagination:w}=s,x=e||s.fetchFiles,C=u(null),_=u(Io.debounce(e=>{const t=JSON.stringify(e);C.current!==t&&(C.current=t,null==x||x(e))},150)).current,S=c(()=>{const e=p||"";if(!e)return;const t=[...Array.isArray(m)?m:[]].reverse().find(t=>t.id===e);return null==t?void 0:t.name},[p,m]),k=c(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:p||"",folderName:S(),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,S,d,g.current,g.pageSize,h,f,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),A=c(e=>{var t,r;if(v&&v(e),w&&w({current:1,pageSize:g.pageSize,total:0}),x){const n={folderId:p||"",folderName:S(),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"};x(n)}else console.error("🔎 useSortAndFilter: fetchFiles НЕ ОПРЕДЕЛЕНА!")},[v,w,g.pageSize,x,p,S,h,f,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),I=c((e,t)=>{var r,n;null==y||y(e),null==b||b(t),x&&_({folderId:p||"",folderName:S(),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"})},[y,b,_,p,S,d,g.current,g.pageSize,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),E=c((e,t)=>{var r;(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)||(w&&w({current:e,pageSize:t||g.pageSize,total:g.total}),x&&_({folderId:p||"",folderName:S(),search:(null==d?void 0:d.trim())||void 0,page:e,limit:t||g.pageSize,sortBy:h,sortOrder:f,itemType:"all"}))},[w,g.pageSize,g.total,_,p,S,d,h,f,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return a(()=>{if(x){const e=k();_(Object.assign(Object.assign({},e),{page:1}))}},[p]),a(()=>{x&&_(k())},[]),a(()=>()=>{var e;null===(e=_.cancel)||void 0===e||e.call(_)},[_]),{state:{searchTerm:d||"",sortBy:h||"name",sortOrder:f||"asc"},actions:{setSearchTerm:v||(()=>{}),setSortBy:y||(()=>{}),setSortOrder:b||(()=>{}),handleSearch:A,handleSort:I,handlePaginationChange:E,getCurrentQueryParams:k}}},Oo=new Map;function Po(e){const t="id"in e&&void 0!==e.id?String(e.id):"unknown",r="data"in e?e.data:void 0;return`${e.type}:${t}:${function(e){if(null==e)return"";try{return JSON.stringify(e,Object.keys(e).sort())}catch(t){return String(e)}}(r)}`}const Mo=()=>{var e,t;const{notification:r}=I.useApp(),n=mo(),{options:i}=n,o=c(async e=>{let t;if(i.handleNotify){try{t=await i.handleNotify(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&i.handleError){try{t=await i.handleError(e)}catch(e){console.error(e)}if(!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("success"===e.type&&i.handleSuccess){try{t=await i.handleSuccess(e)}catch(e){console.error(e)}if(t)return!1}return t},[i]),a=c(async function(e,t=!1){var n,a,s,l;try{void 0===e.visibility&&(e.visibility=!t);const c=await o(e);"object"==typeof c&&(e=c);const u=null!==(a=null===(n=i.config)||void 0===n?void 0:n.notificationDedupeTtlMs)&&void 0!==a?a:12e3,d="error"===e.type&&!0===e.notificationDedupe;d&&function(e,t){if(t<=0)return;const r=Po(e),n=Date.now(),i=Oo.get(r);void 0!==i&&n-i<t&&(e.visibility=!1)}(e,u);if(!(!1!==e.visibility&&!1!==c&&!1!==(null===(s=i.config)||void 0===s?void 0:s.showNotifications)))return e;const h=r[e.type];"function"==typeof h?(h(e),d&&(l=e,u<=0||Oo.set(Po(l),Date.now()))):console.warn(`Unknown notification type: ${e.type}`,e)}catch(e){console.error(e)}return e},[r,o,null===(e=i.config)||void 0===e?void 0:e.notificationDedupeTtlMs,null===(t=i.config)||void 0===t?void 0:t.showNotifications]);return d(()=>({error:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"error"}),t),success:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"success"}),t),warning:(e,t=!1)=>a(Object.assign(Object.assign({},e),{type:"warning"}),t),notify:a}),[a])},Ro={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid. Allowed characters: {{allowedChars}}",FileAccessDenied:"You don't have permission to access this file.",FileReadError:"Failed to read the file.",FileWriteError:"Failed to write the file.",FileTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",FileTypeNotAllowed:"This file type is not allowed.",FileCorrupted:"The file appears to be corrupted.",FileChecksumMismatch:"File integrity check failed.",FileStorageQuotaExceeded:"Storage quota exceeded. Please free up space.",FileLocked:"File is locked by another process or user.",FileVersionConflict:"File version conflict. Please refresh and try again.",FolderNotFound:"Folder not found or no longer available.",FolderAlreadyExists:"Folder with this name already exists.",FolderInvalidName:"Folder name is not valid. Allowed characters: {{allowedChars}}",FolderAccessDenied:"You don't have permission to access this folder.",FolderReadError:"Failed to read the folder contents.",FolderWriteError:"Failed to write to the folder.",FolderQuotaExceeded:"Folder storage quota exceeded.",FolderNotEmpty:"Folder is not empty.",FolderBackendError:"Server error while processing the folder.",FolderTimeout:"Folder operation took too long.",RenameNotAllowed:"Renaming is not allowed for this item.",MoveNotAllowed:"Moving is not allowed for this item.",CopyNotAllowed:"Copying is not allowed for this item.",DeleteNotAllowed:"Deleting is not allowed for this item.",MoveIntoSelf:"Cannot move an item into itself.",MoveIntoDescendant:"Cannot move an item into its descendant folder.",CopyIntoSelf:"Cannot copy an item into itself.",UnsupportedOperation:"This operation is not supported.",ConfigError:"Configuration error occurred.",FileUploadQuotaExceeded:"You have exceeded the upload quota.",FileUploadNetworkError:"Network error while uploading the file.",FileUploadTimeout:"File upload took too long.",FileUploadBackendError:"Server error while uploading the file.",UploadUrlInvalid:"The specified URL is not valid.",UploadUrlNotReachable:"The specified URL is not reachable.",UploadUrlContentTypeNotAllowed:"Content type at the URL is not allowed.",UploadUrlDownloadFailed:"Failed to download file from the URL.",FileLookupFailed:"Failed to find existing file by URL.",FileProxyFailed:"Failed to load file through proxy.",FileProxyNotConfigured:"File proxy is not configured.",FileDownloadNetworkError:"Network error while downloading the file.",FileDownloadTimeout:"File download took too long.",FileDownloadBackendError:"Server error while downloading the file.",BatchPartialFailure:"Some items could not be processed.",BatchAllFailed:"Failed to process all items in the batch.",BatchConflict:"Some items in the batch are in a conflicting state.",BatchValidationFailed:"Some items in the batch did not pass validation.",BatchItemLimitExceeded:"Batch operation exceeds the maximum number of items allowed.",ValidationError:"Some of the provided data is invalid.",PayloadTooLarge:"File is too large ({{fileSize}}). Maximum allowed size: {{maxSize}}.",UnsupportedMediaType:"This media type is not supported.",NetworkError:"Network error. Please check your connection and try again.",BackendError:"Server error. Please try again later.",Timeout:"The operation took too long. Please try again.",AuthenticationFailed:"Authentication failed. Please sign in again.",AuthorizationFailed:"You are not allowed to perform this action.",RateLimitExceeded:"Too many requests. Please try again a bit later.",ServiceUnavailable:"Service is temporarily unavailable. Please try again later.",AIResponseInvalid:"AI service returned an invalid response.",AIImageGenerationFailed:"Failed to generate image using AI.",AIImageGenerationLimitExceeded:"You have reached the AI image generation limit.",IntegrationError:"Error in external integration.",ThirdPartyError:"Error in a third-party service.",UnknownError:"An unknown error occurred."},Lo={FileTooLarge:"File is too large to upload.",PayloadTooLarge:"File is too large to upload."},No=(e,t,r)=>{var n,i,o;if(!e)return;const a=Ro[e];if(!a)return;const s=null!==(n=null==r?void 0:r.fileSize)&&void 0!==n?n:"",l=null!==(i=null==r?void 0:r.maxSize)&&void 0!==i?i:"";if(("FileTooLarge"===e||"PayloadTooLarge"===e)&&!(!!s&&!!l)){const r=Lo[e];return r?t(r):t(a,{fileSize:"?",maxSize:"?"})}return t(a,{allowedChars:null!==(o=null==r?void 0:r.allowedChars)&&void 0!==o?o:"a-z A-Z 0-9 . _ -",fileSize:s,maxSize:l})},jo=e=>{if(!e||"string"!=typeof e)return;const t=e.toLowerCase();return(t.includes("maximum number of files")||t.includes("number of files exceeded"))&&(t.includes("allowed")||t.includes("received"))?"BatchItemLimitExceeded":t.includes("exceeds")||t.includes("maximum")||t.includes("too large")||t.includes("size limit")||t.includes("object size")||t.includes("размер")||t.includes("превышен")?"PayloadTooLarge":t.includes("403")||t.includes("forbidden")||t.includes("access denied")||t.includes("доступ запрещён")?"AuthorizationFailed":t.includes("404")||t.includes("not found")||t.includes("не найден")?"UploadUrlNotReachable":t.includes("already exists")||t.includes("уже существует")||t.includes("дубликат")?"FileAlreadyExists":t.includes("invalid")&&(t.includes("name")||t.includes("имя")||t.includes("назва"))?"FileInvalidName":t.includes("type")&&(t.includes("not allowed")||t.includes("не поддерживается"))?"FileTypeNotAllowed":void 0},Do=e=>{var t,r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y;if(!e)return{message:"Unknown error",raw:e};if("string"==typeof e)return{message:e};if(e instanceof Error){const o=e;return{message:null!==(t=o.message)&&void 0!==t?t:e.message,code:o.code,status:null!==(r=o.status)&&void 0!==r?r:o.httpStatus,stack:null!==(n=o.stack)&&void 0!==n?n:e.stack,raw:null!==(i=o.raw)&&void 0!==i?i:e}}if("object"==typeof e){const t=e,r=null!==(o=t.data)&&void 0!==o?o:t,n=null!==(a=null==r?void 0:r.data)&&void 0!==a?a:r,i=null!==(c=null!==(l=null!==(s=t.message)&&void 0!==s?s:null==r?void 0:r.message)&&void 0!==l?l:t.error)&&void 0!==c?c:t.reason,b=null!==(h=null!==(d=null!==(u=t.status)&&void 0!==u?u:t.httpStatus)&&void 0!==d?d:null==n?void 0:n.status)&&void 0!==h?h:null==r?void 0:r.status,w=null!==(f=t.code)&&void 0!==f?f:null==r?void 0:r.code,x=t.stack,C=null!==(p=t.raw)&&void 0!==p?p:e,_=null!==(m=null!==(g=t.fileSize)&&void 0!==g?g:null==n?void 0:n.fileSize)&&void 0!==m?m:null==r?void 0:r.fileSize,S=null!==(y=null!==(v=t.maxSize)&&void 0!==v?v:null==n?void 0:n.maxSize)&&void 0!==y?y:null==r?void 0:r.maxSize;if(i||w||b||x||C)return Object.assign(Object.assign({message:i,code:w,status:b,stack:x,raw:C},null!=_&&{fileSize:_}),null!=S&&{maxSize:S})}return{message:String(e),raw:e}};const zo=(e,t,r)=>{const n=Do(e),i=null==n?void 0:n.code;if("FileTooLarge"===i&&null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize))return t("File too large ({{size}}). Maximum allowed size: {{maxSize}}",{size:ui(r.fileSize),maxSize:ui(r.maxSize)});if(("BatchItemLimitExceeded"===i||"exceeded_max_files"===i)&&(null==n?void 0:n.message)){const{allowed:e,received:r}=function(e){const t=e.match(/Allowed:\s*(\d+)/i),r=e.match(/received:\s*(\d+)/i);return{allowed:t?parseInt(t[1],10):void 0,received:r?parseInt(r[1],10):void 0}}(n.message);if(null!=e&&null!=r)return t("Maximum number of files exceeded. Allowed: {{allowed}}, received: {{received}}",{allowed:e,received:r})}if((null==n?void 0:n.message)&&"Unknown error"!==n.message)return n.message;const o=null!=(null==r?void 0:r.fileSize)&&null!=(null==r?void 0:r.maxSize)?{fileSize:ui(r.fileSize),maxSize:ui(r.maxSize)}:void 0,a=No(i,t,o);return null!=a?a:t("Error uploading file")},Bo=e=>{const t=Do(e);return"path_folder_not_found"===(null==t?void 0:t.code)},Uo=["file_get_contents","open stream","failed to open stream","http request failed","curl_error"];const Vo=(e,t,r)=>{var n;if(!e)return t("Error when downloading a file by URL");const i=null!==(n=(e=>{const t=jo(e);if("AuthorizationFailed"===t){const t=(e||"").toLowerCase();if(t.includes("download")||t.includes("url")||t.includes("file_get_contents")||t.includes("failed to download"))return"UploadUrlNotReachable"}return t})(null==e?void 0:e.message))&&void 0!==n?n:null==e?void 0:e.code,o=No(i,t,r);if(o)return o;const a=(null==e?void 0:e.message)&&"string"==typeof e.message?e.message.trim():null;return a&&function(e){if(!e||e.length>200)return!1;const t=e.toLowerCase();return!Uo.some(e=>t.includes(e))}(a)?a:t("Failed to download file from the URL.")},Ho=e=>Array.isArray(e)?e.filter(e=>(null==e?void 0:e.id)&&"folders"!==e.id).map(e=>e.name).filter(Boolean).join("/"):"",$o=e=>{const t=e.trim();if(!t)return"";const r=t.toLowerCase(),n=[r.indexOf(" and "),r.indexOf(" or "),t.indexOf(","),t.indexOf(";"),r.indexOf(". ")].filter(e=>e>=0);if(0===n.length)return t;const i=Math.min(...n);return t.slice(0,i).trim()||t},Wo=(e,t)=>{const r=(e=>{var t,r,n,i;if(e&&"object"==typeof e){const o=e,a=null!==(n=null===(r=null===(t=o.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.path_folder)&&void 0!==n?n:null===(i=o.data)||void 0===i?void 0:i.path_folder;if("string"==typeof a&&a.trim())return $o(a)||null}const o=Do(e),a=null==o?void 0:o.message;if(!a)return null;const s=a.toLowerCase(),l=["не существует:","not exists:","not exist:","not found:"];for(const e of l){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return $o(r)||null}}const c=["not exists ","not exist ","not found "];for(const e of c){const t=s.indexOf(e);if(t>=0){const r=a.slice(t+e.length).trim();return $o(r)||null}}return null})(e);return r?(e=>{const t=e.split("/").filter(Boolean);return t.length<=1?"":(t.pop(),t.join("/"))})(r):Ho(t)},Go=async e=>{var t;const{options:r,pathFolder:n,dataProviders:i}=e;if(null==i?void 0:i.clearCache)return void await i.clearCache(n||null);const o=null===(t=null==r?void 0:r.apiEndpoints)||void 0===t?void 0:t.clearCache;if(!o)return;const a=o.includes("?");let s=o;n&&n.length>0&&(s=`${o}${a?"&":"?"}path_folder=${encodeURIComponent(n)}`);const l=await fetch(s,{method:"POST"});if(!l.ok)throw new Error(`Cache clear failed: ${l.status}`)},qo=()=>{var e,t;const{state:r,actions:i,options:o}=mo(),{t:a}=Kn(),s=Mo(),{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(e=!1)=>{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:null!=r?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}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(t){console.error("Error loading folders:",t);const r=Do(t);if(!e&&(404===(null==r?void 0:r.status)||"FileNotFound"===(null==r?void 0:r.code))){const e=Wo(t,d||[]);try{return await Go({options:o,pathFolder:e,dataProviders:null==o?void 0:o.dataProviders}),void await x(!0)}catch(e){console.error("Cache clear failed:",e)}}const n=No(null==r?void 0:r.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=n?n:a("Failed to load folders"),description:a("Folders"),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{reason:t instanceof Error?t.message:String(t),folderId:null,folderName:a("Folders")}})}finally{null==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,d,o]),C=c(()=>x(),[x]),_=c(async e=>{try{let t,r;if(null==y?void 0:y.getFolders){t=await y.getFolders({parentId:e,deep:!1});const n=Array.isArray(l)?l:[],i=new Set(t.map(e=>e.id)),o=n.filter(t=>t.parentId!==e||i.has(t.id));r=[...o,...t.filter(e=>!o.some(t=>t.id===e.id))]}else{if(!(null==y?void 0:y.getFiles))return[];{const{files:n}=await y.getFiles({itemType:"folder",folderId:null!=e?e:void 0});t=w(n);const i=Array.isArray(l)?l:[],o=new Set(t.map(e=>e.id)),a=i.filter(t=>t.parentId!==e||o.has(t.id));r=[...a,...t.filter(e=>!a.some(t=>t.id===e.id))]}}let n=r,i=0;for(;i!==n.length;){i=n.length;const e=new Set(n.map(e=>e.id));n=n.filter(t=>!t.parentId||e.has(t.parentId))}return null==g||g(n),t}catch(e){return console.error("Error loading child folders:",e),[]}},[y,l,g,w]),S=c(()=>{var e;const t=null!==(e=null==b?void 0:b.defaultFolderName)&&void 0!==e?e:a("New folder");h.setFieldsValue({folderName:t}),null==v||v(!0)},[h,v,a,null==b?void 0:b.defaultFolderName]),k=c(async(e,t)=>{const r=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==g||g(r),e.parentId&&(await _(e.parentId),await new Promise(e=>setTimeout(e,50))),!(null==t?void 0:t.preserveSelection)&&i.setSelectedFolder&&i.setSelectedFolder(e.id),!(null==t?void 0:t.preserveSelection)&&i.setPathHistory){const t=Array.isArray(r)?r:[],n=(e,r=new Set)=>{if(r.has(e))return console.warn(`Cycle detected in the path to the folder with id=${e}`),[];const i=t.find(t=>t.id===e);if(!i)return[];const o=new Set(r);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,_,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:null!=n?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]),I=c(async e=>{var t;let r,n,i=null;try{const o=await(e?e.validateFields():h.validateFields());if(r=o.folderName.trim(),!r){const e=o.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:!!o.is_force_create}})}n=Ur(r,b);const c=o.targetFolder;if(c)i="folders"!==c?c:null;else if(u&&"folders"!==u)i=u;else if(Array.isArray(d)&&d.length>1){const e=d[d.length-1];i=(null==e?void 0:e.id)&&"folders"!==e.id?e.id:null}if(Vr(b)&&(null==y?void 0:y.getFolders))try{const e=(await y.getFolders({parentId:i,deep:!1})||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean);if(e.includes(r.trim().toLowerCase()))return void s.error({id:"FOLDER_ALREADY_EXISTS",message:a("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,folderId:i}})}catch(e){}let f;if(!(null==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:n,folderId:null!=i?i:null,is_force_create:!!o.is_force_create}});f=await y.createFolder({name:n,parentId:i,is_force_create:!!o.is_force_create}),(e=>{if(!e||!e.id)throw new Error(a("Invalid server response: folder ID is missing"));if(e.id===e.parentId&&e.parentId)throw console.error("Circular dependency detected: folder cannot be its own parent"),new Error(a("Error: folder cannot be its own parent"))})(f);const p={id:f.id,name:f.name,parentId:null!=i?i:null,childCount:f.childCount},m=[...(Array.isArray(l)?l:[]).filter(e=>e.id!==p.id),p];if(null==g||g(m),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[p.id],folderId:null!==(t=p.parentId)&&void 0!==t?t:null,folderName:p.name}}),e||null==v||v(!1),(async()=>{try{await k(p,{preserveSelection:Boolean(e)}),await C(),await new Promise(e=>setTimeout(e,200));await A(f.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 f}catch(e){console.error("❌ Error creating the folder:",e);const t=Do(e),o=No(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=o?o:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:n||r,folderId:null!=i?i:null,reason:e instanceof Error?e.message:String(e)}})}},[h,u,y,k,C,A,v,s,a,l,g,b,d]),E=c(()=>{null==v||v(!1)},[v]),F=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(ve,{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?F(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=F(r),[t]},[l,a,F]),O=c(async(e,t)=>{var r,n,c,u;let d;try{const h=t.trim(),f=null==l?void 0:l.find(t=>t.id===e);if(!h)return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:e,folderName:t,reason:"emptyName"}});d=Ur(h,b);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==f?void 0:f.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 p=await o.dataProviders.renameFolder(e,d);if(!(null==p?void 0:p.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:e,itemName:d,error:{message:"invalidResponse"}}});await C(),e!==p.id&&i.setSelectedFolder&&i.setSelectedFolder(p.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:p.id,itemName:p.name,folderId:null!==(u=p.parentId)&&void 0!==u?u:null}})}catch(r){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:d||t,error:{message:r instanceof Error?r.message:String(r)}}})}},[C,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,b,i.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:p,loading:f},actions:{fetchFolders:C,fetchChildFolders:_,handleCreateFolder:S,handleModalOk:I,handleModalCancel:E,generateMenuItems:T,renameFolder:O}}},Yo=()=>{const{options:e,actions:t}=mo(),{dataProviders:r,config:n}=e,{setUndoDeletion:i}=t,{t:o}=Kn(),a=Mo(),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),t=i.filter(e=>!e.success),r=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return Bo(r)}),n=t.filter(e=>{var t;const r=null!==(t=e.innerException)&&void 0!==t?t:e.error;return!Bo(r)});return c+=e.length+r.length,u+=n.length,void n.forEach(e=>{var t;const r=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),n=null!==(t=e.innerException)&&void 0!==t?t:e.error,i=Do(n);d.push({itemId:r,itemName:s(r),error:i})})}if(n.success)c+=e.length;else{const t=n.error;if(Bo(t))c+=e.length;else if(t){u+=e.length;const r=Do(t);d.push({error:r})}else u+=e.length}return}catch(r){if(Bo(r))c+=e.length;else{const n=t?"Ошибка при удалении":"Ошибка при перемещении в корзину";console.error(n,r),u+=e.length;const i=Do(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}};class Xo 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,Xo)}}const Ko=/^(localhost|127\.0\.0\.1|0\.0\.0\.0|::1)$/i,Zo=/^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/;function Jo(e,t){const r=e.trim();if(!r)throw new Xo(t("Enter the URL of the image"),"UploadUrlInvalid");if(r.length>8192)throw new Xo(t("URL too long"),"UploadUrlInvalid");let n;try{n=new URL(r)}catch(e){throw new Xo(t("The specified URL is not valid."),"UploadUrlInvalid")}const i=n.protocol.toLowerCase();if("http:"!==i&&"https:"!==i)throw new Xo(t("Only http and https URLs are supported"),"UploadUrlInvalid");const o=n.hostname.toLowerCase();if(Ko.test(o)&&("undefined"==typeof window||!Ko.test(window.location.hostname.toLowerCase())))throw new Xo(t("Private and local URLs are not allowed"),"UploadUrlInvalid");if(Zo.test(o))throw new Xo(t("Private and local URLs are not allowed"),"UploadUrlInvalid")}function Qo(e,t){return new Promise(function(r,n){let i;return ea(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 ea=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 ta={},ra={get exports(){return ta},set exports(e){ta=e}};!function(){var e,t,r={};ra.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,k=65535&_;if(0!=_){k=65535&_;var A=s(S=_>>>16,a.of0);a.lhst[257+A]++;var I=s(k,a.df0);a.dhst[I]++,b+=a.exb[A]+a.dxb[I],f[m]=S<<23|c-d,f[m+1]=k<<16|A<<8|I,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 k=0;k<286;k++)b.lhst[k]=0;for(k=0;k<30;k++)b.dhst[k]=0;for(k=0;k<19;k++)b.ihst[k]=0;var A=C<_&&C<S?0:_<S?1:2;if(w(l,c,e),w(l,c+1,A),c+=3,0==A){for(;7&c;)c++;c=r.F._copyExact(o,a,s,l,c)}else{var I,E;if(1==A&&(I=b.fltree,E=b.fdtree),2==A){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),I=b.ltree,E=b.dtree,x(l,c,p-257),x(l,c+=5,g-1),x(l,c+=5,m-4),c+=4;for(var F=0;F<m;F++)x(l,c+3*F,b.itree[1+(b.ordr[F]<<1)]);c+=3*m,c=r.F._codeTiny(v,b.itree,l,c),c=r.F._codeTiny(y,b.itree,l,c)}for(var T=a,O=0;O<n;O+=2){for(var P=t[O],M=P>>>23,R=T+(8388607&P);T<R;)c=r.F._writeLit(o[T++],I,l,c);if(0!=M){var L=t[O+1],N=L>>16,j=L>>8&255,D=255&L;x(l,c=r.F._writeLit(257+j,I,l,c),M-b.of0[j]),c+=b.exb[j],w(l,c=r.F._writeLit(D,E,l,c),N-b.df0[D]),c+=b.dxb[D],T+=M}}c=r.F._writeLit(256,I,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 k=1;for(S=0;S<b;S++){var A=a(e,_+3*S,3);d.itree[1+(d.ordr[S]<<1)]=A,A>k&&(k=A)}_+=3*b,l(d.itree,k),c(d.itree,k,d.imap),f=d.lmap,p=d.dmap,_=s(d.imap,(1<<k)-1,v+y,e,_,d.ttree);var I=i._copyOut(d.ttree,0,v,d.ltree);w=(1<<I)-1;var E=i._copyOut(d.ttree,v,y,d.dtree);x=(1<<E)-1,l(d.ltree,I),c(d.ltree,I,f),l(d.dtree,E),c(d.dtree,E,p)}for(;;){var F=f[u(e,_)&w];_+=15&F;var T=F>>>4;if(T>>>8==0)t[C++]=T;else{if(256==T)break;var O=C+T-254;if(T>264){var P=d.ldef[T-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],N=(L>>>4)+o(e,_,15&L);for(_+=15&L,h&&(t=r.F._check(t,C+(1<<17)));C<O;)t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N],t[C]=t[C++-N];C=O}}}else{7&_&&(_+=8-(7&_));var j=4+(_>>>3),D=e[j-4]|e[j-3]<<8;h&&(t=r.F._check(t,C+D)),t.set(new n(e.buffer,e.byteOffset+j,D),C),_=j+D<<3,C+=D}return t.length==C?t:t.slice(0,C)},r.F._check=function(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n},r.F._decodeTiny=function(e,t,n,i,o,a){for(var s=r.F._bitsE,l=r.F._get17,c=0;c<n;){var u=e[l(i,o)&t];o+=15&u;var d=u>>>4;if(d<=15)a[c]=d,c++;else{var h=0,f=0;16==d?(f=3+s(i,o,2),o+=2,h=a[c-1]):17==d?(f=3+s(i,o,3),o+=3):18==d&&(f=11+s(i,o,7),o+=7);for(var p=c+f;c<p;)a[c]=h,c++}}return o},r.F._copyOut=function(e,t,r,n){for(var i=0,o=0,a=n.length>>>1;o<r;){var s=e[o+t];n[o<<1]=0,n[1+(o<<1)]=s,s>i&&(i=s),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},r.F.makeCodes=function(e,t){for(var n,i,o,a,s=r.F.U,l=e.length,c=s.bl_count,u=0;u<=t;u++)c[u]=0;for(u=1;u<l;u+=2)c[e[u]]++;var d=s.next_code;for(n=0,c[0]=0,i=1;i<=t;i++)n=n+c[i-1]<<1,d[i]=n;for(o=0;o<l;o+=2)0!=(a=e[o+1])&&(e[o]=d[a],d[a]++)},r.F.codes2map=function(e,t,n){for(var i=e.length,o=r.F.U.rev15,a=0;a<i;a+=2)if(0!=e[a+1])for(var s=a>>1,l=e[a+1],c=s<<4|l,u=t-l,d=e[a]<<u,h=d+(1<<u);d!=h;)n[o[d]>>>15-t]=c,d++},r.F.revCodes=function(e,t){for(var n=r.F.U.rev15,i=15-t,o=0;o<e.length;o+=2){var a=e[o]<<t-e[o+1];e[o]=n[a]>>>i}},r.F._putsE=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},r.F._putsF=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},r.F._bitsE=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},r.F._bitsF=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=r.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function i(e,t,r){for(;0!=t--;)e.push(0,r)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),i(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()}();var na=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:ta},[ta]);const ia=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 k=0;k<r;k++){var A=(_=255*(t[e+(k>>>3)]>>>7-(7&k)&1))==255*m?0:255;u[n+k]=A<<24|_<<16|_<<8|_}else if(2==h)for(k=0;k<r;k++)A=(_=85*(t[e+(k>>>2)]>>>6-((3&k)<<1)&3))==85*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(4==h)for(k=0;k<r;k++)A=(_=17*(t[e+(k>>>1)]>>>4-((1&k)<<2)&15))==17*m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(8==h)for(k=0;k<r;k++)A=(_=t[e+k])==m?0:255,u[n+k]=A<<24|_<<16|_<<8|_;else if(16==h)for(k=0;k<r;k++)_=t[e+(k<<1)],A=f(t,e+(k<<1))==m?0:255,u[n+k]=A<<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}=ia,{_bin:t}=ia,r=ia._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={},k=[],A=[];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++)k.push(r.plte[x].est.rgba);let n=0;for(x=0;x<_.length;x++){const e=(E=_[x]).img.length;var I=new Uint8Array(r.inds.buffer,n>>2,e>>2);A.push(I);const t=new Uint8Array(r.abuf,n,e);p&&s(E.img,E.rect.width,E.rect.height,k,t,I),E.img.set(t),n+=e}}else for(b=0;b<_.length;b++){var E=_[b];const e=new Uint32Array(E.img.buffer);var F=E.rect.width;for(w=e.length,I=new Uint8Array(w),A.push(I),x=0;x<w;x++){const t=e[x];if(0!=x&&t==e[x-1])I[x]=I[x-1];else if(x>F&&t==e[x-F])I[x]=I[x-F];else{let e=S[t];if(null==e&&(S[t]=e=k.length,k.push(t),k.length>=300))break;I[x]=e}}}const T=k.length;for(T<=256&&0==f&&(v=T<=2?1:T<=4?2:T<=16?4:8,v=Math.max(v,u)),b=0;b<_.length;b++){(E=_[b]).rect.x,E.rect.y,F=E.rect.width;const e=E.rect.height;let t=E.img;new Uint32Array(t.buffer);let r=4*F,n=4;if(T<=256&&0==f){r=Math.ceil(v*F/8);var O=new Uint8Array(r*e);const i=A[b];for(let t=0;t<e;t++){x=t*r;const e=t*F;if(8==v)for(var P=0;P<F;P++)O[x+P]=i[e+P];else if(4==v)for(P=0;P<F;P++)O[x+(P>>1)]|=i[e+P]<<4-4*(1&P);else if(2==v)for(P=0;P<F;P++)O[x+(P>>2)]|=i[e+P]<<6-2*(3&P);else if(1==v)for(P=0;P<F;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(F*e*3);const i=F*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*F}E.img=t,E.bpl=r,E.bpp=n}return{ctype:m,depth:v,plte:k,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=na;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]]};ia.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)},ia.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)},ia.encode.compress=u,ia.encode.dither=s,ia.quantize=g,ia.quantize.getKDtree=m,ia.quantize.getNearest=v}();const oa={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,oa._dly)):t(u)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9};var aa={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},sa={[aa.CHROME]:16384,[aa.FIREFOX]:11180,[aa.DESKTOP_SAFARI]:16384,[aa.IE]:8192,[aa.IOS]:4096,[aa.ETC]:8192};const la="undefined"!=typeof window,ca="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,ua=la&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),da=(la||ca)&&(ua&&ua.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),ha=(la||ca)&&(ua&&ua.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function fa(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 pa(e){return new Promise((t,r)=>{const n=new ha;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function ga(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function ma(){if(void 0!==ma.cachedResult)return ma.cachedResult;let e=aa.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=aa.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=aa.IOS:/Safari/i.test(t)?e=aa.DESKTOP_SAFARI:/Firefox/i.test(t)?e=aa.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=aa.IE),ma.cachedResult=e,ma.cachedResult}function va(e,t){const r=ma(),n=sa[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 ya(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 ba(e,t){const{width:r,height:n}=va(e.width,e.height),[i,o]=ya(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 wa(){return void 0!==wa.cachedResult||(wa.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),wa.cachedResult}function xa(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=ba(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 pa(e).then(function(e){try{return t=e,ga(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(wa()||[aa.DESKTOP_SAFARI,aa.MOBILE_SAFARI].includes(ma()))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 Ca(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=ia.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=>oa.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),fa(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 _a(e){e.width=0,e.height=0}function Sa(){return new Promise(function(e,t){let r,n,i,o;return void 0!==Sa.cachedResult?e(Sa.cachedResult):fa("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,xa(r).then(function(a){try{return n=a[1],Ca(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,_a(n),xa(i).then(function(r){try{return o=r[0],Sa.cachedResult=1===o.width&&2===o.height,e(Sa.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 ka(e){return new Promise((t,r)=>{const n=new ha;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 Aa(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]=ya(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),_a(e)),a}function Ia(e,t){const{width:r}=e,{height:n}=e,[i,o]=ya(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),_a(e),i}function Ea(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 k(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function A(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,k(),xa(e,t).then(function(r){try{return[,l]=r,k(),c=Aa(l,t),k(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return ka(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,k(),Sa().then(function(r){try{return d=r?c:Ia(c,u),k(),h=t.initialQuality||1,f=t.fileType||e.type,Ca(d,f,e.name,e.lastModified,h).then(function(r){try{{if(p=r,k(),g=p.size>s,m=p.size>e.size,!g&&!m)return A(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]=ya(t,r),C.drawImage(_,0,0,t,r),h*="image/png"===f?.85:.95,Ca(x,f,e.name,e.lastModified,h).then(function(e){try{return w=e,_a(_),_=x,b=w.size,A(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()?I.call(this):e;e=u}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(u);function I(){return _a(_),_a(x),_a(c),_a(d),_a(l),A(100),n(w)}}}catch(E){return i(E)}}.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 Fa;function Ta(e,t){return new Promise((r,n)=>{Fa||(Fa=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(Fa);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 Oa(e,t){return new Promise(function(r,n){let i,o,a,s,l,c;if(i={...t},a=0,({onProgress:s}=i),i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,l="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{a=e,"function"==typeof s&&s(a)},!(e instanceof Blob||e instanceof da))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 Ea(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 Ea(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",Ta(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=Qo(e,o))}catch(e){}return r(o)}})}function Pa(e,t){var r;if(null==e?void 0:e.extension){const t=e.extension.toLowerCase(),r={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.type){const t=Ar(e.type),r={"image/jpeg":{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},"image/png":{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},"image/gif":{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},"image/webp":{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},"image/svg+xml":{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(r[t])return r[t]}if(null==e?void 0:e.name){const t=null===(r=e.name.split(".").pop())||void 0===r?void 0:r.toLowerCase();if(t){const e={jpg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},jpeg:{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"},png:{extension:"png",mimeType:"image/png",format:"png",pixieFormat:"png"},gif:{extension:"gif",mimeType:"image/gif",format:"gif",pixieFormat:"png"},webp:{extension:"webp",mimeType:"image/webp",format:"webp",pixieFormat:"png"},svg:{extension:"svg",mimeType:"image/svg+xml",format:"svg",pixieFormat:"svg"}};if(e[t])return e[t]}}if(t){const e=Ar(t),r=Fr(e);let n="jpeg";return"png"===r?n="png":"svg"===r?n="svg":"jpeg"===r&&(n="jpeg"),{extension:r,mimeType:e,format:r,pixieFormat:n}}return{extension:"jpeg",mimeType:"image/jpeg",format:"jpeg",pixieFormat:"jpeg"}}Oa.getDataUrlFromFile=pa,Oa.getFilefromDataUrl=fa,Oa.loadImage=ga,Oa.drawImageInCanvas=ba,Oa.drawFileInCanvas=xa,Oa.canvasToFile=Ca,Oa.getExifOrientation=ka,Oa.handleMaxWidthOrHeight=Aa,Oa.followExifOrientation=Ia,Oa.cleanupCanvasMemory=_a,Oa.isAutoOrientationInBrowser=Sa,Oa.approximateBelowMaximumCanvasSizeOfBrowser=va,Oa.copyExifWithoutOrientation=Qo,Oa.getBrowserName=ma,Oa.version="2.0.2";const Ma={MAX_SIZE_MB:.48,MAX_WIDTH_OR_HEIGHT:2e3,QUALITY:.8},Ra=["gif","svg"];function La(e){if(!e)return null;const t=e.trim();if(t.endsWith("%"))return null;const r=parseFloat(t.replace(/px$/i,""));return Number.isFinite(r)&&r>0?r:null}function Na(e,t=2,r=4096){const{width:n,height:i}=function(e){var t,r,n,i,o;const a=null!==(r=null===(t=e.match(/<\s*svg\b[\s\S]*?>/i))||void 0===t?void 0:t[0])&&void 0!==r?r:"",s=null===(n=a.match(/\bwidth\s*=\s*["']([^"']*)["']/i))||void 0===n?void 0:n[1],l=null===(i=a.match(/\bheight\s*=\s*["']([^"']*)["']/i))||void 0===i?void 0:i[1],c=La(s),u=La(l);if(null!=c&&null!=u)return{width:c,height:u};const d=null===(o=e.match(/viewBox\s*=\s*["']([^"']+)["']/i))||void 0===o?void 0:o[1];if(d){const e=d.trim().split(/[\s,]+/);if(4===e.length){const t=parseFloat(e[2]),r=parseFloat(e[3]);if(Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0)return{width:t,height:r}}}return null!=c?{width:c,height:c}:null!=u?{width:u,height:u}:{width:300,height:300}}(e);let o=Math.max(1,Math.round(n*t)),a=Math.max(1,Math.round(i*t));const s=Math.max(64,r),l=Math.max(o,a);if(l>s){const e=s/l;o=Math.max(1,Math.round(o*e)),a=Math.max(1,Math.round(a*e))}return{width:o,height:a}}async function ja(e,t,r,n,i){var o;const a=null!==(o=null==i?void 0:i.canvasScale)&&void 0!==o?o:2,s=new Blob([e],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(s);try{const e=new Image;await new Promise((t,r)=>{e.onload=()=>t(),e.onerror=()=>r(new Error("Failed to load SVG image")),e.src=l});const n=document.createElement("canvas"),i=Math.max(1,Math.round(t*a)),o=Math.max(1,Math.round(r*a));n.width=i,n.height=o;const s=n.getContext("2d");if(!s)throw new Error("Canvas 2D context is not available");return s.clearRect(0,0,i,o),s.drawImage(e,0,0,i,o),function(e){return new Promise((t,r)=>{e.toBlob(e=>{e?t(e):r(new Error("canvas.toBlob returned null"))},"image/png")})}(n)}finally{URL.revokeObjectURL(l)}}async function Da(e,t,r,n,i){const o=await ja(e,t,r,0,i);return a=o,new Promise((e,t)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>{var e;return t(null!==(e=r.error)&&void 0!==e?e:new Error("readAsDataURL failed"))},r.readAsDataURL(a)});var a}function za(e,t,r,n){return new File([e],t,{type:r,lastModified:n})}function Ba(e,t){return t&&t!==e.name?za(e,t,e.type,e.lastModified):e}async function Ua(e,t={}){const{maxSizeMB:r=Ma.MAX_SIZE_MB,maxWidthOrHeight:n=Ma.MAX_WIDTH_OR_HEIGHT,mimeType:i,fileName:o,libURL:a,enableCompression:s=!0,convertSvgToPng:l=!1}=t;if(!(e&&e instanceof File))return e;let c=e,u=!1;if(l){const t=(c.type||"").toLowerCase(),r=/\.svg$/i.test(c.name.trim()),i=t.includes("svg");let a=!1;if(!i&&!r)try{const e=await async function(e,t=24e3){const r=Math.min(t,Math.max(0,e.size));return e.slice(0,r).text()}(c);a=function(e){const t=e.trimStart().replace(/^\uFEFF/,"");return!!t.startsWith("<")&&/<\s*svg[\s>/]/i.test(t)}(e)}catch(e){a=!1}if(i||r||a)try{c=await async function(e,t={}){var r,n,i;const o=null!==(r=t.pixelScale)&&void 0!==r?r:2,a=null!==(n=t.maxLongEdge)&&void 0!==n?n:4096,s=await e.text(),{width:l,height:c}=Na(s,o,a),u=await ja(s,l,c,0,{canvasScale:1}),d=null!==(i=t.outputFileName)&&void 0!==i?i:e.name,h=/\.svg$/i.test(d)?d.replace(/\.svg$/i,".png"):`${d}.png`;return new File([u],h,{type:"image/png",lastModified:e.lastModified})}(c,{maxLongEdge:n,outputFileName:null!=o?o:c.name}),u=!0}catch(t){console.warn("prepareImageForUpload: SVG to PNG conversion failed, using original",t),c=e}}if(u)return c;const d=(c.type&&""!==c.type.trim()?c.type:Tr(c.name))||i||"image/jpeg",h=Ar(d);if(!h.startsWith("image/"))return Ba(c,o);const f="image/webp"===(p=h)?"image/jpeg":p;var p;const g=Fr(h),m=Fr(f),v=f!==h?function(e,t){const r=t.startsWith(".")?t.slice(1):t,n=e.lastIndexOf(".");return n>0?`${e.substring(0,n)}.${r}`:`${e}.${r}`}(null!=o?o:c.name,m):null!=o?o:c.name,y=s&&(b=g,!Ra.includes(b));var b;if(!y&&!(f!==h))return Ba(c,v);try{const t={libURL:a,useWebWorker:!0,fileType:f};y?(t.maxSizeMB=r,t.maxWidthOrHeight=n):(t.maxSizeMB=Math.max(e.size/1048576+1,1),t.initialQuality=1,t.alwaysKeepResolution=!0);const i=await Oa(c,t);return function(e,t,r,n){const i=null!=n?n:t.name;return e instanceof File?e.type!==r||e.lastModified!==t.lastModified||e.name!==i?za(e,i,r,t.lastModified):e:za(e,i,r,t.lastModified)}(i,c,Ar(i.type||f),v)}catch(e){console.error("prepareImageForUpload failed",e);try{return Ba(c,v)}catch(e){return console.error("Failed to create File with normalized name after image preparation error",e),c}}}async function Va(e){const{folderId:t,dataProviders:r,folders:n,pathHistory:i,t:o}=e,a=null==t?"":String(t);if(!a||"folders"===a)return o("Folders");if("Trash"===a)return o("Trash");const s=i||[],l=s[s.length-1];if((null==l?void 0:l.id)===a&&l.name)return l.name;const c=[...s].reverse().find(e=>e.id===a);if(null==c?void 0:c.name)return c.name;const u=null==r?void 0:r.getItem;if(u)try{const e=await Promise.resolve(u(a));if(null==e?void 0:e.name)return e.name}catch(e){}const d=null==n?void 0:n.find(e=>e.id===a);return(null==d?void 0:d.name)?d.name:a}const Ha=/^(utm_[a-z0-9_]+|fbclid|gclid|igshid|mc_cid|mc_eid)$/i;function $a(e){const t=new URL(e.trim());t.hash="",t.hostname=t.hostname.toLowerCase(),("https:"===t.protocol&&"443"===t.port||"http:"===t.protocol&&"80"===t.port)&&(t.port="");const r=Array.from(t.searchParams.entries()).filter(([e])=>!Ha.test(e)).sort(([e,t],[r,n])=>{const i=e.localeCompare(r);return 0!==i?i:t.localeCompare(n)});return t.search="",r.forEach(([e,r])=>t.searchParams.append(e,r)),t.toString()}function Wa(e){return!!(null==e?void 0:e.startsWith("image/"))&&"image/gif"!==e}function Ga(e,t){if(t===e.name)return e;try{return new File([e],t,{type:e.type,lastModified:e.lastModified})}catch(t){return console.warn("Failed to create normalized File:",t),e}}function qa(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>{var e;return r(null!==(e=n.error)&&void 0!==e?e:new Error("Failed to read proxied file"))},n.readAsDataURL(e)})}function Ya(e){try{const t=new URL(e).pathname.split("/").pop();return t?decodeURIComponent(t):void 0}catch(e){return}}function Xa(e){return null==e||""===e||"folders"===e?null:e}async function Ka(e){const t=await fetch(e,{mode:"cors"});if(!t.ok)throw new Xo(`HTTP ${t.status}`,"UploadUrlDownloadFailed",t.status);return t.blob()}function Za(e,t){var r,n;if(!(e instanceof Blob)||0===e.size)throw new Xo(t("Failed to download file from the URL."),"UploadUrlDownloadFailed");const i=(null===(n=null===(r=e.type)||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim())||"image/png";if(!i.startsWith("image/"))throw new Xo(t("Content type at the URL is not allowed."),"UploadUrlContentTypeNotAllowed");return{blob:e,mimeType:i}}const Ja=()=>{var e,t,r,n;const{state:o,actions:a,options:s}=mo(),l=To(),{sortBy:u,sortOrder:d}=l.state,{actions:{fetchFolders:h}}=qo(),{t:f}=Kn(),p=Mo(),{deleteItems:g}=Yo(),{selectedFolder:m,urlForm:v,pagination:y,files:b,pathHistory:w,folders:x}=o,C=i.useRef(null),_=i.useRef([]);C.current=y,_.current=Array.isArray(b)?b:[];const S=i.useRef(null),{setFiles:k,setLoading:A,setIsUrlModalVisible:I,setActiveLibraryItem:E,setPagination:F,setSelectedFolder:T,setPathHistory:O}=a,{dataProviders:P}=s,M=c(async e=>{var t,r,n;if(!(null==P?void 0:P.getFiles))return[];const i=null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.disablePagination,{files:o,pagination:a}=await P.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,noFolder:null==e?void 0:e.noFolder,search:(null===(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 F&&((null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.disablePagination)?F({current:1,pageSize:o.length||1,total:o.length||0}):a&&F({current:a.page,pageSize:a.limit,total:a.total})),o},[P,null===(e=null==s?void 0:s.config)||void 0===e?void 0:e.disablePagination,F]),R=c(async(e,t,r)=>pi(P,e,t,r,Vr(null==s?void 0:s.config)),[P,null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient]),L=c(async(e,t=!1)=>{var r,n,i;try{null==A||A(!0);let t=[];if(!(null==P?void 0:P.getFiles))return void console.error("DataProvider for getting files is not defined");t=await M(e);const r=null!=e?e:{folderId:m||"",itemType:"all"};"file"!==r.itemType&&(t=await Fo(t,r,null==P?void 0:P.getFolders)),"Trash"!==(m||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==k||k(t);const n=Xa(r.folderId);if(n===Xa(m)){const e=Array.isArray(w)?w:[];S.current={selectedFolder:null!=m?m:null,pathHistory:e.map(e=>Object.assign({},e))}}}catch(o){if("StaleLoad"===(null==o?void 0:o.name))return;const a=Do(o),l=404===(null==a?void 0:a.status)||"FileNotFound"===(null==a?void 0:a.code)||"path_folder_not_found"===(null==a?void 0:a.code);if(l||console.error("Error loading files:",o),!t&&l){const t=Wo(o,w||[]);try{return await Go({options:s,pathFolder:t,dataProviders:null==s?void 0:s.dataProviders}),void await L(e,!0)}catch(e){console.error("Cache clear failed:",e)}}if(l&&T&&O){const t=Array.isArray(w)?w:[];if(t.length>1){const n=t.slice(0,-1),i=n[n.length-1],o=null!==(r=null==i?void 0:i.id)&&void 0!==r?r:"folders";return O(n),T(o),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to parent folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:o}),!1)}return O([{id:"folders",name:f("Folders")}]),T("folders"),await h(),p.success({id:"FOLDER_NOT_FOUND_NAVIGATE",message:f("Folder not found"),description:f("Navigated to root folder"),placement:"bottomRight"}),void await L(Object.assign(Object.assign({},e),{folderId:"folders"}),!1)}const c=S.current;if(c&&T&&O){const e=Array.isArray(w)?w:[],t=(null!==(n=c.selectedFolder)&&void 0!==n?n:null)===(null!=m?m:null),r=function(e,t){return e.length===t.length&&e.every((e,r)=>{var n;return e.id===(null===(n=t[r])||void 0===n?void 0:n.id)})}(c.pathHistory,e);t&&r||(T(c.selectedFolder),O(c.pathHistory.map(e=>Object.assign({},e))),s.onPathChange&&s.onPathChange(c.pathHistory.map(e=>e.name)))}const u=No(null==a?void 0:a.code,f),d=null!=e?e:{folderId:m||"",itemType:"all"},g=void 0!==d.folderId&&""!==d.folderId?d.folderId:m||"",v=Array.isArray(w)?w.map(e=>Object.assign({},e)):[],y=null===(i=d.folderName)||void 0===i?void 0:i.trim(),b=y&&y.length>0?y:await Va({folderId:g,dataProviders:P,folders:Array.isArray(x)?x:[],pathHistory:v,t:f}),C=f("Failed to load files"),_=f("Failed to load files in folder",{folderName:b}),k=u&&u!==C?u:void 0;p.error({id:"FILES_FETCH_FAILED",message:_,description:k,placement:"bottomRight",innerException:o,notificationDedupe:!0,data:{params:Object.assign(Object.assign({},d),{folderName:b}),folderName:b}})}finally{null==A||A(!1)}},[P,k,A,T,O,M,h,m,x,p,f,w,s]),N=c(e=>L(e),[L]),j=c(async(e,t)=>{var r;if(!(null==P?void 0:P.findFileByUrl))return null;const n=$a(e);try{return null!==(r=await P.findFileByUrl(n))&&void 0!==r?r:null}catch(e){return console.warn("findFileByUrl failed, falling back to direct loading",e),null}},[P]),D=c(async(e,t)=>{var r,n;Jo(e,f);const i=$a(e),o=await j(i,t);if(o)return{kind:"existing",file:o,normalizedUrl:i};let a,l,c;const u=null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.handleFileProxy,d=null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.handleProxyUrl,h=function(e){if("undefined"==typeof window)return!1;try{return new URL(e).origin===window.location.origin}catch(e){return!1}}(i);if(!h&&u)try{const e=Za(await Promise.resolve(u(i)),f);a=e.blob,l=e.mimeType}catch(e){c=e,console.warn("handleFileProxy failed or returned a non-image blob, falling back to next strategy",e)}if(!h&&!a&&d)try{const e=await Promise.resolve(d(i)),t=Za(await Ka(e),f);a=t.blob,l=t.mimeType}catch(e){c=e,console.warn("handleProxyUrl fetch failed or returned a non-image blob, falling back to direct fetch",e)}if(!a)try{const e=Za(await Ka(i),f);a=e.blob,l=e.mimeType}catch(e){c=e}if(!a||!l)throw c instanceof Error?c:new Xo(f("Failed to download file from the URL."),"UploadUrlDownloadFailed");const p=Fr(l),g=Ya(i)||"uploaded-file",m=g.replace(/\.[^.]+$/,"")||"uploaded-file";return{kind:"blob",blob:a,normalizedUrl:i,mimeType:l,extension:p,fileName:Br(g.includes(".")?g:`${m}.${p}`,null==s?void 0:s.config)}},[j,null==s?void 0:s.config,f]),z=c(async(e,t)=>{var r,n,i,o;Jo(e,f);const a=$a(e);try{const e=await D(a,t);if("existing"===e.kind)return e.file;return{thumbnail:await qa(e.blob),name:e.fileName,type:e.mimeType,extension:e.extension,size:e.blob.size,sourceUrl:e.normalizedUrl,saveWithoutFolder:!0}}catch(e){let u=e;if(null==P?void 0:P.uploadFileByUrl)try{const e=null!=m?m:"",t=Br(Ya(a)||"uploaded-file",null==s?void 0:s.config),i=await R(t,e,!1),o=await P.uploadFileByUrl({url:a,folderId:e,name:i,eventSource:"pixie"}),l=Za(null!==(r=(null==o?void 0:o.id)&&P.getFileData?await P.getFileData(o.id):void 0)&&void 0!==r?r:(null==o?void 0:o.url)?await Ka(o.url):(null==o?void 0:o.thumbnailUrl)?await Ka(o.thumbnailUrl):(null==o?void 0:o.sourceUrl)?await Ka(o.sourceUrl):void 0,f),c=await qa(l.blob);return Object.assign(Object.assign({},o),{thumbnail:c,type:o.type||l.mimeType,extension:o.extension||Fr(l.mimeType),size:null!==(n=o.size)&&void 0!==n?n:l.blob.size,sourceUrl:o.sourceUrl||a})}catch(e){u=e,console.warn("Failed to prepare file for Pixie via uploadByUrl fallback",e)}const d=Do(u),h=(l=null==d?void 0:d.code,c="UploadUrlDownloadFailed","string"==typeof l?l:c),g=u instanceof Xo?u:new Xo(null!==(o=null!==(i=No(h,f))&&void 0!==i?i:null==d?void 0:d.message)&&void 0!==o?o:f("Failed to download file from the URL."),h,null==d?void 0:d.status);throw g.notificationShown=!0,await p.error({id:"EDITOR_PROXY_FILE_FAILED",message:g.message,placement:"bottomRight",data:{url:a,folderId:m||null,error:d,eventSource:"pixie"},innerException:u},t),g}var l,c},[P,p,null==s?void 0:s.config,D,R,m,f]),B=c(async e=>{const t=C.current;try{const r=_.current.find(t=>t.id===e),n=e=>{if(!e)return;const t=b.find(t=>t.id===e);return null==t?void 0:t.name};await g({items:[{id:e,isFolder:null==r?void 0:r.isFolder}],selectedFolder:m,getItemNameById:n,showNotifications:!0});const i=Object.assign({},t);let o=t.current;1===b.length&&(o=i.current>1?i.current-1:1),await N({folderId:m||"",page:o,limit:t.pageSize,sortBy:u,sortOrder:d})}catch(t){console.error("ОError when deleting a file:",t);const r=t;(null==r?void 0:r.notificationShown)||p.error({id:"FILES_DELETE_ERROR",message:f("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:m||null,errors:[{itemId:e,error:Do(t)}]}})}},[g,N,m,f,p,b,u,d]),U=c(async e=>{try{const t=C.current;if(!(null==P?void 0:P.deleteFolder))return void p.error({id:"FOLDER_DELETE_ERROR",message:f("DataProvider for folder deletion is not configured"),placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await P.deleteFolder(e)){const e=new Error("Не удалось удалить папку");throw e.notificationShown=!1,e}p.success({id:"FOLDER_DELETE_SUCCESS",message:f("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}});m===e?await N({page:t.current,limit:t.pageSize,sortBy:u,sortOrder:d}):await N({folderId:m||"",sortBy:u,sortOrder:d,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)||p.error({id:"FOLDER_DELETE_ERROR",message:f("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,error:Do(t)}]}})}},[P,m,p,f,N,u,d]),V=c(async(e,t)=>{var r,n;try{if(null==P?void 0:P.getFileData){const t=await P.getFileData(e);if(t)return t;throw new Error(f("Failed to download file"))}{const t=await fetch(`/api/files/${e}/content`);if(!t.ok)throw new Error(f("Error loading image"));return await t.blob()}}catch(i){console.error("Error when loading a file:",i);const o=_.current.find(t=>t.id===e);t||p.error({id:"FILE_DOWNLOAD_FAILED",message:f("Failed to download file"),placement:"bottomRight",description:(null==o?void 0:o.name)||e,innerException:i,notificationDedupe:!1,data:{itemId:e,itemName:(null==o?void 0:o.name)||e,folderId:null!==(r=null==o?void 0:o.folderId)&&void 0!==r?r:null,thumbnail:null!==(n=null==o?void 0:o.thumbnail)&&void 0!==n?n:null}},t)}},[P,p,f]),H=c(async(e,t,r,n)=>{var i,a,l,c,u,d,h,g,v,y,b,w,x,C;if("Trash"===(n?"":null!=t?t:m||""))throw new Error(f("Upload to Trash is forbidden"));const _=Br(e.name,null==s?void 0:s.config),S=_.split(".").pop()||"",k=n?"":null!=t?t:m||"";let A=e;try{if(Or(e)){const t=null!==(a=null===(i=null==s?void 0:s.config)||void 0===i?void 0:i.compressMaxSize)&&void 0!==a?a:Ma.MAX_SIZE_MB,r=null!==(c=null===(l=null==s?void 0:s.config)||void 0===l?void 0:l.compressMaxWidthOrHeight)&&void 0!==c?c:2e3,n=null!==(d=null===(u=null==s?void 0:s.config)||void 0===u?void 0:u.compessorUrl)&&void 0!==d?d:null===(h=null==s?void 0:s.config)||void 0===h?void 0:h.compressorUrl,o=(null===(g=e.type)||void 0===g?void 0:g.trim())||Tr(e.name)||e.type;A=await Ua(e,{maxSizeMB:t,maxWidthOrHeight:r,mimeType:o,fileName:_,libURL:n,enableCompression:Wa(o),convertSvgToPng:!0})}else A=Ga(e,_)}catch(t){console.warn("Image preparation failed, uploading original file",t),A=Ga(e,_)}let I=A.name;const F=Vr(null==s?void 0:s.config);F&&(I=await R(I,k,n)),F&&(A=Ga(A,I));try{if(null==P?void 0:P.uploadFiles)try{const t=await P.uploadFiles({items:[{name:I,size:A.size,type:A.type||e.type,folderId:k,data:A,extension:S,noFolder:n}],folderId:k});if(t.success&&t.detailed&&t.detailed.length>0){const i=t.detailed[0];if(!i.success||!i.data){if(!r){const e=(null==i?void 0:i.error)?String(i.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:_,innerException:null==i?void 0:i.error,data:{itemName:_,folderId:k||null,eventSource:"upload"}})}return void(E&&E(rr))}{const t=i.data;if(t.id){const r=(null!==(v=t.folderId)&&void 0!==v?v:k)||void 0;await N({folderId:r,noFolder:n});let i=o.files.find(e=>e.id===t.id);if(!i)try{i=(await M({folderId:r,noFolder:n,itemType:"file"})).find(e=>e.id===t.id)}catch(e){console.warn("uploadFileWithProvider: не удалось получить свежий список файлов",e)}return E&&E(rr),i||Object.assign(Object.assign({},t),{id:t.id,name:t.name||_,folderId:null!==(b=null!==(y=t.folderId)&&void 0!==y?y:k)&&void 0!==b?b:null,type:A.type||e.type,size:A.size,extension:S||_.split(".").pop()||"",thumbnail:null!==(w=t.thumbnail)&&void 0!==w?w:void 0,url:null!==(x=t.url)&&void 0!==x?x:void 0,thumbnailUrl:null!==(C=t.thumbnailUrl)&&void 0!==C?C:void 0,isFolder:!1,selected:!1})}}}else if(!t.success){if(!r){const e=t.error?String(t.error):f("Failed to upload file");p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:e,placement:"bottomRight",description:_,innerException:t.error,data:{itemName:_,folderId:k||null,eventSource:"upload"}})}return void(E&&E(rr))}return void(E&&E(rr))}catch(e){throw e}if(null==P?void 0:P.uploadFile){const t=await P.uploadFile({name:I,size:A.size,type:A.type||e.type,folderId:k,noFolder:n,data:A,extension:S});return E&&E(rr),t}return void(r||p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}))}catch(e){const t=Do(e),n=No(null==t?void 0:t.code,f);return r?void 0:void p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=n?n:f("Failed to upload file"),placement:"bottomRight",description:_,innerException:e,data:{itemName:_,folderId:k||null,error:Do(e),eventSource:"upload"}})}},[P,m,E,o.files,N,M,p,f,null==s?void 0:s.config]),$=c(async(e,t)=>{var r;if(!(null==P?void 0:P.getFolders)||!(null==P?void 0:P.createFolder))return e||"";try{const n=await P.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 P.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||""}},[P]),W=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 $(t||"",r)||t||"")}return null!==(o=null!==(i=s)&&void 0!==i?i:t)&&void 0!==o?o:null},[$]);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 W(f,p))&&void 0!==n?n:p)&&void 0!==i?i:null,y=null!==(o=null!=v?v:p)&&void 0!==o?o:null;let b;null===(a=null==m?void 0:m.onStart)||void 0===a||a.call(m,f);try{if(null==m?void 0:m.onProgress){let e=0;b=window.setInterval(()=>{var t;e=Math.min(e+10+Math.floor(Date.now()%10),90),null===(t=null==m?void 0:m.onProgress)||void 0===t||t.call(m,f.name,e)},200)}const e=await g(f,null!=y?y:void 0);return(null==m?void 0:m.onProgress)&&(null===(s=null==m?void 0:m.onProgress)||void 0===s||s.call(m,f.name,100)),null===(l=null==m?void 0:m.onComplete)||void 0===l||l.call(m,f.name),{success:!0,fileName:f.name,fileId:null==e?void 0:e.id,folderId:null!==(u=null!==(c=null==e?void 0:e.folderId)&&void 0!==c?c:y)&&void 0!==u?u:null}}catch(e){const t=e instanceof Error?e.message:String(e);return null===(d=null==m?void 0:m.onError)||void 0===d||d.call(m,f.name,t),{success:!1,fileName:f.name,folderId:null!==(h=null!=y?y:p)&&void 0!==h?h:null,error:t}}finally{void 0!==b&&clearInterval(b)}},[W]);const G=c(async(e,t)=>{var r,n,i,o,a,l,c,u,d,h,g,v,y,b,w,x,C,_,S,k,A,I,F,T,O,M,R,L,N,j,D,z,B,U,V;if(0===e.length)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};null===(r=null==t?void 0:t.onStartBatch)||void 0===r||r.call(t,e);const H=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},$=[];for(let r=0;r<e.length;r++){const v=e[r];if(!Or(v)){const e=await p.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:f("Unsupported file type"),placement:"bottomRight",data:{itemName:v.name,fileType:v.type,folderId:m||null}});null===(n=null==t?void 0:t.onError)||void 0===n||n.call(t,v.name,e.message);continue}const y=Br(v.name,null==s?void 0:s.config);let b=v;try{if(Or(v)){const e=null!==(o=null===(i=null==s?void 0:s.config)||void 0===i?void 0:i.compressMaxSize)&&void 0!==o?o:Ma.MAX_SIZE_MB,t=null!==(l=null===(a=null==s?void 0:s.config)||void 0===a?void 0:a.compressMaxWidthOrHeight)&&void 0!==l?l:2e3,r=null!==(u=null===(c=null==s?void 0:s.config)||void 0===c?void 0:c.compessorUrl)&&void 0!==u?u:null===(d=null==s?void 0:s.config)||void 0===d?void 0:d.compressorUrl,n=(null===(h=v.type)||void 0===h?void 0:h.trim())||Tr(v.name)||v.type;b=await Ua(v,{maxSizeMB:e,maxWidthOrHeight:t,mimeType:n,fileName:y,libURL:r,enableCompression:Wa(n),convertSvgToPng:!0})}else b=Ga(v,y)}catch(e){console.warn("Image preparation failed, uploading original file",e),b=Ga(v,y)}const w=`${Date.now()}-${r}-${Math.random().toString(36).slice(2,8)}`,x=await W(b,m);null===(g=null==t?void 0:t.onStart)||void 0===g||g.call(t,b),$.push({file:b,targetFolderId:x,requestId:w,originalFileName:v.name,originalIndex:r})}const G=$.length;if(0===G)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const q=Vr(null==s?void 0:s.config),Y=new Map;if(q&&(null==P?void 0:P.getFiles)){const e=[...new Set($.map(e=>{var t,r;return null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:""}).filter(e=>null!=e))];for(const t of e)try{const{files:e}=await P.getFiles({folderId:""===t?"":null!=t?t:void 0,itemType:"all",page:1,limit:1e4});let r=(e||[]).map(e=>e.name).filter(e=>!!e);if(null==P?void 0:P.getFolders){const e=(await P.getFolders({parentId:t||null,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);r=[...r,...e]}Y.set(t,r)}catch(e){console.warn("Could not fetch files for duplicate check:",e)}}const X=new Map,K=$.map(e=>{const t=q?((e,t)=>{const r=null!=e?e:"";let n=Y.get(r)||[],i=X.get(r);i||(i=new Set(n.map(e=>e.toLowerCase())),X.set(r,i));const o=fi(t,Array.from(i));return i.add(o.toLowerCase()),o})(e.targetFolderId,e.file.name):e.file.name,r=q?Ga(e.file,t):e.file;return Object.assign(Object.assign({},e),{resolvedUploadName:t,uploadFile:r})}),Z=!t,J=1===G&&Z,Q=[],ee=[],te=[],re=[],ne=new Map;let ie=0,oe=0;const ae=null!==(y=null===(v=null==s?void 0:s.config)||void 0===v?void 0:v.maxFileSize)&&void 0!==y?y:52428800,se=async(e,r,n,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};ie++,Q.push(e),ee.push(null!=n?n:e),await((e,t,r,n)=>{var i;return p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${e} ${f("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:r,itemName:e,folderId:null!==(i=null!=t?t:m)&&void 0!==i?i:null,eventSource:"upload"}},n||!Z)})(e,r,n,!l),s&&(null===(o=null==t?void 0:t.onProgress)||void 0===o||o.call(t,e,100),null===(a=null==t?void 0:t.onComplete)||void 0===a||a.call(t,e))},le=async(e,r,n,i)=>{var o;const{emitProgress:a=!0,emitNotification:s=!0,fileSize:l,progressCallbackName:c,progressCallbackIndex:u}=null!=i?i:{};oe++;const d=null!=l?{fileSize:l,maxSize:ae}:void 0,h=await((e,t,r,n,i)=>{var o,a,s,l,c,u,d;const h=Do(r),g=null!==(o=null==i?void 0:i.fileSize)&&void 0!==o?o:null==h?void 0:h.fileSize,v=null!==(s=null!==(a=null==i?void 0:i.maxSize)&&void 0!==a?a:null==h?void 0:h.maxSize)&&void 0!==s?s:ae,y={allowedChars:"a-z A-Z 0-9 . _ -",fileSize:null!=g?ui(Number(g)):void 0,maxSize:null!=v?ui(Number(v)):void 0},b=null==h?void 0:h.code,w="BatchItemLimitExceeded"===b||"exceeded_max_files"===b?b:null!==(l=jo(null==h?void 0:h.message))&&void 0!==l?l:b,x="BatchItemLimitExceeded"===w||"exceeded_max_files"===w?zo(r,f):No(w,f,y),C=(null==h?void 0:h.message)&&"string"==typeof h.message&&h.message.length>0?h.message:null,_=r instanceof Error?r.message:"string"==typeof r?r:null,S=_&&"[object Object]"!==_?_:null;return p.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!==(u=null!==(c=null!=C?C:x)&&void 0!==c?c:S)&&void 0!==u?u:f("Error uploading file {{fileName}}",{fileName:e}),placement:"bottomRight",data:{itemName:e,folderId:null!==(d=null!=t?t:m)&&void 0!==d?d:null,error:Do(r),eventSource:"upload"},innerException:r},n||!Z)})(e,r,n,!s,d);a&&(null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,null!=c?c:e,h.message,u)),re.push({itemId:void 0,itemName:e,error:Do(n)}),te.push({fileName:e,error:h.message})};let ce;if(!(null==P?void 0:P.uploadFiles))return p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"}),{successCount:0,failCount:G,successes:[],errors:[],totalCount:G};{const e=[];try{(null==t?void 0:t.onProgress)&&$.forEach(r=>{let n=0;const i=window.setInterval(()=>{var e;n=Math.min(n+10+Math.floor(Date.now()%10),90),null===(e=null==t?void 0:t.onProgress)||void 0===e||e.call(t,r.file.name,n)},200);e.push(i)}),ce=await P.uploadFiles({items:K.map(e=>{var t,r;return{requestId:e.requestId,name:e.resolvedUploadName,size:e.uploadFile.size,type:e.uploadFile.type,folderId:null!==(r=null!==(t=e.targetFolderId)&&void 0!==t?t:m)&&void 0!==r?r:null,data:e.uploadFile,extension:e.uploadFile.name.split(".").pop()||""}}),folderId:null!=m?m:null}),e.forEach(e=>window.clearInterval(e)),e.length=0;const r=null!==(b=ce.detailed)&&void 0!==b?b:[],n=new Map(r.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(r.length>0)for(let e=0;e<K.length;e++){const t=K[e],i=null!==(w=t.requestId?n.get(t.requestId):void 0)&&void 0!==w?w:r[e];if(i&&i.success){const e=i.data,r=null!==(x=null==e?void 0:e.name)&&void 0!==x?x:t.resolvedUploadName,n=null!==(S=null!==(_=null!==(C=null==e?void 0:e.folderId)&&void 0!==C?C:t.targetFolderId)&&void 0!==_?_:m)&&void 0!==S?S:null,o=null==e?void 0:e.id;ne.set(r,{id:o,name:r,folderId:n,size:null==e?void 0:e.size,originalFileName:t.originalFileName,originalIndex:t.originalIndex}),await se(r,n,o,{emitNotification:J})}else{const e=null==i?void 0:i.data,r=null!==(k=null==e?void 0:e.name)&&void 0!==k?k:t.resolvedUploadName,n=null!==(F=null!==(I=null!==(A=null==e?void 0:e.folderId)&&void 0!==A?A:t.targetFolderId)&&void 0!==I?I:m)&&void 0!==F?F:null;await le(r,n,null!==(T=null==i?void 0:i.error)&&void 0!==T?T:new Error(f("Error uploading file")),{emitNotification:J,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}else if(ce.success)for(const e of K){const t=e.resolvedUploadName,r=null!==(M=null!==(O=e.targetFolderId)&&void 0!==O?O:m)&&void 0!==M?M:null;await se(t,r,void 0,{emitNotification:J})}else{const e=null!==(R=ce.error)&&void 0!==R?R:new Error(f("Error uploading file"));for(const t of K){const r=t.resolvedUploadName,n=null!==(N=null!==(L=t.targetFolderId)&&void 0!==L?L:m)&&void 0!==N?N:null;await le(r,n,e,{emitNotification:J,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}}catch(e){for(const t of K){const r=t.resolvedUploadName,n=null!==(D=null!==(j=t.targetFolderId)&&void 0!==j?j:m)&&void 0!==D?D:null;await le(r,n,null!=e?e:new Error(f("Error uploading file")),{emitNotification:J,fileSize:t.file.size,progressCallbackName:t.originalFileName,progressCallbackIndex:t.originalIndex})}}finally{e.forEach(e=>window.clearInterval(e))}}if(ie>0&&(E&&E(rr),G>1&&Z)){const e=H(Q),t=e?f("Uploaded",{names:e}):f("uploads_success_summary",{successCount:ie,totalCount:G});p.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:ie,totalCount:G,itemIds:ee,itemNames:Q,folderId:null!=m?m:null,eventSource:"upload"}})}if(oe>0&&Z&&!J)if(G>1){const e=te.map(e=>e.fileName),t=H(e),r=t?f("Failed",{names:t}):f("uploads_fail_summary",{failCount:oe,totalCount:G});p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:oe,totalCount:G,itemNames:e,folderId:null!=m?m:null,errors:re,eventSource:"upload"}})}else if(1===G&&re.length>0&&(null===(z=re[0].error)||void 0===z?void 0:z.code)){const e=No(null===(B=re[0].error)||void 0===B?void 0:B.code,f),t=null!==(V=null===(U=te[0])||void 0===U?void 0:U.fileName)&&void 0!==V?V:"",r=null!=e?e:t?`${f("Failed to upload files")}: ${t}`:f("Failed to upload files");p.error({id:"FILES_UPLOAD_BATCH_FAILED",message:r,placement:"bottomRight",data:{failCount:oe,totalCount:G,itemNames:[t],folderId:null!=m?m:null,errors:re,eventSource:"upload"}})}return{successCount:ie,failCount:oe,successes:Q,errors:te,totalCount:G,uploadedFiles:ne.size>0?ne:void 0}},[P,null===(r=null==s?void 0:s.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient,p,W,m,E,f,null==s?void 0:s.config]),q=c(async e=>{var t;if(!(null==P?void 0:P.uploadFiles))return void p.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:f("DataProvider for file upload is not configured"),placement:"bottomRight"});if("Trash"===m)return void p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}});const r=C.current,n=document.createElement("input");n.type="file",n.accept="image/*",n.multiple=!0;try{!(!(null===(t=null==s?void 0:s.config)||void 0===t?void 0:t.features)||!s.config.features.enableDirectoryUpload)&&(n.webkitdirectory=!0)}catch(e){}n.onchange=async t=>{var n;const i=t.target.files;if(!i||0===i.length)return;const o=Array.from(i);try{null==A||A(!0);const{successes:t,errors:i,uploadedFiles:a}=await G(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 h(),await N({folderId:m||"",sortBy:u,sortOrder:d,page:r.current,limit:r.pageSize})}catch(e){console.error("Error when loading files:",e)}finally{null==A||A(!1)}},n.click()},[null==P?void 0:P.uploadFiles,m,p,f,A,N,h,u,d,G,null===(n=null==s?void 0:s.config)||void 0===n?void 0:n.features]),Y=c(async(e,t,r,n="uploadByUrl")=>{const i=C.current,o=Boolean(e&&String(e).trim());let a,l=null!=e?e:null;try{if(!t&&"Trash"===m)throw r||p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}}),new Xo(f("Cannot upload files to Trash"),"UploadUrlDownloadFailed");let e,c;if(!l&&v&&(e=await v.validateFields(),l=null==e?void 0:e.fileUrl),!l)throw r||p.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:f("Please fill in all fields"),placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,eventSource:n}}),new Xo(f("Please fill in all fields"),"UploadUrlInvalid");if(Jo(l,f),l=$a(l),null==A||A(!0),l){const e=l.split("?")[0].split("#")[0].split("/");c=e[e.length-1]||"uploaded-file",c=Br(c,null==s?void 0:s.config)}const h=t?"":m||"",g=Boolean((null==P?void 0:P.uploadFiles)||(null==P?void 0:P.uploadFile)),y=Boolean(null==P?void 0:P.uploadFileByUrl);let b=c;b&&y&&(b=await R(b,h,t));try{const e=await D(l,r);if("existing"===e.kind)a=e.file;else if(g){const r=new File([e.blob],e.fileName,{type:e.mimeType,lastModified:Date.now()});try{a=await H(r,h,!0,t)}catch(e){throw e.uploadUrlStage="binaryUpload",e}if(!a){const e=new Xo(f("Failed to upload file"),"FileUploadBackendError");throw e.uploadUrlStage="binaryUpload",e}}else{if(!y)throw r||p.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:f("Upload by URL is not supported"),placement:"bottomRight",data:{url:l,folderId:m||null,eventSource:n}}),new Xo(f("Upload by URL is not supported"),"UploadUrlDownloadFailed");a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}}catch(e){const r=e;if("binaryUpload"===(null==r?void 0:r.uploadUrlStage)||!y)throw e;console.warn("Failed to fetch file by URL locally, falling back to uploadByUrl",e),a=await P.uploadFileByUrl({url:l,folderId:m||"",noFolder:t,name:b,eventSource:n})}const w=(null==e?void 0:e.name)||(null==a?void 0:a.name)||"unnamed file";return a&&p.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${f("File")} ${w} ${f("successfully uploaded")}`,placement:"bottomRight",data:{itemName:w,itemId:null==a?void 0:a.id,folderId:m||null,eventSource:n}},r),(e||o)&&(null==I||I(!1),null==v||v.resetFields()),E&&E(rr),await N({folderId:m||"",noFolder:t,sortBy:u,sortOrder:d,page:i.current,limit:i.pageSize}),a}catch(e){if(console.error("Error when loading a file by URL:",e),!r){const t=Do(e),r=t,i=e,o=Number(null==r?void 0:r.fileSize),a=Number(null==r?void 0:r.maxSize),s=Number.isFinite(o)&&Number.isFinite(a)?{fileSize:o,maxSize:a}:void 0,c="binaryUpload"===(null==i?void 0:i.uploadUrlStage)?zo(t,f,s):Vo(t,f);p.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:c,placement:"bottomRight",data:{url:null!=l?l:null,folderId:m||null,error:t,eventSource:n},innerException:e})}throw e}finally{null==A||A(!1)}},[v,A,P,p,f,I,E,N,m,u,d,R,D,H,null==s?void 0:s.config]),X=c(async e=>{if(!e.length)return;const t=C.current;"Trash"!==m?(await G(e),await N({folderId:m||"",sortBy:u,sortOrder:d,page:t.current,limit:t.pageSize})):p.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:f("Cannot upload files to Trash"),placement:"bottomRight",data:{folderId:m||null,reason:"Upload to Trash is not allowed"}})},[N,m,u,d,G,p,f]);return{fetchFiles:N,handleDeleteFile:B,handleDeleteFolder:U,handleAddFile:q,handleAddFileByUrl:Y,handleDroppedFiles:X,getFileData:V,findFileByUrl:j,resolveFileForEditByUrl:z,uploadFileWithProvider:H}},Qa=e=>{let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.delete(e))},a=t=e(n,i,o);return o},es=e=>e;const ts=e=>{const t=(e=>e?Qa(e):Qa)(e),r=e=>function(e,t=es){const r=i.useSyncExternalStore(e.subscribe,i.useCallback(()=>t(e.getState()),[e,t]),i.useCallback(()=>t(e.getInitialState()),[e,t]));return i.useDebugValue(r),r}(t,e);return Object.assign(r,t),r};function rs(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const ns=(is=e=>({selectedFiles:new Set,visibleFileIds:[],anchorId:null,multiSelect:!0,setMultiSelect:t=>{e(e=>{var r;if(e.multiSelect===t)return e;if(t)return{multiSelect:!0};const n=null!==(r=Array.from(e.selectedFiles)[0])&&void 0!==r?r:null;return{multiSelect:!1,selectedFiles:n?new Set([n]):new Set,anchorId:n}})},syncVisibleFiles:t=>{const r=Array.isArray(t)?t.map(e=>e.id):[];e(e=>{const t=new Set(r),n=new Set(Array.from(e.selectedFiles).filter(e=>t.has(e))),i=e.anchorId&&t.has(e.anchorId)?e.anchorId:null,o=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]!==t[r])return!1;return!0}(e.visibleFileIds,r),a=rs(e.selectedFiles,n),s=e.anchorId===i;return o&&a&&s?e:{visibleFileIds:r,selectedFiles:n,anchorId:i}})},setSelectedFiles:t=>{e(e=>{var r;const n=new Set(e.visibleFileIds),i=new Set(Array.from(t).filter(e=>n.has(e)));return rs(e.selectedFiles,i)?e:{selectedFiles:i,anchorId:null!==(r=Array.from(i)[0])&&void 0!==r?r:null}})},clearSelection:()=>{e(e=>0===e.selectedFiles.size&&null===e.anchorId?e:{selectedFiles:new Set,anchorId:null})},selectAllVisible:()=>{e(e=>{var t;const r=new Set(e.visibleFileIds),n=null!==(t=e.visibleFileIds[0])&&void 0!==t?t:null;return rs(e.selectedFiles,r)&&e.anchorId===n?e:{selectedFiles:r,anchorId:n}})},toggleFileSelection:(t,r)=>{e(e=>{const n=!1!==e.multiSelect,i=Boolean(null==r?void 0:r.shiftKey)&&n,o=Boolean(null==r?void 0:r.metaKey)||Boolean(null==r?void 0:r.ctrlKey)||Boolean(null==r?void 0:r.forceToggle),a=e.visibleFileIds,s=new Set(a);if(a.length>0&&!s.has(t))return e;if(!n){const r=new Set([t]);return rs(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(i&&e.anchorId&&s.has(e.anchorId)){const r=a.indexOf(e.anchorId),n=a.indexOf(t);if(-1===r||-1===n)return e;const[i,s]=r<n?[r,n]:[n,r],l=a.slice(i,s+1),c=o?new Set(e.selectedFiles):new Set;return l.forEach(e=>{c.add(e)}),rs(e.selectedFiles,c)?e:{selectedFiles:c}}if(i&&!e.anchorId){const r=new Set([t]);return rs(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}if(o){const r=new Set(e.selectedFiles);return r.has(t)?r.delete(t):r.add(t),rs(e.selectedFiles,r)&&e.anchorId===t?e:{selectedFiles:r,anchorId:t}}const l=new Set([t]);return rs(e.selectedFiles,l)&&e.anchorId===t?e:{selectedFiles:l,anchorId:t}})}}),is?ts(is):ts);var is;const os=e=>{var t,r,n,i;const{state:o,actions:a,options:s}=mo(),{t:l}=Kn(),u=qo(),d=Mo(),{fetchFolders:h}=u.actions,{renameItem:f}=(()=>{const{options:e}=mo(),{dataProviders:t}=e,{t:r}=Kn(),n=c(async({itemId:n,newName:i,isFolder:o})=>{var a,s,l,c,u,d,h,f;try{if(o){if(!(null==t?void 0:t.renameFolder))throw new Error(r("renameFolder is not implemented in dataProviders"));const o=Ur(i.trim(),e.config),c=await t.renameFolder(n,o);return{success:!0,renamedItem:{id:c.id,name:null!==(a=c.name)&&void 0!==a?a:o,parentId:null!==(s=c.parentId)&&void 0!==s?s:null,folderId:null!==(l=c.parentId)&&void 0!==l?l:null}}}if(!(null==t?void 0:t.renameFile))throw new Error(r("renameFile is not implemented in dataProviders"));const p=Br(i,e.config),g=await t.renameFile(n,p);return{success:!0,renamedItem:{id:null!==(c=null==g?void 0:g.id)&&void 0!==c?c:n,name:null!==(u=null==g?void 0:g.name)&&void 0!==u?u:p,folderId:null!==(d=null==g?void 0:g.folderId)&&void 0!==d?d:null,parentId:null!==(f=null!==(h=null==g?void 0:g.parentId)&&void 0!==h?h:null==g?void 0:g.folderId)&&void 0!==f?f:null}}}catch(e){return{success:!1,error:Do(e)}}},[t,r,e.config]);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},k=(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)}},A=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:k(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:k(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]),I=c(()=>{null==x||x(!1),null==w||w(null),null==v||v.resetFields()},[x,w,v]),E=c(async()=>{var t,r,n,i,o,s,c,u,y,w,x,C;if(!m||!v)return;const S=null==p?void 0:p.find(e=>e.id===m);try{const p=await v.validateFields();if(!(null==p?void 0:p.newFileName))return;const A=(null==S?void 0:S.isFolder)||m.startsWith("folder_");if(A){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:k(S,m)})}else{if(!(!1!==(null===(r=null==_?void 0:_.features)||void 0===r?void 0:r.enableRenameFile)))return void d.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:l("File rename is disabled by config"),placement:"bottomRight",data:k(S,m)})}const E=await f({itemId:m,newName:p.newFileName,isFolder:A});if(!E.success){const e=No(null===(n=E.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=E.error)||void 0===i?void 0:i.message)&&void 0!==o?o:l("Error renaming"),placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{error:E.error}),innerException:E.error})}const F=E.renamedItem;A?(d.success({id:"FOLDER_RENAME_SUCCESS",message:l(`${l("Folder renamed to")} ${null!==(s=null==F?void 0:F.name)&&void 0!==s?s:p.newFileName}`),placement:"bottomRight",data:{itemId:null!==(c=null==F?void 0:F.id)&&void 0!==c?c:m,itemName:null!==(u=null==F?void 0:F.name)&&void 0!==u?u:p.newFileName,folderId:null!==(w=null!==(y=null==F?void 0:F.parentId)&&void 0!==y?y:null==F?void 0:F.folderId)&&void 0!==w?w:null}}),await h(),(null==F?void 0:F.id)&&F.id!==m&&a.setSelectedFolder&&a.setSelectedFolder(F.id)):d.success({id:"FILE_RENAME_SUCCESS",message:`${l("File renamed to")} ${null!==(x=null==F?void 0:F.name)&&void 0!==x?x:p.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},k(S,m)),{itemName:null!==(C=null==F?void 0:F.name)&&void 0!==C?C:p.newFileName})}),I(),await e({folderId:g||"",page:b.current,limit:b.pageSize})}catch(e){console.error("Error when renaming:",e);const t=Do(e),r=No(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({},k(S,m)),{error:t}),innerException:e})}},[m,v,p,a,I,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:A,handleRenameCancel:I,handleRenameOk:E}}},as=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}},ss=(e,t,r,n,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:r,folderId:null!=n?n:null}),ls=(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}),cs=()=>{const e=Mo(),{t:t}=Kn(),{state:r,options:n}=mo(),{folders:i,pathHistory:o}=r,{dataProviders:a}=n,{actions:{fetchFolders:s,fetchChildFolders:l}}=qo();return{refreshFolders:c(async({parentIds:r,selectedFolder:n})=>{try{if(await s(),r&&l)for(const e of r)e&&await l(e)}catch(r){console.error("Error when updating the folder tree:",r);const n=t("Folders");e.error({id:"FOLDERS_FETCH_FAILED",message:t("Failed to refresh folder tree"),description:n,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{folderId:null,folderName:n,reason:r instanceof Error?r.message:String(r)}})}},[e,t,s,l]),refreshFiles:c(async({fetchFiles:r,selectedFolder:n,page:s,limit:l})=>{try{await r({folderId:n||"",page:s,limit:l})}catch(r){console.error("Ошибка при обновлении списка файлов:",r);const c=await Va({folderId:n||"",dataProviders:a,folders:Array.isArray(i)?i:[],pathHistory:o,t:t}),u=t("Failed to load files"),d=r instanceof Error?r.message:String(r);e.error({id:"FILES_FETCH_FAILED",message:t("Failed to load files in folder",{folderName:c}),description:d&&d!==u?d:void 0,placement:"bottomRight",innerException:r,notificationDedupe:!0,data:{params:{folderId:n||void 0,page:s,limit:l,folderName:c},folderName:c}})}},[e,t,a,i,o])}},us=e=>{var t;const{state:r,actions:n,options:i}=mo(),{t:o}=Kn(),a=Mo(),s=ns(e=>e.selectedFiles),l=ns(e=>e.clearSelection),{files:u,selectedFolder:d,moveForm:h,pagination:f,currentMenuFile:p}=r,{setIsMoveModalVisible:g,setPagination:m}=n,{dataProviders:v}=i,{moveItems:y}=(()=>{const{options:e}=mo(),{dataProviders:t}=e,{t:r}=Kn(),n=Mo(),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=Do(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=Do(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Do(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:b,refreshFiles:w}=cs(),{getItemNameById:x,getItemNamesByIds:C,getNamesPreview:_}=as(u),S=c(()=>{null==g||g(!0)},[g]),k=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),A=c(async t=>{var r,n,c,g,S,A,I,E;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const F=u.length,T=Object.assign({},f),O=Array.from((null==p?void 0:p.length)?[p]:s),P=O.length;let M=0,R=0;const L=[],N=O.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),j=N.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,f=null!=u?u:d,p=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(p&&(null==v?void 0:v.getFolders))try{const e=await v.getFolders({parentId:u,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const e of N){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||x(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_MOVE",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for move:",e)}if(p&&(null==v?void 0:v.getFiles)&&(null==v?void 0:v.renameFile))try{let e=[];if(null==v?void 0:v.getFiles){const{files:t}=await v.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});e=(t||[]).map(e=>e.name).filter(e=>!!e)}if(null==v?void 0:v.getFolders){const t=(await v.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const t=new Set(e.map(e=>null==e?void 0:e.toLowerCase()).filter(Boolean));for(const e of N){if(e.isFolder||(null===(S=(g=e.id).startsWith)||void 0===S?void 0:S.call(g,"folder_")))continue;const r=e.name||x(e.id)||"";if(!r||!t.has(r.toLowerCase())){t.add(r.toLowerCase());continue}const n=fi(r,Array.from(t));await v.renameFile(e.id,n),t.add(n.toLowerCase())}}catch(e){console.warn("Could not check duplicates for move:",e)}const D=await y({items:N,targetFolderId:s,getItemNameById:x,showNotifications:!1});if(M=D.successCount,R=D.failCount,L.push(...D.errorDetails),M>0){const e=C(O),t=_(e),r=t?o("Moved",{names:t}):o("move_success_summary",{successCount:M,totalCount:P});a.success({id:"FILES_MOVE_SUCCESS",message:r,placement:"bottomRight",data:ss(O,M,P,u,e)})}if(R>0){const e=C(O),t=_(e);let r;if(1===P&&L.length>0&&(null===(A=L[0].error)||void 0===A?void 0:A.code)){const e=No(null===(I=L[0].error)||void 0===I?void 0:I.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P})}else r=t?o("Failed",{names:t}):o("move_fail_summary",{failCount:R,totalCount:P});a.error({id:"FILES_MOVE_ERROR",message:r,placement:"bottomRight",innerException:L.length?L:void 0,data:ls(O,R,P,u,L.length?L:void 0,e)})}k(),l();let z=T.current;if(M>0&&F>0&&M>=F&&T.current>1&&(z=T.current-1),M>0&&T.total>=M){const e=Math.max(0,(null!==(E=T.total)&&void 0!==E?E:0)-M);null==m||m({current:z,pageSize:T.pageSize,total:e})}j&&await b({parentIds:void 0,selectedFolder:f}),await w({fetchFiles:e,selectedFolder:d,page:z,limit:T.pageSize})}catch(e){console.error("Error when moving:",e);const t=No(Do(e).code,o);a.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=t?t:o("Error moving"),placement:"bottomRight",data:ls(O,P,P,d||null,[{error:Do(e)}],C(O))})}},[p,s,h,e,d,f,u,a,m,o,y,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==v?void 0:v.getFiles,null==v?void 0:v.renameFile,x]);return{actions:{showMoveModal:S,handleMoveCancel:k,handleMoveOk:A}}},ds=e=>{var t;const{state:r,actions:n,options:i}=mo(),{t:o}=Kn(),a=Mo(),s=ns(e=>e.selectedFiles),l=ns(e=>e.clearSelection),{files:u,selectedFolder:d,copyForm:h,pagination:f,currentMenuFile:p}=r,{setIsCopyModalVisible:g}=n,{dataProviders:m}=i,{copyItems:v}=(()=>{const{options:e}=mo(),{dataProviders:t}=e,{t:r}=Kn(),n=Mo(),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=>({id:e.id,newName:e.newName}))),n=r.detailed;if(n){const e=n.filter(e=>e.success),t=n.filter(e=>!e.success);s+=e.length,l+=t.length,t.forEach(e=>{const t=(e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id})(e),r=e.error,n=Do(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=Do(t);c.push({error:r})}else l+=e.length}}catch(t){l+=e.length;const r=Do(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,newName:r.newName})?s++:l++}catch(e){l++;const t=Do(e);c.push({itemId:r.id,itemName:o(r.id),error:t})}else l+=e.length,c.push({error:{message:"Copy provider is not configured"}});return a&&(s>0&&n.success({id:"FILES_COPY_SUCCESS",message:r("Files copied"),placement:"bottomRight",data:{successCount:s,totalCount:e.length,itemIds:e.map(e=>e.id),folderId:"folders"===i?null:i}}),l>0&&n.error({id:"FILES_COPY_ERROR",message:r("Errors occurred while copying"),placement:"bottomRight",innerException:c.length?c:void 0,data:{failCount:l,totalCount:e.length,itemIds:e.map(e=>e.id),errors:c.length?c:void 0}})),{successCount:s,failCount:l,errorDetails:c}},[t,n,r]);return{copyItems:i}})(),{refreshFolders:y,refreshFiles:b}=cs(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=as(u),_=c(()=>{null==g||g(!0)},[g]),S=c(()=>{null==g||g(!1),null==h||h.resetFields()},[g,h]),k=c(async t=>{var r,n,c,g,_;if(!((null==p?void 0:p.length)||s&&0!==s.size))return;const k=Array.from((null==p?void 0:p.length)?[p]:s),A=k.length;let I=0,E=0;const F=[],T=k.map(e=>u.find(t=>t.id===e)).filter(e=>Boolean(e)),O=T.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let s=t;if(!t){const e=await h.validateFields();s=null==e?void 0:e.targetFolder}if(!s)return void a.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:o("Select destination folder"),placement:"bottomRight"});const u="folders"===s?null:s,p=null!=u?u:d;let P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const M=!0===(null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.dedupeUploadNamesOnClient);if(M&&(null==m?void 0:m.getFolders))try{const e=await m.getFolders({parentId:u,deep:!1}),t=new Set((e||[]).map(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.toLowerCase()}).filter(Boolean));for(const e of T){if(!e.isFolder&&!(null===(c=(n=e.id).startsWith)||void 0===c?void 0:c.call(n,"folder_")))continue;const r=e.name||w(e.id)||"";if(r&&t.has(r.toLowerCase()))return void a.error({id:"FOLDER_ALREADY_EXISTS_COPY",message:o("A folder with that name already exists. Please enter a different folder name."),placement:"bottomRight",data:{folderName:r,targetFolderId:s}})}}catch(e){console.warn("Could not check folder duplicates for copy:",e)}if(M&&(null==m?void 0:m.getFiles))try{let e=[];const{files:t}=await m.getFiles({folderId:null!=u?u:void 0,itemType:"all",page:1,limit:1e4});if(e=(t||[]).map(e=>e.name).filter(e=>!!e),null==m?void 0:m.getFolders){const t=(await m.getFolders({parentId:u,deep:!1})||[]).map(e=>e.name).filter(e=>!!e);e=[...e,...t]}const r=[...e];P=T.map(e=>{var t,n;if(e.isFolder||(null===(n=(t=e.id).startsWith)||void 0===n?void 0:n.call(t,"folder_")))return{id:e.id,isFolder:!0};const i=T.find(t=>t.id===e.id),o=(null==i?void 0:i.name)||w(e.id)||"",a=fi(o,r);return r.push(a),{id:e.id,isFolder:!1,newName:a!==o?a:void 0}})}catch(e){console.warn("Could not check duplicates for copy:",e)}else P=T.map(e=>({id:e.id,isFolder:(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")}));const R=await v({items:P,targetFolderId:s,getItemNameById:w,showNotifications:!1});if(I=R.successCount,E=R.failCount,F.push(...R.errorDetails),I>0){const e=x(k),t=C(e),r=t?o("Copied",{names:t}):o("copy_success_summary",{successCount:I,totalCount:A});a.success({id:"FILES_COPY_SUCCESS",message:r,placement:"bottomRight",data:ss(k,I,A,u,e)})}if(E>0){const e=x(k),t=C(e);let r;if(1===A&&F.length>0&&(null===(g=F[0].error)||void 0===g?void 0:g.code)){const e=No(null===(_=F[0].error)||void 0===_?void 0:_.code,o);r=null!=e?e:t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A})}else r=t?o("Failed",{names:t}):o("copy_fail_summary",{failCount:E,totalCount:A});a.error({id:"FILES_COPY_ERROR",message:r,placement:"bottomRight",innerException:F.length?F:void 0,data:ls(k,E,A,u,F.length?F:void 0,e)})}S(),l(),O&&await y({parentIds:void 0,selectedFolder:p}),await b({fetchFiles:e,selectedFolder:d,page:f.current,limit:f.pageSize})}catch(e){console.error("Error when copying:",e);const t=No(Do(e).code,o);a.error({id:"FILES_COPY_ERROR",message:null!=t?t:o("Error copying"),innerException:e,placement:"bottomRight",data:ls(k,A,A,d||null,[{error:Do(e)}],x(k))})}},[p,s,h,e,d,f,u,a,o,v,l,g,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.dedupeUploadNamesOnClient,null==m?void 0:m.getFiles,w]);return{actions:{showCopyModal:_,handleCopyCancel:S,handleCopyOk:k}}},hs=e=>{const t=os(e),r=us(e),n=ds(e),i=(e=>{const{state:t,actions:r,options:n}=mo(),{t:i}=Kn(),o=Mo(),a=ns(e=>e.selectedFiles),s=ns(e=>e.clearSelection),{files:l,selectedFolder:u,pagination:d,currentMenuFile:h}=t,{setIsDeleteConfirmVisible:f,setUndoDeletion:p,setPagination:g}=r,{config:m}=n,{deleteItems:v}=Yo(),{refreshFolders:y,refreshFiles:b}=cs(),{getItemNameById:w,getItemNamesByIds:x,getNamesPreview:C}=as(l),_=c(()=>{null==f||f(!0)},[f]),S=c(()=>{null==f||f(!1)},[f]),k=c(async()=>{var t,r,n;if(!((null==h?void 0:h.length)||a&&0!==a.size))return void(null==f||f(!1));const c=l.length,_=Object.assign({},d),S=Array.from(h?[h]:a),k=S.map(e=>l.find(t=>t.id===e)).filter(e=>Boolean(e)),A=new Set;k.forEach(e=>{(null==e?void 0:e.isFolder)&&A.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 I=0,E=0;const F=[];try{const a=await v({items:k,selectedFolder:u,getItemNameById:w,showNotifications:!1});I=a.successCount,E=a.failCount,F.push(...a.errorDetails);const l=(null==m?void 0:m.enableTrashFolder)&&"Trash"===u;if(I>0&&(null==m?void 0:m.enableTrashFolder)&&!l&&(null==p||p({itemIds:S,sourceFolderId:u||"folders"})),I>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:I}),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}}):await o.success({id:"FILES_DELETE_SUCCESS",message:i("Files deleted"),placement:"bottomRight",data:{successCount:I,totalCount:e,itemIds:S,folderId:u||null}})}if(E>0){const e=x(S),n=C(e),a=S.length,s=1===a&&F.length>0&&(null===(t=F[0].error)||void 0===t?void 0:t.code),c=(null==m?void 0:m.enableTrashFolder)&&!l,u=i(c?"При перемещении в корзину произошли ошибки":"При удалении произошли ошибки"),d=s?No(null===(r=F[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:F.length?F:void 0,data:{failCount:E,isTrashMove:c,totalCount:a,itemNames:e,errors:F.length?F:void 0}})}s(),null==f||f(!1),await y({parentIds:Array.from(A),selectedFolder:u});let d=_.current;if(I>0&&c>0&&I>=c&&_.current>1&&(d=_.current-1),I>0&&_.total>=I){const e=Math.max(0,(null!==(n=_.total)&&void 0!==n?n:0)-I);null==g||g({current:d,pageSize:_.pageSize,total:e})}await b({fetchFiles:e,selectedFolder:u,page:d,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:E,totalCount:k.length}})}},[h,a,f,e,u,d,p,g,l,i,o,v,s,null==m?void 0:m.enableTrashFolder]);return{actions:{showDeleteConfirm:_,handleDeleteConfirmCancel:S,handleDeleteConfirmOk:k}}})(e);return{state:t.state,actions:Object.assign(Object.assign(Object.assign(Object.assign({},t.actions),r.actions),n.actions),i.actions)}},fs=()=>{const{state:e}=mo(),{files:t,loading:r,isUrlModalVisible:n}=e,i=Ja(),o=(()=>{const{state:e}=mo(),t=e.multiSelect,r=ns(e=>e.selectedFiles),n=ns(e=>e.toggleFileSelection),i=ns(e=>e.setMultiSelect);return a(()=>{i(!1!==t)},[t,i]),{state:{selectedFiles:r},actions:{toggleFileSelection:n}}})(),s=hs(i.fetchFiles);return{state:{files:t||[],selectedFiles:o.state.selectedFiles,loading:r||!1,isAddingFileByUrl:n||!1,isRenamingFile:s.state.isRenamingFile,fileToRename:s.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:o.actions.toggleFileSelection,showRenameModal:s.actions.showRenameModal,handleRenameCancel:s.actions.handleRenameCancel,handleRenameOk:s.actions.handleRenameOk,showMoveModal:s.actions.showMoveModal,handleMoveCancel:s.actions.handleMoveCancel,handleMoveOk:s.actions.handleMoveOk,showCopyModal:s.actions.showCopyModal,handleCopyCancel:s.actions.handleCopyCancel,handleCopyOk:s.actions.handleCopyOk,showDeleteConfirm:s.actions.showDeleteConfirm,handleDeleteConfirmCancel:s.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:s.actions.handleDeleteConfirmOk}}},ps="filemanager_sidebar_width";function gs({maxConcurrent:e=6}={}){const t=u(new Map),r=u([]),n=u(0),i=d(()=>{const i=e=>({status:e.status,shouldLoad:"loading"===e.status||"loaded"===e.status||"error"===e.status}),o=e=>{const t=i(e);e.listeners.forEach(e=>e(t))},a=e=>{0!==r.current.length&&(r.current=r.current.filter(t=>t!==e))},s=(e,r)=>{const n=t.current.get(e);if(!n){const n={id:e,src:r,status:"idle",listeners:new Set,active:!1};return t.current.set(e,n),n}return n.src!==r&&(a(e),n.src=r,n.status="idle"),n},l=()=>{for(;n.current<e&&r.current.length>0;){const e=r.current.shift();if(!e)break;const i=t.current.get(e);i&&i.active&&"queued"===i.status&&(i.status="loading",n.current+=1,o(i))}},c=(e,t)=>{"loading"===e.status&&(e.status=t,n.current=Math.max(0,n.current-1),o(e),l())};return{getSnapshot:(e,t)=>i(s(e,t)),subscribe:(e,r,n)=>{const o=s(e,r);return o.listeners.add(n),n(i(o)),()=>{const r=t.current.get(e);r&&(r.listeners.delete(n),r.active||0!==r.listeners.size||"loading"===r.status||t.current.delete(e))}},setActive:(e,t,i)=>{const c=s(e,t);c.active=i,i?"loaded"!==c.status&&"loading"!==c.status&&"queued"!==c.status?(c.status="queued",o(c),r.current.includes(e)||r.current.push(e),l()):o(c):"queued"===c.status?(a(e),c.status="idle",o(c)):"loading"===c.status&&(n.current=Math.max(0,n.current-1),c.status="idle",o(c),l())},markLoaded:e=>{const r=t.current.get(e);r&&c(r,"loaded")},markError:e=>{const r=t.current.get(e);r&&c(r,"error")},release:e=>{const r=t.current.get(e);r&&(r.active=!1,"queued"===r.status?(a(e),r.status="idle"):"loading"===r.status&&(n.current=Math.max(0,n.current-1),r.status="idle",l()),0===r.listeners.size&&t.current.delete(e))}}},[e]);return a(()=>()=>{r.current=[],t.current.clear(),n.current=0},[]),i}const ms=/(auto|scroll|overlay)/;function vs(e,t){const r=Math.max(0,null!=t?t:e.clientWidth);return Math.max(1,Math.round(r-function(e){if("undefined"==typeof window)return 0;const t=window.getComputedStyle(e);return(Number.parseFloat(t.paddingLeft||"0")||0)+(Number.parseFloat(t.paddingRight||"0")||0)}(e)))}function ys(e){if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return ms.test(t.overflowY)||ms.test(t.overflow)||ms.test(t.overflowX)}function bs(e){if("undefined"==typeof window)return e;let t=e;for(;t;){if(ys(t))return t;t=t.parentElement}return null}function ws(e){if("undefined"==typeof window)return[e];const t=bs(e);return t?t===e?[window,e]:[window,t]:[window]}function xs(e,t,r){Math.max(0,e.clientHeight),Math.max(0,Math.round(e.getBoundingClientRect().height));return Math.max(1,t)}function Cs(e,t){if(e===t){const r=function(e){var t;if("undefined"==typeof window)return Math.max(1,e.clientHeight);const r=e.getBoundingClientRect(),n=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,i=Math.max(0,r.top),o=Math.min(n,r.bottom);return Math.max(0,Math.round(o-i))}(t);return{scrollTop:t.scrollTop,viewportHeight:xs(e,Math.min(t.clientHeight,r||t.clientHeight)),viewportWidth:vs(t),scrollHeight:e.scrollHeight}}const r=t.getBoundingClientRect(),n=e.getBoundingClientRect(),i=Math.max(r.top,n.top),o=Math.min(r.bottom,n.bottom),a=Math.max(r.left,n.left),s=Math.min(r.right,n.right),l=Math.max(0,Math.round(o-i)),c=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(i-n.top)),viewportHeight:xs(e,l),viewportWidth:vs(e,c||t.clientWidth||e.clientWidth),scrollHeight:e.scrollHeight}}function _s(e){if("undefined"==typeof window)return{scrollTop:e.scrollTop,viewportHeight:Math.max(1,e.clientHeight),viewportWidth:vs(e),scrollHeight:e.scrollHeight};const t=bs(e);return t&&function(e){return e.scrollHeight-e.clientHeight>1}(t)?Cs(e,t):function(e){var t,r;const n=e.getBoundingClientRect(),i=window.innerHeight||(null===(t=document.documentElement)||void 0===t?void 0:t.clientHeight)||0,o=window.innerWidth||(null===(r=document.documentElement)||void 0===r?void 0:r.clientWidth)||n.width,a=Math.max(0,n.top),s=Math.min(i,n.bottom),l=Math.max(0,Math.round(s-a));return{scrollTop:Math.max(0,Math.round(-n.top)),viewportHeight:xs(e,l),viewportWidth:vs(e,Math.min(Math.round(n.width),o)),scrollHeight:e.scrollHeight}}(e)}function Ss(e,t){const r=u(null),n=c(t=>{e(_s(t))},[e]);return a(()=>{r.current&&n(r.current)},[n,...t]),a(()=>{if(!r.current||"undefined"==typeof ResizeObserver)return;const e=r.current,t=new ResizeObserver(()=>{n(e)});return t.observe(e),()=>t.disconnect()},[n]),a(()=>{const e=r.current;if(!e)return;const t=()=>{n(e)},i=ws(e);return i.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{i.forEach(e=>{e.removeEventListener("scroll",t)})}},[n,...t]),r}const ks=({onSearch:t,placeholder:r,className:n})=>{const{t:i}=Kn(),[s,l]=o(""),c=u(null),{options:d}=mo(),{config:h}=d,f=r||i("Search files...");a(()=>(c.current=Io.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(Pi,{size:16,strokeWidth:null==h?void 0:h.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{l(""),t("")}})},As=[{value:"date-desc",labelKey:"Newest first"},{value:"date-asc",labelKey:"Oldest first"},{value:"size-desc",labelKey:"Largest first"},{value:"size-asc",labelKey:"Smallest first"},{value:"name-asc",labelKey:"A-Z"},{value:"name-desc",labelKey:"Z-A"},{value:"type-asc",labelKey:"By type"}];var Is={contentLayout:"contentLayout",headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",filesLoadingOverlay:"filesLoadingOverlay",emptyStateWrapper:"emptyStateWrapper",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",tableLoadingWrapper:"tableLoadingWrapper",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",buttonSelectAll:"buttonSelectAll",gridRow:"gridRow",gridCard:"gridCard",selectedRow:"selectedRow",gridCardSelected:"gridCardSelected",gridCheckbox:"gridCheckbox",gridCardContent:"gridCardContent",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",gridFileMenu:"gridFileMenu",gridFileMenuButton:"gridFileMenuButton",actionsBox:"actionsBox",uploadContainer:"uploadContainer",uploadArea:"uploadArea",blockText:"blockText",textTitle:"textTitle",textDescription:"textDescription",buttons:"buttons",btnAi:"btnAi",btnPhoto:"btnPhoto",dragOverlay:"dragOverlay",dragOverlayInner:"dragOverlayInner",dragCaptureLayer:"dragCaptureLayer",dragOverlayGlobal:"dragOverlayGlobal",noFiles:"noFiles",noFilesIcon:"noFilesIcon",textTitle_trash:"textTitle_trash",textDescription_trash:"textDescription_trash"};const{Text:Es}=T,{Option:Fs}=O;const Ts=i.memo(({files:r,filesById:n,currentSortOption:i,isSmallScreen:o,iconStrokeWidth:a,multiSelectEnabled:s=!0,features:l,viewMode:c,setViewMode:u,handleSearch:h,handleSortOptionChange:f,sortOptions:p,onClearSelection:g,onRename:m,onDelete:v,onCopy:y,onMove:b,onEdit:w,t:x})=>{const C=d(()=>(null==p?void 0:p.length)?As.filter(e=>p.includes(e.value)):As,[p]),_=d(()=>C.map(e=>e.value).join("|")||"all",[C]),S=ns(e=>e.selectedFiles),k=ns(e=>e.selectedFiles.size),A=ns(e=>e.selectAllVisible),I=r.length>0&&k===r.length,E=d(()=>Array.from(S)[0],[S]),F=d(()=>E?n.get(E):void 0,[n,E]),T=(null==F?void 0:F.isFolder)?!1!==(null==l?void 0:l.enableRenameFolder):!1!==(null==l?void 0:l.enableRenameFile),N=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableMoveFolder):!1!==(null==l?void 0:l.enableMoveItem))}),[l,n,S]),j=d(()=>Array.from(S).every(e=>{const t=n.get(e);return!!t&&(t.isFolder?!1!==(null==l?void 0:l.enableCopyFolder):!1!==(null==l?void 0:l.enableCopyItem))}),[l,n,S]),D=d(()=>1===k&&function(e){var t,r,n;if(!e||e.isFolder)return!1;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}(F),[k,F]);return t("div",k>0?{className:`header-container ${Is.headerContainer}`,children:[t(Es,{type:"secondary",className:"selected-text",children:[t("div",{children:[k," ",x("selected")]}),s&&e(P,{title:o?x("Select all"):null,children:e(M,{className:Is.buttonSelectAll,onClick:A,disabled:I||0===r.length,children:x("Select all")})}),e(P,{title:o?x("Deselected"):null,children:e(M,{className:Is.buttonDeselected,icon:e(Oi,{size:16,strokeWidth:a}),onClick:g,children:x("Deselected")})})]}),t(R,{children:[D&&!1!==(null==l?void 0:l.enableEdit)&&e(P,{title:o?x("Edit"):null,children:e(M,{icon:e(yi,{size:16,strokeWidth:a}),onClick:()=>w(F),disabled:!D,children:x("Edit")})}),N&&e(P,{title:o?x("Move to"):null,children:e(M,{icon:e(wi,{size:16,strokeWidth:a}),onClick:b,children:x("Move to")})}),j&&e(P,{title:o?x("Copy"):null,children:e(M,{icon:e(vi,{size:16,strokeWidth:a}),onClick:y,children:x("Copy")})}),1===k&&T&&e(P,{title:o?x("Rename"):null,children:e(M,{icon:e(Ri,{size:16,strokeWidth:a}),onClick:()=>m(),disabled:1!==k||!T,children:x("Rename")})}),!1!==(null==l?void 0:l.enableDelete)&&e(P,{title:o?x("Delete"):null,children:e(M,{danger:!0,icon:e(Ni,{size:16,strokeWidth:a}),onClick:e=>{e.stopPropagation(),e.preventDefault(),v()},children:x("Delete")})})]})]}:{className:Is.headerContainer,children:[e("div",{className:"search-container",children:e(ks,{placeholder:x("Search file or folder"),onSearch:h,className:Is.searchInput})}),t("div",{className:Is.actionsBox,children:[e("div",{className:"sort-container",children:e(O,{value:i,onChange:f,className:Is.sortSelect,popupMatchSelectWidth:!1,suffixIcon:e(gi,{size:16,strokeWidth:a}),children:C.map(({value:t,labelKey:r})=>e(Fs,{value:t,children:x(r)},t))},_)}),e("div",{className:Is.actionsContainer,children:e(L,{options:[{value:"grid",icon:e(Si,{size:16,strokeWidth:a})},{value:"table",icon:e(Ii,{size:20,strokeWidth:a})}],value:c,onChange:e=>u(e)})})]})]})});Ts.displayName="FileContentHeader";const Os=i.memo(({fileId:t,style:r})=>{const n=ns(e=>e.selectedFiles.has(t)),i=ns(e=>e.toggleFileSelection);return e(N,{checked:n,style:r,onClick:e=>{e.stopPropagation()},onChange:e=>{const r=e.nativeEvent;i(t,{metaKey:r.metaKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,forceToggle:!0})}})});function Ps(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}Os.displayName="FileSelectionCheckbox","function"==typeof SuppressedError&&SuppressedError;const Ms=i.memo(t=>{var{className:r}=t,n=Ps(t,["className"]);const i=n["data-row-key"],o=null==i?"":String(i),a=[r,ns(e=>!!o&&e.selectedFiles.has(o))?Is.selectedRow:""].filter(Boolean).join(" ");return e("tr",Object.assign({},n,{className:a}))});Ms.displayName="SelectableTableRow";const Rs=i.memo(({item:t,variant:r="table",t:n,iconStrokeWidth:i,setCurrentMenuFile:a,showMoveModal:s,showCopyModal:l,showRenameModal:u,showDeleteConfirm:h,onEdit:f})=>{const[p,g]=o(!1),m=d(()=>{if(!p)return[];const r=[];return t.canEdit&&r.push({key:"edit",label:n("Edit"),icon:e(yi,{size:16,strokeWidth:i})}),t.canMove&&r.push({key:"move",label:n("Move to"),icon:e(wi,{size:16,strokeWidth:i})}),t.canCopy&&r.push({key:"copy",label:n("Copy"),icon:e(vi,{size:16,strokeWidth:i})}),t.canRename&&r.push({key:"rename",label:n("Rename"),icon:e(Ri,{size:16,strokeWidth:i})}),t.canDelete&&r.push({key:"delete",label:n("Delete"),icon:e(Ni,{size:16,strokeWidth:i}),style:{color:"#ff4d4f"}}),r},[i,p,t.canCopy,t.canDelete,t.canEdit,t.canMove,t.canRename,n]),v=c(({key:e})=>{switch(t.id&&(null==a||a(t.id)),e){case"edit":f(t.file);break;case"move":s();break;case"copy":l();break;case"rename":u(t.id);break;case"delete":null==h||h();break;default:null==a||a("")}},[t,f,a,l,h,s,u]),y=d(()=>({items:m,onClick:v}),[v,m]);return e(j,{arrow:!0,placement:"bottom",menu:y,trigger:["hover"],onOpenChange:g,children:"grid"===r?e(M,{type:"default",className:`${Is.gridFileMenuButton} gridFileMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(bi,{size:16,strokeWidth:i})}):e("span",{className:`${Is.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:e(bi,{size:16,strokeWidth:i})})})});Rs.displayName="FileItemActionsDropdown";const Ls=({thumbnailSrc:t,previewSrc:r,lightboxSrc:n,alt:i,className:s,width:l,height:u,preview:h=!1})=>{const f=i,[p,g]=o(0),m=c(e=>{const t=e.split(",")[1];return!!(t&&t.length>20)},[]),v=c(e=>{var t;if(e&&"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q=="!==e)return e.startsWith("data:image/")?m(e)?e:void 0:e.startsWith("blob:")?e:e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?null!==(t=(e=>{if(e&&"string"==typeof e){if(e.startsWith("data:")||e.startsWith("blob:"))return e;try{if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")){const t=new URL(e.startsWith("/")?`https://x${e}`:e),r=e.startsWith("/")?"":`${t.protocol}//${t.host}`,n=t.pathname.split("/").map(e=>{if(!e)return"";try{return encodeURIComponent(decodeURIComponent(e))}catch(t){return encodeURIComponent(e)}}).join("/");return e.startsWith("/")?n+(t.search||"")+(t.hash||""):`${r}${n}${t.search}${t.hash}`}}catch(e){}return e}})(e))&&void 0!==t?t:e:void 0},[m]),y=d(()=>v(t),[t,v]),b=d(()=>v(r),[r,v]),w=d(()=>v(n),[n,v]),x=d(()=>[y,b].filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t),[y,b]);a(()=>{g(0)},[x]);const C=c((e,t)=>e&&e.toLowerCase().endsWith(".svg")||t&&(t.includes(".svg")||t.includes("image/svg+xml")),[]),_=x[p],S=null!=w?w:_,k=c(()=>{if(!_)return;const e=p+1;C(f,_),g(e)},[_,p,f,C]),A=null!=_?_:pr,I=!(!h||!S)&&{src:S,toolbarRender:()=>null,destroyOnHidden:!0,mask:e(ye,{style:{fontSize:"20px"}})};return e(D,{className:s,src:A,alt:i,width:l,height:u,preview:I,onError:k,fallback:pr})},Ns=i.memo(({item:t,variant:r="table",FolderIcon:n,getFileData:i,className:o,width:a,height:s})=>t.isFolder?e("div","grid"===r?{className:Is.gridFolderIcon,children:e(n,{className:Is.gridFolderIconImage})}:{className:Is.fileManagerTableFolder,children:e("div",{className:Is.fileManagerTableFolderInner,children:e(n,{className:Is.tableFolderIcon,style:{width:null!=a?a:40,height:null!=s?s:40}})})}):t.thumbnailSrc||t.previewSrc?e(Ls,{className:o,thumbnailSrc:t.thumbnailSrc,previewSrc:t.previewSrc,lightboxSrc:t.lightboxSrc,alt:t.file.name,width:a,height:s,preview:!0,file:t.file,getFileData:i}):null);function js(e){var t,r,n;if(e.isFolder)return!1;const i="string"==typeof e.name?e.name:"",o=i?null===(t=i.split(".").pop())||void 0===t?void 0:t.toLowerCase():void 0,a=null!==(n=null===(r=e.extension)||void 0===r?void 0:r.toLowerCase())&&void 0!==n?n:o;return"string"==typeof e.type&&e.type.startsWith("image/")||"string"==typeof a&&mr.includes(a)}Ns.displayName="FileItemPreview";const Ds=i.memo(({item:r,t:n,iconStrokeWidth:i,FolderIcon:o,handleItemClick:a,setCurrentMenuFile:s,showMoveModal:l,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f,onEditorOk:p,getFileData:g,showSelectionCheckbox:m=!0})=>{const v=ns(e=>e.selectedFiles.has(r.id)),y=c(e=>{const t=e.target;if(t.closest(".gridFileMenuButton")||t.closest(".ant-dropdown-menu"))return;Boolean(t.closest(".ant-image"))||Boolean(t.closest(".ant-image-preview-wrap"))||1===e.detail&&(r.isFolder?a(r.file):p&&js(r.file)&&p(r.file))},[a,r.file,r.isFolder,p]);return e(z,{className:Is.gridCard_col,style:{padding:0},children:t(B,{hoverable:!0,cover:e("div",{className:r.isFolder?Is.gridPreviewContainerFolder:Is.gridPreviewContainer,onClick:e=>{e.stopPropagation(),y(e)},children:e(Ns,{item:r,variant:"grid",FolderIcon:o,getFileData:g,className:Is.gridImagePreview})}),className:`${Is.gridCard} ${v?Is.gridCardSelected:""}`,onClick:e=>{e.stopPropagation(),e.preventDefault(),y(e)},children:[t("div",{className:Is.gridCardContent,onClick:e=>{e.stopPropagation(),e.preventDefault(),y(e)},children:[e("div",{className:Is.gridFileName,children:r.nameText||n("Untitled")}),e("div",{className:Is.gridFileInfo,children:r.gridInfoText})]}),e("div",{className:Is.gridFileMenu,onClick:e=>{e.stopPropagation()},children:e(Rs,{item:r,variant:"grid",t:n,iconStrokeWidth:i,setCurrentMenuFile:s,showMoveModal:l,showCopyModal:u,showRenameModal:d,showDeleteConfirm:h,onEdit:f})}),m?e("div",{onClick:e=>{e.stopPropagation()},className:Is.gridCheckbox,children:e(Os,{fileId:r.id,style:{height:20}})}):null]})})});Ds.displayName="FileGridItem";const zs=i.memo(({rows:t,topOffset:n=0,bottomOffset:i=0,t:o,iconStrokeWidth:a,FolderIcon:s,handleItemClick:l,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p,onEditorOk:g,getFileData:m,showSelectionCheckbox:v=!0})=>e(r,{children:e("div",{style:{paddingTop:n,paddingBottom:i},children:e(U,{gutter:[16,16],className:Is.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:t.map(t=>e(Ds,{item:t,handleItemClick:l,iconStrokeWidth:a,t:o,FolderIcon:s,setCurrentMenuFile:c,showMoveModal:u,showCopyModal:d,showRenameModal:h,showDeleteConfirm:f,onEdit:p,onEditorOk:g,getFileData:m,showSelectionCheckbox:v},t.id))})})}));zs.displayName="FileGridView";const Bs=i.memo(({rows:t,columns:n,topOffset:i=0,bottomOffset:o=0,onRow:a,components:s})=>{const l=d(()=>e("div",{style:{paddingTop:i,paddingBottom:o},children:e(A,{renderEmpty:()=>e(H,{image:e(r,{}),description:""}),children:e(V,{dataSource:t,columns:n,rowKey:"id",pagination:!1,tableLayout:"fixed",onRow:a,components:s,showHeader:!1})})}),[o,n,s,a,t,i]);return e("div",{className:Is.tableLoadingWrapper,children:l})});Bs.displayName="FileTableView";const Us=i.memo(({item:t})=>t.dateText?e(P,{title:t.dateText,placement:"bottom",className:Is.fileDate,children:t.dateText}):null);Us.displayName="FileItemDate";const Vs=i.memo(({item:r})=>t("div",{className:Is.fileName,children:[r.nameText,r.isFolder&&e("div",{className:Is.fileItemCount,children:r.folderItemsText})]}));Vs.displayName="FileItemName";const Hs="filemanager_view_mode";class $s{constructor(){this.rowsById=new Map}reconcile(e,t,r){const n=new Map,i=[];for(const o of e){const e=t.getId(o),a=t.buildSignature(o,r),s=this.rowsById.get(e);if(s&&s.signature===a){n.set(e,s),i.push(s);continue}const l=t.buildRowModel(o,r,{id:e,signature:a});n.set(e,l),i.push(l)}return this.rowsById=n,i}}class Ws{createRenderWindow(e,t){var r,n,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y,b,w,x,C,_,S,k,A;const I=null!==(r=null==t?void 0:t.renderStrategy)&&void 0!==r?r:"full";if("windowed"!==I){if("positioned"===I){const r=null!==(i=null===(n=null==t?void 0:t.positioned)||void 0===n?void 0:n.layout)&&void 0!==i?i:[],v=null!==(a=null===(o=null==t?void 0:t.positioned)||void 0===o?void 0:o.viewportTop)&&void 0!==a?a:0,y=null!==(l=null===(s=null==t?void 0:t.positioned)||void 0===s?void 0:s.viewportBottom)&&void 0!==l?l:Number.MAX_SAFE_INTEGER,b=Math.max(0,null!==(u=null===(c=null==t?void 0:t.positioned)||void 0===c?void 0:c.overscanPx)&&void 0!==u?u:0),w=Math.max(0,null!==(h=null===(d=null==t?void 0:t.positioned)||void 0===d?void 0:d.containerHeight)&&void 0!==h?h:0),x=r.filter(e=>e.bottom>=v-b&&e.top<=y+b).map(t=>({row:e[t.index],layout:t})).filter(e=>Boolean(e.row)),C=null!==(p=null===(f=x[0])||void 0===f?void 0:f.layout.index)&&void 0!==p?p:-1,_=null!==(m=null===(g=x[x.length-1])||void 0===g?void 0:g.layout.index)&&void 0!==m?m:-1;return{rows:x.map(e=>e.row),startIndex:C,endIndex:_,topOffset:0,bottomOffset:0,totalCount:e.length,containerHeight:w,positionedItems:x}}return{rows:e,startIndex:0,endIndex:e.length>0?e.length-1:-1,topOffset:0,bottomOffset:0,totalCount:e.length}}const E=Math.max(0,null!==(y=null===(v=null==t?void 0:t.windowed)||void 0===v?void 0:v.startIndex)&&void 0!==y?y:0),F=null!==(w=null===(b=null==t?void 0:t.windowed)||void 0===b?void 0:b.endIndex)&&void 0!==w?w:e.length-1,T=Math.max(0,null!==(C=null===(x=null==t?void 0:t.windowed)||void 0===x?void 0:x.overscan)&&void 0!==C?C:0),O=Math.max(1,null!==(S=null===(_=null==t?void 0:t.windowed)||void 0===_?void 0:_.estimatedItemSize)&&void 0!==S?S:1),P=Math.max(1,null!==(A=null===(k=null==t?void 0:t.windowed)||void 0===k?void 0:k.itemsPerLane)&&void 0!==A?A:1),M=Math.ceil(e.length/P),R=Math.min(e.length-1,F),L=Math.floor(E/P),N=Math.floor(Math.max(E,R)/P),j=Math.max(0,L-T),D=Math.min(M-1,N+T),z=j*P,B=Math.min(e.length-1,(D+1)*P-1),U=Math.max(0,M-D-1);return{rows:e.slice(z,B+1),startIndex:z,endIndex:B,topOffset:j*O,bottomOffset:U*O,totalCount:e.length}}}function Gs({items:e,context:t,adapter:r,options:n}){const i=u(null),o=u(null);i.current||(i.current=new $s),o.current||(o.current=new Ws);const a=d(()=>i.current.reconcile(e,r,t),[r,t,e]),s=d(()=>o.current.createRenderWindow(a,n),[n,a]);return{rowModels:a,renderWindow:s}}function qs({totalCount:e,plan:t}){const[r,n]=o(null),i=d(()=>{var n,i;if(!t.enabled)return{renderStrategy:"full"};const o=function(e,t){var r;return Math.max(1,null!==(r=null==e?void 0:e.viewportHeight)&&void 0!==r?r:t)}(r,null!==(n=t.fallbackViewportHeight)&&void 0!==n?n:800),a=Math.max(1,Math.ceil(o/t.estimatedItemSize)),s=Math.max(1,Math.ceil(e/t.itemsPerLane)),l=Math.min(s-1,Math.max(0,Math.floor((null!==(i=null==r?void 0:r.scrollTop)&&void 0!==i?i:0)/t.estimatedItemSize))),c=l+a-1;return{renderStrategy:"windowed",windowed:{startIndex:l*t.itemsPerLane,endIndex:Math.min(e-1,(c+1)*t.itemsPerLane-1),overscan:t.overscan,estimatedItemSize:t.estimatedItemSize,itemsPerLane:t.itemsPerLane}}},[t.enabled,t.estimatedItemSize,t.fallbackViewportHeight,t.itemsPerLane,t.overscan,e,r]);return{engineOptions:i,handleViewportChange:c(e=>{n(t=>(null==t?void 0:t.viewportHeight)===e.viewportHeight&&(null==t?void 0:t.viewportWidth)===e.viewportWidth&&(null==t?void 0:t.scrollHeight)===e.scrollHeight&&(null==t?void 0:t.scrollTop)===e.scrollTop?t:e)},[])}}function Ys(e,t){if("number"==typeof e.childCount)return e.childCount;const r=t[e.id];return null===r?null:null!=r?r:0}function Xs(e){var t,r,n;const i=e.extension||(e.name&&e.name.includes(".")?e.name.split(".").pop():void 0)||((null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))?null===(n=null===(r=e.type.split("/")[1])||void 0===r?void 0:r.split(";")[0])||void 0===n?void 0:n.trim():void 0);return Boolean(i&&gr.includes(i.toLowerCase()))}function Ks(e,t){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return"";const n=[t("months.january"),t("months.february"),t("months.march"),t("months.april"),t("months.may"),t("months.june"),t("months.july"),t("months.august"),t("months.september"),t("months.october"),t("months.november"),t("months.december")];return t("Added",{date:`${r.getDate()} ${n[r.getMonth()]} ${r.getFullYear()}`})}const Zs={getId:e=>e.id,buildSignature:(e,t)=>function(e,t){var r,n,i,o,a,s,l,c;const u=Boolean(e.isFolder),d=u?Ys(e,t.folderFileCounts):null,h=u?null===d?"u":String(d):"0",f=Ks(e.date,t.t),p=!u&&e.size?String(e.size):"",g=e.thumbnailUrl||e.thumbnail,m=e.url&&Xs(e)?e.url:"",v=t.previewFallbackToFileUrl?m:"",y=[!1!==(null===(r=t.features)||void 0===r?void 0:r.enableEdit),!1!==(null===(n=t.features)||void 0===n?void 0:n.enableMoveFolder),!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveItem),!1!==(null===(o=t.features)||void 0===o?void 0:o.enableCopyFolder),!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyItem),!1!==(null===(s=t.features)||void 0===s?void 0:s.enableRenameFolder),!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFile),!1!==(null===(c=t.features)||void 0===c?void 0:c.enableDelete)].join("|"),b=[g||"",v,m].join("::");return[e.id,e.name,e.folderId,e.type||"",e.extension||"",b,b,e.dimensions||"",p,f,u?"1":"0",h,y].join("::")}(e,t),buildRowModel:(e,t,r)=>{var n,i,o,a,s,l,c,u;const d=Boolean(e.isFolder),h=d?Ys(e,t.folderFileCounts):null,f=d&&null===h?"—":d?`${h} ${1===h?t.t("item"):t.t("items")}`:"",p=e.dimensions||"",g=!d&&e.size?hi(e.size):"",m=d?t.t("Folder"):function(e){var t,r,n;return e.extension||(null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase())||(e.url?null===(n=null===(r=e.url.split("?")[0].split("/").pop())||void 0===r?void 0:r.split(".").pop())||void 0===n?void 0:n.toLowerCase():"")||""}(e),v=Ks(e.date,t.t),y=d?f:[p,g,m].filter(Boolean).join(" • "),b=e.thumbnailUrl||e.thumbnail,w=e.url&&Xs(e)?e.url:void 0,x=t.previewFallbackToFileUrl?w:void 0;return{id:r.id,signature:r.signature,item:e,file:e,isFolder:d,nameText:e.name||t.t("No name"),folderItemsText:f,dimensionsText:p,sizeText:g,typeText:m,dateText:v,gridInfoText:y,thumbnailSrc:b,previewSrc:x,lightboxSrc:w,canEdit:!d&&!1!==(null===(n=t.features)||void 0===n?void 0:n.enableEdit)&&Xs(e),canMove:d?!1!==(null===(i=t.features)||void 0===i?void 0:i.enableMoveFolder):!1!==(null===(o=t.features)||void 0===o?void 0:o.enableMoveItem),canCopy:d?!1!==(null===(a=t.features)||void 0===a?void 0:a.enableCopyFolder):!1!==(null===(s=t.features)||void 0===s?void 0:s.enableCopyItem),canRename:d?!1!==(null===(l=t.features)||void 0===l?void 0:l.enableRenameFolder):!1!==(null===(c=t.features)||void 0===c?void 0:c.enableRenameFile),canDelete:!1!==(null===(u=t.features)||void 0===u?void 0:u.enableDelete)}}};const Js=i.memo(({files:r,searchTerm:n,handleSearch:i,sortBy:s,sortOrder:l,handleSortOptionChange:h,pagination:f,setPagination:p,loading:g,handleItemClick:m,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,showRenameModal:C,showDeleteConfirm:_,showCopyModal:k,showMoveModal:A,onEdit:I,getFileData:E,handleAddFile:F})=>{var T;const{t:O}=Kn(),P=Mo(),{DropZoneFileIcon:M,BigStockIcon:R,BigAIIcon:L,FolderIcon:N}=yo(),{options:j,actions:D,state:z}=mo(),{dataProviders:B,config:U}=j,V=null==U?void 0:U.disablePagination,{setCurrentMenuFile:H,setActiveLibraryItem:W}=D,G="Trash"===(null==z?void 0:z.selectedFolder),q=!1!==(null==z?void 0:z.multiSelect),{viewMode:Y,setViewMode:X}=(()=>{const[e,t]=o(()=>{try{return localStorage.getItem(Hs)||"table"}catch(e){return"table"}}),r=c(e=>{t(e);try{localStorage.setItem(Hs,e)}catch(e){console.warn("Не удалось сохранить режим отображения:",e)}},[]),n=c(()=>{r("table"===e?"grid":"table")},[e,r]);return{viewMode:e,setViewMode:r,toggleViewMode:n}})(),[K,Z]=o({}),[J,Q]=o(!1),ee=u(0),te=u(null);a(()=>{const e=window.matchMedia("(max-width: 1199px)"),t=e=>{Q(e.matches)};t(e);const r=e=>t(e);return"function"==typeof e.addEventListener?(e.addEventListener("change",r),()=>e.removeEventListener("change",r)):(e.addListener(r),()=>e.removeListener(r))},[]);const re=d(()=>(null==U?void 0:U.features)||{},[null==U?void 0:U.features]),ne=null==U?void 0:U.iconStrokeWidth,ie=null==U?void 0:U.sortOptions,oe=d(()=>(null==ie?void 0:ie.length)?new Set(ie):null,[ie]),ae=`${s}-${l}`;a(()=>{var e;if(oe&&!oe.has(ae)){const t=null===(e=As.find(e=>oe.has(e.value)))||void 0===e?void 0:e.value;t&&h(t)}},[oe,ae,h]);const se=d(()=>new Map(r.map(e=>[e.id,e])),[r]),{renderRows:le,renderWindow:ce,hasAnyValidDate:ue,handleViewportChange:de}=function({files:e,folderFileCounts:t,features:r,t:n,viewMode:i,previewFallbackToFileUrl:a}){const s=d(()=>({folderFileCounts:t,features:r,t:n,previewFallbackToFileUrl:a}),[r,t,n,a]),[l,u]=o(()=>Math.max(1,Math.floor(5))),h=d(()=>{const t=e.length>150;return"table"===i?{enabled:t,estimatedItemSize:56,overscan:10,itemsPerLane:1,fallbackViewportHeight:800}:{enabled:t,estimatedItemSize:320,overscan:2,itemsPerLane:l,fallbackViewportHeight:800}},[e.length,l,i]),{engineOptions:f,handleViewportChange:p}=qs({totalCount:e.length,plan:h}),{rowModels:g,renderWindow:m}=Gs({items:e,context:s,adapter:Zs,options:f}),v=d(()=>g.some(e=>Boolean(e.dateText)),[g]),y=c(e=>{if("grid"===i){const t=Math.max(1,Math.floor(e.viewportWidth/240));u(e=>e===t?e:t)}p(e)},[p,i]);return{rowModels:g,renderRows:m.rows,renderWindow:m,hasAnyValidDate:v,handleViewportChange:y}}({files:r,folderFileCounts:K,features:re,t:O,viewMode:Y,previewFallbackToFileUrl:null==U?void 0:U.previewFallbackToFileUrl}),he=c(async e=>{var t,r,n,i;try{if(null==B?void 0:B.getChildrenCount)return await B.getChildrenCount("folders"===e?void 0:e);if(null==B?void 0:B.getFiles){const{files:r,pagination:n}=await B.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:V?void 0:1,limit:V?void 0:1});return V?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;if(404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.code)||404===(null===(i=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.status))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Va({folderId:e,dataProviders:B,folders:Array.isArray(z.folders)?z.folders:[],pathHistory:z.pathHistory,t:O});return P.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:O("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[B,V,P,z.folders,z.pathHistory,O]),fe=c(async()=>{const e=ee.current+1;ee.current=e;const t=r.filter(e=>e.isFolder);if(0===t.length)return void Z(e=>0===Object.keys(e).length?e:{});const n={},i=t.map(async e=>{"number"!=typeof e.childCount?n[e.id]=await he(e.id):n[e.id]=e.childCount});await Promise.all(i),ee.current===e&&Z(e=>{const t=Object.keys(e),r=Object.keys(n);return t.length===r.length&&t.every(t=>e[t]===n[t])?e:n})},[r,he]);a(()=>{fe()},[fe]),a(()=>{te.current&&de(_s(te.current))},[r.length,de,Y]),a(()=>{if(!te.current||"undefined"==typeof ResizeObserver)return;const e=te.current,t=new ResizeObserver(()=>{de(_s(e))});return t.observe(e),()=>{t.disconnect()}},[de]);const pe=c(e=>{const t=_s(e);de(t)},[de]);a(()=>{const e=te.current;if(!e)return;const t=()=>{pe(e)},r=ws(e);return r.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{r.forEach(e=>{e.removeEventListener("scroll",t)})}},[r.length,pe,Y]);const ge=c((e,t)=>e!==t,[]),me=d(()=>[...q?[{key:"selection",width:46,shouldCellUpdate:ge,render:(t,r)=>e(Os,{fileId:r.id})}]:[],{key:"preview",width:60,shouldCellUpdate:ge,render:(t,r)=>e(Ns,{item:r,variant:"table",FolderIcon:N,getFileData:E,className:`${Is.imagePreview} ${Is.tableImagePreview}`,width:40,height:40})},{title:O("Name"),width:"calc(100% - 430px)",dataIndex:"nameText",key:"name",className:Is.fileNameCol,shouldCellUpdate:ge,render:(t,r)=>e(Vs,{item:r})},{title:O("Dimensions"),key:"dimensions",width:100,shouldCellUpdate:ge,render:(t,r)=>r.dimensionsText&&e("div",{className:Is.fileSize,children:r.dimensionsText})},{title:O("Size"),key:"size",width:90,shouldCellUpdate:ge,render:(t,r)=>r.sizeText?e("div",{className:Is.fileSize,children:r.sizeText}):null},{title:O("Type"),key:"type",width:90,shouldCellUpdate:ge,render:(t,r)=>e("div",{className:Is.fileSize,children:r.typeText})},...ue?[{title:O("Date"),dataIndex:"dateText",key:"date",width:200,shouldCellUpdate:ge,render:(t,r)=>e(Us,{item:r})}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),shouldCellUpdate:ge,render:(t,r)=>e(Rs,{item:r,variant:"table",t:O,iconStrokeWidth:ne,setCurrentMenuFile:H,showMoveModal:A,showCopyModal:k,showRenameModal:C,showDeleteConfirm:_,onEdit:I})}],[N,E,ue,ne,q,I,H,ge,k,_,A,C,O]),ve=d(()=>({body:{row:Ms}}),[]),ye=c(e=>({onClick:t=>{if(t.stopPropagation(),t.preventDefault(),1!==t.detail)return;const r=t.target,n=Boolean(r.closest(".ant-checkbox-wrapper")),i=Boolean(r.closest(".ant-image"))||Boolean(r.closest(".ant-image-preview-wrap")),o=Boolean(r.closest(".tableMenuButton")),a=Boolean(r.closest(".ant-dropdown-menu"));n||i||o||a||(e.isFolder?m(e.file):j.onEditorOk&&js(e.file)&&j.onEditorOk(e.file))}}),[m,j]);let be="table"===Y?e(Bs,{rows:le,columns:me,topOffset:ce.topOffset,bottomOffset:ce.bottomOffset,onRow:ye,components:ve}):e(zs,{rows:le,topOffset:ce.topOffset,bottomOffset:ce.bottomOffset,t:O,iconStrokeWidth:ne,FolderIcon:N,handleItemClick:m,setCurrentMenuFile:H,showMoveModal:A,showCopyModal:k,showRenameModal:C,showDeleteConfirm:_,onEdit:I,onEditorOk:j.onEditorOk,getFileData:E,showSelectionCheckbox:q});n&&!r.length&&(be=e(_o,{}));const we=null===(T=null==U?void 0:U.availableImageExtensions)||void 0===T?void 0:T.map(e=>"."+e).join(", "),xe=t("div",G?{className:`${Is.noFiles} ant-layout-sider-light`,children:[e(ji,{size:48,className:Is.noFilesIcon}),e("div",{className:`${Is.textTitle_trash} ant-menu-submenu-title`,children:O("Trash is empty")}),e("div",{className:`${Is.textDescription_trash} ant-menu-submenu-title`,children:O("Deleted files will be displayed here")})]}:{className:Is.uploadContainer,children:[t("div",{className:`${Is.uploadArea} `,onClick:F,children:[e("div",{className:Is.uploadIcon,children:e(M,{})}),e("div",{className:Is.textTitle,children:O("Click here to select a file")}),e("div",{className:Is.textDescription,children:O("Supported files:")+" "+(we||"jpeg, .svg, .png")})]}),t("div",{className:Is.buttons,children:[t("button",{className:Is.btnPhoto,onClick:()=>{W&&W(ir)},children:[e("div",{className:Is.icon,children:e(R,{})}),t("div",{className:Is.blockText,children:[e("div",{className:Is.textTitle,children:O("Stock")}),e("div",{className:Is.textDescription,children:O("Select an image from our library")})]})]}),t("button",{className:Is.btnAi,onClick:()=>{W&&W(ar)},children:[e("div",{className:Is.icon,children:e(L,{})}),t("div",{className:Is.blockText,children:[e("div",{className:Is.textTitle,children:O("AI generation")}),e("div",{className:Is.textDescription,children:O("Creating an image on demand")})]})]})]})]});return e("div",{className:`content-layout ${Is.contentLayout}`,children:g||0!==(null==r?void 0:r.length)||n?t("div",{className:Is.tableContainer,children:[e(Ts,{files:r,filesById:se,currentSortOption:ae,isSmallScreen:J,iconStrokeWidth:ne,multiSelectEnabled:q,features:re,viewMode:Y,setViewMode:X,handleSearch:i,handleSortOptionChange:h,sortOptions:ie,onClearSelection:v,onRename:y,onDelete:b,onCopy:w,onMove:x,onEdit:I,t:O}),t("div",{ref:te,className:Is.filesContainer,children:[be,g?e("div",{className:Is.filesLoadingOverlay,"aria-busy":"true","aria-live":"polite",children:e(S,{size:"large"})}):null]}),!V&&f.total>f.pageSize&&e("div",{className:Is.paginationContainer,children:e($,{current:f.current,pageSize:f.pageSize,total:f.total,onChange:(e,t)=>p({current:e,pageSize:t,total:f.total}),showSizeChanger:!0,showTotal:e=>O("total pages",{total:e})})})]}):e("div",{className:Is.emptyStateWrapper,children:xe})})});Js.displayName="FileContent";var Qs="folderTree",el="emptyFolderContainer",tl="folderItemContainer",rl="folderLabel",nl="folderLabelItem",il="fileCount",ol="foldersTitle",al="foldersTitleItem",sl="folderMenu";const ll=({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}=Kn(),{options:x}=mo(),{config:C}=x,{ExpandArrowIcon:_,CollapseArrowIcon:S,CollapseFolderIcon:k,ExpandFolderIcon:A,EmptyFolderIcon:I}=yo(),E=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[F,T]=o(()=>{if(b||"selection"===y&&b){const e=s();return E(e)}return[]}),O=void 0!==g?g:F,P=void 0!==m?m:T;a(()=>{if(b||"selection"===y&&b){const e=s(),t=E(e);void 0===g&&T(t)}},[b,y,s,E,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]:void 0,o=h&&null===i?null:h&&null!=i?i:0,a=O.includes(r.key),s=u.includes(r.key),l=(()=>{var t;return(null===(t=r.children)||void 0===t?void 0:t.length)?e(a?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}):e(I,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth})})(),d=t("div",{className:`${tl} folder-item-container`,onClick:()=>!s&&c(r.key),style:{opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},children:[t("div",{className:rl,children:[void 0!==r.icon?r.icon:l,e("span",{className:nl,children:r.label})]}),h&&e("div",{className:il,title:null===o?void 0:`${o} ${w(1===o?"item":"items")}`,children:null===o?"—":o})]});return{key:r.key,title:d,children:null===(n=r.children)||void 0===n?void 0:n.map(p),disabled:s}},g=O.includes("folders"),m=e("div",{className:ol,onClick:()=>c("folders"),children:t("div",{className:al,children:[e(g?k:A,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:`${nl} 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:ol,onClick:()=>c("Trash"),children:t("div",{className:al,children:[e(Ni,{size:20,strokeWidth:null==C?void 0:C.iconStrokeWidth}),e("span",{className:nl,children:w("Trash")})]})}),children:void 0});if(d){if(!v)return[{key:"empty",title:e("div",{className:el,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,k,null==C?void 0:C.iconStrokeWidth,A,w,r,M,h,f,I,u,v,y,P]),N=d(()=>L(),[L]);return e(W,{className:`${Qs} ${sl} ${p}`,selectedKeys:r?[r]:[],expandedKeys:O,onSelect:M,onExpand:R,treeData:N,switcherIcon:({expanded:t})=>e(t?S:_,{}),showLine:!1})},cl=({style:t={},wrap:r=!1})=>{const n=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},t);return e(R,{size:"large",style:n,wrap:r,children:e(S,{})})};var ul={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField",inputButtonOk:"inputButtonOk",permanentDeleteWarning:"permanentDeleteWarning",clearTrashProgress:"clearTrashProgress",progressText:"progressText",closeIcon:"closeIcon",modalContentWithLoader:"modalContentWithLoader",modalLoaderOverlay:"modalLoaderOverlay"};const dl=({folderId:n,activeFormField:i,EmptyFolderIcon:o,targetForm:a,handleModalOk:s,onComplete:l,setIsLoading:c,t:u})=>e(E.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(P,{placement:"top",title:"Clean",children:e(M,{icon:e(be,{style:{fontSize:10}}),className:ul.inputButtonClose,type:"text",onClick:()=>{a.setFieldsValue({folderName:""})}})}),e(M,{className:ul.inputButtonOk,type:"text",onClick:()=>{c(!0),s(a).then(e=>{const t=null==e?void 0:e.id;l(t)}).finally(()=>c(!1))},children:u("Create")})]})})});function hl({folders:n,selectedFolder:o,EmptyFolderIcon:a,handleCreateFolderModalOk:s,setIsLoading:l,t:c}){const[u,d]=i.useState(""),h=i.useCallback((t,r)=>n=>e(dl,{folderId:n,activeFormField:u,EmptyFolderIcon:a,targetForm:t,handleModalOk:s,onComplete:r,setIsLoading:l,t:c},n),[a,u,s,l,c]),f=i.useCallback(e=>{const{folderId:t,targetForm:r,onTreeSelect:n,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),d(t),r.setFieldsValue({folderName:c("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),n([t]).then(()=>i(t))}}},[c]),p=i.useCallback(i=>{const{targetForm:a,onTreeSelect:s,onComplete:l,actionButtonText:d}=i,p=h(a,l),g=Array.isArray(n)?n:[],m=(n=null,i=new Set)=>g.filter(e=>{const t=null===n&&!e.parentId,r=e.parentId===n;return t||r}).map(n=>{if(i.has(n.id))return{key:n.id,label:`${n.name} (циклическая ссылка)`};const c=new Set(i);c.add(n.id);const h=m(n.id,c),{handleAddFolder:g,handleSelectFolder:v}=f({folderId:n.id,targetForm:a,onTreeSelect:s,onComplete:l}),y=u===n.id?[{key:`${n.id}_input`,label:p(n.id),icon:null},...h]:h;return{key:n.id,label:t(r,{children:[n.name,o!==n.id&&t("div",{className:`${ul.folderToolsField} folder-tools-field`,children:[e(M,{onClick:g,children:"+"}),e(M,{onClick:v,children:d})]})]}),children:y}}),v=m(),{handleAddFolder:y,handleSelectFolder:b}=f({folderId:"folders",targetForm:a,onTreeSelect:s,onComplete:l}),w="folders"===u?[{key:"folders_input",label:p("folders"),icon:null},...v]:v;return[{key:"folders",label:t(r,{children:[c("Folders"),"folders"!==o&&null!==o&&t("div",{className:`${ul.folderToolsField} folder-tools-field`,children:[e(M,{onClick:y,children:"+"}),e(M,{onClick:b,children:d})]})]}),children:w}]},[u,h,f,n,o,c]);return{activeFormField:u,setActiveFormField:d,generateMenuItemsFromFolders:p}}const fl=f(({folderId:t,activeFormField:r,EmptyFolderIcon:n,targetForm:i,handleModalOk:o,onComplete:a,t:s,setIsLoading:l,defaultFolderName:u})=>{const d=c(()=>{l(!0),o(i).then(e=>a(null==e?void 0:e.id)).finally(()=>l(!1))},[o,i,a,l]);return e(E.Item,{className:"form-item form-item-moveto "+(r===t?"form-item_active":""),name:"folderName",initialValue:u,rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(s("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{className:"form-input",autoFocus:!0,prefix:e(n,{style:{marginRight:6}}),suffix:e(M,{className:ul.inputButtonOk,type:"text",onClick:()=>{l(!0),d()},children:s("Create")})})})});fl.displayName="CustomFolderInput";const pl=({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:k,moveForm:A,selectedFiles:I,isRenameFolderModalVisible:T,handleRenameFolderOk:O,handleRenameFolderCancel:P,renameFolderForm:R,folderToRename:L,isCopyModalVisible:N,handleCopyOk:j,handleCopyCancel:D,copyForm:z,isDeleteConfirmVisible:B,handleDeleteConfirmOk:U,handleDeleteConfirmCancel:V,isClearTrashConfirmVisible:H,handleClearTrashConfirm:$,handleClearTrashCancel:W,fetchChildFolders:Y})=>{var X,K,Z;const{t:J}=Kn(),{state:Q,actions:ee,options:te}=mo(),{setCurrentMenuFile:re}=ee,{config:ne}=te,{currentMenuFile:ie}=Q,oe=E.useWatch("folderName",l),{EmptyFolderIcon:ae}=yo(),[se,le]=o(!1),ce=d(()=>{var e;return(null===(e=null==ne?void 0:ne.defaultFolderName)||void 0===e?void 0:e.trim())||J("New folder")},[null==ne?void 0:ne.defaultFolderName,J]),ue=!oe||0===String(oe).trim().length,de=d(()=>Array.isArray(C)?C:[],[C]),he=x?null===(X=de.find(e=>e.id===x))||void 0===X?void 0:X.name:"",fe=Array.isArray(h)?h:[],pe=L?null===(K=fe.find(e=>e.id===L))||void 0===K?void 0:K.name:"",{activeFormField:ge,setActiveFormField:me,generateMenuItemsFromFolders:ve}=hl({folders:fe,selectedFolder:u,EmptyFolderIcon:ae,handleCreateFolderModalOk:i,setIsLoading:e=>le(Boolean(e)),t:J});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 ye=x?de.find(e=>e.id===x):null,we=(null==ye?void 0:ye.isFolder)||(null==x?void 0:x.startsWith("folder_")),xe=c(async e=>{e.length>0&&(A.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[A,ge,me]),Ce=c(async e=>{e.length>0&&(z.setFieldsValue({targetFolder:e[0]}),ge!==e[0].toString()&&me(""))},[ge,z,me]),_e=c(async e=>{le(!0);try{await S(e)}finally{le(!1)}},[S]),Se=c(async e=>{le(!0);try{await j(e)}finally{le(!1)}},[j]),ke=d(()=>{const e=Array.from(I).filter(e=>{const t=de.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||h.some(t=>t.id===e)});return u&&"folders"!==u?e.push(u):u&&"folders"!==u||e.push("folders"),e},[I,de,h,u]);return t(r,{children:[e(G,{title:e("div",{className:"modal-title",children:J("Creating a new folder")}),open:n,onOk:()=>i(),onCancel:s,okText:J("Create"),cancelText:J("Cancel"),okButtonProps:{disabled:ue,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:t(E,{form:l,layout:"vertical",children:[e(E.Item,{name:"folderName",label:e("div",{className:"form-label",children:J("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],initialValue:ce,className:"form-item",style:{marginBottom:5},children:e(F,{autoFocus:!0,className:"form-input",disabled:se,placeholder:J("Enter the name"),onPressEnter:async()=>{le(!0);try{await l.validateFields(),ue||await i()}catch(e){le(!1)}}})}),e("div",{children:u&&"folders"!==u?t("p",{className:"fm-note",children:[J("A folder will be created inside:")," ",(null===(Z=fe.find(e=>e.id===u))||void 0===Z?void 0:Z.name)||J("selected folder"),"."]}):e("p",{className:"fm-note",children:J("The folder will be created in the root directory.")})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Upload file by URL")}),open:f,onOk:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}},onCancel:()=>p(!1),okText:J("Download"),okButtonProps:{loading:se},cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>le(!1),children:e(E,{form:m,layout:"vertical",children:e(E.Item,{name:"fileUrl",label:e("div",{className:"form-label",children:J("File URL")}),rules:[{required:!0,message:J("Enter the URL of the image")},{validator:(e,t)=>{if(!t||!String(t).trim())return Promise.resolve();try{return Jo(String(t),J),Promise.resolve()}catch(e){return Promise.reject(new Error(e instanceof Error?e.message:J("The specified URL is not valid.")))}}}],validateTrigger:"onBlur",className:"form-item",children:e(F,{className:"form-input",placeholder:"https://example.com/image.jpg",autoFocus:!0,disabled:se,onPressEnter:async()=>{var e;le(!0);try{const t=await m.validateFields(),r=String(null!==(e=t.fileUrl)&&void 0!==e?e:"").trim();await g(r,void 0,void 0,"uploadByUrl")}catch(e){}finally{le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:we?`${J("Rename folder")} ${he}`:J("Rename file",{currentFileName:he})}),open:v,onOk:y,okText:J("Rename"),okButtonProps:{loading:se},onCancel:b,cancelText:J("Cancel"),cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:w,layout:"vertical",children:e(E.Item,{name:"newFileName",label:e("div",{className:"form-label",children:J(we?"New folder name":"New file name")}),rules:[{required:!0,message:J(we?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await w.validateFields(),y()}catch(e){le(!1)}}})})})}),e(G,{title:e("div",{className:"modal-title",children:J("Move to")}),open:_,onCancel:k,footer:t("div",{className:ul.formFooter,children:[t(M,{className:ul.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),A.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(Ci,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:ul.folderButton,onClick:k,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:ul.modalContentWithLoader,children:[se&&e("div",{className:ul.modalLoaderOverlay,children:e(cl,{})}),e(E,{form:A,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:ul.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:ul.formItem,children:e(ll,{onSelect:xe,generateMenuItems:()=>ve({targetForm:A,onTreeSelect:xe,onComplete:_e,actionButtonText:J("Move here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:e("div",{className:"modal-title",children:J("Copy to folder")}),open:N,onCancel:D,footer:t("div",{className:ul.formFooter,children:[t(M,{className:ul.folderButton,onClick:()=>{const e=null!=u?u:"folders";me(e),z.setFieldsValue({folderName:ce,targetFolder:e})},loading:se,children:[e(Ci,{size:18,strokeWidth:null==ne?void 0:ne.iconStrokeWidth}),J("Create folder")]}),e(M,{type:"primary",className:ul.folderButton,onClick:D,loading:se,children:J("Done")})]}),afterClose:()=>{re&&re(""),me(""),le(!1)},loading:se,children:t("div",{className:ul.modalContentWithLoader,children:[se&&e("div",{className:ul.modalLoaderOverlay,children:e(cl,{})}),e(E,{form:z,layout:"vertical",initialValues:{targetFolder:"folders",folderName:ce,is_force_create:!1},children:t("div",{className:ul.foldersWrapper,children:[e(E.Item,{name:"targetFolder",rules:[{required:!0,message:J("Select the destination folder")}],className:ul.formItem,children:e(ll,{onSelect:Ce,generateMenuItems:()=>ve({targetForm:z,onTreeSelect:Ce,onComplete:Se,actionButtonText:J("Copy here")}),fetchChildFolders:Y,disabledFolders:ke,mode:"selection",className:"folderSelectionTree",defaultExpandAll:!0})}),e(E.Item,{name:"folderName",style:{display:"none"},rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(J("Enter the name of the folder"))):Promise.resolve()}],children:e(F,{})}),e(E.Item,{name:"is_force_create",style:{display:"none"},children:e(F,{})})]})})]})}),e(G,{title:t("div",{className:"modal-title",children:[J("Rename folder")," ",pe]}),open:T,onOk:O,onCancel:P,okText:J("Rename"),cancelText:J("Cancel"),okButtonProps:{loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},children:e(E,{form:R,layout:"vertical",children:e(E.Item,{name:"newFolderName",label:e("div",{className:"form-label",children:J("New folder name")}),rules:[{required:!0,message:J("Enter a new folder name")}],className:"form-item",children:e(F,{autoFocus:!0,className:"form-input",disabled:se,onPressEnter:async()=>{le(!0);try{await R.validateFields(),O()}catch(e){le(!1)}}})})})}),e(G,{className:`${ul.deleteModal} deleteModal`,title:(()=>{const t=!!(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u||!(null==ne?void 0:ne.enableTrashFolder),r=J(t?"Permanently delete":"Move to Trash");return e("div",{className:"modal-title",children:r})})(),open:!!B,onOk:()=>{le(!0);try{U&&U()}catch(e){console.error(e),le(!1)}},onCancel:()=>V&&V(),okText:(null==ne?void 0:ne.enableTrashFolder)&&"Trash"===u?J("Delete permanently"):(null==ne?void 0:ne.enableTrashFolder)?J("Move to Trash"):J("Delete"),cancelText:J("Cancel"),okButtonProps:{danger:!(null==ne?void 0:ne.enableTrashFolder)||"Trash"===u,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1),re&&re("")},closeIcon:e(be,{className:ul.closeIcon}),children:(()=>{var r,n;const i=(ie?[ie]:Array.from(I||[])).map(e=>de.find(t=>t.id===e)).filter(e=>!!e),o=i.filter(e=>e.isFolder||e.id.startsWith("folder_")),a=i.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=i.length,l=o.length,c=a.length,d=!!(null==ne?void 0:ne.enableTrashFolder);if(!d||d&&"Trash"===u){let n;if(1===s&&1===l){const e=o[0],t=(null==e?void 0:e.name)||"",i=null!==(r=null==e?void 0:e.childCount)&&void 0!==r?r:0;n=J("delete_folder_permanent",{name:t,count:i})}else n=0===l&&c>0?J("delete_files_permanent",{count:c}):J("delete_mixed_permanent",{total:s,folders:l,images:c});return t("div",{children:[e("div",{children:n}),e("p",{className:ul.permanentDeleteWarning,children:J("permanent_delete_warning")})]})}if(1===s&&1===l){const t=o[0],r=(null==t?void 0:t.name)||"",i=null!==(n=null==t?void 0:t.childCount)&&void 0!==n?n:0;return e("div",{children:J("move_folder_to_trash",{name:r,count:i})})}return e("div",0===l&&c>0?{children:J("move_files_to_trash",{count:c})}:{children:J("move_mixed_to_trash",{total:s,folders:l,images:c})})})()}),t(G,{className:`${ul.deleteModal} deleteModal`,title:e("div",{className:"modal-title",children:J("Clear Trash")}),open:!!H,onOk:async()=>{le(!0),$&&await $(),le(!1)},onCancel:()=>W&&W(),okText:J("Delete permanently"),cancelText:J("Cancel"),okButtonProps:{danger:!0,loading:se},cancelButtonProps:{disabled:se},afterClose:()=>{le(!1)},closeIcon:e(be,{className:ul.closeIcon}),children:[e("div",{children:J("Are you sure you want to permanently delete all items from Trash?")}),se&&t("div",{className:ul.clearTrashProgress,children:[e(q,{percent:99,status:"active",showInfo:!1}),e("div",{className:ul.progressText,children:J("Deleting items...")})]})]})]})};var gl={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const ml=f(p(({selectedFolder:r,generateMenuItems:n,onFolderSelect:i,folders:s,fetchChildFolders:l,handleAddFile:h,setIsUrlModalVisible:f,handleCreateFolder:p,activeLibraryItem:m,setActiveLibraryItem:v},y)=>{var b,w,x;const C=d(()=>Array.isArray(s)?s:[],[s]),{t:_}=Kn(),S=Mo(),[k,A]=o({}),{options:I,state:E}=mo(),{dataProviders:F,config:T}=I,O=E.pathHistory,P=!1!==(null===(b=null==T?void 0:T.features)||void 0===b?void 0:b.enableGif)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("gif")),R=!1!==(null===(w=null==T?void 0:T.features)||void 0===w?void 0:w.enableStockImages)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("stock")),L=!1!==(null===(x=null==T?void 0:T.features)||void 0===x?void 0:x.enableIconStock)&&(!(null==T?void 0:T.enabledTabs)||T.enabledTabs.includes("icons")),N=c(e=>{const t=[],r=e=>{e.forEach(e=>{t.push(e.key),e.children&&r(e.children)})};return r(e),t},[]),[j,D]=o(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n();return N(e)}return!0===(null==T?void 0:T.expandRootFolderOnInit)?["folders"]:[]}),z=u(!1),B=u(!1);a(()=>{if(z.current)return;"lazy"===(null==T?void 0:T.folderTreeLoading)&&!0===(null==T?void 0:T.expandRootFolderOnInit)&&(z.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==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit,l]),a(()=>{!0===(null==T?void 0:T.expandRootFolderOnInit)&&Array.isArray(C)&&C.length>0&&(B.current||j&&0!==j.length||(B.current=!0,D(["folders"])))},[null==T?void 0:T.expandRootFolderOnInit,C,j]),a(()=>{if(!0===(null==T?void 0:T.expandAllFoldersOnInit)&&"lazy"!==(null==T?void 0:T.folderTreeLoading)){const e=n(),t=N(e);return void D(t)}!0===(null==T?void 0:T.expandRootFolderOnInit)&&D(e=>e&&e.length>0?[...e]:["folders"])},[C,n,N,null==T?void 0:T.expandAllFoldersOnInit,null==T?void 0:T.folderTreeLoading,null==T?void 0:T.expandRootFolderOnInit]);const U=null==T?void 0:T.disablePagination,V=c(async e=>{var t,r,n,i;try{if(null==F?void 0:F.getChildrenCount)return await F.getChildrenCount("folders"===e?void 0:e);if(null==F?void 0:F.getFiles){const{files:r,pagination:n}=await F.getFiles({folderId:"folders"===e?void 0:e,itemType:"all",page:U?void 0:1,limit:U?void 0:1});return U?Array.isArray(r)?r.length:0:null!==(t=null==n?void 0:n.total)&&void 0!==t?t:Array.isArray(r)?r.length:0}return 0}catch(t){if("StaleLoad"===(null==t?void 0:t.name))return 0;const o=t;if(404===(null==o?void 0:o.status)||"FileNotFound"===(null==o?void 0:o.code)||"path_folder_not_found"===(null==o?void 0:o.code)||"path_folder_not_found"===(null===(r=null==o?void 0:o.data)||void 0===r?void 0:r.code)||404===(null===(i=null===(n=null==o?void 0:o.data)||void 0===n?void 0:n.data)||void 0===i?void 0:i.status))return 0;console.error(`Error getting the number of files for the folder ${e}:`,t);const a=await Va({folderId:e,dataProviders:F,folders:C,pathHistory:O,t:_});return S.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:_("Failed to load folder items count in folder",{folderName:a}),placement:"bottomRight",innerException:t,notificationDedupe:!0,data:{folderId:"folders"===e?null:e,folderName:a,reason:t instanceof Error?t.message:String(t)}}),null}},[F,U,S,O,C,_]),H=c(async()=>{if(0===C.length)return;const e={};e.folders=await V("folders");const t=C.map(async t=>{"number"!=typeof t.childCount?e[t.id]=await V(t.id):e[t.id]=t.childCount});await Promise.all(t),A(e)},[C,V]),$=c(async e=>{const t=await V(e);A(r=>Object.assign(Object.assign({},r),{[e]:t}))},[V]);g(y,()=>({refreshFileCounts:H}),[H]),a(()=>{H()},[H]),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=C.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?D(e=>{const r=new Set(e);return t.forEach(e=>r.add(e)),r.add("folders"),Array.from(r)}):D(e=>e.includes("folders")?e:[...e,"folders"])},[r,C]);const W=c(async()=>{await h(),r?await $(r):await $("folders")},[h,r,$]),G=[{key:rr,label:_("My files"),icon:e(ki,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth})},{key:nr,label:_("GIF"),icon:e(Ei,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!P},{key:ir,label:_("Stock images"),icon:e(mi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!R},{key:or,label:_("Icons"),icon:e(we,{size:20}),disabled:!L},{key:ar,label:_("AI"),icon:e(Mi,{size:20,strokeWidth:null==T?void 0:T.iconStrokeWidth}),disabled:!(null==T?void 0:T.sseQuery)}].filter(e=>!e.disabled),q=c(async e=>{const t=e[0];t&&"empty"!==t&&(m!==rr&&v(rr),null==i||i(t),await(null==l?void 0:l(t)))},[i,m,v,l]),K=c(({key:e})=>{v(e)},[v]),Z=c(async(e,t)=>{var r;D(e);if(!("lazy"===(null==T?void 0:T.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);const t=await Va({folderId:n,dataProviders:F,folders:C,pathHistory:O,t:_});S.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:_("Failed to load subfolders in folder",{folderName:t}),placement:"bottomRight",innerException:e,notificationDedupe:!0,data:{folderId:n,folderName:t,reason:e instanceof Error?e.message:String(e)}})}},[null==T?void 0:T.folderTreeLoading,F,l,S,O,C,_]);return t("div",{className:"sidebar-container",children:[t("div",{className:gl.buttonWrapper,children:[e(M,{type:"primary",size:"large",icon:e(Fi,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:W,className:gl.uploadButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r,children:e("span",{className:gl.uploadButtonTitle,children:_("Upload file")})}),e(M,{type:"primary",size:"large",icon:e(Ai,{size:24,strokeWidth:null==T?void 0:T.iconStrokeWidth}),onClick:()=>null==f?void 0:f(!0),className:gl.uploadByURLButton,style:{whiteSpace:"nowrap"},disabled:"Trash"===r})]}),e(Y,{className:"folder-menu",items:G,defaultSelectedKeys:[rr],onSelect:({key:e})=>K({key:e}),selectedKeys:[m]}),e(X,{className:gl.divider}),t("div",{className:gl.foldersContainer,children:[e(ll,{selectedFolder:r,onSelect:q,onExpand:Z,generateMenuItems:n,fetchChildFolders:l,showFileCounts:!0,folderFileCounts:k,expandedKeys:j,setExpandedKeys:D,showTrashFolder:null==T?void 0:T.enableTrashFolder}),e("div",{className:gl.folderActions,children:e(M,{onClick:e=>{e.stopPropagation(),p()},className:gl.button,icon:e(Ci,{size:18,strokeWidth:null==T?void 0:T.iconStrokeWidth}),size:"middle"})})]})]})}));ml.displayName="FolderSidebar";var vl=Object.defineProperty,yl=(e,t,r)=>(((e,t,r)=>{t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r);function bl(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function wl(e){var t=e.toString().split(/[eE]/),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function xl(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=wl(e);return t>0?bl(Number(e)*Math.pow(10,t)):Number(e)}function Cl(e){El&&(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 _l(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 Sl=_l(function(e,t){var r=xl(e),n=xl(t),i=wl(e)+wl(t),o=r*n;return Cl(o),o/Math.pow(10,i)}),kl=_l(function(e,t){var r=Math.pow(10,Math.max(wl(e),wl(t)));return(Sl(e,r)+Sl(t,r))/r}),Al=_l(function(e,t){var r=Math.pow(10,Math.max(wl(e),wl(t)));return(Sl(e,r)-Sl(t,r))/r}),Il=_l(function(e,t){var r=xl(e),n=xl(t);return Cl(r),Cl(n),Sl(r/n,bl(Math.pow(10,wl(t)-wl(e))))});var El=!0;var Fl={strip:bl,plus:kl,minus:Al,times:Sl,divide:Il,round:function(e,t){var r=Math.pow(10,t),n=Il(Math.round(Math.abs(Sl(e,r))),r);return e<0&&0!==n&&(n=Sl(n,-1)),n},digitLength:wl,float2Fixed:xl,enableBoundaryChecking:function(e){void 0===e&&(e=!0),El=e}};const Tl=Object.prototype.toString;function Ol(e){switch(Tl.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ul(e,Error)}}function Pl(e,t){return Tl.call(e)===`[object ${t}]`}function Ml(e){return Pl(e,"ErrorEvent")}function Rl(e){return Pl(e,"DOMError")}function Ll(e){return Pl(e,"String")}function Nl(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function jl(e){return null===e||Nl(e)||"object"!=typeof e&&"function"!=typeof e}function Dl(e){return Pl(e,"Object")}function zl(e){return typeof Event<"u"&&Ul(e,Event)}function Bl(e){return!(!e||!e.then||"function"!=typeof e.then)}function Ul(e,t){try{return e instanceof t}catch{return!1}}function Vl(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function Hl(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function $l(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{Vl(n)?r.push("[VueViewModel]"):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function Wl(e,t,r=!1){return!!Ll(e)&&(function(e){return Pl(e,"RegExp")}(t)?t.test(e):!!Ll(t)&&(r?e===t:e.includes(t)))}function Gl(e,t=[],r=!1){return t.some(t=>Wl(e,t,r))}function ql(e,t,r=250,n,i,o,a){if(!(o.exception&&o.exception.values&&a&&Ul(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=Hl(e.value,t)),e))}(Yl(e,t,i,a.originalException,n,o.exception.values,s,0),r))}function Yl(e,t,r,n,i,o,a,s){if(o.length>=r+1)return o;let l=[...o];if(Ul(n[i],Error)){Xl(a,s);const o=e(t,n[i]),c=l.length;Kl(o,i,c,s),l=Yl(e,t,r,n[i],i,[o,...l],o,c)}return Array.isArray(n.errors)&&n.errors.forEach((n,o)=>{if(Ul(n,Error)){Xl(a,s);const c=e(t,n),u=l.length;Kl(c,`errors[${o}]`,u,s),l=Yl(e,t,r,n,i,[c,...l],c,u)}}),l}function Xl(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 Kl(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 Zl(e){return e&&e.Math==Math?e:void 0}const Jl="object"==typeof globalThis&&Zl(globalThis)||"object"==typeof window&&Zl(window)||"object"==typeof self&&Zl(self)||"object"==typeof global&&Zl(global)||function(){return this}()||{};function Ql(){return Jl}function ec(e,t,r){const n=r||Jl,i=n.__SENTRY__=n.__SENTRY__||{};return i[e]||(i[e]=t())}const tc=Ql();function rc(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=nc(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 nc(e,t){const r=e,n=[];let i,o,a,s,l;if(!r||!r.tagName)return"";if(tc.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&&Ll(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 ic=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,oc=["debug","info","warn","error","log","assert","trace"],ac={};function sc(e){if(!("console"in Jl))return e();const t=Jl.console,r={},n=Object.keys(ac);n.forEach(e=>{const n=ac[e];r[e]=t[e],t[e]=n});try{return e()}finally{n.forEach(e=>{t[e]=r[e]})}}const lc=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return ic?oc.forEach(r=>{t[r]=(...t)=>{e&&sc(()=>{Jl.console[r](`Sentry Logger [${r}]:`,...t)})}}):oc.forEach(e=>{t[e]=()=>{}}),t}(),cc=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function uc(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 dc(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function hc(e){const t="string"==typeof e?function(e){const t=cc.exec(e);if(!t)return void sc(()=>{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 dc({host:o,pass:i,path:l,projectId:c,port:a,protocol:r,publicKey:n})}(e):dc(e);if(t&&function(e){if(!ic)return!0;const{port:t,projectId:r,protocol:n}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(lc.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(r.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(n)?t&&isNaN(parseInt(t,10))&&(lc.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(lc.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),1):(lc.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),1)))}(t))return t}class fc 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 pc(e,t,r){if(!(t in e))return;const n=e[t],i=r(n);"function"==typeof i&&mc(i,n),e[t]=i}function gc(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{ic&&lc.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function mc(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,gc(e,"__sentry_original__",t)}catch{}}function vc(e){return e.__sentry_original__}function yc(e){if(Ol(e))return{message:e.message,name:e.name,stack:e.stack,...wc(e)};if(zl(e)){const t={type:e.type,target:bc(e.target),currentTarget:bc(e.currentTarget),...wc(e)};return typeof CustomEvent<"u"&&Ul(e,CustomEvent)&&(t.detail=e.detail),t}return e}function bc(e){try{return function(e){return typeof Element<"u"&&Ul(e,Element)}(e)?rc(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function wc(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 xc(e){return Cc(e,new Map)}function Cc(e,t){if(function(e){if(!Dl(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]=Cc(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(Cc(e,t))}),n}return e}const _c=/\(error: (.*)\)/,Sc=/captureMessage|captureException/;function kc(...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=_c.test(r)?r.replace(_c,"$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(),Sc.test(t[t.length-1].function||"")&&(t.pop(),Sc.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 Ac(e){return Array.isArray(e)?kc(...e):e}const Ic="<anonymous>";function Ec(e){try{return e&&"function"==typeof e&&e.name||Ic}catch{return Ic}}const Fc={},Tc={};function Oc(e,t){Fc[e]=Fc[e]||[],Fc[e].push(t)}function Pc(e,t){Tc[e]||(t(),Tc[e]=!0)}function Mc(e,t){const r=e&&Fc[e];if(r)for(const n of r)try{n(t)}catch(t){ic&&lc.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Ec(n)}\nError:`,t)}}function Rc(){"console"in Jl&&oc.forEach(function(e){e in Jl.console&&pc(Jl.console,e,function(t){return ac[e]=t,function(...t){Mc("console",{args:t,level:e});const r=ac[e];r&&r.apply(Jl.console,t)}})})}function Lc(){const e=Jl,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 Nc(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function jc(e){const{message:t,event_id:r}=e;if(t)return t;const n=Nc(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Dc(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 zc(e,t){const r=Nc(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 Bc(e){if(e&&e.__sentry_captured__)return!0;try{gc(e,"__sentry_captured__",!0)}catch{}return!1}function Uc(e){return Array.isArray(e)?e:[e]}const Vc=Jl;let Hc,$c,Wc;function Gc(){if(!Vc.document)return;const e=Mc.bind(null,"dom"),t=qc(e,!0);Vc.document.addEventListener("click",t,!1),Vc.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const r=Vc[t]&&Vc[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(pc(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=qc(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}}),pc(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 qc(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;gc(r,"_sentryCaptured",!0),n&&!n._sentryId&&gc(n,"_sentryId",Lc());const i="keypress"===r.type?"input":r.type;(function(e){if(e.type!==$c)return!1;try{if(!e.target||e.target._sentryId!==Wc)return!1}catch{}return!0})(r)||(e({event:r,name:i,global:t}),$c=r.type,Wc=n?n._sentryId:void 0),clearTimeout(Hc),Hc=Vc.setTimeout(()=>{Wc=void 0,$c=void 0},1e3)}}const Yc=Ql();function Xc(){if(!("fetch"in Yc))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Kc(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Zc(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!Xc())return!1;if(Kc(Yc.fetch))return!0;let e=!1;const t=Yc.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=Kc(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){ic&&lc.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&pc(Jl,"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:Qc(t),method:Jc(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Qc(t),method:Jc(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:n},startTimestamp:Date.now()};return Mc("fetch",{...i}),e.apply(Jl,t).then(e=>(Mc("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Mc("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function Jc(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Qc(e){return"string"==typeof e?e:e?Jc(e,"url")?e.url:e.toString?e.toString():"":""}let eu=null;function tu(){eu=Jl.onerror,Jl.onerror=function(e,t,r,n,i){return Mc("error",{column:n,error:i,line:r,msg:e,url:t}),!(!eu||eu.__SENTRY_LOADER__)&&eu.apply(this,arguments)},Jl.onerror.__SENTRY_INSTRUMENTED__=!0}let ru=null;function nu(){ru=Jl.onunhandledrejection,Jl.onunhandledrejection=function(e){return Mc("unhandledrejection",e),!(ru&&!ru.__SENTRY_LOADER__)||ru.apply(this,arguments)},Jl.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const iu=Ql();const ou=Jl;let au;function su(e){const t="history";Oc(t,e),Pc(t,lu)}function lu(){if(!function(){const e=iu.chrome,t=e&&e.app&&e.app.runtime,r="history"in iu&&!!iu.history.pushState&&!!iu.history.replaceState;return!t&&r}())return;const e=ou.onpopstate;function t(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const e=au,t=String(r);au=t,Mc("history",{from:e,to:t})}return e.apply(this,t)}}ou.onpopstate=function(...t){const r=ou.location.href,n=au;if(au=r,Mc("history",{from:n,to:r}),e)try{return e.apply(this,t)}catch{}},pc(ou.history,"pushState",t),pc(ou.history,"replaceState",t)}const cu=Jl,uu="__sentry_xhr_v3__";function du(){if(!cu.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;pc(e,"open",function(e){return function(...t){const r=Date.now(),n=Ll(t[0])?t[0].toUpperCase():void 0,i=function(e){if(Ll(e))return e;try{return e.toString()}catch{}}(t[1]);if(!n||!i)return e.apply(this,t);this[uu]={method:n,url:i,request_headers:{}},"POST"===n&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[uu];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}Mc("xhr",{args:[n,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?pc(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),pc(this,"setRequestHeader",function(e){return function(...t){const[r,n]=t,i=this[uu];return i&&Ll(r)&&Ll(n)&&(i.request_headers[r.toLowerCase()]=n),e.apply(this,t)}}),e.apply(this,t)}}),pc(e,"send",function(e){return function(...t){const r=this[uu];if(!r)return e.apply(this,t);void 0!==t[0]&&(r.body=t[0]);return Mc("xhr",{args:[r.method,r.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}function hu(e,t=100,r=1/0){try{return pu("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function fu(e,t=3,r=102400){const n=hu(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(n)>r?fu(e,t-1,r):n}function pu(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(Vl(t))return"[VueViewModel]";if(function(e){return Dl(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: ${Ec(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 pu("",c.toJSON(),l-1,n,i)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=yc(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]=pu(e,t,l-1,n,i),d++}return a(t),u}var gu;function mu(e){return new yu(t=>{t(e)})}function vu(e){return new yu((t,r)=>{r(e)})}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(gu||(gu={}));class yu{constructor(e){yu.prototype.__init.call(this),yu.prototype.__init2.call(this),yu.prototype.__init3.call(this),yu.prototype.__init4.call(this),this._state=gu.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new yu((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 yu((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(gu.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(gu.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===gu.PENDING){if(Bl(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===gu.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===gu.RESOLVED&&e[1](this._value),this._state===gu.REJECTED&&e[2](this._value),e[0]=!0)})}}}function bu(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 vu(new fc("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 yu((r,n)=>{let i=t.length;if(!i)return r(!0);const o=setTimeout(()=>{e&&e>0&&r(!1)},e);t.forEach(e=>{mu(e).then(()=>{--i||(clearTimeout(o),r(!0))},n)})})}}}function wu(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 xu=["fatal","error","warning","log","info","debug"];function Cu(e){return"warn"===e?"warning":xu.includes(e)?e:"log"}function _u(){return Date.now()/1e3}const Su=function(){const{performance:e}=Jl;if(!e||!e.now)return _u;const t=Date.now()-e.now(),r=null==e.timeOrigin?t:e.timeOrigin;return()=>(r+e.now())/1e3}();function ku(e,t=[]){return[e,t]}function Au(e,t){const[r,n]=e;return[r,[...n,t]]}function Iu(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function Eu(e,t){return(t||new TextEncoder).encode(e)}function Fu(e,t){const[r,n]=e;let i=JSON.stringify(r);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[Eu(i,t),e]:i.push("string"==typeof e?Eu(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(hu(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 Tu(e,t){const r="string"==typeof e.data?Eu(e.data,t):e.data;return[xc({type:"attachment",length:r.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),r]}(()=>{const{performance:e}=Jl;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 Ou={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 Pu(e){return Ou[e]}function Mu(e){if(!e||!e.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function Ru(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 Lu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Nu="production";function ju(){return ec("globalEventProcessors",()=>[])}function Du(e){ju().push(e)}function zu(e,t,r,n=0){return new yu((i,o)=>{const a=e[n];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},r);Lu&&a.id&&null===s&&lc.log(`Event processor "${a.id}" dropped event`),Bl(s)?s.then(t=>zu(e,t,r,n+1).then(i)).then(null,o):zu(e,s,r,n+1).then(i).then(null,o)}})}function Bu(e){const t=Su(),r={sid:Lc(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return xc({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&&Uu(r,e),r}function Uu(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||Su(),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:Lc()),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 Vu(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),Uu(e,r)}function Hu(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:o,status:a,tags:s,origin:l}=$u(e);return xc({data:n,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:r,origin:l})}function $u(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function Wu(e,t,r,n,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||Lc(),timestamp:t.timestamp||_u()},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:Nu),void 0===e.release&&void 0!==n&&(e.release=n),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=Hl(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=Hl(a.value,o));const s=e.request;s&&s.url&&(s.url=Hl(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=Jl._sentryDebugIds;if(!r)return;let n;const i=Gu.get(t);i?n=i:(n=new Map,Gu.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 ld;return r.update(t),r}(n,r.captureContext);r.mechanism&&zc(l,r.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(sd||(sd=new ld),sd).getScopeData();if(o){od(h,o.getScopeData())}if(u){od(h,u.getScopeData())}const f=[...r.attachments||[],...h.attachments];f.length&&(r.attachments=f),id(l,h);return zu([...d,...ju(),...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:hu(e.data,t,r)}}))},...e.user&&{user:hu(e.user,t,r)},...e.contexts&&{contexts:hu(e.contexts,t,r)},...e.extra&&{extra:hu(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=hu(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(e=>{const n=$u(e).data;return n&&(e.data=hu(n,t,r)),e})),n}(e,a,s):e))}const Gu=new WeakMap;function qu(e,t){return md().captureEvent(e,t)}function Yu(e,t){md().addBreadcrumb(e,t)}function Xu(){return md().getClient()}function Ku(){return md().getScope()}function Zu(e){const t=Xu(),r=vd(),n=Ku(),{release:i,environment:o=Nu}=t&&t.getOptions()||{},{userAgent:a}=Jl.navigator||{},s=Bu({release:i,environment:o,user:n.getUser()||r.getUser(),...a&&{userAgent:a},...e}),l=r.getSession();return l&&"ok"===l.status&&Uu(l,{status:"exited"}),Ju(),r.setSession(s),n.setSession(s),s}function Ju(){const e=vd(),t=Ku(),r=t.getSession()||e.getSession();r&&Vu(r),Qu(),e.setSession(),t.setSession()}function Qu(){const e=vd(),t=Ku(),r=Xu(),n=t.getSession()||e.getSession();n&&r&&r.captureSession&&r.captureSession(n)}function ed(e=!1){e?Ju():Qu()}function td(e){return e.transaction}function rd(e,t,r){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=r&&r.getUser()||{},a=xc({environment:n.environment||Nu,release:n.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function nd(e){const t=Xu();if(!t)return{};const r=rd($u(e).trace_id||"",t,Ku()),n=td(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=$u(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 id(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=xc(r);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=xc(n);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=xc(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=xc(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:Hu(t),...e.contexts};const r=td(t);if(r){e.sdkProcessingMetadata={dynamicSamplingContext:nd(t),...e.sdkProcessingMetadata};const n=$u(r).description;n&&(e.tags={transaction:n,...e.tags})}}(e,n),function(e,t){e.fingerprint=e.fingerprint?Uc(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 od(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;ad(e,"extra",r),ad(e,"tags",n),ad(e,"user",i),ad(e,"contexts",o),ad(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 ad(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 sd;class ld{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=cd()}static clone(e){return e?e.clone():new ld}clone(){const e=new ld;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&&Uu(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 ld){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(Dl(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=cd(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:100;if(r<=0)return this;const n={timestamp:_u(),...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=[]){id(e,this.getScopeData());return zu([...r,...ju(),...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:Lc();if(!this._client)return lc.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:Lc();if(!this._client)return lc.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:Lc();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(lc.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 cd(){return{traceId:Lc(),spanId:Lc().substring(16)}}const ud="7.116.0",dd=parseFloat(ud),hd=100;class fd{constructor(e,t,r,n=dd){let i,o;this._version=n,t?i=t:(i=new ld,i.setClient(e)),r?o=r:(o=new ld,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 Bl(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:Lc(),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:Lc(),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:Lc();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=hd}=n.getOptions&&n.getOptions()||{};if(o<=0)return;const a={timestamp:_u(),...e},s=i?sc(()=>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=gd(this);try{e(this)}finally{gd(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Lu&&lc.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const r=this._callExtensionMethod("startTransaction",e,t);return Lu&&!r&&(this.getClient()?lc.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):lc.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&&Vu(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:r}=this.getStackTop(),{release:n,environment:i=Nu}=r&&r.getOptions()||{},{userAgent:o}=Jl.navigator||{},a=Bu({release:n,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&Uu(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=pd().__SENTRY__;if(r&&r.extensions&&"function"==typeof r.extensions[e])return r.extensions[e].apply(this,t);Lu&&lc.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function pd(){return Jl.__SENTRY__=Jl.__SENTRY__||{extensions:{},hub:void 0},Jl}function gd(e){const t=pd(),r=yd(t);return bd(t,e),r}function md(){const e=pd();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=pd()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||yd(e).isOlderThan(dd))&&bd(e,new fd),yd(e)}(e)}function vd(){return md().getIsolationScope()}function yd(e){return ec("hub",()=>new fd,e)}function bd(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function wd(e,t,r,n){const i=Mu(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:uc(n)},...i&&{trace:xc({...i})}}}(e,i,n,t);return delete e.sdkProcessingMetadata,ku(a,[[{type:o},e]])}function xd(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 Cd=[];function _d(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?Uc(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 Sd(e,t){for(const r of t)r&&r.afterAllSetup&&r.afterAllSetup(e)}function kd(e,t,r){if(r[t.name])Lu&&lc.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,-1===Cd.indexOf(t.name)&&(t.setupOnce(Du,md),Cd.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)}Lu&&lc.log(`Integration installed: ${t.name}`)}}function Ad(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}function Id(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=uc(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 ku(i,[o])}const Ed="Not capturing exception because it's already been captured.";class Fd{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=hc(e.dsn):Lu&&lc.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)}?${xd(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(Bc(e))return void(Lu&&lc.log(Ed));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=Nl(e)?e:String(e),a=jl(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&&Bc(t.originalException))return void(Lu&&lc.log(Ed));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?Lu&&lc.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Uu(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))):mu(!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 Lu&&lc.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];kd(this,e,this._integrations),t||Sd(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=wd(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=Au(r,Tu(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=Mu(r);return ku({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:uc(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}`;Lu&&lc.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}captureAggregateMetrics(e){Lu&&lc.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=Id(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&&kd(e,t,r)}),r}(this,e),Sd(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)&&(Uu(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new yu(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=vd()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),Wu(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||rd(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(Lu){const t=e;"log"===t.logLevel?lc.log(t.message):lc.warn(t)}})}_processEvent(e,t,r){const n=this.getOptions(),{sampleRate:i}=n,o=Od(e),a=Td(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),vu(new fc(`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 fc("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 Td(t)&&n?n(t,r):Od(t)&&i?i(t,r):t}(n,r,t);return function(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Bl(e))return e.then(e=>{if(!Dl(e)&&null!==e)throw new fc(r);return e},e=>{throw new fc(`${t} rejected with ${e}`)});if(!Dl(e)&&null!==e)throw new fc(r);return e}(i,l)}).then(n=>{if(null===n)throw this.recordDroppedEvent("before_send",c,e),new fc(`${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 fc?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new fc(`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=>{Lu&&lc.error("Error while sending event:",e)});Lu&&lc.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 Td(e){return void 0===e.type}function Od(e){return"transaction"===e.type}function Pd(e,t){!0===t.debug&&(Lu?lc.enable():sc(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Ku().update(t.initialScope);const r=new e(t);(function(e){const t=md().getStackTop();t.client=e,t.scope.setClient(e)})(r),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(r)}function Md(e,t,r=bu(e.bufferSize||30)){let n={};function i(i){const o=[];if(Iu(i,(t,r)=>{const i=Pu(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=Rd(t,r);e.recordDroppedEvent("ratelimit_backoff",i,n)}else o.push(t)}),0===o.length)return mu();const a=ku(i[0],o),s=t=>{Iu(a,(r,n)=>{const i=Rd(r,n);e.recordDroppedEvent(t,Pu(n),i)})};return r.add(()=>t({body:Fu(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Lu&&lc.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=Ru(n,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof fc)return Lu&&lc.error("Skipped sending event because buffer is full."),s("queue_overflow"),mu();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>r.drain(e)}}function Rd(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function Ld(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:ud})),version:ud}),e._metadata=i}const Nd=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],jd=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Dd="InboundFilters",zd=(e={})=>({name:Dd,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?[]:Nd],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:jd],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)?(Lu&&lc.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${jc(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}`)),Lu&&0===t.length&&lc.error(`Could not extract message for event ${jc(e)}`),t}(e).some(e=>Gl(e,t))}(e,t.ignoreErrors)?(Lu&&lc.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${jc(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const r=e.transaction;return!!r&&Gl(r,t)}(e,t.ignoreTransactions)?(Lu&&lc.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${jc(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const r=Bd(e);return!!r&&Gl(r,t)}(e,t.denyUrls)?(Lu&&lc.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${jc(e)}.\nUrl: ${Bd(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const r=Bd(e);return!r||Gl(r,t)}(e,t.allowUrls)&&(Lu&&lc.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${jc(e)}.\nUrl: ${Bd(e)}`),!0)}(t,o)?null:t}});function Bd(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 Lu&&lc.error(`Cannot extract url for event ${jc(e)}`),null}}let Ud;Ad(Dd,zd);const Vd="FunctionToString",Hd=new WeakMap,$d=()=>({name:Vd,setupOnce(){Ud=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=vc(this),r=Hd.has(Xu())&&void 0!==t?t:this;return Ud.apply(r,e)}}catch{}},setup(e){Hd.set(e,!0)}});Ad(Vd,$d);const Wd=Jl;let Gd=0;function qd(){return Gd>0}function Yd(e,t={},r){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(vc(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=>Yd(e,t));return e.apply(this,i)}catch(e){throw Gd++,setTimeout(()=>{Gd--}),function(...e){const t=md();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&&(Dc(e,void 0),zc(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),function(e){md().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}mc(n,e),gc(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}const Xd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Kd(e,t){const r=Jd(e,t),n={type:t&&t.name,value:eh(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Zd(e,t){return{exception:{values:[Kd(e,t)]}}}function Jd(e,t){const r=t.stacktrace||t.stack||"",n=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Qd.test(e.message))return 1}return 0}(t);try{return e(r,n)}catch{}return[]}const Qd=/Minified React error #\d+;/i;function eh(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function th(e,t,r,n,i){let o;if(Ml(t)&&t.error)return Zd(e,t.error);if(Rl(t)||function(e){return Pl(e,"DOMException")}(t)){const i=t;if("stack"in t)o=Zd(e,t);else{const t=i.name||(Rl(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=rh(e,a,r,n),Dc(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return Ol(t)?Zd(e,t):Dl(t)||zl(t)?(o=function(e,t,r,n){const i=Xu(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:zl(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:nh(t,{isUnhandledRejection:n})}]},extra:{__serialized__:fu(t,o)}};if(r){const t=Jd(e,r);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,r,i),zc(o,{synthetic:!0}),o):(o=rh(e,t,r,n),Dc(o,`${t}`),zc(o,{synthetic:!0}),o)}function rh(e,t,r,n){const i={};if(n&&r){const n=Jd(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]})}if(Nl(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 nh(e,{isUnhandledRejection:t}){const r=function(e,t=40){const r=Object.keys(yc(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return Hl(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:Hl(n,t)}return""}(e),n=t?"promise rejection":"exception";return Ml(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:zl(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 ih extends Fd{constructor(e){Ld(e,"browser",["browser"],Wd.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&Wd.document&&Wd.document.addEventListener("visibilitychange",()=>{"hidden"===Wd.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,r,n){const i=th(e,t,r&&r.syntheticException||void 0,n);return zc(i),i.level="error",r&&r.event_id&&(i.event_id=r.event_id),mu(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return function(e,t,r="info",n,i){const o=rh(e,t,n&&n.syntheticException||void 0,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),mu(o)}(this._options.stackParser,e,t,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(Xd&&lc.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:uc(n)}},o=function(e){return[{type:"user_report"},e]}(e);return ku(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(Xd&&lc.log("No outcomes to send"));if(!this._dsn)return void(Xd&&lc.log("No dsn provided, will not send outcomes"));Xd&&lc.log("Sending outcomes:",e);const t=function(e,t){return ku(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:_u(),discarded_events:e}]])}(e,this._options.tunnel&&uc(this._dsn));this._sendEnvelope(t)}}let oh;function ah(e,t=function(){if(oh)return oh;if(Kc(Wd.fetch))return oh=Wd.fetch.bind(Wd);const e=Wd.document;let t=Wd.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){Xd&&lc.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return oh=t.bind(Wd)}()){let r=0,n=0;return Md(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 oh=void 0,r-=o,n--,vu(e)}})}function sh(e){return Md(e,function(t){return new yu((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 lh="?";function ch(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 uh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,dh=/\((\S*)(?::(\d+))(?::(\d+))\)/,hh=[30,e=>{const t=uh.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=dh.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,r]=bh(t[1]||lh,t[2]);return ch(r,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],fh=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ph=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gh=[50,e=>{const t=fh.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=ph.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]||lh;return[r,e]=bh(r,e),ch(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],mh=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,vh=[40,e=>{const t=mh.exec(e);return t?ch(t[2],t[1]||lh,+t[3],t[4]?+t[4]:void 0):void 0}],yh=kc(...[hh,gh,vh]),bh=(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]:lh,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},wh=1024,xh="Breadcrumbs",Ch=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:xh,setupOnce(){},setup(e){t.console&&function(e){const t="console";Oc(t,e),Pc(t,Rc)}(function(e){return function(t){if(Xu()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:Cu(t.level),message:$l(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${$l(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}Yu(r,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){Oc("dom",e),Pc("dom",Gc)}(function(e,t){return function(r){if(Xu()!==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>wh&&(Xd&&lc.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=wh),"string"==typeof o&&(o=[o]);try{const e=r.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;n=rc(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!tc.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}),Yu(s,{event:r.event,name:r.name,global:r.global})}}(e,t.dom)),t.xhr&&function(e){Oc("xhr",e),Pc("xhr",du)}(function(e){return function(t){if(Xu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[uu];if(!r||!n||!i)return;const{method:o,url:a,status_code:s,body:l}=i;Yu({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";Oc(t,e),Pc(t,Zc)}(function(e){return function(t){if(Xu()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){Yu({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:r,endTimestamp:n})}else{const e=t.response;Yu({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:r,endTimestamp:n})}}}(e)),t.history&&su(function(e){return function(t){if(Xu()!==e)return;let r=t.from,n=t.to;const i=wu(Wd.location.href);let o=r?wu(r):void 0;const a=wu(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),Yu({category:"navigation",data:{from:r,to:n}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){Xu()===e&&Yu({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:jc(t)},{event:t})}}(e))}}};Ad(xh,Ch);const _h="Dedupe",Sh=()=>{let e;return{name:_h,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||!Ah(e,t)||!kh(e,t))}(e,t)&&!function(e,t){const r=Ih(t),n=Ih(e);return!!(r&&n&&r.type===n.type&&r.value===n.value&&Ah(e,t)&&kh(e,t))}(e,t))}(t,e))return Xd&&lc.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function kh(e,t){let r=Eh(e),n=Eh(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 Ah(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 Ih(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Eh(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}Ad(_h,Sh);const Fh="GlobalHandlers",Th=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Fh,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";Oc(t,e),Pc(t,tu)}(t=>{const{stackParser:r,attachStacktrace:n}=Mh();if(Xu()!==e||qd())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&Ll(i)?function(e,t,r,n){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Ml(e)?e.message:e,a="Error";const s=o.match(i);return s&&(a=s[1],o=s[2]),Oh({exception:{values:[{type:a,value:o}]}},t,r,n)}(i,o,a,s):Oh(th(r,l||i,void 0,n,!1),o,a,s);c.level="error",qu(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Ph("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";Oc(t,e),Pc(t,nu)}(t=>{const{stackParser:r,attachStacktrace:n}=Mh();if(Xu()!==e||qd())return;const i=function(e){if(jl(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=jl(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):th(r,i,void 0,n,!0);o.level="error",qu(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Ph("onunhandledrejection"))}}};function Oh(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=Ll(t)&&t.length>0?t:function(){try{return tc.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Ph(e){Xd&&lc.log(`Global Handler attached: ${e}`)}function Mh(){const e=Xu();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}Ad(Fh,Th);const Rh="HttpContext",Lh=()=>({name:Rh,setupOnce(){},preprocessEvent(e){if(!Wd.navigator&&!Wd.location&&!Wd.document)return;const t=e.request&&e.request.url||Wd.location&&Wd.location.href,{referrer:r}=Wd.document||{},{userAgent:n}=Wd.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}});Ad(Rh,Lh);const Nh="LinkedErrors",jh=(e={})=>{const t=e.limit||5,r=e.key||"cause";return{name:Nh,setupOnce(){},preprocessEvent(e,n,i){const o=i.getOptions();ql(Kd,o.stackParser,o.maxValueLength,r,t,e,n)}}};Ad(Nh,jh);const Dh=["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"],zh="TryCatch",Bh=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:zh,setupOnce(){t.setTimeout&&pc(Wd,"setTimeout",Uh),t.setInterval&&pc(Wd,"setInterval",Uh),t.requestAnimationFrame&&pc(Wd,"requestAnimationFrame",Vh),t.XMLHttpRequest&&"XMLHttpRequest"in Wd&&pc(XMLHttpRequest.prototype,"send",Hh);const e=t.eventTarget;e&&(Array.isArray(e)?e:Dh).forEach($h)}}};function Uh(e){return function(...t){const r=t[0];return t[0]=Yd(r,{mechanism:{data:{function:Ec(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Vh(e){return function(t){return e.apply(this,[Yd(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Ec(e)},handled:!1,type:"instrument"}})])}}function Hh(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in r&&"function"==typeof r[e]&&pc(r,e,function(t){const r={mechanism:{data:{function:e,handler:Ec(t)},handled:!1,type:"instrument"}},n=vc(t);return n&&(r.mechanism.data.handler=Ec(n)),Yd(t,r)})}),e.apply(this,t)}}function $h(e){const t=Wd,r=t[e]&&t[e].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(pc(r,"addEventListener",function(t){return function(r,n,i){try{"function"==typeof n.handleEvent&&(n.handleEvent=Yd(n.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Ec(n),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[r,Yd(n,{mechanism:{data:{function:"addEventListener",handler:Ec(n),target:e},handled:!1,type:"instrument"}}),i])}}),pc(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)}}))}Ad(zh,Bh);const Wh=[zd(),$d(),Bh(),Ch(),Th(),jh(),Sh(),Lh()];function Gh(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...Wh]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),Wd.SENTRY_RELEASE&&Wd.SENTRY_RELEASE.id&&(e.release=Wd.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Ac(e.stackParser||yh),integrations:_d(e),transport:e.transport||(Xc()?ah:sh)};Pd(ih,t),e.autoSessionTracking&&function(){if(typeof Wd.document>"u")return void(Xd&&lc.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));Zu({ignoreDuration:!0}),ed(),su(({from:e,to:t})=>{void 0!==e&&e!==t&&(Zu({ignoreDuration:!0}),ed())})}()}var qh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xh(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 Kh=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(Kh||{}),Zh=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(Zh||{});function Jh(e,t){return{...t,message:e}}const Qh=[{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}],ef={emoticons:Jh("Emoticons"),doodles:Jh("Doodles"),landmarks:Jh("Landmarks"),bubbles:Jh("Bubbles"),transportation:Jh("Transportation"),beach:Jh("Beach")},tf={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},rf=[1,8,15,20,25];var nf=(e=>(e.DARK="dark",e.LIGHT="light",e))(nf||{});const of=[{name:nf.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:nf.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 af=(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))(af||{});function sf(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=sf(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function lf(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=sf(e))&&(n&&(n+=" "),n+=t);return n}const cf=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:lf("svg-icon",s,uf(o)),style:{color:l,...c},ref:n,height:f||"1em",width:h||"1em",children:[a&&e("title",{children:a}),u]})});function uf(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 df(t,r="",n){return i.memo(i.forwardRef((i,o)=>e(cf,{"data-testid":`${r}Icon`,ref:o,viewBox:n,...i,size:i.size||"md",children:t})))}function hf(e,t=""){return df(ff(e),t)}function ff(e){return(null==e?void 0:e.map)&&e.map((e,t)=>i.createElement(e.tag,{key:t,...e.attr},ff(e.child)))}const pf=df(e("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),gf=df(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"),mf=df(e("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),vf=df(e("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),yf=df(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"),bf=df(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"),wf=df(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"),xf=df(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"),Cf=df(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"),_f=df(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"),Sf=df(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"),kf=df([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"),Af=df(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"),If=df(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"),Ef=df(e("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),Ff={[af.FILTER]:{name:Jh("Applied Filters"),icon:pf},[af.RESIZE]:{name:Jh("Resized Image"),icon:gf},[af.CROP]:{name:Jh("Cropped Image"),icon:mf},[af.DRAW]:{name:Jh("Added Drawing"),icon:If},[af.TEXT]:{name:Jh("Added Text"),icon:vf},[af.SHAPES]:{name:Jh("Added Shape"),icon:yf},[af.STICKERS]:{name:Jh("Added Sticker"),icon:bf},[af.FRAME]:{name:Jh("Added Frame"),icon:wf},[af.MERGE]:{name:Jh("Merged Objects"),icon:xf},[af.CORNERS]:{name:Jh("Rounded Corner"),icon:Cf},bgImage:{name:Jh("Replaced Background Image"),icon:_f},overlayImage:{name:Jh("Added Image"),icon:_f},initial:{name:Jh("Initial"),icon:Ef},loadedState:{name:Jh("Loaded State"),icon:Sf},objectStyle:{name:Jh("Changed Style"),icon:kf},deletedObject:{name:Jh("Deleted object"),icon:Af}},Tf=Object.values(af).map(e=>({name:e,icon:Ff[e].icon,action:e===af.MERGE?e=>{e.tools.merge.apply()}:e})),Of={filter:Jh("filter"),resize:Jh("resize"),crop:Jh("crop"),draw:Jh("draw"),text:Jh("text"),shapes:Jh("shapes"),stickers:Jh("stickers"),frame:Jh("frame"),corners:Jh("corners"),merge:Jh("merge")},Pf=df(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"),Mf="3.0.5",Rf={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:Kh.INLINE,forceOverlayModeOnMobile:!0,activeTheme:nf.LIGHT,themes:of,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:Sf,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:Pf,label:Jh("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:Zh.BOTTOM,items:[...Tf]},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:{...tf},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:rf,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:Qh},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}}]}}},Lf=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 Nf={exports:{}},jf={},Df={exports:{}},zf={},Bf=i;
10
10
  /**
11
11
  * @license React
12
12
  * use-sync-external-store-shim.production.min.js