const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/cytoscape-fcose-Di-e6ZnW.js","assets/_commonjsHelpers-Cpj98o6Y.js","assets/jszip.min-KAUKf24L.js"])))=>i.map(i=>d[i]); var VT=Object.defineProperty;var qT=(e,t,n)=>t in e?VT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ot=(e,t,n)=>qT(e,typeof t!="symbol"?t+"":t,n);import{c as Cl,g as zv}from"./_commonjsHelpers-Cpj98o6Y.js";const XT="modulepreload",YT=function(e){return"/build/"+e},ag={},af=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){let a=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=a(n.map(h=>{if(h=YT(h),h in ag)return;ag[h]=!0;const d=h.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":XT,d||(y.as="script"),y.crossOrigin="",y.href=h,u&&y.setAttribute("nonce",u),document.head.appendChild(y),d)return new Promise((x,S)=>{y.addEventListener("load",x),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return r.then(a=>{for(const l of a||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};var So={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var KT=So.exports,lg;function GT(){return lg||(lg=1,function(e,t){(function(){var n,i="4.17.23",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",h=500,d="__lodash_placeholder__",m=1,y=2,x=4,S=1,C=2,T=1,A=2,M=4,B=8,D=16,R=32,N=64,I=128,j=256,q=512,F=30,H="...",U=800,V=16,st=1,tt=2,it=3,K=1/0,ct=9007199254740991,dt=17976931348623157e292,_t=NaN,wt=4294967295,vt=wt-1,Ft=wt>>>1,xt=[["ary",I],["bind",T],["bindKey",A],["curry",B],["curryRight",D],["flip",q],["partial",R],["partialRight",N],["rearg",j]],Ct="[object Arguments]",Nt="[object Array]",be="[object AsyncFunction]",Ot="[object Boolean]",St="[object Date]",In="[object DOMException]",De="[object Error]",te="[object Function]",Le="[object GeneratorFunction]",re="[object Map]",oe="[object Number]",we="[object Null]",ye="[object Object]",Ve="[object Promise]",wn="[object Proxy]",he="[object RegExp]",Xt="[object Set]",xe="[object String]",Ae="[object Symbol]",xn="[object Undefined]",Yt="[object WeakMap]",Se="[object WeakSet]",fe="[object ArrayBuffer]",Z="[object DataView]",et="[object Float32Array]",ht="[object Float64Array]",lt="[object Int8Array]",Bt="[object Int16Array]",jt="[object Int32Array]",de="[object Uint8Array]",Ie="[object Uint8ClampedArray]",qe="[object Uint16Array]",Ne="[object Uint32Array]",Zi=/\b__p \+= '';/g,Qi=/\b(__p \+=) '' \+/g,tr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,er=/&(?:amp|lt|gt|quot|#39);/g,Fr=/[&<>"']/g,Br=RegExp(er.source),Nn=RegExp(Fr.source),$t=/<%-([\s\S]+?)%>/g,_e=/<%([\s\S]+?)%>/g,Sn=/<%=([\s\S]+?)%>/g,Wc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jc=/^\w*$/,$c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ss=/[\\^$.*+?()[\]{}|]/g,Ei=RegExp(Ss.source),Ts=/^\s+/,la=/\s/,ca=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ua=/\{\n\/\* \[wrapped with (.+)\] \*/,ha=/,? & /,Uc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Vc=/[()=,{}\[\]\/\s]/,qc=/\\(\\)?/g,Hr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fa=/\w*$/,da=/^[-+]0x[0-9a-f]+$/i,Xc=/^0b[01]+$/i,Yc=/^\[object .+?Constructor\]$/,Kc=/^0o[0-7]+$/i,Gc=/^(?:0|[1-9]\d*)$/,Jc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zr=/($^)/,Zc=/['\n\r\u2028\u2029\\]/g,Wr="\\ud800-\\udfff",pa="\\u0300-\\u036f",oi="\\ufe20-\\ufe2f",Qc="\\u20d0-\\u20ff",ga=pa+oi+Qc,ma="\\u2700-\\u27bf",va="a-z\\xdf-\\xf6\\xf8-\\xff",tu="\\xac\\xb1\\xd7\\xf7",eu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",nu="\\u2000-\\u206f",iu=" \\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",ba="A-Z\\xc0-\\xd6\\xd8-\\xde",jr="\\ufe0e\\ufe0f",ya=tu+eu+nu+iu,Cs="['’]",Os="["+Wr+"]",_a="["+ya+"]",$r="["+ga+"]",wa="\\d+",ru="["+ma+"]",xa="["+va+"]",Sa="[^"+Wr+ya+wa+ma+va+ba+"]",ks="\\ud83c[\\udffb-\\udfff]",su="(?:"+$r+"|"+ks+")",Ur="[^"+Wr+"]",As="(?:\\ud83c[\\udde6-\\uddff]){2}",Es="[\\ud800-\\udbff][\\udc00-\\udfff]",Pi="["+ba+"]",Ta="\\u200d",Ca="(?:"+xa+"|"+Sa+")",ou="(?:"+Pi+"|"+Sa+")",Oa="(?:"+Cs+"(?:d|ll|m|re|s|t|ve))?",ka="(?:"+Cs+"(?:D|LL|M|RE|S|T|VE))?",Aa=su+"?",Ea="["+jr+"]?",Fn="(?:"+Ta+"(?:"+[Ur,As,Es].join("|")+")"+Ea+Aa+")*",au="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pa="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ma=Ea+Aa+Fn,ai="(?:"+[ru,As,Es].join("|")+")"+Ma,lu="(?:"+[Ur+$r+"?",$r,As,Es,Os].join("|")+")",Ps=RegExp(Cs,"g"),cu=RegExp($r,"g"),Ms=RegExp(ks+"(?="+ks+")|"+lu+Ma,"g"),uu=RegExp([Pi+"?"+xa+"+"+Oa+"(?="+[_a,Pi,"$"].join("|")+")",ou+"+"+ka+"(?="+[_a,Pi+Ca,"$"].join("|")+")",Pi+"?"+Ca+"+"+Oa,Pi+"+"+ka,Pa,au,wa,ai].join("|"),"g"),hu=RegExp("["+Ta+Wr+ga+jr+"]"),fu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rs=["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"],du=-1,qt={};qt[et]=qt[ht]=qt[lt]=qt[Bt]=qt[jt]=qt[de]=qt[Ie]=qt[qe]=qt[Ne]=!0,qt[Ct]=qt[Nt]=qt[fe]=qt[Ot]=qt[Z]=qt[St]=qt[De]=qt[te]=qt[re]=qt[oe]=qt[ye]=qt[he]=qt[Xt]=qt[xe]=qt[Yt]=!1;var Ut={};Ut[Ct]=Ut[Nt]=Ut[fe]=Ut[Z]=Ut[Ot]=Ut[St]=Ut[et]=Ut[ht]=Ut[lt]=Ut[Bt]=Ut[jt]=Ut[re]=Ut[oe]=Ut[ye]=Ut[he]=Ut[Xt]=Ut[xe]=Ut[Ae]=Ut[de]=Ut[Ie]=Ut[qe]=Ut[Ne]=!0,Ut[De]=Ut[te]=Ut[Yt]=!1;var pu={À:"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"},Vr={"&":"&","<":"<",">":">",'"':""","'":"'"},gu={"&":"&","<":"<",">":">",""":'"',"'":"'"},nr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},mu=parseFloat,vu=parseInt,Mi=typeof Cl=="object"&&Cl&&Cl.Object===Object&&Cl,bu=typeof self=="object"&&self&&self.Object===Object&&self,Te=Mi||bu||Function("return this")(),Ds=t&&!t.nodeType&&t,li=Ds&&!0&&e&&!e.nodeType&&e,Ra=li&&li.exports===Ds,Ls=Ra&&Mi.process,Qe=function(){try{var b=li&&li.require&&li.require("util").types;return b||Ls&&Ls.binding&&Ls.binding("util")}catch{}}(),Da=Qe&&Qe.isArrayBuffer,La=Qe&&Qe.isDate,qr=Qe&&Qe.isMap,Vn=Qe&&Qe.isRegExp,Ia=Qe&&Qe.isSet,Na=Qe&&Qe.isTypedArray;function Xe(b,w,O){switch(O.length){case 0:return b.call(w);case 1:return b.call(w,O[0]);case 2:return b.call(w,O[0],O[1]);case 3:return b.call(w,O[0],O[1],O[2])}return b.apply(w,O)}function yu(b,w,O,W){for(var Y=-1,rt=b==null?0:b.length;++Y-1}function Ns(b,w,O){for(var W=-1,Y=b==null?0:b.length;++W-1;);return O}function $a(b,w){for(var O=b.length;O--&&Yn(w,b[O],0)>-1;);return O}function Ri(b,w){for(var O=b.length,W=0;O--;)b[O]===w&&++W;return W}var Ou=zs(pu),ku=zs(Vr);function Au(b){return"\\"+nr[b]}function Ua(b,w){return b==null?n:b[w]}function Di(b){return hu.test(b)}function Eu(b){return fu.test(b)}function Pu(b){for(var w,O=[];!(w=b.next()).done;)O.push(w.value);return O}function Vs(b){var w=-1,O=Array(b.size);return b.forEach(function(W,Y){O[++w]=[Y,W]}),O}function Va(b,w){return function(O){return b(w(O))}}function Kn(b,w){for(var O=-1,W=b.length,Y=0,rt=[];++O-1}function m0(o,c){var f=this.__data__,_=il(f,o);return _<0?(++this.size,f.push([o,c])):f[_][1]=c,this}ui.prototype.clear=f0,ui.prototype.delete=d0,ui.prototype.get=p0,ui.prototype.has=g0,ui.prototype.set=m0;function hi(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c=c?o:c)),o}function On(o,c,f,_,k,P){var L,z=c&m,$=c&y,G=c&x;if(f&&(L=k?f(o,_,k,P):f(o)),L!==n)return L;if(!se(o))return o;var J=kt(o);if(J){if(L=__(o),!z)return en(o,L)}else{var Q=He(o),at=Q==te||Q==Le;if(Hi(o))return Zd(o,z);if(Q==ye||Q==Ct||at&&!k){if(L=$||at?{}:vp(o),!z)return $?c_(o,R0(L,o)):l_(o,Ad(L,o))}else{if(!Ut[Q])return k?o:{};L=w_(o,Q,z)}}P||(P=new Bn);var ft=P.get(o);if(ft)return ft;P.set(o,L),qp(o)?o.forEach(function(mt){L.add(On(mt,c,f,mt,o,P))}):Up(o)&&o.forEach(function(mt,Mt){L.set(Mt,On(mt,c,f,Mt,o,P))});var gt=G?$?ah:oh:$?rn:Ee,Et=J?n:gt(o);return Ye(Et||o,function(mt,Mt){Et&&(Mt=mt,mt=o[Mt]),no(L,Mt,On(mt,c,f,Mt,o,P))}),L}function D0(o){var c=Ee(o);return function(f){return Ed(f,o,c)}}function Ed(o,c,f){var _=f.length;if(o==null)return!_;for(o=ut(o);_--;){var k=f[_],P=c[k],L=o[k];if(L===n&&!(k in o)||!P(L))return!1}return!0}function Pd(o,c,f){if(typeof o!="function")throw new tn(a);return uo(function(){o.apply(n,f)},c)}function ro(o,c,f,_){var k=-1,P=Xr,L=!0,z=o.length,$=[],G=c.length;if(!z)return $;f&&(c=Kt(c,Ke(f))),_?(P=Ns,L=!1):c.length>=r&&(P=ir,L=!1,c=new ur(c));t:for(;++kk?0:k+f),_=_===n||_>k?k:At(_),_<0&&(_+=k),_=f>_?0:Yp(_);f<_;)o[f++]=c;return o}function Rd(o,c){var f=[];return Ii(o,function(_,k,P){c(_,k,P)&&f.push(_)}),f}function Fe(o,c,f,_,k){var P=-1,L=o.length;for(f||(f=S_),k||(k=[]);++P0&&f(z)?c>1?Fe(z,c-1,f,_,k):Xn(k,z):_||(k[k.length]=z)}return k}var ju=rp(),Dd=rp(!0);function Jn(o,c){return o&&ju(o,c,Ee)}function $u(o,c){return o&&Dd(o,c,Ee)}function sl(o,c){return qn(c,function(f){return mi(o[f])})}function fr(o,c){c=Fi(c,o);for(var f=0,_=c.length;o!=null&&f<_;)o=o[Qn(c[f++])];return f&&f==_?o:n}function Ld(o,c,f){var _=c(o);return kt(o)?_:Xn(_,f(o))}function Ge(o){return o==null?o===n?xn:we:lr&&lr in ut(o)?v_(o):P_(o)}function Uu(o,c){return o>c}function N0(o,c){return o!=null&&Ht.call(o,c)}function F0(o,c){return o!=null&&c in ut(o)}function B0(o,c,f){return o>=Be(c,f)&&o=120&&J.length>=120)?new ur(L&&J):n}J=o[0];var Q=-1,at=z[0];t:for(;++Q-1;)z!==o&&Ga.call(z,$,1),Ga.call(o,$,1);return o}function Ud(o,c){for(var f=o?c.length:0,_=f-1;f--;){var k=c[f];if(f==_||k!==P){var P=k;gi(k)?Ga.call(o,k,1):Qu(o,k)}}return o}function Gu(o,c){return o+Qa(Td()*(c-o+1))}function J0(o,c,f,_){for(var k=-1,P=Ce(Za((c-o)/(f||1)),0),L=O(P);P--;)L[_?P:++k]=o,o+=f;return L}function Ju(o,c){var f="";if(!o||c<1||c>ct)return f;do c%2&&(f+=o),c=Qa(c/2),c&&(o+=o);while(c);return f}function Pt(o,c){return ph(_p(o,c,sn),o+"")}function Z0(o){return kd(os(o))}function Q0(o,c){var f=os(o);return ml(f,hr(c,0,f.length))}function ao(o,c,f,_){if(!se(o))return o;c=Fi(c,o);for(var k=-1,P=c.length,L=P-1,z=o;z!=null&&++kk?0:k+c),f=f>k?k:f,f<0&&(f+=k),k=c>f?0:f-c>>>0,c>>>=0;for(var P=O(k);++_>>1,L=o[P];L!==null&&!mn(L)&&(f?L<=c:L=r){var G=c?null:d_(o);if(G)return Kr(G);L=!1,k=ir,$=new ur}else $=c?[]:z;t:for(;++_=_?o:kn(o,c,f)}var Jd=Uy||function(o){return Te.clearTimeout(o)};function Zd(o,c){if(c)return o.slice();var f=o.length,_=Ka?Ka(f):new o.constructor(f);return o.copy(_),_}function ih(o){var c=new o.constructor(o.byteLength);return new Jr(c).set(new Jr(o)),c}function r_(o,c){var f=c?ih(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function s_(o){var c=new o.constructor(o.source,fa.exec(o));return c.lastIndex=o.lastIndex,c}function o_(o){return eo?ut(eo.call(o)):{}}function Qd(o,c){var f=c?ih(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function tp(o,c){if(o!==c){var f=o!==n,_=o===null,k=o===o,P=mn(o),L=c!==n,z=c===null,$=c===c,G=mn(c);if(!z&&!G&&!P&&o>c||P&&L&&$&&!z&&!G||_&&L&&$||!f&&$||!k)return 1;if(!_&&!P&&!G&&o=z)return $;var G=f[_];return $*(G=="desc"?-1:1)}}return o.index-c.index}function ep(o,c,f,_){for(var k=-1,P=o.length,L=f.length,z=-1,$=c.length,G=Ce(P-L,0),J=O($+G),Q=!_;++z<$;)J[z]=c[z];for(;++k1?f[k-1]:n,L=k>2?f[2]:n;for(P=o.length>3&&typeof P=="function"?(k--,P):n,L&&Je(f[0],f[1],L)&&(P=k<3?n:P,k=1),c=ut(c);++_-1?k[P?c[L]:L]:n}}function ap(o){return pi(function(c){var f=c.length,_=f,k=Cn.prototype.thru;for(o&&c.reverse();_--;){var P=c[_];if(typeof P!="function")throw new tn(a);if(k&&!L&&pl(P)=="wrapper")var L=new Cn([],!0)}for(_=L?_:f;++_1&&It.reverse(),J&&$z))return!1;var G=P.get(o),J=P.get(c);if(G&&J)return G==c&&J==o;var Q=-1,at=!0,ft=f&C?new ur:n;for(P.set(o,c),P.set(c,o);++Q1?"& ":"")+c[_],c=c.join(f>2?", ":" "),o.replace(ca,`{ /* [wrapped with `+c+`] */ `)}function S_(o){return kt(o)||gr(o)||!!(xd&&o&&o[xd])}function gi(o,c){var f=typeof o;return c=c??ct,!!c&&(f=="number"||f!="symbol"&&Gc.test(o))&&o>-1&&o%1==0&&o0){if(++c>=U)return arguments[0]}else c=0;return o.apply(n,arguments)}}function ml(o,c){var f=-1,_=o.length,k=_-1;for(c=c===n?_:c;++f1?o[c-1]:n;return f=typeof f=="function"?(o.pop(),f):n,Rp(o,f)});function Dp(o){var c=E(o);return c.__chain__=!0,c}function Lw(o,c){return c(o),o}function vl(o,c){return c(o)}var Iw=pi(function(o){var c=o.length,f=c?o[0]:0,_=this.__wrapped__,k=function(P){return Wu(P,o)};return c>1||this.__actions__.length||!(_ instanceof Dt)||!gi(f)?this.thru(k):(_=_.slice(f,+f+(c?1:0)),_.__actions__.push({func:vl,args:[k],thisArg:n}),new Cn(_,this.__chain__).thru(function(P){return c&&!P.length&&P.push(n),P}))});function Nw(){return Dp(this)}function Fw(){return new Cn(this.value(),this.__chain__)}function Bw(){this.__values__===n&&(this.__values__=Xp(this.value()));var o=this.__index__>=this.__values__.length,c=o?n:this.__values__[this.__index__++];return{done:o,value:c}}function Hw(){return this}function zw(o){for(var c,f=this;f instanceof nl;){var _=Op(f);_.__index__=0,_.__values__=n,c?k.__wrapped__=_:c=_;var k=_;f=f.__wrapped__}return k.__wrapped__=o,c}function Ww(){var o=this.__wrapped__;if(o instanceof Dt){var c=o;return this.__actions__.length&&(c=new Dt(this)),c=c.reverse(),c.__actions__.push({func:vl,args:[gh],thisArg:n}),new Cn(c,this.__chain__)}return this.thru(gh)}function jw(){return Kd(this.__wrapped__,this.__actions__)}var $w=cl(function(o,c,f){Ht.call(o,f)?++o[f]:fi(o,f,1)});function Uw(o,c,f){var _=kt(o)?Is:L0;return f&&Je(o,c,f)&&(c=n),_(o,pt(c,3))}function Vw(o,c){var f=kt(o)?qn:Rd;return f(o,pt(c,3))}var qw=op(kp),Xw=op(Ap);function Yw(o,c){return Fe(bl(o,c),1)}function Kw(o,c){return Fe(bl(o,c),K)}function Gw(o,c,f){return f=f===n?1:At(f),Fe(bl(o,c),f)}function Lp(o,c){var f=kt(o)?Ye:Ii;return f(o,pt(c,3))}function Ip(o,c){var f=kt(o)?_u:Md;return f(o,pt(c,3))}var Jw=cl(function(o,c,f){Ht.call(o,f)?o[f].push(c):fi(o,f,[c])});function Zw(o,c,f,_){o=nn(o)?o:os(o),f=f&&!_?At(f):0;var k=o.length;return f<0&&(f=Ce(k+f,0)),Sl(o)?f<=k&&o.indexOf(c,f)>-1:!!k&&Yn(o,c,f)>-1}var Qw=Pt(function(o,c,f){var _=-1,k=typeof c=="function",P=nn(o)?O(o.length):[];return Ii(o,function(L){P[++_]=k?Xe(c,L,f):so(L,c,f)}),P}),tx=cl(function(o,c,f){fi(o,f,c)});function bl(o,c){var f=kt(o)?Kt:Bd;return f(o,pt(c,3))}function ex(o,c,f,_){return o==null?[]:(kt(c)||(c=c==null?[]:[c]),f=_?n:f,kt(f)||(f=f==null?[]:[f]),jd(o,c,f))}var nx=cl(function(o,c,f){o[f?0:1].push(c)},function(){return[[],[]]});function ix(o,c,f){var _=kt(o)?Fs:Ws,k=arguments.length<3;return _(o,pt(c,4),f,k,Ii)}function rx(o,c,f){var _=kt(o)?wu:Ws,k=arguments.length<3;return _(o,pt(c,4),f,k,Md)}function sx(o,c){var f=kt(o)?qn:Rd;return f(o,wl(pt(c,3)))}function ox(o){var c=kt(o)?kd:Z0;return c(o)}function ax(o,c,f){(f?Je(o,c,f):c===n)?c=1:c=At(c);var _=kt(o)?E0:Q0;return _(o,c)}function lx(o){var c=kt(o)?P0:e_;return c(o)}function cx(o){if(o==null)return 0;if(nn(o))return Sl(o)?Li(o):o.length;var c=He(o);return c==re||c==Xt?o.size:Xu(o).length}function ux(o,c,f){var _=kt(o)?Bs:n_;return f&&Je(o,c,f)&&(c=n),_(o,pt(c,3))}var hx=Pt(function(o,c){if(o==null)return[];var f=c.length;return f>1&&Je(o,c[0],c[1])?c=[]:f>2&&Je(c[0],c[1],c[2])&&(c=[c[0]]),jd(o,Fe(c,1),[])}),yl=Vy||function(){return Te.Date.now()};function fx(o,c){if(typeof c!="function")throw new tn(a);return o=At(o),function(){if(--o<1)return c.apply(this,arguments)}}function Np(o,c,f){return c=f?n:c,c=o&&c==null?o.length:c,di(o,I,n,n,n,n,c)}function Fp(o,c){var f;if(typeof c!="function")throw new tn(a);return o=At(o),function(){return--o>0&&(f=c.apply(this,arguments)),o<=1&&(c=n),f}}var vh=Pt(function(o,c,f){var _=T;if(f.length){var k=Kn(f,rs(vh));_|=R}return di(o,_,c,f,k)}),Bp=Pt(function(o,c,f){var _=T|A;if(f.length){var k=Kn(f,rs(Bp));_|=R}return di(c,_,o,f,k)});function Hp(o,c,f){c=f?n:c;var _=di(o,B,n,n,n,n,n,c);return _.placeholder=Hp.placeholder,_}function zp(o,c,f){c=f?n:c;var _=di(o,D,n,n,n,n,n,c);return _.placeholder=zp.placeholder,_}function Wp(o,c,f){var _,k,P,L,z,$,G=0,J=!1,Q=!1,at=!0;if(typeof o!="function")throw new tn(a);c=En(c)||0,se(f)&&(J=!!f.leading,Q="maxWait"in f,P=Q?Ce(En(f.maxWait)||0,c):P,at="trailing"in f?!!f.trailing:at);function ft(ge){var zn=_,bi=k;return _=k=n,G=ge,L=o.apply(bi,zn),L}function gt(ge){return G=ge,z=uo(Mt,c),J?ft(ge):L}function Et(ge){var zn=ge-$,bi=ge-G,og=c-zn;return Q?Be(og,P-bi):og}function mt(ge){var zn=ge-$,bi=ge-G;return $===n||zn>=c||zn<0||Q&&bi>=P}function Mt(){var ge=yl();if(mt(ge))return It(ge);z=uo(Mt,Et(ge))}function It(ge){return z=n,at&&_?ft(ge):(_=k=n,L)}function vn(){z!==n&&Jd(z),G=0,_=$=k=z=n}function Ze(){return z===n?L:It(yl())}function bn(){var ge=yl(),zn=mt(ge);if(_=arguments,k=this,$=ge,zn){if(z===n)return gt($);if(Q)return Jd(z),z=uo(Mt,c),ft($)}return z===n&&(z=uo(Mt,c)),L}return bn.cancel=vn,bn.flush=Ze,bn}var dx=Pt(function(o,c){return Pd(o,1,c)}),px=Pt(function(o,c,f){return Pd(o,En(c)||0,f)});function gx(o){return di(o,q)}function _l(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new tn(a);var f=function(){var _=arguments,k=c?c.apply(this,_):_[0],P=f.cache;if(P.has(k))return P.get(k);var L=o.apply(this,_);return f.cache=P.set(k,L)||P,L};return f.cache=new(_l.Cache||hi),f}_l.Cache=hi;function wl(o){if(typeof o!="function")throw new tn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function mx(o){return Fp(2,o)}var vx=i_(function(o,c){c=c.length==1&&kt(c[0])?Kt(c[0],Ke(pt())):Kt(Fe(c,1),Ke(pt()));var f=c.length;return Pt(function(_){for(var k=-1,P=Be(_.length,f);++k=c}),gr=Id(function(){return arguments}())?Id:function(o){return ae(o)&&Ht.call(o,"callee")&&!wd.call(o,"callee")},kt=O.isArray,Rx=Da?Ke(Da):z0;function nn(o){return o!=null&&xl(o.length)&&!mi(o)}function pe(o){return ae(o)&&nn(o)}function Dx(o){return o===!0||o===!1||ae(o)&&Ge(o)==Ot}var Hi=Xy||Eh,Lx=La?Ke(La):W0;function Ix(o){return ae(o)&&o.nodeType===1&&!ho(o)}function Nx(o){if(o==null)return!0;if(nn(o)&&(kt(o)||typeof o=="string"||typeof o.splice=="function"||Hi(o)||ss(o)||gr(o)))return!o.length;var c=He(o);if(c==re||c==Xt)return!o.size;if(co(o))return!Xu(o).length;for(var f in o)if(Ht.call(o,f))return!1;return!0}function Fx(o,c){return oo(o,c)}function Bx(o,c,f){f=typeof f=="function"?f:n;var _=f?f(o,c):n;return _===n?oo(o,c,n,f):!!_}function yh(o){if(!ae(o))return!1;var c=Ge(o);return c==De||c==In||typeof o.message=="string"&&typeof o.name=="string"&&!ho(o)}function Hx(o){return typeof o=="number"&&Sd(o)}function mi(o){if(!se(o))return!1;var c=Ge(o);return c==te||c==Le||c==be||c==wn}function $p(o){return typeof o=="number"&&o==At(o)}function xl(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=ct}function se(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function ae(o){return o!=null&&typeof o=="object"}var Up=qr?Ke(qr):$0;function zx(o,c){return o===c||qu(o,c,ch(c))}function Wx(o,c,f){return f=typeof f=="function"?f:n,qu(o,c,ch(c),f)}function jx(o){return Vp(o)&&o!=+o}function $x(o){if(O_(o))throw new Y(s);return Nd(o)}function Ux(o){return o===null}function Vx(o){return o==null}function Vp(o){return typeof o=="number"||ae(o)&&Ge(o)==oe}function ho(o){if(!ae(o)||Ge(o)!=ye)return!1;var c=Zr(o);if(c===null)return!0;var f=Ht.call(c,"constructor")&&c.constructor;return typeof f=="function"&&f instanceof f&&sr.call(f)==Ya}var _h=Vn?Ke(Vn):U0;function qx(o){return $p(o)&&o>=-ct&&o<=ct}var qp=Ia?Ke(Ia):V0;function Sl(o){return typeof o=="string"||!kt(o)&&ae(o)&&Ge(o)==xe}function mn(o){return typeof o=="symbol"||ae(o)&&Ge(o)==Ae}var ss=Na?Ke(Na):q0;function Xx(o){return o===n}function Yx(o){return ae(o)&&He(o)==Yt}function Kx(o){return ae(o)&&Ge(o)==Se}var Gx=dl(Yu),Jx=dl(function(o,c){return o<=c});function Xp(o){if(!o)return[];if(nn(o))return Sl(o)?pn(o):en(o);if(Js&&o[Js])return Pu(o[Js]());var c=He(o),f=c==re?Vs:c==Xt?Kr:os;return f(o)}function vi(o){if(!o)return o===0?o:0;if(o=En(o),o===K||o===-K){var c=o<0?-1:1;return c*dt}return o===o?o:0}function At(o){var c=vi(o),f=c%1;return c===c?f?c-f:c:0}function Yp(o){return o?hr(At(o),0,wt):0}function En(o){if(typeof o=="number")return o;if(mn(o))return _t;if(se(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=se(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=Wa(o);var f=Xc.test(o);return f||Kc.test(o)?vu(o.slice(2),f?2:8):da.test(o)?_t:+o}function Kp(o){return Zn(o,rn(o))}function Zx(o){return o?hr(At(o),-ct,ct):o===0?o:0}function Wt(o){return o==null?"":gn(o)}var Qx=ns(function(o,c){if(co(c)||nn(c)){Zn(c,Ee(c),o);return}for(var f in c)Ht.call(c,f)&&no(o,f,c[f])}),Gp=ns(function(o,c){Zn(c,rn(c),o)}),Tl=ns(function(o,c,f,_){Zn(c,rn(c),o,_)}),tS=ns(function(o,c,f,_){Zn(c,Ee(c),o,_)}),eS=pi(Wu);function nS(o,c){var f=es(o);return c==null?f:Ad(f,c)}var iS=Pt(function(o,c){o=ut(o);var f=-1,_=c.length,k=_>2?c[2]:n;for(k&&Je(c[0],c[1],k)&&(_=1);++f<_;)for(var P=c[f],L=rn(P),z=-1,$=L.length;++z<$;){var G=L[z],J=o[G];(J===n||Hn(J,ci[G])&&!Ht.call(o,G))&&(o[G]=P[G])}return o}),rS=Pt(function(o){return o.push(n,dp),Xe(Jp,n,o)});function sS(o,c){return Ba(o,pt(c,3),Jn)}function oS(o,c){return Ba(o,pt(c,3),$u)}function aS(o,c){return o==null?o:ju(o,pt(c,3),rn)}function lS(o,c){return o==null?o:Dd(o,pt(c,3),rn)}function cS(o,c){return o&&Jn(o,pt(c,3))}function uS(o,c){return o&&$u(o,pt(c,3))}function hS(o){return o==null?[]:sl(o,Ee(o))}function fS(o){return o==null?[]:sl(o,rn(o))}function wh(o,c,f){var _=o==null?n:fr(o,c);return _===n?f:_}function dS(o,c){return o!=null&&mp(o,c,N0)}function xh(o,c){return o!=null&&mp(o,c,F0)}var pS=lp(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=or.call(c)),o[c]=f},Th(sn)),gS=lp(function(o,c,f){c!=null&&typeof c.toString!="function"&&(c=or.call(c)),Ht.call(o,c)?o[c].push(f):o[c]=[f]},pt),mS=Pt(so);function Ee(o){return nn(o)?Od(o):Xu(o)}function rn(o){return nn(o)?Od(o,!0):X0(o)}function vS(o,c){var f={};return c=pt(c,3),Jn(o,function(_,k,P){fi(f,c(_,k,P),_)}),f}function bS(o,c){var f={};return c=pt(c,3),Jn(o,function(_,k,P){fi(f,k,c(_,k,P))}),f}var yS=ns(function(o,c,f){ol(o,c,f)}),Jp=ns(function(o,c,f,_){ol(o,c,f,_)}),_S=pi(function(o,c){var f={};if(o==null)return f;var _=!1;c=Kt(c,function(P){return P=Fi(P,o),_||(_=P.length>1),P}),Zn(o,ah(o),f),_&&(f=On(f,m|y|x,p_));for(var k=c.length;k--;)Qu(f,c[k]);return f});function wS(o,c){return Zp(o,wl(pt(c)))}var xS=pi(function(o,c){return o==null?{}:K0(o,c)});function Zp(o,c){if(o==null)return{};var f=Kt(ah(o),function(_){return[_]});return c=pt(c),$d(o,f,function(_,k){return c(_,k[0])})}function SS(o,c,f){c=Fi(c,o);var _=-1,k=c.length;for(k||(k=1,o=n);++_c){var _=o;o=c,c=_}if(f||o%1||c%1){var k=Td();return Be(o+k*(c-o+mu("1e-"+((k+"").length-1))),c)}return Gu(o,c)}var LS=is(function(o,c,f){return c=c.toLowerCase(),o+(f?eg(c):c)});function eg(o){return Sh(Wt(o).toLowerCase())}function ng(o){return o=Wt(o),o&&o.replace(Jc,Ou).replace(cu,"")}function IS(o,c,f){o=Wt(o),c=gn(c);var _=o.length;f=f===n?_:hr(At(f),0,_);var k=f;return f-=c.length,f>=0&&o.slice(f,k)==c}function NS(o){return o=Wt(o),o&&Nn.test(o)?o.replace(Fr,ku):o}function FS(o){return o=Wt(o),o&&Ei.test(o)?o.replace(Ss,"\\$&"):o}var BS=is(function(o,c,f){return o+(f?"-":"")+c.toLowerCase()}),HS=is(function(o,c,f){return o+(f?" ":"")+c.toLowerCase()}),zS=sp("toLowerCase");function WS(o,c,f){o=Wt(o),c=At(c);var _=c?Li(o):0;if(!c||_>=c)return o;var k=(c-_)/2;return fl(Qa(k),f)+o+fl(Za(k),f)}function jS(o,c,f){o=Wt(o),c=At(c);var _=c?Li(o):0;return c&&_>>0,f?(o=Wt(o),o&&(typeof c=="string"||c!=null&&!_h(c))&&(c=gn(c),!c&&Di(o))?Bi(pn(o),0,f):o.split(c,f)):[]}var KS=is(function(o,c,f){return o+(f?" ":"")+Sh(c)});function GS(o,c,f){return o=Wt(o),f=f==null?0:hr(At(f),0,o.length),c=gn(c),o.slice(f,f+c.length)==c}function JS(o,c,f){var _=E.templateSettings;f&&Je(o,c,f)&&(c=n),o=Wt(o),c=Tl({},c,_,fp);var k=Tl({},c.imports,_.imports,fp),P=Ee(k),L=Us(k,P),z,$,G=0,J=c.interpolate||zr,Q="__p += '",at=ee((c.escape||zr).source+"|"+J.source+"|"+(J===Sn?Hr:zr).source+"|"+(c.evaluate||zr).source+"|$","g"),ft="//# sourceURL="+(Ht.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++du+"]")+` `;o.replace(at,function(mt,Mt,It,vn,Ze,bn){return It||(It=vn),Q+=o.slice(G,bn).replace(Zc,Au),Mt&&(z=!0,Q+=`' + __e(`+Mt+`) + '`),Ze&&($=!0,Q+=`'; `+Ze+`; __p += '`),It&&(Q+=`' + ((__t = (`+It+`)) == null ? '' : __t) + '`),G=bn+mt.length,mt}),Q+=`'; `;var gt=Ht.call(c,"variable")&&c.variable;if(!gt)Q=`with (obj) { `+Q+` } `;else if(Vc.test(gt))throw new Y(l);Q=($?Q.replace(Zi,""):Q).replace(Qi,"$1").replace(tr,"$1;"),Q="function("+(gt||"obj")+`) { `+(gt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(z?", __e = _.escape":"")+($?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Q+`return __p }`;var Et=rg(function(){return rt(P,ft+"return "+Q).apply(n,L)});if(Et.source=Q,yh(Et))throw Et;return Et}function ZS(o){return Wt(o).toLowerCase()}function QS(o){return Wt(o).toUpperCase()}function tT(o,c,f){if(o=Wt(o),o&&(f||c===n))return Wa(o);if(!o||!(c=gn(c)))return o;var _=pn(o),k=pn(c),P=ja(_,k),L=$a(_,k)+1;return Bi(_,P,L).join("")}function eT(o,c,f){if(o=Wt(o),o&&(f||c===n))return o.slice(0,qa(o)+1);if(!o||!(c=gn(c)))return o;var _=pn(o),k=$a(_,pn(c))+1;return Bi(_,0,k).join("")}function nT(o,c,f){if(o=Wt(o),o&&(f||c===n))return o.replace(Ts,"");if(!o||!(c=gn(c)))return o;var _=pn(o),k=ja(_,pn(c));return Bi(_,k).join("")}function iT(o,c){var f=F,_=H;if(se(c)){var k="separator"in c?c.separator:k;f="length"in c?At(c.length):f,_="omission"in c?gn(c.omission):_}o=Wt(o);var P=o.length;if(Di(o)){var L=pn(o);P=L.length}if(f>=P)return o;var z=f-Li(_);if(z<1)return _;var $=L?Bi(L,0,z).join(""):o.slice(0,z);if(k===n)return $+_;if(L&&(z+=$.length-z),_h(k)){if(o.slice(z).search(k)){var G,J=$;for(k.global||(k=ee(k.source,Wt(fa.exec(k))+"g")),k.lastIndex=0;G=k.exec(J);)var Q=G.index;$=$.slice(0,Q===n?z:Q)}}else if(o.indexOf(gn(k),z)!=z){var at=$.lastIndexOf(k);at>-1&&($=$.slice(0,at))}return $+_}function rT(o){return o=Wt(o),o&&Br.test(o)?o.replace(er,Xa):o}var sT=is(function(o,c,f){return o+(f?" ":"")+c.toUpperCase()}),Sh=sp("toUpperCase");function ig(o,c,f){return o=Wt(o),c=f?n:c,c===n?Eu(o)?v(o):Su(o):o.match(c)||[]}var rg=Pt(function(o,c){try{return Xe(o,n,c)}catch(f){return yh(f)?f:new Y(f)}}),oT=pi(function(o,c){return Ye(c,function(f){f=Qn(f),fi(o,f,vh(o[f],o))}),o});function aT(o){var c=o==null?0:o.length,f=pt();return o=c?Kt(o,function(_){if(typeof _[1]!="function")throw new tn(a);return[f(_[0]),_[1]]}):[],Pt(function(_){for(var k=-1;++kct)return[];var f=wt,_=Be(o,wt);c=pt(c),o-=wt;for(var k=$s(_,c);++f0||c<0)?new Dt(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),c!==n&&(c=At(c),f=c<0?f.dropRight(-c):f.take(c-o)),f)},Dt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Dt.prototype.toArray=function(){return this.take(wt)},Jn(Dt.prototype,function(o,c){var f=/^(?:filter|find|map|reject)|While$/.test(c),_=/^(?:head|last)$/.test(c),k=E[_?"take"+(c=="last"?"Right":""):c],P=_||/^find/.test(c);k&&(E.prototype[c]=function(){var L=this.__wrapped__,z=_?[1]:arguments,$=L instanceof Dt,G=z[0],J=$||kt(L),Q=function(Mt){var It=k.apply(E,Xn([Mt],z));return _&&at?It[0]:It};J&&f&&typeof G=="function"&&G.length!=1&&($=J=!1);var at=this.__chain__,ft=!!this.__actions__.length,gt=P&&!at,Et=$&&!ft;if(!P&&J){L=Et?L:new Dt(this);var mt=o.apply(L,z);return mt.__actions__.push({func:vl,args:[Q],thisArg:n}),new Cn(mt,at)}return gt&&Et?o.apply(this,z):(mt=this.thru(Q),gt?_?mt.value()[0]:mt.value():mt)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(o){var c=rr[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",_=/^(?:pop|shift)$/.test(o);E.prototype[o]=function(){var k=arguments;if(_&&!this.__chain__){var P=this.value();return c.apply(kt(P)?P:[],k)}return this[f](function(L){return c.apply(kt(L)?L:[],k)})}}),Jn(Dt.prototype,function(o,c){var f=E[c];if(f){var _=f.name+"";Ht.call(ts,_)||(ts[_]=[]),ts[_].push({name:c,func:f})}}),ts[ul(n,A).name]=[{name:"wrapper",func:n}],Dt.prototype.clone=r0,Dt.prototype.reverse=s0,Dt.prototype.value=o0,E.prototype.at=Iw,E.prototype.chain=Nw,E.prototype.commit=Fw,E.prototype.next=Bw,E.prototype.plant=zw,E.prototype.reverse=Ww,E.prototype.toJSON=E.prototype.valueOf=E.prototype.value=jw,E.prototype.first=E.prototype.head,Js&&(E.prototype[Js]=Hw),E},g=p();li?((li.exports=g)._=g,Ds._=g):Te._=g}).call(KT)}(So,So.exports)),So.exports}var JT=GT();const ZT=zv(JT);function Wv(e,t){return function(){return e.apply(t,arguments)}}const{toString:QT}=Object.prototype,{getPrototypeOf:zf}=Object,{iterator:Oc,toStringTag:jv}=Symbol,kc=(e=>t=>{const n=QT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Un=e=>(e=e.toLowerCase(),t=>kc(t)===e),Ac=e=>t=>typeof t===e,{isArray:xs}=Array,ps=Ac("undefined");function Qo(e){return e!==null&&!ps(e)&&e.constructor!==null&&!ps(e.constructor)&&ln(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $v=Un("ArrayBuffer");function t1(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&$v(e.buffer),t}const e1=Ac("string"),ln=Ac("function"),Uv=Ac("number"),ta=e=>e!==null&&typeof e=="object",n1=e=>e===!0||e===!1,Yl=e=>{if(kc(e)!=="object")return!1;const t=zf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(jv in e)&&!(Oc in e)},i1=e=>{if(!ta(e)||Qo(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},r1=Un("Date"),s1=Un("File"),o1=e=>!!(e&&typeof e.uri<"u"),a1=e=>e&&typeof e.getParts<"u",l1=Un("Blob"),c1=Un("FileList"),u1=e=>ta(e)&&ln(e.pipe);function h1(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const cg=h1(),ug=typeof cg.FormData<"u"?cg.FormData:void 0,f1=e=>{let t;return e&&(ug&&e instanceof ug||ln(e.append)&&((t=kc(e))==="formdata"||t==="object"&&ln(e.toString)&&e.toString()==="[object FormData]"))},d1=Un("URLSearchParams"),[p1,g1,m1,v1]=["ReadableStream","Request","Response","Headers"].map(Un),b1=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ea(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,r;if(typeof e!="object"&&(e=[e]),xs(e))for(i=0,r=e.length;i0;)if(r=n[i],t===r.toLowerCase())return r;return null}const Cr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qv=e=>!ps(e)&&e!==Cr;function lf(){const{caseless:e,skipUndefined:t}=qv(this)&&this||{},n={},i=(r,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const a=e&&Vv(n,s)||s;Yl(n[a])&&Yl(r)?n[a]=lf(n[a],r):Yl(r)?n[a]=lf({},r):xs(r)?n[a]=r.slice():(!t||!ps(r))&&(n[a]=r)};for(let r=0,s=arguments.length;r(ea(t,(r,s)=>{n&&ln(r)?Object.defineProperty(e,s,{value:Wv(r,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),_1=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),w1=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},x1=(e,t,n,i)=>{let r,s,a;const l={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)a=r[s],(!i||i(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&zf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},S1=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},T1=e=>{if(!e)return null;if(xs(e))return e;let t=e.length;if(!Uv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},C1=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&zf(Uint8Array)),O1=(e,t)=>{const i=(e&&e[Oc]).call(e);let r;for(;(r=i.next())&&!r.done;){const s=r.value;t.call(e,s[0],s[1])}},k1=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},A1=Un("HTMLFormElement"),E1=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),hg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),P1=Un("RegExp"),Xv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};ea(n,(r,s)=>{let a;(a=t(r,s,e))!==!1&&(i[s]=a||r)}),Object.defineProperties(e,i)},M1=e=>{Xv(e,(t,n)=>{if(ln(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(ln(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},R1=(e,t)=>{const n={},i=r=>{r.forEach(s=>{n[s]=!0})};return xs(e)?i(e):i(String(e).split(t)),n},D1=()=>{},L1=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function I1(e){return!!(e&&ln(e.append)&&e[jv]==="FormData"&&e[Oc])}const N1=e=>{const t=new Array(10),n=(i,r)=>{if(ta(i)){if(t.indexOf(i)>=0)return;if(Qo(i))return i;if(!("toJSON"in i)){t[r]=i;const s=xs(i)?[]:{};return ea(i,(a,l)=>{const u=n(a,r+1);!ps(u)&&(s[l]=u)}),t[r]=void 0,s}}return i};return n(e,0)},F1=Un("AsyncFunction"),B1=e=>e&&(ta(e)||ln(e))&&ln(e.then)&&ln(e.catch),Yv=((e,t)=>e?setImmediate:t?((n,i)=>(Cr.addEventListener("message",({source:r,data:s})=>{r===Cr&&s===n&&i.length&&i.shift()()},!1),r=>{i.push(r),Cr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ln(Cr.postMessage)),H1=typeof queueMicrotask<"u"?queueMicrotask.bind(Cr):typeof process<"u"&&process.nextTick||Yv,z1=e=>e!=null&&ln(e[Oc]),X={isArray:xs,isArrayBuffer:$v,isBuffer:Qo,isFormData:f1,isArrayBufferView:t1,isString:e1,isNumber:Uv,isBoolean:n1,isObject:ta,isPlainObject:Yl,isEmptyObject:i1,isReadableStream:p1,isRequest:g1,isResponse:m1,isHeaders:v1,isUndefined:ps,isDate:r1,isFile:s1,isReactNativeBlob:o1,isReactNative:a1,isBlob:l1,isRegExp:P1,isFunction:ln,isStream:u1,isURLSearchParams:d1,isTypedArray:C1,isFileList:c1,forEach:ea,merge:lf,extend:y1,trim:b1,stripBOM:_1,inherits:w1,toFlatObject:x1,kindOf:kc,kindOfTest:Un,endsWith:S1,toArray:T1,forEachEntry:O1,matchAll:k1,isHTMLForm:A1,hasOwnProperty:hg,hasOwnProp:hg,reduceDescriptors:Xv,freezeMethods:M1,toObjectSet:R1,toCamelCase:E1,noop:D1,toFiniteNumber:L1,findKey:Vv,global:Cr,isContextDefined:qv,isSpecCompliantForm:I1,toJSONObject:N1,isAsyncFn:F1,isThenable:B1,setImmediate:Yv,asap:H1,isIterable:z1};let bt=class Kv extends Error{static from(t,n,i,r,s,a){const l=new Kv(t.message,n||t.code,i,r,s);return l.cause=t,l.name=t.name,t.status!=null&&l.status==null&&(l.status=t.status),a&&Object.assign(l,a),l}constructor(t,n,i,r,s){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:X.toJSONObject(this.config),code:this.code,status:this.status}}};bt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";bt.ERR_BAD_OPTION="ERR_BAD_OPTION";bt.ECONNABORTED="ECONNABORTED";bt.ETIMEDOUT="ETIMEDOUT";bt.ERR_NETWORK="ERR_NETWORK";bt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";bt.ERR_DEPRECATED="ERR_DEPRECATED";bt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";bt.ERR_BAD_REQUEST="ERR_BAD_REQUEST";bt.ERR_CANCELED="ERR_CANCELED";bt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";bt.ERR_INVALID_URL="ERR_INVALID_URL";const W1=null;function cf(e){return X.isPlainObject(e)||X.isArray(e)}function Gv(e){return X.endsWith(e,"[]")?e.slice(0,-2):e}function Ph(e,t,n){return e?e.concat(t).map(function(r,s){return r=Gv(r),!n&&s?"["+r+"]":r}).join(n?".":""):t}function j1(e){return X.isArray(e)&&!e.some(cf)}const $1=X.toFlatObject(X,{},null,function(t){return/^is[A-Z]/.test(t)});function Ec(e,t,n){if(!X.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=X.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,T){return!X.isUndefined(T[C])});const i=n.metaTokens,r=n.visitor||d,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&X.isSpecCompliantForm(t);if(!X.isFunction(r))throw new TypeError("visitor must be a function");function h(S){if(S===null)return"";if(X.isDate(S))return S.toISOString();if(X.isBoolean(S))return S.toString();if(!u&&X.isBlob(S))throw new bt("Blob is not supported. Use a Buffer instead.");return X.isArrayBuffer(S)||X.isTypedArray(S)?u&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function d(S,C,T){let A=S;if(X.isReactNative(t)&&X.isReactNativeBlob(S))return t.append(Ph(T,C,s),h(S)),!1;if(S&&!T&&typeof S=="object"){if(X.endsWith(C,"{}"))C=i?C:C.slice(0,-2),S=JSON.stringify(S);else if(X.isArray(S)&&j1(S)||(X.isFileList(S)||X.endsWith(C,"[]"))&&(A=X.toArray(S)))return C=Gv(C),A.forEach(function(B,D){!(X.isUndefined(B)||B===null)&&t.append(a===!0?Ph([C],D,s):a===null?C:C+"[]",h(B))}),!1}return cf(S)?!0:(t.append(Ph(T,C,s),h(S)),!1)}const m=[],y=Object.assign($1,{defaultVisitor:d,convertValue:h,isVisitable:cf});function x(S,C){if(!X.isUndefined(S)){if(m.indexOf(S)!==-1)throw Error("Circular reference detected in "+C.join("."));m.push(S),X.forEach(S,function(A,M){(!(X.isUndefined(A)||A===null)&&r.call(t,A,X.isString(M)?M.trim():M,C,y))===!0&&x(A,C?C.concat(M):[M])}),m.pop()}}if(!X.isObject(e))throw new TypeError("data must be an object");return x(e),t}function fg(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function Wf(e,t){this._pairs=[],e&&Ec(e,this,t)}const Jv=Wf.prototype;Jv.append=function(t,n){this._pairs.push([t,n])};Jv.toString=function(t){const n=t?function(i){return t.call(this,i,fg)}:fg;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function U1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Zv(e,t,n){if(!t)return e;const i=n&&n.encode||U1,r=X.isFunction(n)?{serialize:n}:n,s=r&&r.serialize;let a;if(s?a=s(t,r):a=X.isURLSearchParams(t)?t.toString():new Wf(t,r).toString(i),a){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class dg{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){X.forEach(this.handlers,function(i){i!==null&&t(i)})}}const jf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},V1=typeof URLSearchParams<"u"?URLSearchParams:Wf,q1=typeof FormData<"u"?FormData:null,X1=typeof Blob<"u"?Blob:null,Y1={isBrowser:!0,classes:{URLSearchParams:V1,FormData:q1,Blob:X1},protocols:["http","https","file","blob","url","data"]},$f=typeof window<"u"&&typeof document<"u",uf=typeof navigator=="object"&&navigator||void 0,K1=$f&&(!uf||["ReactNative","NativeScript","NS"].indexOf(uf.product)<0),G1=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",J1=$f&&window.location.href||"http://localhost",Z1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$f,hasStandardBrowserEnv:K1,hasStandardBrowserWebWorkerEnv:G1,navigator:uf,origin:J1},Symbol.toStringTag,{value:"Module"})),je={...Z1,...Y1};function Q1(e,t){return Ec(e,new je.classes.URLSearchParams,{visitor:function(n,i,r,s){return je.isNode&&X.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...t})}function tC(e){return X.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function eC(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i=n.length;return a=!a&&X.isArray(r)?r.length:a,u?(X.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i,!l):((!r[a]||!X.isObject(r[a]))&&(r[a]=[]),t(n,i,r[a],s)&&X.isArray(r[a])&&(r[a]=eC(r[a])),!l)}if(X.isFormData(e)&&X.isFunction(e.entries)){const n={};return X.forEachEntry(e,(i,r)=>{t(tC(i),r,n,0)}),n}return null}function nC(e,t,n){if(X.isString(e))try{return(t||JSON.parse)(e),X.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const na={transitional:jf,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=X.isObject(t);if(s&&X.isHTMLForm(t)&&(t=new FormData(t)),X.isFormData(t))return r?JSON.stringify(Qv(t)):t;if(X.isArrayBuffer(t)||X.isBuffer(t)||X.isStream(t)||X.isFile(t)||X.isBlob(t)||X.isReadableStream(t))return t;if(X.isArrayBufferView(t))return t.buffer;if(X.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Q1(t,this.formSerializer).toString();if((l=X.isFileList(t))||i.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Ec(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),nC(t)):t}],transformResponse:[function(t){const n=this.transitional||na.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(X.isResponse(t)||X.isReadableStream(t))return t;if(t&&X.isString(t)&&(i&&!this.responseType||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?bt.from(l,bt.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:je.classes.FormData,Blob:je.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};X.forEach(["delete","get","head","post","put","patch"],e=>{na.headers[e]={}});const iC=X.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),rC=e=>{const t={};let n,i,r;return e&&e.split(` `).forEach(function(a){r=a.indexOf(":"),n=a.substring(0,r).trim().toLowerCase(),i=a.substring(r+1).trim(),!(!n||t[n]&&iC[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},pg=Symbol("internals");function fo(e){return e&&String(e).trim().toLowerCase()}function Kl(e){return e===!1||e==null?e:X.isArray(e)?e.map(Kl):String(e)}function sC(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const oC=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Mh(e,t,n,i,r){if(X.isFunction(i))return i.call(this,t,n);if(r&&(t=n),!!X.isString(t)){if(X.isString(i))return t.indexOf(i)!==-1;if(X.isRegExp(i))return i.test(t)}}function aC(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function lC(e,t){const n=X.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(r,s,a){return this[i].call(this,t,r,s,a)},configurable:!0})})}let cn=class{constructor(t){t&&this.set(t)}set(t,n,i){const r=this;function s(l,u,h){const d=fo(u);if(!d)throw new Error("header name must be a non-empty string");const m=X.findKey(r,d);(!m||r[m]===void 0||h===!0||h===void 0&&r[m]!==!1)&&(r[m||u]=Kl(l))}const a=(l,u)=>X.forEach(l,(h,d)=>s(h,d,u));if(X.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(X.isString(t)&&(t=t.trim())&&!oC(t))a(rC(t),n);else if(X.isObject(t)&&X.isIterable(t)){let l={},u,h;for(const d of t){if(!X.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[h=d[0]]=(u=l[h])?X.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}a(l,n)}else t!=null&&s(n,t,i);return this}get(t,n){if(t=fo(t),t){const i=X.findKey(this,t);if(i){const r=this[i];if(!n)return r;if(n===!0)return sC(r);if(X.isFunction(n))return n.call(this,r,i);if(X.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=fo(t),t){const i=X.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||Mh(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let r=!1;function s(a){if(a=fo(a),a){const l=X.findKey(i,a);l&&(!n||Mh(i,i[l],l,n))&&(delete i[l],r=!0)}}return X.isArray(t)?t.forEach(s):s(t),r}clear(t){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const s=n[i];(!t||Mh(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const n=this,i={};return X.forEach(this,(r,s)=>{const a=X.findKey(i,s);if(a){n[a]=Kl(r),delete n[s];return}const l=t?aC(s):String(s).trim();l!==s&&delete n[s],n[l]=Kl(r),i[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return X.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=t&&X.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(r=>i.set(r)),i}static accessor(t){const i=(this[pg]=this[pg]={accessors:{}}).accessors,r=this.prototype;function s(a){const l=fo(a);i[l]||(lC(r,a),i[l]=!0)}return X.isArray(t)?t.forEach(s):s(t),this}};cn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);X.reduceDescriptors(cn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});X.freezeMethods(cn);function Rh(e,t){const n=this||na,i=t||n,r=cn.from(i.headers);let s=i.data;return X.forEach(e,function(l){s=l.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function tb(e){return!!(e&&e.__CANCEL__)}let ia=class extends bt{constructor(t,n,i){super(t??"canceled",bt.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function eb(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new bt("Request failed with status code "+n.status,[bt.ERR_BAD_REQUEST,bt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cC(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function uC(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r=0,s=0,a;return t=t!==void 0?t:1e3,function(u){const h=Date.now(),d=i[s];a||(a=h),n[r]=u,i[r]=h;let m=s,y=0;for(;m!==r;)y+=n[m++],m=m%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),h-a{n=d,r=null,s&&(clearTimeout(s),s=null),e(...h)};return[(...h)=>{const d=Date.now(),m=d-n;m>=i?a(h,d):(r=h,s||(s=setTimeout(()=>{s=null,a(r)},i-m)))},()=>r&&a(r)]}const cc=(e,t,n=3)=>{let i=0;const r=uC(50,250);return hC(s=>{const a=s.loaded,l=s.lengthComputable?s.total:void 0,u=a-i,h=r(u),d=a<=l;i=a;const m={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:h||void 0,estimated:h&&l&&d?(l-a)/h:void 0,event:s,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(m)},n)},gg=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},mg=e=>(...t)=>X.asap(()=>e(...t)),fC=je.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,je.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(je.origin),je.navigator&&/(msie|trident)/i.test(je.navigator.userAgent)):()=>!0,dC=je.hasStandardBrowserEnv?{write(e,t,n,i,r,s,a){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];X.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),X.isString(i)&&l.push(`path=${i}`),X.isString(r)&&l.push(`domain=${r}`),s===!0&&l.push("secure"),X.isString(a)&&l.push(`SameSite=${a}`),document.cookie=l.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function pC(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gC(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function nb(e,t,n){let i=!pC(t);return e&&(i||n==!1)?gC(e,t):t}const vg=e=>e instanceof cn?{...e}:e;function Mr(e,t){t=t||{};const n={};function i(h,d,m,y){return X.isPlainObject(h)&&X.isPlainObject(d)?X.merge.call({caseless:y},h,d):X.isPlainObject(d)?X.merge({},d):X.isArray(d)?d.slice():d}function r(h,d,m,y){if(X.isUndefined(d)){if(!X.isUndefined(h))return i(void 0,h,m,y)}else return i(h,d,m,y)}function s(h,d){if(!X.isUndefined(d))return i(void 0,d)}function a(h,d){if(X.isUndefined(d)){if(!X.isUndefined(h))return i(void 0,h)}else return i(void 0,d)}function l(h,d,m){if(m in t)return i(h,d);if(m in e)return i(void 0,h)}const u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(h,d,m)=>r(vg(h),vg(d),m,!0)};return X.forEach(Object.keys({...e,...t}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;const m=X.hasOwnProp(u,d)?u[d]:r,y=m(e[d],t[d],d);X.isUndefined(y)&&m!==l||(n[d]=y)}),n}const ib=e=>{const t=Mr({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:l}=t;if(t.headers=a=cn.from(a),t.url=Zv(nb(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),X.isFormData(n)){if(je.hasStandardBrowserEnv||je.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(X.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([d,m])=>{h.includes(d.toLowerCase())&&a.set(d,m)})}}if(je.hasStandardBrowserEnv&&(i&&X.isFunction(i)&&(i=i(t)),i||i!==!1&&fC(t.url))){const u=r&&s&&dC.read(s);u&&a.set(r,u)}return t},mC=typeof XMLHttpRequest<"u",vC=mC&&function(e){return new Promise(function(n,i){const r=ib(e);let s=r.data;const a=cn.from(r.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:h}=r,d,m,y,x,S;function C(){x&&x(),S&&S(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let T=new XMLHttpRequest;T.open(r.method.toUpperCase(),r.url,!0),T.timeout=r.timeout;function A(){if(!T)return;const B=cn.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),R={data:!l||l==="text"||l==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:B,config:e,request:T};eb(function(I){n(I),C()},function(I){i(I),C()},R),T=null}"onloadend"in T?T.onloadend=A:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(A)},T.onabort=function(){T&&(i(new bt("Request aborted",bt.ECONNABORTED,e,T)),T=null)},T.onerror=function(D){const R=D&&D.message?D.message:"Network Error",N=new bt(R,bt.ERR_NETWORK,e,T);N.event=D||null,i(N),T=null},T.ontimeout=function(){let D=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const R=r.transitional||jf;r.timeoutErrorMessage&&(D=r.timeoutErrorMessage),i(new bt(D,R.clarifyTimeoutError?bt.ETIMEDOUT:bt.ECONNABORTED,e,T)),T=null},s===void 0&&a.setContentType(null),"setRequestHeader"in T&&X.forEach(a.toJSON(),function(D,R){T.setRequestHeader(R,D)}),X.isUndefined(r.withCredentials)||(T.withCredentials=!!r.withCredentials),l&&l!=="json"&&(T.responseType=r.responseType),h&&([y,S]=cc(h,!0),T.addEventListener("progress",y)),u&&T.upload&&([m,x]=cc(u),T.upload.addEventListener("progress",m),T.upload.addEventListener("loadend",x)),(r.cancelToken||r.signal)&&(d=B=>{T&&(i(!B||B.type?new ia(null,e,T):B),T.abort(),T=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const M=cC(r.url);if(M&&je.protocols.indexOf(M)===-1){i(new bt("Unsupported protocol "+M+":",bt.ERR_BAD_REQUEST,e));return}T.send(s||null)})},bC=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,r;const s=function(h){if(!r){r=!0,l();const d=h instanceof Error?h:this.reason;i.abort(d instanceof bt?d:new ia(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,s(new bt(`timeout of ${t}ms exceeded`,bt.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(s):h.removeEventListener("abort",s)}),e=null)};e.forEach(h=>h.addEventListener("abort",s));const{signal:u}=i;return u.unsubscribe=()=>X.asap(l),u}},yC=function*(e,t){let n=e.byteLength;if(n{const r=_C(e,t);let s=0,a,l=u=>{a||(a=!0,i&&i(u))};return new ReadableStream({async pull(u){try{const{done:h,value:d}=await r.next();if(h){l(),u.close();return}let m=d.byteLength;if(n){let y=s+=m;n(y)}u.enqueue(new Uint8Array(d))}catch(h){throw l(h),h}},cancel(u){return l(u),r.return()}},{highWaterMark:2})},yg=64*1024,{isFunction:Ol}=X,xC=(({Request:e,Response:t})=>({Request:e,Response:t}))(X.global),{ReadableStream:_g,TextEncoder:wg}=X.global,xg=(e,...t)=>{try{return!!e(...t)}catch{return!1}},SC=e=>{e=X.merge.call({skipUndefined:!0},xC,e);const{fetch:t,Request:n,Response:i}=e,r=t?Ol(t):typeof fetch=="function",s=Ol(n),a=Ol(i);if(!r)return!1;const l=r&&Ol(_g),u=r&&(typeof wg=="function"?(S=>C=>S.encode(C))(new wg):async S=>new Uint8Array(await new n(S).arrayBuffer())),h=s&&l&&xg(()=>{let S=!1;const C=new n(je.origin,{body:new _g,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!C}),d=a&&l&&xg(()=>X.isReadableStream(new i("").body)),m={stream:d&&(S=>S.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!m[S]&&(m[S]=(C,T)=>{let A=C&&C[S];if(A)return A.call(C);throw new bt(`Response type '${S}' is not supported`,bt.ERR_NOT_SUPPORT,T)})});const y=async S=>{if(S==null)return 0;if(X.isBlob(S))return S.size;if(X.isSpecCompliantForm(S))return(await new n(je.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(X.isArrayBufferView(S)||X.isArrayBuffer(S))return S.byteLength;if(X.isURLSearchParams(S)&&(S=S+""),X.isString(S))return(await u(S)).byteLength},x=async(S,C)=>{const T=X.toFiniteNumber(S.getContentLength());return T??y(C)};return async S=>{let{url:C,method:T,data:A,signal:M,cancelToken:B,timeout:D,onDownloadProgress:R,onUploadProgress:N,responseType:I,headers:j,withCredentials:q="same-origin",fetchOptions:F}=ib(S),H=t||fetch;I=I?(I+"").toLowerCase():"text";let U=bC([M,B&&B.toAbortSignal()],D),V=null;const st=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let tt;try{if(N&&h&&T!=="get"&&T!=="head"&&(tt=await x(j,A))!==0){let wt=new n(C,{method:"POST",body:A,duplex:"half"}),vt;if(X.isFormData(A)&&(vt=wt.headers.get("content-type"))&&j.setContentType(vt),wt.body){const[Ft,xt]=gg(tt,cc(mg(N)));A=bg(wt.body,yg,Ft,xt)}}X.isString(q)||(q=q?"include":"omit");const it=s&&"credentials"in n.prototype,K={...F,signal:U,method:T.toUpperCase(),headers:j.normalize().toJSON(),body:A,duplex:"half",credentials:it?q:void 0};V=s&&new n(C,K);let ct=await(s?H(V,F):H(C,K));const dt=d&&(I==="stream"||I==="response");if(d&&(R||dt&&st)){const wt={};["status","statusText","headers"].forEach(Ct=>{wt[Ct]=ct[Ct]});const vt=X.toFiniteNumber(ct.headers.get("content-length")),[Ft,xt]=R&&gg(vt,cc(mg(R),!0))||[];ct=new i(bg(ct.body,yg,Ft,()=>{xt&&xt(),st&&st()}),wt)}I=I||"text";let _t=await m[X.findKey(m,I)||"text"](ct,S);return!dt&&st&&st(),await new Promise((wt,vt)=>{eb(wt,vt,{data:_t,headers:cn.from(ct.headers),status:ct.status,statusText:ct.statusText,config:S,request:V})})}catch(it){throw st&&st(),it&&it.name==="TypeError"&&/Load failed|fetch/i.test(it.message)?Object.assign(new bt("Network Error",bt.ERR_NETWORK,S,V,it&&it.response),{cause:it.cause||it}):bt.from(it,it&&it.code,S,V,it&&it.response)}}},TC=new Map,rb=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:r}=t,s=[i,r,n];let a=s.length,l=a,u,h,d=TC;for(;l--;)u=s[l],h=d.get(u),h===void 0&&d.set(u,h=l?new Map:SC(t)),d=h;return h};rb();const Uf={http:W1,xhr:vC,fetch:{get:rb}};X.forEach(Uf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Sg=e=>`- ${e}`,CC=e=>X.isFunction(e)||e===null||e===!1;function OC(e,t){e=X.isArray(e)?e:[e];const{length:n}=e;let i,r;const s={};for(let a=0;a`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since : `+a.map(Sg).join(` `):" "+Sg(a[0]):"as no adapter specified";throw new bt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r}const sb={getAdapter:OC,adapters:Uf};function Dh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ia(null,e)}function Tg(e){return Dh(e),e.headers=cn.from(e.headers),e.data=Rh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),sb.getAdapter(e.adapter||na.adapter,e)(e).then(function(i){return Dh(e),i.data=Rh.call(e,e.transformResponse,i),i.headers=cn.from(i.headers),i},function(i){return tb(i)||(Dh(e),i&&i.response&&(i.response.data=Rh.call(e,e.transformResponse,i.response),i.response.headers=cn.from(i.response.headers))),Promise.reject(i)})}const ob="1.13.6",Pc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pc[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const Cg={};Pc.transitional=function(t,n,i){function r(s,a){return"[Axios v"+ob+"] Transitional option '"+s+"'"+a+(i?". "+i:"")}return(s,a,l)=>{if(t===!1)throw new bt(r(a," has been removed"+(n?" in "+n:"")),bt.ERR_DEPRECATED);return n&&!Cg[a]&&(Cg[a]=!0,console.warn(r(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,a,l):!0}};Pc.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function kC(e,t,n){if(typeof e!="object")throw new bt("options must be an object",bt.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],a=t[s];if(a){const l=e[s],u=l===void 0||a(l,s,e);if(u!==!0)throw new bt("option "+s+" must be "+u,bt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new bt("Unknown option "+s,bt.ERR_BAD_OPTION)}}const Gl={assertOptions:kC,validators:Pc},Pn=Gl.validators;let kr=class{constructor(t){this.defaults=t||{},this.interceptors={request:new dg,response:new dg}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+=` `+s):i.stack=s}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Mr(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&Gl.assertOptions(i,{silentJSONParsing:Pn.transitional(Pn.boolean),forcedJSONParsing:Pn.transitional(Pn.boolean),clarifyTimeoutError:Pn.transitional(Pn.boolean),legacyInterceptorReqResOrdering:Pn.transitional(Pn.boolean)},!1),r!=null&&(X.isFunction(r)?n.paramsSerializer={serialize:r}:Gl.assertOptions(r,{encode:Pn.function,serialize:Pn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Gl.assertOptions(n,{baseUrl:Pn.spelling("baseURL"),withXsrfToken:Pn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&X.merge(s.common,s[n.method]);s&&X.forEach(["delete","get","head","post","put","patch","common"],S=>{delete s[S]}),n.headers=cn.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(C){if(typeof C.runWhen=="function"&&C.runWhen(n)===!1)return;u=u&&C.synchronous;const T=n.transitional||jf;T&&T.legacyInterceptorReqResOrdering?l.unshift(C.fulfilled,C.rejected):l.push(C.fulfilled,C.rejected)});const h=[];this.interceptors.response.forEach(function(C){h.push(C.fulfilled,C.rejected)});let d,m=0,y;if(!u){const S=[Tg.bind(this),void 0];for(S.unshift(...l),S.push(...h),y=S.length,d=Promise.resolve(n);m{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(l=>{i.subscribe(l),s=l}).then(r);return a.cancel=function(){i.unsubscribe(s)},a},t(function(s,a,l){i.reason||(i.reason=new ia(s,a,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ab(function(r){t=r}),cancel:t}}};function EC(e){return function(n){return e.apply(null,n)}}function PC(e){return X.isObject(e)&&e.isAxiosError===!0}const hf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(hf).forEach(([e,t])=>{hf[t]=e});function lb(e){const t=new kr(e),n=Wv(kr.prototype.request,t);return X.extend(n,kr.prototype,t,{allOwnKeys:!0}),X.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return lb(Mr(e,r))},n}const ve=lb(na);ve.Axios=kr;ve.CanceledError=ia;ve.CancelToken=AC;ve.isCancel=tb;ve.VERSION=ob;ve.toFormData=Ec;ve.AxiosError=bt;ve.Cancel=ve.CanceledError;ve.all=function(t){return Promise.all(t)};ve.spread=EC;ve.isAxiosError=PC;ve.mergeConfig=Mr;ve.AxiosHeaders=cn;ve.formToJSON=e=>Qv(X.isHTMLForm(e)?new FormData(e):e);ve.getAdapter=sb.getAdapter;ve.HttpStatusCode=hf;ve.default=ve;const{Axios:LD,AxiosError:ID,CanceledError:ND,isCancel:FD,CancelToken:BD,VERSION:HD,all:zD,Cancel:WD,isAxiosError:jD,spread:$D,toFormData:UD,AxiosHeaders:VD,HttpStatusCode:qD,formToJSON:XD,getAdapter:YD,mergeConfig:KD}=ve;window._=ZT;window.axios=ve;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";window.axios&&window.axios.interceptors.response.use(e=>e,e=>(e.response&&e.response.status===419&&(e.response.data&&e.response.data.action==="redirect"&&e.response.data.redirect_url?window.location.href=e.response.data.redirect_url:window.location.href="/login"),Promise.reject(e)));var un="top",Dn="bottom",Ln="right",hn="left",Vf="auto",ra=[un,Dn,Ln,hn],gs="start",Wo="end",MC="clippingParents",cb="viewport",po="popper",RC="reference",Og=ra.reduce(function(e,t){return e.concat([t+"-"+gs,t+"-"+Wo])},[]),ub=[].concat(ra,[Vf]).reduce(function(e,t){return e.concat([t,t+"-"+gs,t+"-"+Wo])},[]),DC="beforeRead",LC="read",IC="afterRead",NC="beforeMain",FC="main",BC="afterMain",HC="beforeWrite",zC="write",WC="afterWrite",jC=[DC,LC,IC,NC,FC,BC,HC,zC,WC];function si(e){return e?(e.nodeName||"").toLowerCase():null}function _n(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Rr(e){var t=_n(e).Element;return e instanceof t||e instanceof Element}function Rn(e){var t=_n(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function qf(e){if(typeof ShadowRoot>"u")return!1;var t=_n(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $C(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var i=t.styles[n]||{},r=t.attributes[n]||{},s=t.elements[n];!Rn(s)||!si(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var l=r[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})}function UC(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(i){var r=t.elements[i],s=t.attributes[i]||{},a=Object.keys(t.styles.hasOwnProperty(i)?t.styles[i]:n[i]),l=a.reduce(function(u,h){return u[h]="",u},{});!Rn(r)||!si(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(u){r.removeAttribute(u)}))})}}const VC={name:"applyStyles",enabled:!0,phase:"write",fn:$C,effect:UC,requires:["computeStyles"]};function ii(e){return e.split("-")[0]}var Ar=Math.max,uc=Math.min,ms=Math.round;function ff(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function hb(){return!/^((?!chrome|android).)*safari/i.test(ff())}function vs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var i=e.getBoundingClientRect(),r=1,s=1;t&&Rn(e)&&(r=e.offsetWidth>0&&ms(i.width)/e.offsetWidth||1,s=e.offsetHeight>0&&ms(i.height)/e.offsetHeight||1);var a=Rr(e)?_n(e):window,l=a.visualViewport,u=!hb()&&n,h=(i.left+(u&&l?l.offsetLeft:0))/r,d=(i.top+(u&&l?l.offsetTop:0))/s,m=i.width/r,y=i.height/s;return{width:m,height:y,top:d,right:h+m,bottom:d+y,left:h,x:h,y:d}}function Xf(e){var t=vs(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function fb(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&qf(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ki(e){return _n(e).getComputedStyle(e)}function qC(e){return["table","td","th"].indexOf(si(e))>=0}function Gi(e){return((Rr(e)?e.ownerDocument:e.document)||window.document).documentElement}function Mc(e){return si(e)==="html"?e:e.assignedSlot||e.parentNode||(qf(e)?e.host:null)||Gi(e)}function kg(e){return!Rn(e)||ki(e).position==="fixed"?null:e.offsetParent}function XC(e){var t=/firefox/i.test(ff()),n=/Trident/i.test(ff());if(n&&Rn(e)){var i=ki(e);if(i.position==="fixed")return null}var r=Mc(e);for(qf(r)&&(r=r.host);Rn(r)&&["html","body"].indexOf(si(r))<0;){var s=ki(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function sa(e){for(var t=_n(e),n=kg(e);n&&qC(n)&&ki(n).position==="static";)n=kg(n);return n&&(si(n)==="html"||si(n)==="body"&&ki(n).position==="static")?t:n||XC(e)||t}function Yf(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Do(e,t,n){return Ar(e,uc(t,n))}function YC(e,t,n){var i=Do(e,t,n);return i>n?n:i}function db(){return{top:0,right:0,bottom:0,left:0}}function pb(e){return Object.assign({},db(),e)}function gb(e,t){return t.reduce(function(n,i){return n[i]=e,n},{})}var KC=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,pb(typeof t!="number"?t:gb(t,ra))};function GC(e){var t,n=e.state,i=e.name,r=e.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=ii(n.placement),u=Yf(l),h=[hn,Ln].indexOf(l)>=0,d=h?"height":"width";if(!(!s||!a)){var m=KC(r.padding,n),y=Xf(s),x=u==="y"?un:hn,S=u==="y"?Dn:Ln,C=n.rects.reference[d]+n.rects.reference[u]-a[u]-n.rects.popper[d],T=a[u]-n.rects.reference[u],A=sa(s),M=A?u==="y"?A.clientHeight||0:A.clientWidth||0:0,B=C/2-T/2,D=m[x],R=M-y[d]-m[S],N=M/2-y[d]/2+B,I=Do(D,N,R),j=u;n.modifiersData[i]=(t={},t[j]=I,t.centerOffset=I-N,t)}}function JC(e){var t=e.state,n=e.options,i=n.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||fb(t.elements.popper,r)&&(t.elements.arrow=r))}const ZC={name:"arrow",enabled:!0,phase:"main",fn:GC,effect:JC,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bs(e){return e.split("-")[1]}var QC={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tO(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:ms(n*r)/r||0,y:ms(i*r)/r||0}}function Ag(e){var t,n=e.popper,i=e.popperRect,r=e.placement,s=e.variation,a=e.offsets,l=e.position,u=e.gpuAcceleration,h=e.adaptive,d=e.roundOffsets,m=e.isFixed,y=a.x,x=y===void 0?0:y,S=a.y,C=S===void 0?0:S,T=typeof d=="function"?d({x,y:C}):{x,y:C};x=T.x,C=T.y;var A=a.hasOwnProperty("x"),M=a.hasOwnProperty("y"),B=hn,D=un,R=window;if(h){var N=sa(n),I="clientHeight",j="clientWidth";if(N===_n(n)&&(N=Gi(n),ki(N).position!=="static"&&l==="absolute"&&(I="scrollHeight",j="scrollWidth")),N=N,r===un||(r===hn||r===Ln)&&s===Wo){D=Dn;var q=m&&N===R&&R.visualViewport?R.visualViewport.height:N[I];C-=q-i.height,C*=u?1:-1}if(r===hn||(r===un||r===Dn)&&s===Wo){B=Ln;var F=m&&N===R&&R.visualViewport?R.visualViewport.width:N[j];x-=F-i.width,x*=u?1:-1}}var H=Object.assign({position:l},h&&QC),U=d===!0?tO({x,y:C},_n(n)):{x,y:C};if(x=U.x,C=U.y,u){var V;return Object.assign({},H,(V={},V[D]=M?"0":"",V[B]=A?"0":"",V.transform=(R.devicePixelRatio||1)<=1?"translate("+x+"px, "+C+"px)":"translate3d("+x+"px, "+C+"px, 0)",V))}return Object.assign({},H,(t={},t[D]=M?C+"px":"",t[B]=A?x+"px":"",t.transform="",t))}function eO(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=i===void 0?!0:i,s=n.adaptive,a=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,h={placement:ii(t.placement),variation:bs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ag(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ag(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const nO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:eO,data:{}};var kl={passive:!0};function iO(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,s=r===void 0?!0:r,a=i.resize,l=a===void 0?!0:a,u=_n(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&h.forEach(function(d){d.addEventListener("scroll",n.update,kl)}),l&&u.addEventListener("resize",n.update,kl),function(){s&&h.forEach(function(d){d.removeEventListener("scroll",n.update,kl)}),l&&u.removeEventListener("resize",n.update,kl)}}const rO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:iO,data:{}};var sO={left:"right",right:"left",bottom:"top",top:"bottom"};function Jl(e){return e.replace(/left|right|bottom|top/g,function(t){return sO[t]})}var oO={start:"end",end:"start"};function Eg(e){return e.replace(/start|end/g,function(t){return oO[t]})}function Kf(e){var t=_n(e),n=t.pageXOffset,i=t.pageYOffset;return{scrollLeft:n,scrollTop:i}}function Gf(e){return vs(Gi(e)).left+Kf(e).scrollLeft}function aO(e,t){var n=_n(e),i=Gi(e),r=n.visualViewport,s=i.clientWidth,a=i.clientHeight,l=0,u=0;if(r){s=r.width,a=r.height;var h=hb();(h||!h&&t==="fixed")&&(l=r.offsetLeft,u=r.offsetTop)}return{width:s,height:a,x:l+Gf(e),y:u}}function lO(e){var t,n=Gi(e),i=Kf(e),r=(t=e.ownerDocument)==null?void 0:t.body,s=Ar(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ar(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+Gf(e),u=-i.scrollTop;return ki(r||n).direction==="rtl"&&(l+=Ar(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:a,x:l,y:u}}function Jf(e){var t=ki(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function mb(e){return["html","body","#document"].indexOf(si(e))>=0?e.ownerDocument.body:Rn(e)&&Jf(e)?e:mb(Mc(e))}function Lo(e,t){var n;t===void 0&&(t=[]);var i=mb(e),r=i===((n=e.ownerDocument)==null?void 0:n.body),s=_n(i),a=r?[s].concat(s.visualViewport||[],Jf(i)?i:[]):i,l=t.concat(a);return r?l:l.concat(Lo(Mc(a)))}function df(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cO(e,t){var n=vs(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Pg(e,t,n){return t===cb?df(aO(e,n)):Rr(t)?cO(t,n):df(lO(Gi(e)))}function uO(e){var t=Lo(Mc(e)),n=["absolute","fixed"].indexOf(ki(e).position)>=0,i=n&&Rn(e)?sa(e):e;return Rr(i)?t.filter(function(r){return Rr(r)&&fb(r,i)&&si(r)!=="body"}):[]}function hO(e,t,n,i){var r=t==="clippingParents"?uO(e):[].concat(t),s=[].concat(r,[n]),a=s[0],l=s.reduce(function(u,h){var d=Pg(e,h,i);return u.top=Ar(d.top,u.top),u.right=uc(d.right,u.right),u.bottom=uc(d.bottom,u.bottom),u.left=Ar(d.left,u.left),u},Pg(e,a,i));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function vb(e){var t=e.reference,n=e.element,i=e.placement,r=i?ii(i):null,s=i?bs(i):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(r){case un:u={x:a,y:t.y-n.height};break;case Dn:u={x:a,y:t.y+t.height};break;case Ln:u={x:t.x+t.width,y:l};break;case hn:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var h=r?Yf(r):null;if(h!=null){var d=h==="y"?"height":"width";switch(s){case gs:u[h]=u[h]-(t[d]/2-n[d]/2);break;case Wo:u[h]=u[h]+(t[d]/2-n[d]/2);break}}return u}function jo(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=i===void 0?e.placement:i,s=n.strategy,a=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?MC:l,h=n.rootBoundary,d=h===void 0?cb:h,m=n.elementContext,y=m===void 0?po:m,x=n.altBoundary,S=x===void 0?!1:x,C=n.padding,T=C===void 0?0:C,A=pb(typeof T!="number"?T:gb(T,ra)),M=y===po?RC:po,B=e.rects.popper,D=e.elements[S?M:y],R=hO(Rr(D)?D:D.contextElement||Gi(e.elements.popper),u,d,a),N=vs(e.elements.reference),I=vb({reference:N,element:B,placement:r}),j=df(Object.assign({},B,I)),q=y===po?j:N,F={top:R.top-q.top+A.top,bottom:q.bottom-R.bottom+A.bottom,left:R.left-q.left+A.left,right:q.right-R.right+A.right},H=e.modifiersData.offset;if(y===po&&H){var U=H[r];Object.keys(F).forEach(function(V){var st=[Ln,Dn].indexOf(V)>=0?1:-1,tt=[un,Dn].indexOf(V)>=0?"y":"x";F[V]+=U[tt]*st})}return F}function fO(e,t){t===void 0&&(t={});var n=t,i=n.placement,r=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,h=u===void 0?ub:u,d=bs(i),m=d?l?Og:Og.filter(function(S){return bs(S)===d}):ra,y=m.filter(function(S){return h.indexOf(S)>=0});y.length===0&&(y=m);var x=y.reduce(function(S,C){return S[C]=jo(e,{placement:C,boundary:r,rootBoundary:s,padding:a})[ii(C)],S},{});return Object.keys(x).sort(function(S,C){return x[S]-x[C]})}function dO(e){if(ii(e)===Vf)return[];var t=Jl(e);return[Eg(e),t,Eg(t)]}function pO(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,s=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!0:a,u=n.fallbackPlacements,h=n.padding,d=n.boundary,m=n.rootBoundary,y=n.altBoundary,x=n.flipVariations,S=x===void 0?!0:x,C=n.allowedAutoPlacements,T=t.options.placement,A=ii(T),M=A===T,B=u||(M||!S?[Jl(T)]:dO(T)),D=[T].concat(B).reduce(function(xt,Ct){return xt.concat(ii(Ct)===Vf?fO(t,{placement:Ct,boundary:d,rootBoundary:m,padding:h,flipVariations:S,allowedAutoPlacements:C}):Ct)},[]),R=t.rects.reference,N=t.rects.popper,I=new Map,j=!0,q=D[0],F=0;F=0,tt=st?"width":"height",it=jo(t,{placement:H,boundary:d,rootBoundary:m,altBoundary:y,padding:h}),K=st?V?Ln:hn:V?Dn:un;R[tt]>N[tt]&&(K=Jl(K));var ct=Jl(K),dt=[];if(s&&dt.push(it[U]<=0),l&&dt.push(it[K]<=0,it[ct]<=0),dt.every(function(xt){return xt})){q=H,j=!1;break}I.set(H,dt)}if(j)for(var _t=S?3:1,wt=function(Ct){var Nt=D.find(function(be){var Ot=I.get(be);if(Ot)return Ot.slice(0,Ct).every(function(St){return St})});if(Nt)return q=Nt,"break"},vt=_t;vt>0;vt--){var Ft=wt(vt);if(Ft==="break")break}t.placement!==q&&(t.modifiersData[i]._skip=!0,t.placement=q,t.reset=!0)}}const gO={name:"flip",enabled:!0,phase:"main",fn:pO,requiresIfExists:["offset"],data:{_skip:!1}};function Mg(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Rg(e){return[un,Ln,Dn,hn].some(function(t){return e[t]>=0})}function mO(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=jo(t,{elementContext:"reference"}),l=jo(t,{altBoundary:!0}),u=Mg(a,i),h=Mg(l,r,s),d=Rg(u),m=Rg(h);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:h,isReferenceHidden:d,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":m})}const vO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:mO};function bO(e,t,n){var i=ii(e),r=[hn,un].indexOf(i)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=s[0],l=s[1];return a=a||0,l=(l||0)*r,[hn,Ln].indexOf(i)>=0?{x:l,y:a}:{x:a,y:l}}function yO(e){var t=e.state,n=e.options,i=e.name,r=n.offset,s=r===void 0?[0,0]:r,a=ub.reduce(function(d,m){return d[m]=bO(m,t.rects,s),d},{}),l=a[t.placement],u=l.x,h=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=h),t.modifiersData[i]=a}const _O={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:yO};function wO(e){var t=e.state,n=e.name;t.modifiersData[n]=vb({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const xO={name:"popperOffsets",enabled:!0,phase:"read",fn:wO,data:{}};function SO(e){return e==="x"?"y":"x"}function TO(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!1:a,u=n.boundary,h=n.rootBoundary,d=n.altBoundary,m=n.padding,y=n.tether,x=y===void 0?!0:y,S=n.tetherOffset,C=S===void 0?0:S,T=jo(t,{boundary:u,rootBoundary:h,padding:m,altBoundary:d}),A=ii(t.placement),M=bs(t.placement),B=!M,D=Yf(A),R=SO(D),N=t.modifiersData.popperOffsets,I=t.rects.reference,j=t.rects.popper,q=typeof C=="function"?C(Object.assign({},t.rects,{placement:t.placement})):C,F=typeof q=="number"?{mainAxis:q,altAxis:q}:Object.assign({mainAxis:0,altAxis:0},q),H=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(N){if(s){var V,st=D==="y"?un:hn,tt=D==="y"?Dn:Ln,it=D==="y"?"height":"width",K=N[D],ct=K+T[st],dt=K-T[tt],_t=x?-j[it]/2:0,wt=M===gs?I[it]:j[it],vt=M===gs?-j[it]:-I[it],Ft=t.elements.arrow,xt=x&&Ft?Xf(Ft):{width:0,height:0},Ct=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:db(),Nt=Ct[st],be=Ct[tt],Ot=Do(0,I[it],xt[it]),St=B?I[it]/2-_t-Ot-Nt-F.mainAxis:wt-Ot-Nt-F.mainAxis,In=B?-I[it]/2+_t+Ot+be+F.mainAxis:vt+Ot+be+F.mainAxis,De=t.elements.arrow&&sa(t.elements.arrow),te=De?D==="y"?De.clientTop||0:De.clientLeft||0:0,Le=(V=H==null?void 0:H[D])!=null?V:0,re=K+St-Le-te,oe=K+In-Le,we=Do(x?uc(ct,re):ct,K,x?Ar(dt,oe):dt);N[D]=we,U[D]=we-K}if(l){var ye,Ve=D==="x"?un:hn,wn=D==="x"?Dn:Ln,he=N[R],Xt=R==="y"?"height":"width",xe=he+T[Ve],Ae=he-T[wn],xn=[un,hn].indexOf(A)!==-1,Yt=(ye=H==null?void 0:H[R])!=null?ye:0,Se=xn?xe:he-I[Xt]-j[Xt]-Yt+F.altAxis,fe=xn?he+I[Xt]+j[Xt]-Yt-F.altAxis:Ae,Z=x&&xn?YC(Se,he,fe):Do(x?Se:xe,he,x?fe:Ae);N[R]=Z,U[R]=Z-he}t.modifiersData[i]=U}}const CO={name:"preventOverflow",enabled:!0,phase:"main",fn:TO,requiresIfExists:["offset"]};function OO(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function kO(e){return e===_n(e)||!Rn(e)?Kf(e):OO(e)}function AO(e){var t=e.getBoundingClientRect(),n=ms(t.width)/e.offsetWidth||1,i=ms(t.height)/e.offsetHeight||1;return n!==1||i!==1}function EO(e,t,n){n===void 0&&(n=!1);var i=Rn(t),r=Rn(t)&&AO(t),s=Gi(t),a=vs(e,r,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!n)&&((si(t)!=="body"||Jf(s))&&(l=kO(t)),Rn(t)?(u=vs(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=Gf(s))),{x:a.left+l.scrollLeft-u.x,y:a.top+l.scrollTop-u.y,width:a.width,height:a.height}}function PO(e){var t=new Map,n=new Set,i=[];e.forEach(function(s){t.set(s.name,s)});function r(s){n.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&r(u)}}),i.push(s)}return e.forEach(function(s){n.has(s.name)||r(s)}),i}function MO(e){var t=PO(e);return jC.reduce(function(n,i){return n.concat(t.filter(function(r){return r.phase===i}))},[])}function RO(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function DO(e){var t=e.reduce(function(n,i){var r=n[i.name];return n[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,n},{});return Object.keys(t).map(function(n){return t[n]})}var Dg={placement:"bottom",modifiers:[],strategy:"absolute"};function Lg(){for(var e=arguments.length,t=new Array(e),n=0;nsummary:first-of-type","details"],hc=bb.join(","),yb=typeof Element>"u",Dr=yb?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,pf=!yb&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},_b=function(t,n,i){var r=Array.prototype.slice.apply(t.querySelectorAll(hc));return n&&Dr.call(t,hc)&&r.unshift(t),r=r.filter(i),r},wb=function e(t,n,i){for(var r=[],s=Array.from(t);s.length;){var a=s.shift();if(a.tagName==="SLOT"){var l=a.assignedElements(),u=l.length?l:a.children,h=e(u,!0,i);i.flatten?r.push.apply(r,h):r.push({scope:a,candidates:h})}else{var d=Dr.call(a,hc);d&&i.filter(a)&&(n||!t.includes(a))&&r.push(a);var m=a.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(a),y=!i.shadowRootFilter||i.shadowRootFilter(a);if(m&&y){var x=e(m===!0?a.children:m.children,!0,i);i.flatten?r.push.apply(r,x):r.push({scope:a,candidates:x})}else s.unshift.apply(s,a.children)}}return r},xb=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},FO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sb=function(t){return t.tagName==="INPUT"},BO=function(t){return Sb(t)&&t.type==="hidden"},HO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(i){return i.tagName==="SUMMARY"});return n},zO=function(t,n){for(var i=0;isummary:first-of-type"),a=s?t.parentElement:t;if(Dr.call(a,"details:not([open]) *"))return!0;var l=pf(t).host,u=(l==null?void 0:l.ownerDocument.contains(l))||t.ownerDocument.contains(t);if(!i||i==="full"){if(typeof r=="function"){for(var h=t;t;){var d=t.parentElement,m=pf(t);if(d&&!d.shadowRoot&&r(d)===!0)return Ig(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=h}if(u)return!t.getClientRects().length}else if(i==="non-zero-area")return Ig(t);return!1},VO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var i=0;i=0)},XO=function e(t){var n=[],i=[];return t.forEach(function(r,s){var a=!!r.scope,l=a?r.scope:r,u=xb(l,a),h=a?e(r.candidates):l;u===0?a?n.push.apply(n,h):n.push(l):i.push({documentOrder:s,tabIndex:u,item:r,isScope:a,content:h})}),i.sort(FO).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},YO=function(t,n){n=n||{};var i;return n.getShadowRoot?i=wb([t],n.includeContainer,{filter:gf.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:qO}):i=_b(t,n.includeContainer,gf.bind(null,n)),XO(i)},Tb=function(t,n){n=n||{};var i;return n.getShadowRoot?i=wb([t],n.includeContainer,{filter:fc.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):i=_b(t,n.includeContainer,fc.bind(null,n)),i},Al=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Dr.call(t,hc)===!1?!1:gf(n,t)},KO=bb.concat("iframe").join(","),Zl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Dr.call(t,KO)===!1?!1:fc(n,t)};function Ng(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Fg(e){for(var t=1;t0){var i=e[e.length-1];i!==n&&i.pause()}var r=e.indexOf(n);r===-1||e.splice(r,1),e.push(n)},deactivateTrap:function(n){var i=e.indexOf(n);i!==-1&&e.splice(i,1),e.length>0&&e[e.length-1].unpause()}}}(),JO=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},ZO=function(t){return t.key==="Escape"||t.key==="Esc"||t.keyCode===27},QO=function(t){return t.key==="Tab"||t.keyCode===9},Hg=function(t){return setTimeout(t,0)},zg=function(t,n){var i=-1;return t.every(function(r,s){return n(r)?(i=s,!1):!0}),i},go=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1?j-1:0),F=1;F=0)N=i.activeElement;else{var I=s.tabbableGroups[0],j=I&&I.firstTabbableNode;N=j||h("fallbackFocus")}if(!N)throw new Error("Your focus-trap needs to have at least one focusable element");return N},m=function(){if(s.containerGroups=s.containers.map(function(N){var I=YO(N,r.tabbableOptions),j=Tb(N,r.tabbableOptions);return{container:N,tabbableNodes:I,focusableNodes:j,firstTabbableNode:I.length>0?I[0]:null,lastTabbableNode:I.length>0?I[I.length-1]:null,nextTabbableNode:function(F){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,U=j.findIndex(function(V){return V===F});if(!(U<0))return H?j.slice(U+1).find(function(V){return Al(V,r.tabbableOptions)}):j.slice(0,U).reverse().find(function(V){return Al(V,r.tabbableOptions)})}}}),s.tabbableGroups=s.containerGroups.filter(function(N){return N.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},y=function R(N){if(N!==!1&&N!==i.activeElement){if(!N||!N.focus){R(d());return}N.focus({preventScroll:!!r.preventScroll}),s.mostRecentlyFocusedNode=N,JO(N)&&N.select()}},x=function(N){var I=h("setReturnFocus",N);return I||(I===!1?!1:N)},S=function(N){var I=El(N);if(!(u(I)>=0)){if(go(r.clickOutsideDeactivates,N)){a.deactivate({returnFocus:r.returnFocusOnDeactivate&&!Zl(I,r.tabbableOptions)});return}go(r.allowOutsideClick,N)||N.preventDefault()}},C=function(N){var I=El(N),j=u(I)>=0;j||I instanceof Document?j&&(s.mostRecentlyFocusedNode=I):(N.stopImmediatePropagation(),y(s.mostRecentlyFocusedNode||d()))},T=function(N){var I=El(N);m();var j=null;if(s.tabbableGroups.length>0){var q=u(I),F=q>=0?s.containerGroups[q]:void 0;if(q<0)N.shiftKey?j=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:j=s.tabbableGroups[0].firstTabbableNode;else if(N.shiftKey){var H=zg(s.tabbableGroups,function(K){var ct=K.firstTabbableNode;return I===ct});if(H<0&&(F.container===I||Zl(I,r.tabbableOptions)&&!Al(I,r.tabbableOptions)&&!F.nextTabbableNode(I,!1))&&(H=q),H>=0){var U=H===0?s.tabbableGroups.length-1:H-1,V=s.tabbableGroups[U];j=V.lastTabbableNode}}else{var st=zg(s.tabbableGroups,function(K){var ct=K.lastTabbableNode;return I===ct});if(st<0&&(F.container===I||Zl(I,r.tabbableOptions)&&!Al(I,r.tabbableOptions)&&!F.nextTabbableNode(I))&&(st=q),st>=0){var tt=st===s.tabbableGroups.length-1?0:st+1,it=s.tabbableGroups[tt];j=it.firstTabbableNode}}}else j=h("fallbackFocus");j&&(N.preventDefault(),y(j))},A=function(N){if(ZO(N)&&go(r.escapeDeactivates,N)!==!1){N.preventDefault(),a.deactivate();return}if(QO(N)){T(N);return}},M=function(N){var I=El(N);u(I)>=0||go(r.clickOutsideDeactivates,N)||go(r.allowOutsideClick,N)||(N.preventDefault(),N.stopImmediatePropagation())},B=function(){if(s.active)return Bg.activateTrap(a),s.delayInitialFocusTimer=r.delayInitialFocus?Hg(function(){y(d())}):y(d()),i.addEventListener("focusin",C,!0),i.addEventListener("mousedown",S,{capture:!0,passive:!1}),i.addEventListener("touchstart",S,{capture:!0,passive:!1}),i.addEventListener("click",M,{capture:!0,passive:!1}),i.addEventListener("keydown",A,{capture:!0,passive:!1}),a},D=function(){if(s.active)return i.removeEventListener("focusin",C,!0),i.removeEventListener("mousedown",S,!0),i.removeEventListener("touchstart",S,!0),i.removeEventListener("click",M,!0),i.removeEventListener("keydown",A,!0),a};return a={get active(){return s.active},get paused(){return s.paused},activate:function(N){if(s.active)return this;var I=l(N,"onActivate"),j=l(N,"onPostActivate"),q=l(N,"checkCanFocusTrap");q||m(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=i.activeElement,I&&I();var F=function(){q&&m(),B(),j&&j()};return q?(q(s.containers.concat()).then(F,F),this):(F(),this)},deactivate:function(N){if(!s.active)return this;var I=Fg({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},N);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,D(),s.active=!1,s.paused=!1,Bg.deactivateTrap(a);var j=l(I,"onDeactivate"),q=l(I,"onPostDeactivate"),F=l(I,"checkCanReturnFocus"),H=l(I,"returnFocus","returnFocusOnDeactivate");j&&j();var U=function(){Hg(function(){H&&y(x(s.nodeFocusedBeforeActivation)),q&&q()})};return H&&F?(F(x(s.nodeFocusedBeforeActivation)).then(U,U),this):(U(),this)},pause:function(){return s.paused||!s.active?this:(s.paused=!0,D(),this)},unpause:function(){return!s.paused||!s.active?this:(s.paused=!1,m(),B(),this)},updateContainerElements:function(N){var I=[].concat(N).filter(Boolean);return s.containers=I.map(function(j){return typeof j=="string"?i.querySelector(j):j}),s.active&&m(),this}},a.updateContainerElements(t),a};function ek(e){let t,n;window.addEventListener("focusin",()=>{t=n,n=document.activeElement}),e.magic("focus",i=>{let r=i;return{__noscroll:!1,__wrapAround:!1,within(s){return r=s,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(s){return Zl(s)},previouslyFocused(){return t},lastFocused(){return t},focused(){return n},focusables(){return Array.isArray(r)?r:Tb(r,{displayCheck:"none"})},all(){return this.focusables()},isFirst(s){let a=this.all();return a[0]&&a[0].isSameNode(s)},isLast(s){let a=this.all();return a.length&&a.slice(-1)[0].isSameNode(s)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let s=this.all(),a=document.activeElement;if(s.indexOf(a)!==-1)return this.__wrapAround&&s.indexOf(a)===s.length-1?s[0]:s[s.indexOf(a)+1]},getPrevious(){let s=this.all(),a=document.activeElement;if(s.indexOf(a)!==-1)return this.__wrapAround&&s.indexOf(a)===0?s.slice(-1)[0]:s[s.indexOf(a)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(s){s&&setTimeout(()=>{s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.focus({preventScroll:this.__noscroll})})}}}),e.directive("trap",e.skipDuringClone((i,{expression:r,modifiers:s},{effect:a,evaluateLater:l,cleanup:u})=>{let h=l(r),d=!1,m={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>i};if(s.includes("noautofocus"))m.initialFocus=!1;else{let T=i.querySelector("[autofocus]");T&&(m.initialFocus=T)}let y=tk(i,m),x=()=>{},S=()=>{};const C=()=>{x(),x=()=>{},S(),S=()=>{},y.deactivate({returnFocus:!s.includes("noreturn")})};a(()=>h(T=>{d!==T&&(T&&!d&&(s.includes("noscroll")&&(S=nk()),s.includes("inert")&&(x=Wg(i)),setTimeout(()=>{y.activate()},15)),!T&&d&&C(),d=!!T)})),u(C)},(i,{expression:r,modifiers:s},{evaluate:a})=>{s.includes("inert")&&a(r)&&Wg(i)}))}function Wg(e){let t=[];return Cb(e,n=>{let i=n.hasAttribute("aria-hidden");n.setAttribute("aria-hidden","true"),t.push(()=>i||n.removeAttribute("aria-hidden"))}),()=>{for(;t.length;)t.pop()()}}function Cb(e,t){e.isSameNode(document.body)||!e.parentNode||Array.from(e.parentNode.children).forEach(n=>{n.isSameNode(e)?Cb(e.parentNode,t):t(n)})}function nk(){let e=document.documentElement.style.overflow,t=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${n}px`,()=>{document.documentElement.style.overflow=e,document.documentElement.style.paddingRight=t}}var ik=ek;/*! Bundled license information: tabbable/dist/index.esm.js: (*! * tabbable 5.3.3 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE *) focus-trap/dist/focus-trap.esm.js: (*! * focus-trap 6.9.4 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE *) */var jg="​";function Lh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n/g,">").replace(/"/g,""").replace(/`|'/g,"'"):e}function Wn(e){var t=Object.prototype.toString.call(e).split(" ")[1].slice(0,-1);return e===Object(e)&&t!="Array"&&t!="Function"&&t!="RegExp"&&t!="HTMLUnknownElement"}function Oe(e,t,n){var i,r;function s(a,l){for(var u in l)if(l.hasOwnProperty(u)){if(Wn(l[u])){Wn(a[u])?s(a[u],l[u]):a[u]=Object.assign({},l[u]);continue}if(Array.isArray(l[u])){a[u]=Object.assign([],l[u]);continue}a[u]=l[u]}}return i=e,((r=Object)!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?r[Symbol.hasInstance](i):i instanceof r)||(e={}),s(e,t),n&&s(e,n),e}function qg(){var e=[],t={},n=!0,i=!1,r=void 0;try{for(var s,a=arguments[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var l=s.value,u=!0,h=!1,d=void 0;try{for(var m,y=l[Symbol.iterator]();!(u=(m=y.next()).done);u=!0){var x=m.value;Wn(x)?t[x.value]||(e.push(x),t[x.value]=1):e.includes(x)||e.push(x)}}catch(S){h=!0,d=S}finally{try{u||y.return==null||y.return()}finally{if(h)throw d}}}}catch(S){i=!0,r=S}finally{try{n||a.return==null||a.return()}finally{if(i)throw r}}return e}function Pl(e){return String.prototype.normalize?typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):void 0:e}var Xg=function(){return/(?=.*chrome)(?=.*android)/i.test(navigator.userAgent)};function Yg(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)})}function Tr(e){var t,n=Ob.call(this,e),i=e==null||(t=e.classList)===null||t===void 0?void 0:t.contains(this.settings.classNames.tag);return n&&i}function Kg(e){return Ob.call(this,e)&&(e==null?void 0:e.closest(this.settings.classNames.tagSelector))}function Ob(e){var t;return(e==null||(t=e.closest)===null||t===void 0?void 0:t.call(e,this.settings.classNames.namespaceSelector))===this.DOM.scope}function kb(e,t){var n=window.getSelection();return t=t||n.getRangeAt(0),typeof e=="string"&&(e=document.createTextNode(e)),t&&(t.deleteContents(),t.insertNode(e)),e}function Zt(e,t,n){return e?(t&&(e.__tagifyTagData=n?t:Oe({},e.__tagifyTagData||{},t)),e.__tagifyTagData):(qi.warn("tag element doesn't exist",{tagElm:e,data:t}),t)}function Wi(e){if(e&&e.parentNode){var t=e,n=window.getSelection(),i=n.getRangeAt(0);n.rangeCount&&(i.setStartAfter(t),i.collapse(!0),n.removeAllRanges(),n.addRange(i))}}function Ab(e,t){e.forEach(function(n){if(Zt(n.previousSibling)||!n.previousSibling){var i=document.createTextNode("​");n.before(i),t&&Wi(i)}})}var Nh={delimiters:",",pattern:null,tagTextProp:"value",maxTags:1/0,callbacks:{},addTagOnBlur:!0,addTagOn:["blur","tab","enter"],onChangeAfterBlur:!0,duplicates:!1,whitelist:[],blacklist:[],enforceWhitelist:!1,userInput:!0,focusable:!0,focusInputOnRemove:!0,keepInvalidTags:!1,createInvalidTags:!0,mixTagsAllowedAfter:/,|\.|\:|\s/,mixTagsInterpolator:["[[","]]"],backspace:!0,skipInvalid:!1,pasteAsTags:!0,editTags:{clicks:2,keepInvalid:!0},transformTag:function(){},trim:!0,a11y:{focusableTags:!1},mixMode:{insertAfterTag:" "},autoComplete:{enabled:!0,rightKey:!1,tabKey:!1},classNames:{namespace:"tagify",mixMode:"tagify--mix",selectMode:"tagify--select",input:"tagify__input",focus:"tagify--focus",tagNoAnimation:"tagify--noAnim",tagInvalid:"tagify--invalid",tagNotAllowed:"tagify--notAllowed",scopeLoading:"tagify--loading",hasMaxTags:"tagify--hasMaxTags",hasNoTags:"tagify--noTags",empty:"tagify--empty",inputInvalid:"tagify__input--invalid",dropdown:"tagify__dropdown",dropdownWrapper:"tagify__dropdown__wrapper",dropdownHeader:"tagify__dropdown__header",dropdownFooter:"tagify__dropdown__footer",dropdownItem:"tagify__dropdown__item",dropdownItemActive:"tagify__dropdown__item--active",dropdownItemHidden:"tagify__dropdown__item--hidden",dropdownItemSelected:"tagify__dropdown__item--selected",dropdownInital:"tagify__dropdown--initial",tag:"tagify__tag",tagText:"tagify__tag-text",tagX:"tagify__tag__removeBtn",tagLoading:"tagify__tag--loading",tagEditing:"tagify__tag--editable",tagFlash:"tagify__tag--flash",tagHide:"tagify__tag--hide"},dropdown:{classname:"",enabled:2,maxItems:10,searchKeys:["value","searchBy"],fuzzySearch:!0,caseSensitive:!1,accentedSearch:!0,includeSelectedTags:!1,escapeHTML:!0,highlightFirst:!0,closeOnSelect:!0,clearOnSelect:!0,position:"all",appendTarget:null},hooks:{beforeRemoveTag:function(){return Promise.resolve()},beforePaste:function(){return Promise.resolve()},suggestionClick:function(){return Promise.resolve()},beforeKeyDown:function(){return Promise.resolve()}}};function rk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sk(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&arguments[0]!==void 0)||arguments[0],t=this.dropdown.events.callbacks,n=this.listeners.dropdown=this.listeners.dropdown||{position:this.dropdown.position.bind(this,null),onKeyDown:t.onKeyDown.bind(this),onMouseOver:t.onMouseOver.bind(this),onMouseLeave:t.onMouseLeave.bind(this),onClick:t.onClick.bind(this),onScroll:t.onScroll.bind(this)},i=e?"addEventListener":"removeEventListener";this.settings.dropdown.position!="manual"&&(document[i]("scroll",n.position,!0),window[i]("resize",n.position),window[i]("keydown",n.onKeyDown)),this.DOM.dropdown[i]("mouseover",n.onMouseOver),this.DOM.dropdown[i]("mouseleave",n.onMouseLeave),this.DOM.dropdown[i]("mousedown",n.onClick),this.DOM.dropdown.content[i]("scroll",n.onScroll)},callbacks:{onKeyDown:function(e){var t=this;if(this.state.hasFocus&&!this.state.composing){var n=this.settings,i=n.dropdown.includeSelectedTags,r=this.DOM.dropdown.querySelector(n.classNames.dropdownItemActiveSelector),s=this.dropdown.getSuggestionDataByNode(r),a=n.mode=="mix",l=n.mode=="select";n.hooks.beforeKeyDown(e,{tagify:this}).then(function(u){switch(e.key){case"ArrowDown":case"ArrowUp":case"Down":case"Up":e.preventDefault();var h=t.dropdown.getAllSuggestionsRefs(),d=e.key=="ArrowUp"||e.key=="Up";r&&(r=t.dropdown.getNextOrPrevOption(r,!d)),r&&r.matches(n.classNames.dropdownItemSelector)||(r=h[d?h.length-1:0]),t.dropdown.highlightOption(r,!0);break;case"PageUp":case"PageDown":var m;e.preventDefault();var y=t.dropdown.getAllSuggestionsRefs(),x=Math.floor(t.DOM.dropdown.content.clientHeight/((m=y[0])===null||m===void 0?void 0:m.offsetHeight))||1,S=e.key==="PageUp";if(r){var C=y.indexOf(r),T=S?Math.max(0,C-x):Math.min(y.length-1,C+x);r=y[T]}else r=y[0];t.dropdown.highlightOption(r,!0);break;case"Home":case"End":e.preventDefault();var A=t.dropdown.getAllSuggestionsRefs();r=A[e.key==="Home"?0:A.length-1],t.dropdown.highlightOption(r,!0);break;case"Escape":case"Esc":t.dropdown.hide();break;case"ArrowRight":if(t.state.actions.ArrowLeft||n.autoComplete.rightKey)return;case"Tab":var M=!n.autoComplete.rightKey||!n.autoComplete.tabKey;if(!a&&!l&&r&&M&&!t.state.editing&&s){e.preventDefault();var B=t.dropdown.getMappedValue(s);return t.state.autoCompleteData=s,t.input.autocomplete.set.call(t,B),!1}return!0;case"Enter":e.preventDefault(),t.state.actions.selectOption=!0,setTimeout(function(){return t.state.actions.selectOption=!1},100),n.hooks.suggestionClick(e,{tagify:t,tagData:s,suggestionElm:r}).then(function(){if(r){var R=i?r:t.dropdown.getNextOrPrevOption(r,!d);t.dropdown.selectOption(r,e,function(){if(R){var N=R.getAttribute("value");R=t.dropdown.getSuggestionNodeByValue(N),t.dropdown.highlightOption(R)}})}else t.dropdown.hide(),a||t.addTags(t.state.inputText.trim(),!0)}).catch(function(R){return qi.warn(R)});break;case"Backspace":if(a||t.state.editing.scope)return;var D=t.input.raw.call(t);D!=""&&D.charCodeAt(0)!=8203||(n.backspace===!0?t.removeTags():n.backspace=="edit"&&setTimeout(t.editTag.bind(t),0))}})}},onMouseOver:function(e){var t=e.target.closest(this.settings.classNames.dropdownItemSelector);this.dropdown.highlightOption(t)},onMouseLeave:function(e){this.dropdown.highlightOption()},onClick:function(e){var t=this;if(e.button==0&&e.target!=this.DOM.dropdown&&e.target!=this.DOM.dropdown.content){var n=e.target.closest(this.settings.classNames.dropdownItemSelector),i=this.dropdown.getSuggestionDataByNode(n);this.state.actions.selectOption=!0,setTimeout(function(){return t.state.actions.selectOption=!1},100),this.settings.hooks.suggestionClick(e,{tagify:this,tagData:i,suggestionElm:n}).then(function(){n?t.dropdown.selectOption(n,e):t.dropdown.hide()}).catch(function(r){return qi.warn(r)})}},onScroll:function(e){var t=e.target,n=t.scrollTop/(t.scrollHeight-t.parentNode.clientHeight)*100;this.trigger("dropdown:scroll",{percentage:Math.round(n)})}}},refilter:function(e){e=e||this.state.dropdown.query||"",this.suggestedListItems=this.dropdown.filterListItems(e),this.dropdown.fill(),this.suggestedListItems.length||this.dropdown.hide(),this.trigger("dropdown:updated",this.DOM.dropdown)},getSuggestionDataByNode:function(e){for(var t,n=e&&e.getAttribute("value"),i=this.suggestedListItems.length;i--;){if(Wn(t=this.suggestedListItems[i])&&t.value==n)return t;if(t==n)return{value:t}}},getSuggestionNodeByValue:function(e){return this.dropdown.getAllSuggestionsRefs().find(function(t){return t.getAttribute("value")===e})},getNextOrPrevOption:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.dropdown.getAllSuggestionsRefs(),i=n.findIndex(function(r){return r===e});return t?n[i+1]:n[i-1]},highlightOption:function(e,t){var n,i=this.settings.classNames.dropdownItemActive;if(this.state.ddItemElm&&(this.state.ddItemElm.classList.remove(i),this.state.ddItemElm.removeAttribute("aria-selected")),!e)return this.state.ddItemData=null,this.state.ddItemElm=null,void this.input.autocomplete.suggest.call(this);n=this.dropdown.getSuggestionDataByNode(e),this.state.ddItemData=n,this.state.ddItemElm=e,e.classList.add(i),e.setAttribute("aria-selected",!0),t&&(e.parentNode.scrollTop=e.clientHeight+e.offsetTop-e.parentNode.clientHeight),this.settings.autoComplete&&(this.input.autocomplete.suggest.call(this,n),this.dropdown.position())},selectOption:function(e,t,n){var i=this,r=this.settings,s=r.dropdown.includeSelectedTags,a=r.dropdown,l=a.clearOnSelect,u=a.closeOnSelect;if(!e)return this.addTags(this.state.inputText,!0),void(u&&this.dropdown.hide());t=t||{};var h=e.getAttribute("value"),d=h=="noMatch",m=r.mode=="mix",y=this.suggestedListItems.find(function(S){var C;return((C=S.value)!==null&&C!==void 0?C:S)==h});if(this.trigger("dropdown:select",{data:y,elm:e,event:t}),y||d){if(this.state.editing){var x=this.normalizeTags([y])[0];y=r.transformTag.call(this,x)||x,this.onEditTagDone(null,Oe({__isValid:!0},y))}else this[m?"addMixTags":"addTags"]([y||this.input.raw.call(this)],l);(m||this.DOM.input.parentNode)&&(setTimeout(function(){i.DOM.input.focus(),i.toggleFocusClass(!0)}),u&&setTimeout(this.dropdown.hide.bind(this)),s?n&&n():(e.addEventListener("transitionend",function(){i.dropdown.fillHeaderFooter(),setTimeout(function(){e.remove(),i.dropdown.refilter(),n&&n()},100)},{once:!0}),e.classList.add(this.settings.classNames.dropdownItemHidden)))}else u&&setTimeout(this.dropdown.hide.bind(this))},selectAll:function(e){this.suggestedListItems.length=0,this.dropdown.hide(),this.dropdown.filterListItems("");var t=this.dropdown.filterListItems("");return e||(t=this.state.dropdown.suggestions),this.addTags(t,!0),this},filterListItems:function(e,t){var n,i,r,s,a,l,u=function(){var R,N,I=void 0,j=void 0;R=S[B],i=((N=Object)!=null&&typeof Symbol<"u"&&N[Symbol.hasInstance]?N[Symbol.hasInstance](R):R instanceof N)?S[B]:{value:S[B]};var q,F=Object.keys(i).some(function(H){return M.includes(H)})?M:["value"];m.fuzzySearch&&!t.exact?(s=F.reduce(function(H,U){return H+" "+(i[U]||"")},"").toLowerCase().trim(),m.accentedSearch&&(s=Pl(s),l=Pl(l)),I=s.indexOf(l)==0,j=s===l,q=s,r=l.toLowerCase().split(" ").every(function(H){return q.includes(H.toLowerCase())})):(I=!0,r=F.some(function(H){var U=""+(i[H]||"");return m.accentedSearch&&(U=Pl(U),l=Pl(l)),m.caseSensitive||(U=U.toLowerCase()),j=U===l,t.exact?U===l:U.indexOf(l)==0})),a=!m.includeSelectedTags&&n.isTagDuplicate(Wn(i)?i.value:i),r&&!a&&(j&&I?x.push(i):m.sortby=="startsWith"&&I?y.unshift(i):y.push(i))},h=this,d=this.settings,m=d.dropdown,y=(t=t||{},[]),x=[],S=d.whitelist,C=m.maxItems>=0?m.maxItems:1/0,T=m.includeSelectedTags,A=typeof m.sortby=="function",M=m.searchKeys,B=0;if(!(e=d.mode=="select"&&this.value.length&&this.value[0][d.tagTextProp]==e?"":e)||!M.length){y=T?S:S.filter(function(R){return!h.isTagDuplicate(Wn(R)?R.value:R)});var D=A?m.sortby(y,l):y.slice(0,C);return this.state.dropdown.suggestions=D,D}for(l=m.caseSensitive?""+e:(""+e).toLowerCase();B[\r\n ]+\<").split(/>\s+<").trim():""},fillHeaderFooter:function(){var e=this.dropdown.filterListItems(this.state.dropdown.query),t=this.parseTemplate("dropdownHeader",[e]),n=this.parseTemplate("dropdownFooter",[e]),i=this.dropdown.getHeaderRef(),r=this.dropdown.getFooterRef();t&&(i==null||i.parentNode.replaceChild(t,i)),n&&(r==null||r.parentNode.replaceChild(n,r))},position:function(e){var t=this.settings.dropdown,n=this.dropdown.getAppendTarget();if(t.position!="manual"&&n){var i,r,s,a,l,u,h,d,m,y,x=this.DOM.dropdown,S=t.RTL,C=n===document.body,T=n===this.DOM.scope,A=C?window.pageYOffset:n.scrollTop,M=document.fullscreenElement||document.webkitFullscreenElement||document.documentElement,B=M.clientHeight,D=Math.max(M.clientWidth||0,window.innerWidth||0),R=D>480?t.position:"all",N=this.DOM[R=="input"?"input":"scope"];if(e=e||x.clientHeight,this.state.dropdown.visible){if(R=="text"?(s=(i=function(){var q=document.getSelection();if(q.rangeCount){var F,H,U=q.getRangeAt(0),V=U.startContainer,st=U.startOffset;if(st>0)return(H=document.createRange()).setStart(V,st-1),H.setEnd(V,st),{left:(F=H.getBoundingClientRect()).right,top:F.top,bottom:F.bottom};if(V.getBoundingClientRect)return V.getBoundingClientRect()}return{left:-9999,top:-9999}}()).bottom,r=i.top,a=i.left,l="auto"):(u=function(q){var F=0,H=0;for(q=q.parentNode;q&&q!=M;)F+=q.offsetTop||0,H+=q.offsetLeft||0,q=q.parentNode;return{top:F,left:H}}(n),i=N.getBoundingClientRect(),r=T?-1:i.top-u.top,s=(T?i.height:i.bottom-u.top)-1,a=T?-1:i.left-u.left,l=i.width+"px"),!C){var I=function(){for(var q=0,F=t.appendTarget.parentNode;F;)q+=F.scrollTop||0,F=F.parentNode;return q}();r+=I,s+=I}var j;r=Math.floor(r),s=Math.ceil(s),d=D-a<120,m=((h=(j=t.placeAbove)!==null&&j!==void 0?j:B-i.bottom `).concat(this.settings.templates.input.call(this),` `).concat(jg,` `)},input:function(){var e=this.settings,t=e.placeholder||jg;return"')},tag:function(e,t){var n=t.settings;return'
').concat(e[n.tagTextProp]||e.value,`
`)},dropdown:function(e){var t=e.dropdown,n=t.position=="manual";return'
`)},dropdownContent:function(e){var t=this.settings.templates,n=this.state.dropdown.suggestions;return` `.concat(t.dropdownHeader.call(this,n),` `).concat(e,` `).concat(t.dropdownFooter.call(this,n),` `)},dropdownItem:function(e){return"
`).concat(e.mappedValue||e.value,"
")},dropdownHeader:function(e){return`
')},dropdownFooter:function(e){var t=e.length-this.settings.dropdown.maxItems;return t>0?`
`).concat(t,` more items. Refine your search.
`):""},dropdownItemNoMatch:null};function Gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&arguments[0]!==void 0)||arguments[0],n=this.settings,i=this.events.callbacks,r=t?"addEventListener":"removeEventListener";if(!(this.state.mainEvents&&t||n.disabled||n.readonly)){for(var s in this.state.mainEvents=t,t&&!this.listeners.main&&(this.events.bindGlobal.call(this),this.settings.isJQueryPlugin&&jQuery(this.DOM.originalInput).on("tagify.removeAllTags",this.removeAllTags.bind(this))),e=this.listeners.main=this.listeners.main||{keydown:["input",i.onKeydown.bind(this)],click:["scope",i.onClickScope.bind(this)],dblclick:n.mode!="select"&&["scope",i.onDoubleClickScope.bind(this)],paste:["input",i.onPaste.bind(this)],drop:["input",i.onDrop.bind(this)],compositionstart:["input",i.onCompositionStart.bind(this)],compositionend:["input",i.onCompositionEnd.bind(this)]})e[s]&&this.DOM[e[s][0]][r](s,e[s][1]);var a=this.listeners.main.inputMutationObserver||new MutationObserver(i.onInputDOMChange.bind(this));a.disconnect(),n.mode=="mix"&&a.observe(this.DOM.input,{childList:!0}),this.events.bindOriginaInputListener.call(this)}},bindOriginaInputListener:function(e){var t=(e||0)+500;this.listeners.main&&(clearInterval(this.listeners.main.originalInputValueObserverInterval),this.listeners.main.originalInputValueObserverInterval=setInterval(this.events.callbacks.observeOriginalInputValue.bind(this),t))},bindGlobal:function(e){var t,n=this.events.callbacks,i=e?"removeEventListener":"addEventListener";if(this.listeners&&(e||!this.listeners.global)){this.listeners.global=this.listeners.global||[{type:this.isIE?"keydown":"input",target:this.DOM.input,cb:n[this.isIE?"onInputIE":"onInput"].bind(this)},{type:"keydown",target:window,cb:n.onWindowKeyDown.bind(this)},{type:"focusin",target:this.DOM.scope,cb:n.onFocusBlur.bind(this)},{type:"focusout",target:this.DOM.scope,cb:n.onFocusBlur.bind(this)},{type:"click",target:document,cb:n.onClickAnywhere.bind(this),useCapture:!0}];var r=!0,s=!1,a=void 0;try{for(var l,u=this.listeners.global[Symbol.iterator]();!(r=(l=u.next()).done);r=!0)(t=l.value).target[i](t.type,t.cb,!!t.useCapture)}catch(h){s=!0,a=h}finally{try{r||u.return==null||u.return()}finally{if(s)throw a}}}},unbindGlobal:function(){this.events.bindGlobal.call(this,!0)},callbacks:{onFocusBlur:function(e){var t,n,i=this.settings,r=Kg.call(this,e.relatedTarget),s=Tr.call(this,e.target),a=e.target.classList.contains(i.classNames.tagX),l=e.type=="focusin",u=e.type=="focusout";a&&i.mode!="mix"&&i.focusInputOnRemove&&this.DOM.input.focus(),r&&l&&!s&&!a&&this.toggleFocusClass(this.state.hasFocus=+new Date);var h=e.target?this.trim(this.DOM.input.textContent):"",d=(n=this.value)===null||n===void 0||(t=n[0])===null||t===void 0?void 0:t[i.tagTextProp],m=i.dropdown.enabled>=0,y={relatedTarget:e.relatedTarget},x=this.state.actions.selectOption&&(m||!i.dropdown.closeOnSelect),S=this.state.actions.addNew&&m;if(u){if(e.relatedTarget===this.DOM.scope)return this.dropdown.hide(),void this.DOM.input.focus();this.postUpdate(),i.onChangeAfterBlur&&this.triggerChangeEvent()}if(!(x||S||a))if(this.state.hasFocus=!(!l&&!r)&&+new Date,this.toggleFocusClass(this.state.hasFocus),i.mode!="mix"){if(l){if(!i.focusable)return;var C=i.dropdown.enabled===0&&!this.state.dropdown.visible,T=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector);return this.trigger("focus",y),void(C&&!s&&(this.dropdown.show(this.value.length?"":void 0),i.mode==="select"&&this.setRangeAtStartEnd(!1,T)))}if(u){if(this.trigger("blur",y),this.loading(!1),i.mode=="select"){if(this.value.length){var A=this.getTagElms()[0];h=this.trim(A.textContent)}d===h&&(h="")}h&&!this.state.actions.selectOption&&i.addTagOnBlur&&i.addTagOn.includes("blur")&&this.addTags(h,!0)}r||(this.DOM.input.removeAttribute("style"),this.dropdown.hide())}else l?this.trigger("focus",y):u&&(this.trigger("blur",y),this.loading(!1),this.dropdown.hide(),this.state.dropdown.visible=void 0,this.setStateSelection())},onCompositionStart:function(e){this.state.composing=!0},onCompositionEnd:function(e){this.state.composing=!1},onWindowKeyDown:function(e){var t,n=this.settings,i=document.activeElement,r=Kg.call(this,i)&&this.DOM.scope.contains(i),s=i===this.DOM.input,a=r&&i.hasAttribute("readonly"),l=this.DOM.scope.querySelector(this.settings.classNames.tagTextSelector),u=this.state.dropdown.visible;if((e.key==="Tab"&&u||this.state.hasFocus||r&&!a)&&!s){t=i.nextElementSibling;var h=e.target.classList.contains(n.classNames.tagX);switch(e.key){case"Backspace":n.readonly||this.state.editing||(this.removeTags(i),(t||this.DOM.input).focus());break;case"Enter":if(h)return void this.removeTags(e.target.parentNode);n.a11y.focusableTags&&Tr.call(this,i)&&setTimeout(this.editTag.bind(this),0,i);break;case"ArrowDown":this.state.dropdown.visible||n.mode=="mix"||this.dropdown.show();break;case"Tab":l==null||l.focus()}}},onKeydown:function(e){var t=this,n=this.settings;if(!this.state.composing&&n.userInput){n.mode=="select"&&n.enforceWhitelist&&this.value.length&&e.key!="Tab"&&e.preventDefault();var i=this.trim(e.target.textContent);this.trigger("keydown",{event:e}),n.hooks.beforeKeyDown(e,{tagify:this}).then(function(r){if(n.mode=="mix"){switch(e.key){case"Left":case"ArrowLeft":t.state.actions.ArrowLeft=!0;break;case"Delete":case"Backspace":if(t.state.editing)return;var s=document.getSelection(),a=e.key=="Delete"&&s.anchorOffset==(s.anchorNode.length||0),l=s.anchorNode.previousSibling,u=s.anchorNode.nodeType==1||!s.anchorOffset&&l&&l.nodeType==1&&s.anchorNode.previousSibling;(function(A){var M=document.createElement("div");A.replace(/\&#?[0-9a-z]+;/gi,function(B){return M.innerHTML=B,M.innerText})})(t.DOM.input.innerHTML);var h,d,m,y=t.getTagElms(),x=s.anchorNode.length===1&&s.anchorNode.nodeValue=="​";if(n.backspace=="edit"&&u)return h=s.anchorNode.nodeType==1?null:s.anchorNode.previousElementSibling,setTimeout(t.editTag.bind(t),0,h),void e.preventDefault();if(Xg()&&Zg(u,Element))return m=Vg(u),u.hasAttribute("readonly")||u.remove(),t.DOM.input.focus(),void setTimeout(function(){Wi(m),t.DOM.input.click()});if(s.anchorNode.nodeName=="BR")return;if((a||u)&&s.anchorNode.nodeType==1?d=s.anchorOffset==0?a?y[0]:null:y[Math.min(y.length,s.anchorOffset)-1]:a?d=s.anchorNode.nextElementSibling:Zg(u,Element)&&(d=u),s.anchorNode.nodeType==3&&!s.anchorNode.nodeValue&&s.anchorNode.previousElementSibling&&e.preventDefault(),(u||a)&&!n.backspace||s.type!="Range"&&!s.anchorOffset&&s.anchorNode==t.DOM.input&&e.key!="Delete")return void e.preventDefault();if(s.type!="Range"&&d&&d.hasAttribute("readonly"))return void Wi(Vg(d));e.key=="Delete"&&x&&Zt(s.anchorNode.nextSibling)&&t.removeTags(s.anchorNode.nextSibling)}return!0}var S=n.dropdown.position=="manual";switch(e.key){case"Backspace":n.mode=="select"&&n.enforceWhitelist&&t.value.length?t.removeTags():t.state.dropdown.visible&&n.dropdown.position!="manual"||e.target.textContent!=""&&i.charCodeAt(0)!=8203||(n.backspace===!0?t.removeTags():n.backspace=="edit"&&setTimeout(t.editTag.bind(t),0));break;case"Esc":case"Escape":if(t.state.dropdown.visible)return;e.target.blur();break;case"Down":case"ArrowDown":t.state.dropdown.visible||t.dropdown.show();break;case"ArrowRight":var C=t.state.inputSuggestion||t.state.ddItemData;if(C&&n.autoComplete.rightKey)return void t.addTags([C],!0);break;case"Tab":return!0;case"Enter":if(t.state.dropdown.visible&&!S)return;e.preventDefault();var T=t.state.autoCompleteData||i;setTimeout(function(){t.state.dropdown.visible&&!S||t.state.actions.selectOption||!n.addTagOn.includes(e.key.toLowerCase())||(t.addTags([T],!0),t.state.autoCompleteData=null)})}}).catch(function(r){return r})}},onInput:function(e){this.postUpdate();var t=this.settings;if(t.mode=="mix")return this.events.callbacks.onMixTagsInput.call(this,e);var n=this.input.normalize.call(this,void 0,{trim:!1}),i=n.length>=t.dropdown.enabled,r={value:n,inputElm:this.DOM.input},s=this.validateTag({value:n});t.mode=="select"&&this.toggleScopeValidation(s),r.isValid=s,this.state.inputText!=n&&(this.input.set.call(this,n,!1),n.search(t.delimiters)!=-1?this.addTags(n)&&this.input.set.call(this):t.dropdown.enabled>=0&&this.dropdown[i?"show":"hide"](n),this.trigger("input",r))},onMixTagsInput:function(e){var t,n,i,r,s,a,l,u,h=this,d=this.settings,m=this.value.length,y=this.getTagElms(),x=document.createDocumentFragment(),S=window.getSelection().getRangeAt(0),C=[].map.call(y,function(T){return Zt(T).value});if(e.inputType=="deleteContentBackward"&&Xg()&&this.events.callbacks.onKeydown.call(this,{target:e.target,key:"Backspace"}),Ab(this.getTagElms()),this.value.slice().forEach(function(T){T.readonly&&!C.includes(T.value)&&x.appendChild(h.createTagElem(T))}),x.childNodes.length&&(S.insertNode(x),this.setRangeAtStartEnd(!1,x.lastChild)),y.length!=m)return this.value=[].map.call(this.getTagElms(),function(T){return Zt(T)}),void this.update({withoutChangeEvent:!0});if(this.hasMaxTags())return!0;if(window.getSelection&&(a=window.getSelection()).rangeCount>0&&a.anchorNode.nodeType==3){if((S=a.getRangeAt(0).cloneRange()).collapse(!0),S.setStart(a.focusNode,0),i=(t=S.toString().slice(0,S.endOffset)).split(d.pattern).length-1,(n=t.match(d.pattern))&&(r=t.slice(t.lastIndexOf(n[n.length-1]))),r){if(this.state.actions.ArrowLeft=!1,this.state.tag={prefix:r.match(d.pattern)[0],value:r.replace(d.pattern,"")},this.state.tag.baseOffset=a.baseOffset-this.state.tag.value.length,u=this.state.tag.value.match(d.delimiters))return this.state.tag.value=this.state.tag.value.replace(d.delimiters,""),this.state.tag.delimiters=u[0],this.addTags(this.state.tag.value,d.dropdown.clearOnSelect),void this.dropdown.hide();s=this.state.tag.value.length>=d.dropdown.enabled;try{l=(l=this.state.flaggedTags[this.state.tag.baseOffset]).prefix==this.state.tag.prefix&&l.value[0]==this.state.tag.value[0],this.state.flaggedTags[this.state.tag.baseOffset]&&!this.state.tag.value&&delete this.state.flaggedTags[this.state.tag.baseOffset]}catch{}(l||i500||!t.focusable)?this.state.dropdown.visible?this.dropdown.hide():t.dropdown.enabled===0&&t.mode!="mix"&&this.dropdown.show(this.value.length?"":void 0):t.mode!="select"||t.dropdown.enabled!==0||this.state.dropdown.visible||(this.events.callbacks.onDoubleClickScope.call(this,pk(function(r){for(var s=1;s=this.settings.dropdown.enabled&&(this.state.editing&&(this.state.editing.value=a),this.dropdown.show(a)),this.trigger("edit:input",{tag:i,index:r,data:Oe({},this.value[r],{newValue:a}),event:t})},onEditTagPaste:function(e,t){var n=(t.clipboardData||window.clipboardData).getData("Text");t.preventDefault();var i=kb(n);this.setRangeAtStartEnd(!1,i)},onEditTagClick:function(e,t){this.events.callbacks.onClickScope.call(this,t)},onEditTagFocus:function(e){this.state.editing={scope:e,input:e.querySelector("[contenteditable]")}},onEditTagBlur:function(e,t){var n=Tr.call(this,t.relatedTarget);if(this.settings.mode=="select"&&n&&t.relatedTarget.contains(t.target))this.dropdown.hide();else if(this.state.editing&&(this.state.hasFocus||this.toggleFocusClass(),this.DOM.scope.contains(document.activeElement)||this.trigger("blur",{}),this.DOM.scope.contains(e))){var i,r,s,a=this.settings,l=e.closest("."+a.classNames.tag),u=Zt(l),h=this.input.normalize.call(this,e),d=(mr(i={},a.tagTextProp,h),mr(i,"__tagId",u.__tagId),i),m=u.__originalData,y=this.editTagChangeDetected(Oe(u,d)),x=this.validateTag(d);if(h)if(y){var S;if(r=this.hasMaxTags(),s=Oe({},m,(mr(S={},a.tagTextProp,this.trim(h)),mr(S,"__isValid",x),S)),a.transformTag.call(this,s,m),(x=(!r||m.__isValid===!0)&&this.validateTag(s))!==!0){if(this.trigger("invalid",{data:s,tag:l,message:x}),a.editTags.keepInvalid)return;a.keepInvalidTags?s.__isValid=x:s=m}else a.keepInvalidTags&&(delete s.title,delete s["aria-invalid"],delete s.class);this.onEditTagDone(l,s)}else this.onEditTagDone(l,m);else this.onEditTagDone(l)}},onEditTagkeydown:function(e,t){if(!this.state.composing)switch(this.trigger("edit:keydown",{event:e}),e.key){case"Esc":case"Escape":this.state.editing=!1,t.__tagifyTagData.__originalData.value?t.parentNode.replaceChild(t.__tagifyTagData.__originalHTML,t):t.remove();break;case"Enter":case"Tab":e.preventDefault(),setTimeout(function(){return e.target.blur()},0)}},onDoubleClickScope:function(e){var t=e.target.closest("."+this.settings.classNames.tag);if(t){var n,i,r=Zt(t),s=this.settings;(r==null?void 0:r.editable)!==!1&&(n=t.classList.contains(this.settings.classNames.tagEditing),i=t.hasAttribute("readonly"),s.readonly||n||i||!this.settings.editTags||!s.userInput||(this.events.callbacks.onEditTagFocus.call(this,t),this.editTag(t)),this.toggleFocusClass(!0),s.mode!="select"&&this.trigger("dblclick",{tag:t,index:this.getNodeIndex(t),data:Zt(t)}))}},onInputDOMChange:function(e){var t=this;e.forEach(function(i){i.addedNodes.forEach(function(r){if(r.outerHTML=="

")r.replaceWith(document.createElement("br"));else if(r.nodeType==1&&r.querySelector(t.settings.classNames.tagSelector)){var s,a=document.createTextNode("");r.childNodes[0].nodeType==3&&r.previousSibling.nodeName!="BR"&&(a=document.createTextNode(` `)),(s=r).replaceWith.apply(s,Hh([a].concat(Hh(Hh(r.childNodes).slice(0,-1))))),Wi(a)}else if(Tr.call(t,r)){var l;if(((l=r.previousSibling)===null||l===void 0?void 0:l.nodeType)!=3||r.previousSibling.textContent||r.previousSibling.remove(),r.previousSibling&&r.previousSibling.nodeName=="BR"){r.previousSibling.replaceWith(` ​`);for(var u=r.nextSibling,h="";u;)h+=u.textContent,u=u.nextSibling;h.trim()&&Wi(r.previousSibling)}else r.previousSibling&&!Zt(r.previousSibling)||r.before("​")}}),i.removedNodes.forEach(function(r){r&&r.nodeName=="BR"&&Tr.call(t,n)&&(t.removeTags(n),t.fixFirefoxLastTagNoCaret())})});var n=this.DOM.input.lastChild;n&&n.nodeValue==""&&n.remove(),n&&n.nodeName=="BR"||this.DOM.input.appendChild(document.createElement("br"))}}};function zh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n");else{try{yi(JSON.parse(e),Array)&&(e=JSON.parse(e))}catch{}this.addTags(e,!0).forEach(function(r){return r&&r.classList.add(n.classNames.tagNoAnimation)})}else this.postUpdate();this.state.lastOriginalValueReported=n.mixMode.integrated?"":this.DOM.originalInput.value},cloneEvent:function(e){var t={};for(var n in e)n!="path"&&(t[n]=e[n]);return t},loading:function(e){return this.state.isLoading=e,this.DOM.scope.classList[e?"add":"remove"](this.settings.classNames.scopeLoading),this},tagLoading:function(e,t){return e&&e.classList[t?"add":"remove"](this.settings.classNames.tagLoading),this},toggleClass:function(e,t){typeof e=="string"&&this.DOM.scope.classList.toggle(e,t)},toggleScopeValidation:function(e){var t=e===!0||e===void 0;!this.settings.required&&e&&e===this.TEXTS.empty&&(t=!0),this.toggleClass(this.settings.classNames.tagInvalid,!t),this.DOM.scope.title=t?"":e},toggleFocusClass:function(e){this.toggleClass(this.settings.classNames.focus,!!e)},setPlaceholder:function(e){var t=this;["data","aria"].forEach(function(n){return t.DOM.input.setAttribute("".concat(n,"-placeholder"),e)})},triggerChangeEvent:function(){if(!this.settings.mixMode.integrated){var e=this.DOM.originalInput,t=this.state.lastOriginalValueReported!==e.value,n=new CustomEvent("change",{bubbles:!0});t&&(this.state.lastOriginalValueReported=e.value,n.simulated=!0,e._valueTracker&&e._valueTracker.setValue(Math.random()),e.dispatchEvent(n),this.trigger("change",this.state.lastOriginalValueReported),e.value=this.state.lastOriginalValueReported)}},events:gk,fixFirefoxLastTagNoCaret:function(){},setRangeAtStartEnd:function(e,t){if(t){e=typeof e=="number"?e:!!e,t=t.lastChild||t;var n=document.getSelection();if(yi(n.focusNode,Element)&&!this.DOM.input.contains(n.focusNode))return!0;try{n.rangeCount>=1&&["Start","End"].forEach(function(i){return n.getRangeAt(0)["set"+i](t,e||t.length)})}catch(i){console.warn(i)}}},insertAfterTag:function(e,t){if(t=t||this.settings.mixMode.insertAfterTag,e&&e.parentNode&&t)return t=typeof t=="string"?document.createTextNode(t):t,e.parentNode.insertBefore(t,e.nextSibling),t},editTagChangeDetected:function(e){var t=e.__originalData;for(var n in t)if(!this.dataProps.includes(n)&&e[n]!=t[n])return!0;return!1},getTagTextNode:function(e){return e.querySelector(this.settings.classNames.tagTextSelector)},setTagTextNode:function(e,t){this.getTagTextNode(e).innerHTML=wr(t)},editTag:function(e,t){var n=this;e=e||this.getLastTag(),t=t||{};var i=this.settings,r=this.getTagTextNode(e),s=this.getNodeIndex(e),a=Zt(e),l=this.events.callbacks,u=!0,h=i.mode=="select";if(!h&&this.dropdown.hide(),r){if(!yi(a,Object)||!("editable"in a)||a.editable)return a=Zt(e,{__originalData:Oe({},a),__originalHTML:e.cloneNode(!0)}),Zt(a.__originalHTML,a.__originalData),r.setAttribute("contenteditable",!0),e.classList.add(i.classNames.tagEditing),this.events.callbacks.onEditTagFocus.call(this,e),r.addEventListener("click",l.onEditTagClick.bind(this,e)),r.addEventListener("blur",l.onEditTagBlur.bind(this,this.getTagTextNode(e))),r.addEventListener("input",l.onEditTagInput.bind(this,r)),r.addEventListener("paste",l.onEditTagPaste.bind(this,r)),r.addEventListener("keydown",function(d){return l.onEditTagkeydown.call(n,d,e)}),r.addEventListener("compositionstart",l.onCompositionStart.bind(this)),r.addEventListener("compositionend",l.onCompositionEnd.bind(this)),t.skipValidation||(u=this.editTagToggleValidity(e)),r.originalIsValid=u,this.trigger("edit:start",{tag:e,index:s,data:a,isValid:u}),r.focus(),!h&&this.setRangeAtStartEnd(!1,r),i.dropdown.enabled===0&&!h&&this.dropdown.show(),this.state.hasFocus=!0,this}else qi.warn("Cannot find element in Tag template: .",i.classNames.tagTextSelector)},editTagToggleValidity:function(e,t){var n;if(t=t||Zt(e))return(n=!("__isValid"in t)||t.__isValid===!0)||this.removeTagsFromValue(e),this.update(),e.classList.toggle(this.settings.classNames.tagNotAllowed,!n),t.__isValid=n,t.__isValid;qi.warn("tag has no data: ",e,t)},onEditTagDone:function(e,t){e=e||this.state.editing.scope,t=t||{};var n,i,r=this.settings,s={tag:e,index:this.getNodeIndex(e),previousData:Zt(e),data:t};this.trigger("edit:beforeUpdate",s,{cloneData:!1}),this.state.editing=!1,delete t.__originalData,delete t.__originalHTML,e&&e.parentNode&&(((i=t[r.tagTextProp])!==void 0?!((n=(i+="").trim)===null||n===void 0)&&n.call(i):!(r.tagTextProp in t)&&t.value)?(e=this.replaceTag(e,t),this.editTagToggleValidity(e,t),r.a11y.focusableTags?e.focus():r.mode!="select"&&Wi(e)):this.removeTags(e)),this.trigger("edit:updated",s),r.dropdown.closeOnSelect&&this.dropdown.hide(),this.settings.keepInvalidTags&&this.reCheckInvalidTags()},replaceTag:function(e,t){t&&t.value!==""&&t.value!==void 0||(t=e.__tagifyTagData),t.__isValid&&t.__isValid!=1&&Oe(t,this.getInvalidTagAttrs(t,t.__isValid));var n=this.createTagElem(t);return e.parentNode.replaceChild(n,e),this.updateValueByDOMTags(),n},updateValueByDOMTags:function(){var e=this;this.value.length=0;var t=this.settings.classNames,n=[t.tagNotAllowed.split(" ")[0],t.tagHide];[].forEach.call(this.getTagElms(),function(i){Rl(i.classList).some(function(r){return n.includes(r)})||e.value.push(Zt(i))}),this.update(),this.dropdown.refilter()},injectAtCaret:function(e,t){var n;if(t=t||((n=this.state.selection)===null||n===void 0?void 0:n.range),typeof e=="string"&&(e=document.createTextNode(e)),!t&&e)return this.appendMixTags(e),this;var i=kb(e,t);return this.setRangeAtStartEnd(!1,i),this.updateValueByDOMTags(),this.update(),this},input:{set:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.settings,i=n.dropdown.closeOnSelect;this.state.inputText=e,t&&(this.DOM.input.innerHTML=wr(""+e),e&&this.toggleClass(n.classNames.empty,!this.DOM.input.innerHTML)),!e&&i&&this.dropdown.hide.bind(this),this.input.autocomplete.suggest.call(this),this.input.validate.call(this)},raw:function(){return this.DOM.input.textContent},validate:function(){var e=!this.state.inputText||this.validateTag({value:this.state.inputText})===!0;return this.DOM.input.classList.toggle(this.settings.classNames.inputInvalid,!e),e},normalize:function(e,t){var n=e||this.DOM.input,i=[];n.childNodes.forEach(function(r){return r.nodeType==3&&i.push(r.nodeValue)}),i=i.join(` `);try{i=i.replace(/(?:\r\n|\r|\n)/g,this.settings.delimiters.source.charAt(0))}catch{}return i=i.replace(/\s/g," "),t!=null&&t.trim?this.trim(i):i},autocomplete:{suggest:function(e){if(this.settings.autoComplete.enabled){typeof(e=e||{value:""})!="object"&&(e={value:e});var t=this.dropdown.getMappedValue(e);if(typeof t!="number"){var n=this.state.inputText.toLowerCase(),i=t.substr(0,this.state.inputText.length).toLowerCase(),r=t.substring(this.state.inputText.length);t&&this.state.inputText&&i==n?(this.DOM.input.setAttribute("data-suggest",r),this.state.inputSuggestion=e):(this.DOM.input.removeAttribute("data-suggest"),delete this.state.inputSuggestion)}}},set:function(e){var t=this.DOM.input.getAttribute("data-suggest"),n=e||(t?this.state.inputText+t:null);return!!n&&(this.settings.mode=="mix"?this.replaceTextWithNode(document.createTextNode(this.state.tag.prefix+n)):(this.input.set.call(this,n),this.setRangeAtStartEnd(!1,this.DOM.input)),this.input.autocomplete.suggest.call(this),this.dropdown.hide(),!0)}}},getTagIdx:function(e){return this.value.findIndex(function(t){return t.__tagId==(e||{}).__tagId})},getNodeIndex:function(e){var t=0;if(e)for(;e=e.previousElementSibling;)t++;return t},getTagElms:function(){for(var e=arguments.length,t=new Array(e),n=0;n=this.settings.maxTags&&this.TEXTS.exceed},setReadonly:function(e,t){var n=this.settings;this.DOM.scope.contains(document.activeElement)&&document.activeElement.blur(),n[t||"readonly"]=e,this.DOM.scope[(e?"set":"remove")+"Attribute"](t||"readonly",!0),this.settings.userInput=!0,this.setContentEditable(!e)},setContentEditable:function(e){this.DOM.scope.querySelectorAll("[data-can-editable]").forEach(function(t){t.contentEditable=e,t.tabIndex=e?0:-1})},setDisabled:function(e){this.setReadonly(e,"disabled")},normalizeTags:function(e){var t=this,n=this.settings,i=n.whitelist,r=n.delimiters,s=n.mode,a=n.tagTextProp,l=[],u=!!i&&yi(i[0],Object),h=Array.isArray(e),d=h&&e[0].value,m=function(y){return(y+"").split(r).reduce(function(x,S){var C,T=t.trim(S);return T&&x.push((vf(C={},a,T),vf(C,"value",T),C)),x},[])};if(typeof e=="number"&&(e=e.toString()),typeof e=="string"){if(!e.trim())return[];e=m(e)}else h&&(e=e.reduce(function(y,x){if(Wn(x)){var S=Oe({},x);a in S||(a="value"),S[a]=t.trim(S[a]),(S[a]||S[a]===0)&&y.push(S)}else if(x!=null&&x!==""&&x!==void 0){var C;(C=y).push.apply(C,Rl(m(x)))}return y},[]));return u&&!d&&(e.forEach(function(y){var x=l.map(function(T){return T.value}),S=t.dropdown.filterListItems.call(t,y[a],{exact:!0});t.settings.duplicates||(S=S.filter(function(T){return!x.includes(T.value)}));var C=S.length>1?t.getWhitelistItem(y[a],a,S):S[0];C&&yi(C,Object)?l.push(C):s!="mix"&&(y.value==null&&(y.value=y[a]),l.push(y))}),l.length&&(e=l)),e},parseMixTags:function(e){var t=this,n=this.settings,i=n.mixTagsInterpolator,r=n.duplicates,s=n.transformTag,a=n.enforceWhitelist,l=n.maxTags,u=n.tagTextProp,h=[];e=e.split(i[0]).map(function(m,y){var x,S,C,T=m.split(i[1]),A=T[0],M=h.length==l;try{if(A==+A)throw Error;S=JSON.parse(A)}catch{S=t.normalizeTags(A)[0]||{value:A}}if(s.call(t,S),M||!(T.length>1)||a&&!t.isTagWhitelisted(S.value)||!r&&t.isTagDuplicate(S.value)){if(m)return y?i[0]+m:m}else S[x=S[u]?u:"value"]=t.trim(S[x]),C=t.createTagElem(S),h.push(S),C.classList.add(t.settings.classNames.tagNoAnimation),T[0]=C.outerHTML,t.value.push(S);return T.join("")}).join(""),this.DOM.input.innerHTML=e,this.DOM.input.appendChild(document.createTextNode("")),this.DOM.input.normalize();var d=this.getTagElms();return d.forEach(function(m,y){return Zt(m,h[y])}),this.update({withoutChangeEvent:!0}),Ab(d,this.state.hasFocus),e},replaceTextWithNode:function(e,t){if(this.state.tag||t){t=t||this.state.tag.prefix+this.state.tag.value;var n,i,r=this.state.selection||window.getSelection(),s=r.anchorNode,a=this.state.tag.delimiters?this.state.tag.delimiters.length:0;return s.splitText(r.anchorOffset-a),(n=s.nodeValue.lastIndexOf(t))==-1||(i=s.splitText(n),e&&s.parentNode.replaceChild(e,i)),!0}},prepareNewTagNode:function(e,t){t=t||{};var n=this.settings,i=[],r={},s=Object.assign({},e,{value:e.value+""});if(e=Object.assign({},s),n.transformTag.call(this,e),e.__isValid=this.hasMaxTags()||this.validateTag(e),e.__isValid!==!0){if(t.skipInvalid)return;if(Oe(r,this.getInvalidTagAttrs(e,e.__isValid),{__preInvalidData:s}),e.__isValid==this.TEXTS.duplicate&&this.flashTag(this.getTagElmByValue(e.value)),!n.createInvalidTags)return void i.push(e.value)}return"readonly"in e&&(e.readonly?r["aria-readonly"]=!0:delete e.readonly),{tagElm:this.createTagElem(e,r),tagData:e,aggregatedInvalidInput:i}},postProcessNewTagNode:function(e,t){var n=this,i=this.settings,r=t.__isValid;r&&r===!0?this.value.push(t):(this.trigger("invalid",{data:t,index:this.value.length,tag:e,message:r}),i.keepInvalidTags||setTimeout(function(){return n.removeTags(e,!0)},1e3)),this.dropdown.position()},selectTag:function(e,t){var n=this;if(!this.settings.enforceWhitelist||this.isTagWhitelisted(t.value)){this.state.actions.selectOption&&setTimeout(function(){return n.setRangeAtStartEnd(!1,n.DOM.input)});var i=this.getLastTag();return i?this.replaceTag(i,t):this.appendTag(e),this.value[0]=t,this.update(),this.trigger("add",{tag:e,data:t}),[e]}},addEmptyTag:function(e){var t=Oe({value:""},e||{}),n=this.createTagElem(t);Zt(n,t),this.appendTag(n),this.editTag(n,{skipValidation:!0}),this.toggleFocusClass(!0)},addTags:function(e,t,n){var i=this,r=[],s=this.settings,a=[],l=document.createDocumentFragment(),u=[];if(!e||e.length==0)return r;switch(e=this.normalizeTags(e),s.mode){case"mix":return this.addMixTags(e);case"select":t=!1,this.removeAllTags()}return this.DOM.input.removeAttribute("style"),e.forEach(function(h){var d=i.prepareNewTagNode(h,{skipInvalid:n||s.skipInvalid});if(d){var m=d.tagElm;if(h=d.tagData,a=d.aggregatedInvalidInput,r.push(m),s.mode=="select")return i.selectTag(m,h);l.appendChild(m),i.postProcessNewTagNode(m,h),u.push({tagElm:m,tagData:h})}}),this.appendTag(l),u.forEach(function(h){var d=h.tagElm,m=h.tagData;return i.trigger("add",{tag:d,index:i.getTagIdx(m),data:m})}),this.update(),e.length&&t&&(this.input.set.call(this,s.createInvalidTags?"":a.join(s._delimiters)),this.setRangeAtStartEnd(!1,this.DOM.input)),this.dropdown.refilter(),r},addMixTags:function(e){var t=this;if((e=this.normalizeTags(e))[0].prefix||this.state.tag)return this.prefixedTextToTag(e[0]);var n=document.createDocumentFragment();return e.forEach(function(i){var r=t.prepareNewTagNode(i);n.appendChild(r.tagElm),t.insertAfterTag(r.tagElm),t.postProcessNewTagNode(r.tagElm,r.tagData)}),this.appendMixTags(n),n.children},appendMixTags:function(e){var t=!!this.state.selection;t?this.injectAtCaret(e):(this.DOM.input.focus(),(t=this.setStateSelection()).range.setStart(this.DOM.input,t.range.endOffset),t.range.setEnd(this.DOM.input,t.range.endOffset),this.DOM.input.appendChild(e),this.updateValueByDOMTags(),this.update())},prefixedTextToTag:function(e){var t,n,i,r=this,s=this.settings,a=(t=this.state.tag)===null||t===void 0?void 0:t.delimiters;if(e.prefix=e.prefix||this.state.tag?this.state.tag.prefix:(s.pattern.source||s.pattern)[0],i=this.prepareNewTagNode(e),n=i.tagElm,this.replaceTextWithNode(n)||this.DOM.input.appendChild(n),setTimeout(function(){return n.classList.add(r.settings.classNames.tagNoAnimation)},300),this.update(),!a){var l=this.insertAfterTag(n)||n;setTimeout(Wi,0,l)}return this.state.tag=null,this.postProcessNewTagNode(n,i.tagData),n},appendTag:function(e){var t=this.DOM,n=t.input;t.scope.insertBefore(e,n)},createTagElem:function(e,t){e.__tagId=Yg();var n,i=Oe({},e,Qg({value:wr(e.value+"")},t));return function(r){for(var s,a=document.createNodeIterator(r,NodeFilter.SHOW_TEXT,null,!1);s=a.nextNode();)s.textContent.trim()||s.parentNode.removeChild(s)}(n=this.parseTemplate("tag",[i,this])),Zt(n,e),n},reCheckInvalidTags:function(){var e=this,t=this.settings;this.getTagElms(t.classNames.tagNotAllowed).forEach(function(n,i){var r=Zt(n),s=e.hasMaxTags(),a=e.validateTag(r),l=a===!0&&!s;if(t.mode=="select"&&e.toggleScopeValidation(a),l)return r=r.__preInvalidData?r.__preInvalidData:{value:r.value},e.replaceTag(n,r);n.title=s||a})},removeTags:function(e,t,n){var i,r=this,s=this.settings;if(e=e&&yi(e,HTMLElement)?[e]:yi(e,Array)?e:e?[e]:[this.getLastTag()].filter(function(a){return a}),i=e.reduce(function(a,l){l&&typeof l=="string"&&(l=r.getTagElmByValue(l));var u=Zt(l);return l&&u&&!u.readonly&&a.push({node:l,idx:r.getTagIdx(u),data:Zt(l,{__removed:!0})}),a},[]),n=typeof n=="number"?n:this.CSSVars.tagHideTransition,s.mode=="select"&&(n=0,this.input.set.call(this)),i.length==1&&s.mode!="select"&&i[0].node.classList.contains(s.classNames.tagNotAllowed)&&(t=!0),i.length)return s.hooks.beforeRemoveTag(i,{tagify:this}).then(function(){var a=function(l){l.node.parentNode&&(l.node.parentNode.removeChild(l.node),t?s.keepInvalidTags&&this.trigger("remove",{tag:l.node,index:l.idx}):(this.trigger("remove",{tag:l.node,index:l.idx,data:l.data}),this.dropdown.refilter(),this.dropdown.position(),this.DOM.input.normalize(),s.keepInvalidTags&&this.reCheckInvalidTags()))};n&&n>10&&i.length==1?(function(l){l.node.style.width=parseFloat(window.getComputedStyle(l.node).width)+"px",document.body.clientTop,l.node.classList.add(s.classNames.tagHide),setTimeout(a.bind(this),n,l)}).call(r,i[0]):i.forEach(a.bind(r)),t||(r.removeTagsFromValue(i.map(function(l){return l.node})),r.update(),s.mode=="select"&&s.userInput&&r.setContentEditable(!0))}).catch(function(a){})},removeTagsFromDOM:function(){this.getTagElms().forEach(function(e){return e.remove()})},removeTagsFromValue:function(e){var t=this;(e=Array.isArray(e)?e:[e]).forEach(function(n){var i=Zt(n),r=t.getTagIdx(i);r>-1&&t.value.splice(r,1)})},removeAllTags:function(e){var t=this;e=e||{},this.value=[],this.settings.mode=="mix"?this.DOM.input.innerHTML="":this.removeTagsFromDOM(),this.dropdown.refilter(),this.dropdown.position(),this.state.dropdown.visible&&setTimeout(function(){t.DOM.input.focus()}),this.settings.mode=="select"&&(this.input.set.call(this),this.settings.userInput&&this.setContentEditable(!0)),this.update(e)},postUpdate:function(){this.state.blockChangeEvent=!1;var e,t,n=this.settings,i=n.classNames,r=n.mode=="mix"?n.mixMode.integrated?this.DOM.input.textContent:this.DOM.originalInput.value.trim():this.value.length+this.input.raw.call(this).length;this.toggleClass(i.hasMaxTags,this.value.length>=n.maxTags),this.toggleClass(i.hasNoTags,!this.value.length),this.toggleClass(i.empty,!r),n.mode=="select"&&this.toggleScopeValidation((t=this.value)===null||t===void 0||(e=t[0])===null||e===void 0?void 0:e.__isValid)},setOriginalInputValue:function(e){var t=this.DOM.originalInput;this.settings.mixMode.integrated||(t.value=e,t.tagifyValue=t.value,this.setPersistedData(e,"value"))},update:function(e){clearTimeout(this.debouncedUpdateTimeout),this.debouncedUpdateTimeout=setTimeout((function(){var t=this.getInputValue();this.setOriginalInputValue(t),this.settings.onChangeAfterBlur&&(e||{}).withoutChangeEvent||this.state.blockChangeEvent||this.triggerChangeEvent(),this.postUpdate()}).bind(this),100),this.events.bindOriginaInputListener.call(this,100)},getInputValue:function(){var e=this.getCleanValue();return this.settings.mode=="mix"?this.getMixedTagsAsString(e):e.length?this.settings.originalInputValueFormat?this.settings.originalInputValueFormat(e):JSON.stringify(e):""},getCleanValue:function(e){return Ug(e||this.value,this.dataProps)},getMixedTagsAsString:function(){var e="",t=this,n=this.settings,i=n.originalInputValueFormat||JSON.stringify,r=n.mixTagsInterpolator;return function s(a){a.childNodes.forEach(function(l){if(l.nodeType==1){var u=Zt(l);if(l.tagName=="BR"&&(e+=`\r `),u&&Tr.call(t,l)){if(u.__removed)return;e+=r[0]+i(mf(u,t.dataProps))+r[1]}else l.getAttribute("style")||["B","I","U"].includes(l.tagName)?e+=l.textContent:l.tagName!="DIV"&&l.tagName!="P"||(e+=`\r `,s(l))}else e+=l.textContent})}(this.DOM.input),e}},Ql.prototype.removeTag=Ql.prototype.removeTags;function Io(e){"@babel/helpers - typeof";return Io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Io(e)}function Me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mk(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function bk(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yk(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bk(e)}function dn(e){var t=vk();return function(){var i=dc(e),r;if(t){var s=dc(this).constructor;r=Reflect.construct(i,arguments,s)}else r=i.apply(this,arguments);return yk(this,r)}}var Zf=function(){function e(){Me(this,e)}return Re(e,[{key:"listenForWhisper",value:function(n,i){return this.listen(".client-"+n,i)}},{key:"notification",value:function(n){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",n)}},{key:"stopListeningForWhisper",value:function(n,i){return this.stopListening(".client-"+n,i)}}]),e}(),Eb=function(){function e(t){Me(this,e),this.namespace=t}return Re(e,[{key:"format",value:function(n){return[".","\\"].includes(n.charAt(0))?n.substring(1):(this.namespace&&(n=this.namespace+"."+n),n.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(n){this.namespace=n}}]),e}();function _k(e){try{new e}catch(t){if(t.message.includes("is not a constructor"))return!1}return!0}var Qf=function(e){fn(n,e);var t=dn(n);function n(i,r,s){var a;return Me(this,n),a=t.call(this),a.name=r,a.pusher=i,a.options=s,a.eventFormatter=new Eb(a.options.namespace),a.subscribe(),a}return Re(n,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(r,s){return this.on(this.eventFormatter.format(r),s),this}},{key:"listenToAll",value:function(r){var s=this;return this.subscription.bind_global(function(a,l){if(!a.startsWith("pusher:")){var u=s.options.namespace.replace(/\./g,"\\"),h=a.startsWith(u)?a.substring(u.length+1):"."+a;r(h,l)}}),this}},{key:"stopListening",value:function(r,s){return s?this.subscription.unbind(this.eventFormatter.format(r),s):this.subscription.unbind(this.eventFormatter.format(r)),this}},{key:"stopListeningToAll",value:function(r){return r?this.subscription.unbind_global(r):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(r){return this.on("pusher:subscription_succeeded",function(){r()}),this}},{key:"error",value:function(r){return this.on("pusher:subscription_error",function(s){r(s)}),this}},{key:"on",value:function(r,s){return this.subscription.bind(r,s),this}}]),n}(Zf),Pb=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}}]),n}(Qf),wk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}}]),n}(Qf),xk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"here",value:function(r){return this.on("pusher:subscription_succeeded",function(s){r(Object.keys(s.members).map(function(a){return s.members[a]}))}),this}},{key:"joining",value:function(r){return this.on("pusher:member_added",function(s){r(s.info)}),this}},{key:"whisper",value:function(r,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(r),s),this}},{key:"leaving",value:function(r){return this.on("pusher:member_removed",function(s){r(s.info)}),this}}]),n}(Pb),Mb=function(e){fn(n,e);var t=dn(n);function n(i,r,s){var a;return Me(this,n),a=t.call(this),a.events={},a.listeners={},a.name=r,a.socket=i,a.options=s,a.eventFormatter=new Eb(a.options.namespace),a.subscribe(),a}return Re(n,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(r,s){return this.on(this.eventFormatter.format(r),s),this}},{key:"stopListening",value:function(r,s){return this.unbindEvent(this.eventFormatter.format(r),s),this}},{key:"subscribed",value:function(r){return this.on("connect",function(s){r(s)}),this}},{key:"error",value:function(r){return this}},{key:"on",value:function(r,s){var a=this;return this.listeners[r]=this.listeners[r]||[],this.events[r]||(this.events[r]=function(l,u){a.name===l&&a.listeners[r]&&a.listeners[r].forEach(function(h){return h(u)})},this.socket.on(r,this.events[r])),this.listeners[r].push(s),this}},{key:"unbind",value:function(){var r=this;Object.keys(this.events).forEach(function(s){r.unbindEvent(s)})}},{key:"unbindEvent",value:function(r,s){this.listeners[r]=this.listeners[r]||[],s&&(this.listeners[r]=this.listeners[r].filter(function(a){return a!==s})),(!s||this.listeners[r].length===0)&&(this.events[r]&&(this.socket.removeListener(r,this.events[r]),delete this.events[r]),delete this.listeners[r])}}]),n}(Zf),Rb=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(r),data:s}),this}}]),n}(Mb),Sk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"here",value:function(r){return this.on("presence:subscribed",function(s){r(s.map(function(a){return a.user_info}))}),this}},{key:"joining",value:function(r){return this.on("presence:joining",function(s){return r(s.user_info)}),this}},{key:"whisper",value:function(r,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(r),data:s}),this}},{key:"leaving",value:function(r){return this.on("presence:leaving",function(s){return r(s.user_info)}),this}}]),n}(Rb),pc=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(r,s){return this}},{key:"listenToAll",value:function(r){return this}},{key:"stopListening",value:function(r,s){return this}},{key:"subscribed",value:function(r){return this}},{key:"error",value:function(r){return this}},{key:"on",value:function(r,s){return this}}]),n}(Zf),Db=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this}}]),n}(pc),Tk=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"whisper",value:function(r,s){return this}}]),n}(pc),Ck=function(e){fn(n,e);var t=dn(n);function n(){return Me(this,n),t.apply(this,arguments)}return Re(n,[{key:"here",value:function(r){return this}},{key:"joining",value:function(r){return this}},{key:"whisper",value:function(r,s){return this}},{key:"leaving",value:function(r){return this}}]),n}(Db),td=function(){function e(t){Me(this,e),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},broadcaster:"pusher",csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions(t),this.connect()}return Re(e,[{key:"setOptions",value:function(n){this.options=$o(this._defaultOptions,n);var i=this.csrfToken();return i&&(this.options.auth.headers["X-CSRF-TOKEN"]=i,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=i),i=this.options.bearerToken,i&&(this.options.auth.headers.Authorization="Bearer "+i,this.options.userAuthentication.headers.Authorization="Bearer "+i),n}},{key:"csrfToken",value:function(){var n;return typeof window<"u"&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"&&(n=document.querySelector('meta[name="csrf-token"]'))?n.getAttribute("content"):null}}]),e}(),tm=function(e){fn(n,e);var t=dn(n);function n(){var i;return Me(this,n),i=t.apply(this,arguments),i.channels={},i}return Re(n,[{key:"connect",value:function(){typeof this.options.client<"u"?this.pusher=this.options.client:this.options.Pusher?this.pusher=new this.options.Pusher(this.options.key,this.options):this.pusher=new Pusher(this.options.key,this.options)}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(r,s,a){return this.channel(r).listen(s,a)}},{key:"channel",value:function(r){return this.channels[r]||(this.channels[r]=new Qf(this.pusher,r,this.options)),this.channels[r]}},{key:"privateChannel",value:function(r){return this.channels["private-"+r]||(this.channels["private-"+r]=new Pb(this.pusher,"private-"+r,this.options)),this.channels["private-"+r]}},{key:"encryptedPrivateChannel",value:function(r){return this.channels["private-encrypted-"+r]||(this.channels["private-encrypted-"+r]=new wk(this.pusher,"private-encrypted-"+r,this.options)),this.channels["private-encrypted-"+r]}},{key:"presenceChannel",value:function(r){return this.channels["presence-"+r]||(this.channels["presence-"+r]=new xk(this.pusher,"presence-"+r,this.options)),this.channels["presence-"+r]}},{key:"leave",value:function(r){var s=this,a=[r,"private-"+r,"private-encrypted-"+r,"presence-"+r];a.forEach(function(l,u){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(r){this.channels[r]&&(this.channels[r].unsubscribe(),delete this.channels[r])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),n}(td),em=function(e){fn(n,e);var t=dn(n);function n(){var i;return Me(this,n),i=t.apply(this,arguments),i.channels={},i}return Re(n,[{key:"connect",value:function(){var r=this,s=this.getSocketIO();return this.socket=s(this.options.host,this.options),this.socket.on("reconnect",function(){Object.values(r.channels).forEach(function(a){a.subscribe()})}),this.socket}},{key:"getSocketIO",value:function(){if(typeof this.options.client<"u")return this.options.client;if(typeof io<"u")return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(r,s,a){return this.channel(r).listen(s,a)}},{key:"channel",value:function(r){return this.channels[r]||(this.channels[r]=new Mb(this.socket,r,this.options)),this.channels[r]}},{key:"privateChannel",value:function(r){return this.channels["private-"+r]||(this.channels["private-"+r]=new Rb(this.socket,"private-"+r,this.options)),this.channels["private-"+r]}},{key:"presenceChannel",value:function(r){return this.channels["presence-"+r]||(this.channels["presence-"+r]=new Sk(this.socket,"presence-"+r,this.options)),this.channels["presence-"+r]}},{key:"leave",value:function(r){var s=this,a=[r,"private-"+r,"presence-"+r];a.forEach(function(l){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(r){this.channels[r]&&(this.channels[r].unsubscribe(),delete this.channels[r])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),n}(td),Ok=function(e){fn(n,e);var t=dn(n);function n(){var i;return Me(this,n),i=t.apply(this,arguments),i.channels={},i}return Re(n,[{key:"connect",value:function(){}},{key:"listen",value:function(r,s,a){return new pc}},{key:"channel",value:function(r){return new pc}},{key:"privateChannel",value:function(r){return new Db}},{key:"encryptedPrivateChannel",value:function(r){return new Tk}},{key:"presenceChannel",value:function(r){return new Ck}},{key:"leave",value:function(r){}},{key:"leaveChannel",value:function(r){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),n}(td),kk=function(){function e(t){Me(this,e),this.options=t,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return Re(e,[{key:"channel",value:function(n){return this.connector.channel(n)}},{key:"connect",value:function(){if(this.options.broadcaster=="reverb")this.connector=new tm($o($o({},this.options),{cluster:""}));else if(this.options.broadcaster=="pusher")this.connector=new tm(this.options);else if(this.options.broadcaster=="socket.io")this.connector=new em(this.options);else if(this.options.broadcaster=="null")this.connector=new Ok(this.options);else if(typeof this.options.broadcaster=="function"&&_k(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error("Broadcaster ".concat(Io(this.options.broadcaster)," ").concat(this.options.broadcaster," is not supported."))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(n){return this.connector.presenceChannel(n)}},{key:"leave",value:function(n){this.connector.leave(n)}},{key:"leaveChannel",value:function(n){this.connector.leaveChannel(n)}},{key:"leaveAllChannels",value:function(){for(var n in this.connector.channels)this.leaveChannel(n)}},{key:"listen",value:function(n,i,r){return this.connector.listen(n,i,r)}},{key:"private",value:function(n){return this.connector.privateChannel(n)}},{key:"encryptedPrivate",value:function(n){if(this.connector instanceof em)throw new Error("Broadcaster ".concat(Io(this.options.broadcaster)," ").concat(this.options.broadcaster," does not support encrypted private channels."));return this.connector.encryptedPrivateChannel(n)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){typeof Vue=="function"&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),(typeof Turbo>"u"?"undefined":Io(Turbo))==="object"&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var n=this;Vue.http.interceptors.push(function(i,r){n.socketId()&&i.headers.set("X-Socket-ID",n.socketId()),r()})}},{key:"registerAxiosRequestInterceptor",value:function(){var n=this;axios.interceptors.request.use(function(i){return n.socketId()&&(i.headers["X-Socket-Id"]=n.socketId()),i})}},{key:"registerjQueryAjaxSetup",value:function(){var n=this;typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter(function(i,r,s){n.socketId()&&s.setRequestHeader("X-Socket-Id",n.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var n=this;document.addEventListener("turbo:before-fetch-request",function(i){i.detail.fetchOptions.headers["X-Socket-Id"]=n.socketId()})}}]),e}(),Wh={exports:{}};/*! * Pusher JavaScript Library v7.6.0 * https://pusher.com/ * * Copyright 2020, Pusher * Released under the MIT licence. */var nm;function Ak(){return nm||(nm=1,function(e,t){(function(i,r){e.exports=r()})(window,function(){return function(n){var i={};function r(s){if(i[s])return i[s].exports;var a=i[s]={i:s,l:!1,exports:{}};return n[s].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=n,r.c=i,r.d=function(s,a,l){r.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,a){if(a&1&&(s=r(s)),a&8||a&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(r.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),a&2&&typeof s!="string")for(var u in s)r.d(l,u,(function(h){return s[h]}).bind(null,u));return l},r.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(a,"a",a),a},r.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},r.p="",r(r.s=2)}([function(n,i,r){var s=this&&this.__extends||function(){var C=function(T,A){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,B){M.__proto__=B}||function(M,B){for(var D in B)B.hasOwnProperty(D)&&(M[D]=B[D])},C(T,A)};return function(T,A){C(T,A);function M(){this.constructor=T}T.prototype=A===null?Object.create(A):(M.prototype=A.prototype,new M)}}();Object.defineProperty(i,"__esModule",{value:!0});var a=256,l=function(){function C(T){T===void 0&&(T="="),this._paddingCharacter=T}return C.prototype.encodedLength=function(T){return this._paddingCharacter?(T+2)/3*4|0:(T*8+5)/6|0},C.prototype.encode=function(T){for(var A="",M=0;M>>3*6&63),A+=this._encodeByte(B>>>2*6&63),A+=this._encodeByte(B>>>1*6&63),A+=this._encodeByte(B>>>0*6&63)}var D=T.length-M;if(D>0){var B=T[M]<<16|(D===2?T[M+1]<<8:0);A+=this._encodeByte(B>>>3*6&63),A+=this._encodeByte(B>>>2*6&63),D===2?A+=this._encodeByte(B>>>1*6&63):A+=this._paddingCharacter||"",A+=this._paddingCharacter||""}return A},C.prototype.maxDecodedLength=function(T){return this._paddingCharacter?T/4*3|0:(T*6+7)/8|0},C.prototype.decodedLength=function(T){return this.maxDecodedLength(T.length-this._getPaddingLength(T))},C.prototype.decode=function(T){if(T.length===0)return new Uint8Array(0);for(var A=this._getPaddingLength(T),M=T.length-A,B=new Uint8Array(this.maxDecodedLength(M)),D=0,R=0,N=0,I=0,j=0,q=0,F=0;R>>4,B[D++]=j<<4|q>>>2,B[D++]=q<<6|F,N|=I&a,N|=j&a,N|=q&a,N|=F&a;if(R>>4,N|=I&a,N|=j&a),R>>2,N|=q&a),R>>8&6,A+=51-T>>>8&-75,A+=61-T>>>8&-15,A+=62-T>>>8&3,String.fromCharCode(A)},C.prototype._decodeChar=function(T){var A=a;return A+=(42-T&T-44)>>>8&-a+T-43+62,A+=(46-T&T-48)>>>8&-a+T-47+63,A+=(47-T&T-58)>>>8&-a+T-48+52,A+=(64-T&T-91)>>>8&-a+T-65+0,A+=(96-T&T-123)>>>8&-a+T-97+26,A},C.prototype._getPaddingLength=function(T){var A=0;if(this._paddingCharacter){for(var M=T.length-1;M>=0&&T[M]===this._paddingCharacter;M--)A++;if(T.length<4||A>2)throw new Error("Base64Coder: incorrect padding")}return A},C}();i.Coder=l;var u=new l;function h(C){return u.encode(C)}i.encode=h;function d(C){return u.decode(C)}i.decode=d;var m=function(C){s(T,C);function T(){return C!==null&&C.apply(this,arguments)||this}return T.prototype._encodeByte=function(A){var M=A;return M+=65,M+=25-A>>>8&6,M+=51-A>>>8&-75,M+=61-A>>>8&-13,M+=62-A>>>8&49,String.fromCharCode(M)},T.prototype._decodeChar=function(A){var M=a;return M+=(44-A&A-46)>>>8&-a+A-45+62,M+=(94-A&A-96)>>>8&-a+A-95+63,M+=(47-A&A-58)>>>8&-a+A-48+52,M+=(64-A&A-91)>>>8&-a+A-65+0,M+=(96-A&A-123)>>>8&-a+A-97+26,M},T}(l);i.URLSafeCoder=m;var y=new m;function x(C){return y.encode(C)}i.encodeURLSafe=x;function S(C){return y.decode(C)}i.decodeURLSafe=S,i.encodedLength=function(C){return u.encodedLength(C)},i.maxDecodedLength=function(C){return u.maxDecodedLength(C)},i.decodedLength=function(C){return u.decodedLength(C)}},function(n,i,r){Object.defineProperty(i,"__esModule",{value:!0});var s="utf8: invalid string",a="utf8: invalid source encoding";function l(d){for(var m=new Uint8Array(u(d)),y=0,x=0;x>6,m[y++]=128|S&63):S<55296?(m[y++]=224|S>>12,m[y++]=128|S>>6&63,m[y++]=128|S&63):(x++,S=(S&1023)<<10,S|=d.charCodeAt(x)&1023,S+=65536,m[y++]=240|S>>18,m[y++]=128|S>>12&63,m[y++]=128|S>>6&63,m[y++]=128|S&63)}return m}i.encode=l;function u(d){for(var m=0,y=0;y=d.length-1)throw new Error(s);y++,m+=4}else throw new Error(s)}return m}i.encodedLength=u;function h(d){for(var m=[],y=0;y=d.length)throw new Error(a);var C=d[++y];if((C&192)!==128)throw new Error(a);x=(x&31)<<6|C&63,S=128}else if(x<240){if(y>=d.length-1)throw new Error(a);var C=d[++y],T=d[++y];if((C&192)!==128||(T&192)!==128)throw new Error(a);x=(x&15)<<12|(C&63)<<6|T&63,S=2048}else if(x<248){if(y>=d.length-2)throw new Error(a);var C=d[++y],T=d[++y],A=d[++y];if((C&192)!==128||(T&192)!==128||(A&192)!==128)throw new Error(a);x=(x&15)<<18|(C&63)<<12|(T&63)<<6|A&63,S=65536}else throw new Error(a);if(x=55296&&x<=57343)throw new Error(a);if(x>=65536){if(x>1114111)throw new Error(a);x-=65536,m.push(String.fromCharCode(55296|x>>10)),x=56320|x&1023}}m.push(String.fromCharCode(x))}return m.join("")}i.decode=h},function(n,i,r){n.exports=r(3).default},function(n,i,r){r.r(i);var s=function(){function v(p,g){this.lastId=0,this.prefix=p,this.name=g}return v.prototype.create=function(p){this.lastId++;var g=this.lastId,b=this.prefix+g,w=this.name+"["+g+"]",O=!1,W=function(){O||(p.apply(null,arguments),O=!0)};return this[g]=W,{number:g,id:b,name:w,callback:W}},v.prototype.remove=function(p){delete this[p.number]},v}(),a=new s("_pusher_script_","Pusher.ScriptReceivers"),l={VERSION:"7.6.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,cluster:"mt1",userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},u=l,h=function(){function v(p){this.options=p,this.receivers=p.receivers||a,this.loading={}}return v.prototype.load=function(p,g,b){var w=this;if(w.loading[p]&&w.loading[p].length>0)w.loading[p].push(b);else{w.loading[p]=[b];var O=yt.createScriptRequest(w.getPath(p,g)),W=w.receivers.create(function(Y){if(w.receivers.remove(W),w.loading[p]){var rt=w.loading[p];delete w.loading[p];for(var nt=function(ee){ee||O.cleanup()},ut=0;ut>>6)+st(128|p&63):st(224|p>>>12&15)+st(128|p>>>6&63)+st(128|p&63)},K=function(v){return v.replace(/[^\x00-\x7F]/g,it)},ct=function(v){var p=[0,2,1][v.length%3],g=v.charCodeAt(0)<<16|(v.length>1?v.charCodeAt(1):0)<<8|(v.length>2?v.charCodeAt(2):0),b=[tt.charAt(g>>>18),tt.charAt(g>>>12&63),p>=2?"=":tt.charAt(g>>>6&63),p>=1?"=":tt.charAt(g&63)];return b.join("")},dt=window.btoa||function(v){return v.replace(/[\s\S]{1,3}/g,ct)},_t=function(){function v(p,g,b,w){var O=this;this.clear=g,this.timer=p(function(){O.timer&&(O.timer=w(O.timer))},b)}return v.prototype.isRunning=function(){return this.timer!==null},v.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},v}(),wt=_t,vt=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}();function Ft(v){window.clearTimeout(v)}function xt(v){window.clearInterval(v)}var Ct=function(v){vt(p,v);function p(g,b){return v.call(this,setTimeout,Ft,g,function(w){return b(),null})||this}return p}(wt),Nt=function(v){vt(p,v);function p(g,b){return v.call(this,setInterval,xt,g,function(w){return b(),w})||this}return p}(wt),be={now:function(){return Date.now?Date.now():new Date().valueOf()},defer:function(v){return new Ct(0,v)},method:function(v){var p=Array.prototype.slice.call(arguments,1);return function(g){return g[v].apply(g,p.concat(arguments))}}},Ot=be;function St(v){for(var p=[],g=1;g0)for(var w=0;w=1002&&v.code<=1004?"backoff":null:v.code===4e3?"tls_only":v.code<4100?"refused":v.code<4200?"backoff":v.code<4300?"retry":"refused"},getCloseError:function(v){return v.code!==1e3&&v.code!==1001?{type:"PusherError",data:{code:v.code,message:v.reason||v.message}}:null}},oi=pa,Qc=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),ga=function(v){Qc(p,v);function p(g,b){var w=v.call(this)||this;return w.id=g,w.transport=b,w.activityTimeout=b.activityTimeout,w.bindListeners(),w}return p.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},p.prototype.send=function(g){return this.transport.send(g)},p.prototype.send_event=function(g,b,w){var O={event:g,data:b};return w&&(O.channel=w),Z.debug("Event sent",O),this.send(oi.encodeMessage(O))},p.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},p.prototype.close=function(){this.transport.close()},p.prototype.bindListeners=function(){var g=this,b={message:function(O){var W;try{W=oi.decodeMessage(O)}catch(Y){g.emit("error",{type:"MessageParseError",error:Y,data:O.data})}if(W!==void 0){switch(Z.debug("Event recd",W),W.event){case"pusher:error":g.emit("error",{type:"PusherError",data:W.data});break;case"pusher:ping":g.emit("ping");break;case"pusher:pong":g.emit("pong");break}g.emit("message",W)}},activity:function(){g.emit("activity")},error:function(O){g.emit("error",O)},closed:function(O){w(),O&&O.code&&g.handleCloseEvent(O),g.transport=null,g.emit("closed")}},w=function(){te(b,function(O,W){g.transport.unbind(W,O)})};te(b,function(O,W){g.transport.bind(W,O)})},p.prototype.handleCloseEvent=function(g){var b=oi.getCloseAction(g),w=oi.getCloseError(g);w&&this.emit("error",w),b&&this.emit(b,{action:b,error:w})},p}(Sn),ma=ga,va=function(){function v(p,g){this.transport=p,this.callback=g,this.bindListeners()}return v.prototype.close=function(){this.unbindListeners(),this.transport.close()},v.prototype.bindListeners=function(){var p=this;this.onMessage=function(g){p.unbindListeners();var b;try{b=oi.processHandshake(g)}catch(w){p.finish("error",{error:w}),p.transport.close();return}b.action==="connected"?p.finish("connected",{connection:new ma(b.id,p.transport),activityTimeout:b.activityTimeout}):(p.finish(b.action,{error:b.error}),p.transport.close())},this.onClosed=function(g){p.unbindListeners();var b=oi.getCloseAction(g)||"backoff",w=oi.getCloseError(g);p.finish(b,{error:w})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},v.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},v.prototype.finish=function(p,g){this.callback(St({transport:this.transport,action:p},g))},v}(),tu=va,eu=function(){function v(p,g){this.timeline=p,this.options=g||{}}return v.prototype.send=function(p,g){this.timeline.isEmpty()||this.timeline.send(yt.TimelineTransport.getAgent(this,p),g)},v}(),nu=eu,iu=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),ba=function(v){iu(p,v);function p(g,b){var w=v.call(this,function(O,W){Z.debug("No callbacks on "+g+" for "+O)})||this;return w.name=g,w.pusher=b,w.subscribed=!1,w.subscriptionPending=!1,w.subscriptionCancelled=!1,w}return p.prototype.authorize=function(g,b){return b(null,{auth:""})},p.prototype.trigger=function(g,b){if(g.indexOf("client-")!==0)throw new M("Event '"+g+"' does not start with 'client-'");if(!this.subscribed){var w=C.buildLogSuffix("triggeringClientEvents");Z.warn("Client event triggered before channel 'subscription_succeeded' event . "+w)}return this.pusher.send_event(g,b,this.name)},p.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},p.prototype.handleEvent=function(g){var b=g.event,w=g.data;if(b==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(g);else if(b==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(g);else if(b.indexOf("pusher_internal:")!==0){var O={};this.emit(b,w,O)}},p.prototype.handleSubscriptionSucceededEvent=function(g){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",g.data)},p.prototype.handleSubscriptionCountEvent=function(g){g.data.subscription_count&&(this.subscriptionCount=g.data.subscription_count),this.emit("pusher:subscription_count",g.data)},p.prototype.subscribe=function(){var g=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,function(b,w){b?(g.subscriptionPending=!1,Z.error(b.toString()),g.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:b.message},b instanceof F?{status:b.status}:{}))):g.pusher.send_event("pusher:subscribe",{auth:w.auth,channel_data:w.channel_data,channel:g.name})}))},p.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},p.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},p.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},p}(Sn),jr=ba,ya=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Cs=function(v){ya(p,v);function p(){return v!==null&&v.apply(this,arguments)||this}return p.prototype.authorize=function(g,b){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:g},b)},p}(jr),Os=Cs,_a=function(){function v(){this.reset()}return v.prototype.get=function(p){return Object.prototype.hasOwnProperty.call(this.members,p)?{id:p,info:this.members[p]}:null},v.prototype.each=function(p){var g=this;te(this.members,function(b,w){p(g.get(w))})},v.prototype.setMyID=function(p){this.myID=p},v.prototype.onSubscription=function(p){this.members=p.presence.hash,this.count=p.presence.count,this.me=this.get(this.myID)},v.prototype.addMember=function(p){return this.get(p.user_id)===null&&this.count++,this.members[p.user_id]=p.user_info,this.get(p.user_id)},v.prototype.removeMember=function(p){var g=this.get(p.user_id);return g&&(delete this.members[p.user_id],this.count--),g},v.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},v}(),$r=_a,wa=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),ru=function(v,p,g,b){function w(O){return O instanceof g?O:new g(function(W){W(O)})}return new(g||(g=Promise))(function(O,W){function Y(ut){try{nt(b.next(ut))}catch(ee){W(ee)}}function rt(ut){try{nt(b.throw(ut))}catch(ee){W(ee)}}function nt(ut){ut.done?O(ut.value):w(ut.value).then(Y,rt)}nt((b=b.apply(v,p||[])).next())})},xa=function(v,p){var g={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},b,w,O,W;return W={next:Y(0),throw:Y(1),return:Y(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function Y(nt){return function(ut){return rt([nt,ut])}}function rt(nt){if(b)throw new TypeError("Generator is already executing.");for(;g;)try{if(b=1,w&&(O=nt[0]&2?w.return:nt[0]?w.throw||((O=w.return)&&O.call(w),0):w.next)&&!(O=O.call(w,nt[1])).done)return O;switch(w=0,O&&(nt=[nt[0]&2,O.value]),nt[0]){case 0:case 1:O=nt;break;case 4:return g.label++,{value:nt[1],done:!1};case 5:g.label++,w=nt[1],nt=[0];continue;case 7:nt=g.ops.pop(),g.trys.pop();continue;default:if(O=g.trys,!(O=O.length>0&&O[O.length-1])&&(nt[0]===6||nt[0]===2)){g=0;continue}if(nt[0]===3&&(!O||nt[1]>O[0]&&nt[1]0&&this.emit("connecting_in",Math.round(g/1e3)),this.retryTimer=new Ct(g||0,function(){b.disconnectInternally(),b.connect()})},p.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},p.prototype.setUnavailableTimer=function(){var g=this;this.unavailableTimer=new Ct(this.options.unavailableTimeout,function(){g.updateState("unavailable")})},p.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},p.prototype.sendActivityCheck=function(){var g=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ct(this.options.pongTimeout,function(){g.timeline.error({pong_timed_out:g.options.pongTimeout}),g.retryIn(0)})},p.prototype.resetActivityCheck=function(){var g=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ct(this.activityTimeout,function(){g.sendActivityCheck()}))},p.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},p.prototype.buildConnectionCallbacks=function(g){var b=this;return St({},g,{message:function(w){b.resetActivityCheck(),b.emit("message",w)},ping:function(){b.send_event("pusher:pong",{})},activity:function(){b.resetActivityCheck()},error:function(w){b.emit("error",w)},closed:function(){b.abandonConnection(),b.shouldRetry()&&b.retryIn(1e3)}})},p.prototype.buildHandshakeCallbacks=function(g){var b=this;return St({},g,{connected:function(w){b.activityTimeout=Math.min(b.options.activityTimeout,w.activityTimeout,w.connection.activityTimeout||1/0),b.clearUnavailableTimer(),b.setConnection(w.connection),b.socket_id=b.connection.id,b.updateState("connected",{socket_id:b.socket_id})}})},p.prototype.buildErrorCallbacks=function(){var g=this,b=function(w){return function(O){O.error&&g.emit("error",{type:"WebSocketError",error:O.error}),w(O)}};return{tls_only:b(function(){g.usingTLS=!0,g.updateStrategy(),g.retryIn(0)}),refused:b(function(){g.disconnect()}),backoff:b(function(){g.retryIn(1e3)}),retry:b(function(){g.retryIn(0)})}},p.prototype.setConnection=function(g){this.connection=g;for(var b in this.connectionCallbacks)this.connection.bind(b,this.connectionCallbacks[b]);this.resetActivityCheck()},p.prototype.abandonConnection=function(){if(this.connection){this.stopActivityCheck();for(var g in this.connectionCallbacks)this.connection.unbind(g,this.connectionCallbacks[g]);var b=this.connection;return this.connection=null,b}},p.prototype.updateState=function(g,b){var w=this.state;if(this.state=g,w!==g){var O=g;O==="connected"&&(O+=" with new socket ID "+b.socket_id),Z.debug("State changed",w+" -> "+O),this.timeline.info({state:g,params:b}),this.emit("state_change",{previous:w,current:g}),this.emit(g,b)}},p.prototype.shouldRetry=function(){return this.state==="connecting"||this.state==="connected"},p}(Sn),ou=Ca,Oa=function(){function v(){this.channels={}}return v.prototype.add=function(p,g){return this.channels[p]||(this.channels[p]=Aa(p,g)),this.channels[p]},v.prototype.all=function(){return re(this.channels)},v.prototype.find=function(p){return this.channels[p]},v.prototype.remove=function(p){var g=this.channels[p];return delete this.channels[p],g},v.prototype.disconnect=function(){te(this.channels,function(p){p.disconnect()})},v}(),ka=Oa;function Aa(v,p){if(v.indexOf("private-encrypted-")===0){if(p.config.nacl)return Fn.createEncryptedChannel(v,p,p.config.nacl);var g="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",b=C.buildLogSuffix("encryptedChannelSupport");throw new I(g+". "+b)}else{if(v.indexOf("private-")===0)return Fn.createPrivateChannel(v,p);if(v.indexOf("presence-")===0)return Fn.createPresenceChannel(v,p);if(v.indexOf("#")===0)throw new B('Cannot create a channel with name "'+v+'".');return Fn.createChannel(v,p)}}var Ea={createChannels:function(){return new ka},createConnectionManager:function(v,p){return new ou(v,p)},createChannel:function(v,p){return new jr(v,p)},createPrivateChannel:function(v,p){return new Os(v,p)},createPresenceChannel:function(v,p){return new ks(v,p)},createEncryptedChannel:function(v,p,g){return new Pi(v,p,g)},createTimelineSender:function(v,p){return new nu(v,p)},createHandshake:function(v,p){return new tu(v,p)},createAssistantToTheTransportManager:function(v,p,g){return new Wr(v,p,g)}},Fn=Ea,au=function(){function v(p){this.options=p||{},this.livesLeft=this.options.lives||1/0}return v.prototype.getAssistant=function(p){return Fn.createAssistantToTheTransportManager(this,p,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},v.prototype.isAlive=function(){return this.livesLeft>0},v.prototype.reportDeath=function(){this.livesLeft-=1},v}(),Pa=au,Ma=function(){function v(p,g){this.strategies=p,this.loop=!!g.loop,this.failFast=!!g.failFast,this.timeout=g.timeout,this.timeoutLimit=g.timeoutLimit}return v.prototype.isSupported=function(){return Xt(this.strategies,Ot.method("isSupported"))},v.prototype.connect=function(p,g){var b=this,w=this.strategies,O=0,W=this.timeout,Y=null,rt=function(nt,ut){ut?g(null,ut):(O=O+1,b.loop&&(O=O%w.length),O0&&(O=new Ct(b.timeout,function(){W.abort(),w(!0)})),W=p.connect(g,function(Y,rt){Y&&O&&O.isRunning()&&!b.failFast||(O&&O.ensureAborted(),w(Y,rt))}),{abort:function(){O&&O.ensureAborted(),W.abort()},forceMinPriority:function(Y){W.forceMinPriority(Y)}}},v}(),ai=Ma,lu=function(){function v(p){this.strategies=p}return v.prototype.isSupported=function(){return Xt(this.strategies,Ot.method("isSupported"))},v.prototype.connect=function(p,g){return cu(this.strategies,p,function(b,w){return function(O,W){if(w[b].error=O,O){Ms(w)&&g(!0);return}oe(w,function(Y){Y.forceMinPriority(W.transport.priority)}),g(null,W)}})},v}(),Ps=lu;function cu(v,p,g){var b=we(v,function(w,O,W,Y){return w.connect(p,g(O,Y))});return{abort:function(){oe(b,uu)},forceMinPriority:function(w){oe(b,function(O){O.forceMinPriority(w)})}}}function Ms(v){return xe(v,function(p){return!!p.error})}function uu(v){!v.error&&!v.aborted&&(v.abort(),v.aborted=!0)}var hu=function(){function v(p,g,b){this.strategy=p,this.transports=g,this.ttl=b.ttl||1800*1e3,this.usingTLS=b.useTLS,this.timeline=b.timeline}return v.prototype.isSupported=function(){return this.strategy.isSupported()},v.prototype.connect=function(p,g){var b=this.usingTLS,w=du(b),O=[this.strategy];if(w&&w.timestamp+this.ttl>=Ot.now()){var W=this.transports[w.transport];W&&(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),O.push(new ai([W],{timeout:w.latency*2+1e3,failFast:!0})))}var Y=Ot.now(),rt=O.pop().connect(p,function nt(ut,ee){ut?(Ut(b),O.length>0?(Y=Ot.now(),rt=O.pop().connect(p,nt)):g(ut)):(qt(b,ee.transport.name,Ot.now()-Y),g(null,ee))});return{abort:function(){rt.abort()},forceMinPriority:function(nt){p=nt,rt&&rt.forceMinPriority(nt)}}},v}(),fu=hu;function Rs(v){return"pusherTransport"+(v?"TLS":"NonTLS")}function du(v){var p=yt.getLocalStorage();if(p)try{var g=p[Rs(v)];if(g)return JSON.parse(g)}catch{Ut(v)}return null}function qt(v,p,g){var b=yt.getLocalStorage();if(b)try{b[Rs(v)]=Se({timestamp:Ot.now(),transport:p,latency:g})}catch{}}function Ut(v){var p=yt.getLocalStorage();if(p)try{delete p[Rs(v)]}catch{}}var pu=function(){function v(p,g){var b=g.delay;this.strategy=p,this.options={delay:b}}return v.prototype.isSupported=function(){return this.strategy.isSupported()},v.prototype.connect=function(p,g){var b=this.strategy,w,O=new Ct(this.options.delay,function(){w=b.connect(p,g)});return{abort:function(){O.ensureAborted(),w&&w.abort()},forceMinPriority:function(W){p=W,w&&w.forceMinPriority(W)}}},v}(),Vr=pu,gu=function(){function v(p,g,b){this.test=p,this.trueBranch=g,this.falseBranch=b}return v.prototype.isSupported=function(){var p=this.test()?this.trueBranch:this.falseBranch;return p.isSupported()},v.prototype.connect=function(p,g){var b=this.test()?this.trueBranch:this.falseBranch;return b.connect(p,g)},v}(),nr=gu,mu=function(){function v(p){this.strategy=p}return v.prototype.isSupported=function(){return this.strategy.isSupported()},v.prototype.connect=function(p,g){var b=this.strategy.connect(p,function(w,O){O&&b.abort(),g(w,O)});return b},v}(),vu=mu;function Mi(v){return function(){return v.isSupported()}}var bu=function(v,p,g){var b={};function w(ar,Gn,Jr,Ka,Zr){var Gs=g(v,ar,Gn,Jr,Ka,Zr);return b[ar]=Gs,Gs}var O=Object.assign({},p,{hostNonTLS:v.wsHost+":"+v.wsPort,hostTLS:v.wsHost+":"+v.wssPort,httpPath:v.wsPath}),W=Object.assign({},O,{useTLS:!0}),Y=Object.assign({},p,{hostNonTLS:v.httpHost+":"+v.httpPort,hostTLS:v.httpHost+":"+v.httpsPort,httpPath:v.httpPath}),rt={loop:!0,timeout:15e3,timeoutLimit:6e4},nt=new Pa({lives:2,minPingDelay:1e4,maxPingDelay:v.activityTimeout}),ut=new Pa({lives:2,minPingDelay:1e4,maxPingDelay:v.activityTimeout}),ee=w("ws","ws",3,O,nt),Tn=w("wss","ws",3,W,nt),tn=w("sockjs","sockjs",1,Y),rr=w("xhr_streaming","xhr_streaming",1,Y,ut),Iu=w("xdr_streaming","xdr_streaming",1,Y,ut),ci=w("xhr_polling","xhr_polling",1,Y),Gr=w("xdr_polling","xdr_polling",1,Y),sr=new ai([ee],rt),Ht=new ai([Tn],rt),Nu=new ai([tn],rt),Xs=new ai([new nr(Mi(rr),rr,Iu)],rt),or=new ai([new nr(Mi(ci),ci,Gr)],rt),Ya=new ai([new nr(Mi(Xs),new Ps([Xs,new Vr(or,{delay:4e3})]),or)],rt),Ys=new nr(Mi(Ya),Ya,Nu),Ks;return p.useTLS?Ks=new Ps([sr,new Vr(Ys,{delay:2e3})]):Ks=new Ps([sr,new Vr(Ht,{delay:2e3}),new Vr(Ys,{delay:5e3})]),new fu(new vu(new nr(Mi(ee),Ks,Ys)),b,{ttl:18e5,timeline:p.timeline,useTLS:p.useTLS})},Te=bu,Ds=function(){var v=this;v.timeline.info(v.buildTimelineMessage({transport:v.name+(v.options.useTLS?"s":"")})),v.hooks.isInitialized()?v.changeState("initialized"):v.hooks.file?(v.changeState("initializing"),y.load(v.hooks.file,{useTLS:v.options.useTLS},function(p,g){v.hooks.isInitialized()?(v.changeState("initialized"),g(!0)):(p&&v.onError(p),v.onClose(),g(!1))})):v.onClose()},li={getRequest:function(v){var p=new window.XDomainRequest;return p.ontimeout=function(){v.emit("error",new D),v.close()},p.onerror=function(g){v.emit("error",g),v.close()},p.onprogress=function(){p.responseText&&p.responseText.length>0&&v.onChunk(200,p.responseText)},p.onload=function(){p.responseText&&p.responseText.length>0&&v.onChunk(200,p.responseText),v.emit("finished",200),v.close()},p},abortRequest:function(v){v.ontimeout=v.onerror=v.onprogress=v.onload=null,v.abort()}},Ra=li,Ls=function(){var v=function(p,g){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var O in w)w.hasOwnProperty(O)&&(b[O]=w[O])},v(p,g)};return function(p,g){v(p,g);function b(){this.constructor=p}p.prototype=g===null?Object.create(g):(b.prototype=g.prototype,new b)}}(),Qe=256*1024,Da=function(v){Ls(p,v);function p(g,b,w){var O=v.call(this)||this;return O.hooks=g,O.method=b,O.url=w,O}return p.prototype.start=function(g){var b=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){b.close()},yt.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(g)},p.prototype.close=function(){this.unloader&&(yt.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},p.prototype.onChunk=function(g,b){for(;;){var w=this.advanceBuffer(b);if(w)this.emit("chunk",{status:g,data:w});else break}this.isBufferTooLong(b)&&this.emit("buffer_too_long")},p.prototype.advanceBuffer=function(g){var b=g.slice(this.position),w=b.indexOf(` `);return w!==-1?(this.position+=w+1,b.slice(0,w)):null},p.prototype.isBufferTooLong=function(g){return this.position===g.length&&g.length>Qe},p}(Sn),La=Da,qr;(function(v){v[v.CONNECTING=0]="CONNECTING",v[v.OPEN=1]="OPEN",v[v.CLOSED=3]="CLOSED"})(qr||(qr={}));var Vn=qr,Ia=1,Na=function(){function v(p,g){this.hooks=p,this.session=Is(1e3)+"/"+qn(8),this.location=Xe(g),this.readyState=Vn.CONNECTING,this.openStream()}return v.prototype.send=function(p){return this.sendRaw(JSON.stringify([p]))},v.prototype.ping=function(){this.hooks.sendHeartbeat(this)},v.prototype.close=function(p,g){this.onClose(p,g,!0)},v.prototype.sendRaw=function(p){if(this.readyState===Vn.OPEN)try{return yt.createSocketRequest("POST",Ye(yu(this.location,this.session))).start(p),!0}catch{return!1}else return!1},v.prototype.reconnect=function(){this.closeStream(),this.openStream()},v.prototype.onClose=function(p,g,b){this.closeStream(),this.readyState=Vn.CLOSED,this.onclose&&this.onclose({code:p,reason:g,wasClean:b})},v.prototype.onChunk=function(p){if(p.status===200){this.readyState===Vn.OPEN&&this.onActivity();var g,b=p.data.slice(0,1);switch(b){case"o":g=JSON.parse(p.data.slice(1)||"{}"),this.onOpen(g);break;case"a":g=JSON.parse(p.data.slice(1)||"[]");for(var w=0;w0&&v.onChunk(g.status,g.responseText);break;case 4:g.responseText&&g.responseText.length>0&&v.onChunk(g.status,g.responseText),v.emit("finished",g.status),v.close();break}},g},abortRequest:function(v){v.onreadystatechange=null,v.abort()}},Bs=wu,xu={createStreamingSocket:function(v){return this.createSocket(Kt,v)},createPollingSocket:function(v){return this.createSocket(Fs,v)},createSocket:function(v,p){return new Xr(v,p)},createXHR:function(v,p){return this.createRequest(Bs,v,p)},createRequest:function(v,p,g){return new La(v,p,g)}},Fa=xu;Fa.createXDR=function(v,p){return this.createRequest(Ra,v,p)};var Su=Fa,Ba={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:m,getDefaultStrategy:Te,Transports:Kc,transportConnectionInitializer:Ds,HTTPFactory:Su,TimelineTransport:Ne,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(v){var p=this;window.Pusher=v;var g=function(){p.onDocumentBody(v.ready)};window.JSON?g():y.load("json2",{},g)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:U,jsonp:ht}},onDocumentBody:function(v){var p=this;document.body?v():setTimeout(function(){p.onDocumentBody(v)},0)},createJSONPRequest:function(v,p){return new de(v,p)},createScriptRequest:function(v){return new Bt(v)},getLocalStorage:function(){try{return window.localStorage}catch{return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){var v=this.getXHRAPI();return new v},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return zr},createWebSocket:function(v){var p=this.getWebSocketAPI();return new p(v)},createSocketRequest:function(v,p){if(this.isXHRSupported())return this.HTTPFactory.createXHR(v,p);if(this.isXDRSupported(p.indexOf("https:")===0))return this.HTTPFactory.createXDR(v,p);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var v=this.getXHRAPI();return!!v&&new v().withCredentials!==void 0},isXDRSupported:function(v){var p=v?"https:":"http:",g=this.getProtocol();return!!window.XDomainRequest&&g===p},addUnloadListener:function(v){window.addEventListener!==void 0?window.addEventListener("unload",v,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",v)},removeUnloadListener:function(v){window.addEventListener!==void 0?window.removeEventListener("unload",v,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",v)},randomInt:function(v){var p=function(){var g=window.crypto||window.msCrypto,b=g.getRandomValues(new Uint32Array(1))[0];return b/Math.pow(2,32)};return Math.floor(p()*v)}},yt=Ba,Yn;(function(v){v[v.ERROR=3]="ERROR",v[v.INFO=6]="INFO",v[v.DEBUG=7]="DEBUG"})(Yn||(Yn={}));var Yr=Yn,Ha=function(){function v(p,g,b){this.key=p,this.session=g,this.events=[],this.options=b||{},this.sent=0,this.uniqueID=0}return v.prototype.log=function(p,g){p<=this.options.level&&(this.events.push(St({},g,{timestamp:Ot.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},v.prototype.error=function(p){this.log(Yr.ERROR,p)},v.prototype.info=function(p){this.log(Yr.INFO,p)},v.prototype.debug=function(p){this.log(Yr.DEBUG,p)},v.prototype.isEmpty=function(){return this.events.length===0},v.prototype.send=function(p,g){var b=this,w=St({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],p(w,function(O,W){O||b.sent++,g&&g(O,W)}),!0},v.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},v}(),za=Ha,Hs=function(){function v(p,g,b,w){this.name=p,this.priority=g,this.transport=b,this.options=w||{}}return v.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},v.prototype.connect=function(p,g){var b=this;if(this.isSupported()){if(this.priorityMath.max(Math.min(e,n),t);function Co(e){return ji(oa(e*2.55),0,255)}function Xi(e){return ji(oa(e*255),0,255)}function Si(e){return ji(oa(e/2.55)/100,0,1)}function im(e){return ji(oa(e*100),0,100)}const Mn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},yf=[..."0123456789ABCDEF"],Mk=e=>yf[e&15],Rk=e=>yf[(e&240)>>4]+yf[e&15],Dl=e=>(e&240)>>4===(e&15),Dk=e=>Dl(e.r)&&Dl(e.g)&&Dl(e.b)&&Dl(e.a);function Lk(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Mn[e[1]]*17,g:255&Mn[e[2]]*17,b:255&Mn[e[3]]*17,a:t===5?Mn[e[4]]*17:255}:(t===7||t===9)&&(n={r:Mn[e[1]]<<4|Mn[e[2]],g:Mn[e[3]]<<4|Mn[e[4]],b:Mn[e[5]]<<4|Mn[e[6]],a:t===9?Mn[e[7]]<<4|Mn[e[8]]:255})),n}const Ik=(e,t)=>e<255?t(e):"";function Nk(e){var t=Dk(e)?Mk:Rk;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Ik(e.a,t):void 0}const Fk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Lb(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function Bk(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Hk(e,t,n){const i=Lb(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function zk(e,t,n,i,r){return e===r?(t-n)/i+(t.5?d/(2-s-a):d/(s+a),u=zk(n,i,r,d,s),u=u*60+.5),[u|0,h||0,l]}function nd(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Xi)}function id(e,t,n){return nd(Lb,e,t,n)}function Wk(e,t,n){return nd(Hk,e,t,n)}function jk(e,t,n){return nd(Bk,e,t,n)}function Ib(e){return(e%360+360)%360}function $k(e){const t=Fk.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Co(+t[5]):Xi(+t[5]));const r=Ib(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Wk(r,s,a):t[1]==="hsv"?i=jk(r,s,a):i=id(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function Uk(e,t){var n=ed(e);n[0]=Ib(n[0]+t),n=id(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Vk(e){if(!e)return;const t=ed(e),n=t[0],i=im(t[1]),r=im(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${Si(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const rm={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},sm={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function qk(){const e={},t=Object.keys(sm),n=Object.keys(rm);let i,r,s,a,l;for(i=0;i>16&255,s>>8&255,s&255]}return e}let Ll;function Xk(e){Ll||(Ll=qk(),Ll.transparent=[0,0,0,0]);const t=Ll[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Yk=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Kk(e){const t=Yk.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?Co(a):ji(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Co(i):ji(i,0,255)),r=255&(t[4]?Co(r):ji(r,0,255)),s=255&(t[6]?Co(s):ji(s,0,255)),{r:i,g:r,b:s,a:n}}}function Gk(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Si(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const jh=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ls=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Jk(e,t,n){const i=ls(Si(e.r)),r=ls(Si(e.g)),s=ls(Si(e.b));return{r:Xi(jh(i+n*(ls(Si(t.r))-i))),g:Xi(jh(r+n*(ls(Si(t.g))-r))),b:Xi(jh(s+n*(ls(Si(t.b))-s))),a:e.a+n*(t.a-e.a)}}function Il(e,t,n){if(e){let i=ed(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=id(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Nb(e,t){return e&&Object.assign(t||{},e)}function om(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Xi(e[3]))):(t=Nb(e,{r:0,g:0,b:0,a:1}),t.a=Xi(t.a)),t}function Zk(e){return e.charAt(0)==="r"?Kk(e):$k(e)}class Uo{constructor(t){if(t instanceof Uo)return t;const n=typeof t;let i;n==="object"?i=om(t):n==="string"&&(i=Lk(t)||Xk(t)||Zk(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Nb(this._rgb);return t&&(t.a=Si(t.a)),t}set rgb(t){this._rgb=om(t)}rgbString(){return this._valid?Gk(this._rgb):void 0}hexString(){return this._valid?Nk(this._rgb):void 0}hslString(){return this._valid?Vk(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const a=n===s?.5:n,l=2*a-1,u=i.a-r.a,h=((l*u===-1?l:(l+u)/(1+l*u))+1)/2;s=1-h,i.r=255&h*i.r+s*r.r+.5,i.g=255&h*i.g+s*r.g+.5,i.b=255&h*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=Jk(this._rgb,t._rgb,n)),this}clone(){return new Uo(this.rgb)}alpha(t){return this._rgb.a=Xi(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=oa(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Il(this._rgb,2,t),this}darken(t){return Il(this._rgb,2,-t),this}saturate(t){return Il(this._rgb,1,t),this}desaturate(t){return Il(this._rgb,1,-t),this}rotate(t){return Uk(this._rgb,t),this}}/*! * Chart.js v4.5.0 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License */function _i(){}const Qk=(()=>{let e=0;return()=>e++})();function Rt(e){return e==null}function ne(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Lt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ue(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function yn(e,t){return ue(e)?e:t}function Tt(e,t){return typeof e>"u"?t:e}const tA=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Fb=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Gt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Vt(e,t,n,i){let r,s,a;if(ne(e))for(s=e.length,r=0;re,x:e=>e.x,y:e=>e.y};function iA(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function rA(e){const t=iA(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Yi(e,t){return(am[t]||(am[t]=rA(t)))(e)}function rd(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qo=e=>typeof e<"u",Ki=e=>typeof e=="function",lm=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function sA(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const zt=Math.PI,Qt=2*zt,oA=Qt+zt,vc=Number.POSITIVE_INFINITY,aA=zt/180,me=zt/2,vr=zt/4,cm=zt*2/3,$i=Math.log10,ri=Math.sign;function Fo(e,t,n){return Math.abs(e-t)r-s).pop(),t}function cA(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ys(e){return!cA(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function uA(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Hb(e,t,n){let i,r,s;for(i=0,r=e.length;iu&&h=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function od(e,t,n){n=n||(a=>e[a]1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const Ci=(e,t,n,i)=>od(e,n,i?r=>{const s=e[r][t];return se[r][t]od(e,n,i=>e[i][t]>=n);function pA(e,t,n){let i=0,r=e.length;for(;ii&&e[r-1]>n;)r--;return i>0||r{const i="_onData"+rd(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[i]=="function"&&l[i](...s)}),a}})})}function fm(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Wb.forEach(s=>{delete e[s]}),delete e._chartjs)}function jb(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const $b=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Ub(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,$b.call(window,()=>{i=!1,e.apply(t,n)}))}}function mA(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const ad=e=>e==="start"?"left":e==="end"?"right":"center",ze=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,vA=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function Vb(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:l,_parsed:u}=e,h=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=a.axis,{min:m,max:y,minDefined:x,maxDefined:S}=a.getUserBounds();if(x){if(r=Math.min(Ci(u,d,m).lo,n?i:Ci(t,d,a.getPixelForValue(m)).lo),h){const C=u.slice(0,r+1).reverse().findIndex(T=>!Rt(T[l.axis]));r-=Math.max(0,C)}r=Pe(r,0,i-1)}if(S){let C=Math.max(Ci(u,a.axis,y,!0).hi+1,n?0:Ci(t,d,a.getPixelForValue(y),!0).hi+1);if(h){const T=u.slice(C-1).findIndex(A=>!Rt(A[l.axis]));C+=Math.max(0,T)}s=Pe(C,r,i)-r}else s=i-r}return{start:r,count:s}}function qb(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const Nl=e=>e===0||e===1,dm=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Qt/n)),pm=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Qt/n)+1,Bo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*me)+1,easeOutSine:e=>Math.sin(e*me),easeInOutSine:e=>-.5*(Math.cos(zt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Nl(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Nl(e)?e:dm(e,.075,.3),easeOutElastic:e=>Nl(e)?e:pm(e,.075,.3),easeInOutElastic(e){return Nl(e)?e:e<.5?.5*dm(e*2,.1125,.45):.5+.5*pm(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Bo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Bo.easeInBounce(e*2)*.5:Bo.easeOutBounce(e*2-1)*.5+.5};function ld(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function gm(e){return ld(e)?e:new Uo(e)}function $h(e){return ld(e)?e:new Uo(e).saturate(.5).darken(.1).hexString()}const bA=["x","y","borderWidth","radius","tension"],yA=["color","borderColor","backgroundColor"];function _A(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:yA},numbers:{type:"number",properties:bA}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function wA(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const mm=new Map;function xA(e,t){t=t||{};const n=e+JSON.stringify(t);let i=mm.get(n);return i||(i=new Intl.NumberFormat(e,t),mm.set(n,i)),i}function aa(e,t,n){return xA(t,n).format(e)}const Xb={values(e){return ne(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const h=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(h<1e-4||h>1e15)&&(r="scientific"),s=SA(e,n)}const a=$i(Math.abs(s)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(u,this.options.ticks.format),aa(e,i,u)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor($i(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?Xb.numeric.call(this,e,t,n):""}};function SA(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Rc={formatters:Xb};function TA(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Rc.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Lr=Object.create(null),wf=Object.create(null);function Ho(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>$h(r.backgroundColor),this.hoverBorderColor=(i,r)=>$h(r.borderColor),this.hoverColor=(i,r)=>$h(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Uh(this,t,n)}get(t){return Ho(this,t)}describe(t,n){return Uh(wf,t,n)}override(t,n){return Uh(Lr,t,n)}route(t,n,i,r){const s=Ho(this,t),a=Ho(this,i),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const u=this[l],h=a[r];return Lt(u)?Object.assign({},h,u):Tt(u,h)},set(u){this[l]=u}}})}apply(t){t.forEach(n=>n(this))}}var ie=new CA({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[_A,wA,TA]);function OA(e){return!e||Rt(e.size)||Rt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function bc(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function kA(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const l=n.length;let u,h,d,m,y;for(u=0;un.length){for(u=0;u0&&e.stroke()}}function Oi(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&s.strokeColor!=="";let u,h;for(e.save(),e.font=r.string,PA(e,s),u=0;u+e||0;function cd(e,t){const n={},i=Lt(t),r=i?Object.keys(t):t,s=Lt(e)?i?a=>Tt(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=NA(s(a));return n}function Kb(e){return cd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Er(e){return cd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ue(e){const t=Kb(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ke(e,t){e=e||{},t=t||ie.font;let n=Tt(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Tt(e.style,t.style);i&&!(""+i).match(LA)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:Tt(e.family,t.family),lineHeight:IA(Tt(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Tt(e.weight,t.weight),string:""};return r.string=OA(r),r}function Oo(e,t,n,i){let r,s,a;for(r=0,s=e.length;rn&&l===0?0:l+u;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Ji(e,t){return Object.assign(Object.create(e),t)}function ud(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=Qb("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:l=>ud([l,...e],t,s,i)};return new Proxy(a,{deleteProperty(l,u){return delete l[u],delete l._keys,delete e[0][u],!0},get(l,u){return Jb(l,u,()=>VA(u,t,e,l))},getOwnPropertyDescriptor(l,u){return Reflect.getOwnPropertyDescriptor(l._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,u){return ym(l).includes(u)},ownKeys(l){return ym(l)},set(l,u,h){const d=l._storage||(l._storage=r());return l[u]=d[u]=h,delete l._keys,!0}})}function _s(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Gb(e,i),setContext:s=>_s(e,s,n,i),override:s=>_s(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,l){return Jb(s,a,()=>HA(s,a,l))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,l){return e[a]=l,delete s[a],!0}})}function Gb(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:Ki(n)?n:()=>n,isIndexable:Ki(i)?i:()=>i}}const BA=(e,t)=>e?e+rd(t):t,hd=(e,t)=>Lt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Jb(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function HA(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let l=i[t];return Ki(l)&&a.isScriptable(t)&&(l=zA(t,l,e,n)),ne(l)&&l.length&&(l=WA(t,l,e,a.isIndexable)),hd(t,l)&&(l=_s(l,r,s&&s[t],a)),l}function zA(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let u=t(s,a||i);return l.delete(e),hd(e,u)&&(u=fd(r._scopes,r,e,u)),u}function WA(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:l}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(Lt(t[0])){const u=t,h=r._scopes.filter(d=>d!==u);t=[];for(const d of u){const m=fd(h,r,e,d);t.push(_s(m,s,a&&a[e],l))}}return t}function Zb(e,t,n){return Ki(e)?e(t,n):e}const jA=(e,t)=>e===!0?t:typeof e=="string"?Yi(t,e):void 0;function $A(e,t,n,i,r){for(const s of t){const a=jA(n,s);if(a){e.add(a);const l=Zb(a._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==i)return l}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function fd(e,t,n,i){const r=t._rootScopes,s=Zb(t._fallback,n,i),a=[...e,...r],l=new Set;l.add(i);let u=bm(l,a,n,s||n,i);return u===null||typeof s<"u"&&s!==n&&(u=bm(l,a,s,u,i),u===null)?!1:ud(Array.from(l),[""],r,s,()=>UA(t,n,i))}function bm(e,t,n,i,r){for(;n;)n=$A(e,t,n,i,r);return n}function UA(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return ne(r)&&Lt(n)?n:r||{}}function VA(e,t,n,i){let r;for(const s of t)if(r=Qb(BA(s,e),n),typeof r<"u")return hd(e,r)?fd(n,i,e,r):r}function Qb(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function ym(e){let t=e._keys;return t||(t=e._keys=qA(e._scopes)),t}function qA(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function ty(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let l,u,h,d;for(l=0,u=i;lte==="x"?"y":"x";function YA(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,l=_f(s,r),u=_f(a,s);let h=l/(l+u),d=u/(l+u);h=isNaN(h)?0:h,d=isNaN(d)?0:d;const m=i*h,y=i*d;return{previous:{x:s.x-m*(a.x-r.x),y:s.y-m*(a.y-r.y)},next:{x:s.x+y*(a.x-r.x),y:s.y+y*(a.y-r.y)}}}function KA(e,t,n){const i=e.length;let r,s,a,l,u,h=ws(e,0);for(let d=0;d!h.skip)),t.cubicInterpolationMode==="monotone")JA(e,r);else{let h=i?e[e.length-1]:e[0];for(s=0,a=e.length;se.ownerDocument.defaultView.getComputedStyle(e,null);function tE(e,t){return Ic(e).getPropertyValue(t)}const eE=["top","right","bottom","left"];function Pr(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=eE[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const nE=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function iE(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,l,u;if(nE(r,s,e.target))l=r,u=s;else{const h=t.getBoundingClientRect();l=i.clientX-h.left,u=i.clientY-h.top,a=!0}return{x:l,y:u,box:a}}function xr(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=Ic(n),s=r.boxSizing==="border-box",a=Pr(r,"padding"),l=Pr(r,"border","width"),{x:u,y:h,box:d}=iE(e,n),m=a.left+(d&&l.left),y=a.top+(d&&l.top);let{width:x,height:S}=t;return s&&(x-=a.width+l.width,S-=a.height+l.height),{x:Math.round((u-m)/x*n.width/i),y:Math.round((h-y)/S*n.height/i)}}function rE(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&pd(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),l=Ic(s),u=Pr(l,"border","width"),h=Pr(l,"padding");t=a.width-h.width-u.width,n=a.height-h.height-u.height,i=yc(l.maxWidth,s,"clientWidth"),r=yc(l.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||vc,maxHeight:r||vc}}const Bl=e=>Math.round(e*10)/10;function sE(e,t,n,i){const r=Ic(e),s=Pr(r,"margin"),a=yc(r.maxWidth,e,"clientWidth")||vc,l=yc(r.maxHeight,e,"clientHeight")||vc,u=rE(e,t,n);let{width:h,height:d}=u;if(r.boxSizing==="content-box"){const y=Pr(r,"border","width"),x=Pr(r,"padding");h-=x.width+y.width,d-=x.height+y.height}return h=Math.max(0,h-s.width),d=Math.max(0,i?h/i:d-s.height),h=Bl(Math.min(h,a,u.maxWidth)),d=Bl(Math.min(d,l,u.maxHeight)),h&&!d&&(d=Bl(h/2)),(t!==void 0||n!==void 0)&&i&&u.height&&d>u.height&&(d=u.height,h=Bl(Math.floor(d*i))),{width:h,height:d}}function _m(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const oE=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};dd()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function wm(e,t){const n=tE(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Sr(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function aE(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function lE(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=Sr(e,r,n),l=Sr(r,s,n),u=Sr(s,t,n),h=Sr(a,l,n),d=Sr(l,u,n);return Sr(h,d,n)}const cE=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},uE=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function fs(e,t,n){return e?cE(t,n):uE()}function ny(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function iy(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ry(e){return e==="angle"?{between:Xo,compare:hA,normalize:We}:{between:Ti,compare:(t,n)=>t-n,normalize:t=>t}}function xm({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function hE(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:l}=ry(i),u=t.length;let{start:h,end:d,loop:m}=e,y,x;if(m){for(h+=u,d+=u,y=0,x=u;yu(r,B,A)&&l(r,B)!==0,R=()=>l(s,A)===0||u(s,B,A),N=()=>C||D(),I=()=>!C||R();for(let j=d,q=d;j<=m;++j)M=t[j%a],!M.skip&&(A=h(M[i]),A!==B&&(C=u(A,r,s),T===null&&N()&&(T=l(A,r)===0?j:q),T!==null&&I()&&(S.push(xm({start:T,end:j,loop:y,count:a,style:x})),T=null),q=j,B=A));return T!==null&&S.push(xm({start:T,end:m,loop:y,count:a,style:x})),S}function oy(e,t){const n=[],i=e.segments;for(let r=0;rr&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function dE(e,t,n,i){const r=e.length,s=[];let a=t,l=e[t],u;for(u=t+1;u<=n;++u){const h=e[u%r];h.skip||h.stop?l.skip||(i=!1,s.push({start:t%r,end:(u-1)%r,loop:i}),t=a=h.stop?u:null):(a=u,l.skip&&(t=u)),l=h}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function pE(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:l}=fE(n,r,s,i);if(i===!0)return Sm(e,[{start:a,end:l,loop:s}],n,t);const u=ll({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=$b.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,l=!1,u;for(;a>=0;--a)u=s[a],u._active?(u._total>i.duration&&(i.duration=u._total),u.tick(t),l=!0):(s[a]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var wi=new bE;const Cm="transparent",yE={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=gm(e||Cm),r=i.valid&&gm(t||Cm);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class _E{constructor(t,n,i,r){const s=n[i];r=Oo([t.to,r,s,t.from]);const a=Oo([t.from,s,r]);this._active=!0,this._fn=t.fn||yE[t.type||typeof a],this._easing=Bo[t.easing]||Bo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=Oo([t.to,n,r,t.from]),this._from=Oo([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,l=this._to;let u;if(this._active=s!==l&&(a||n1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[r]=this._fn(s,l,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r{const s=t[r];if(!Lt(s))return;const a={};for(const l of n)a[l]=s[l];(ne(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!i.has(l))&&i.set(l,a)})})}_animateOptions(t,n){const i=n.options,r=xE(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&wE(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),l=Date.now();let u;for(u=a.length-1;u>=0;--u){const h=a[u];if(h.charAt(0)==="$")continue;if(h==="options"){r.push(...this._animateOptions(t,n));continue}const d=n[h];let m=s[h];const y=i.get(h);if(m)if(y&&m.active()){m.update(y,d,l);continue}else m.cancel();if(!y||!y.duration){t[h]=d;continue}s[h]=m=new _E(y,t,h,d),r.push(m)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return wi.add(this._chart,i),!0}}function wE(e,t){const n=[],i=Object.keys(t);for(let r=0;r0||!n&&s<0)return r.index}return null}function Em(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:l}=i,u=s.axis,h=a.axis,d=OE(s,a,i),m=t.length;let y;for(let x=0;xn[i].axis===t).shift()}function EE(e,t){return Ji(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function PE(e,t,n){return Ji(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function vo(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const Xh=e=>e==="reset"||e==="none",Pm=(e,t)=>t?e:Object.assign({},e),ME=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:cy(n,!0),values:null};class $n{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Vh(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&vo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(m,y,x,S)=>m==="x"?y:m==="r"?S:x,s=n.xAxisID=Tt(i.xAxisID,qh(t,"x")),a=n.yAxisID=Tt(i.yAxisID,qh(t,"y")),l=n.rAxisID=Tt(i.rAxisID,qh(t,"r")),u=n.indexAxis,h=n.iAxisID=r(u,s,a,l),d=n.vAxisID=r(u,a,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(h),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&fm(this._data,this),t._stacked&&vo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Lt(n)){const r=this._cachedMeta;this._data=CE(n,r)}else if(i!==n){if(i){fm(i,this);const r=this._cachedMeta;vo(r),r._parsed=[]}n&&Object.isExtensible(n)&&gA(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=Vh(n.vScale,n),n.stack!==i.stack&&(r=!0,vo(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(Em(this,n._parsed),n._stacked=Vh(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,l=s.axis;let u=t===0&&n===r.length?!0:i._sorted,h=t>0&&i._parsed[t-1],d,m,y;if(this._parsing===!1)i._parsed=r,i._sorted=!0,y=r;else{ne(r[t])?y=this.parseArrayData(i,r,t,n):Lt(r[t])?y=this.parseObjectData(i,r,t,n):y=this.parsePrimitiveData(i,r,t,n);const x=()=>m[l]===null||h&&m[l]C||m=0;--y)if(!S()){this.updateRangeFromParsed(h,t,x,u);break}}return h}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r=0&&tthis.getContext(i,r,n),C=h.resolveNamedOptions(y,x,S,m);return C.$shared&&(C.$shared=u,s[a]=Object.freeze(Pm(C,u))),C}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,l=s[a];if(l)return l;let u;if(r.options.animation!==!1){const d=this.chart.config,m=d.datasetAnimationScopeKeys(this._type,n),y=d.getOptionScopes(this.getDataset(),m);u=d.createResolver(y,this.getContext(t,i,n))}const h=new ly(r,u&&u.animations);return u&&u._cacheable&&(s[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Xh(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){Xh(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!Xh(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[l,u,h]of this._syncList)this[l](u,h);this._syncList=[];const r=i.length,s=n.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s{for(h.length+=n,l=h.length-1;l>=a;l--)h[l]=h[l-n]};for(u(s),l=t;lr-s))}return e._cache.$bar}function DE(e){const t=e.iScale,n=RE(t,e.type);let i=t._length,r,s,a,l;const u=()=>{a===32767||a===-32768||(qo(l)&&(i=Math.min(i,Math.abs(a-l)||i)),l=a)};for(r=0,s=n.length;r0?r[e-1]:null,l=eMath.abs(l)&&(u=l,h=a),t[n.axis]=h,t._custom={barStart:u,barEnd:h,start:r,end:s,min:a,max:l}}function uy(e,t,n,i){return ne(e)?NE(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Mm(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),l=r===s,u=[];let h,d,m,y;for(h=n,d=n+i;h=n?1:-1)}function BE(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.based.controller.options.grouped),s=i.options.stacked,a=[],l=this._cachedMeta.controller.getParsed(n),u=l&&l[i.axis],h=d=>{const m=d._parsed.find(x=>x[i.axis]===u),y=m&&m[d.vScale.axis];if(Rt(y)||isNaN(y))return!0};for(const d of r)if(!(n!==void 0&&h(d))&&((s===!1||a.indexOf(d.stack)===-1||s===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Tt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),l=r.getLabelForValue(a.x),u=s.getLabelForValue(a.y),h=a._custom;return{label:i[t]||"",value:"("+l+", "+u+(h?", "+h:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,r),d=a.axis,m=l.axis;for(let y=n;yXo(B,l,u,!0)?1:Math.max(D,D*n,R,R*n),S=(B,D,R)=>Xo(B,l,u,!0)?-1:Math.min(D,D*n,R,R*n),C=x(0,h,m),T=x(me,d,y),A=S(zt,h,m),M=S(zt+me,d,y);i=(C-A)/2,r=(T-M)/2,s=-(C+A)/2,a=-(T+M)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class Or extends $n{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=u=>+i[u];if(Lt(i[t])){const{key:u="value"}=this._parsing;s=h=>+Yi(i[h],u)}let a,l;for(a=t,l=t+n;a0&&!isNaN(t)?Qt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=aa(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const i=this.chart;let r,s,a,l,u;if(!t){for(r=0,s=i.data.datasets.length;rt!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ot(Or,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class nc extends $n{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:l,count:u}=Vb(n,r,a);this._drawStart=l,this._drawCount=u,qb(n)&&(l=0,u=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:h},t),this.updateElements(r,l,u,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:l,_stacked:u,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:m}=this._getSharedOptions(n,r),y=a.axis,x=l.axis,{spanGaps:S,segment:C}=this.options,T=ys(S)?S:Number.POSITIVE_INFINITY,A=this.chart._animationsDisabled||s||r==="none",M=n+i,B=t.length;let D=n>0&&this.getParsed(n-1);for(let R=0;R=M){I.skip=!0;continue}const j=this.getParsed(R),q=Rt(j[x]),F=I[y]=a.getPixelForValue(j[y],R),H=I[x]=s||q?l.getBasePixel():l.getPixelForValue(u?this.applyStack(l,j,u):j[x],R);I.skip=isNaN(F)||isNaN(H)||q,I.stop=R>0&&Math.abs(j[y]-D[y])>T,C&&(I.parsed=j,I.raw=h.data[R]),m&&(I.options=d||this.resolveDataElementOptions(R,N.active?"active":r)),A||this.updateElement(N,R,I,r),D=j}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ot(nc,"id","line"),ot(nc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ot(nc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class zo extends $n{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=aa(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return ty.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(sn.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),l=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,u=a.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,m=h.yCenter,y=h.getIndexAngle(0)-.5*zt;let x=y,S;const C=360/this.countVisibleElements();for(S=0;S{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?jn(this.resolveDataElementOptions(t,n).angle||i):0}}ot(zo,"id","polarArea"),ot(zo,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),ot(zo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const u=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:u.backgroundColor,strokeStyle:u.borderColor,fontColor:r,lineWidth:u.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Sf extends Or{}ot(Sf,"id","pie"),ot(Sf,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ic extends $n{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return ty.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,l,t)}this.updateElements(r,0,r.length,t)}updateElements(t,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let l=n;l0&&this.getParsed(n-1);for(let D=n;D0&&Math.abs(N[x]-B[x])>A,T&&(I.parsed=N,I.raw=h.data[D]),y&&(I.options=m||this.resolveDataElementOptions(D,R.active?"active":r)),M||this.updateElement(R,D,I,r),B=N}this.updateSharedOptions(m,r,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let u=n.length-1;u>=0;--u)l=Math.max(l,n[u].size(this.resolveDataElementOptions(u))/2);return l>0&&l}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}ot(rc,"id","scatter"),ot(rc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),ot(rc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var $E=Object.freeze({__proto__:null,BarController:tc,BubbleController:ec,DoughnutController:Or,LineController:nc,PieController:Sf,PolarAreaController:zo,RadarController:ic,ScatterController:rc});function yr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class gd{constructor(t){ot(this,"options");this.options=t||{}}static override(t){Object.assign(gd.prototype,t)}init(){}formats(){return yr()}parse(){return yr()}format(){return yr()}add(){return yr()}diff(){return yr()}startOf(){return yr()}endOf(){return yr()}}var UE={_date:gd};function VE(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,l=r._cachedMeta.iScale,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&a&&s.length){const h=l._reversePixels?dA:Ci;if(i){if(r._sharedOptions){const d=s[0],m=typeof d.getRange=="function"&&d.getRange(t);if(m){const y=h(s,t,n-m),x=h(s,t,n+m);return{lo:y.lo,hi:x.hi}}}}else{const d=h(s,t,n);if(u){const{vScale:m}=r._cachedMeta,{_parsed:y}=e,x=y.slice(0,d.lo+1).reverse().findIndex(C=>!Rt(C[m.axis]));d.lo-=Math.max(0,x);const S=y.slice(d.hi).findIndex(C=>!Rt(C[m.axis]));d.hi+=Math.max(0,S)}return d}}return{lo:0,hi:s.length-1}}function Nc(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let l=0,u=s.length;l{u[a]&&u[a](t[n],r)&&(s.push({element:u,datasetIndex:h,index:d}),l=l||u.inRange(t.x,t.y,r))}),i&&!l?[]:s}var KE={modes:{index(e,t,n,i){const r=xr(t,e),s=n.axis||"x",a=n.includeInvisible||!1,l=n.intersect?Kh(e,r,s,i,a):Gh(e,r,s,!1,i,a),u=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(h=>{const d=l[0].index,m=h.data[d];m&&!m.skip&&u.push({element:m,datasetIndex:h.index,index:d})}),u):[]},dataset(e,t,n,i){const r=xr(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let l=n.intersect?Kh(e,r,s,i,a):Gh(e,r,s,!1,i,a);if(l.length>0){const u=l[0].datasetIndex,h=e.getDatasetMeta(u).data;l=[];for(let d=0;dn.pos===t)}function Im(e,t){return e.filter(n=>hy.indexOf(n.pos)===-1&&n.box.axis===t)}function yo(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function GE(e){const t=[];let n,i,r,s,a,l;for(n=0,i=(e||[]).length;nh.box.fullSize),!0),i=yo(bo(t,"left"),!0),r=yo(bo(t,"right")),s=yo(bo(t,"top"),!0),a=yo(bo(t,"bottom")),l=Im(t,"x"),u=Im(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(u).concat(a).concat(l),chartArea:bo(t,"chartArea"),vertical:i.concat(r).concat(u),horizontal:s.concat(a).concat(l)}}function Nm(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function fy(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function tP(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!Lt(r)){n.size&&(e[r]-=n.size);const m=i[n.stack]||{size:0,count:1};m.size=Math.max(m.size,n.horizontal?s.height:s.width),n.size=m.size/m.count,e[r]+=n.size}s.getPadding&&fy(a,s.getPadding());const l=Math.max(0,t.outerWidth-Nm(a,e,"left","right")),u=Math.max(0,t.outerHeight-Nm(a,e,"top","bottom")),h=l!==e.w,d=u!==e.h;return e.w=l,e.h=u,n.horizontal?{same:h,other:d}:{same:d,other:h}}function eP(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function nP(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function ko(e,t,n,i){const r=[];let s,a,l,u,h,d;for(s=0,a=e.length,h=0;s{typeof C.beforeLayout=="function"&&C.beforeLayout()});const d=u.reduce((C,T)=>T.box.options&&T.box.options.display===!1?C:C+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/d,hBoxMaxHeight:a/2}),y=Object.assign({},r);fy(y,Ue(i));const x=Object.assign({maxPadding:y,w:s,h:a,x:r.left,y:r.top},r),S=ZE(u.concat(h),m);ko(l.fullSize,x,m,S),ko(u,x,m,S),ko(h,x,m,S)&&ko(u,x,m,S),eP(x),Fm(l.leftAndTop,x,m,S),x.x+=x.w,x.y+=x.h,Fm(l.rightAndBottom,x,m,S),e.chartArea={left:x.left,top:x.top,right:x.left+x.w,bottom:x.top+x.h,height:x.h,width:x.w},Vt(l.chartArea,C=>{const T=C.box;Object.assign(T,e.chartArea),T.update(x.w,x.h,{left:0,top:0,right:0,bottom:0})})}};class dy{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class iP extends dy{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const sc="$chartjs",rP={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bm=e=>e===null||e==="";function sP(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[sc]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Bm(r)){const s=wm(e,"width");s!==void 0&&(e.width=s)}if(Bm(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=wm(e,"height");s!==void 0&&(e.height=s)}return e}const py=oE?{passive:!0}:!1;function oP(e,t,n){e&&e.addEventListener(t,n,py)}function aP(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,py)}function lP(e,t){const n=rP[e.type]||e.type,{x:i,y:r}=xr(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function _c(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function cP(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||_c(l.addedNodes,i),a=a&&!_c(l.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function uP(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const l of s)a=a||_c(l.removedNodes,i),a=a&&!_c(l.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const Ko=new Map;let Hm=0;function gy(){const e=window.devicePixelRatio;e!==Hm&&(Hm=e,Ko.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function hP(e,t){Ko.size||window.addEventListener("resize",gy),Ko.set(e,t)}function fP(e){Ko.delete(e),Ko.size||window.removeEventListener("resize",gy)}function dP(e,t,n){const i=e.canvas,r=i&&pd(i);if(!r)return;const s=Ub((l,u)=>{const h=r.clientWidth;n(l,u),h{const u=l[0],h=u.contentRect.width,d=u.contentRect.height;h===0&&d===0||s(h,d)});return a.observe(r),hP(e,s),a}function Jh(e,t,n){n&&n.disconnect(),t==="resize"&&fP(e)}function pP(e,t,n){const i=e.canvas,r=Ub(s=>{e.ctx!==null&&n(lP(s,e))},e);return oP(i,t,r),r}class gP extends dy{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(sP(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[sc])return!1;const i=n[sc].initial;["height","width"].forEach(s=>{const a=i[s];Rt(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[sc],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:cP,detach:uP,resize:dP}[n]||pP;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:Jh,detach:Jh,resize:Jh}[n]||aP)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return sE(t,n,i,r)}isAttached(t){const n=t&&pd(t);return!!(n&&n.isConnected)}}function mP(e){return!dd()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?iP:gP}var Xl;let Ai=(Xl=class{constructor(){ot(this,"x");ot(this,"y");ot(this,"active",!1);ot(this,"options");ot(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return ys(this.x)&&ys(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}},ot(Xl,"defaults",{}),ot(Xl,"defaultRoutes"),Xl);function vP(e,t){const n=e.options.ticks,i=bP(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?_P(t):[],a=s.length,l=s[0],u=s[a-1],h=[];if(a>r)return wP(t,h,s,a/r),h;const d=yP(s,t,r);if(a>0){let m,y;const x=a>1?Math.round((u-l)/(a-1)):null;for(Wl(t,h,d,Rt(x)?0:l-x,l),m=0,y=a-1;mr)return u}return Math.max(r,1)}function _P(e){const t=[];let n,i;for(n=0,i=e.length;ne==="left"?"right":e==="right"?"left":e,zm=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Wm=(e,t)=>Math.min(t||e,e);function jm(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;sa+l)))return u}function CP(e,t){Vt(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;si?i:n,i=r&&n>i?n:i,{min:yn(n,yn(i,n)),max:yn(i,yn(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Gt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=FA(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=l=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const d=this._getLabelSizes(),m=d.widest.width,y=d.highest.height,x=Pe(this.chart.width-m,0,this.maxWidth);l=t.offset?this.maxWidth/i:x/(i-1),m+6>l&&(l=x/(i-(t.offset?.5:1)),u=this.maxHeight-_o(t.grid)-n.padding-$m(t.title,this.chart.options.font),h=Math.sqrt(m*m+y*y),a=sd(Math.min(Math.asin(Pe((d.highest.height+6)/l,-1,1)),Math.asin(Pe(u/h,-1,1))-Math.asin(Pe(y/h,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Gt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Gt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const u=$m(r,n.options.font);if(l?(t.width=this.maxWidth,t.height=_o(s)+u):(t.height=this.maxHeight,t.width=_o(s)+u),i.display&&this.ticks.length){const{first:h,last:d,widest:m,highest:y}=this._getLabelSizes(),x=i.padding*2,S=jn(this.labelRotation),C=Math.cos(S),T=Math.sin(S);if(l){const A=i.mirror?0:T*m.width+C*y.height;t.height=Math.min(this.maxHeight,t.height+A+x)}else{const A=i.mirror?0:C*m.width+T*y.height;t.width=Math.min(this.maxWidth,t.width+A+x)}this._calculatePadding(h,d,T,C)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:a},position:l}=this.options,u=this.labelRotation!==0,h=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let y=0,x=0;u?h?(y=r*t.width,x=i*n.height):(y=i*t.height,x=r*n.width):s==="start"?x=n.width:s==="end"?y=t.width:s!=="inner"&&(y=t.width/2,x=n.width/2),this.paddingLeft=Math.max((y-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((x-m+a)*this.width/(this.width-m),0)}else{let d=n.height/2,m=t.height/2;s==="start"?(d=0,m=t.height):s==="end"&&(d=n.height,m=0),this.paddingTop=d+a,this.paddingBottom=m+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Gt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n({width:a[q]||0,height:l[q]||0});return{first:j(0),last:j(n-1),widest:j(N),highest:j(I),widths:a,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return fA(this._alignToPixels?br(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&tl*r?l/i:u/r:u*r0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:l}=r,u=s.offset,h=this.isHorizontal(),m=this.ticks.length+(u?1:0),y=_o(s),x=[],S=l.setContext(this.getContext()),C=S.display?S.width:0,T=C/2,A=function(it){return br(i,it,C)};let M,B,D,R,N,I,j,q,F,H,U,V;if(a==="top")M=A(this.bottom),I=this.bottom-y,q=M-T,H=A(t.top)+T,V=t.bottom;else if(a==="bottom")M=A(this.top),H=t.top,V=A(t.bottom)-T,I=M+T,q=this.top+y;else if(a==="left")M=A(this.right),N=this.right-y,j=M-T,F=A(t.left)+T,U=t.right;else if(a==="right")M=A(this.left),F=t.left,U=A(t.right)-T,N=M+T,j=this.left+y;else if(n==="x"){if(a==="center")M=A((t.top+t.bottom)/2+.5);else if(Lt(a)){const it=Object.keys(a)[0],K=a[it];M=A(this.chart.scales[it].getPixelForValue(K))}H=t.top,V=t.bottom,I=M+T,q=I+y}else if(n==="y"){if(a==="center")M=A((t.left+t.right)/2);else if(Lt(a)){const it=Object.keys(a)[0],K=a[it];M=A(this.chart.scales[it].getPixelForValue(K))}N=M-T,j=N-y,F=t.left,U=t.right}const st=Tt(r.ticks.maxTicksLimit,m),tt=Math.max(1,Math.ceil(m/st));for(B=0;B0&&(Nt-=xt/2);break}wt={left:Nt,top:Ct,width:xt+vt.width,height:Ft+vt.height,color:tt.backdropColor}}T.push({label:D,font:q,textOffset:U,options:{rotation:C,color:K,strokeColor:ct,strokeWidth:dt,textAlign:_t,textBaseline:V,translation:[R,N],backdrop:wt}})}return T}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-jn(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),l=t+s,u=a.widest.width;let h,d;return n==="left"?r?(d=this.right+s,i==="near"?h="left":i==="center"?(h="center",d+=u/2):(h="right",d+=u)):(d=this.right-l,i==="near"?h="right":i==="center"?(h="center",d-=u/2):(h="left",d=this.left)):n==="right"?r?(d=this.left+s,i==="near"?h="right":i==="center"?(h="center",d-=u/2):(h="left",d-=u)):(d=this.left+l,i==="near"?h="left":i==="center"?(h="center",d+=u/2):(h="right",d=this.right)):h="right",{textAlign:h,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const l=(u,h,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(u.x,u.y),i.lineTo(h.x,h.y),i.stroke(),i.restore())};if(n.display)for(s=0,a=r.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),l=a.pop(),u=a.join(".");ie.route(s,r,u,l)})}function RP(e){return"id"in e&&"defaults"in e}class DP{constructor(){this.controllers=new jl($n,"datasets",!0),this.elements=new jl(Ai,"elements"),this.plugins=new jl(Object,"plugins"),this.scales=new jl(Nr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Vt(r,a=>{const l=i||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,n,i){const r=rd(t);Gt(i["before"+r],[],i),n[t](i),Gt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;ns.filter(l=>!a.some(u=>l.plugin.id===u.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function IP(e){const t={},n=[],i=Object.keys(ei.plugins.items);for(let s=0;s1&&Um(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Vm(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function jP(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Vm(e,"x",n[0])||Vm(e,"y",n[0])}return{}}function $P(e,t){const n=Lr[e.type]||{scales:{}},i=t.scales||{},r=Tf(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const l=i[a];if(!Lt(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const u=Cf(a,l,jP(a,e),ie.scales[l.type]),h=zP(u,r),d=n.scales||{};s[a]=No(Object.create(null),[{axis:u},l,d[u],d[h]])}),e.data.datasets.forEach(a=>{const l=a.type||e.type,u=a.indexAxis||Tf(l,t),d=(Lr[l]||{}).scales||{};Object.keys(d).forEach(m=>{const y=HP(m,u),x=a[y+"AxisID"]||y;s[x]=s[x]||Object.create(null),No(s[x],[{axis:y},i[x],d[m]])})}),Object.keys(s).forEach(a=>{const l=s[a];No(l,[ie.scales[l.type],ie.scale])}),s}function my(e){const t=e.options||(e.options={});t.plugins=Tt(t.plugins,{}),t.scales=$P(e,t)}function vy(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function UP(e){return e=e||{},e.data=vy(e.data),my(e),e}const qm=new Map,by=new Set;function $l(e,t){let n=qm.get(e);return n||(n=t(),qm.set(e,n),by.add(n)),n}const wo=(e,t,n)=>{const i=Yi(t,n);i!==void 0&&e.add(i)};class VP{constructor(t){this._config=UP(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=vy(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),my(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $l(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return $l(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return $l(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return $l(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),l=a.get(n);if(l)return l;const u=new Set;n.forEach(d=>{t&&(u.add(t),d.forEach(m=>wo(u,t,m))),d.forEach(m=>wo(u,r,m)),d.forEach(m=>wo(u,Lr[s]||{},m)),d.forEach(m=>wo(u,ie,m)),d.forEach(m=>wo(u,wf,m))});const h=Array.from(u);return h.length===0&&h.push(Object.create(null)),by.has(n)&&a.set(n,h),h}chartOptionScopes(){const{options:t,type:n}=this;return[t,Lr[n]||{},ie.datasets[n]||{},{type:n},ie,wf]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:l}=Xm(this._resolverCache,t,r);let u=a;if(XP(a,n)){s.$shared=!1,i=Ki(i)?i():i;const h=this.createResolver(t,i,l);u=_s(a,i,h)}for(const h of n)s[h]=u[h];return s}createResolver(t,n,i=[""],r){const{resolver:s}=Xm(this._resolverCache,t,i);return Lt(n)?_s(s,n,void 0,r):s}}function Xm(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:ud(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},i.set(r,s)),s}const qP=e=>Lt(e)&&Object.getOwnPropertyNames(e).some(t=>Ki(e[t]));function XP(e,t){const{isScriptable:n,isIndexable:i}=Gb(e);for(const r of t){const s=n(r),a=i(r),l=(a||s)&&e[r];if(s&&(Ki(l)||qP(l))||a&&ne(l))return!0}return!1}var YP="4.5.0";const KP=["top","bottom","left","right","chartArea"];function Ym(e,t){return e==="top"||e==="bottom"||KP.indexOf(e)===-1&&t==="x"}function Km(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Gm(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Gt(n&&n.onComplete,[e],t)}function GP(e){const t=e.chart,n=t.options.animation;Gt(n&&n.onProgress,[e],t)}function yy(e){return dd()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const oc={},Jm=e=>{const t=yy(e);return Object.values(oc).filter(n=>n.canvas===t).pop()};function JP(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function ZP(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}class Jt{static register(...t){ei.add(...t),Zm()}static unregister(...t){ei.remove(...t),Zm()}constructor(t,n){const i=this.config=new VP(n),r=yy(t),s=Jm(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||mP(r)),this.platform.updateConfig(i);const l=this.platform.acquireContext(r,a.aspectRatio),u=l&&l.canvas,h=u&&u.height,d=u&&u.width;if(this.id=Qk(),this.ctx=l,this.canvas=u,this.width=d,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new LP,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=mA(m=>this.update(m),a.resizeDelay||0),this._dataChanges=[],oc[this.id]=this,!l||!u){console.error("Failed to create chart: can't acquire context from the given item");return}wi.listen(this,"complete",Gm),wi.listen(this,"progress",GP),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return Rt(t)?n&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ei}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_m(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return vm(this.canvas,this.ctx),this}stop(){return wi.stop(this),this}resize(t,n){wi.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),l=i.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,_m(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Gt(i.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Vt(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,l)=>(a[l]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const l=n[a],u=Cf(a,l),h=u==="r",d=u==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),Vt(s,a=>{const l=a.options,u=l.id,h=Cf(u,l),d=Tt(l.type,a.dtype);(l.position===void 0||Ym(l.position,h)!==Ym(a.dposition))&&(l.position=a.dposition),r[u]=!0;let m=null;if(u in i&&i[u].type===d)m=i[u];else{const y=ei.getScale(d);m=new y({id:u,type:d,ctx:this.ctx,chart:this}),i[m.id]=m}m.init(l,t)}),Vt(r,(a,l)=>{a||delete i[l]}),Vt(i,a=>{$e.configure(this,a,a.options),$e.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;rn.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let h=0,d=this.data.datasets.length;h{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Km("z","_idx"));const{_active:l,_lastEvent:u}=this;u?this._eventHandler(u,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Vt(this.scales,t=>{$e.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!lm(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;JP(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,l)=>l+","+a.splice(1).join(","))),r=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$e.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Vt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=ay(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&Dc(n,r),t.controller.draw(),r&&Lc(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Oi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=KE.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Ji(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);qo(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),wi.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,s,a),t[s]=a},r=(s,a,l)=>{s.offsetX=a,s.offsetY=l,this._eventHandler(s)};Vt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(u,h)=>{n.addEventListener(this,u,h),t[u]=h},r=(u,h)=>{t[u]&&(n.removeEventListener(this,u,h),delete t[u])},s=(u,h)=>{this.canvas&&this.resize(u,h)};let a;const l=()=>{r("attach",l),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",l)},n.isAttached(this.canvas)?l():a()}unbindEvents(){Vt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Vt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,l,u;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,u=t.length;l{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[a],index:a}});!gc(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(u,h)=>u.filter(d=>!h.some(m=>d.datasetIndex===m.datasetIndex&&d.index===m.index)),a=s(n,t),l=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,l=this._getActiveElements(t,r,i,a),u=sA(t),h=ZP(t,this._lastEvent,i,u);i&&(this._lastEvent=null,Gt(s.onHover,[t,l,this],this),u&&Gt(s.onClick,[t,l,this],this));const d=!gc(l,r);return(d||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=h,d}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}}ot(Jt,"defaults",ie),ot(Jt,"instances",oc),ot(Jt,"overrides",Lr),ot(Jt,"registry",ei),ot(Jt,"version",YP),ot(Jt,"getChart",Jm);function Zm(){return Vt(Jt.instances,e=>e._plugins.invalidate())}function QP(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:l,options:u}=t,{borderWidth:h,borderJoinStyle:d}=u,m=Math.min(h/a,We(i-n));if(e.beginPath(),e.arc(r,s,a-h/2,i+m/2,n-m/2),l>0){const y=Math.min(h/l,We(i-n));e.arc(r,s,l+h/2,n-y/2,i+y/2,!0)}else{const y=Math.min(h/2,a*We(i-n));if(d==="round")e.arc(r,s,y,n-zt/2,i+zt/2,!0);else if(d==="bevel"){const x=2*y*y,S=-x*Math.cos(n+zt/2)+r,C=-x*Math.sin(n+zt/2)+s,T=x*Math.cos(i+zt/2)+r,A=x*Math.sin(i+zt/2)+s;e.lineTo(S,C),e.lineTo(T,A)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function tM(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:l,innerRadius:u}=t;let h=r/l;e.beginPath(),e.arc(s,a,l,i-h,n+h),u>r?(h=r/u,e.arc(s,a,u,n+h,i-h,!0)):e.arc(s,a,r,n+me,i-me),e.closePath(),e.clip()}function eM(e){return cd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function nM(e,t,n,i){const r=eM(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),l=u=>{const h=(n-Math.min(s,u))*i/2;return Pe(u,0,Math.min(s,h))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Pe(r.innerStart,0,a),innerEnd:Pe(r.innerEnd,0,a)}}function cs(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function wc(e,t,n,i,r,s){const{x:a,y:l,startAngle:u,pixelMargin:h,innerRadius:d}=t,m=Math.max(t.outerRadius+i+n-h,0),y=d>0?d+i+n+h:0;let x=0;const S=r-u;if(i){const tt=d>0?d-i:0,it=m>0?m-i:0,K=(tt+it)/2,ct=K!==0?S*K/(K+i):S;x=(S-ct)/2}const C=Math.max(.001,S*m-n/zt)/m,T=(S-C)/2,A=u+T+x,M=r-T-x,{outerStart:B,outerEnd:D,innerStart:R,innerEnd:N}=nM(t,y,m,M-A),I=m-B,j=m-D,q=A+B/I,F=M-D/j,H=y+R,U=y+N,V=A+R/H,st=M-N/U;if(e.beginPath(),s){const tt=(q+F)/2;if(e.arc(a,l,m,q,tt),e.arc(a,l,m,tt,F),D>0){const dt=cs(j,F,a,l);e.arc(dt.x,dt.y,D,F,M+me)}const it=cs(U,M,a,l);if(e.lineTo(it.x,it.y),N>0){const dt=cs(U,st,a,l);e.arc(dt.x,dt.y,N,M+me,st+Math.PI)}const K=(M-N/y+(A+R/y))/2;if(e.arc(a,l,y,M-N/y,K,!0),e.arc(a,l,y,K,A+R/y,!0),R>0){const dt=cs(H,V,a,l);e.arc(dt.x,dt.y,R,V+Math.PI,A-me)}const ct=cs(I,A,a,l);if(e.lineTo(ct.x,ct.y),B>0){const dt=cs(I,q,a,l);e.arc(dt.x,dt.y,B,A-me,q)}}else{e.moveTo(a,l);const tt=Math.cos(q)*m+a,it=Math.sin(q)*m+l;e.lineTo(tt,it);const K=Math.cos(F)*m+a,ct=Math.sin(F)*m+l;e.lineTo(K,ct)}e.closePath()}function iM(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:l}=t;let u=t.endAngle;if(s){wc(e,t,n,i,u,r);for(let h=0;h=zt&&x===0&&d!=="miter"&&QP(e,t,C),s||(wc(e,t,n,i,C,r),e.stroke())}class Ao extends Ai{constructor(n){super();ot(this,"circumference");ot(this,"endAngle");ot(this,"fullCircles");ot(this,"innerRadius");ot(this,"outerRadius");ot(this,"pixelMargin");ot(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,i,r){const s=this.getProps(["x","y"],r),{angle:a,distance:l}=zb(s,{x:n,y:i}),{startAngle:u,endAngle:h,innerRadius:d,outerRadius:m,circumference:y}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),x=(this.options.spacing+this.options.borderWidth)/2,S=Tt(y,h-u),C=Xo(a,u,h)&&u!==h,T=S>=Qt||C,A=Ti(l,d+x,m+x);return T&&A}getCenterPoint(n){const{x:i,y:r,startAngle:s,endAngle:a,innerRadius:l,outerRadius:u}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:h,spacing:d}=this.options,m=(s+a)/2,y=(l+u+d+h)/2;return{x:i+Math.cos(m)*y,y:r+Math.sin(m)*y}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:r}=this,s=(i.offset||0)/4,a=(i.spacing||0)/2,l=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>Qt?Math.floor(r/Qt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const u=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(u)*s,Math.sin(u)*s);const h=1-Math.sin(Math.min(zt,r||0)),d=s*h;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,iM(n,this,d,a,l),rM(n,this,d,a,l),n.restore()}}ot(Ao,"id","arc"),ot(Ao,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),ot(Ao,"defaultRoutes",{backgroundColor:"backgroundColor"}),ot(Ao,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function _y(e,t,n=t){e.lineCap=Tt(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Tt(n.borderDash,t.borderDash)),e.lineDashOffset=Tt(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Tt(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Tt(n.borderWidth,t.borderWidth),e.strokeStyle=Tt(n.borderColor,t.borderColor)}function sM(e,t,n){e.lineTo(n.x,n.y)}function oM(e){return e.stepped?AA:e.tension||e.cubicInterpolationMode==="monotone"?EA:sM}function wy(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:a,end:l}=t,u=Math.max(r,a),h=Math.min(s,l),d=rl&&s>l;return{count:i,start:u,loop:t.loop,ilen:h(a+(h?l-D:D))%s,B=()=>{C!==T&&(e.lineTo(d,T),e.lineTo(d,C),e.lineTo(d,A))};for(u&&(x=r[M(0)],e.moveTo(x.x,x.y)),y=0;y<=l;++y){if(x=r[M(y)],x.skip)continue;const D=x.x,R=x.y,N=D|0;N===S?(RT&&(T=R),d=(m*d+D)/++m):(B(),e.lineTo(D,R),S=N,m=0,C=T=R),A=R}B()}function Of(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?lM:aM}function cM(e){return e.stepped?aE:e.tension||e.cubicInterpolationMode==="monotone"?lE:Sr}function uM(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),_y(e,t.options),e.stroke(r)}function hM(e,t,n,i){const{segments:r,options:s}=t,a=Of(t);for(const l of r)_y(e,s,l.style),e.beginPath(),a(e,t,l,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const fM=typeof Path2D=="function";function dM(e,t,n,i){fM&&!t.options.segment?uM(e,t,n,i):hM(e,t,n,i)}class Ui extends Ai{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;QA(this._points,i,t,r,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=pE(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=oy(this,{property:n,start:r,end:r});if(!a.length)return;const l=[],u=cM(i);let h,d;for(h=0,d=a.length;ht!=="borderDash"&&t!=="fill"});function Qm(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Sy(e){return kf[e%kf.length]}function Ty(e){return tv[e%tv.length]}function _M(e,t){return e.borderColor=Sy(t),e.backgroundColor=Ty(t),++t}function wM(e,t){return e.backgroundColor=e.data.map(()=>Sy(t++)),t}function xM(e,t){return e.backgroundColor=e.data.map(()=>Ty(t++)),t}function SM(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof Or?t=wM(n,t):r instanceof zo?t=xM(n,t):r&&(t=_M(n,t))}}function ev(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function TM(e){return e&&(e.borderColor||e.backgroundColor)}function CM(){return ie.borderColor!=="rgba(0,0,0,0.1)"||ie.backgroundColor!=="rgba(0,0,0,0.1)"}var OM={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=ev(i)||TM(r)||s&&ev(s)||CM();if(!n.forceOverride&&a)return;const l=SM(e);i.forEach(l)}};function kM(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],l=(n-2)/(s-2);let u=0;const h=t+n-1;let d=t,m,y,x,S,C;for(a[u++]=e[d],m=0;mx&&(x=S,y=e[M],C=M);a[u++]=y,d=C}return a[u++]=e[h],a}function AM(e,t,n,i){let r=0,s=0,a,l,u,h,d,m,y,x,S,C;const T=[],A=t+n-1,M=e[t].x,D=e[A].x-M;for(a=t;aC&&(C=h,y=a),r=(s*r+l.x)/++s;else{const N=a-1;if(!Rt(m)&&!Rt(y)){const I=Math.min(m,y),j=Math.max(m,y);I!==x&&I!==N&&T.push({...e[I],x:r}),j!==x&&j!==N&&T.push({...e[j],x:r})}a>0&&N!==x&&T.push(e[N]),T.push(l),d=R,s=0,S=C=h,m=y=x=a}}return T}function Cy(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function nv(e){e.data.datasets.forEach(t=>{Cy(t)})}function EM(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:l,minDefined:u,maxDefined:h}=s.getUserBounds();return u&&(i=Pe(Ci(t,s.axis,a).lo,0,n-1)),h?r=Pe(Ci(t,s.axis,l).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var PM={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){nv(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:l}=r,u=e.getDatasetMeta(s),h=a||r.data;if(Oo([l,e.options.indexAxis])==="y"||!u.controller.supportsDecimation)return;const d=e.scales[u.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:m,count:y}=EM(u,h);const x=n.threshold||4*i;if(y<=x){Cy(r);return}Rt(a)&&(r._data=h,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(C){this._data=C}}));let S;switch(n.algorithm){case"lttb":S=kM(h,m,y,i,n);break;case"min-max":S=AM(h,m,y,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=S})},destroy(e){nv(e)}};function MM(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const l of i){let{start:u,end:h}=l;h=Fc(u,h,r);const d=Af(n,r[u],r[h],l.loop);if(!t.segments){a.push({source:l,target:d,start:r[u],end:r[h]});continue}const m=oy(t,d);for(const y of m){const x=Af(n,s[y.start],s[y.end],y.loop),S=sy(l,r,x);for(const C of S)a.push({source:C,target:y,start:{[n]:iv(d,x,"start",Math.max)},end:{[n]:iv(d,x,"end",Math.min)}})}}return a}function Af(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=We(r),s=We(s)),{property:e,start:r,end:s}}function RM(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:l})=>{l=Fc(a,l,r);const u=r[a],h=r[l];i!==null?(s.push({x:u.x,y:i}),s.push({x:h.x,y:i})):n!==null&&(s.push({x:n,y:u.y}),s.push({x:n,y:h.y}))}),s}function Fc(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function iv(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Oy(e,t){let n=[],i=!1;return ne(e)?(i=!0,n=e):n=RM(e,t),n.length?new Ui({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function rv(e){return e&&e.fill!==!1}function DM(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ue(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function LM(e,t,n){const i=BM(e);if(Lt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return ue(r)&&Math.floor(r)===r?IM(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function IM(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function NM(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Lt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function FM(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:Lt(e)?i=e.value:i=t.getBaseValue(),i}function BM(e){const t=e.options,n=t.fill;let i=Tt(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function HM(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,l=zM(t,n);l.push(Oy({x:null,y:t.bottom},i));for(let u=0;u=0;--a){const l=r[a].$filler;l&&(l.line.updateControlPoints(s,l.axis),i&&l.fill&&tf(e.ctx,l,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;rv(s)&&tf(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!rv(i)||n.drawTime!=="beforeDatasetDraw"||tf(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const lv=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},JM=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class cv extends Ai{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Gt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=ke(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:u}=lv(i,s);let h,d;n.font=r.string,this.isHorizontal()?(h=this.maxWidth,d=this._fitRows(a,s,l,u)+10):(d=this.maxHeight,h=this._fitCols(a,r,l,u)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],h=this.lineWidths=[0],d=r+l;let m=t;s.textAlign="left",s.textBaseline="middle";let y=-1,x=-d;return this.legendItems.forEach((S,C)=>{const T=i+n/2+s.measureText(S.text).width;(C===0||h[h.length-1]+T+2*l>a)&&(m+=d,h[h.length-(C>0?0:1)]=0,x+=d,y++),u[C]={left:0,top:x,row:y,width:T,height:r},h[h.length-1]+=T+l}),m}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:l}}}=this,u=this.legendHitBoxes=[],h=this.columnSizes=[],d=a-t;let m=l,y=0,x=0,S=0,C=0;return this.legendItems.forEach((T,A)=>{const{itemWidth:M,itemHeight:B}=ZM(i,n,s,T,r);A>0&&x+B+2*l>d&&(m+=y+l,h.push({width:y,height:x}),S+=y+l,C++,y=x=0),u[A]={left:S,top:x,col:C,width:M,height:B},y=Math.max(y,M),x+=B+l}),m+=y,h.push({width:y,height:x}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=fs(s,this.left,this.width);if(this.isHorizontal()){let l=0,u=ze(i,this.left+r,this.right-this.lineWidths[l]);for(const h of n)l!==h.row&&(l=h.row,u=ze(i,this.left+r,this.right-this.lineWidths[l])),h.top+=this.top+t+r,h.left=a.leftForLtr(a.x(u),h.width),u+=h.width+r}else{let l=0,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const h of n)h.col!==l&&(l=h.col,u=ze(i,this.top+t+r,this.bottom-this.columnSizes[l].height)),h.top=u,h.left+=this.left+r,h.left=a.leftForLtr(a.x(h.left),h.width),u+=h.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Dc(t,this),this._draw(),Lc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,l=ie.color,u=fs(t.rtl,this.left,this.width),h=ke(a.font),{padding:d}=a,m=h.size,y=m/2;let x;this.drawTitle(),r.textAlign=u.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=h.string;const{boxWidth:S,boxHeight:C,itemHeight:T}=lv(a,m),A=function(N,I,j){if(isNaN(S)||S<=0||isNaN(C)||C<0)return;r.save();const q=Tt(j.lineWidth,1);if(r.fillStyle=Tt(j.fillStyle,l),r.lineCap=Tt(j.lineCap,"butt"),r.lineDashOffset=Tt(j.lineDashOffset,0),r.lineJoin=Tt(j.lineJoin,"miter"),r.lineWidth=q,r.strokeStyle=Tt(j.strokeStyle,l),r.setLineDash(Tt(j.lineDash,[])),a.usePointStyle){const F={radius:C*Math.SQRT2/2,pointStyle:j.pointStyle,rotation:j.rotation,borderWidth:q},H=u.xPlus(N,S/2),U=I+y;Yb(r,F,H,U,a.pointStyleWidth&&S)}else{const F=I+Math.max((m-C)/2,0),H=u.leftForLtr(N,S),U=Er(j.borderRadius);r.beginPath(),Object.values(U).some(V=>V!==0)?Yo(r,{x:H,y:F,w:S,h:C,radius:U}):r.rect(H,F,S,C),r.fill(),q!==0&&r.stroke()}r.restore()},M=function(N,I,j){Ir(r,j.text,N,I+T/2,h,{strikethrough:j.hidden,textAlign:u.textAlign(j.textAlign)})},B=this.isHorizontal(),D=this._computeTitleHeight();B?x={x:ze(s,this.left+d,this.right-i[0]),y:this.top+d+D,line:0}:x={x:this.left+d,y:ze(s,this.top+D+d,this.bottom-n[0].height),line:0},ny(this.ctx,t.textDirection);const R=T+d;this.legendItems.forEach((N,I)=>{r.strokeStyle=N.fontColor,r.fillStyle=N.fontColor;const j=r.measureText(N.text).width,q=u.textAlign(N.textAlign||(N.textAlign=a.textAlign)),F=S+y+j;let H=x.x,U=x.y;u.setWidth(this.width),B?I>0&&H+F+d>this.right&&(U=x.y+=R,x.line++,H=x.x=ze(s,this.left+d,this.right-i[x.line])):I>0&&U+R>this.bottom&&(H=x.x=H+n[x.line].width+d,x.line++,U=x.y=ze(s,this.top+D+d,this.bottom-n[x.line].height));const V=u.x(H);if(A(V,U,N),H=vA(q,H+S+y,B?H+F:this.right,t.rtl),M(u.x(H),U,N),B)x.x+=F+d;else if(typeof N.text!="string"){const st=h.lineHeight;x.y+=Ay(N,st)+d}else x.y+=R}),iy(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ke(n.font),r=Ue(n.padding);if(!n.display)return;const s=fs(t.rtl,this.left,this.width),a=this.ctx,l=n.position,u=i.size/2,h=r.top+u;let d,m=this.left,y=this.width;if(this.isHorizontal())y=Math.max(...this.lineWidths),d=this.top+h,m=ze(t.align,m,this.right-y);else{const S=this.columnSizes.reduce((C,T)=>Math.max(C,T.height),0);d=h+ze(t.align,this.top,this.bottom-S-t.labels.padding-this._computeTitleHeight())}const x=ze(l,m,m+y);a.textAlign=s.textAlign(ad(l)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,Ir(a,n.text,x,d,i)}_computeTitleHeight(){const t=this.options.title,n=ke(t.font),i=Ue(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(Ti(t,this.left,this.right)&&Ti(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;is.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function tR(e,t,n){let i=e;return typeof t.text!="string"&&(i=Ay(t,n)),i}function Ay(e,t){const n=e.text?e.text.length:0;return t*n}function eR(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var nR={id:"legend",_element:cv,start(e,t,n){const i=e.legend=new cv({ctx:e.ctx,options:n,chart:e});$e.configure(e,i,n),$e.addBox(e,i)},stop(e){$e.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;$e.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(u=>{const h=u.controller.getStyle(n?0:void 0),d=Ue(h.borderWidth);return{text:t[u.index].label,fillStyle:h.backgroundColor,fontColor:s,hidden:!u.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:h.borderColor,pointStyle:i||h.pointStyle,rotation:h.rotation,textAlign:r||h.textAlign,borderRadius:a&&(l||h.borderRadius),datasetIndex:u.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class md extends Ai{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const r=ne(i.text)?i.text.length:1;this._padding=Ue(i.padding);const s=r*ke(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:a}=this,l=a.align;let u=0,h,d,m;return this.isHorizontal()?(d=ze(l,i,s),m=n+t,h=s-i):(a.position==="left"?(d=i+t,m=ze(l,r,n),u=zt*-.5):(d=s-t,m=ze(l,n,r),u=zt*.5),h=r-n),{titleX:d,titleY:m,maxWidth:h,rotation:u}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ke(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:u,rotation:h}=this._drawArgs(s);Ir(t,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:h,textAlign:ad(n.align),textBaseline:"middle",translation:[a,l]})}}function iR(e,t){const n=new md({ctx:e.ctx,options:t,chart:e});$e.configure(e,n,t),$e.addBox(e,n),e.titleBlock=n}var rR={id:"title",_element:md,start(e,t,n){iR(e,n)},stop(e){const t=e.titleBlock;$e.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;$e.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ul=new WeakMap;var sR={id:"subtitle",start(e,t,n){const i=new md({ctx:e.ctx,options:n,chart:e});$e.configure(e,i,n),$e.addBox(e,i),Ul.set(e,i)},stop(e){$e.removeBox(e,Ul.get(e)),Ul.delete(e)},beforeUpdate(e,t,n){const i=Ul.get(e);$e.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eo={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;tl+u)/i.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,l;for(s=0,a=e.length;s-1?e.split(` `):e}function oR(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:l}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function uv(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:l}=t,u=ke(t.bodyFont),h=ke(t.titleFont),d=ke(t.footerFont),m=s.length,y=r.length,x=i.length,S=Ue(t.padding);let C=S.height,T=0,A=i.reduce((D,R)=>D+R.before.length+R.lines.length+R.after.length,0);if(A+=e.beforeBody.length+e.afterBody.length,m&&(C+=m*h.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),A){const D=t.displayColors?Math.max(l,u.lineHeight):u.lineHeight;C+=x*D+(A-x)*u.lineHeight+(A-1)*t.bodySpacing}y&&(C+=t.footerMarginTop+y*d.lineHeight+(y-1)*t.footerSpacing);let M=0;const B=function(D){T=Math.max(T,n.measureText(D).width+M)};return n.save(),n.font=h.string,Vt(e.title,B),n.font=u.string,Vt(e.beforeBody.concat(e.afterBody),B),M=t.displayColors?a+2+t.boxPadding:0,Vt(i,D=>{Vt(D.before,B),Vt(D.lines,B),Vt(D.after,B)}),M=0,n.font=d.string,Vt(e.footer,B),n.restore(),T+=S.width,{width:T,height:C}}function aR(e,t){const{y:n,height:i}=t;return ne.height-i/2?"bottom":"center"}function lR(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function cR(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:l,right:u}}=e;let h="center";return i==="center"?h=r<=(l+u)/2?"left":"right":r<=s/2?h="left":r>=a-s/2&&(h="right"),lR(h,e,t,n)&&(h="center"),h}function hv(e,t,n){const i=n.yAlign||t.yAlign||aR(e,n);return{xAlign:n.xAlign||t.xAlign||cR(e,t,n,i),yAlign:i}}function uR(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function hR(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function fv(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:l,yAlign:u}=n,h=r+s,{topLeft:d,topRight:m,bottomLeft:y,bottomRight:x}=Er(a);let S=uR(t,l);const C=hR(t,u,h);return u==="center"?l==="left"?S+=h:l==="right"&&(S-=h):l==="left"?S-=Math.max(d,y)+r:l==="right"&&(S+=Math.max(m,x)+r),{x:Pe(S,0,i.width-t.width),y:Pe(C,0,i.height-t.height)}}function Vl(e,t,n){const i=Ue(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function dv(e){return ti([],xi(e))}function fR(e,t,n){return Ji(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function pv(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ey={beforeTitle:_i,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Ey[t].call(n,i):r}class Ef extends Ai{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new ly(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=fR(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=on(i,"beforeTitle",this,t),s=on(i,"title",this,t),a=on(i,"afterTitle",this,t);let l=[];return l=ti(l,xi(r)),l=ti(l,xi(s)),l=ti(l,xi(a)),l}getBeforeBody(t,n){return dv(on(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return Vt(t,s=>{const a={before:[],lines:[],after:[]},l=pv(i,s);ti(a.before,xi(on(l,"beforeLabel",this,s))),ti(a.lines,on(l,"label",this,s)),ti(a.after,xi(on(l,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return dv(on(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=on(i,"beforeFooter",this,t),s=on(i,"footer",this,t),a=on(i,"afterFooter",this,t);let l=[];return l=ti(l,xi(r)),l=ti(l,xi(s)),l=ti(l,xi(a)),l}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let l=[],u,h;for(u=0,h=n.length;ut.filter(d,m,y,i))),t.itemSort&&(l=l.sort((d,m)=>t.itemSort(d,m,i))),Vt(l,d=>{const m=pv(t.callbacks,d);r.push(on(m,"labelColor",this,d)),s.push(on(m,"labelPointStyle",this,d)),a.push(on(m,"labelTextColor",this,d))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=l,l}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=Eo[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const u=this._size=uv(this,i),h=Object.assign({},l,u),d=hv(this.chart,i,h),m=fv(i,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,s={opacity:1,x:m.x,y:m.y,width:u.width,height:u.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:l}=i,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:m}=Er(l),{x:y,y:x}=t,{width:S,height:C}=n;let T,A,M,B,D,R;return s==="center"?(D=x+C/2,r==="left"?(T=y,A=T-a,B=D+a,R=D-a):(T=y+S,A=T+a,B=D-a,R=D+a),M=T):(r==="left"?A=y+Math.max(u,d)+a:r==="right"?A=y+S-Math.max(h,m)-a:A=this.caretX,s==="top"?(B=x,D=B-a,T=A-a,M=A+a):(B=x+C,D=B+a,T=A+a,M=A-a),R=B),{x1:T,x2:A,x3:M,y1:B,y2:D,y3:R}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,l,u;if(s){const h=fs(i.rtl,this.x,this.width);for(t.x=Vl(this,i.titleAlign,i),n.textAlign=h.textAlign(i.titleAlign),n.textBaseline="middle",a=ke(i.titleFont),l=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,u=0;uM!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,Yo(t,{x:C,y:S,w:h,h:u,radius:A}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Yo(t,{x:T,y:S+1,w:h-2,h:u-2,radius:A}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(C,S,h,u),t.strokeRect(C,S,h,u),t.fillStyle=a.backgroundColor,t.fillRect(T,S+1,h-2,u-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:l,boxHeight:u,boxWidth:h,boxPadding:d}=i,m=ke(i.bodyFont);let y=m.lineHeight,x=0;const S=fs(i.rtl,this.x,this.width),C=function(j){n.fillText(j,S.x(t.x+x),t.y+y/2),t.y+=y+s},T=S.textAlign(a);let A,M,B,D,R,N,I;for(n.textAlign=a,n.textBaseline="middle",n.font=m.string,t.x=Vl(this,T,i),n.fillStyle=i.bodyColor,Vt(this.beforeBody,C),x=l&&T!=="right"?a==="center"?h/2+d:h+2+d:0,D=0,N=r.length;D0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=Eo[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=uv(this,t),u=Object.assign({},a,this._size),h=hv(n,t,u),d=fv(t,u,h,n);(r._to!==d.x||s._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ue(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),ny(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),iy(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:l,index:u})=>{const h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[u],index:u}}),s=!gc(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),l=this._positionChanged(a,t),u=n||!gc(a,s)||l;return u&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),u}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,a=Eo[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}ot(Ef,"positioners",Eo);var dR={id:"tooltip",_element:Ef,positioners:Eo,afterInit(e,t,n){n&&(e.tooltip=new Ef({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ey},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},pR=Object.freeze({__proto__:null,Colors:OM,Decimation:PM,Filler:GM,Legend:nR,SubTitle:sR,Title:rR,Tooltip:dR});const gR=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function mR(e,t,n,i){const r=e.indexOf(t);if(r===-1)return gR(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const vR=(e,t)=>e===null?null:Pe(Math.round(e),0,t);function gv(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}ot(Pf,"id","category"),ot(Pf,"defaults",{ticks:{callback:gv}});function bR(e,t){const n=[],{bounds:r,step:s,min:a,max:l,precision:u,count:h,maxTicks:d,maxDigits:m,includeBounds:y}=e,x=s||1,S=d-1,{min:C,max:T}=t,A=!Rt(a),M=!Rt(l),B=!Rt(h),D=(T-C)/(m+1);let R=um((T-C)/S/x)*x,N,I,j,q;if(R<1e-14&&!A&&!M)return[{value:C},{value:T}];q=Math.ceil(T/R)-Math.floor(C/R),q>S&&(R=um(q*R/S/x)*x),Rt(u)||(N=Math.pow(10,u),R=Math.ceil(R*N)/N),r==="ticks"?(I=Math.floor(C/R)*R,j=Math.ceil(T/R)*R):(I=C,j=T),A&&M&&s&&uA((l-a)/s,R/1e3)?(q=Math.round(Math.min((l-a)/R,d)),R=(l-a)/q,I=a,j=l):B?(I=A?a:I,j=M?l:j,q=h-1,R=(j-I)/q):(q=(j-I)/R,Fo(q,Math.round(q),R/1e3)?q=Math.round(q):q=Math.ceil(q));const F=Math.max(hm(R),hm(I));N=Math.pow(10,Rt(u)?F:u),I=Math.round(I*N)/N,j=Math.round(j*N)/N;let H=0;for(A&&(y&&I!==a?(n.push({value:a}),Il)break;n.push({value:U})}return M&&y&&j!==l?n.length&&Fo(n[n.length-1].value,l,mv(l,D,e))?n[n.length-1].value=l:n.push({value:l}):(!M||j===l)&&n.push({value:j}),n}function mv(e,t,{horizontal:n,minRotation:i}){const r=jn(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class xc extends Nr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=u=>r=n?r:u,l=u=>s=i?s:u;if(t){const u=ri(r),h=ri(s);u<0&&h<0?l(0):u>0&&h>0&&a(0)}if(r===s){let u=s===0?1:Math.abs(s*.05);l(s+u),t||a(r-u)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,a=bR(r,s);return t.bounds==="ticks"&&Hb(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return aa(t,this.chart.options.locale,this.options.ticks.format)}}class Mf extends xc{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ue(t)?t:0,this.max=ue(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=jn(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ot(Mf,"id","linear"),ot(Mf,"defaults",{ticks:{callback:Rc.formatters.numeric}});const Go=e=>Math.floor($i(e)),_r=(e,t)=>Math.pow(10,Go(e)+t);function vv(e){return e/Math.pow(10,Go(e))===1}function bv(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function yR(e,t){const n=t-e;let i=Go(n);for(;bv(e,t,i)>10;)i++;for(;bv(e,t,i)<10;)i--;return Math.min(i,Go(e))}function _R(e,{min:t,max:n}){t=yn(e.min,t);const i=[],r=Go(t);let s=yR(t,n),a=s<0?Math.pow(10,Math.abs(s)):1;const l=Math.pow(10,s),u=r>s?Math.pow(10,r):0,h=Math.round((t-u)*a)/a,d=Math.floor((t-u)/l/10)*l*10;let m=Math.floor((h-d)/Math.pow(10,s)),y=yn(e.min,Math.round((u+d+m*Math.pow(10,s))*a)/a);for(;y=10?m=m<15?15:20:m++,m>=20&&(s++,m=2,a=s>=0?1:a),y=Math.round((u+d+m*Math.pow(10,s))*a)/a;const x=yn(e.max,y);return i.push({value:x,major:vv(x),significand:m}),i}class Rf extends Nr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=xc.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return ue(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ue(t)?Math.max(0,t):null,this.max=ue(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ue(this._userMin)&&(this.min=t===_r(this.min,0)?_r(this.min,-1):_r(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=l=>i=t?i:l,a=l=>r=n?r:l;i===r&&(i<=0?(s(1),a(10)):(s(_r(i,-1)),a(_r(r,1)))),i<=0&&s(_r(r,-1)),r<=0&&a(_r(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=_R(n,this);return t.bounds==="ticks"&&Hb(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":aa(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=$i(t),this._valueRange=$i(this.max)-$i(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:($i(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ot(Rf,"id","logarithmic"),ot(Rf,"defaults",{ticks:{callback:Rc.formatters.logarithmic,major:{enabled:!0}}});function Df(e){const t=e.ticks;if(t.display&&e.display){const n=Ue(t.backdropPadding);return Tt(t.font&&t.font.size,ie.font.size)+n.height}return 0}function wR(e,t,n){return n=ne(n)?n:[n],{w:kA(e,t.string,n),h:n.length*t.lineHeight}}function yv(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:er?{start:t-n,end:t}:{start:t,end:t+n}}function xR(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,l=a.centerPointLabels?zt/s:0;for(let u=0;ut.r&&(l=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+l)),r.startt.b&&(u=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+u))}function TR(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:l}=n,u=e.getPointPosition(t,i+r+a,s),h=Math.round(sd(We(u.angle+me))),d=ER(u.y,l.h,h),m=kR(h),y=AR(u.x,l.w,m);return{visible:!0,x:u.x,y:d,textAlign:m,left:y,top:d,right:y+l.w,bottom:d+l.h}}function CR(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(Oi({x:n,y:i},t)||Oi({x:n,y:s},t)||Oi({x:r,y:i},t)||Oi({x:r,y:s},t))}function OR(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:l}=s.pointLabels,u={extra:Df(s)/2,additionalAngle:a?zt/r:0};let h;for(let d=0;d270||n<90)&&(e-=t),e}function PR(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:l}=t;if(!Rt(l)){const u=Er(t.borderRadius),h=Ue(t.backdropPadding);e.fillStyle=l;const d=i-h.left,m=r-h.top,y=s-i+h.width,x=a-r+h.height;Object.values(u).some(S=>S!==0)?(e.beginPath(),Yo(e,{x:d,y:m,w:y,h:x,radius:u}),e.fill()):e.fillRect(d,m,y,x)}}function MR(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));PR(n,a,s);const l=ke(a.font),{x:u,y:h,textAlign:d}=s;Ir(n,e._pointLabels[r],u,h+l.lineHeight/2,l,{color:a.color,textAlign:d,textBaseline:"middle"})}}function Py(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,Qt);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a{const r=Gt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?xR(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=Qt/(this._pointLabels.length||1),i=this.options.startAngle||0;return We(t*n+jn(i))}getDistanceFromCenterForValue(t){if(Rt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Rt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(d.value);const y=this.getContext(m),x=r.setContext(y),S=s.setContext(y);RR(this,x,u,a,S)}}),i.display){for(t.save(),l=a-1;l>=0;l--){const d=i.setContext(this.getPointLabelContext(l)),{color:m,lineWidth:y}=d;!y||!m||(t.lineWidth=y,t.strokeStyle=m,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,u=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),h=this.getPointPosition(l,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,u)=>{if(u===0&&this.min>=0&&!n.reverse)return;const h=i.setContext(this.getContext(u)),d=ke(h.font);if(s=this.getDistanceFromCenterForValue(this.ticks[u].value),h.showLabelBackdrop){t.font=d.string,a=t.measureText(l.label).width,t.fillStyle=h.backdropColor;const m=Ue(h.backdropPadding);t.fillRect(-a/2-m.left,-s-d.size/2-m.top,a+m.width,d.size+m.height)}Ir(t,l.label,0,-s,d,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})}),t.restore()}drawTitle(){}}ot(Po,"id","radialLinear"),ot(Po,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Rc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ot(Po,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ot(Po,"descriptors",{angleLines:{_fallback:"grid"}});const Bc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},an=Object.keys(Bc);function _v(e,t){return e-t}function wv(e,t){if(Rt(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),ue(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(ys(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function xv(e,t,n,i){const r=an.length;for(let s=an.indexOf(e);s=an.indexOf(n);s--){const a=an[s];if(Bc[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return an[n?an.indexOf(n):0]}function IR(e){for(let t=an.indexOf(e)+1,n=an.length;t=t?n[i]:n[r];e[s]=!0}}function NR(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let l,u;for(l=s;l<=a;l=+r.add(l,1,i))u=n[l],u>=0&&(t[u].major=!0);return t}function Tv(e,t,n){const i=[],r={},s=t.length;let a,l;for(a=0;a+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Pe(n,0,a),i=Pe(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||xv(s.minUnit,n,i,this._getLabelCapacity(n)),l=Tt(r.ticks.stepSize,1),u=a==="week"?s.isoWeekday:!1,h=ys(u)||u===!0,d={};let m=n,y,x;if(h&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,h?"day":a),t.diff(i,n,a)>1e5*l)throw new Error(n+" and "+i+" are too far apart with stepSize of "+l+" "+a);const S=r.ticks.source==="data"&&this.getDataTimestamps();for(y=m,x=0;y+C)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return Gt(a,[t,n,i],this);const l=s.time.displayFormats,u=this._unit,h=this._majorUnit,d=u&&l[u],m=h&&l[h],y=i[n],x=h&&m&&y&&y.major;return this._adapter.format(t,r||(x?m:d))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=Ci(e,"pos",t)),{pos:s,time:l}=e[i],{pos:a,time:u}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=Ci(e,"time",t)),{time:s,pos:l}=e[i],{time:a,pos:u}=e[r]);const h=a-s;return h?l+(u-l)*(t-s)/h:l}class Lf extends Jo{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ql(n,this.min),this._tableRange=ql(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,l,u,h,d;for(a=0,l=t.length;a=n&&h<=i&&r.push(h);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,l=r.length;ar-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(ql(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return ql(this._table,i*this._tableRange+this._minPos,!0)}}ot(Lf,"id","timeseries"),ot(Lf,"defaults",Jo.defaults);var FR=Object.freeze({__proto__:null,CategoryScale:Pf,LinearScale:Mf,LogarithmicScale:Rf,RadialLinearScale:Po,TimeScale:Jo,TimeSeriesScale:Lf});const Hc=[$E,yM,pR,FR];class BR{constructor(){this.heartbeatInterval=null,this.offlineTimeout=null,this.lastActivity=Date.now(),this.isOnline=!0,this.init()}init(){this.setupActivityTracking(),this.setupVisibilityHandling(),this.setupBeforeUnload(),this.startHeartbeat()}setupActivityTracking(){["mousedown","mousemove","keypress","scroll","touchstart"].forEach(n=>{document.addEventListener(n,()=>{this.updateActivity()},{passive:!0})})}setupVisibilityHandling(){document.addEventListener("visibilitychange",()=>{document.hidden?this.handleUserAway():this.handleUserBack()})}setupBeforeUnload(){window.addEventListener("beforeunload",()=>{this.setOffline()}),window.addEventListener("pagehide",()=>{this.setOffline()})}updateActivity(){const t=Date.now();t-this.lastActivity>15e3&&(this.lastActivity=t,this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e5),this.notifyLivewireComponents("handleUserActivity"))}handleUserAway(){this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e4)}handleUserBack(){this.lastActivity=Date.now(),this.heartbeat(),this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.offlineTimeout=setTimeout(()=>{this.setOffline()},3e5)}startHeartbeat(){this.heartbeatInterval=setInterval(()=>{!document.hidden&&this.isOnline&&this.heartbeat()},3e4)}heartbeat(){this.getActiveGuards().forEach(n=>{var i;fetch("/presence/heartbeat",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":(i=document.querySelector('meta[name="csrf-token"]'))==null?void 0:i.content},body:JSON.stringify({guard:n})}).then(r=>{r.ok&&(this.isOnline=!0,this.notifyLivewireComponents("handleUserActivity"))}).catch(()=>{})})}setOffline(){if(!this.isOnline)return;this.getActiveGuards().forEach(n=>{var r;const i=JSON.stringify({guard:n});navigator.sendBeacon?navigator.sendBeacon("/presence/offline",i):fetch("/presence/offline",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":(r=document.querySelector('meta[name="csrf-token"]'))==null?void 0:r.content},body:i}).catch(()=>{})}),this.isOnline=!1,this.notifyLivewireComponents("handleUserOffline")}getActiveGuards(){const t=new Set;if(document.querySelectorAll(".user-presence-container").forEach(n=>{const i=n.getAttribute("data-guard")||"web";t.add(i)}),t.size===0){const n=document.body.getAttribute("data-active-guard")||"web";t.add(n)}return Array.from(t)}notifyLivewireComponents(t){document.querySelectorAll("[wire\\:id]").forEach(n=>{const i=n.getAttribute("wire:id");if(i&&n.classList.contains("user-presence-container"))try{Livewire.find(i).call(t)}catch{}})}destroy(){this.heartbeatInterval&&clearInterval(this.heartbeatInterval),this.offlineTimeout&&clearTimeout(this.offlineTimeout),this.setOffline()}}document.addEventListener("DOMContentLoaded",()=>{window.presenceTracker=new BR});window.addEventListener("beforeunload",()=>{window.presenceTracker&&window.presenceTracker.destroy()});Jt.register(...Hc);window.initReturnRatioChart=function(e,t=[]){var s;const n=document.getElementById("returnRatioChart");if(!n||!e||e.length===0)return;const i=e.map(a=>a.return_ratio);Math.min(...i),Math.max(...i);const r=n.getContext("2d");if(r){n.chart&&n.chart.destroy();try{const a=[];t&&t.length>0&&a.push({label:"Trend Line",data:t.map(d=>d.trend_value),borderColor:"#DC2626",backgroundColor:"transparent",borderWidth:3,borderDash:[8,4],tension:0,fill:!1,pointRadius:0,pointHoverRadius:0,order:1}),a.push({label:"Reciprocity Rate %",data:e.map(d=>d.return_ratio),borderColor:"#000",backgroundColor:"rgba(107, 114, 128, 0.1)",borderWidth:3,fill:!0,tension:.4,pointBackgroundColor:"#000",pointBorderColor:"#fff",pointBorderWidth:2,pointRadius:6,pointHoverRadius:8,order:0});const l=((s=e[0])==null?void 0:s.translations)||{period:"Period",return_ratio:"Reciprocity Rate"},u=new Jt(r,{type:"line",data:{labels:e.map(d=>d.label),datasets:a},options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!0,position:"top",align:"start",labels:{usePointStyle:!0,color:"#1F2937"}},tooltip:{enabled:!1,external:function(d){const m=d.tooltip;let y=document.getElementById("custom-tooltip");if(y||(y=document.createElement("div"),y.id="custom-tooltip",y.style.position="absolute",y.style.background="rgba(0, 0, 0, 0.8)",y.style.color="white",y.style.border="2px solid white",y.style.borderRadius="8px",y.style.pointerEvents="none",y.style.transform="translate(-50%, 0)",y.style.transition="all .1s ease",y.style.padding="10px",y.style.fontSize="12px",y.style.fontFamily="Arial, sans-serif",y.style.zIndex="9999",y.style.boxShadow="none",y.style.outline="none",document.body.appendChild(y)),m.opacity===0){y.style.opacity="0";return}if(m.body){const S=m.title||[],C=m.body.map(A=>A.lines);let T="";S.forEach(function(A){T+='
'+A+"
"}),C.forEach(function(A,M){const B=m.labelColors[M],D='';let R=A[0];M===0?R="Trend: "+R.split(": ")[1]:R="Reciprocity Rate: "+R.split(": ")[1],T+='
'+D+R+"
"}),y.innerHTML=T}const x=d.chart.canvas.getBoundingClientRect();y.style.opacity="1",y.style.left=x.left+window.pageXOffset+m.caretX+"px",y.style.top=x.top+window.pageYOffset+m.caretY+"px"}}},scales:{x:{display:!0,title:{display:!0,text:l.period,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",autoSkip:!1,maxRotation:60,minRotation:60,padding:8,font:{size:10}}},y:{display:!0,title:{display:!0,text:l.return_ratio,color:"#6B7280"},beginAtZero:!0,grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",callback:function(d){return Math.round(d)+"%"}}}}}});n.chart=u,window.returnRatioChart=u,n.style.height="300px";const h=document.getElementById("chartLoadingIndicator");return h&&(h.style.display="none"),u}catch{return null}}};document.addEventListener("livewire:init",()=>{Livewire.on("openPdf",n=>{n&&window.open(n,"_blank")});function e(){const n=document.querySelector("[data-chart-data]");if(!n)return;const i=n.getAttribute("data-chart-data"),r=n.getAttribute("data-trend-data");if(i)try{const s=JSON.parse(i),a=r?JSON.parse(r):[];typeof window.initReturnRatioChart=="function"&&window.initReturnRatioChart(s,a)}catch{}}document.addEventListener("DOMContentLoaded",()=>{setTimeout(e,100)});let t=null;Livewire.hook("morph.updated",()=>{clearTimeout(t),t=setTimeout(()=>{e()},300)})});window.exportReturnRatioChartForPdf=async function(){if(!window.returnRatioChart)return null;try{const e=window.returnRatioChart,t=900,n=400,i=document.createElement("canvas");i.width=t,i.height=n;const r=i.getContext("2d"),s=new Jt(r,{type:e.config.type,data:JSON.parse(JSON.stringify(e.config.data)),options:{...JSON.parse(JSON.stringify(e.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1}});await new Promise(l=>setTimeout(l,300));const a=i.toDataURL("image/png",1);return s.destroy(),a}catch{return null}};window.findSingleReportComponent=function(){if(!window.Livewire)return null;const e=document.getElementById("single-report-component");if(e){const n=e.closest("[wire\\:id]");if(n)return window.Livewire.find(n.getAttribute("wire:id"))}const t=document.querySelectorAll("[wire\\:id]");for(let n of t)if(n.querySelector("[data-chart-data]")||n.querySelector("[data-balance-chart-data]")||n.querySelector("#returnRatioChart")||n.querySelector("#accountBalancesChart")||n.querySelector("#account-balances")||n.querySelector("#transaction-types"))return window.Livewire.find(n.getAttribute("wire:id"));return null};window.exportPdfWithChart=async function(){const e=await window.exportReturnRatioChartForPdf();let t=null;window.accountBalancesChart&&(t=await window.exportAccountBalancesChartForPdf());let n=null,i=null;if(window.exportBalanceDistributionChartForPdf&&(n=await window.exportBalanceDistributionChartForPdf("reportBalanceDistributionChart"),i=await window.exportBalanceDistributionChartForPdf("reportBalanceDistributionOrgChart")),!e&&!t&&!n&&!i){if(window.Livewire){const u=window.findSingleReportComponent();u&&u.call("exportPdf")}return}const r=document.querySelector("[data-balance-chart-data]")||document.querySelector("[data-chart-data]");let s=null,a=null,l=!1;if(r){const u=r.getAttribute("data-date-range");if(u){const h=u.split(" to ");h.length===2&&(s=h[0].trim(),a=h[1].trim())}l=r.getAttribute("data-decimal-format")==="1"}if(window.Livewire)try{const u=window.findSingleReportComponent();if(!u)throw new Error("SingleReport Livewire component not found");await u.call("exportPdfWithCharts",e,t,s,a,l,n,i,typeof window.exportNetworkForPdf=="function"?window.exportNetworkForPdf():null)}catch{try{const h=window.findSingleReportComponent();h&&await h.call("exportPdf")}catch{}}};Jt.register(...Hc);window.initAccountBalancesChart=function(e,t){var s;const n=document.getElementById("accountBalancesChart");if(!n||!e||e.length===0)return;const i=n.getContext("2d");if(!i)return;n.chart&&n.chart.destroy();function r(a){if(t){const m=a<0,x=(Math.abs(a)/60).toFixed(2).replace(".",",");return(m?"-":"")+x+" h."}const l=a<0,u=Math.abs(a),h=Math.floor(u/60),d=String(u%60).padStart(2,"0");return"H "+(l?"-":"")+h+":"+d}try{const a=[],l=new Map;e.forEach(S=>{S.accounts&&Array.isArray(S.accounts)&&S.accounts.forEach(C=>{l.has(C.account_id)||l.set(C.account_id,{name:C.account_name,id:C.account_id})})});const u=["#3B82F6","#10B981","#F59E0B","#EF4444"];let h=0;if(l.forEach((S,C)=>{const T=e.map(A=>{var D;const M=(D=A.accounts)==null?void 0:D.find(R=>R.account_id===C);return(M?parseInt(M.balance):0)/60});a.push({label:S.name,data:T,borderColor:u[h%u.length],backgroundColor:u[h%u.length]+"33",borderWidth:3,tension:.4,fill:!0,pointRadius:6,pointHoverRadius:8,pointBackgroundColor:u[h%u.length],pointBorderColor:"#ffffff",pointBorderWidth:2}),h++}),a.length===0)return;const d=e.map(S=>S.label),m=d.length===1?"bar":"line",y=((s=e[0])==null?void 0:s.translations)||{period:"Period",balance:"Balance"},x={type:m,data:{labels:d,datasets:a},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",align:"start",labels:{usePointStyle:!0,color:"#1F2937"}},tooltip:{callbacks:{label:function(S){const C=Math.round(S.parsed.y*60);return S.dataset.label+": "+r(C)}}}},scales:{x:{display:!0,title:{display:!0,text:y.period,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",autoSkip:!1,maxRotation:60,minRotation:60,padding:8,font:{size:10}}},y:{display:!0,title:{display:!0,text:y.balance,color:"#6B7280"},grid:{color:"rgba(0, 0, 0, 0.1)"},ticks:{color:"#6B7280",callback:function(S){const C=Math.round(S*60);return r(C)}}}}}};n.chart=new Jt(i,x),window.accountBalancesChart=n.chart}catch{}};function My(){const e=document.querySelector("[data-balance-chart-data]");if(!e)return;const t=e.getAttribute("data-balance-chart-data");if(t)try{const n=JSON.parse(t),i=e.getAttribute("data-decimal-format")==="1";typeof window.initAccountBalancesChart=="function"&&window.initAccountBalancesChart(n,i)}catch{}}document.addEventListener("DOMContentLoaded",()=>{setTimeout(My,100)});document.addEventListener("livewire:init",()=>{let e=null;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(()=>{My()},300)})});window.exportAccountBalancesChartForPdf=async function(){if(!window.accountBalancesChart)return null;try{const e=window.accountBalancesChart,t=900,n=400,i=document.createElement("canvas");i.width=t,i.height=n;const r=i.getContext("2d"),s=new Jt(r,{type:e.config.type,data:JSON.parse(JSON.stringify(e.config.data)),options:{...JSON.parse(JSON.stringify(e.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1}});await new Promise(l=>setTimeout(l,300));const a=i.toDataURL("image/png",1);return s.destroy(),a}catch{return null}};const Ry=[{key:"volume",canvasId:"statsVolumeChart",dataAttribute:"data-stats-volume-chart",globalName:"statsChartVolume",stacked:!0,dynamicSeries:!0},{key:"registrations",pdfWidth:331,pdfHeight:124,canvasId:"statsRegistrationsChart",dataAttribute:"data-stats-registrations-chart",globalName:"statsChartRegistrations",series:[{field:"User",label:"User"}]},{key:"registrationsOrg",pdfWidth:331,pdfHeight:124,canvasId:"statsRegistrationsOrgChart",dataAttribute:"data-stats-registrations-org-chart",globalName:"statsChartRegistrationsOrg",series:[{field:"Organization",label:"Organization"}]},{key:"inactivations",type:"line",pdfWidth:674,pdfHeight:200,canvasId:"statsInactivationsChart",dataAttribute:"data-stats-inactivations-chart",globalName:"statsChartInactivations",series:[{field:"count",label:"Profiles marked as inactive"},{field:"balance",label:"Total balance",axis:"y1",currency:!0},{field:"incomplete",label:"Incomplete profiles"}],secondAxis:{id:"y1",currency:!0},footerField:"added"},{key:"balance",bandedAxis:!0,pdfWidth:674,pdfHeight:200,canvasId:"statsBalanceChart",dataAttribute:"data-stats-balance-chart",globalName:"statsChartBalance",series:[{field:"User",label:"User"}]},{key:"balanceOrg",bandedAxis:!0,pdfWidth:674,pdfHeight:200,canvasId:"statsBalanceOrgChart",dataAttribute:"data-stats-balance-org-chart",globalName:"statsChartBalanceOrg",series:[{field:"Organization",label:"Organization"}]},{key:"engagementPosts",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementPostsChart",dataAttribute:"data-stats-engagement-posts-chart",globalName:"statsChartEngagementPosts",series:[{field:"posts",label:"Posts"}]},{key:"engagementCalls",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementCallsChart",dataAttribute:"data-stats-engagement-calls-chart",globalName:"statsChartEngagementCalls",series:[{field:"calls",label:"Calls"}]},{key:"engagementReactions",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementReactionsChart",dataAttribute:"data-stats-engagement-reactions-chart",globalName:"statsChartEngagementReactions",series:[{field:"reactions",label:"Reactions"}]},{key:"engagementMessages",pdfWidth:331,pdfHeight:124,canvasId:"statsEngagementMessagesChart",dataAttribute:"data-stats-engagement-messages-chart",globalName:"statsChartEngagementMessages",series:[{field:"messages",label:"Messages"}]}],Cv=["#f87171","#4ade80","#60a5fa","#c084fc"],HR=.72;function Dy(e){const t=String(e).replace("#",""),n=t.length===3?t.split("").map(i=>i+i).join(""):t;return/^[0-9a-f]{6}$/i.test(n)?[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]:null}function Ov(e,t=HR){const n=Dy(e);if(!n)return e;const[i,r,s]=n.map(a=>Math.round(a*t));return`rgb(${i}, ${r}, ${s})`}function zR(e,t){const n=Dy(e);if(!n)return e;const[i,r,s]=n;return`rgba(${i}, ${r}, ${s}, ${t})`}function WR(e){const t=getComputedStyle(document.documentElement).getPropertyValue("--color-primary-500").trim();return t?`rgb(${t})`:e}function jR(e){var j,q,F;const t=document.getElementById(e.canvasId);if(!t||typeof window.Chart>"u")return;const n=t.closest(`[${e.dataAttribute}]`);if(!n)return;let i;try{i=JSON.parse(n.getAttribute(e.dataAttribute)||"[]")}catch{return}if(!Array.isArray(i)||i.length===0)return;const r=n.getAttribute("data-decimal-format")==="1",s=`${n.getAttribute(e.dataAttribute)}|${r}`,a=(q=(j=window.Chart).getChart)==null?void 0:q.call(j,t);if(t.dataset.chartSignature===s&&a){window[e.globalName]=a;return}const l=window.Chart.getChart?window.Chart.getChart(t):null;l?l.destroy():typeof((F=window[e.globalName])==null?void 0:F.destroy)=="function"&&window[e.globalName].destroy();const u=e.key==="volume",h=Ov(n.getAttribute("data-chart-color")||WR("rgb(59, 130, 246)")),d=n.getAttribute("data-currency-symbol")||"",m=n.getAttribute("data-currency-position-end")==="1",y=n.getAttribute("data-currency-thousand-separator")||"",x=H=>y?String(H).replace(/\B(?=(\d{3})+(?!\d))/g,y):String(H),S=H=>d?m?`${H} ${d}`:`${d} ${H}`:H,C=(H,U=!1)=>{if(r)return S(`${H.toFixed(2).replace(".",",")} h.`);const V=H<0,st=Math.abs(H),tt=Math.floor(st),it=Math.round((st-tt)*60),K=it===60?tt+1:tt,ct=it===60?0:it,dt=V?"-":"",_t=x(K);return S(U&&ct===0?`${dt}${_t}`:`${dt}${_t}:${String(ct).padStart(2,"0")}`)};let T={},A={};try{T=JSON.parse(n.getAttribute("data-series-labels")||"{}"),A=JSON.parse(n.getAttribute("data-series-colors")||"{}")}catch{T={},A={}}const M=e.type||"bar",B=M==="line",D=e.dynamicSeries?Object.keys(i[0]||{}).filter(H=>!["label","ym","count","volume"].includes(H)).map(H=>({field:H,label:H})):e.series,R=!e.secondAxis||(D||[]).some(H=>H.axis===e.secondAxis.id&&i.some(U=>Number(U[H.field])!==0)),N=(D||[]).filter(H=>R||!e.secondAxis||H.axis!==e.secondAxis.id),I=D?N.map((H,U)=>{const V=A[H.field]||Cv[U%Cv.length],st=Ov(V);return{label:T[H.field]||H.label,data:i.map(tt=>tt[H.field]||0),backgroundColor:B?zR(V,.15):st,borderColor:st,borderWidth:B?2:1,...B?{tension:e.stepLike===!0?0:.3,pointRadius:0,pointHoverRadius:4,fill:!1}:{},...H.axis?{yAxisID:H.axis}:{},...H.dashed?{borderDash:[6,4]}:{}}}):[{label:u?"volume":"count",data:i.map(H=>u?(H.volume||0)/60:H.count||0),backgroundColor:h,borderColor:h,borderWidth:1}];window[e.globalName]=new window.Chart(t.getContext("2d"),{type:M,data:{labels:i.map(H=>H.label),datasets:I},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{bottom:16}},plugins:{legend:I.length>1?{display:!0,position:"bottom",align:"start",labels:{boxWidth:12,usePointStyle:!0,padding:16}}:{display:!1},tooltip:{mode:e.stacked===!0?"index":"nearest",intersect:e.stacked!==!0,callbacks:{title:H=>{var V,st;const U=i[(V=H[0])==null?void 0:V.dataIndex];return(U==null?void 0:U.range)||((st=H[0])==null?void 0:st.label)||""},label:H=>{const U=H.parsed.y,V=N==null?void 0:N[H.datasetIndex],tt=u||(V==null?void 0:V.currency)===!0?C(U):`${U}`;return I.length>1?`${H.dataset.label}: ${tt}`:tt},footer:H=>{if(H.length===0)return;if(e.footerField){const V=i[H[0].dataIndex],st=(V==null?void 0:V[e.footerField])||0,tt=n.getAttribute("data-footer-label");return tt?`${tt}: +${st}`:`+${st}`}if(e.stacked!==!0)return;const U=H.reduce((V,st)=>V+(st.parsed.y||0),0);return`∑ ${u?C(U):U}`}}}},scales:{y:{beginAtZero:!0,stacked:e.stacked===!0,ticks:u?{callback:H=>C(H,!0)}:{precision:0}},...e.secondAxis&&R?{[e.secondAxis.id]:{position:"right",beginAtZero:!0,grid:{drawOnChartArea:!1},ticks:e.secondAxis.currency?{callback:H=>C(H,!0)}:{precision:0}}}:{},x:{stacked:e.stacked===!0,grid:{display:!0,drawOnChartArea:!0,offset:e.bandedAxis!==!0,color:"rgba(0, 0, 0, 0.10)"},ticks:{padding:8,autoSkip:!1,maxRotation:60,minRotation:60,font:{size:10}}}}}}),t.dataset.chartSignature=s}function Ly(){Ry.forEach(e=>{try{jR(e)}catch(t){console.error(`[stats-charts] ${e.canvasId} failed to render:`,t)}})}document.addEventListener("DOMContentLoaded",()=>{setTimeout(Ly,100)});document.addEventListener("livewire:init",()=>{let e=null;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(Ly,300)}),Livewire.on("openStatsPdf",t=>{window.open(Array.isArray(t)?t[0]:t,"_blank")})});async function $R(e){var i,r;const t=document.getElementById(e.canvasId),n=t&&((r=(i=window.Chart).getChart)==null?void 0:r.call(i,t))||window[e.globalName];if(!n)return null;try{const a=e.pdfWidth||674,l=e.pdfHeight||180,u=document.createElement("canvas");u.width=a*2,u.height=l*2;const h=JSON.parse(JSON.stringify({type:n.config.type,data:n.config.data,options:n.config.options}));h.options={...h.options,responsive:!1,maintainAspectRatio:!1,animation:!1,devicePixelRatio:2};const d=new window.Chart(u.getContext("2d"),h);await new Promise(y=>setTimeout(y,300));const m=u.toDataURL("image/png",1);return d.destroy(),m}catch{return null}}function UR(){if(!window.Livewire)return null;const e=document.getElementById("stats-component"),t=e?e.closest("[wire\\:id]")||e:null;return t&&t.getAttribute("wire:id")?window.Livewire.find(t.getAttribute("wire:id")):null}window.exportStatsPdf=async function(){const e=UR();if(!e)return;const t={};for(const i of Ry){const r=await $R(i);r&&(t[i.key]=r)}if(typeof window.exportNetworkForPdf=="function"){const i=window.exportNetworkForPdf();i&&(t.network=i)}const n=document.querySelector("[data-network-host]");n&&n.dataset.networkSubtext&&(t.networkSubtext=n.dataset.networkSubtext);try{await e.call("exportPdf",t)}catch{try{await e.call("exportPdf",{})}catch{}}};const nf=16,VR=8;class ds{constructor(t){this.deltas=t||[],this.checkpoints=new Map,this.recent=new Map;const n=new Set,i=new Set;this.deltas.forEach((r,s)=>{ds.apply(n,i,r),s%nf===0&&this.checkpoints.set(s,{nodes:new Set(n),edges:new Set(i)})})}static apply(t,n,i){(i.nodes_removed||[]).forEach(r=>t.delete(r)),(i.nodes_added||[]).forEach(r=>t.add(r)),(i.edges_removed||[]).forEach(r=>n.delete(r)),(i.edges_added||[]).forEach(r=>n.add(r))}get length(){return this.deltas.length}at(t){if(t<0||t>=this.deltas.length)return null;if(this.recent.has(t))return this.recent.get(t);let n;if(this.checkpoints.has(t))n=this.checkpoints.get(t);else{const i=this.recent.has(t-1)?t-1:Math.floor(t/nf)*nf,r=this.recent.get(i)||this.checkpoints.get(i),s=new Set(r.nodes),a=new Set(r.edges);for(let l=i+1;l<=t;l++)ds.apply(s,a,this.deltas[l]);n={nodes:s,edges:a}}return this.recent.set(t,n),this.recent.size>VR&&this.recent.delete(this.recent.keys().next().value),n}}function qR(e){const t=e&&e.frames||[],n=new ds(t),i=e&&e.ghosts?new ds(e.ghosts):null,r=e&&e.history?new ds(e.history):null;return{count:t.length,step:s=>t[s]?{label:t[s].label,till:t[s].till}:null,layers:s=>({current:n.at(s),ghost:i?i.at(s):null,back:r?r.at(s):null})}}const kv=new WeakMap;function ni(e){if(e&&e.nodes instanceof Set)return e;let t=kv.get(e);return t||(t={nodes:new Set((e.nodes||[]).map(n=>n.id)),edges:new Set((e.edges||[]).map(n=>typeof n=="string"?n:`${n.source}|${n.target}|${n.type_id}`))},kv.set(e,t)),t}function XR(e){zc(e)}function zc(e){let t=e.scratch("_timelapseIndex");return t||(t={nodes:new Map,edges:new Map},e.nodes().forEach(n=>t.nodes.set(n.id(),n)),e.edges().forEach(n=>{const i=n.data("key");t.edges.has(i)||t.edges.set(i,[]),t.edges.get(i).push(n)}),e.scratch("_timelapseIndex",t)),t}function Zo(e,t,n=t?1:0){const i=e.scratch("_timelapse")||{};i.shown!==t&&(e.style("display",t?"element":"none"),i.shown=t),i.opacity!==n&&(e.style("opacity",n),i.opacity=n),e.scratch("_timelapse",i)}const YR=.5;function Iy(e,t){if(!Number.isFinite(t))return;const n=e.data("size");(!Number.isFinite(n)||Math.abs(n-t)>=YR)&&e.data("size",t)}const KR=.25,GR=.15,If={current:1,ghost:KR,history:GR,hidden:0};function JR(e){let t,n,i;const r=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(String(e||"").trim());if(r){const l=r[1].length===3?r[1].split("").map(u=>u+u).join(""):r[1];t=parseInt(l.slice(0,2),16),n=parseInt(l.slice(2,4),16),i=parseInt(l.slice(4,6),16)}else{const l=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(String(e||""));if(!l)return"#94a3b8";[t,n,i]=l.slice(1,4).map(Number)}const a=Math.round(.2126*t+.7152*n+.0722*i).toString(16).padStart(2,"0");return`#${a}${a}${a}`}function vd(e,t){const n=e.scratch("_timelapse")||{},i=t==="ghost"||t==="history";if(n.tier===t){i&&e.data("ghostColor")!==n.grey&&e.data("ghostColor",n.grey);return}const r=n.tier==="ghost"||n.tier==="history";i&&!r?(n.grey=JR(bd(e)),e.data("ghostColor",n.grey)):i&&e.data("ghostColor")!==n.grey&&e.data("ghostColor",n.grey),t!=="hidden"&&(e.toggleClass("ghost",i),e.toggleClass("history",t==="history")),n.tier=t,e.scratch("_timelapse",n)}function Ny(e){const t=e.scratch("_timelapse")||{};e.removeClass("ghost history"),t.tier="hidden",e.scratch("_timelapse",t)}function Sc(e,t,n,i){return t.has(e)?"current":n&&n.has(e)?"ghost":i&&i.has(e)?"history":"hidden"}function Nf(e,t,n=null){const i=ni(t.current),r=t.ghost?ni(t.ghost):null,s=t.back?ni(t.back):null,a=(l,u)=>{if(u==="hidden"){Zo(l,!1),Ny(l);return}vd(l,u),Zo(l,!0,If[u])};e.batch(()=>{e.nodes().forEach(l=>{const u=l.id();a(l,Sc(u,i.nodes,r&&r.nodes,s&&s.nodes)),n&&(l.scratch("_timelapse")||{}).shown&&Iy(l,n(u))}),e.edges().forEach(l=>{const u=l.data("key");a(l,Sc(u,i.edges,r&&r.edges,s&&s.edges))})})}function ZR(e,t,n){const i={current:ni(t.current),ghost:t.ghost?ni(t.ghost):null,back:t.back?ni(t.back):null},r={current:ni(n.current),ghost:n.ghost?ni(n.ghost):null,back:n.back?ni(n.back):null},s=zc(e),a=[],l=[],u=[],h=(d,m,y)=>{if(d==="nodes"){const x=s.nodes.get(m);x&&y(x)}else(s.edges.get(m)||[]).forEach(y)};return e.batch(()=>{["nodes","edges"].forEach(d=>{const m=C=>C?C[d]:null,y=new Set;[r.current,i.current,r.ghost,i.ghost].forEach(C=>{C&&C[d].forEach(T=>y.add(T))});const x=m(i.back),S=m(r.back);S&&S.forEach(C=>{(!x||!x.has(C))&&y.add(C)}),x&&x.forEach(C=>{(!S||!S.has(C))&&y.add(C)}),y.forEach(C=>{const T=Sc(C,i.current[d],m(i.ghost),x),A=Sc(C,r.current[d],m(r.ghost),S);if(T===A)return;const M=If[T],B=If[A];h(d,C,D=>{const R=D.scratch("_timelapse")||{},N=R.shown?R.opacity:0,I={element:D,from:N,to:B,colorFrom:null,colorTo:null,tierAtEnd:null};if(A!=="hidden"){const j=tD(D),q=A==="ghost"||A==="history";q||!D.hasClass("ghost")?vd(D,A):I.tierAtEnd=A;const F=q?(D.scratch("_timelapse")||{}).grey:bd(D);D.hasClass("ghost")&&j!==F&&(D.data("ghostColor",j),I.colorFrom=j,I.colorTo=F)}Zo(D,!0,N),B>M?a.push(I):(l.push(I),A==="hidden"&&u.push(I))})})})}),{cy:e,arriving:a,departing:l,expiring:u}}function QR(e,t,n=null){const i=zc(e),r=new Map,s=new Map,a=[],l=(y,x,S,C)=>{let T=y.get(x);T||(T={steps:[],values:[]},y.set(x,T)),T.steps[T.steps.length-1]===S?T.values[T.values.length-1]=C:(T.steps.push(S),T.values.push(C))},u=new Set,h=new Set,d=new Map;for(let y=0;y{A&&ni(A).edges.forEach(M=>{u.has(M)||(u.add(M),(i.edges.get(M)||[]).forEach(B=>{const D=B.source().id(),R=B.target().id(),N=D{const j=(d.get(I)||0)+1;d.set(I,j),l(r,I,y,j),x.add(I)}))}))})});const T=n?n[y]:null;T&&Object.keys(T).forEach(A=>{l(s,A,y,Number(T[A])||0),x.add(A)}),a.push([...x])}const m=(y,x,S)=>{const C=y.get(x);if(!C||C.steps[0]>S)return 0;let T=0,A=C.steps.length-1;for(;T>1;C.steps[M]<=S?T=M:A=M-1}return C.values[T]};return{degreeAt:(y,x)=>m(r,y,x),volumeAt:(y,x)=>m(s,y,x),changedAt:y=>a[y]||[]}}function Fy(e,t){Zo(e.element,!0,t>=1?e.to:e.from+(e.to-e.from)*t),e.colorFrom&&e.element.data("ghostColor",eD(e.colorFrom,e.colorTo,t))}function Av(e){const{element:t}=e;Fy(e,1),e.tierAtEnd&&vd(t,e.tierAtEnd),e.to===0&&(Zo(t,!1),Ny(t))}function bd(e){return e.isNode()?e.data("color"):e.data("edgeColor")||"#64748b"}function tD(e){return e.hasClass("ghost")?e.data("ghostColor"):bd(e)}function Ev(e){const t=String(e||"").trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){const r=n[1].length===3?n[1].split("").map(s=>s+s).join(""):n[1];return[0,2,4].map(s=>parseInt(r.slice(s,s+2),16))}const i=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(t);return i?i.slice(1,4).map(Number):null}function eD(e,t,n){const i=Ev(e),r=Ev(t);return!i||!r?n<.5?e:t:"#"+i.map((s,a)=>Math.round(s+(r[a]-s)*n).toString(16).padStart(2,"0")).join("")}function nD(e){const t=new Map;return{add(n,i,r){[...n.arriving,...n.departing].forEach(s=>{t.set(s.element,{item:s,start:i,duration:r})})},tick(n){return t.size===0?!1:(e.batch(()=>{t.forEach(({item:i,start:r,duration:s},a)=>{const l=Math.min(1,(n-r)/s);l>=1?(Av(i),t.delete(a)):Fy(i,l*l*(3-2*l))})}),t.size>0)},settle(){e.batch(()=>t.forEach(({item:n})=>Av(n))),t.clear()},clear(){t.clear()}}}const iD=450,rD=4;function Pv(e){return Math.max(e,Math.min(iD,e*rD))}function sD({cy:e,count:t,layersAt:n,interval:i=450,onFrame:r=null,sizeOf:s=null,changedAt:a=null,holdAtEnd:l=3e3,loop:u=!0}){let h=i,d=0,m=null,y=!1,x=0;const S=nD(e),C=()=>{r&&r(d)},T=D=>{S.clear(),d=Math.max(0,Math.min(D,t-1)),Nf(e,n(d),s?R=>s(R,d):null),C()},A=D=>{if(!s||!a)return;const R=zc(e).nodes;e.batch(()=>{a(D).forEach(N=>{const I=R.get(N);I&&Iy(I,s(N,D))})})},M=D=>{if(m=null,y&&D>=x)if(d>=t-1)u?(T(0),x=D+h):(y=!1,C());else{const N=ZR(e,n(d),n(d+1));d+=1,A(d),C(),S.add(N,D,Pv(h)),x=Math.max(x+h,D),d>=t-1&&(x=D+Pv(h)+l)}const R=S.tick(D);(y||R)&&(m=requestAnimationFrame(M))},B=()=>{m===null&&(m=requestAnimationFrame(M))};return{play(){y||t===0||(y=!0,d>=t-1&&T(0),x=performance.now(),B())},pause:()=>{y=!1},isPlaying:()=>y,setInterval:D=>{h=Math.max(16,D)},goTo:D=>{y=!1,T(D)},currentIndex:()=>d}}const oD=2e3;function aD({screenBox:e,frameBox:t,headerBox:n,button:i,panel:r,signal:s,onResize:a}){if(!e||!t||!i)return;const l=e.requestFullscreen||e.webkitRequestFullscreen,u=document.exitFullscreen||document.webkitExitFullscreen;if(!l||!u){i.hidden=!0;return}const h=()=>document.fullscreenElement||document.webkitFullscreenElement||null,d={capture:!0,passive:!0,signal:s};let m=null,y="mouse",x=!1,S=null;const C=D=>{if(!D||!S)return!1;const R=D.getBoundingClientRect();return S.x>=R.left&&S.x<=R.right&&S.y>=R.top&&S.y<=R.bottom},T=()=>x?!0:y==="mouse"&&[n,r?r():null].some(C),A=()=>{clearTimeout(m),m=setTimeout(()=>{if(h()===e){if(T()){A();return}e.classList.add("controls-hidden")}},oD)},M=()=>{h()===e&&(e.classList.remove("controls-hidden"),A())};["pointermove","mousemove","pointerdown","touchstart","wheel","keydown"].forEach(D=>{document.addEventListener(D,M,d)}),s&&s.addEventListener("abort",()=>clearTimeout(m),{once:!0}),e.addEventListener("pointerdown",D=>{x=!0,y=D.pointerType||"mouse",S={x:D.clientX,y:D.clientY}},d),e.addEventListener("pointermove",D=>{y=D.pointerType||y,S={x:D.clientX,y:D.clientY}},d),e.addEventListener("pointerleave",()=>{S=null},{signal:s}),["pointerup","pointercancel"].forEach(D=>{document.addEventListener(D,()=>{x&&(x=!1,M())},d)}),i.addEventListener("click",D=>{D.preventDefault();const R=h()===e?u.call(document):l.call(e);R&&typeof R.catch=="function"&&R.catch(()=>{})},{signal:s});const B=()=>{var N,I;const D=h()===e,R=D?i.dataset.labelExit:i.dataset.labelEnter;i.setAttribute("title",R),i.setAttribute("aria-label",R),(N=i.querySelector("[data-fullscreen-enter]"))==null||N.classList.toggle("hidden",D),(I=i.querySelector("[data-fullscreen-exit]"))==null||I.classList.toggle("hidden",!D),e.classList.remove("controls-hidden"),clearTimeout(m),D&&A(),a&&requestAnimationFrame(()=>a(D,n?n.offsetHeight:0))};document.addEventListener("fullscreenchange",B,{signal:s}),document.addEventListener("webkitfullscreenchange",B,{signal:s})}const Ff="data-stats-network";let rf=null;function lD(){return rf||(rf=Promise.all([af(()=>import("./cytoscape.esm-B5_a_fx8.js"),[]),af(()=>import("./cytoscape-fcose-Di-e6ZnW.js").then(e=>e.c),__vite__mapDeps([0,1]))]).then(([e,t])=>{const n=e.default||e;return n.use(t.default||t),n})),rf}const cD={User:"#14b8a6",Organization:"#d946ef",Bank:"#f59e0b"};function Tc(e,t){return t?6+Math.pow(e/t,.85)*36:8}const Mv={1:"#1e293b",2:"#4338ca",3:"#16a34a",4:"#eab308",5:"#ff3b00",6:"#0891b2"},By={flowing:"#3b82f6",stalled:"#9333ea",neverPaid:"#22d3ee"};function uD(e,t,n=null,i=!1){const r=new Map,s=(u,h)=>r.set(u,(r.get(u)||0)+h),a=new Set(e.map(u=>u.id));(t||[]).forEach(u=>{const h=a.has(u.source),d=a.has(u.target),m=u.a_to_b||0,y=u.b_to_a||0;m>0&&(h&&s(u.source,-m),d&&s(u.target,m)),y>0&&(d&&s(u.target,-y),h&&s(u.source,y))});const l=new Map;return e.forEach(u=>{const h=r.get(u.id)||0,d=u.days_since_paid;if(d==null){l.set(u.id,{flow:"neverPaid",net:h});return}const m=i&&u.inactive||n!==null&&d>n;l.set(u.id,{flow:m?"stalled":"flowing",net:h})}),l}const Cc=["#3b82f6","#f97316","#14b8a6","#d946ef","#84cc16","#8b5cf6","#ec4899","#22c55e","#0ea5e9","#eab308"];function hD(e){const t=[];e.forEach(i=>{i.region&&!t.includes(i.region)&&t.push(i.region)});const n={};return t.forEach((i,r)=>{n[i]=Cc[r%Cc.length]}),n}const Bf={force:{name:"fcose",quality:"default",animate:!1,randomize:!0,nodeRepulsion:6e3,idealEdgeLength:60},circle:{name:"circle",animate:!1,padding:30,avoidOverlap:!0},concentric:{name:"concentric",animate:!1,padding:30,minNodeSpacing:14,concentric:e=>e.degree(),levelWidth:e=>Math.max(1,e.maxDegree()/6)},tree:{name:"breadthfirst",animate:!1,padding:30,spacingFactor:1.1,directed:!1,circle:!1,grid:!0},grid:{name:"grid",animate:!1,padding:30,avoidOverlap:!0}};function Rv(e,t){const n=Bf[e]||Bf.force;if(n.name!=="breadthfirst")return n;const i=mD(t);return i?{...n,roots:i}:n}let zi,fD=0;const Mo=new Map;function Hy(){if(zi!==void 0)return zi;try{zi=new Worker(new URL("/build/assets/network-layout-worker-BKWU_04t.js",import.meta.url)),zi.onmessage=e=>{const{id:t,positions:n,error:i}=e.data||{},r=Mo.get(t);r&&(Mo.delete(t),i?r.reject(new Error(i)):r.resolve(n))},zi.onerror=e=>{const t=new Error(e&&e.message||"layout worker failed");Mo.forEach(n=>n.reject(t)),Mo.clear(),zi=null}}catch(e){console.error("[network] no layout worker, laying out on the page instead",e),zi=null}return zi}function dD(e,t){const n=Hy();if(!n)return Promise.reject(new Error("no layout worker"));const i=e.nodes().map(l=>({id:l.id(),size:l.data("size")})),r=new Set(i.map(l=>l.id)),s=e.edges().filter(l=>r.has(l.source().id())&&r.has(l.target().id())).map(l=>({id:l.id(),source:l.source().id(),target:l.target().id()})),a=++fD;return new Promise((l,u)=>{Mo.set(a,{resolve:l,reject:u}),n.postMessage({id:a,nodes:i,edges:s,options:t})})}function sf(e,t,n,i=null,r=null,s=null){let a=!1;const l=()=>{a||e.destroyed()||(a=!0,pD(e,t),e.fit(t,zy(e)),Wy(e,t,r),i&&i())},u=d=>{const m=t.layout(d);m.one("layoutstop",l),m.run()},h=d=>{e.destroyed()||(console.error("[network] layout failed, falling back to a simpler one",d),s&&s(d),u({...Bf.concentric}))};if(n.name==="fcose"&&Hy()){dD(t,n).then(d=>{e.destroyed()||(t.nodes().positions(m=>d[m.id()]||m.position()),l())}).catch(h);return}try{u(n)}catch(d){h(d)}}function zy(e){var r;const t=(r=e.container())==null?void 0:r.closest("[data-network-screen]"),n=document.fullscreenElement||document.webkitFullscreenElement;if(!t||n!==t)return 20;const i=t.querySelector("[data-network-header]");return Math.max(20,(i?i.offsetHeight:0)+8)}function Wy(e,t,n){if(!n||!n.width||!n.height)return;const i=t.nodes().renderedBoundingBox();if(!i||!i.w||!i.h)return;const r=8,s=e.height()-n.height-r,a=n.width+r;if(i.y2<=s||i.x1>=a)return;const l=s-20,u=Math.min(1,l/i.h);u<1&&e.zoom({level:e.zoom()*u,renderedPosition:{x:e.width()/2,y:e.height()/2}});const d=t.nodes().renderedBoundingBox().y2-s;d>0&&e.panBy({x:0,y:-d})}function pD(e,t){const n=t.nodes();if(n.length<2)return;const i=n.boundingBox();if(!i.w||!i.h)return;const r=e.width()*.88,s=e.height()*.82,a=r/i.w,l=s/i.h,u=i.x1+i.w/2,h=i.y1+i.h/2,d={x:e.width()/2,y:e.height()/2};n.positions(m=>{const y=m.position();return{x:d.x+(y.x-u)*a,y:d.y+(y.y-h)*l}})}function gD(e,t,n){const i=t.nodes().not(".hidden");if(i.length<2)return;const r=i.boundingBox(),s=r.x1+r.w/2,a=r.y1+r.h/2;i.positions(l=>{const u=l.position();return{x:s+(u.x-s)*n,y:a+(u.y-a)*n}})}function mD(e){return e.nodes().not(".hidden").max(n=>n.degree()).ele||null}function Dv(e,t,n){const i=le(e,"[data-network-cluster-legend]");if(!i)return;if(t.length===0){i.hidden=!0;return}const r=(()=>{try{return JSON.parse(e.getAttribute("data-network-labels")||"{}")}catch{return{}}})(),a=[...t].sort((h,d)=>d.size-h.size).slice(0,8),l=n-a.length,u=r.profiles||"profiles";i.innerHTML=a.map((h,d)=>` ${ce(r.cluster||"Cluster")} ${d+1} · ${h.size} ${ce(u)} `).join("")+(l>0?`${ce(r.more||"+ :count more").replace(":count",l)}`:""),i.hidden=!1}function le(e,t){return e.querySelector(t)||(e.closest("[data-network-section]")||document).querySelector(t)}function of(e,t,n){const i=e&&e.querySelector("[data-timelapse-play]");if(!i)return;const r=t==="busy",s={play:e.querySelector("[data-timelapse-icon-play]"),pause:e.querySelector("[data-timelapse-icon-pause]"),busy:e.querySelector("[data-timelapse-icon-busy]")};i.disabled=!0,i.setAttribute("title",n),i.setAttribute("aria-label",n),s.busy&&s.busy.classList.toggle("hidden",!r),s.play&&s.play.classList.toggle("hidden",r),s.pause&&s.pause.classList.add("hidden")}function vD(e,t){let n=0,i=e.length-1,r=null;for(;n<=i;){const s=n+i>>1;e[s]<=t?(r=e[s],n=s+1):i=s-1}return r}function Lv(e,t,n,{view:i,stoppedAfterDays:r,markInactive:s}){if(!n||!t||!t.till)return;const a=t.till,l=Date.parse(a),u=n.paid||{},h=n.removed||{},d=n.inactive||{};e.batch(()=>{e.nodes().forEach(m=>{const y=m.id(),x=!!h[y]&&h[y]<=a,S=!x&&!!d[y]&&d[y]<=a;if(m.hasClass("removed")!==x&&m.toggleClass("removed",x),m.hasClass("inactive")!==S&&m.toggleClass("inactive",S),i!=="circulation"||m.hasClass("outside"))return;const C=vD(u[y]||[],a);let T="neverPaid";if(C!==null){const A=Math.round((l-Date.parse(C))/864e5);T=s&&S||r!==null&&A>r?"stalled":"flowing"}m.data("flow")!==T&&(m.data("flow",T),m.data("color",By[T]||"#94a3b8"))})})}const Iv=.5,bD=30;function Nv(e){const t=Math.max(0,Math.min(100,Number(e)||0))/100;return Iv*Math.pow(bD/Iv,t)}function yD(e){return e<10?`${e.toFixed(1)}/s`:`${Math.round(e)}/s`}function Fv(e,t,n){const i=le(e,"[data-network-stagnant]");if(!i)return;const r=l=>l instanceof Set?l.size:(l||[]).length,s=(i.dataset.drawnTemplate||"").replace(":nodes",r(n.nodes)).replace(":edges",r(n.edges));i.textContent=s?`${t}: ${s}`:t,i.hidden=!1;const a=e.querySelector("[data-network-host]");a&&(a.dataset.networkSubtext=i.textContent)}function ce(e){return String(e).replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t])}let hs={symbol:"H",atEnd:!1,thousands:"."};function xo(e){const t=(e||0)/60,n=t>=100?Math.round(t):Math.round(t*10)/10;let i=String(n).replace(".",",");if(hs.thousands){const[r,s]=i.split(","),a=r.replace(/\B(?=(\d{3})+(?!\d))/g,hs.thousands);i=s?`${a},${s}`:a}return hs.atEnd?`${i} ${hs.symbol}`:`${hs.symbol} ${i}`}function Ro(e){try{return e?JSON.parse(e):null}catch{return null}}function _D(e,t,n,i=null,r=!1){const s=e.nodes.reduce((F,H)=>Math.max(F,H.volume||0),0),a=e.nodes.reduce((F,H)=>!F||H.degree>F.degree?H:F,null),l=t&&a?a.id:null,u=e.nodes.filter(F=>F.id!==l),h=hD(u),d=new Set(u.map(F=>F.id)),m=new Map;(e.edges||[]).forEach(F=>{!d.has(F.source)||!d.has(F.target)||(m.has(F.source)||m.set(F.source,new Set),m.has(F.target)||m.set(F.target,new Set),m.get(F.source).add(F.target),m.get(F.target).add(F.source))}),u.forEach(F=>{F.totalDegree=F.degree,F.degree=(m.get(F.id)||new Set).size});const y=n==="circulation"?uD(u,e.edges||[],i,r):new Map,x=u.reduce((F,H)=>Math.max(F,H.degree||0),0),S=u.map(F=>{const H=n==="volume"?Tc(F.volume||0,s):Tc(F.degree||0,x),U=F.outside?"#94a3b8":n==="circulation"?By[(y.get(F.id)||{}).flow]||"#94a3b8":n==="region"?h[F.region]||"#64748b":cD[F.type]||"#64748b";return{data:{id:F.id,label:F.name,fullName:F.full_name||null,type:F.type,region:F.region||"",bank:F.bank||"",degree:F.degree,hiddenPartners:Math.max((F.totalDegree||F.degree)-F.degree,0),volume:F.volume,paid:F.paid||0,received:F.received||0,size:H,color:U,flow:(y.get(F.id)||{}).flow||null,flowNet:(y.get(F.id)||{}).net||0,borderW:1,outlineW:1.5,fontS:14},classes:[F.outside?"outside":"",F.removed?"removed":"",F.inactive?"inactive":""].filter(Boolean).join(" ")}}),C=new Set(S.map(F=>F.data.id)),T=e.edges.reduce((F,H)=>Math.max(F,H.volume||0),0),A=e.edges.filter(F=>C.has(F.source)&&C.has(F.target)),M=F=>T?.2+Math.pow((F||0)/T,.7)*12:.5,B=[],D=new Map,R=(F,H)=>{const U=`${F}->${H}`,V=D.get(U)||0;return D.set(U,V+1),26+V*22};A.forEach((F,H)=>{if(n!=="flow"){B.push({data:{id:`e${H}`,key:`${F.source}|${F.target}|${F.type_id}`,source:F.source,target:F.target,tx:F.tx,volume:F.volume,width:Math.min(.2+Math.pow(Math.log2(1+F.tx),1.5)*.55,12),bend:26}});return}const U=F.a_to_b||0,V=F.b_to_a||0;U>0&&B.push({data:{id:`e${H}f`,key:`${F.source}|${F.target}|${F.type_id}`,source:F.source,target:F.target,tx:F.tx,volume:U,width:M(U),bend:R(F.source,F.target),edgeColor:Mv[F.type_id]||"#64748b"},classes:"directed flowtype"}),V>0&&B.push({data:{id:`e${H}b`,key:`${F.source}|${F.target}|${F.type_id}`,source:F.target,target:F.source,tx:F.tx,volume:V,width:M(V),bend:R(F.target,F.source),edgeColor:Mv[F.type_id]||"#64748b"},classes:"directed flowtype"})});const N=a?{...a,label:a.name}:null;let I=0,j=0,q=0;return y.forEach(F=>{if(F.flow==="neverPaid")q+=1;else if(F.flow!=="stalled")return;I+=1,F.net>0&&(j+=F.net)}),{elements:[...S,...B],hub:N,droppedHub:!!l,regions:h,stagnantNodes:I,stagnantMinutes:j,neverPaidNodes:q}}async function wD(e){const t=e.querySelector("[data-network-host]");if(!t)return;const n=Z=>{const et=t.querySelector("[data-network-placeholder] span");et&&(et.textContent=Z)},i=Z=>(n(Z),new Promise(et=>{requestAnimationFrame(()=>requestAnimationFrame(et))})),r=Ro(e.getAttribute("data-network-labels"))||{};let s;try{s=JSON.parse(e.getAttribute(Ff)||"{}")}catch{n(r.drawFailed||"The network could not be drawn.");return}if(!s.nodes||s.nodes.length===0){n(r.drawEmpty||"No network to draw for this selection.");return}const a=[e.getAttribute(Ff),e.getAttribute("data-network-view"),e.getAttribute("data-network-layout"),e.getAttribute("data-hide-hub"),e.getAttribute("data-network-anonymize"),e.getAttribute("data-network-stopped-after"),e.getAttribute("data-network-mark-inactive"),e.getAttribute("data-network-timelapse"),e.getAttribute("data-network-timelapse-months"),e.getAttribute("data-network-timelapse-cumulative"),e.getAttribute("data-network-timelapse-step")].join("|");if(t.dataset.networkSignature===a&&t._cy&&!t._cy.destroyed()||t._buildingSignature===a)return;const l=(t._buildId||0)+1;t._buildId=l,t._buildingSignature=a;const u=()=>t._buildId!==l,h=Ro(e.getAttribute("data-currency"));h&&(hs=h);const d=e.getAttribute("data-hide-hub")!=="0",m=e.getAttribute("data-network-view")||"volume",y=e.getAttribute("data-network-layout")||"force";await i(r.loading||"Loading...");const x=await lD();if(u())return;const S=e.getAttribute("data-network-timelapse")==="1",C=S?Ro(e.getAttribute("data-network-timelapse-months"))||[]:[],T=e.closest("[wire\\:id]"),A=T&&window.Livewire?window.Livewire.find(T.getAttribute("wire:id")):null;let M=[],B=!1,D=null,R=null,N=null;if(S&&A&&C.length>0){of(le(e,"[data-network-timelapse-controls]"),"busy",r.timelapseLoading||"Loading the time-lapse..."),await i(r.timelapseLoading||"Loading the time-lapse...");try{const Z=await A.call("networkTimelapseData");if(u())return;const et=Z&&Z.graph;et&&(et.nodes||[]).length>0&&(s=et,D=Z.timeline||null,N=Z.volumes||null,R=qR(Z),M=Array.from({length:R.count},(ht,lt)=>R.step(lt)))}catch(Z){M=[],B=!0,console.error("[time-lapse] loading the frames failed",Z)}}const I=parseInt(e.getAttribute("data-network-stopped-after"),10);if(await i((r.preparing||"Preparing :count profiles...").replace(":count",(s.nodes||[]).length)),u())return;const{elements:j,hub:q,droppedHub:F,stagnantNodes:H,stagnantMinutes:U,neverPaidNodes:V}=_D(s,d,m,Number.isFinite(I)?I:null,e.getAttribute("data-network-mark-inactive")==="1");t._cy&&t._cy.destroy(),t._timelapse&&(t._timelapse.pause(),t._timelapse=null),t._listeners&&t._listeners.abort();const st=new AbortController;t._listeners=st;const tt=(Z,et,ht)=>{Z.addEventListener(et,ht,{signal:st.signal})},it=t.querySelector("[data-network-placeholder]");it&&(it.style.position="absolute",it.style.inset="0",it.style.zIndex="20",it.style.background="#ffffff");const K=x({container:t,elements:j,style:[{selector:"node",style:{"background-color":"data(color)",width:"data(size)",height:"data(size)",label:"data(label)","font-size":"data(fontS)","font-weight":600,"text-valign":"top","text-halign":"center","text-margin-y":-6,color:"#0f172a","text-outline-color":"#ffffff","text-outline-width":"data(outlineW)","text-opacity":0,"border-width":"data(borderW)","border-color":"rgba(0,0,0,0.25)"}},{selector:"node.removed",style:{"background-opacity":0}},{selector:"node.inactive",style:{"border-color":"#dc2626"}},{selector:"edge",style:{width:"data(width)","line-color":"#64748b","line-opacity":.8,"curve-style":"unbundled-bezier","control-point-distances":"data(bend)","control-point-weights":.5}},{selector:"node:selected, node.hovered",style:{"text-opacity":1,"border-width":2,"border-color":"#0f172a","z-index":9999}},{selector:"node.neighbour",style:{"text-opacity":1,"z-index":9998}},{selector:".faded",style:{opacity:.15}},{selector:".hidden",style:{display:"none"}},{selector:"node.found",style:{"text-opacity":1,"border-width":2,"border-color":"#000000","z-index":1e4}},{selector:".focused",style:{"text-opacity":1}},{selector:"edge.incident",style:{"line-color":"#0f172a"}},{selector:"edge.directed",style:{"curve-style":"unbundled-bezier","control-point-distances":"data(bend)","control-point-weights":.5,"target-arrow-shape":"triangle","arrow-scale":.45}},{selector:"edge.flowtype",style:{"line-color":"data(edgeColor)","target-arrow-color":"data(edgeColor)"}},{selector:"node.outside",style:{"border-style":"dashed","border-width":1.5,"border-color":"#64748b"}},{selector:"node.ghost",style:{"background-color":"data(ghostColor)","border-color":"#9ca3af","z-index":-1}},{selector:"edge.ghost",style:{"line-color":"data(ghostColor)","target-arrow-color":"data(ghostColor)","z-index":-1}},{selector:".history",style:{"z-index":-2}}],layout:{name:"preset"},motionBlur:!1,textureOnViewport:!1,minZoom:.05,maxZoom:8,wheelSensitivity:1.5}),ct={border:1,outline:1.5,font:14};let dt=null;const _t=()=>{if(K.destroyed())return;const Z=Math.max(K.zoom(),1),et=Z,ht=Math.min(Z,3);K.batch(()=>{K.nodes().forEach(lt=>{lt.data("borderW",ct.border/ht),lt.data("outlineW",ct.outline/et),lt.data("fontS",ct.font/et)})})},wt=()=>{dt===null&&(dt=requestAnimationFrame(()=>{dt=null,_t()}))};K.on("zoom",wt),_t();const vt=document.createElement("div");vt.className="stats-network-tip",vt.setAttribute("hidden",""),Object.assign(vt.style,{position:"absolute",zIndex:"20",pointerEvents:"none",background:"rgba(15,23,42,0.94)",color:"#f8fafc",padding:"7px 9px",borderRadius:"6px",fontSize:"12px",lineHeight:"1.45",whiteSpace:"nowrap",boxShadow:"0 2px 8px rgba(0,0,0,0.25)"}),getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(vt);const Ft=le(e,"[data-network-focus]"),xt=(()=>{try{return JSON.parse(e.getAttribute("data-network-labels")||"{}")}catch{return{}}})();K.on("mouseover","node",Z=>{const et=Z.target,ht=et.closedNeighborhood();K.elements().difference(ht).addClass("faded"),et.addClass("hovered"),et.neighborhood("node").addClass("neighbour"),et.connectedEdges().addClass("incident");const lt=et.data(),Bt=[`${ce(lt.label||"")}`];if(lt.fullName&&Bt.push(`${ce(lt.fullName)}`),Bt.push(lt.hiddenPartners>0?`${ce(xt.partners||"Partners")}: ${lt.degree} (${ce(xt.hidden||"hidden")}: ${lt.hiddenPartners})`:`${ce(xt.partners||"Partners")}: ${lt.degree}`,`${ce(xt.paid||"Paid")}: ${xo(lt.paid)}`,`${ce(xt.received||"Received")}: ${xo(lt.received)}`,`${ce(xt.total||"Total")}: ${xo(lt.volume)}`),lt.flow){const jt=(xt.flow||{})[lt.flow];jt&&Bt.push(`${ce(xt.flowRole||"Flow")}: ${ce(jt)}`),lt.flow==="stalled"&<.flowNet>0&&Bt.push(`${ce(xt.stale||"Stagnant")}: ${xo(lt.flowNet)}`)}lt.bank&&Bt.push(`${ce(xt.bank||"Bank")}: ${ce(lt.bank)}`),lt.region&&Bt.push(ce(lt.region)),vt.innerHTML=Bt.join("
"),vt.removeAttribute("hidden")}),K.on("mousemove",Z=>{if(vt.hasAttribute("hidden"))return;const et=Z.renderedPosition||{x:0,y:0},ht=t.getBoundingClientRect(),lt=et.x+14+vt.offsetWidth>ht.width?et.x-vt.offsetWidth-14:et.x+14,Bt=et.y+14+vt.offsetHeight>ht.height?et.y-vt.offsetHeight-14:et.y+14;vt.style.left=`${Math.max(0,lt)}px`,vt.style.top=`${Math.max(0,Bt)}px`});const Ct=()=>{K.elements().removeClass(Hf),vt.setAttribute("hidden","")};K.on("mouseout","node",Ct),tt(t,"mouseleave",Ct);let Nt=null;const be=()=>{Nt=null,K.elements().removeClass("hidden focused"),sf(K,K.elements(),Rv(y,K)),Ft&&(Ft.hidden=!0)};K.on("tap","node",Z=>{const et=Z.target;if(Nt===et.id()){be();return}Nt=et.id();const ht=et.closedNeighborhood();if(K.elements().addClass("hidden"),ht.removeClass("hidden").addClass("focused"),sf(K,ht,{name:"fcose",quality:"default",animate:!1,randomize:!0,nodeRepulsion:5e3,idealEdgeLength:90}),Ft){const lt=et.neighborhood("node").length;Ft.textContent=(Ft.dataset.template||"").replace(":name",et.data("label")||"").replace(":count",lt),Ft.hidden=!1}});const Ot=le(e,"[data-network-search-input]"),St=le(e,"[data-network-search-results]"),In=()=>K.elements().removeClass("found"),De=Z=>{In(),Z.hasClass("hidden")&&be(),Z.addClass("found"),K.animate({center:{eles:Z},zoom:1.6},{duration:300})};if(Ot&&St){const Z=et=>{const ht=et.trim().toLowerCase();if(ht.length<2){St.hidden=!0,St.innerHTML="";return}const lt=jt=>{const de=jt.toLowerCase();return de===ht?0:de.startsWith(ht)?/^\s|^$/.test(de.slice(ht.length))?1:2:3},Bt=K.nodes().filter(jt=>!jt.hasClass("outside")&&String(jt.data("label")||"").toLowerCase().includes(ht)).toArray().sort((jt,de)=>{const Ie=lt(String(jt.data("label")||""))-lt(String(de.data("label")||""));return Ie!==0?Ie:(de.data("degree")||0)-(jt.data("degree")||0)}).slice(0,8);if(Bt.length===0){const jt=xt.noMatchHint?`
${ce(xt.noMatchHint)}
`:"";St.innerHTML=`
${ce(xt.noMatch||"No match")}
${jt}`,St.hidden=!1;return}St.innerHTML=Bt.map(jt=>` `).join(""),St.hidden=!1};tt(Ot,"input",et=>Z(et.target.value)),tt(Ot,"search",et=>{et.target.value===""&&(In(),St.hidden=!0)}),tt(St,"mousedown",et=>{const ht=et.target.closest("[data-node-id]");if(!ht)return;et.preventDefault();const lt=K.getElementById(ht.dataset.nodeId);lt&<.length&&(De(lt),Ot.value=lt.data("label")||"",St.hidden=!0)}),tt(Ot,"keydown",et=>{if(et.key!=="Enter")return;et.preventDefault();const ht=St.querySelector("[data-node-id]");if(ht){const lt=K.getElementById(ht.dataset.nodeId);lt&<.length&&(De(lt),St.hidden=!0)}}),tt(document,"click",et=>{e.contains(et.target)||(St.hidden=!0)})}K.on("tap",Z=>{Z.target===K&&Nt&&be()});const te=1.5;[["[data-network-spread]",te],["[data-network-shrink]",1/te]].forEach(([Z,et])=>{const ht=le(e,Z);ht&&tt(ht,"click",lt=>{lt.preventDefault(),gD(K,K.elements(),et),_t()})}),aD({screenBox:le(e,"[data-network-screen]"),frameBox:le(e,"[data-network-frame]"),headerBox:le(e,"[data-network-header]"),button:le(e,"[data-network-fullscreen]"),panel:()=>le(e,"[data-network-timelapse-controls]"),signal:st.signal,onResize:()=>{if(K.destroyed())return;K.resize();const Z=K.elements().not(".hidden"),et=le(e,"[data-network-timelapse-controls]");K.fit(Z,zy(K)),Wy(K,Z,et?{width:et.offsetWidth,height:et.offsetHeight+12}:null),_t()}});const Le=le(e,"[data-network-svg]");Le&&tt(Le,"click",Z=>{Z.preventDefault();const et=e.getAttribute("data-network-anonymize")==="1",ht=Ro(e.getAttribute("data-network-meta")),lt=e.querySelector("[data-network-host]"),Bt=le(e,"[data-network-stagnant]"),jt=Bt&&!Bt.hidden?Bt.textContent.trim():"";ht&&jt?ht.subtext=jt:ht&<&<.dataset.networkSubtext&&(ht.subtext=lt.dataset.networkSubtext),ht&<&<._timelapse&&(ht.period=null);const de=jy(K,()=>TD(K,!et,ht));if(!de)return;const Ie=new Blob([de],{type:"image/svg+xml;charset=utf-8"}),qe=URL.createObjectURL(Ie),Ne=document.createElement("a");Ne.href=qe,Ne.download=(Le.dataset.filename||"trading-network")+"-"+new Date().toISOString().slice(0,10)+".svg",document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),setTimeout(()=>URL.revokeObjectURL(qe),1e3)});const re=le(e,"[data-network-drag-neighbours]"),oe=()=>!re||re.checked;let we=null;if(K.on("grab","node",Z=>{const et=Z.target;if(!oe()){we=null;return}const ht={...et.position()},lt=et.neighborhood("node").filter(Bt=>!Bt.hasClass("hidden")).map(Bt=>({node:Bt,offset:{x:Bt.position("x")-ht.x,y:Bt.position("y")-ht.y}}));we={node:et,followers:lt}}),K.on("drag","node",Z=>{if(!we||we.node.id()!==Z.target.id())return;const et=we.node.position();we.followers.forEach(({node:ht,offset:lt})=>{ht.position({x:et.x+lt.x,y:et.y+lt.y})})}),K.on("free","node",()=>{we=null}),await i((r.arranging||"Arranging :count profiles...").replace(":count",K.nodes().not(".hidden").length)),u()){K.destroy();return}const ye=()=>{it&&it.isConnected&&it.remove()};setTimeout(ye,12e4);const Ve=S?le(e,"[data-network-timelapse-controls]"):null,wn=Ve?{width:Ve.offsetWidth,height:Ve.offsetHeight+12}:null,he={view:m,stoppedAfterDays:Number.isFinite(I)?I:null,markInactive:e.getAttribute("data-network-mark-inactive")==="1"},Xt=S&&M.length>0?()=>{Nf(K,R.layers(0)),Lv(K,M[0],D,he)}:null,xe=le(e,"[data-network-warning]");if(xe){const Z=xe.querySelector("[data-network-warning-text]");Z&&(Z.textContent=""),xe.hidden=!1}let Ae;const xn=new Promise(Z=>{Ae=Z});if(sf(K,K.elements(),Rv(y,K),()=>{Xt&&Xt(),ye(),Ae()},wn,Z=>{const et=xe&&xe.querySelector("[data-network-warning-text]");et&&(et.textContent=`${r.layoutFallback||"The usual arrangement failed, so a simpler one is shown."} (${Z.message||Z})`)}),m==="cluster"){const et=K.nodes().not(".hidden").length;if(et>600){Dv(e,[],0);const ht=le(e,"[data-network-warning]"),lt=ht&&ht.querySelector("[data-network-warning-text]");ht&<&&(lt.textContent=(e.getAttribute("data-cluster-too-large")||"").replace(":count",et).replace(":limit",600))}else{if(await i((r.clustering||"Finding clusters in :count profiles, this can take a moment...").replace(":count",et)),u()){K.destroy();return}try{const ht=K.elements().markovClustering(),lt=[];ht.forEach((Bt,jt)=>{const de=Cc[jt%Cc.length],Ie=Bt.nodes().filter(qe=>!qe.hasClass("outside"));Ie.forEach(qe=>qe.data("color",de)),Ie.length>1&<.push({color:de,size:Ie.length})}),Dv(e,lt,ht.length)}catch{}}}const Yt=le(e,"[data-network-timelapse-controls]");if(S&&M.length>0&&Yt)try{const Z=Yt.querySelector("[data-timelapse-play]"),et=Yt.querySelector("[data-timelapse-scrubber]"),ht=Yt.querySelector("[data-timelapse-year]"),lt=Yt.querySelector("[data-timelapse-speed]"),Bt=r.timelapsePlay||"Play",jt=r.timelapsePause||"Pause",de=Yt.querySelector("[data-timelapse-icon-play]"),Ie=Yt.querySelector("[data-timelapse-icon-pause]"),qe=Yt.querySelector("[data-timelapse-icon-busy]"),Ne=$t=>{if(!Z)return;const _e=$t?jt:Bt;Z.setAttribute("title",_e),Z.setAttribute("aria-label",_e),de&&Ie&&(de.classList.toggle("hidden",$t),Ie.classList.toggle("hidden",!$t)),qe&&qe.classList.add("hidden"),Z.disabled=!1},Zi=(s.nodes||[]).reduce(($t,_e)=>Math.max($t,_e.volume||0),0),Qi=(s.nodes||[]).reduce(($t,_e)=>Math.max($t,_e.degree||0),0);XR(K);const tr=QR(K,R,N),er=($t,_e)=>m==="volume"?Tc(tr.volumeAt($t,_e),Zi):Tc(tr.degreeAt($t,_e),Qi),Fr=e.getAttribute("data-network-timelapse-step")==="week"?30.44/7:1,Br=$t=>1e3/($t*Fr),Nn=sD({cy:K,sizeOf:er,changedAt:tr.changedAt,count:M.length,layersAt:$t=>R.layers($t),interval:Br(Nv(lt?lt.value:36)),holdAtEnd:3e3,onFrame:$t=>{const _e=M[$t];Lv(K,_e,D,he),ht&&(ht.textContent=_e.label||""),et&&(et.value=$t),Ne(Nn.isPlaying()),Fv(e,_e.label||"",R.layers($t).current)}});et&&(et.max=String(Math.max(0,M.length-1)),et.value="0",tt(et,"input",()=>{Nn.goTo(parseInt(et.value,10)||0),Ne(!1)})),lt&&tt(lt,"input",()=>{const $t=Nv(lt.value);Nn.setInterval(Br($t));const _e=Yt.querySelector("[data-timelapse-speed-value]");_e&&(_e.textContent=yD($t))}),Z&&tt(Z,"click",()=>{Nn.isPlaying()?(Nn.pause(),Ne(!1)):(Nn.play(),Ne(!0))}),xn.then(()=>{K.destroyed()||u()||(Nf(K,R.layers(0),$t=>er($t,0)),Ne(!1))}),ht&&(ht.textContent=M[0].label||""),t._timelapseFirst={year:M[0].label||"",frame:R.layers(0).current},t._timelapse=Nn}catch(Z){console.error("[time-lapse] setting up playback failed",Z),of(Yt,"error",r.timelapseFailed||"The time-lapse could not be loaded.")}else S&&Yt?of(Yt,"error",B?r.timelapseFailed||"The time-lapse could not be loaded.":r.timelapseEmpty||"Nothing to animate for this selection."):t._timelapse&&(t._timelapse.pause(),t._timelapse=null);t._cy=K,t.dataset.networkSignature=a,t._buildingSignature=null,window.statsNetworkChart=K;const Se=le(e,"[data-network-stagnant]");if(Se){const Z=K.nodes().not(".hidden").length,et=K.edges().not(".hidden").length,ht=(Se.dataset.drawnTemplate||"").replace(":nodes",Z).replace(":edges",et),lt=m==="circulation"&&H>0?(Se.dataset.template||"").replace(":count",H).replace(":never",V).replace(":hours",xo(U)):"";Se.textContent=[ht,lt].filter(Boolean).join(" "),Se.hidden=!1,t.dataset.networkSubtext=Se.textContent,t._timelapseFirst&&(Fv(e,t._timelapseFirst.year,t._timelapseFirst.frame),t._timelapseFirst=null)}const fe=le(e,"[data-network-note]");fe&&F&&q?(fe.textContent=fe.dataset.template?fe.dataset.template.replace(":name",q.label||"").replace(":count",q.degree):"",fe.hidden=!1):fe&&(fe.hidden=!0),window.statsNetwork=K}window.exportNetworkForPdf=function(){if(window.__networkSnapshot){const e=window.__networkSnapshot;return window.__networkSnapshot=null,e}return $y()};function xD(e,t,n,i){const r=e&&e.logo&&e.logo.svg?String(e.logo.svg):"",s=/viewBox="([^"]+)"/.exec(r);if(!r||!s||n<=0)return null;const[,,a,l]=s[1].trim().split(/[\s,]+/).map(Number);if(!(a>0)||!(l>0))return null;const u=r.replace(/^[\s\S]*?]*>/,"").replace(/<\/svg>\s*$/,""),h=Math.max(20,n-16),d=h*(a/l),m=t-i-d,y=8,x=String(e.logo.color||"#000000").replace(/[^#0-9a-zA-Z(),. ]/g,"");return{defs:' ',body:`${u}`,x:m,bottom:y+h}}let us;function SD(e,t,n=400){if(us===void 0)try{us=document.createElement("canvas").getContext("2d")||null}catch{us=null}return us?(us.font=`${n} ${t}px Helvetica, Arial, sans-serif`,us.measureText(e).width):String(e).length*t*(n>=600?.58:.52)}function Bv(e,t,n,i){const r=String(e).split(/\s+/).filter(Boolean),s=[];let a="";return r.forEach(l=>{const u=a?`${a} ${l}`:l;a&&SD(u,t,n)>i?(s.push(a),a=l):a=u}),a&&s.push(a),s}function TD(e,t=!0,n=null){if(!e||e.destroyed()||e.nodes().length===0)return null;const i=e.width(),r=e.height(),s=e.pan(),a=e.zoom(),l=16,u=n?40+(n.period?12:0)+(n.subtext?16:0):0,h=xD(n,i,u,l),d=h?h.x-12:i-l,m=[];if(n){const H=[{text:n.caption,size:15,weight:600,fill:"#0f172a"},{text:n.period,size:11,weight:400,fill:"#64748b"},{text:n.subtext,size:10,weight:400,fill:"#64748b"}];let U=0;H.filter(V=>V.text).forEach(V=>{Bv(V.text,V.size,V.weight,d-l).forEach(st=>{U=U===0?22:U+V.size+5,m.push({...V,text:st,y:U})})})}const y=m.length?m[m.length-1].y:0,x=n?Math.max(u,y+14,h?h.bottom+8:0):0,S=n&&n.colors?n.colors.length:0,C=n&&n.directions?n.directions.length:0,T=n&&n.nodeStyles?n.nodeStyles.length:0,A=n&&n.hint?Bv(n.hint,10,400,i-2*l):[],M=n?60+A.length*14+(A.length?6:0)+Math.ceil(S/2)*18+Math.ceil(C/2)*18+Math.ceil(T/2)*18+(n.settings?34:0):0,B=x+r+M,D=H=>({x:H.x*a+s.x,y:H.y*a+s.y+x}),R=H=>String(H).replace(/[&<>"']/g,U=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[U]),N=H=>{const U=String(H).match(/rgba?\(([^)]+)\)/);if(!U)return{color:H||"#000",alpha:1};const V=U[1].split(",").map(st=>parseFloat(st.trim()));return{color:`rgb(${V[0]},${V[1]},${V[2]})`,alpha:V.length>3?V[3]:1}},I=(H,U)=>{const V=H.pstyle(U).value;return Array.isArray(V)&&V.length>=3?{color:`rgb(${V[0]},${V[1]},${V[2]})`,alpha:V.length>3&&Number.isFinite(V[3])?V[3]:1}:N(H.style(U))},j=[];e.edges().forEach(H=>{if(H.hasClass("hidden")||H.style("display")==="none")return;const U=D(H.source().position()),V=D(H.target().position()),st=I(H,"line-color"),tt=(parseFloat(H.style("width"))||1)*a,it=_t=>{const wt=parseFloat(H.style(_t));return Number.isFinite(wt)?wt:1},K=it("line-opacity")*it("opacity"),ct=parseFloat(H.style("control-point-distances"))||0;let dt;if(ct){const _t=(U.x+V.x)/2,wt=(U.y+V.y)/2,vt=V.x-U.x,Ft=V.y-U.y,xt=Math.sqrt(vt*vt+Ft*Ft)||1,Ct=_t-Ft/xt*ct*a,Nt=wt+vt/xt*ct*a;dt=`M ${U.x.toFixed(2)} ${U.y.toFixed(2)} Q ${Ct.toFixed(2)} ${Nt.toFixed(2)} ${V.x.toFixed(2)} ${V.y.toFixed(2)}`}else dt=`M ${U.x.toFixed(2)} ${U.y.toFixed(2)} L ${V.x.toFixed(2)} ${V.y.toFixed(2)}`;if(j.push(``),H.style("target-arrow-shape")==="triangle"){const _t=I(H,"target-arrow-color"),wt=parseFloat(H.style("arrow-scale"))||1,vt=Math.min(Math.max(tt*3*wt,3.5),10),Ct=(parseFloat(H.target().style("width"))||10)*a/2+1.5;let Nt,be,Ot,St;if(ct){const Le=(U.x+V.x)/2,re=(U.y+V.y)/2,oe=V.x-U.x,we=V.y-U.y,ye=Math.sqrt(oe*oe+we*we)||1,Ve=Le-we/ye*ct*a,wn=re+oe/ye*ct*a,he=Z=>{const et=1-Z;return{x:et*et*U.x+2*et*Z*Ve+Z*Z*V.x,y:et*et*U.y+2*et*Z*wn+Z*Z*V.y}};let Xt=0,xe=1;for(let Z=0;Z<40;Z+=1){const et=(Xt+xe)/2,ht=he(et);Math.hypot(ht.x-V.x,ht.y-V.y)>Ct?Xt=et:xe=et}const Ae=Xt,xn=he(Ae);Nt=xn.x,be=xn.y;const Yt=2*(1-Ae)*(Ve-U.x)+2*Ae*(V.x-Ve),Se=2*(1-Ae)*(wn-U.y)+2*Ae*(V.y-wn),fe=Math.hypot(Yt,Se)||1;Ot=Yt/fe,St=Se/fe}else{const Le=V.x-U.x,re=V.y-U.y,oe=Math.hypot(Le,re)||1;Ot=Le/oe,St=re/oe,Nt=V.x-Ot*Ct,be=V.y-St*Ct}const In=Nt-Ot*vt,De=be-St*vt,te=Math.max(vt*.8,tt*1.15)/2;j.push(``)}});const q=[];e.nodes().forEach(H=>{if(H.hasClass("hidden")||H.style("display")==="none")return;const U=D(H.position()),V=(parseFloat(H.style("width"))||10)*a/2,st=I(H,"background-color"),tt=I(H,"border-color"),it=(parseFloat(H.style("border-width"))||0)*a,K=Nt=>{const be=parseFloat(H.style(Nt));return Number.isFinite(be)?be:1},ct=K("opacity"),dt=st.alpha*K("background-opacity")*ct,_t=tt.alpha*K("border-opacity")*ct;j.push(`0?`fill="${st.color}" fill-opacity="${dt.toFixed(3)}"`:'fill="none"')+(it>0?` stroke="${tt.color}" stroke-opacity="${_t.toFixed(3)}" stroke-width="${it.toFixed(2)}"`:"")+"/>");const wt=t?H.data("label"):null;if(!wt)return;const vt=(parseFloat(H.style("font-size"))||14)*a,Ft=I(H,"text-outline-color"),xt=(parseFloat(H.style("text-outline-width"))||0)*a,Ct=U.y-V-6*a;q.push(`0?` stroke="${Ft.color}" stroke-width="${(xt*2).toFixed(2)}" paint-order="stroke fill" stroke-linejoin="round"`:"")+`>${R(wt)}`)});const F=[];if(n){const H=(tt,it,K,ct={})=>`${R(K)}`;x>0&&F.push(``),m.forEach(tt=>{F.push(H(l,tt.y,tt.text,{size:tt.size,weight:tt.weight,fill:tt.fill}))}),h&&F.push(h.body);const U=x+r;F.push(``),F.push(``);let V=U+28;A.forEach(tt=>{F.push(H(l,V,tt,{size:10,fill:"#334155"})),V+=14}),A.length&&(V+=6),n.colorMeaning&&(F.push(H(l,V,n.colorMeaning,{size:10,fill:"#64748b"})),V+=16),(n.colors||[]).forEach((tt,it)=>{const K=it%2,ct=l+K*(i/2-l),dt=Math.floor(it/2),_t=V+dt*18;F.push(``),F.push(H(ct+16,_t,tt.label,{size:10}))}),V+=Math.ceil((n.colors||[]).length/2)*18+6;const st=[];n.sizeMeaning&&st.push(`${n.sizeLabel||"Dot size"}: ${n.sizeMeaning}`),n.widthMeaning&&st.push(`${n.widthLabel||"Line thickness"}: ${n.widthMeaning}`),st.length&&(F.push(H(l,V,st.join(" · "),{size:10,fill:"#64748b"})),V+=18),(n.nodeStyles||[]).forEach((tt,it)=>{const K=it%2,ct=l+K*(i/2-l),dt=Math.floor(it/2),_t=V+dt*18,wt=N(tt.color);F.push(``),F.push(H(ct+16,_t,tt.label,{size:10}))}),(n.nodeStyles||[]).length&&(V+=Math.ceil(n.nodeStyles.length/2)*18+6),(n.directions||[]).forEach((tt,it)=>{const K=it%2,ct=l+K*(i/2-l),dt=Math.floor(it/2),_t=V+dt*18;F.push(``),F.push(H(ct+22,_t,tt.label,{size:10}))}),(n.directions||[]).length&&(V+=Math.ceil(n.directions.length/2)*18+6),n.settings&&F.push(H(l,V,n.settings,{size:9,fill:"#94a3b8"}))}return` ${h?h.defs:""} ${j.join(` `)} ${q.join(` `)} ${F.join(` `)} `}const Hf="faded neighbour hovered incident";function jy(e,t){const n={};Hf.split(" ").forEach(i=>{n[i]=e.elements(`.${i}`)}),e.batch(()=>e.elements().removeClass(Hf));try{return t()}finally{e.batch(()=>{Object.entries(n).forEach(([i,r])=>r.addClass(i))})}}function $y(){try{const e=window.statsNetworkChart;if(!e||e.destroyed()||e.nodes().length===0)return null;const t=2;return jy(e,()=>e.png({output:"base64uri",bg:"#ffffff",full:!1,scale:t}))}catch{return null}}typeof document<"u"&&document.addEventListener("click",e=>{e.target.closest("[data-network-pdf-trigger]")&&(window.__networkSnapshot=$y())},!0);function CD(){window.LaravelFlatpickr&&document.querySelectorAll("[data-network-timelapse-end] .flatpickr-input").forEach(e=>{e._flatpickr||window.LaravelFlatpickr.initializeFlatpickr(e)})}function yd(){document.querySelectorAll(`[${Ff}]`).forEach(e=>{wD(e).catch(t=>{const n=e.querySelector("[data-network-host]");n&&(n._buildingSignature=null),console.error("[network] drawing failed",t);const i=n&&n.querySelector("[data-network-placeholder] span");if(i){const r=Ro(e.getAttribute("data-network-labels"))||{};i.textContent=`${r.drawFailed||"The network could not be drawn."} (${t&&t.message||t})`}})})}document.addEventListener("DOMContentLoaded",()=>setTimeout(yd,100));document.addEventListener("livewire:init",()=>{let e=null,t=!1;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(yd,300),t||(t=!0,requestAnimationFrame(()=>{t=!1,CD()}))})});document.addEventListener("livewire:navigated",()=>setTimeout(yd,100));Jt.register(...Hc);const OD=[{canvasId:"reportBalanceDistributionChart",dataAttribute:"data-report-balance-distribution",field:"User",color:"#14b8a6"},{canvasId:"reportBalanceDistributionOrgChart",dataAttribute:"data-report-balance-distribution-org",field:"Organization",color:"#d946ef"}];function kD(e){var u;const t=document.getElementById(e.canvasId);if(!t||typeof Jt>"u")return;const n=t.closest(`[${e.dataAttribute}]`);if(!n)return;let i;try{i=JSON.parse(n.getAttribute(e.dataAttribute)||"[]")}catch{return}if(!Array.isArray(i)||i.length===0)return;let r={};try{r=JSON.parse(n.getAttribute("data-series-labels")||"{}")}catch{r={}}const s=n.getAttribute(e.dataAttribute);if(t.dataset.chartSignature===s&&((u=Jt.getChart)!=null&&u.call(Jt,t)))return;const a=Jt.getChart?Jt.getChart(t):null;a&&a.destroy();const l=[{label:r[e.field]||e.field,data:i.map(h=>h[e.field]||0),backgroundColor:e.color,borderColor:e.color,borderWidth:1}];t.chart=new Jt(t.getContext("2d"),{type:"bar",data:{labels:i.map(h=>h.label),datasets:l},options:{responsive:!0,maintainAspectRatio:!1,layout:{padding:{bottom:16}},plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0,drawOnChartArea:!0,offset:!1,color:"rgba(0, 0, 0, 0.10)"},ticks:{padding:8,autoSkip:!1,maxRotation:60,minRotation:60,font:{size:10}}}}}}),t.dataset.chartSignature=s}function _d(){OD.forEach(kD)}document.addEventListener("DOMContentLoaded",()=>{setTimeout(_d,100)});document.addEventListener("livewire:init",()=>{let e=null;Livewire.hook("morph.updated",()=>{clearTimeout(e),e=setTimeout(_d,300)})});document.addEventListener("livewire:navigated",()=>{setTimeout(_d,100)});window.exportBalanceDistributionChartForPdf=async function(e){try{const t=document.getElementById(e);if(!t)return null;const n=Jt.getChart?Jt.getChart(t):null;if(!n)return null;const i=2,r=674,s=300,a=document.createElement("canvas");a.width=r*i,a.height=s*i;const l=new Jt(a.getContext("2d"),{type:n.config.type,data:JSON.parse(JSON.stringify(n.config.data)),options:{...JSON.parse(JSON.stringify(n.config.options||{})),responsive:!1,maintainAspectRatio:!1,animation:!1,devicePixelRatio:i}});await new Promise(h=>setTimeout(h,300));const u=a.toDataURL("image/png",1);return l.destroy(),u}catch{return null}};window.__showProfileSwitchBanner=function(e){const t=document.getElementById("profile-switch-banner");if(!t)return;const n=document.getElementById("profile-switch-banner-photo");n&&(n.style.display="none");const i=document.getElementById("profile-switch-banner-role");i&&(i.style.display="none",i.textContent=""),e.photo&&n&&(n.src=e.photo,n.alt=e.name||"",n.style.display="block");const r=document.getElementById("profile-switch-banner-name");r&&(r.textContent=e.name||""),i&&e.roleLabel&&(i.textContent=e.roleLabel,i.style.display="block"),t.style.opacity="1",t.style.transition="",t.style.display="flex",t.addEventListener("click",()=>{t.style.display="none"},{once:!0}),setTimeout(()=>{t.style.transition="opacity 0.4s",t.style.opacity="0",setTimeout(()=>{t.style.display="none",t.style.opacity="",t.style.transition=""},400)},3e3)};Alpine.plugin(ik);Jt.register(...Hc);window.Chart=Jt;window.createPopper=NO;window.Tagify=Ql;window.loadJSZip=()=>af(()=>import("./jszip.min-KAUKf24L.js").then(e=>e.j),__vite__mapDeps([2,1])).then(e=>e.default);document.addEventListener("alpine:init",()=>{Alpine.data("callTagPicker",()=>({callTagify:null,init(){const e=this.$refs.callTagsInput,t=JSON.parse(e.dataset.suggestions||"[]");this.callTagify=new Tagify(e,{maxTags:1,whitelist:t,enforceWhiteList:!1,backspace:!1,editTags:!1,addTagOn:["enter","tab","blur"],addTagOnBlur:!0,dropdown:{maxItems:10,enabled:2,closeOnSelect:!0,highlightFirst:!0}});const n=this.$wire.get("tagsArray");n&&n!=="[]"&&this.callTagify.loadOriginalValues(n),this.callTagify.on("change",()=>{const i=this.$refs.callTagsInput.value,r=JSON.parse(i||"[]");if(r.length===0){this.$wire.set("tagsArray","[]",!1),this.$wire.call("notifyTagCleared");return}const s=r[0];s.tag_id?(this.$wire.set("tagsArray",i,!1),this.$wire.call("notifyTagSelected",s.tag_id)):this.$wire.call("openNewTagModal",s.value)}),window.addEventListener("removeLastCallTag",()=>{this.callTagify&&this.callTagify.value.length>0&&this.callTagify.removeTag(this.callTagify.value[this.callTagify.value.length-1].value)}),Livewire.on("callTagifyReload",i=>{this.callTagify.loadOriginalValues(i.tagsArray)})}}))});window.Pusher=Pk;const AD=()=>{const e=window.location.pathname.split("/").filter(Boolean),t=["en","nl","de","es","fr"];return e.length>0&&t.includes(e[0])?`/${e[0]}`:"/en"};var Hv;window.Echo=new kk({broadcaster:"reverb",key:"aj7hptmqiercfnc5cpwu",wsHost:"localhost",wsPort:"8080",wssPort:"8080",wsPath:"/",forceTLS:!1,enabledTransports:["ws","wss"],authEndpoint:`${AD()}/broadcasting/auth`,auth:{headers:{"X-CSRF-TOKEN":(Hv=document.querySelector('meta[name="csrf-token"]'))==null?void 0:Hv.getAttribute("content")}}});