From 15e5da6c5dbb5d34dfd55c360fe561a8419e366f Mon Sep 17 00:00:00 2001 From: spaaaacccee Date: Fri, 6 Dec 2024 05:07:14 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Shortest?= =?UTF-8?q?PathLab/posthoc-app@1dd44df7bd0dae43aacf2951ac9cd6f44a7f8446=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/D2Renderer.worker-Bhx9fy0S.js | 30 ------------------- assets/D2Renderer.worker-D5n7AaL-.js | 30 +++++++++++++++++++ assets/getGridSymbols.worker-BM9IxXsn.js | 27 +++++++++++++++++ assets/getGridSymbols.worker-QUYfJgzc.js | 27 ----------------- .../{index-T4quaFGH.js => index-DpDXPyDz.js} | 10 +++---- assets/parseGrid.worker-CTnsDGUU.js | 27 +++++++++++++++++ assets/parseGrid.worker-DeCcDXY5.js | 27 ----------------- assets/parseTrace.worker-ahBXG5Yy.js | 27 ----------------- assets/parseTrace.worker-y8dm9SDW.js | 27 +++++++++++++++++ assets/parseTraceSlave.worker-DaoiSWpC.js | 28 +++++++++++++++++ assets/parseTraceSlave.worker-MM7PTpMM.js | 28 ----------------- assets/parseYaml.worker-CXyNYLS1.js | 17 +++++++++++ assets/parseYaml.worker-D2goq2pP.js | 17 ----------- assets/tree.worker-sIhKZmHR.js | 27 ----------------- assets/tree.worker-w3km_BXF.js | 27 +++++++++++++++++ index.html | 2 +- 16 files changed, 189 insertions(+), 189 deletions(-) delete mode 100644 assets/D2Renderer.worker-Bhx9fy0S.js create mode 100644 assets/D2Renderer.worker-D5n7AaL-.js create mode 100644 assets/getGridSymbols.worker-BM9IxXsn.js delete mode 100644 assets/getGridSymbols.worker-QUYfJgzc.js rename assets/{index-T4quaFGH.js => index-DpDXPyDz.js} (99%) create mode 100644 assets/parseGrid.worker-CTnsDGUU.js delete mode 100644 assets/parseGrid.worker-DeCcDXY5.js delete mode 100644 assets/parseTrace.worker-ahBXG5Yy.js create mode 100644 assets/parseTrace.worker-y8dm9SDW.js create mode 100644 assets/parseTraceSlave.worker-DaoiSWpC.js delete mode 100644 assets/parseTraceSlave.worker-MM7PTpMM.js create mode 100644 assets/parseYaml.worker-CXyNYLS1.js delete mode 100644 assets/parseYaml.worker-D2goq2pP.js delete mode 100644 assets/tree.worker-sIhKZmHR.js create mode 100644 assets/tree.worker-w3km_BXF.js diff --git a/assets/D2Renderer.worker-Bhx9fy0S.js b/assets/D2Renderer.worker-Bhx9fy0S.js deleted file mode 100644 index 87bfbcf..0000000 --- a/assets/D2Renderer.worker-Bhx9fy0S.js +++ /dev/null @@ -1,30 +0,0 @@ -var sh=fe=>{throw TypeError(fe)};var Lo=(fe,we,Te)=>we.has(fe)||sh("Cannot "+Te);var pe=(fe,we,Te)=>(Lo(fe,we,"read from private field"),Te?Te.call(fe):we.get(fe)),Rn=(fe,we,Te)=>we.has(fe)?sh("Cannot add the same private member more than once"):we instanceof WeakSet?we.add(fe):we.set(fe,Te),dn=(fe,we,Te,Ln)=>(Lo(fe,we,"write to private field"),Ln?Ln.call(fe,Te):we.set(fe,Te),Te),In=(fe,we,Te)=>(Lo(fe,we,"access private method"),Te);var fh=(fe,we,Te,Ln)=>({set _(ki){dn(fe,we,ki,Te)},get _(){return pe(fe,we,Ln)}});(function(){"use strict";var ze,Bt,Xn,kn,sr,Pe,lh,Mt,ft,Mr,Ot,ch,hh,ph,gh;var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function we(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Te={},Ln=fe&&fe.__assign||function(){return Ln=Object.assign||function(t){for(var i,r=1,a=arguments.length;r - * 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 - */Or.exports,function(t,i){(function(){var r,a="4.17.21",s=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",h="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",g=500,y="__lodash_placeholder__",b=1,E=2,S=4,F=1,P=2,C=1,I=2,T=4,x=8,B=16,G=32,W=64,re=128,ce=256,Ve=512,Ft=30,Jr="...",aa=800,Hg=16,Bf=1,Pg=2,Gg=3,lt=1/0,Wn=9007199254740991,Dg=17976931348623157e292,jr=NaN,En=4294967295,$g=En-1,Ng=En>>>1,qg=[["ary",re],["bind",C],["bindKey",I],["curry",x],["curryRight",B],["flip",Ve],["partial",G],["partialRight",W],["rearg",ce]],Tt="[object Arguments]",Qr="[object Array]",Yg="[object AsyncFunction]",fr="[object Boolean]",lr="[object Date]",Ug="[object DOMException]",ei="[object Error]",ni="[object Function]",Mf="[object GeneratorFunction]",vn="[object Map]",cr="[object Number]",Xg="[object Null]",Mn="[object Object]",Of="[object Promise]",kg="[object Proxy]",hr="[object RegExp]",yn="[object Set]",pr="[object String]",ti="[object Symbol]",Wg="[object Undefined]",gr="[object WeakMap]",Kg="[object WeakSet]",dr="[object ArrayBuffer]",Ht="[object DataView]",oa="[object Float32Array]",sa="[object Float64Array]",fa="[object Int8Array]",la="[object Int16Array]",ca="[object Int32Array]",ha="[object Uint8Array]",pa="[object Uint8ClampedArray]",ga="[object Uint16Array]",da="[object Uint32Array]",zg=/\b__p \+= '';/g,Vg=/\b(__p \+=) '' \+/g,Zg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ff=/&(?:amp|lt|gt|quot|#39);/g,Tf=/[&<>"']/g,Jg=RegExp(Ff.source),jg=RegExp(Tf.source),Qg=/<%-([\s\S]+?)%>/g,ed=/<%([\s\S]+?)%>/g,Hf=/<%=([\s\S]+?)%>/g,nd=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,td=/^\w*$/,rd=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ma=/[\\^$.*+?()[\]{}|]/g,id=RegExp(ma.source),va=/^\s+/,ud=/\s/,ad=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,od=/\{\n\/\* \[wrapped with (.+)\] \*/,sd=/,? & /,fd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ld=/[()=,{}\[\]\/\s]/,cd=/\\(\\)?/g,hd=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pf=/\w*$/,pd=/^[-+]0x[0-9a-f]+$/i,gd=/^0b[01]+$/i,dd=/^\[object .+?Constructor\]$/,md=/^0o[0-7]+$/i,vd=/^(?:0|[1-9]\d*)$/,yd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ri=/($^)/,_d=/['\n\r\u2028\u2029\\]/g,ii="\\ud800-\\udfff",bd="\\u0300-\\u036f",Ad="\\ufe20-\\ufe2f",wd="\\u20d0-\\u20ff",Gf=bd+Ad+wd,Df="\\u2700-\\u27bf",$f="a-z\\xdf-\\xf6\\xf8-\\xff",Ed="\\xac\\xb1\\xd7\\xf7",xd="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sd="\\u2000-\\u206f",Cd=" \\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",Nf="A-Z\\xc0-\\xd6\\xd8-\\xde",qf="\\ufe0e\\ufe0f",Yf=Ed+xd+Sd+Cd,ya="['’]",Rd="["+ii+"]",Uf="["+Yf+"]",ui="["+Gf+"]",Xf="\\d+",Id="["+Df+"]",kf="["+$f+"]",Wf="[^"+ii+Yf+Xf+Df+$f+Nf+"]",_a="\\ud83c[\\udffb-\\udfff]",Ld="(?:"+ui+"|"+_a+")",Kf="[^"+ii+"]",ba="(?:\\ud83c[\\udde6-\\uddff]){2}",Aa="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+Nf+"]",zf="\\u200d",Vf="(?:"+kf+"|"+Wf+")",Bd="(?:"+Pt+"|"+Wf+")",Zf="(?:"+ya+"(?:d|ll|m|re|s|t|ve))?",Jf="(?:"+ya+"(?:D|LL|M|RE|S|T|VE))?",jf=Ld+"?",Qf="["+qf+"]?",Md="(?:"+zf+"(?:"+[Kf,ba,Aa].join("|")+")"+Qf+jf+")*",Od="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",el=Qf+jf+Md,Td="(?:"+[Id,ba,Aa].join("|")+")"+el,Hd="(?:"+[Kf+ui+"?",ui,ba,Aa,Rd].join("|")+")",Pd=RegExp(ya,"g"),Gd=RegExp(ui,"g"),wa=RegExp(_a+"(?="+_a+")|"+Hd+el,"g"),Dd=RegExp([Pt+"?"+kf+"+"+Zf+"(?="+[Uf,Pt,"$"].join("|")+")",Bd+"+"+Jf+"(?="+[Uf,Pt+Vf,"$"].join("|")+")",Pt+"?"+Vf+"+"+Zf,Pt+"+"+Jf,Fd,Od,Xf,Td].join("|"),"g"),$d=RegExp("["+zf+ii+Gf+qf+"]"),Nd=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,qd=["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"],Yd=-1,ve={};ve[oa]=ve[sa]=ve[fa]=ve[la]=ve[ca]=ve[ha]=ve[pa]=ve[ga]=ve[da]=!0,ve[Tt]=ve[Qr]=ve[dr]=ve[fr]=ve[Ht]=ve[lr]=ve[ei]=ve[ni]=ve[vn]=ve[cr]=ve[Mn]=ve[hr]=ve[yn]=ve[pr]=ve[gr]=!1;var de={};de[Tt]=de[Qr]=de[dr]=de[Ht]=de[fr]=de[lr]=de[oa]=de[sa]=de[fa]=de[la]=de[ca]=de[vn]=de[cr]=de[Mn]=de[hr]=de[yn]=de[pr]=de[ti]=de[ha]=de[pa]=de[ga]=de[da]=!0,de[ei]=de[ni]=de[gr]=!1;var Ud={À:"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"},Xd={"&":"&","<":"<",">":">",'"':""","'":"'"},kd={"&":"&","<":"<",">":">",""":'"',"'":"'"},Wd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Kd=parseFloat,zd=parseInt,nl=typeof fe=="object"&&fe&&fe.Object===Object&&fe,Vd=typeof self=="object"&&self&&self.Object===Object&&self,Ge=nl||Vd||Function("return this")(),Ea=i&&!i.nodeType&&i,ct=Ea&&!0&&t&&!t.nodeType&&t,tl=ct&&ct.exports===Ea,xa=tl&&nl.process,on=function(){try{var A=ct&&ct.require&&ct.require("util").types;return A||xa&&xa.binding&&xa.binding("util")}catch{}}(),rl=on&&on.isArrayBuffer,il=on&&on.isDate,ul=on&&on.isMap,al=on&&on.isRegExp,ol=on&&on.isSet,sl=on&&on.isTypedArray;function en(A,L,R){switch(R.length){case 0:return A.call(L);case 1:return A.call(L,R[0]);case 2:return A.call(L,R[0],R[1]);case 3:return A.call(L,R[0],R[1],R[2])}return A.apply(L,R)}function Zd(A,L,R,q){for(var Z=-1,ae=A==null?0:A.length;++Z-1}function Sa(A,L,R){for(var q=-1,Z=A==null?0:A.length;++q-1;);return R}function ml(A,L){for(var R=A.length;R--&&Gt(L,A[R],0)>-1;);return R}function u1(A,L){for(var R=A.length,q=0;R--;)A[R]===L&&++q;return q}var a1=La(Ud),o1=La(Xd);function s1(A){return"\\"+Wd[A]}function f1(A,L){return A==null?r:A[L]}function Dt(A){return $d.test(A)}function l1(A){return Nd.test(A)}function c1(A){for(var L,R=[];!(L=A.next()).done;)R.push(L.value);return R}function Fa(A){var L=-1,R=Array(A.size);return A.forEach(function(q,Z){R[++L]=[Z,q]}),R}function vl(A,L){return function(R){return A(L(R))}}function Vn(A,L){for(var R=-1,q=A.length,Z=0,ae=[];++R-1}function j1(e,n){var u=this.__data__,o=Ei(u,e);return o<0?(++this.size,u.push([e,n])):u[o][1]=n,this}On.prototype.clear=z1,On.prototype.delete=V1,On.prototype.get=Z1,On.prototype.has=J1,On.prototype.set=j1;function Fn(e){var n=-1,u=e==null?0:e.length;for(this.clear();++n=n?e:n)),e}function cn(e,n,u,o,c,m){var v,_=n&b,w=n&E,M=n&S;if(u&&(v=c?u(e,o,c,m):u(e)),v!==r)return v;if(!_e(e))return e;var O=J(e);if(O){if(v=tv(e),!_)return Ze(e,v)}else{var H=qe(e),N=H==ni||H==Mf;if(nt(e))return Ql(e,_);if(H==Mn||H==Tt||N&&!c){if(v=w||N?{}:yc(e),!_)return w?km(e,gm(v,e)):Xm(e,Ll(v,e))}else{if(!de[H])return c?e:{};v=rv(e,H,_)}}m||(m=new bn);var Y=m.get(e);if(Y)return Y;m.set(e,v),Kc(e)?e.forEach(function(V){v.add(cn(V,n,u,V,e,m))}):kc(e)&&e.forEach(function(V,ne){v.set(ne,cn(V,n,u,ne,e,m))});var z=M?w?uo:io:w?je:Fe,Q=O?r:z(e);return sn(Q||e,function(V,ne){Q&&(ne=V,V=e[ne]),wr(v,ne,cn(V,n,u,ne,e,m))}),v}function dm(e){var n=Fe(e);return function(u){return Bl(u,e,n)}}function Bl(e,n,u){var o=u.length;if(e==null)return!o;for(e=he(e);o--;){var c=u[o],m=n[c],v=e[c];if(v===r&&!(c in e)||!m(v))return!1}return!0}function Ml(e,n,u){if(typeof e!="function")throw new fn(l);return Lr(function(){e.apply(r,u)},n)}function Er(e,n,u,o){var c=-1,m=ai,v=!0,_=e.length,w=[],M=n.length;if(!_)return w;u&&(n=ye(n,nn(u))),o?(m=Sa,v=!1):n.length>=s&&(m=mr,v=!1,n=new gt(n));e:for(;++c<_;){var O=e[c],H=u==null?O:u(O);if(O=o||O!==0?O:0,v&&H===H){for(var N=M;N--;)if(n[N]===H)continue e;w.push(O)}else m(n,H,o)||w.push(O)}return w}var Jn=ic(xn),Ol=ic(qa,!0);function mm(e,n){var u=!0;return Jn(e,function(o,c,m){return u=!!n(o,c,m),u}),u}function xi(e,n,u){for(var o=-1,c=e.length;++oc?0:c+u),o=o===r||o>c?c:j(o),o<0&&(o+=c),o=u>o?0:Vc(o);u0&&u(_)?n>1?De(_,n-1,u,o,c):zn(c,_):o||(c[c.length]=_)}return c}var Na=uc(),Tl=uc(!0);function xn(e,n){return e&&Na(e,n,Fe)}function qa(e,n){return e&&Tl(e,n,Fe)}function Si(e,n){return Kn(n,function(u){return Dn(e[u])})}function mt(e,n){n=Qn(n,e);for(var u=0,o=n.length;e!=null&&un}function ym(e,n){return e!=null&&se.call(e,n)}function _m(e,n){return e!=null&&n in he(e)}function bm(e,n,u){return e>=Ne(n,u)&&e=120&&O.length>=120)?new gt(v&&O):r}O=e[0];var H=-1,N=_[0];e:for(;++H-1;)_!==e&&mi.call(_,w,1),mi.call(e,w,1);return e}function kl(e,n){for(var u=e?n.length:0,o=u-1;u--;){var c=n[u];if(u==o||c!==m){var m=c;Gn(c)?mi.call(e,c,1):Ja(e,c)}}return e}function za(e,n){return e+_i(Sl()*(n-e+1))}function Fm(e,n,u,o){for(var c=-1,m=Me(yi((n-e)/(u||1)),0),v=R(m);m--;)v[o?m:++c]=e,e+=u;return v}function Va(e,n){var u="";if(!e||n<1||n>Wn)return u;do n%2&&(u+=e),n=_i(n/2),n&&(e+=e);while(n);return u}function ee(e,n){return ho(Ac(e,n,Qe),e+"")}function Tm(e){return Il(Vt(e))}function Hm(e,n){var u=Vt(e);return Pi(u,dt(n,0,u.length))}function Cr(e,n,u,o){if(!_e(e))return e;n=Qn(n,e);for(var c=-1,m=n.length,v=m-1,_=e;_!=null&&++cc?0:c+n),u=u>c?c:u,u<0&&(u+=c),c=n>u?0:u-n>>>0,n>>>=0;for(var m=R(c);++o>>1,v=e[m];v!==null&&!rn(v)&&(u?v<=n:v=s){var M=n?null:Vm(e);if(M)return si(M);v=!1,c=mr,w=new gt}else w=n?[]:_;e:for(;++o=o?e:hn(e,n,u)}var jl=C1||function(e){return Ge.clearTimeout(e)};function Ql(e,n){if(n)return e.slice();var u=e.length,o=bl?bl(u):new e.constructor(u);return e.copy(o),o}function no(e){var n=new e.constructor(e.byteLength);return new gi(n).set(new gi(e)),n}function Nm(e,n){var u=n?no(e.buffer):e.buffer;return new e.constructor(u,e.byteOffset,e.byteLength)}function qm(e){var n=new e.constructor(e.source,Pf.exec(e));return n.lastIndex=e.lastIndex,n}function Ym(e){return Ar?he(Ar.call(e)):{}}function ec(e,n){var u=n?no(e.buffer):e.buffer;return new e.constructor(u,e.byteOffset,e.length)}function nc(e,n){if(e!==n){var u=e!==r,o=e===null,c=e===e,m=rn(e),v=n!==r,_=n===null,w=n===n,M=rn(n);if(!_&&!M&&!m&&e>n||m&&v&&w&&!_&&!M||o&&v&&w||!u&&w||!c)return 1;if(!o&&!m&&!M&&e=_)return w;var M=u[o];return w*(M=="desc"?-1:1)}}return e.index-n.index}function tc(e,n,u,o){for(var c=-1,m=e.length,v=u.length,_=-1,w=n.length,M=Me(m-v,0),O=R(w+M),H=!o;++_1?u[c-1]:r,v=c>2?u[2]:r;for(m=e.length>3&&typeof m=="function"?(c--,m):r,v&&Xe(u[0],u[1],v)&&(m=c<3?r:m,c=1),n=he(n);++o-1?c[m?n[v]:v]:r}}function sc(e){return Pn(function(n){var u=n.length,o=u,c=ln.prototype.thru;for(e&&n.reverse();o--;){var m=n[o];if(typeof m!="function")throw new fn(l);if(c&&!v&&Ti(m)=="wrapper")var v=new ln([],!0)}for(o=v?o:u;++o1&&ie.reverse(),O&&w_))return!1;var M=m.get(e),O=m.get(n);if(M&&O)return M==n&&O==e;var H=-1,N=!0,Y=u&P?new gt:r;for(m.set(e,n),m.set(n,e);++H<_;){var z=e[H],Q=n[H];if(o)var V=v?o(Q,z,H,n,e,m):o(z,Q,H,e,n,m);if(V!==r){if(V)continue;N=!1;break}if(Y){if(!Ra(n,function(ne,ie){if(!mr(Y,ie)&&(z===ne||c(z,ne,u,o,m)))return Y.push(ie)})){N=!1;break}}else if(!(z===Q||c(z,Q,u,o,m))){N=!1;break}}return m.delete(e),m.delete(n),N}function Jm(e,n,u,o,c,m,v){switch(u){case Ht:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case dr:return!(e.byteLength!=n.byteLength||!m(new gi(e),new gi(n)));case fr:case lr:case cr:return An(+e,+n);case ei:return e.name==n.name&&e.message==n.message;case hr:case pr:return e==n+"";case vn:var _=Fa;case yn:var w=o&F;if(_||(_=si),e.size!=n.size&&!w)return!1;var M=v.get(e);if(M)return M==n;o|=P,v.set(e,n);var O=dc(_(e),_(n),o,c,m,v);return v.delete(e),O;case ti:if(Ar)return Ar.call(e)==Ar.call(n)}return!1}function jm(e,n,u,o,c,m){var v=u&F,_=io(e),w=_.length,M=io(n),O=M.length;if(w!=O&&!v)return!1;for(var H=w;H--;){var N=_[H];if(!(v?N in n:se.call(n,N)))return!1}var Y=m.get(e),z=m.get(n);if(Y&&z)return Y==n&&z==e;var Q=!0;m.set(e,n),m.set(n,e);for(var V=v;++H1?"& ":"")+n[o],n=n.join(u>2?", ":" "),e.replace(ad,`{ -/* [wrapped with `+n+`] */ -`)}function uv(e){return J(e)||_t(e)||!!(El&&e&&e[El])}function Gn(e,n){var u=typeof e;return n=n??Wn,!!n&&(u=="number"||u!="symbol"&&vd.test(e))&&e>-1&&e%1==0&&e0){if(++n>=aa)return arguments[0]}else n=0;return e.apply(r,arguments)}}function Pi(e,n){var u=-1,o=e.length,c=o-1;for(n=n===r?o:n;++u1?e[n-1]:r;return u=typeof u=="function"?(e.pop(),u):r,Fc(e,u)});function Tc(e){var n=p(e);return n.__chain__=!0,n}function my(e,n){return n(e),e}function Gi(e,n){return n(e)}var vy=Pn(function(e){var n=e.length,u=n?e[0]:0,o=this.__wrapped__,c=function(m){return $a(m,e)};return n>1||this.__actions__.length||!(o instanceof te)||!Gn(u)?this.thru(c):(o=o.slice(u,+u+(n?1:0)),o.__actions__.push({func:Gi,args:[c],thisArg:r}),new ln(o,this.__chain__).thru(function(m){return n&&!m.length&&m.push(r),m}))});function yy(){return Tc(this)}function _y(){return new ln(this.value(),this.__chain__)}function by(){this.__values__===r&&(this.__values__=zc(this.value()));var e=this.__index__>=this.__values__.length,n=e?r:this.__values__[this.__index__++];return{done:e,value:n}}function Ay(){return this}function wy(e){for(var n,u=this;u instanceof wi;){var o=Rc(u);o.__index__=0,o.__values__=r,n?c.__wrapped__=o:n=o;var c=o;u=u.__wrapped__}return c.__wrapped__=e,n}function Ey(){var e=this.__wrapped__;if(e instanceof te){var n=e;return this.__actions__.length&&(n=new te(this)),n=n.reverse(),n.__actions__.push({func:Gi,args:[po],thisArg:r}),new ln(n,this.__chain__)}return this.thru(po)}function xy(){return Zl(this.__wrapped__,this.__actions__)}var Sy=Li(function(e,n,u){se.call(e,u)?++e[u]:Tn(e,u,1)});function Cy(e,n,u){var o=J(e)?fl:mm;return u&&Xe(e,n,u)&&(n=r),o(e,K(n,3))}function Ry(e,n){var u=J(e)?Kn:Fl;return u(e,K(n,3))}var Iy=oc(Ic),Ly=oc(Lc);function By(e,n){return De(Di(e,n),1)}function My(e,n){return De(Di(e,n),lt)}function Oy(e,n,u){return u=u===r?1:j(u),De(Di(e,n),u)}function Hc(e,n){var u=J(e)?sn:Jn;return u(e,K(n,3))}function Pc(e,n){var u=J(e)?Jd:Ol;return u(e,K(n,3))}var Fy=Li(function(e,n,u){se.call(e,u)?e[u].push(n):Tn(e,u,[n])});function Ty(e,n,u,o){e=Je(e)?e:Vt(e),u=u&&!o?j(u):0;var c=e.length;return u<0&&(u=Me(c+u,0)),Ui(e)?u<=c&&e.indexOf(n,u)>-1:!!c&&Gt(e,n,u)>-1}var Hy=ee(function(e,n,u){var o=-1,c=typeof n=="function",m=Je(e)?R(e.length):[];return Jn(e,function(v){m[++o]=c?en(n,v,u):xr(v,n,u)}),m}),Py=Li(function(e,n,u){Tn(e,u,n)});function Di(e,n){var u=J(e)?ye:$l;return u(e,K(n,3))}function Gy(e,n,u,o){return e==null?[]:(J(n)||(n=n==null?[]:[n]),u=o?r:u,J(u)||(u=u==null?[]:[u]),Ul(e,n,u))}var Dy=Li(function(e,n,u){e[u?0:1].push(n)},function(){return[[],[]]});function $y(e,n,u){var o=J(e)?Ca:pl,c=arguments.length<3;return o(e,K(n,4),u,c,Jn)}function Ny(e,n,u){var o=J(e)?jd:pl,c=arguments.length<3;return o(e,K(n,4),u,c,Ol)}function qy(e,n){var u=J(e)?Kn:Fl;return u(e,qi(K(n,3)))}function Yy(e){var n=J(e)?Il:Tm;return n(e)}function Uy(e,n,u){(u?Xe(e,n,u):n===r)?n=1:n=j(n);var o=J(e)?cm:Hm;return o(e,n)}function Xy(e){var n=J(e)?hm:Gm;return n(e)}function ky(e){if(e==null)return 0;if(Je(e))return Ui(e)?$t(e):e.length;var n=qe(e);return n==vn||n==yn?e.size:ka(e).length}function Wy(e,n,u){var o=J(e)?Ra:Dm;return u&&Xe(e,n,u)&&(n=r),o(e,K(n,3))}var Ky=ee(function(e,n){if(e==null)return[];var u=n.length;return u>1&&Xe(e,n[0],n[1])?n=[]:u>2&&Xe(n[0],n[1],n[2])&&(n=[n[0]]),Ul(e,De(n,1),[])}),$i=R1||function(){return Ge.Date.now()};function zy(e,n){if(typeof n!="function")throw new fn(l);return e=j(e),function(){if(--e<1)return n.apply(this,arguments)}}function Gc(e,n,u){return n=u?r:n,n=e&&n==null?e.length:n,Hn(e,re,r,r,r,r,n)}function Dc(e,n){var u;if(typeof n!="function")throw new fn(l);return e=j(e),function(){return--e>0&&(u=n.apply(this,arguments)),e<=1&&(n=r),u}}var mo=ee(function(e,n,u){var o=C;if(u.length){var c=Vn(u,Kt(mo));o|=G}return Hn(e,o,n,u,c)}),$c=ee(function(e,n,u){var o=C|I;if(u.length){var c=Vn(u,Kt($c));o|=G}return Hn(n,o,e,u,c)});function Nc(e,n,u){n=u?r:n;var o=Hn(e,x,r,r,r,r,r,n);return o.placeholder=Nc.placeholder,o}function qc(e,n,u){n=u?r:n;var o=Hn(e,B,r,r,r,r,r,n);return o.placeholder=qc.placeholder,o}function Yc(e,n,u){var o,c,m,v,_,w,M=0,O=!1,H=!1,N=!0;if(typeof e!="function")throw new fn(l);n=gn(n)||0,_e(u)&&(O=!!u.leading,H="maxWait"in u,m=H?Me(gn(u.maxWait)||0,n):m,N="trailing"in u?!!u.trailing:N);function Y(Se){var wn=o,Nn=c;return o=c=r,M=Se,v=e.apply(Nn,wn),v}function z(Se){return M=Se,_=Lr(ne,n),O?Y(Se):v}function Q(Se){var wn=Se-w,Nn=Se-M,oh=n-wn;return H?Ne(oh,m-Nn):oh}function V(Se){var wn=Se-w,Nn=Se-M;return w===r||wn>=n||wn<0||H&&Nn>=m}function ne(){var Se=$i();if(V(Se))return ie(Se);_=Lr(ne,Q(Se))}function ie(Se){return _=r,N&&o?Y(Se):(o=c=r,v)}function un(){_!==r&&jl(_),M=0,o=w=c=_=r}function ke(){return _===r?v:ie($i())}function an(){var Se=$i(),wn=V(Se);if(o=arguments,c=this,w=Se,wn){if(_===r)return z(w);if(H)return jl(_),_=Lr(ne,n),Y(w)}return _===r&&(_=Lr(ne,n)),v}return an.cancel=un,an.flush=ke,an}var Vy=ee(function(e,n){return Ml(e,1,n)}),Zy=ee(function(e,n,u){return Ml(e,gn(n)||0,u)});function Jy(e){return Hn(e,Ve)}function Ni(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new fn(l);var u=function(){var o=arguments,c=n?n.apply(this,o):o[0],m=u.cache;if(m.has(c))return m.get(c);var v=e.apply(this,o);return u.cache=m.set(c,v)||m,v};return u.cache=new(Ni.Cache||Fn),u}Ni.Cache=Fn;function qi(e){if(typeof e!="function")throw new fn(l);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function jy(e){return Dc(2,e)}var Qy=$m(function(e,n){n=n.length==1&&J(n[0])?ye(n[0],nn(K())):ye(De(n,1),nn(K()));var u=n.length;return ee(function(o){for(var c=-1,m=Ne(o.length,u);++c=n}),_t=Pl(function(){return arguments}())?Pl:function(e){return Ae(e)&&se.call(e,"callee")&&!wl.call(e,"callee")},J=R.isArray,g_=rl?nn(rl):wm;function Je(e){return e!=null&&Yi(e.length)&&!Dn(e)}function xe(e){return Ae(e)&&Je(e)}function d_(e){return e===!0||e===!1||Ae(e)&&Ue(e)==fr}var nt=L1||Io,m_=il?nn(il):Em;function v_(e){return Ae(e)&&e.nodeType===1&&!Br(e)}function y_(e){if(e==null)return!0;if(Je(e)&&(J(e)||typeof e=="string"||typeof e.splice=="function"||nt(e)||zt(e)||_t(e)))return!e.length;var n=qe(e);if(n==vn||n==yn)return!e.size;if(Ir(e))return!ka(e).length;for(var u in e)if(se.call(e,u))return!1;return!0}function __(e,n){return Sr(e,n)}function b_(e,n,u){u=typeof u=="function"?u:r;var o=u?u(e,n):r;return o===r?Sr(e,n,r,u):!!o}function yo(e){if(!Ae(e))return!1;var n=Ue(e);return n==ei||n==Ug||typeof e.message=="string"&&typeof e.name=="string"&&!Br(e)}function A_(e){return typeof e=="number"&&xl(e)}function Dn(e){if(!_e(e))return!1;var n=Ue(e);return n==ni||n==Mf||n==Yg||n==kg}function Xc(e){return typeof e=="number"&&e==j(e)}function Yi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Wn}function _e(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function Ae(e){return e!=null&&typeof e=="object"}var kc=ul?nn(ul):Sm;function w_(e,n){return e===n||Xa(e,n,oo(n))}function E_(e,n,u){return u=typeof u=="function"?u:r,Xa(e,n,oo(n),u)}function x_(e){return Wc(e)&&e!=+e}function S_(e){if(sv(e))throw new Z(f);return Gl(e)}function C_(e){return e===null}function R_(e){return e==null}function Wc(e){return typeof e=="number"||Ae(e)&&Ue(e)==cr}function Br(e){if(!Ae(e)||Ue(e)!=Mn)return!1;var n=di(e);if(n===null)return!0;var u=se.call(n,"constructor")&&n.constructor;return typeof u=="function"&&u instanceof u&&ci.call(u)==E1}var _o=al?nn(al):Cm;function I_(e){return Xc(e)&&e>=-Wn&&e<=Wn}var Kc=ol?nn(ol):Rm;function Ui(e){return typeof e=="string"||!J(e)&&Ae(e)&&Ue(e)==pr}function rn(e){return typeof e=="symbol"||Ae(e)&&Ue(e)==ti}var zt=sl?nn(sl):Im;function L_(e){return e===r}function B_(e){return Ae(e)&&qe(e)==gr}function M_(e){return Ae(e)&&Ue(e)==Kg}var O_=Fi(Wa),F_=Fi(function(e,n){return e<=n});function zc(e){if(!e)return[];if(Je(e))return Ui(e)?_n(e):Ze(e);if(vr&&e[vr])return c1(e[vr]());var n=qe(e),u=n==vn?Fa:n==yn?si:Vt;return u(e)}function $n(e){if(!e)return e===0?e:0;if(e=gn(e),e===lt||e===-lt){var n=e<0?-1:1;return n*Dg}return e===e?e:0}function j(e){var n=$n(e),u=n%1;return n===n?u?n-u:n:0}function Vc(e){return e?dt(j(e),0,En):0}function gn(e){if(typeof e=="number")return e;if(rn(e))return jr;if(_e(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=_e(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=gl(e);var u=gd.test(e);return u||md.test(e)?zd(e.slice(2),u?2:8):pd.test(e)?jr:+e}function Zc(e){return Sn(e,je(e))}function T_(e){return e?dt(j(e),-Wn,Wn):e===0?e:0}function oe(e){return e==null?"":tn(e)}var H_=kt(function(e,n){if(Ir(n)||Je(n)){Sn(n,Fe(n),e);return}for(var u in n)se.call(n,u)&&wr(e,u,n[u])}),Jc=kt(function(e,n){Sn(n,je(n),e)}),Xi=kt(function(e,n,u,o){Sn(n,je(n),e,o)}),P_=kt(function(e,n,u,o){Sn(n,Fe(n),e,o)}),G_=Pn($a);function D_(e,n){var u=Xt(e);return n==null?u:Ll(u,n)}var $_=ee(function(e,n){e=he(e);var u=-1,o=n.length,c=o>2?n[2]:r;for(c&&Xe(n[0],n[1],c)&&(o=1);++u1),m}),Sn(e,uo(e),u),o&&(u=cn(u,b|E|S,Zm));for(var c=n.length;c--;)Ja(u,n[c]);return u});function rb(e,n){return Qc(e,qi(K(n)))}var ib=Pn(function(e,n){return e==null?{}:Mm(e,n)});function Qc(e,n){if(e==null)return{};var u=ye(uo(e),function(o){return[o]});return n=K(n),Xl(e,u,function(o,c){return n(o,c[0])})}function ub(e,n,u){n=Qn(n,e);var o=-1,c=n.length;for(c||(c=1,e=r);++on){var o=e;e=n,n=o}if(u||e%1||n%1){var c=Sl();return Ne(e+c*(n-e+Kd("1e-"+((c+"").length-1))),n)}return za(e,n)}var mb=Wt(function(e,n,u){return n=n.toLowerCase(),e+(u?th(n):n)});function th(e){return wo(oe(e).toLowerCase())}function rh(e){return e=oe(e),e&&e.replace(yd,a1).replace(Gd,"")}function vb(e,n,u){e=oe(e),n=tn(n);var o=e.length;u=u===r?o:dt(j(u),0,o);var c=u;return u-=n.length,u>=0&&e.slice(u,c)==n}function yb(e){return e=oe(e),e&&jg.test(e)?e.replace(Tf,o1):e}function _b(e){return e=oe(e),e&&id.test(e)?e.replace(ma,"\\$&"):e}var bb=Wt(function(e,n,u){return e+(u?"-":"")+n.toLowerCase()}),Ab=Wt(function(e,n,u){return e+(u?" ":"")+n.toLowerCase()}),wb=ac("toLowerCase");function Eb(e,n,u){e=oe(e),n=j(n);var o=n?$t(e):0;if(!n||o>=n)return e;var c=(n-o)/2;return Oi(_i(c),u)+e+Oi(yi(c),u)}function xb(e,n,u){e=oe(e),n=j(n);var o=n?$t(e):0;return n&&o>>0,u?(e=oe(e),e&&(typeof n=="string"||n!=null&&!_o(n))&&(n=tn(n),!n&&Dt(e))?et(_n(e),0,u):e.split(n,u)):[]}var Mb=Wt(function(e,n,u){return e+(u?" ":"")+wo(n)});function Ob(e,n,u){return e=oe(e),u=u==null?0:dt(j(u),0,e.length),n=tn(n),e.slice(u,u+n.length)==n}function Fb(e,n,u){var o=p.templateSettings;u&&Xe(e,n,u)&&(n=r),e=oe(e),n=Xi({},n,o,pc);var c=Xi({},n.imports,o.imports,pc),m=Fe(c),v=Oa(c,m),_,w,M=0,O=n.interpolate||ri,H="__p += '",N=Ta((n.escape||ri).source+"|"+O.source+"|"+(O===Hf?hd:ri).source+"|"+(n.evaluate||ri).source+"|$","g"),Y="//# sourceURL="+(se.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yd+"]")+` -`;e.replace(N,function(V,ne,ie,un,ke,an){return ie||(ie=un),H+=e.slice(M,an).replace(_d,s1),ne&&(_=!0,H+=`' + -__e(`+ne+`) + -'`),ke&&(w=!0,H+=`'; -`+ke+`; -__p += '`),ie&&(H+=`' + -((__t = (`+ie+`)) == null ? '' : __t) + -'`),M=an+V.length,V}),H+=`'; -`;var z=se.call(n,"variable")&&n.variable;if(!z)H=`with (obj) { -`+H+` -} -`;else if(ld.test(z))throw new Z(h);H=(w?H.replace(zg,""):H).replace(Vg,"$1").replace(Zg,"$1;"),H="function("+(z||"obj")+`) { -`+(z?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(w?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+H+`return __p -}`;var Q=uh(function(){return ae(m,Y+"return "+H).apply(r,v)});if(Q.source=H,yo(Q))throw Q;return Q}function Tb(e){return oe(e).toLowerCase()}function Hb(e){return oe(e).toUpperCase()}function Pb(e,n,u){if(e=oe(e),e&&(u||n===r))return gl(e);if(!e||!(n=tn(n)))return e;var o=_n(e),c=_n(n),m=dl(o,c),v=ml(o,c)+1;return et(o,m,v).join("")}function Gb(e,n,u){if(e=oe(e),e&&(u||n===r))return e.slice(0,yl(e)+1);if(!e||!(n=tn(n)))return e;var o=_n(e),c=ml(o,_n(n))+1;return et(o,0,c).join("")}function Db(e,n,u){if(e=oe(e),e&&(u||n===r))return e.replace(va,"");if(!e||!(n=tn(n)))return e;var o=_n(e),c=dl(o,_n(n));return et(o,c).join("")}function $b(e,n){var u=Ft,o=Jr;if(_e(n)){var c="separator"in n?n.separator:c;u="length"in n?j(n.length):u,o="omission"in n?tn(n.omission):o}e=oe(e);var m=e.length;if(Dt(e)){var v=_n(e);m=v.length}if(u>=m)return e;var _=u-$t(o);if(_<1)return o;var w=v?et(v,0,_).join(""):e.slice(0,_);if(c===r)return w+o;if(v&&(_+=w.length-_),_o(c)){if(e.slice(_).search(c)){var M,O=w;for(c.global||(c=Ta(c.source,oe(Pf.exec(c))+"g")),c.lastIndex=0;M=c.exec(O);)var H=M.index;w=w.slice(0,H===r?_:H)}}else if(e.indexOf(tn(c),_)!=_){var N=w.lastIndexOf(c);N>-1&&(w=w.slice(0,N))}return w+o}function Nb(e){return e=oe(e),e&&Jg.test(e)?e.replace(Ff,d1):e}var qb=Wt(function(e,n,u){return e+(u?" ":"")+n.toUpperCase()}),wo=ac("toUpperCase");function ih(e,n,u){return e=oe(e),n=u?r:n,n===r?l1(e)?y1(e):n1(e):e.match(n)||[]}var uh=ee(function(e,n){try{return en(e,r,n)}catch(u){return yo(u)?u:new Z(u)}}),Yb=Pn(function(e,n){return sn(n,function(u){u=Cn(u),Tn(e,u,mo(e[u],e))}),e});function Ub(e){var n=e==null?0:e.length,u=K();return e=n?ye(e,function(o){if(typeof o[1]!="function")throw new fn(l);return[u(o[0]),o[1]]}):[],ee(function(o){for(var c=-1;++cWn)return[];var u=En,o=Ne(e,En);n=K(n),e-=En;for(var c=Ma(o,n);++u0||n<0)?new te(u):(e<0?u=u.takeRight(-e):e&&(u=u.drop(e)),n!==r&&(n=j(n),u=n<0?u.dropRight(-n):u.take(n-e)),u)},te.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},te.prototype.toArray=function(){return this.take(En)},xn(te.prototype,function(e,n){var u=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),c=p[o?"take"+(n=="last"?"Right":""):n],m=o||/^find/.test(n);c&&(p.prototype[n]=function(){var v=this.__wrapped__,_=o?[1]:arguments,w=v instanceof te,M=_[0],O=w||J(v),H=function(ne){var ie=c.apply(p,zn([ne],_));return o&&N?ie[0]:ie};O&&u&&typeof M=="function"&&M.length!=1&&(w=O=!1);var N=this.__chain__,Y=!!this.__actions__.length,z=m&&!N,Q=w&&!Y;if(!m&&O){v=Q?v:new te(this);var V=e.apply(v,_);return V.__actions__.push({func:Gi,args:[H],thisArg:r}),new ln(V,N)}return z&&Q?e.apply(this,_):(V=this.thru(H),z?o?V.value()[0]:V.value():V)})}),sn(["pop","push","shift","sort","splice","unshift"],function(e){var n=fi[e],u=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var c=arguments;if(o&&!this.__chain__){var m=this.value();return n.apply(J(m)?m:[],c)}return this[u](function(v){return n.apply(J(v)?v:[],c)})}}),xn(te.prototype,function(e,n){var u=p[n];if(u){var o=u.name+"";se.call(Ut,o)||(Ut[o]=[]),Ut[o].push({name:n,func:u})}}),Ut[Bi(r,I).name]=[{name:"wrapper",func:r}],te.prototype.clone=N1,te.prototype.reverse=q1,te.prototype.value=Y1,p.prototype.at=vy,p.prototype.chain=yy,p.prototype.commit=_y,p.prototype.next=by,p.prototype.plant=wy,p.prototype.reverse=Ey,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=xy,p.prototype.first=p.prototype.head,vr&&(p.prototype[vr]=Ay),p},Nt=_1();ct?((ct.exports=Nt)._=Nt,Ea._=Nt):Ge._=Nt}).call(fe)}(Or,Or.exports);var ue=Or.exports,mh=function(){},vh=mh(),tt=function(t){return t!==vh&&t!==null},yh=tt,_h=Array.prototype.forEach,bh=Object.create,Ah=function(t,i){var r;for(r in t)i[r]=t[r]},Bo=function(t){var i=bh(null);return _h.call(arguments,function(r){yh(r)&&Ah(Object(r),i)}),i},wh=function(){var t=Math.sign;return typeof t!="function"?!1:t(10)===1&&t(-20)===-1},Wi,Mo;function Eh(){return Mo||(Mo=1,Wi=function(t){return t=Number(t),isNaN(t)||t===0?t:t>0?1:-1}),Wi}var xh=wh()?Math.sign:Eh(),Sh=xh,Ch=Math.abs,Rh=Math.floor,Ih=function(t){return isNaN(t)?0:(t=Number(t),t===0||!isFinite(t)?t:Sh(t)*Rh(Ch(t)))},Lh=Ih,Bh=Math.max,rt=function(t){return Bh(0,Lh(t))},Mh=rt,Oo=function(t,i,r){var a;return isNaN(t)?(a=i,a>=0?r&&a?a-1:a:1):t===!1?!1:Mh(t)},qn=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");return t},Ki,Fo;function bt(){if(Fo)return Ki;Fo=1;var t=tt;return Ki=function(i){if(!t(i))throw new TypeError("Cannot use null or undefined");return i},Ki}var Oh=qn,Fh=bt(),Th=Function.prototype.bind,To=Function.prototype.call,Hh=Object.keys,Ph=Object.prototype.propertyIsEnumerable,Gh=function(t,i){return function(r,a){var s,f=arguments[2],l=arguments[3];return r=Object(Fh(r)),Oh(a),s=Hh(r),l&&s.sort(typeof l=="function"?Th.call(l,r):void 0),typeof t!="function"&&(t=s[t]),To.call(t,s,function(h,d){return Ph.call(r,h)?To.call(a,f,r[h],h,r,d):i})}},Fr=Gh("forEach"),it={},Ho={exports:{}},Dh=function(){var t=Object.assign,i;return typeof t!="function"?!1:(i={foo:"raz"},t(i,{bar:"dwa"},{trzy:"trzy"}),i.foo+i.bar+i.trzy==="razdwatrzy")},zi,Po;function $h(){return Po||(Po=1,zi=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),zi}var Vi,Go;function Nh(){if(Go)return Vi;Go=1;var t=tt,i=Object.keys;return Vi=function(r){return i(t(r)?Object(r):r)},Vi}var Zi,Do;function qh(){return Do||(Do=1,Zi=$h()()?Object.keys:Nh()),Zi}var Ji,$o;function Yh(){if($o)return Ji;$o=1;var t=qh(),i=bt(),r=Math.max;return Ji=function(a,s){var f,l,h=r(arguments.length,2),d;for(a=Object(i(a)),d=function(g){try{a[g]=s[g]}catch(y){f||(f=y)}},l=1;l-1},tu}var op=up()?String.prototype.contains:ap(),Tr=Zo,jo=ip,Qo=No,es=Bo,Zt=op,sp=Vo.exports=function(t,i){var r,a,s,f,l;return arguments.length<2||typeof t!="string"?(f=i,i=t,t=null):f=arguments[2],Tr(t)?(r=Zt.call(t,"c"),a=Zt.call(t,"e"),s=Zt.call(t,"w")):(r=s=!0,a=!1),l={value:i,configurable:r,enumerable:a,writable:s},f?Qo(es(f),l):l};sp.gs=function(t,i,r){var a,s,f,l;return typeof t!="string"?(f=r,r=i,i=t,t=null):f=arguments[3],Tr(i)?jo(i)?Tr(r)?jo(r)||(f=r,r=void 0):r=void 0:(f=i,i=r=void 0):i=void 0,Tr(t)?(a=Zt.call(t,"c"),s=Zt.call(t,"e")):(a=!0,s=!1),l={get:i,set:r,configurable:a,enumerable:s},f?Qo(es(f),l):l};var ut=Vo.exports,ru={exports:{}};(function(t,i){var r=ut,a=qn,s=Function.prototype.apply,f=Function.prototype.call,l=Object.create,h=Object.defineProperty,d=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0},b,E,S,F,P,C,I;b=function(T,x){var B;return a(x),g.call(this,"__ee__")?B=this.__ee__:(B=y.value=l(null),h(this,"__ee__",y),y.value=null),B[T]?typeof B[T]=="object"?B[T].push(x):B[T]=[B[T],x]:B[T]=x,this},E=function(T,x){var B,G;return a(x),G=this,b.call(this,T,B=function(){S.call(G,T,B),s.call(x,this,arguments)}),B.__eeOnceListener__=x,this},S=function(T,x){var B,G,W,re;if(a(x),!g.call(this,"__ee__"))return this;if(B=this.__ee__,!B[T])return this;if(G=B[T],typeof G=="object")for(re=0;W=G[re];++re)(W===x||W.__eeOnceListener__===x)&&(G.length===2?B[T]=G[re?0:1]:G.splice(re,1));else(G===x||G.__eeOnceListener__===x)&&delete B[T];return this},F=function(T){var x,B,G,W,re;if(g.call(this,"__ee__")&&(W=this.__ee__[T],!!W))if(typeof W=="object"){for(B=arguments.length,re=new Array(B-1),x=1;x=55296&&B<=56319&&(ce+=E[++C])),ce=S?g.call(S,F,ce,I):ce,P?(y.value=ce,b(T,I,y)):T[I]=ce,++I;x=I}}if(x===void 0)for(x=a(E.length),P&&(T=new P(x)),C=0;C=0?y=l(y):y=i(this.length)-l(f(y)),d=y;d"}},qu}var Yu,Xs;function r0(){if(Xs)return Yu;Xs=1;var t=t0(),i=/[\n\r\u2028\u2029]/g;return Yu=function(r){var a=t(r);return a.length>100&&(a=a.slice(0,99)+"…"),a=a.replace(i,function(s){return JSON.stringify(s).slice(1,-1)}),a},Yu}var $r={exports:{}},ks;function Ws(){if(ks)return $r.exports;ks=1,$r.exports=t,$r.exports.default=t;function t(i){return!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function"}return $r.exports}var Ks;function i0(){if(Ks)return Gs;Ks=1;var t=Ts(),i=Qp(),r=n0(),a=r0(),s=Ws(),f=Pu(),l=Object.create,h=i("then","then:finally","done","done:finally");return it.promise=function(d,g){var y=l(null),b=l(null),E=l(null);if(d===!0)d=null;else if(d=r(d),!h[d])throw new TypeError("'"+a(d)+"' is not valid promise mode");g.on("set",function(S,F,P){var C=!1;if(!s(P)){b[S]=P,g.emit("setasync",S,1);return}y[S]=1,E[S]=P;var I=function(G){var W=y[S];if(C)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) -Consider to rely on 'then' or 'done' mode instead.`);W&&(delete y[S],b[S]=G,g.emit("setasync",S,W))},T=function(){C=!0,y[S]&&(delete y[S],delete E[S],g.delete(S))},x=d;if(x||(x="then"),x==="then"){var B=function(){f(T)};P=P.then(function(G){f(I.bind(this,G))},B),typeof P.finally=="function"&&P.finally(B)}else if(x==="done"){if(typeof P.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");P.done(I,T)}else if(x==="done:finally"){if(typeof P.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof P.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");P.done(I),P.finally(T)}}),g.on("get",function(S,F,P){var C;if(y[S]){++y[S];return}C=E[S];var I=function(){g.emit("getasync",S,F,P)};s(C)?typeof C.done=="function"?C.done(I):C.then(function(){f(I)}):I()}),g.on("delete",function(S){if(delete E[S],y[S]){delete y[S];return}if(hasOwnProperty.call(b,S)){var F=b[S];delete b[S],g.emit("deleteasync",S,[F])}}),g.on("clear",function(){var S=b;b=l(null),y=l(null),E=l(null),g.emit("clearasync",t(S,function(F){return[F]}))})},Gs}var zs={},Vs;function u0(){if(Vs)return zs;Vs=1;var t=qn,i=Fr,r=it,a=Function.prototype.apply;return r.dispose=function(s,f,l){var h;if(t(s),l.async&&r.async||l.promise&&r.promise){f.on("deleteasync",h=function(d,g){a.call(s,null,g)}),f.on("clearasync",function(d){i(d,function(g,y){h(y,g)})});return}f.on("delete",h=function(d,g){s(g)}),f.on("clear",function(d){i(d,function(g,y){h(y,g)})})},zs}var Zs={},Uu,Js;function a0(){return Js||(Js=1,Uu=2147483647),Uu}var Xu,js;function o0(){if(js)return Xu;js=1;var t=rt,i=a0();return Xu=function(r){if(r=t(r),r>i)throw new TypeError(r+" exceeds maximum possible timeout");return r},Xu}var Qs;function s0(){if(Qs)return Zs;Qs=1;var t=Au(),i=Fr,r=Pu(),a=Ws(),s=o0(),f=it,l=Function.prototype,h=Math.max,d=Math.min,g=Object.create;return f.maxAge=function(y,b,E){var S,F,P,C;y=s(y),y&&(S=g(null),F=E.async&&f.async||E.promise&&f.promise?"async":"",b.on("set"+F,function(I){S[I]=setTimeout(function(){b.delete(I)},y),typeof S[I].unref=="function"&&S[I].unref(),C&&(C[I]&&C[I]!=="nextTick"&&clearTimeout(C[I]),C[I]=setTimeout(function(){delete C[I]},P),typeof C[I].unref=="function"&&C[I].unref())}),b.on("delete"+F,function(I){clearTimeout(S[I]),delete S[I],C&&(C[I]!=="nextTick"&&clearTimeout(C[I]),delete C[I])}),E.preFetch&&(E.preFetch===!0||isNaN(E.preFetch)?P=.333:P=h(d(Number(E.preFetch),1),0),P&&(C={},P=(1-P)*y,b.on("get"+F,function(I,T,x){C[I]||(C[I]="nextTick",r(function(){var B;C[I]==="nextTick"&&(delete C[I],b.delete(I),E.async&&(T=t(T),T.push(l)),B=b.memoized.apply(x,T),E.promise&&a(B)&&(typeof B.done=="function"?B.done(l,l):B.then(l,l)))}))}))),b.on("clear"+F,function(){i(S,function(I){clearTimeout(I)}),S={},C&&(i(C,function(I){I!=="nextTick"&&clearTimeout(I)}),C={})}))},Zs}var ef={},ku,nf;function f0(){if(nf)return ku;nf=1;var t=rt,i=Object.create,r=Object.prototype.hasOwnProperty;return ku=function(a){var s=0,f=1,l=i(null),h=i(null),d=0,g;return a=t(a),{hit:function(y){var b=h[y],E=++d;if(l[E]=y,h[y]=E,!b)return++s,s<=a?void 0:(y=l[f],g(y),y);if(delete l[b],f===b)for(;!r.call(l,++f););},delete:g=function(y){var b=h[y];if(b&&(delete l[b],delete h[y],--s,f===b)){if(!s){d=0,f=1;return}for(;!r.call(l,++f););}},clear:function(){s=0,f=1,l=i(null),h=i(null),d=0}}},ku}var tf;function l0(){if(tf)return ef;tf=1;var t=rt,i=f0(),r=it;return r.max=function(a,s,f){var l,h,d;a=t(a),a&&(h=i(a),l=f.async&&r.async||f.promise&&r.promise?"async":"",s.on("set"+l,d=function(g){g=h.hit(g),g!==void 0&&s.delete(g)}),s.on("get"+l,d),s.on("delete"+l,h.delete),s.on("clear"+l,h.clear))},ef}var rf={},uf;function c0(){if(uf)return rf;uf=1;var t=ut,i=it,r=Object.create,a=Object.defineProperties;return i.refCounter=function(s,f,l){var h,d;h=r(null),d=l.async&&i.async||l.promise&&i.promise?"async":"",f.on("set"+d,function(g,y){h[g]=y||1}),f.on("get"+d,function(g){++h[g]}),f.on("delete"+d,function(g){delete h[g]}),f.on("clear"+d,function(){h={}}),a(f.memoized,{deleteRef:t(function(){var g=f.get(arguments);return g===null||!h[g]?null:--h[g]?!1:(f.delete(g),!0)}),getRefCount:t(function(){var g=f.get(arguments);return g===null||!h[g]?0:h[g]})})},rf}var h0=Bo,p0=Oo,g0=Up,d0=function(t){var i=h0(arguments[1]),r;return i.normalizer||(r=i.length=p0(i.length,t.length,i.async),r!==0&&(i.primitive?r===!1?i.normalizer=Xp():r>1&&(i.normalizer=kp()(r)):r===!1?i.normalizer=Vp()():r===1?i.normalizer=Zp()():i.normalizer=Jp()(r))),i.async&&jp(),i.promise&&i0(),i.dispose&&u0(),i.maxAge&&s0(),i.max&&l0(),i.refCounter&&c0(),g0(t,i)},m0=we(d0);function af(t,i,r=0,a=t.length-1,s=v0){for(;a>r;){if(a-r>600){const d=a-r+1,g=i-r+1,y=Math.log(d),b=.5*Math.exp(2*y/3),E=.5*Math.sqrt(y*b*(d-b)/d)*(g-d/2<0?-1:1),S=Math.max(r,Math.floor(i-g*b/d+E)),F=Math.min(a,Math.floor(i+(d-g)*b/d+E));af(t,i,S,F,s)}const f=t[i];let l=r,h=a;for(jt(t,r,i),s(t[a],f)>0&&jt(t,r,a);l0;)h--}s(t[r],f)===0?jt(t,r,h):(h++,jt(t,h,a)),h<=i&&(r=h+1),i<=h&&(a=h-1)}}function jt(t,i,r){const a=t[i];t[i]=t[r],t[r]=a}function v0(t,i){return ti?1:0}class y0{constructor(i=9){this._maxEntries=Math.max(4,i),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(i){let r=this.data;const a=[];if(!qr(i,r))return a;const s=this.toBBox,f=[];for(;r;){for(let l=0;l=0&&f[r].children.length>this._maxEntries;)this._split(f,r),r--;this._adjustParentBBoxes(s,f,r)}_split(i,r){const a=i[r],s=a.children.length,f=this._minEntries;this._chooseSplitAxis(a,f,s);const l=this._chooseSplitIndex(a,f,s),h=wt(a.children.splice(l,a.children.length-l));h.height=a.height,h.leaf=a.leaf,At(a,this.toBBox),At(h,this.toBBox),r?i[r-1].children.push(h):this._splitRoot(a,h)}_splitRoot(i,r){this.data=wt([i,r]),this.data.height=i.height+1,this.data.leaf=!1,At(this.data,this.toBBox)}_chooseSplitIndex(i,r,a){let s,f=1/0,l=1/0;for(let h=r;h<=a-r;h++){const d=Qt(i,0,h,this.toBBox),g=Qt(i,h,a,this.toBBox),y=E0(d,g),b=Wu(d)+Wu(g);y=r;g--){const y=i.children[g];er(h,i.leaf?f(y):y),d+=Nr(h)}return d}_adjustParentBBoxes(i,r,a){for(let s=a;s>=0;s--)er(r[s],i)}_condense(i){for(let r=i.length-1,a;r>=0;r--)i[r].children.length===0?r>0?(a=i[r-1].children,a.splice(a.indexOf(i[r]),1)):this.clear():At(i[r],this.toBBox)}}function _0(t,i,r){if(!r)return i.indexOf(t);for(let a=0;a=t.minX&&i.maxY>=t.minY}function wt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function of(t,i,r,a,s){const f=[i,r];for(;f.length;){if(r=f.pop(),i=f.pop(),r-i<=a)continue;const l=i+Math.ceil((r-i)/a/2)*a;af(t,l,i,r,s),f.push(i,l,l,r)}}class x0 extends y0{toBBox(i){return{minX:i.left,minY:i.top,maxX:i.right,maxY:i.bottom}}compareMinX(i,r){return i.left-r.left}compareMinY(i,r){return i.top-r.top}}const S0={screenSize:{width:1,height:1},workerCount:4,workerIndex:0,tileResolution:{width:64,height:64},tileSubdivision:0,refreshInterval:1e3/60,animationDuration:150,debounceInterval:1e3/60,errorColor:"#f44336",backgroundColor:"#ffffff",accentColor:"#333333",dynamicResolution:{intervalMs:500,increment:.5,maxScale:1.5,minScale:1,dtMax:1.5,dtMin:1.1}};var sf={exports:{}};(function(t){var i=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function s(d,g,y){this.fn=d,this.context=g,this.once=y||!1}function f(d,g,y,b,E){if(typeof y!="function")throw new TypeError("The listener must be a function");var S=new s(y,b||d,E),F=r?r+g:g;return d._events[F]?d._events[F].fn?d._events[F]=[d._events[F],S]:d._events[F].push(S):(d._events[F]=S,d._eventsCount++),d}function l(d,g){--d._eventsCount===0?d._events=new a:delete d._events[g]}function h(){this._events=new a,this._eventsCount=0}h.prototype.eventNames=function(){var g=[],y,b;if(this._eventsCount===0)return g;for(b in y=this._events)i.call(y,b)&&g.push(r?b.slice(1):b);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(y)):g},h.prototype.listeners=function(g){var y=r?r+g:g,b=this._events[y];if(!b)return[];if(b.fn)return[b.fn];for(var E=0,S=b.length,F=new Array(S);EObject.prototype.hasOwnProperty.call(t,i),rr=t=>+`${t}`.replace(Ee,"$1"),at=t=>Ee.test(`${t}`)?rr(t):Math.min(+t,100),Ur=t=>(t.length===1&&(t+=t),parseInt(t,16)),Xr=t=>{const i=$(t,0).toString(16).toUpperCase();return i.length===1?`0x0${i}`:`0x${i}`},ot=(t,i=!1)=>!i&&Ee.test(t)?Math.min(255*rr(t)/100,255):Vu.test(t)?(t.length===3&&(t+=t.slice(-1)),i?$(t)/255:$(t)):Math.min(+t,i?1:255),kr=t=>Ee.test(t)?Ie(125*rr(t)/100,-125,125):Ie(+t,-125,125),Yn=t=>Math.min(Ee.test(t)?rr(t)/100:+t,1),cf=t=>[...t].sort().join("").toUpperCase(),$=(t,i=6)=>{const r=Math.pow(10,i);return Math.round(+t*r)/r},Ie=(t,i,r)=>Math.max(i,Math.min(t,r)),ir=t=>{if(typeof t=="string"){const i=t.match(lf),r=+i[1];switch(i[2]){case Ye.RADIANS:t=$(180*r/Math.PI);break;case Ye.TURNS:t=$(360*r);break;case Ye.GRADIANS:t=$(.9*r);break;case Ye.DEGREES:default:t=r}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},H0=(t,i)=>{let r;switch(i){case Ye.RADIANS:r=$((a=>a*Math.PI/180)(t));break;case Ye.TURNS:r=$(t/360);break;case Ye.GRADIANS:r=$(10/9*t);break;case Ye.DEGREES:case Ye.NONE:default:r=t}return r},k=(t,...i)=>{const r=[],a=[],s=[],f=[],l=[],h=[],d=Object.values(Ye),g=Object.values($e),y=Object.values(tr),b={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const E of i)if(typeof E=="string"){if(r.push(E),E.includes(",")){b.legacyCSS++;const S=E.match(M0);new Set(S).size===1&&O0.test(S[0].slice(1))&&b.spacesAfterCommas++}if(E.match(We.HSL)){const S=E.match(We.HSL),F=S[1]||S[5],P=S[8],C=F.match(lf)[2];a.push(C===""?Ye.NONE:C),h.push(Ee.test(P));continue}if(We.RGB.test(E)){const S=E.match(We.RGB),F=S[1]||S[5],P=S[2]||S[6],C=S[3]||S[7],I=S[8];s.push(Ee.test(F)&&Ee.test(P)&&Ee.test(C)),h.push(Ee.test(I));continue}if(We.CIELab.test(E)){const S=E.match(We.CIELab),F=S[1],P=S[2],C=S[3],I=S[4];f.push(Ee.test(F)&&Ee.test(P)&&Ee.test(C)),h.push(Ee.test(I));continue}if(E.match(We.CMYK)){const S=E.match(We.CMYK),F=S[1]||S[6],P=S[2]||S[7],C=S[3]||S[8],I=S[4]||S[9],T=S[10];l.push(Ee.test(F)&&Ee.test(P)&&Ee.test(C)&&Ee.test(I)),E.startsWith("cmyk")&&b.cmykFunction++,h.push(Ee.test(T))}}return{decimals:typeof t.decimals===nr.NUMBER?t.decimals:Bn.decimals,legacyCSS:typeof t.legacyCSS===nr.BOOLEAN?t.legacyCSS:!!(r.length&&b.legacyCSS===r.length)||Bn.legacyCSS,spacesAfterCommas:typeof t.spacesAfterCommas===nr.BOOLEAN?t.spacesAfterCommas:!!(r.length&&b.spacesAfterCommas===r.length)||Bn.spacesAfterCommas,anglesUnit:t.anglesUnit&&d.includes(t.anglesUnit)?t.anglesUnit:new Set(a).size===1?a[0]:Bn.anglesUnit,rgbUnit:t.rgbUnit&&g.includes(t.rgbUnit)?t.rgbUnit:new Set(s).size===1&&s[0]?$e.PERCENT:Bn.rgbUnit,labUnit:t.labUnit&&g.includes(t.labUnit)?t.labUnit:new Set(f).size===1&&f[0]?$e.PERCENT:Bn.labUnit,cmykUnit:t.cmykUnit&&g.includes(t.cmykUnit)?t.cmykUnit:new Set(l).size!==1||l[0]?Bn.cmykUnit:$e.NONE,alphaUnit:t.alphaUnit&&g.includes(t.alphaUnit)?t.alphaUnit:new Set(h).size===1&&h[0]?$e.PERCENT:Bn.alphaUnit,cmykFunction:t.cmykFunction&&y.includes(t.cmykFunction)?t.cmykFunction:l.length&&l.length===b.cmykFunction?tr.CMYK:Bn.cmykFunction}},Zu=t=>`${t}`in ge,hf=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],P0=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],Et=hf.map(t=>t.reduce((i,r)=>i+r,0)),Ju=(t,i,r)=>(r<0&&(r+=6),r>=6&&(r-=6),$(r<1?255*((i-t)*r+t):r<3?255*i:r<4?255*((i-t)*(4-r)+t):255*t)),G0=t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4,D0=t=>t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,pf=(t,i,r,a)=>{const s=[0,0,0],f=[t,i,r];return a.forEach((l,h)=>{l.forEach((d,g)=>{s[h]+=d*f[g]})}),s},Ce=(t,i,r)=>{i/=100;const a=(r/=100)<=.5?r*(i+1):r+i-r*i,s=2*r-a;return{R:Ju(s,a,(t/=60)+2),G:Ju(s,a,t),B:Ju(s,a,t-2)}},xt=(t,i,r,a=1)=>{t/=255,i/=255,r/=255,a=Math.min(a,1);const s=Math.max(t,i,r),f=Math.min(t,i,r),l=s-f;let h=0,d=0;const g=(s+f)/2;if(l!==0){switch(s){case t:h=(i-r)/l%6;break;case i:h=(r-t)/l+2;break;case r:h=(t-i)/l+4}h=$(60*h),h<0&&(h+=360),d=l/(1-Math.abs(2*g-1))}return{H:h,S:$(100*d),L:$(100*g),A:a}},St=(t,i,r)=>{const a=[t/255,i/255,r/255].map(G0),s=pf(a[0],a[1],a[2],hf),f=((l,h,d)=>{const g=E=>E>.008856451679035631?Math.cbrt(E):E/.12841854934601665+.13793103448275862,y=g(l/Et[0]),b=g(h/Et[1]);return[116*b-16,500*(y-b),200*(b-g(d/Et[2]))]})(s[0],s[1],s[2]);return{L:f[0],a:f[1],b:f[2]}},ju=(t,i,r)=>{const a=((f,l,h)=>{const d=E=>E>.20689655172413793?E**3:.12841854934601665*(E-.13793103448275862),g=(f+16)/116,y=l/500,b=h/200;return[Et[0]*d(g+y),Et[1]*d(g),Et[2]*d(g-b)]})(t,i,r),s=pf(a[0],a[1],a[2],P0).map(D0);return{R:Ie(255*s[0],0,255),G:Ie(255*s[1],0,255),B:Ie(255*s[2],0,255)}},Qu=(t,i,r,a)=>({R:$(255*(1-t)*(a=1-a)),G:$(255*(1-i)*a),B:$(255*(1-r)*a)}),gf=(t,i,r)=>{t/=255,i/=255,r/=255;const a=1-Math.max(t,i,r),s=1-a,f=s&&(s-i)/s,l=s&&(s-r)/s;return{C:$(100*(s&&(s-t)/s)),M:$(100*f),Y:$(100*l),K:$(100*a)}},df=(t,i)=>{if(t<0&&(t+=360),t>360&&(t-=360),t===360||t===0)return t;const r=[[0,120],[120,180],[180,240],[240,360]],a=[[0,60],[60,120],[120,240],[240,360]],s=i?a:r;let f=0,l=0,h=0,d=0;return(i?r:a).find((g,y)=>t>=g[0]&&tt?", ":",",ur=(t,i)=>{const r=cf(Object.keys(t));return L0[zu[r]].reduce((a,s,f)=>{const l=t[s];return l!==void 0&&a.push(i(l,f)),a},[])},ar=(t,i)=>t.replace(B0,(r,a)=>`${i[+a-1]}`),Wr=(t,i,r=!1)=>{const{alphaUnit:a,legacyCSS:s,decimals:f}=i;return a!==$e.PERCENT||s&&!r?$(t,f):`${$(100*t,f)}%`},X={[U.HEX]:t=>{const i=ur(t,a=>(s=>{let f=$(s,0).toString(16).toUpperCase();return f.length===1&&(f=`0${f}`),f})($(a))),r=i.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return ar(r,i)},[U.RGB]:(t,i)=>{const{decimals:r,legacyCSS:a,spacesAfterCommas:s,rgbUnit:f}=i,l=ea(s),h=ur(t,(g,y)=>f===$e.PERCENT&&y<3?`${((b,E)=>$(b/255*100,E))(g,r)}%`:y===3?Wr(g,i):$(g,r)),d=a?h.length===4?`rgba({1}${l}{2}${l}{3}${l}{4})`:`rgb({1}${l}{2}${l}{3})`:h.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return ar(d,h)},[U.HSL]:(t,i)=>{const{decimals:r,legacyCSS:a,spacesAfterCommas:s,anglesUnit:f}=i,l=ea(s),h=ur(t,(g,y)=>y===0&&f!==Ye.NONE?`${$(H0(g,f),r)}${f}`:y===3?Wr(g,i):$(g,r)),d=a?h.length===4?`hsla({1}${l}{2}%${l}{3}%${l}{4})`:`hsl({1}${l}{2}%${l}{3}%)`:h.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return ar(d,h)},[U.CIELab]:(t,i)=>{const{decimals:r,labUnit:a}=i,s=ur(t,(l,h)=>{if(h===0){const d=$(at(l),r);return a===$e.PERCENT?`${d}%`:`${d}`}return h<3?a===$e.PERCENT?`${((d,g)=>$(d/125*100,g))(l,r)}%`:$(l,r):Wr(l,i,!0)}),f=s.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return ar(f,s)},[U.CMYK]:(t,i)=>{const{decimals:r,legacyCSS:a,spacesAfterCommas:s,cmykUnit:f,cmykFunction:l}=i,h=ea(s),d=ur(t,(y,b)=>f===$e.PERCENT&&b<4?`${$(y,r)}%`:b===4?Wr(y,i):$(y/100,r)),g=a?d.length===5?`${l}({1}${h}{2}${h}{3}${h}{4}${h}{5})`:`${l}({1}${h}{2}${h}{3}${h}{4})`:d.length===5?`${l}({1} {2} {3} {4} / {5})`:`${l}({1} {2} {3} {4})`;return ar(g,d)}},Le=t=>(typeof t=="string"&&(t=Ee.test(t)?rr(t)/100:+t),isNaN(+t)||t>1?1:$(t)),Ct=(t,i,r)=>i.reduce((a,s)=>[...a,{...t,H:r===ge.ADDITIVE?ir(t.H+s):ir(df(df(t.H,!1)+s,!0))}],[{...t}]),$0=(t,i)=>Ct(t,[30,-30],i),N0=(t,i)=>Ct(t,[180],i),q0=(t,i)=>Ct(t,[150,-150],i),Y0=(t,i)=>Ct(t,[120,-120],i),U0=(t,i)=>Ct(t,[60,-120,180],i),X0=(t,i)=>Ct(t,[90,-90,180],i),be=t=>typeof t=="string"?(i=>{let r;if(Object.keys(U).some(a=>{if(We[a].test(i))return r=a,!0}),!r&&~ff.indexOf(i)&&(r=U.HEX),!r)throw new Error(F0);return r})(t):(i=>{let r,a=!1;const s=cf(Object.keys(i));if(zu[s]&&(r=zu[s]),r&&r===U.RGB){const f=Object.entries(i).some(h=>!Vu.test(`${h[1]}`)),l=Object.entries(i).some(h=>!(Ee.test(`${h[1]}`)||!Vu.test(`${h[1]}`)&&!isNaN(+h[1])&&+h[1]<=255));f&&l&&(a=!0),f||(r=U.HEX)}if(!r||a)throw new Error(T0);return r})(t),k0={[U.HEX](t){const i=(~ff.indexOf(t)?Yr[t]:t).match(We.HEX),r={R:Ur(i[1]||i[5]),G:Ur(i[2]||i[6]),B:Ur(i[3]||i[7])},a=i[4]||i[8];return a!==void 0&&(r.A=Ur(a)/255),r},[U.RGB](t){const i=t.match(We.RGB),r=ot(i[1]||i[5]),a=ot(i[2]||i[6]),s=ot(i[3]||i[7]),f=i[4]||i[8],l={R:Math.min(r,255),G:Math.min(a,255),B:Math.min(s,255)};return f!==void 0&&(l.A=Le(f)),l},[U.HSL](t){const i=t.match(We.HSL),r=ir(i[1]||i[5]),a=at(i[2]||i[6]),s=at(i[3]||i[7]),f=i[4]||i[8],l=Ce(r,a,s);return f!==void 0&&(l.A=Le(f)),l},[U.CIELab](t){const i=t.match(We.CIELab),r=at(i[1]),a=kr(i[2]),s=kr(i[3]),f=i[4],l=ju(r,a,s);return f!==void 0&&(l.A=Le(f)),l},[U.CMYK](t){const i=t.match(We.CMYK),r=Yn(i[1]||i[6]),a=Yn(i[2]||i[7]),s=Yn(i[3]||i[8]),f=Yn(i[4]||i[9]),l=i[5]||i[10],h=Qu(r,a,s,f);return l!==void 0&&(h.A=Le(l)),h}},W0={[U.HEX](t){const i={R:ot(`${t.R}`),G:ot(`${t.G}`),B:ot(`${t.B}`)};return Re(t,"A")&&(i.A=Math.min(ot(`${t.A}`,!0),1)),i},[U.RGB](t){return this.HEX(t)},[U.HSL](t){const i=at(`${t.S}`),r=at(`${t.L}`),a=Ce(ir(t.H),i,r);return Re(t,"A")&&(a.A=Le(t.A)),a},[U.CIELab](t){const i=at(`${t.L}`),r=kr(`${t.a}`),a=kr(`${t.b}`),s=ju(i,r,a);return Re(t,"A")&&(s.A=Le(t.A)),s},[U.CMYK](t){const i=Yn(`${t.C}`),r=Yn(`${t.M}`),a=Yn(`${t.Y}`),s=Yn(`${t.K}`),f=Qu(i,r,a,s);return Re(t,"A")&&(f.A=Le(t.A)),f}},st=(t,i=be(t))=>typeof t=="string"?k0[i](t):W0[i](t),D={[U.HEX]:t=>({R:Xr(t.R),G:Xr(t.G),B:Xr(t.B)}),HEXA(t){const i=D.HEX(t);return i.A=Re(t,"A")?Xr(255*t.A):"0xFF",i},[U.RGB](t,i){const r=K0(t,i);return Re(r,"A")&&delete r.A,r},RGBA(t,i){const r=D.RGB(t,i);return r.A=Re(t,"A")?$(t.A):1,r},[U.HSL](t,i){const r=xt(t.R,t.G,t.B);return delete r.A,na(r,i)},HSLA(t,i){const r=D.HSL(t,i);return r.A=Re(t,"A")?$(t.A,i):1,r},[U.CIELab](t,i){const r=St(t.R,t.G,t.B);return z0(r,i)},CIELabA(t,i){const r=D.CIELab(t,i);return r.A=Re(t,"A")?$(t.A,i):1,r},[U.CMYK]:(t,i)=>V0(gf(t.R,t.G,t.B),i),CMYKA(t,i){const r=D.CMYK(t,i);return r.A=Re(t,"A")?$(t.A,i):1,r}},Kr=(t,i,r,a)=>{const s=be(t),f=typeof t=="string",l=st(t,s),h=typeof t=="string"&&Re(l,"A")||typeof t!="string"&&Re(t,"A"),d=xt(l.R,l.G,l.B,l.A);h||delete d.A;const g=r?d.L/(i+1):(100-d.L)/(i+1),y=Array(i).fill(null).map((b,E)=>({...d,L:d.L+g*(E+1)*(1-2*+r)}));switch(s){case U.HEX:default:return y.map(b=>{const E=Ce(b.H,b.S,b.L);return h&&(E.A=b.A),f?h?X.HEX({...E,A:$(255*E.A)}):X.HEX(E):h?D.HEXA(E):D.HEX(E)});case U.RGB:return y.map(b=>{const E=Ce(b.H,b.S,b.L);return h&&(E.A=b.A),f?X.RGB(E,a):h?D.RGBA(E,a.decimals):D.RGB(E,a.decimals)});case U.HSL:return y.map(b=>f?X.HSL(b,a):h?D.HSLA({...Ce(b.H,b.S,b.L),A:b.A},a.decimals):D.HSL(Ce(b.H,b.S,b.L),a.decimals));case U.CIELab:return y.map(b=>{const E=Ce(b.H,b.S,b.L);return f?X.CIELab(h?D.CIELabA(E,a.decimals):D.CIELab(E,a.decimals),a):h?D.CIELabA({...E,A:b.A},a.decimals):D.CIELab(E,a.decimals)})}},Rt={buildHarmony(t,i,r,a){const s=be(t),f=st(t,s),l=xt(f.R,f.G,f.B,f.A),h=typeof t=="string"&&Re(f,"A")||typeof t!="string"&&Re(t,"A"),d=typeof t=="string";switch(s){case U.HEX:default:return h?this.HEXA(na(l,0),i,r,d):this.HEX(na(l,0),i,r,d);case U.HSL:return h?this.HSLA(l,i,r,d,a):this.HSL(l,i,r,d,a);case U.RGB:return h?this.RGBA(l,i,r,d,a):this.RGB(l,i,r,d,a);case U.CIELab:return h?this.CIELabA(l,i,r,d,a):this.CIELab(l,i,r,d,a)}},[U.HEX]:(t,i,r,a)=>i(t,r).map(s=>a?X.HEX(Ce(s.H,s.S,s.L)):D.HEX(Ce(s.H,s.S,s.L))),HEXA:(t,i,r,a)=>i(t,r).map(s=>a?X.HEX({...Ce(s.H,s.S,s.L),A:255*Le(s.A)}):D.HEXA({...Ce(s.H,s.S,s.L),A:Le(s.A)})),[U.RGB]:(t,i,r,a,s)=>i(t,r).map(f=>a?X.RGB(Ce(f.H,f.S,f.L),s):D.RGB(Ce(f.H,f.S,f.L),s.decimals)),RGBA:(t,i,r,a,s)=>i(t,r).map(f=>a?X.RGB({...Ce(f.H,f.S,f.L),A:Le(f.A)},s):D.RGBA({...Ce(f.H,f.S,f.L),A:Le(f.A)},s.decimals)),[U.HSL]:(t,i,r,a,s)=>i(t,r).map(f=>a?X.HSL({H:f.H,S:f.S,L:f.L},s):D.HSL(Ce(f.H,f.S,f.L),s.decimals)),HSLA:(t,i,r,a,s)=>i(t,r).map(f=>a?X.HSL({...f,A:Le(f.A)},s):D.HSLA({...Ce(f.H,f.S,f.L),A:Le(f.A)},s.decimals)),[U.CIELab]:(t,i,r,a,s)=>i(t,r).map(f=>{const l=Ce(f.H,f.S,f.L);return a?X.CIELab(St(l.R,l.G,l.B),s):D.CIELab(l,s.decimals)}),CIELabA:(t,i,r,a,s)=>i(t,r).map(f=>{const l=Ce(f.H,f.S,f.L);return a?X.CIELab({...St(l.R,l.G,l.B),A:Le(f.A)},s):D.CIELabA({...l,A:Le(f.A)},s.decimals)})},le={mix(t,i){const r=t.map(l=>{const h=be(l);return st(l,h)}),a=i===ge.SUBTRACTIVE?r.map(l=>{const h=((d,g,y)=>{const b=Math.min(d,g,y),E=Math.min(255-d,255-g,255-y),S=d-b,F=g-b,P=y-b,C=Math.min(S,F),I=S-C,T=(F+C)/2,x=(P+F-C)/2,B=Math.max(I,T,x)/Math.max(S,F,P),G=isNaN(B)||B===1/0||B<=0?1:B;return{R:I/G+E,Y:T/G+E,B:x/G+E}})(l.R,l.G,l.B);return Re(l,"A")&&(h.A=l.A),h}):null;function s(l){const h=i===ge.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return l.reduce((d,g)=>{const y=Re(g,"A")?g.A:1,b={R:Math.min(d.R+g.R*y,255),B:Math.min(d.B+g.B*y,255),A:1-(1-y)*(1-d.A)},E="G"in d?d.G:d.Y,S="G"in g?g.G:g.Y;return{...b,...i===ge.ADDITIVE?{G:Math.min(E+S*y,255)}:{Y:Math.min(E+S*y,255)}}},h)}let f;if(i===ge.ADDITIVE)f=s(r);else{const l=s(a);f=((h,d,g)=>{const y=Math.min(h,d,g),b=Math.min(255-h,255-d,255-g),E=h-y,S=d-y,F=g-y,P=Math.min(S,F),C=E+S-P,I=S+P,T=2*(F-P),x=Math.max(C,I,T)/Math.max(E,S,F),B=isNaN(x)||x===1/0||x<=0?1:x;return{R:C/B+b,G:I/B+b,B:T/B+b}})(l.R,l.Y,l.B),f.A=l.A}return{R:$(f.R),G:$(f.G),B:$(f.B),A:Ie(f.A,0,1)}},[U.HEX](t,i,r){const a=this.mix(t,i);return delete a.A,r?X.HEX(a):D.HEX(a)},HEXA(t,i,r){const a=this.mix(t,i);return a.A=r?255*Le(a.A):Le(a.A),r?X.HEX(a):D.HEXA(a)},[U.RGB](t,i,r,a){const s=this.mix(t,i);return delete s.A,r?X.RGB(s,a):D.RGB(s,a.decimals)},RGBA(t,i,r,a){const s=this.mix(t,i);return r?X.RGB(s,a):D.RGBA(s,a.decimals)},[U.HSL](t,i,r,a){const s=this.mix(t,i),f=xt(s.R,s.G,s.B);return delete s.A,delete f.A,r?X.HSL(f,a):D.HSL(s,a.decimals)},HSLA(t,i,r,a){const s=this.mix(t,i),f=xt(s.R,s.G,s.B,s.A);return r?X.HSL(f,a):D.HSLA(s,a.decimals)},[U.CIELab](t,i,r,a){const s=this.mix(t,i),f=St(s.R,s.G,s.B);return delete s.A,r?X.CIELab(f,a):D.CIELabA(s,a.decimals)},CIELabA(t,i,r,a){const s=this.mix(t,i),f=St(s.R,s.G,s.B);return Re(s,"A")&&(f.A=s.A),r?X.CIELab(f,a):D.CIELabA(s,a.decimals)}},K0=(t,i)=>({R:$(t.R,i),G:$(t.G,i),B:$(t.B,i),...Re(t,"A")?{A:$(t.A,i)}:{}}),na=(t,i)=>({H:$(t.H,i),S:$(t.S,i),L:$(t.L,i),...Re(t,"A")?{A:$(t.A,i)}:{}}),z0=(t,i)=>({L:$(t.L,i),a:$(t.a,i),b:$(t.b,i)}),V0=(t,i)=>({C:$(t.C,i),M:$(t.M,i),Y:$(t.Y,i),K:$(t.K,i)}),Oe=(t,i,r,a)=>a(st(t,i),r),me=(t,i,r,a,s)=>(r<1&&(r=5),((l,h,d)=>{const g=d-1,y=(h.R-l.R)/g,b=(h.G-l.G)/g,E=(h.B-l.B)/g,S=Le(l.A),F=(Le(h.A)-S)/g;return Array(d).fill(null).map((P,C)=>C===0?l:C===g?h:{R:$(l.R+y*C),G:$(l.G+b*C),B:$(l.B+E*C),A:$(S+F*C)})})(st(t),st(i),r).map(l=>s(l,a))),ta=(t,i,r,a)=>({[mn.ANALOGOUS]:Rt.buildHarmony(i,$0,r,a),[mn.COMPLEMENTARY]:Rt.buildHarmony(i,N0,r,a),[mn.SPLIT_COMPLEMENTARY]:Rt.buildHarmony(i,q0,r,a),[mn.TRIADIC]:Rt.buildHarmony(i,Y0,r,a),[mn.TETRADIC]:Rt.buildHarmony(i,U0,r,a),[mn.SQUARE]:Rt.buildHarmony(i,X0,r,a)})[t];class It{constructor(i,r={}){this._options=k(r,i),this.rgb=st(i),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...Ce(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...Qu(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...ju(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=xt(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...St(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=gf(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(i={}){return this._options={...this._options,...i},this}setH(i){return this.hsl.H=ir(i),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(i){return this.hsl.S=Ie(i,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(i){return this.hsl.L=Ie(i,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(i){this.rgb.R=Ie(i,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(i){return this.rgb.G=Ie(i,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(i){return this.rgb.B=Ie(i,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(i){return this.lab.L=Ie(i,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(i){return this.lab.a=Ie(i,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(i){return this.lab.b=Ie(i,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(i){return this.hsl.A=this.rgb.A=Ie(i,0,1),this}setC(i){return this.cmyk.C=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(i){return this.cmyk.M=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(i){return this.cmyk.Y=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(i){return this.cmyk.K=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return $(this.hsl.H,this.options.decimals)}get S(){return $(this.hsl.S,this.options.decimals)}get L(){return $(this.hsl.L,this.options.decimals)}get CIEL(){return $(this.lab.L,this.options.decimals)}get CIEa(){return $(this.lab.a,this.options.decimals)}get CIEb(){return $(this.lab.b,this.options.decimals)}get R(){return $(this.rgb.R,this.options.decimals)}get G(){return $(this.rgb.G,this.options.decimals)}get B(){return $(this.rgb.B,this.options.decimals)}get A(){return $(this.hsl.A,this.options.decimals)}get C(){return $(this.cmyk.C,this.options.decimals)}get M(){return $(this.cmyk.M,this.options.decimals)}get Y(){return $(this.cmyk.Y,this.options.decimals)}get K(){return $(this.cmyk.K,this.options.decimals)}get HEXObject(){return D.HEX(this.rgb)}get HEXAObject(){return D.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return X.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return X.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return X.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return X.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return X.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return X.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return X.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return X.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return X.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return X.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(i){const r=be(i);return Oe(i,r,0,D.HEX)}static toHEX(i){return X.HEX(It.toHEXObject(i))}static toHEXAObject(i){const r=be(i);return Oe(i,r,0,D.HEXA)}static toHEXA(i){return X.HEX(It.toHEXAObject(i))}static toRGBObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.RGB)}static toRGB(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.RGB);return X.RGB(f,s)}static toRGBAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.RGBA)}static toRGBA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.RGBA);return X.RGB(f,s)}static toHSLObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.HSL)}static toHSL(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.HSL);return X.HSL(f,s)}static toHSLAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.HSLA)}static toHSLA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.HSLA);return X.HSL(f,s)}static toCIELabObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CIELab)}static toCIELab(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CIELab);return X.CIELab(f,s)}static toCIELabAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CIELabA)}static toCIELabA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CIELabA);return X.CIELab(f,s)}static toCMYKObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CMYK)}static toCMYK(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CMYK);return X.CMYK(f,s)}static toCMYKAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CMYKA)}static toCMYKA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CMYKA);return X.CMYK(f,s)}static getBlendHEXObject(i,r,a=5){return me(i,r,a,0,D.HEX)}static getBlendHEX(i,r,a=5){return It.getBlendHEXObject(i,r,a).map(s=>X.HEX(s))}static getBlendHEXAObject(i,r,a=5){return me(i,r,a,0,D.HEXA)}static getBlendHEXA(i,r,a=5){return It.getBlendHEXAObject(i,r,a).map(s=>X.HEX(s))}static getBlendRGBObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGB):me(i,r,5,a==null?void 0:a.decimals,D.RGB)}static getBlendRGB(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGB).map(f=>X.RGB(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.RGB).map(f=>X.RGB(f,k(a||{},i,r)))}static getBlendRGBAObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGBA):me(i,r,5,a==null?void 0:a.decimals,D.RGBA)}static getBlendRGBA(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGBA).map(f=>X.RGB(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.RGBA).map(f=>X.RGB(f,k(a||{},i,r)))}static getBlendHSLObject(i,r,a,s){return me(i,r,typeof a=="number"?a:5,s==null?void 0:s.decimals,D.HSL)}static getBlendHSL(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.HSL).map(f=>X.HSL(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.HSL).map(f=>X.HSL(f,k(a||{},i,r)))}static getBlendHSLAObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.HSLA):me(i,r,5,a==null?void 0:a.decimals,D.HSLA)}static getBlendHSLA(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.HSLA).map(f=>X.HSL(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.HSLA).map(f=>X.HSL(f,k(a||{},i,r)))}static getBlendCIELabObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELab):me(i,r,5,a==null?void 0:a.decimals,D.CIELab)}static getBlendCIELab(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELab).map(f=>X.CIELab(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.CIELab).map(f=>X.CIELab(f,k(a||{},i,r)))}static getBlendCIELabAObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELabA):me(i,r,5,a==null?void 0:a.decimals,D.CIELabA)}static getBlendCIELabA(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELabA).map(f=>X.CIELab(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.CIELabA).map(f=>X.CIELab(f,k(a||{},i,r)))}static getMixHEXObject(i,r=ge.ADDITIVE){return le.HEX(i,r,!1)}static getMixHEX(i,r=ge.ADDITIVE){return le.HEX(i,r,!0)}static getMixHEXAObject(i,r=ge.ADDITIVE){return le.HEXA(i,r,!1)}static getMixHEXA(i,r=ge.ADDITIVE){return le.HEXA(i,r,!0)}static getMixRGBObject(i,r,a){return typeof r=="string"?le.RGB(i,r,!1,k(a||{},...i)):le.RGB(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixRGB(i,r,a){return typeof r=="string"?le.RGB(i,r,!0,k(a||{},...i)):le.RGB(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixRGBAObject(i,r,a){return typeof r=="string"?le.RGBA(i,r,!1,k(a||{},...i)):le.RGBA(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixRGBA(i,r,a){return typeof r=="string"?le.RGBA(i,r,!0,k(a||{},...i)):le.RGBA(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixHSLObject(i,r,a){return typeof r=="string"?le.HSL(i,r,!1,k(a||{},...i)):le.HSL(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixHSL(i,r,a){return typeof r=="string"?le.HSL(i,r,!0,k(a||{},...i)):le.HSL(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixHSLAObject(i,r,a){return typeof r=="string"?le.HSLA(i,r,!1,k(a||{},...i)):le.HSLA(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixHSLA(i,r,a){return typeof r=="string"?le.HSLA(i,r,!0,k(a||{},...i)):le.HSLA(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixCIELabObject(i,r,a){return typeof r=="string"?le.CIELab(i,r,!1,k(a||{},...i)):le.CIELab(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixCIELab(i,r,a){return typeof r=="string"?le.CIELab(i,r,!0,k(a||{},...i)):le.CIELab(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixCIELabAObject(i,r,a){return typeof r=="string"?le.CIELabA(i,r,!1,k(a||{},...i)):le.CIELabA(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixCIELabA(i,r,a){return typeof r=="string"?le.CIELabA(i,r,!0,k(a||{},...i)):le.CIELabA(i,ge.ADDITIVE,!0,k(r||{},...i))}static getShades(i,r,a){return typeof r=="number"?Kr(i,r,!0,k(a||{},i)):Kr(i,5,!0,k(r||{},i))}static getTints(i,r,a){return typeof r=="number"?Kr(i,r,!1,k(a||{},i)):Kr(i,5,!1,k(r||{},i))}static getHarmony(i,r,a,s){return`${r}`in mn?ta(r,i,Zu(a)?a:ge.ADDITIVE,k(Zu(a)?s||{}:a||{},i)):Zu(r)?ta(mn.COMPLEMENTARY,i,r,k(a||{},i)):ta(mn.COMPLEMENTARY,i,ge.ADDITIVE,k(r||{},i))}}const Z0={current:void 0,parent:void 0,events:void 0,color:{source:2533018,destination:15753874,expanding:16733986,updating:16733986,generating:16771899,closing:11583173,end:15483002},scale:10,fill:"#000000",alpha:1};var Ke=63710088e-1,mf={centimeters:Ke*100,centimetres:Ke*100,degrees:360/(2*Math.PI),feet:Ke*3.28084,inches:Ke*39.37,kilometers:Ke/1e3,kilometres:Ke/1e3,meters:Ke,metres:Ke,miles:Ke/1609.344,millimeters:Ke*1e3,millimetres:Ke*1e3,nauticalmiles:Ke/1852,radians:1,yards:Ke*1.0936};function Lt(t,i,r={}){const a={type:"Feature"};return(r.id===0||r.id)&&(a.id=r.id),r.bbox&&(a.bbox=r.bbox),a.properties=i||{},a.geometry=t,a}function vf(t,i,r={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!bf(t[0])||!bf(t[1]))throw new Error("coordinates must contain numbers");return Lt({type:"Point",coordinates:t},i,r)}function ra(t,i,r={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return Lt({type:"LineString",coordinates:t},i,r)}function yf(t,i="kilometers"){const r=mf[i];if(!r)throw new Error(i+" units is invalid");return t*r}function J0(t,i="kilometers"){const r=mf[i];if(!r)throw new Error(i+" units is invalid");return t/r}function zr(t){return t%360*Math.PI/180}function _f(t,i="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return yf(J0(t,i),r)}function bf(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Vr(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return[...t.geometry.coordinates];if(t.type==="Point")return[...t.coordinates]}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Af(t,i,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||t.type!=="Feature"||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==i)throw new Error("Invalid input to "+r+": must be a "+i+", given "+t.geometry.type)}function j0(t,i,r={}){var a=Vr(t),s=Vr(i),f=zr(s[1]-a[1]),l=zr(s[0]-a[0]),h=zr(a[1]),d=zr(s[1]),g=Math.pow(Math.sin(f/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(h)*Math.cos(d);return yf(2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)),r.units)}function wf(t,i,r){if(t!==null)for(var a,s,f,l,h,d,g,y=0,b=0,E,S=t.type,F=S==="FeatureCollection",P=S==="Feature",C=F?t.features.length:1,I=0;Id||F>g||P>y){h=b,d=a,g=F,y=P,f=0;return}var C=ra([h,b],r.properties);if(i(C,a,s,P,f)===!1)return!1;f++,h=b})===!1)return!1}}})}function tg(t,i,r={}){const a=Vr(t),s=Vr(i);s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0;const f=rg(a,s);return _f(f,"meters",r.units)}function rg(t,i,r){r=r===void 0?Ke:Number(r);const a=r,s=t[1]*Math.PI/180,f=i[1]*Math.PI/180,l=f-s;let h=Math.abs(i[0]-t[0])*Math.PI/180;h>Math.PI&&(h-=2*Math.PI);const d=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),g=Math.abs(d)>1e-11?l/d:Math.cos(s);return Math.sqrt(l*l+g*g*h*h)*a}function ig(t,i,r={}){if(r.method||(r.method="geodesic"),r.units||(r.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=vf(t):t.type==="Point"?t=Lt(t):Af(t,"Point","point"),!i)throw new Error("line is required");Array.isArray(i)?i=ra(i):i.type==="LineString"?i=Lt(i):Af(i,"LineString","line");let a=1/0;const s=t.geometry.coordinates;return ng(i,f=>{const l=f.geometry.coordinates[0],h=f.geometry.coordinates[1],d=ug(s,l,h,r);dnew It(t).setA(i??Z0.alpha).RGBA,sg=(t,i)=>or(t,i);function Un(t,i){return{width:t.width*i.scale.x,height:t.height*i.scale.y,x:t.x*i.scale.x+i.x,y:t.y*i.scale.y+i.y}}const ua={text:{draw(t,i,r){const a=t.label??t.text;if(a){const s=Un(t,{x:t["label-x"]??t.textX??0,y:t["label-y"]??t.textY??0,scale:{x:1,y:1}}),f=Un(s,r);i.font=`${(t["label-size"]??t.fontSize??4)*r.scale.x}px Inter`,i.fillStyle=or(t["label-color"]??t.fontColor??"grey",1),i.fillText(a,f.x,f.y)}},test(t){return{left:-1/0,right:1/0,top:-1/0,bottom:1/0}},narrow(){return!0}},path:{draw(t,i,r){const[a,...s]=t.points;i.beginPath(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=sg(t.fill,t.alpha);const{x:f,y:l,width:h}=Un({...a,width:t["line-width"]??t.lineWidth,height:0},r);i.lineWidth=He(h),i.moveTo(He(f),He(l));for(const d of s){const{x:g,y}=Un({...d,width:0,height:0},r);i.lineTo(He(g),He(y))}i.stroke()},test(t){var r,a,s,f;const i=t["line-width"]??t.lineWidth;return{left:(((r=ue.minBy(t.points,"x"))==null?void 0:r.x)??0-i??0)-1,right:(((a=ue.maxBy(t.points,"x"))==null?void 0:a.x)??0+i??0)+1,top:(((s=ue.minBy(t.points,"y"))==null?void 0:s.y)??0-i??0)-1,bottom:(((f=ue.maxBy(t.points,"y"))==null?void 0:f.y)??0+i??0)+1}},narrow(t,i){return ag(vf([i.x,i.y]),ra(t.points.map(({x:r,y:a})=>[r,a])))<500*t.lineWidth}},rect:{draw(t,i,r){const{x:a,y:s,width:f,height:l}=Un(t,r);i.fillStyle=or(t.fill,t.alpha),i.fillRect(He(a),He(s),He(f)||1,He(l)||1)},test(t){return{left:t.x,right:t.x+t.width,top:t.y,bottom:t.y+t.height}},narrow(){return!0}},polygon:{draw(t,i,r){const[a,...s]=t.points;i.beginPath(),i.fillStyle=or(t.fill,t.alpha);const{x:f,y:l}=Un({...a,width:0,height:0},r);i.moveTo(He(f),He(l));for(const h of s){const{x:d,y:g}=Un({...h,width:0,height:0},r);i.lineTo(He(d),He(g))}i.closePath(),i.fill()},test(t){var i,r,a,s;return{left:((i=ue.minBy(t.points,"x"))==null?void 0:i.x)??0,right:((r=ue.maxBy(t.points,"x"))==null?void 0:r.x)??0,top:((a=ue.minBy(t.points,"y"))==null?void 0:a.y)??0,bottom:((s=ue.maxBy(t.points,"y"))==null?void 0:s.y)??0}},narrow(){return!0}},circle:{draw(t,i,r){i.fillStyle=or(t.fill,t.alpha),i.beginPath();const a=Un({...t,width:t.radius,height:t.radius},r);i.ellipse(He(a.x),He(a.y),He(a.width),He(a.height),0,0,2*og),i.fill()},test(t){return{left:t.x-t.radius,right:t.x+t.radius,top:t.y-t.radius,bottom:t.y+t.radius}},narrow(){return!0}}},fg=t=>new Error(`The component ${t.$} is not supported by this renderer.`);function xf(t,i,r,a){if(t in ua)ua[t].draw(i,r,a);else throw fg(i)}const lg=(t,i,r)=>{xf(t.$,t,i,r),(t.text||t.label)&&xf("text",t,i,r)},cg=({x:t,y:i})=>{const r=Math.abs(t),a=Math.abs(i),s=Math.max(r,a),f=2*s,l=Math.pow(f-1,2);return t==s&&i>-s?l+i-(-s+1):i==s?l+s-t+f-1:t==-s?l+s-i+2*f-1:i==-s?l+t+s+3*f-1:0};var hg={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Sf=hg,pg=gg,Cf={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function gg(t){var i,r=[],a=1,s;if(typeof t=="string")if(t=t.toLowerCase(),Sf[t])r=Sf[t].slice(),s="rgb";else if(t==="transparent")a=0,s="rgb",r=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var f=t.slice(1),l=f.length,h=l<=4;a=1,h?(r=[parseInt(f[0]+f[0],16),parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16)],l===4&&(a=parseInt(f[3]+f[3],16)/255)):(r=[parseInt(f[0]+f[1],16),parseInt(f[2]+f[3],16),parseInt(f[4]+f[5],16)],l===8&&(a=parseInt(f[6]+f[7],16)/255)),r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0),s="rgb"}else if(i=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var d=i[1],g=d==="rgb",f=d.replace(/a$/,"");s=f;var l=f==="cmyk"?4:f==="gray"?1:3;r=i[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(E,S){if(/%$/.test(E))return S===l?parseFloat(E)/100:f==="rgb"?parseFloat(E)*255/100:parseFloat(E);if(f[S]==="h"){if(/deg$/.test(E))return parseFloat(E);if(Cf[E]!==void 0)return Cf[E]}return parseFloat(E)}),d===f&&r.push(1),a=g||r[l]===void 0?1:r[l],r=r.slice(0,l)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(r=t.match(/([0-9]+)/g).map(function(y){return parseFloat(y)}),s=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(r=[t[0],t[1],t[2]],s="rgb",a=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(s="rgb",r=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(s="hsl",r=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),a=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(a/=100)):(s="rgb",r=[t>>>16,(t&65280)>>>8,t&255]);return{space:s,values:r,alpha:a}}var dg={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},mg=dg,vg={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var i=t[0]/360,r=t[1]/100,a=t[2]/100,s,f,l,h,d;if(r===0)return d=a*255,[d,d,d];a<.5?f=a*(1+r):f=a+r-a*r,s=2*a-f,h=[0,0,0];for(var g=0;g<3;g++)l=i+1/3*-(g-1),l<0?l++:l>1&&l--,6*l<1?d=s+(f-s)*6*l:2*l<1?d=f:3*l<2?d=s+(f-s)*(2/3-l)*6:d=s,h[g]=d*255;return h}};mg.hsl=function(t){var i=t[0]/255,r=t[1]/255,a=t[2]/255,s=Math.min(i,r,a),f=Math.max(i,r,a),l=f-s,h,d,g;return f===s?h=0:i===f?h=(r-a)/l:r===f?h=2+(a-i)/l:a===f&&(h=4+(i-r)/l),h=Math.min(h*60,360),h<0&&(h+=360),g=(s+f)/2,f===s?d=0:g<=.5?d=l/(f+s):d=l/(2-f-s),[h,d*100,g*100]};function yg(t,i,r){return t*(1-r)+i*r}var _g=yg,bg=Ag;function Ag(t,i,r){return ir?r:t:ti?i:t}const wg=pg,Eg=vg,xg=_g,Sg=bg;var Cg=Rg;function Rg(t){return t=t.map(function(i){if(i=wg(i),i.space!="rgb"){if(i.space!="hsl")throw"c.spacespace is not supported.";i.values=Eg.rgb(i.values)}return i.values.push(i.alpha),i.values}),function(i,r){r=r||xg,i=Sg(i,0,1);var a=(t.length-1)*i,s=Math.floor(a),f=Math.ceil(a);i=a-s;var l=t[s],h=t[f],d=l.map(function(g,y){return g=r(g,h[y],i),y<3&&(g=Math.round(g)),g});return d[3]===1?"rgb("+d.slice(0,3)+")":"rgba("+d+")"}}var Ig=we(Cg);const Rf=JSON.stringify,{log2:Lg,max:Bg}=Math,If=t=>ue.floor(Lg(t+1));function Mg(t,i){return ue.chain(t).split(" ").reduce((r,a)=>a.length+r.width>i?{text:`${r.text} -${a} `,width:a.length+1}:{text:`${r.text}${a} `,width:r.width+a.length+1},{width:0,text:""}).value().text}function Og({right:t,left:i,bottom:r,top:a},s){const f=Bg(If(t-i),If(r-a))-s,l=2**f,h={left:ue.floor(i/l),right:ue.ceil((t+1)/l),top:ue.floor(a/l),bottom:ue.ceil((r+1)/l)};return{zoom:f,order:l,tiles:ue.shuffle(dh({x:ue.range(h.left,h.right+1),y:ue.range(h.top,h.bottom+1)}).map(d=>{const g=d.x*l,y=d.y*l;return{tile:d,bounds:{left:g-l/2,right:g+l/2,top:y-l/2,bottom:y+l/2}}}))}}const Fg=200,Zr=t=>ue.isNumber(t)&&!isNaN(t);class Tg extends I0{constructor(){super(...arguments);Rn(this,Pe);Rn(this,ze);Rn(this,Bt);Rn(this,Xn);Rn(this,kn);Rn(this,sr);Rn(this,Mt);Rn(this,ft);Rn(this,Ot);dn(this,ze,S0),dn(this,Bt,{bottom:256,top:0,left:0,right:256}),dn(this,Xn,new x0(16)),dn(this,kn,{}),dn(this,sr,0),dn(this,Mt,{}),dn(this,ft,{}),this.loadFont=ue.once(async()=>{try{const r=new FontFace("Inter","local('Inter'), local('Inter UI'), url('/fonts/inter.woff2') format('woff2'), url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format('woff2'), local('-apple-system'), local('BlinkMacSystemFont'), local('Arial'), local('Helvetica'), local('sans-serif')");self.fonts.add(r),await r.load()}catch(r){console.warn(r)}}),dn(this,Ot,ue.once(()=>ue.debounce(()=>this.render(),pe(this,ze).refreshInterval,{leading:!1,trailing:!0}))),this.renderTile=m0((r,a)=>In(this,Pe,gh).call(this,r,a),{normalizer:JSON.stringify,max:Fg})}getView(){return{system:pe(this,Xn),world:pe(this,kn)}}setFrustum(r){dn(this,Bt,r),pe(this,Ot).call(this)()}setTileResolution(r){ue.isEqual(r,pe(this,ze).tileResolution)||(Object.assign(pe(this,ze),{tileResolution:r}),In(this,Pe,Mr).call(this))}add(r,a){const s=ue.map(r,({component:l,meta:h})=>({...ua[l.$].test(l),component:l,meta:ue.pick(h,"sourceLayerIndex","sourceLayerAlpha","sourceLayerDisplayMode"),index:In(this,Pe,lh).call(this)})),f=s.find(l=>!Zr(l.top)||!Zr(l.bottom)||!Zr(l.left)||!Zr(l.right));if(f){pe(this,ft)[a]=`Component '${f.component.$}' is missing properties. Check these: width, height, x, y.`;return}pe(this,Xn).load(s),pe(this,kn)[a]=s,In(this,Pe,Mr).call(this)}remove(r){ue.map(pe(this,kn)[r],a=>{pe(this,Xn).remove(a)}),delete pe(this,kn)[r],delete pe(this,ft)[r],In(this,Pe,Mr).call(this)}setup(r){dn(this,ze,r),In(this,Pe,Mr).call(this)}async render(){await this.loadFont();for(const{tile:r,bounds:a}of Og(pe(this,Bt),pe(this,ze).tileSubdivision).tiles)if(In(this,Pe,ch).call(this,r)){const s=this.renderTile(a,pe(this,ze).tileResolution);s&&this.emit("message",{action:"update",payload:{bounds:a,bitmap:s}},[])}}}ze=new WeakMap,Bt=new WeakMap,Xn=new WeakMap,kn=new WeakMap,sr=new WeakMap,Pe=new WeakSet,lh=function(){return fh(this,sr)._++},Mt=new WeakMap,ft=new WeakMap,Mr=function(){this.renderTile.clear(),pe(this,Ot).call(this)()},Ot=new WeakMap,ch=function({x:r,y:a}){const{workerCount:s,workerIndex:f}=pe(this,ze);return cg({x:r,y:a})%s===f},hh=function(){const{tileResolution:r,tileSubdivision:a}=pe(this,ze);return r.width*2**a/4096},ph=function(r,a=""){const{errorColor:l,backgroundColor:h}=pe(this,ze),d=new OffscreenCanvas(r.width,r.height),g=d.getContext("2d",{alpha:!1}),y=In(this,Pe,hh).call(this);g.fillStyle=Ig([h,l])(.05),g.fillRect(0,0,r.width,r.height),g.font=`${y*64}px Inter, Helvetica, Arial, sans-serif`,g.fillStyle=l;for(const[b,E]of Mg(ue.truncate(a,{length:100}),28).split(` -`).map((...S)=>S))g.fillText(b,y*64,y*64*2+76*y*E);return g.lineWidth=y*.5,g.strokeStyle=l,g.strokeRect(0,0,r.width,r.height),d},gh=function(r,a){try{const s=ue.values(pe(this,ft)).find(ue.identity);if(s)throw new Error(s);const{top:f,right:l,bottom:h,left:d}=r,g={x:a.width/(l-d),y:a.height/(h-f)},y=ue.sortBy(pe(this,Xn).search({minX:d,maxX:l,maxY:h,minY:f}),"index"),b=Rf(ue.map(y,"index")),E=Rf([f,l,h,d,a.width,a.height]),S=pe(this,Mt)[E];if(!S||b!==S.hash){const F=new OffscreenCanvas(a.width,a.height),P=F.getContext("2d",{alpha:!1});P.imageSmoothingEnabled=!1,P.fillStyle=pe(this,ze).backgroundColor,P.fillRect(0,0,a.width,a.height);const C=a.width*.05,I=1;P.fillStyle="rgba(127,127,127,0.36)",P.fillRect((a.width-C)/2,(a.height-I)/2,C,I),P.fillRect((a.width-I)/2,(a.height-C)/2,I,C),ue.chain(y).sortBy(x=>{var B;return-(((B=x.meta)==null?void 0:B.sourceLayerIndex)??0)}).groupBy(x=>{var B;return((B=x.meta)==null?void 0:B.sourceLayerIndex)??0}).forEach(x=>{var ce,Ve,Ft,Jr;const B=new OffscreenCanvas(a.width,a.height),G=B.getContext("2d");for(const{component:aa}of x)lg(aa,G,{scale:g,x:-d*g.x,y:-f*g.y});const W=((Ve=(ce=ue.head(x))==null?void 0:ce.meta)==null?void 0:Ve.sourceLayerAlpha)??1,re=((Jr=(Ft=ue.head(x))==null?void 0:Ft.meta)==null?void 0:Jr.sourceLayerDisplayMode)??"source-over";P.globalCompositeOperation=re,P.globalAlpha=W,P.drawImage(B,0,0)}).value();const T=F.transferToImageBitmap();return pe(this,Mt)[E]={hash:b,tile:T},T}else return S.tile}catch(s){return console.error(s),In(this,Pe,ph).call(this,a,ue.get(s,"message")).transferToImageBitmap()}};const Lf=new Tg;Lf.on("message",(t,i)=>self.postMessage(t,i)),self.onmessage=t=>{const{action:i,payload:r}=t.data;Lf[i](...r)}})(); diff --git a/assets/D2Renderer.worker-D5n7AaL-.js b/assets/D2Renderer.worker-D5n7AaL-.js new file mode 100644 index 0000000..e3d8ab0 --- /dev/null +++ b/assets/D2Renderer.worker-D5n7AaL-.js @@ -0,0 +1,30 @@ +var ah=fe=>{throw TypeError(fe)};var Io=(fe,we,Te)=>we.has(fe)||ah("Cannot "+Te);var pe=(fe,we,Te)=>(Io(fe,we,"read from private field"),Te?Te.call(fe):we.get(fe)),Rn=(fe,we,Te)=>we.has(fe)?ah("Cannot add the same private member more than once"):we instanceof WeakSet?we.add(fe):we.set(fe,Te),dn=(fe,we,Te,Ln)=>(Io(fe,we,"write to private field"),Ln?Ln.call(fe,Te):we.set(fe,Te),Te),In=(fe,we,Te)=>(Io(fe,we,"access private method"),Te);var oh=(fe,we,Te,Ln)=>({set _(ki){dn(fe,we,ki,Te)},get _(){return pe(fe,we,Ln)}});(function(){"use strict";var ze,Bt,Xn,kn,sr,Pe,sh,Mt,ft,Mr,Ot,fh,lh,ch,hh;var fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function we(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Te={},Ln=fe&&fe.__assign||function(){return Ln=Object.assign||function(t){for(var i,r=1,a=arguments.length;r + * 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 + */Or.exports,function(t,i){(function(){var r,a="4.17.21",s=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",h="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",g=500,y="__lodash_placeholder__",b=1,E=2,S=4,F=1,P=2,C=1,I=2,T=4,x=8,B=16,G=32,W=64,re=128,ce=256,Ve=512,Ft=30,Jr="...",ua=800,Tg=16,If=1,Hg=2,Pg=3,lt=1/0,Wn=9007199254740991,Gg=17976931348623157e292,jr=NaN,En=4294967295,Dg=En-1,$g=En>>>1,Ng=[["ary",re],["bind",C],["bindKey",I],["curry",x],["curryRight",B],["flip",Ve],["partial",G],["partialRight",W],["rearg",ce]],Tt="[object Arguments]",Qr="[object Array]",qg="[object AsyncFunction]",fr="[object Boolean]",lr="[object Date]",Yg="[object DOMException]",ei="[object Error]",ni="[object Function]",Lf="[object GeneratorFunction]",vn="[object Map]",cr="[object Number]",Ug="[object Null]",Mn="[object Object]",Bf="[object Promise]",Xg="[object Proxy]",hr="[object RegExp]",yn="[object Set]",pr="[object String]",ti="[object Symbol]",kg="[object Undefined]",gr="[object WeakMap]",Wg="[object WeakSet]",dr="[object ArrayBuffer]",Ht="[object DataView]",aa="[object Float32Array]",oa="[object Float64Array]",sa="[object Int8Array]",fa="[object Int16Array]",la="[object Int32Array]",ca="[object Uint8Array]",ha="[object Uint8ClampedArray]",pa="[object Uint16Array]",ga="[object Uint32Array]",Kg=/\b__p \+= '';/g,zg=/\b(__p \+=) '' \+/g,Vg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mf=/&(?:amp|lt|gt|quot|#39);/g,Of=/[&<>"']/g,Zg=RegExp(Mf.source),Jg=RegExp(Of.source),jg=/<%-([\s\S]+?)%>/g,Qg=/<%([\s\S]+?)%>/g,Ff=/<%=([\s\S]+?)%>/g,ed=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nd=/^\w*$/,td=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,da=/[\\^$.*+?()[\]{}|]/g,rd=RegExp(da.source),ma=/^\s+/,id=/\s/,ud=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ad=/\{\n\/\* \[wrapped with (.+)\] \*/,od=/,? & /,sd=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fd=/[()=,{}\[\]\/\s]/,ld=/\\(\\)?/g,cd=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Tf=/\w*$/,hd=/^[-+]0x[0-9a-f]+$/i,pd=/^0b[01]+$/i,gd=/^\[object .+?Constructor\]$/,dd=/^0o[0-7]+$/i,md=/^(?:0|[1-9]\d*)$/,vd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ri=/($^)/,yd=/['\n\r\u2028\u2029\\]/g,ii="\\ud800-\\udfff",_d="\\u0300-\\u036f",bd="\\ufe20-\\ufe2f",Ad="\\u20d0-\\u20ff",Hf=_d+bd+Ad,Pf="\\u2700-\\u27bf",Gf="a-z\\xdf-\\xf6\\xf8-\\xff",wd="\\xac\\xb1\\xd7\\xf7",Ed="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",xd="\\u2000-\\u206f",Sd=" \\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",Df="A-Z\\xc0-\\xd6\\xd8-\\xde",$f="\\ufe0e\\ufe0f",Nf=wd+Ed+xd+Sd,va="['’]",Cd="["+ii+"]",qf="["+Nf+"]",ui="["+Hf+"]",Yf="\\d+",Rd="["+Pf+"]",Uf="["+Gf+"]",Xf="[^"+ii+Nf+Yf+Pf+Gf+Df+"]",ya="\\ud83c[\\udffb-\\udfff]",Id="(?:"+ui+"|"+ya+")",kf="[^"+ii+"]",_a="(?:\\ud83c[\\udde6-\\uddff]){2}",ba="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+Df+"]",Wf="\\u200d",Kf="(?:"+Uf+"|"+Xf+")",Ld="(?:"+Pt+"|"+Xf+")",zf="(?:"+va+"(?:d|ll|m|re|s|t|ve))?",Vf="(?:"+va+"(?:D|LL|M|RE|S|T|VE))?",Zf=Id+"?",Jf="["+$f+"]?",Bd="(?:"+Wf+"(?:"+[kf,_a,ba].join("|")+")"+Jf+Zf+")*",Md="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Od="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",jf=Jf+Zf+Bd,Fd="(?:"+[Rd,_a,ba].join("|")+")"+jf,Td="(?:"+[kf+ui+"?",ui,_a,ba,Cd].join("|")+")",Hd=RegExp(va,"g"),Pd=RegExp(ui,"g"),Aa=RegExp(ya+"(?="+ya+")|"+Td+jf,"g"),Gd=RegExp([Pt+"?"+Uf+"+"+zf+"(?="+[qf,Pt,"$"].join("|")+")",Ld+"+"+Vf+"(?="+[qf,Pt+Kf,"$"].join("|")+")",Pt+"?"+Kf+"+"+zf,Pt+"+"+Vf,Od,Md,Yf,Fd].join("|"),"g"),Dd=RegExp("["+Wf+ii+Hf+$f+"]"),$d=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nd=["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"],qd=-1,ve={};ve[aa]=ve[oa]=ve[sa]=ve[fa]=ve[la]=ve[ca]=ve[ha]=ve[pa]=ve[ga]=!0,ve[Tt]=ve[Qr]=ve[dr]=ve[fr]=ve[Ht]=ve[lr]=ve[ei]=ve[ni]=ve[vn]=ve[cr]=ve[Mn]=ve[hr]=ve[yn]=ve[pr]=ve[gr]=!1;var de={};de[Tt]=de[Qr]=de[dr]=de[Ht]=de[fr]=de[lr]=de[aa]=de[oa]=de[sa]=de[fa]=de[la]=de[vn]=de[cr]=de[Mn]=de[hr]=de[yn]=de[pr]=de[ti]=de[ca]=de[ha]=de[pa]=de[ga]=!0,de[ei]=de[ni]=de[gr]=!1;var Yd={À:"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"},Ud={"&":"&","<":"<",">":">",'"':""","'":"'"},Xd={"&":"&","<":"<",">":">",""":'"',"'":"'"},kd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wd=parseFloat,Kd=parseInt,Qf=typeof fe=="object"&&fe&&fe.Object===Object&&fe,zd=typeof self=="object"&&self&&self.Object===Object&&self,Ge=Qf||zd||Function("return this")(),wa=i&&!i.nodeType&&i,ct=wa&&!0&&t&&!t.nodeType&&t,el=ct&&ct.exports===wa,Ea=el&&Qf.process,on=function(){try{var A=ct&&ct.require&&ct.require("util").types;return A||Ea&&Ea.binding&&Ea.binding("util")}catch{}}(),nl=on&&on.isArrayBuffer,tl=on&&on.isDate,rl=on&&on.isMap,il=on&&on.isRegExp,ul=on&&on.isSet,al=on&&on.isTypedArray;function en(A,L,R){switch(R.length){case 0:return A.call(L);case 1:return A.call(L,R[0]);case 2:return A.call(L,R[0],R[1]);case 3:return A.call(L,R[0],R[1],R[2])}return A.apply(L,R)}function Vd(A,L,R,q){for(var Z=-1,ae=A==null?0:A.length;++Z-1}function xa(A,L,R){for(var q=-1,Z=A==null?0:A.length;++q-1;);return R}function gl(A,L){for(var R=A.length;R--&&Gt(L,A[R],0)>-1;);return R}function i1(A,L){for(var R=A.length,q=0;R--;)A[R]===L&&++q;return q}var u1=Ia(Yd),a1=Ia(Ud);function o1(A){return"\\"+kd[A]}function s1(A,L){return A==null?r:A[L]}function Dt(A){return Dd.test(A)}function f1(A){return $d.test(A)}function l1(A){for(var L,R=[];!(L=A.next()).done;)R.push(L.value);return R}function Oa(A){var L=-1,R=Array(A.size);return A.forEach(function(q,Z){R[++L]=[Z,q]}),R}function dl(A,L){return function(R){return A(L(R))}}function Vn(A,L){for(var R=-1,q=A.length,Z=0,ae=[];++R-1}function J1(e,n){var u=this.__data__,o=Ei(u,e);return o<0?(++this.size,u.push([e,n])):u[o][1]=n,this}On.prototype.clear=K1,On.prototype.delete=z1,On.prototype.get=V1,On.prototype.has=Z1,On.prototype.set=J1;function Fn(e){var n=-1,u=e==null?0:e.length;for(this.clear();++n=n?e:n)),e}function cn(e,n,u,o,c,m){var v,_=n&b,w=n&E,M=n&S;if(u&&(v=c?u(e,o,c,m):u(e)),v!==r)return v;if(!_e(e))return e;var O=J(e);if(O){if(v=nv(e),!_)return Ze(e,v)}else{var H=qe(e),N=H==ni||H==Lf;if(nt(e))return Jl(e,_);if(H==Mn||H==Tt||N&&!c){if(v=w||N?{}:mc(e),!_)return w?Xm(e,pm(v,e)):Um(e,Rl(v,e))}else{if(!de[H])return c?e:{};v=tv(e,H,_)}}m||(m=new bn);var Y=m.get(e);if(Y)return Y;m.set(e,v),kc(e)?e.forEach(function(V){v.add(cn(V,n,u,V,e,m))}):Uc(e)&&e.forEach(function(V,ne){v.set(ne,cn(V,n,u,ne,e,m))});var z=M?w?io:ro:w?je:Fe,Q=O?r:z(e);return sn(Q||e,function(V,ne){Q&&(ne=V,V=e[ne]),wr(v,ne,cn(V,n,u,ne,e,m))}),v}function gm(e){var n=Fe(e);return function(u){return Il(u,e,n)}}function Il(e,n,u){var o=u.length;if(e==null)return!o;for(e=he(e);o--;){var c=u[o],m=n[c],v=e[c];if(v===r&&!(c in e)||!m(v))return!1}return!0}function Ll(e,n,u){if(typeof e!="function")throw new fn(l);return Lr(function(){e.apply(r,u)},n)}function Er(e,n,u,o){var c=-1,m=ai,v=!0,_=e.length,w=[],M=n.length;if(!_)return w;u&&(n=ye(n,nn(u))),o?(m=xa,v=!1):n.length>=s&&(m=mr,v=!1,n=new gt(n));e:for(;++c<_;){var O=e[c],H=u==null?O:u(O);if(O=o||O!==0?O:0,v&&H===H){for(var N=M;N--;)if(n[N]===H)continue e;w.push(O)}else m(n,H,o)||w.push(O)}return w}var Jn=tc(xn),Bl=tc(Na,!0);function dm(e,n){var u=!0;return Jn(e,function(o,c,m){return u=!!n(o,c,m),u}),u}function xi(e,n,u){for(var o=-1,c=e.length;++oc?0:c+u),o=o===r||o>c?c:j(o),o<0&&(o+=c),o=u>o?0:Kc(o);u0&&u(_)?n>1?De(_,n-1,u,o,c):zn(c,_):o||(c[c.length]=_)}return c}var $a=rc(),Ol=rc(!0);function xn(e,n){return e&&$a(e,n,Fe)}function Na(e,n){return e&&Ol(e,n,Fe)}function Si(e,n){return Kn(n,function(u){return Dn(e[u])})}function mt(e,n){n=Qn(n,e);for(var u=0,o=n.length;e!=null&&un}function vm(e,n){return e!=null&&se.call(e,n)}function ym(e,n){return e!=null&&n in he(e)}function _m(e,n,u){return e>=Ne(n,u)&&e=120&&O.length>=120)?new gt(v&&O):r}O=e[0];var H=-1,N=_[0];e:for(;++H-1;)_!==e&&mi.call(_,w,1),mi.call(e,w,1);return e}function Ul(e,n){for(var u=e?n.length:0,o=u-1;u--;){var c=n[u];if(u==o||c!==m){var m=c;Gn(c)?mi.call(e,c,1):Za(e,c)}}return e}function Ka(e,n){return e+_i(El()*(n-e+1))}function Om(e,n,u,o){for(var c=-1,m=Me(yi((n-e)/(u||1)),0),v=R(m);m--;)v[o?m:++c]=e,e+=u;return v}function za(e,n){var u="";if(!e||n<1||n>Wn)return u;do n%2&&(u+=e),n=_i(n/2),n&&(e+=e);while(n);return u}function ee(e,n){return co(_c(e,n,Qe),e+"")}function Fm(e){return Cl(Vt(e))}function Tm(e,n){var u=Vt(e);return Pi(u,dt(n,0,u.length))}function Cr(e,n,u,o){if(!_e(e))return e;n=Qn(n,e);for(var c=-1,m=n.length,v=m-1,_=e;_!=null&&++cc?0:c+n),u=u>c?c:u,u<0&&(u+=c),c=n>u?0:u-n>>>0,n>>>=0;for(var m=R(c);++o>>1,v=e[m];v!==null&&!rn(v)&&(u?v<=n:v=s){var M=n?null:zm(e);if(M)return si(M);v=!1,c=mr,w=new gt}else w=n?[]:_;e:for(;++o=o?e:hn(e,n,u)}var Zl=S1||function(e){return Ge.clearTimeout(e)};function Jl(e,n){if(n)return e.slice();var u=e.length,o=yl?yl(u):new e.constructor(u);return e.copy(o),o}function eo(e){var n=new e.constructor(e.byteLength);return new gi(n).set(new gi(e)),n}function $m(e,n){var u=n?eo(e.buffer):e.buffer;return new e.constructor(u,e.byteOffset,e.byteLength)}function Nm(e){var n=new e.constructor(e.source,Tf.exec(e));return n.lastIndex=e.lastIndex,n}function qm(e){return Ar?he(Ar.call(e)):{}}function jl(e,n){var u=n?eo(e.buffer):e.buffer;return new e.constructor(u,e.byteOffset,e.length)}function Ql(e,n){if(e!==n){var u=e!==r,o=e===null,c=e===e,m=rn(e),v=n!==r,_=n===null,w=n===n,M=rn(n);if(!_&&!M&&!m&&e>n||m&&v&&w&&!_&&!M||o&&v&&w||!u&&w||!c)return 1;if(!o&&!m&&!M&&e=_)return w;var M=u[o];return w*(M=="desc"?-1:1)}}return e.index-n.index}function ec(e,n,u,o){for(var c=-1,m=e.length,v=u.length,_=-1,w=n.length,M=Me(m-v,0),O=R(w+M),H=!o;++_1?u[c-1]:r,v=c>2?u[2]:r;for(m=e.length>3&&typeof m=="function"?(c--,m):r,v&&Xe(u[0],u[1],v)&&(m=c<3?r:m,c=1),n=he(n);++o-1?c[m?n[v]:v]:r}}function ac(e){return Pn(function(n){var u=n.length,o=u,c=ln.prototype.thru;for(e&&n.reverse();o--;){var m=n[o];if(typeof m!="function")throw new fn(l);if(c&&!v&&Ti(m)=="wrapper")var v=new ln([],!0)}for(o=v?o:u;++o1&&ie.reverse(),O&&w_))return!1;var M=m.get(e),O=m.get(n);if(M&&O)return M==n&&O==e;var H=-1,N=!0,Y=u&P?new gt:r;for(m.set(e,n),m.set(n,e);++H<_;){var z=e[H],Q=n[H];if(o)var V=v?o(Q,z,H,n,e,m):o(z,Q,H,e,n,m);if(V!==r){if(V)continue;N=!1;break}if(Y){if(!Ca(n,function(ne,ie){if(!mr(Y,ie)&&(z===ne||c(z,ne,u,o,m)))return Y.push(ie)})){N=!1;break}}else if(!(z===Q||c(z,Q,u,o,m))){N=!1;break}}return m.delete(e),m.delete(n),N}function Zm(e,n,u,o,c,m,v){switch(u){case Ht:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case dr:return!(e.byteLength!=n.byteLength||!m(new gi(e),new gi(n)));case fr:case lr:case cr:return An(+e,+n);case ei:return e.name==n.name&&e.message==n.message;case hr:case pr:return e==n+"";case vn:var _=Oa;case yn:var w=o&F;if(_||(_=si),e.size!=n.size&&!w)return!1;var M=v.get(e);if(M)return M==n;o|=P,v.set(e,n);var O=pc(_(e),_(n),o,c,m,v);return v.delete(e),O;case ti:if(Ar)return Ar.call(e)==Ar.call(n)}return!1}function Jm(e,n,u,o,c,m){var v=u&F,_=ro(e),w=_.length,M=ro(n),O=M.length;if(w!=O&&!v)return!1;for(var H=w;H--;){var N=_[H];if(!(v?N in n:se.call(n,N)))return!1}var Y=m.get(e),z=m.get(n);if(Y&&z)return Y==n&&z==e;var Q=!0;m.set(e,n),m.set(n,e);for(var V=v;++H1?"& ":"")+n[o],n=n.join(u>2?", ":" "),e.replace(ud,`{ +/* [wrapped with `+n+`] */ +`)}function iv(e){return J(e)||_t(e)||!!(Al&&e&&e[Al])}function Gn(e,n){var u=typeof e;return n=n??Wn,!!n&&(u=="number"||u!="symbol"&&md.test(e))&&e>-1&&e%1==0&&e0){if(++n>=ua)return arguments[0]}else n=0;return e.apply(r,arguments)}}function Pi(e,n){var u=-1,o=e.length,c=o-1;for(n=n===r?o:n;++u1?e[n-1]:r;return u=typeof u=="function"?(e.pop(),u):r,Mc(e,u)});function Oc(e){var n=p(e);return n.__chain__=!0,n}function dy(e,n){return n(e),e}function Gi(e,n){return n(e)}var my=Pn(function(e){var n=e.length,u=n?e[0]:0,o=this.__wrapped__,c=function(m){return Da(m,e)};return n>1||this.__actions__.length||!(o instanceof te)||!Gn(u)?this.thru(c):(o=o.slice(u,+u+(n?1:0)),o.__actions__.push({func:Gi,args:[c],thisArg:r}),new ln(o,this.__chain__).thru(function(m){return n&&!m.length&&m.push(r),m}))});function vy(){return Oc(this)}function yy(){return new ln(this.value(),this.__chain__)}function _y(){this.__values__===r&&(this.__values__=Wc(this.value()));var e=this.__index__>=this.__values__.length,n=e?r:this.__values__[this.__index__++];return{done:e,value:n}}function by(){return this}function Ay(e){for(var n,u=this;u instanceof wi;){var o=Sc(u);o.__index__=0,o.__values__=r,n?c.__wrapped__=o:n=o;var c=o;u=u.__wrapped__}return c.__wrapped__=e,n}function wy(){var e=this.__wrapped__;if(e instanceof te){var n=e;return this.__actions__.length&&(n=new te(this)),n=n.reverse(),n.__actions__.push({func:Gi,args:[ho],thisArg:r}),new ln(n,this.__chain__)}return this.thru(ho)}function Ey(){return zl(this.__wrapped__,this.__actions__)}var xy=Li(function(e,n,u){se.call(e,u)?++e[u]:Tn(e,u,1)});function Sy(e,n,u){var o=J(e)?ol:dm;return u&&Xe(e,n,u)&&(n=r),o(e,K(n,3))}function Cy(e,n){var u=J(e)?Kn:Ml;return u(e,K(n,3))}var Ry=uc(Cc),Iy=uc(Rc);function Ly(e,n){return De(Di(e,n),1)}function By(e,n){return De(Di(e,n),lt)}function My(e,n,u){return u=u===r?1:j(u),De(Di(e,n),u)}function Fc(e,n){var u=J(e)?sn:Jn;return u(e,K(n,3))}function Tc(e,n){var u=J(e)?Zd:Bl;return u(e,K(n,3))}var Oy=Li(function(e,n,u){se.call(e,u)?e[u].push(n):Tn(e,u,[n])});function Fy(e,n,u,o){e=Je(e)?e:Vt(e),u=u&&!o?j(u):0;var c=e.length;return u<0&&(u=Me(c+u,0)),Ui(e)?u<=c&&e.indexOf(n,u)>-1:!!c&&Gt(e,n,u)>-1}var Ty=ee(function(e,n,u){var o=-1,c=typeof n=="function",m=Je(e)?R(e.length):[];return Jn(e,function(v){m[++o]=c?en(n,v,u):xr(v,n,u)}),m}),Hy=Li(function(e,n,u){Tn(e,u,n)});function Di(e,n){var u=J(e)?ye:Gl;return u(e,K(n,3))}function Py(e,n,u,o){return e==null?[]:(J(n)||(n=n==null?[]:[n]),u=o?r:u,J(u)||(u=u==null?[]:[u]),ql(e,n,u))}var Gy=Li(function(e,n,u){e[u?0:1].push(n)},function(){return[[],[]]});function Dy(e,n,u){var o=J(e)?Sa:cl,c=arguments.length<3;return o(e,K(n,4),u,c,Jn)}function $y(e,n,u){var o=J(e)?Jd:cl,c=arguments.length<3;return o(e,K(n,4),u,c,Bl)}function Ny(e,n){var u=J(e)?Kn:Ml;return u(e,qi(K(n,3)))}function qy(e){var n=J(e)?Cl:Fm;return n(e)}function Yy(e,n,u){(u?Xe(e,n,u):n===r)?n=1:n=j(n);var o=J(e)?lm:Tm;return o(e,n)}function Uy(e){var n=J(e)?cm:Pm;return n(e)}function Xy(e){if(e==null)return 0;if(Je(e))return Ui(e)?$t(e):e.length;var n=qe(e);return n==vn||n==yn?e.size:Xa(e).length}function ky(e,n,u){var o=J(e)?Ca:Gm;return u&&Xe(e,n,u)&&(n=r),o(e,K(n,3))}var Wy=ee(function(e,n){if(e==null)return[];var u=n.length;return u>1&&Xe(e,n[0],n[1])?n=[]:u>2&&Xe(n[0],n[1],n[2])&&(n=[n[0]]),ql(e,De(n,1),[])}),$i=C1||function(){return Ge.Date.now()};function Ky(e,n){if(typeof n!="function")throw new fn(l);return e=j(e),function(){if(--e<1)return n.apply(this,arguments)}}function Hc(e,n,u){return n=u?r:n,n=e&&n==null?e.length:n,Hn(e,re,r,r,r,r,n)}function Pc(e,n){var u;if(typeof n!="function")throw new fn(l);return e=j(e),function(){return--e>0&&(u=n.apply(this,arguments)),e<=1&&(n=r),u}}var go=ee(function(e,n,u){var o=C;if(u.length){var c=Vn(u,Kt(go));o|=G}return Hn(e,o,n,u,c)}),Gc=ee(function(e,n,u){var o=C|I;if(u.length){var c=Vn(u,Kt(Gc));o|=G}return Hn(n,o,e,u,c)});function Dc(e,n,u){n=u?r:n;var o=Hn(e,x,r,r,r,r,r,n);return o.placeholder=Dc.placeholder,o}function $c(e,n,u){n=u?r:n;var o=Hn(e,B,r,r,r,r,r,n);return o.placeholder=$c.placeholder,o}function Nc(e,n,u){var o,c,m,v,_,w,M=0,O=!1,H=!1,N=!0;if(typeof e!="function")throw new fn(l);n=gn(n)||0,_e(u)&&(O=!!u.leading,H="maxWait"in u,m=H?Me(gn(u.maxWait)||0,n):m,N="trailing"in u?!!u.trailing:N);function Y(Se){var wn=o,Nn=c;return o=c=r,M=Se,v=e.apply(Nn,wn),v}function z(Se){return M=Se,_=Lr(ne,n),O?Y(Se):v}function Q(Se){var wn=Se-w,Nn=Se-M,uh=n-wn;return H?Ne(uh,m-Nn):uh}function V(Se){var wn=Se-w,Nn=Se-M;return w===r||wn>=n||wn<0||H&&Nn>=m}function ne(){var Se=$i();if(V(Se))return ie(Se);_=Lr(ne,Q(Se))}function ie(Se){return _=r,N&&o?Y(Se):(o=c=r,v)}function un(){_!==r&&Zl(_),M=0,o=w=c=_=r}function ke(){return _===r?v:ie($i())}function an(){var Se=$i(),wn=V(Se);if(o=arguments,c=this,w=Se,wn){if(_===r)return z(w);if(H)return Zl(_),_=Lr(ne,n),Y(w)}return _===r&&(_=Lr(ne,n)),v}return an.cancel=un,an.flush=ke,an}var zy=ee(function(e,n){return Ll(e,1,n)}),Vy=ee(function(e,n,u){return Ll(e,gn(n)||0,u)});function Zy(e){return Hn(e,Ve)}function Ni(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new fn(l);var u=function(){var o=arguments,c=n?n.apply(this,o):o[0],m=u.cache;if(m.has(c))return m.get(c);var v=e.apply(this,o);return u.cache=m.set(c,v)||m,v};return u.cache=new(Ni.Cache||Fn),u}Ni.Cache=Fn;function qi(e){if(typeof e!="function")throw new fn(l);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function Jy(e){return Pc(2,e)}var jy=Dm(function(e,n){n=n.length==1&&J(n[0])?ye(n[0],nn(K())):ye(De(n,1),nn(K()));var u=n.length;return ee(function(o){for(var c=-1,m=Ne(o.length,u);++c=n}),_t=Tl(function(){return arguments}())?Tl:function(e){return Ae(e)&&se.call(e,"callee")&&!bl.call(e,"callee")},J=R.isArray,p_=nl?nn(nl):Am;function Je(e){return e!=null&&Yi(e.length)&&!Dn(e)}function xe(e){return Ae(e)&&Je(e)}function g_(e){return e===!0||e===!1||Ae(e)&&Ue(e)==fr}var nt=I1||Ro,d_=tl?nn(tl):wm;function m_(e){return Ae(e)&&e.nodeType===1&&!Br(e)}function v_(e){if(e==null)return!0;if(Je(e)&&(J(e)||typeof e=="string"||typeof e.splice=="function"||nt(e)||zt(e)||_t(e)))return!e.length;var n=qe(e);if(n==vn||n==yn)return!e.size;if(Ir(e))return!Xa(e).length;for(var u in e)if(se.call(e,u))return!1;return!0}function y_(e,n){return Sr(e,n)}function __(e,n,u){u=typeof u=="function"?u:r;var o=u?u(e,n):r;return o===r?Sr(e,n,r,u):!!o}function vo(e){if(!Ae(e))return!1;var n=Ue(e);return n==ei||n==Yg||typeof e.message=="string"&&typeof e.name=="string"&&!Br(e)}function b_(e){return typeof e=="number"&&wl(e)}function Dn(e){if(!_e(e))return!1;var n=Ue(e);return n==ni||n==Lf||n==qg||n==Xg}function Yc(e){return typeof e=="number"&&e==j(e)}function Yi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Wn}function _e(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function Ae(e){return e!=null&&typeof e=="object"}var Uc=rl?nn(rl):xm;function A_(e,n){return e===n||Ua(e,n,ao(n))}function w_(e,n,u){return u=typeof u=="function"?u:r,Ua(e,n,ao(n),u)}function E_(e){return Xc(e)&&e!=+e}function x_(e){if(ov(e))throw new Z(f);return Hl(e)}function S_(e){return e===null}function C_(e){return e==null}function Xc(e){return typeof e=="number"||Ae(e)&&Ue(e)==cr}function Br(e){if(!Ae(e)||Ue(e)!=Mn)return!1;var n=di(e);if(n===null)return!0;var u=se.call(n,"constructor")&&n.constructor;return typeof u=="function"&&u instanceof u&&ci.call(u)==w1}var yo=il?nn(il):Sm;function R_(e){return Yc(e)&&e>=-Wn&&e<=Wn}var kc=ul?nn(ul):Cm;function Ui(e){return typeof e=="string"||!J(e)&&Ae(e)&&Ue(e)==pr}function rn(e){return typeof e=="symbol"||Ae(e)&&Ue(e)==ti}var zt=al?nn(al):Rm;function I_(e){return e===r}function L_(e){return Ae(e)&&qe(e)==gr}function B_(e){return Ae(e)&&Ue(e)==Wg}var M_=Fi(ka),O_=Fi(function(e,n){return e<=n});function Wc(e){if(!e)return[];if(Je(e))return Ui(e)?_n(e):Ze(e);if(vr&&e[vr])return l1(e[vr]());var n=qe(e),u=n==vn?Oa:n==yn?si:Vt;return u(e)}function $n(e){if(!e)return e===0?e:0;if(e=gn(e),e===lt||e===-lt){var n=e<0?-1:1;return n*Gg}return e===e?e:0}function j(e){var n=$n(e),u=n%1;return n===n?u?n-u:n:0}function Kc(e){return e?dt(j(e),0,En):0}function gn(e){if(typeof e=="number")return e;if(rn(e))return jr;if(_e(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=_e(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=hl(e);var u=pd.test(e);return u||dd.test(e)?Kd(e.slice(2),u?2:8):hd.test(e)?jr:+e}function zc(e){return Sn(e,je(e))}function F_(e){return e?dt(j(e),-Wn,Wn):e===0?e:0}function oe(e){return e==null?"":tn(e)}var T_=kt(function(e,n){if(Ir(n)||Je(n)){Sn(n,Fe(n),e);return}for(var u in n)se.call(n,u)&&wr(e,u,n[u])}),Vc=kt(function(e,n){Sn(n,je(n),e)}),Xi=kt(function(e,n,u,o){Sn(n,je(n),e,o)}),H_=kt(function(e,n,u,o){Sn(n,Fe(n),e,o)}),P_=Pn(Da);function G_(e,n){var u=Xt(e);return n==null?u:Rl(u,n)}var D_=ee(function(e,n){e=he(e);var u=-1,o=n.length,c=o>2?n[2]:r;for(c&&Xe(n[0],n[1],c)&&(o=1);++u1),m}),Sn(e,io(e),u),o&&(u=cn(u,b|E|S,Vm));for(var c=n.length;c--;)Za(u,n[c]);return u});function tb(e,n){return Jc(e,qi(K(n)))}var rb=Pn(function(e,n){return e==null?{}:Bm(e,n)});function Jc(e,n){if(e==null)return{};var u=ye(io(e),function(o){return[o]});return n=K(n),Yl(e,u,function(o,c){return n(o,c[0])})}function ib(e,n,u){n=Qn(n,e);var o=-1,c=n.length;for(c||(c=1,e=r);++on){var o=e;e=n,n=o}if(u||e%1||n%1){var c=El();return Ne(e+c*(n-e+Wd("1e-"+((c+"").length-1))),n)}return Ka(e,n)}var db=Wt(function(e,n,u){return n=n.toLowerCase(),e+(u?eh(n):n)});function eh(e){return Ao(oe(e).toLowerCase())}function nh(e){return e=oe(e),e&&e.replace(vd,u1).replace(Pd,"")}function mb(e,n,u){e=oe(e),n=tn(n);var o=e.length;u=u===r?o:dt(j(u),0,o);var c=u;return u-=n.length,u>=0&&e.slice(u,c)==n}function vb(e){return e=oe(e),e&&Jg.test(e)?e.replace(Of,a1):e}function yb(e){return e=oe(e),e&&rd.test(e)?e.replace(da,"\\$&"):e}var _b=Wt(function(e,n,u){return e+(u?"-":"")+n.toLowerCase()}),bb=Wt(function(e,n,u){return e+(u?" ":"")+n.toLowerCase()}),Ab=ic("toLowerCase");function wb(e,n,u){e=oe(e),n=j(n);var o=n?$t(e):0;if(!n||o>=n)return e;var c=(n-o)/2;return Oi(_i(c),u)+e+Oi(yi(c),u)}function Eb(e,n,u){e=oe(e),n=j(n);var o=n?$t(e):0;return n&&o>>0,u?(e=oe(e),e&&(typeof n=="string"||n!=null&&!yo(n))&&(n=tn(n),!n&&Dt(e))?et(_n(e),0,u):e.split(n,u)):[]}var Bb=Wt(function(e,n,u){return e+(u?" ":"")+Ao(n)});function Mb(e,n,u){return e=oe(e),u=u==null?0:dt(j(u),0,e.length),n=tn(n),e.slice(u,u+n.length)==n}function Ob(e,n,u){var o=p.templateSettings;u&&Xe(e,n,u)&&(n=r),e=oe(e),n=Xi({},n,o,cc);var c=Xi({},n.imports,o.imports,cc),m=Fe(c),v=Ma(c,m),_,w,M=0,O=n.interpolate||ri,H="__p += '",N=Fa((n.escape||ri).source+"|"+O.source+"|"+(O===Ff?cd:ri).source+"|"+(n.evaluate||ri).source+"|$","g"),Y="//# sourceURL="+(se.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++qd+"]")+` +`;e.replace(N,function(V,ne,ie,un,ke,an){return ie||(ie=un),H+=e.slice(M,an).replace(yd,o1),ne&&(_=!0,H+=`' + +__e(`+ne+`) + +'`),ke&&(w=!0,H+=`'; +`+ke+`; +__p += '`),ie&&(H+=`' + +((__t = (`+ie+`)) == null ? '' : __t) + +'`),M=an+V.length,V}),H+=`'; +`;var z=se.call(n,"variable")&&n.variable;if(!z)H=`with (obj) { +`+H+` +} +`;else if(fd.test(z))throw new Z(h);H=(w?H.replace(Kg,""):H).replace(zg,"$1").replace(Vg,"$1;"),H="function("+(z||"obj")+`) { +`+(z?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(w?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+H+`return __p +}`;var Q=rh(function(){return ae(m,Y+"return "+H).apply(r,v)});if(Q.source=H,vo(Q))throw Q;return Q}function Fb(e){return oe(e).toLowerCase()}function Tb(e){return oe(e).toUpperCase()}function Hb(e,n,u){if(e=oe(e),e&&(u||n===r))return hl(e);if(!e||!(n=tn(n)))return e;var o=_n(e),c=_n(n),m=pl(o,c),v=gl(o,c)+1;return et(o,m,v).join("")}function Pb(e,n,u){if(e=oe(e),e&&(u||n===r))return e.slice(0,ml(e)+1);if(!e||!(n=tn(n)))return e;var o=_n(e),c=gl(o,_n(n))+1;return et(o,0,c).join("")}function Gb(e,n,u){if(e=oe(e),e&&(u||n===r))return e.replace(ma,"");if(!e||!(n=tn(n)))return e;var o=_n(e),c=pl(o,_n(n));return et(o,c).join("")}function Db(e,n){var u=Ft,o=Jr;if(_e(n)){var c="separator"in n?n.separator:c;u="length"in n?j(n.length):u,o="omission"in n?tn(n.omission):o}e=oe(e);var m=e.length;if(Dt(e)){var v=_n(e);m=v.length}if(u>=m)return e;var _=u-$t(o);if(_<1)return o;var w=v?et(v,0,_).join(""):e.slice(0,_);if(c===r)return w+o;if(v&&(_+=w.length-_),yo(c)){if(e.slice(_).search(c)){var M,O=w;for(c.global||(c=Fa(c.source,oe(Tf.exec(c))+"g")),c.lastIndex=0;M=c.exec(O);)var H=M.index;w=w.slice(0,H===r?_:H)}}else if(e.indexOf(tn(c),_)!=_){var N=w.lastIndexOf(c);N>-1&&(w=w.slice(0,N))}return w+o}function $b(e){return e=oe(e),e&&Zg.test(e)?e.replace(Mf,g1):e}var Nb=Wt(function(e,n,u){return e+(u?" ":"")+n.toUpperCase()}),Ao=ic("toUpperCase");function th(e,n,u){return e=oe(e),n=u?r:n,n===r?f1(e)?v1(e):e1(e):e.match(n)||[]}var rh=ee(function(e,n){try{return en(e,r,n)}catch(u){return vo(u)?u:new Z(u)}}),qb=Pn(function(e,n){return sn(n,function(u){u=Cn(u),Tn(e,u,go(e[u],e))}),e});function Yb(e){var n=e==null?0:e.length,u=K();return e=n?ye(e,function(o){if(typeof o[1]!="function")throw new fn(l);return[u(o[0]),o[1]]}):[],ee(function(o){for(var c=-1;++cWn)return[];var u=En,o=Ne(e,En);n=K(n),e-=En;for(var c=Ba(o,n);++u0||n<0)?new te(u):(e<0?u=u.takeRight(-e):e&&(u=u.drop(e)),n!==r&&(n=j(n),u=n<0?u.dropRight(-n):u.take(n-e)),u)},te.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},te.prototype.toArray=function(){return this.take(En)},xn(te.prototype,function(e,n){var u=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),c=p[o?"take"+(n=="last"?"Right":""):n],m=o||/^find/.test(n);c&&(p.prototype[n]=function(){var v=this.__wrapped__,_=o?[1]:arguments,w=v instanceof te,M=_[0],O=w||J(v),H=function(ne){var ie=c.apply(p,zn([ne],_));return o&&N?ie[0]:ie};O&&u&&typeof M=="function"&&M.length!=1&&(w=O=!1);var N=this.__chain__,Y=!!this.__actions__.length,z=m&&!N,Q=w&&!Y;if(!m&&O){v=Q?v:new te(this);var V=e.apply(v,_);return V.__actions__.push({func:Gi,args:[H],thisArg:r}),new ln(V,N)}return z&&Q?e.apply(this,_):(V=this.thru(H),z?o?V.value()[0]:V.value():V)})}),sn(["pop","push","shift","sort","splice","unshift"],function(e){var n=fi[e],u=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var c=arguments;if(o&&!this.__chain__){var m=this.value();return n.apply(J(m)?m:[],c)}return this[u](function(v){return n.apply(J(v)?v:[],c)})}}),xn(te.prototype,function(e,n){var u=p[n];if(u){var o=u.name+"";se.call(Ut,o)||(Ut[o]=[]),Ut[o].push({name:n,func:u})}}),Ut[Bi(r,I).name]=[{name:"wrapper",func:r}],te.prototype.clone=$1,te.prototype.reverse=N1,te.prototype.value=q1,p.prototype.at=my,p.prototype.chain=vy,p.prototype.commit=yy,p.prototype.next=_y,p.prototype.plant=Ay,p.prototype.reverse=wy,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Ey,p.prototype.first=p.prototype.head,vr&&(p.prototype[vr]=by),p},Nt=y1();ct?((ct.exports=Nt)._=Nt,wa._=Nt):Ge._=Nt}).call(fe)}(Or,Or.exports);var ue=Or.exports,gh=function(){},dh=gh(),tt=function(t){return t!==dh&&t!==null},mh=tt,vh=Array.prototype.forEach,yh=Object.create,_h=function(t,i){var r;for(r in t)i[r]=t[r]},Lo=function(t){var i=yh(null);return vh.call(arguments,function(r){mh(r)&&_h(Object(r),i)}),i},bh=function(){var t=Math.sign;return typeof t!="function"?!1:t(10)===1&&t(-20)===-1},Wi,Bo;function Ah(){return Bo||(Bo=1,Wi=function(t){return t=Number(t),isNaN(t)||t===0?t:t>0?1:-1}),Wi}var wh=bh()?Math.sign:Ah(),Eh=wh,xh=Math.abs,Sh=Math.floor,Ch=function(t){return isNaN(t)?0:(t=Number(t),t===0||!isFinite(t)?t:Eh(t)*Sh(xh(t)))},Rh=Ch,Ih=Math.max,rt=function(t){return Ih(0,Rh(t))},Lh=rt,Mo=function(t,i,r){var a;return isNaN(t)?(a=i,a>=0?r&&a?a-1:a:1):t===!1?!1:Lh(t)},qn=function(t){if(typeof t!="function")throw new TypeError(t+" is not a function");return t},Bh=tt,bt=function(t){if(!Bh(t))throw new TypeError("Cannot use null or undefined");return t},Mh=qn,Oh=bt,Fh=Function.prototype.bind,Oo=Function.prototype.call,Th=Object.keys,Hh=Object.prototype.propertyIsEnumerable,Ph=function(t,i){return function(r,a){var s,f=arguments[2],l=arguments[3];return r=Object(Oh(r)),Mh(a),s=Th(r),l&&s.sort(typeof l=="function"?Fh.call(l,r):void 0),typeof t!="function"&&(t=s[t]),Oo.call(t,s,function(h,d){return Hh.call(r,h)?Oo.call(a,f,r[h],h,r,d):i})}},Fr=Ph("forEach"),it={},Fo={exports:{}},Gh=function(){var t=Object.assign,i;return typeof t!="function"?!1:(i={foo:"raz"},t(i,{bar:"dwa"},{trzy:"trzy"}),i.foo+i.bar+i.trzy==="razdwatrzy")},Ki,To;function Dh(){return To||(To=1,Ki=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Ki}var zi,Ho;function $h(){if(Ho)return zi;Ho=1;var t=tt,i=Object.keys;return zi=function(r){return i(t(r)?Object(r):r)},zi}var Vi,Po;function Nh(){return Po||(Po=1,Vi=Dh()()?Object.keys:$h()),Vi}var Zi,Go;function qh(){if(Go)return Zi;Go=1;var t=Nh(),i=bt,r=Math.max;return Zi=function(a,s){var f,l,h=r(arguments.length,2),d;for(a=Object(i(a)),d=function(g){try{a[g]=s[g]}catch(y){f||(f=y)}},l=1;l-1},nu}var ap=ip()?String.prototype.contains:up(),Tr=zo,Zo=rp,Jo=Do,jo=Lo,Zt=ap,op=Ko.exports=function(t,i){var r,a,s,f,l;return arguments.length<2||typeof t!="string"?(f=i,i=t,t=null):f=arguments[2],Tr(t)?(r=Zt.call(t,"c"),a=Zt.call(t,"e"),s=Zt.call(t,"w")):(r=s=!0,a=!1),l={value:i,configurable:r,enumerable:a,writable:s},f?Jo(jo(f),l):l};op.gs=function(t,i,r){var a,s,f,l;return typeof t!="string"?(f=r,r=i,i=t,t=null):f=arguments[3],Tr(i)?Zo(i)?Tr(r)?Zo(r)||(f=r,r=void 0):r=void 0:(f=i,i=r=void 0):i=void 0,Tr(t)?(a=Zt.call(t,"c"),s=Zt.call(t,"e")):(a=!0,s=!1),l={get:i,set:r,configurable:a,enumerable:s},f?Jo(jo(f),l):l};var ut=Ko.exports,tu={exports:{}};(function(t,i){var r=ut,a=qn,s=Function.prototype.apply,f=Function.prototype.call,l=Object.create,h=Object.defineProperty,d=Object.defineProperties,g=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0},b,E,S,F,P,C,I;b=function(T,x){var B;return a(x),g.call(this,"__ee__")?B=this.__ee__:(B=y.value=l(null),h(this,"__ee__",y),y.value=null),B[T]?typeof B[T]=="object"?B[T].push(x):B[T]=[B[T],x]:B[T]=x,this},E=function(T,x){var B,G;return a(x),G=this,b.call(this,T,B=function(){S.call(G,T,B),s.call(x,this,arguments)}),B.__eeOnceListener__=x,this},S=function(T,x){var B,G,W,re;if(a(x),!g.call(this,"__ee__"))return this;if(B=this.__ee__,!B[T])return this;if(G=B[T],typeof G=="object")for(re=0;W=G[re];++re)(W===x||W.__eeOnceListener__===x)&&(G.length===2?B[T]=G[re?0:1]:G.splice(re,1));else(G===x||G.__eeOnceListener__===x)&&delete B[T];return this},F=function(T){var x,B,G,W,re;if(g.call(this,"__ee__")&&(W=this.__ee__[T],!!W))if(typeof W=="object"){for(B=arguments.length,re=new Array(B-1),x=1;x=55296&&B<=56319&&(ce+=E[++C])),ce=S?g.call(S,F,ce,I):ce,P?(y.value=ce,b(T,I,y)):T[I]=ce,++I;x=I}}if(x===void 0)for(x=a(E.length),P&&(T=new P(x)),C=0;C=0?y=l(y):y=i(this.length)-l(f(y)),d=y;d"}},Nu}var qu,Ys;function t0(){if(Ys)return qu;Ys=1;var t=n0(),i=/[\n\r\u2028\u2029]/g;return qu=function(r){var a=t(r);return a.length>100&&(a=a.slice(0,99)+"…"),a=a.replace(i,function(s){return JSON.stringify(s).slice(1,-1)}),a},qu}var $r={exports:{}},Us;function Xs(){if(Us)return $r.exports;Us=1,$r.exports=t,$r.exports.default=t;function t(i){return!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function"}return $r.exports}var ks;function r0(){if(ks)return Hs;ks=1;var t=Os(),i=jp(),r=e0(),a=t0(),s=Xs(),f=Hu(),l=Object.create,h=i("then","then:finally","done","done:finally");return it.promise=function(d,g){var y=l(null),b=l(null),E=l(null);if(d===!0)d=null;else if(d=r(d),!h[d])throw new TypeError("'"+a(d)+"' is not valid promise mode");g.on("set",function(S,F,P){var C=!1;if(!s(P)){b[S]=P,g.emit("setasync",S,1);return}y[S]=1,E[S]=P;var I=function(G){var W=y[S];if(C)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) +Consider to rely on 'then' or 'done' mode instead.`);W&&(delete y[S],b[S]=G,g.emit("setasync",S,W))},T=function(){C=!0,y[S]&&(delete y[S],delete E[S],g.delete(S))},x=d;if(x||(x="then"),x==="then"){var B=function(){f(T)};P=P.then(function(G){f(I.bind(this,G))},B),typeof P.finally=="function"&&P.finally(B)}else if(x==="done"){if(typeof P.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");P.done(I,T)}else if(x==="done:finally"){if(typeof P.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof P.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");P.done(I),P.finally(T)}}),g.on("get",function(S,F,P){var C;if(y[S]){++y[S];return}C=E[S];var I=function(){g.emit("getasync",S,F,P)};s(C)?typeof C.done=="function"?C.done(I):C.then(function(){f(I)}):I()}),g.on("delete",function(S){if(delete E[S],y[S]){delete y[S];return}if(hasOwnProperty.call(b,S)){var F=b[S];delete b[S],g.emit("deleteasync",S,[F])}}),g.on("clear",function(){var S=b;b=l(null),y=l(null),E=l(null),g.emit("clearasync",t(S,function(F){return[F]}))})},Hs}var Ws={},Ks;function i0(){if(Ks)return Ws;Ks=1;var t=qn,i=Fr,r=it,a=Function.prototype.apply;return r.dispose=function(s,f,l){var h;if(t(s),l.async&&r.async||l.promise&&r.promise){f.on("deleteasync",h=function(d,g){a.call(s,null,g)}),f.on("clearasync",function(d){i(d,function(g,y){h(y,g)})});return}f.on("delete",h=function(d,g){s(g)}),f.on("clear",function(d){i(d,function(g,y){h(y,g)})})},Ws}var zs={},Yu,Vs;function u0(){return Vs||(Vs=1,Yu=2147483647),Yu}var Uu,Zs;function a0(){if(Zs)return Uu;Zs=1;var t=rt,i=u0();return Uu=function(r){if(r=t(r),r>i)throw new TypeError(r+" exceeds maximum possible timeout");return r},Uu}var Js;function o0(){if(Js)return zs;Js=1;var t=bu(),i=Fr,r=Hu(),a=Xs(),s=a0(),f=it,l=Function.prototype,h=Math.max,d=Math.min,g=Object.create;return f.maxAge=function(y,b,E){var S,F,P,C;y=s(y),y&&(S=g(null),F=E.async&&f.async||E.promise&&f.promise?"async":"",b.on("set"+F,function(I){S[I]=setTimeout(function(){b.delete(I)},y),typeof S[I].unref=="function"&&S[I].unref(),C&&(C[I]&&C[I]!=="nextTick"&&clearTimeout(C[I]),C[I]=setTimeout(function(){delete C[I]},P),typeof C[I].unref=="function"&&C[I].unref())}),b.on("delete"+F,function(I){clearTimeout(S[I]),delete S[I],C&&(C[I]!=="nextTick"&&clearTimeout(C[I]),delete C[I])}),E.preFetch&&(E.preFetch===!0||isNaN(E.preFetch)?P=.333:P=h(d(Number(E.preFetch),1),0),P&&(C={},P=(1-P)*y,b.on("get"+F,function(I,T,x){C[I]||(C[I]="nextTick",r(function(){var B;C[I]==="nextTick"&&(delete C[I],b.delete(I),E.async&&(T=t(T),T.push(l)),B=b.memoized.apply(x,T),E.promise&&a(B)&&(typeof B.done=="function"?B.done(l,l):B.then(l,l)))}))}))),b.on("clear"+F,function(){i(S,function(I){clearTimeout(I)}),S={},C&&(i(C,function(I){I!=="nextTick"&&clearTimeout(I)}),C={})}))},zs}var js={},Xu,Qs;function s0(){if(Qs)return Xu;Qs=1;var t=rt,i=Object.create,r=Object.prototype.hasOwnProperty;return Xu=function(a){var s=0,f=1,l=i(null),h=i(null),d=0,g;return a=t(a),{hit:function(y){var b=h[y],E=++d;if(l[E]=y,h[y]=E,!b)return++s,s<=a?void 0:(y=l[f],g(y),y);if(delete l[b],f===b)for(;!r.call(l,++f););},delete:g=function(y){var b=h[y];if(b&&(delete l[b],delete h[y],--s,f===b)){if(!s){d=0,f=1;return}for(;!r.call(l,++f););}},clear:function(){s=0,f=1,l=i(null),h=i(null),d=0}}},Xu}var ef;function f0(){if(ef)return js;ef=1;var t=rt,i=s0(),r=it;return r.max=function(a,s,f){var l,h,d;a=t(a),a&&(h=i(a),l=f.async&&r.async||f.promise&&r.promise?"async":"",s.on("set"+l,d=function(g){g=h.hit(g),g!==void 0&&s.delete(g)}),s.on("get"+l,d),s.on("delete"+l,h.delete),s.on("clear"+l,h.clear))},js}var nf={},tf;function l0(){if(tf)return nf;tf=1;var t=ut,i=it,r=Object.create,a=Object.defineProperties;return i.refCounter=function(s,f,l){var h,d;h=r(null),d=l.async&&i.async||l.promise&&i.promise?"async":"",f.on("set"+d,function(g,y){h[g]=y||1}),f.on("get"+d,function(g){++h[g]}),f.on("delete"+d,function(g){delete h[g]}),f.on("clear"+d,function(){h={}}),a(f.memoized,{deleteRef:t(function(){var g=f.get(arguments);return g===null||!h[g]?null:--h[g]?!1:(f.delete(g),!0)}),getRefCount:t(function(){var g=f.get(arguments);return g===null||!h[g]?0:h[g]})})},nf}var c0=Lo,h0=Mo,p0=Yp,g0=function(t){var i=c0(arguments[1]),r;return i.normalizer||(r=i.length=h0(i.length,t.length,i.async),r!==0&&(i.primitive?r===!1?i.normalizer=Up():r>1&&(i.normalizer=Xp()(r)):r===!1?i.normalizer=zp()():r===1?i.normalizer=Vp()():i.normalizer=Zp()(r))),i.async&&Jp(),i.promise&&r0(),i.dispose&&i0(),i.maxAge&&o0(),i.max&&f0(),i.refCounter&&l0(),p0(t,i)},d0=we(g0);function rf(t,i,r=0,a=t.length-1,s=m0){for(;a>r;){if(a-r>600){const d=a-r+1,g=i-r+1,y=Math.log(d),b=.5*Math.exp(2*y/3),E=.5*Math.sqrt(y*b*(d-b)/d)*(g-d/2<0?-1:1),S=Math.max(r,Math.floor(i-g*b/d+E)),F=Math.min(a,Math.floor(i+(d-g)*b/d+E));rf(t,i,S,F,s)}const f=t[i];let l=r,h=a;for(jt(t,r,i),s(t[a],f)>0&&jt(t,r,a);l0;)h--}s(t[r],f)===0?jt(t,r,h):(h++,jt(t,h,a)),h<=i&&(r=h+1),i<=h&&(a=h-1)}}function jt(t,i,r){const a=t[i];t[i]=t[r],t[r]=a}function m0(t,i){return ti?1:0}class v0{constructor(i=9){this._maxEntries=Math.max(4,i),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(i){let r=this.data;const a=[];if(!qr(i,r))return a;const s=this.toBBox,f=[];for(;r;){for(let l=0;l=0&&f[r].children.length>this._maxEntries;)this._split(f,r),r--;this._adjustParentBBoxes(s,f,r)}_split(i,r){const a=i[r],s=a.children.length,f=this._minEntries;this._chooseSplitAxis(a,f,s);const l=this._chooseSplitIndex(a,f,s),h=wt(a.children.splice(l,a.children.length-l));h.height=a.height,h.leaf=a.leaf,At(a,this.toBBox),At(h,this.toBBox),r?i[r-1].children.push(h):this._splitRoot(a,h)}_splitRoot(i,r){this.data=wt([i,r]),this.data.height=i.height+1,this.data.leaf=!1,At(this.data,this.toBBox)}_chooseSplitIndex(i,r,a){let s,f=1/0,l=1/0;for(let h=r;h<=a-r;h++){const d=Qt(i,0,h,this.toBBox),g=Qt(i,h,a,this.toBBox),y=w0(d,g),b=ku(d)+ku(g);y=r;g--){const y=i.children[g];er(h,i.leaf?f(y):y),d+=Nr(h)}return d}_adjustParentBBoxes(i,r,a){for(let s=a;s>=0;s--)er(r[s],i)}_condense(i){for(let r=i.length-1,a;r>=0;r--)i[r].children.length===0?r>0?(a=i[r-1].children,a.splice(a.indexOf(i[r]),1)):this.clear():At(i[r],this.toBBox)}}function y0(t,i,r){if(!r)return i.indexOf(t);for(let a=0;a=t.minX&&i.maxY>=t.minY}function wt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function uf(t,i,r,a,s){const f=[i,r];for(;f.length;){if(r=f.pop(),i=f.pop(),r-i<=a)continue;const l=i+Math.ceil((r-i)/a/2)*a;rf(t,l,i,r,s),f.push(i,l,l,r)}}class E0 extends v0{toBBox(i){return{minX:i.left,minY:i.top,maxX:i.right,maxY:i.bottom}}compareMinX(i,r){return i.left-r.left}compareMinY(i,r){return i.top-r.top}}const x0={screenSize:{width:1,height:1},workerCount:4,workerIndex:0,tileResolution:{width:64,height:64},tileSubdivision:0,refreshInterval:1e3/60,animationDuration:150,debounceInterval:1e3/60,errorColor:"#f44336",backgroundColor:"#ffffff",accentColor:"#333333",dynamicResolution:{intervalMs:500,increment:.5,maxScale:1.5,minScale:1,dtMax:1.5,dtMin:1.1}};var af={exports:{}};(function(t){var i=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function s(d,g,y){this.fn=d,this.context=g,this.once=y||!1}function f(d,g,y,b,E){if(typeof y!="function")throw new TypeError("The listener must be a function");var S=new s(y,b||d,E),F=r?r+g:g;return d._events[F]?d._events[F].fn?d._events[F]=[d._events[F],S]:d._events[F].push(S):(d._events[F]=S,d._eventsCount++),d}function l(d,g){--d._eventsCount===0?d._events=new a:delete d._events[g]}function h(){this._events=new a,this._eventsCount=0}h.prototype.eventNames=function(){var g=[],y,b;if(this._eventsCount===0)return g;for(b in y=this._events)i.call(y,b)&&g.push(r?b.slice(1):b);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(y)):g},h.prototype.listeners=function(g){var y=r?r+g:g,b=this._events[y];if(!b)return[];if(b.fn)return[b.fn];for(var E=0,S=b.length,F=new Array(S);EObject.prototype.hasOwnProperty.call(t,i),rr=t=>+`${t}`.replace(Ee,"$1"),at=t=>Ee.test(`${t}`)?rr(t):Math.min(+t,100),Ur=t=>(t.length===1&&(t+=t),parseInt(t,16)),Xr=t=>{const i=$(t,0).toString(16).toUpperCase();return i.length===1?`0x0${i}`:`0x${i}`},ot=(t,i=!1)=>!i&&Ee.test(t)?Math.min(255*rr(t)/100,255):zu.test(t)?(t.length===3&&(t+=t.slice(-1)),i?$(t)/255:$(t)):Math.min(+t,i?1:255),kr=t=>Ee.test(t)?Ie(125*rr(t)/100,-125,125):Ie(+t,-125,125),Yn=t=>Math.min(Ee.test(t)?rr(t)/100:+t,1),ff=t=>[...t].sort().join("").toUpperCase(),$=(t,i=6)=>{const r=Math.pow(10,i);return Math.round(+t*r)/r},Ie=(t,i,r)=>Math.max(i,Math.min(t,r)),ir=t=>{if(typeof t=="string"){const i=t.match(sf),r=+i[1];switch(i[2]){case Ye.RADIANS:t=$(180*r/Math.PI);break;case Ye.TURNS:t=$(360*r);break;case Ye.GRADIANS:t=$(.9*r);break;case Ye.DEGREES:default:t=r}}return(t>360||t<0)&&(t-=360*Math.floor(t/360)),t},T0=(t,i)=>{let r;switch(i){case Ye.RADIANS:r=$((a=>a*Math.PI/180)(t));break;case Ye.TURNS:r=$(t/360);break;case Ye.GRADIANS:r=$(10/9*t);break;case Ye.DEGREES:case Ye.NONE:default:r=t}return r},k=(t,...i)=>{const r=[],a=[],s=[],f=[],l=[],h=[],d=Object.values(Ye),g=Object.values($e),y=Object.values(tr),b={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const E of i)if(typeof E=="string"){if(r.push(E),E.includes(",")){b.legacyCSS++;const S=E.match(B0);new Set(S).size===1&&M0.test(S[0].slice(1))&&b.spacesAfterCommas++}if(E.match(We.HSL)){const S=E.match(We.HSL),F=S[1]||S[5],P=S[8],C=F.match(sf)[2];a.push(C===""?Ye.NONE:C),h.push(Ee.test(P));continue}if(We.RGB.test(E)){const S=E.match(We.RGB),F=S[1]||S[5],P=S[2]||S[6],C=S[3]||S[7],I=S[8];s.push(Ee.test(F)&&Ee.test(P)&&Ee.test(C)),h.push(Ee.test(I));continue}if(We.CIELab.test(E)){const S=E.match(We.CIELab),F=S[1],P=S[2],C=S[3],I=S[4];f.push(Ee.test(F)&&Ee.test(P)&&Ee.test(C)),h.push(Ee.test(I));continue}if(E.match(We.CMYK)){const S=E.match(We.CMYK),F=S[1]||S[6],P=S[2]||S[7],C=S[3]||S[8],I=S[4]||S[9],T=S[10];l.push(Ee.test(F)&&Ee.test(P)&&Ee.test(C)&&Ee.test(I)),E.startsWith("cmyk")&&b.cmykFunction++,h.push(Ee.test(T))}}return{decimals:typeof t.decimals===nr.NUMBER?t.decimals:Bn.decimals,legacyCSS:typeof t.legacyCSS===nr.BOOLEAN?t.legacyCSS:!!(r.length&&b.legacyCSS===r.length)||Bn.legacyCSS,spacesAfterCommas:typeof t.spacesAfterCommas===nr.BOOLEAN?t.spacesAfterCommas:!!(r.length&&b.spacesAfterCommas===r.length)||Bn.spacesAfterCommas,anglesUnit:t.anglesUnit&&d.includes(t.anglesUnit)?t.anglesUnit:new Set(a).size===1?a[0]:Bn.anglesUnit,rgbUnit:t.rgbUnit&&g.includes(t.rgbUnit)?t.rgbUnit:new Set(s).size===1&&s[0]?$e.PERCENT:Bn.rgbUnit,labUnit:t.labUnit&&g.includes(t.labUnit)?t.labUnit:new Set(f).size===1&&f[0]?$e.PERCENT:Bn.labUnit,cmykUnit:t.cmykUnit&&g.includes(t.cmykUnit)?t.cmykUnit:new Set(l).size!==1||l[0]?Bn.cmykUnit:$e.NONE,alphaUnit:t.alphaUnit&&g.includes(t.alphaUnit)?t.alphaUnit:new Set(h).size===1&&h[0]?$e.PERCENT:Bn.alphaUnit,cmykFunction:t.cmykFunction&&y.includes(t.cmykFunction)?t.cmykFunction:l.length&&l.length===b.cmykFunction?tr.CMYK:Bn.cmykFunction}},Vu=t=>`${t}`in ge,lf=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],H0=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],Et=lf.map(t=>t.reduce((i,r)=>i+r,0)),Zu=(t,i,r)=>(r<0&&(r+=6),r>=6&&(r-=6),$(r<1?255*((i-t)*r+t):r<3?255*i:r<4?255*((i-t)*(4-r)+t):255*t)),P0=t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4,G0=t=>t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,cf=(t,i,r,a)=>{const s=[0,0,0],f=[t,i,r];return a.forEach((l,h)=>{l.forEach((d,g)=>{s[h]+=d*f[g]})}),s},Ce=(t,i,r)=>{i/=100;const a=(r/=100)<=.5?r*(i+1):r+i-r*i,s=2*r-a;return{R:Zu(s,a,(t/=60)+2),G:Zu(s,a,t),B:Zu(s,a,t-2)}},xt=(t,i,r,a=1)=>{t/=255,i/=255,r/=255,a=Math.min(a,1);const s=Math.max(t,i,r),f=Math.min(t,i,r),l=s-f;let h=0,d=0;const g=(s+f)/2;if(l!==0){switch(s){case t:h=(i-r)/l%6;break;case i:h=(r-t)/l+2;break;case r:h=(t-i)/l+4}h=$(60*h),h<0&&(h+=360),d=l/(1-Math.abs(2*g-1))}return{H:h,S:$(100*d),L:$(100*g),A:a}},St=(t,i,r)=>{const a=[t/255,i/255,r/255].map(P0),s=cf(a[0],a[1],a[2],lf),f=((l,h,d)=>{const g=E=>E>.008856451679035631?Math.cbrt(E):E/.12841854934601665+.13793103448275862,y=g(l/Et[0]),b=g(h/Et[1]);return[116*b-16,500*(y-b),200*(b-g(d/Et[2]))]})(s[0],s[1],s[2]);return{L:f[0],a:f[1],b:f[2]}},Ju=(t,i,r)=>{const a=((f,l,h)=>{const d=E=>E>.20689655172413793?E**3:.12841854934601665*(E-.13793103448275862),g=(f+16)/116,y=l/500,b=h/200;return[Et[0]*d(g+y),Et[1]*d(g),Et[2]*d(g-b)]})(t,i,r),s=cf(a[0],a[1],a[2],H0).map(G0);return{R:Ie(255*s[0],0,255),G:Ie(255*s[1],0,255),B:Ie(255*s[2],0,255)}},ju=(t,i,r,a)=>({R:$(255*(1-t)*(a=1-a)),G:$(255*(1-i)*a),B:$(255*(1-r)*a)}),hf=(t,i,r)=>{t/=255,i/=255,r/=255;const a=1-Math.max(t,i,r),s=1-a,f=s&&(s-i)/s,l=s&&(s-r)/s;return{C:$(100*(s&&(s-t)/s)),M:$(100*f),Y:$(100*l),K:$(100*a)}},pf=(t,i)=>{if(t<0&&(t+=360),t>360&&(t-=360),t===360||t===0)return t;const r=[[0,120],[120,180],[180,240],[240,360]],a=[[0,60],[60,120],[120,240],[240,360]],s=i?a:r;let f=0,l=0,h=0,d=0;return(i?r:a).find((g,y)=>t>=g[0]&&tt?", ":",",ur=(t,i)=>{const r=ff(Object.keys(t));return I0[Ku[r]].reduce((a,s,f)=>{const l=t[s];return l!==void 0&&a.push(i(l,f)),a},[])},ar=(t,i)=>t.replace(L0,(r,a)=>`${i[+a-1]}`),Wr=(t,i,r=!1)=>{const{alphaUnit:a,legacyCSS:s,decimals:f}=i;return a!==$e.PERCENT||s&&!r?$(t,f):`${$(100*t,f)}%`},X={[U.HEX]:t=>{const i=ur(t,a=>(s=>{let f=$(s,0).toString(16).toUpperCase();return f.length===1&&(f=`0${f}`),f})($(a))),r=i.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return ar(r,i)},[U.RGB]:(t,i)=>{const{decimals:r,legacyCSS:a,spacesAfterCommas:s,rgbUnit:f}=i,l=Qu(s),h=ur(t,(g,y)=>f===$e.PERCENT&&y<3?`${((b,E)=>$(b/255*100,E))(g,r)}%`:y===3?Wr(g,i):$(g,r)),d=a?h.length===4?`rgba({1}${l}{2}${l}{3}${l}{4})`:`rgb({1}${l}{2}${l}{3})`:h.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return ar(d,h)},[U.HSL]:(t,i)=>{const{decimals:r,legacyCSS:a,spacesAfterCommas:s,anglesUnit:f}=i,l=Qu(s),h=ur(t,(g,y)=>y===0&&f!==Ye.NONE?`${$(T0(g,f),r)}${f}`:y===3?Wr(g,i):$(g,r)),d=a?h.length===4?`hsla({1}${l}{2}%${l}{3}%${l}{4})`:`hsl({1}${l}{2}%${l}{3}%)`:h.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return ar(d,h)},[U.CIELab]:(t,i)=>{const{decimals:r,labUnit:a}=i,s=ur(t,(l,h)=>{if(h===0){const d=$(at(l),r);return a===$e.PERCENT?`${d}%`:`${d}`}return h<3?a===$e.PERCENT?`${((d,g)=>$(d/125*100,g))(l,r)}%`:$(l,r):Wr(l,i,!0)}),f=s.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return ar(f,s)},[U.CMYK]:(t,i)=>{const{decimals:r,legacyCSS:a,spacesAfterCommas:s,cmykUnit:f,cmykFunction:l}=i,h=Qu(s),d=ur(t,(y,b)=>f===$e.PERCENT&&b<4?`${$(y,r)}%`:b===4?Wr(y,i):$(y/100,r)),g=a?d.length===5?`${l}({1}${h}{2}${h}{3}${h}{4}${h}{5})`:`${l}({1}${h}{2}${h}{3}${h}{4})`:d.length===5?`${l}({1} {2} {3} {4} / {5})`:`${l}({1} {2} {3} {4})`;return ar(g,d)}},Le=t=>(typeof t=="string"&&(t=Ee.test(t)?rr(t)/100:+t),isNaN(+t)||t>1?1:$(t)),Ct=(t,i,r)=>i.reduce((a,s)=>[...a,{...t,H:r===ge.ADDITIVE?ir(t.H+s):ir(pf(pf(t.H,!1)+s,!0))}],[{...t}]),D0=(t,i)=>Ct(t,[30,-30],i),$0=(t,i)=>Ct(t,[180],i),N0=(t,i)=>Ct(t,[150,-150],i),q0=(t,i)=>Ct(t,[120,-120],i),Y0=(t,i)=>Ct(t,[60,-120,180],i),U0=(t,i)=>Ct(t,[90,-90,180],i),be=t=>typeof t=="string"?(i=>{let r;if(Object.keys(U).some(a=>{if(We[a].test(i))return r=a,!0}),!r&&~of.indexOf(i)&&(r=U.HEX),!r)throw new Error(O0);return r})(t):(i=>{let r,a=!1;const s=ff(Object.keys(i));if(Ku[s]&&(r=Ku[s]),r&&r===U.RGB){const f=Object.entries(i).some(h=>!zu.test(`${h[1]}`)),l=Object.entries(i).some(h=>!(Ee.test(`${h[1]}`)||!zu.test(`${h[1]}`)&&!isNaN(+h[1])&&+h[1]<=255));f&&l&&(a=!0),f||(r=U.HEX)}if(!r||a)throw new Error(F0);return r})(t),X0={[U.HEX](t){const i=(~of.indexOf(t)?Yr[t]:t).match(We.HEX),r={R:Ur(i[1]||i[5]),G:Ur(i[2]||i[6]),B:Ur(i[3]||i[7])},a=i[4]||i[8];return a!==void 0&&(r.A=Ur(a)/255),r},[U.RGB](t){const i=t.match(We.RGB),r=ot(i[1]||i[5]),a=ot(i[2]||i[6]),s=ot(i[3]||i[7]),f=i[4]||i[8],l={R:Math.min(r,255),G:Math.min(a,255),B:Math.min(s,255)};return f!==void 0&&(l.A=Le(f)),l},[U.HSL](t){const i=t.match(We.HSL),r=ir(i[1]||i[5]),a=at(i[2]||i[6]),s=at(i[3]||i[7]),f=i[4]||i[8],l=Ce(r,a,s);return f!==void 0&&(l.A=Le(f)),l},[U.CIELab](t){const i=t.match(We.CIELab),r=at(i[1]),a=kr(i[2]),s=kr(i[3]),f=i[4],l=Ju(r,a,s);return f!==void 0&&(l.A=Le(f)),l},[U.CMYK](t){const i=t.match(We.CMYK),r=Yn(i[1]||i[6]),a=Yn(i[2]||i[7]),s=Yn(i[3]||i[8]),f=Yn(i[4]||i[9]),l=i[5]||i[10],h=ju(r,a,s,f);return l!==void 0&&(h.A=Le(l)),h}},k0={[U.HEX](t){const i={R:ot(`${t.R}`),G:ot(`${t.G}`),B:ot(`${t.B}`)};return Re(t,"A")&&(i.A=Math.min(ot(`${t.A}`,!0),1)),i},[U.RGB](t){return this.HEX(t)},[U.HSL](t){const i=at(`${t.S}`),r=at(`${t.L}`),a=Ce(ir(t.H),i,r);return Re(t,"A")&&(a.A=Le(t.A)),a},[U.CIELab](t){const i=at(`${t.L}`),r=kr(`${t.a}`),a=kr(`${t.b}`),s=Ju(i,r,a);return Re(t,"A")&&(s.A=Le(t.A)),s},[U.CMYK](t){const i=Yn(`${t.C}`),r=Yn(`${t.M}`),a=Yn(`${t.Y}`),s=Yn(`${t.K}`),f=ju(i,r,a,s);return Re(t,"A")&&(f.A=Le(t.A)),f}},st=(t,i=be(t))=>typeof t=="string"?X0[i](t):k0[i](t),D={[U.HEX]:t=>({R:Xr(t.R),G:Xr(t.G),B:Xr(t.B)}),HEXA(t){const i=D.HEX(t);return i.A=Re(t,"A")?Xr(255*t.A):"0xFF",i},[U.RGB](t,i){const r=W0(t,i);return Re(r,"A")&&delete r.A,r},RGBA(t,i){const r=D.RGB(t,i);return r.A=Re(t,"A")?$(t.A):1,r},[U.HSL](t,i){const r=xt(t.R,t.G,t.B);return delete r.A,ea(r,i)},HSLA(t,i){const r=D.HSL(t,i);return r.A=Re(t,"A")?$(t.A,i):1,r},[U.CIELab](t,i){const r=St(t.R,t.G,t.B);return K0(r,i)},CIELabA(t,i){const r=D.CIELab(t,i);return r.A=Re(t,"A")?$(t.A,i):1,r},[U.CMYK]:(t,i)=>z0(hf(t.R,t.G,t.B),i),CMYKA(t,i){const r=D.CMYK(t,i);return r.A=Re(t,"A")?$(t.A,i):1,r}},Kr=(t,i,r,a)=>{const s=be(t),f=typeof t=="string",l=st(t,s),h=typeof t=="string"&&Re(l,"A")||typeof t!="string"&&Re(t,"A"),d=xt(l.R,l.G,l.B,l.A);h||delete d.A;const g=r?d.L/(i+1):(100-d.L)/(i+1),y=Array(i).fill(null).map((b,E)=>({...d,L:d.L+g*(E+1)*(1-2*+r)}));switch(s){case U.HEX:default:return y.map(b=>{const E=Ce(b.H,b.S,b.L);return h&&(E.A=b.A),f?h?X.HEX({...E,A:$(255*E.A)}):X.HEX(E):h?D.HEXA(E):D.HEX(E)});case U.RGB:return y.map(b=>{const E=Ce(b.H,b.S,b.L);return h&&(E.A=b.A),f?X.RGB(E,a):h?D.RGBA(E,a.decimals):D.RGB(E,a.decimals)});case U.HSL:return y.map(b=>f?X.HSL(b,a):h?D.HSLA({...Ce(b.H,b.S,b.L),A:b.A},a.decimals):D.HSL(Ce(b.H,b.S,b.L),a.decimals));case U.CIELab:return y.map(b=>{const E=Ce(b.H,b.S,b.L);return f?X.CIELab(h?D.CIELabA(E,a.decimals):D.CIELab(E,a.decimals),a):h?D.CIELabA({...E,A:b.A},a.decimals):D.CIELab(E,a.decimals)})}},Rt={buildHarmony(t,i,r,a){const s=be(t),f=st(t,s),l=xt(f.R,f.G,f.B,f.A),h=typeof t=="string"&&Re(f,"A")||typeof t!="string"&&Re(t,"A"),d=typeof t=="string";switch(s){case U.HEX:default:return h?this.HEXA(ea(l,0),i,r,d):this.HEX(ea(l,0),i,r,d);case U.HSL:return h?this.HSLA(l,i,r,d,a):this.HSL(l,i,r,d,a);case U.RGB:return h?this.RGBA(l,i,r,d,a):this.RGB(l,i,r,d,a);case U.CIELab:return h?this.CIELabA(l,i,r,d,a):this.CIELab(l,i,r,d,a)}},[U.HEX]:(t,i,r,a)=>i(t,r).map(s=>a?X.HEX(Ce(s.H,s.S,s.L)):D.HEX(Ce(s.H,s.S,s.L))),HEXA:(t,i,r,a)=>i(t,r).map(s=>a?X.HEX({...Ce(s.H,s.S,s.L),A:255*Le(s.A)}):D.HEXA({...Ce(s.H,s.S,s.L),A:Le(s.A)})),[U.RGB]:(t,i,r,a,s)=>i(t,r).map(f=>a?X.RGB(Ce(f.H,f.S,f.L),s):D.RGB(Ce(f.H,f.S,f.L),s.decimals)),RGBA:(t,i,r,a,s)=>i(t,r).map(f=>a?X.RGB({...Ce(f.H,f.S,f.L),A:Le(f.A)},s):D.RGBA({...Ce(f.H,f.S,f.L),A:Le(f.A)},s.decimals)),[U.HSL]:(t,i,r,a,s)=>i(t,r).map(f=>a?X.HSL({H:f.H,S:f.S,L:f.L},s):D.HSL(Ce(f.H,f.S,f.L),s.decimals)),HSLA:(t,i,r,a,s)=>i(t,r).map(f=>a?X.HSL({...f,A:Le(f.A)},s):D.HSLA({...Ce(f.H,f.S,f.L),A:Le(f.A)},s.decimals)),[U.CIELab]:(t,i,r,a,s)=>i(t,r).map(f=>{const l=Ce(f.H,f.S,f.L);return a?X.CIELab(St(l.R,l.G,l.B),s):D.CIELab(l,s.decimals)}),CIELabA:(t,i,r,a,s)=>i(t,r).map(f=>{const l=Ce(f.H,f.S,f.L);return a?X.CIELab({...St(l.R,l.G,l.B),A:Le(f.A)},s):D.CIELabA({...l,A:Le(f.A)},s.decimals)})},le={mix(t,i){const r=t.map(l=>{const h=be(l);return st(l,h)}),a=i===ge.SUBTRACTIVE?r.map(l=>{const h=((d,g,y)=>{const b=Math.min(d,g,y),E=Math.min(255-d,255-g,255-y),S=d-b,F=g-b,P=y-b,C=Math.min(S,F),I=S-C,T=(F+C)/2,x=(P+F-C)/2,B=Math.max(I,T,x)/Math.max(S,F,P),G=isNaN(B)||B===1/0||B<=0?1:B;return{R:I/G+E,Y:T/G+E,B:x/G+E}})(l.R,l.G,l.B);return Re(l,"A")&&(h.A=l.A),h}):null;function s(l){const h=i===ge.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return l.reduce((d,g)=>{const y=Re(g,"A")?g.A:1,b={R:Math.min(d.R+g.R*y,255),B:Math.min(d.B+g.B*y,255),A:1-(1-y)*(1-d.A)},E="G"in d?d.G:d.Y,S="G"in g?g.G:g.Y;return{...b,...i===ge.ADDITIVE?{G:Math.min(E+S*y,255)}:{Y:Math.min(E+S*y,255)}}},h)}let f;if(i===ge.ADDITIVE)f=s(r);else{const l=s(a);f=((h,d,g)=>{const y=Math.min(h,d,g),b=Math.min(255-h,255-d,255-g),E=h-y,S=d-y,F=g-y,P=Math.min(S,F),C=E+S-P,I=S+P,T=2*(F-P),x=Math.max(C,I,T)/Math.max(E,S,F),B=isNaN(x)||x===1/0||x<=0?1:x;return{R:C/B+b,G:I/B+b,B:T/B+b}})(l.R,l.Y,l.B),f.A=l.A}return{R:$(f.R),G:$(f.G),B:$(f.B),A:Ie(f.A,0,1)}},[U.HEX](t,i,r){const a=this.mix(t,i);return delete a.A,r?X.HEX(a):D.HEX(a)},HEXA(t,i,r){const a=this.mix(t,i);return a.A=r?255*Le(a.A):Le(a.A),r?X.HEX(a):D.HEXA(a)},[U.RGB](t,i,r,a){const s=this.mix(t,i);return delete s.A,r?X.RGB(s,a):D.RGB(s,a.decimals)},RGBA(t,i,r,a){const s=this.mix(t,i);return r?X.RGB(s,a):D.RGBA(s,a.decimals)},[U.HSL](t,i,r,a){const s=this.mix(t,i),f=xt(s.R,s.G,s.B);return delete s.A,delete f.A,r?X.HSL(f,a):D.HSL(s,a.decimals)},HSLA(t,i,r,a){const s=this.mix(t,i),f=xt(s.R,s.G,s.B,s.A);return r?X.HSL(f,a):D.HSLA(s,a.decimals)},[U.CIELab](t,i,r,a){const s=this.mix(t,i),f=St(s.R,s.G,s.B);return delete s.A,r?X.CIELab(f,a):D.CIELabA(s,a.decimals)},CIELabA(t,i,r,a){const s=this.mix(t,i),f=St(s.R,s.G,s.B);return Re(s,"A")&&(f.A=s.A),r?X.CIELab(f,a):D.CIELabA(s,a.decimals)}},W0=(t,i)=>({R:$(t.R,i),G:$(t.G,i),B:$(t.B,i),...Re(t,"A")?{A:$(t.A,i)}:{}}),ea=(t,i)=>({H:$(t.H,i),S:$(t.S,i),L:$(t.L,i),...Re(t,"A")?{A:$(t.A,i)}:{}}),K0=(t,i)=>({L:$(t.L,i),a:$(t.a,i),b:$(t.b,i)}),z0=(t,i)=>({C:$(t.C,i),M:$(t.M,i),Y:$(t.Y,i),K:$(t.K,i)}),Oe=(t,i,r,a)=>a(st(t,i),r),me=(t,i,r,a,s)=>(r<1&&(r=5),((l,h,d)=>{const g=d-1,y=(h.R-l.R)/g,b=(h.G-l.G)/g,E=(h.B-l.B)/g,S=Le(l.A),F=(Le(h.A)-S)/g;return Array(d).fill(null).map((P,C)=>C===0?l:C===g?h:{R:$(l.R+y*C),G:$(l.G+b*C),B:$(l.B+E*C),A:$(S+F*C)})})(st(t),st(i),r).map(l=>s(l,a))),na=(t,i,r,a)=>({[mn.ANALOGOUS]:Rt.buildHarmony(i,D0,r,a),[mn.COMPLEMENTARY]:Rt.buildHarmony(i,$0,r,a),[mn.SPLIT_COMPLEMENTARY]:Rt.buildHarmony(i,N0,r,a),[mn.TRIADIC]:Rt.buildHarmony(i,q0,r,a),[mn.TETRADIC]:Rt.buildHarmony(i,Y0,r,a),[mn.SQUARE]:Rt.buildHarmony(i,U0,r,a)})[t];class It{constructor(i,r={}){this._options=k(r,i),this.rgb=st(i),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...Ce(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...ju(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...Ju(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=xt(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...St(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=hf(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(i={}){return this._options={...this._options,...i},this}setH(i){return this.hsl.H=ir(i),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(i){return this.hsl.S=Ie(i,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(i){return this.hsl.L=Ie(i,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(i){this.rgb.R=Ie(i,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(i){return this.rgb.G=Ie(i,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(i){return this.rgb.B=Ie(i,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(i){return this.lab.L=Ie(i,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(i){return this.lab.a=Ie(i,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(i){return this.lab.b=Ie(i,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(i){return this.hsl.A=this.rgb.A=Ie(i,0,1),this}setC(i){return this.cmyk.C=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(i){return this.cmyk.M=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(i){return this.cmyk.Y=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(i){return this.cmyk.K=Ie(i,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return $(this.hsl.H,this.options.decimals)}get S(){return $(this.hsl.S,this.options.decimals)}get L(){return $(this.hsl.L,this.options.decimals)}get CIEL(){return $(this.lab.L,this.options.decimals)}get CIEa(){return $(this.lab.a,this.options.decimals)}get CIEb(){return $(this.lab.b,this.options.decimals)}get R(){return $(this.rgb.R,this.options.decimals)}get G(){return $(this.rgb.G,this.options.decimals)}get B(){return $(this.rgb.B,this.options.decimals)}get A(){return $(this.hsl.A,this.options.decimals)}get C(){return $(this.cmyk.C,this.options.decimals)}get M(){return $(this.cmyk.M,this.options.decimals)}get Y(){return $(this.cmyk.Y,this.options.decimals)}get K(){return $(this.cmyk.K,this.options.decimals)}get HEXObject(){return D.HEX(this.rgb)}get HEXAObject(){return D.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return X.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return X.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return X.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return X.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return X.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return X.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return X.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return X.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return X.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return X.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(i){const r=be(i);return Oe(i,r,0,D.HEX)}static toHEX(i){return X.HEX(It.toHEXObject(i))}static toHEXAObject(i){const r=be(i);return Oe(i,r,0,D.HEXA)}static toHEXA(i){return X.HEX(It.toHEXAObject(i))}static toRGBObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.RGB)}static toRGB(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.RGB);return X.RGB(f,s)}static toRGBAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.RGBA)}static toRGBA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.RGBA);return X.RGB(f,s)}static toHSLObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.HSL)}static toHSL(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.HSL);return X.HSL(f,s)}static toHSLAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.HSLA)}static toHSLA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.HSLA);return X.HSL(f,s)}static toCIELabObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CIELab)}static toCIELab(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CIELab);return X.CIELab(f,s)}static toCIELabAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CIELabA)}static toCIELabA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CIELabA);return X.CIELab(f,s)}static toCMYKObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CMYK)}static toCMYK(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CMYK);return X.CMYK(f,s)}static toCMYKAObject(i,r={}){const a=be(i);return Oe(i,a,r.decimals,D.CMYKA)}static toCMYKA(i,r={}){const a=be(i),s=k(r,i),f=Oe(i,a,r.decimals,D.CMYKA);return X.CMYK(f,s)}static getBlendHEXObject(i,r,a=5){return me(i,r,a,0,D.HEX)}static getBlendHEX(i,r,a=5){return It.getBlendHEXObject(i,r,a).map(s=>X.HEX(s))}static getBlendHEXAObject(i,r,a=5){return me(i,r,a,0,D.HEXA)}static getBlendHEXA(i,r,a=5){return It.getBlendHEXAObject(i,r,a).map(s=>X.HEX(s))}static getBlendRGBObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGB):me(i,r,5,a==null?void 0:a.decimals,D.RGB)}static getBlendRGB(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGB).map(f=>X.RGB(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.RGB).map(f=>X.RGB(f,k(a||{},i,r)))}static getBlendRGBAObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGBA):me(i,r,5,a==null?void 0:a.decimals,D.RGBA)}static getBlendRGBA(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.RGBA).map(f=>X.RGB(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.RGBA).map(f=>X.RGB(f,k(a||{},i,r)))}static getBlendHSLObject(i,r,a,s){return me(i,r,typeof a=="number"?a:5,s==null?void 0:s.decimals,D.HSL)}static getBlendHSL(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.HSL).map(f=>X.HSL(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.HSL).map(f=>X.HSL(f,k(a||{},i,r)))}static getBlendHSLAObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.HSLA):me(i,r,5,a==null?void 0:a.decimals,D.HSLA)}static getBlendHSLA(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.HSLA).map(f=>X.HSL(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.HSLA).map(f=>X.HSL(f,k(a||{},i,r)))}static getBlendCIELabObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELab):me(i,r,5,a==null?void 0:a.decimals,D.CIELab)}static getBlendCIELab(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELab).map(f=>X.CIELab(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.CIELab).map(f=>X.CIELab(f,k(a||{},i,r)))}static getBlendCIELabAObject(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELabA):me(i,r,5,a==null?void 0:a.decimals,D.CIELabA)}static getBlendCIELabA(i,r,a,s){return typeof a=="number"?me(i,r,a,s==null?void 0:s.decimals,D.CIELabA).map(f=>X.CIELab(f,k(s||{},i,r))):me(i,r,5,a==null?void 0:a.decimals,D.CIELabA).map(f=>X.CIELab(f,k(a||{},i,r)))}static getMixHEXObject(i,r=ge.ADDITIVE){return le.HEX(i,r,!1)}static getMixHEX(i,r=ge.ADDITIVE){return le.HEX(i,r,!0)}static getMixHEXAObject(i,r=ge.ADDITIVE){return le.HEXA(i,r,!1)}static getMixHEXA(i,r=ge.ADDITIVE){return le.HEXA(i,r,!0)}static getMixRGBObject(i,r,a){return typeof r=="string"?le.RGB(i,r,!1,k(a||{},...i)):le.RGB(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixRGB(i,r,a){return typeof r=="string"?le.RGB(i,r,!0,k(a||{},...i)):le.RGB(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixRGBAObject(i,r,a){return typeof r=="string"?le.RGBA(i,r,!1,k(a||{},...i)):le.RGBA(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixRGBA(i,r,a){return typeof r=="string"?le.RGBA(i,r,!0,k(a||{},...i)):le.RGBA(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixHSLObject(i,r,a){return typeof r=="string"?le.HSL(i,r,!1,k(a||{},...i)):le.HSL(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixHSL(i,r,a){return typeof r=="string"?le.HSL(i,r,!0,k(a||{},...i)):le.HSL(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixHSLAObject(i,r,a){return typeof r=="string"?le.HSLA(i,r,!1,k(a||{},...i)):le.HSLA(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixHSLA(i,r,a){return typeof r=="string"?le.HSLA(i,r,!0,k(a||{},...i)):le.HSLA(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixCIELabObject(i,r,a){return typeof r=="string"?le.CIELab(i,r,!1,k(a||{},...i)):le.CIELab(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixCIELab(i,r,a){return typeof r=="string"?le.CIELab(i,r,!0,k(a||{},...i)):le.CIELab(i,ge.ADDITIVE,!0,k(r||{},...i))}static getMixCIELabAObject(i,r,a){return typeof r=="string"?le.CIELabA(i,r,!1,k(a||{},...i)):le.CIELabA(i,ge.ADDITIVE,!1,k(r||{},...i))}static getMixCIELabA(i,r,a){return typeof r=="string"?le.CIELabA(i,r,!0,k(a||{},...i)):le.CIELabA(i,ge.ADDITIVE,!0,k(r||{},...i))}static getShades(i,r,a){return typeof r=="number"?Kr(i,r,!0,k(a||{},i)):Kr(i,5,!0,k(r||{},i))}static getTints(i,r,a){return typeof r=="number"?Kr(i,r,!1,k(a||{},i)):Kr(i,5,!1,k(r||{},i))}static getHarmony(i,r,a,s){return`${r}`in mn?na(r,i,Vu(a)?a:ge.ADDITIVE,k(Vu(a)?s||{}:a||{},i)):Vu(r)?na(mn.COMPLEMENTARY,i,r,k(a||{},i)):na(mn.COMPLEMENTARY,i,ge.ADDITIVE,k(r||{},i))}}const V0={current:void 0,parent:void 0,events:void 0,color:{source:2533018,destination:15753874,expanding:16733986,updating:16733986,generating:16771899,closing:11583173,end:15483002},scale:10,fill:"#000000",alpha:1};var Ke=63710088e-1,gf={centimeters:Ke*100,centimetres:Ke*100,degrees:360/(2*Math.PI),feet:Ke*3.28084,inches:Ke*39.37,kilometers:Ke/1e3,kilometres:Ke/1e3,meters:Ke,metres:Ke,miles:Ke/1609.344,millimeters:Ke*1e3,millimetres:Ke*1e3,nauticalmiles:Ke/1852,radians:1,yards:Ke*1.0936};function Lt(t,i,r={}){const a={type:"Feature"};return(r.id===0||r.id)&&(a.id=r.id),r.bbox&&(a.bbox=r.bbox),a.properties=i||{},a.geometry=t,a}function df(t,i,r={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!yf(t[0])||!yf(t[1]))throw new Error("coordinates must contain numbers");return Lt({type:"Point",coordinates:t},i,r)}function ta(t,i,r={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return Lt({type:"LineString",coordinates:t},i,r)}function mf(t,i="kilometers"){const r=gf[i];if(!r)throw new Error(i+" units is invalid");return t*r}function Z0(t,i="kilometers"){const r=gf[i];if(!r)throw new Error(i+" units is invalid");return t/r}function zr(t){return t%360*Math.PI/180}function vf(t,i="kilometers",r="kilometers"){if(!(t>=0))throw new Error("length must be a positive number");return mf(Z0(t,i),r)}function yf(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function Vr(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return[...t.geometry.coordinates];if(t.type==="Point")return[...t.coordinates]}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function _f(t,i,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||t.type!=="Feature"||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==i)throw new Error("Invalid input to "+r+": must be a "+i+", given "+t.geometry.type)}function J0(t,i,r={}){var a=Vr(t),s=Vr(i),f=zr(s[1]-a[1]),l=zr(s[0]-a[0]),h=zr(a[1]),d=zr(s[1]),g=Math.pow(Math.sin(f/2),2)+Math.pow(Math.sin(l/2),2)*Math.cos(h)*Math.cos(d);return mf(2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)),r.units)}function bf(t,i,r){if(t!==null)for(var a,s,f,l,h,d,g,y=0,b=0,E,S=t.type,F=S==="FeatureCollection",P=S==="Feature",C=F?t.features.length:1,I=0;Id||F>g||P>y){h=b,d=a,g=F,y=P,f=0;return}var C=ta([h,b],r.properties);if(i(C,a,s,P,f)===!1)return!1;f++,h=b})===!1)return!1}}})}function ng(t,i,r={}){const a=Vr(t),s=Vr(i);s[0]+=s[0]-a[0]>180?-360:a[0]-s[0]>180?360:0;const f=tg(a,s);return vf(f,"meters",r.units)}function tg(t,i,r){r=r===void 0?Ke:Number(r);const a=r,s=t[1]*Math.PI/180,f=i[1]*Math.PI/180,l=f-s;let h=Math.abs(i[0]-t[0])*Math.PI/180;h>Math.PI&&(h-=2*Math.PI);const d=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),g=Math.abs(d)>1e-11?l/d:Math.cos(s);return Math.sqrt(l*l+g*g*h*h)*a}function rg(t,i,r={}){if(r.method||(r.method="geodesic"),r.units||(r.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=df(t):t.type==="Point"?t=Lt(t):_f(t,"Point","point"),!i)throw new Error("line is required");Array.isArray(i)?i=ta(i):i.type==="LineString"?i=Lt(i):_f(i,"LineString","line");let a=1/0;const s=t.geometry.coordinates;return eg(i,f=>{const l=f.geometry.coordinates[0],h=f.geometry.coordinates[1],d=ig(s,l,h,r);dnew It(t).setA(i??V0.alpha).RGBA,og=(t,i)=>or(t,i);function Un(t,i){return{width:t.width*i.scale.x,height:t.height*i.scale.y,x:t.x*i.scale.x+i.x,y:t.y*i.scale.y+i.y}}const ia={text:{draw(t,i,r){const a=t.label??t.text;if(a){const s=Un(t,{x:t["label-x"]??t.textX??0,y:t["label-y"]??t.textY??0,scale:{x:1,y:1}}),f=Un(s,r);i.font=`${(t["label-size"]??t.fontSize??4)*r.scale.x}px Inter`,i.fillStyle=or(t["label-color"]??t.fontColor??"grey",1),i.fillText(a,f.x,f.y)}},test(t){return{left:-1/0,right:1/0,top:-1/0,bottom:1/0}},narrow(){return!0}},path:{draw(t,i,r){const[a,...s]=t.points;i.beginPath(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=og(t.fill,t.alpha);const{x:f,y:l,width:h}=Un({...a,width:t["line-width"]??t.lineWidth,height:0},r);i.lineWidth=He(h),i.moveTo(He(f),He(l));for(const d of s){const{x:g,y}=Un({...d,width:0,height:0},r);i.lineTo(He(g),He(y))}i.stroke()},test(t){var r,a,s,f;const i=t["line-width"]??t.lineWidth;return{left:(((r=ue.minBy(t.points,"x"))==null?void 0:r.x)??0-i??0)-1,right:(((a=ue.maxBy(t.points,"x"))==null?void 0:a.x)??0+i??0)+1,top:(((s=ue.minBy(t.points,"y"))==null?void 0:s.y)??0-i??0)-1,bottom:(((f=ue.maxBy(t.points,"y"))==null?void 0:f.y)??0+i??0)+1}},narrow(t,i){return ug(df([i.x,i.y]),ta(t.points.map(({x:r,y:a})=>[r,a])))<500*t.lineWidth}},rect:{draw(t,i,r){const{x:a,y:s,width:f,height:l}=Un(t,r);i.fillStyle=or(t.fill,t.alpha),i.fillRect(He(a),He(s),He(f)||1,He(l)||1)},test(t){return{left:t.x,right:t.x+t.width,top:t.y,bottom:t.y+t.height}},narrow(){return!0}},polygon:{draw(t,i,r){const[a,...s]=t.points;i.beginPath(),i.fillStyle=or(t.fill,t.alpha);const{x:f,y:l}=Un({...a,width:0,height:0},r);i.moveTo(He(f),He(l));for(const h of s){const{x:d,y:g}=Un({...h,width:0,height:0},r);i.lineTo(He(d),He(g))}i.closePath(),i.fill()},test(t){var i,r,a,s;return{left:((i=ue.minBy(t.points,"x"))==null?void 0:i.x)??0,right:((r=ue.maxBy(t.points,"x"))==null?void 0:r.x)??0,top:((a=ue.minBy(t.points,"y"))==null?void 0:a.y)??0,bottom:((s=ue.maxBy(t.points,"y"))==null?void 0:s.y)??0}},narrow(){return!0}},circle:{draw(t,i,r){i.fillStyle=or(t.fill,t.alpha),i.beginPath();const a=Un({...t,width:t.radius,height:t.radius},r);i.ellipse(He(a.x),He(a.y),He(a.width),He(a.height),0,0,2*ag),i.fill()},test(t){return{left:t.x-t.radius,right:t.x+t.radius,top:t.y-t.radius,bottom:t.y+t.radius}},narrow(){return!0}}},sg=t=>new Error(`The component ${t.$} is not supported by this renderer.`);function wf(t,i,r,a){if(t in ia)ia[t].draw(i,r,a);else throw sg(i)}const fg=(t,i,r)=>{wf(t.$,t,i,r),(t.text||t.label)&&wf("text",t,i,r)},lg=({x:t,y:i})=>{const r=Math.abs(t),a=Math.abs(i),s=Math.max(r,a),f=2*s,l=Math.pow(f-1,2);return t==s&&i>-s?l+i-(-s+1):i==s?l+s-t+f-1:t==-s?l+s-i+2*f-1:i==-s?l+t+s+3*f-1:0};var cg={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ef=cg,hg=pg,xf={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function pg(t){var i,r=[],a=1,s;if(typeof t=="string")if(t=t.toLowerCase(),Ef[t])r=Ef[t].slice(),s="rgb";else if(t==="transparent")a=0,s="rgb",r=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var f=t.slice(1),l=f.length,h=l<=4;a=1,h?(r=[parseInt(f[0]+f[0],16),parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16)],l===4&&(a=parseInt(f[3]+f[3],16)/255)):(r=[parseInt(f[0]+f[1],16),parseInt(f[2]+f[3],16),parseInt(f[4]+f[5],16)],l===8&&(a=parseInt(f[6]+f[7],16)/255)),r[0]||(r[0]=0),r[1]||(r[1]=0),r[2]||(r[2]=0),s="rgb"}else if(i=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var d=i[1],g=d==="rgb",f=d.replace(/a$/,"");s=f;var l=f==="cmyk"?4:f==="gray"?1:3;r=i[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(E,S){if(/%$/.test(E))return S===l?parseFloat(E)/100:f==="rgb"?parseFloat(E)*255/100:parseFloat(E);if(f[S]==="h"){if(/deg$/.test(E))return parseFloat(E);if(xf[E]!==void 0)return xf[E]}return parseFloat(E)}),d===f&&r.push(1),a=g||r[l]===void 0?1:r[l],r=r.slice(0,l)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(r=t.match(/([0-9]+)/g).map(function(y){return parseFloat(y)}),s=t.match(/([a-z])/ig).join("").toLowerCase());else isNaN(t)?Array.isArray(t)||t.length?(r=[t[0],t[1],t[2]],s="rgb",a=t.length===4?t[3]:1):t instanceof Object&&(t.r!=null||t.red!=null||t.R!=null?(s="rgb",r=[t.r||t.red||t.R||0,t.g||t.green||t.G||0,t.b||t.blue||t.B||0]):(s="hsl",r=[t.h||t.hue||t.H||0,t.s||t.saturation||t.S||0,t.l||t.lightness||t.L||t.b||t.brightness]),a=t.a||t.alpha||t.opacity||1,t.opacity!=null&&(a/=100)):(s="rgb",r=[t>>>16,(t&65280)>>>8,t&255]);return{space:s,values:r,alpha:a}}var gg={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},dg=gg,mg={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var i=t[0]/360,r=t[1]/100,a=t[2]/100,s,f,l,h,d;if(r===0)return d=a*255,[d,d,d];a<.5?f=a*(1+r):f=a+r-a*r,s=2*a-f,h=[0,0,0];for(var g=0;g<3;g++)l=i+1/3*-(g-1),l<0?l++:l>1&&l--,6*l<1?d=s+(f-s)*6*l:2*l<1?d=f:3*l<2?d=s+(f-s)*(2/3-l)*6:d=s,h[g]=d*255;return h}};dg.hsl=function(t){var i=t[0]/255,r=t[1]/255,a=t[2]/255,s=Math.min(i,r,a),f=Math.max(i,r,a),l=f-s,h,d,g;return f===s?h=0:i===f?h=(r-a)/l:r===f?h=2+(a-i)/l:a===f&&(h=4+(i-r)/l),h=Math.min(h*60,360),h<0&&(h+=360),g=(s+f)/2,f===s?d=0:g<=.5?d=l/(f+s):d=l/(2-f-s),[h,d*100,g*100]};function vg(t,i,r){return t*(1-r)+i*r}var yg=vg,_g=bg;function bg(t,i,r){return ir?r:t:ti?i:t}const Ag=hg,wg=mg,Eg=yg,xg=_g;var Sg=Cg;function Cg(t){return t=t.map(function(i){if(i=Ag(i),i.space!="rgb"){if(i.space!="hsl")throw"c.spacespace is not supported.";i.values=wg.rgb(i.values)}return i.values.push(i.alpha),i.values}),function(i,r){r=r||Eg,i=xg(i,0,1);var a=(t.length-1)*i,s=Math.floor(a),f=Math.ceil(a);i=a-s;var l=t[s],h=t[f],d=l.map(function(g,y){return g=r(g,h[y],i),y<3&&(g=Math.round(g)),g});return d[3]===1?"rgb("+d.slice(0,3)+")":"rgba("+d+")"}}var Rg=we(Sg);const Sf=JSON.stringify,{log2:Ig,max:Lg}=Math,Cf=t=>ue.floor(Ig(t+1));function Bg(t,i){return ue.chain(t).split(" ").reduce((r,a)=>a.length+r.width>i?{text:`${r.text} +${a} `,width:a.length+1}:{text:`${r.text}${a} `,width:r.width+a.length+1},{width:0,text:""}).value().text}function Mg({right:t,left:i,bottom:r,top:a},s){const f=Lg(Cf(t-i),Cf(r-a))-s,l=2**f,h={left:ue.floor(i/l),right:ue.ceil((t+1)/l),top:ue.floor(a/l),bottom:ue.ceil((r+1)/l)};return{zoom:f,order:l,tiles:ue.shuffle(ph({x:ue.range(h.left,h.right+1),y:ue.range(h.top,h.bottom+1)}).map(d=>{const g=d.x*l,y=d.y*l;return{tile:d,bounds:{left:g-l/2,right:g+l/2,top:y-l/2,bottom:y+l/2}}}))}}const Og=200,Zr=t=>ue.isNumber(t)&&!isNaN(t);class Fg extends R0{constructor(){super(...arguments);Rn(this,Pe);Rn(this,ze);Rn(this,Bt);Rn(this,Xn);Rn(this,kn);Rn(this,sr);Rn(this,Mt);Rn(this,ft);Rn(this,Ot);dn(this,ze,x0),dn(this,Bt,{bottom:256,top:0,left:0,right:256}),dn(this,Xn,new E0(16)),dn(this,kn,{}),dn(this,sr,0),dn(this,Mt,{}),dn(this,ft,{}),this.loadFont=ue.once(async()=>{try{const r=new FontFace("Inter","local('Inter'), local('Inter UI'), url('/fonts/inter.woff2') format('woff2'), url(https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format('woff2'), local('-apple-system'), local('BlinkMacSystemFont'), local('Arial'), local('Helvetica'), local('sans-serif')");self.fonts.add(r),await r.load()}catch(r){console.warn(r)}}),dn(this,Ot,ue.once(()=>ue.debounce(()=>this.render(),pe(this,ze).refreshInterval,{leading:!1,trailing:!0}))),this.renderTile=d0((r,a)=>In(this,Pe,hh).call(this,r,a),{normalizer:JSON.stringify,max:Og})}getView(){return{system:pe(this,Xn),world:pe(this,kn)}}setFrustum(r){dn(this,Bt,r),pe(this,Ot).call(this)()}setTileResolution(r){ue.isEqual(r,pe(this,ze).tileResolution)||(Object.assign(pe(this,ze),{tileResolution:r}),In(this,Pe,Mr).call(this))}add(r,a){const s=ue.map(r,({component:l,meta:h})=>({...ia[l.$].test(l),component:l,meta:ue.pick(h,"sourceLayerIndex","sourceLayerAlpha","sourceLayerDisplayMode"),index:In(this,Pe,sh).call(this)})),f=s.find(l=>!Zr(l.top)||!Zr(l.bottom)||!Zr(l.left)||!Zr(l.right));if(f){pe(this,ft)[a]=`Component '${f.component.$}' is missing properties. Check these: width, height, x, y.`;return}pe(this,Xn).load(s),pe(this,kn)[a]=s,In(this,Pe,Mr).call(this)}remove(r){ue.map(pe(this,kn)[r],a=>{pe(this,Xn).remove(a)}),delete pe(this,kn)[r],delete pe(this,ft)[r],In(this,Pe,Mr).call(this)}setup(r){dn(this,ze,r),In(this,Pe,Mr).call(this)}async render(){await this.loadFont();for(const{tile:r,bounds:a}of Mg(pe(this,Bt),pe(this,ze).tileSubdivision).tiles)if(In(this,Pe,fh).call(this,r)){const s=this.renderTile(a,pe(this,ze).tileResolution);s&&this.emit("message",{action:"update",payload:{bounds:a,bitmap:s}},[])}}}ze=new WeakMap,Bt=new WeakMap,Xn=new WeakMap,kn=new WeakMap,sr=new WeakMap,Pe=new WeakSet,sh=function(){return oh(this,sr)._++},Mt=new WeakMap,ft=new WeakMap,Mr=function(){this.renderTile.clear(),pe(this,Ot).call(this)()},Ot=new WeakMap,fh=function({x:r,y:a}){const{workerCount:s,workerIndex:f}=pe(this,ze);return lg({x:r,y:a})%s===f},lh=function(){const{tileResolution:r,tileSubdivision:a}=pe(this,ze);return r.width*2**a/4096},ch=function(r,a=""){const{errorColor:l,backgroundColor:h}=pe(this,ze),d=new OffscreenCanvas(r.width,r.height),g=d.getContext("2d",{alpha:!1}),y=In(this,Pe,lh).call(this);g.fillStyle=Rg([h,l])(.05),g.fillRect(0,0,r.width,r.height),g.font=`${y*64}px Inter, Helvetica, Arial, sans-serif`,g.fillStyle=l;for(const[b,E]of Bg(ue.truncate(a,{length:100}),28).split(` +`).map((...S)=>S))g.fillText(b,y*64,y*64*2+76*y*E);return g.lineWidth=y*.5,g.strokeStyle=l,g.strokeRect(0,0,r.width,r.height),d},hh=function(r,a){try{const s=ue.values(pe(this,ft)).find(ue.identity);if(s)throw new Error(s);const{top:f,right:l,bottom:h,left:d}=r,g={x:a.width/(l-d),y:a.height/(h-f)},y=ue.sortBy(pe(this,Xn).search({minX:d,maxX:l,maxY:h,minY:f}),"index"),b=Sf(ue.map(y,"index")),E=Sf([f,l,h,d,a.width,a.height]),S=pe(this,Mt)[E];if(!S||b!==S.hash){const F=new OffscreenCanvas(a.width,a.height),P=F.getContext("2d",{alpha:!1});P.imageSmoothingEnabled=!1,P.fillStyle=pe(this,ze).backgroundColor,P.fillRect(0,0,a.width,a.height);const C=a.width*.05,I=1;P.fillStyle="rgba(127,127,127,0.36)",P.fillRect((a.width-C)/2,(a.height-I)/2,C,I),P.fillRect((a.width-I)/2,(a.height-C)/2,I,C),ue.chain(y).sortBy(x=>{var B;return-(((B=x.meta)==null?void 0:B.sourceLayerIndex)??0)}).groupBy(x=>{var B;return((B=x.meta)==null?void 0:B.sourceLayerIndex)??0}).forEach(x=>{var ce,Ve,Ft,Jr;const B=new OffscreenCanvas(a.width,a.height),G=B.getContext("2d");for(const{component:ua}of x)fg(ua,G,{scale:g,x:-d*g.x,y:-f*g.y});const W=((Ve=(ce=ue.head(x))==null?void 0:ce.meta)==null?void 0:Ve.sourceLayerAlpha)??1,re=((Jr=(Ft=ue.head(x))==null?void 0:Ft.meta)==null?void 0:Jr.sourceLayerDisplayMode)??"source-over";P.globalCompositeOperation=re,P.globalAlpha=W,P.drawImage(B,0,0)}).value();const T=F.transferToImageBitmap();return pe(this,Mt)[E]={hash:b,tile:T},T}else return S.tile}catch(s){return console.error(s),In(this,Pe,ch).call(this,a,ue.get(s,"message")).transferToImageBitmap()}};const Rf=new Fg;Rf.on("message",(t,i)=>self.postMessage(t,i)),self.onmessage=t=>{const{action:i,payload:r}=t.data;Rf[i](...r)}})(); diff --git a/assets/getGridSymbols.worker-BM9IxXsn.js b/assets/getGridSymbols.worker-BM9IxXsn.js new file mode 100644 index 0000000..78bd8ec --- /dev/null +++ b/assets/getGridSymbols.worker-BM9IxXsn.js @@ -0,0 +1,27 @@ +(function(){"use strict";var zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_e={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 + */_e.exports,function(h,w){(function(){var f,M="4.17.21",F=200,B="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",E="Expected a function",rn="Invalid `variable` option passed into `_.template`",Q="__lodash_hash_undefined__",G=500,k="__lodash_placeholder__",an=1,N=2,z=4,pn=1,ln=2,T=1,_n=2,C=4,A=8,D=16,Z=32,X=64,j=128,sn=256,Br=512,Ts=30,Es="...",Cs=800,Ls=16,$u=1,Ps=2,Fs=3,dt=1/0,ot=9007199254740991,Ws=17976931348623157e292,we=NaN,Yn=4294967295,Ms=Yn-1,Bs=Yn>>>1,Us=[["ary",j],["bind",T],["bindKey",_n],["curry",A],["curryRight",D],["flip",Br],["partial",Z],["partialRight",X],["rearg",sn]],Tt="[object Arguments]",me="[object Array]",Ds="[object AsyncFunction]",Yt="[object Boolean]",Xt="[object Date]",qs="[object DOMException]",xe="[object Error]",ye="[object Function]",Nu="[object GeneratorFunction]",Nn="[object Map]",Jt="[object Number]",$s="[object Null]",Vn="[object Object]",Gu="[object Promise]",Ns="[object Proxy]",Qt="[object RegExp]",Gn="[object Set]",Vt="[object String]",Ae="[object Symbol]",Gs="[object Undefined]",kt="[object WeakMap]",Hs="[object WeakSet]",jt="[object ArrayBuffer]",Et="[object DataView]",Ur="[object Float32Array]",Dr="[object Float64Array]",qr="[object Int8Array]",$r="[object Int16Array]",Nr="[object Int32Array]",Gr="[object Uint8Array]",Hr="[object Uint8ClampedArray]",zr="[object Uint16Array]",Kr="[object Uint32Array]",zs=/\b__p \+= '';/g,Ks=/\b(__p \+=) '' \+/g,Zs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Hu=/&(?:amp|lt|gt|quot|#39);/g,zu=/[&<>"']/g,Ys=RegExp(Hu.source),Xs=RegExp(zu.source),Js=/<%-([\s\S]+?)%>/g,Qs=/<%([\s\S]+?)%>/g,Ku=/<%=([\s\S]+?)%>/g,Vs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ks=/^\w*$/,js=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zr=/[\\^$.*+?()[\]{}|]/g,nl=RegExp(Zr.source),Yr=/^\s+/,tl=/\s/,el=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,rl=/\{\n\/\* \[wrapped with (.+)\] \*/,il=/,? & /,ul=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fl=/[()=,{}\[\]\/\s]/,ol=/\\(\\)?/g,al=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Zu=/\w*$/,sl=/^[-+]0x[0-9a-f]+$/i,ll=/^0b[01]+$/i,cl=/^\[object .+?Constructor\]$/,hl=/^0o[0-7]+$/i,gl=/^(?:0|[1-9]\d*)$/,pl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Se=/($^)/,_l=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",vl="\\u0300-\\u036f",dl="\\ufe20-\\ufe2f",wl="\\u20d0-\\u20ff",Yu=vl+dl+wl,Xu="\\u2700-\\u27bf",Ju="a-z\\xdf-\\xf6\\xf8-\\xff",ml="\\xac\\xb1\\xd7\\xf7",xl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yl="\\u2000-\\u206f",Al=" \\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",Qu="A-Z\\xc0-\\xd6\\xd8-\\xde",Vu="\\ufe0e\\ufe0f",ku=ml+xl+yl+Al,Xr="['’]",Sl="["+be+"]",ju="["+ku+"]",Ie="["+Yu+"]",nf="\\d+",bl="["+Xu+"]",tf="["+Ju+"]",ef="[^"+be+ku+nf+Xu+Ju+Qu+"]",Jr="\\ud83c[\\udffb-\\udfff]",Il="(?:"+Ie+"|"+Jr+")",rf="[^"+be+"]",Qr="(?:\\ud83c[\\udde6-\\uddff]){2}",Vr="[\\ud800-\\udbff][\\udc00-\\udfff]",Ct="["+Qu+"]",uf="\\u200d",ff="(?:"+tf+"|"+ef+")",Rl="(?:"+Ct+"|"+ef+")",of="(?:"+Xr+"(?:d|ll|m|re|s|t|ve))?",af="(?:"+Xr+"(?:D|LL|M|RE|S|T|VE))?",sf=Il+"?",lf="["+Vu+"]?",Ol="(?:"+uf+"(?:"+[rf,Qr,Vr].join("|")+")"+lf+sf+")*",Tl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",El="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",cf=lf+sf+Ol,Cl="(?:"+[bl,Qr,Vr].join("|")+")"+cf,Ll="(?:"+[rf+Ie+"?",Ie,Qr,Vr,Sl].join("|")+")",Pl=RegExp(Xr,"g"),Fl=RegExp(Ie,"g"),kr=RegExp(Jr+"(?="+Jr+")|"+Ll+cf,"g"),Wl=RegExp([Ct+"?"+tf+"+"+of+"(?="+[ju,Ct,"$"].join("|")+")",Rl+"+"+af+"(?="+[ju,Ct+ff,"$"].join("|")+")",Ct+"?"+ff+"+"+of,Ct+"+"+af,El,Tl,nf,Cl].join("|"),"g"),Ml=RegExp("["+uf+be+Yu+Vu+"]"),Bl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ul=["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"],Dl=-1,nn={};nn[Ur]=nn[Dr]=nn[qr]=nn[$r]=nn[Nr]=nn[Gr]=nn[Hr]=nn[zr]=nn[Kr]=!0,nn[Tt]=nn[me]=nn[jt]=nn[Yt]=nn[Et]=nn[Xt]=nn[xe]=nn[ye]=nn[Nn]=nn[Jt]=nn[Vn]=nn[Qt]=nn[Gn]=nn[Vt]=nn[kt]=!1;var V={};V[Tt]=V[me]=V[jt]=V[Et]=V[Yt]=V[Xt]=V[Ur]=V[Dr]=V[qr]=V[$r]=V[Nr]=V[Nn]=V[Jt]=V[Vn]=V[Qt]=V[Gn]=V[Vt]=V[Ae]=V[Gr]=V[Hr]=V[zr]=V[Kr]=!0,V[xe]=V[ye]=V[kt]=!1;var ql={À:"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"},$l={"&":"&","<":"<",">":">",'"':""","'":"'"},Nl={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Hl=parseFloat,zl=parseInt,hf=typeof zt=="object"&&zt&&zt.Object===Object&&zt,Kl=typeof self=="object"&&self&&self.Object===Object&&self,vn=hf||Kl||Function("return this")(),jr=w&&!w.nodeType&&w,wt=jr&&!0&&h&&!h.nodeType&&h,gf=wt&&wt.exports===jr,ni=gf&&hf.process,Fn=function(){try{var l=wt&&wt.require&&wt.require("util").types;return l||ni&&ni.binding&&ni.binding("util")}catch{}}(),pf=Fn&&Fn.isArrayBuffer,_f=Fn&&Fn.isDate,vf=Fn&&Fn.isMap,df=Fn&&Fn.isRegExp,wf=Fn&&Fn.isSet,mf=Fn&&Fn.isTypedArray;function On(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function Zl(l,p,g,x){for(var R=-1,H=l==null?0:l.length;++R-1}function ti(l,p,g){for(var x=-1,R=l==null?0:l.length;++x-1;);return g}function Of(l,p){for(var g=l.length;g--&&Lt(p,l[g],0)>-1;);return g}function tc(l,p){for(var g=l.length,x=0;g--;)l[g]===p&&++x;return x}var ec=ui(ql),rc=ui($l);function ic(l){return"\\"+Gl[l]}function uc(l,p){return l==null?f:l[p]}function Pt(l){return Ml.test(l)}function fc(l){return Bl.test(l)}function oc(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function si(l){var p=-1,g=Array(l.size);return l.forEach(function(x,R){g[++p]=[R,x]}),g}function Tf(l,p){return function(g){return l(p(g))}}function lt(l,p){for(var g=-1,x=l.length,R=0,H=[];++g-1}function Xc(n,t){var e=this.__data__,r=He(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}kn.prototype.clear=zc,kn.prototype.delete=Kc,kn.prototype.get=Zc,kn.prototype.has=Yc,kn.prototype.set=Xc;function jn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function Un(n,t,e,r,i,o){var a,s=t&an,c=t&N,_=t&z;if(e&&(a=i?e(n,r,i,o):e(n)),a!==f)return a;if(!en(n))return n;var v=O(n);if(v){if(a=kh(n),!s)return Sn(n,a)}else{var d=mn(n),m=d==ye||d==Nu;if(vt(n))return lo(n,s);if(d==Vn||d==Tt||m&&!i){if(a=c||m?{}:Co(n),!s)return c?Nh(n,lh(a,n)):$h(n,$f(a,n))}else{if(!V[d])return i?n:{};a=jh(n,d,s)}}o||(o=new zn);var y=o.get(n);if(y)return y;o.set(n,a),ua(n)?n.forEach(function(I){a.add(Un(I,t,e,I,n,o))}):ra(n)&&n.forEach(function(I,U){a.set(U,Un(I,t,e,U,n,o))});var b=_?c?Mi:Wi:c?In:gn,P=v?f:b(n);return Wn(P||n,function(I,U){P&&(U=I,I=n[U]),fe(a,U,Un(I,t,e,U,n,o))}),a}function ch(n){var t=gn(n);return function(e){return Nf(e,n,t)}}function Nf(n,t,e){var r=e.length;if(n==null)return!r;for(n=J(n);r--;){var i=e[r],o=t[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function Gf(n,t,e){if(typeof n!="function")throw new Mn(E);return ge(function(){n.apply(f,e)},t)}function oe(n,t,e,r){var i=-1,o=Re,a=!0,s=n.length,c=[],_=t.length;if(!s)return c;e&&(t=tn(t,Tn(e))),r?(o=ti,a=!1):t.length>=F&&(o=ne,a=!1,t=new yt(t));n:for(;++ii?0:i+e),r=r===f||r>i?i:L(r),r<0&&(r+=i),r=e>r?0:oa(r);e0&&e(s)?t>1?dn(s,t-1,e,r,i):st(i,s):r||(i[i.length]=s)}return i}var vi=vo(),Kf=vo(!0);function Xn(n,t){return n&&vi(n,t,gn)}function di(n,t){return n&&Kf(n,t,gn)}function Ke(n,t){return at(t,function(e){return it(n[e])})}function St(n,t){t=pt(t,n);for(var e=0,r=t.length;n!=null&&et}function ph(n,t){return n!=null&&Y.call(n,t)}function _h(n,t){return n!=null&&t in J(n)}function vh(n,t,e){return n>=wn(t,e)&&n=120&&v.length>=120)?new yt(a&&v):f}v=n[0];var d=-1,m=s[0];n:for(;++d-1;)s!==n&&Be.call(s,c,1),Be.call(n,c,1);return n}function eo(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==o){var o=i;rt(i)?Be.call(n,i,1):Oi(n,i)}}return n}function bi(n,t){return n+qe(Bf()*(t-n+1))}function Eh(n,t,e,r){for(var i=-1,o=hn(De((t-n)/(e||1)),0),a=g(o);o--;)a[r?o:++i]=n,n+=e;return a}function Ii(n,t){var e="";if(!n||t<1||t>ot)return e;do t%2&&(e+=n),t=qe(t/2),t&&(n+=n);while(t);return e}function W(n,t){return Gi(Fo(n,t,Rn),n+"")}function Ch(n){return qf(Ht(n))}function Lh(n,t){var e=Ht(n);return er(e,At(t,0,e.length))}function le(n,t,e,r){if(!en(n))return n;t=pt(t,n);for(var i=-1,o=t.length,a=o-1,s=n;s!=null&&++ii?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var o=g(i);++r>>1,a=n[o];a!==null&&!Cn(a)&&(e?a<=t:a=F){var _=t?null:Kh(n);if(_)return Te(_);a=!1,i=ne,c=new yt}else c=t?[]:s;n:for(;++r=r?n:Dn(n,t,e)}var so=Ac||function(n){return vn.clearTimeout(n)};function lo(n,t){if(t)return n.slice();var e=n.length,r=Lf?Lf(e):new n.constructor(e);return n.copy(r),r}function Li(n){var t=new n.constructor(n.byteLength);return new We(t).set(new We(n)),t}function Bh(n,t){var e=t?Li(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function Uh(n){var t=new n.constructor(n.source,Zu.exec(n));return t.lastIndex=n.lastIndex,t}function Dh(n){return ue?J(ue.call(n)):{}}function co(n,t){var e=t?Li(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function ho(n,t){if(n!==t){var e=n!==f,r=n===null,i=n===n,o=Cn(n),a=t!==f,s=t===null,c=t===t,_=Cn(t);if(!s&&!_&&!o&&n>t||o&&a&&c&&!s&&!_||r&&a&&c||!e&&c||!i)return 1;if(!r&&!o&&!_&&n=s)return c;var _=e[r];return c*(_=="desc"?-1:1)}}return n.index-t.index}function go(n,t,e,r){for(var i=-1,o=n.length,a=e.length,s=-1,c=t.length,_=hn(o-a,0),v=g(c+_),d=!r;++s1?e[i-1]:f,a=i>2?e[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&yn(e[0],e[1],a)&&(o=i<3?f:o,i=1),t=J(t);++r-1?i[o?t[a]:a]:f}}function xo(n){return et(function(t){var e=t.length,r=e,i=Bn.prototype.thru;for(n&&t.reverse();r--;){var o=t[r];if(typeof o!="function")throw new Mn(E);if(i&&!a&&nr(o)=="wrapper")var a=new Bn([],!0)}for(r=a?r:e;++r1&&$.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(t);if(_&&v)return _==t&&v==n;var d=-1,m=!0,y=e&ln?new yt:f;for(o.set(n,t),o.set(t,n);++d1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(el,`{ +/* [wrapped with `+t+`] */ +`)}function tg(n){return O(n)||Rt(n)||!!(Wf&&n&&n[Wf])}function rt(n,t){var e=typeof n;return t=t??ot,!!t&&(e=="number"||e!="symbol"&&gl.test(n))&&n>-1&&n%1==0&&n0){if(++t>=Cs)return arguments[0]}else t=0;return n.apply(f,arguments)}}function er(n,t){var e=-1,r=n.length,i=r-1;for(t=t===f?r:t;++e1?n[t-1]:f;return e=typeof e=="function"?(n.pop(),e):f,Ko(n,e)});function Zo(n){var t=u(n);return t.__chain__=!0,t}function hp(n,t){return t(n),n}function rr(n,t){return t(n)}var gp=et(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,i=function(o){return _i(o,n)};return t>1||this.__actions__.length||!(r instanceof q)||!rt(e)?this.thru(i):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:rr,args:[i],thisArg:f}),new Bn(r,this.__chain__).thru(function(o){return t&&!o.length&&o.push(f),o}))});function pp(){return Zo(this)}function _p(){return new Bn(this.value(),this.__chain__)}function vp(){this.__values__===f&&(this.__values__=fa(this.value()));var n=this.__index__>=this.__values__.length,t=n?f:this.__values__[this.__index__++];return{done:n,value:t}}function dp(){return this}function wp(n){for(var t,e=this;e instanceof Ge;){var r=qo(e);r.__index__=0,r.__values__=f,t?i.__wrapped__=r:t=r;var i=r;e=e.__wrapped__}return i.__wrapped__=n,t}function mp(){var n=this.__wrapped__;if(n instanceof q){var t=n;return this.__actions__.length&&(t=new q(this)),t=t.reverse(),t.__actions__.push({func:rr,args:[Hi],thisArg:f}),new Bn(t,this.__chain__)}return this.thru(Hi)}function xp(){return oo(this.__wrapped__,this.__actions__)}var yp=Je(function(n,t,e){Y.call(n,e)?++n[e]:nt(n,e,1)});function Ap(n,t,e){var r=O(n)?xf:hh;return e&&yn(n,t,e)&&(t=f),r(n,S(t,3))}function Sp(n,t){var e=O(n)?at:zf;return e(n,S(t,3))}var bp=mo($o),Ip=mo(No);function Rp(n,t){return dn(ir(n,t),1)}function Op(n,t){return dn(ir(n,t),dt)}function Tp(n,t,e){return e=e===f?1:L(e),dn(ir(n,t),e)}function Yo(n,t){var e=O(n)?Wn:ht;return e(n,S(t,3))}function Xo(n,t){var e=O(n)?Yl:Hf;return e(n,S(t,3))}var Ep=Je(function(n,t,e){Y.call(n,e)?n[e].push(t):nt(n,e,[t])});function Cp(n,t,e,r){n=bn(n)?n:Ht(n),e=e&&!r?L(e):0;var i=n.length;return e<0&&(e=hn(i+e,0)),sr(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&Lt(n,t,e)>-1}var Lp=W(function(n,t,e){var r=-1,i=typeof t=="function",o=bn(n)?g(n.length):[];return ht(n,function(a){o[++r]=i?On(t,a,e):ae(a,t,e)}),o}),Pp=Je(function(n,t,e){nt(n,e,t)});function ir(n,t){var e=O(n)?tn:Qf;return e(n,S(t,3))}function Fp(n,t,e,r){return n==null?[]:(O(t)||(t=t==null?[]:[t]),e=r?f:e,O(e)||(e=e==null?[]:[e]),no(n,t,e))}var Wp=Je(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function Mp(n,t,e){var r=O(n)?ei:bf,i=arguments.length<3;return r(n,S(t,4),e,i,ht)}function Bp(n,t,e){var r=O(n)?Xl:bf,i=arguments.length<3;return r(n,S(t,4),e,i,Hf)}function Up(n,t){var e=O(n)?at:zf;return e(n,or(S(t,3)))}function Dp(n){var t=O(n)?qf:Ch;return t(n)}function qp(n,t,e){(e?yn(n,t,e):t===f)?t=1:t=L(t);var r=O(n)?oh:Lh;return r(n,t)}function $p(n){var t=O(n)?ah:Fh;return t(n)}function Np(n){if(n==null)return 0;if(bn(n))return sr(n)?Ft(n):n.length;var t=mn(n);return t==Nn||t==Gn?n.size:yi(n).length}function Gp(n,t,e){var r=O(n)?ri:Wh;return e&&yn(n,t,e)&&(t=f),r(n,S(t,3))}var Hp=W(function(n,t){if(n==null)return[];var e=t.length;return e>1&&yn(n,t[0],t[1])?t=[]:e>2&&yn(t[0],t[1],t[2])&&(t=[t[0]]),no(n,dn(t,1),[])}),ur=Sc||function(){return vn.Date.now()};function zp(n,t){if(typeof t!="function")throw new Mn(E);return n=L(n),function(){if(--n<1)return t.apply(this,arguments)}}function Jo(n,t,e){return t=e?f:t,t=n&&t==null?n.length:t,tt(n,j,f,f,f,f,t)}function Qo(n,t){var e;if(typeof t!="function")throw new Mn(E);return n=L(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=f),e}}var Ki=W(function(n,t,e){var r=T;if(e.length){var i=lt(e,Nt(Ki));r|=Z}return tt(n,r,t,e,i)}),Vo=W(function(n,t,e){var r=T|_n;if(e.length){var i=lt(e,Nt(Vo));r|=Z}return tt(t,r,n,e,i)});function ko(n,t,e){t=e?f:t;var r=tt(n,A,f,f,f,f,f,t);return r.placeholder=ko.placeholder,r}function jo(n,t,e){t=e?f:t;var r=tt(n,D,f,f,f,f,f,t);return r.placeholder=jo.placeholder,r}function na(n,t,e){var r,i,o,a,s,c,_=0,v=!1,d=!1,m=!0;if(typeof n!="function")throw new Mn(E);t=$n(t)||0,en(e)&&(v=!!e.leading,d="maxWait"in e,o=d?hn($n(e.maxWait)||0,t):o,m="trailing"in e?!!e.trailing:m);function y(on){var Zn=r,ft=i;return r=i=f,_=on,a=n.apply(ft,Zn),a}function b(on){return _=on,s=ge(U,t),v?y(on):a}function P(on){var Zn=on-c,ft=on-_,ma=t-Zn;return d?wn(ma,o-ft):ma}function I(on){var Zn=on-c,ft=on-_;return c===f||Zn>=t||Zn<0||d&&ft>=o}function U(){var on=ur();if(I(on))return $(on);s=ge(U,P(on))}function $(on){return s=f,m&&r?y(on):(r=i=f,a)}function Ln(){s!==f&&so(s),_=0,r=c=i=s=f}function An(){return s===f?a:$(ur())}function Pn(){var on=ur(),Zn=I(on);if(r=arguments,i=this,c=on,Zn){if(s===f)return b(c);if(d)return so(s),s=ge(U,t),y(c)}return s===f&&(s=ge(U,t)),a}return Pn.cancel=Ln,Pn.flush=An,Pn}var Kp=W(function(n,t){return Gf(n,1,t)}),Zp=W(function(n,t,e){return Gf(n,$n(t)||0,e)});function Yp(n){return tt(n,Br)}function fr(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new Mn(E);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=e.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return e.cache=o.set(i,a)||o,a};return e.cache=new(fr.Cache||jn),e}fr.Cache=jn;function or(n){if(typeof n!="function")throw new Mn(E);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Xp(n){return Qo(2,n)}var Jp=Mh(function(n,t){t=t.length==1&&O(t[0])?tn(t[0],Tn(S())):tn(dn(t,1),Tn(S()));var e=t.length;return W(function(r){for(var i=-1,o=wn(r.length,e);++i=t}),Rt=Yf(function(){return arguments}())?Yf:function(n){return un(n)&&Y.call(n,"callee")&&!Ff.call(n,"callee")},O=g.isArray,l_=pf?Tn(pf):wh;function bn(n){return n!=null&&ar(n.length)&&!it(n)}function fn(n){return un(n)&&bn(n)}function c_(n){return n===!0||n===!1||un(n)&&xn(n)==Yt}var vt=Ic||ru,h_=_f?Tn(_f):mh;function g_(n){return un(n)&&n.nodeType===1&&!pe(n)}function p_(n){if(n==null)return!0;if(bn(n)&&(O(n)||typeof n=="string"||typeof n.splice=="function"||vt(n)||Gt(n)||Rt(n)))return!n.length;var t=mn(n);if(t==Nn||t==Gn)return!n.size;if(he(n))return!yi(n).length;for(var e in n)if(Y.call(n,e))return!1;return!0}function __(n,t){return se(n,t)}function v_(n,t,e){e=typeof e=="function"?e:f;var r=e?e(n,t):f;return r===f?se(n,t,f,e):!!r}function Yi(n){if(!un(n))return!1;var t=xn(n);return t==xe||t==qs||typeof n.message=="string"&&typeof n.name=="string"&&!pe(n)}function d_(n){return typeof n=="number"&&Mf(n)}function it(n){if(!en(n))return!1;var t=xn(n);return t==ye||t==Nu||t==Ds||t==Ns}function ea(n){return typeof n=="number"&&n==L(n)}function ar(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ot}function en(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function un(n){return n!=null&&typeof n=="object"}var ra=vf?Tn(vf):yh;function w_(n,t){return n===t||xi(n,t,Ui(t))}function m_(n,t,e){return e=typeof e=="function"?e:f,xi(n,t,Ui(t),e)}function x_(n){return ia(n)&&n!=+n}function y_(n){if(ig(n))throw new R(B);return Xf(n)}function A_(n){return n===null}function S_(n){return n==null}function ia(n){return typeof n=="number"||un(n)&&xn(n)==Jt}function pe(n){if(!un(n)||xn(n)!=Vn)return!1;var t=Me(n);if(t===null)return!0;var e=Y.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Le.call(e)==mc}var Xi=df?Tn(df):Ah;function b_(n){return ea(n)&&n>=-ot&&n<=ot}var ua=wf?Tn(wf):Sh;function sr(n){return typeof n=="string"||!O(n)&&un(n)&&xn(n)==Vt}function Cn(n){return typeof n=="symbol"||un(n)&&xn(n)==Ae}var Gt=mf?Tn(mf):bh;function I_(n){return n===f}function R_(n){return un(n)&&mn(n)==kt}function O_(n){return un(n)&&xn(n)==Hs}var T_=je(Ai),E_=je(function(n,t){return n<=t});function fa(n){if(!n)return[];if(bn(n))return sr(n)?Hn(n):Sn(n);if(te&&n[te])return oc(n[te]());var t=mn(n),e=t==Nn?si:t==Gn?Te:Ht;return e(n)}function ut(n){if(!n)return n===0?n:0;if(n=$n(n),n===dt||n===-dt){var t=n<0?-1:1;return t*Ws}return n===n?n:0}function L(n){var t=ut(n),e=t%1;return t===t?e?t-e:t:0}function oa(n){return n?At(L(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return we;if(en(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=en(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=If(n);var e=ll.test(n);return e||hl.test(n)?zl(n.slice(2),e?2:8):sl.test(n)?we:+n}function aa(n){return Jn(n,In(n))}function C_(n){return n?At(L(n),-ot,ot):n===0?n:0}function K(n){return n==null?"":En(n)}var L_=qt(function(n,t){if(he(t)||bn(t)){Jn(t,gn(t),n);return}for(var e in t)Y.call(t,e)&&fe(n,e,t[e])}),sa=qt(function(n,t){Jn(t,In(t),n)}),lr=qt(function(n,t,e,r){Jn(t,In(t),n,r)}),P_=qt(function(n,t,e,r){Jn(t,gn(t),n,r)}),F_=et(_i);function W_(n,t){var e=Dt(n);return t==null?e:$f(e,t)}var M_=W(function(n,t){n=J(n);var e=-1,r=t.length,i=r>2?t[2]:f;for(i&&yn(t[0],t[1],i)&&(r=1);++e1),o}),Jn(n,Mi(n),e),r&&(e=Un(e,an|N|z,Zh));for(var i=t.length;i--;)Oi(e,t[i]);return e});function j_(n,t){return ca(n,or(S(t)))}var nv=et(function(n,t){return n==null?{}:Oh(n,t)});function ca(n,t){if(n==null)return{};var e=tn(Mi(n),function(r){return[r]});return t=S(t),to(n,e,function(r,i){return t(r,i[0])})}function tv(n,t,e){t=pt(t,n);var r=-1,i=t.length;for(i||(i=1,n=f);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var i=Bf();return wn(n+i*(t-n+Hl("1e-"+((i+"").length-1))),t)}return bi(n,t)}var hv=$t(function(n,t,e){return t=t.toLowerCase(),n+(e?pa(t):t)});function pa(n){return Vi(K(n).toLowerCase())}function _a(n){return n=K(n),n&&n.replace(pl,ec).replace(Fl,"")}function gv(n,t,e){n=K(n),t=En(t);var r=n.length;e=e===f?r:At(L(e),0,r);var i=e;return e-=t.length,e>=0&&n.slice(e,i)==t}function pv(n){return n=K(n),n&&Xs.test(n)?n.replace(zu,rc):n}function _v(n){return n=K(n),n&&nl.test(n)?n.replace(Zr,"\\$&"):n}var vv=$t(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),dv=$t(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),wv=wo("toLowerCase");function mv(n,t,e){n=K(n),t=L(t);var r=t?Ft(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return ke(qe(i),e)+n+ke(De(i),e)}function xv(n,t,e){n=K(n),t=L(t);var r=t?Ft(n):0;return t&&r>>0,e?(n=K(n),n&&(typeof t=="string"||t!=null&&!Xi(t))&&(t=En(t),!t&&Pt(n))?_t(Hn(n),0,e):n.split(t,e)):[]}var Ov=$t(function(n,t,e){return n+(e?" ":"")+Vi(t)});function Tv(n,t,e){return n=K(n),e=e==null?0:At(L(e),0,n.length),t=En(t),n.slice(e,e+t.length)==t}function Ev(n,t,e){var r=u.templateSettings;e&&yn(n,t,e)&&(t=f),n=K(n),t=lr({},t,r,Io);var i=lr({},t.imports,r.imports,Io),o=gn(i),a=ai(i,o),s,c,_=0,v=t.interpolate||Se,d="__p += '",m=li((t.escape||Se).source+"|"+v.source+"|"+(v===Ku?al:Se).source+"|"+(t.evaluate||Se).source+"|$","g"),y="//# sourceURL="+(Y.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Dl+"]")+` +`;n.replace(m,function(I,U,$,Ln,An,Pn){return $||($=Ln),d+=n.slice(_,Pn).replace(_l,ic),U&&(s=!0,d+=`' + +__e(`+U+`) + +'`),An&&(c=!0,d+=`'; +`+An+`; +__p += '`),$&&(d+=`' + +((__t = (`+$+`)) == null ? '' : __t) + +'`),_=Pn+I.length,I}),d+=`'; +`;var b=Y.call(t,"variable")&&t.variable;if(!b)d=`with (obj) { +`+d+` +} +`;else if(fl.test(b))throw new R(rn);d=(c?d.replace(zs,""):d).replace(Ks,"$1").replace(Zs,"$1;"),d="function("+(b||"obj")+`) { +`+(b?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+d+`return __p +}`;var P=da(function(){return H(o,y+"return "+d).apply(f,a)});if(P.source=d,Yi(P))throw P;return P}function Cv(n){return K(n).toLowerCase()}function Lv(n){return K(n).toUpperCase()}function Pv(n,t,e){if(n=K(n),n&&(e||t===f))return If(n);if(!n||!(t=En(t)))return n;var r=Hn(n),i=Hn(t),o=Rf(r,i),a=Of(r,i)+1;return _t(r,o,a).join("")}function Fv(n,t,e){if(n=K(n),n&&(e||t===f))return n.slice(0,Ef(n)+1);if(!n||!(t=En(t)))return n;var r=Hn(n),i=Of(r,Hn(t))+1;return _t(r,0,i).join("")}function Wv(n,t,e){if(n=K(n),n&&(e||t===f))return n.replace(Yr,"");if(!n||!(t=En(t)))return n;var r=Hn(n),i=Rf(r,Hn(t));return _t(r,i).join("")}function Mv(n,t){var e=Ts,r=Es;if(en(t)){var i="separator"in t?t.separator:i;e="length"in t?L(t.length):e,r="omission"in t?En(t.omission):r}n=K(n);var o=n.length;if(Pt(n)){var a=Hn(n);o=a.length}if(e>=o)return n;var s=e-Ft(r);if(s<1)return r;var c=a?_t(a,0,s).join(""):n.slice(0,s);if(i===f)return c+r;if(a&&(s+=c.length-s),Xi(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=li(i.source,K(Zu.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var d=_.index;c=c.slice(0,d===f?s:d)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function Bv(n){return n=K(n),n&&Ys.test(n)?n.replace(Hu,cc):n}var Uv=$t(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),Vi=wo("toUpperCase");function va(n,t,e){return n=K(n),t=e?f:t,t===f?fc(n)?pc(n):Vl(n):n.match(t)||[]}var da=W(function(n,t){try{return On(n,f,t)}catch(e){return Yi(e)?e:new R(e)}}),Dv=et(function(n,t){return Wn(t,function(e){e=Qn(e),nt(n,e,Ki(n[e],n))}),n});function qv(n){var t=n==null?0:n.length,e=S();return n=t?tn(n,function(r){if(typeof r[1]!="function")throw new Mn(E);return[e(r[0]),r[1]]}):[],W(function(r){for(var i=-1;++iot)return[];var e=Yn,r=wn(n,Yn);t=S(t),n-=Yn;for(var i=oi(r,t);++e0||t<0)?new q(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==f&&(t=L(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},q.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},q.prototype.toArray=function(){return this.take(Yn)},Xn(q.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=u[r?"take"+(t=="last"?"Right":""):t],o=r||/^find/.test(t);i&&(u.prototype[t]=function(){var a=this.__wrapped__,s=r?[1]:arguments,c=a instanceof q,_=s[0],v=c||O(a),d=function(U){var $=i.apply(u,st([U],s));return r&&m?$[0]:$};v&&e&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,y=!!this.__actions__.length,b=o&&!m,P=c&&!y;if(!o&&v){a=P?a:new q(this);var I=n.apply(a,s);return I.__actions__.push({func:rr,args:[d],thisArg:f}),new Bn(I,m)}return b&&P?n.apply(this,s):(I=this.thru(d),b?r?I.value()[0]:I.value():I)})}),Wn(["pop","push","shift","sort","splice","unshift"],function(n){var t=Ee[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(O(o)?o:[],i)}return this[e](function(a){return t.apply(O(a)?a:[],i)})}}),Xn(q.prototype,function(n,t){var e=u[t];if(e){var r=e.name+"";Y.call(Ut,r)||(Ut[r]=[]),Ut[r].push({name:t,func:e})}}),Ut[Qe(f,_n).name]=[{name:"wrapper",func:f}],q.prototype.clone=Bc,q.prototype.reverse=Uc,q.prototype.value=Dc,u.prototype.at=gp,u.prototype.chain=pp,u.prototype.commit=_p,u.prototype.next=vp,u.prototype.plant=wp,u.prototype.reverse=mp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=xp,u.prototype.first=u.prototype.head,te&&(u.prototype[te]=dp),u},Wt=_c();wt?((wt.exports=Wt)._=Wt,jr._=Wt):vn._=Wt}).call(zt)}(_e,_e.exports);var iu=_e.exports;const uu=" `.-':_,^=;><+!rc*/z?sLTv)J7(|Fi{C}fI31tlu[neoZ5Yxjya]2ESwqkP6h9d4VpOGbUAKXHm8RD#$Bg0MNWQ%&@";function xa(h){return iu.chain(uu).split("").indexOf(h).thru(w=>Math.max(w-3,0)/uu.length).value()}var ya=function(){},Aa=ya(),Ot=function(h){return h!==Aa&&h!==null},Sa=Ot,ba=Array.prototype.forEach,Ia=Object.create,Ra=function(h,w){var f;for(f in h)w[f]=h[f]},Oa=function(h){var w=Ia(null);return ba.call(arguments,function(f){Sa(f)&&Ra(Object(f),w)}),w},Ta=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},cr,fu;function Ea(){return fu||(fu=1,cr=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),cr}var Ca=Ta()?Math.sign:Ea(),La=Ca,Pa=Math.abs,Fa=Math.floor,Wa=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:La(h)*Fa(Pa(h)))},Ma=Wa,Ba=Math.max,Ua=function(h){return Ba(0,Ma(h))},ou=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},Da=Ot,au=function(h){if(!Da(h))throw new TypeError("Cannot use null or undefined");return h},qa={exports:{}},$a=function(){var h=Object.assign,w;return typeof h!="function"?!1:(w={foo:"raz"},h(w,{bar:"dwa"},{trzy:"trzy"}),w.foo+w.bar+w.trzy==="razdwatrzy")},hr,su;function Na(){return su||(su=1,hr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),hr}var gr,lu;function Ga(){if(lu)return gr;lu=1;var h=Ot,w=Object.keys;return gr=function(f){return w(h(f)?Object(f):f)},gr}var pr,cu;function Ha(){return cu||(cu=1,pr=Na()()?Object.keys:Ga()),pr}var _r,hu;function za(){if(hu)return _r;hu=1;var h=Ha(),w=au,f=Math.max;return _r=function(M,F){var B,E,rn=f(arguments.length,2),Q;for(M=Object(w(M)),Q=function(G){try{M[G]=F[G]}catch(k){B||(B=k)}},E=1;E-1},dr}var as=fs()?String.prototype.contains:os(),ve=vu,wu=us,mu=gu,xu=Oa,Kt=as,ss=_u.exports=function(h,w){var f,M,F,B,E;return arguments.length<2||typeof h!="string"?(B=w,w=h,h=null):B=arguments[2],ve(h)?(f=Kt.call(h,"c"),M=Kt.call(h,"e"),F=Kt.call(h,"w")):(f=F=!0,M=!1),E={value:w,configurable:f,enumerable:M,writable:F},B?mu(xu(B),E):E};ss.gs=function(h,w,f){var M,F,B,E;return typeof h!="string"?(B=f,f=w,w=h,h=null):B=arguments[3],ve(w)?wu(w)?ve(f)?wu(f)||(B=f,f=void 0):f=void 0:(B=w,w=f=void 0):w=void 0,ve(h)?(M=Kt.call(h,"c"),F=Kt.call(h,"e")):(M=!0,F=!1),E={get:w,set:f,configurable:M,enumerable:F},B?mu(xu(B),E):E};var Zt=_u.exports,wr={exports:{}};(function(h,w){var f=Zt,M=ou,F=Function.prototype.apply,B=Function.prototype.call,E=Object.create,rn=Object.defineProperty,Q=Object.defineProperties,G=Object.prototype.hasOwnProperty,k={configurable:!0,enumerable:!1,writable:!0},an,N,z,pn,ln,T,_n;an=function(C,A){var D;return M(A),G.call(this,"__ee__")?D=this.__ee__:(D=k.value=E(null),rn(this,"__ee__",k),k.value=null),D[C]?typeof D[C]=="object"?D[C].push(A):D[C]=[D[C],A]:D[C]=A,this},N=function(C,A){var D,Z;return M(A),Z=this,an.call(this,C,D=function(){z.call(Z,C,D),F.call(A,this,arguments)}),D.__eeOnceListener__=A,this},z=function(C,A){var D,Z,X,j;if(M(A),!G.call(this,"__ee__"))return this;if(D=this.__ee__,!D[C])return this;if(Z=D[C],typeof Z=="object")for(j=0;X=Z[j];++j)(X===A||X.__eeOnceListener__===A)&&(Z.length===2?D[C]=Z[j?0:1]:Z.splice(j,1));else(Z===A||Z.__eeOnceListener__===A)&&delete D[C];return this},pn=function(C){var A,D,Z,X,j;if(G.call(this,"__ee__")&&(X=this.__ee__[C],!!X))if(typeof X=="object"){for(D=arguments.length,j=new Array(D-1),A=1;A=55296&&D<=56319&&(sn+=N[++T])),sn=z?G.call(z,pn,sn,_n):sn,ln?(k.value=sn,an(C,_n,k)):C[_n]=sn,++_n;A=_n}}if(A===void 0)for(A=M(N.length),ln&&(C=new ln(A)),T=0;Tasync w=>{try{const f=await h(w);postMessage({result:f})}catch(f){postMessage({error:f})}};function Os({map:h}){const w=h.split(/\r?\n/),[,,,,...f]=w;return{symbols:iu.chain(f).join("").trim().split("").uniq().map(M=>({symbol:M,value:xa(M)})).value()}}onmessage=Rs(async({data:h})=>Os(h))})(); diff --git a/assets/getGridSymbols.worker-QUYfJgzc.js b/assets/getGridSymbols.worker-QUYfJgzc.js deleted file mode 100644 index cfb64cb..0000000 --- a/assets/getGridSymbols.worker-QUYfJgzc.js +++ /dev/null @@ -1,27 +0,0 @@ -(function(){"use strict";var Ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pr={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 - */pr.exports,function(h,d){(function(){var f,B="4.17.21",L=200,G="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",x="Expected a function",A="Invalid `variable` option passed into `_.template`",I="__lodash_hash_undefined__",E=500,$="__lodash_placeholder__",Z=1,F=2,X=4,pn=1,ln=2,q=1,_n=2,W=4,S=8,H=16,Q=32,j=64,en=128,sn=256,Zt=512,Bs=30,Ds="...",Us=800,$s=16,tf=1,Ns=2,Gs=3,de=1/0,oe=9007199254740991,Hs=17976931348623157e292,dr=NaN,Yn=4294967295,zs=Yn-1,Ks=Yn>>>1,Zs=[["ary",en],["bind",q],["bindKey",_n],["curry",S],["curryRight",H],["flip",Zt],["partial",Q],["partialRight",j],["rearg",sn]],Ee="[object Arguments]",wr="[object Array]",Ys="[object AsyncFunction]",Ze="[object Boolean]",Ye="[object Date]",Xs="[object DOMException]",mr="[object Error]",yr="[object Function]",uf="[object GeneratorFunction]",Nn="[object Map]",Xe="[object Number]",Js="[object Null]",Vn="[object Object]",ff="[object Promise]",Qs="[object Proxy]",Je="[object RegExp]",Gn="[object Set]",Qe="[object String]",xr="[object Symbol]",Vs="[object Undefined]",Ve="[object WeakMap]",js="[object WeakSet]",je="[object ArrayBuffer]",Ce="[object DataView]",Yt="[object Float32Array]",Xt="[object Float64Array]",Jt="[object Int8Array]",Qt="[object Int16Array]",Vt="[object Int32Array]",jt="[object Uint8Array]",kt="[object Uint8ClampedArray]",ni="[object Uint16Array]",ei="[object Uint32Array]",ks=/\b__p \+= '';/g,nl=/\b(__p \+=) '' \+/g,el=/(__e\(.*?\)|\b__t\)) \+\n'';/g,of=/&(?:amp|lt|gt|quot|#39);/g,af=/[&<>"']/g,rl=RegExp(of.source),tl=RegExp(af.source),il=/<%-([\s\S]+?)%>/g,ul=/<%([\s\S]+?)%>/g,sf=/<%=([\s\S]+?)%>/g,fl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ol=/^\w*$/,al=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ri=/[\\^$.*+?()[\]{}|]/g,sl=RegExp(ri.source),ti=/^\s+/,ll=/\s/,cl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hl=/\{\n\/\* \[wrapped with (.+)\] \*/,gl=/,? & /,pl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,_l=/[()=,{}\[\]\/\s]/,vl=/\\(\\)?/g,dl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lf=/\w*$/,wl=/^[-+]0x[0-9a-f]+$/i,ml=/^0b[01]+$/i,yl=/^\[object .+?Constructor\]$/,xl=/^0o[0-7]+$/i,bl=/^(?:0|[1-9]\d*)$/,Al=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,br=/($^)/,Sl=/['\n\r\u2028\u2029\\]/g,Ar="\\ud800-\\udfff",Il="\\u0300-\\u036f",Rl="\\ufe20-\\ufe2f",Ol="\\u20d0-\\u20ff",cf=Il+Rl+Ol,hf="\\u2700-\\u27bf",gf="a-z\\xdf-\\xf6\\xf8-\\xff",Tl="\\xac\\xb1\\xd7\\xf7",El="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Cl="\\u2000-\\u206f",Ll=" \\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",pf="A-Z\\xc0-\\xd6\\xd8-\\xde",_f="\\ufe0e\\ufe0f",vf=Tl+El+Cl+Ll,ii="['’]",Pl="["+Ar+"]",df="["+vf+"]",Sr="["+cf+"]",wf="\\d+",Fl="["+hf+"]",mf="["+gf+"]",yf="[^"+Ar+vf+wf+hf+gf+pf+"]",ui="\\ud83c[\\udffb-\\udfff]",ql="(?:"+Sr+"|"+ui+")",xf="[^"+Ar+"]",fi="(?:\\ud83c[\\udde6-\\uddff]){2}",oi="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+pf+"]",bf="\\u200d",Af="(?:"+mf+"|"+yf+")",Wl="(?:"+Le+"|"+yf+")",Sf="(?:"+ii+"(?:d|ll|m|re|s|t|ve))?",If="(?:"+ii+"(?:D|LL|M|RE|S|T|VE))?",Rf=ql+"?",Of="["+_f+"]?",Ml="(?:"+bf+"(?:"+[xf,fi,oi].join("|")+")"+Of+Rf+")*",Bl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Tf=Of+Rf+Ml,Ul="(?:"+[Fl,fi,oi].join("|")+")"+Tf,$l="(?:"+[xf+Sr+"?",Sr,fi,oi,Pl].join("|")+")",Nl=RegExp(ii,"g"),Gl=RegExp(Sr,"g"),ai=RegExp(ui+"(?="+ui+")|"+$l+Tf,"g"),Hl=RegExp([Le+"?"+mf+"+"+Sf+"(?="+[df,Le,"$"].join("|")+")",Wl+"+"+If+"(?="+[df,Le+Af,"$"].join("|")+")",Le+"?"+Af+"+"+Sf,Le+"+"+If,Dl,Bl,wf,Ul].join("|"),"g"),zl=RegExp("["+bf+Ar+cf+_f+"]"),Kl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zl=["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"],Yl=-1,rn={};rn[Yt]=rn[Xt]=rn[Jt]=rn[Qt]=rn[Vt]=rn[jt]=rn[kt]=rn[ni]=rn[ei]=!0,rn[Ee]=rn[wr]=rn[je]=rn[Ze]=rn[Ce]=rn[Ye]=rn[mr]=rn[yr]=rn[Nn]=rn[Xe]=rn[Vn]=rn[Je]=rn[Gn]=rn[Qe]=rn[Ve]=!1;var nn={};nn[Ee]=nn[wr]=nn[je]=nn[Ce]=nn[Ze]=nn[Ye]=nn[Yt]=nn[Xt]=nn[Jt]=nn[Qt]=nn[Vt]=nn[Nn]=nn[Xe]=nn[Vn]=nn[Je]=nn[Gn]=nn[Qe]=nn[xr]=nn[jt]=nn[kt]=nn[ni]=nn[ei]=!0,nn[mr]=nn[yr]=nn[Ve]=!1;var Xl={À:"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"},Jl={"&":"&","<":"<",">":">",'"':""","'":"'"},Ql={"&":"&","<":"<",">":">",""":'"',"'":"'"},Vl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jl=parseFloat,kl=parseInt,Ef=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,nc=typeof self=="object"&&self&&self.Object===Object&&self,vn=Ef||nc||Function("return this")(),si=d&&!d.nodeType&&d,we=si&&!0&&h&&!h.nodeType&&h,Cf=we&&we.exports===si,li=Cf&&Ef.process,Fn=function(){try{var l=we&&we.require&&we.require("util").types;return l||li&&li.binding&&li.binding("util")}catch{}}(),Lf=Fn&&Fn.isArrayBuffer,Pf=Fn&&Fn.isDate,Ff=Fn&&Fn.isMap,qf=Fn&&Fn.isRegExp,Wf=Fn&&Fn.isSet,Mf=Fn&&Fn.isTypedArray;function On(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function ec(l,p,g,y){for(var C=-1,Y=l==null?0:l.length;++C-1}function ci(l,p,g){for(var y=-1,C=l==null?0:l.length;++y-1;);return g}function zf(l,p){for(var g=l.length;g--&&Pe(p,l[g],0)>-1;);return g}function lc(l,p){for(var g=l.length,y=0;g--;)l[g]===p&&++y;return y}var cc=_i(Xl),hc=_i(Jl);function gc(l){return"\\"+Vl[l]}function pc(l,p){return l==null?f:l[p]}function Fe(l){return zl.test(l)}function _c(l){return Kl.test(l)}function vc(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function mi(l){var p=-1,g=Array(l.size);return l.forEach(function(y,C){g[++p]=[C,y]}),g}function Kf(l,p){return function(g){return l(p(g))}}function le(l,p){for(var g=-1,y=l.length,C=0,Y=[];++g-1}function th(n,e){var r=this.__data__,t=Gr(r,n);return t<0?(++this.size,r.push([n,e])):r[t][1]=e,this}jn.prototype.clear=kc,jn.prototype.delete=nh,jn.prototype.get=eh,jn.prototype.has=rh,jn.prototype.set=th;function kn(n){var e=-1,r=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Bn(n,e,r,t,i,o){var a,s=e&Z,c=e&F,_=e&X;if(r&&(a=i?r(n,t,i,o):r(n)),a!==f)return a;if(!un(n))return n;var v=P(n);if(v){if(a=og(n),!s)return An(n,a)}else{var w=mn(n),m=w==yr||w==uf;if(ve(n))return To(n,s);if(w==Vn||w==Ee||m&&!i){if(a=c||m?{}:Yo(n),!s)return c?Qh(n,mh(a,n)):Jh(n,to(a,n))}else{if(!nn[w])return i?n:{};a=ag(n,w,s)}}o||(o=new zn);var b=o.get(n);if(b)return b;o.set(n,a),ba(n)?n.forEach(function(T){a.add(Bn(T,e,r,T,n,o))}):ya(n)&&n.forEach(function(T,N){a.set(N,Bn(T,e,r,N,n,o))});var O=_?c?Ki:zi:c?In:gn,D=v?f:O(n);return qn(D||n,function(T,N){D&&(N=T,T=n[N]),ur(a,N,Bn(T,e,r,N,n,o))}),a}function yh(n){var e=gn(n);return function(r){return io(r,n,e)}}function io(n,e,r){var t=r.length;if(n==null)return!t;for(n=k(n);t--;){var i=r[t],o=e[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function uo(n,e,r){if(typeof n!="function")throw new Wn(x);return hr(function(){n.apply(f,r)},e)}function fr(n,e,r,t){var i=-1,o=Ir,a=!0,s=n.length,c=[],_=e.length;if(!s)return c;r&&(e=tn(e,Tn(r))),t?(o=ci,a=!1):e.length>=L&&(o=ke,a=!1,e=new xe(e));n:for(;++ii?0:i+r),t=t===f||t>i?i:M(t),t<0&&(t+=i),t=r>t?0:Sa(t);r0&&r(s)?e>1?dn(s,e-1,r,t,i):se(i,s):t||(i[i.length]=s)}return i}var Ri=qo(),ao=qo(!0);function Xn(n,e){return n&&Ri(n,e,gn)}function Oi(n,e){return n&&ao(n,e,gn)}function zr(n,e){return ae(e,function(r){return ie(n[r])})}function Ae(n,e){e=pe(e,n);for(var r=0,t=e.length;n!=null&&re}function Ah(n,e){return n!=null&&V.call(n,e)}function Sh(n,e){return n!=null&&e in k(n)}function Ih(n,e,r){return n>=wn(e,r)&&n=120&&v.length>=120)?new xe(a&&v):f}v=n[0];var w=-1,m=s[0];n:for(;++w-1;)s!==n&&Wr.call(s,c,1),Wr.call(n,c,1);return n}function yo(n,e){for(var r=n?e.length:0,t=r-1;r--;){var i=e[r];if(r==t||i!==o){var o=i;te(i)?Wr.call(n,i,1):Bi(n,i)}}return n}function qi(n,e){return n+Dr(kf()*(e-n+1))}function Dh(n,e,r,t){for(var i=-1,o=hn(Br((e-n)/(r||1)),0),a=g(o);o--;)a[t?o:++i]=n,n+=r;return a}function Wi(n,e){var r="";if(!n||e<1||e>oe)return r;do e%2&&(r+=n),e=Dr(e/2),e&&(n+=n);while(e);return r}function U(n,e){return ji(Qo(n,e,Rn),n+"")}function Uh(n){return ro(ze(n))}function $h(n,e){var r=ze(n);return et(r,be(e,0,r.length))}function sr(n,e,r,t){if(!un(n))return n;e=pe(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++ii?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=g(i);++t>>1,a=n[o];a!==null&&!Cn(a)&&(r?a<=e:a=L){var _=e?null:ng(n);if(_)return Or(_);a=!1,i=ke,c=new xe}else c=e?[]:s;n:for(;++t=t?n:Dn(n,e,r)}var Oo=Lc||function(n){return vn.clearTimeout(n)};function To(n,e){if(e)return n.slice();var r=n.length,t=Xf?Xf(r):new n.constructor(r);return n.copy(t),t}function Ni(n){var e=new n.constructor(n.byteLength);return new Fr(e).set(new Fr(n)),e}function Kh(n,e){var r=e?Ni(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}function Zh(n){var e=new n.constructor(n.source,lf.exec(n));return e.lastIndex=n.lastIndex,e}function Yh(n){return ir?k(ir.call(n)):{}}function Eo(n,e){var r=e?Ni(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Co(n,e){if(n!==e){var r=n!==f,t=n===null,i=n===n,o=Cn(n),a=e!==f,s=e===null,c=e===e,_=Cn(e);if(!s&&!_&&!o&&n>e||o&&a&&c&&!s&&!_||t&&a&&c||!r&&c||!i)return 1;if(!t&&!o&&!_&&n=s)return c;var _=r[t];return c*(_=="desc"?-1:1)}}return n.index-e.index}function Lo(n,e,r,t){for(var i=-1,o=n.length,a=r.length,s=-1,c=e.length,_=hn(o-a,0),v=g(c+_),w=!t;++s1?r[i-1]:f,a=i>2?r[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&xn(r[0],r[1],a)&&(o=i<3?f:o,i=1),e=k(e);++t-1?i[o?e[a]:a]:f}}function Bo(n){return re(function(e){var r=e.length,t=r,i=Mn.prototype.thru;for(n&&e.reverse();t--;){var o=e[t];if(typeof o!="function")throw new Wn(x);if(i&&!a&&kr(o)=="wrapper")var a=new Mn([],!0)}for(t=a?t:r;++t1&&K.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(e);if(_&&v)return _==e&&v==n;var w=-1,m=!0,b=r&ln?new xe:f;for(o.set(n,e),o.set(e,n);++w1?"& ":"")+e[t],e=e.join(r>2?", ":" "),n.replace(cl,`{ -/* [wrapped with `+e+`] */ -`)}function lg(n){return P(n)||Re(n)||!!(Vf&&n&&n[Vf])}function te(n,e){var r=typeof n;return e=e??oe,!!e&&(r=="number"||r!="symbol"&&bl.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Us)return arguments[0]}else e=0;return n.apply(f,arguments)}}function et(n,e){var r=-1,t=n.length,i=t-1;for(e=e===f?t:e;++r1?n[e-1]:f;return r=typeof r=="function"?(n.pop(),r):f,aa(n,r)});function sa(n){var e=u(n);return e.__chain__=!0,e}function xp(n,e){return e(n),n}function rt(n,e){return e(n)}var bp=re(function(n){var e=n.length,r=e?n[0]:0,t=this.__wrapped__,i=function(o){return Ii(o,n)};return e>1||this.__actions__.length||!(t instanceof z)||!te(r)?this.thru(i):(t=t.slice(r,+r+(e?1:0)),t.__actions__.push({func:rt,args:[i],thisArg:f}),new Mn(t,this.__chain__).thru(function(o){return e&&!o.length&&o.push(f),o}))});function Ap(){return sa(this)}function Sp(){return new Mn(this.value(),this.__chain__)}function Ip(){this.__values__===f&&(this.__values__=Aa(this.value()));var n=this.__index__>=this.__values__.length,e=n?f:this.__values__[this.__index__++];return{done:n,value:e}}function Rp(){return this}function Op(n){for(var e,r=this;r instanceof Nr;){var t=ra(r);t.__index__=0,t.__values__=f,e?i.__wrapped__=t:e=t;var i=t;r=r.__wrapped__}return i.__wrapped__=n,e}function Tp(){var n=this.__wrapped__;if(n instanceof z){var e=n;return this.__actions__.length&&(e=new z(this)),e=e.reverse(),e.__actions__.push({func:rt,args:[ki],thisArg:f}),new Mn(e,this.__chain__)}return this.thru(ki)}function Ep(){return Io(this.__wrapped__,this.__actions__)}var Cp=Xr(function(n,e,r){V.call(n,r)?++n[r]:ne(n,r,1)});function Lp(n,e,r){var t=P(n)?Bf:xh;return r&&xn(n,e,r)&&(e=f),t(n,R(e,3))}function Pp(n,e){var r=P(n)?ae:oo;return r(n,R(e,3))}var Fp=Mo(ta),qp=Mo(ia);function Wp(n,e){return dn(tt(n,e),1)}function Mp(n,e){return dn(tt(n,e),de)}function Bp(n,e,r){return r=r===f?1:M(r),dn(tt(n,e),r)}function la(n,e){var r=P(n)?qn:he;return r(n,R(e,3))}function ca(n,e){var r=P(n)?rc:fo;return r(n,R(e,3))}var Dp=Xr(function(n,e,r){V.call(n,r)?n[r].push(e):ne(n,r,[e])});function Up(n,e,r,t){n=Sn(n)?n:ze(n),r=r&&!t?M(r):0;var i=n.length;return r<0&&(r=hn(i+r,0)),at(n)?r<=i&&n.indexOf(e,r)>-1:!!i&&Pe(n,e,r)>-1}var $p=U(function(n,e,r){var t=-1,i=typeof e=="function",o=Sn(n)?g(n.length):[];return he(n,function(a){o[++t]=i?On(e,a,r):or(a,e,r)}),o}),Np=Xr(function(n,e,r){ne(n,r,e)});function tt(n,e){var r=P(n)?tn:go;return r(n,R(e,3))}function Gp(n,e,r,t){return n==null?[]:(P(e)||(e=e==null?[]:[e]),r=t?f:r,P(r)||(r=r==null?[]:[r]),wo(n,e,r))}var Hp=Xr(function(n,e,r){n[r?0:1].push(e)},function(){return[[],[]]});function zp(n,e,r){var t=P(n)?hi:Nf,i=arguments.length<3;return t(n,R(e,4),r,i,he)}function Kp(n,e,r){var t=P(n)?tc:Nf,i=arguments.length<3;return t(n,R(e,4),r,i,fo)}function Zp(n,e){var r=P(n)?ae:oo;return r(n,ft(R(e,3)))}function Yp(n){var e=P(n)?ro:Uh;return e(n)}function Xp(n,e,r){(r?xn(n,e,r):e===f)?e=1:e=M(e);var t=P(n)?vh:$h;return t(n,e)}function Jp(n){var e=P(n)?dh:Gh;return e(n)}function Qp(n){if(n==null)return 0;if(Sn(n))return at(n)?qe(n):n.length;var e=mn(n);return e==Nn||e==Gn?n.size:Li(n).length}function Vp(n,e,r){var t=P(n)?gi:Hh;return r&&xn(n,e,r)&&(e=f),t(n,R(e,3))}var jp=U(function(n,e){if(n==null)return[];var r=e.length;return r>1&&xn(n,e[0],e[1])?e=[]:r>2&&xn(e[0],e[1],e[2])&&(e=[e[0]]),wo(n,dn(e,1),[])}),it=Pc||function(){return vn.Date.now()};function kp(n,e){if(typeof e!="function")throw new Wn(x);return n=M(n),function(){if(--n<1)return e.apply(this,arguments)}}function ha(n,e,r){return e=r?f:e,e=n&&e==null?n.length:e,ee(n,en,f,f,f,f,e)}function ga(n,e){var r;if(typeof e!="function")throw new Wn(x);return n=M(n),function(){return--n>0&&(r=e.apply(this,arguments)),n<=1&&(e=f),r}}var eu=U(function(n,e,r){var t=q;if(r.length){var i=le(r,Ge(eu));t|=Q}return ee(n,t,e,r,i)}),pa=U(function(n,e,r){var t=q|_n;if(r.length){var i=le(r,Ge(pa));t|=Q}return ee(e,t,n,r,i)});function _a(n,e,r){e=r?f:e;var t=ee(n,S,f,f,f,f,f,e);return t.placeholder=_a.placeholder,t}function va(n,e,r){e=r?f:e;var t=ee(n,H,f,f,f,f,f,e);return t.placeholder=va.placeholder,t}function da(n,e,r){var t,i,o,a,s,c,_=0,v=!1,w=!1,m=!0;if(typeof n!="function")throw new Wn(x);e=$n(e)||0,un(r)&&(v=!!r.leading,w="maxWait"in r,o=w?hn($n(r.maxWait)||0,e):o,m="trailing"in r?!!r.trailing:m);function b(an){var Zn=t,fe=i;return t=i=f,_=an,a=n.apply(fe,Zn),a}function O(an){return _=an,s=hr(N,e),v?b(an):a}function D(an){var Zn=an-c,fe=an-_,Ma=e-Zn;return w?wn(Ma,o-fe):Ma}function T(an){var Zn=an-c,fe=an-_;return c===f||Zn>=e||Zn<0||w&&fe>=o}function N(){var an=it();if(T(an))return K(an);s=hr(N,D(an))}function K(an){return s=f,m&&t?b(an):(t=i=f,a)}function Ln(){s!==f&&Oo(s),_=0,t=c=i=s=f}function bn(){return s===f?a:K(it())}function Pn(){var an=it(),Zn=T(an);if(t=arguments,i=this,c=an,Zn){if(s===f)return O(c);if(w)return Oo(s),s=hr(N,e),b(c)}return s===f&&(s=hr(N,e)),a}return Pn.cancel=Ln,Pn.flush=bn,Pn}var n_=U(function(n,e){return uo(n,1,e)}),e_=U(function(n,e,r){return uo(n,$n(e)||0,r)});function r_(n){return ee(n,Zt)}function ut(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Wn(x);var r=function(){var t=arguments,i=e?e.apply(this,t):t[0],o=r.cache;if(o.has(i))return o.get(i);var a=n.apply(this,t);return r.cache=o.set(i,a)||o,a};return r.cache=new(ut.Cache||kn),r}ut.Cache=kn;function ft(n){if(typeof n!="function")throw new Wn(x);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function t_(n){return ga(2,n)}var i_=zh(function(n,e){e=e.length==1&&P(e[0])?tn(e[0],Tn(R())):tn(dn(e,1),Tn(R()));var r=e.length;return U(function(t){for(var i=-1,o=wn(t.length,r);++i=e}),Re=lo(function(){return arguments}())?lo:function(n){return fn(n)&&V.call(n,"callee")&&!Qf.call(n,"callee")},P=g.isArray,m_=Lf?Tn(Lf):Oh;function Sn(n){return n!=null&&ot(n.length)&&!ie(n)}function on(n){return fn(n)&&Sn(n)}function y_(n){return n===!0||n===!1||fn(n)&&yn(n)==Ze}var ve=qc||gu,x_=Pf?Tn(Pf):Th;function b_(n){return fn(n)&&n.nodeType===1&&!gr(n)}function A_(n){if(n==null)return!0;if(Sn(n)&&(P(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||He(n)||Re(n)))return!n.length;var e=mn(n);if(e==Nn||e==Gn)return!n.size;if(cr(n))return!Li(n).length;for(var r in n)if(V.call(n,r))return!1;return!0}function S_(n,e){return ar(n,e)}function I_(n,e,r){r=typeof r=="function"?r:f;var t=r?r(n,e):f;return t===f?ar(n,e,f,r):!!t}function tu(n){if(!fn(n))return!1;var e=yn(n);return e==mr||e==Xs||typeof n.message=="string"&&typeof n.name=="string"&&!gr(n)}function R_(n){return typeof n=="number"&&jf(n)}function ie(n){if(!un(n))return!1;var e=yn(n);return e==yr||e==uf||e==Ys||e==Qs}function ma(n){return typeof n=="number"&&n==M(n)}function ot(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=oe}function un(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function fn(n){return n!=null&&typeof n=="object"}var ya=Ff?Tn(Ff):Ch;function O_(n,e){return n===e||Ci(n,e,Yi(e))}function T_(n,e,r){return r=typeof r=="function"?r:f,Ci(n,e,Yi(e),r)}function E_(n){return xa(n)&&n!=+n}function C_(n){if(gg(n))throw new C(G);return co(n)}function L_(n){return n===null}function P_(n){return n==null}function xa(n){return typeof n=="number"||fn(n)&&yn(n)==Xe}function gr(n){if(!fn(n)||yn(n)!=Vn)return!1;var e=qr(n);if(e===null)return!0;var r=V.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Cr.call(r)==Tc}var iu=qf?Tn(qf):Lh;function F_(n){return ma(n)&&n>=-oe&&n<=oe}var ba=Wf?Tn(Wf):Ph;function at(n){return typeof n=="string"||!P(n)&&fn(n)&&yn(n)==Qe}function Cn(n){return typeof n=="symbol"||fn(n)&&yn(n)==xr}var He=Mf?Tn(Mf):Fh;function q_(n){return n===f}function W_(n){return fn(n)&&mn(n)==Ve}function M_(n){return fn(n)&&yn(n)==js}var B_=jr(Pi),D_=jr(function(n,e){return n<=e});function Aa(n){if(!n)return[];if(Sn(n))return at(n)?Hn(n):An(n);if(nr&&n[nr])return vc(n[nr]());var e=mn(n),r=e==Nn?mi:e==Gn?Or:ze;return r(n)}function ue(n){if(!n)return n===0?n:0;if(n=$n(n),n===de||n===-de){var e=n<0?-1:1;return e*Hs}return n===n?n:0}function M(n){var e=ue(n),r=e%1;return e===e?r?e-r:e:0}function Sa(n){return n?be(M(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return dr;if(un(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=un(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Gf(n);var r=ml.test(n);return r||xl.test(n)?kl(n.slice(2),r?2:8):wl.test(n)?dr:+n}function Ia(n){return Jn(n,In(n))}function U_(n){return n?be(M(n),-oe,oe):n===0?n:0}function J(n){return n==null?"":En(n)}var $_=$e(function(n,e){if(cr(e)||Sn(e)){Jn(e,gn(e),n);return}for(var r in e)V.call(e,r)&&ur(n,r,e[r])}),Ra=$e(function(n,e){Jn(e,In(e),n)}),st=$e(function(n,e,r,t){Jn(e,In(e),n,t)}),N_=$e(function(n,e,r,t){Jn(e,gn(e),n,t)}),G_=re(Ii);function H_(n,e){var r=Ue(n);return e==null?r:to(r,e)}var z_=U(function(n,e){n=k(n);var r=-1,t=e.length,i=t>2?e[2]:f;for(i&&xn(e[0],e[1],i)&&(t=1);++r1),o}),Jn(n,Ki(n),r),t&&(r=Bn(r,Z|F|X,eg));for(var i=e.length;i--;)Bi(r,e[i]);return r});function av(n,e){return Ta(n,ft(R(e)))}var sv=re(function(n,e){return n==null?{}:Mh(n,e)});function Ta(n,e){if(n==null)return{};var r=tn(Ki(n),function(t){return[t]});return e=R(e),mo(n,r,function(t,i){return e(t,i[0])})}function lv(n,e,r){e=pe(e,n);var t=-1,i=e.length;for(i||(i=1,n=f);++te){var t=n;n=e,e=t}if(r||n%1||e%1){var i=kf();return wn(n+i*(e-n+jl("1e-"+((i+"").length-1))),e)}return qi(n,e)}var xv=Ne(function(n,e,r){return e=e.toLowerCase(),n+(r?La(e):e)});function La(n){return ou(J(n).toLowerCase())}function Pa(n){return n=J(n),n&&n.replace(Al,cc).replace(Gl,"")}function bv(n,e,r){n=J(n),e=En(e);var t=n.length;r=r===f?t:be(M(r),0,t);var i=r;return r-=e.length,r>=0&&n.slice(r,i)==e}function Av(n){return n=J(n),n&&tl.test(n)?n.replace(af,hc):n}function Sv(n){return n=J(n),n&&sl.test(n)?n.replace(ri,"\\$&"):n}var Iv=Ne(function(n,e,r){return n+(r?"-":"")+e.toLowerCase()}),Rv=Ne(function(n,e,r){return n+(r?" ":"")+e.toLowerCase()}),Ov=Wo("toLowerCase");function Tv(n,e,r){n=J(n),e=M(e);var t=e?qe(n):0;if(!e||t>=e)return n;var i=(e-t)/2;return Vr(Dr(i),r)+n+Vr(Br(i),r)}function Ev(n,e,r){n=J(n),e=M(e);var t=e?qe(n):0;return e&&t>>0,r?(n=J(n),n&&(typeof e=="string"||e!=null&&!iu(e))&&(e=En(e),!e&&Fe(n))?_e(Hn(n),0,r):n.split(e,r)):[]}var Mv=Ne(function(n,e,r){return n+(r?" ":"")+ou(e)});function Bv(n,e,r){return n=J(n),r=r==null?0:be(M(r),0,n.length),e=En(e),n.slice(r,r+e.length)==e}function Dv(n,e,r){var t=u.templateSettings;r&&xn(n,e,r)&&(e=f),n=J(n),e=st({},e,t,Go);var i=st({},e.imports,t.imports,Go),o=gn(i),a=wi(i,o),s,c,_=0,v=e.interpolate||br,w="__p += '",m=yi((e.escape||br).source+"|"+v.source+"|"+(v===sf?dl:br).source+"|"+(e.evaluate||br).source+"|$","g"),b="//# sourceURL="+(V.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yl+"]")+` -`;n.replace(m,function(T,N,K,Ln,bn,Pn){return K||(K=Ln),w+=n.slice(_,Pn).replace(Sl,gc),N&&(s=!0,w+=`' + -__e(`+N+`) + -'`),bn&&(c=!0,w+=`'; -`+bn+`; -__p += '`),K&&(w+=`' + -((__t = (`+K+`)) == null ? '' : __t) + -'`),_=Pn+T.length,T}),w+=`'; -`;var O=V.call(e,"variable")&&e.variable;if(!O)w=`with (obj) { -`+w+` -} -`;else if(_l.test(O))throw new C(A);w=(c?w.replace(ks,""):w).replace(nl,"$1").replace(el,"$1;"),w="function("+(O||"obj")+`) { -`+(O?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+w+`return __p -}`;var D=qa(function(){return Y(o,b+"return "+w).apply(f,a)});if(D.source=w,tu(D))throw D;return D}function Uv(n){return J(n).toLowerCase()}function $v(n){return J(n).toUpperCase()}function Nv(n,e,r){if(n=J(n),n&&(r||e===f))return Gf(n);if(!n||!(e=En(e)))return n;var t=Hn(n),i=Hn(e),o=Hf(t,i),a=zf(t,i)+1;return _e(t,o,a).join("")}function Gv(n,e,r){if(n=J(n),n&&(r||e===f))return n.slice(0,Zf(n)+1);if(!n||!(e=En(e)))return n;var t=Hn(n),i=zf(t,Hn(e))+1;return _e(t,0,i).join("")}function Hv(n,e,r){if(n=J(n),n&&(r||e===f))return n.replace(ti,"");if(!n||!(e=En(e)))return n;var t=Hn(n),i=Hf(t,Hn(e));return _e(t,i).join("")}function zv(n,e){var r=Bs,t=Ds;if(un(e)){var i="separator"in e?e.separator:i;r="length"in e?M(e.length):r,t="omission"in e?En(e.omission):t}n=J(n);var o=n.length;if(Fe(n)){var a=Hn(n);o=a.length}if(r>=o)return n;var s=r-qe(t);if(s<1)return t;var c=a?_e(a,0,s).join(""):n.slice(0,s);if(i===f)return c+t;if(a&&(s+=c.length-s),iu(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=yi(i.source,J(lf.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var w=_.index;c=c.slice(0,w===f?s:w)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+t}function Kv(n){return n=J(n),n&&rl.test(n)?n.replace(of,yc):n}var Zv=Ne(function(n,e,r){return n+(r?" ":"")+e.toUpperCase()}),ou=Wo("toUpperCase");function Fa(n,e,r){return n=J(n),e=r?f:e,e===f?_c(n)?Ac(n):fc(n):n.match(e)||[]}var qa=U(function(n,e){try{return On(n,f,e)}catch(r){return tu(r)?r:new C(r)}}),Yv=re(function(n,e){return qn(e,function(r){r=Qn(r),ne(n,r,eu(n[r],n))}),n});function Xv(n){var e=n==null?0:n.length,r=R();return n=e?tn(n,function(t){if(typeof t[1]!="function")throw new Wn(x);return[r(t[0]),t[1]]}):[],U(function(t){for(var i=-1;++ioe)return[];var r=Yn,t=wn(n,Yn);e=R(e),n-=Yn;for(var i=di(t,e);++r0||e<0)?new z(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==f&&(e=M(e),r=e<0?r.dropRight(-e):r.take(e-n)),r)},z.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},z.prototype.toArray=function(){return this.take(Yn)},Xn(z.prototype,function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),t=/^(?:head|last)$/.test(e),i=u[t?"take"+(e=="last"?"Right":""):e],o=t||/^find/.test(e);i&&(u.prototype[e]=function(){var a=this.__wrapped__,s=t?[1]:arguments,c=a instanceof z,_=s[0],v=c||P(a),w=function(N){var K=i.apply(u,se([N],s));return t&&m?K[0]:K};v&&r&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,b=!!this.__actions__.length,O=o&&!m,D=c&&!b;if(!o&&v){a=D?a:new z(this);var T=n.apply(a,s);return T.__actions__.push({func:rt,args:[w],thisArg:f}),new Mn(T,m)}return O&&D?n.apply(this,s):(T=this.thru(w),O?t?T.value()[0]:T.value():T)})}),qn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Tr[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",t=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(t&&!this.__chain__){var o=this.value();return e.apply(P(o)?o:[],i)}return this[r](function(a){return e.apply(P(a)?a:[],i)})}}),Xn(z.prototype,function(n,e){var r=u[e];if(r){var t=r.name+"";V.call(De,t)||(De[t]=[]),De[t].push({name:e,func:r})}}),De[Jr(f,_n).name]=[{name:"wrapper",func:f}],z.prototype.clone=Kc,z.prototype.reverse=Zc,z.prototype.value=Yc,u.prototype.at=bp,u.prototype.chain=Ap,u.prototype.commit=Sp,u.prototype.next=Ip,u.prototype.plant=Op,u.prototype.reverse=Tp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Ep,u.prototype.first=u.prototype.head,nr&&(u.prototype[nr]=Rp),u},We=Sc();we?((we.exports=We)._=We,si._=We):vn._=We}).call(Ke)}(pr,pr.exports);var pu=pr.exports;const _u=" `.-':_,^=;><+!rc*/z?sLTv)J7(|Fi{C}fI31tlu[neoZ5Yxjya]2ESwqkP6h9d4VpOGbUAKXHm8RD#$Bg0MNWQ%&@";function Ba(h){return pu.chain(_u).split("").indexOf(h).thru(d=>Math.max(d-3,0)/_u.length).value()}var Da=function(){},Ua=Da(),Oe=function(h){return h!==Ua&&h!==null},$a=Oe,Na=Array.prototype.forEach,Ga=Object.create,Ha=function(h,d){var f;for(f in h)d[f]=h[f]},za=function(h){var d=Ga(null);return Na.call(arguments,function(f){$a(f)&&Ha(Object(f),d)}),d},Ka=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},lt,vu;function Za(){return vu||(vu=1,lt=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),lt}var Ya=Ka()?Math.sign:Za(),Xa=Ya,Ja=Math.abs,Qa=Math.floor,Va=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:Xa(h)*Qa(Ja(h)))},ja=Va,ka=Math.max,du=function(h){return ka(0,ja(h))},wu=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},ns=Oe,ct=function(h){if(!ns(h))throw new TypeError("Cannot use null or undefined");return h},es={exports:{}},ht,mu;function rs(){return mu||(mu=1,ht=function(){var h=Object.assign,d;return typeof h!="function"?!1:(d={foo:"raz"},h(d,{bar:"dwa"},{trzy:"trzy"}),d.foo+d.bar+d.trzy==="razdwatrzy")}),ht}var gt,yu;function ts(){return yu||(yu=1,gt=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gt}var pt,xu;function is(){if(xu)return pt;xu=1;var h=Oe,d=Object.keys;return pt=function(f){return d(h(f)?Object(f):f)},pt}var _t,bu;function us(){return bu||(bu=1,_t=ts()()?Object.keys:is()),_t}var vt,Au;function fs(){if(Au)return vt;Au=1;var h=us(),d=ct,f=Math.max;return vt=function(B,L){var G,x,A=f(arguments.length,2),I;for(B=Object(d(B)),I=function(E){try{B[E]=L[E]}catch($){G||(G=$)}},x=1;x-1},Rt}var Ot,Mu;function ws(){return Mu||(Mu=1,Ot=vs()()?String.prototype.contains:ds()),Ot}var Bu;function Te(){if(Bu)return mt.exports;Bu=1;var h=Eu(),d=_s(),f=Iu(),B=za,L=ws(),G=mt.exports=function(x,A){var I,E,$,Z,F;return arguments.length<2||typeof x!="string"?(Z=A,A=x,x=null):Z=arguments[2],h(x)?(I=L.call(x,"c"),E=L.call(x,"e"),$=L.call(x,"w")):(I=$=!0,E=!1),F={value:A,configurable:I,enumerable:E,writable:$},Z?f(B(Z),F):F};return G.gs=function(x,A,I){var E,$,Z,F;return typeof x!="string"?(Z=I,I=A,A=x,x=null):Z=arguments[3],h(A)?d(A)?h(I)?d(I)||(Z=I,I=void 0):I=void 0:(Z=A,A=I=void 0):A=void 0,h(x)?(E=L.call(x,"c"),$=L.call(x,"e")):(E=!0,$=!1),F={get:A,set:I,configurable:E,enumerable:$},Z?f(B(Z),F):F},mt.exports}var Tt={exports:{}};(function(h,d){var f=Te(),B=wu,L=Function.prototype.apply,G=Function.prototype.call,x=Object.create,A=Object.defineProperty,I=Object.defineProperties,E=Object.prototype.hasOwnProperty,$={configurable:!0,enumerable:!1,writable:!0},Z,F,X,pn,ln,q,_n;Z=function(W,S){var H;return B(S),E.call(this,"__ee__")?H=this.__ee__:(H=$.value=x(null),A(this,"__ee__",$),$.value=null),H[W]?typeof H[W]=="object"?H[W].push(S):H[W]=[H[W],S]:H[W]=S,this},F=function(W,S){var H,Q;return B(S),Q=this,Z.call(this,W,H=function(){X.call(Q,W,H),L.call(S,this,arguments)}),H.__eeOnceListener__=S,this},X=function(W,S){var H,Q,j,en;if(B(S),!E.call(this,"__ee__"))return this;if(H=this.__ee__,!H[W])return this;if(Q=H[W],typeof Q=="object")for(en=0;j=Q[en];++en)(j===S||j.__eeOnceListener__===S)&&(Q.length===2?H[W]=Q[en?0:1]:Q.splice(en,1));else(Q===S||Q.__eeOnceListener__===S)&&delete H[W];return this},pn=function(W){var S,H,Q,j,en;if(E.call(this,"__ee__")&&(j=this.__ee__[W],!!j))if(typeof j=="object"){for(H=arguments.length,en=new Array(H-1),S=1;S=55296&&H<=56319&&(sn+=F[++q])),sn=X?E.call(X,pn,sn,_n):sn,ln?($.value=sn,Z(W,_n,$)):W[_n]=sn,++_n;S=_n}}if(S===void 0)for(S=B(F.length),ln&&(W=new ln(S)),q=0;qasync d=>{try{const f=await h(d);postMessage({result:f})}catch(f){postMessage({error:f})}};function Ms({map:h}){const d=h.split(/\r?\n/),[,,,,...f]=d;return{symbols:pu.chain(f).join("").trim().split("").uniq().map(B=>({symbol:B,value:Ba(B)})).value()}}onmessage=Ws(async({data:h})=>Ms(h))})(); diff --git a/assets/index-T4quaFGH.js b/assets/index-DpDXPyDz.js similarity index 99% rename from assets/index-T4quaFGH.js rename to assets/index-DpDXPyDz.js index 4173bc4..150c764 100644 --- a/assets/index-T4quaFGH.js +++ b/assets/index-DpDXPyDz.js @@ -455,7 +455,7 @@ PERFORMANCE OF THIS SOFTWARE. ${me.palette.background.default} 8px )`},textAlign:"center",vertical:!0,...pe,children:[oe,jsxRuntimeExports.jsx(Typography,{component:"div",children:ne}),!!ce&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"caption",sx:{px:8,maxWidth:480},children:ce}),!!ue&&jsxRuntimeExports.jsx(Box,{pt:2,children:ue})]})}function Button(ne){const oe=compilerRuntimeExports.c(17);let ce,ue,pe;oe[0]!==ne?({children:ce,sx:pe,...ue}=ne,oe[0]=ne,oe[1]=ce,oe[2]=ue,oe[3]=pe):(ce=oe[1],ue=oe[2],pe=oe[3]);const me=usePaper();let ge;oe[4]!==me||oe[5]!==ue.variant?(ge=ue.variant==="text"?void 0:me(1),oe[4]=me,oe[5]=ue.variant,oe[6]=ge):ge=oe[6];let ye;oe[7]!==pe||oe[8]!==ge?(ye={minWidth:0,borderColor:_temp$u,...ge,...pe},oe[7]=pe,oe[8]=ge,oe[9]=ye):ye=oe[9];let xe;oe[10]===Symbol.for("react.memo_cache_sentinel")?(xe={color:"text.primary",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},oe[10]=xe):xe=oe[10];let ve;oe[11]!==ce?(ve=jsxRuntimeExports.jsx(Box,{sx:xe,children:ce}),oe[11]=ce,oe[12]=ve):ve=oe[12];let _e;return oe[13]!==ue||oe[14]!==ye||oe[15]!==ve?(_e=jsxRuntimeExports.jsx(Button$1,{disableElevation:!0,variant:"outlined",color:"primary",...ue,sx:ye,children:ve}),oe[13]=ue,oe[14]=ye,oe[15]=ve,oe[16]=_e):_e=oe[16],_e}function _temp$u(ne){return alpha$2(ne.palette.text.primary,ne.palette.action.activatedOpacity)}const isTraceLayer=ne=>{var oe;return((oe=ne.source)==null?void 0:oe.type)==="trace"};var download$1={exports:{}};(function(ne,oe){(function(ce,ue){ne.exports=ue()})(commonjsGlobal$1,function(){return function ce(ue,pe,me){var ge=window,ye="application/octet-stream",xe=me||ye,ve=ue,_e=!pe&&!me&&ve,we=document.createElement("a"),Se=function(Ue){return String(Ue)},$e=ge.Blob||ge.MozBlob||ge.WebKitBlob||Se,Te=pe||"download",Re,Ae;if($e=$e.call?$e.bind(ge):Blob,String(this)==="true"&&(ve=[ve,xe],xe=ve[0],ve=ve[1]),_e&&_e.length<2048&&(Te=_e.split("/").pop().split("?")[0],we.href=_e,we.href.indexOf(_e)!==-1)){var ke=new XMLHttpRequest;return ke.open("GET",_e,!0),ke.responseType="blob",ke.onload=function(Ue){ce(Ue.target.response,Te,ye)},setTimeout(function(){ke.send()},0),ke}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(ve))if(ve.length>1024*1024*1.999&&$e!==Se)ve=je(ve),xe=ve.type||ye;else return navigator.msSaveBlob?navigator.msSaveBlob(je(ve),Te):ze(ve);else if(/([\x80-\xff])/.test(ve)){var Be=0,Ie=new Uint8Array(ve.length),Ne=Ie.length;for(Be;Bene.join(oe),l$4={accept:"*",multiple:!1,strict:!1},r$4=ne=>{const{accept:oe,multiple:ce,strict:ue}={...l$4,...ne},pe=p$6({multiple:ce,accept:Array.isArray(oe)?c$5(oe):oe});return new Promise(me=>{pe.onchange=()=>{me(s$4(pe.files,ce,ue)),pe.remove()},pe.click()})},s$4=(ne,oe,ce)=>new Promise((ue,pe)=>{if(!ne)return pe(new t$4);const me=i$5(ne,oe,ce);if(!me)return pe(new n$4);ue(me)}),i$5=(ne,oe,ce)=>!oe&&ce?ne.length===1?ne[0]:null:ne.length?ne:null,p$6=({accept:ne,multiple:oe})=>{const ce=document.createElement("input");return ce.type="file",ce.multiple=oe,ce.accept=ne,ce};function isPlainObject$2(ne){return(ne==null?void 0:ne.constructor)===Object}var validPathRegex=/^[^.[\]]+(?:\.[^.[\]]+)*(?:\[\d+])*(?:\.[^.[\]]+(?:\[\d+])*)*$/,pathSplitRegex=/\.|(?=\[)/g,matchBracketsRegex=/[[\]]/g;function set$4(ne,oe,ce){if(!validPathRegex.test(oe))throw new Error("Invalid path, look at the examples for the correct format.");const ue=oe.split(pathSplitRegex);let pe=ne;for(let me=0;melodashExports.omitBy(merge$6(ne,oe),lodashExports.isUndefined)});function wait$1(ne){return new Promise(oe=>lodashExports.delay(oe,ne))}function useBusyState(ne){const oe=compilerRuntimeExports.c(3),[,ce]=useBusy();let ue;return oe[0]!==ce||oe[1]!==ne?(ue=async(pe,me)=>{ce(()=>({[ne]:me})),wait$1(300);const ge=await pe();return ce(()=>({[ne]:void 0})),ge},oe[0]=ce,oe[1]=ne,oe[2]=ue):ue=oe[2],ue}function formatByte(ne){return`${(ne/(1024*1024)).toFixed(2)} MB`}const[useConnections,ConnectionsProvider]=createSlice([],{reduce:replace$1}),[useFeatures,FeaturesProvider]=createSlice({algorithms:[],maps:[],formats:[],traces:[]}),[useLoading,LoadingProvider]=createSlice({specimen:0,connections:0,features:0,map:0,general:0},{reduce:(ne,{action:oe,key:ce})=>produce(ne,ue=>{switch(oe){case"start":ue[ce]+=1;break;case"end":ue[ce]-=1}return ue})});function useAnyLoading(){const ne=compilerRuntimeExports.c(2),[oe]=useLoading();let ce;return ne[0]!==oe?(ce=lodashExports.some(lodashExports.values(oe)),ne[0]=oe,ne[1]=ce):ce=ne[1],ce}function useLoadingState(ne){const oe=compilerRuntimeExports.c(3),ce=ne===void 0?"general":ne,[,ue]=useLoading();let pe;return oe[0]!==ue||oe[1]!==ce?(pe=async me=>{ue(()=>({action:"start",key:ce}));const ge=await me();return ue(()=>({action:"end",key:ce})),ge},oe[0]=ue,oe[1]=ce,oe[2]=pe):pe=oe[2],pe}const hashWorkerUrl=""+new URL("hash.worker-B5ThNeUw.js",import.meta.url).href,ipcWorkerUrl=""+new URL("ipc.worker-BX5xrXZT.js",import.meta.url).href,compressWorkerUrl=""+new URL("compress.worker-BDIAOI0k.js",import.meta.url).href,compressBinaryWorkerUrl=""+new URL("compressBinary.worker-DBtqfVRd.js",import.meta.url).href,decompressBinaryWorkerUrl=""+new URL("decompressBinary.worker-DZ-PtwiT.js",import.meta.url).href,yamlWorkerUrl=""+new URL("parseYaml.worker-D2goq2pP.js",import.meta.url).href;class HashWorker extends Worker{constructor(){super(hashWorkerUrl,{type:"module"})}}class CompressWorker extends Worker{constructor(){super(compressWorkerUrl,{type:"module"})}}class CompressBinaryWorker extends Worker{constructor(){super(compressBinaryWorkerUrl,{type:"module"})}}class DecompressBinaryWorker extends Worker{constructor(){super(decompressBinaryWorkerUrl,{type:"module"})}}class IPCWorker extends Worker{constructor(){super(ipcWorkerUrl,{type:"module"})}}class ParseYamlWorker extends Worker{constructor(){super(yamlWorkerUrl,{type:"module"})}}var noop$8=function(){},_undefined$1=noop$8(),isValue$7=function(ne){return ne!==_undefined$1&&ne!==null},isValue$6=isValue$7,forEach$2=Array.prototype.forEach,create$3=Object.create,process$1=function(ne,oe){var ce;for(ce in ne)oe[ce]=ne[ce]},normalizeOptions$1=function(ne){var oe=create$3(null);return forEach$2.call(arguments,function(ce){isValue$6(ce)&&process$1(Object(ce),oe)}),oe},isImplemented$7=function(){var ne=Math.sign;return typeof ne!="function"?!1:ne(10)===1&&ne(-20)===-1},shim$5,hasRequiredShim$5;function requireShim$5(){return hasRequiredShim$5||(hasRequiredShim$5=1,shim$5=function(ne){return ne=Number(ne),isNaN(ne)||ne===0?ne:ne>0?1:-1}),shim$5}var sign$3=isImplemented$7()?Math.sign:requireShim$5(),sign$2=sign$3,abs=Math.abs,floor$1=Math.floor,toInteger$1=function(ne){return isNaN(ne)?0:(ne=Number(ne),ne===0||!isFinite(ne)?ne:sign$2(ne)*floor$1(abs(ne)))},toInteger=toInteger$1,max$6=Math.max,toPosInteger=function(ne){return max$6(0,toInteger(ne))},toPosInt$1=toPosInteger,resolveLength$2=function(ne,oe,ce){var ue;return isNaN(ne)?(ue=oe,ue>=0?ce&&ue?ue-1:ue:1):ne===!1?!1:toPosInt$1(ne)},validCallable=function(ne){if(typeof ne!="function")throw new TypeError(ne+" is not a function");return ne},isValue$5=isValue$7,validValue=function(ne){if(!isValue$5(ne))throw new TypeError("Cannot use null or undefined");return ne},callable$3=validCallable,value$2=validValue,bind$2=Function.prototype.bind,call$4=Function.prototype.call,keys$1=Object.keys,objPropertyIsEnumerable=Object.prototype.propertyIsEnumerable,_iterate=function(ne,oe){return function(ce,ue){var pe,me=arguments[2],ge=arguments[3];return ce=Object(value$2(ce)),callable$3(ue),pe=keys$1(ce),ge&&pe.sort(typeof ge=="function"?bind$2.call(ge,ce):void 0),typeof ne!="function"&&(ne=pe[ne]),call$4.call(ne,pe,function(ye,xe){return objPropertyIsEnumerable.call(ce,ye)?call$4.call(ue,me,ce[ye],ye,ce,xe):oe})}},forEach$1=_iterate("forEach"),registeredExtensions={},custom$2={exports:{}},isImplemented$6=function(){var ne=Object.assign,oe;return typeof ne!="function"?!1:(oe={foo:"raz"},ne(oe,{bar:"dwa"},{trzy:"trzy"}),oe.foo+oe.bar+oe.trzy==="razdwatrzy")},isImplemented$5,hasRequiredIsImplemented$4;function requireIsImplemented$4(){return hasRequiredIsImplemented$4||(hasRequiredIsImplemented$4=1,isImplemented$5=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),isImplemented$5}var shim$4,hasRequiredShim$4;function requireShim$4(){if(hasRequiredShim$4)return shim$4;hasRequiredShim$4=1;var ne=isValue$7,oe=Object.keys;return shim$4=function(ce){return oe(ne(ce)?Object(ce):ce)},shim$4}var keys,hasRequiredKeys;function requireKeys(){return hasRequiredKeys||(hasRequiredKeys=1,keys=requireIsImplemented$4()()?Object.keys:requireShim$4()),keys}var shim$3,hasRequiredShim$3;function requireShim$3(){if(hasRequiredShim$3)return shim$3;hasRequiredShim$3=1;var ne=requireKeys(),oe=validValue,ce=Math.max;return shim$3=function(ue,pe){var me,ge,ye=ce(arguments.length,2),xe;for(ue=Object(oe(ue)),xe=function(ve){try{ue[ve]=pe[ve]}catch(_e){me||(me=_e)}},ge=1;ge-1},shim$2}var contains$2=isImplemented$4()?String.prototype.contains:requireShim$2(),isValue$2=is$6,isPlainFunction=is$2,assign$4=assign$5,normalizeOpts$1=normalizeOptions$1,contains$1=contains$2,d$4=d$5.exports=function(ne,oe){var ce,ue,pe,me,ge;return arguments.length<2||typeof ne!="string"?(me=oe,oe=ne,ne=null):me=arguments[2],isValue$2(ne)?(ce=contains$1.call(ne,"c"),ue=contains$1.call(ne,"e"),pe=contains$1.call(ne,"w")):(ce=pe=!0,ue=!1),ge={value:oe,configurable:ce,enumerable:ue,writable:pe},me?assign$4(normalizeOpts$1(me),ge):ge};d$4.gs=function(ne,oe,ce){var ue,pe,me,ge;return typeof ne!="string"?(me=ce,ce=oe,oe=ne,ne=null):me=arguments[3],isValue$2(oe)?isPlainFunction(oe)?isValue$2(ce)?isPlainFunction(ce)||(me=ce,ce=void 0):ce=void 0:(me=oe,oe=ce=void 0):oe=void 0,isValue$2(ne)?(ue=contains$1.call(ne,"c"),pe=contains$1.call(ne,"e")):(ue=!0,pe=!1),ge={get:oe,set:ce,configurable:ue,enumerable:pe},me?assign$4(normalizeOpts$1(me),ge):ge};var dExports=d$5.exports,eventEmitter={exports:{}};(function(ne,oe){var ce=dExports,ue=validCallable,pe=Function.prototype.apply,me=Function.prototype.call,ge=Object.create,ye=Object.defineProperty,xe=Object.defineProperties,ve=Object.prototype.hasOwnProperty,_e={configurable:!0,enumerable:!1,writable:!0},we,Se,$e,Te,Re,Ae,ke;we=function(Be,Ie){var Ne;return ue(Ie),ve.call(this,"__ee__")?Ne=this.__ee__:(Ne=_e.value=ge(null),ye(this,"__ee__",_e),_e.value=null),Ne[Be]?typeof Ne[Be]=="object"?Ne[Be].push(Ie):Ne[Be]=[Ne[Be],Ie]:Ne[Be]=Ie,this},Se=function(Be,Ie){var Ne,je;return ue(Ie),je=this,we.call(this,Be,Ne=function(){$e.call(je,Be,Ne),pe.call(Ie,this,arguments)}),Ne.__eeOnceListener__=Ie,this},$e=function(Be,Ie){var Ne,je,ze,Ue;if(ue(Ie),!ve.call(this,"__ee__"))return this;if(Ne=this.__ee__,!Ne[Be])return this;if(je=Ne[Be],typeof je=="object")for(Ue=0;ze=je[Ue];++Ue)(ze===Ie||ze.__eeOnceListener__===Ie)&&(je.length===2?Ne[Be]=je[Ue?0:1]:je.splice(Ue,1));else(je===Ie||je.__eeOnceListener__===Ie)&&delete Ne[Be];return this},Te=function(Be){var Ie,Ne,je,ze,Ue;if(ve.call(this,"__ee__")&&(ze=this.__ee__[Be],!!ze))if(typeof ze=="object"){for(Ne=arguments.length,Ue=new Array(Ne-1),Ie=1;Ie=55296&&Ne<=56319&&(qe+=Se[++Ae])),qe=$e?ve.call($e,Te,qe,ke):qe,Re?(_e.value=qe,we(Be,ke,_e)):Be[ke]=qe,++ke;Ie=ke}}if(Ie===void 0)for(Ie=ue(Se.length),Re&&(Be=new Re(Ie)),Ae=0;Ae=0?_e=ge(_e):_e=oe(this.length)-ge(me(_e)),xe=_e;xe"}},safeToString}var toShortStringRepresentation,hasRequiredToShortStringRepresentation;function requireToShortStringRepresentation(){if(hasRequiredToShortStringRepresentation)return toShortStringRepresentation;hasRequiredToShortStringRepresentation=1;var ne=requireSafeToString(),oe=/[\n\r\u2028\u2029]/g;return toShortStringRepresentation=function(ce){var ue=ne(ce);return ue.length>100&&(ue=ue.slice(0,99)+"…"),ue=ue.replace(oe,function(pe){return JSON.stringify(pe).slice(1,-1)}),ue},toShortStringRepresentation}var isPromise={exports:{}},hasRequiredIsPromise;function requireIsPromise(){if(hasRequiredIsPromise)return isPromise.exports;hasRequiredIsPromise=1,isPromise.exports=ne,isPromise.exports.default=ne;function ne(oe){return!!oe&&(typeof oe=="object"||typeof oe=="function")&&typeof oe.then=="function"}return isPromise.exports}var hasRequiredPromise;function requirePromise(){if(hasRequiredPromise)return promise;hasRequiredPromise=1;var ne=requireMap(),oe=requirePrimitiveSet(),ce=requireValidateStringifiableValue(),ue=requireToShortStringRepresentation(),pe=requireIsPromise(),me=requireNextTick(),ge=Object.create,ye=oe("then","then:finally","done","done:finally");return registeredExtensions.promise=function(xe,ve){var _e=ge(null),we=ge(null),Se=ge(null);if(xe===!0)xe=null;else if(xe=ce(xe),!ye[xe])throw new TypeError("'"+ue(xe)+"' is not valid promise mode");ve.on("set",function($e,Te,Re){var Ae=!1;if(!pe(Re)){we[$e]=Re,ve.emit("setasync",$e,1);return}_e[$e]=1,Se[$e]=Re;var ke=function(je){var ze=_e[$e];if(Ae)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) +Use Save As... to download, then click back to return to this page.`)&&(location.href=Ue),!0;var Ke=document.createElement("iframe");document.body.appendChild(Ke),!qe&&/^data:/.test(Ue)&&(Ue="data:"+Ue.replace(/^data:([\w\/\-\+]+)/,ye)),Ke.src=Ue,setTimeout(function(){document.body.removeChild(Ke)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(Re,Te);if(ge.URL)ze(ge.URL.createObjectURL(Re),!0);else{if(typeof Re=="string"||Re.constructor===Se)try{return ze("data:"+xe+";base64,"+ge.btoa(Re))}catch{return ze("data:"+xe+","+encodeURIComponent(Re))}Ae=new FileReader,Ae.onload=function(Ue){ze(this.result)},Ae.readAsDataURL(Re)}return!0}})})(download$1);var downloadExports=download$1.exports;const download=getDefaultExportFromCjs$1(downloadExports);let e$3=class extends Error{},t$4=class extends e$3{},n$4=class extends e$3{};const c$5=(ne,oe=",")=>ne.join(oe),l$4={accept:"*",multiple:!1,strict:!1},r$4=ne=>{const{accept:oe,multiple:ce,strict:ue}={...l$4,...ne},pe=p$6({multiple:ce,accept:Array.isArray(oe)?c$5(oe):oe});return new Promise(me=>{pe.onchange=()=>{me(s$4(pe.files,ce,ue)),pe.remove()},pe.click()})},s$4=(ne,oe,ce)=>new Promise((ue,pe)=>{if(!ne)return pe(new t$4);const me=i$5(ne,oe,ce);if(!me)return pe(new n$4);ue(me)}),i$5=(ne,oe,ce)=>!oe&&ce?ne.length===1?ne[0]:null:ne.length?ne:null,p$6=({accept:ne,multiple:oe})=>{const ce=document.createElement("input");return ce.type="file",ce.multiple=oe,ce.accept=ne,ce};function isPlainObject$2(ne){return(ne==null?void 0:ne.constructor)===Object}var validPathRegex=/^[^.[\]]+(?:\.[^.[\]]+)*(?:\[\d+])*(?:\.[^.[\]]+(?:\[\d+])*)*$/,pathSplitRegex=/\.|(?=\[)/g,matchBracketsRegex=/[[\]]/g;function set$4(ne,oe,ce){if(!validPathRegex.test(oe))throw new Error("Invalid path, look at the examples for the correct format.");const ue=oe.split(pathSplitRegex);let pe=ne;for(let me=0;melodashExports.omitBy(merge$6(ne,oe),lodashExports.isUndefined)});function wait$1(ne){return new Promise(oe=>lodashExports.delay(oe,ne))}function useBusyState(ne){const oe=compilerRuntimeExports.c(3),[,ce]=useBusy();let ue;return oe[0]!==ce||oe[1]!==ne?(ue=async(pe,me)=>{ce(()=>({[ne]:me})),wait$1(300);const ge=await pe();return ce(()=>({[ne]:void 0})),ge},oe[0]=ce,oe[1]=ne,oe[2]=ue):ue=oe[2],ue}function formatByte(ne){return`${(ne/(1024*1024)).toFixed(2)} MB`}const[useConnections,ConnectionsProvider]=createSlice([],{reduce:replace$1}),[useFeatures,FeaturesProvider]=createSlice({algorithms:[],maps:[],formats:[],traces:[]}),[useLoading,LoadingProvider]=createSlice({specimen:0,connections:0,features:0,map:0,general:0},{reduce:(ne,{action:oe,key:ce})=>produce(ne,ue=>{switch(oe){case"start":ue[ce]+=1;break;case"end":ue[ce]-=1}return ue})});function useAnyLoading(){const ne=compilerRuntimeExports.c(2),[oe]=useLoading();let ce;return ne[0]!==oe?(ce=lodashExports.some(lodashExports.values(oe)),ne[0]=oe,ne[1]=ce):ce=ne[1],ce}function useLoadingState(ne){const oe=compilerRuntimeExports.c(3),ce=ne===void 0?"general":ne,[,ue]=useLoading();let pe;return oe[0]!==ue||oe[1]!==ce?(pe=async me=>{ue(()=>({action:"start",key:ce}));const ge=await me();return ue(()=>({action:"end",key:ce})),ge},oe[0]=ue,oe[1]=ce,oe[2]=pe):pe=oe[2],pe}const hashWorkerUrl=""+new URL("hash.worker-B5ThNeUw.js",import.meta.url).href,ipcWorkerUrl=""+new URL("ipc.worker-BX5xrXZT.js",import.meta.url).href,compressWorkerUrl=""+new URL("compress.worker-BDIAOI0k.js",import.meta.url).href,compressBinaryWorkerUrl=""+new URL("compressBinary.worker-DBtqfVRd.js",import.meta.url).href,decompressBinaryWorkerUrl=""+new URL("decompressBinary.worker-DZ-PtwiT.js",import.meta.url).href,yamlWorkerUrl=""+new URL("parseYaml.worker-CXyNYLS1.js",import.meta.url).href;class HashWorker extends Worker{constructor(){super(hashWorkerUrl,{type:"module"})}}class CompressWorker extends Worker{constructor(){super(compressWorkerUrl,{type:"module"})}}class CompressBinaryWorker extends Worker{constructor(){super(compressBinaryWorkerUrl,{type:"module"})}}class DecompressBinaryWorker extends Worker{constructor(){super(decompressBinaryWorkerUrl,{type:"module"})}}class IPCWorker extends Worker{constructor(){super(ipcWorkerUrl,{type:"module"})}}class ParseYamlWorker extends Worker{constructor(){super(yamlWorkerUrl,{type:"module"})}}var noop$8=function(){},_undefined$1=noop$8(),isValue$7=function(ne){return ne!==_undefined$1&&ne!==null},isValue$6=isValue$7,forEach$2=Array.prototype.forEach,create$3=Object.create,process$1=function(ne,oe){var ce;for(ce in ne)oe[ce]=ne[ce]},normalizeOptions$1=function(ne){var oe=create$3(null);return forEach$2.call(arguments,function(ce){isValue$6(ce)&&process$1(Object(ce),oe)}),oe},isImplemented$7=function(){var ne=Math.sign;return typeof ne!="function"?!1:ne(10)===1&&ne(-20)===-1},shim$5,hasRequiredShim$5;function requireShim$5(){return hasRequiredShim$5||(hasRequiredShim$5=1,shim$5=function(ne){return ne=Number(ne),isNaN(ne)||ne===0?ne:ne>0?1:-1}),shim$5}var sign$3=isImplemented$7()?Math.sign:requireShim$5(),sign$2=sign$3,abs=Math.abs,floor$1=Math.floor,toInteger$1=function(ne){return isNaN(ne)?0:(ne=Number(ne),ne===0||!isFinite(ne)?ne:sign$2(ne)*floor$1(abs(ne)))},toInteger=toInteger$1,max$6=Math.max,toPosInteger=function(ne){return max$6(0,toInteger(ne))},toPosInt$1=toPosInteger,resolveLength$2=function(ne,oe,ce){var ue;return isNaN(ne)?(ue=oe,ue>=0?ce&&ue?ue-1:ue:1):ne===!1?!1:toPosInt$1(ne)},validCallable=function(ne){if(typeof ne!="function")throw new TypeError(ne+" is not a function");return ne},isValue$5=isValue$7,validValue=function(ne){if(!isValue$5(ne))throw new TypeError("Cannot use null or undefined");return ne},callable$3=validCallable,value$2=validValue,bind$2=Function.prototype.bind,call$4=Function.prototype.call,keys$1=Object.keys,objPropertyIsEnumerable=Object.prototype.propertyIsEnumerable,_iterate=function(ne,oe){return function(ce,ue){var pe,me=arguments[2],ge=arguments[3];return ce=Object(value$2(ce)),callable$3(ue),pe=keys$1(ce),ge&&pe.sort(typeof ge=="function"?bind$2.call(ge,ce):void 0),typeof ne!="function"&&(ne=pe[ne]),call$4.call(ne,pe,function(ye,xe){return objPropertyIsEnumerable.call(ce,ye)?call$4.call(ue,me,ce[ye],ye,ce,xe):oe})}},forEach$1=_iterate("forEach"),registeredExtensions={},custom$2={exports:{}},isImplemented$6=function(){var ne=Object.assign,oe;return typeof ne!="function"?!1:(oe={foo:"raz"},ne(oe,{bar:"dwa"},{trzy:"trzy"}),oe.foo+oe.bar+oe.trzy==="razdwatrzy")},isImplemented$5,hasRequiredIsImplemented$4;function requireIsImplemented$4(){return hasRequiredIsImplemented$4||(hasRequiredIsImplemented$4=1,isImplemented$5=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),isImplemented$5}var shim$4,hasRequiredShim$4;function requireShim$4(){if(hasRequiredShim$4)return shim$4;hasRequiredShim$4=1;var ne=isValue$7,oe=Object.keys;return shim$4=function(ce){return oe(ne(ce)?Object(ce):ce)},shim$4}var keys,hasRequiredKeys;function requireKeys(){return hasRequiredKeys||(hasRequiredKeys=1,keys=requireIsImplemented$4()()?Object.keys:requireShim$4()),keys}var shim$3,hasRequiredShim$3;function requireShim$3(){if(hasRequiredShim$3)return shim$3;hasRequiredShim$3=1;var ne=requireKeys(),oe=validValue,ce=Math.max;return shim$3=function(ue,pe){var me,ge,ye=ce(arguments.length,2),xe;for(ue=Object(oe(ue)),xe=function(ve){try{ue[ve]=pe[ve]}catch(_e){me||(me=_e)}},ge=1;ge-1},shim$2}var contains$2=isImplemented$4()?String.prototype.contains:requireShim$2(),isValue$2=is$6,isPlainFunction=is$2,assign$4=assign$5,normalizeOpts$1=normalizeOptions$1,contains$1=contains$2,d$4=d$5.exports=function(ne,oe){var ce,ue,pe,me,ge;return arguments.length<2||typeof ne!="string"?(me=oe,oe=ne,ne=null):me=arguments[2],isValue$2(ne)?(ce=contains$1.call(ne,"c"),ue=contains$1.call(ne,"e"),pe=contains$1.call(ne,"w")):(ce=pe=!0,ue=!1),ge={value:oe,configurable:ce,enumerable:ue,writable:pe},me?assign$4(normalizeOpts$1(me),ge):ge};d$4.gs=function(ne,oe,ce){var ue,pe,me,ge;return typeof ne!="string"?(me=ce,ce=oe,oe=ne,ne=null):me=arguments[3],isValue$2(oe)?isPlainFunction(oe)?isValue$2(ce)?isPlainFunction(ce)||(me=ce,ce=void 0):ce=void 0:(me=oe,oe=ce=void 0):oe=void 0,isValue$2(ne)?(ue=contains$1.call(ne,"c"),pe=contains$1.call(ne,"e")):(ue=!0,pe=!1),ge={get:oe,set:ce,configurable:ue,enumerable:pe},me?assign$4(normalizeOpts$1(me),ge):ge};var dExports=d$5.exports,eventEmitter={exports:{}};(function(ne,oe){var ce=dExports,ue=validCallable,pe=Function.prototype.apply,me=Function.prototype.call,ge=Object.create,ye=Object.defineProperty,xe=Object.defineProperties,ve=Object.prototype.hasOwnProperty,_e={configurable:!0,enumerable:!1,writable:!0},we,Se,$e,Te,Re,Ae,ke;we=function(Be,Ie){var Ne;return ue(Ie),ve.call(this,"__ee__")?Ne=this.__ee__:(Ne=_e.value=ge(null),ye(this,"__ee__",_e),_e.value=null),Ne[Be]?typeof Ne[Be]=="object"?Ne[Be].push(Ie):Ne[Be]=[Ne[Be],Ie]:Ne[Be]=Ie,this},Se=function(Be,Ie){var Ne,je;return ue(Ie),je=this,we.call(this,Be,Ne=function(){$e.call(je,Be,Ne),pe.call(Ie,this,arguments)}),Ne.__eeOnceListener__=Ie,this},$e=function(Be,Ie){var Ne,je,ze,Ue;if(ue(Ie),!ve.call(this,"__ee__"))return this;if(Ne=this.__ee__,!Ne[Be])return this;if(je=Ne[Be],typeof je=="object")for(Ue=0;ze=je[Ue];++Ue)(ze===Ie||ze.__eeOnceListener__===Ie)&&(je.length===2?Ne[Be]=je[Ue?0:1]:je.splice(Ue,1));else(je===Ie||je.__eeOnceListener__===Ie)&&delete Ne[Be];return this},Te=function(Be){var Ie,Ne,je,ze,Ue;if(ve.call(this,"__ee__")&&(ze=this.__ee__[Be],!!ze))if(typeof ze=="object"){for(Ne=arguments.length,Ue=new Array(Ne-1),Ie=1;Ie=55296&&Ne<=56319&&(qe+=Se[++Ae])),qe=$e?ve.call($e,Te,qe,ke):qe,Re?(_e.value=qe,we(Be,ke,_e)):Be[ke]=qe,++ke;Ie=ke}}if(Ie===void 0)for(Ie=ue(Se.length),Re&&(Be=new Re(Ie)),Ae=0;Ae=0?_e=ge(_e):_e=oe(this.length)-ge(me(_e)),xe=_e;xe"}},safeToString}var toShortStringRepresentation,hasRequiredToShortStringRepresentation;function requireToShortStringRepresentation(){if(hasRequiredToShortStringRepresentation)return toShortStringRepresentation;hasRequiredToShortStringRepresentation=1;var ne=requireSafeToString(),oe=/[\n\r\u2028\u2029]/g;return toShortStringRepresentation=function(ce){var ue=ne(ce);return ue.length>100&&(ue=ue.slice(0,99)+"…"),ue=ue.replace(oe,function(pe){return JSON.stringify(pe).slice(1,-1)}),ue},toShortStringRepresentation}var isPromise={exports:{}},hasRequiredIsPromise;function requireIsPromise(){if(hasRequiredIsPromise)return isPromise.exports;hasRequiredIsPromise=1,isPromise.exports=ne,isPromise.exports.default=ne;function ne(oe){return!!oe&&(typeof oe=="object"||typeof oe=="function")&&typeof oe.then=="function"}return isPromise.exports}var hasRequiredPromise;function requirePromise(){if(hasRequiredPromise)return promise;hasRequiredPromise=1;var ne=requireMap(),oe=requirePrimitiveSet(),ce=requireValidateStringifiableValue(),ue=requireToShortStringRepresentation(),pe=requireIsPromise(),me=requireNextTick(),ge=Object.create,ye=oe("then","then:finally","done","done:finally");return registeredExtensions.promise=function(xe,ve){var _e=ge(null),we=ge(null),Se=ge(null);if(xe===!0)xe=null;else if(xe=ce(xe),!ye[xe])throw new TypeError("'"+ue(xe)+"' is not valid promise mode");ve.on("set",function($e,Te,Re){var Ae=!1;if(!pe(Re)){we[$e]=Re,ve.emit("setasync",$e,1);return}_e[$e]=1,Se[$e]=Re;var ke=function(je){var ze=_e[$e];if(Ae)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) Consider to rely on 'then' or 'done' mode instead.`);ze&&(delete _e[$e],we[$e]=je,ve.emit("setasync",$e,ze))},Be=function(){Ae=!0,_e[$e]&&(delete _e[$e],delete Se[$e],ve.delete($e))},Ie=xe;if(Ie||(Ie="then"),Ie==="then"){var Ne=function(){me(Be)};Re=Re.then(function(je){me(ke.bind(this,je))},Ne),typeof Re.finally=="function"&&Re.finally(Ne)}else if(Ie==="done"){if(typeof Re.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");Re.done(ke,Be)}else if(Ie==="done:finally"){if(typeof Re.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof Re.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");Re.done(ke),Re.finally(Be)}}),ve.on("get",function($e,Te,Re){var Ae;if(_e[$e]){++_e[$e];return}Ae=Se[$e];var ke=function(){ve.emit("getasync",$e,Te,Re)};pe(Ae)?typeof Ae.done=="function"?Ae.done(ke):Ae.then(function(){me(ke)}):ke()}),ve.on("delete",function($e){if(delete Se[$e],_e[$e]){delete _e[$e];return}if(hasOwnProperty.call(we,$e)){var Te=we[$e];delete we[$e],ve.emit("deleteasync",$e,[Te])}}),ve.on("clear",function(){var $e=we;we=ge(null),_e=ge(null),Se=ge(null),ve.emit("clearasync",ne($e,function(Te){return[Te]}))})},promise}var dispose={},hasRequiredDispose;function requireDispose(){if(hasRequiredDispose)return dispose;hasRequiredDispose=1;var ne=validCallable,oe=forEach$1,ce=registeredExtensions,ue=Function.prototype.apply;return ce.dispose=function(pe,me,ge){var ye;if(ne(pe),ge.async&&ce.async||ge.promise&&ce.promise){me.on("deleteasync",ye=function(xe,ve){ue.call(pe,null,ve)}),me.on("clearasync",function(xe){oe(xe,function(ve,_e){ye(_e,ve)})});return}me.on("delete",ye=function(xe,ve){pe(ve)}),me.on("clear",function(xe){oe(xe,function(ve,_e){ye(_e,ve)})})},dispose}var maxAge={},maxTimeout,hasRequiredMaxTimeout;function requireMaxTimeout(){return hasRequiredMaxTimeout||(hasRequiredMaxTimeout=1,maxTimeout=2147483647),maxTimeout}var validTimeout,hasRequiredValidTimeout;function requireValidTimeout(){if(hasRequiredValidTimeout)return validTimeout;hasRequiredValidTimeout=1;var ne=toPosInteger,oe=requireMaxTimeout();return validTimeout=function(ce){if(ce=ne(ce),ce>oe)throw new TypeError(ce+" exceeds maximum possible timeout");return ce},validTimeout}var hasRequiredMaxAge;function requireMaxAge(){if(hasRequiredMaxAge)return maxAge;hasRequiredMaxAge=1;var ne=requireFrom(),oe=forEach$1,ce=requireNextTick(),ue=requireIsPromise(),pe=requireValidTimeout(),me=registeredExtensions,ge=Function.prototype,ye=Math.max,xe=Math.min,ve=Object.create;return me.maxAge=function(_e,we,Se){var $e,Te,Re,Ae;_e=pe(_e),_e&&($e=ve(null),Te=Se.async&&me.async||Se.promise&&me.promise?"async":"",we.on("set"+Te,function(ke){$e[ke]=setTimeout(function(){we.delete(ke)},_e),typeof $e[ke].unref=="function"&&$e[ke].unref(),Ae&&(Ae[ke]&&Ae[ke]!=="nextTick"&&clearTimeout(Ae[ke]),Ae[ke]=setTimeout(function(){delete Ae[ke]},Re),typeof Ae[ke].unref=="function"&&Ae[ke].unref())}),we.on("delete"+Te,function(ke){clearTimeout($e[ke]),delete $e[ke],Ae&&(Ae[ke]!=="nextTick"&&clearTimeout(Ae[ke]),delete Ae[ke])}),Se.preFetch&&(Se.preFetch===!0||isNaN(Se.preFetch)?Re=.333:Re=ye(xe(Number(Se.preFetch),1),0),Re&&(Ae={},Re=(1-Re)*_e,we.on("get"+Te,function(ke,Be,Ie){Ae[ke]||(Ae[ke]="nextTick",ce(function(){var Ne;Ae[ke]==="nextTick"&&(delete Ae[ke],we.delete(ke),Se.async&&(Be=ne(Be),Be.push(ge)),Ne=we.memoized.apply(Ie,Be),Se.promise&&ue(Ne)&&(typeof Ne.done=="function"?Ne.done(ge,ge):Ne.then(ge,ge)))}))}))),we.on("clear"+Te,function(){oe($e,function(ke){clearTimeout(ke)}),$e={},Ae&&(oe(Ae,function(ke){ke!=="nextTick"&&clearTimeout(ke)}),Ae={})}))},maxAge}var max$5={},lruQueue,hasRequiredLruQueue;function requireLruQueue(){if(hasRequiredLruQueue)return lruQueue;hasRequiredLruQueue=1;var ne=toPosInteger,oe=Object.create,ce=Object.prototype.hasOwnProperty;return lruQueue=function(ue){var pe=0,me=1,ge=oe(null),ye=oe(null),xe=0,ve;return ue=ne(ue),{hit:function(_e){var we=ye[_e],Se=++xe;if(ge[Se]=_e,ye[_e]=Se,!we)return++pe,pe<=ue?void 0:(_e=ge[me],ve(_e),_e);if(delete ge[we],me===we)for(;!ce.call(ge,++me););},delete:ve=function(_e){var we=ye[_e];if(we&&(delete ge[we],delete ye[_e],--pe,me===we)){if(!pe){xe=0,me=1;return}for(;!ce.call(ge,++me););}},clear:function(){pe=0,me=1,ge=oe(null),ye=oe(null),xe=0}}},lruQueue}var hasRequiredMax;function requireMax(){if(hasRequiredMax)return max$5;hasRequiredMax=1;var ne=toPosInteger,oe=requireLruQueue(),ce=registeredExtensions;return ce.max=function(ue,pe,me){var ge,ye,xe;ue=ne(ue),ue&&(ye=oe(ue),ge=me.async&&ce.async||me.promise&&ce.promise?"async":"",pe.on("set"+ge,xe=function(ve){ve=ye.hit(ve),ve!==void 0&&pe.delete(ve)}),pe.on("get"+ge,xe),pe.on("delete"+ge,ye.delete),pe.on("clear"+ge,ye.clear))},max$5}var refCounter={},hasRequiredRefCounter;function requireRefCounter(){if(hasRequiredRefCounter)return refCounter;hasRequiredRefCounter=1;var ne=dExports,oe=registeredExtensions,ce=Object.create,ue=Object.defineProperties;return oe.refCounter=function(pe,me,ge){var ye,xe;ye=ce(null),xe=ge.async&&oe.async||ge.promise&&oe.promise?"async":"",me.on("set"+xe,function(ve,_e){ye[ve]=_e||1}),me.on("get"+xe,function(ve){++ye[ve]}),me.on("delete"+xe,function(ve){delete ye[ve]}),me.on("clear"+xe,function(){ye={}}),ue(me.memoized,{deleteRef:ne(function(){var ve=me.get(arguments);return ve===null||!ye[ve]?null:--ye[ve]?!1:(me.delete(ve),!0)}),getRefCount:ne(function(){var ve=me.get(arguments);return ve===null||!ye[ve]?0:ye[ve]})})},refCounter}var normalizeOpts=normalizeOptions$1,resolveLength=resolveLength$2,plain=plain$1,memoizee=function(ne){var oe=normalizeOpts(arguments[1]),ce;return oe.normalizer||(ce=oe.length=resolveLength(oe.length,ne.length,oe.async),ce!==0&&(oe.primitive?ce===!1?oe.normalizer=requirePrimitive():ce>1&&(oe.normalizer=requireGetPrimitiveFixed()(ce)):ce===!1?oe.normalizer=requireGet()():ce===1?oe.normalizer=requireGet1()():oe.normalizer=requireGetFixed()(ce))),oe.async&&requireAsync(),oe.promise&&requirePromise(),oe.dispose&&requireDispose(),oe.maxAge&&requireMaxAge(),oe.max&&requireMax(),oe.refCounter&&requireRefCounter(),plain(ne,oe)};const memoizee$1=getDefaultExportFromCjs$1(memoizee),usingWorker=ne=>async oe=>{const ce=new ne,ue=await oe(ce);if("error"in ue)throw console.error(ue.error),new Error(ue.error);return ce.terminate(),ue.result},usingWorkerTask=ne=>oe=>usingWorker(ne)(ce=>(ce.postMessage(oe),new Promise((ue,pe)=>{ce.onmessage=me=>{ue(me.data)},ce.onerror=me=>{console.error(me),pe(me)}}))),usingMemoizedWorkerTask=(ne,oe={async:!0,length:1})=>memoizee$1(usingWorkerTask(ne),oe);lodashExports.memoize(usingWorkerTask(HashWorker));lodashExports.memoize(usingWorkerTask(CompressWorker));const compressBinaryAsync=lodashExports.memoize(usingWorkerTask(CompressBinaryWorker)),decompressBinaryAsync=lodashExports.memoize(usingWorkerTask(DecompressBinaryWorker)),parseYamlAsync=lodashExports.memoize(usingWorkerTask(ParseYamlWorker));function ext$1(ne){return ne.split(".").pop()}function name$2(ne){return ne.split(".").shift()}const customId="internal/custom",custom$1=(ne,oe="resource")=>({name:(ne==null?void 0:ne.id)===customId?`Imported ${lodashExports.startCase(oe)} - ${ne==null?void 0:ne.name}`:`Import ${lodashExports.startCase(oe)}`,description:"Internal",id:customId}),EXTENSIONS=["json","yaml","yml"],FORMATS$1=EXTENSIONS.map(ne=>`.trace.${ne}`);async function uploadTrace(){const ne=await r$4({accept:EXTENSIONS.map(oe=>`.${oe}`),strict:!0});if(ne)return readUploadedTrace(ne)}function readUploadedTrace(ne){return{file:ne,read:async()=>{if(isTraceFormat(ne)){const oe=await ne.text(),ce=await parseYamlAsync(oe);return{...custom$1(),format:ce==null?void 0:ce.format,content:ce,name:lodashExports.startCase(name$2(ne.name)),type:customId,key:nanoid()}}else throw new Error(`The file should have one of these extensions: ${FORMATS$1.join(", ")}`)}}}function isTraceFormat(ne){return!!lodashExports.find(FORMATS$1,oe=>ne.name.endsWith(oe))}async function uploadMap(ne){const oe=await r$4({accept:ne.map(({id:ce})=>`.${ce}`),strict:!0});if(oe)return readUploadedMap(oe,ne)}function readUploadedMap(ne,oe){return{file:ne,read:async()=>{if(lodashExports.find(oe,{id:ext$1(ne.name)}))return{...custom$1(),format:ext$1(ne.name),content:await ne.text(),name:lodashExports.startCase(name$2(ne.name))};throw new Error(`The format (${ext$1(ne.name)}) is unsupported.`)}}}function name$1(ne){return ne.split(".").shift()}function MapPicker({onChange:ne,value:oe}){const ce=useSnackbar(),ue=useLoadingState("map"),[{features:pe,connections:me}]=useLoading(),ge=useBusyState("map"),[ye]=useConnections(),[{maps:xe,formats:ve}]=useFeatures();return jsxRuntimeExports.jsx(FeaturePicker,{showTooltip:!0,arrow:!0,paper:!0,disabled:!!pe||!!me,ellipsis:25,icon:jsxRuntimeExports.jsx(SvgIcon$J,{}),label:"Choose Map",value:oe==null?void 0:oe.id,items:[custom$1(oe,"map"),...xe.map(_e=>{var we;return{..._e,description:(we=lodashExports.find(ye,{url:_e.source}))==null?void 0:we.name}})],onChange:async _e=>{switch(_e){case custom$1().id:try{const we=await uploadMap(ve);we&&ue(async()=>{ce("Opening map...");const Se=we.file.size>LARGE_FILE_B?await ge(we.read,`Opening map (${formatByte(we.file.size)})`):await we.read();Se&&(ne==null||ne(Se))})}catch(we){ce(`${we}`)}break;default:ne==null||ne(lodashExports.find(xe,{id:_e}));break}}})}function TracePicker({onChange:ne,value:oe}){const ce=useSnackbar(),ue=useLoadingState("specimen"),pe=useBusyState("specimen"),[me]=useConnections(),[{features:ge,connections:ye}]=useLoading(),[{traces:xe}]=useFeatures();return jsxRuntimeExports.jsx(FeaturePicker,{showTooltip:!0,paper:!0,arrow:!0,ellipsis:25,disabled:!!ge||!!ye,icon:jsxRuntimeExports.jsx(SvgIcon$J,{}),label:"Choose Trace",value:oe==null?void 0:oe.id,items:[custom$1(oe,"trace"),...xe.map(ve=>{var _e;return{...ve,description:(_e=lodashExports.find(me,{url:ve.source}))==null?void 0:_e.name}})],onChange:async ve=>{switch(ve){case custom$1().id:try{const _e=await uploadTrace();_e&&ue(async()=>{ce("Opening trace...");try{const we=_e.file.size>LARGE_FILE_B?await pe(_e.read,`Opening trace (${formatByte(_e.file.size)})`):await _e.read();we&&(ne==null||ne(we))}catch(we){console.error(we),ce(`Error opening, ${lodashExports.get(we,"message")}`),ne==null||ne({id:custom$1().id,error:lodashExports.get(we,"message"),name:lodashExports.startCase(name$1(_e.file.name))})}})}catch(_e){console.error(_e),ce(`Error opening, ${lodashExports.get(_e,"message")}`),ne==null||ne({id:custom$1().id,error:lodashExports.get(_e,"message"),name:"File"})}break;default:ne==null||ne(lodashExports.find(xe,{id:ve}));break}}})}const Heading=({label:ne})=>jsxRuntimeExports.jsx(Typography,{component:"div",variant:"overline",color:"text.secondary",sx:{pt:1},children:ne}),Label=({label:ne})=>jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body1",children:ne}),Option=({label:ne,content:oe})=>jsxRuntimeExports.jsxs(Flex,{alignItems:"center",children:[jsxRuntimeExports.jsx(Label,{label:ne}),jsxRuntimeExports.jsx(Space,{flex:1}),oe]});var hexRgb$1=function(ne){if(typeof ne!="string")throw new TypeError("Expected a string");ne=ne.replace(/^#/,""),ne.length===3&&(ne=ne[0]+ne[0]+ne[1]+ne[1]+ne[2]+ne[2]);var oe=parseInt(ne,16);return[oe>>16,oe>>8&255,oe&255]},rgbHex$1=(ne,oe,ce,ue)=>{const pe=(ne+(ue||"")).toString().includes("%");if(typeof ne=="string"){const me=ne.match(/(0?\.?\d{1,3})%?\b/g).map(Number);ne=me[0],oe=me[1],ce=me[2],ue=me[3]}else ue!==void 0&&(ue=parseFloat(ue));if(typeof ne!="number"||typeof oe!="number"||typeof ce!="number"||ne>255||oe>255||ce>255)throw new TypeError("Expected three numbers below 256");if(typeof ue=="number"){if(!pe&&ue>=0&&ue<=1)ue=Math.round(255*ue);else if(pe&&ue>=0&&ue<=100)ue=Math.round(255*ue/100);else throw new TypeError(`Expected alpha value (${ue}) as a fraction or percentage`);ue=(ue|256).toString(16).slice(1)}else ue="";return(ce|oe<<8|ne<<16|1<<24).toString(16).slice(1)+ue},colorDiff$1={};/** * @author Markus Ekholm * @copyright 2012-2023 (c) Markus Ekholm @@ -534,7 +534,7 @@ Consider to rely on 'then' or 'done' mode instead.`);ze&&(delete _e[$e],we[$e]=j * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */function paletteMapKey(ne){return ne=normalize$2(ne),ne.A!==1?`rgba(${ne.R}, ${ne.G}, ${ne.B}, ${ne.A})`:`rgb(${ne.R}, ${ne.G}, ${ne.B})`}function labPaletteMapKey(ne){return`lab(${ne.L}, ${ne.a}, ${ne.b})`}function mapPalette(ne,oe,ce,ue){const pe={};ue=ue||{R:255,G:255,B:255},ce=ce||"closest";for(let me=0;mexe){ye=_e,xe=we;continue}}ye&&(pe[paletteMapKey(ge)]=ye)}return pe}function matchPaletteLab(ne,oe,ce){let ue,pe,me=oe[0],ge=ciede2000(ne,me);for(let ye=1,xe=oe.length;yege)&&(me=ue,ge=pe);return me}function mapPaletteLab(ne,oe,ce){const ue={},pe=ce==="furthest";for(let me=0;me{let oe=hexRgb(ne);return{R:oe[0],G:oe[1],B:oe[2]}},pantoneRGBList=pantones.map(ne=>get_rgbObject(ne.hex));var getClosestColor=ne=>{const oe=get_rgbObject(ne),ce=diff.closest(oe,pantoneRGBList),ue=rgbHex(ce.R,ce.G,ce.B),pe=pantones.findIndex(ge=>ge.hex==`#${ue}`);return pantones[pe]};function u$4(){return(u$4=Object.assign||function(ne){for(var oe=1;oe=0||(pe[ce]=ne[ce]);return pe}function i$4(ne){var oe=reactExports.useRef(ne),ce=reactExports.useRef(function(ue){oe.current&&oe.current(ue)});return oe.current=ne,ce.current}var s$3=function(ne,oe,ce){return oe===void 0&&(oe=0),ce===void 0&&(ce=1),ne>ce?ce:ne0:Ae.buttons>0)&&pe.current?me(d$2(pe.current,Ae,ye.current)):Re(!1)},Te=function(){return Re(!1)};function Re(Ae){var ke=xe.current,Be=v$6(pe.current),Ie=Ae?Be.addEventListener:Be.removeEventListener;Ie(ke?"touchmove":"mousemove",$e),Ie(ke?"touchend":"mouseup",Te)}return[function(Ae){var ke=Ae.nativeEvent,Be=pe.current;if(Be&&(h$5(ke),!function(Ne,je){return je&&!f$5(Ne)}(ke,xe.current)&&Be)){if(f$5(ke)){xe.current=!0;var Ie=ke.changedTouches||[];Ie.length&&(ye.current=Ie[0].identifier)}Be.focus(),me(d$2(Be,ke,ye.current)),Re(!0)}},function(Ae){var ke=Ae.which||Ae.keyCode;ke<37||ke>40||(Ae.preventDefault(),ge({left:ke===39?.05:ke===37?-.05:0,top:ke===40?.05:ke===38?-.05:0}))},Re]},[ge,me]),_e=ve[0],we=ve[1],Se=ve[2];return reactExports.useEffect(function(){return Se},[Se]),React$2.createElement("div",u$4({},ue,{onTouchStart:_e,onMouseDown:_e,className:"react-colorful__interactive",ref:pe,onKeyDown:we,tabIndex:0,role:"slider"}))}),g$4=function(ne){return ne.filter(Boolean).join(" ")},p$5=function(ne){var oe=ne.color,ce=ne.left,ue=ne.top,pe=ue===void 0?.5:ue,me=g$4(["react-colorful__pointer",ne.className]);return React$2.createElement("div",{className:me,style:{top:100*pe+"%",left:100*ce+"%"}},React$2.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:oe}}))},b$5=function(ne,oe,ce){return oe===void 0&&(oe=0),ce===void 0&&(ce=Math.pow(10,oe)),Math.round(ce*ne)/ce},x$5=function(ne){return L$3(C$3(ne))},C$3=function(ne){return ne[0]==="#"&&(ne=ne.substring(1)),ne.length<6?{r:parseInt(ne[0]+ne[0],16),g:parseInt(ne[1]+ne[1],16),b:parseInt(ne[2]+ne[2],16),a:ne.length===4?b$5(parseInt(ne[3]+ne[3],16)/255,2):1}:{r:parseInt(ne.substring(0,2),16),g:parseInt(ne.substring(2,4),16),b:parseInt(ne.substring(4,6),16),a:ne.length===8?b$5(parseInt(ne.substring(6,8),16)/255,2):1}},w$4=function(ne){return K$2(I$2(ne))},y$6=function(ne){var oe=ne.s,ce=ne.v,ue=ne.a,pe=(200-oe)*ce/100;return{h:b$5(ne.h),s:b$5(pe>0&&pe<200?oe*ce/100/(pe<=100?pe:200-pe)*100:0),l:b$5(pe/2),a:b$5(ue,2)}},q$3=function(ne){var oe=y$6(ne);return"hsl("+oe.h+", "+oe.s+"%, "+oe.l+"%)"},I$2=function(ne){var oe=ne.h,ce=ne.s,ue=ne.v,pe=ne.a;oe=oe/360*6,ce/=100,ue/=100;var me=Math.floor(oe),ge=ue*(1-ce),ye=ue*(1-(oe-me)*ce),xe=ue*(1-(1-oe+me)*ce),ve=me%6;return{r:b$5(255*[ue,ye,ge,ge,xe,ue][ve]),g:b$5(255*[xe,ue,ue,ye,ge,ge][ve]),b:b$5(255*[ge,ge,xe,ue,ue,ye][ve]),a:b$5(pe,2)}},D$3=function(ne){var oe=ne.toString(16);return oe.length<2?"0"+oe:oe},K$2=function(ne){var oe=ne.r,ce=ne.g,ue=ne.b,pe=ne.a,me=pe<1?D$3(b$5(255*pe)):"";return"#"+D$3(oe)+D$3(ce)+D$3(ue)+me},L$3=function(ne){var oe=ne.r,ce=ne.g,ue=ne.b,pe=ne.a,me=Math.max(oe,ce,ue),ge=me-Math.min(oe,ce,ue),ye=ge?me===oe?(ce-ue)/ge:me===ce?2+(ue-oe)/ge:4+(oe-ce)/ge:0;return{h:b$5(60*(ye<0?ye+6:ye)),s:b$5(me?ge/me*100:0),v:b$5(me/255*100),a:pe}},S$5=React$2.memo(function(ne){var oe=ne.hue,ce=ne.onChange,ue=g$4(["react-colorful__hue",ne.className]);return React$2.createElement("div",{className:ue},React$2.createElement(m$3,{onMove:function(pe){ce({h:360*pe.left})},onKey:function(pe){ce({h:s$3(oe+360*pe.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$5(oe),"aria-valuemax":"360","aria-valuemin":"0"},React$2.createElement(p$5,{className:"react-colorful__hue-pointer",left:oe/360,color:q$3({h:oe,s:100,v:100,a:1})})))}),T$3=React$2.memo(function(ne){var oe=ne.hsva,ce=ne.onChange,ue={backgroundColor:q$3({h:oe.h,s:100,v:100,a:1})};return React$2.createElement("div",{className:"react-colorful__saturation",style:ue},React$2.createElement(m$3,{onMove:function(pe){ce({s:100*pe.left,v:100-100*pe.top})},onKey:function(pe){ce({s:s$3(oe.s+100*pe.left,0,100),v:s$3(oe.v-100*pe.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$5(oe.s)+"%, Brightness "+b$5(oe.v)+"%"},React$2.createElement(p$5,{className:"react-colorful__saturation-pointer",top:1-oe.v/100,left:oe.s/100,color:q$3(oe)})))}),F$2=function(ne,oe){if(ne===oe)return!0;for(var ce in ne)if(ne[ce]!==oe[ce])return!1;return!0},X$2=function(ne,oe){return ne.toLowerCase()===oe.toLowerCase()||F$2(C$3(ne),C$3(oe))};function Y$5(ne,oe,ce){var ue=i$4(ce),pe=reactExports.useState(function(){return ne.toHsva(oe)}),me=pe[0],ge=pe[1],ye=reactExports.useRef({color:oe,hsva:me});reactExports.useEffect(function(){if(!ne.equal(oe,ye.current.color)){var ve=ne.toHsva(oe);ye.current={hsva:ve,color:oe},ge(ve)}},[oe,ne]),reactExports.useEffect(function(){var ve;F$2(me,ye.current.hsva)||ne.equal(ve=ne.fromHsva(me),ye.current.color)||(ye.current={hsva:me,color:ve},ue(ve))},[me,ne,ue]);var xe=reactExports.useCallback(function(ve){ge(function(_e){return Object.assign({},_e,ve)})},[]);return[me,xe]}var V$2=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$4=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$2=new Map,Q$2=function(ne){V$2(function(){var oe=ne.current?ne.current.ownerDocument:document;if(oe!==void 0&&!J$2.has(oe)){var ce=oe.createElement("style");ce.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$2.set(oe,ce);var ue=$$4();ue&&ce.setAttribute("nonce",ue),oe.head.appendChild(ce)}},[])},U$2=function(ne){var oe=ne.className,ce=ne.colorModel,ue=ne.color,pe=ue===void 0?ce.defaultColor:ue,me=ne.onChange,ge=c$4(ne,["className","colorModel","color","onChange"]),ye=reactExports.useRef(null);Q$2(ye);var xe=Y$5(ce,pe,me),ve=xe[0],_e=xe[1],we=g$4(["react-colorful",oe]);return React$2.createElement("div",u$4({},ge,{ref:ye,className:we}),React$2.createElement(T$3,{hsva:ve,onChange:_e}),React$2.createElement(S$5,{hue:ve.h,onChange:_e,className:"react-colorful__last-control"}))},W$2={defaultColor:"000",toHsva:x$5,fromHsva:function(ne){return w$4({h:ne.h,s:ne.s,v:ne.v,a:1})},equal:X$2},Z$3=function(ne){return React$2.createElement(U$2,u$4({},ne,{colorModel:W$2}))};const byPoint=({variables:ne},{x:oe,y:ce})=>(ne==null?void 0:ne.x)===oe&&(ne==null?void 0:ne.y)===ce,getGridSymbolsUrl=""+new URL("getGridSymbols.worker-QUYfJgzc.js",import.meta.url).href;class GetGridSymbolsWorker extends Worker{constructor(){super(getGridSymbolsUrl,{type:"module"})}}const getGridSymbolsAsync=usingWorkerTask(GetGridSymbolsWorker),parseGridWorkerUrl=""+new URL("parseGrid.worker-DeCcDXY5.js",import.meta.url).href;class ParseGridWorker extends Worker{constructor(){super(parseGridWorkerUrl,{type:"module"})}}const parseGridAsync=usingMemoizedWorkerTask(ParseGridWorker);function useDebouncedState(ne,oe=lodashExports.noop,ce=300){const[ue,pe]=reactExports.useState(ne),me=reactExports.useRef(lodashExports.now());return[ue,ge=>{const ye=lodashExports.now();requestIdleCallback(()=>{ye>me.current&&(oe==null||oe(ge),me.current=ye)},{timeout:ce}),pe(ge)}]}function useDebouncedState2(ne,oe=lodashExports.noop,ce=300){const[ue,pe]=reactExports.useState(ne),me=reactExports.useRef(lodashExports.now());return[ue,ge=>{const ye=lodashExports.now();requestIdleCallback(()=>{ye>me.current&&(oe==null||oe(ge),me.current=ye)},{timeout:ce}),pe(ge(ue))}]}function between(ne,oe,ce){return ne>=oe&&ne({content:ne,...await parseGridAsync({map:ne,options:oe})}),{normalizer:JSON.stringify});function SymbolColorPicker(ne){const oe=compilerRuntimeExports.c(5),{onChange:ce,value:ue,autoValue:pe}=ne,[me,ge]=useDebouncedState(ue,ce),ye=me??pe;let xe;return oe[0]!==pe||oe[1]!==ye||oe[2]!==ge||oe[3]!==me?(xe=jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:ve=>{var _e;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger(ve),children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,alignItems:"center",children:[jsxRuntimeExports.jsx(Box,{sx:{width:16,height:16,backgroundColor:ye,outline:_temp$t,borderRadius:4}}),me?lodashExports.startCase(((_e=getClosestColor(me))==null?void 0:_e.name)??"Custom"):"Auto"]})}),jsxRuntimeExports.jsxs(Popover,{transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},...bindPopover(ve),slotProps:{paper:{sx:{overflow:"visible"}}},children:[jsxRuntimeExports.jsx(Box,{sx:{px:2,py:1},children:jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{defaultChecked:!me,onChange:(we,Se)=>ge==null?void 0:ge(Se?void 0:pe)}),label:"Choose Automatically"})}),jsxRuntimeExports.jsx(Box,{sx:{p:2,pt:0,...!me&&{opacity:_temp2$l,pointerEvents:"none"}},children:jsxRuntimeExports.jsx(Z$3,{color:me??pe,onChange:ge})})]})]})}}),oe[0]=pe,oe[1]=ye,oe[2]=ge,oe[3]=me,oe[4]=xe):xe=oe[4],xe}function _temp2$l(ne){return ne.palette.action.disabledOpacity}function _temp$t(ne){return`1px solid ${ne.palette.divider}`}const editor$3=async ne=>{if(ne){const{symbols:oe}=await getGridSymbolsAsync({map:ne});return withProduce(({produce:ce,value:ue})=>{const{palette:pe}=useTheme(),me=lodashExports.flow(interpolate$1([pe.background.paper,pe.text.primary]),rgbToHex$3);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lodashExports.sortBy(oe,"value").map(({symbol:ge})=>{var ye,xe;return jsxRuntimeExports.jsx(Option,{label:`Tile color for "${ge}"`,content:jsxRuntimeExports.jsx(SymbolColorPicker,{value:(ye=ue==null?void 0:ue.symbols)==null?void 0:ye[ge],autoValue:me(((xe=lodashExports.find(oe,{symbol:ge}))==null?void 0:xe.value)??0),onChange:ve=>ce(_e=>{lodashExports.set(_e,`symbols["${ge}"]`,ve)})})},ge)})})})}else return()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},hydrate$3=ne=>{const{width:oe,height:ce}=ne.bounds;return{...ne,snap:({x:ue,y:pe},me=1)=>{const[ge,ye]=[lodashExports.round(-1+ue+me/2),lodashExports.round(-1+pe+me/2)];if(between(ge,0,oe)&&between(ye,0,ce))return{x:ge,y:ye}},nodeAt:ue=>{const{x:pe,y:me}=ue;return me*oe+pe},pointOf:ue=>({x:ue%oe,y:~~(ue/oe)}),matchNode:byPoint}},grid=Object.freeze(Object.defineProperty({__proto__:null,SymbolColorPicker,editor:editor$3,hydrate:hydrate$3,parse:parse$9},Symbol.toStringTag,{value:"Module"})),parseMeshWorkerUrl=""+new URL("parseMesh.worker-BqXfsHv6.js",import.meta.url).href;class ParseMeshWorker extends Worker{constructor(){super(parseMeshWorkerUrl,{type:"module"})}}const parseMeshAsync=usingMemoizedWorkerTask(ParseMeshWorker),parse$8=memoizee$1(async(ne="",oe)=>await parseMeshAsync({map:ne,options:oe}),{normalizer:JSON.stringify}),hydrate$2=ne=>({...ne,snap:lodashExports.identity,nodeAt:lodashExports.constant(0),pointOf:lodashExports.constant({x:0,y:0}),matchNode:byPoint}),editor$2=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),mesh=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$2,hydrate:hydrate$2,parse:parse$8},Symbol.toStringTag,{value:"Module"})),parseNetworkWorkerUrl=""+new URL("parseNetwork.worker-CBxoD6o6.js",import.meta.url).href;class ParseNetworkWorker extends Worker{constructor(){super(parseNetworkWorkerUrl,{type:"module"})}}const parseNetworkAsync=usingMemoizedWorkerTask(ParseNetworkWorker),parse$7=memoizee$1(async(ne="",oe)=>await parseNetworkAsync({map:ne,options:oe}),{normalizer:JSON.stringify}),hydrate$1=ne=>({...ne,snap:lodashExports.identity,nodeAt:lodashExports.constant(0),pointOf:lodashExports.constant({x:0,y:0}),matchNode:byPoint}),editor$1=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),xy=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$1,hydrate:hydrate$1,parse:parse$7},Symbol.toStringTag,{value:"Module"})),parsePolyWorkerUrl=""+new URL("parsePoly.worker-CFQGo0UP.js",import.meta.url).href;class ParsePolyWorker extends Worker{constructor(){super(parsePolyWorkerUrl,{type:"module"})}}const parsePolyAsync=usingMemoizedWorkerTask(ParsePolyWorker),parse$6=memoizee$1(async(ne="",oe)=>await parsePolyAsync({map:ne,options:oe}),{normalizer:JSON.stringify}),hydrate=ne=>({...ne,snap:lodashExports.identity,nodeAt:lodashExports.constant(0),pointOf:lodashExports.constant({x:0,y:0}),matchNode:byPoint}),editor=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),poly=Object.freeze(Object.defineProperty({__proto__:null,editor,hydrate,parse:parse$6},Symbol.toStringTag,{value:"Module"})),mapParsers={grid,map:grid,xy,mesh,poly};function getParser(ne=""){return mapParsers[ne]}const defaultGuard=lodashExports.constant(!0),[useLayers,LayersProvider]=createSlice({layers:[]});function useLayer(ne,oe){const ce=compilerRuntimeExports.c(21),ue=oe===void 0?defaultGuard:oe,[pe,me]=reactExports.useState(ne),[ge,ye]=useLayers(),{layers:xe}=ge;let ve,_e;ce[0]!==ue||ce[1]!==pe||ce[2]!==xe?(ve=lodashExports.filter(xe,ue),_e=pe?lodashExports.find(ve,{key:pe})??lodashExports.head(ve):lodashExports.head(ve),ce[0]=ue,ce[1]=pe,ce[2]=xe,ce[3]=ve,ce[4]=_e):(ve=ce[3],_e=ce[4]);const we=_e;let Se,$e;ce[5]!==ne?(Se=()=>{me(ne)},$e=[ne],ce[5]=ne,ce[6]=Se,ce[7]=$e):(Se=ce[6],$e=ce[7]),reactExports.useEffect(Se,$e);let Te,Re;ce[8]!==pe||ce[9]!==we?(Te=()=>{we&&we.key!==pe&&me(we.key)},Re=[we,pe,me],ce[8]=pe,ce[9]=we,ce[10]=Te,ce[11]=Re):(Te=ce[10],Re=ce[11]),reactExports.useEffect(Te,Re);let Ae;const ke=we==null?void 0:we.key;let Be;ce[12]!==we||ce[13]!==ye?(Be=Ne=>{const je={...we,...Ne};ye(ze=>{const{layers:Ue}=ze;return{layers:lodashExports.map(Ue,qe=>qe.key===je.key?je:qe)}})},ce[12]=we,ce[13]=ye,ce[14]=Be):Be=ce[14];let Ie;return ce[15]!==ve||ce[16]!==we||ce[17]!==xe||ce[18]!==ke||ce[19]!==Be?(Ie={key:ke,setKey:me,layer:we,setLayer:Be,layers:ve,allLayers:xe},ce[15]=ve,ce[16]=we,ce[17]=xe,ce[18]=ke,ce[19]=Be,ce[20]=Ie):Ie=ce[20],Ae=Ie,Ae}const shouldBreak={name:"shouldBreak",description:"Define in what situations the debugger should break, in addition to the conditions defined in the standard options.",params:[{name:"step",type:"number"},{name:"event",type:"any"},{name:"events",type:"any"},{name:"parent",type:"any"},{name:"children",type:"any"}],defaultReturnValue:!1,returnType:"boolean"},templates={shouldBreak},fn=memoizee$1((ne,oe)=>new Function("params",`${ne}; return ${oe}.apply(null, params);`));function call$2(ne,oe,ce){try{return fn(ne,oe)(ce)}catch{return templates[oe].defaultReturnValue}}function _extends(){return _extends=Object.assign||function(ne){for(var oe=1;oeawait treeAsync$1(ne),ue=[ne],oe[0]=ne,oe[1]=ce,oe[2]=ue):(ce=oe[1],ue=oe[2]),useAsync(ce,ue)}function useTreeMemo$1(ne,oe){const ce=reactExports.useMemo(()=>ne,oe);return useTree$1(ce)}function useBreakpoints(ne){var _e;const{layer:oe}=useLayer(ne),{isTrusted:ce}=useUntrustedLayers(),{monotonicF:ue,monotonicG:pe,breakpoints:me,code:ge,trace:ye}=(oe==null?void 0:oe.source)??{},xe=ye==null?void 0:ye.content,{result:ve}=useTreeMemo$1({trace:xe,step:(_e=xe==null?void 0:xe.events)==null?void 0:_e.length,radius:void 0},[xe]);return reactExports.useMemo(()=>{const we=(xe==null?void 0:xe.events)??[],Se=treeToDict((ve==null?void 0:ve.tree)??[]);return memoizee$1($e=>{var Re,Ae;const Te=we[$e];if(Te)try{for(const{active:ke,condition:Be,type:Ie,property:Ne="",reference:je=0}of me??[]){const ze=!Ie||Ie===Te.type;if(ke&&ze&&(()=>{var qe;return(qe=Be==null?void 0:Be.apply)==null?void 0:qe.call(Be,{type:Ie,event:Te,property:Ne,value:lodashExports.get(Te,Ne),reference:je,step:$e,events:we,node:Se[$e]})})())return Be!=null&&Be.needsReference?{result:`${Ne} ${lodashExports.toLower(lodashExports.startCase(Be==null?void 0:Be.key))} ${je}`}:{result:`${Ne} ${lodashExports.toLower(lodashExports.startCase(Be==null?void 0:Be.key))}`}}if(ce&&call$2(ge??"","shouldBreak",[$e,Te,we,(Re=Se[$e])==null?void 0:Re.parent,((Ae=Se[$e])==null?void 0:Ae.children)??[]]))return{result:"Script editor"}}catch(ke){return{error:`${ke}`}}return{result:""}})},[ce,ge,xe,me,ue,pe,ve])}function treeToDict(ne=[],oe={}){for(const ce of ne){for(const ue of ce.events)oe[ue.step]=ce;treeToDict(ce.children,oe)}return oe}function cancellable(ne,oe){let ce=!1;return requestAnimationFrame(async()=>{const ue=await ne();ce||oe(ue)}),()=>{ce=!0}}function usePlaybackState(ne){const{layer:oe,setLayer:ce,setKey:ue}=useLayer(ne),pe=useSnackbar(),me=useBreakpoints(ne);reactExports.useEffect(()=>{ne&&ue(ne)},[ne]);const{playback:ge,playbackTo:ye,step:xe=0}=(oe==null?void 0:oe.source)??{},ve=lodashExports.min([ye,xe])??0,_e=!!ye,we=ge==="playing",[Se,$e]=[0,(ye??1)-1];return reactExports.useMemo(()=>{function Te(ze){ce(produce(oe,Ue=>lodashExports.set(Ue,"source",{...Ue==null?void 0:Ue.source,...ze})))}const Re={start:Se,end:$e,step:ve,canPlay:_e&&!we&&ve<$e,canPause:_e&&we,canStop:_e&&ve,canStepForward:_e&&!we&&ve<$e,canStepBackward:_e&&!we&&ve>0},Ae=(ze=0)=>{Te({playback:"paused",step:Ne(ze)})},ke=(ze=1)=>Te({playback:"playing",step:Ne(ze)}),Be=(ze,Ue=0)=>cancellable(async()=>{for(const qe of lodashExports.range(Ue,ze)){const Ke=me(ve+qe);if(Ke.result||Ke.error)return{...Ke,offset:qe}}return{result:"",offset:0,error:void 0}},({result:qe,offset:Ke,error:Ge})=>{Ge?(pe(`${lodashExports.trimEnd(Ge,".")}`,`Step ${ve+Ke}`),Ae()):qe?(pe(`Breakpoint hit: ${qe}`,`Step ${ve+Ke}`),Ae(Ke)):ke(ze)}),Ie=(ze=1)=>{var qe;let Ue;for(Ue=ve+ze;Ue<=$e&&Ue>=0&&!((qe=me(Ue))!=null&&qe.result);Ue+=ze);return Ue},Ne=ze=>lodashExports.clamp(ve+ze,Se,$e);return{playing:ge==="playing",...Re,...{play:()=>{Te({playback:"playing",step:Ne(1)})},pause:Ae,stepTo:(ze=0)=>Te({step:lodashExports.clamp(ze,Se,$e)}),stop:()=>Te({step:Se,playback:"paused"}),stepForward:()=>Te({step:Ne(1)}),stepBackward:()=>Te({step:Ne(-1)}),tick:ke,findBreakpoint:Ie,stepWithBreakpointCheck:Be}}},[$e,ge,we,_e,Se,ve,ce])}function RenderLayer(ne){var ge;const oe=compilerRuntimeExports.c(5),{layer:ce,index:ue}=ne;let pe;oe[0]!==ue||oe[1]!==ce?(pe=ce&&reactExports.createElement((ge=getController(ce))==null?void 0:ge.renderer,{layer:ce,index:ue}),oe[0]=ue,oe[1]=ce,oe[2]=pe):pe=oe[2];let me;return oe[3]!==pe?(me=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pe}),oe[3]=pe,oe[4]=me):me=oe[4],me}const[useRenderers,RendererProvider]=createSlice([],{reduce:replace$1}),removeUndefinedValues=ne=>lodashExports.omit(ne,lodashExports.filter(lodashExports.keys(ne),oe=>lodashExports.isUndefined(ne[oe]))),[useScreenshots,ScreenshotsProvider]=createSlice({},{reduce:lodashExports.flow(merge$6,removeUndefinedValues)});var events={exports:{}},R$3=typeof Reflect=="object"?Reflect:null,ReflectApply=R$3&&typeof R$3.apply=="function"?R$3.apply:function(oe,ce,ue){return Function.prototype.apply.call(oe,ce,ue)},ReflectOwnKeys;R$3&&typeof R$3.ownKeys=="function"?ReflectOwnKeys=R$3.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(oe){return Object.getOwnPropertyNames(oe).concat(Object.getOwnPropertySymbols(oe))}:ReflectOwnKeys=function(oe){return Object.getOwnPropertyNames(oe)};function ProcessEmitWarning(ne){console&&console.warn&&console.warn(ne)}var NumberIsNaN=Number.isNaN||function(oe){return oe!==oe};function EventEmitter$3(){EventEmitter$3.init.call(this)}events.exports=EventEmitter$3;events.exports.once=once;EventEmitter$3.EventEmitter=EventEmitter$3;EventEmitter$3.prototype._events=void 0;EventEmitter$3.prototype._eventsCount=0;EventEmitter$3.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(ne){if(typeof ne!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ne)}Object.defineProperty(EventEmitter$3,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(ne){if(typeof ne!="number"||ne<0||NumberIsNaN(ne))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ne+".");defaultMaxListeners=ne}});EventEmitter$3.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};EventEmitter$3.prototype.setMaxListeners=function(oe){if(typeof oe!="number"||oe<0||NumberIsNaN(oe))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+oe+".");return this._maxListeners=oe,this};function _getMaxListeners(ne){return ne._maxListeners===void 0?EventEmitter$3.defaultMaxListeners:ne._maxListeners}EventEmitter$3.prototype.getMaxListeners=function(){return _getMaxListeners(this)};EventEmitter$3.prototype.emit=function(oe){for(var ce=[],ue=1;ue0&&(ge=ce[0]),ge instanceof Error)throw ge;var ye=new Error("Unhandled error."+(ge?" ("+ge.message+")":""));throw ye.context=ge,ye}var xe=me[oe];if(xe===void 0)return!1;if(typeof xe=="function")ReflectApply(xe,this,ce);else for(var ve=xe.length,_e=arrayClone(xe,ve),ue=0;ue0&&ge.length>pe&&!ge.warned){ge.warned=!0;var ye=new Error("Possible EventEmitter memory leak detected. "+ge.length+" "+String(oe)+" listeners added. Use emitter.setMaxListeners() to increase limit");ye.name="MaxListenersExceededWarning",ye.emitter=ne,ye.type=oe,ye.count=ge.length,ProcessEmitWarning(ye)}return ne}EventEmitter$3.prototype.addListener=function(oe,ce){return _addListener(this,oe,ce,!1)};EventEmitter$3.prototype.on=EventEmitter$3.prototype.addListener;EventEmitter$3.prototype.prependListener=function(oe,ce){return _addListener(this,oe,ce,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(ne,oe,ce){var ue={fired:!1,wrapFn:void 0,target:ne,type:oe,listener:ce},pe=onceWrapper.bind(ue);return pe.listener=ce,ue.wrapFn=pe,pe}EventEmitter$3.prototype.once=function(oe,ce){return checkListener(ce),this.on(oe,_onceWrap(this,oe,ce)),this};EventEmitter$3.prototype.prependOnceListener=function(oe,ce){return checkListener(ce),this.prependListener(oe,_onceWrap(this,oe,ce)),this};EventEmitter$3.prototype.removeListener=function(oe,ce){var ue,pe,me,ge,ye;if(checkListener(ce),pe=this._events,pe===void 0)return this;if(ue=pe[oe],ue===void 0)return this;if(ue===ce||ue.listener===ce)--this._eventsCount===0?this._events=Object.create(null):(delete pe[oe],pe.removeListener&&this.emit("removeListener",oe,ue.listener||ce));else if(typeof ue!="function"){for(me=-1,ge=ue.length-1;ge>=0;ge--)if(ue[ge]===ce||ue[ge].listener===ce){ye=ue[ge].listener,me=ge;break}if(me<0)return this;me===0?ue.shift():spliceOne(ue,me),ue.length===1&&(pe[oe]=ue[0]),pe.removeListener!==void 0&&this.emit("removeListener",oe,ye||ce)}return this};EventEmitter$3.prototype.off=EventEmitter$3.prototype.removeListener;EventEmitter$3.prototype.removeAllListeners=function(oe){var ce,ue,pe;if(ue=this._events,ue===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[oe]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[oe]),this;if(arguments.length===0){var me=Object.keys(ue),ge;for(pe=0;pe=0;pe--)this.removeListener(oe,ce[pe]);return this};function _listeners(ne,oe,ce){var ue=ne._events;if(ue===void 0)return[];var pe=ue[oe];return pe===void 0?[]:typeof pe=="function"?ce?[pe.listener||pe]:[pe]:ce?unwrapListeners(pe):arrayClone(pe,pe.length)}EventEmitter$3.prototype.listeners=function(oe){return _listeners(this,oe,!0)};EventEmitter$3.prototype.rawListeners=function(oe){return _listeners(this,oe,!1)};EventEmitter$3.listenerCount=function(ne,oe){return typeof ne.listenerCount=="function"?ne.listenerCount(oe):listenerCount.call(ne,oe)};EventEmitter$3.prototype.listenerCount=listenerCount;function listenerCount(ne){var oe=this._events;if(oe!==void 0){var ce=oe[ne];if(typeof ce=="function")return 1;if(ce!==void 0)return ce.length}return 0}EventEmitter$3.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(ne,oe){for(var ce=new Array(oe),ue=0;ue=oe?{done:!0}:{done:!1,value:ne[ce++]}})};Iterator$2.empty=function(){var ne=new Iterator$2(function(){return{done:!0}});return ne};Iterator$2.fromSequence=function(ne){var oe=0,ce=ne.length;return new Iterator$2(function(){return oe>=ce?{done:!0}:{done:!1,value:ne[oe++]}})};Iterator$2.is=function(ne){return ne instanceof Iterator$2?!0:typeof ne=="object"&&ne!==null&&typeof ne.next=="function"};var iterator=Iterator$2;const Iterator$3=getDefaultExportFromCjs$1(iterator);var support$1={};support$1.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u";support$1.SYMBOL_SUPPORT=typeof Symbol<"u";var Iterator$1=iterator,support=support$1,ARRAY_BUFFER_SUPPORT=support.ARRAY_BUFFER_SUPPORT,SYMBOL_SUPPORT=support.SYMBOL_SUPPORT;function iterOrNull(ne){return typeof ne=="string"||Array.isArray(ne)||ARRAY_BUFFER_SUPPORT&&ArrayBuffer.isView(ne)?Iterator$1.fromSequence(ne):typeof ne!="object"||ne===null?null:SYMBOL_SUPPORT&&typeof ne[Symbol.iterator]=="function"?ne[Symbol.iterator]():typeof ne.next=="function"?ne:null}var iter$2=function(oe){var ce=iterOrNull(oe);if(!ce)throw new Error("obliterator: target is not iterable nor a valid iterator.");return ce},iter$1=iter$2,take=function(oe,ce){for(var ue=arguments.length>1?ce:1/0,pe=ue!==1/0?new Array(ue):[],me,ge=0,ye=iter$1(oe);;){if(ge===ue)return pe;if(me=ye.next(),me.done)return ge!==ce&&(pe.length=ge),pe;pe[ge++]=me.value}};const take$1=getDefaultExportFromCjs$1(take);var Iterator=iterator,iter=iter$2,chain=function(){var oe=arguments,ce=null,ue=-1;return new Iterator(function(){var me=null;do{if(ce===null){if(ue++,ue>=oe.length)return{done:!0};ce=iter(oe[ue])}if(me=ce.next(),me.done===!0){ce=null;continue}break}while(!0);return me})};const chain$1=getDefaultExportFromCjs$1(chain);function assignPolyfill(){const ne=arguments[0];for(let oe=1,ce=arguments.length;oene++}class GraphError extends Error{constructor(oe){super(),this.name="GraphError",this.message=oe}}class InvalidArgumentsGraphError extends GraphError{constructor(oe){super(oe),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,InvalidArgumentsGraphError.prototype.constructor)}}class NotFoundGraphError extends GraphError{constructor(oe){super(oe),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,NotFoundGraphError.prototype.constructor)}}class UsageGraphError extends GraphError{constructor(oe){super(oe),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,UsageGraphError.prototype.constructor)}}function MixedNodeData(ne,oe){this.key=ne,this.attributes=oe,this.clear()}MixedNodeData.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function DirectedNodeData(ne,oe){this.key=ne,this.attributes=oe,this.clear()}DirectedNodeData.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function UndirectedNodeData(ne,oe){this.key=ne,this.attributes=oe,this.clear()}UndirectedNodeData.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function EdgeData(ne,oe,ce,ue,pe){this.key=oe,this.attributes=pe,this.undirected=ne,this.source=ce,this.target=ue}EdgeData.prototype.attach=function(){let ne="out",oe="in";this.undirected&&(ne=oe="undirected");const ce=this.source.key,ue=this.target.key;this.source[ne][ue]=this,!(this.undirected&&ce===ue)&&(this.target[oe][ce]=this)};EdgeData.prototype.attachMulti=function(){let ne="out",oe="in";const ce=this.source.key,ue=this.target.key;this.undirected&&(ne=oe="undirected");const pe=this.source[ne],me=pe[ue];if(typeof me>"u"){pe[ue]=this,this.undirected&&ce===ue||(this.target[oe][ce]=this);return}me.previous=this,this.next=me,pe[ue]=this,this.target[oe][ce]=this};EdgeData.prototype.detach=function(){const ne=this.source.key,oe=this.target.key;let ce="out",ue="in";this.undirected&&(ce=ue="undirected"),delete this.source[ce][oe],delete this.target[ue][ne]};EdgeData.prototype.detachMulti=function(){const ne=this.source.key,oe=this.target.key;let ce="out",ue="in";this.undirected&&(ce=ue="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[ce][oe],delete this.target[ue][ne]):(this.next.previous=void 0,this.source[ce][oe]=this.next,this.target[ue][ne]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const NODE=0,SOURCE=1,TARGET=2,OPPOSITE=3;function findRelevantNodeData(ne,oe,ce,ue,pe,me,ge){let ye,xe,ve,_e;if(ue=""+ue,ce===NODE){if(ye=ne._nodes.get(ue),!ye)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" node in the graph.`);ve=pe,_e=me}else if(ce===OPPOSITE){if(pe=""+pe,xe=ne._edges.get(pe),!xe)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${pe}" edge in the graph.`);const we=xe.source.key,Se=xe.target.key;if(ue===we)ye=xe.target;else if(ue===Se)ye=xe.source;else throw new NotFoundGraphError(`Graph.${oe}: the "${ue}" node is not attached to the "${pe}" edge (${we}, ${Se}).`);ve=me,_e=ge}else{if(xe=ne._edges.get(ue),!xe)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`);ce===SOURCE?ye=xe.source:ye=xe.target,ve=pe,_e=me}return[ye,ve,_e]}function attachNodeAttributeGetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);return ge.attributes[ye]}}function attachNodeAttributesGetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe){const[me]=findRelevantNodeData(this,oe,ce,ue,pe);return me.attributes}}function attachNodeAttributeChecker(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);return ge.attributes.hasOwnProperty(ye)}}function attachNodeAttributeSetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me,ge){const[ye,xe,ve]=findRelevantNodeData(this,oe,ce,ue,pe,me,ge);return ye.attributes[xe]=ve,this.emit("nodeAttributesUpdated",{key:ye.key,type:"set",attributes:ye.attributes,name:xe}),this}}function attachNodeAttributeUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me,ge){const[ye,xe,ve]=findRelevantNodeData(this,oe,ce,ue,pe,me,ge);if(typeof ve!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: updater should be a function.`);const _e=ye.attributes,we=ve(_e[xe]);return _e[xe]=we,this.emit("nodeAttributesUpdated",{key:ye.key,type:"set",attributes:ye.attributes,name:xe}),this}}function attachNodeAttributeRemover(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);return delete ge.attributes[ye],this.emit("nodeAttributesUpdated",{key:ge.key,type:"remove",attributes:ge.attributes,name:ye}),this}}function attachNodeAttributesReplacer(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);if(!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return ge.attributes=ye,this.emit("nodeAttributesUpdated",{key:ge.key,type:"replace",attributes:ge.attributes}),this}}function attachNodeAttributesMerger(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);if(!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return assign$3(ge.attributes,ye),this.emit("nodeAttributesUpdated",{key:ge.key,type:"merge",attributes:ge.attributes,data:ye}),this}}function attachNodeAttributesUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);if(typeof ye!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: provided updater is not a function.`);return ge.attributes=ye(ge.attributes),this.emit("nodeAttributesUpdated",{key:ge.key,type:"update",attributes:ge.attributes}),this}}const NODE_ATTRIBUTES_METHODS=[{name:ne=>`get${ne}Attribute`,attacher:attachNodeAttributeGetter},{name:ne=>`get${ne}Attributes`,attacher:attachNodeAttributesGetter},{name:ne=>`has${ne}Attribute`,attacher:attachNodeAttributeChecker},{name:ne=>`set${ne}Attribute`,attacher:attachNodeAttributeSetter},{name:ne=>`update${ne}Attribute`,attacher:attachNodeAttributeUpdater},{name:ne=>`remove${ne}Attribute`,attacher:attachNodeAttributeRemover},{name:ne=>`replace${ne}Attributes`,attacher:attachNodeAttributesReplacer},{name:ne=>`merge${ne}Attributes`,attacher:attachNodeAttributesMerger},{name:ne=>`update${ne}Attributes`,attacher:attachNodeAttributesUpdater}];function attachNodeAttributesMethods(ne){NODE_ATTRIBUTES_METHODS.forEach(function({name:oe,attacher:ce}){ce(ne,oe("Node"),NODE),ce(ne,oe("Source"),SOURCE),ce(ne,oe("Target"),TARGET),ce(ne,oe("Opposite"),OPPOSITE)})}function attachEdgeAttributeGetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return me.attributes[pe]}}function attachEdgeAttributesGetter(ne,oe,ce){ne.prototype[oe]=function(ue){let pe;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const me=""+ue,ge=""+arguments[1];if(pe=getMatchingEdge(this,me,ge,ce),!pe)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${me}" - "${ge}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,pe=this._edges.get(ue),!pe)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return pe.attributes}}function attachEdgeAttributeChecker(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return me.attributes.hasOwnProperty(pe)}}function attachEdgeAttributeSetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){let ge;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ye=""+ue,xe=""+pe;if(pe=arguments[2],me=arguments[3],ge=getMatchingEdge(this,ye,xe,ce),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ye}" - "${xe}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,ge=this._edges.get(ue),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return ge.attributes[pe]=me,this.emit("edgeAttributesUpdated",{key:ge.key,type:"set",attributes:ge.attributes,name:pe}),this}}function attachEdgeAttributeUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){let ge;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ye=""+ue,xe=""+pe;if(pe=arguments[2],me=arguments[3],ge=getMatchingEdge(this,ye,xe,ce),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ye}" - "${xe}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,ge=this._edges.get(ue),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(typeof me!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: updater should be a function.`);return ge.attributes[pe]=me(ge.attributes[pe]),this.emit("edgeAttributesUpdated",{key:ge.key,type:"set",attributes:ge.attributes,name:pe}),this}}function attachEdgeAttributeRemover(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return delete me.attributes[pe],this.emit("edgeAttributesUpdated",{key:me.key,type:"remove",attributes:me.attributes,name:pe}),this}}function attachEdgeAttributesReplacer(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(!isPlainObject$1(pe))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return me.attributes=pe,this.emit("edgeAttributesUpdated",{key:me.key,type:"replace",attributes:me.attributes}),this}}function attachEdgeAttributesMerger(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(!isPlainObject$1(pe))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return assign$3(me.attributes,pe),this.emit("edgeAttributesUpdated",{key:me.key,type:"merge",attributes:me.attributes,data:pe}),this}}function attachEdgeAttributesUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(typeof pe!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: provided updater is not a function.`);return me.attributes=pe(me.attributes),this.emit("edgeAttributesUpdated",{key:me.key,type:"update",attributes:me.attributes}),this}}const EDGE_ATTRIBUTES_METHODS=[{name:ne=>`get${ne}Attribute`,attacher:attachEdgeAttributeGetter},{name:ne=>`get${ne}Attributes`,attacher:attachEdgeAttributesGetter},{name:ne=>`has${ne}Attribute`,attacher:attachEdgeAttributeChecker},{name:ne=>`set${ne}Attribute`,attacher:attachEdgeAttributeSetter},{name:ne=>`update${ne}Attribute`,attacher:attachEdgeAttributeUpdater},{name:ne=>`remove${ne}Attribute`,attacher:attachEdgeAttributeRemover},{name:ne=>`replace${ne}Attributes`,attacher:attachEdgeAttributesReplacer},{name:ne=>`merge${ne}Attributes`,attacher:attachEdgeAttributesMerger},{name:ne=>`update${ne}Attributes`,attacher:attachEdgeAttributesUpdater}];function attachEdgeAttributesMethods(ne){EDGE_ATTRIBUTES_METHODS.forEach(function({name:oe,attacher:ce}){ce(ne,oe("Edge"),"mixed"),ce(ne,oe("DirectedEdge"),"directed"),ce(ne,oe("UndirectedEdge"),"undirected")})}const EDGES_ITERATION=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function forEachSimple(ne,oe,ce,ue){let pe=!1;for(const me in oe){if(me===ue)continue;const ge=oe[me];if(pe=ce(ge.key,ge.attributes,ge.source.key,ge.target.key,ge.source.attributes,ge.target.attributes,ge.undirected),ne&&pe)return ge.key}}function forEachMulti(ne,oe,ce,ue){let pe,me,ge,ye=!1;for(const xe in oe)if(xe!==ue){pe=oe[xe];do{if(me=pe.source,ge=pe.target,ye=ce(pe.key,pe.attributes,me.key,ge.key,me.attributes,ge.attributes,pe.undirected),ne&&ye)return pe.key;pe=pe.next}while(pe!==void 0)}}function createIterator(ne,oe){const ce=Object.keys(ne),ue=ce.length;let pe,me=0;return new Iterator$3(function(){do if(pe)pe=pe.next;else{if(me>=ue)return{done:!0};const ye=ce[me++];if(ye===oe){pe=void 0;continue}pe=ne[ye]}while(!pe);return{done:!1,value:{edge:pe.key,attributes:pe.attributes,source:pe.source.key,target:pe.target.key,sourceAttributes:pe.source.attributes,targetAttributes:pe.target.attributes,undirected:pe.undirected}}})}function forEachForKeySimple(ne,oe,ce,ue){const pe=oe[ce];if(!pe)return;const me=pe.source,ge=pe.target;if(ue(pe.key,pe.attributes,me.key,ge.key,me.attributes,ge.attributes,pe.undirected)&&ne)return pe.key}function forEachForKeyMulti(ne,oe,ce,ue){let pe=oe[ce];if(!pe)return;let me=!1;do{if(me=ue(pe.key,pe.attributes,pe.source.key,pe.target.key,pe.source.attributes,pe.target.attributes,pe.undirected),ne&&me)return pe.key;pe=pe.next}while(pe!==void 0)}function createIteratorForKey(ne,oe){let ce=ne[oe];return ce.next!==void 0?new Iterator$3(function(){if(!ce)return{done:!0};const ue={edge:ce.key,attributes:ce.attributes,source:ce.source.key,target:ce.target.key,sourceAttributes:ce.source.attributes,targetAttributes:ce.target.attributes,undirected:ce.undirected};return ce=ce.next,{done:!1,value:ue}}):Iterator$3.of({edge:ce.key,attributes:ce.attributes,source:ce.source.key,target:ce.target.key,sourceAttributes:ce.source.attributes,targetAttributes:ce.target.attributes,undirected:ce.undirected})}function createEdgeArray(ne,oe){if(ne.size===0)return[];if(oe==="mixed"||oe===ne.type)return typeof Array.from=="function"?Array.from(ne._edges.keys()):take$1(ne._edges.keys(),ne._edges.size);const ce=oe==="undirected"?ne.undirectedSize:ne.directedSize,ue=new Array(ce),pe=oe==="undirected",me=ne._edges.values();let ge=0,ye,xe;for(;ye=me.next(),ye.done!==!0;)xe=ye.value,xe.undirected===pe&&(ue[ge++]=xe.key);return ue}function forEachEdge(ne,oe,ce,ue){if(oe.size===0)return;const pe=ce!=="mixed"&&ce!==oe.type,me=ce==="undirected";let ge,ye,xe=!1;const ve=oe._edges.values();for(;ge=ve.next(),ge.done!==!0;){if(ye=ge.value,pe&&ye.undirected!==me)continue;const{key:_e,attributes:we,source:Se,target:$e}=ye;if(xe=ue(_e,we,Se.key,$e.key,Se.attributes,$e.attributes,ye.undirected),ne&&xe)return _e}}function createEdgeIterator(ne,oe){if(ne.size===0)return Iterator$3.empty();const ce=oe!=="mixed"&&oe!==ne.type,ue=oe==="undirected",pe=ne._edges.values();return new Iterator$3(function(){let ge,ye;for(;;){if(ge=pe.next(),ge.done)return ge;if(ye=ge.value,!(ce&&ye.undirected!==ue))break}return{value:{edge:ye.key,attributes:ye.attributes,source:ye.source.key,target:ye.target.key,sourceAttributes:ye.source.attributes,targetAttributes:ye.target.attributes,undirected:ye.undirected},done:!1}})}function forEachEdgeForNode(ne,oe,ce,ue,pe,me){const ge=oe?forEachMulti:forEachSimple;let ye;if(ce!=="undirected"&&(ue!=="out"&&(ye=ge(ne,pe.in,me),ne&&ye)||ue!=="in"&&(ye=ge(ne,pe.out,me,ue?void 0:pe.key),ne&&ye))||ce!=="directed"&&(ye=ge(ne,pe.undirected,me),ne&&ye))return ye}function createEdgeArrayForNode(ne,oe,ce,ue){const pe=[];return forEachEdgeForNode(!1,ne,oe,ce,ue,function(me){pe.push(me)}),pe}function createEdgeIteratorForNode(ne,oe,ce){let ue=Iterator$3.empty();return ne!=="undirected"&&(oe!=="out"&&typeof ce.in<"u"&&(ue=chain$1(ue,createIterator(ce.in))),oe!=="in"&&typeof ce.out<"u"&&(ue=chain$1(ue,createIterator(ce.out,oe?void 0:ce.key)))),ne!=="directed"&&typeof ce.undirected<"u"&&(ue=chain$1(ue,createIterator(ce.undirected))),ue}function forEachEdgeForPath(ne,oe,ce,ue,pe,me,ge){const ye=ce?forEachForKeyMulti:forEachForKeySimple;let xe;if(oe!=="undirected"&&(typeof pe.in<"u"&&ue!=="out"&&(xe=ye(ne,pe.in,me,ge),ne&&xe)||typeof pe.out<"u"&&ue!=="in"&&(ue||pe.key!==me)&&(xe=ye(ne,pe.out,me,ge),ne&&xe))||oe!=="directed"&&typeof pe.undirected<"u"&&(xe=ye(ne,pe.undirected,me,ge),ne&&xe))return xe}function createEdgeArrayForPath(ne,oe,ce,ue,pe){const me=[];return forEachEdgeForPath(!1,ne,oe,ce,ue,pe,function(ge){me.push(ge)}),me}function createEdgeIteratorForPath(ne,oe,ce,ue){let pe=Iterator$3.empty();return ne!=="undirected"&&(typeof ce.in<"u"&&oe!=="out"&&ue in ce.in&&(pe=chain$1(pe,createIteratorForKey(ce.in,ue))),typeof ce.out<"u"&&oe!=="in"&&ue in ce.out&&(oe||ce.key!==ue)&&(pe=chain$1(pe,createIteratorForKey(ce.out,ue)))),ne!=="directed"&&typeof ce.undirected<"u"&&ue in ce.undirected&&(pe=chain$1(pe,createIteratorForKey(ce.undirected,ue))),pe}function attachEdgeArrayCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe;ne.prototype[ce]=function(me,ge){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return[];if(!arguments.length)return createEdgeArray(this,ue);if(arguments.length===1){me=""+me;const ye=this._nodes.get(me);if(typeof ye>"u")throw new NotFoundGraphError(`Graph.${ce}: could not find the "${me}" node in the graph.`);return createEdgeArrayForNode(this.multi,ue==="mixed"?this.type:ue,pe,ye)}if(arguments.length===2){me=""+me,ge=""+ge;const ye=this._nodes.get(me);if(!ye)throw new NotFoundGraphError(`Graph.${ce}: could not find the "${me}" source node in the graph.`);if(!this._nodes.has(ge))throw new NotFoundGraphError(`Graph.${ce}: could not find the "${ge}" target node in the graph.`);return createEdgeArrayForPath(ue,this.multi,pe,ye,ge)}throw new InvalidArgumentsGraphError(`Graph.${ce}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function attachForEachEdge(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me="forEach"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[me]=function(ve,_e,we){if(!(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)){if(arguments.length===1)return we=ve,forEachEdge(!1,this,ue,we);if(arguments.length===2){ve=""+ve,we=_e;const Se=this._nodes.get(ve);if(typeof Se>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" node in the graph.`);return forEachEdgeForNode(!1,this.multi,ue==="mixed"?this.type:ue,pe,Se,we)}if(arguments.length===3){ve=""+ve,_e=""+_e;const Se=this._nodes.get(ve);if(!Se)throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" source node in the graph.`);if(!this._nodes.has(_e))throw new NotFoundGraphError(`Graph.${me}: could not find the "${_e}" target node in the graph.`);return forEachEdgeForPath(!1,ue,this.multi,pe,Se,_e,we)}throw new InvalidArgumentsGraphError(`Graph.${me}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const ge="map"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ge]=function(){const ve=Array.prototype.slice.call(arguments),_e=ve.pop();let we;if(ve.length===0){let Se=0;ue!=="directed"&&(Se+=this.undirectedSize),ue!=="undirected"&&(Se+=this.directedSize),we=new Array(Se);let $e=0;ve.push((Te,Re,Ae,ke,Be,Ie,Ne)=>{we[$e++]=_e(Te,Re,Ae,ke,Be,Ie,Ne)})}else we=[],ve.push((Se,$e,Te,Re,Ae,ke,Be)=>{we.push(_e(Se,$e,Te,Re,Ae,ke,Be))});return this[me].apply(this,ve),we};const ye="filter"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ye]=function(){const ve=Array.prototype.slice.call(arguments),_e=ve.pop(),we=[];return ve.push((Se,$e,Te,Re,Ae,ke,Be)=>{_e(Se,$e,Te,Re,Ae,ke,Be)&&we.push(Se)}),this[me].apply(this,ve),we};const xe="reduce"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[xe]=function(){let ve=Array.prototype.slice.call(arguments);if(ve.length<2||ve.length>4)throw new InvalidArgumentsGraphError(`Graph.${xe}: invalid number of arguments (expecting 2, 3 or 4 and got ${ve.length}).`);if(typeof ve[ve.length-1]=="function"&&typeof ve[ve.length-2]!="function")throw new InvalidArgumentsGraphError(`Graph.${xe}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let _e,we;ve.length===2?(_e=ve[0],we=ve[1],ve=[]):ve.length===3?(_e=ve[1],we=ve[2],ve=[ve[0]]):ve.length===4&&(_e=ve[2],we=ve[3],ve=[ve[0],ve[1]]);let Se=we;return ve.push(($e,Te,Re,Ae,ke,Be,Ie)=>{Se=_e(Se,$e,Te,Re,Ae,ke,Be,Ie)}),this[me].apply(this,ve),Se}}function attachFindEdge(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me="find"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[me]=function(xe,ve,_e){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return!1;if(arguments.length===1)return _e=xe,forEachEdge(!0,this,ue,_e);if(arguments.length===2){xe=""+xe,_e=ve;const we=this._nodes.get(xe);if(typeof we>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${xe}" node in the graph.`);return forEachEdgeForNode(!0,this.multi,ue==="mixed"?this.type:ue,pe,we,_e)}if(arguments.length===3){xe=""+xe,ve=""+ve;const we=this._nodes.get(xe);if(!we)throw new NotFoundGraphError(`Graph.${me}: could not find the "${xe}" source node in the graph.`);if(!this._nodes.has(ve))throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" target node in the graph.`);return forEachEdgeForPath(!0,ue,this.multi,pe,we,ve,_e)}throw new InvalidArgumentsGraphError(`Graph.${me}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const ge="some"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[ge]=function(){const xe=Array.prototype.slice.call(arguments),ve=xe.pop();return xe.push((we,Se,$e,Te,Re,Ae,ke)=>ve(we,Se,$e,Te,Re,Ae,ke)),!!this[me].apply(this,xe)};const ye="every"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[ye]=function(){const xe=Array.prototype.slice.call(arguments),ve=xe.pop();return xe.push((we,Se,$e,Te,Re,Ae,ke)=>!ve(we,Se,$e,Te,Re,Ae,ke)),!this[me].apply(this,xe)}}function attachEdgeIteratorCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me=ce.slice(0,-1)+"Entries";ne.prototype[me]=function(ge,ye){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return Iterator$3.empty();if(!arguments.length)return createEdgeIterator(this,ue);if(arguments.length===1){ge=""+ge;const xe=this._nodes.get(ge);if(!xe)throw new NotFoundGraphError(`Graph.${me}: could not find the "${ge}" node in the graph.`);return createEdgeIteratorForNode(ue,pe,xe)}if(arguments.length===2){ge=""+ge,ye=""+ye;const xe=this._nodes.get(ge);if(!xe)throw new NotFoundGraphError(`Graph.${me}: could not find the "${ge}" source node in the graph.`);if(!this._nodes.has(ye))throw new NotFoundGraphError(`Graph.${me}: could not find the "${ye}" target node in the graph.`);return createEdgeIteratorForPath(ue,pe,xe,ye)}throw new InvalidArgumentsGraphError(`Graph.${me}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function attachEdgeIterationMethods(ne){EDGES_ITERATION.forEach(oe=>{attachEdgeArrayCreator(ne,oe),attachForEachEdge(ne,oe),attachFindEdge(ne,oe),attachEdgeIteratorCreator(ne,oe)})}const NEIGHBORS_ITERATION=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function CompositeSetWrapper(){this.A=null,this.B=null}CompositeSetWrapper.prototype.wrap=function(ne){this.A===null?this.A=ne:this.B===null&&(this.B=ne)};CompositeSetWrapper.prototype.has=function(ne){return this.A!==null&&ne in this.A||this.B!==null&&ne in this.B};function forEachInObjectOnce(ne,oe,ce,ue,pe){for(const me in ue){const ge=ue[me],ye=ge.source,xe=ge.target,ve=ye===ce?xe:ye;if(oe&&oe.has(ve.key))continue;const _e=pe(ve.key,ve.attributes);if(ne&&_e)return ve.key}}function forEachNeighbor(ne,oe,ce,ue,pe){if(oe!=="mixed"){if(oe==="undirected")return forEachInObjectOnce(ne,null,ue,ue.undirected,pe);if(typeof ce=="string")return forEachInObjectOnce(ne,null,ue,ue[ce],pe)}const me=new CompositeSetWrapper;let ge;if(oe!=="undirected"){if(ce!=="out"){if(ge=forEachInObjectOnce(ne,null,ue,ue.in,pe),ne&&ge)return ge;me.wrap(ue.in)}if(ce!=="in"){if(ge=forEachInObjectOnce(ne,me,ue,ue.out,pe),ne&&ge)return ge;me.wrap(ue.out)}}if(oe!=="directed"&&(ge=forEachInObjectOnce(ne,me,ue,ue.undirected,pe),ne&&ge))return ge}function createNeighborArrayForNode(ne,oe,ce){if(ne!=="mixed"){if(ne==="undirected")return Object.keys(ce.undirected);if(typeof oe=="string")return Object.keys(ce[oe])}const ue=[];return forEachNeighbor(!1,ne,oe,ce,function(pe){ue.push(pe)}),ue}function createDedupedObjectIterator(ne,oe,ce){const ue=Object.keys(ce),pe=ue.length;let me=0;return new Iterator$3(function(){let ye=null;do{if(me>=pe)return ne&&ne.wrap(ce),{done:!0};const xe=ce[ue[me++]],ve=xe.source,_e=xe.target;if(ye=ve===oe?_e:ve,ne&&ne.has(ye.key)){ye=null;continue}}while(ye===null);return{done:!1,value:{neighbor:ye.key,attributes:ye.attributes}}})}function createNeighborIterator(ne,oe,ce){if(ne!=="mixed"){if(ne==="undirected")return createDedupedObjectIterator(null,ce,ce.undirected);if(typeof oe=="string")return createDedupedObjectIterator(null,ce,ce[oe])}let ue=Iterator$3.empty();const pe=new CompositeSetWrapper;return ne!=="undirected"&&(oe!=="out"&&(ue=chain$1(ue,createDedupedObjectIterator(pe,ce,ce.in))),oe!=="in"&&(ue=chain$1(ue,createDedupedObjectIterator(pe,ce,ce.out)))),ne!=="directed"&&(ue=chain$1(ue,createDedupedObjectIterator(pe,ce,ce.undirected))),ue}function attachNeighborArrayCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe;ne.prototype[ce]=function(me){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return[];me=""+me;const ge=this._nodes.get(me);if(typeof ge>"u")throw new NotFoundGraphError(`Graph.${ce}: could not find the "${me}" node in the graph.`);return createNeighborArrayForNode(ue==="mixed"?this.type:ue,pe,ge)}}function attachForEachNeighbor(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me="forEach"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[me]=function(ve,_e){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return;ve=""+ve;const we=this._nodes.get(ve);if(typeof we>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" node in the graph.`);forEachNeighbor(!1,ue==="mixed"?this.type:ue,pe,we,_e)};const ge="map"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ge]=function(ve,_e){const we=[];return this[me](ve,(Se,$e)=>{we.push(_e(Se,$e))}),we};const ye="filter"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ye]=function(ve,_e){const we=[];return this[me](ve,(Se,$e)=>{_e(Se,$e)&&we.push(Se)}),we};const xe="reduce"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[xe]=function(ve,_e,we){if(arguments.length<3)throw new InvalidArgumentsGraphError(`Graph.${xe}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let Se=we;return this[me](ve,($e,Te)=>{Se=_e(Se,$e,Te)}),Se}}function attachFindNeighbor(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me=ce[0].toUpperCase()+ce.slice(1,-1),ge="find"+me;ne.prototype[ge]=function(ve,_e){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return;ve=""+ve;const we=this._nodes.get(ve);if(typeof we>"u")throw new NotFoundGraphError(`Graph.${ge}: could not find the "${ve}" node in the graph.`);return forEachNeighbor(!0,ue==="mixed"?this.type:ue,pe,we,_e)};const ye="some"+me;ne.prototype[ye]=function(ve,_e){return!!this[ge](ve,_e)};const xe="every"+me;ne.prototype[xe]=function(ve,_e){return!this[ge](ve,(Se,$e)=>!_e(Se,$e))}}function attachNeighborIteratorCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me=ce.slice(0,-1)+"Entries";ne.prototype[me]=function(ge){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return Iterator$3.empty();ge=""+ge;const ye=this._nodes.get(ge);if(typeof ye>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${ge}" node in the graph.`);return createNeighborIterator(ue==="mixed"?this.type:ue,pe,ye)}}function attachNeighborIterationMethods(ne){NEIGHBORS_ITERATION.forEach(oe=>{attachNeighborArrayCreator(ne,oe),attachForEachNeighbor(ne,oe),attachFindNeighbor(ne,oe),attachNeighborIteratorCreator(ne,oe)})}function forEachAdjacency(ne,oe,ce,ue,pe){const me=ue._nodes.values(),ge=ue.type;let ye,xe,ve,_e,we,Se;for(;ye=me.next(),ye.done!==!0;){let $e=!1;if(xe=ye.value,ge!=="undirected"){_e=xe.out;for(ve in _e){we=_e[ve];do Se=we.target,$e=!0,pe(xe.key,Se.key,xe.attributes,Se.attributes,we.key,we.attributes,we.undirected),we=we.next;while(we)}}if(ge!=="directed"){_e=xe.undirected;for(ve in _e)if(!(oe&&xe.key>ve)){we=_e[ve];do Se=we.target,Se.key!==ve&&(Se=we.source),$e=!0,pe(xe.key,Se.key,xe.attributes,Se.attributes,we.key,we.attributes,we.undirected),we=we.next;while(we)}}ce&&!$e&&pe(xe.key,null,xe.attributes,null,null,null,null)}}function serializeNode(ne,oe){const ce={key:ne};return isEmpty$2(oe.attributes)||(ce.attributes=assign$3({},oe.attributes)),ce}function serializeEdge(ne,oe,ce){const ue={key:oe,source:ce.source.key,target:ce.target.key};return isEmpty$2(ce.attributes)||(ue.attributes=assign$3({},ce.attributes)),ne==="mixed"&&ce.undirected&&(ue.undirected=!0),ue}function validateSerializedNode(ne){if(!isPlainObject$1(ne))throw new InvalidArgumentsGraphError('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in ne))throw new InvalidArgumentsGraphError("Graph.import: serialized node is missing its key.");if("attributes"in ne&&(!isPlainObject$1(ne.attributes)||ne.attributes===null))throw new InvalidArgumentsGraphError("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function validateSerializedEdge(ne){if(!isPlainObject$1(ne))throw new InvalidArgumentsGraphError('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in ne))throw new InvalidArgumentsGraphError("Graph.import: serialized edge is missing its source.");if(!("target"in ne))throw new InvalidArgumentsGraphError("Graph.import: serialized edge is missing its target.");if("attributes"in ne&&(!isPlainObject$1(ne.attributes)||ne.attributes===null))throw new InvalidArgumentsGraphError("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in ne&&typeof ne.undirected!="boolean")throw new InvalidArgumentsGraphError("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const INSTANCE_ID=incrementalIdStartingFromRandomByte(),TYPES$1=new Set(["directed","undirected","mixed"]),EMITTER_PROPS=new Set(["domain","_events","_eventsCount","_maxListeners"]),EDGE_ADD_METHODS=[{name:ne=>`${ne}Edge`,generateKey:!0},{name:ne=>`${ne}DirectedEdge`,generateKey:!0,type:"directed"},{name:ne=>`${ne}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:ne=>`${ne}EdgeWithKey`},{name:ne=>`${ne}DirectedEdgeWithKey`,type:"directed"},{name:ne=>`${ne}UndirectedEdgeWithKey`,type:"undirected"}],DEFAULTS={allowSelfLoops:!0,multi:!1,type:"mixed"};function addNode(ne,oe,ce){if(ce&&!isPlainObject$1(ce))throw new InvalidArgumentsGraphError(`Graph.addNode: invalid attributes. Expecting an object but got "${ce}"`);if(oe=""+oe,ce=ce||{},ne._nodes.has(oe))throw new UsageGraphError(`Graph.addNode: the "${oe}" node already exist in the graph.`);const ue=new ne.NodeDataClass(oe,ce);return ne._nodes.set(oe,ue),ne.emit("nodeAdded",{key:oe,attributes:ce}),ue}function unsafeAddNode(ne,oe,ce){const ue=new ne.NodeDataClass(oe,ce);return ne._nodes.set(oe,ue),ne.emit("nodeAdded",{key:oe,attributes:ce}),ue}function addEdge(ne,oe,ce,ue,pe,me,ge,ye){if(!ue&&ne.type==="undirected")throw new UsageGraphError(`Graph.${oe}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(ue&&ne.type==="directed")throw new UsageGraphError(`Graph.${oe}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(ye&&!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: invalid attributes. Expecting an object but got "${ye}"`);if(me=""+me,ge=""+ge,ye=ye||{},!ne.allowSelfLoops&&me===ge)throw new UsageGraphError(`Graph.${oe}: source & target are the same ("${me}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const xe=ne._nodes.get(me),ve=ne._nodes.get(ge);if(!xe)throw new NotFoundGraphError(`Graph.${oe}: source node "${me}" not found.`);if(!ve)throw new NotFoundGraphError(`Graph.${oe}: target node "${ge}" not found.`);const _e={key:null,undirected:ue,source:me,target:ge,attributes:ye};if(ce)pe=ne._edgeKeyGenerator();else if(pe=""+pe,ne._edges.has(pe))throw new UsageGraphError(`Graph.${oe}: the "${pe}" edge already exists in the graph.`);if(!ne.multi&&(ue?typeof xe.undirected[ge]<"u":typeof xe.out[ge]<"u"))throw new UsageGraphError(`Graph.${oe}: an edge linking "${me}" to "${ge}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const we=new EdgeData(ue,pe,xe,ve,ye);ne._edges.set(pe,we);const Se=me===ge;return ue?(xe.undirectedDegree++,ve.undirectedDegree++,Se&&(xe.undirectedLoops++,ne._undirectedSelfLoopCount++)):(xe.outDegree++,ve.inDegree++,Se&&(xe.directedLoops++,ne._directedSelfLoopCount++)),ne.multi?we.attachMulti():we.attach(),ue?ne._undirectedSize++:ne._directedSize++,_e.key=pe,ne.emit("edgeAdded",_e),pe}function mergeEdge(ne,oe,ce,ue,pe,me,ge,ye,xe){if(!ue&&ne.type==="undirected")throw new UsageGraphError(`Graph.${oe}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(ue&&ne.type==="directed")throw new UsageGraphError(`Graph.${oe}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(ye){if(xe){if(typeof ye!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: invalid updater function. Expecting a function but got "${ye}"`)}else if(!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: invalid attributes. Expecting an object but got "${ye}"`)}me=""+me,ge=""+ge;let ve;if(xe&&(ve=ye,ye=void 0),!ne.allowSelfLoops&&me===ge)throw new UsageGraphError(`Graph.${oe}: source & target are the same ("${me}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let _e=ne._nodes.get(me),we=ne._nodes.get(ge),Se,$e;if(!ce&&(Se=ne._edges.get(pe),Se)){if((Se.source.key!==me||Se.target.key!==ge)&&(!ue||Se.source.key!==ge||Se.target.key!==me))throw new UsageGraphError(`Graph.${oe}: inconsistency detected when attempting to merge the "${pe}" edge with "${me}" source & "${ge}" target vs. ("${Se.source.key}", "${Se.target.key}").`);$e=Se}if(!$e&&!ne.multi&&_e&&($e=ue?_e.undirected[ge]:_e.out[ge]),$e){const Be=[$e.key,!1,!1,!1];if(xe?!ve:!ye)return Be;if(xe){const Ie=$e.attributes;$e.attributes=ve(Ie),ne.emit("edgeAttributesUpdated",{type:"replace",key:$e.key,attributes:$e.attributes})}else assign$3($e.attributes,ye),ne.emit("edgeAttributesUpdated",{type:"merge",key:$e.key,attributes:$e.attributes,data:ye});return Be}ye=ye||{},xe&&ve&&(ye=ve(ye));const Te={key:null,undirected:ue,source:me,target:ge,attributes:ye};if(ce)pe=ne._edgeKeyGenerator();else if(pe=""+pe,ne._edges.has(pe))throw new UsageGraphError(`Graph.${oe}: the "${pe}" edge already exists in the graph.`);let Re=!1,Ae=!1;_e||(_e=unsafeAddNode(ne,me,{}),Re=!0,me===ge&&(we=_e,Ae=!0)),we||(we=unsafeAddNode(ne,ge,{}),Ae=!0),Se=new EdgeData(ue,pe,_e,we,ye),ne._edges.set(pe,Se);const ke=me===ge;return ue?(_e.undirectedDegree++,we.undirectedDegree++,ke&&(_e.undirectedLoops++,ne._undirectedSelfLoopCount++)):(_e.outDegree++,we.inDegree++,ke&&(_e.directedLoops++,ne._directedSelfLoopCount++)),ne.multi?Se.attachMulti():Se.attach(),ue?ne._undirectedSize++:ne._directedSize++,Te.key=pe,ne.emit("edgeAdded",Te),[pe,!0,Re,Ae]}function dropEdgeFromData(ne,oe){ne._edges.delete(oe.key);const{source:ce,target:ue,attributes:pe}=oe,me=oe.undirected,ge=ce===ue;me?(ce.undirectedDegree--,ue.undirectedDegree--,ge&&(ce.undirectedLoops--,ne._undirectedSelfLoopCount--)):(ce.outDegree--,ue.inDegree--,ge&&(ce.directedLoops--,ne._directedSelfLoopCount--)),ne.multi?oe.detachMulti():oe.detach(),me?ne._undirectedSize--:ne._directedSize--,ne.emit("edgeDropped",{key:oe.key,attributes:pe,source:ce.key,target:ue.key,undirected:me})}class Graph extends eventsExports.EventEmitter{constructor(oe){if(super(),oe=assign$3({},DEFAULTS,oe),typeof oe.multi!="boolean")throw new InvalidArgumentsGraphError(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${oe.multi}".`);if(!TYPES$1.has(oe.type))throw new InvalidArgumentsGraphError(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${oe.type}".`);if(typeof oe.allowSelfLoops!="boolean")throw new InvalidArgumentsGraphError(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${oe.allowSelfLoops}".`);const ce=oe.type==="mixed"?MixedNodeData:oe.type==="directed"?DirectedNodeData:UndirectedNodeData;privateProperty(this,"NodeDataClass",ce);const ue="geid_"+INSTANCE_ID()+"_";let pe=0;const me=()=>{let ge;do ge=ue+pe++;while(this._edges.has(ge));return ge};privateProperty(this,"_attributes",{}),privateProperty(this,"_nodes",new Map),privateProperty(this,"_edges",new Map),privateProperty(this,"_directedSize",0),privateProperty(this,"_undirectedSize",0),privateProperty(this,"_directedSelfLoopCount",0),privateProperty(this,"_undirectedSelfLoopCount",0),privateProperty(this,"_edgeKeyGenerator",me),privateProperty(this,"_options",oe),EMITTER_PROPS.forEach(ge=>privateProperty(this,ge,this[ge])),readOnlyProperty(this,"order",()=>this._nodes.size),readOnlyProperty(this,"size",()=>this._edges.size),readOnlyProperty(this,"directedSize",()=>this._directedSize),readOnlyProperty(this,"undirectedSize",()=>this._undirectedSize),readOnlyProperty(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),readOnlyProperty(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),readOnlyProperty(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),readOnlyProperty(this,"multi",this._options.multi),readOnlyProperty(this,"type",this._options.type),readOnlyProperty(this,"allowSelfLoops",this._options.allowSelfLoops),readOnlyProperty(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(oe){return this._nodes.has(""+oe)}hasDirectedEdge(oe,ce){if(this.type==="undirected")return!1;if(arguments.length===1){const ue=""+oe,pe=this._edges.get(ue);return!!pe&&!pe.undirected}else if(arguments.length===2){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);return ue?ue.out.hasOwnProperty(ce):!1}throw new InvalidArgumentsGraphError(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(oe,ce){if(this.type==="directed")return!1;if(arguments.length===1){const ue=""+oe,pe=this._edges.get(ue);return!!pe&&pe.undirected}else if(arguments.length===2){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);return ue?ue.undirected.hasOwnProperty(ce):!1}throw new InvalidArgumentsGraphError(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(oe,ce){if(arguments.length===1){const ue=""+oe;return this._edges.has(ue)}else if(arguments.length===2){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);return ue?typeof ue.out<"u"&&ue.out.hasOwnProperty(ce)||typeof ue.undirected<"u"&&ue.undirected.hasOwnProperty(ce):!1}throw new InvalidArgumentsGraphError(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(oe,ce){if(this.type==="undirected")return;if(oe=""+oe,ce=""+ce,this.multi)throw new UsageGraphError("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.directedEdge: could not find the "${oe}" source node in the graph.`);if(!this._nodes.has(ce))throw new NotFoundGraphError(`Graph.directedEdge: could not find the "${ce}" target node in the graph.`);const pe=ue.out&&ue.out[ce]||void 0;if(pe)return pe.key}undirectedEdge(oe,ce){if(this.type==="directed")return;if(oe=""+oe,ce=""+ce,this.multi)throw new UsageGraphError("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.undirectedEdge: could not find the "${oe}" source node in the graph.`);if(!this._nodes.has(ce))throw new NotFoundGraphError(`Graph.undirectedEdge: could not find the "${ce}" target node in the graph.`);const pe=ue.undirected&&ue.undirected[ce]||void 0;if(pe)return pe.key}edge(oe,ce){if(this.multi)throw new UsageGraphError("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.edge: could not find the "${oe}" source node in the graph.`);if(!this._nodes.has(ce))throw new NotFoundGraphError(`Graph.edge: could not find the "${ce}" target node in the graph.`);const pe=ue.out&&ue.out[ce]||ue.undirected&&ue.undirected[ce]||void 0;if(pe)return pe.key}areDirectedNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areDirectedNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?!1:ce in ue.in||ce in ue.out}areOutNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areOutNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?!1:ce in ue.out}areInNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areInNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?!1:ce in ue.in}areUndirectedNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areUndirectedNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="directed"?!1:ce in ue.undirected}areNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areNeighbors: could not find the "${oe}" node in the graph.`);return this.type!=="undirected"&&(ce in ue.in||ce in ue.out)||this.type!=="directed"&&ce in ue.undirected}areInboundNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areInboundNeighbors: could not find the "${oe}" node in the graph.`);return this.type!=="undirected"&&ce in ue.in||this.type!=="directed"&&ce in ue.undirected}areOutboundNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areOutboundNeighbors: could not find the "${oe}" node in the graph.`);return this.type!=="undirected"&&ce in ue.out||this.type!=="directed"&&ce in ue.undirected}inDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inDegree: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree}outDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outDegree: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.outDegree}directedDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.directedDegree: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree+ce.outDegree}undirectedDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.undirectedDegree: could not find the "${oe}" node in the graph.`);return this.type==="directed"?0:ce.undirectedDegree}inboundDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inboundDegree: could not find the "${oe}" node in the graph.`);let ue=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree),this.type!=="undirected"&&(ue+=ce.inDegree),ue}outboundDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outboundDegree: could not find the "${oe}" node in the graph.`);let ue=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree),this.type!=="undirected"&&(ue+=ce.outDegree),ue}degree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.degree: could not find the "${oe}" node in the graph.`);let ue=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree),this.type!=="undirected"&&(ue+=ce.inDegree+ce.outDegree),ue}inDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree-ce.directedLoops}outDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.outDegree-ce.directedLoops}directedDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.directedDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree+ce.outDegree-ce.directedLoops*2}undirectedDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="directed"?0:ce.undirectedDegree-ce.undirectedLoops*2}inboundDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);let ue=0,pe=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree,pe+=ce.undirectedLoops*2),this.type!=="undirected"&&(ue+=ce.inDegree,pe+=ce.directedLoops),ue-pe}outboundDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);let ue=0,pe=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree,pe+=ce.undirectedLoops*2),this.type!=="undirected"&&(ue+=ce.outDegree,pe+=ce.directedLoops),ue-pe}degreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.degreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);let ue=0,pe=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree,pe+=ce.undirectedLoops*2),this.type!=="undirected"&&(ue+=ce.inDegree+ce.outDegree,pe+=ce.directedLoops*2),ue-pe}source(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.source: could not find the "${oe}" edge in the graph.`);return ce.source.key}target(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.target: could not find the "${oe}" edge in the graph.`);return ce.target.key}extremities(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.extremities: could not find the "${oe}" edge in the graph.`);return[ce.source.key,ce.target.key]}opposite(oe,ce){oe=""+oe,ce=""+ce;const ue=this._edges.get(ce);if(!ue)throw new NotFoundGraphError(`Graph.opposite: could not find the "${ce}" edge in the graph.`);const pe=ue.source.key,me=ue.target.key;if(oe===pe)return me;if(oe===me)return pe;throw new NotFoundGraphError(`Graph.opposite: the "${oe}" node is not attached to the "${ce}" edge (${pe}, ${me}).`)}hasExtremity(oe,ce){oe=""+oe,ce=""+ce;const ue=this._edges.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.hasExtremity: could not find the "${oe}" edge in the graph.`);return ue.source.key===ce||ue.target.key===ce}isUndirected(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.isUndirected: could not find the "${oe}" edge in the graph.`);return ce.undirected}isDirected(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.isDirected: could not find the "${oe}" edge in the graph.`);return!ce.undirected}isSelfLoop(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.isSelfLoop: could not find the "${oe}" edge in the graph.`);return ce.source===ce.target}addNode(oe,ce){return addNode(this,oe,ce).key}mergeNode(oe,ce){if(ce&&!isPlainObject$1(ce))throw new InvalidArgumentsGraphError(`Graph.mergeNode: invalid attributes. Expecting an object but got "${ce}"`);oe=""+oe,ce=ce||{};let ue=this._nodes.get(oe);return ue?(ce&&(assign$3(ue.attributes,ce),this.emit("nodeAttributesUpdated",{type:"merge",key:oe,attributes:ue.attributes,data:ce})),[oe,!1]):(ue=new this.NodeDataClass(oe,ce),this._nodes.set(oe,ue),this.emit("nodeAdded",{key:oe,attributes:ce}),[oe,!0])}updateNode(oe,ce){if(ce&&typeof ce!="function")throw new InvalidArgumentsGraphError(`Graph.updateNode: invalid updater function. Expecting a function but got "${ce}"`);oe=""+oe;let ue=this._nodes.get(oe);if(ue){if(ce){const me=ue.attributes;ue.attributes=ce(me),this.emit("nodeAttributesUpdated",{type:"replace",key:oe,attributes:ue.attributes})}return[oe,!1]}const pe=ce?ce({}):{};return ue=new this.NodeDataClass(oe,pe),this._nodes.set(oe,ue),this.emit("nodeAdded",{key:oe,attributes:pe}),[oe,!0]}dropNode(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.dropNode: could not find the "${oe}" node in the graph.`);let ue;if(this.type!=="undirected"){for(const pe in ce.out){ue=ce.out[pe];do dropEdgeFromData(this,ue),ue=ue.next;while(ue)}for(const pe in ce.in){ue=ce.in[pe];do dropEdgeFromData(this,ue),ue=ue.next;while(ue)}}if(this.type!=="directed")for(const pe in ce.undirected){ue=ce.undirected[pe];do dropEdgeFromData(this,ue),ue=ue.next;while(ue)}this._nodes.delete(oe),this.emit("nodeDropped",{key:oe,attributes:ce.attributes})}dropEdge(oe){let ce;if(arguments.length>1){const ue=""+arguments[0],pe=""+arguments[1];if(ce=getMatchingEdge(this,ue,pe,this.type),!ce)throw new NotFoundGraphError(`Graph.dropEdge: could not find the "${ue}" -> "${pe}" edge in the graph.`)}else if(oe=""+oe,ce=this._edges.get(oe),!ce)throw new NotFoundGraphError(`Graph.dropEdge: could not find the "${oe}" edge in the graph.`);return dropEdgeFromData(this,ce),this}dropDirectedEdge(oe,ce){if(arguments.length<2)throw new UsageGraphError("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new UsageGraphError("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");oe=""+oe,ce=""+ce;const ue=getMatchingEdge(this,oe,ce,"directed");if(!ue)throw new NotFoundGraphError(`Graph.dropDirectedEdge: could not find a "${oe}" -> "${ce}" edge in the graph.`);return dropEdgeFromData(this,ue),this}dropUndirectedEdge(oe,ce){if(arguments.length<2)throw new UsageGraphError("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new UsageGraphError("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const ue=getMatchingEdge(this,oe,ce,"undirected");if(!ue)throw new NotFoundGraphError(`Graph.dropUndirectedEdge: could not find a "${oe}" -> "${ce}" edge in the graph.`);return dropEdgeFromData(this,ue),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const oe=this._nodes.values();let ce;for(;ce=oe.next(),ce.done!==!0;)ce.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(oe){return this._attributes[oe]}getAttributes(){return this._attributes}hasAttribute(oe){return this._attributes.hasOwnProperty(oe)}setAttribute(oe,ce){return this._attributes[oe]=ce,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:oe}),this}updateAttribute(oe,ce){if(typeof ce!="function")throw new InvalidArgumentsGraphError("Graph.updateAttribute: updater should be a function.");const ue=this._attributes[oe];return this._attributes[oe]=ce(ue),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:oe}),this}removeAttribute(oe){return delete this._attributes[oe],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:oe}),this}replaceAttributes(oe){if(!isPlainObject$1(oe))throw new InvalidArgumentsGraphError("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=oe,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(oe){if(!isPlainObject$1(oe))throw new InvalidArgumentsGraphError("Graph.mergeAttributes: provided attributes are not a plain object.");return assign$3(this._attributes,oe),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:oe}),this}updateAttributes(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.updateAttributes: provided updater is not a function.");return this._attributes=oe(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(oe,ce){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.updateEachNodeAttributes: expecting an updater function.");if(ce&&!validateHints(ce))throw new InvalidArgumentsGraphError("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const ue=this._nodes.values();let pe,me;for(;pe=ue.next(),pe.done!==!0;)me=pe.value,me.attributes=oe(me.key,me.attributes);this.emit("eachNodeAttributesUpdated",{hints:ce||null})}updateEachEdgeAttributes(oe,ce){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.updateEachEdgeAttributes: expecting an updater function.");if(ce&&!validateHints(ce))throw new InvalidArgumentsGraphError("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const ue=this._edges.values();let pe,me,ge,ye;for(;pe=ue.next(),pe.done!==!0;)me=pe.value,ge=me.source,ye=me.target,me.attributes=oe(me.key,me.attributes,ge.key,ye.key,ge.attributes,ye.attributes,me.undirected);this.emit("eachEdgeAttributesUpdated",{hints:ce||null})}forEachAdjacencyEntry(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAdjacencyEntry: expecting a callback.");forEachAdjacency(!1,!1,!1,this,oe)}forEachAdjacencyEntryWithOrphans(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");forEachAdjacency(!1,!1,!0,this,oe)}forEachAssymetricAdjacencyEntry(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");forEachAdjacency(!1,!0,!1,this,oe)}forEachAssymetricAdjacencyEntryWithOrphans(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");forEachAdjacency(!1,!0,!0,this,oe)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):take$1(this._nodes.keys(),this._nodes.size)}forEachNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)pe=ue.value,oe(pe.key,pe.attributes)}findNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.findNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)if(pe=ue.value,oe(pe.key,pe.attributes))return pe.key}mapNodes(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.mapNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;const me=new Array(this.order);let ge=0;for(;ue=ce.next(),ue.done!==!0;)pe=ue.value,me[ge++]=oe(pe.key,pe.attributes);return me}someNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.someNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)if(pe=ue.value,oe(pe.key,pe.attributes))return!0;return!1}everyNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.everyNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)if(pe=ue.value,!oe(pe.key,pe.attributes))return!1;return!0}filterNodes(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.filterNodes: expecting a callback.");const ce=this._nodes.values();let ue,pe;const me=[];for(;ue=ce.next(),ue.done!==!0;)pe=ue.value,oe(pe.key,pe.attributes)&&me.push(pe.key);return me}reduceNodes(oe,ce){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new InvalidArgumentsGraphError("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let ue=ce;const pe=this._nodes.values();let me,ge;for(;me=pe.next(),me.done!==!0;)ge=me.value,ue=oe(ue,ge.key,ge.attributes);return ue}nodeEntries(){const oe=this._nodes.values();return new Iterator$3(()=>{const ce=oe.next();if(ce.done)return ce;const ue=ce.value;return{value:{node:ue.key,attributes:ue.attributes},done:!1}})}export(){const oe=new Array(this._nodes.size);let ce=0;this._nodes.forEach((pe,me)=>{oe[ce++]=serializeNode(me,pe)});const ue=new Array(this._edges.size);return ce=0,this._edges.forEach((pe,me)=>{ue[ce++]=serializeEdge(this.type,me,pe)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:oe,edges:ue}}import(oe,ce=!1){if(oe instanceof Graph)return oe.forEachNode((xe,ve)=>{ce?this.mergeNode(xe,ve):this.addNode(xe,ve)}),oe.forEachEdge((xe,ve,_e,we,Se,$e,Te)=>{ce?Te?this.mergeUndirectedEdgeWithKey(xe,_e,we,ve):this.mergeDirectedEdgeWithKey(xe,_e,we,ve):Te?this.addUndirectedEdgeWithKey(xe,_e,we,ve):this.addDirectedEdgeWithKey(xe,_e,we,ve)}),this;if(!isPlainObject$1(oe))throw new InvalidArgumentsGraphError("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(oe.attributes){if(!isPlainObject$1(oe.attributes))throw new InvalidArgumentsGraphError("Graph.import: invalid attributes. Expecting a plain object.");ce?this.mergeAttributes(oe.attributes):this.replaceAttributes(oe.attributes)}let ue,pe,me,ge,ye;if(oe.nodes){if(me=oe.nodes,!Array.isArray(me))throw new InvalidArgumentsGraphError("Graph.import: invalid nodes. Expecting an array.");for(ue=0,pe=me.length;ue{const me=assign$3({},ue.attributes);ue=new ce.NodeDataClass(pe,me),ce._nodes.set(pe,ue)}),ce}copy(oe){if(oe=oe||{},typeof oe.type=="string"&&oe.type!==this.type&&oe.type!=="mixed")throw new UsageGraphError(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${oe.type}" because this would mean losing information about the current graph.`);if(typeof oe.multi=="boolean"&&oe.multi!==this.multi&&oe.multi!==!0)throw new UsageGraphError("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof oe.allowSelfLoops=="boolean"&&oe.allowSelfLoops!==this.allowSelfLoops&&oe.allowSelfLoops!==!0)throw new UsageGraphError("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const ce=this.emptyCopy(oe),ue=this._edges.values();let pe,me;for(;pe=ue.next(),pe.done!==!0;)me=pe.value,addEdge(ce,"copy",!1,me.undirected,me.key,me.source.key,me.target.key,assign$3({},me.attributes));return ce}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const oe={};this._nodes.forEach((me,ge)=>{oe[ge]=me.attributes});const ce={},ue={};this._edges.forEach((me,ge)=>{const ye=me.undirected?"--":"->";let xe="",ve=me.source.key,_e=me.target.key,we;me.undirected&&ve>_e&&(we=ve,ve=_e,_e=we);const Se=`(${ve})${ye}(${_e})`;ge.startsWith("geid_")?this.multi&&(typeof ue[Se]>"u"?ue[Se]=0:ue[Se]++,xe+=`${ue[Se]}. `):xe+=`[${ge}]: `,xe+=Se,ce[xe]=me.attributes});const pe={};for(const me in this)this.hasOwnProperty(me)&&!EMITTER_PROPS.has(me)&&typeof this[me]!="function"&&typeof me!="symbol"&&(pe[me]=this[me]);return pe.attributes=this._attributes,pe.nodes=oe,pe.edges=ce,privateProperty(pe,"constructor",this.constructor),pe}}typeof Symbol<"u"&&(Graph.prototype[Symbol.for("nodejs.util.inspect.custom")]=Graph.prototype.inspect);EDGE_ADD_METHODS.forEach(ne=>{["add","merge","update"].forEach(oe=>{const ce=ne.name(oe),ue=oe==="add"?addEdge:mergeEdge;ne.generateKey?Graph.prototype[ce]=function(pe,me,ge){return ue(this,ce,!0,(ne.type||this.type)==="undirected",null,pe,me,ge,oe==="update")}:Graph.prototype[ce]=function(pe,me,ge,ye){return ue(this,ce,!1,(ne.type||this.type)==="undirected",pe,me,ge,ye,oe==="update")}})});attachNodeAttributesMethods(Graph);attachEdgeAttributesMethods(Graph);attachEdgeIterationMethods(Graph);attachNeighborIterationMethods(Graph);class DirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"directed"},oe);if("multi"in ce&&ce.multi!==!1)throw new InvalidArgumentsGraphError("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(ce.type!=="directed")throw new InvalidArgumentsGraphError('DirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}class UndirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"undirected"},oe);if("multi"in ce&&ce.multi!==!1)throw new InvalidArgumentsGraphError("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(ce.type!=="undirected")throw new InvalidArgumentsGraphError('UndirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}class MultiGraph extends Graph{constructor(oe){const ce=assign$3({multi:!0},oe);if("multi"in ce&&ce.multi!==!0)throw new InvalidArgumentsGraphError("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(ce)}}class MultiDirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"directed",multi:!0},oe);if("multi"in ce&&ce.multi!==!0)throw new InvalidArgumentsGraphError("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(ce.type!=="directed")throw new InvalidArgumentsGraphError('MultiDirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}class MultiUndirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"undirected",multi:!0},oe);if("multi"in ce&&ce.multi!==!0)throw new InvalidArgumentsGraphError("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(ce.type!=="undirected")throw new InvalidArgumentsGraphError('MultiUndirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}function attachStaticFromMethod(ne){ne.from=function(oe,ce){const ue=assign$3({},oe.options,ce),pe=new ne(ue);return pe.import(oe),pe}}attachStaticFromMethod(Graph);attachStaticFromMethod(DirectedGraph);attachStaticFromMethod(UndirectedGraph);attachStaticFromMethod(MultiGraph);attachStaticFromMethod(MultiDirectedGraph);attachStaticFromMethod(MultiUndirectedGraph);Graph.Graph=Graph;Graph.DirectedGraph=DirectedGraph;Graph.UndirectedGraph=UndirectedGraph;Graph.MultiGraph=MultiGraph;Graph.MultiDirectedGraph=MultiDirectedGraph;Graph.MultiUndirectedGraph=MultiUndirectedGraph;Graph.InvalidArgumentsGraphError=InvalidArgumentsGraphError;Graph.NotFoundGraphError=NotFoundGraphError;Graph.UsageGraphError=UsageGraphError;function _toPrimitive(ne,oe){if(typeof ne!="object"||!ne)return ne;var ce=ne[Symbol.toPrimitive];if(ce!==void 0){var ue=ce.call(ne,oe||"default");if(typeof ue!="object")return ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return(oe==="string"?String:Number)(ne)}function _toPropertyKey(ne){var oe=_toPrimitive(ne,"string");return typeof oe=="symbol"?oe:oe+""}function _classCallCheck$1(ne,oe){if(!(ne instanceof oe))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(ne,oe){for(var ce=0;cene.length)&&(oe=ne.length);for(var ce=0,ue=Array(oe);cexe){ye=_e,xe=we;continue}}ye&&(pe[paletteMapKey(ge)]=ye)}return pe}function matchPaletteLab(ne,oe,ce){let ue,pe,me=oe[0],ge=ciede2000(ne,me);for(let ye=1,xe=oe.length;yege)&&(me=ue,ge=pe);return me}function mapPaletteLab(ne,oe,ce){const ue={},pe=ce==="furthest";for(let me=0;me{let oe=hexRgb(ne);return{R:oe[0],G:oe[1],B:oe[2]}},pantoneRGBList=pantones.map(ne=>get_rgbObject(ne.hex));var getClosestColor=ne=>{const oe=get_rgbObject(ne),ce=diff.closest(oe,pantoneRGBList),ue=rgbHex(ce.R,ce.G,ce.B),pe=pantones.findIndex(ge=>ge.hex==`#${ue}`);return pantones[pe]};function u$4(){return(u$4=Object.assign||function(ne){for(var oe=1;oe=0||(pe[ce]=ne[ce]);return pe}function i$4(ne){var oe=reactExports.useRef(ne),ce=reactExports.useRef(function(ue){oe.current&&oe.current(ue)});return oe.current=ne,ce.current}var s$3=function(ne,oe,ce){return oe===void 0&&(oe=0),ce===void 0&&(ce=1),ne>ce?ce:ne0:Ae.buttons>0)&&pe.current?me(d$2(pe.current,Ae,ye.current)):Re(!1)},Te=function(){return Re(!1)};function Re(Ae){var ke=xe.current,Be=v$6(pe.current),Ie=Ae?Be.addEventListener:Be.removeEventListener;Ie(ke?"touchmove":"mousemove",$e),Ie(ke?"touchend":"mouseup",Te)}return[function(Ae){var ke=Ae.nativeEvent,Be=pe.current;if(Be&&(h$5(ke),!function(Ne,je){return je&&!f$5(Ne)}(ke,xe.current)&&Be)){if(f$5(ke)){xe.current=!0;var Ie=ke.changedTouches||[];Ie.length&&(ye.current=Ie[0].identifier)}Be.focus(),me(d$2(Be,ke,ye.current)),Re(!0)}},function(Ae){var ke=Ae.which||Ae.keyCode;ke<37||ke>40||(Ae.preventDefault(),ge({left:ke===39?.05:ke===37?-.05:0,top:ke===40?.05:ke===38?-.05:0}))},Re]},[ge,me]),_e=ve[0],we=ve[1],Se=ve[2];return reactExports.useEffect(function(){return Se},[Se]),React$2.createElement("div",u$4({},ue,{onTouchStart:_e,onMouseDown:_e,className:"react-colorful__interactive",ref:pe,onKeyDown:we,tabIndex:0,role:"slider"}))}),g$4=function(ne){return ne.filter(Boolean).join(" ")},p$5=function(ne){var oe=ne.color,ce=ne.left,ue=ne.top,pe=ue===void 0?.5:ue,me=g$4(["react-colorful__pointer",ne.className]);return React$2.createElement("div",{className:me,style:{top:100*pe+"%",left:100*ce+"%"}},React$2.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:oe}}))},b$5=function(ne,oe,ce){return oe===void 0&&(oe=0),ce===void 0&&(ce=Math.pow(10,oe)),Math.round(ce*ne)/ce},x$5=function(ne){return L$3(C$3(ne))},C$3=function(ne){return ne[0]==="#"&&(ne=ne.substring(1)),ne.length<6?{r:parseInt(ne[0]+ne[0],16),g:parseInt(ne[1]+ne[1],16),b:parseInt(ne[2]+ne[2],16),a:ne.length===4?b$5(parseInt(ne[3]+ne[3],16)/255,2):1}:{r:parseInt(ne.substring(0,2),16),g:parseInt(ne.substring(2,4),16),b:parseInt(ne.substring(4,6),16),a:ne.length===8?b$5(parseInt(ne.substring(6,8),16)/255,2):1}},w$4=function(ne){return K$2(I$2(ne))},y$6=function(ne){var oe=ne.s,ce=ne.v,ue=ne.a,pe=(200-oe)*ce/100;return{h:b$5(ne.h),s:b$5(pe>0&&pe<200?oe*ce/100/(pe<=100?pe:200-pe)*100:0),l:b$5(pe/2),a:b$5(ue,2)}},q$3=function(ne){var oe=y$6(ne);return"hsl("+oe.h+", "+oe.s+"%, "+oe.l+"%)"},I$2=function(ne){var oe=ne.h,ce=ne.s,ue=ne.v,pe=ne.a;oe=oe/360*6,ce/=100,ue/=100;var me=Math.floor(oe),ge=ue*(1-ce),ye=ue*(1-(oe-me)*ce),xe=ue*(1-(1-oe+me)*ce),ve=me%6;return{r:b$5(255*[ue,ye,ge,ge,xe,ue][ve]),g:b$5(255*[xe,ue,ue,ye,ge,ge][ve]),b:b$5(255*[ge,ge,xe,ue,ue,ye][ve]),a:b$5(pe,2)}},D$3=function(ne){var oe=ne.toString(16);return oe.length<2?"0"+oe:oe},K$2=function(ne){var oe=ne.r,ce=ne.g,ue=ne.b,pe=ne.a,me=pe<1?D$3(b$5(255*pe)):"";return"#"+D$3(oe)+D$3(ce)+D$3(ue)+me},L$3=function(ne){var oe=ne.r,ce=ne.g,ue=ne.b,pe=ne.a,me=Math.max(oe,ce,ue),ge=me-Math.min(oe,ce,ue),ye=ge?me===oe?(ce-ue)/ge:me===ce?2+(ue-oe)/ge:4+(oe-ce)/ge:0;return{h:b$5(60*(ye<0?ye+6:ye)),s:b$5(me?ge/me*100:0),v:b$5(me/255*100),a:pe}},S$5=React$2.memo(function(ne){var oe=ne.hue,ce=ne.onChange,ue=g$4(["react-colorful__hue",ne.className]);return React$2.createElement("div",{className:ue},React$2.createElement(m$3,{onMove:function(pe){ce({h:360*pe.left})},onKey:function(pe){ce({h:s$3(oe+360*pe.left,0,360)})},"aria-label":"Hue","aria-valuenow":b$5(oe),"aria-valuemax":"360","aria-valuemin":"0"},React$2.createElement(p$5,{className:"react-colorful__hue-pointer",left:oe/360,color:q$3({h:oe,s:100,v:100,a:1})})))}),T$3=React$2.memo(function(ne){var oe=ne.hsva,ce=ne.onChange,ue={backgroundColor:q$3({h:oe.h,s:100,v:100,a:1})};return React$2.createElement("div",{className:"react-colorful__saturation",style:ue},React$2.createElement(m$3,{onMove:function(pe){ce({s:100*pe.left,v:100-100*pe.top})},onKey:function(pe){ce({s:s$3(oe.s+100*pe.left,0,100),v:s$3(oe.v-100*pe.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+b$5(oe.s)+"%, Brightness "+b$5(oe.v)+"%"},React$2.createElement(p$5,{className:"react-colorful__saturation-pointer",top:1-oe.v/100,left:oe.s/100,color:q$3(oe)})))}),F$2=function(ne,oe){if(ne===oe)return!0;for(var ce in ne)if(ne[ce]!==oe[ce])return!1;return!0},X$2=function(ne,oe){return ne.toLowerCase()===oe.toLowerCase()||F$2(C$3(ne),C$3(oe))};function Y$5(ne,oe,ce){var ue=i$4(ce),pe=reactExports.useState(function(){return ne.toHsva(oe)}),me=pe[0],ge=pe[1],ye=reactExports.useRef({color:oe,hsva:me});reactExports.useEffect(function(){if(!ne.equal(oe,ye.current.color)){var ve=ne.toHsva(oe);ye.current={hsva:ve,color:oe},ge(ve)}},[oe,ne]),reactExports.useEffect(function(){var ve;F$2(me,ye.current.hsva)||ne.equal(ve=ne.fromHsva(me),ye.current.color)||(ye.current={hsva:me,color:ve},ue(ve))},[me,ne,ue]);var xe=reactExports.useCallback(function(ve){ge(function(_e){return Object.assign({},_e,ve)})},[]);return[me,xe]}var V$2=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,$$4=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},J$2=new Map,Q$2=function(ne){V$2(function(){var oe=ne.current?ne.current.ownerDocument:document;if(oe!==void 0&&!J$2.has(oe)){var ce=oe.createElement("style");ce.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,J$2.set(oe,ce);var ue=$$4();ue&&ce.setAttribute("nonce",ue),oe.head.appendChild(ce)}},[])},U$2=function(ne){var oe=ne.className,ce=ne.colorModel,ue=ne.color,pe=ue===void 0?ce.defaultColor:ue,me=ne.onChange,ge=c$4(ne,["className","colorModel","color","onChange"]),ye=reactExports.useRef(null);Q$2(ye);var xe=Y$5(ce,pe,me),ve=xe[0],_e=xe[1],we=g$4(["react-colorful",oe]);return React$2.createElement("div",u$4({},ge,{ref:ye,className:we}),React$2.createElement(T$3,{hsva:ve,onChange:_e}),React$2.createElement(S$5,{hue:ve.h,onChange:_e,className:"react-colorful__last-control"}))},W$2={defaultColor:"000",toHsva:x$5,fromHsva:function(ne){return w$4({h:ne.h,s:ne.s,v:ne.v,a:1})},equal:X$2},Z$3=function(ne){return React$2.createElement(U$2,u$4({},ne,{colorModel:W$2}))};const byPoint=({variables:ne},{x:oe,y:ce})=>(ne==null?void 0:ne.x)===oe&&(ne==null?void 0:ne.y)===ce,getGridSymbolsUrl=""+new URL("getGridSymbols.worker-BM9IxXsn.js",import.meta.url).href;class GetGridSymbolsWorker extends Worker{constructor(){super(getGridSymbolsUrl,{type:"module"})}}const getGridSymbolsAsync=usingWorkerTask(GetGridSymbolsWorker),parseGridWorkerUrl=""+new URL("parseGrid.worker-CTnsDGUU.js",import.meta.url).href;class ParseGridWorker extends Worker{constructor(){super(parseGridWorkerUrl,{type:"module"})}}const parseGridAsync=usingMemoizedWorkerTask(ParseGridWorker);function useDebouncedState(ne,oe=lodashExports.noop,ce=300){const[ue,pe]=reactExports.useState(ne),me=reactExports.useRef(lodashExports.now());return[ue,ge=>{const ye=lodashExports.now();requestIdleCallback(()=>{ye>me.current&&(oe==null||oe(ge),me.current=ye)},{timeout:ce}),pe(ge)}]}function useDebouncedState2(ne,oe=lodashExports.noop,ce=300){const[ue,pe]=reactExports.useState(ne),me=reactExports.useRef(lodashExports.now());return[ue,ge=>{const ye=lodashExports.now();requestIdleCallback(()=>{ye>me.current&&(oe==null||oe(ge),me.current=ye)},{timeout:ce}),pe(ge(ue))}]}function between(ne,oe,ce){return ne>=oe&&ne({content:ne,...await parseGridAsync({map:ne,options:oe})}),{normalizer:JSON.stringify});function SymbolColorPicker(ne){const oe=compilerRuntimeExports.c(5),{onChange:ce,value:ue,autoValue:pe}=ne,[me,ge]=useDebouncedState(ue,ce),ye=me??pe;let xe;return oe[0]!==pe||oe[1]!==ye||oe[2]!==ge||oe[3]!==me?(xe=jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:ve=>{var _e;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FeaturePickerButton,{...bindTrigger(ve),children:jsxRuntimeExports.jsxs(Stack,{direction:"row",gap:1,alignItems:"center",children:[jsxRuntimeExports.jsx(Box,{sx:{width:16,height:16,backgroundColor:ye,outline:_temp$t,borderRadius:4}}),me?lodashExports.startCase(((_e=getClosestColor(me))==null?void 0:_e.name)??"Custom"):"Auto"]})}),jsxRuntimeExports.jsxs(Popover,{transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},...bindPopover(ve),slotProps:{paper:{sx:{overflow:"visible"}}},children:[jsxRuntimeExports.jsx(Box,{sx:{px:2,py:1},children:jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{defaultChecked:!me,onChange:(we,Se)=>ge==null?void 0:ge(Se?void 0:pe)}),label:"Choose Automatically"})}),jsxRuntimeExports.jsx(Box,{sx:{p:2,pt:0,...!me&&{opacity:_temp2$l,pointerEvents:"none"}},children:jsxRuntimeExports.jsx(Z$3,{color:me??pe,onChange:ge})})]})]})}}),oe[0]=pe,oe[1]=ye,oe[2]=ge,oe[3]=me,oe[4]=xe):xe=oe[4],xe}function _temp2$l(ne){return ne.palette.action.disabledOpacity}function _temp$t(ne){return`1px solid ${ne.palette.divider}`}const editor$3=async ne=>{if(ne){const{symbols:oe}=await getGridSymbolsAsync({map:ne});return withProduce(({produce:ce,value:ue})=>{const{palette:pe}=useTheme(),me=lodashExports.flow(interpolate$1([pe.background.paper,pe.text.primary]),rgbToHex$3);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:lodashExports.sortBy(oe,"value").map(({symbol:ge})=>{var ye,xe;return jsxRuntimeExports.jsx(Option,{label:`Tile color for "${ge}"`,content:jsxRuntimeExports.jsx(SymbolColorPicker,{value:(ye=ue==null?void 0:ue.symbols)==null?void 0:ye[ge],autoValue:me(((xe=lodashExports.find(oe,{symbol:ge}))==null?void 0:xe.value)??0),onChange:ve=>ce(_e=>{lodashExports.set(_e,`symbols["${ge}"]`,ve)})})},ge)})})})}else return()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},hydrate$3=ne=>{const{width:oe,height:ce}=ne.bounds;return{...ne,snap:({x:ue,y:pe},me=1)=>{const[ge,ye]=[lodashExports.round(-1+ue+me/2),lodashExports.round(-1+pe+me/2)];if(between(ge,0,oe)&&between(ye,0,ce))return{x:ge,y:ye}},nodeAt:ue=>{const{x:pe,y:me}=ue;return me*oe+pe},pointOf:ue=>({x:ue%oe,y:~~(ue/oe)}),matchNode:byPoint}},grid=Object.freeze(Object.defineProperty({__proto__:null,SymbolColorPicker,editor:editor$3,hydrate:hydrate$3,parse:parse$9},Symbol.toStringTag,{value:"Module"})),parseMeshWorkerUrl=""+new URL("parseMesh.worker-BqXfsHv6.js",import.meta.url).href;class ParseMeshWorker extends Worker{constructor(){super(parseMeshWorkerUrl,{type:"module"})}}const parseMeshAsync=usingMemoizedWorkerTask(ParseMeshWorker),parse$8=memoizee$1(async(ne="",oe)=>await parseMeshAsync({map:ne,options:oe}),{normalizer:JSON.stringify}),hydrate$2=ne=>({...ne,snap:lodashExports.identity,nodeAt:lodashExports.constant(0),pointOf:lodashExports.constant({x:0,y:0}),matchNode:byPoint}),editor$2=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),mesh=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$2,hydrate:hydrate$2,parse:parse$8},Symbol.toStringTag,{value:"Module"})),parseNetworkWorkerUrl=""+new URL("parseNetwork.worker-CBxoD6o6.js",import.meta.url).href;class ParseNetworkWorker extends Worker{constructor(){super(parseNetworkWorkerUrl,{type:"module"})}}const parseNetworkAsync=usingMemoizedWorkerTask(ParseNetworkWorker),parse$7=memoizee$1(async(ne="",oe)=>await parseNetworkAsync({map:ne,options:oe}),{normalizer:JSON.stringify}),hydrate$1=ne=>({...ne,snap:lodashExports.identity,nodeAt:lodashExports.constant(0),pointOf:lodashExports.constant({x:0,y:0}),matchNode:byPoint}),editor$1=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),xy=Object.freeze(Object.defineProperty({__proto__:null,editor:editor$1,hydrate:hydrate$1,parse:parse$7},Symbol.toStringTag,{value:"Module"})),parsePolyWorkerUrl=""+new URL("parsePoly.worker-CFQGo0UP.js",import.meta.url).href;class ParsePolyWorker extends Worker{constructor(){super(parsePolyWorkerUrl,{type:"module"})}}const parsePolyAsync=usingMemoizedWorkerTask(ParsePolyWorker),parse$6=memoizee$1(async(ne="",oe)=>await parsePolyAsync({map:ne,options:oe}),{normalizer:JSON.stringify}),hydrate=ne=>({...ne,snap:lodashExports.identity,nodeAt:lodashExports.constant(0),pointOf:lodashExports.constant({x:0,y:0}),matchNode:byPoint}),editor=async()=>()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:"No options available."})}),poly=Object.freeze(Object.defineProperty({__proto__:null,editor,hydrate,parse:parse$6},Symbol.toStringTag,{value:"Module"})),mapParsers={grid,map:grid,xy,mesh,poly};function getParser(ne=""){return mapParsers[ne]}const defaultGuard=lodashExports.constant(!0),[useLayers,LayersProvider]=createSlice({layers:[]});function useLayer(ne,oe){const ce=compilerRuntimeExports.c(21),ue=oe===void 0?defaultGuard:oe,[pe,me]=reactExports.useState(ne),[ge,ye]=useLayers(),{layers:xe}=ge;let ve,_e;ce[0]!==ue||ce[1]!==pe||ce[2]!==xe?(ve=lodashExports.filter(xe,ue),_e=pe?lodashExports.find(ve,{key:pe})??lodashExports.head(ve):lodashExports.head(ve),ce[0]=ue,ce[1]=pe,ce[2]=xe,ce[3]=ve,ce[4]=_e):(ve=ce[3],_e=ce[4]);const we=_e;let Se,$e;ce[5]!==ne?(Se=()=>{me(ne)},$e=[ne],ce[5]=ne,ce[6]=Se,ce[7]=$e):(Se=ce[6],$e=ce[7]),reactExports.useEffect(Se,$e);let Te,Re;ce[8]!==pe||ce[9]!==we?(Te=()=>{we&&we.key!==pe&&me(we.key)},Re=[we,pe,me],ce[8]=pe,ce[9]=we,ce[10]=Te,ce[11]=Re):(Te=ce[10],Re=ce[11]),reactExports.useEffect(Te,Re);let Ae;const ke=we==null?void 0:we.key;let Be;ce[12]!==we||ce[13]!==ye?(Be=Ne=>{const je={...we,...Ne};ye(ze=>{const{layers:Ue}=ze;return{layers:lodashExports.map(Ue,qe=>qe.key===je.key?je:qe)}})},ce[12]=we,ce[13]=ye,ce[14]=Be):Be=ce[14];let Ie;return ce[15]!==ve||ce[16]!==we||ce[17]!==xe||ce[18]!==ke||ce[19]!==Be?(Ie={key:ke,setKey:me,layer:we,setLayer:Be,layers:ve,allLayers:xe},ce[15]=ve,ce[16]=we,ce[17]=xe,ce[18]=ke,ce[19]=Be,ce[20]=Ie):Ie=ce[20],Ae=Ie,Ae}const shouldBreak={name:"shouldBreak",description:"Define in what situations the debugger should break, in addition to the conditions defined in the standard options.",params:[{name:"step",type:"number"},{name:"event",type:"any"},{name:"events",type:"any"},{name:"parent",type:"any"},{name:"children",type:"any"}],defaultReturnValue:!1,returnType:"boolean"},templates={shouldBreak},fn=memoizee$1((ne,oe)=>new Function("params",`${ne}; return ${oe}.apply(null, params);`));function call$2(ne,oe,ce){try{return fn(ne,oe)(ce)}catch{return templates[oe].defaultReturnValue}}function _extends(){return _extends=Object.assign||function(ne){for(var oe=1;oeawait treeAsync$1(ne),ue=[ne],oe[0]=ne,oe[1]=ce,oe[2]=ue):(ce=oe[1],ue=oe[2]),useAsync(ce,ue)}function useTreeMemo$1(ne,oe){const ce=reactExports.useMemo(()=>ne,oe);return useTree$1(ce)}function useBreakpoints(ne){var _e;const{layer:oe}=useLayer(ne),{isTrusted:ce}=useUntrustedLayers(),{monotonicF:ue,monotonicG:pe,breakpoints:me,code:ge,trace:ye}=(oe==null?void 0:oe.source)??{},xe=ye==null?void 0:ye.content,{result:ve}=useTreeMemo$1({trace:xe,step:(_e=xe==null?void 0:xe.events)==null?void 0:_e.length,radius:void 0},[xe]);return reactExports.useMemo(()=>{const we=(xe==null?void 0:xe.events)??[],Se=treeToDict((ve==null?void 0:ve.tree)??[]);return memoizee$1($e=>{var Re,Ae;const Te=we[$e];if(Te)try{for(const{active:ke,condition:Be,type:Ie,property:Ne="",reference:je=0}of me??[]){const ze=!Ie||Ie===Te.type;if(ke&&ze&&(()=>{var qe;return(qe=Be==null?void 0:Be.apply)==null?void 0:qe.call(Be,{type:Ie,event:Te,property:Ne,value:lodashExports.get(Te,Ne),reference:je,step:$e,events:we,node:Se[$e]})})())return Be!=null&&Be.needsReference?{result:`${Ne} ${lodashExports.toLower(lodashExports.startCase(Be==null?void 0:Be.key))} ${je}`}:{result:`${Ne} ${lodashExports.toLower(lodashExports.startCase(Be==null?void 0:Be.key))}`}}if(ce&&call$2(ge??"","shouldBreak",[$e,Te,we,(Re=Se[$e])==null?void 0:Re.parent,((Ae=Se[$e])==null?void 0:Ae.children)??[]]))return{result:"Script editor"}}catch(ke){return{error:`${ke}`}}return{result:""}})},[ce,ge,xe,me,ue,pe,ve])}function treeToDict(ne=[],oe={}){for(const ce of ne){for(const ue of ce.events)oe[ue.step]=ce;treeToDict(ce.children,oe)}return oe}function cancellable(ne,oe){let ce=!1;return requestAnimationFrame(async()=>{const ue=await ne();ce||oe(ue)}),()=>{ce=!0}}function usePlaybackState(ne){const{layer:oe,setLayer:ce,setKey:ue}=useLayer(ne),pe=useSnackbar(),me=useBreakpoints(ne);reactExports.useEffect(()=>{ne&&ue(ne)},[ne]);const{playback:ge,playbackTo:ye,step:xe=0}=(oe==null?void 0:oe.source)??{},ve=lodashExports.min([ye,xe])??0,_e=!!ye,we=ge==="playing",[Se,$e]=[0,(ye??1)-1];return reactExports.useMemo(()=>{function Te(ze){ce(produce(oe,Ue=>lodashExports.set(Ue,"source",{...Ue==null?void 0:Ue.source,...ze})))}const Re={start:Se,end:$e,step:ve,canPlay:_e&&!we&&ve<$e,canPause:_e&&we,canStop:_e&&ve,canStepForward:_e&&!we&&ve<$e,canStepBackward:_e&&!we&&ve>0},Ae=(ze=0)=>{Te({playback:"paused",step:Ne(ze)})},ke=(ze=1)=>Te({playback:"playing",step:Ne(ze)}),Be=(ze,Ue=0)=>cancellable(async()=>{for(const qe of lodashExports.range(Ue,ze)){const Ke=me(ve+qe);if(Ke.result||Ke.error)return{...Ke,offset:qe}}return{result:"",offset:0,error:void 0}},({result:qe,offset:Ke,error:Ge})=>{Ge?(pe(`${lodashExports.trimEnd(Ge,".")}`,`Step ${ve+Ke}`),Ae()):qe?(pe(`Breakpoint hit: ${qe}`,`Step ${ve+Ke}`),Ae(Ke)):ke(ze)}),Ie=(ze=1)=>{var qe;let Ue;for(Ue=ve+ze;Ue<=$e&&Ue>=0&&!((qe=me(Ue))!=null&&qe.result);Ue+=ze);return Ue},Ne=ze=>lodashExports.clamp(ve+ze,Se,$e);return{playing:ge==="playing",...Re,...{play:()=>{Te({playback:"playing",step:Ne(1)})},pause:Ae,stepTo:(ze=0)=>Te({step:lodashExports.clamp(ze,Se,$e)}),stop:()=>Te({step:Se,playback:"paused"}),stepForward:()=>Te({step:Ne(1)}),stepBackward:()=>Te({step:Ne(-1)}),tick:ke,findBreakpoint:Ie,stepWithBreakpointCheck:Be}}},[$e,ge,we,_e,Se,ve,ce])}function RenderLayer(ne){var ge;const oe=compilerRuntimeExports.c(5),{layer:ce,index:ue}=ne;let pe;oe[0]!==ue||oe[1]!==ce?(pe=ce&&reactExports.createElement((ge=getController(ce))==null?void 0:ge.renderer,{layer:ce,index:ue}),oe[0]=ue,oe[1]=ce,oe[2]=pe):pe=oe[2];let me;return oe[3]!==pe?(me=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pe}),oe[3]=pe,oe[4]=me):me=oe[4],me}const[useRenderers,RendererProvider]=createSlice([],{reduce:replace$1}),removeUndefinedValues=ne=>lodashExports.omit(ne,lodashExports.filter(lodashExports.keys(ne),oe=>lodashExports.isUndefined(ne[oe]))),[useScreenshots,ScreenshotsProvider]=createSlice({},{reduce:lodashExports.flow(merge$6,removeUndefinedValues)});var events={exports:{}},R$3=typeof Reflect=="object"?Reflect:null,ReflectApply=R$3&&typeof R$3.apply=="function"?R$3.apply:function(oe,ce,ue){return Function.prototype.apply.call(oe,ce,ue)},ReflectOwnKeys;R$3&&typeof R$3.ownKeys=="function"?ReflectOwnKeys=R$3.ownKeys:Object.getOwnPropertySymbols?ReflectOwnKeys=function(oe){return Object.getOwnPropertyNames(oe).concat(Object.getOwnPropertySymbols(oe))}:ReflectOwnKeys=function(oe){return Object.getOwnPropertyNames(oe)};function ProcessEmitWarning(ne){console&&console.warn&&console.warn(ne)}var NumberIsNaN=Number.isNaN||function(oe){return oe!==oe};function EventEmitter$3(){EventEmitter$3.init.call(this)}events.exports=EventEmitter$3;events.exports.once=once;EventEmitter$3.EventEmitter=EventEmitter$3;EventEmitter$3.prototype._events=void 0;EventEmitter$3.prototype._eventsCount=0;EventEmitter$3.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(ne){if(typeof ne!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ne)}Object.defineProperty(EventEmitter$3,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(ne){if(typeof ne!="number"||ne<0||NumberIsNaN(ne))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ne+".");defaultMaxListeners=ne}});EventEmitter$3.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};EventEmitter$3.prototype.setMaxListeners=function(oe){if(typeof oe!="number"||oe<0||NumberIsNaN(oe))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+oe+".");return this._maxListeners=oe,this};function _getMaxListeners(ne){return ne._maxListeners===void 0?EventEmitter$3.defaultMaxListeners:ne._maxListeners}EventEmitter$3.prototype.getMaxListeners=function(){return _getMaxListeners(this)};EventEmitter$3.prototype.emit=function(oe){for(var ce=[],ue=1;ue0&&(ge=ce[0]),ge instanceof Error)throw ge;var ye=new Error("Unhandled error."+(ge?" ("+ge.message+")":""));throw ye.context=ge,ye}var xe=me[oe];if(xe===void 0)return!1;if(typeof xe=="function")ReflectApply(xe,this,ce);else for(var ve=xe.length,_e=arrayClone(xe,ve),ue=0;ue0&&ge.length>pe&&!ge.warned){ge.warned=!0;var ye=new Error("Possible EventEmitter memory leak detected. "+ge.length+" "+String(oe)+" listeners added. Use emitter.setMaxListeners() to increase limit");ye.name="MaxListenersExceededWarning",ye.emitter=ne,ye.type=oe,ye.count=ge.length,ProcessEmitWarning(ye)}return ne}EventEmitter$3.prototype.addListener=function(oe,ce){return _addListener(this,oe,ce,!1)};EventEmitter$3.prototype.on=EventEmitter$3.prototype.addListener;EventEmitter$3.prototype.prependListener=function(oe,ce){return _addListener(this,oe,ce,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(ne,oe,ce){var ue={fired:!1,wrapFn:void 0,target:ne,type:oe,listener:ce},pe=onceWrapper.bind(ue);return pe.listener=ce,ue.wrapFn=pe,pe}EventEmitter$3.prototype.once=function(oe,ce){return checkListener(ce),this.on(oe,_onceWrap(this,oe,ce)),this};EventEmitter$3.prototype.prependOnceListener=function(oe,ce){return checkListener(ce),this.prependListener(oe,_onceWrap(this,oe,ce)),this};EventEmitter$3.prototype.removeListener=function(oe,ce){var ue,pe,me,ge,ye;if(checkListener(ce),pe=this._events,pe===void 0)return this;if(ue=pe[oe],ue===void 0)return this;if(ue===ce||ue.listener===ce)--this._eventsCount===0?this._events=Object.create(null):(delete pe[oe],pe.removeListener&&this.emit("removeListener",oe,ue.listener||ce));else if(typeof ue!="function"){for(me=-1,ge=ue.length-1;ge>=0;ge--)if(ue[ge]===ce||ue[ge].listener===ce){ye=ue[ge].listener,me=ge;break}if(me<0)return this;me===0?ue.shift():spliceOne(ue,me),ue.length===1&&(pe[oe]=ue[0]),pe.removeListener!==void 0&&this.emit("removeListener",oe,ye||ce)}return this};EventEmitter$3.prototype.off=EventEmitter$3.prototype.removeListener;EventEmitter$3.prototype.removeAllListeners=function(oe){var ce,ue,pe;if(ue=this._events,ue===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[oe]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[oe]),this;if(arguments.length===0){var me=Object.keys(ue),ge;for(pe=0;pe=0;pe--)this.removeListener(oe,ce[pe]);return this};function _listeners(ne,oe,ce){var ue=ne._events;if(ue===void 0)return[];var pe=ue[oe];return pe===void 0?[]:typeof pe=="function"?ce?[pe.listener||pe]:[pe]:ce?unwrapListeners(pe):arrayClone(pe,pe.length)}EventEmitter$3.prototype.listeners=function(oe){return _listeners(this,oe,!0)};EventEmitter$3.prototype.rawListeners=function(oe){return _listeners(this,oe,!1)};EventEmitter$3.listenerCount=function(ne,oe){return typeof ne.listenerCount=="function"?ne.listenerCount(oe):listenerCount.call(ne,oe)};EventEmitter$3.prototype.listenerCount=listenerCount;function listenerCount(ne){var oe=this._events;if(oe!==void 0){var ce=oe[ne];if(typeof ce=="function")return 1;if(ce!==void 0)return ce.length}return 0}EventEmitter$3.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone(ne,oe){for(var ce=new Array(oe),ue=0;ue=oe?{done:!0}:{done:!1,value:ne[ce++]}})};Iterator$2.empty=function(){var ne=new Iterator$2(function(){return{done:!0}});return ne};Iterator$2.fromSequence=function(ne){var oe=0,ce=ne.length;return new Iterator$2(function(){return oe>=ce?{done:!0}:{done:!1,value:ne[oe++]}})};Iterator$2.is=function(ne){return ne instanceof Iterator$2?!0:typeof ne=="object"&&ne!==null&&typeof ne.next=="function"};var iterator=Iterator$2;const Iterator$3=getDefaultExportFromCjs$1(iterator);var support$1={};support$1.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u";support$1.SYMBOL_SUPPORT=typeof Symbol<"u";var Iterator$1=iterator,support=support$1,ARRAY_BUFFER_SUPPORT=support.ARRAY_BUFFER_SUPPORT,SYMBOL_SUPPORT=support.SYMBOL_SUPPORT;function iterOrNull(ne){return typeof ne=="string"||Array.isArray(ne)||ARRAY_BUFFER_SUPPORT&&ArrayBuffer.isView(ne)?Iterator$1.fromSequence(ne):typeof ne!="object"||ne===null?null:SYMBOL_SUPPORT&&typeof ne[Symbol.iterator]=="function"?ne[Symbol.iterator]():typeof ne.next=="function"?ne:null}var iter$2=function(oe){var ce=iterOrNull(oe);if(!ce)throw new Error("obliterator: target is not iterable nor a valid iterator.");return ce},iter$1=iter$2,take=function(oe,ce){for(var ue=arguments.length>1?ce:1/0,pe=ue!==1/0?new Array(ue):[],me,ge=0,ye=iter$1(oe);;){if(ge===ue)return pe;if(me=ye.next(),me.done)return ge!==ce&&(pe.length=ge),pe;pe[ge++]=me.value}};const take$1=getDefaultExportFromCjs$1(take);var Iterator=iterator,iter=iter$2,chain=function(){var oe=arguments,ce=null,ue=-1;return new Iterator(function(){var me=null;do{if(ce===null){if(ue++,ue>=oe.length)return{done:!0};ce=iter(oe[ue])}if(me=ce.next(),me.done===!0){ce=null;continue}break}while(!0);return me})};const chain$1=getDefaultExportFromCjs$1(chain);function assignPolyfill(){const ne=arguments[0];for(let oe=1,ce=arguments.length;oene++}class GraphError extends Error{constructor(oe){super(),this.name="GraphError",this.message=oe}}class InvalidArgumentsGraphError extends GraphError{constructor(oe){super(oe),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,InvalidArgumentsGraphError.prototype.constructor)}}class NotFoundGraphError extends GraphError{constructor(oe){super(oe),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,NotFoundGraphError.prototype.constructor)}}class UsageGraphError extends GraphError{constructor(oe){super(oe),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,UsageGraphError.prototype.constructor)}}function MixedNodeData(ne,oe){this.key=ne,this.attributes=oe,this.clear()}MixedNodeData.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function DirectedNodeData(ne,oe){this.key=ne,this.attributes=oe,this.clear()}DirectedNodeData.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function UndirectedNodeData(ne,oe){this.key=ne,this.attributes=oe,this.clear()}UndirectedNodeData.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function EdgeData(ne,oe,ce,ue,pe){this.key=oe,this.attributes=pe,this.undirected=ne,this.source=ce,this.target=ue}EdgeData.prototype.attach=function(){let ne="out",oe="in";this.undirected&&(ne=oe="undirected");const ce=this.source.key,ue=this.target.key;this.source[ne][ue]=this,!(this.undirected&&ce===ue)&&(this.target[oe][ce]=this)};EdgeData.prototype.attachMulti=function(){let ne="out",oe="in";const ce=this.source.key,ue=this.target.key;this.undirected&&(ne=oe="undirected");const pe=this.source[ne],me=pe[ue];if(typeof me>"u"){pe[ue]=this,this.undirected&&ce===ue||(this.target[oe][ce]=this);return}me.previous=this,this.next=me,pe[ue]=this,this.target[oe][ce]=this};EdgeData.prototype.detach=function(){const ne=this.source.key,oe=this.target.key;let ce="out",ue="in";this.undirected&&(ce=ue="undirected"),delete this.source[ce][oe],delete this.target[ue][ne]};EdgeData.prototype.detachMulti=function(){const ne=this.source.key,oe=this.target.key;let ce="out",ue="in";this.undirected&&(ce=ue="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[ce][oe],delete this.target[ue][ne]):(this.next.previous=void 0,this.source[ce][oe]=this.next,this.target[ue][ne]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const NODE=0,SOURCE=1,TARGET=2,OPPOSITE=3;function findRelevantNodeData(ne,oe,ce,ue,pe,me,ge){let ye,xe,ve,_e;if(ue=""+ue,ce===NODE){if(ye=ne._nodes.get(ue),!ye)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" node in the graph.`);ve=pe,_e=me}else if(ce===OPPOSITE){if(pe=""+pe,xe=ne._edges.get(pe),!xe)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${pe}" edge in the graph.`);const we=xe.source.key,Se=xe.target.key;if(ue===we)ye=xe.target;else if(ue===Se)ye=xe.source;else throw new NotFoundGraphError(`Graph.${oe}: the "${ue}" node is not attached to the "${pe}" edge (${we}, ${Se}).`);ve=me,_e=ge}else{if(xe=ne._edges.get(ue),!xe)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`);ce===SOURCE?ye=xe.source:ye=xe.target,ve=pe,_e=me}return[ye,ve,_e]}function attachNodeAttributeGetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);return ge.attributes[ye]}}function attachNodeAttributesGetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe){const[me]=findRelevantNodeData(this,oe,ce,ue,pe);return me.attributes}}function attachNodeAttributeChecker(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);return ge.attributes.hasOwnProperty(ye)}}function attachNodeAttributeSetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me,ge){const[ye,xe,ve]=findRelevantNodeData(this,oe,ce,ue,pe,me,ge);return ye.attributes[xe]=ve,this.emit("nodeAttributesUpdated",{key:ye.key,type:"set",attributes:ye.attributes,name:xe}),this}}function attachNodeAttributeUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me,ge){const[ye,xe,ve]=findRelevantNodeData(this,oe,ce,ue,pe,me,ge);if(typeof ve!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: updater should be a function.`);const _e=ye.attributes,we=ve(_e[xe]);return _e[xe]=we,this.emit("nodeAttributesUpdated",{key:ye.key,type:"set",attributes:ye.attributes,name:xe}),this}}function attachNodeAttributeRemover(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);return delete ge.attributes[ye],this.emit("nodeAttributesUpdated",{key:ge.key,type:"remove",attributes:ge.attributes,name:ye}),this}}function attachNodeAttributesReplacer(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);if(!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return ge.attributes=ye,this.emit("nodeAttributesUpdated",{key:ge.key,type:"replace",attributes:ge.attributes}),this}}function attachNodeAttributesMerger(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);if(!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return assign$3(ge.attributes,ye),this.emit("nodeAttributesUpdated",{key:ge.key,type:"merge",attributes:ge.attributes,data:ye}),this}}function attachNodeAttributesUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){const[ge,ye]=findRelevantNodeData(this,oe,ce,ue,pe,me);if(typeof ye!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: provided updater is not a function.`);return ge.attributes=ye(ge.attributes),this.emit("nodeAttributesUpdated",{key:ge.key,type:"update",attributes:ge.attributes}),this}}const NODE_ATTRIBUTES_METHODS=[{name:ne=>`get${ne}Attribute`,attacher:attachNodeAttributeGetter},{name:ne=>`get${ne}Attributes`,attacher:attachNodeAttributesGetter},{name:ne=>`has${ne}Attribute`,attacher:attachNodeAttributeChecker},{name:ne=>`set${ne}Attribute`,attacher:attachNodeAttributeSetter},{name:ne=>`update${ne}Attribute`,attacher:attachNodeAttributeUpdater},{name:ne=>`remove${ne}Attribute`,attacher:attachNodeAttributeRemover},{name:ne=>`replace${ne}Attributes`,attacher:attachNodeAttributesReplacer},{name:ne=>`merge${ne}Attributes`,attacher:attachNodeAttributesMerger},{name:ne=>`update${ne}Attributes`,attacher:attachNodeAttributesUpdater}];function attachNodeAttributesMethods(ne){NODE_ATTRIBUTES_METHODS.forEach(function({name:oe,attacher:ce}){ce(ne,oe("Node"),NODE),ce(ne,oe("Source"),SOURCE),ce(ne,oe("Target"),TARGET),ce(ne,oe("Opposite"),OPPOSITE)})}function attachEdgeAttributeGetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return me.attributes[pe]}}function attachEdgeAttributesGetter(ne,oe,ce){ne.prototype[oe]=function(ue){let pe;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const me=""+ue,ge=""+arguments[1];if(pe=getMatchingEdge(this,me,ge,ce),!pe)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${me}" - "${ge}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,pe=this._edges.get(ue),!pe)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return pe.attributes}}function attachEdgeAttributeChecker(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return me.attributes.hasOwnProperty(pe)}}function attachEdgeAttributeSetter(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){let ge;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ye=""+ue,xe=""+pe;if(pe=arguments[2],me=arguments[3],ge=getMatchingEdge(this,ye,xe,ce),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ye}" - "${xe}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,ge=this._edges.get(ue),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return ge.attributes[pe]=me,this.emit("edgeAttributesUpdated",{key:ge.key,type:"set",attributes:ge.attributes,name:pe}),this}}function attachEdgeAttributeUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe,me){let ge;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ye=""+ue,xe=""+pe;if(pe=arguments[2],me=arguments[3],ge=getMatchingEdge(this,ye,xe,ce),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ye}" - "${xe}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,ge=this._edges.get(ue),!ge)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(typeof me!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: updater should be a function.`);return ge.attributes[pe]=me(ge.attributes[pe]),this.emit("edgeAttributesUpdated",{key:ge.key,type:"set",attributes:ge.attributes,name:pe}),this}}function attachEdgeAttributeRemover(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}return delete me.attributes[pe],this.emit("edgeAttributesUpdated",{key:me.key,type:"remove",attributes:me.attributes,name:pe}),this}}function attachEdgeAttributesReplacer(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(!isPlainObject$1(pe))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return me.attributes=pe,this.emit("edgeAttributesUpdated",{key:me.key,type:"replace",attributes:me.attributes}),this}}function attachEdgeAttributesMerger(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(!isPlainObject$1(pe))throw new InvalidArgumentsGraphError(`Graph.${oe}: provided attributes are not a plain object.`);return assign$3(me.attributes,pe),this.emit("edgeAttributesUpdated",{key:me.key,type:"merge",attributes:me.attributes,data:pe}),this}}function attachEdgeAttributesUpdater(ne,oe,ce){ne.prototype[oe]=function(ue,pe){let me;if(this.type!=="mixed"&&ce!=="mixed"&&ce!==this.type)throw new UsageGraphError(`Graph.${oe}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new UsageGraphError(`Graph.${oe}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const ge=""+ue,ye=""+pe;if(pe=arguments[2],me=getMatchingEdge(this,ge,ye,ce),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find an edge for the given path ("${ge}" - "${ye}").`)}else{if(ce!=="mixed")throw new UsageGraphError(`Graph.${oe}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(ue=""+ue,me=this._edges.get(ue),!me)throw new NotFoundGraphError(`Graph.${oe}: could not find the "${ue}" edge in the graph.`)}if(typeof pe!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: provided updater is not a function.`);return me.attributes=pe(me.attributes),this.emit("edgeAttributesUpdated",{key:me.key,type:"update",attributes:me.attributes}),this}}const EDGE_ATTRIBUTES_METHODS=[{name:ne=>`get${ne}Attribute`,attacher:attachEdgeAttributeGetter},{name:ne=>`get${ne}Attributes`,attacher:attachEdgeAttributesGetter},{name:ne=>`has${ne}Attribute`,attacher:attachEdgeAttributeChecker},{name:ne=>`set${ne}Attribute`,attacher:attachEdgeAttributeSetter},{name:ne=>`update${ne}Attribute`,attacher:attachEdgeAttributeUpdater},{name:ne=>`remove${ne}Attribute`,attacher:attachEdgeAttributeRemover},{name:ne=>`replace${ne}Attributes`,attacher:attachEdgeAttributesReplacer},{name:ne=>`merge${ne}Attributes`,attacher:attachEdgeAttributesMerger},{name:ne=>`update${ne}Attributes`,attacher:attachEdgeAttributesUpdater}];function attachEdgeAttributesMethods(ne){EDGE_ATTRIBUTES_METHODS.forEach(function({name:oe,attacher:ce}){ce(ne,oe("Edge"),"mixed"),ce(ne,oe("DirectedEdge"),"directed"),ce(ne,oe("UndirectedEdge"),"undirected")})}const EDGES_ITERATION=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function forEachSimple(ne,oe,ce,ue){let pe=!1;for(const me in oe){if(me===ue)continue;const ge=oe[me];if(pe=ce(ge.key,ge.attributes,ge.source.key,ge.target.key,ge.source.attributes,ge.target.attributes,ge.undirected),ne&&pe)return ge.key}}function forEachMulti(ne,oe,ce,ue){let pe,me,ge,ye=!1;for(const xe in oe)if(xe!==ue){pe=oe[xe];do{if(me=pe.source,ge=pe.target,ye=ce(pe.key,pe.attributes,me.key,ge.key,me.attributes,ge.attributes,pe.undirected),ne&&ye)return pe.key;pe=pe.next}while(pe!==void 0)}}function createIterator(ne,oe){const ce=Object.keys(ne),ue=ce.length;let pe,me=0;return new Iterator$3(function(){do if(pe)pe=pe.next;else{if(me>=ue)return{done:!0};const ye=ce[me++];if(ye===oe){pe=void 0;continue}pe=ne[ye]}while(!pe);return{done:!1,value:{edge:pe.key,attributes:pe.attributes,source:pe.source.key,target:pe.target.key,sourceAttributes:pe.source.attributes,targetAttributes:pe.target.attributes,undirected:pe.undirected}}})}function forEachForKeySimple(ne,oe,ce,ue){const pe=oe[ce];if(!pe)return;const me=pe.source,ge=pe.target;if(ue(pe.key,pe.attributes,me.key,ge.key,me.attributes,ge.attributes,pe.undirected)&&ne)return pe.key}function forEachForKeyMulti(ne,oe,ce,ue){let pe=oe[ce];if(!pe)return;let me=!1;do{if(me=ue(pe.key,pe.attributes,pe.source.key,pe.target.key,pe.source.attributes,pe.target.attributes,pe.undirected),ne&&me)return pe.key;pe=pe.next}while(pe!==void 0)}function createIteratorForKey(ne,oe){let ce=ne[oe];return ce.next!==void 0?new Iterator$3(function(){if(!ce)return{done:!0};const ue={edge:ce.key,attributes:ce.attributes,source:ce.source.key,target:ce.target.key,sourceAttributes:ce.source.attributes,targetAttributes:ce.target.attributes,undirected:ce.undirected};return ce=ce.next,{done:!1,value:ue}}):Iterator$3.of({edge:ce.key,attributes:ce.attributes,source:ce.source.key,target:ce.target.key,sourceAttributes:ce.source.attributes,targetAttributes:ce.target.attributes,undirected:ce.undirected})}function createEdgeArray(ne,oe){if(ne.size===0)return[];if(oe==="mixed"||oe===ne.type)return typeof Array.from=="function"?Array.from(ne._edges.keys()):take$1(ne._edges.keys(),ne._edges.size);const ce=oe==="undirected"?ne.undirectedSize:ne.directedSize,ue=new Array(ce),pe=oe==="undirected",me=ne._edges.values();let ge=0,ye,xe;for(;ye=me.next(),ye.done!==!0;)xe=ye.value,xe.undirected===pe&&(ue[ge++]=xe.key);return ue}function forEachEdge(ne,oe,ce,ue){if(oe.size===0)return;const pe=ce!=="mixed"&&ce!==oe.type,me=ce==="undirected";let ge,ye,xe=!1;const ve=oe._edges.values();for(;ge=ve.next(),ge.done!==!0;){if(ye=ge.value,pe&&ye.undirected!==me)continue;const{key:_e,attributes:we,source:Se,target:$e}=ye;if(xe=ue(_e,we,Se.key,$e.key,Se.attributes,$e.attributes,ye.undirected),ne&&xe)return _e}}function createEdgeIterator(ne,oe){if(ne.size===0)return Iterator$3.empty();const ce=oe!=="mixed"&&oe!==ne.type,ue=oe==="undirected",pe=ne._edges.values();return new Iterator$3(function(){let ge,ye;for(;;){if(ge=pe.next(),ge.done)return ge;if(ye=ge.value,!(ce&&ye.undirected!==ue))break}return{value:{edge:ye.key,attributes:ye.attributes,source:ye.source.key,target:ye.target.key,sourceAttributes:ye.source.attributes,targetAttributes:ye.target.attributes,undirected:ye.undirected},done:!1}})}function forEachEdgeForNode(ne,oe,ce,ue,pe,me){const ge=oe?forEachMulti:forEachSimple;let ye;if(ce!=="undirected"&&(ue!=="out"&&(ye=ge(ne,pe.in,me),ne&&ye)||ue!=="in"&&(ye=ge(ne,pe.out,me,ue?void 0:pe.key),ne&&ye))||ce!=="directed"&&(ye=ge(ne,pe.undirected,me),ne&&ye))return ye}function createEdgeArrayForNode(ne,oe,ce,ue){const pe=[];return forEachEdgeForNode(!1,ne,oe,ce,ue,function(me){pe.push(me)}),pe}function createEdgeIteratorForNode(ne,oe,ce){let ue=Iterator$3.empty();return ne!=="undirected"&&(oe!=="out"&&typeof ce.in<"u"&&(ue=chain$1(ue,createIterator(ce.in))),oe!=="in"&&typeof ce.out<"u"&&(ue=chain$1(ue,createIterator(ce.out,oe?void 0:ce.key)))),ne!=="directed"&&typeof ce.undirected<"u"&&(ue=chain$1(ue,createIterator(ce.undirected))),ue}function forEachEdgeForPath(ne,oe,ce,ue,pe,me,ge){const ye=ce?forEachForKeyMulti:forEachForKeySimple;let xe;if(oe!=="undirected"&&(typeof pe.in<"u"&&ue!=="out"&&(xe=ye(ne,pe.in,me,ge),ne&&xe)||typeof pe.out<"u"&&ue!=="in"&&(ue||pe.key!==me)&&(xe=ye(ne,pe.out,me,ge),ne&&xe))||oe!=="directed"&&typeof pe.undirected<"u"&&(xe=ye(ne,pe.undirected,me,ge),ne&&xe))return xe}function createEdgeArrayForPath(ne,oe,ce,ue,pe){const me=[];return forEachEdgeForPath(!1,ne,oe,ce,ue,pe,function(ge){me.push(ge)}),me}function createEdgeIteratorForPath(ne,oe,ce,ue){let pe=Iterator$3.empty();return ne!=="undirected"&&(typeof ce.in<"u"&&oe!=="out"&&ue in ce.in&&(pe=chain$1(pe,createIteratorForKey(ce.in,ue))),typeof ce.out<"u"&&oe!=="in"&&ue in ce.out&&(oe||ce.key!==ue)&&(pe=chain$1(pe,createIteratorForKey(ce.out,ue)))),ne!=="directed"&&typeof ce.undirected<"u"&&ue in ce.undirected&&(pe=chain$1(pe,createIteratorForKey(ce.undirected,ue))),pe}function attachEdgeArrayCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe;ne.prototype[ce]=function(me,ge){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return[];if(!arguments.length)return createEdgeArray(this,ue);if(arguments.length===1){me=""+me;const ye=this._nodes.get(me);if(typeof ye>"u")throw new NotFoundGraphError(`Graph.${ce}: could not find the "${me}" node in the graph.`);return createEdgeArrayForNode(this.multi,ue==="mixed"?this.type:ue,pe,ye)}if(arguments.length===2){me=""+me,ge=""+ge;const ye=this._nodes.get(me);if(!ye)throw new NotFoundGraphError(`Graph.${ce}: could not find the "${me}" source node in the graph.`);if(!this._nodes.has(ge))throw new NotFoundGraphError(`Graph.${ce}: could not find the "${ge}" target node in the graph.`);return createEdgeArrayForPath(ue,this.multi,pe,ye,ge)}throw new InvalidArgumentsGraphError(`Graph.${ce}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function attachForEachEdge(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me="forEach"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[me]=function(ve,_e,we){if(!(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)){if(arguments.length===1)return we=ve,forEachEdge(!1,this,ue,we);if(arguments.length===2){ve=""+ve,we=_e;const Se=this._nodes.get(ve);if(typeof Se>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" node in the graph.`);return forEachEdgeForNode(!1,this.multi,ue==="mixed"?this.type:ue,pe,Se,we)}if(arguments.length===3){ve=""+ve,_e=""+_e;const Se=this._nodes.get(ve);if(!Se)throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" source node in the graph.`);if(!this._nodes.has(_e))throw new NotFoundGraphError(`Graph.${me}: could not find the "${_e}" target node in the graph.`);return forEachEdgeForPath(!1,ue,this.multi,pe,Se,_e,we)}throw new InvalidArgumentsGraphError(`Graph.${me}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const ge="map"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ge]=function(){const ve=Array.prototype.slice.call(arguments),_e=ve.pop();let we;if(ve.length===0){let Se=0;ue!=="directed"&&(Se+=this.undirectedSize),ue!=="undirected"&&(Se+=this.directedSize),we=new Array(Se);let $e=0;ve.push((Te,Re,Ae,ke,Be,Ie,Ne)=>{we[$e++]=_e(Te,Re,Ae,ke,Be,Ie,Ne)})}else we=[],ve.push((Se,$e,Te,Re,Ae,ke,Be)=>{we.push(_e(Se,$e,Te,Re,Ae,ke,Be))});return this[me].apply(this,ve),we};const ye="filter"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ye]=function(){const ve=Array.prototype.slice.call(arguments),_e=ve.pop(),we=[];return ve.push((Se,$e,Te,Re,Ae,ke,Be)=>{_e(Se,$e,Te,Re,Ae,ke,Be)&&we.push(Se)}),this[me].apply(this,ve),we};const xe="reduce"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[xe]=function(){let ve=Array.prototype.slice.call(arguments);if(ve.length<2||ve.length>4)throw new InvalidArgumentsGraphError(`Graph.${xe}: invalid number of arguments (expecting 2, 3 or 4 and got ${ve.length}).`);if(typeof ve[ve.length-1]=="function"&&typeof ve[ve.length-2]!="function")throw new InvalidArgumentsGraphError(`Graph.${xe}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let _e,we;ve.length===2?(_e=ve[0],we=ve[1],ve=[]):ve.length===3?(_e=ve[1],we=ve[2],ve=[ve[0]]):ve.length===4&&(_e=ve[2],we=ve[3],ve=[ve[0],ve[1]]);let Se=we;return ve.push(($e,Te,Re,Ae,ke,Be,Ie)=>{Se=_e(Se,$e,Te,Re,Ae,ke,Be,Ie)}),this[me].apply(this,ve),Se}}function attachFindEdge(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me="find"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[me]=function(xe,ve,_e){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return!1;if(arguments.length===1)return _e=xe,forEachEdge(!0,this,ue,_e);if(arguments.length===2){xe=""+xe,_e=ve;const we=this._nodes.get(xe);if(typeof we>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${xe}" node in the graph.`);return forEachEdgeForNode(!0,this.multi,ue==="mixed"?this.type:ue,pe,we,_e)}if(arguments.length===3){xe=""+xe,ve=""+ve;const we=this._nodes.get(xe);if(!we)throw new NotFoundGraphError(`Graph.${me}: could not find the "${xe}" source node in the graph.`);if(!this._nodes.has(ve))throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" target node in the graph.`);return forEachEdgeForPath(!0,ue,this.multi,pe,we,ve,_e)}throw new InvalidArgumentsGraphError(`Graph.${me}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const ge="some"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[ge]=function(){const xe=Array.prototype.slice.call(arguments),ve=xe.pop();return xe.push((we,Se,$e,Te,Re,Ae,ke)=>ve(we,Se,$e,Te,Re,Ae,ke)),!!this[me].apply(this,xe)};const ye="every"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[ye]=function(){const xe=Array.prototype.slice.call(arguments),ve=xe.pop();return xe.push((we,Se,$e,Te,Re,Ae,ke)=>!ve(we,Se,$e,Te,Re,Ae,ke)),!this[me].apply(this,xe)}}function attachEdgeIteratorCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me=ce.slice(0,-1)+"Entries";ne.prototype[me]=function(ge,ye){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return Iterator$3.empty();if(!arguments.length)return createEdgeIterator(this,ue);if(arguments.length===1){ge=""+ge;const xe=this._nodes.get(ge);if(!xe)throw new NotFoundGraphError(`Graph.${me}: could not find the "${ge}" node in the graph.`);return createEdgeIteratorForNode(ue,pe,xe)}if(arguments.length===2){ge=""+ge,ye=""+ye;const xe=this._nodes.get(ge);if(!xe)throw new NotFoundGraphError(`Graph.${me}: could not find the "${ge}" source node in the graph.`);if(!this._nodes.has(ye))throw new NotFoundGraphError(`Graph.${me}: could not find the "${ye}" target node in the graph.`);return createEdgeIteratorForPath(ue,pe,xe,ye)}throw new InvalidArgumentsGraphError(`Graph.${me}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function attachEdgeIterationMethods(ne){EDGES_ITERATION.forEach(oe=>{attachEdgeArrayCreator(ne,oe),attachForEachEdge(ne,oe),attachFindEdge(ne,oe),attachEdgeIteratorCreator(ne,oe)})}const NEIGHBORS_ITERATION=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function CompositeSetWrapper(){this.A=null,this.B=null}CompositeSetWrapper.prototype.wrap=function(ne){this.A===null?this.A=ne:this.B===null&&(this.B=ne)};CompositeSetWrapper.prototype.has=function(ne){return this.A!==null&&ne in this.A||this.B!==null&&ne in this.B};function forEachInObjectOnce(ne,oe,ce,ue,pe){for(const me in ue){const ge=ue[me],ye=ge.source,xe=ge.target,ve=ye===ce?xe:ye;if(oe&&oe.has(ve.key))continue;const _e=pe(ve.key,ve.attributes);if(ne&&_e)return ve.key}}function forEachNeighbor(ne,oe,ce,ue,pe){if(oe!=="mixed"){if(oe==="undirected")return forEachInObjectOnce(ne,null,ue,ue.undirected,pe);if(typeof ce=="string")return forEachInObjectOnce(ne,null,ue,ue[ce],pe)}const me=new CompositeSetWrapper;let ge;if(oe!=="undirected"){if(ce!=="out"){if(ge=forEachInObjectOnce(ne,null,ue,ue.in,pe),ne&&ge)return ge;me.wrap(ue.in)}if(ce!=="in"){if(ge=forEachInObjectOnce(ne,me,ue,ue.out,pe),ne&&ge)return ge;me.wrap(ue.out)}}if(oe!=="directed"&&(ge=forEachInObjectOnce(ne,me,ue,ue.undirected,pe),ne&&ge))return ge}function createNeighborArrayForNode(ne,oe,ce){if(ne!=="mixed"){if(ne==="undirected")return Object.keys(ce.undirected);if(typeof oe=="string")return Object.keys(ce[oe])}const ue=[];return forEachNeighbor(!1,ne,oe,ce,function(pe){ue.push(pe)}),ue}function createDedupedObjectIterator(ne,oe,ce){const ue=Object.keys(ce),pe=ue.length;let me=0;return new Iterator$3(function(){let ye=null;do{if(me>=pe)return ne&&ne.wrap(ce),{done:!0};const xe=ce[ue[me++]],ve=xe.source,_e=xe.target;if(ye=ve===oe?_e:ve,ne&&ne.has(ye.key)){ye=null;continue}}while(ye===null);return{done:!1,value:{neighbor:ye.key,attributes:ye.attributes}}})}function createNeighborIterator(ne,oe,ce){if(ne!=="mixed"){if(ne==="undirected")return createDedupedObjectIterator(null,ce,ce.undirected);if(typeof oe=="string")return createDedupedObjectIterator(null,ce,ce[oe])}let ue=Iterator$3.empty();const pe=new CompositeSetWrapper;return ne!=="undirected"&&(oe!=="out"&&(ue=chain$1(ue,createDedupedObjectIterator(pe,ce,ce.in))),oe!=="in"&&(ue=chain$1(ue,createDedupedObjectIterator(pe,ce,ce.out)))),ne!=="directed"&&(ue=chain$1(ue,createDedupedObjectIterator(pe,ce,ce.undirected))),ue}function attachNeighborArrayCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe;ne.prototype[ce]=function(me){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return[];me=""+me;const ge=this._nodes.get(me);if(typeof ge>"u")throw new NotFoundGraphError(`Graph.${ce}: could not find the "${me}" node in the graph.`);return createNeighborArrayForNode(ue==="mixed"?this.type:ue,pe,ge)}}function attachForEachNeighbor(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me="forEach"+ce[0].toUpperCase()+ce.slice(1,-1);ne.prototype[me]=function(ve,_e){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return;ve=""+ve;const we=this._nodes.get(ve);if(typeof we>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${ve}" node in the graph.`);forEachNeighbor(!1,ue==="mixed"?this.type:ue,pe,we,_e)};const ge="map"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ge]=function(ve,_e){const we=[];return this[me](ve,(Se,$e)=>{we.push(_e(Se,$e))}),we};const ye="filter"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[ye]=function(ve,_e){const we=[];return this[me](ve,(Se,$e)=>{_e(Se,$e)&&we.push(Se)}),we};const xe="reduce"+ce[0].toUpperCase()+ce.slice(1);ne.prototype[xe]=function(ve,_e,we){if(arguments.length<3)throw new InvalidArgumentsGraphError(`Graph.${xe}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let Se=we;return this[me](ve,($e,Te)=>{Se=_e(Se,$e,Te)}),Se}}function attachFindNeighbor(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me=ce[0].toUpperCase()+ce.slice(1,-1),ge="find"+me;ne.prototype[ge]=function(ve,_e){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return;ve=""+ve;const we=this._nodes.get(ve);if(typeof we>"u")throw new NotFoundGraphError(`Graph.${ge}: could not find the "${ve}" node in the graph.`);return forEachNeighbor(!0,ue==="mixed"?this.type:ue,pe,we,_e)};const ye="some"+me;ne.prototype[ye]=function(ve,_e){return!!this[ge](ve,_e)};const xe="every"+me;ne.prototype[xe]=function(ve,_e){return!this[ge](ve,(Se,$e)=>!_e(Se,$e))}}function attachNeighborIteratorCreator(ne,oe){const{name:ce,type:ue,direction:pe}=oe,me=ce.slice(0,-1)+"Entries";ne.prototype[me]=function(ge){if(ue!=="mixed"&&this.type!=="mixed"&&ue!==this.type)return Iterator$3.empty();ge=""+ge;const ye=this._nodes.get(ge);if(typeof ye>"u")throw new NotFoundGraphError(`Graph.${me}: could not find the "${ge}" node in the graph.`);return createNeighborIterator(ue==="mixed"?this.type:ue,pe,ye)}}function attachNeighborIterationMethods(ne){NEIGHBORS_ITERATION.forEach(oe=>{attachNeighborArrayCreator(ne,oe),attachForEachNeighbor(ne,oe),attachFindNeighbor(ne,oe),attachNeighborIteratorCreator(ne,oe)})}function forEachAdjacency(ne,oe,ce,ue,pe){const me=ue._nodes.values(),ge=ue.type;let ye,xe,ve,_e,we,Se;for(;ye=me.next(),ye.done!==!0;){let $e=!1;if(xe=ye.value,ge!=="undirected"){_e=xe.out;for(ve in _e){we=_e[ve];do Se=we.target,$e=!0,pe(xe.key,Se.key,xe.attributes,Se.attributes,we.key,we.attributes,we.undirected),we=we.next;while(we)}}if(ge!=="directed"){_e=xe.undirected;for(ve in _e)if(!(oe&&xe.key>ve)){we=_e[ve];do Se=we.target,Se.key!==ve&&(Se=we.source),$e=!0,pe(xe.key,Se.key,xe.attributes,Se.attributes,we.key,we.attributes,we.undirected),we=we.next;while(we)}}ce&&!$e&&pe(xe.key,null,xe.attributes,null,null,null,null)}}function serializeNode(ne,oe){const ce={key:ne};return isEmpty$2(oe.attributes)||(ce.attributes=assign$3({},oe.attributes)),ce}function serializeEdge(ne,oe,ce){const ue={key:oe,source:ce.source.key,target:ce.target.key};return isEmpty$2(ce.attributes)||(ue.attributes=assign$3({},ce.attributes)),ne==="mixed"&&ce.undirected&&(ue.undirected=!0),ue}function validateSerializedNode(ne){if(!isPlainObject$1(ne))throw new InvalidArgumentsGraphError('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in ne))throw new InvalidArgumentsGraphError("Graph.import: serialized node is missing its key.");if("attributes"in ne&&(!isPlainObject$1(ne.attributes)||ne.attributes===null))throw new InvalidArgumentsGraphError("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function validateSerializedEdge(ne){if(!isPlainObject$1(ne))throw new InvalidArgumentsGraphError('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in ne))throw new InvalidArgumentsGraphError("Graph.import: serialized edge is missing its source.");if(!("target"in ne))throw new InvalidArgumentsGraphError("Graph.import: serialized edge is missing its target.");if("attributes"in ne&&(!isPlainObject$1(ne.attributes)||ne.attributes===null))throw new InvalidArgumentsGraphError("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in ne&&typeof ne.undirected!="boolean")throw new InvalidArgumentsGraphError("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const INSTANCE_ID=incrementalIdStartingFromRandomByte(),TYPES$1=new Set(["directed","undirected","mixed"]),EMITTER_PROPS=new Set(["domain","_events","_eventsCount","_maxListeners"]),EDGE_ADD_METHODS=[{name:ne=>`${ne}Edge`,generateKey:!0},{name:ne=>`${ne}DirectedEdge`,generateKey:!0,type:"directed"},{name:ne=>`${ne}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:ne=>`${ne}EdgeWithKey`},{name:ne=>`${ne}DirectedEdgeWithKey`,type:"directed"},{name:ne=>`${ne}UndirectedEdgeWithKey`,type:"undirected"}],DEFAULTS={allowSelfLoops:!0,multi:!1,type:"mixed"};function addNode(ne,oe,ce){if(ce&&!isPlainObject$1(ce))throw new InvalidArgumentsGraphError(`Graph.addNode: invalid attributes. Expecting an object but got "${ce}"`);if(oe=""+oe,ce=ce||{},ne._nodes.has(oe))throw new UsageGraphError(`Graph.addNode: the "${oe}" node already exist in the graph.`);const ue=new ne.NodeDataClass(oe,ce);return ne._nodes.set(oe,ue),ne.emit("nodeAdded",{key:oe,attributes:ce}),ue}function unsafeAddNode(ne,oe,ce){const ue=new ne.NodeDataClass(oe,ce);return ne._nodes.set(oe,ue),ne.emit("nodeAdded",{key:oe,attributes:ce}),ue}function addEdge(ne,oe,ce,ue,pe,me,ge,ye){if(!ue&&ne.type==="undirected")throw new UsageGraphError(`Graph.${oe}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(ue&&ne.type==="directed")throw new UsageGraphError(`Graph.${oe}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(ye&&!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: invalid attributes. Expecting an object but got "${ye}"`);if(me=""+me,ge=""+ge,ye=ye||{},!ne.allowSelfLoops&&me===ge)throw new UsageGraphError(`Graph.${oe}: source & target are the same ("${me}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const xe=ne._nodes.get(me),ve=ne._nodes.get(ge);if(!xe)throw new NotFoundGraphError(`Graph.${oe}: source node "${me}" not found.`);if(!ve)throw new NotFoundGraphError(`Graph.${oe}: target node "${ge}" not found.`);const _e={key:null,undirected:ue,source:me,target:ge,attributes:ye};if(ce)pe=ne._edgeKeyGenerator();else if(pe=""+pe,ne._edges.has(pe))throw new UsageGraphError(`Graph.${oe}: the "${pe}" edge already exists in the graph.`);if(!ne.multi&&(ue?typeof xe.undirected[ge]<"u":typeof xe.out[ge]<"u"))throw new UsageGraphError(`Graph.${oe}: an edge linking "${me}" to "${ge}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const we=new EdgeData(ue,pe,xe,ve,ye);ne._edges.set(pe,we);const Se=me===ge;return ue?(xe.undirectedDegree++,ve.undirectedDegree++,Se&&(xe.undirectedLoops++,ne._undirectedSelfLoopCount++)):(xe.outDegree++,ve.inDegree++,Se&&(xe.directedLoops++,ne._directedSelfLoopCount++)),ne.multi?we.attachMulti():we.attach(),ue?ne._undirectedSize++:ne._directedSize++,_e.key=pe,ne.emit("edgeAdded",_e),pe}function mergeEdge(ne,oe,ce,ue,pe,me,ge,ye,xe){if(!ue&&ne.type==="undirected")throw new UsageGraphError(`Graph.${oe}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(ue&&ne.type==="directed")throw new UsageGraphError(`Graph.${oe}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(ye){if(xe){if(typeof ye!="function")throw new InvalidArgumentsGraphError(`Graph.${oe}: invalid updater function. Expecting a function but got "${ye}"`)}else if(!isPlainObject$1(ye))throw new InvalidArgumentsGraphError(`Graph.${oe}: invalid attributes. Expecting an object but got "${ye}"`)}me=""+me,ge=""+ge;let ve;if(xe&&(ve=ye,ye=void 0),!ne.allowSelfLoops&&me===ge)throw new UsageGraphError(`Graph.${oe}: source & target are the same ("${me}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let _e=ne._nodes.get(me),we=ne._nodes.get(ge),Se,$e;if(!ce&&(Se=ne._edges.get(pe),Se)){if((Se.source.key!==me||Se.target.key!==ge)&&(!ue||Se.source.key!==ge||Se.target.key!==me))throw new UsageGraphError(`Graph.${oe}: inconsistency detected when attempting to merge the "${pe}" edge with "${me}" source & "${ge}" target vs. ("${Se.source.key}", "${Se.target.key}").`);$e=Se}if(!$e&&!ne.multi&&_e&&($e=ue?_e.undirected[ge]:_e.out[ge]),$e){const Be=[$e.key,!1,!1,!1];if(xe?!ve:!ye)return Be;if(xe){const Ie=$e.attributes;$e.attributes=ve(Ie),ne.emit("edgeAttributesUpdated",{type:"replace",key:$e.key,attributes:$e.attributes})}else assign$3($e.attributes,ye),ne.emit("edgeAttributesUpdated",{type:"merge",key:$e.key,attributes:$e.attributes,data:ye});return Be}ye=ye||{},xe&&ve&&(ye=ve(ye));const Te={key:null,undirected:ue,source:me,target:ge,attributes:ye};if(ce)pe=ne._edgeKeyGenerator();else if(pe=""+pe,ne._edges.has(pe))throw new UsageGraphError(`Graph.${oe}: the "${pe}" edge already exists in the graph.`);let Re=!1,Ae=!1;_e||(_e=unsafeAddNode(ne,me,{}),Re=!0,me===ge&&(we=_e,Ae=!0)),we||(we=unsafeAddNode(ne,ge,{}),Ae=!0),Se=new EdgeData(ue,pe,_e,we,ye),ne._edges.set(pe,Se);const ke=me===ge;return ue?(_e.undirectedDegree++,we.undirectedDegree++,ke&&(_e.undirectedLoops++,ne._undirectedSelfLoopCount++)):(_e.outDegree++,we.inDegree++,ke&&(_e.directedLoops++,ne._directedSelfLoopCount++)),ne.multi?Se.attachMulti():Se.attach(),ue?ne._undirectedSize++:ne._directedSize++,Te.key=pe,ne.emit("edgeAdded",Te),[pe,!0,Re,Ae]}function dropEdgeFromData(ne,oe){ne._edges.delete(oe.key);const{source:ce,target:ue,attributes:pe}=oe,me=oe.undirected,ge=ce===ue;me?(ce.undirectedDegree--,ue.undirectedDegree--,ge&&(ce.undirectedLoops--,ne._undirectedSelfLoopCount--)):(ce.outDegree--,ue.inDegree--,ge&&(ce.directedLoops--,ne._directedSelfLoopCount--)),ne.multi?oe.detachMulti():oe.detach(),me?ne._undirectedSize--:ne._directedSize--,ne.emit("edgeDropped",{key:oe.key,attributes:pe,source:ce.key,target:ue.key,undirected:me})}class Graph extends eventsExports.EventEmitter{constructor(oe){if(super(),oe=assign$3({},DEFAULTS,oe),typeof oe.multi!="boolean")throw new InvalidArgumentsGraphError(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${oe.multi}".`);if(!TYPES$1.has(oe.type))throw new InvalidArgumentsGraphError(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${oe.type}".`);if(typeof oe.allowSelfLoops!="boolean")throw new InvalidArgumentsGraphError(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${oe.allowSelfLoops}".`);const ce=oe.type==="mixed"?MixedNodeData:oe.type==="directed"?DirectedNodeData:UndirectedNodeData;privateProperty(this,"NodeDataClass",ce);const ue="geid_"+INSTANCE_ID()+"_";let pe=0;const me=()=>{let ge;do ge=ue+pe++;while(this._edges.has(ge));return ge};privateProperty(this,"_attributes",{}),privateProperty(this,"_nodes",new Map),privateProperty(this,"_edges",new Map),privateProperty(this,"_directedSize",0),privateProperty(this,"_undirectedSize",0),privateProperty(this,"_directedSelfLoopCount",0),privateProperty(this,"_undirectedSelfLoopCount",0),privateProperty(this,"_edgeKeyGenerator",me),privateProperty(this,"_options",oe),EMITTER_PROPS.forEach(ge=>privateProperty(this,ge,this[ge])),readOnlyProperty(this,"order",()=>this._nodes.size),readOnlyProperty(this,"size",()=>this._edges.size),readOnlyProperty(this,"directedSize",()=>this._directedSize),readOnlyProperty(this,"undirectedSize",()=>this._undirectedSize),readOnlyProperty(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),readOnlyProperty(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),readOnlyProperty(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),readOnlyProperty(this,"multi",this._options.multi),readOnlyProperty(this,"type",this._options.type),readOnlyProperty(this,"allowSelfLoops",this._options.allowSelfLoops),readOnlyProperty(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(oe){return this._nodes.has(""+oe)}hasDirectedEdge(oe,ce){if(this.type==="undirected")return!1;if(arguments.length===1){const ue=""+oe,pe=this._edges.get(ue);return!!pe&&!pe.undirected}else if(arguments.length===2){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);return ue?ue.out.hasOwnProperty(ce):!1}throw new InvalidArgumentsGraphError(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(oe,ce){if(this.type==="directed")return!1;if(arguments.length===1){const ue=""+oe,pe=this._edges.get(ue);return!!pe&&pe.undirected}else if(arguments.length===2){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);return ue?ue.undirected.hasOwnProperty(ce):!1}throw new InvalidArgumentsGraphError(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(oe,ce){if(arguments.length===1){const ue=""+oe;return this._edges.has(ue)}else if(arguments.length===2){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);return ue?typeof ue.out<"u"&&ue.out.hasOwnProperty(ce)||typeof ue.undirected<"u"&&ue.undirected.hasOwnProperty(ce):!1}throw new InvalidArgumentsGraphError(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(oe,ce){if(this.type==="undirected")return;if(oe=""+oe,ce=""+ce,this.multi)throw new UsageGraphError("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.directedEdge: could not find the "${oe}" source node in the graph.`);if(!this._nodes.has(ce))throw new NotFoundGraphError(`Graph.directedEdge: could not find the "${ce}" target node in the graph.`);const pe=ue.out&&ue.out[ce]||void 0;if(pe)return pe.key}undirectedEdge(oe,ce){if(this.type==="directed")return;if(oe=""+oe,ce=""+ce,this.multi)throw new UsageGraphError("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.undirectedEdge: could not find the "${oe}" source node in the graph.`);if(!this._nodes.has(ce))throw new NotFoundGraphError(`Graph.undirectedEdge: could not find the "${ce}" target node in the graph.`);const pe=ue.undirected&&ue.undirected[ce]||void 0;if(pe)return pe.key}edge(oe,ce){if(this.multi)throw new UsageGraphError("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.edge: could not find the "${oe}" source node in the graph.`);if(!this._nodes.has(ce))throw new NotFoundGraphError(`Graph.edge: could not find the "${ce}" target node in the graph.`);const pe=ue.out&&ue.out[ce]||ue.undirected&&ue.undirected[ce]||void 0;if(pe)return pe.key}areDirectedNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areDirectedNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?!1:ce in ue.in||ce in ue.out}areOutNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areOutNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?!1:ce in ue.out}areInNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areInNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?!1:ce in ue.in}areUndirectedNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areUndirectedNeighbors: could not find the "${oe}" node in the graph.`);return this.type==="directed"?!1:ce in ue.undirected}areNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areNeighbors: could not find the "${oe}" node in the graph.`);return this.type!=="undirected"&&(ce in ue.in||ce in ue.out)||this.type!=="directed"&&ce in ue.undirected}areInboundNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areInboundNeighbors: could not find the "${oe}" node in the graph.`);return this.type!=="undirected"&&ce in ue.in||this.type!=="directed"&&ce in ue.undirected}areOutboundNeighbors(oe,ce){oe=""+oe,ce=""+ce;const ue=this._nodes.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.areOutboundNeighbors: could not find the "${oe}" node in the graph.`);return this.type!=="undirected"&&ce in ue.out||this.type!=="directed"&&ce in ue.undirected}inDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inDegree: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree}outDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outDegree: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.outDegree}directedDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.directedDegree: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree+ce.outDegree}undirectedDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.undirectedDegree: could not find the "${oe}" node in the graph.`);return this.type==="directed"?0:ce.undirectedDegree}inboundDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inboundDegree: could not find the "${oe}" node in the graph.`);let ue=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree),this.type!=="undirected"&&(ue+=ce.inDegree),ue}outboundDegree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outboundDegree: could not find the "${oe}" node in the graph.`);let ue=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree),this.type!=="undirected"&&(ue+=ce.outDegree),ue}degree(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.degree: could not find the "${oe}" node in the graph.`);let ue=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree),this.type!=="undirected"&&(ue+=ce.inDegree+ce.outDegree),ue}inDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree-ce.directedLoops}outDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.outDegree-ce.directedLoops}directedDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.directedDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="undirected"?0:ce.inDegree+ce.outDegree-ce.directedLoops*2}undirectedDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);return this.type==="directed"?0:ce.undirectedDegree-ce.undirectedLoops*2}inboundDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);let ue=0,pe=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree,pe+=ce.undirectedLoops*2),this.type!=="undirected"&&(ue+=ce.inDegree,pe+=ce.directedLoops),ue-pe}outboundDegreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);let ue=0,pe=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree,pe+=ce.undirectedLoops*2),this.type!=="undirected"&&(ue+=ce.outDegree,pe+=ce.directedLoops),ue-pe}degreeWithoutSelfLoops(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.degreeWithoutSelfLoops: could not find the "${oe}" node in the graph.`);let ue=0,pe=0;return this.type!=="directed"&&(ue+=ce.undirectedDegree,pe+=ce.undirectedLoops*2),this.type!=="undirected"&&(ue+=ce.inDegree+ce.outDegree,pe+=ce.directedLoops*2),ue-pe}source(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.source: could not find the "${oe}" edge in the graph.`);return ce.source.key}target(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.target: could not find the "${oe}" edge in the graph.`);return ce.target.key}extremities(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.extremities: could not find the "${oe}" edge in the graph.`);return[ce.source.key,ce.target.key]}opposite(oe,ce){oe=""+oe,ce=""+ce;const ue=this._edges.get(ce);if(!ue)throw new NotFoundGraphError(`Graph.opposite: could not find the "${ce}" edge in the graph.`);const pe=ue.source.key,me=ue.target.key;if(oe===pe)return me;if(oe===me)return pe;throw new NotFoundGraphError(`Graph.opposite: the "${oe}" node is not attached to the "${ce}" edge (${pe}, ${me}).`)}hasExtremity(oe,ce){oe=""+oe,ce=""+ce;const ue=this._edges.get(oe);if(!ue)throw new NotFoundGraphError(`Graph.hasExtremity: could not find the "${oe}" edge in the graph.`);return ue.source.key===ce||ue.target.key===ce}isUndirected(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.isUndirected: could not find the "${oe}" edge in the graph.`);return ce.undirected}isDirected(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.isDirected: could not find the "${oe}" edge in the graph.`);return!ce.undirected}isSelfLoop(oe){oe=""+oe;const ce=this._edges.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.isSelfLoop: could not find the "${oe}" edge in the graph.`);return ce.source===ce.target}addNode(oe,ce){return addNode(this,oe,ce).key}mergeNode(oe,ce){if(ce&&!isPlainObject$1(ce))throw new InvalidArgumentsGraphError(`Graph.mergeNode: invalid attributes. Expecting an object but got "${ce}"`);oe=""+oe,ce=ce||{};let ue=this._nodes.get(oe);return ue?(ce&&(assign$3(ue.attributes,ce),this.emit("nodeAttributesUpdated",{type:"merge",key:oe,attributes:ue.attributes,data:ce})),[oe,!1]):(ue=new this.NodeDataClass(oe,ce),this._nodes.set(oe,ue),this.emit("nodeAdded",{key:oe,attributes:ce}),[oe,!0])}updateNode(oe,ce){if(ce&&typeof ce!="function")throw new InvalidArgumentsGraphError(`Graph.updateNode: invalid updater function. Expecting a function but got "${ce}"`);oe=""+oe;let ue=this._nodes.get(oe);if(ue){if(ce){const me=ue.attributes;ue.attributes=ce(me),this.emit("nodeAttributesUpdated",{type:"replace",key:oe,attributes:ue.attributes})}return[oe,!1]}const pe=ce?ce({}):{};return ue=new this.NodeDataClass(oe,pe),this._nodes.set(oe,ue),this.emit("nodeAdded",{key:oe,attributes:pe}),[oe,!0]}dropNode(oe){oe=""+oe;const ce=this._nodes.get(oe);if(!ce)throw new NotFoundGraphError(`Graph.dropNode: could not find the "${oe}" node in the graph.`);let ue;if(this.type!=="undirected"){for(const pe in ce.out){ue=ce.out[pe];do dropEdgeFromData(this,ue),ue=ue.next;while(ue)}for(const pe in ce.in){ue=ce.in[pe];do dropEdgeFromData(this,ue),ue=ue.next;while(ue)}}if(this.type!=="directed")for(const pe in ce.undirected){ue=ce.undirected[pe];do dropEdgeFromData(this,ue),ue=ue.next;while(ue)}this._nodes.delete(oe),this.emit("nodeDropped",{key:oe,attributes:ce.attributes})}dropEdge(oe){let ce;if(arguments.length>1){const ue=""+arguments[0],pe=""+arguments[1];if(ce=getMatchingEdge(this,ue,pe,this.type),!ce)throw new NotFoundGraphError(`Graph.dropEdge: could not find the "${ue}" -> "${pe}" edge in the graph.`)}else if(oe=""+oe,ce=this._edges.get(oe),!ce)throw new NotFoundGraphError(`Graph.dropEdge: could not find the "${oe}" edge in the graph.`);return dropEdgeFromData(this,ce),this}dropDirectedEdge(oe,ce){if(arguments.length<2)throw new UsageGraphError("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new UsageGraphError("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");oe=""+oe,ce=""+ce;const ue=getMatchingEdge(this,oe,ce,"directed");if(!ue)throw new NotFoundGraphError(`Graph.dropDirectedEdge: could not find a "${oe}" -> "${ce}" edge in the graph.`);return dropEdgeFromData(this,ue),this}dropUndirectedEdge(oe,ce){if(arguments.length<2)throw new UsageGraphError("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new UsageGraphError("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const ue=getMatchingEdge(this,oe,ce,"undirected");if(!ue)throw new NotFoundGraphError(`Graph.dropUndirectedEdge: could not find a "${oe}" -> "${ce}" edge in the graph.`);return dropEdgeFromData(this,ue),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const oe=this._nodes.values();let ce;for(;ce=oe.next(),ce.done!==!0;)ce.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(oe){return this._attributes[oe]}getAttributes(){return this._attributes}hasAttribute(oe){return this._attributes.hasOwnProperty(oe)}setAttribute(oe,ce){return this._attributes[oe]=ce,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:oe}),this}updateAttribute(oe,ce){if(typeof ce!="function")throw new InvalidArgumentsGraphError("Graph.updateAttribute: updater should be a function.");const ue=this._attributes[oe];return this._attributes[oe]=ce(ue),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:oe}),this}removeAttribute(oe){return delete this._attributes[oe],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:oe}),this}replaceAttributes(oe){if(!isPlainObject$1(oe))throw new InvalidArgumentsGraphError("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=oe,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(oe){if(!isPlainObject$1(oe))throw new InvalidArgumentsGraphError("Graph.mergeAttributes: provided attributes are not a plain object.");return assign$3(this._attributes,oe),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:oe}),this}updateAttributes(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.updateAttributes: provided updater is not a function.");return this._attributes=oe(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(oe,ce){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.updateEachNodeAttributes: expecting an updater function.");if(ce&&!validateHints(ce))throw new InvalidArgumentsGraphError("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const ue=this._nodes.values();let pe,me;for(;pe=ue.next(),pe.done!==!0;)me=pe.value,me.attributes=oe(me.key,me.attributes);this.emit("eachNodeAttributesUpdated",{hints:ce||null})}updateEachEdgeAttributes(oe,ce){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.updateEachEdgeAttributes: expecting an updater function.");if(ce&&!validateHints(ce))throw new InvalidArgumentsGraphError("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const ue=this._edges.values();let pe,me,ge,ye;for(;pe=ue.next(),pe.done!==!0;)me=pe.value,ge=me.source,ye=me.target,me.attributes=oe(me.key,me.attributes,ge.key,ye.key,ge.attributes,ye.attributes,me.undirected);this.emit("eachEdgeAttributesUpdated",{hints:ce||null})}forEachAdjacencyEntry(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAdjacencyEntry: expecting a callback.");forEachAdjacency(!1,!1,!1,this,oe)}forEachAdjacencyEntryWithOrphans(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");forEachAdjacency(!1,!1,!0,this,oe)}forEachAssymetricAdjacencyEntry(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");forEachAdjacency(!1,!0,!1,this,oe)}forEachAssymetricAdjacencyEntryWithOrphans(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");forEachAdjacency(!1,!0,!0,this,oe)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):take$1(this._nodes.keys(),this._nodes.size)}forEachNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.forEachNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)pe=ue.value,oe(pe.key,pe.attributes)}findNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.findNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)if(pe=ue.value,oe(pe.key,pe.attributes))return pe.key}mapNodes(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.mapNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;const me=new Array(this.order);let ge=0;for(;ue=ce.next(),ue.done!==!0;)pe=ue.value,me[ge++]=oe(pe.key,pe.attributes);return me}someNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.someNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)if(pe=ue.value,oe(pe.key,pe.attributes))return!0;return!1}everyNode(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.everyNode: expecting a callback.");const ce=this._nodes.values();let ue,pe;for(;ue=ce.next(),ue.done!==!0;)if(pe=ue.value,!oe(pe.key,pe.attributes))return!1;return!0}filterNodes(oe){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.filterNodes: expecting a callback.");const ce=this._nodes.values();let ue,pe;const me=[];for(;ue=ce.next(),ue.done!==!0;)pe=ue.value,oe(pe.key,pe.attributes)&&me.push(pe.key);return me}reduceNodes(oe,ce){if(typeof oe!="function")throw new InvalidArgumentsGraphError("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new InvalidArgumentsGraphError("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let ue=ce;const pe=this._nodes.values();let me,ge;for(;me=pe.next(),me.done!==!0;)ge=me.value,ue=oe(ue,ge.key,ge.attributes);return ue}nodeEntries(){const oe=this._nodes.values();return new Iterator$3(()=>{const ce=oe.next();if(ce.done)return ce;const ue=ce.value;return{value:{node:ue.key,attributes:ue.attributes},done:!1}})}export(){const oe=new Array(this._nodes.size);let ce=0;this._nodes.forEach((pe,me)=>{oe[ce++]=serializeNode(me,pe)});const ue=new Array(this._edges.size);return ce=0,this._edges.forEach((pe,me)=>{ue[ce++]=serializeEdge(this.type,me,pe)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:oe,edges:ue}}import(oe,ce=!1){if(oe instanceof Graph)return oe.forEachNode((xe,ve)=>{ce?this.mergeNode(xe,ve):this.addNode(xe,ve)}),oe.forEachEdge((xe,ve,_e,we,Se,$e,Te)=>{ce?Te?this.mergeUndirectedEdgeWithKey(xe,_e,we,ve):this.mergeDirectedEdgeWithKey(xe,_e,we,ve):Te?this.addUndirectedEdgeWithKey(xe,_e,we,ve):this.addDirectedEdgeWithKey(xe,_e,we,ve)}),this;if(!isPlainObject$1(oe))throw new InvalidArgumentsGraphError("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(oe.attributes){if(!isPlainObject$1(oe.attributes))throw new InvalidArgumentsGraphError("Graph.import: invalid attributes. Expecting a plain object.");ce?this.mergeAttributes(oe.attributes):this.replaceAttributes(oe.attributes)}let ue,pe,me,ge,ye;if(oe.nodes){if(me=oe.nodes,!Array.isArray(me))throw new InvalidArgumentsGraphError("Graph.import: invalid nodes. Expecting an array.");for(ue=0,pe=me.length;ue{const me=assign$3({},ue.attributes);ue=new ce.NodeDataClass(pe,me),ce._nodes.set(pe,ue)}),ce}copy(oe){if(oe=oe||{},typeof oe.type=="string"&&oe.type!==this.type&&oe.type!=="mixed")throw new UsageGraphError(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${oe.type}" because this would mean losing information about the current graph.`);if(typeof oe.multi=="boolean"&&oe.multi!==this.multi&&oe.multi!==!0)throw new UsageGraphError("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof oe.allowSelfLoops=="boolean"&&oe.allowSelfLoops!==this.allowSelfLoops&&oe.allowSelfLoops!==!0)throw new UsageGraphError("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const ce=this.emptyCopy(oe),ue=this._edges.values();let pe,me;for(;pe=ue.next(),pe.done!==!0;)me=pe.value,addEdge(ce,"copy",!1,me.undirected,me.key,me.source.key,me.target.key,assign$3({},me.attributes));return ce}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const oe={};this._nodes.forEach((me,ge)=>{oe[ge]=me.attributes});const ce={},ue={};this._edges.forEach((me,ge)=>{const ye=me.undirected?"--":"->";let xe="",ve=me.source.key,_e=me.target.key,we;me.undirected&&ve>_e&&(we=ve,ve=_e,_e=we);const Se=`(${ve})${ye}(${_e})`;ge.startsWith("geid_")?this.multi&&(typeof ue[Se]>"u"?ue[Se]=0:ue[Se]++,xe+=`${ue[Se]}. `):xe+=`[${ge}]: `,xe+=Se,ce[xe]=me.attributes});const pe={};for(const me in this)this.hasOwnProperty(me)&&!EMITTER_PROPS.has(me)&&typeof this[me]!="function"&&typeof me!="symbol"&&(pe[me]=this[me]);return pe.attributes=this._attributes,pe.nodes=oe,pe.edges=ce,privateProperty(pe,"constructor",this.constructor),pe}}typeof Symbol<"u"&&(Graph.prototype[Symbol.for("nodejs.util.inspect.custom")]=Graph.prototype.inspect);EDGE_ADD_METHODS.forEach(ne=>{["add","merge","update"].forEach(oe=>{const ce=ne.name(oe),ue=oe==="add"?addEdge:mergeEdge;ne.generateKey?Graph.prototype[ce]=function(pe,me,ge){return ue(this,ce,!0,(ne.type||this.type)==="undirected",null,pe,me,ge,oe==="update")}:Graph.prototype[ce]=function(pe,me,ge,ye){return ue(this,ce,!1,(ne.type||this.type)==="undirected",pe,me,ge,ye,oe==="update")}})});attachNodeAttributesMethods(Graph);attachEdgeAttributesMethods(Graph);attachEdgeIterationMethods(Graph);attachNeighborIterationMethods(Graph);class DirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"directed"},oe);if("multi"in ce&&ce.multi!==!1)throw new InvalidArgumentsGraphError("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(ce.type!=="directed")throw new InvalidArgumentsGraphError('DirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}class UndirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"undirected"},oe);if("multi"in ce&&ce.multi!==!1)throw new InvalidArgumentsGraphError("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(ce.type!=="undirected")throw new InvalidArgumentsGraphError('UndirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}class MultiGraph extends Graph{constructor(oe){const ce=assign$3({multi:!0},oe);if("multi"in ce&&ce.multi!==!0)throw new InvalidArgumentsGraphError("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(ce)}}class MultiDirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"directed",multi:!0},oe);if("multi"in ce&&ce.multi!==!0)throw new InvalidArgumentsGraphError("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(ce.type!=="directed")throw new InvalidArgumentsGraphError('MultiDirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}class MultiUndirectedGraph extends Graph{constructor(oe){const ce=assign$3({type:"undirected",multi:!0},oe);if("multi"in ce&&ce.multi!==!0)throw new InvalidArgumentsGraphError("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(ce.type!=="undirected")throw new InvalidArgumentsGraphError('MultiUndirectedGraph.from: inconsistent "'+ce.type+'" type in given options!');super(ce)}}function attachStaticFromMethod(ne){ne.from=function(oe,ce){const ue=assign$3({},oe.options,ce),pe=new ne(ue);return pe.import(oe),pe}}attachStaticFromMethod(Graph);attachStaticFromMethod(DirectedGraph);attachStaticFromMethod(UndirectedGraph);attachStaticFromMethod(MultiGraph);attachStaticFromMethod(MultiDirectedGraph);attachStaticFromMethod(MultiUndirectedGraph);Graph.Graph=Graph;Graph.DirectedGraph=DirectedGraph;Graph.UndirectedGraph=UndirectedGraph;Graph.MultiGraph=MultiGraph;Graph.MultiDirectedGraph=MultiDirectedGraph;Graph.MultiUndirectedGraph=MultiUndirectedGraph;Graph.InvalidArgumentsGraphError=InvalidArgumentsGraphError;Graph.NotFoundGraphError=NotFoundGraphError;Graph.UsageGraphError=UsageGraphError;function _toPrimitive(ne,oe){if(typeof ne!="object"||!ne)return ne;var ce=ne[Symbol.toPrimitive];if(ce!==void 0){var ue=ce.call(ne,oe||"default");if(typeof ue!="object")return ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return(oe==="string"?String:Number)(ne)}function _toPropertyKey(ne){var oe=_toPrimitive(ne,"string");return typeof oe=="symbol"?oe:oe+""}function _classCallCheck$1(ne,oe){if(!(ne instanceof oe))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(ne,oe){for(var ce=0;cene.length)&&(oe=ne.length);for(var ce=0,ue=Array(oe);ce>>16,ce=(ne&65280)>>>8,ue=ne&255,pe=255,me=rgbaToFloat(oe,ce,ue,pe);return FLOAT_INDEX_CACHE[ne]=me,me}function colorToIndex(ne,oe,ce,ue){return ce+(oe<<8)+(ne<<16)}function getPixelColor(ne,oe,ce,ue,pe,me){var ge=Math.floor(ce/me*pe),ye=Math.floor(ne.drawingBufferHeight/me-ue/me*pe),xe=new Uint8Array(4);ne.bindFramebuffer(ne.FRAMEBUFFER,oe),ne.readPixels(ge,ye,1,1,ne.RGBA,ne.UNSIGNED_BYTE,xe);var ve=_slicedToArray$1(xe,4),_e=ve[0],we=ve[1],Se=ve[2],$e=ve[3];return[_e,we,Se,$e]}function _defineProperty$3(ne,oe,ce){return(oe=_toPropertyKey(oe))in ne?Object.defineProperty(ne,oe,{value:ce,enumerable:!0,configurable:!0,writable:!0}):ne[oe]=ce,ne}function ownKeys$3(ne,oe){var ce=Object.keys(ne);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(ne);oe&&(ue=ue.filter(function(pe){return Object.getOwnPropertyDescriptor(ne,pe).enumerable})),ce.push.apply(ce,ue)}return ce}function _objectSpread2$3(ne){for(var oe=1;oece?`{ `+gap+xe.join(`, `+gap)+` -`+ye+"}":"{ "+xe.join(", ")+" }":"{"+xe.join(",")+"}",gap=ye,me}}function beautify(ne,oe,ce,ue){var pe;if(gap="",indent="",ue||(ue=0),typeof ue!="number")throw new Error("beaufifier: limit must be a number");if(typeof ce=="number")for(pe=0;pe+pe);return ue<-2||ue>4?jsxRuntimeExports.jsxs("span",{children:[ce,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:ue})]}):lodashExports.round(ne,2)}else return ne;case"string":return`${ne}`;case"undefined":return"null";default:return oe?jsxRuntimeExports.jsx("code",{children:lodashExports.isNull(ne)?"null":lodashExports.get(ne,"constructor.name")??typeof ne}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports.truncate(beautify$1(ne,void 0,2),{length:100})})}}function Property(ne){const oe=compilerRuntimeExports.c(17),{label:ce,value:ue,type:pe,simple:me}=ne,ge=`${ce}::${renderProperty(ue)}`,ye=pe==null?void 0:pe.sx;let xe;oe[0]!==ye?(xe={opacity:.54,...ye},oe[0]=ye,oe[1]=xe):xe=oe[1];let ve;oe[2]!==ce||oe[3]!==xe||oe[4]!==pe?(ve=jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",...pe,sx:xe,children:ce}),oe[2]=ce,oe[3]=xe,oe[4]=pe,oe[5]=ve):ve=oe[5];let _e;oe[6]===Symbol.for("react.memo_cache_sentinel")?(_e=jsxRuntimeExports.jsx(Space,{}),oe[6]=_e):_e=oe[6];let we;oe[7]!==me||oe[8]!==ue?(we=renderProperty(ue,me)??"none",oe[7]=me,oe[8]=ue,oe[9]=we):we=oe[9];let Se;oe[10]!==we||oe[11]!==pe?(Se=jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",...pe,children:we}),oe[10]=we,oe[11]=pe,oe[12]=Se):Se=oe[12];let $e;return oe[13]!==ge||oe[14]!==ve||oe[15]!==Se?($e=jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[ve,_e,Se]},ge),oe[13]=ge,oe[14]=ve,oe[15]=Se,oe[16]=$e):$e=oe[16],$e}const COMMON_PROPS=["type"],OMIT_PROPS=[...COMMON_PROPS,"id"],ESSENTIAL_PROPS=["id"],GRAPH_PROPS=[...ESSENTIAL_PROPS,"pId"],HEURISTIC_PROPS=["f","g"],ALL_PROPS=[...OMIT_PROPS,...GRAPH_PROPS,...HEURISTIC_PROPS],sortEventKeys=ne=>lodashExports.chain(ne).entries().filter(([,oe])=>!lodashExports.isUndefined(oe)).sortBy(([oe])=>lodashExports.indexOf(ALL_PROPS,oe)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog(ne){const oe=compilerRuntimeExports.c(9);let ce,ue,pe;if(oe[0]!==ne){const{event:ye,max:xe,simple:ve,variant:_e,...we}=ne;ce=ye,pe=xe,ue=we,oe[0]=ne,oe[1]=ce,oe[2]=ue,oe[3]=pe}else ce=oe[1],ue=oe[2],pe=oe[3];const me=pe===void 0?10:pe;let ge;if(oe[4]!==ce||oe[5]!==me||oe[6]!==ue){const ye=sortEventKeys(ce);let xe;oe[8]===Symbol.for("react.memo_cache_sentinel")?(xe=jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"}),oe[8]=xe):xe=oe[8],ge=jsxRuntimeExports.jsx(ManagedModal,{...lodashExports.merge({appBar:{children:xe},trigger:ve=>jsxRuntimeExports.jsxs(Button$1,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:_temp$q,justifyContent:"left"},onClick:_e=>{_e.stopPropagation(),_e.preventDefault(),ve(_e)},children:[ye.length-me," more"]})},ue),children:[{name:"common",props:lodashExports.filter(ye,_temp2$i)},{name:"Graph",props:lodashExports.filter(ye,_temp3$b)},{name:"Heuristic",props:lodashExports.filter(ye,_temp4$6)},{name:"other",props:lodashExports.filter(ye,_temp5$3)}].map(_temp7$3)}),oe[4]=ce,oe[5]=me,oe[6]=ue,oe[7]=ge}else ge=oe[7];return ge}function _temp7$3(ne,oe){const{name:ce,props:ue}=ne;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!!oe&&jsxRuntimeExports.jsx(Divider,{sx:{mb:1}}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"overline",color:"text.secondary",sx:{px:3},children:lodashExports.startCase(ce)}),jsxRuntimeExports.jsx(Box,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports.map(ue,_temp6$3)},ce)]},ce)}function _temp6$3(ne){const[oe,ce]=ne;return jsxRuntimeExports.jsx(ListItem,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText,{secondary:oe,primary:renderProperty(ce)})},`${oe}::${ce}`)}function _temp5$3(ne){const[oe]=ne;return!ALL_PROPS.includes(oe)}function _temp4$6(ne){const[oe]=ne;return HEURISTIC_PROPS.includes(oe)}function _temp3$b(ne){const[oe]=ne;return GRAPH_PROPS.includes(oe)}function _temp2$i(ne){const[oe]=ne;return COMMON_PROPS.includes(oe)}function _temp$q(ne){return ne.palette.text.secondary}function PropertyList(ne){const oe=compilerRuntimeExports.c(32);let ce,ue,pe,me,ge,ye;oe[0]!==ne?({event:ce,variant:ge,max:ye,simple:me,primitives:ue,...pe}=ne,oe[0]=ne,oe[1]=ce,oe[2]=ue,oe[3]=pe,oe[4]=me,oe[5]=ge,oe[6]=ye):(ce=oe[1],ue=oe[2],pe=oe[3],me=oe[4],ge=oe[5],ye=oe[6]);const xe=ge===void 0?"body2":ge,ve=ye===void 0?10:ye;let _e,we,Se,$e;if(oe[7]!==ce||oe[8]!==ve||oe[9]!==ue||oe[10]!==pe||oe[11]!==me||oe[12]!==xe){we=sortEventKeys(ce),_e=Flex,Se=pe;let Ae;oe[17]!==ue?(Ae=ue?_temp8$1:lodashExports.constant(!0),oe[17]=ue,oe[18]=Ae):Ae=oe[18];let ke;oe[19]!==me||oe[20]!==xe?(ke=(Be,Ie)=>{const[Ne,je]=Be;return jsxRuntimeExports.jsx(Property,{label:Ne,value:je,type:{variant:xe},simple:me},Ie)},oe[19]=me,oe[20]=xe,oe[21]=ke):ke=oe[21],$e=lodashExports.chain(we).filter(Ae).slice(0,ve).map(ke).value(),oe[7]=ce,oe[8]=ve,oe[9]=ue,oe[10]=pe,oe[11]=me,oe[12]=xe,oe[13]=_e,oe[14]=we,oe[15]=Se,oe[16]=$e}else _e=oe[13],we=oe[14],Se=oe[15],$e=oe[16];let Te;oe[22]!==ve||oe[23]!==ne||oe[24]!==me||oe[25]!==we.length?(Te=we.length>ve&&!me&&jsxRuntimeExports.jsx(PropertyDialog,{...ne}),oe[22]=ve,oe[23]=ne,oe[24]=me,oe[25]=we.length,oe[26]=Te):Te=oe[26];let Re;return oe[27]!==_e||oe[28]!==Se||oe[29]!==$e||oe[30]!==Te?(Re=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(_e,{...Se,children:[$e,Te]})}),oe[27]=_e,oe[28]=Se,oe[29]=$e,oe[30]=Te,oe[31]=Re):Re=oe[31],Re}function _temp8$1(ne){const[,oe]=ne;return isPrimitive(oe)}function isPrimitive(ne){return lodashExports.isString(ne)||lodashExports.isNumber(ne)}var t$3,e$2,s$2,i$3;(function(ne){ne.HEX="HEX",ne.RGB="RGB",ne.HSL="HSL",ne.CIELab="CIELab",ne.CMYK="CMYK"})(t$3||(t$3={})),function(ne){ne.ANALOGOUS="ANALOGOUS",ne.COMPLEMENTARY="COMPLEMENTARY",ne.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",ne.TRIADIC="TRIADIC",ne.TETRADIC="TETRADIC",ne.SQUARE="SQUARE"}(e$2||(e$2={})),function(ne){ne.ADDITIVE="ADDITIVE",ne.SUBTRACTIVE="SUBTRACTIVE"}(s$2||(s$2={})),function(ne){ne.black="#000000",ne.silver="#C0C0C0",ne.gray="#808080",ne.white="#FFFFFF",ne.maroon="#800000",ne.red="#FF0000",ne.purple="#800080",ne.fuchsia="#FF00FF",ne.green="#008000",ne.lime="#00FF00",ne.olive="#808000",ne.yellow="#FFFF00",ne.navy="#000080",ne.blue="#0000FF",ne.teal="#008080",ne.aqua="#00FFFF",ne.orange="#FFA500",ne.aliceblue="#F0F8FF",ne.antiquewhite="#FAEBD7",ne.aquamarine="#7FFFD4",ne.azure="#F0FFFF",ne.beige="#F5F5DC",ne.bisque="#FFE4C4",ne.blanchedalmond="#FFEBCD",ne.blueviolet="#8A2BE2",ne.brown="#A52A2A",ne.burlywood="#DEB887",ne.cadetblue="#5F9EA0",ne.chartreuse="#7FFF00",ne.chocolate="#D2691E",ne.coral="#FF7F50",ne.cornflowerblue="#6495ED",ne.cornsilk="#FFF8DC",ne.crimson="#DC143C",ne.cyan="#00FFFF",ne.darkblue="#00008B",ne.darkcyan="#008B8B",ne.darkgoldenrod="#B8860B",ne.darkgray="#A9A9A9",ne.darkgreen="#006400",ne.darkgrey="#A9A9A9",ne.darkkhaki="#BDB76B",ne.darkmagenta="#8B008B",ne.darkolivegreen="#556B2F",ne.darkorange="#FF8C00",ne.darkorchid="#9932CC",ne.darkred="#8B0000",ne.darksalmon="#E9967A",ne.darkseagreen="#8FBC8F",ne.darkslateblue="#483D8B",ne.darkslategray="#2F4F4F",ne.darkslategrey="#2F4F4F",ne.darkturquoise="#00CED1",ne.darkviolet="#9400D3",ne.deeppink="#FF1493",ne.deepskyblue="#00BFFF",ne.dimgray="#696969",ne.dimgrey="#696969",ne.dodgerblue="#1E90FF",ne.firebrick="#B22222",ne.floralwhite="#FFFAF0",ne.forestgreen="#228B22",ne.gainsboro="#DCDCDC",ne.ghostwhite="#F8F8FF",ne.gold="#FFD700",ne.goldenrod="#DAA520",ne.greenyellow="#ADFF2F",ne.grey="#808080",ne.honeydew="#F0FFF0",ne.hotpink="#FF69B4",ne.indianred="#CD5C5C",ne.indigo="#4B0082",ne.ivory="#FFFFF0",ne.khaki="#F0E68C",ne.lavender="#E6E6FA",ne.lavenderblush="#FFF0F5",ne.lawngreen="#7CFC00",ne.lemonchiffon="#FFFACD",ne.lightblue="#ADD8E6",ne.lightcoral="#F08080",ne.lightcyan="#E0FFFF",ne.lightgoldenrodyellow="#FAFAD2",ne.lightgray="#D3D3D3",ne.lightgreen="#90EE90",ne.lightgrey="#D3D3D3",ne.lightpink="#FFB6C1",ne.lightsalmon="#FFA07A",ne.lightseagreen="#20B2AA",ne.lightskyblue="#87CEFA",ne.lightslategray="#778899",ne.lightslategrey="#778899",ne.lightsteelblue="#B0C4DE",ne.lightyellow="#FFFFE0",ne.limegreen="#32CD32",ne.linen="#FAF0E6",ne.magenta="#FF00FF",ne.mediumaquamarine="#66CDAA",ne.mediumblue="#0000CD",ne.mediumorchid="#BA55D3",ne.mediumpurple="#9370DB",ne.mediumseagreen="#3CB371",ne.mediumslateblue="#7B68EE",ne.mediumspringgreen="#00FA9A",ne.mediumturquoise="#48D1CC",ne.mediumvioletred="#C71585",ne.midnightblue="#191970",ne.mintcream="#F5FFFA",ne.mistyrose="#FFE4E1",ne.moccasin="#FFE4B5",ne.navajowhite="#FFDEAD",ne.oldlace="#FDF5E6",ne.olivedrab="#6B8E23",ne.orangered="#FF4500",ne.orchid="#DA70D6",ne.palegoldenrod="#EEE8AA",ne.palegreen="#98FB98",ne.paleturquoise="#AFEEEE",ne.palevioletred="#DB7093",ne.papayawhip="#FFEFD5",ne.peachpuff="#FFDAB9",ne.peru="#CD853F",ne.pink="#FFC0CB",ne.plum="#DDA0DD",ne.powderblue="#B0E0E6",ne.rosybrown="#BC8F8F",ne.royalblue="#4169E1",ne.saddlebrown="#8B4513",ne.salmon="#FA8072",ne.sandybrown="#F4A460",ne.seagreen="#2E8B57",ne.seashell="#FFF5EE",ne.sienna="#A0522D",ne.skyblue="#87CEEB",ne.slateblue="#6A5ACD",ne.slategray="#708090",ne.slategrey="#708090",ne.snow="#FFFAFA",ne.springgreen="#00FF7F",ne.steelblue="#4682B4",ne.tan="#D2B48C",ne.thistle="#D8BFD8",ne.tomato="#FF6347",ne.turquoise="#40E0D0",ne.violet="#EE82EE",ne.wheat="#F5DEB3",ne.whitesmoke="#F5F5F5",ne.yellowgreen="#9ACD32",ne.rebeccapurple="#663399"}(i$3||(i$3={}));const a$3=Object.keys(i$3),r$3={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},n$3={BGR:t$3.RGB,ABGR:t$3.RGB,HLS:t$3.HSL,AHLS:t$3.HSL,LAB:t$3.CIELab,ALAB:t$3.CIELab,CKMY:t$3.CMYK,ACKMY:t$3.CMYK};var c$3;(function(ne){ne.NUMBER="number",ne.BOOLEAN="boolean"})(c$3||(c$3={}));const o$3={[t$3.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[t$3.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$3.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$3.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$3.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},A$3=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,h$3=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,u$3=/^0x([a-f\d]{1,2})$/i,d$1=/\{(\d+)\}/g,l$3=/,( +|\d+)/g,E$2=/ +/,m$1="The provided string color doesn't have a correct format",b$3="The provided color object doesn't have the proper keys or format";var C$2,L$2,g$3;(function(ne){ne.NONE="none",ne.DEGREES="deg",ne.GRADIANS="grad",ne.RADIANS="rad",ne.TURNS="turn"})(C$2||(C$2={})),function(ne){ne.NONE="none",ne.PERCENT="percent"}(L$2||(L$2={})),function(ne){ne.DEVICE_CMYK="device-cmyk",ne.CMYK="cmyk"}(g$3||(g$3={}));const B$2={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:C$2.NONE,rgbUnit:L$2.NONE,labUnit:L$2.NONE,cmykUnit:L$2.PERCENT,alphaUnit:L$2.NONE,cmykFunction:g$3.DEVICE_CMYK},p$3=(ne,oe)=>Object.prototype.hasOwnProperty.call(ne,oe),H$3=ne=>+`${ne}`.replace(h$3,"$1"),F$1=ne=>h$3.test(`${ne}`)?H$3(ne):Math.min(+ne,100),R$2=ne=>(ne.length===1&&(ne+=ne),parseInt(ne,16)),S$3=ne=>{const oe=D$2(ne,0).toString(16).toUpperCase();return oe.length===1?`0x0${oe}`:`0x${oe}`},I$1=(ne,oe=!1)=>!oe&&h$3.test(ne)?Math.min(255*H$3(ne)/100,255):u$3.test(ne)?(ne.length===3&&(ne+=ne.slice(-1)),oe?D$2(ne)/255:D$2(ne)):Math.min(+ne,oe?1:255),G$1=ne=>h$3.test(ne)?f$3(125*H$3(ne)/100,-125,125):f$3(+ne,-125,125),M$3=ne=>Math.min(h$3.test(ne)?H$3(ne)/100:+ne,1),y$4=ne=>[...ne].sort().join("").toUpperCase(),D$2=(ne,oe=6)=>{const ce=Math.pow(10,oe);return Math.round(+ne*ce)/ce},f$3=(ne,oe,ce)=>Math.max(oe,Math.min(ne,ce)),O$1=ne=>{if(typeof ne=="string"){const oe=ne.match(A$3),ce=+oe[1];switch(oe[2]){case C$2.RADIANS:ne=D$2(180*ce/Math.PI);break;case C$2.TURNS:ne=D$2(360*ce);break;case C$2.GRADIANS:ne=D$2(.9*ce);break;case C$2.DEGREES:default:ne=ce}}return(ne>360||ne<0)&&(ne-=360*Math.floor(ne/360)),ne},Y$4=(ne,oe)=>{let ce;switch(oe){case C$2.RADIANS:ce=D$2((ue=>ue*Math.PI/180)(ne));break;case C$2.TURNS:ce=D$2(ne/360);break;case C$2.GRADIANS:ce=D$2(10/9*ne);break;case C$2.DEGREES:case C$2.NONE:default:ce=ne}return ce},k$4=(ne,...oe)=>{const ce=[],ue=[],pe=[],me=[],ge=[],ye=[],xe=Object.values(C$2),ve=Object.values(L$2),_e=Object.values(g$3),we={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const Se of oe)if(typeof Se=="string"){if(ce.push(Se),Se.includes(",")){we.legacyCSS++;const $e=Se.match(l$3);new Set($e).size===1&&E$2.test($e[0].slice(1))&&we.spacesAfterCommas++}if(Se.match(o$3.HSL)){const $e=Se.match(o$3.HSL),Te=$e[1]||$e[5],Re=$e[8],Ae=Te.match(A$3)[2];ue.push(Ae===""?C$2.NONE:Ae),ye.push(h$3.test(Re));continue}if(o$3.RGB.test(Se)){const $e=Se.match(o$3.RGB),Te=$e[1]||$e[5],Re=$e[2]||$e[6],Ae=$e[3]||$e[7],ke=$e[8];pe.push(h$3.test(Te)&&h$3.test(Re)&&h$3.test(Ae)),ye.push(h$3.test(ke));continue}if(o$3.CIELab.test(Se)){const $e=Se.match(o$3.CIELab),Te=$e[1],Re=$e[2],Ae=$e[3],ke=$e[4];me.push(h$3.test(Te)&&h$3.test(Re)&&h$3.test(Ae)),ye.push(h$3.test(ke));continue}if(Se.match(o$3.CMYK)){const $e=Se.match(o$3.CMYK),Te=$e[1]||$e[6],Re=$e[2]||$e[7],Ae=$e[3]||$e[8],ke=$e[4]||$e[9],Be=$e[10];ge.push(h$3.test(Te)&&h$3.test(Re)&&h$3.test(Ae)&&h$3.test(ke)),Se.startsWith("cmyk")&&we.cmykFunction++,ye.push(h$3.test(Be))}}return{decimals:typeof ne.decimals===c$3.NUMBER?ne.decimals:B$2.decimals,legacyCSS:typeof ne.legacyCSS===c$3.BOOLEAN?ne.legacyCSS:!!(ce.length&&we.legacyCSS===ce.length)||B$2.legacyCSS,spacesAfterCommas:typeof ne.spacesAfterCommas===c$3.BOOLEAN?ne.spacesAfterCommas:!!(ce.length&&we.spacesAfterCommas===ce.length)||B$2.spacesAfterCommas,anglesUnit:ne.anglesUnit&&xe.includes(ne.anglesUnit)?ne.anglesUnit:new Set(ue).size===1?ue[0]:B$2.anglesUnit,rgbUnit:ne.rgbUnit&&ve.includes(ne.rgbUnit)?ne.rgbUnit:new Set(pe).size===1&&pe[0]?L$2.PERCENT:B$2.rgbUnit,labUnit:ne.labUnit&&ve.includes(ne.labUnit)?ne.labUnit:new Set(me).size===1&&me[0]?L$2.PERCENT:B$2.labUnit,cmykUnit:ne.cmykUnit&&ve.includes(ne.cmykUnit)?ne.cmykUnit:new Set(ge).size!==1||ge[0]?B$2.cmykUnit:L$2.NONE,alphaUnit:ne.alphaUnit&&ve.includes(ne.alphaUnit)?ne.alphaUnit:new Set(ye).size===1&&ye[0]?L$2.PERCENT:B$2.alphaUnit,cmykFunction:ne.cmykFunction&&_e.includes(ne.cmykFunction)?ne.cmykFunction:ge.length&&ge.length===we.cmykFunction?g$3.CMYK:B$2.cmykFunction}},K$1=ne=>`${ne}`in s$2,X$1=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],T$2=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],N$3=X$1.map(ne=>ne.reduce((oe,ce)=>oe+ce,0)),$$3=(ne,oe,ce)=>(ce<0&&(ce+=6),ce>=6&&(ce-=6),D$2(ce<1?255*((oe-ne)*ce+ne):ce<3?255*oe:ce<4?255*((oe-ne)*(4-ce)+ne):255*ne)),j$2=ne=>ne<=.04045?ne/12.92:((ne+.055)/1.055)**2.4,U$1=ne=>ne<=.0031308?12.92*ne:1.055*ne**(1/2.4)-.055,w$2=(ne,oe,ce,ue)=>{const pe=[0,0,0],me=[ne,oe,ce];return ue.forEach((ge,ye)=>{ge.forEach((xe,ve)=>{pe[ye]+=xe*me[ve]})}),pe},x$4=(ne,oe,ce)=>{oe/=100;const ue=(ce/=100)<=.5?ce*(oe+1):ce+oe-ce*oe,pe=2*ce-ue;return{R:$$3(pe,ue,(ne/=60)+2),G:$$3(pe,ue,ne),B:$$3(pe,ue,ne-2)}},v$4=(ne,oe,ce,ue=1)=>{ne/=255,oe/=255,ce/=255,ue=Math.min(ue,1);const pe=Math.max(ne,oe,ce),me=Math.min(ne,oe,ce),ge=pe-me;let ye=0,xe=0;const ve=(pe+me)/2;if(ge!==0){switch(pe){case ne:ye=(oe-ce)/ge%6;break;case oe:ye=(ce-ne)/ge+2;break;case ce:ye=(ne-oe)/ge+4}ye=D$2(60*ye),ye<0&&(ye+=360),xe=ge/(1-Math.abs(2*ve-1))}return{H:ye,S:D$2(100*xe),L:D$2(100*ve),A:ue}},V$1=(ne,oe,ce)=>{const ue=[ne/255,oe/255,ce/255].map(j$2),pe=w$2(ue[0],ue[1],ue[2],X$1),me=((ge,ye,xe)=>{const ve=Se=>Se>.008856451679035631?Math.cbrt(Se):Se/.12841854934601665+.13793103448275862,_e=ve(ge/N$3[0]),we=ve(ye/N$3[1]);return[116*we-16,500*(_e-we),200*(we-ve(xe/N$3[2]))]})(pe[0],pe[1],pe[2]);return{L:me[0],a:me[1],b:me[2]}},P=(ne,oe,ce)=>{const ue=((me,ge,ye)=>{const xe=Se=>Se>.20689655172413793?Se**3:.12841854934601665*(Se-.13793103448275862),ve=(me+16)/116,_e=ge/500,we=ye/200;return[N$3[0]*xe(ve+_e),N$3[1]*xe(ve),N$3[2]*xe(ve-we)]})(ne,oe,ce),pe=w$2(ue[0],ue[1],ue[2],T$2).map(U$1);return{R:f$3(255*pe[0],0,255),G:f$3(255*pe[1],0,255),B:f$3(255*pe[2],0,255)}},q$2=(ne,oe,ce,ue)=>({R:D$2(255*(1-ne)*(ue=1-ue)),G:D$2(255*(1-oe)*ue),B:D$2(255*(1-ce)*ue)}),_$3=(ne,oe,ce)=>{ne/=255,oe/=255,ce/=255;const ue=1-Math.max(ne,oe,ce),pe=1-ue,me=pe&&(pe-oe)/pe,ge=pe&&(pe-ce)/pe;return{C:D$2(100*(pe&&(pe-ne)/pe)),M:D$2(100*me),Y:D$2(100*ge),K:D$2(100*ue)}},z$3=(ne,oe)=>{if(ne<0&&(ne+=360),ne>360&&(ne-=360),ne===360||ne===0)return ne;const ce=[[0,120],[120,180],[180,240],[240,360]],ue=[[0,60],[60,120],[120,240],[240,360]],pe=oe?ue:ce;let me=0,ge=0,ye=0,xe=0;return(oe?ce:ue).find((ve,_e)=>ne>=ve[0]&&nene?", ":",",W$1=(ne,oe)=>{const ce=y$4(Object.keys(ne));return r$3[n$3[ce]].reduce((ue,pe,me)=>{const ge=ne[pe];return ge!==void 0&&ue.push(oe(ge,me)),ue},[])},J$1=(ne,oe)=>ne.replace(d$1,(ce,ue)=>`${oe[+ue-1]}`),Z$2=(ne,oe,ce=!1)=>{const{alphaUnit:ue,legacyCSS:pe,decimals:me}=oe;return ue!==L$2.PERCENT||pe&&!ce?D$2(ne,me):`${D$2(100*ne,me)}%`},tt$1={[t$3.HEX]:ne=>{const oe=W$1(ne,ue=>(pe=>{let me=D$2(pe,0).toString(16).toUpperCase();return me.length===1&&(me=`0${me}`),me})(D$2(ue))),ce=oe.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return J$1(ce,oe)},[t$3.RGB]:(ne,oe)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,rgbUnit:me}=oe,ge=Q$1(pe),ye=W$1(ne,(ve,_e)=>me===L$2.PERCENT&&_e<3?`${((we,Se)=>D$2(we/255*100,Se))(ve,ce)}%`:_e===3?Z$2(ve,oe):D$2(ve,ce)),xe=ue?ye.length===4?`rgba({1}${ge}{2}${ge}{3}${ge}{4})`:`rgb({1}${ge}{2}${ge}{3})`:ye.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return J$1(xe,ye)},[t$3.HSL]:(ne,oe)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,anglesUnit:me}=oe,ge=Q$1(pe),ye=W$1(ne,(ve,_e)=>_e===0&&me!==C$2.NONE?`${D$2(Y$4(ve,me),ce)}${me}`:_e===3?Z$2(ve,oe):D$2(ve,ce)),xe=ue?ye.length===4?`hsla({1}${ge}{2}%${ge}{3}%${ge}{4})`:`hsl({1}${ge}{2}%${ge}{3}%)`:ye.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return J$1(xe,ye)},[t$3.CIELab]:(ne,oe)=>{const{decimals:ce,labUnit:ue}=oe,pe=W$1(ne,(ge,ye)=>{if(ye===0){const xe=D$2(F$1(ge),ce);return ue===L$2.PERCENT?`${xe}%`:`${xe}`}return ye<3?ue===L$2.PERCENT?`${((xe,ve)=>D$2(xe/125*100,ve))(ge,ce)}%`:D$2(ge,ce):Z$2(ge,oe,!0)}),me=pe.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return J$1(me,pe)},[t$3.CMYK]:(ne,oe)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,cmykUnit:me,cmykFunction:ge}=oe,ye=Q$1(pe),xe=W$1(ne,(_e,we)=>me===L$2.PERCENT&&we<4?`${D$2(_e,ce)}%`:we===4?Z$2(_e,oe):D$2(_e/100,ce)),ve=ue?xe.length===5?`${ge}({1}${ye}{2}${ye}{3}${ye}{4}${ye}{5})`:`${ge}({1}${ye}{2}${ye}{3}${ye}{4})`:xe.length===5?`${ge}({1} {2} {3} {4} / {5})`:`${ge}({1} {2} {3} {4})`;return J$1(ve,xe)}},et$1=ne=>(typeof ne=="string"&&(ne=h$3.test(ne)?H$3(ne)/100:+ne),isNaN(+ne)||ne>1?1:D$2(ne)),st=(ne,oe,ce)=>oe.reduce((ue,pe)=>[...ue,{...ne,H:ce===s$2.ADDITIVE?O$1(ne.H+pe):O$1(z$3(z$3(ne.H,!1)+pe,!0))}],[{...ne}]),it=(ne,oe)=>st(ne,[30,-30],oe),at=(ne,oe)=>st(ne,[180],oe),rt=(ne,oe)=>st(ne,[150,-150],oe),nt=(ne,oe)=>st(ne,[120,-120],oe),ct=(ne,oe)=>st(ne,[60,-120,180],oe),ot=(ne,oe)=>st(ne,[90,-90,180],oe),At=ne=>typeof ne=="string"?(oe=>{let ce;if(Object.keys(t$3).some(ue=>{if(o$3[ue].test(oe))return ce=ue,!0}),!ce&&~a$3.indexOf(oe)&&(ce=t$3.HEX),!ce)throw new Error(m$1);return ce})(ne):(oe=>{let ce,ue=!1;const pe=y$4(Object.keys(oe));if(n$3[pe]&&(ce=n$3[pe]),ce&&ce===t$3.RGB){const me=Object.entries(oe).some(ye=>!u$3.test(`${ye[1]}`)),ge=Object.entries(oe).some(ye=>!(h$3.test(`${ye[1]}`)||!u$3.test(`${ye[1]}`)&&!isNaN(+ye[1])&&+ye[1]<=255));me&&ge&&(ue=!0),me||(ce=t$3.HEX)}if(!ce||ue)throw new Error(b$3);return ce})(ne),ht$1={[t$3.HEX](ne){const oe=(~a$3.indexOf(ne)?i$3[ne]:ne).match(o$3.HEX),ce={R:R$2(oe[1]||oe[5]),G:R$2(oe[2]||oe[6]),B:R$2(oe[3]||oe[7])},ue=oe[4]||oe[8];return ue!==void 0&&(ce.A=R$2(ue)/255),ce},[t$3.RGB](ne){const oe=ne.match(o$3.RGB),ce=I$1(oe[1]||oe[5]),ue=I$1(oe[2]||oe[6]),pe=I$1(oe[3]||oe[7]),me=oe[4]||oe[8],ge={R:Math.min(ce,255),G:Math.min(ue,255),B:Math.min(pe,255)};return me!==void 0&&(ge.A=et$1(me)),ge},[t$3.HSL](ne){const oe=ne.match(o$3.HSL),ce=O$1(oe[1]||oe[5]),ue=F$1(oe[2]||oe[6]),pe=F$1(oe[3]||oe[7]),me=oe[4]||oe[8],ge=x$4(ce,ue,pe);return me!==void 0&&(ge.A=et$1(me)),ge},[t$3.CIELab](ne){const oe=ne.match(o$3.CIELab),ce=F$1(oe[1]),ue=G$1(oe[2]),pe=G$1(oe[3]),me=oe[4],ge=P(ce,ue,pe);return me!==void 0&&(ge.A=et$1(me)),ge},[t$3.CMYK](ne){const oe=ne.match(o$3.CMYK),ce=M$3(oe[1]||oe[6]),ue=M$3(oe[2]||oe[7]),pe=M$3(oe[3]||oe[8]),me=M$3(oe[4]||oe[9]),ge=oe[5]||oe[10],ye=q$2(ce,ue,pe,me);return ge!==void 0&&(ye.A=et$1(ge)),ye}},ut={[t$3.HEX](ne){const oe={R:I$1(`${ne.R}`),G:I$1(`${ne.G}`),B:I$1(`${ne.B}`)};return p$3(ne,"A")&&(oe.A=Math.min(I$1(`${ne.A}`,!0),1)),oe},[t$3.RGB](ne){return this.HEX(ne)},[t$3.HSL](ne){const oe=F$1(`${ne.S}`),ce=F$1(`${ne.L}`),ue=x$4(O$1(ne.H),oe,ce);return p$3(ne,"A")&&(ue.A=et$1(ne.A)),ue},[t$3.CIELab](ne){const oe=F$1(`${ne.L}`),ce=G$1(`${ne.a}`),ue=G$1(`${ne.b}`),pe=P(oe,ce,ue);return p$3(ne,"A")&&(pe.A=et$1(ne.A)),pe},[t$3.CMYK](ne){const oe=M$3(`${ne.C}`),ce=M$3(`${ne.M}`),ue=M$3(`${ne.Y}`),pe=M$3(`${ne.K}`),me=q$2(oe,ce,ue,pe);return p$3(ne,"A")&&(me.A=et$1(ne.A)),me}},dt=(ne,oe=At(ne))=>typeof ne=="string"?ht$1[oe](ne):ut[oe](ne),lt={[t$3.HEX]:ne=>({R:S$3(ne.R),G:S$3(ne.G),B:S$3(ne.B)}),HEXA(ne){const oe=lt.HEX(ne);return oe.A=p$3(ne,"A")?S$3(255*ne.A):"0xFF",oe},[t$3.RGB](ne,oe){const ce=Ct(ne,oe);return p$3(ce,"A")&&delete ce.A,ce},RGBA(ne,oe){const ce=lt.RGB(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A):1,ce},[t$3.HSL](ne,oe){const ce=v$4(ne.R,ne.G,ne.B);return delete ce.A,Lt(ce,oe)},HSLA(ne,oe){const ce=lt.HSL(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A,oe):1,ce},[t$3.CIELab](ne,oe){const ce=V$1(ne.R,ne.G,ne.B);return gt(ce,oe)},CIELabA(ne,oe){const ce=lt.CIELab(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A,oe):1,ce},[t$3.CMYK]:(ne,oe)=>Bt(_$3(ne.R,ne.G,ne.B),oe),CMYKA(ne,oe){const ce=lt.CMYK(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A,oe):1,ce}},Et=(ne,oe,ce,ue)=>{const pe=At(ne),me=typeof ne=="string",ge=dt(ne,pe),ye=typeof ne=="string"&&p$3(ge,"A")||typeof ne!="string"&&p$3(ne,"A"),xe=v$4(ge.R,ge.G,ge.B,ge.A);ye||delete xe.A;const ve=ce?xe.L/(oe+1):(100-xe.L)/(oe+1),_e=Array(oe).fill(null).map((we,Se)=>({...xe,L:xe.L+ve*(Se+1)*(1-2*+ce)}));switch(pe){case t$3.HEX:default:return _e.map(we=>{const Se=x$4(we.H,we.S,we.L);return ye&&(Se.A=we.A),me?ye?tt$1.HEX({...Se,A:D$2(255*Se.A)}):tt$1.HEX(Se):ye?lt.HEXA(Se):lt.HEX(Se)});case t$3.RGB:return _e.map(we=>{const Se=x$4(we.H,we.S,we.L);return ye&&(Se.A=we.A),me?tt$1.RGB(Se,ue):ye?lt.RGBA(Se,ue.decimals):lt.RGB(Se,ue.decimals)});case t$3.HSL:return _e.map(we=>me?tt$1.HSL(we,ue):ye?lt.HSLA({...x$4(we.H,we.S,we.L),A:we.A},ue.decimals):lt.HSL(x$4(we.H,we.S,we.L),ue.decimals));case t$3.CIELab:return _e.map(we=>{const Se=x$4(we.H,we.S,we.L);return me?tt$1.CIELab(ye?lt.CIELabA(Se,ue.decimals):lt.CIELab(Se,ue.decimals),ue):ye?lt.CIELabA({...Se,A:we.A},ue.decimals):lt.CIELab(Se,ue.decimals)})}},mt={buildHarmony(ne,oe,ce,ue){const pe=At(ne),me=dt(ne,pe),ge=v$4(me.R,me.G,me.B,me.A),ye=typeof ne=="string"&&p$3(me,"A")||typeof ne!="string"&&p$3(ne,"A"),xe=typeof ne=="string";switch(pe){case t$3.HEX:default:return ye?this.HEXA(Lt(ge,0),oe,ce,xe):this.HEX(Lt(ge,0),oe,ce,xe);case t$3.HSL:return ye?this.HSLA(ge,oe,ce,xe,ue):this.HSL(ge,oe,ce,xe,ue);case t$3.RGB:return ye?this.RGBA(ge,oe,ce,xe,ue):this.RGB(ge,oe,ce,xe,ue);case t$3.CIELab:return ye?this.CIELabA(ge,oe,ce,xe,ue):this.CIELab(ge,oe,ce,xe,ue)}},[t$3.HEX]:(ne,oe,ce,ue)=>oe(ne,ce).map(pe=>ue?tt$1.HEX(x$4(pe.H,pe.S,pe.L)):lt.HEX(x$4(pe.H,pe.S,pe.L))),HEXA:(ne,oe,ce,ue)=>oe(ne,ce).map(pe=>ue?tt$1.HEX({...x$4(pe.H,pe.S,pe.L),A:255*et$1(pe.A)}):lt.HEXA({...x$4(pe.H,pe.S,pe.L),A:et$1(pe.A)})),[t$3.RGB]:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.RGB(x$4(me.H,me.S,me.L),pe):lt.RGB(x$4(me.H,me.S,me.L),pe.decimals)),RGBA:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.RGB({...x$4(me.H,me.S,me.L),A:et$1(me.A)},pe):lt.RGBA({...x$4(me.H,me.S,me.L),A:et$1(me.A)},pe.decimals)),[t$3.HSL]:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.HSL({H:me.H,S:me.S,L:me.L},pe):lt.HSL(x$4(me.H,me.S,me.L),pe.decimals)),HSLA:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.HSL({...me,A:et$1(me.A)},pe):lt.HSLA({...x$4(me.H,me.S,me.L),A:et$1(me.A)},pe.decimals)),[t$3.CIELab]:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>{const ge=x$4(me.H,me.S,me.L);return ue?tt$1.CIELab(V$1(ge.R,ge.G,ge.B),pe):lt.CIELab(ge,pe.decimals)}),CIELabA:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>{const ge=x$4(me.H,me.S,me.L);return ue?tt$1.CIELab({...V$1(ge.R,ge.G,ge.B),A:et$1(me.A)},pe):lt.CIELabA({...ge,A:et$1(me.A)},pe.decimals)})},bt={mix(ne,oe){const ce=ne.map(ge=>{const ye=At(ge);return dt(ge,ye)}),ue=oe===s$2.SUBTRACTIVE?ce.map(ge=>{const ye=((xe,ve,_e)=>{const we=Math.min(xe,ve,_e),Se=Math.min(255-xe,255-ve,255-_e),$e=xe-we,Te=ve-we,Re=_e-we,Ae=Math.min($e,Te),ke=$e-Ae,Be=(Te+Ae)/2,Ie=(Re+Te-Ae)/2,Ne=Math.max(ke,Be,Ie)/Math.max($e,Te,Re),je=isNaN(Ne)||Ne===1/0||Ne<=0?1:Ne;return{R:ke/je+Se,Y:Be/je+Se,B:Ie/je+Se}})(ge.R,ge.G,ge.B);return p$3(ge,"A")&&(ye.A=ge.A),ye}):null;function pe(ge){const ye=oe===s$2.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return ge.reduce((xe,ve)=>{const _e=p$3(ve,"A")?ve.A:1,we={R:Math.min(xe.R+ve.R*_e,255),B:Math.min(xe.B+ve.B*_e,255),A:1-(1-_e)*(1-xe.A)},Se="G"in xe?xe.G:xe.Y,$e="G"in ve?ve.G:ve.Y;return{...we,...oe===s$2.ADDITIVE?{G:Math.min(Se+$e*_e,255)}:{Y:Math.min(Se+$e*_e,255)}}},ye)}let me;if(oe===s$2.ADDITIVE)me=pe(ce);else{const ge=pe(ue);me=((ye,xe,ve)=>{const _e=Math.min(ye,xe,ve),we=Math.min(255-ye,255-xe,255-ve),Se=ye-_e,$e=xe-_e,Te=ve-_e,Re=Math.min($e,Te),Ae=Se+$e-Re,ke=$e+Re,Be=2*(Te-Re),Ie=Math.max(Ae,ke,Be)/Math.max(Se,$e,Te),Ne=isNaN(Ie)||Ie===1/0||Ie<=0?1:Ie;return{R:Ae/Ne+we,G:ke/Ne+we,B:Be/Ne+we}})(ge.R,ge.Y,ge.B),me.A=ge.A}return{R:D$2(me.R),G:D$2(me.G),B:D$2(me.B),A:f$3(me.A,0,1)}},[t$3.HEX](ne,oe,ce){const ue=this.mix(ne,oe);return delete ue.A,ce?tt$1.HEX(ue):lt.HEX(ue)},HEXA(ne,oe,ce){const ue=this.mix(ne,oe);return ue.A=ce?255*et$1(ue.A):et$1(ue.A),ce?tt$1.HEX(ue):lt.HEXA(ue)},[t$3.RGB](ne,oe,ce,ue){const pe=this.mix(ne,oe);return delete pe.A,ce?tt$1.RGB(pe,ue):lt.RGB(pe,ue.decimals)},RGBA(ne,oe,ce,ue){const pe=this.mix(ne,oe);return ce?tt$1.RGB(pe,ue):lt.RGBA(pe,ue.decimals)},[t$3.HSL](ne,oe,ce,ue){const pe=this.mix(ne,oe),me=v$4(pe.R,pe.G,pe.B);return delete pe.A,delete me.A,ce?tt$1.HSL(me,ue):lt.HSL(pe,ue.decimals)},HSLA(ne,oe,ce,ue){const pe=this.mix(ne,oe),me=v$4(pe.R,pe.G,pe.B,pe.A);return ce?tt$1.HSL(me,ue):lt.HSLA(pe,ue.decimals)},[t$3.CIELab](ne,oe,ce,ue){const pe=this.mix(ne,oe),me=V$1(pe.R,pe.G,pe.B);return delete pe.A,ce?tt$1.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)},CIELabA(ne,oe,ce,ue){const pe=this.mix(ne,oe),me=V$1(pe.R,pe.G,pe.B);return p$3(pe,"A")&&(me.A=pe.A),ce?tt$1.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)}},Ct=(ne,oe)=>({R:D$2(ne.R,oe),G:D$2(ne.G,oe),B:D$2(ne.B,oe),...p$3(ne,"A")?{A:D$2(ne.A,oe)}:{}}),Lt=(ne,oe)=>({H:D$2(ne.H,oe),S:D$2(ne.S,oe),L:D$2(ne.L,oe),...p$3(ne,"A")?{A:D$2(ne.A,oe)}:{}}),gt=(ne,oe)=>({L:D$2(ne.L,oe),a:D$2(ne.a,oe),b:D$2(ne.b,oe)}),Bt=(ne,oe)=>({C:D$2(ne.C,oe),M:D$2(ne.M,oe),Y:D$2(ne.Y,oe),K:D$2(ne.K,oe)}),pt=(ne,oe,ce,ue)=>ue(dt(ne,oe),ce),Ht=(ne,oe,ce,ue,pe)=>(ce<1&&(ce=5),((ge,ye,xe)=>{const ve=xe-1,_e=(ye.R-ge.R)/ve,we=(ye.G-ge.G)/ve,Se=(ye.B-ge.B)/ve,$e=et$1(ge.A),Te=(et$1(ye.A)-$e)/ve;return Array(xe).fill(null).map((Re,Ae)=>Ae===0?ge:Ae===ve?ye:{R:D$2(ge.R+_e*Ae),G:D$2(ge.G+we*Ae),B:D$2(ge.B+Se*Ae),A:D$2($e+Te*Ae)})})(dt(ne),dt(oe),ce).map(ge=>pe(ge,ue))),Ft$1=(ne,oe,ce,ue)=>({[e$2.ANALOGOUS]:mt.buildHarmony(oe,it,ce,ue),[e$2.COMPLEMENTARY]:mt.buildHarmony(oe,at,ce,ue),[e$2.SPLIT_COMPLEMENTARY]:mt.buildHarmony(oe,rt,ce,ue),[e$2.TRIADIC]:mt.buildHarmony(oe,nt,ce,ue),[e$2.TETRADIC]:mt.buildHarmony(oe,ct,ce,ue),[e$2.SQUARE]:mt.buildHarmony(oe,ot,ce,ue)})[ne];class Rt{constructor(oe,ce={}){this._options=k$4(ce,oe),this.rgb=dt(oe),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...x$4(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...q$2(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...P(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=v$4(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...V$1(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=_$3(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(oe={}){return this._options={...this._options,...oe},this}setH(oe){return this.hsl.H=O$1(oe),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(oe){return this.hsl.S=f$3(oe,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(oe){return this.hsl.L=f$3(oe,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(oe){this.rgb.R=f$3(oe,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(oe){return this.rgb.G=f$3(oe,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(oe){return this.rgb.B=f$3(oe,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(oe){return this.lab.L=f$3(oe,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(oe){return this.lab.a=f$3(oe,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(oe){return this.lab.b=f$3(oe,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(oe){return this.hsl.A=this.rgb.A=f$3(oe,0,1),this}setC(oe){return this.cmyk.C=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(oe){return this.cmyk.M=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(oe){return this.cmyk.Y=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(oe){return this.cmyk.K=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return D$2(this.hsl.H,this.options.decimals)}get S(){return D$2(this.hsl.S,this.options.decimals)}get L(){return D$2(this.hsl.L,this.options.decimals)}get CIEL(){return D$2(this.lab.L,this.options.decimals)}get CIEa(){return D$2(this.lab.a,this.options.decimals)}get CIEb(){return D$2(this.lab.b,this.options.decimals)}get R(){return D$2(this.rgb.R,this.options.decimals)}get G(){return D$2(this.rgb.G,this.options.decimals)}get B(){return D$2(this.rgb.B,this.options.decimals)}get A(){return D$2(this.hsl.A,this.options.decimals)}get C(){return D$2(this.cmyk.C,this.options.decimals)}get M(){return D$2(this.cmyk.M,this.options.decimals)}get Y(){return D$2(this.cmyk.Y,this.options.decimals)}get K(){return D$2(this.cmyk.K,this.options.decimals)}get HEXObject(){return lt.HEX(this.rgb)}get HEXAObject(){return lt.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return tt$1.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return tt$1.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return tt$1.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return tt$1.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return tt$1.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return tt$1.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return tt$1.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return tt$1.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return tt$1.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return tt$1.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(oe){const ce=At(oe);return pt(oe,ce,0,lt.HEX)}static toHEX(oe){return tt$1.HEX(Rt.toHEXObject(oe))}static toHEXAObject(oe){const ce=At(oe);return pt(oe,ce,0,lt.HEXA)}static toHEXA(oe){return tt$1.HEX(Rt.toHEXAObject(oe))}static toRGBObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.RGB)}static toRGB(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.RGB);return tt$1.RGB(me,pe)}static toRGBAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.RGBA)}static toRGBA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.RGBA);return tt$1.RGB(me,pe)}static toHSLObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.HSL)}static toHSL(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.HSL);return tt$1.HSL(me,pe)}static toHSLAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.HSLA)}static toHSLA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.HSLA);return tt$1.HSL(me,pe)}static toCIELabObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CIELab)}static toCIELab(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CIELab);return tt$1.CIELab(me,pe)}static toCIELabAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CIELabA)}static toCIELabA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CIELabA);return tt$1.CIELab(me,pe)}static toCMYKObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CMYK)}static toCMYK(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CMYK);return tt$1.CMYK(me,pe)}static toCMYKAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CMYKA)}static toCMYKA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CMYKA);return tt$1.CMYK(me,pe)}static getBlendHEXObject(oe,ce,ue=5){return Ht(oe,ce,ue,0,lt.HEX)}static getBlendHEX(oe,ce,ue=5){return Rt.getBlendHEXObject(oe,ce,ue).map(pe=>tt$1.HEX(pe))}static getBlendHEXAObject(oe,ce,ue=5){return Ht(oe,ce,ue,0,lt.HEXA)}static getBlendHEXA(oe,ce,ue=5){return Rt.getBlendHEXAObject(oe,ce,ue).map(pe=>tt$1.HEX(pe))}static getBlendRGBObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGB):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGB)}static getBlendRGB(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGB).map(me=>tt$1.RGB(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGB).map(me=>tt$1.RGB(me,k$4(ue||{},oe,ce)))}static getBlendRGBAObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGBA)}static getBlendRGBA(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA).map(me=>tt$1.RGB(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGBA).map(me=>tt$1.RGB(me,k$4(ue||{},oe,ce)))}static getBlendHSLObject(oe,ce,ue,pe){return Ht(oe,ce,typeof ue=="number"?ue:5,pe==null?void 0:pe.decimals,lt.HSL)}static getBlendHSL(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.HSL).map(me=>tt$1.HSL(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.HSL).map(me=>tt$1.HSL(me,k$4(ue||{},oe,ce)))}static getBlendHSLAObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.HSLA)}static getBlendHSLA(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA).map(me=>tt$1.HSL(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.HSLA).map(me=>tt$1.HSL(me,k$4(ue||{},oe,ce)))}static getBlendCIELabObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELab)}static getBlendCIELab(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab).map(me=>tt$1.CIELab(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELab).map(me=>tt$1.CIELab(me,k$4(ue||{},oe,ce)))}static getBlendCIELabAObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA)}static getBlendCIELabA(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA).map(me=>tt$1.CIELab(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA).map(me=>tt$1.CIELab(me,k$4(ue||{},oe,ce)))}static getMixHEXObject(oe,ce=s$2.ADDITIVE){return bt.HEX(oe,ce,!1)}static getMixHEX(oe,ce=s$2.ADDITIVE){return bt.HEX(oe,ce,!0)}static getMixHEXAObject(oe,ce=s$2.ADDITIVE){return bt.HEXA(oe,ce,!1)}static getMixHEXA(oe,ce=s$2.ADDITIVE){return bt.HEXA(oe,ce,!0)}static getMixRGBObject(oe,ce,ue){return typeof ce=="string"?bt.RGB(oe,ce,!1,k$4(ue||{},...oe)):bt.RGB(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixRGB(oe,ce,ue){return typeof ce=="string"?bt.RGB(oe,ce,!0,k$4(ue||{},...oe)):bt.RGB(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixRGBAObject(oe,ce,ue){return typeof ce=="string"?bt.RGBA(oe,ce,!1,k$4(ue||{},...oe)):bt.RGBA(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixRGBA(oe,ce,ue){return typeof ce=="string"?bt.RGBA(oe,ce,!0,k$4(ue||{},...oe)):bt.RGBA(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixHSLObject(oe,ce,ue){return typeof ce=="string"?bt.HSL(oe,ce,!1,k$4(ue||{},...oe)):bt.HSL(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixHSL(oe,ce,ue){return typeof ce=="string"?bt.HSL(oe,ce,!0,k$4(ue||{},...oe)):bt.HSL(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixHSLAObject(oe,ce,ue){return typeof ce=="string"?bt.HSLA(oe,ce,!1,k$4(ue||{},...oe)):bt.HSLA(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixHSLA(oe,ce,ue){return typeof ce=="string"?bt.HSLA(oe,ce,!0,k$4(ue||{},...oe)):bt.HSLA(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixCIELabObject(oe,ce,ue){return typeof ce=="string"?bt.CIELab(oe,ce,!1,k$4(ue||{},...oe)):bt.CIELab(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixCIELab(oe,ce,ue){return typeof ce=="string"?bt.CIELab(oe,ce,!0,k$4(ue||{},...oe)):bt.CIELab(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixCIELabAObject(oe,ce,ue){return typeof ce=="string"?bt.CIELabA(oe,ce,!1,k$4(ue||{},...oe)):bt.CIELabA(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixCIELabA(oe,ce,ue){return typeof ce=="string"?bt.CIELabA(oe,ce,!0,k$4(ue||{},...oe)):bt.CIELabA(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getShades(oe,ce,ue){return typeof ce=="number"?Et(oe,ce,!0,k$4(ue||{},oe)):Et(oe,5,!0,k$4(ce||{},oe))}static getTints(oe,ce,ue){return typeof ce=="number"?Et(oe,ce,!1,k$4(ue||{},oe)):Et(oe,5,!1,k$4(ce||{},oe))}static getHarmony(oe,ce,ue,pe){return`${ce}`in e$2?Ft$1(ce,oe,K$1(ue)?ue:s$2.ADDITIVE,k$4(K$1(ue)?pe||{}:ue||{},oe)):K$1(ce)?Ft$1(e$2.COMPLEMENTARY,oe,ce,k$4(ue||{},oe)):Ft$1(e$2.COMPLEMENTARY,oe,s$2.ADDITIVE,k$4(ce||{},oe))}}function hash(ne){let oe=5381,ce=ne.length;for(;ce;)oe=oe*33^ne.charCodeAt(--ce);return oe>>>0}const tint="500";function hex(ne){return parseInt(ne.replace("#","0x"))}const searchEventAliases=lodashExports.thru({source:["source","start"],destination:["destination","goal","finish"],updating:["update","updating"],expanding:["expanding","expanding"],generating:["generate","generating","open","opening"],closing:["close","closing"],end:["finish","end","solution"]},ne=>{const oe={};for(const[ce,ue]of lodashExports.entries(ne))for(const pe of ue)oe[pe]=ce;return oe}),colorsHex={source:green$2.A400,destination:red$2.A400,updating:orange$2[tint],expanding:deepPurple[tint],generating:amber[tint],closing:pink[tint],end:blue$2.A400};lodashExports.mapValues(colorsHex,hex);const shades=lodashExports.sortBy(lodashExports.keys(accentColors),ne=>new Rt(getShade(ne,"dark")).H);function getColorHex(ne="",oe){const ce=searchEventAliases[lodashExports.lowerCase(ne)];if(ce)return colorsHex[ce];{const ue=hash(lodashExports.lowerCase(ne)),pe=lodashExports.values(accentColors);return pe[ue%pe.length][tint]}}function inferLayerName(ne){var oe;return ne!=null&&ne.name?ne==null?void 0:ne.name:(oe=ne==null?void 0:ne.source)!=null&&oe.type?getController(ne).inferName(ne):"Untitled Layer"}let windowObject;typeof window<"u"?windowObject=window:typeof self<"u"?windowObject=self:windowObject=global;let cancelFrame=null,requestFrame=null;const TIMEOUT_DURATION=20,clearTimeoutFn=windowObject.clearTimeout,setTimeoutFn=windowObject.setTimeout,cancelAnimationFrameFn=windowObject.cancelAnimationFrame||windowObject.mozCancelAnimationFrame||windowObject.webkitCancelAnimationFrame,requestAnimationFrameFn=windowObject.requestAnimationFrame||windowObject.mozRequestAnimationFrame||windowObject.webkitRequestAnimationFrame;cancelAnimationFrameFn==null||requestAnimationFrameFn==null?(cancelFrame=clearTimeoutFn,requestFrame=function(oe){return setTimeoutFn(oe,TIMEOUT_DURATION)}):(cancelFrame=function([oe,ce]){cancelAnimationFrameFn(oe),clearTimeoutFn(ce)},requestFrame=function(oe){const ce=requestAnimationFrameFn(function(){clearTimeoutFn(ue),oe()}),ue=setTimeoutFn(function(){cancelAnimationFrameFn(ce),oe()},TIMEOUT_DURATION);return[ce,ue]});function createDetectElementResize(ne){let oe,ce,ue,pe,me,ge,ye;const xe=typeof document<"u"&&document.attachEvent;if(!xe){ge=function(ke){const Be=ke.__resizeTriggers__,Ie=Be.firstElementChild,Ne=Be.lastElementChild,je=Ie.firstElementChild;Ne.scrollLeft=Ne.scrollWidth,Ne.scrollTop=Ne.scrollHeight,je.style.width=Ie.offsetWidth+1+"px",je.style.height=Ie.offsetHeight+1+"px",Ie.scrollLeft=Ie.scrollWidth,Ie.scrollTop=Ie.scrollHeight},me=function(ke){return ke.offsetWidth!==ke.__resizeLast__.width||ke.offsetHeight!==ke.__resizeLast__.height},ye=function(ke){if(ke.target.className&&typeof ke.target.className.indexOf=="function"&&ke.target.className.indexOf("contract-trigger")<0&&ke.target.className.indexOf("expand-trigger")<0)return;const Be=this;ge(this),this.__resizeRAF__&&cancelFrame(this.__resizeRAF__),this.__resizeRAF__=requestFrame(function(){me(Be)&&(Be.__resizeLast__.width=Be.offsetWidth,Be.__resizeLast__.height=Be.offsetHeight,Be.__resizeListeners__.forEach(function(je){je.call(Be,ke)}))})};let Se=!1,$e="";ue="animationstart";const Te="Webkit Moz O ms".split(" ");let Re="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),Ae="";{const ke=document.createElement("fakeelement");if(ke.style.animationName!==void 0&&(Se=!0),Se===!1){for(let Be=0;Be div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',Te=Se.head||Se.getElementsByTagName("head")[0],Re=Se.createElement("style");Re.id="detectElementResize",Re.type="text/css",ne!=null&&Re.setAttribute("nonce",ne),Re.styleSheet?Re.styleSheet.cssText=$e:Re.appendChild(Se.createTextNode($e)),Te.appendChild(Re)}};return{addResizeListener:function(Se,$e){if(xe)Se.attachEvent("onresize",$e);else{if(!Se.__resizeTriggers__){const Te=Se.ownerDocument,Re=windowObject.getComputedStyle(Se);Re&&Re.position==="static"&&(Se.style.position="relative"),ve(Te),Se.__resizeLast__={},Se.__resizeListeners__=[],(Se.__resizeTriggers__=Te.createElement("div")).className="resize-triggers";const Ae=Te.createElement("div");Ae.className="expand-trigger",Ae.appendChild(Te.createElement("div"));const ke=Te.createElement("div");ke.className="contract-trigger",Se.__resizeTriggers__.appendChild(Ae),Se.__resizeTriggers__.appendChild(ke),Se.appendChild(Se.__resizeTriggers__),ge(Se),Se.addEventListener("scroll",ye,!0),ue&&(Se.__resizeTriggers__.__animationListener__=function(Ie){Ie.animationName===ce&&ge(Se)},Se.__resizeTriggers__.addEventListener(ue,Se.__resizeTriggers__.__animationListener__))}Se.__resizeListeners__.push($e)}},removeResizeListener:function(Se,$e){if(xe)Se.detachEvent("onresize",$e);else if(Se.__resizeListeners__.splice(Se.__resizeListeners__.indexOf($e),1),!Se.__resizeListeners__.length){Se.removeEventListener("scroll",ye,!0),Se.__resizeTriggers__.__animationListener__&&(Se.__resizeTriggers__.removeEventListener(ue,Se.__resizeTriggers__.__animationListener__),Se.__resizeTriggers__.__animationListener__=null);try{Se.__resizeTriggers__=!Se.removeChild(Se.__resizeTriggers__)}catch{}}}}}class AutoSizer extends reactExports.Component{constructor(...oe){super(...oe),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:ce,disableWidth:ue,onResize:pe}=this.props;if(this._parentNode){const me=window.getComputedStyle(this._parentNode)||{},ge=parseFloat(me.paddingLeft||"0"),ye=parseFloat(me.paddingRight||"0"),xe=parseFloat(me.paddingTop||"0"),ve=parseFloat(me.paddingBottom||"0"),_e=this._parentNode.getBoundingClientRect(),we=_e.height-xe-ve,Se=_e.width-ge-ye,$e=this._parentNode.offsetHeight-xe-ve,Te=this._parentNode.offsetWidth-ge-ye;(!ce&&(this.state.height!==$e||this.state.scaledHeight!==we)||!ue&&(this.state.width!==Te||this.state.scaledWidth!==Se))&&(this.setState({height:$e,width:Te,scaledHeight:we,scaledWidth:Se}),typeof pe=="function"&&pe({height:$e,scaledHeight:we,scaledWidth:Se,width:Te}))}},this._setRef=ce=>{this._autoSizer=ce}}componentDidMount(){const{nonce:oe}=this.props,ce=this._autoSizer?this._autoSizer.parentNode:null;if(ce!=null&&ce.ownerDocument&&ce.ownerDocument.defaultView&&ce instanceof ce.ownerDocument.defaultView.HTMLElement){this._parentNode=ce;const ue=ce.ownerDocument.defaultView.ResizeObserver;ue!=null?(this._resizeObserver=new ue(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(ce)):(this._detectElementResize=createDetectElementResize(oe),this._detectElementResize.addResizeListener(ce,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:oe,defaultHeight:ce,defaultWidth:ue,disableHeight:pe=!1,disableWidth:me=!1,doNotBailOutOnEmptyChildren:ge=!1,nonce:ye,onResize:xe,style:ve={},tagName:_e="div",...we}=this.props,{height:Se,scaledHeight:$e,scaledWidth:Te,width:Re}=this.state,Ae={overflow:"visible"},ke={};let Be=!1;return pe||(Se===0&&(Be=!0),Ae.height=0,ke.height=Se,ke.scaledHeight=$e),me||(Re===0&&(Be=!0),Ae.width=0,ke.width=Re,ke.scaledWidth=Te),ge&&(Be=!1),reactExports.createElement(_e,{ref:this._setRef,style:{...Ae,...ve},...we},!Be&&oe(ke))}}const treeWorkerUrl=""+new URL("tree.worker-sIhKZmHR.js",import.meta.url).href;class TreeWorkerUrl extends Worker{constructor(){super(treeWorkerUrl,{type:"module"})}}const treeAsync=usingMemoizedWorkerTask(TreeWorkerUrl);function useTree(ne){const oe=compilerRuntimeExports.c(3);let ce,ue;return oe[0]!==ne?(ce=async()=>await treeAsync(ne),ue=[ne],oe[0]=ne,oe[1]=ce,oe[2]=ue):(ce=oe[1],ue=oe[2]),useAsync(ce,ue)}function useTreeMemo(ne,oe){const ce=reactExports.useMemo(()=>ne,oe);return useTree(ce)}const isDefined$1=ne=>!lodashExports.isUndefined(ne)&&!lodashExports.isNull(ne),divider$4=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1}});function useCache(ne,oe){const ce=compilerRuntimeExports.c(4),ue=!1,[pe,me]=reactExports.useState();let ge,ye;return ce[0]!==ue||ce[1]!==ne?(ge=()=>{ne&&me(ne)},ye=[ne,ue],ce[0]=ue,ce[1]=ne,ce[2]=ge,ce[3]=ye):(ge=ce[2],ye=ce[3]),reactExports.useEffect(ge,ye),pe}const layoutModes={"directed-graph":{value:"directed-graph",name:"Directed Graph",description:"Show all edges",showAllEdges:!0},tree:{value:"tree",name:"Tree",description:"Show only edges between each node and their final parents",showAllEdges:!1}};function GraphEvents(ne){const oe=compilerRuntimeExports.c(7),{onSelection:ce,layer:ue}=ne,pe=v$5(),me=_$4();let ge;oe[0]!==ce||oe[1]!==me?(ge=()=>{me({clickNode:xe=>{ce==null||ce({event:xe.event.original,node:xe.node})},enterNode:_temp$p,leaveNode:_temp2$h})},oe[0]=ce,oe[1]=me,oe[2]=ge):ge=oe[2];let ye;return oe[3]!==ue||oe[4]!==me||oe[5]!==pe?(ye=[ue,me,pe],oe[3]=ue,oe[4]=me,oe[5]=pe,oe[6]=ye):ye=oe[6],reactExports.useEffect(ge,ye),null}function _temp2$h(){document.body.style.cursor=""}function _temp$p(){document.body.style.cursor="pointer"}const SEVEN_CLASS_GNBU=["#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"];function TreeGraph({trace:ne,tree:oe,step:ce=0,layer:ue,showAllEdges:pe,trackedProperty:me}){const ge=v$5(),[ye,xe]=reactExports.useState("vertical"),ve=usePaper(),_e=useAcrylic(),we=useTheme(),Se=interpolate$1([we.palette.background.paper,we.palette.text.primary]),$e=j$3(),Te=reactExports.useMemo(()=>getFinalParents(ne),[ne]),Re=reactExports.useMemo(()=>{const Ae=ye==="vertical",ke=new MultiDirectedGraph;lodashExports.forEach(oe,Ie=>{ke.addNode(Ie.label,{x:Ae?Ie.x:-Ie.y,y:Ae?Ie.y:-Ie.x,label:Ie.label,size:Math.log(Ie.size)+2,color:we.palette.action.disabledBackground})});const Be={};return lodashExports.forEach(ne==null?void 0:ne.events,({id:Ie,pId:Ne})=>{Ie&&Ne&&(Be[Ie]=Be[Ie]??new Set,Be[Ie].add(Ne))}),lodashExports.forEach(ne==null?void 0:ne.events,({id:Ie,pId:Ne})=>{if(isDefined$1(Ne)&&ke.hasNode(`${Ne}`)){const je=makeEdgeKey(Ie,Ne);!ke.hasEdge(je)&&ke.hasNode(`${Ie}`)&&ke.addDirectedEdgeWithKey(je,`${Ne}`,`${Ie}`,{label:"",color:"white",size:2,final:Te[Ie]===Ne}),ke.hasDirectedEdge(je)&&ke.updateEdgeAttribute(je,"size",ze=>Math.log(Math.E**(ze-.5)+.5)+.5)}}),ke},[$e,ne,oe,Te,ye]);return reactExports.useEffect(()=>{const Ae=memoizee$1(je=>interpolate$1([we.palette.background.paper,je])),ke=400,Be=Se(.1);Re.forEachNode(je=>{Re.setNodeAttribute(je,"color",Be),Re.setNodeAttribute(je,"forceLabel",!1),Re.setNodeAttribute(je,"label",lodashExports.truncate(je,{length:15}))}),Re.forEachEdge(je=>{const ze=Re.getEdgeAttribute(je,"final");Re.setEdgeAttribute(je,"color",Be),Re.setEdgeAttribute(je,"hidden",!pe&&!ze),Re.setEdgeAttribute(je,"forceLabel",!1),Re.setEdgeAttribute(je,"label","")});const Ie={},Ne={};if((pe?lodashExports.forEach:lodashExports.forEachRight)(lodashExports.slice(ne==null?void 0:ne.events,0,ce+1),({id:je,type:ze,pId:Ue},qe)=>{const Ke=getColorHex(ze),Ge=Ae(Ke)(lodashExports.max([1-(ce-qe)/ke,.2]));if(Re.hasNode(`${je}`)&&!Ie[je]){Re.setNodeAttribute(`${je}`,"color",Ge),Re.setNodeAttribute(`${je}`,"label",lodashExports.truncate(`${lodashExports.startCase(ze)} ${je}`,{length:15})),Re.setNodeAttribute(`${je}`,"forceLabel",ce===qe);const Ye=makeEdgeKey(je,Ue);isDefined$1(Ue)&&Re.hasNode(`${Ue}`)&&Re.hasEdge(Ye)&&!Ne[Ye]&&(Re.setEdgeAttribute(Ye,"forceLabel",ce===qe),Re.setEdgeAttribute(Ye,"color",Ge),Re.setEdgeAttribute(Ye,"label",`Step ${qe}`),Re.setEdgeAttribute(Ye,"hidden",!1),pe||(Ne[Ye]=!0)),pe||(Ie[je]=!0)}}),me){const je=lodashExports.min(lodashExports.map(ne==null?void 0:ne.events,Ke=>lodashExports.get(Ke,me))),ze=lodashExports.max(lodashExports.map(ne==null?void 0:ne.events,Ke=>lodashExports.get(Ke,me))),Ue=Ke=>isNaN(je)||isNaN(ze)||isNaN(Ke)?0:(Ke-je)/(ze-je),qe=interpolate$1(SEVEN_CLASS_GNBU);lodashExports.forEach(lodashExports.slice(ne==null?void 0:ne.events,0,ce+1),Ke=>{if(Re.hasNode(`${Ke.id}`)){const Ge=qe(Ue(lodashExports.get(Ke,me)));if(Re.setNodeAttribute(`${Ke.id}`,"color",Ge),isDefined$1(Ke.pId)){const Ye=makeEdgeKey(`${Ke.id}`,`${Ke.pId}`);Re.hasDirectedEdge(Ye)&&Re.setEdgeAttribute(Ye,"color",Ge)}}})}$e(Re)},[Re,ce,ne,pe,me,we]),jsxRuntimeExports.jsx(Stack,{sx:{pt:6,position:"absolute",top:0,left:0},children:jsxRuntimeExports.jsxs(Stack,{direction:"row",sx:{...ve(1),..._e,alignItems:"center",height:Ae=>Ae.spacing(6),px:1,m:1},children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{var Ae,ke,Be;(Be=(ke=(Ae=ge==null?void 0:ge.getCamera)==null?void 0:Ae.call(ge))==null?void 0:ke.animatedReset)==null||Be.call(ke)},label:"Fit",icon:jsxRuntimeExports.jsx(SvgIcon$g,{})}),divider$4,jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{xe(ye==="vertical"?"horizontal":"vertical")},label:"Rotate",icon:jsxRuntimeExports.jsx(SvgIcon$c,{})}),divider$4,jsxRuntimeExports.jsx(MinimisedPlaybackControls,{layer:ue})]})})}function makeEdgeKey(ne,oe){return`${ne}::${oe}`}const stepsLayerGuard$2=ne=>!!getController(ne).steps;function TreePage({template:ne}){var Je,Qe,Ze,Tt,Ut,Gt,Nt,Wt,Mt,Yt;const{key:oe,setKey:ce,layer:ue,layers:pe,allLayers:me}=useLayer(void 0,stepsLayerGuard$2),ge=useTheme(),{controls:ye,onChange:xe,state:ve,dragHandle:_e}=useViewTreeContext(),we=useThrottle(((Je=ue==null?void 0:ue.source)==null?void 0:Je.step)??0,1e3/24),{stepTo:Se}=usePlaybackState(oe),$e=reactExports.useMemo(()=>{var ir,tr,Qt;return lodashExports.chain((Qt=(tr=(ir=ue==null?void 0:ue.source)==null?void 0:ir.trace)==null?void 0:tr.content)==null?void 0:Qt.events).flatMap(lodashExports.keys).uniq().filter(er=>er!=="type").value()},[(Tt=(Ze=(Qe=ue==null?void 0:ue.source)==null?void 0:Qe.trace)==null?void 0:Ze.content)==null?void 0:Tt.events]),[Te,Re]=reactExports.useState(""),Ae=(Gt=(Ut=ue==null?void 0:ue.source)==null?void 0:Ut.trace)==null?void 0:Gt.content;reactExports.useEffect(()=>{Re("")},[Ae,Re]);const[ke,Be]=reactExports.useState(),{x:Ie,y:Ne}=ke?ke.event instanceof MouseEvent?{x:ke.event.clientX,y:ke.event.clientY}:{x:(Wt=(Nt=ke.event.touches)==null?void 0:Nt[0])==null?void 0:Wt.clientX,y:(Yt=(Mt=ke.event.touches)==null?void 0:Mt[0])==null?void 0:Yt.clientY}:{x:0,y:0},[je,ze]=reactExports.useState(!1),[Ue,qe]=reactExports.useState("tree"),Ke=reactExports.useMemo(()=>{const ir=lodashExports.filter(lodashExports.map(Ae==null?void 0:Ae.events,(tr,Qt)=>({event:tr,step:Qt})),tr=>`${tr.event.id}`===(ke==null?void 0:ke.node));return{events:ir,current:lodashExports.findLast(ir,tr=>tr.step<=we)}},[ke,we]),{result:Ge,loading:Ye}=useTreeMemo({trace:Ae,mode:Ue},[oe,Ue]),Xe=reactExports.useMemo(()=>({stagePadding:8*8,allowInvalidContainer:!0,edgeLabelColor:{color:ge.palette.text.secondary},labelFont:"Inter",labelSize:14,labelDensity:.1,renderEdgeLabels:!0,edgeLabelFont:"Inter",edgeLabelSize:12,defaultDrawNodeHover:()=>{},labelColor:{color:ge.palette.text.primary},edgeLabelWeight:"500",defaultEdgeType:"arrow",edgeProgramClasses:{straight:EdgeArrowProgram$1,curvedArrow:EdgeCurvedArrowProgram}}),[ge]);return jsxRuntimeExports.jsxs(ne,{onChange:xe,stack:ve,children:[jsxRuntimeExports.jsx(ne.Key,{children:"tree"}),jsxRuntimeExports.jsx(ne.Title,{children:"Tree"}),jsxRuntimeExports.jsx(ne.Handle,{children:_e}),jsxRuntimeExports.jsx(ne.Content,{children:jsxRuntimeExports.jsx(Flex,{children:Ae?Ye?jsxRuntimeExports.jsxs(Flex,{sx:{flexDirection:"column",gap:4,alignItems:"center",justifyContent:"center"},children:[jsxRuntimeExports.jsx(CircularProgress,{}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",sx:{px:8,maxWidth:480},children:"Generating layout"})]}):Ge!=null&&Ge.length?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AutoSizer,{children:ir=>jsxRuntimeExports.jsxs(S$4,{style:{...ir,background:ge.palette.background.paper},graph:MultiDirectedGraph,settings:Xe,children:[jsxRuntimeExports.jsx(TreeGraph,{step:we,tree:Ge,trace:Ae,layer:ue,showAllEdges:layoutModes[Ue].showAllEdges,trackedProperty:Te}),jsxRuntimeExports.jsx(GraphEvents,{layer:oe,onSelection:tr=>{Be(tr),ze(!0)}})]})}),jsxRuntimeExports.jsx(Menu,{onClose:()=>ze(!1),anchorReference:"anchorPosition",anchorPosition:{left:Ie,top:Ne},transformOrigin:{horizontal:"left",vertical:"top"},open:je,children:jsxRuntimeExports.jsxs(MenuList,{dense:!0,sx:{p:0},children:[!!Ke.current&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ListItem,{sx:{py:0},children:jsxRuntimeExports.jsxs(Typography,{component:"div",color:"text.secondary",variant:"overline",children:["Step ",Ke.current.step]})}),jsxRuntimeExports.jsx(Box,{px:2,py:1,children:jsxRuntimeExports.jsx(PropertyList,{event:Ke.current.event,vertical:!0,simple:!0,primitives:!0})}),jsxRuntimeExports.jsx(Divider,{sx:{my:1,mx:2}})]}),jsxRuntimeExports.jsx(ListItem,{sx:{py:0},children:jsxRuntimeExports.jsxs(Typography,{component:"div",color:"text.secondary",variant:"overline",children:["Events at ",ke==null?void 0:ke.node]})}),lodashExports.map(Ke.events,(ir,tr,Qt)=>{var hr;const er=((hr=lodashExports.findLast(Qt,cr=>cr.step<=we))==null?void 0:hr.step)===ir.step;return jsxRuntimeExports.jsxs(Stack,{direction:"row",children:[jsxRuntimeExports.jsx(MenuItem,{selected:er,sx:{height:32,flex:1,borderLeft:`4px solid ${getColorHex(ir.event.type)}`},onClick:()=>{Se(ir.step)},children:jsxRuntimeExports.jsx(Tooltip,{title:`Go to step ${ir.step}`,children:jsxRuntimeExports.jsx(Box,{sx:{ml:-.5,pr:4},children:jsxRuntimeExports.jsx(Label$1,{primary:lodashExports.startCase(ir.event.type),secondary:isDefined$1(ir.event.pId)?`Step ${ir.step}, from ${ir.event.pId}`:`Step ${ir.step}`})})})}),jsxRuntimeExports.jsx(Box,{sx:{flex:0},children:jsxRuntimeExports.jsx(PropertyDialog,{event:ir.event,trigger:cr=>jsxRuntimeExports.jsx(MenuItem,{selected:er,onClick:cr,sx:{pr:0},children:jsxRuntimeExports.jsx(Tooltip,{title:"See all properties",children:jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(SvgIcon$S,{})})})})})})]})})]})})]}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$10,{}),label:"Graph",secondary:`${inferLayerName(ue)} is not a graph.`}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$10,{}),label:"Graph",secondary:"When you load a trace that has tree-like data, you'll see it here as a decision tree."})})}),jsxRuntimeExports.jsxs(ne.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),label:"Layer",value:oe,items:lodashExports.map(me,ir=>({id:ir.key,hidden:!lodashExports.find(pe,{key:ir.key}),name:inferLayerName(ir)})),onChange:ce,arrow:!0,ellipsis:12}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$C,{}),label:"Layout",value:Ue,onChange:qe,items:lodashExports.map(lodashExports.entries(layoutModes),([ir,tr])=>({id:ir,...tr})),arrow:!0}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$r,{}),label:"Tracked Property",value:Te,onChange:Re,items:[{id:"",name:"Off"},...lodashExports.map($e,ir=>({id:ir,name:`$.${ir}`}))],arrow:!0})]}),jsxRuntimeExports.jsx(ne.Extras,{children:ye})]})}function getFinalParents(ne){const oe={};return lodashExports.forEach(ne==null?void 0:ne.events,({id:ce,pId:ue})=>{oe[ce]=ue}),oe}function SelectionMenu(ne){const oe=compilerRuntimeExports.c(17),{selection:ce,onClose:ue}=ne,pe=useSelectionMenu(),me=useCache(ce);let ge;oe[0]!==ce?(ge=ce??{},oe[0]=ce,oe[1]=ge):ge=oe[1];const{client:ye}=ge,xe=!!ce,ve=(ye==null?void 0:ye.y)??0,_e=(ye==null?void 0:ye.x)??0;let we;oe[2]!==ve||oe[3]!==_e?(we={top:ve,left:_e},oe[2]=ve,oe[3]=_e,oe[4]=we):we=oe[4];let Se;oe[5]===Symbol.for("react.memo_cache_sentinel")?(Se={py:0},oe[5]=Se):Se=oe[5];let $e;oe[6]!==ue?($e=Ae=>{const ke=lodashExports.entries(Ae);return ke.length?lodashExports.chain(ke).sortBy(_temp$o).map((Be,Ie)=>{const[,Ne]=Be,{items:je,primary:ze}=Ne;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!Ie&&jsxRuntimeExports.jsx(Divider,{sx:{my:1,mx:2}}),ze&&jsxRuntimeExports.jsx(ListItem,{sx:{py:0},children:jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",variant:"overline",children:ze})}),lodashExports.chain(je).entries().sortBy(_temp2$g).map(Ue=>{const[qe,Ke]=Ue,{action:Ge,icon:Ye,primary:Xe,secondary:Je,extras:Qe}=Ke;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!(Ge||Xe||Je)&&(Ge?jsxRuntimeExports.jsxs(MenuItem,{onClick:()=>{Ge==null||Ge(),ue==null||ue()},children:[Ye&&jsxRuntimeExports.jsx(ListItemIcon,{children:Ye}),jsxRuntimeExports.jsx(ListItemText,{primary:Xe,sx:{mr:4}}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:Je})]},qe):jsxRuntimeExports.jsxs(ListItem,{children:[Ye&&jsxRuntimeExports.jsx(ListItemIcon,{children:Ye}),jsxRuntimeExports.jsx(ListItemText,{primary:Xe,sx:{mr:4}}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:Je})]},qe)),!!Qe&&Qe]})}).value()]})}).value():jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ListItem,{children:jsxRuntimeExports.jsx(Typography,{component:"div",children:"No info to show."})})})},oe[6]=ue,oe[7]=$e):$e=oe[7];let Te;oe[8]!==pe||oe[9]!==me||oe[10]!==$e?(Te=jsxRuntimeExports.jsx(MenuList,{dense:!0,sx:Se,children:jsxRuntimeExports.jsx(pe,{event:me,children:$e})}),oe[8]=pe,oe[9]=me,oe[10]=$e,oe[11]=Te):Te=oe[11];let Re;return oe[12]!==ue||oe[13]!==xe||oe[14]!==we||oe[15]!==Te?(Re=jsxRuntimeExports.jsx(Menu,{open:xe,anchorReference:"anchorPosition",anchorPosition:we,onClose:ue,keepMounted:!0,children:Te}),oe[12]=ue,oe[13]=xe,oe[14]=we,oe[15]=Te,oe[16]=Re):Re=oe[16],Re}function _temp2$g(ne){const[,oe]=ne;return oe.index}function _temp$o(ne){const[,oe]=ne;return oe.index}const identity$1=({children:ne})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne==null?void 0:ne({})});function useSelectionMenu(){const ne=compilerRuntimeExports.c(2),[oe]=useLayers(),{layers:ce}=oe;let ue,pe;return ne[0]!==ce?(pe=lodashExports.chain(ce).reduce(_temp3$a,identity$1).value(),ne[0]=ce,ne[1]=pe):pe=ne[1],ue=pe,ue}function _temp3$a(ne,oe){var ue;const ce=((ue=getController(oe))==null?void 0:ue.provideSelectionInfo)??identity$1;return pe=>{const{children:me,event:ge}=pe;return jsxRuntimeExports.jsx(ce,{layer:oe.key,event:ge,children:ye=>jsxRuntimeExports.jsx(ne,{event:ge,children:xe=>me==null?void 0:me(lodashExports.merge(ye,xe))})})}}const TILE_RESOLUTION=128,tileSize=(ne=!1)=>(ne?.75:devicePixelRatio*2)*TILE_RESOLUTION,rendererOptions={tileSubdivision:2,workerCount:lodashExports.clamp(lodashExports.floor((navigator.hardwareConcurrency-1)/2),1,12),tileResolution:{width:tileSize(),height:tileSize()}},TraceRendererContext=reactExports.createContext({});function useRendererInstance(){return reactExports.useContext(TraceRendererContext)}function useRenderer(ne,{width:oe,height:ce}={}){const ue=useTheme(),[pe]=useRenderers(),me=reactExports.useRef(null),[ge,ye]=reactExports.useState(""),[xe,ve]=reactExports.useState();return reactExports.useEffect(()=>{if(me.current&&oe&&ce&&ne){const _e=lodashExports.find(pe,we=>we.renderer.meta.id===ne);if(_e)try{const we=new _e.renderer.constructor;we.setup({...rendererOptions,screenSize:{width:oe,height:ce},backgroundColor:ue.palette.background.paper,accentColor:ue.palette.primary.main}),me.current.append(we.getView()),ve(we),ye("");const Se=me.current;return()=>{try{Se.removeChild(we.getView()),ve(void 0)}catch($e){console.warn($e)}finally{we.destroy()}}}catch(we){ye(`${_e.renderer.meta.name}: ${lodashExports.get(we,"message")}`),ve(void 0)}}},[me.current,lodashExports.map,ne,pe,ue,ye,ve]),useDebounce(()=>{xe&&oe&&ce&&xe.setOptions({screenSize:{width:oe,height:ce}})},ue.transitions.duration.standard,[xe,oe,ce]),{instance:xe,ref:me,error:ge}}function TraceRendererCircularProgress(){const ne=compilerRuntimeExports.c(3),[oe]=useLoading(),{map:ce,specimen:ue}=oe;let pe;return ne[0]!==ce||ne[1]!==ue?(pe=!!(ce||ue)&&jsxRuntimeExports.jsx(CircularProgress,{sx:{position:"absolute",top:_temp$n,right:_temp2$f}}),ne[0]=ce,ne[1]=ue,ne[2]=pe):pe=ne[2],pe}function _temp2$f(ne){return ne.spacing(2)}function _temp$n(ne){return ne.spacing(8)}const VIEWPORT_PAGE_DESCRIPTION="When you create a layer, you'll see it visualised here.";function TraceRenderer({width:ne,height:oe,renderer:ce,rendererRef:ue,layers:pe}){const me=reactExports.useMemo(nanoid,[]),{instance:ge,error:ye,ref:xe}=useRenderer(ce,{width:ne,height:oe}),{playing:ve}=usePlaybackState(),[,_e]=useScreenshots(),[we,Se]=reactExports.useState();reactExports.useEffect(()=>{if(ge){const Te=(Re,Ae)=>{const ke=Re;Se({client:{x:ke.clientX,y:ke.clientY},world:Ae.world,info:{point:Ae.world,components:Ae.components}})};return ge.on("click",Te),()=>void ge.off("click",Te)}},[ge]);const $e=reactExports.useMemo(()=>({renderer:ge}),[ge]);return reactExports.useEffect(()=>ue==null?void 0:ue(ge),[ge,ue]),reactExports.useEffect(()=>{const Te=async()=>{var Re;return await((Re=ge==null?void 0:ge.toDataUrl)==null?void 0:Re.call(ge))};return _e(()=>({[me]:Te})),()=>_e(()=>({[me]:void 0}))},[me,ge]),reactExports.useEffect(()=>{ge&&ge.setOptions({tileResolution:{width:tileSize(ve),height:tileSize(ve)}})},[ge,ve]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TraceRendererCircularProgress,{}),jsxRuntimeExports.jsx(TraceRendererContext.Provider,{value:$e,children:jsxRuntimeExports.jsx(Box,{sx:{width:ne,height:oe},children:pe!=null&&pe.length?jsxRuntimeExports.jsx(TrustedContent,{children:ye?jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",width:ne,height:oe,alignItems:"center",justifyContent:"center",color:"text.secondary"},children:[jsxRuntimeExports.jsx(SvgIcon$X,{sx:{mb:2},fontSize:"large"}),ye]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box,{ref:xe,children:pe.map((Te,Re)=>jsxRuntimeExports.jsx(RenderLayer,{index:Re,layer:Te},Te.key))})})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$o,{}),label:"Viewport",width:ne,height:oe,secondary:VIEWPORT_PAGE_DESCRIPTION})})}),jsxRuntimeExports.jsx(SelectionMenu,{selection:we,onClose:()=>Se(void 0)})]})}function NodeList({nodes:ne,start:oe=0,end:ce=(ne==null?void 0:ne.length)??0}){const{renderer:ue}=useRendererInstance();return reactExports.useEffect(()=>{if(ue&&(ne!=null&&ne.length))return ue.add(lodashExports.slice(ne,oe,ce).flat())},[ue,ne,oe,ce]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function NodeList2(ne){const oe=compilerRuntimeExports.c(5),{nodes:ce}=ne,{renderer:ue}=useRendererInstance();let pe,me;oe[0]!==ce||oe[1]!==ue?(pe=()=>{if(ue&&(ce!=null&&ce.length))return ue.add(ce)},me=[ue,ce],oe[0]=ce,oe[1]=ue,oe[2]=pe,oe[3]=me):(pe=oe[2],me=oe[3]),reactExports.useEffect(pe,me);let ge;return oe[4]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),oe[4]=ge):ge=oe[4],ge}function LazyNodeList({nodes:ne,end:oe}){const ue=lodashExports.floor((oe??0)/100)*100,pe=reactExports.useMemo(()=>lodashExports.slice(ne,0,ue),[ne,ue]),me=reactExports.useMemo(()=>lodashExports.slice(ne,ue,(oe??0)+1),[ne,ue,oe]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!ue&&jsxRuntimeExports.jsx(NodeList,{nodes:pe}),me.map((ge,ye)=>jsxRuntimeExports.jsx(NodeList2,{nodes:ge},ue+ye))]})}const useEffectWhen=(ne,oe,ce)=>{const ue=compilerRuntimeExports.c(6),pe=usePrevious$1(ce);let me;ue[0]!==ne||ue[1]!==pe||ue[2]!==ce?(me=()=>{allSame(ce,pe)||ne()},ue[0]=ne,ue[1]=pe,ue[2]=ce,ue[3]=me):me=ue[3];let ge;return ue[4]!==oe?(ge=[oe],ue[4]=oe,ue[5]=ge):ge=ue[5],reactExports.useEffect(me,ge)};function allSame(ne,oe){return lodashExports.zip(ne,oe).every(([ce,ue])=>ce===ue)}const useEffectWhenAsync=(ne,oe,ce)=>{const ue=compilerRuntimeExports.c(12);let pe;ue[0]!==oe?(pe=oe===void 0?[]:oe,ue[0]=oe,ue[1]=pe):pe=ue[1];const me=pe;let ge;ue[2]!==ce?(ge=ce===void 0?[]:ce,ue[2]=ce,ue[3]=ge):ge=ue[3];const ye=ge,[xe,ve]=reactExports.useState(me),[_e,we]=reactExports.useState(ye);let Se,$e;ue[4]!==me||ue[5]!==_e||ue[6]!==ye?(Se=()=>{allSame(_e,ye)||(ve(me),we(ye))},$e=[me,ye,_e],ue[4]=me,ue[5]=_e,ue[6]=ye,ue[7]=Se,ue[8]=$e):(Se=ue[7],$e=ue[8]),reactExports.useEffect(Se,$e);let Te;return ue[9]!==xe||ue[10]!==_e?(Te=[...xe,..._e],ue[9]=xe,ue[10]=_e,ue[11]=Te):Te=ue[11],useAsyncAbortable(ne,Te)};function useConnectionResolver(){const ne=compilerRuntimeExports.c(2),[oe]=useConnections();let ce;return ne[0]!==oe?(ce=ue=>lodashExports.find(oe,ue),ne[0]=oe,ne[1]=ce):ce=ne[1],ce}function useConnection(ne){const oe=compilerRuntimeExports.c(3),ce=useConnectionResolver();let ue;return oe[0]!==ce||oe[1]!==ne?(ue=ce({url:ne}),oe[0]=ce,oe[1]=ne,oe[2]=ue):ue=oe[2],ue}function useMapContent(ne){const oe=compilerRuntimeExports.c(17),ce=useSnackbar(),ue=useLoadingState("map"),pe=useConnectionResolver();let me,ge;oe[0]!==ce||oe[1]!==pe?(ge=memoizee$1(async Te=>{const{source:Re,id:Ae}=Te===void 0?{}:Te;if(Re&&Ae){const ke=pe({url:Re});if(ke){ce("Fetching map...");const Be=await ke.transport().call("features/map",{id:Ae});return Be==null?void 0:Be.content}}},{normalizer:JSON.stringify}),oe[0]=ce,oe[1]=pe,oe[2]=ge):ge=oe[2],me=ge;const ye=me;let xe;oe[3]!==ne?(xe=ne??{},oe[3]=ne,oe[4]=xe):xe=oe[4];const{content:ve,source:_e,id:we}=xe;let Se;oe[5]!==ve||oe[6]!==ye||oe[7]!==we||oe[8]!==ne||oe[9]!==_e||oe[10]!==ue?(Se=()=>ue(async()=>{if(we)return{...ne,content:ve||await ye({source:_e,id:we})}}),oe[5]=ve,oe[6]=ye,oe[7]=we,oe[8]=ne,oe[9]=_e,oe[10]=ue,oe[11]=Se):Se=oe[11];let $e;return oe[12]!==ve||oe[13]!==ye||oe[14]!==we||oe[15]!==_e?($e=[ye,ve,_e,we],oe[12]=ve,oe[13]=ye,oe[14]=we,oe[15]=_e,oe[16]=$e):$e=oe[16],useAsync(Se,$e)}const noop$6=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});function useMapOptions(ne){const oe=compilerRuntimeExports.c(8);let ce;oe[0]!==ne?(ce=ne??{},oe[0]=ne,oe[1]=ce):ce=oe[1];const{format:ue}=ce;let pe;oe[2]!==ue||oe[3]!==(ne==null?void 0:ne.content)?(pe=async()=>{var ye,xe;return await((xe=(ye=getParser(ue))==null?void 0:ye.editor)==null?void 0:xe.call(ye,ne==null?void 0:ne.content))??noop$6},oe[2]=ue,oe[3]=ne==null?void 0:ne.content,oe[4]=pe):pe=oe[4];const me=ne==null?void 0:ne.content;let ge;return oe[5]!==ue||oe[6]!==me?(ge=[ue,me],oe[5]=ue,oe[6]=me,oe[7]=ge):ge=oe[7],useAsync(pe,ge)}function useParsedMap(ne,oe){const ce=useSnackbar(),ue=useTheme(),pe=useLoadingState("map"),{format:me,content:ge}=ne??{};return useAsync(()=>pe(async()=>{var ye,xe;if(me&&ge){ce("Processing map...");try{const ve=await((xe=(ye=getParser(me))==null?void 0:ye.parse)==null?void 0:xe.call(ye,ge,{color:ue.palette.text.primary,background:ue.palette.background.paper,...oe}))??{nodes:[]};return ce("Map loaded",`${ve.nodes.length} elements, ${ve.log.join(", ")}`),{...ne,...ve}}catch(ve){return console.error(ve),ce("Error parsing",lodashExports.get(ve,"message")),{error:lodashExports.get(ve,"message")}}}}),[me,ge,ue,oe])}const controller$2={key:"map",icon:jsxRuntimeExports.jsx(SvgIcon$D,{}),inferName:ne=>{var oe;return(oe=ne==null?void 0:ne.source)!=null&&oe.map?`${ne.source.map.name} (${lodashExports.startCase(ne.source.map.format)})`:"Untitled Map"},error:ne=>{var oe,ce;return(ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.parsedMap)==null?void 0:ce.error},compress:ne=>lodashExports.pick(ne,["map","options"]),claimImportedFile:async ne=>lodashExports.keys(mapParsers).includes(ext$1(ne.name))?{claimed:!0,layer:async oe=>{oe("Opening map...");try{return{map:{...await readUploadedMap(ne,lodashExports.entries(mapParsers).map(([ue])=>({id:ue}))).read()}}}catch(ce){return console.error(ce),oe(`Error opening, ${lodashExports.get(ce,"message")}`),{map:{key:nanoid(),id:custom$1().id,error:lodashExports.get(ce,"message"),name:lodashExports.startCase(name$2(ne.name))}}}}}:{claimed:!1},editor:withProduce(({value:ne,produce:oe})=>{var pe,me,ge;const ce=(pe=ne==null?void 0:ne.source)==null?void 0:pe.parsedMap,{result:ue}=useMapOptions(ce);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Source",content:jsxRuntimeExports.jsx(MapPicker,{value:(me=ne==null?void 0:ne.source)==null?void 0:me.map,onChange:ye=>oe(xe=>lodashExports.set(xe,"source.map",ye))})}),(ce==null?void 0:ce.error)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"error",sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:ce==null?void 0:ce.error})}),!!ce&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Heading,{label:"Map Options"}),ue?jsxRuntimeExports.jsx(ue,{value:(ge=ne==null?void 0:ne.source)==null?void 0:ge.options,onChange:ye=>oe(xe=>{var ve;lodashExports.set(xe,"source.options",ye(((ve=xe.source)==null?void 0:ve.options)??{}))})}):jsxRuntimeExports.jsx(CircularProgress,{sx:{mt:2}})]})]})}),renderer:({layer:ne,index:oe})=>{var pe;const{nodes:ce}=((pe=ne==null?void 0:ne.source)==null?void 0:pe.parsedMap)??{},ue=reactExports.useMemo(()=>[lodashExports.map(ce,me=>({...me,meta:{...me.meta,sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))],[ce,oe,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode]);return jsxRuntimeExports.jsx(NodeList,{nodes:ue})},service:withProduce(({value:ne,produce:oe})=>{var me,ge;const{result:ce}=useMapContent((me=ne==null?void 0:ne.source)==null?void 0:me.map),{result:ue,loading:pe}=useParsedMap(ce,(ge=ne==null?void 0:ne.source)==null?void 0:ge.options);return useEffectWhen(()=>{pe||oe(ye=>{lodashExports.set(ye,"source.parsedMap",ue),lodashExports.set(ye,"viewKey",nanoid())})},[ue,oe,pe],[ue]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}),provideSelectionInfo:({children:ne,event:oe,layer:ce})=>{const{layer:ue,setLayer:pe,layers:me}=useLayer(ce),{parsedMap:ge}=(ue==null?void 0:ue.source)??{},{point:ye,node:xe}=reactExports.useMemo(()=>{var _e,we,Se,$e;if(ge&&oe){const Te=($e=(Se=getParser((we=(_e=ue==null?void 0:ue.source)==null?void 0:_e.map)==null?void 0:we.format))==null?void 0:Se.hydrate)==null?void 0:$e.call(Se,ge);if(Te){const Re=(oe==null?void 0:oe.world)&&Te.snap(oe.world);if(Re){const Ae=(oe==null?void 0:oe.world)&&Te.nodeAt(Re);return{point:Re,node:Ae}}}}return{}},[ge,oe]),ve=reactExports.useMemo(()=>({...ue&&ye&&!lodashExports.isUndefined(xe)&&{[ue.key]:{primary:inferLayerName(ue),items:{point:{primary:"Point",secondary:`(${lodashExports.round(ye.x,2)}, ${lodashExports.round(ye.y,2)})`}}}}}),[ye,xe,ue,me,pe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne==null?void 0:ne(ve)})},getSources:ne=>{var ue,pe;const oe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.map,ce=(pe=ne==null?void 0:ne.source)==null?void 0:pe.parsedMap;return oe?[{id:"map",name:`${oe.name}`,language:"txt",content:ce==null?void 0:ce.content}]:[]},onEditSource:(ne,oe,ce)=>ne};function _defineProperty$1(ne,oe,ce){return oe in ne?Object.defineProperty(ne,oe,{value:ce,enumerable:!0,configurable:!0,writable:!0}):ne[oe]=ce,ne}function ownKeys$1(ne,oe){var ce=Object.keys(ne);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(ne);oe&&(ue=ue.filter(function(pe){return Object.getOwnPropertyDescriptor(ne,pe).enumerable})),ce.push.apply(ce,ue)}return ce}function _objectSpread2$1(ne){for(var oe=1;oe=0)&&(ce[pe]=ne[pe]);return ce}function _objectWithoutProperties(ne,oe){if(ne==null)return{};var ce=_objectWithoutPropertiesLoose(ne,oe),ue,pe;if(Object.getOwnPropertySymbols){var me=Object.getOwnPropertySymbols(ne);for(pe=0;pe=0)&&Object.prototype.propertyIsEnumerable.call(ne,ue)&&(ce[ue]=ne[ue])}return ce}function _slicedToArray(ne,oe){return _arrayWithHoles(ne)||_iterableToArrayLimit(ne,oe)||_unsupportedIterableToArray(ne,oe)||_nonIterableRest()}function _arrayWithHoles(ne){if(Array.isArray(ne))return ne}function _iterableToArrayLimit(ne,oe){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(ne)))){var ce=[],ue=!0,pe=!1,me=void 0;try{for(var ge=ne[Symbol.iterator](),ye;!(ue=(ye=ge.next()).done)&&(ce.push(ye.value),!(oe&&ce.length===oe));ue=!0);}catch(xe){pe=!0,me=xe}finally{try{!ue&&ge.return!=null&&ge.return()}finally{if(pe)throw me}}return ce}}function _unsupportedIterableToArray(ne,oe){if(ne){if(typeof ne=="string")return _arrayLikeToArray(ne,oe);var ce=Object.prototype.toString.call(ne).slice(8,-1);if(ce==="Object"&&ne.constructor&&(ce=ne.constructor.name),ce==="Map"||ce==="Set")return Array.from(ne);if(ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ce))return _arrayLikeToArray(ne,oe)}}function _arrayLikeToArray(ne,oe){(oe==null||oe>ne.length)&&(oe=ne.length);for(var ce=0,ue=new Array(oe);ce+pe);return ue<-2||ue>4?jsxRuntimeExports.jsxs("span",{children:[ce,"x10",jsxRuntimeExports.jsx("sup",{style:supProps,children:ue})]}):lodashExports.round(ne,2)}else return ne;case"string":return`${ne}`;case"undefined":return"null";default:return oe?jsxRuntimeExports.jsx("code",{children:lodashExports.isNull(ne)?"null":lodashExports.get(ne,"constructor.name")??typeof ne}):jsxRuntimeExports.jsx("code",{style:{whiteSpace:"pre"},children:lodashExports.truncate(beautify$1(ne,void 0,2),{length:100})})}}function Property(ne){const oe=compilerRuntimeExports.c(17),{label:ce,value:ue,type:pe,simple:me}=ne,ge=`${ce}::${renderProperty(ue)}`,ye=pe==null?void 0:pe.sx;let xe;oe[0]!==ye?(xe={opacity:.54,...ye},oe[0]=ye,oe[1]=xe):xe=oe[1];let ve;oe[2]!==ce||oe[3]!==xe||oe[4]!==pe?(ve=jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",...pe,sx:xe,children:ce}),oe[2]=ce,oe[3]=xe,oe[4]=pe,oe[5]=ve):ve=oe[5];let _e;oe[6]===Symbol.for("react.memo_cache_sentinel")?(_e=jsxRuntimeExports.jsx(Space,{}),oe[6]=_e):_e=oe[6];let we;oe[7]!==me||oe[8]!==ue?(we=renderProperty(ue,me)??"none",oe[7]=me,oe[8]=ue,oe[9]=we):we=oe[9];let Se;oe[10]!==we||oe[11]!==pe?(Se=jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",...pe,children:we}),oe[10]=we,oe[11]=pe,oe[12]=Se):Se=oe[12];let $e;return oe[13]!==ge||oe[14]!==ve||oe[15]!==Se?($e=jsxRuntimeExports.jsxs(Flex,{width:"auto",mr:2,mb:.5,alignItems:"baseline",children:[ve,_e,Se]},ge),oe[13]=ge,oe[14]=ve,oe[15]=Se,oe[16]=$e):$e=oe[16],$e}const COMMON_PROPS=["type"],OMIT_PROPS=[...COMMON_PROPS,"id"],ESSENTIAL_PROPS=["id"],GRAPH_PROPS=[...ESSENTIAL_PROPS,"pId"],HEURISTIC_PROPS=["f","g"],ALL_PROPS=[...OMIT_PROPS,...GRAPH_PROPS,...HEURISTIC_PROPS],sortEventKeys=ne=>lodashExports.chain(ne).entries().filter(([,oe])=>!lodashExports.isUndefined(oe)).sortBy(([oe])=>lodashExports.indexOf(ALL_PROPS,oe)+1||Number.MAX_SAFE_INTEGER).value();function PropertyDialog(ne){const oe=compilerRuntimeExports.c(9);let ce,ue,pe;if(oe[0]!==ne){const{event:ye,max:xe,simple:ve,variant:_e,...we}=ne;ce=ye,pe=xe,ue=we,oe[0]=ne,oe[1]=ce,oe[2]=ue,oe[3]=pe}else ce=oe[1],ue=oe[2],pe=oe[3];const me=pe===void 0?10:pe;let ge;if(oe[4]!==ce||oe[5]!==me||oe[6]!==ue){const ye=sortEventKeys(ce);let xe;oe[8]===Symbol.for("react.memo_cache_sentinel")?(xe=jsxRuntimeExports.jsx(AppBarTitle,{children:"Event Properties"}),oe[8]=xe):xe=oe[8],ge=jsxRuntimeExports.jsx(ManagedModal,{...lodashExports.merge({appBar:{children:xe},trigger:ve=>jsxRuntimeExports.jsxs(Button$1,{variant:"text",sx:{mx:-1,minWidth:0,width:"fit-content",color:_temp$q,justifyContent:"left"},onClick:_e=>{_e.stopPropagation(),_e.preventDefault(),ve(_e)},children:[ye.length-me," more"]})},ue),children:[{name:"common",props:lodashExports.filter(ye,_temp2$i)},{name:"Graph",props:lodashExports.filter(ye,_temp3$b)},{name:"Heuristic",props:lodashExports.filter(ye,_temp4$6)},{name:"other",props:lodashExports.filter(ye,_temp5$3)}].map(_temp7$3)}),oe[4]=ce,oe[5]=me,oe[6]=ue,oe[7]=ge}else ge=oe[7];return ge}function _temp7$3(ne,oe){const{name:ce,props:ue}=ne;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!!oe&&jsxRuntimeExports.jsx(Divider,{sx:{mb:1}}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"overline",color:"text.secondary",sx:{px:3},children:lodashExports.startCase(ce)}),jsxRuntimeExports.jsx(Box,{sx:{p:1,pt:0,display:"grid",gridAutoFlow:"row",gridTemplateColumns:"repeat(2, 1fr)"},children:lodashExports.map(ue,_temp6$3)},ce)]},ce)}function _temp6$3(ne){const[oe,ce]=ne;return jsxRuntimeExports.jsx(ListItem,{sx:{py:.5},children:jsxRuntimeExports.jsx(ListItemText,{secondary:oe,primary:renderProperty(ce)})},`${oe}::${ce}`)}function _temp5$3(ne){const[oe]=ne;return!ALL_PROPS.includes(oe)}function _temp4$6(ne){const[oe]=ne;return HEURISTIC_PROPS.includes(oe)}function _temp3$b(ne){const[oe]=ne;return GRAPH_PROPS.includes(oe)}function _temp2$i(ne){const[oe]=ne;return COMMON_PROPS.includes(oe)}function _temp$q(ne){return ne.palette.text.secondary}function PropertyList(ne){const oe=compilerRuntimeExports.c(32);let ce,ue,pe,me,ge,ye;oe[0]!==ne?({event:ce,variant:ge,max:ye,simple:me,primitives:ue,...pe}=ne,oe[0]=ne,oe[1]=ce,oe[2]=ue,oe[3]=pe,oe[4]=me,oe[5]=ge,oe[6]=ye):(ce=oe[1],ue=oe[2],pe=oe[3],me=oe[4],ge=oe[5],ye=oe[6]);const xe=ge===void 0?"body2":ge,ve=ye===void 0?10:ye;let _e,we,Se,$e;if(oe[7]!==ce||oe[8]!==ve||oe[9]!==ue||oe[10]!==pe||oe[11]!==me||oe[12]!==xe){we=sortEventKeys(ce),_e=Flex,Se=pe;let Ae;oe[17]!==ue?(Ae=ue?_temp8$1:lodashExports.constant(!0),oe[17]=ue,oe[18]=Ae):Ae=oe[18];let ke;oe[19]!==me||oe[20]!==xe?(ke=(Be,Ie)=>{const[Ne,je]=Be;return jsxRuntimeExports.jsx(Property,{label:Ne,value:je,type:{variant:xe},simple:me},Ie)},oe[19]=me,oe[20]=xe,oe[21]=ke):ke=oe[21],$e=lodashExports.chain(we).filter(Ae).slice(0,ve).map(ke).value(),oe[7]=ce,oe[8]=ve,oe[9]=ue,oe[10]=pe,oe[11]=me,oe[12]=xe,oe[13]=_e,oe[14]=we,oe[15]=Se,oe[16]=$e}else _e=oe[13],we=oe[14],Se=oe[15],$e=oe[16];let Te;oe[22]!==ve||oe[23]!==ne||oe[24]!==me||oe[25]!==we.length?(Te=we.length>ve&&!me&&jsxRuntimeExports.jsx(PropertyDialog,{...ne}),oe[22]=ve,oe[23]=ne,oe[24]=me,oe[25]=we.length,oe[26]=Te):Te=oe[26];let Re;return oe[27]!==_e||oe[28]!==Se||oe[29]!==$e||oe[30]!==Te?(Re=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(_e,{...Se,children:[$e,Te]})}),oe[27]=_e,oe[28]=Se,oe[29]=$e,oe[30]=Te,oe[31]=Re):Re=oe[31],Re}function _temp8$1(ne){const[,oe]=ne;return isPrimitive(oe)}function isPrimitive(ne){return lodashExports.isString(ne)||lodashExports.isNumber(ne)}var t$3,e$2,s$2,i$3;(function(ne){ne.HEX="HEX",ne.RGB="RGB",ne.HSL="HSL",ne.CIELab="CIELab",ne.CMYK="CMYK"})(t$3||(t$3={})),function(ne){ne.ANALOGOUS="ANALOGOUS",ne.COMPLEMENTARY="COMPLEMENTARY",ne.SPLIT_COMPLEMENTARY="SPLIT_COMPLEMENTARY",ne.TRIADIC="TRIADIC",ne.TETRADIC="TETRADIC",ne.SQUARE="SQUARE"}(e$2||(e$2={})),function(ne){ne.ADDITIVE="ADDITIVE",ne.SUBTRACTIVE="SUBTRACTIVE"}(s$2||(s$2={})),function(ne){ne.black="#000000",ne.silver="#C0C0C0",ne.gray="#808080",ne.white="#FFFFFF",ne.maroon="#800000",ne.red="#FF0000",ne.purple="#800080",ne.fuchsia="#FF00FF",ne.green="#008000",ne.lime="#00FF00",ne.olive="#808000",ne.yellow="#FFFF00",ne.navy="#000080",ne.blue="#0000FF",ne.teal="#008080",ne.aqua="#00FFFF",ne.orange="#FFA500",ne.aliceblue="#F0F8FF",ne.antiquewhite="#FAEBD7",ne.aquamarine="#7FFFD4",ne.azure="#F0FFFF",ne.beige="#F5F5DC",ne.bisque="#FFE4C4",ne.blanchedalmond="#FFEBCD",ne.blueviolet="#8A2BE2",ne.brown="#A52A2A",ne.burlywood="#DEB887",ne.cadetblue="#5F9EA0",ne.chartreuse="#7FFF00",ne.chocolate="#D2691E",ne.coral="#FF7F50",ne.cornflowerblue="#6495ED",ne.cornsilk="#FFF8DC",ne.crimson="#DC143C",ne.cyan="#00FFFF",ne.darkblue="#00008B",ne.darkcyan="#008B8B",ne.darkgoldenrod="#B8860B",ne.darkgray="#A9A9A9",ne.darkgreen="#006400",ne.darkgrey="#A9A9A9",ne.darkkhaki="#BDB76B",ne.darkmagenta="#8B008B",ne.darkolivegreen="#556B2F",ne.darkorange="#FF8C00",ne.darkorchid="#9932CC",ne.darkred="#8B0000",ne.darksalmon="#E9967A",ne.darkseagreen="#8FBC8F",ne.darkslateblue="#483D8B",ne.darkslategray="#2F4F4F",ne.darkslategrey="#2F4F4F",ne.darkturquoise="#00CED1",ne.darkviolet="#9400D3",ne.deeppink="#FF1493",ne.deepskyblue="#00BFFF",ne.dimgray="#696969",ne.dimgrey="#696969",ne.dodgerblue="#1E90FF",ne.firebrick="#B22222",ne.floralwhite="#FFFAF0",ne.forestgreen="#228B22",ne.gainsboro="#DCDCDC",ne.ghostwhite="#F8F8FF",ne.gold="#FFD700",ne.goldenrod="#DAA520",ne.greenyellow="#ADFF2F",ne.grey="#808080",ne.honeydew="#F0FFF0",ne.hotpink="#FF69B4",ne.indianred="#CD5C5C",ne.indigo="#4B0082",ne.ivory="#FFFFF0",ne.khaki="#F0E68C",ne.lavender="#E6E6FA",ne.lavenderblush="#FFF0F5",ne.lawngreen="#7CFC00",ne.lemonchiffon="#FFFACD",ne.lightblue="#ADD8E6",ne.lightcoral="#F08080",ne.lightcyan="#E0FFFF",ne.lightgoldenrodyellow="#FAFAD2",ne.lightgray="#D3D3D3",ne.lightgreen="#90EE90",ne.lightgrey="#D3D3D3",ne.lightpink="#FFB6C1",ne.lightsalmon="#FFA07A",ne.lightseagreen="#20B2AA",ne.lightskyblue="#87CEFA",ne.lightslategray="#778899",ne.lightslategrey="#778899",ne.lightsteelblue="#B0C4DE",ne.lightyellow="#FFFFE0",ne.limegreen="#32CD32",ne.linen="#FAF0E6",ne.magenta="#FF00FF",ne.mediumaquamarine="#66CDAA",ne.mediumblue="#0000CD",ne.mediumorchid="#BA55D3",ne.mediumpurple="#9370DB",ne.mediumseagreen="#3CB371",ne.mediumslateblue="#7B68EE",ne.mediumspringgreen="#00FA9A",ne.mediumturquoise="#48D1CC",ne.mediumvioletred="#C71585",ne.midnightblue="#191970",ne.mintcream="#F5FFFA",ne.mistyrose="#FFE4E1",ne.moccasin="#FFE4B5",ne.navajowhite="#FFDEAD",ne.oldlace="#FDF5E6",ne.olivedrab="#6B8E23",ne.orangered="#FF4500",ne.orchid="#DA70D6",ne.palegoldenrod="#EEE8AA",ne.palegreen="#98FB98",ne.paleturquoise="#AFEEEE",ne.palevioletred="#DB7093",ne.papayawhip="#FFEFD5",ne.peachpuff="#FFDAB9",ne.peru="#CD853F",ne.pink="#FFC0CB",ne.plum="#DDA0DD",ne.powderblue="#B0E0E6",ne.rosybrown="#BC8F8F",ne.royalblue="#4169E1",ne.saddlebrown="#8B4513",ne.salmon="#FA8072",ne.sandybrown="#F4A460",ne.seagreen="#2E8B57",ne.seashell="#FFF5EE",ne.sienna="#A0522D",ne.skyblue="#87CEEB",ne.slateblue="#6A5ACD",ne.slategray="#708090",ne.slategrey="#708090",ne.snow="#FFFAFA",ne.springgreen="#00FF7F",ne.steelblue="#4682B4",ne.tan="#D2B48C",ne.thistle="#D8BFD8",ne.tomato="#FF6347",ne.turquoise="#40E0D0",ne.violet="#EE82EE",ne.wheat="#F5DEB3",ne.whitesmoke="#F5F5F5",ne.yellowgreen="#9ACD32",ne.rebeccapurple="#663399"}(i$3||(i$3={}));const a$3=Object.keys(i$3),r$3={HEX:["R","G","B","A"],RGB:["R","G","B","A"],HSL:["H","S","L","A"],CIELab:["L","a","b","A"],CMYK:["C","M","Y","K","A"]},n$3={BGR:t$3.RGB,ABGR:t$3.RGB,HLS:t$3.HSL,AHLS:t$3.HSL,LAB:t$3.CIELab,ALAB:t$3.CIELab,CKMY:t$3.CMYK,ACKMY:t$3.CMYK};var c$3;(function(ne){ne.NUMBER="number",ne.BOOLEAN="boolean"})(c$3||(c$3={}));const o$3={[t$3.HEX]:/^#(?:([a-f\d])([a-f\d])([a-f\d])([a-f\d])?|([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?)$/i,[t$3.RGB]:/^rgba?\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$3.HSL]:/^hsla?\s*\(\s*(?:(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*,\s*((?:\d*\.)?\d+)%\s*,\s*((?:\d*\.)?\d+)%(?:\s*,\s*((?:\d*\.)?\d+))?|(-?(?:\d*\.)?\d+(?:deg|grad|rad|turn)?)\s*((?:\d*\.)?\d+)%\s*((?:\d*\.)?\d+)%(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$3.CIELab]:/^lab\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)\s*(-?(?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/,[t$3.CMYK]:/^(?:device-cmyk|cmyk)\s*\(\s*(?:((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)\s*,\s*((?:\d*\.)?\d+%?)(?:\s*,\s*((?:\d*\.)?\d+))?|((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)\s*((?:\d*\.)?\d+%?)(?:\s*\/\s*((?:\d*\.)?\d+%?))?)\s*\)$/},A$3=/^(-?(?:\d*\.)?\d+)((?:deg|grad|rad|turn)?)$/,h$3=/^(-?\d+(?:\.\d+)?|-?\.\d+)%$/,u$3=/^0x([a-f\d]{1,2})$/i,d$1=/\{(\d+)\}/g,l$3=/,( +|\d+)/g,E$2=/ +/,m$1="The provided string color doesn't have a correct format",b$3="The provided color object doesn't have the proper keys or format";var C$2,L$2,g$3;(function(ne){ne.NONE="none",ne.DEGREES="deg",ne.GRADIANS="grad",ne.RADIANS="rad",ne.TURNS="turn"})(C$2||(C$2={})),function(ne){ne.NONE="none",ne.PERCENT="percent"}(L$2||(L$2={})),function(ne){ne.DEVICE_CMYK="device-cmyk",ne.CMYK="cmyk"}(g$3||(g$3={}));const B$2={decimals:6,legacyCSS:!1,spacesAfterCommas:!1,anglesUnit:C$2.NONE,rgbUnit:L$2.NONE,labUnit:L$2.NONE,cmykUnit:L$2.PERCENT,alphaUnit:L$2.NONE,cmykFunction:g$3.DEVICE_CMYK},p$3=(ne,oe)=>Object.prototype.hasOwnProperty.call(ne,oe),H$3=ne=>+`${ne}`.replace(h$3,"$1"),F$1=ne=>h$3.test(`${ne}`)?H$3(ne):Math.min(+ne,100),R$2=ne=>(ne.length===1&&(ne+=ne),parseInt(ne,16)),S$3=ne=>{const oe=D$2(ne,0).toString(16).toUpperCase();return oe.length===1?`0x0${oe}`:`0x${oe}`},I$1=(ne,oe=!1)=>!oe&&h$3.test(ne)?Math.min(255*H$3(ne)/100,255):u$3.test(ne)?(ne.length===3&&(ne+=ne.slice(-1)),oe?D$2(ne)/255:D$2(ne)):Math.min(+ne,oe?1:255),G$1=ne=>h$3.test(ne)?f$3(125*H$3(ne)/100,-125,125):f$3(+ne,-125,125),M$3=ne=>Math.min(h$3.test(ne)?H$3(ne)/100:+ne,1),y$4=ne=>[...ne].sort().join("").toUpperCase(),D$2=(ne,oe=6)=>{const ce=Math.pow(10,oe);return Math.round(+ne*ce)/ce},f$3=(ne,oe,ce)=>Math.max(oe,Math.min(ne,ce)),O$1=ne=>{if(typeof ne=="string"){const oe=ne.match(A$3),ce=+oe[1];switch(oe[2]){case C$2.RADIANS:ne=D$2(180*ce/Math.PI);break;case C$2.TURNS:ne=D$2(360*ce);break;case C$2.GRADIANS:ne=D$2(.9*ce);break;case C$2.DEGREES:default:ne=ce}}return(ne>360||ne<0)&&(ne-=360*Math.floor(ne/360)),ne},Y$4=(ne,oe)=>{let ce;switch(oe){case C$2.RADIANS:ce=D$2((ue=>ue*Math.PI/180)(ne));break;case C$2.TURNS:ce=D$2(ne/360);break;case C$2.GRADIANS:ce=D$2(10/9*ne);break;case C$2.DEGREES:case C$2.NONE:default:ce=ne}return ce},k$4=(ne,...oe)=>{const ce=[],ue=[],pe=[],me=[],ge=[],ye=[],xe=Object.values(C$2),ve=Object.values(L$2),_e=Object.values(g$3),we={legacyCSS:0,spacesAfterCommas:0,cmykFunction:0};for(const Se of oe)if(typeof Se=="string"){if(ce.push(Se),Se.includes(",")){we.legacyCSS++;const $e=Se.match(l$3);new Set($e).size===1&&E$2.test($e[0].slice(1))&&we.spacesAfterCommas++}if(Se.match(o$3.HSL)){const $e=Se.match(o$3.HSL),Te=$e[1]||$e[5],Re=$e[8],Ae=Te.match(A$3)[2];ue.push(Ae===""?C$2.NONE:Ae),ye.push(h$3.test(Re));continue}if(o$3.RGB.test(Se)){const $e=Se.match(o$3.RGB),Te=$e[1]||$e[5],Re=$e[2]||$e[6],Ae=$e[3]||$e[7],ke=$e[8];pe.push(h$3.test(Te)&&h$3.test(Re)&&h$3.test(Ae)),ye.push(h$3.test(ke));continue}if(o$3.CIELab.test(Se)){const $e=Se.match(o$3.CIELab),Te=$e[1],Re=$e[2],Ae=$e[3],ke=$e[4];me.push(h$3.test(Te)&&h$3.test(Re)&&h$3.test(Ae)),ye.push(h$3.test(ke));continue}if(Se.match(o$3.CMYK)){const $e=Se.match(o$3.CMYK),Te=$e[1]||$e[6],Re=$e[2]||$e[7],Ae=$e[3]||$e[8],ke=$e[4]||$e[9],Be=$e[10];ge.push(h$3.test(Te)&&h$3.test(Re)&&h$3.test(Ae)&&h$3.test(ke)),Se.startsWith("cmyk")&&we.cmykFunction++,ye.push(h$3.test(Be))}}return{decimals:typeof ne.decimals===c$3.NUMBER?ne.decimals:B$2.decimals,legacyCSS:typeof ne.legacyCSS===c$3.BOOLEAN?ne.legacyCSS:!!(ce.length&&we.legacyCSS===ce.length)||B$2.legacyCSS,spacesAfterCommas:typeof ne.spacesAfterCommas===c$3.BOOLEAN?ne.spacesAfterCommas:!!(ce.length&&we.spacesAfterCommas===ce.length)||B$2.spacesAfterCommas,anglesUnit:ne.anglesUnit&&xe.includes(ne.anglesUnit)?ne.anglesUnit:new Set(ue).size===1?ue[0]:B$2.anglesUnit,rgbUnit:ne.rgbUnit&&ve.includes(ne.rgbUnit)?ne.rgbUnit:new Set(pe).size===1&&pe[0]?L$2.PERCENT:B$2.rgbUnit,labUnit:ne.labUnit&&ve.includes(ne.labUnit)?ne.labUnit:new Set(me).size===1&&me[0]?L$2.PERCENT:B$2.labUnit,cmykUnit:ne.cmykUnit&&ve.includes(ne.cmykUnit)?ne.cmykUnit:new Set(ge).size!==1||ge[0]?B$2.cmykUnit:L$2.NONE,alphaUnit:ne.alphaUnit&&ve.includes(ne.alphaUnit)?ne.alphaUnit:new Set(ye).size===1&&ye[0]?L$2.PERCENT:B$2.alphaUnit,cmykFunction:ne.cmykFunction&&_e.includes(ne.cmykFunction)?ne.cmykFunction:ge.length&&ge.length===we.cmykFunction?g$3.CMYK:B$2.cmykFunction}},K$1=ne=>`${ne}`in s$2,X$1=[[.4360747,.3850649,.1430804],[.2225045,.7168786,.0606169],[.0139322,.0971045,.7141733]],T$2=[[3.1338561,-1.6168667,-.4906146],[-.9787684,1.9161415,.033454],[.0719453,-.2289914,1.4052427]],N$3=X$1.map(ne=>ne.reduce((oe,ce)=>oe+ce,0)),$$3=(ne,oe,ce)=>(ce<0&&(ce+=6),ce>=6&&(ce-=6),D$2(ce<1?255*((oe-ne)*ce+ne):ce<3?255*oe:ce<4?255*((oe-ne)*(4-ce)+ne):255*ne)),j$2=ne=>ne<=.04045?ne/12.92:((ne+.055)/1.055)**2.4,U$1=ne=>ne<=.0031308?12.92*ne:1.055*ne**(1/2.4)-.055,w$2=(ne,oe,ce,ue)=>{const pe=[0,0,0],me=[ne,oe,ce];return ue.forEach((ge,ye)=>{ge.forEach((xe,ve)=>{pe[ye]+=xe*me[ve]})}),pe},x$4=(ne,oe,ce)=>{oe/=100;const ue=(ce/=100)<=.5?ce*(oe+1):ce+oe-ce*oe,pe=2*ce-ue;return{R:$$3(pe,ue,(ne/=60)+2),G:$$3(pe,ue,ne),B:$$3(pe,ue,ne-2)}},v$4=(ne,oe,ce,ue=1)=>{ne/=255,oe/=255,ce/=255,ue=Math.min(ue,1);const pe=Math.max(ne,oe,ce),me=Math.min(ne,oe,ce),ge=pe-me;let ye=0,xe=0;const ve=(pe+me)/2;if(ge!==0){switch(pe){case ne:ye=(oe-ce)/ge%6;break;case oe:ye=(ce-ne)/ge+2;break;case ce:ye=(ne-oe)/ge+4}ye=D$2(60*ye),ye<0&&(ye+=360),xe=ge/(1-Math.abs(2*ve-1))}return{H:ye,S:D$2(100*xe),L:D$2(100*ve),A:ue}},V$1=(ne,oe,ce)=>{const ue=[ne/255,oe/255,ce/255].map(j$2),pe=w$2(ue[0],ue[1],ue[2],X$1),me=((ge,ye,xe)=>{const ve=Se=>Se>.008856451679035631?Math.cbrt(Se):Se/.12841854934601665+.13793103448275862,_e=ve(ge/N$3[0]),we=ve(ye/N$3[1]);return[116*we-16,500*(_e-we),200*(we-ve(xe/N$3[2]))]})(pe[0],pe[1],pe[2]);return{L:me[0],a:me[1],b:me[2]}},P=(ne,oe,ce)=>{const ue=((me,ge,ye)=>{const xe=Se=>Se>.20689655172413793?Se**3:.12841854934601665*(Se-.13793103448275862),ve=(me+16)/116,_e=ge/500,we=ye/200;return[N$3[0]*xe(ve+_e),N$3[1]*xe(ve),N$3[2]*xe(ve-we)]})(ne,oe,ce),pe=w$2(ue[0],ue[1],ue[2],T$2).map(U$1);return{R:f$3(255*pe[0],0,255),G:f$3(255*pe[1],0,255),B:f$3(255*pe[2],0,255)}},q$2=(ne,oe,ce,ue)=>({R:D$2(255*(1-ne)*(ue=1-ue)),G:D$2(255*(1-oe)*ue),B:D$2(255*(1-ce)*ue)}),_$3=(ne,oe,ce)=>{ne/=255,oe/=255,ce/=255;const ue=1-Math.max(ne,oe,ce),pe=1-ue,me=pe&&(pe-oe)/pe,ge=pe&&(pe-ce)/pe;return{C:D$2(100*(pe&&(pe-ne)/pe)),M:D$2(100*me),Y:D$2(100*ge),K:D$2(100*ue)}},z$3=(ne,oe)=>{if(ne<0&&(ne+=360),ne>360&&(ne-=360),ne===360||ne===0)return ne;const ce=[[0,120],[120,180],[180,240],[240,360]],ue=[[0,60],[60,120],[120,240],[240,360]],pe=oe?ue:ce;let me=0,ge=0,ye=0,xe=0;return(oe?ce:ue).find((ve,_e)=>ne>=ve[0]&&nene?", ":",",W$1=(ne,oe)=>{const ce=y$4(Object.keys(ne));return r$3[n$3[ce]].reduce((ue,pe,me)=>{const ge=ne[pe];return ge!==void 0&&ue.push(oe(ge,me)),ue},[])},J$1=(ne,oe)=>ne.replace(d$1,(ce,ue)=>`${oe[+ue-1]}`),Z$2=(ne,oe,ce=!1)=>{const{alphaUnit:ue,legacyCSS:pe,decimals:me}=oe;return ue!==L$2.PERCENT||pe&&!ce?D$2(ne,me):`${D$2(100*ne,me)}%`},tt$1={[t$3.HEX]:ne=>{const oe=W$1(ne,ue=>(pe=>{let me=D$2(pe,0).toString(16).toUpperCase();return me.length===1&&(me=`0${me}`),me})(D$2(ue))),ce=oe.length===4?"#{1}{2}{3}{4}":"#{1}{2}{3}";return J$1(ce,oe)},[t$3.RGB]:(ne,oe)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,rgbUnit:me}=oe,ge=Q$1(pe),ye=W$1(ne,(ve,_e)=>me===L$2.PERCENT&&_e<3?`${((we,Se)=>D$2(we/255*100,Se))(ve,ce)}%`:_e===3?Z$2(ve,oe):D$2(ve,ce)),xe=ue?ye.length===4?`rgba({1}${ge}{2}${ge}{3}${ge}{4})`:`rgb({1}${ge}{2}${ge}{3})`:ye.length===4?"rgb({1} {2} {3} / {4})":"rgb({1} {2} {3})";return J$1(xe,ye)},[t$3.HSL]:(ne,oe)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,anglesUnit:me}=oe,ge=Q$1(pe),ye=W$1(ne,(ve,_e)=>_e===0&&me!==C$2.NONE?`${D$2(Y$4(ve,me),ce)}${me}`:_e===3?Z$2(ve,oe):D$2(ve,ce)),xe=ue?ye.length===4?`hsla({1}${ge}{2}%${ge}{3}%${ge}{4})`:`hsl({1}${ge}{2}%${ge}{3}%)`:ye.length===4?"hsl({1} {2}% {3}% / {4})":"hsl({1} {2}% {3}%)";return J$1(xe,ye)},[t$3.CIELab]:(ne,oe)=>{const{decimals:ce,labUnit:ue}=oe,pe=W$1(ne,(ge,ye)=>{if(ye===0){const xe=D$2(F$1(ge),ce);return ue===L$2.PERCENT?`${xe}%`:`${xe}`}return ye<3?ue===L$2.PERCENT?`${((xe,ve)=>D$2(xe/125*100,ve))(ge,ce)}%`:D$2(ge,ce):Z$2(ge,oe,!0)}),me=pe.length===4?"lab({1} {2} {3} / {4})":"lab({1} {2} {3})";return J$1(me,pe)},[t$3.CMYK]:(ne,oe)=>{const{decimals:ce,legacyCSS:ue,spacesAfterCommas:pe,cmykUnit:me,cmykFunction:ge}=oe,ye=Q$1(pe),xe=W$1(ne,(_e,we)=>me===L$2.PERCENT&&we<4?`${D$2(_e,ce)}%`:we===4?Z$2(_e,oe):D$2(_e/100,ce)),ve=ue?xe.length===5?`${ge}({1}${ye}{2}${ye}{3}${ye}{4}${ye}{5})`:`${ge}({1}${ye}{2}${ye}{3}${ye}{4})`:xe.length===5?`${ge}({1} {2} {3} {4} / {5})`:`${ge}({1} {2} {3} {4})`;return J$1(ve,xe)}},et$1=ne=>(typeof ne=="string"&&(ne=h$3.test(ne)?H$3(ne)/100:+ne),isNaN(+ne)||ne>1?1:D$2(ne)),st=(ne,oe,ce)=>oe.reduce((ue,pe)=>[...ue,{...ne,H:ce===s$2.ADDITIVE?O$1(ne.H+pe):O$1(z$3(z$3(ne.H,!1)+pe,!0))}],[{...ne}]),it=(ne,oe)=>st(ne,[30,-30],oe),at=(ne,oe)=>st(ne,[180],oe),rt=(ne,oe)=>st(ne,[150,-150],oe),nt=(ne,oe)=>st(ne,[120,-120],oe),ct=(ne,oe)=>st(ne,[60,-120,180],oe),ot=(ne,oe)=>st(ne,[90,-90,180],oe),At=ne=>typeof ne=="string"?(oe=>{let ce;if(Object.keys(t$3).some(ue=>{if(o$3[ue].test(oe))return ce=ue,!0}),!ce&&~a$3.indexOf(oe)&&(ce=t$3.HEX),!ce)throw new Error(m$1);return ce})(ne):(oe=>{let ce,ue=!1;const pe=y$4(Object.keys(oe));if(n$3[pe]&&(ce=n$3[pe]),ce&&ce===t$3.RGB){const me=Object.entries(oe).some(ye=>!u$3.test(`${ye[1]}`)),ge=Object.entries(oe).some(ye=>!(h$3.test(`${ye[1]}`)||!u$3.test(`${ye[1]}`)&&!isNaN(+ye[1])&&+ye[1]<=255));me&&ge&&(ue=!0),me||(ce=t$3.HEX)}if(!ce||ue)throw new Error(b$3);return ce})(ne),ht$1={[t$3.HEX](ne){const oe=(~a$3.indexOf(ne)?i$3[ne]:ne).match(o$3.HEX),ce={R:R$2(oe[1]||oe[5]),G:R$2(oe[2]||oe[6]),B:R$2(oe[3]||oe[7])},ue=oe[4]||oe[8];return ue!==void 0&&(ce.A=R$2(ue)/255),ce},[t$3.RGB](ne){const oe=ne.match(o$3.RGB),ce=I$1(oe[1]||oe[5]),ue=I$1(oe[2]||oe[6]),pe=I$1(oe[3]||oe[7]),me=oe[4]||oe[8],ge={R:Math.min(ce,255),G:Math.min(ue,255),B:Math.min(pe,255)};return me!==void 0&&(ge.A=et$1(me)),ge},[t$3.HSL](ne){const oe=ne.match(o$3.HSL),ce=O$1(oe[1]||oe[5]),ue=F$1(oe[2]||oe[6]),pe=F$1(oe[3]||oe[7]),me=oe[4]||oe[8],ge=x$4(ce,ue,pe);return me!==void 0&&(ge.A=et$1(me)),ge},[t$3.CIELab](ne){const oe=ne.match(o$3.CIELab),ce=F$1(oe[1]),ue=G$1(oe[2]),pe=G$1(oe[3]),me=oe[4],ge=P(ce,ue,pe);return me!==void 0&&(ge.A=et$1(me)),ge},[t$3.CMYK](ne){const oe=ne.match(o$3.CMYK),ce=M$3(oe[1]||oe[6]),ue=M$3(oe[2]||oe[7]),pe=M$3(oe[3]||oe[8]),me=M$3(oe[4]||oe[9]),ge=oe[5]||oe[10],ye=q$2(ce,ue,pe,me);return ge!==void 0&&(ye.A=et$1(ge)),ye}},ut={[t$3.HEX](ne){const oe={R:I$1(`${ne.R}`),G:I$1(`${ne.G}`),B:I$1(`${ne.B}`)};return p$3(ne,"A")&&(oe.A=Math.min(I$1(`${ne.A}`,!0),1)),oe},[t$3.RGB](ne){return this.HEX(ne)},[t$3.HSL](ne){const oe=F$1(`${ne.S}`),ce=F$1(`${ne.L}`),ue=x$4(O$1(ne.H),oe,ce);return p$3(ne,"A")&&(ue.A=et$1(ne.A)),ue},[t$3.CIELab](ne){const oe=F$1(`${ne.L}`),ce=G$1(`${ne.a}`),ue=G$1(`${ne.b}`),pe=P(oe,ce,ue);return p$3(ne,"A")&&(pe.A=et$1(ne.A)),pe},[t$3.CMYK](ne){const oe=M$3(`${ne.C}`),ce=M$3(`${ne.M}`),ue=M$3(`${ne.Y}`),pe=M$3(`${ne.K}`),me=q$2(oe,ce,ue,pe);return p$3(ne,"A")&&(me.A=et$1(ne.A)),me}},dt=(ne,oe=At(ne))=>typeof ne=="string"?ht$1[oe](ne):ut[oe](ne),lt={[t$3.HEX]:ne=>({R:S$3(ne.R),G:S$3(ne.G),B:S$3(ne.B)}),HEXA(ne){const oe=lt.HEX(ne);return oe.A=p$3(ne,"A")?S$3(255*ne.A):"0xFF",oe},[t$3.RGB](ne,oe){const ce=Ct(ne,oe);return p$3(ce,"A")&&delete ce.A,ce},RGBA(ne,oe){const ce=lt.RGB(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A):1,ce},[t$3.HSL](ne,oe){const ce=v$4(ne.R,ne.G,ne.B);return delete ce.A,Lt(ce,oe)},HSLA(ne,oe){const ce=lt.HSL(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A,oe):1,ce},[t$3.CIELab](ne,oe){const ce=V$1(ne.R,ne.G,ne.B);return gt(ce,oe)},CIELabA(ne,oe){const ce=lt.CIELab(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A,oe):1,ce},[t$3.CMYK]:(ne,oe)=>Bt(_$3(ne.R,ne.G,ne.B),oe),CMYKA(ne,oe){const ce=lt.CMYK(ne,oe);return ce.A=p$3(ne,"A")?D$2(ne.A,oe):1,ce}},Et=(ne,oe,ce,ue)=>{const pe=At(ne),me=typeof ne=="string",ge=dt(ne,pe),ye=typeof ne=="string"&&p$3(ge,"A")||typeof ne!="string"&&p$3(ne,"A"),xe=v$4(ge.R,ge.G,ge.B,ge.A);ye||delete xe.A;const ve=ce?xe.L/(oe+1):(100-xe.L)/(oe+1),_e=Array(oe).fill(null).map((we,Se)=>({...xe,L:xe.L+ve*(Se+1)*(1-2*+ce)}));switch(pe){case t$3.HEX:default:return _e.map(we=>{const Se=x$4(we.H,we.S,we.L);return ye&&(Se.A=we.A),me?ye?tt$1.HEX({...Se,A:D$2(255*Se.A)}):tt$1.HEX(Se):ye?lt.HEXA(Se):lt.HEX(Se)});case t$3.RGB:return _e.map(we=>{const Se=x$4(we.H,we.S,we.L);return ye&&(Se.A=we.A),me?tt$1.RGB(Se,ue):ye?lt.RGBA(Se,ue.decimals):lt.RGB(Se,ue.decimals)});case t$3.HSL:return _e.map(we=>me?tt$1.HSL(we,ue):ye?lt.HSLA({...x$4(we.H,we.S,we.L),A:we.A},ue.decimals):lt.HSL(x$4(we.H,we.S,we.L),ue.decimals));case t$3.CIELab:return _e.map(we=>{const Se=x$4(we.H,we.S,we.L);return me?tt$1.CIELab(ye?lt.CIELabA(Se,ue.decimals):lt.CIELab(Se,ue.decimals),ue):ye?lt.CIELabA({...Se,A:we.A},ue.decimals):lt.CIELab(Se,ue.decimals)})}},mt={buildHarmony(ne,oe,ce,ue){const pe=At(ne),me=dt(ne,pe),ge=v$4(me.R,me.G,me.B,me.A),ye=typeof ne=="string"&&p$3(me,"A")||typeof ne!="string"&&p$3(ne,"A"),xe=typeof ne=="string";switch(pe){case t$3.HEX:default:return ye?this.HEXA(Lt(ge,0),oe,ce,xe):this.HEX(Lt(ge,0),oe,ce,xe);case t$3.HSL:return ye?this.HSLA(ge,oe,ce,xe,ue):this.HSL(ge,oe,ce,xe,ue);case t$3.RGB:return ye?this.RGBA(ge,oe,ce,xe,ue):this.RGB(ge,oe,ce,xe,ue);case t$3.CIELab:return ye?this.CIELabA(ge,oe,ce,xe,ue):this.CIELab(ge,oe,ce,xe,ue)}},[t$3.HEX]:(ne,oe,ce,ue)=>oe(ne,ce).map(pe=>ue?tt$1.HEX(x$4(pe.H,pe.S,pe.L)):lt.HEX(x$4(pe.H,pe.S,pe.L))),HEXA:(ne,oe,ce,ue)=>oe(ne,ce).map(pe=>ue?tt$1.HEX({...x$4(pe.H,pe.S,pe.L),A:255*et$1(pe.A)}):lt.HEXA({...x$4(pe.H,pe.S,pe.L),A:et$1(pe.A)})),[t$3.RGB]:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.RGB(x$4(me.H,me.S,me.L),pe):lt.RGB(x$4(me.H,me.S,me.L),pe.decimals)),RGBA:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.RGB({...x$4(me.H,me.S,me.L),A:et$1(me.A)},pe):lt.RGBA({...x$4(me.H,me.S,me.L),A:et$1(me.A)},pe.decimals)),[t$3.HSL]:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.HSL({H:me.H,S:me.S,L:me.L},pe):lt.HSL(x$4(me.H,me.S,me.L),pe.decimals)),HSLA:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>ue?tt$1.HSL({...me,A:et$1(me.A)},pe):lt.HSLA({...x$4(me.H,me.S,me.L),A:et$1(me.A)},pe.decimals)),[t$3.CIELab]:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>{const ge=x$4(me.H,me.S,me.L);return ue?tt$1.CIELab(V$1(ge.R,ge.G,ge.B),pe):lt.CIELab(ge,pe.decimals)}),CIELabA:(ne,oe,ce,ue,pe)=>oe(ne,ce).map(me=>{const ge=x$4(me.H,me.S,me.L);return ue?tt$1.CIELab({...V$1(ge.R,ge.G,ge.B),A:et$1(me.A)},pe):lt.CIELabA({...ge,A:et$1(me.A)},pe.decimals)})},bt={mix(ne,oe){const ce=ne.map(ge=>{const ye=At(ge);return dt(ge,ye)}),ue=oe===s$2.SUBTRACTIVE?ce.map(ge=>{const ye=((xe,ve,_e)=>{const we=Math.min(xe,ve,_e),Se=Math.min(255-xe,255-ve,255-_e),$e=xe-we,Te=ve-we,Re=_e-we,Ae=Math.min($e,Te),ke=$e-Ae,Be=(Te+Ae)/2,Ie=(Re+Te-Ae)/2,Ne=Math.max(ke,Be,Ie)/Math.max($e,Te,Re),je=isNaN(Ne)||Ne===1/0||Ne<=0?1:Ne;return{R:ke/je+Se,Y:Be/je+Se,B:Ie/je+Se}})(ge.R,ge.G,ge.B);return p$3(ge,"A")&&(ye.A=ge.A),ye}):null;function pe(ge){const ye=oe===s$2.ADDITIVE?{R:0,G:0,B:0,A:0}:{R:0,Y:0,B:0,A:0};return ge.reduce((xe,ve)=>{const _e=p$3(ve,"A")?ve.A:1,we={R:Math.min(xe.R+ve.R*_e,255),B:Math.min(xe.B+ve.B*_e,255),A:1-(1-_e)*(1-xe.A)},Se="G"in xe?xe.G:xe.Y,$e="G"in ve?ve.G:ve.Y;return{...we,...oe===s$2.ADDITIVE?{G:Math.min(Se+$e*_e,255)}:{Y:Math.min(Se+$e*_e,255)}}},ye)}let me;if(oe===s$2.ADDITIVE)me=pe(ce);else{const ge=pe(ue);me=((ye,xe,ve)=>{const _e=Math.min(ye,xe,ve),we=Math.min(255-ye,255-xe,255-ve),Se=ye-_e,$e=xe-_e,Te=ve-_e,Re=Math.min($e,Te),Ae=Se+$e-Re,ke=$e+Re,Be=2*(Te-Re),Ie=Math.max(Ae,ke,Be)/Math.max(Se,$e,Te),Ne=isNaN(Ie)||Ie===1/0||Ie<=0?1:Ie;return{R:Ae/Ne+we,G:ke/Ne+we,B:Be/Ne+we}})(ge.R,ge.Y,ge.B),me.A=ge.A}return{R:D$2(me.R),G:D$2(me.G),B:D$2(me.B),A:f$3(me.A,0,1)}},[t$3.HEX](ne,oe,ce){const ue=this.mix(ne,oe);return delete ue.A,ce?tt$1.HEX(ue):lt.HEX(ue)},HEXA(ne,oe,ce){const ue=this.mix(ne,oe);return ue.A=ce?255*et$1(ue.A):et$1(ue.A),ce?tt$1.HEX(ue):lt.HEXA(ue)},[t$3.RGB](ne,oe,ce,ue){const pe=this.mix(ne,oe);return delete pe.A,ce?tt$1.RGB(pe,ue):lt.RGB(pe,ue.decimals)},RGBA(ne,oe,ce,ue){const pe=this.mix(ne,oe);return ce?tt$1.RGB(pe,ue):lt.RGBA(pe,ue.decimals)},[t$3.HSL](ne,oe,ce,ue){const pe=this.mix(ne,oe),me=v$4(pe.R,pe.G,pe.B);return delete pe.A,delete me.A,ce?tt$1.HSL(me,ue):lt.HSL(pe,ue.decimals)},HSLA(ne,oe,ce,ue){const pe=this.mix(ne,oe),me=v$4(pe.R,pe.G,pe.B,pe.A);return ce?tt$1.HSL(me,ue):lt.HSLA(pe,ue.decimals)},[t$3.CIELab](ne,oe,ce,ue){const pe=this.mix(ne,oe),me=V$1(pe.R,pe.G,pe.B);return delete pe.A,ce?tt$1.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)},CIELabA(ne,oe,ce,ue){const pe=this.mix(ne,oe),me=V$1(pe.R,pe.G,pe.B);return p$3(pe,"A")&&(me.A=pe.A),ce?tt$1.CIELab(me,ue):lt.CIELabA(pe,ue.decimals)}},Ct=(ne,oe)=>({R:D$2(ne.R,oe),G:D$2(ne.G,oe),B:D$2(ne.B,oe),...p$3(ne,"A")?{A:D$2(ne.A,oe)}:{}}),Lt=(ne,oe)=>({H:D$2(ne.H,oe),S:D$2(ne.S,oe),L:D$2(ne.L,oe),...p$3(ne,"A")?{A:D$2(ne.A,oe)}:{}}),gt=(ne,oe)=>({L:D$2(ne.L,oe),a:D$2(ne.a,oe),b:D$2(ne.b,oe)}),Bt=(ne,oe)=>({C:D$2(ne.C,oe),M:D$2(ne.M,oe),Y:D$2(ne.Y,oe),K:D$2(ne.K,oe)}),pt=(ne,oe,ce,ue)=>ue(dt(ne,oe),ce),Ht=(ne,oe,ce,ue,pe)=>(ce<1&&(ce=5),((ge,ye,xe)=>{const ve=xe-1,_e=(ye.R-ge.R)/ve,we=(ye.G-ge.G)/ve,Se=(ye.B-ge.B)/ve,$e=et$1(ge.A),Te=(et$1(ye.A)-$e)/ve;return Array(xe).fill(null).map((Re,Ae)=>Ae===0?ge:Ae===ve?ye:{R:D$2(ge.R+_e*Ae),G:D$2(ge.G+we*Ae),B:D$2(ge.B+Se*Ae),A:D$2($e+Te*Ae)})})(dt(ne),dt(oe),ce).map(ge=>pe(ge,ue))),Ft$1=(ne,oe,ce,ue)=>({[e$2.ANALOGOUS]:mt.buildHarmony(oe,it,ce,ue),[e$2.COMPLEMENTARY]:mt.buildHarmony(oe,at,ce,ue),[e$2.SPLIT_COMPLEMENTARY]:mt.buildHarmony(oe,rt,ce,ue),[e$2.TRIADIC]:mt.buildHarmony(oe,nt,ce,ue),[e$2.TETRADIC]:mt.buildHarmony(oe,ct,ce,ue),[e$2.SQUARE]:mt.buildHarmony(oe,ot,ce,ue)})[ne];class Rt{constructor(oe,ce={}){this._options=k$4(ce,oe),this.rgb=dt(oe),this.updateHSL(),this.updateLab(),this.updateCMYK()}updateRGB(){this.rgb={...x$4(this.hsl.H,this.hsl.S,this.hsl.L),A:this.hsl.A}}updateRGBFromCMYK(){this.rgb={...q$2(this.cmyk.C,this.cmyk.M,this.cmyk.Y,this.cmyk.K),A:this.rgb.A}}updateRGBFromLab(){this.rgb={...P(this.lab.L,this.lab.a,this.lab.b),A:this.rgb.A}}updateHSL(){this.hsl=v$4(this.rgb.R,this.rgb.G,this.rgb.B,this.rgb.A)}updateLab(){this.lab={...V$1(this.rgb.R,this.rgb.G,this.rgb.B),A:this.rgb.A}}updateCMYK(){this.cmyk=_$3(this.rgb.R,this.rgb.G,this.rgb.B)}setOptions(oe={}){return this._options={...this._options,...oe},this}setH(oe){return this.hsl.H=O$1(oe),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setS(oe){return this.hsl.S=f$3(oe,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setL(oe){return this.hsl.L=f$3(oe,0,100),this.updateRGB(),this.updateLab(),this.updateCMYK(),this}setR(oe){this.rgb.R=f$3(oe,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK()}setG(oe){return this.rgb.G=f$3(oe,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setB(oe){return this.rgb.B=f$3(oe,0,255),this.updateHSL(),this.updateLab(),this.updateCMYK(),this}setCIEL(oe){return this.lab.L=f$3(oe,0,100),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEa(oe){return this.lab.a=f$3(oe,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setCIEb(oe){return this.lab.b=f$3(oe,-125,125),this.updateRGBFromLab(),this.updateHSL(),this.updateCMYK(),this}setA(oe){return this.hsl.A=this.rgb.A=f$3(oe,0,1),this}setC(oe){return this.cmyk.C=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setM(oe){return this.cmyk.M=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setY(oe){return this.cmyk.Y=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}setK(oe){return this.cmyk.K=f$3(oe,0,100),this.updateRGBFromCMYK(),this.updateHSL(),this.updateLab(),this}get options(){return this._options}get H(){return D$2(this.hsl.H,this.options.decimals)}get S(){return D$2(this.hsl.S,this.options.decimals)}get L(){return D$2(this.hsl.L,this.options.decimals)}get CIEL(){return D$2(this.lab.L,this.options.decimals)}get CIEa(){return D$2(this.lab.a,this.options.decimals)}get CIEb(){return D$2(this.lab.b,this.options.decimals)}get R(){return D$2(this.rgb.R,this.options.decimals)}get G(){return D$2(this.rgb.G,this.options.decimals)}get B(){return D$2(this.rgb.B,this.options.decimals)}get A(){return D$2(this.hsl.A,this.options.decimals)}get C(){return D$2(this.cmyk.C,this.options.decimals)}get M(){return D$2(this.cmyk.M,this.options.decimals)}get Y(){return D$2(this.cmyk.Y,this.options.decimals)}get K(){return D$2(this.cmyk.K,this.options.decimals)}get HEXObject(){return lt.HEX(this.rgb)}get HEXAObject(){return lt.HEXA(this.rgb)}get RGBObject(){return{R:this.R,G:this.G,B:this.B}}get RGBAObject(){return{...this.RGBObject,A:this.A}}get HSLObject(){return{H:this.H,S:this.S,L:this.L}}get HSLAObject(){return{...this.HSLObject,A:this.A}}get CIELabObject(){return{L:this.CIEL,a:this.CIEa,b:this.CIEb}}get CIELabAObject(){return{...this.CIELabObject,A:this.A}}get CMYKObject(){return{C:this.C,M:this.M,Y:this.Y,K:this.K}}get CMYKAObject(){return{...this.CMYKObject,A:this.A}}get HEX(){return tt$1.HEX({R:this.R,G:this.G,B:this.B})}get HEXA(){return tt$1.HEX({R:this.R,G:this.G,B:this.B,A:255*this.A})}get RGB(){return tt$1.RGB({R:this.R,G:this.G,B:this.B},this.options)}get RGBA(){return tt$1.RGB({R:this.R,G:this.G,B:this.B,A:this.A},this.options)}get HSL(){return tt$1.HSL({H:this.H,S:this.S,L:this.L},this.options)}get HSLA(){return tt$1.HSL({H:this.H,S:this.S,L:this.L,A:this.A},this.options)}get CIELab(){return tt$1.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb},this.options)}get CIELabA(){return tt$1.CIELab({L:this.CIEL,a:this.CIEa,b:this.CIEb,A:this.A},this.options)}get CMYK(){return tt$1.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K},this.options)}get CMYKA(){return tt$1.CMYK({C:this.C,M:this.M,Y:this.Y,K:this.K,A:this.A},this.options)}static toHEXObject(oe){const ce=At(oe);return pt(oe,ce,0,lt.HEX)}static toHEX(oe){return tt$1.HEX(Rt.toHEXObject(oe))}static toHEXAObject(oe){const ce=At(oe);return pt(oe,ce,0,lt.HEXA)}static toHEXA(oe){return tt$1.HEX(Rt.toHEXAObject(oe))}static toRGBObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.RGB)}static toRGB(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.RGB);return tt$1.RGB(me,pe)}static toRGBAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.RGBA)}static toRGBA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.RGBA);return tt$1.RGB(me,pe)}static toHSLObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.HSL)}static toHSL(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.HSL);return tt$1.HSL(me,pe)}static toHSLAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.HSLA)}static toHSLA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.HSLA);return tt$1.HSL(me,pe)}static toCIELabObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CIELab)}static toCIELab(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CIELab);return tt$1.CIELab(me,pe)}static toCIELabAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CIELabA)}static toCIELabA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CIELabA);return tt$1.CIELab(me,pe)}static toCMYKObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CMYK)}static toCMYK(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CMYK);return tt$1.CMYK(me,pe)}static toCMYKAObject(oe,ce={}){const ue=At(oe);return pt(oe,ue,ce.decimals,lt.CMYKA)}static toCMYKA(oe,ce={}){const ue=At(oe),pe=k$4(ce,oe),me=pt(oe,ue,ce.decimals,lt.CMYKA);return tt$1.CMYK(me,pe)}static getBlendHEXObject(oe,ce,ue=5){return Ht(oe,ce,ue,0,lt.HEX)}static getBlendHEX(oe,ce,ue=5){return Rt.getBlendHEXObject(oe,ce,ue).map(pe=>tt$1.HEX(pe))}static getBlendHEXAObject(oe,ce,ue=5){return Ht(oe,ce,ue,0,lt.HEXA)}static getBlendHEXA(oe,ce,ue=5){return Rt.getBlendHEXAObject(oe,ce,ue).map(pe=>tt$1.HEX(pe))}static getBlendRGBObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGB):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGB)}static getBlendRGB(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGB).map(me=>tt$1.RGB(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGB).map(me=>tt$1.RGB(me,k$4(ue||{},oe,ce)))}static getBlendRGBAObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGBA)}static getBlendRGBA(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.RGBA).map(me=>tt$1.RGB(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.RGBA).map(me=>tt$1.RGB(me,k$4(ue||{},oe,ce)))}static getBlendHSLObject(oe,ce,ue,pe){return Ht(oe,ce,typeof ue=="number"?ue:5,pe==null?void 0:pe.decimals,lt.HSL)}static getBlendHSL(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.HSL).map(me=>tt$1.HSL(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.HSL).map(me=>tt$1.HSL(me,k$4(ue||{},oe,ce)))}static getBlendHSLAObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.HSLA)}static getBlendHSLA(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.HSLA).map(me=>tt$1.HSL(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.HSLA).map(me=>tt$1.HSL(me,k$4(ue||{},oe,ce)))}static getBlendCIELabObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELab)}static getBlendCIELab(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELab).map(me=>tt$1.CIELab(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELab).map(me=>tt$1.CIELab(me,k$4(ue||{},oe,ce)))}static getBlendCIELabAObject(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA)}static getBlendCIELabA(oe,ce,ue,pe){return typeof ue=="number"?Ht(oe,ce,ue,pe==null?void 0:pe.decimals,lt.CIELabA).map(me=>tt$1.CIELab(me,k$4(pe||{},oe,ce))):Ht(oe,ce,5,ue==null?void 0:ue.decimals,lt.CIELabA).map(me=>tt$1.CIELab(me,k$4(ue||{},oe,ce)))}static getMixHEXObject(oe,ce=s$2.ADDITIVE){return bt.HEX(oe,ce,!1)}static getMixHEX(oe,ce=s$2.ADDITIVE){return bt.HEX(oe,ce,!0)}static getMixHEXAObject(oe,ce=s$2.ADDITIVE){return bt.HEXA(oe,ce,!1)}static getMixHEXA(oe,ce=s$2.ADDITIVE){return bt.HEXA(oe,ce,!0)}static getMixRGBObject(oe,ce,ue){return typeof ce=="string"?bt.RGB(oe,ce,!1,k$4(ue||{},...oe)):bt.RGB(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixRGB(oe,ce,ue){return typeof ce=="string"?bt.RGB(oe,ce,!0,k$4(ue||{},...oe)):bt.RGB(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixRGBAObject(oe,ce,ue){return typeof ce=="string"?bt.RGBA(oe,ce,!1,k$4(ue||{},...oe)):bt.RGBA(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixRGBA(oe,ce,ue){return typeof ce=="string"?bt.RGBA(oe,ce,!0,k$4(ue||{},...oe)):bt.RGBA(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixHSLObject(oe,ce,ue){return typeof ce=="string"?bt.HSL(oe,ce,!1,k$4(ue||{},...oe)):bt.HSL(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixHSL(oe,ce,ue){return typeof ce=="string"?bt.HSL(oe,ce,!0,k$4(ue||{},...oe)):bt.HSL(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixHSLAObject(oe,ce,ue){return typeof ce=="string"?bt.HSLA(oe,ce,!1,k$4(ue||{},...oe)):bt.HSLA(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixHSLA(oe,ce,ue){return typeof ce=="string"?bt.HSLA(oe,ce,!0,k$4(ue||{},...oe)):bt.HSLA(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixCIELabObject(oe,ce,ue){return typeof ce=="string"?bt.CIELab(oe,ce,!1,k$4(ue||{},...oe)):bt.CIELab(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixCIELab(oe,ce,ue){return typeof ce=="string"?bt.CIELab(oe,ce,!0,k$4(ue||{},...oe)):bt.CIELab(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getMixCIELabAObject(oe,ce,ue){return typeof ce=="string"?bt.CIELabA(oe,ce,!1,k$4(ue||{},...oe)):bt.CIELabA(oe,s$2.ADDITIVE,!1,k$4(ce||{},...oe))}static getMixCIELabA(oe,ce,ue){return typeof ce=="string"?bt.CIELabA(oe,ce,!0,k$4(ue||{},...oe)):bt.CIELabA(oe,s$2.ADDITIVE,!0,k$4(ce||{},...oe))}static getShades(oe,ce,ue){return typeof ce=="number"?Et(oe,ce,!0,k$4(ue||{},oe)):Et(oe,5,!0,k$4(ce||{},oe))}static getTints(oe,ce,ue){return typeof ce=="number"?Et(oe,ce,!1,k$4(ue||{},oe)):Et(oe,5,!1,k$4(ce||{},oe))}static getHarmony(oe,ce,ue,pe){return`${ce}`in e$2?Ft$1(ce,oe,K$1(ue)?ue:s$2.ADDITIVE,k$4(K$1(ue)?pe||{}:ue||{},oe)):K$1(ce)?Ft$1(e$2.COMPLEMENTARY,oe,ce,k$4(ue||{},oe)):Ft$1(e$2.COMPLEMENTARY,oe,s$2.ADDITIVE,k$4(ce||{},oe))}}function hash(ne){let oe=5381,ce=ne.length;for(;ce;)oe=oe*33^ne.charCodeAt(--ce);return oe>>>0}const tint="500";function hex(ne){return parseInt(ne.replace("#","0x"))}const searchEventAliases=lodashExports.thru({source:["source","start"],destination:["destination","goal","finish"],updating:["update","updating"],expanding:["expanding","expanding"],generating:["generate","generating","open","opening"],closing:["close","closing"],end:["finish","end","solution"]},ne=>{const oe={};for(const[ce,ue]of lodashExports.entries(ne))for(const pe of ue)oe[pe]=ce;return oe}),colorsHex={source:green$2.A400,destination:red$2.A400,updating:orange$2[tint],expanding:deepPurple[tint],generating:amber[tint],closing:pink[tint],end:blue$2.A400};lodashExports.mapValues(colorsHex,hex);const shades=lodashExports.sortBy(lodashExports.keys(accentColors),ne=>new Rt(getShade(ne,"dark")).H);function getColorHex(ne="",oe){const ce=searchEventAliases[lodashExports.lowerCase(ne)];if(ce)return colorsHex[ce];{const ue=hash(lodashExports.lowerCase(ne)),pe=lodashExports.values(accentColors);return pe[ue%pe.length][tint]}}function inferLayerName(ne){var oe;return ne!=null&&ne.name?ne==null?void 0:ne.name:(oe=ne==null?void 0:ne.source)!=null&&oe.type?getController(ne).inferName(ne):"Untitled Layer"}let windowObject;typeof window<"u"?windowObject=window:typeof self<"u"?windowObject=self:windowObject=global;let cancelFrame=null,requestFrame=null;const TIMEOUT_DURATION=20,clearTimeoutFn=windowObject.clearTimeout,setTimeoutFn=windowObject.setTimeout,cancelAnimationFrameFn=windowObject.cancelAnimationFrame||windowObject.mozCancelAnimationFrame||windowObject.webkitCancelAnimationFrame,requestAnimationFrameFn=windowObject.requestAnimationFrame||windowObject.mozRequestAnimationFrame||windowObject.webkitRequestAnimationFrame;cancelAnimationFrameFn==null||requestAnimationFrameFn==null?(cancelFrame=clearTimeoutFn,requestFrame=function(oe){return setTimeoutFn(oe,TIMEOUT_DURATION)}):(cancelFrame=function([oe,ce]){cancelAnimationFrameFn(oe),clearTimeoutFn(ce)},requestFrame=function(oe){const ce=requestAnimationFrameFn(function(){clearTimeoutFn(ue),oe()}),ue=setTimeoutFn(function(){cancelAnimationFrameFn(ce),oe()},TIMEOUT_DURATION);return[ce,ue]});function createDetectElementResize(ne){let oe,ce,ue,pe,me,ge,ye;const xe=typeof document<"u"&&document.attachEvent;if(!xe){ge=function(ke){const Be=ke.__resizeTriggers__,Ie=Be.firstElementChild,Ne=Be.lastElementChild,je=Ie.firstElementChild;Ne.scrollLeft=Ne.scrollWidth,Ne.scrollTop=Ne.scrollHeight,je.style.width=Ie.offsetWidth+1+"px",je.style.height=Ie.offsetHeight+1+"px",Ie.scrollLeft=Ie.scrollWidth,Ie.scrollTop=Ie.scrollHeight},me=function(ke){return ke.offsetWidth!==ke.__resizeLast__.width||ke.offsetHeight!==ke.__resizeLast__.height},ye=function(ke){if(ke.target.className&&typeof ke.target.className.indexOf=="function"&&ke.target.className.indexOf("contract-trigger")<0&&ke.target.className.indexOf("expand-trigger")<0)return;const Be=this;ge(this),this.__resizeRAF__&&cancelFrame(this.__resizeRAF__),this.__resizeRAF__=requestFrame(function(){me(Be)&&(Be.__resizeLast__.width=Be.offsetWidth,Be.__resizeLast__.height=Be.offsetHeight,Be.__resizeListeners__.forEach(function(je){je.call(Be,ke)}))})};let Se=!1,$e="";ue="animationstart";const Te="Webkit Moz O ms".split(" ");let Re="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),Ae="";{const ke=document.createElement("fakeelement");if(ke.style.animationName!==void 0&&(Se=!0),Se===!1){for(let Be=0;Be div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',Te=Se.head||Se.getElementsByTagName("head")[0],Re=Se.createElement("style");Re.id="detectElementResize",Re.type="text/css",ne!=null&&Re.setAttribute("nonce",ne),Re.styleSheet?Re.styleSheet.cssText=$e:Re.appendChild(Se.createTextNode($e)),Te.appendChild(Re)}};return{addResizeListener:function(Se,$e){if(xe)Se.attachEvent("onresize",$e);else{if(!Se.__resizeTriggers__){const Te=Se.ownerDocument,Re=windowObject.getComputedStyle(Se);Re&&Re.position==="static"&&(Se.style.position="relative"),ve(Te),Se.__resizeLast__={},Se.__resizeListeners__=[],(Se.__resizeTriggers__=Te.createElement("div")).className="resize-triggers";const Ae=Te.createElement("div");Ae.className="expand-trigger",Ae.appendChild(Te.createElement("div"));const ke=Te.createElement("div");ke.className="contract-trigger",Se.__resizeTriggers__.appendChild(Ae),Se.__resizeTriggers__.appendChild(ke),Se.appendChild(Se.__resizeTriggers__),ge(Se),Se.addEventListener("scroll",ye,!0),ue&&(Se.__resizeTriggers__.__animationListener__=function(Ie){Ie.animationName===ce&&ge(Se)},Se.__resizeTriggers__.addEventListener(ue,Se.__resizeTriggers__.__animationListener__))}Se.__resizeListeners__.push($e)}},removeResizeListener:function(Se,$e){if(xe)Se.detachEvent("onresize",$e);else if(Se.__resizeListeners__.splice(Se.__resizeListeners__.indexOf($e),1),!Se.__resizeListeners__.length){Se.removeEventListener("scroll",ye,!0),Se.__resizeTriggers__.__animationListener__&&(Se.__resizeTriggers__.removeEventListener(ue,Se.__resizeTriggers__.__animationListener__),Se.__resizeTriggers__.__animationListener__=null);try{Se.__resizeTriggers__=!Se.removeChild(Se.__resizeTriggers__)}catch{}}}}}class AutoSizer extends reactExports.Component{constructor(...oe){super(...oe),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:ce,disableWidth:ue,onResize:pe}=this.props;if(this._parentNode){const me=window.getComputedStyle(this._parentNode)||{},ge=parseFloat(me.paddingLeft||"0"),ye=parseFloat(me.paddingRight||"0"),xe=parseFloat(me.paddingTop||"0"),ve=parseFloat(me.paddingBottom||"0"),_e=this._parentNode.getBoundingClientRect(),we=_e.height-xe-ve,Se=_e.width-ge-ye,$e=this._parentNode.offsetHeight-xe-ve,Te=this._parentNode.offsetWidth-ge-ye;(!ce&&(this.state.height!==$e||this.state.scaledHeight!==we)||!ue&&(this.state.width!==Te||this.state.scaledWidth!==Se))&&(this.setState({height:$e,width:Te,scaledHeight:we,scaledWidth:Se}),typeof pe=="function"&&pe({height:$e,scaledHeight:we,scaledWidth:Se,width:Te}))}},this._setRef=ce=>{this._autoSizer=ce}}componentDidMount(){const{nonce:oe}=this.props,ce=this._autoSizer?this._autoSizer.parentNode:null;if(ce!=null&&ce.ownerDocument&&ce.ownerDocument.defaultView&&ce instanceof ce.ownerDocument.defaultView.HTMLElement){this._parentNode=ce;const ue=ce.ownerDocument.defaultView.ResizeObserver;ue!=null?(this._resizeObserver=new ue(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(ce)):(this._detectElementResize=createDetectElementResize(oe),this._detectElementResize.addResizeListener(ce,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:oe,defaultHeight:ce,defaultWidth:ue,disableHeight:pe=!1,disableWidth:me=!1,doNotBailOutOnEmptyChildren:ge=!1,nonce:ye,onResize:xe,style:ve={},tagName:_e="div",...we}=this.props,{height:Se,scaledHeight:$e,scaledWidth:Te,width:Re}=this.state,Ae={overflow:"visible"},ke={};let Be=!1;return pe||(Se===0&&(Be=!0),Ae.height=0,ke.height=Se,ke.scaledHeight=$e),me||(Re===0&&(Be=!0),Ae.width=0,ke.width=Re,ke.scaledWidth=Te),ge&&(Be=!1),reactExports.createElement(_e,{ref:this._setRef,style:{...Ae,...ve},...we},!Be&&oe(ke))}}const treeWorkerUrl=""+new URL("tree.worker-w3km_BXF.js",import.meta.url).href;class TreeWorkerUrl extends Worker{constructor(){super(treeWorkerUrl,{type:"module"})}}const treeAsync=usingMemoizedWorkerTask(TreeWorkerUrl);function useTree(ne){const oe=compilerRuntimeExports.c(3);let ce,ue;return oe[0]!==ne?(ce=async()=>await treeAsync(ne),ue=[ne],oe[0]=ne,oe[1]=ce,oe[2]=ue):(ce=oe[1],ue=oe[2]),useAsync(ce,ue)}function useTreeMemo(ne,oe){const ce=reactExports.useMemo(()=>ne,oe);return useTree(ce)}const isDefined$1=ne=>!lodashExports.isUndefined(ne)&&!lodashExports.isNull(ne),divider$4=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1}});function useCache(ne,oe){const ce=compilerRuntimeExports.c(4),ue=!1,[pe,me]=reactExports.useState();let ge,ye;return ce[0]!==ue||ce[1]!==ne?(ge=()=>{ne&&me(ne)},ye=[ne,ue],ce[0]=ue,ce[1]=ne,ce[2]=ge,ce[3]=ye):(ge=ce[2],ye=ce[3]),reactExports.useEffect(ge,ye),pe}const layoutModes={"directed-graph":{value:"directed-graph",name:"Directed Graph",description:"Show all edges",showAllEdges:!0},tree:{value:"tree",name:"Tree",description:"Show only edges between each node and their final parents",showAllEdges:!1}};function GraphEvents(ne){const oe=compilerRuntimeExports.c(7),{onSelection:ce,layer:ue}=ne,pe=v$5(),me=_$4();let ge;oe[0]!==ce||oe[1]!==me?(ge=()=>{me({clickNode:xe=>{ce==null||ce({event:xe.event.original,node:xe.node})},enterNode:_temp$p,leaveNode:_temp2$h})},oe[0]=ce,oe[1]=me,oe[2]=ge):ge=oe[2];let ye;return oe[3]!==ue||oe[4]!==me||oe[5]!==pe?(ye=[ue,me,pe],oe[3]=ue,oe[4]=me,oe[5]=pe,oe[6]=ye):ye=oe[6],reactExports.useEffect(ge,ye),null}function _temp2$h(){document.body.style.cursor=""}function _temp$p(){document.body.style.cursor="pointer"}const SEVEN_CLASS_GNBU=["#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"];function TreeGraph({trace:ne,tree:oe,step:ce=0,layer:ue,showAllEdges:pe,trackedProperty:me}){const ge=v$5(),[ye,xe]=reactExports.useState("vertical"),ve=usePaper(),_e=useAcrylic(),we=useTheme(),Se=interpolate$1([we.palette.background.paper,we.palette.text.primary]),$e=j$3(),Te=reactExports.useMemo(()=>getFinalParents(ne),[ne]),Re=reactExports.useMemo(()=>{const Ae=ye==="vertical",ke=new MultiDirectedGraph;lodashExports.forEach(oe,Ie=>{ke.addNode(Ie.label,{x:Ae?Ie.x:-Ie.y,y:Ae?Ie.y:-Ie.x,label:Ie.label,size:Math.log(Ie.size)+2,color:we.palette.action.disabledBackground})});const Be={};return lodashExports.forEach(ne==null?void 0:ne.events,({id:Ie,pId:Ne})=>{Ie&&Ne&&(Be[Ie]=Be[Ie]??new Set,Be[Ie].add(Ne))}),lodashExports.forEach(ne==null?void 0:ne.events,({id:Ie,pId:Ne})=>{if(isDefined$1(Ne)&&ke.hasNode(`${Ne}`)){const je=makeEdgeKey(Ie,Ne);!ke.hasEdge(je)&&ke.hasNode(`${Ie}`)&&ke.addDirectedEdgeWithKey(je,`${Ne}`,`${Ie}`,{label:"",color:"white",size:2,final:Te[Ie]===Ne}),ke.hasDirectedEdge(je)&&ke.updateEdgeAttribute(je,"size",ze=>Math.log(Math.E**(ze-.5)+.5)+.5)}}),ke},[$e,ne,oe,Te,ye]);return reactExports.useEffect(()=>{const Ae=memoizee$1(je=>interpolate$1([we.palette.background.paper,je])),ke=400,Be=Se(.1);Re.forEachNode(je=>{Re.setNodeAttribute(je,"color",Be),Re.setNodeAttribute(je,"forceLabel",!1),Re.setNodeAttribute(je,"label",lodashExports.truncate(je,{length:15}))}),Re.forEachEdge(je=>{const ze=Re.getEdgeAttribute(je,"final");Re.setEdgeAttribute(je,"color",Be),Re.setEdgeAttribute(je,"hidden",!pe&&!ze),Re.setEdgeAttribute(je,"forceLabel",!1),Re.setEdgeAttribute(je,"label","")});const Ie={},Ne={};if((pe?lodashExports.forEach:lodashExports.forEachRight)(lodashExports.slice(ne==null?void 0:ne.events,0,ce+1),({id:je,type:ze,pId:Ue},qe)=>{const Ke=getColorHex(ze),Ge=Ae(Ke)(lodashExports.max([1-(ce-qe)/ke,.2]));if(Re.hasNode(`${je}`)&&!Ie[je]){Re.setNodeAttribute(`${je}`,"color",Ge),Re.setNodeAttribute(`${je}`,"label",lodashExports.truncate(`${lodashExports.startCase(ze)} ${je}`,{length:15})),Re.setNodeAttribute(`${je}`,"forceLabel",ce===qe);const Ye=makeEdgeKey(je,Ue);isDefined$1(Ue)&&Re.hasNode(`${Ue}`)&&Re.hasEdge(Ye)&&!Ne[Ye]&&(Re.setEdgeAttribute(Ye,"forceLabel",ce===qe),Re.setEdgeAttribute(Ye,"color",Ge),Re.setEdgeAttribute(Ye,"label",`Step ${qe}`),Re.setEdgeAttribute(Ye,"hidden",!1),pe||(Ne[Ye]=!0)),pe||(Ie[je]=!0)}}),me){const je=lodashExports.min(lodashExports.map(ne==null?void 0:ne.events,Ke=>lodashExports.get(Ke,me))),ze=lodashExports.max(lodashExports.map(ne==null?void 0:ne.events,Ke=>lodashExports.get(Ke,me))),Ue=Ke=>isNaN(je)||isNaN(ze)||isNaN(Ke)?0:(Ke-je)/(ze-je),qe=interpolate$1(SEVEN_CLASS_GNBU);lodashExports.forEach(lodashExports.slice(ne==null?void 0:ne.events,0,ce+1),Ke=>{if(Re.hasNode(`${Ke.id}`)){const Ge=qe(Ue(lodashExports.get(Ke,me)));if(Re.setNodeAttribute(`${Ke.id}`,"color",Ge),isDefined$1(Ke.pId)){const Ye=makeEdgeKey(`${Ke.id}`,`${Ke.pId}`);Re.hasDirectedEdge(Ye)&&Re.setEdgeAttribute(Ye,"color",Ge)}}})}$e(Re)},[Re,ce,ne,pe,me,we]),jsxRuntimeExports.jsx(Stack,{sx:{pt:6,position:"absolute",top:0,left:0},children:jsxRuntimeExports.jsxs(Stack,{direction:"row",sx:{...ve(1),..._e,alignItems:"center",height:Ae=>Ae.spacing(6),px:1,m:1},children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{var Ae,ke,Be;(Be=(ke=(Ae=ge==null?void 0:ge.getCamera)==null?void 0:Ae.call(ge))==null?void 0:ke.animatedReset)==null||Be.call(ke)},label:"Fit",icon:jsxRuntimeExports.jsx(SvgIcon$g,{})}),divider$4,jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",onClick:()=>{xe(ye==="vertical"?"horizontal":"vertical")},label:"Rotate",icon:jsxRuntimeExports.jsx(SvgIcon$c,{})}),divider$4,jsxRuntimeExports.jsx(MinimisedPlaybackControls,{layer:ue})]})})}function makeEdgeKey(ne,oe){return`${ne}::${oe}`}const stepsLayerGuard$2=ne=>!!getController(ne).steps;function TreePage({template:ne}){var Je,Qe,Ze,Tt,Ut,Gt,Nt,Wt,Mt,Yt;const{key:oe,setKey:ce,layer:ue,layers:pe,allLayers:me}=useLayer(void 0,stepsLayerGuard$2),ge=useTheme(),{controls:ye,onChange:xe,state:ve,dragHandle:_e}=useViewTreeContext(),we=useThrottle(((Je=ue==null?void 0:ue.source)==null?void 0:Je.step)??0,1e3/24),{stepTo:Se}=usePlaybackState(oe),$e=reactExports.useMemo(()=>{var ir,tr,Qt;return lodashExports.chain((Qt=(tr=(ir=ue==null?void 0:ue.source)==null?void 0:ir.trace)==null?void 0:tr.content)==null?void 0:Qt.events).flatMap(lodashExports.keys).uniq().filter(er=>er!=="type").value()},[(Tt=(Ze=(Qe=ue==null?void 0:ue.source)==null?void 0:Qe.trace)==null?void 0:Ze.content)==null?void 0:Tt.events]),[Te,Re]=reactExports.useState(""),Ae=(Gt=(Ut=ue==null?void 0:ue.source)==null?void 0:Ut.trace)==null?void 0:Gt.content;reactExports.useEffect(()=>{Re("")},[Ae,Re]);const[ke,Be]=reactExports.useState(),{x:Ie,y:Ne}=ke?ke.event instanceof MouseEvent?{x:ke.event.clientX,y:ke.event.clientY}:{x:(Wt=(Nt=ke.event.touches)==null?void 0:Nt[0])==null?void 0:Wt.clientX,y:(Yt=(Mt=ke.event.touches)==null?void 0:Mt[0])==null?void 0:Yt.clientY}:{x:0,y:0},[je,ze]=reactExports.useState(!1),[Ue,qe]=reactExports.useState("tree"),Ke=reactExports.useMemo(()=>{const ir=lodashExports.filter(lodashExports.map(Ae==null?void 0:Ae.events,(tr,Qt)=>({event:tr,step:Qt})),tr=>`${tr.event.id}`===(ke==null?void 0:ke.node));return{events:ir,current:lodashExports.findLast(ir,tr=>tr.step<=we)}},[ke,we]),{result:Ge,loading:Ye}=useTreeMemo({trace:Ae,mode:Ue},[oe,Ue]),Xe=reactExports.useMemo(()=>({stagePadding:8*8,allowInvalidContainer:!0,edgeLabelColor:{color:ge.palette.text.secondary},labelFont:"Inter",labelSize:14,labelDensity:.1,renderEdgeLabels:!0,edgeLabelFont:"Inter",edgeLabelSize:12,defaultDrawNodeHover:()=>{},labelColor:{color:ge.palette.text.primary},edgeLabelWeight:"500",defaultEdgeType:"arrow",edgeProgramClasses:{straight:EdgeArrowProgram$1,curvedArrow:EdgeCurvedArrowProgram}}),[ge]);return jsxRuntimeExports.jsxs(ne,{onChange:xe,stack:ve,children:[jsxRuntimeExports.jsx(ne.Key,{children:"tree"}),jsxRuntimeExports.jsx(ne.Title,{children:"Tree"}),jsxRuntimeExports.jsx(ne.Handle,{children:_e}),jsxRuntimeExports.jsx(ne.Content,{children:jsxRuntimeExports.jsx(Flex,{children:Ae?Ye?jsxRuntimeExports.jsxs(Flex,{sx:{flexDirection:"column",gap:4,alignItems:"center",justifyContent:"center"},children:[jsxRuntimeExports.jsx(CircularProgress,{}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",sx:{px:8,maxWidth:480},children:"Generating layout"})]}):Ge!=null&&Ge.length?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AutoSizer,{children:ir=>jsxRuntimeExports.jsxs(S$4,{style:{...ir,background:ge.palette.background.paper},graph:MultiDirectedGraph,settings:Xe,children:[jsxRuntimeExports.jsx(TreeGraph,{step:we,tree:Ge,trace:Ae,layer:ue,showAllEdges:layoutModes[Ue].showAllEdges,trackedProperty:Te}),jsxRuntimeExports.jsx(GraphEvents,{layer:oe,onSelection:tr=>{Be(tr),ze(!0)}})]})}),jsxRuntimeExports.jsx(Menu,{onClose:()=>ze(!1),anchorReference:"anchorPosition",anchorPosition:{left:Ie,top:Ne},transformOrigin:{horizontal:"left",vertical:"top"},open:je,children:jsxRuntimeExports.jsxs(MenuList,{dense:!0,sx:{p:0},children:[!!Ke.current&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ListItem,{sx:{py:0},children:jsxRuntimeExports.jsxs(Typography,{component:"div",color:"text.secondary",variant:"overline",children:["Step ",Ke.current.step]})}),jsxRuntimeExports.jsx(Box,{px:2,py:1,children:jsxRuntimeExports.jsx(PropertyList,{event:Ke.current.event,vertical:!0,simple:!0,primitives:!0})}),jsxRuntimeExports.jsx(Divider,{sx:{my:1,mx:2}})]}),jsxRuntimeExports.jsx(ListItem,{sx:{py:0},children:jsxRuntimeExports.jsxs(Typography,{component:"div",color:"text.secondary",variant:"overline",children:["Events at ",ke==null?void 0:ke.node]})}),lodashExports.map(Ke.events,(ir,tr,Qt)=>{var hr;const er=((hr=lodashExports.findLast(Qt,cr=>cr.step<=we))==null?void 0:hr.step)===ir.step;return jsxRuntimeExports.jsxs(Stack,{direction:"row",children:[jsxRuntimeExports.jsx(MenuItem,{selected:er,sx:{height:32,flex:1,borderLeft:`4px solid ${getColorHex(ir.event.type)}`},onClick:()=>{Se(ir.step)},children:jsxRuntimeExports.jsx(Tooltip,{title:`Go to step ${ir.step}`,children:jsxRuntimeExports.jsx(Box,{sx:{ml:-.5,pr:4},children:jsxRuntimeExports.jsx(Label$1,{primary:lodashExports.startCase(ir.event.type),secondary:isDefined$1(ir.event.pId)?`Step ${ir.step}, from ${ir.event.pId}`:`Step ${ir.step}`})})})}),jsxRuntimeExports.jsx(Box,{sx:{flex:0},children:jsxRuntimeExports.jsx(PropertyDialog,{event:ir.event,trigger:cr=>jsxRuntimeExports.jsx(MenuItem,{selected:er,onClick:cr,sx:{pr:0},children:jsxRuntimeExports.jsx(Tooltip,{title:"See all properties",children:jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(SvgIcon$S,{})})})})})})]})})]})})]}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$10,{}),label:"Graph",secondary:`${inferLayerName(ue)} is not a graph.`}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$10,{}),label:"Graph",secondary:"When you load a trace that has tree-like data, you'll see it here as a decision tree."})})}),jsxRuntimeExports.jsxs(ne.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),label:"Layer",value:oe,items:lodashExports.map(me,ir=>({id:ir.key,hidden:!lodashExports.find(pe,{key:ir.key}),name:inferLayerName(ir)})),onChange:ce,arrow:!0,ellipsis:12}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$C,{}),label:"Layout",value:Ue,onChange:qe,items:lodashExports.map(lodashExports.entries(layoutModes),([ir,tr])=>({id:ir,...tr})),arrow:!0}),divider$4,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$r,{}),label:"Tracked Property",value:Te,onChange:Re,items:[{id:"",name:"Off"},...lodashExports.map($e,ir=>({id:ir,name:`$.${ir}`}))],arrow:!0})]}),jsxRuntimeExports.jsx(ne.Extras,{children:ye})]})}function getFinalParents(ne){const oe={};return lodashExports.forEach(ne==null?void 0:ne.events,({id:ce,pId:ue})=>{oe[ce]=ue}),oe}function SelectionMenu(ne){const oe=compilerRuntimeExports.c(17),{selection:ce,onClose:ue}=ne,pe=useSelectionMenu(),me=useCache(ce);let ge;oe[0]!==ce?(ge=ce??{},oe[0]=ce,oe[1]=ge):ge=oe[1];const{client:ye}=ge,xe=!!ce,ve=(ye==null?void 0:ye.y)??0,_e=(ye==null?void 0:ye.x)??0;let we;oe[2]!==ve||oe[3]!==_e?(we={top:ve,left:_e},oe[2]=ve,oe[3]=_e,oe[4]=we):we=oe[4];let Se;oe[5]===Symbol.for("react.memo_cache_sentinel")?(Se={py:0},oe[5]=Se):Se=oe[5];let $e;oe[6]!==ue?($e=Ae=>{const ke=lodashExports.entries(Ae);return ke.length?lodashExports.chain(ke).sortBy(_temp$o).map((Be,Ie)=>{const[,Ne]=Be,{items:je,primary:ze}=Ne;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!Ie&&jsxRuntimeExports.jsx(Divider,{sx:{my:1,mx:2}}),ze&&jsxRuntimeExports.jsx(ListItem,{sx:{py:0},children:jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",variant:"overline",children:ze})}),lodashExports.chain(je).entries().sortBy(_temp2$g).map(Ue=>{const[qe,Ke]=Ue,{action:Ge,icon:Ye,primary:Xe,secondary:Je,extras:Qe}=Ke;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!(Ge||Xe||Je)&&(Ge?jsxRuntimeExports.jsxs(MenuItem,{onClick:()=>{Ge==null||Ge(),ue==null||ue()},children:[Ye&&jsxRuntimeExports.jsx(ListItemIcon,{children:Ye}),jsxRuntimeExports.jsx(ListItemText,{primary:Xe,sx:{mr:4}}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:Je})]},qe):jsxRuntimeExports.jsxs(ListItem,{children:[Ye&&jsxRuntimeExports.jsx(ListItemIcon,{children:Ye}),jsxRuntimeExports.jsx(ListItemText,{primary:Xe,sx:{mr:4}}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:Je})]},qe)),!!Qe&&Qe]})}).value()]})}).value():jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ListItem,{children:jsxRuntimeExports.jsx(Typography,{component:"div",children:"No info to show."})})})},oe[6]=ue,oe[7]=$e):$e=oe[7];let Te;oe[8]!==pe||oe[9]!==me||oe[10]!==$e?(Te=jsxRuntimeExports.jsx(MenuList,{dense:!0,sx:Se,children:jsxRuntimeExports.jsx(pe,{event:me,children:$e})}),oe[8]=pe,oe[9]=me,oe[10]=$e,oe[11]=Te):Te=oe[11];let Re;return oe[12]!==ue||oe[13]!==xe||oe[14]!==we||oe[15]!==Te?(Re=jsxRuntimeExports.jsx(Menu,{open:xe,anchorReference:"anchorPosition",anchorPosition:we,onClose:ue,keepMounted:!0,children:Te}),oe[12]=ue,oe[13]=xe,oe[14]=we,oe[15]=Te,oe[16]=Re):Re=oe[16],Re}function _temp2$g(ne){const[,oe]=ne;return oe.index}function _temp$o(ne){const[,oe]=ne;return oe.index}const identity$1=({children:ne})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne==null?void 0:ne({})});function useSelectionMenu(){const ne=compilerRuntimeExports.c(2),[oe]=useLayers(),{layers:ce}=oe;let ue,pe;return ne[0]!==ce?(pe=lodashExports.chain(ce).reduce(_temp3$a,identity$1).value(),ne[0]=ce,ne[1]=pe):pe=ne[1],ue=pe,ue}function _temp3$a(ne,oe){var ue;const ce=((ue=getController(oe))==null?void 0:ue.provideSelectionInfo)??identity$1;return pe=>{const{children:me,event:ge}=pe;return jsxRuntimeExports.jsx(ce,{layer:oe.key,event:ge,children:ye=>jsxRuntimeExports.jsx(ne,{event:ge,children:xe=>me==null?void 0:me(lodashExports.merge(ye,xe))})})}}const TILE_RESOLUTION=128,tileSize=(ne=!1)=>(ne?.75:devicePixelRatio*2)*TILE_RESOLUTION,rendererOptions={tileSubdivision:2,workerCount:lodashExports.clamp(lodashExports.floor((navigator.hardwareConcurrency-1)/2),1,12),tileResolution:{width:tileSize(),height:tileSize()}},TraceRendererContext=reactExports.createContext({});function useRendererInstance(){return reactExports.useContext(TraceRendererContext)}function useRenderer(ne,{width:oe,height:ce}={}){const ue=useTheme(),[pe]=useRenderers(),me=reactExports.useRef(null),[ge,ye]=reactExports.useState(""),[xe,ve]=reactExports.useState();return reactExports.useEffect(()=>{if(me.current&&oe&&ce&&ne){const _e=lodashExports.find(pe,we=>we.renderer.meta.id===ne);if(_e)try{const we=new _e.renderer.constructor;we.setup({...rendererOptions,screenSize:{width:oe,height:ce},backgroundColor:ue.palette.background.paper,accentColor:ue.palette.primary.main}),me.current.append(we.getView()),ve(we),ye("");const Se=me.current;return()=>{try{Se.removeChild(we.getView()),ve(void 0)}catch($e){console.warn($e)}finally{we.destroy()}}}catch(we){ye(`${_e.renderer.meta.name}: ${lodashExports.get(we,"message")}`),ve(void 0)}}},[me.current,lodashExports.map,ne,pe,ue,ye,ve]),useDebounce(()=>{xe&&oe&&ce&&xe.setOptions({screenSize:{width:oe,height:ce}})},ue.transitions.duration.standard,[xe,oe,ce]),{instance:xe,ref:me,error:ge}}function TraceRendererCircularProgress(){const ne=compilerRuntimeExports.c(3),[oe]=useLoading(),{map:ce,specimen:ue}=oe;let pe;return ne[0]!==ce||ne[1]!==ue?(pe=!!(ce||ue)&&jsxRuntimeExports.jsx(CircularProgress,{sx:{position:"absolute",top:_temp$n,right:_temp2$f}}),ne[0]=ce,ne[1]=ue,ne[2]=pe):pe=ne[2],pe}function _temp2$f(ne){return ne.spacing(2)}function _temp$n(ne){return ne.spacing(8)}const VIEWPORT_PAGE_DESCRIPTION="When you create a layer, you'll see it visualised here.";function TraceRenderer({width:ne,height:oe,renderer:ce,rendererRef:ue,layers:pe}){const me=reactExports.useMemo(nanoid,[]),{instance:ge,error:ye,ref:xe}=useRenderer(ce,{width:ne,height:oe}),{playing:ve}=usePlaybackState(),[,_e]=useScreenshots(),[we,Se]=reactExports.useState();reactExports.useEffect(()=>{if(ge){const Te=(Re,Ae)=>{const ke=Re;Se({client:{x:ke.clientX,y:ke.clientY},world:Ae.world,info:{point:Ae.world,components:Ae.components}})};return ge.on("click",Te),()=>void ge.off("click",Te)}},[ge]);const $e=reactExports.useMemo(()=>({renderer:ge}),[ge]);return reactExports.useEffect(()=>ue==null?void 0:ue(ge),[ge,ue]),reactExports.useEffect(()=>{const Te=async()=>{var Re;return await((Re=ge==null?void 0:ge.toDataUrl)==null?void 0:Re.call(ge))};return _e(()=>({[me]:Te})),()=>_e(()=>({[me]:void 0}))},[me,ge]),reactExports.useEffect(()=>{ge&&ge.setOptions({tileResolution:{width:tileSize(ve),height:tileSize(ve)}})},[ge,ve]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TraceRendererCircularProgress,{}),jsxRuntimeExports.jsx(TraceRendererContext.Provider,{value:$e,children:jsxRuntimeExports.jsx(Box,{sx:{width:ne,height:oe},children:pe!=null&&pe.length?jsxRuntimeExports.jsx(TrustedContent,{children:ye?jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",width:ne,height:oe,alignItems:"center",justifyContent:"center",color:"text.secondary"},children:[jsxRuntimeExports.jsx(SvgIcon$X,{sx:{mb:2},fontSize:"large"}),ye]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Box,{ref:xe,children:pe.map((Te,Re)=>jsxRuntimeExports.jsx(RenderLayer,{index:Re,layer:Te},Te.key))})})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$o,{}),label:"Viewport",width:ne,height:oe,secondary:VIEWPORT_PAGE_DESCRIPTION})})}),jsxRuntimeExports.jsx(SelectionMenu,{selection:we,onClose:()=>Se(void 0)})]})}function NodeList({nodes:ne,start:oe=0,end:ce=(ne==null?void 0:ne.length)??0}){const{renderer:ue}=useRendererInstance();return reactExports.useEffect(()=>{if(ue&&(ne!=null&&ne.length))return ue.add(lodashExports.slice(ne,oe,ce).flat())},[ue,ne,oe,ce]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}function NodeList2(ne){const oe=compilerRuntimeExports.c(5),{nodes:ce}=ne,{renderer:ue}=useRendererInstance();let pe,me;oe[0]!==ce||oe[1]!==ue?(pe=()=>{if(ue&&(ce!=null&&ce.length))return ue.add(ce)},me=[ue,ce],oe[0]=ce,oe[1]=ue,oe[2]=pe,oe[3]=me):(pe=oe[2],me=oe[3]),reactExports.useEffect(pe,me);let ge;return oe[4]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),oe[4]=ge):ge=oe[4],ge}function LazyNodeList({nodes:ne,end:oe}){const ue=lodashExports.floor((oe??0)/100)*100,pe=reactExports.useMemo(()=>lodashExports.slice(ne,0,ue),[ne,ue]),me=reactExports.useMemo(()=>lodashExports.slice(ne,ue,(oe??0)+1),[ne,ue,oe]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!!ue&&jsxRuntimeExports.jsx(NodeList,{nodes:pe}),me.map((ge,ye)=>jsxRuntimeExports.jsx(NodeList2,{nodes:ge},ue+ye))]})}const useEffectWhen=(ne,oe,ce)=>{const ue=compilerRuntimeExports.c(6),pe=usePrevious$1(ce);let me;ue[0]!==ne||ue[1]!==pe||ue[2]!==ce?(me=()=>{allSame(ce,pe)||ne()},ue[0]=ne,ue[1]=pe,ue[2]=ce,ue[3]=me):me=ue[3];let ge;return ue[4]!==oe?(ge=[oe],ue[4]=oe,ue[5]=ge):ge=ue[5],reactExports.useEffect(me,ge)};function allSame(ne,oe){return lodashExports.zip(ne,oe).every(([ce,ue])=>ce===ue)}const useEffectWhenAsync=(ne,oe,ce)=>{const ue=compilerRuntimeExports.c(12);let pe;ue[0]!==oe?(pe=oe===void 0?[]:oe,ue[0]=oe,ue[1]=pe):pe=ue[1];const me=pe;let ge;ue[2]!==ce?(ge=ce===void 0?[]:ce,ue[2]=ce,ue[3]=ge):ge=ue[3];const ye=ge,[xe,ve]=reactExports.useState(me),[_e,we]=reactExports.useState(ye);let Se,$e;ue[4]!==me||ue[5]!==_e||ue[6]!==ye?(Se=()=>{allSame(_e,ye)||(ve(me),we(ye))},$e=[me,ye,_e],ue[4]=me,ue[5]=_e,ue[6]=ye,ue[7]=Se,ue[8]=$e):(Se=ue[7],$e=ue[8]),reactExports.useEffect(Se,$e);let Te;return ue[9]!==xe||ue[10]!==_e?(Te=[...xe,..._e],ue[9]=xe,ue[10]=_e,ue[11]=Te):Te=ue[11],useAsyncAbortable(ne,Te)};function useConnectionResolver(){const ne=compilerRuntimeExports.c(2),[oe]=useConnections();let ce;return ne[0]!==oe?(ce=ue=>lodashExports.find(oe,ue),ne[0]=oe,ne[1]=ce):ce=ne[1],ce}function useConnection(ne){const oe=compilerRuntimeExports.c(3),ce=useConnectionResolver();let ue;return oe[0]!==ce||oe[1]!==ne?(ue=ce({url:ne}),oe[0]=ce,oe[1]=ne,oe[2]=ue):ue=oe[2],ue}function useMapContent(ne){const oe=compilerRuntimeExports.c(17),ce=useSnackbar(),ue=useLoadingState("map"),pe=useConnectionResolver();let me,ge;oe[0]!==ce||oe[1]!==pe?(ge=memoizee$1(async Te=>{const{source:Re,id:Ae}=Te===void 0?{}:Te;if(Re&&Ae){const ke=pe({url:Re});if(ke){ce("Fetching map...");const Be=await ke.transport().call("features/map",{id:Ae});return Be==null?void 0:Be.content}}},{normalizer:JSON.stringify}),oe[0]=ce,oe[1]=pe,oe[2]=ge):ge=oe[2],me=ge;const ye=me;let xe;oe[3]!==ne?(xe=ne??{},oe[3]=ne,oe[4]=xe):xe=oe[4];const{content:ve,source:_e,id:we}=xe;let Se;oe[5]!==ve||oe[6]!==ye||oe[7]!==we||oe[8]!==ne||oe[9]!==_e||oe[10]!==ue?(Se=()=>ue(async()=>{if(we)return{...ne,content:ve||await ye({source:_e,id:we})}}),oe[5]=ve,oe[6]=ye,oe[7]=we,oe[8]=ne,oe[9]=_e,oe[10]=ue,oe[11]=Se):Se=oe[11];let $e;return oe[12]!==ve||oe[13]!==ye||oe[14]!==we||oe[15]!==_e?($e=[ye,ve,_e,we],oe[12]=ve,oe[13]=ye,oe[14]=we,oe[15]=_e,oe[16]=$e):$e=oe[16],useAsync(Se,$e)}const noop$6=()=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});function useMapOptions(ne){const oe=compilerRuntimeExports.c(8);let ce;oe[0]!==ne?(ce=ne??{},oe[0]=ne,oe[1]=ce):ce=oe[1];const{format:ue}=ce;let pe;oe[2]!==ue||oe[3]!==(ne==null?void 0:ne.content)?(pe=async()=>{var ye,xe;return await((xe=(ye=getParser(ue))==null?void 0:ye.editor)==null?void 0:xe.call(ye,ne==null?void 0:ne.content))??noop$6},oe[2]=ue,oe[3]=ne==null?void 0:ne.content,oe[4]=pe):pe=oe[4];const me=ne==null?void 0:ne.content;let ge;return oe[5]!==ue||oe[6]!==me?(ge=[ue,me],oe[5]=ue,oe[6]=me,oe[7]=ge):ge=oe[7],useAsync(pe,ge)}function useParsedMap(ne,oe){const ce=useSnackbar(),ue=useTheme(),pe=useLoadingState("map"),{format:me,content:ge}=ne??{};return useAsync(()=>pe(async()=>{var ye,xe;if(me&&ge){ce("Processing map...");try{const ve=await((xe=(ye=getParser(me))==null?void 0:ye.parse)==null?void 0:xe.call(ye,ge,{color:ue.palette.text.primary,background:ue.palette.background.paper,...oe}))??{nodes:[]};return ce("Map loaded",`${ve.nodes.length} elements, ${ve.log.join(", ")}`),{...ne,...ve}}catch(ve){return console.error(ve),ce("Error parsing",lodashExports.get(ve,"message")),{error:lodashExports.get(ve,"message")}}}}),[me,ge,ue,oe])}const controller$2={key:"map",icon:jsxRuntimeExports.jsx(SvgIcon$D,{}),inferName:ne=>{var oe;return(oe=ne==null?void 0:ne.source)!=null&&oe.map?`${ne.source.map.name} (${lodashExports.startCase(ne.source.map.format)})`:"Untitled Map"},error:ne=>{var oe,ce;return(ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.parsedMap)==null?void 0:ce.error},compress:ne=>lodashExports.pick(ne,["map","options"]),claimImportedFile:async ne=>lodashExports.keys(mapParsers).includes(ext$1(ne.name))?{claimed:!0,layer:async oe=>{oe("Opening map...");try{return{map:{...await readUploadedMap(ne,lodashExports.entries(mapParsers).map(([ue])=>({id:ue}))).read()}}}catch(ce){return console.error(ce),oe(`Error opening, ${lodashExports.get(ce,"message")}`),{map:{key:nanoid(),id:custom$1().id,error:lodashExports.get(ce,"message"),name:lodashExports.startCase(name$2(ne.name))}}}}}:{claimed:!1},editor:withProduce(({value:ne,produce:oe})=>{var pe,me,ge;const ce=(pe=ne==null?void 0:ne.source)==null?void 0:pe.parsedMap,{result:ue}=useMapOptions(ce);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Source",content:jsxRuntimeExports.jsx(MapPicker,{value:(me=ne==null?void 0:ne.source)==null?void 0:me.map,onChange:ye=>oe(xe=>lodashExports.set(xe,"source.map",ye))})}),(ce==null?void 0:ce.error)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"error",sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:ce==null?void 0:ce.error})}),!!ce&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Heading,{label:"Map Options"}),ue?jsxRuntimeExports.jsx(ue,{value:(ge=ne==null?void 0:ne.source)==null?void 0:ge.options,onChange:ye=>oe(xe=>{var ve;lodashExports.set(xe,"source.options",ye(((ve=xe.source)==null?void 0:ve.options)??{}))})}):jsxRuntimeExports.jsx(CircularProgress,{sx:{mt:2}})]})]})}),renderer:({layer:ne,index:oe})=>{var pe;const{nodes:ce}=((pe=ne==null?void 0:ne.source)==null?void 0:pe.parsedMap)??{},ue=reactExports.useMemo(()=>[lodashExports.map(ce,me=>({...me,meta:{...me.meta,sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))],[ce,oe,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode]);return jsxRuntimeExports.jsx(NodeList,{nodes:ue})},service:withProduce(({value:ne,produce:oe})=>{var me,ge;const{result:ce}=useMapContent((me=ne==null?void 0:ne.source)==null?void 0:me.map),{result:ue,loading:pe}=useParsedMap(ce,(ge=ne==null?void 0:ne.source)==null?void 0:ge.options);return useEffectWhen(()=>{pe||oe(ye=>{lodashExports.set(ye,"source.parsedMap",ue),lodashExports.set(ye,"viewKey",nanoid())})},[ue,oe,pe],[ue]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}),provideSelectionInfo:({children:ne,event:oe,layer:ce})=>{const{layer:ue,setLayer:pe,layers:me}=useLayer(ce),{parsedMap:ge}=(ue==null?void 0:ue.source)??{},{point:ye,node:xe}=reactExports.useMemo(()=>{var _e,we,Se,$e;if(ge&&oe){const Te=($e=(Se=getParser((we=(_e=ue==null?void 0:ue.source)==null?void 0:_e.map)==null?void 0:we.format))==null?void 0:Se.hydrate)==null?void 0:$e.call(Se,ge);if(Te){const Re=(oe==null?void 0:oe.world)&&Te.snap(oe.world);if(Re){const Ae=(oe==null?void 0:oe.world)&&Te.nodeAt(Re);return{point:Re,node:Ae}}}}return{}},[ge,oe]),ve=reactExports.useMemo(()=>({...ue&&ye&&!lodashExports.isUndefined(xe)&&{[ue.key]:{primary:inferLayerName(ue),items:{point:{primary:"Point",secondary:`(${lodashExports.round(ye.x,2)}, ${lodashExports.round(ye.y,2)})`}}}}}),[ye,xe,ue,me,pe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ne==null?void 0:ne(ve)})},getSources:ne=>{var ue,pe;const oe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.map,ce=(pe=ne==null?void 0:ne.source)==null?void 0:pe.parsedMap;return oe?[{id:"map",name:`${oe.name}`,language:"txt",content:ce==null?void 0:ce.content}]:[]},onEditSource:(ne,oe,ce)=>ne};function _defineProperty$1(ne,oe,ce){return oe in ne?Object.defineProperty(ne,oe,{value:ce,enumerable:!0,configurable:!0,writable:!0}):ne[oe]=ce,ne}function ownKeys$1(ne,oe){var ce=Object.keys(ne);if(Object.getOwnPropertySymbols){var ue=Object.getOwnPropertySymbols(ne);oe&&(ue=ue.filter(function(pe){return Object.getOwnPropertyDescriptor(ne,pe).enumerable})),ce.push.apply(ce,ue)}return ce}function _objectSpread2$1(ne){for(var oe=1;oe=0)&&(ce[pe]=ne[pe]);return ce}function _objectWithoutProperties(ne,oe){if(ne==null)return{};var ce=_objectWithoutPropertiesLoose(ne,oe),ue,pe;if(Object.getOwnPropertySymbols){var me=Object.getOwnPropertySymbols(ne);for(pe=0;pe=0)&&Object.prototype.propertyIsEnumerable.call(ne,ue)&&(ce[ue]=ne[ue])}return ce}function _slicedToArray(ne,oe){return _arrayWithHoles(ne)||_iterableToArrayLimit(ne,oe)||_unsupportedIterableToArray(ne,oe)||_nonIterableRest()}function _arrayWithHoles(ne){if(Array.isArray(ne))return ne}function _iterableToArrayLimit(ne,oe){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(ne)))){var ce=[],ue=!0,pe=!1,me=void 0;try{for(var ge=ne[Symbol.iterator](),ye;!(ue=(ye=ge.next()).done)&&(ce.push(ye.value),!(oe&&ce.length===oe));ue=!0);}catch(xe){pe=!0,me=xe}finally{try{!ue&&ge.return!=null&&ge.return()}finally{if(pe)throw me}}return ce}}function _unsupportedIterableToArray(ne,oe){if(ne){if(typeof ne=="string")return _arrayLikeToArray(ne,oe);var ce=Object.prototype.toString.call(ne).slice(8,-1);if(ce==="Object"&&ne.constructor&&(ce=ne.constructor.name),ce==="Map"||ce==="Set")return Array.from(ne);if(ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ce))return _arrayLikeToArray(ne,oe)}}function _arrayLikeToArray(ne,oe){(oe==null||oe>ne.length)&&(oe=ne.length);for(var ce=0,ue=new Array(oe);ce=ne.length?ne.apply(this,pe):function(){for(var ge=arguments.length,ye=new Array(ge),xe=0;xe1&&arguments[1]!==void 0?arguments[1]:{};validators$1.initial(ne),validators$1.handler(oe);var ce={current:ne},ue=curry$1(didStateUpdate)(ce,oe),pe=curry$1(updateState)(ce),me=curry$1(validators$1.changes)(ne),ge=curry$1(extractChanges)(ce);function ye(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(_e){return _e};return validators$1.selector(ve),ve(ce.current)}function xe(ve){compose$3(ue,pe,me,ge)(ve)}return[ye,xe]}function extractChanges(ne,oe){return isFunction(oe)?oe(ne.current):oe}function updateState(ne,oe){return ne.current=_objectSpread2(_objectSpread2({},ne.current),oe),oe}function didStateUpdate(ne,oe,ce){return isFunction(oe)?oe(ne.current):Object.keys(ce).forEach(function(ue){var pe;return(pe=oe[ue])===null||pe===void 0?void 0:pe.call(oe,ne.current[ue])}),ce}var index$1={create:create$1},config$1={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function curry(ne){return function oe(){for(var ce=this,ue=arguments.length,pe=new Array(ue),me=0;me=ne.length?ne.apply(this,pe):function(){for(var ge=arguments.length,ye=new Array(ge),xe=0;xeoe(new Proxy(normalize$1(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace$1=/^\$\{\{\s*/,closeBrace$1=/^\s*\}\}/,neverMatch$1=/\b\B/,parser$3=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace$1,VARIABLE_END:closeBrace$1,PIPE_START:neverMatch$1,PIPE_PARAMETER_START:neverMatch$1,QUOTED_STRING:neverMatch$1}),parseString$1=memoizee$1(ne=>{const oe=parser$3(ne);return lodashExports.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken$1(ue)(ce)):parseToken$1(oe.variables[0].name)},{primitive:!0});function parseProperty$1(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports.map(ne,parseProperty$1);return ce=>lodashExports.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports.mapValues(ne,parseProperty$1);return ce=>lodashExports.mapValues(oe,ue=>ue(ce))}case String:return parseString$1(ne);default:return()=>ne}}function commonjsRequire$1(ne){throw new Error('Could not dynamically require "'+ne+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(ne,oe){(function(ce,ue){typeof commonjsRequire$1=="function"?ne.exports=ue():ce.pluralize=ue()})(commonjsGlobal$1,function(){var ce=[],ue=[],pe={},me={},ge={};function ye(Re){return typeof Re=="string"?new RegExp("^"+Re+"$","i"):Re}function xe(Re,Ae){return Re===Ae?Ae:Re===Re.toLowerCase()?Ae.toLowerCase():Re===Re.toUpperCase()?Ae.toUpperCase():Re[0]===Re[0].toUpperCase()?Ae.charAt(0).toUpperCase()+Ae.substr(1).toLowerCase():Ae.toLowerCase()}function ve(Re,Ae){return Re.replace(/\$(\d{1,2})/g,function(ke,Be){return Ae[Be]||""})}function _e(Re,Ae){return Re.replace(Ae[0],function(ke,Be){var Ie=ve(Ae[1],arguments);return xe(ke===""?Re[Be-1]:ke,Ie)})}function we(Re,Ae,ke){if(!Re.length||pe.hasOwnProperty(Re))return Ae;for(var Be=ke.length;Be--;){var Ie=ke[Be];if(Ie[0].test(Ae))return _e(Ae,Ie)}return Ae}function Se(Re,Ae,ke){return function(Be){var Ie=Be.toLowerCase();return Ae.hasOwnProperty(Ie)?xe(Be,Ie):Re.hasOwnProperty(Ie)?xe(Be,Re[Ie]):we(Ie,Be,ke)}}function $e(Re,Ae,ke,Be){return function(Ie){var Ne=Ie.toLowerCase();return Ae.hasOwnProperty(Ne)?!0:Re.hasOwnProperty(Ne)?!1:we(Ne,Ne,ke)===Ne}}function Te(Re,Ae,ke){var Be=Ae===1?Te.singular(Re):Te.plural(Re);return(ke?Ae+" ":"")+Be}return Te.plural=Se(ge,me,ce),Te.isPlural=$e(ge,me,ce),Te.singular=Se(me,ge,ue),Te.isSingular=$e(me,ge,ue),Te.addPluralRule=function(Re,Ae){ce.push([ye(Re),Ae])},Te.addSingularRule=function(Re,Ae){ue.push([ye(Re),Ae])},Te.addUncountableRule=function(Re){if(typeof Re=="string"){pe[Re.toLowerCase()]=!0;return}Te.addPluralRule(Re,"$0"),Te.addSingularRule(Re,"$0")},Te.addIrregularRule=function(Re,Ae){Ae=Ae.toLowerCase(),Re=Re.toLowerCase(),ge[Re]=Ae,me[Ae]=Re},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(Re){return Te.addIrregularRule(Re[0],Re[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(Re){return Te.addPluralRule(Re[0],Re[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(Re){return Te.addSingularRule(Re[0],Re[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(Te.addUncountableRule),Te})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs$1(pluralizeExports),parseTraceWorkerLegacyUrl=""+new URL("parseTrace.worker-ahBXG5Yy.js",import.meta.url).href,parseTraceWorkerUrl=""+new URL("parseTrace.worker-DDV8yRvx.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}class ParseTraceWorkerLegacy extends Worker{constructor(){super(parseTraceWorkerLegacyUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker),parseTraceLegacyAsync=usingMemoizedWorkerTask(ParseTraceWorkerLegacy);function useTraceParser(ne,oe,ce){const ue=useSnackbar(),pe=useLoadingState("specimen");return reactExports.useMemo(()=>{if(ne.trace)return oe?()=>pe(async()=>{var me,ge;ue("Processing trace...");try{const ye=((me=ne.trace)==null?void 0:me.version)==="1.4.0"?await parseTraceAsync(ne):await parseTraceLegacyAsync(ne);return ue("Trace loaded",pluralize("step",((ge=ye==null?void 0:ye.stepsPersistent)==null?void 0:ge.length)??0,!0)),{components:ye,content:ne.trace}}catch(ye){return console.error(ye),ue("Error parsing",lodashExports.get(ye,"message")),{error:lodashExports.get(ye,"message")}}}):()=>pe(async()=>{var me,ge;return ue("Trace loaded",pluralize("step",((ge=(me=ne.trace)==null?void 0:me.events)==null?void 0:ge.length)??0,!0)),{content:ne.trace,components:[]}})},ce)}function mapProperties(ne={},oe){const ce={};for(const ue of Object.keys(ne))ce[ue]=ue==="$"?ne[ue]:oe(ne[ue],ue,ne);return Object.setPrototypeOf(ce,ne)}function normalize(ne={}){return mapProperties(ne,oe=>lodashExports.isFunction(oe)?oe:parseProperty(oe))}const parseToken=ne=>{const oe=Function("$",`return ${ne};`);return ce=>oe(new Proxy(normalize(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$2=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memoizee$1(ne=>{const oe=parser$2(ne);return lodashExports.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken(ue)(ce)):parseToken(oe.variables[0].name)},{primitive:!0});function parseProperty(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports.map(ne,parseProperty);return ce=>lodashExports.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports.mapValues(ne,parseProperty);return ce=>lodashExports.mapValues(oe,ue=>ue(ce))}case String:return parseString(ne);default:return()=>ne}}function useTraceContent(ne){const oe=compilerRuntimeExports.c(24),ce=useSnackbar(),ue=useLoadingState("specimen"),pe=useConnectionResolver(),[me]=useFeatures(),{traces:ge}=me;let ye,xe;oe[0]!==ce||oe[1]!==pe?(xe=memoizee$1(async Ne=>{const{source:je,id:ze}=Ne;if(je&&ze){const Ue=pe({url:je});if(Ue){ce("Fetching trace...");const qe=await Ue.transport().call("features/trace",{id:ze});return console.log(qe==null?void 0:qe.content),qe==null?void 0:qe.content}}},{normalizer:JSON.stringify}),oe[0]=ce,oe[1]=pe,oe[2]=xe):xe=oe[2],ye=xe;const ve=ye;let _e;oe[3]!==ne?(_e=ne??{},oe[3]=ne,oe[4]=_e):_e=oe[4];const{content:we,source:Se,id:$e,key:Te}=_e;let Re;oe[5]!==$e||oe[6]!==Se||oe[7]!==ge?(Re=lodashExports.find(ge,{id:$e,source:Se})??{},oe[5]=$e,oe[6]=Se,oe[7]=ge,oe[8]=Re):Re=oe[8];const{lastModified:Ae}=Re;let ke;oe[9]!==we||oe[10]!==ve||oe[11]!==$e||oe[12]!==Ae||oe[13]!==Se||oe[14]!==ne||oe[15]!==ue?(ke=()=>ue(async()=>{if($e){if(we)return{...ne,content:we};{const Ne=await ve({source:Se,id:$e,lastModified:Ae});return{...ne,content:Ne}}}}),oe[9]=we,oe[10]=ve,oe[11]=$e,oe[12]=Ae,oe[13]=Se,oe[14]=ne,oe[15]=ue,oe[16]=ke):ke=oe[16];const Be=!!we;let Ie;return oe[17]!==ve||oe[18]!==$e||oe[19]!==Te||oe[20]!==Ae||oe[21]!==Se||oe[22]!==Be?(Ie=[ve,Be,Te,Se,$e,Ae],oe[17]=ve,oe[18]=$e,oe[19]=Te,oe[20]=Ae,oe[21]=Se,oe[22]=Be,oe[23]=Ie):Ie=oe[23],useAsync(ke,Ie)}const labelScale=1.25,reuseCanvas={canvas:document.createElement("canvas")};function getTextWidth(ne,oe){const ue=(reuseCanvas.canvas||(reuseCanvas.canvas=document.createElement("canvas"))).getContext("2d");return ue.font=oe,ue.measureText(ne).width}const isNullish=ne=>ne==null;function makePathIndex(ne){const oe=[],ce={},ue={},pe=lodashExports.chain(ne==null?void 0:ne.events).map((ye,xe)=>({step:xe,id:ye.id,pId:ye.pId})).groupBy("id").value();lodashExports.forEach(ne==null?void 0:ne.events,({id:ye,pId:xe},ve)=>{!isNullish(xe)&&ce[ye]!==xe&&(oe.push({id:ye,pId:xe,step:ve,prev:lodashExports.last(oe)}),ce[ye]=xe),ue[ve]=lodashExports.last(oe)});const me=(ye,xe=(ve=>(ve=ne==null?void 0:ne.events)==null?void 0:ve.length)()??0)=>{let _e=ue[xe];for(;_e;){if(_e.id===ye)return _e.pId;_e=_e.prev}};return{getParent:me,getPath:ye=>{const xe=[ye];let ve={...(ne.events??[])[ye],step:ye};for(;ve;){const _e=me(ve.id,ve.step);if(_e){const we=lodashExports.findLast(pe[_e],Se=>Se.step<=ve.step);if(we)xe.push(we.step),ve=we;else break}else break}return xe}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(SvgIcon$w,{}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Trace"},error:ne=>{var oe,ce,ue,pe;return((ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.trace)==null?void 0:ce.error)||((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.parsedTrace)==null?void 0:pe.error)},compress:ne=>lodashExports.pick(ne,["trace","onion","step","code","breakpoints"]),claimImportedFile:async ne=>isTraceFormat(ne)?{claimed:!0,layer:async oe=>{oe("Opening trace...");try{return{trace:await readUploadedTrace(ne).read()}}catch(ce){return console.error(ce),oe(`Error opening, ${lodashExports.get(ce,"message")}`),{trace:{key:nanoid(),id:custom$1().id,error:lodashExports.get(ce,"message"),name:lodashExports.startCase(name$2(ne.name))}}}}}:{claimed:!1},editor:withProduce(({value:ne,produce:oe})=>{var ce,ue,pe,me,ge,ye,xe,ve,_e,we,Se;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:$e=>oe(Te=>lodashExports.set(Te,"source.trace",$e)),value:(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace})}),((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.trace)==null?void 0:pe.error)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"error",sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(ge=(me=ne==null?void 0:ne.source)==null?void 0:me.trace)==null?void 0:ge.error})}),((xe=(ye=ne==null?void 0:ne.source)==null?void 0:ye.parsedTrace)==null?void 0:xe.error)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"error",sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(_e=(ve=ne==null?void 0:ne.source)==null?void 0:ve.parsedTrace)==null?void 0:_e.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Se=(we=ne==null?void 0:ne.source)==null?void 0:we.parsedTrace)==null?void 0:Se.content})})]})}),service:withProduce(({value:ne,produce:oe})=>{var ye;const{palette:ce}=useTheme(),{result:ue,loading:pe}=useTraceContent((ye=ne==null?void 0:ne.source)==null?void 0:ye.trace);reactExports.useEffect(()=>{oe(xe=>{var ve,_e;return lodashExports.set(xe,"source.playbackTo",((_e=(ve=ue==null?void 0:ue.content)==null?void 0:ve.events)==null?void 0:_e.length)??0)})},[ue==null?void 0:ue.key]);const{isTrusted:me}=useUntrustedLayers(),ge=useTraceParser({trace:ue==null?void 0:ue.content,context:{theme:{foreground:ce.text.primary,background:ce.background.paper,accent:ce.primary.main},color:{...colorsHex,...lodashExports.mapValues(accentColors,(xe,ve)=>getShade(ve,ce.mode,500,400))},themeAccent:ce.primary.main,themeTextPrimary:ce.text.primary,themeBackground:ce.background.paper},view:"main"},me,[ue==null?void 0:ue.key,ce.mode,me]);return useAsync$1(async()=>{if(ge&&!pe){const xe=await ge();oe(ve=>{lodashExports.set(ve,"source.parsedTrace",xe),lodashExports.set(ve,"viewKey",nanoid())})}},[pe,ge]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:ne})})}),renderer:({layer:ne,index:oe})=>{var xe,ve,_e;const ce=(ve=(xe=ne==null?void 0:ne.source)==null?void 0:xe.parsedTrace)==null?void 0:ve.components,ue=useThrottle(((_e=ne==null?void 0:ne.source)==null?void 0:_e.step)??0,1e3/60),pe=use2DPath(ne,oe,ue),me=reactExports.useMemo(()=>lodashExports.map(ce==null?void 0:ce.stepsPersistent,we=>lodashExports.map(we,Se=>lodashExports.merge(Se,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsPersistent,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ge=reactExports.useMemo(()=>lodashExports.map(ce==null?void 0:ce.stepsTransient,we=>lodashExports.map(we,Se=>lodashExports.merge(Se,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsTransient,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ye=reactExports.useMemo(()=>[ge[ue]??[]],[ge,ue]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{end:ue,nodes:me}),jsxRuntimeExports.jsx(NodeList,{nodes:ye}),pe]})},steps:ne=>{var oe,ce,ue;return((ue=(ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.parsedTrace)==null?void 0:ce.content)==null?void 0:ue.events)??[]},provideSelectionInfo:({layer:ne,event:oe,children:ce})=>{const{layer:ue,setLayer:pe}=useLayer(ne),me=reactExports.useMemo(()=>{var ve,_e,we,Se,$e;const ge=((we=(_e=(ve=ue==null?void 0:ue.source)==null?void 0:ve.parsedTrace)==null?void 0:_e.content)==null?void 0:we.events)??[],ye=lodashExports.chain((Se=oe==null?void 0:oe.info)==null?void 0:Se.components).filter(Te=>{var Re;return((Re=Te.meta)==null?void 0:Re.sourceLayer)===(ue==null?void 0:ue.key)}).map(Te=>{var Re;return(Re=Te.meta)==null?void 0:Re.step}).filter(lodashExports.negate(lodashExports.isUndefined)).sort((Te,Re)=>Te-Re).value(),xe=lodashExports.chain(($e=oe==null?void 0:oe.info)==null?void 0:$e.components).filter(Te=>{var Re;return((Re=Te.meta)==null?void 0:Re.sourceLayer)===(ue==null?void 0:ue.key)}).filter(Te=>{var Re;return(Re=Te.meta)==null?void 0:Re.info}).value();if(ye.length&&ue){const Te=lodashExports.last(ye),Re=ge[Te];if(Re)return{...lodashExports.keyBy(lodashExports.map(xe,(Ae,ke)=>({key:`${ue.key}.${ke}`,primary:`Selection in ${inferLayerName(ue)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:Ae.meta.info,vertical:!0})}}})),"key"),[ue.key]:{primary:inferLayerName(ue),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:Re,vertical:!0,simple:!0,primitives:!0})},propertiesDetails:{index:-1,extras:jsxRuntimeExports.jsx(PropertyDialog,{event:Re,trigger:Ae=>jsxRuntimeExports.jsxs(MenuItem,{onClick:Ae,children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(SvgIcon$S,{})}),jsxRuntimeExports.jsx(ListItemText,{sx:{mr:4},children:"See properties"}),jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",children:["Step ",Te]})]})})},[`${Re}`]:{primary:`Go to step ${Te}`,secondary:`${lodashExports.startCase(Re.type)}`,action:()=>pe(produce(ue,Ae=>{lodashExports.set(Ae,"source.step",Te)})),icon:jsxRuntimeExports.jsx(SvgIcon$Z,{})}}}}}return{}},[ue,oe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ce==null?void 0:ce(me)})},getSources:ne=>{var ce;const oe=(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace;return oe?[{id:"trace",name:`${oe.name}`,language:"yaml",content:dump(oe.content,{noCompatMode:!0})}]:[]}},labelSize=.8;function use2DPath(ne,oe=0,ce=0){var ge,ye,xe;const{palette:ue}=useTheme(),{getPath:pe}=reactExports.useMemo(()=>{var ve,_e,we;return((ve=ne==null?void 0:ne.source)==null?void 0:ve.playback)!=="playing"&&((we=(_e=ne==null?void 0:ne.source)==null?void 0:_e.parsedTrace)!=null&&we.content)?makePathIndex(ne.source.parsedTrace.content):{getParent:lodashExports.constant(void 0),getPath:lodashExports.constant([])}},[(ye=(ge=ne==null?void 0:ne.source)==null?void 0:ge.parsedTrace)==null?void 0:ye.content,(xe=ne==null?void 0:ne.source)==null?void 0:xe.playback]);return reactExports.useMemo(()=>{var we,Se,$e,Te,Re,Ae,ke,Be,Ie,Ne,je,ze;const ve=interpolate$1([ue.background.paper,ue.text.primary])(.05),_e=(Se=(we=ne==null?void 0:ne.source)==null?void 0:we.parsedTrace)==null?void 0:Se.content;if(($e=_e==null?void 0:_e.render)!=null&&$e.path||_e!=null&&_e.pivot){const Ue=((Re=(Te=_e==null?void 0:_e.render)==null?void 0:Te.path)==null?void 0:Re.pivot)??(_e==null?void 0:_e.pivot)??{},qe=(ke=(Ae=_e==null?void 0:_e.render)==null?void 0:Ae.path)!=null&&ke.scale?_e.render.path.scale*(1/.3):((Be=_e==null?void 0:_e.pivot)==null?void 0:Be.scale)??1,{x:Ke,y:Ge}=Ue,Ye=(_e==null?void 0:_e.version)==="1.4.0"?parseProperty$1:Tt=>Ut=>parseProperty(Tt)({event:Ut}),Xe=Ke?Ye(Ke):Tt=>Tt.x,Je=Ge?Ye(Ge):Tt=>Tt.y,Qe=lodashExports.map(pe(ce),Tt=>{var Ut;return(Ut=_e==null?void 0:_e.events)==null?void 0:Ut[Tt]}),Ze={x:Xe({x:0,y:0,...lodashExports.head(Qe)}),y:Je({x:0,y:0,...lodashExports.head(Qe)})};if(Qe.length){const Tt=`${lodashExports.startCase((Ie=lodashExports.head(Qe))==null?void 0:Ie.type)} ${(Ne=lodashExports.head(Qe))==null?void 0:Ne.id}`,Ut=getTextWidth(Tt,`${labelSize*qe*labelScale}px Inter`),Gt=[{$:"circle",x:Xe({x:0,y:0,...lodashExports.last(Qe)}),y:Je({x:0,y:0,...lodashExports.last(Qe)}),fill:ue.primary.main,radius:.3*qe},{$:"path",points:Qe.map(Nt=>({x:Xe({x:0,y:0,...Nt}),y:Je({x:0,y:0,...Nt})})),fill:ue.primary.main,alpha:1,lineWidth:.3*qe},{$:"circle",...Ze,fill:ue.primary.main,radius:.3*qe},{$:"rect",alpha:.85,fill:ve,x:Ze.x-.3*qe*labelScale,y:Ze.y-2*qe*labelScale,width:Ut+(.8+.5)*qe*labelScale,height:1.4*qe*labelScale},{$:"path",points:[{x:Ze.x,y:Ze.y},{x:Ze.x+(-.3-.05)*qe*labelScale,y:Ze.y+(-2+1.4)*qe*labelScale}],fill:getColorHex((je=lodashExports.head(Qe))==null?void 0:je.type),alpha:1,lineWidth:.1*qe*labelScale},{$:"rect",x:Ze.x+(-.3-.1)*qe*labelScale,y:Ze.y+-2*qe*labelScale,fill:getColorHex((ze=lodashExports.head(Qe))==null?void 0:ze.type),height:1.4*qe*labelScale,width:.1*qe*labelScale},{$:"rect",alpha:0,fill:"rgba(255, 255, 255, 0)",x:Ze.x-.3*qe*labelScale,y:Ze.y-2*qe*labelScale,width:Ut*2,height:1*qe*labelScale,label:Tt,"label-size":labelSize*qe*labelScale,"label-x":(.1+.5)*qe*labelScale,"label-y":1*qe*labelScale,"label-color":ue.text.primary}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports.map(Gt,Nt=>({component:Nt,meta:{source:"path",sourceLayerIndex:-99999+oe}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[ne,oe,ce,ue,pe])}const mapValuesDeep=(ne,oe)=>lodashExports.isArray(ne)?lodashExports.map(ne,ce=>mapValuesDeep(ce,oe)):lodashExports.isObject(ne)?lodashExports.mapValues(ne,ce=>mapValuesDeep(ce,oe)):oe(ne);async function findConnection(ne,oe,ce){for(const ue of ne){const pe=await ue.transport().call("features/algorithms"),me=await ue.transport().call("features/formats");if(lodashExports.find(pe,{id:oe})&&lodashExports.find(me,{id:ce}))return ue}}const maxStringPropLength=40,controller={...lodashExports.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(SvgIcon$w,{}),compress:ne=>lodashExports.pick(ne,["mapLayerKey","query","start","end","algorithm","onion","step","code","breakpoints"]),editor:withProduce(({value:ne,produce:oe})=>{var ve,_e;const{algorithm:ce}=(ne==null?void 0:ne.source)??{},{layers:ue,allLayers:pe,layer:me,key:ge}=useLayer(void 0,we=>{var Se;return((Se=we.source)==null?void 0:Se.type)==="map"}),[{algorithms:ye}]=useFeatures(),[xe]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(SvgIcon$T,{}),label:"Algorithm",value:ce,items:ye.map(we=>{var Se;return{...we,description:(Se=lodashExports.find(xe,{url:we.source}))==null?void 0:Se.name}}),onChange:async we=>oe(Se=>lodashExports.set(Se,"source.algorithm",we))})}),!(ye!=null&&ye.length)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),label:"Layer",value:ge,items:pe.map(we=>({id:we.key,hidden:!lodashExports.find(ue,Se=>Se.key===we.key),name:inferLayerName(we)})),onChange:async we=>oe(Se=>lodashExports.set(Se,"source.mapLayerKey",we))})}),me&&jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(me)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(_e=(ve=ne==null?void 0:ne.source)==null?void 0:ve.trace)==null?void 0:_e.content})})]})}),service:withProduce(({value:ne,produce:oe,onChange:ce})=>{var Te;const ue=controller$1.service,pe=useSnackbar(),{algorithm:me,mapLayerKey:ge,start:ye,end:xe}=(ne==null?void 0:ne.source)??{},[{layers:ve}]=useLayers(),[_e]=useConnections(),[{algorithms:we}]=useFeatures(),Se=reactExports.useMemo(()=>{if(ge&&me)return lodashExports.find(ve,{key:ge})},[ge,me,ve]),{result:$e}=useMapContent((Te=Se==null?void 0:Se.source)==null?void 0:Te.map);return useEffectWhenAsync(async Re=>{var Ae;if(Se&&$e&&me){const{format:ke}=((Ae=Se==null?void 0:Se.source)==null?void 0:Ae.map)??{},{content:Be}=$e??{};if(ke&&Be){const Ie=await findConnection(_e,me,ke),Ne=lodashExports.find(we,{id:me});if(Ie){pe(`Executing ${inferLayerName(ne)} using ${Ie.name}...`);const je={format:ke,instances:[{start:ye??0,end:xe??0}],mapURI:`map:${encodeURIComponent(Be)}`,algorithm:me},ze=await Ie.transport().call("solve/pathfinding",je);Re.aborted?pe("Canceled"):oe(Ue=>{lodashExports.set(Ue,"source.trace",{name:`${Ne==null?void 0:Ne.name}`,content:ze,key:nanoid(),id:nanoid()}),lodashExports.set(Ue,"source.query",je)})}}}},[Se,_e,me,ye,xe,oe,pe,ne,we],[Se,$e,_e,me,ye,xe]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ue,{value:ne,onChange:ce})})}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Query"},provideSelectionInfo:({children:ne,event:oe,layer:ce})=>{const ue=controller$1.provideSelectionInfo,{layer:pe,setLayer:me,layers:ge}=useLayer(ce),ye=reactExports.useMemo(()=>{const ve=lodashExports.filter(ge,{source:{type:"map"}});return lodashExports.filter(lodashExports.map(ve,_e=>{var Se,$e,Te,Re;const{parsedMap:we}=(_e==null?void 0:_e.source)??{};if(we&&oe){const Ae=(Re=(Te=getParser(($e=(Se=_e==null?void 0:_e.source)==null?void 0:Se.map)==null?void 0:$e.format))==null?void 0:Te.hydrate)==null?void 0:Re.call(Te,we);if(Ae){const ke=(oe==null?void 0:oe.world)&&Ae.snap(oe.world);if(ke){const Be=(oe==null?void 0:oe.world)&&Ae.nodeAt(ke);return{point:ke,node:Be,key:_e.key,name:inferLayerName(_e)}}}}}))},[ge]),xe=reactExports.useMemo(()=>!!pe&&!!ye.length&&{[pe.key]:{primary:inferLayerName(pe),items:{...lodashExports.reduce(ye,(ve,_e)=>({...ve,[`${ce}-${_e==null?void 0:_e.key}-source`]:{primary:"Set as source",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,we=>{lodashExports.set(we,"source.start",_e==null?void 0:_e.node),lodashExports.set(we,"source.query",void 0),lodashExports.set(we,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports.set(we,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(SvgIcon$q,{sx:{transform:"scale(0.5)"}})},[`${ce}-${_e==null?void 0:_e.key}-destination`]:{primary:"Set as destination",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,we=>{lodashExports.set(we,"source.end",_e==null?void 0:_e.node),lodashExports.set(we,"source.query",void 0),lodashExports.set(we,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports.set(we,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(SvgIcon$E,{})}}),{})}}},[ye,pe,ge,me]);return jsxRuntimeExports.jsx(ue,{event:oe,layer:ce,children:ve=>ne==null?void 0:ne(lodashExports.merge(ve,xe))})},getSources:ne=>{const{algorithm:oe=null,start:ce=0,end:ue=0,query:pe}=(ne==null?void 0:ne.source)??{};return[{id:"params",name:"Query",language:"yaml",content:dump({algorithm:oe,instances:[{start:ce,end:ue}],mapURI:"(...)",format:"(...)",...mapValuesDeep(pe,me=>typeof me=="string"&&me.length>maxStringPropLength?`${lodashExports.truncate(me,{length:maxStringPropLength})} (${me.length} characters)`:me)},{noCompatMode:!0})},...controller$1.getSources(ne)]}};function getController(ne){var oe;return getControllers()[((oe=ne==null?void 0:ne.source)==null?void 0:oe.type)??""]}const getControllers=lodashExports.once(()=>({trace:controller$1,map:controller$2,query:controller}));var byte_size={STRING:2,BOOLEAN:4,BYTES:4,NUMBER:8,Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=ye,base64Js.toByteArray=ve,base64Js.fromByteArray=Se;for(var ne=[],oe=[],ce=typeof Uint8Array<"u"?Uint8Array:Array,ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe=0,me=ue.length;pe0)throw new Error("Invalid string. Length must be a multiple of 4");var Re=$e.indexOf("=");Re===-1&&(Re=Te);var Ae=Re===Te?0:4-Re%4;return[Re,Ae]}function ye($e){var Te=ge($e),Re=Te[0],Ae=Te[1];return(Re+Ae)*3/4-Ae}function xe($e,Te,Re){return(Te+Re)*3/4-Re}function ve($e){var Te,Re=ge($e),Ae=Re[0],ke=Re[1],Be=new ce(xe($e,Ae,ke)),Ie=0,Ne=ke>0?Ae-4:Ae,je;for(je=0;je>16&255,Be[Ie++]=Te>>8&255,Be[Ie++]=Te&255;return ke===2&&(Te=oe[$e.charCodeAt(je)]<<2|oe[$e.charCodeAt(je+1)]>>4,Be[Ie++]=Te&255),ke===1&&(Te=oe[$e.charCodeAt(je)]<<10|oe[$e.charCodeAt(je+1)]<<4|oe[$e.charCodeAt(je+2)]>>2,Be[Ie++]=Te>>8&255,Be[Ie++]=Te&255),Be}function _e($e){return ne[$e>>18&63]+ne[$e>>12&63]+ne[$e>>6&63]+ne[$e&63]}function we($e,Te,Re){for(var Ae,ke=[],Be=Te;BeNe?Ne:Ie+Be));return Ae===1?(Te=$e[Re-1],ke.push(ne[Te>>2]+ne[Te<<4&63]+"==")):Ae===2&&(Te=($e[Re-2]<<8)+$e[Re-1],ke.push(ne[Te>>10]+ne[Te>>4&63]+ne[Te<<2&63]+"=")),ke.join("")}return base64Js}var ieee754$1={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754$1.read=function(ne,oe,ce,ue,pe){var me,ge,ye=pe*8-ue-1,xe=(1<>1,_e=-7,we=ce?pe-1:0,Se=ce?-1:1,$e=ne[oe+we];for(we+=Se,me=$e&(1<<-_e)-1,$e>>=-_e,_e+=ye;_e>0;me=me*256+ne[oe+we],we+=Se,_e-=8);for(ge=me&(1<<-_e)-1,me>>=-_e,_e+=ue;_e>0;ge=ge*256+ne[oe+we],we+=Se,_e-=8);if(me===0)me=1-ve;else{if(me===xe)return ge?NaN:($e?-1:1)*(1/0);ge=ge+Math.pow(2,ue),me=me-ve}return($e?-1:1)*ge*Math.pow(2,me-ue)},ieee754$1.write=function(ne,oe,ce,ue,pe,me){var ge,ye,xe,ve=me*8-pe-1,_e=(1<>1,Se=pe===23?Math.pow(2,-24)-Math.pow(2,-77):0,$e=ue?0:me-1,Te=ue?1:-1,Re=oe<0||oe===0&&1/oe<0?1:0;for(oe=Math.abs(oe),isNaN(oe)||oe===1/0?(ye=isNaN(oe)?1:0,ge=_e):(ge=Math.floor(Math.log(oe)/Math.LN2),oe*(xe=Math.pow(2,-ge))<1&&(ge--,xe*=2),ge+we>=1?oe+=Se/xe:oe+=Se*Math.pow(2,1-we),oe*xe>=2&&(ge++,xe/=2),ge+we>=_e?(ye=0,ge=_e):ge+we>=1?(ye=(oe*xe-1)*Math.pow(2,pe),ge=ge+we):(ye=oe*Math.pow(2,we-1)*Math.pow(2,pe),ge=0));pe>=8;ne[ce+$e]=ye&255,$e+=Te,ye/=256,pe-=8);for(ge=ge<0;ne[ce+$e]=ge&255,$e+=Te,ge/=256,ve-=8);ne[ce+$e-Te]|=Re*128}),ieee754$1}/*! + `);return ce=>oe(new Proxy(normalize$1(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace$1=/^\$\{\{\s*/,closeBrace$1=/^\s*\}\}/,neverMatch$1=/\b\B/,parser$3=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace$1,VARIABLE_END:closeBrace$1,PIPE_START:neverMatch$1,PIPE_PARAMETER_START:neverMatch$1,QUOTED_STRING:neverMatch$1}),parseString$1=memoizee$1(ne=>{const oe=parser$3(ne);return lodashExports.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken$1(ue)(ce)):parseToken$1(oe.variables[0].name)},{primitive:!0});function parseProperty$1(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports.map(ne,parseProperty$1);return ce=>lodashExports.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports.mapValues(ne,parseProperty$1);return ce=>lodashExports.mapValues(oe,ue=>ue(ce))}case String:return parseString$1(ne);default:return()=>ne}}function commonjsRequire$1(ne){throw new Error('Could not dynamically require "'+ne+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pluralize$1={exports:{}};(function(ne,oe){(function(ce,ue){typeof commonjsRequire$1=="function"?ne.exports=ue():ce.pluralize=ue()})(commonjsGlobal$1,function(){var ce=[],ue=[],pe={},me={},ge={};function ye(Re){return typeof Re=="string"?new RegExp("^"+Re+"$","i"):Re}function xe(Re,Ae){return Re===Ae?Ae:Re===Re.toLowerCase()?Ae.toLowerCase():Re===Re.toUpperCase()?Ae.toUpperCase():Re[0]===Re[0].toUpperCase()?Ae.charAt(0).toUpperCase()+Ae.substr(1).toLowerCase():Ae.toLowerCase()}function ve(Re,Ae){return Re.replace(/\$(\d{1,2})/g,function(ke,Be){return Ae[Be]||""})}function _e(Re,Ae){return Re.replace(Ae[0],function(ke,Be){var Ie=ve(Ae[1],arguments);return xe(ke===""?Re[Be-1]:ke,Ie)})}function we(Re,Ae,ke){if(!Re.length||pe.hasOwnProperty(Re))return Ae;for(var Be=ke.length;Be--;){var Ie=ke[Be];if(Ie[0].test(Ae))return _e(Ae,Ie)}return Ae}function Se(Re,Ae,ke){return function(Be){var Ie=Be.toLowerCase();return Ae.hasOwnProperty(Ie)?xe(Be,Ie):Re.hasOwnProperty(Ie)?xe(Be,Re[Ie]):we(Ie,Be,ke)}}function $e(Re,Ae,ke,Be){return function(Ie){var Ne=Ie.toLowerCase();return Ae.hasOwnProperty(Ne)?!0:Re.hasOwnProperty(Ne)?!1:we(Ne,Ne,ke)===Ne}}function Te(Re,Ae,ke){var Be=Ae===1?Te.singular(Re):Te.plural(Re);return(ke?Ae+" ":"")+Be}return Te.plural=Se(ge,me,ce),Te.isPlural=$e(ge,me,ce),Te.singular=Se(me,ge,ue),Te.isSingular=$e(me,ge,ue),Te.addPluralRule=function(Re,Ae){ce.push([ye(Re),Ae])},Te.addSingularRule=function(Re,Ae){ue.push([ye(Re),Ae])},Te.addUncountableRule=function(Re){if(typeof Re=="string"){pe[Re.toLowerCase()]=!0;return}Te.addPluralRule(Re,"$0"),Te.addSingularRule(Re,"$0")},Te.addIrregularRule=function(Re,Ae){Ae=Ae.toLowerCase(),Re=Re.toLowerCase(),ge[Re]=Ae,me[Ae]=Re},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(Re){return Te.addIrregularRule(Re[0],Re[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(Re){return Te.addPluralRule(Re[0],Re[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(Re){return Te.addSingularRule(Re[0],Re[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(Te.addUncountableRule),Te})})(pluralize$1);var pluralizeExports=pluralize$1.exports;const pluralize=getDefaultExportFromCjs$1(pluralizeExports),parseTraceWorkerLegacyUrl=""+new URL("parseTrace.worker-y8dm9SDW.js",import.meta.url).href,parseTraceWorkerUrl=""+new URL("parseTrace.worker-DDV8yRvx.js",import.meta.url).href;class ParseTraceWorker extends Worker{constructor(){super(parseTraceWorkerUrl,{type:"module"})}}class ParseTraceWorkerLegacy extends Worker{constructor(){super(parseTraceWorkerLegacyUrl,{type:"module"})}}const parseTraceAsync=usingMemoizedWorkerTask(ParseTraceWorker),parseTraceLegacyAsync=usingMemoizedWorkerTask(ParseTraceWorkerLegacy);function useTraceParser(ne,oe,ce){const ue=useSnackbar(),pe=useLoadingState("specimen");return reactExports.useMemo(()=>{if(ne.trace)return oe?()=>pe(async()=>{var me,ge;ue("Processing trace...");try{const ye=((me=ne.trace)==null?void 0:me.version)==="1.4.0"?await parseTraceAsync(ne):await parseTraceLegacyAsync(ne);return ue("Trace loaded",pluralize("step",((ge=ye==null?void 0:ye.stepsPersistent)==null?void 0:ge.length)??0,!0)),{components:ye,content:ne.trace}}catch(ye){return console.error(ye),ue("Error parsing",lodashExports.get(ye,"message")),{error:lodashExports.get(ye,"message")}}}):()=>pe(async()=>{var me,ge;return ue("Trace loaded",pluralize("step",((ge=(me=ne.trace)==null?void 0:me.events)==null?void 0:ge.length)??0,!0)),{content:ne.trace,components:[]}})},ce)}function mapProperties(ne={},oe){const ce={};for(const ue of Object.keys(ne))ce[ue]=ue==="$"?ne[ue]:oe(ne[ue],ue,ne);return Object.setPrototypeOf(ce,ne)}function normalize(ne={}){return mapProperties(ne,oe=>lodashExports.isFunction(oe)?oe:parseProperty(oe))}const parseToken=ne=>{const oe=Function("$",`return ${ne};`);return ce=>oe(new Proxy(normalize(ce),{get(ue,pe){return typeof(ue==null?void 0:ue[pe])=="function"?ue[pe]({}):ue==null?void 0:ue[pe]}}))},openBrace=/^\{\{\s*/,closeBrace=/^\s*\}\}/,neverMatch=/\b\B/,parser$2=distExports.parseStringTemplateGenerator({VARIABLE_START:openBrace,VARIABLE_END:closeBrace,PIPE_START:neverMatch,PIPE_PARAMETER_START:neverMatch,QUOTED_STRING:neverMatch}),parseString=memoizee$1(ne=>{const oe=parser$2(ne);return lodashExports.join(oe.literals,"")?ce=>distExports.evaluateParsedString(oe,{},{},ue=>parseToken(ue)(ce)):parseToken(oe.variables[0].name)},{primitive:!0});function parseProperty(ne){switch(ne==null?void 0:ne.constructor){case Array:{const oe=lodashExports.map(ne,parseProperty);return ce=>lodashExports.map(oe,ue=>ue(ce))}case Object:{const oe=lodashExports.mapValues(ne,parseProperty);return ce=>lodashExports.mapValues(oe,ue=>ue(ce))}case String:return parseString(ne);default:return()=>ne}}function useTraceContent(ne){const oe=compilerRuntimeExports.c(24),ce=useSnackbar(),ue=useLoadingState("specimen"),pe=useConnectionResolver(),[me]=useFeatures(),{traces:ge}=me;let ye,xe;oe[0]!==ce||oe[1]!==pe?(xe=memoizee$1(async Ne=>{const{source:je,id:ze}=Ne;if(je&&ze){const Ue=pe({url:je});if(Ue){ce("Fetching trace...");const qe=await Ue.transport().call("features/trace",{id:ze});return console.log(qe==null?void 0:qe.content),qe==null?void 0:qe.content}}},{normalizer:JSON.stringify}),oe[0]=ce,oe[1]=pe,oe[2]=xe):xe=oe[2],ye=xe;const ve=ye;let _e;oe[3]!==ne?(_e=ne??{},oe[3]=ne,oe[4]=_e):_e=oe[4];const{content:we,source:Se,id:$e,key:Te}=_e;let Re;oe[5]!==$e||oe[6]!==Se||oe[7]!==ge?(Re=lodashExports.find(ge,{id:$e,source:Se})??{},oe[5]=$e,oe[6]=Se,oe[7]=ge,oe[8]=Re):Re=oe[8];const{lastModified:Ae}=Re;let ke;oe[9]!==we||oe[10]!==ve||oe[11]!==$e||oe[12]!==Ae||oe[13]!==Se||oe[14]!==ne||oe[15]!==ue?(ke=()=>ue(async()=>{if($e){if(we)return{...ne,content:we};{const Ne=await ve({source:Se,id:$e,lastModified:Ae});return{...ne,content:Ne}}}}),oe[9]=we,oe[10]=ve,oe[11]=$e,oe[12]=Ae,oe[13]=Se,oe[14]=ne,oe[15]=ue,oe[16]=ke):ke=oe[16];const Be=!!we;let Ie;return oe[17]!==ve||oe[18]!==$e||oe[19]!==Te||oe[20]!==Ae||oe[21]!==Se||oe[22]!==Be?(Ie=[ve,Be,Te,Se,$e,Ae],oe[17]=ve,oe[18]=$e,oe[19]=Te,oe[20]=Ae,oe[21]=Se,oe[22]=Be,oe[23]=Ie):Ie=oe[23],useAsync(ke,Ie)}const labelScale=1.25,reuseCanvas={canvas:document.createElement("canvas")};function getTextWidth(ne,oe){const ue=(reuseCanvas.canvas||(reuseCanvas.canvas=document.createElement("canvas"))).getContext("2d");return ue.font=oe,ue.measureText(ne).width}const isNullish=ne=>ne==null;function makePathIndex(ne){const oe=[],ce={},ue={},pe=lodashExports.chain(ne==null?void 0:ne.events).map((ye,xe)=>({step:xe,id:ye.id,pId:ye.pId})).groupBy("id").value();lodashExports.forEach(ne==null?void 0:ne.events,({id:ye,pId:xe},ve)=>{!isNullish(xe)&&ce[ye]!==xe&&(oe.push({id:ye,pId:xe,step:ve,prev:lodashExports.last(oe)}),ce[ye]=xe),ue[ve]=lodashExports.last(oe)});const me=(ye,xe=(ve=>(ve=ne==null?void 0:ne.events)==null?void 0:ve.length)()??0)=>{let _e=ue[xe];for(;_e;){if(_e.id===ye)return _e.pId;_e=_e.prev}};return{getParent:me,getPath:ye=>{const xe=[ye];let ve={...(ne.events??[])[ye],step:ye};for(;ve;){const _e=me(ve.id,ve.step);if(_e){const we=lodashExports.findLast(pe[_e],Se=>Se.step<=ve.step);if(we)xe.push(we.step),ve=we;else break}else break}return xe}}}const controller$1={key:"trace",icon:jsxRuntimeExports.jsx(SvgIcon$w,{}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Trace"},error:ne=>{var oe,ce,ue,pe;return((ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.trace)==null?void 0:ce.error)||((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.parsedTrace)==null?void 0:pe.error)},compress:ne=>lodashExports.pick(ne,["trace","onion","step","code","breakpoints"]),claimImportedFile:async ne=>isTraceFormat(ne)?{claimed:!0,layer:async oe=>{oe("Opening trace...");try{return{trace:await readUploadedTrace(ne).read()}}catch(ce){return console.error(ce),oe(`Error opening, ${lodashExports.get(ce,"message")}`),{trace:{key:nanoid(),id:custom$1().id,error:lodashExports.get(ce,"message"),name:lodashExports.startCase(name$2(ne.name))}}}}}:{claimed:!1},editor:withProduce(({value:ne,produce:oe})=>{var ce,ue,pe,me,ge,ye,xe,ve,_e,we,Se;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Trace",content:jsxRuntimeExports.jsx(TracePicker,{onChange:$e=>oe(Te=>lodashExports.set(Te,"source.trace",$e)),value:(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace})}),((pe=(ue=ne==null?void 0:ne.source)==null?void 0:ue.trace)==null?void 0:pe.error)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"error",sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(ge=(me=ne==null?void 0:ne.source)==null?void 0:me.trace)==null?void 0:ge.error})}),((xe=(ye=ne==null?void 0:ne.source)==null?void 0:ye.parsedTrace)==null?void 0:xe.error)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"error",sx:{whiteSpace:"pre-wrap",mb:1,mt:1},children:jsxRuntimeExports.jsx("code",{children:(_e=(ve=ne==null?void 0:ne.source)==null?void 0:ve.parsedTrace)==null?void 0:_e.error})}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(Se=(we=ne==null?void 0:ne.source)==null?void 0:we.parsedTrace)==null?void 0:Se.content})})]})}),service:withProduce(({value:ne,produce:oe})=>{var ye;const{palette:ce}=useTheme(),{result:ue,loading:pe}=useTraceContent((ye=ne==null?void 0:ne.source)==null?void 0:ye.trace);reactExports.useEffect(()=>{oe(xe=>{var ve,_e;return lodashExports.set(xe,"source.playbackTo",((_e=(ve=ue==null?void 0:ue.content)==null?void 0:ve.events)==null?void 0:_e.length)??0)})},[ue==null?void 0:ue.key]);const{isTrusted:me}=useUntrustedLayers(),ge=useTraceParser({trace:ue==null?void 0:ue.content,context:{theme:{foreground:ce.text.primary,background:ce.background.paper,accent:ce.primary.main},color:{...colorsHex,...lodashExports.mapValues(accentColors,(xe,ve)=>getShade(ve,ce.mode,500,400))},themeAccent:ce.primary.main,themeTextPrimary:ce.text.primary,themeBackground:ce.background.paper},view:"main"},me,[ue==null?void 0:ue.key,ce.mode,me]);return useAsync$1(async()=>{if(ge&&!pe){const xe=await ge();oe(ve=>{lodashExports.set(ve,"source.parsedTrace",xe),lodashExports.set(ve,"viewKey",nanoid())})}},[pe,ge]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(PlaybackService,{value:ne})})}),renderer:({layer:ne,index:oe})=>{var xe,ve,_e;const ce=(ve=(xe=ne==null?void 0:ne.source)==null?void 0:xe.parsedTrace)==null?void 0:ve.components,ue=useThrottle(((_e=ne==null?void 0:ne.source)==null?void 0:_e.step)??0,1e3/60),pe=use2DPath(ne,oe,ue),me=reactExports.useMemo(()=>lodashExports.map(ce==null?void 0:ce.stepsPersistent,we=>lodashExports.map(we,Se=>lodashExports.merge(Se,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsPersistent,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ge=reactExports.useMemo(()=>lodashExports.map(ce==null?void 0:ce.stepsTransient,we=>lodashExports.map(we,Se=>lodashExports.merge(Se,{meta:{sourceLayer:ne==null?void 0:ne.key,sourceLayerIndex:oe,sourceLayerAlpha:1-.01*+((ne==null?void 0:ne.transparency)??0),sourceLayerDisplayMode:(ne==null?void 0:ne.displayMode)??"source-over"}}))),[ce==null?void 0:ce.stepsTransient,ne==null?void 0:ne.key,ne==null?void 0:ne.transparency,ne==null?void 0:ne.displayMode,oe]),ye=reactExports.useMemo(()=>[ge[ue]??[]],[ge,ue]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LazyNodeList,{end:ue,nodes:me}),jsxRuntimeExports.jsx(NodeList,{nodes:ye}),pe]})},steps:ne=>{var oe,ce,ue;return((ue=(ce=(oe=ne==null?void 0:ne.source)==null?void 0:oe.parsedTrace)==null?void 0:ce.content)==null?void 0:ue.events)??[]},provideSelectionInfo:({layer:ne,event:oe,children:ce})=>{const{layer:ue,setLayer:pe}=useLayer(ne),me=reactExports.useMemo(()=>{var ve,_e,we,Se,$e;const ge=((we=(_e=(ve=ue==null?void 0:ue.source)==null?void 0:ve.parsedTrace)==null?void 0:_e.content)==null?void 0:we.events)??[],ye=lodashExports.chain((Se=oe==null?void 0:oe.info)==null?void 0:Se.components).filter(Te=>{var Re;return((Re=Te.meta)==null?void 0:Re.sourceLayer)===(ue==null?void 0:ue.key)}).map(Te=>{var Re;return(Re=Te.meta)==null?void 0:Re.step}).filter(lodashExports.negate(lodashExports.isUndefined)).sort((Te,Re)=>Te-Re).value(),xe=lodashExports.chain(($e=oe==null?void 0:oe.info)==null?void 0:$e.components).filter(Te=>{var Re;return((Re=Te.meta)==null?void 0:Re.sourceLayer)===(ue==null?void 0:ue.key)}).filter(Te=>{var Re;return(Re=Te.meta)==null?void 0:Re.info}).value();if(ye.length&&ue){const Te=lodashExports.last(ye),Re=ge[Te];if(Re)return{...lodashExports.keyBy(lodashExports.map(xe,(Ae,ke)=>({key:`${ue.key}.${ke}`,primary:`Selection in ${inferLayerName(ue)}`,items:{info:{index:-1,primary:jsxRuntimeExports.jsx(PropertyList,{event:Ae.meta.info,vertical:!0})}}})),"key"),[ue.key]:{primary:inferLayerName(ue),items:{properties:{index:-2,primary:jsxRuntimeExports.jsx(PropertyList,{event:Re,vertical:!0,simple:!0,primitives:!0})},propertiesDetails:{index:-1,extras:jsxRuntimeExports.jsx(PropertyDialog,{event:Re,trigger:Ae=>jsxRuntimeExports.jsxs(MenuItem,{onClick:Ae,children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(SvgIcon$S,{})}),jsxRuntimeExports.jsx(ListItemText,{sx:{mr:4},children:"See properties"}),jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",children:["Step ",Te]})]})})},[`${Re}`]:{primary:`Go to step ${Te}`,secondary:`${lodashExports.startCase(Re.type)}`,action:()=>pe(produce(ue,Ae=>{lodashExports.set(Ae,"source.step",Te)})),icon:jsxRuntimeExports.jsx(SvgIcon$Z,{})}}}}}return{}},[ue,oe]);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ce==null?void 0:ce(me)})},getSources:ne=>{var ce;const oe=(ce=ne==null?void 0:ne.source)==null?void 0:ce.trace;return oe?[{id:"trace",name:`${oe.name}`,language:"yaml",content:dump(oe.content,{noCompatMode:!0})}]:[]}},labelSize=.8;function use2DPath(ne,oe=0,ce=0){var ge,ye,xe;const{palette:ue}=useTheme(),{getPath:pe}=reactExports.useMemo(()=>{var ve,_e,we;return((ve=ne==null?void 0:ne.source)==null?void 0:ve.playback)!=="playing"&&((we=(_e=ne==null?void 0:ne.source)==null?void 0:_e.parsedTrace)!=null&&we.content)?makePathIndex(ne.source.parsedTrace.content):{getParent:lodashExports.constant(void 0),getPath:lodashExports.constant([])}},[(ye=(ge=ne==null?void 0:ne.source)==null?void 0:ge.parsedTrace)==null?void 0:ye.content,(xe=ne==null?void 0:ne.source)==null?void 0:xe.playback]);return reactExports.useMemo(()=>{var we,Se,$e,Te,Re,Ae,ke,Be,Ie,Ne,je,ze;const ve=interpolate$1([ue.background.paper,ue.text.primary])(.05),_e=(Se=(we=ne==null?void 0:ne.source)==null?void 0:we.parsedTrace)==null?void 0:Se.content;if(($e=_e==null?void 0:_e.render)!=null&&$e.path||_e!=null&&_e.pivot){const Ue=((Re=(Te=_e==null?void 0:_e.render)==null?void 0:Te.path)==null?void 0:Re.pivot)??(_e==null?void 0:_e.pivot)??{},qe=(ke=(Ae=_e==null?void 0:_e.render)==null?void 0:Ae.path)!=null&&ke.scale?_e.render.path.scale*(1/.3):((Be=_e==null?void 0:_e.pivot)==null?void 0:Be.scale)??1,{x:Ke,y:Ge}=Ue,Ye=(_e==null?void 0:_e.version)==="1.4.0"?parseProperty$1:Tt=>Ut=>parseProperty(Tt)({event:Ut}),Xe=Ke?Ye(Ke):Tt=>Tt.x,Je=Ge?Ye(Ge):Tt=>Tt.y,Qe=lodashExports.map(pe(ce),Tt=>{var Ut;return(Ut=_e==null?void 0:_e.events)==null?void 0:Ut[Tt]}),Ze={x:Xe({x:0,y:0,...lodashExports.head(Qe)}),y:Je({x:0,y:0,...lodashExports.head(Qe)})};if(Qe.length){const Tt=`${lodashExports.startCase((Ie=lodashExports.head(Qe))==null?void 0:Ie.type)} ${(Ne=lodashExports.head(Qe))==null?void 0:Ne.id}`,Ut=getTextWidth(Tt,`${labelSize*qe*labelScale}px Inter`),Gt=[{$:"circle",x:Xe({x:0,y:0,...lodashExports.last(Qe)}),y:Je({x:0,y:0,...lodashExports.last(Qe)}),fill:ue.primary.main,radius:.3*qe},{$:"path",points:Qe.map(Nt=>({x:Xe({x:0,y:0,...Nt}),y:Je({x:0,y:0,...Nt})})),fill:ue.primary.main,alpha:1,lineWidth:.3*qe},{$:"circle",...Ze,fill:ue.primary.main,radius:.3*qe},{$:"rect",alpha:.85,fill:ve,x:Ze.x-.3*qe*labelScale,y:Ze.y-2*qe*labelScale,width:Ut+(.8+.5)*qe*labelScale,height:1.4*qe*labelScale},{$:"path",points:[{x:Ze.x,y:Ze.y},{x:Ze.x+(-.3-.05)*qe*labelScale,y:Ze.y+(-2+1.4)*qe*labelScale}],fill:getColorHex((je=lodashExports.head(Qe))==null?void 0:je.type),alpha:1,lineWidth:.1*qe*labelScale},{$:"rect",x:Ze.x+(-.3-.1)*qe*labelScale,y:Ze.y+-2*qe*labelScale,fill:getColorHex((ze=lodashExports.head(Qe))==null?void 0:ze.type),height:1.4*qe*labelScale,width:.1*qe*labelScale},{$:"rect",alpha:0,fill:"rgba(255, 255, 255, 0)",x:Ze.x-.3*qe*labelScale,y:Ze.y-2*qe*labelScale,width:Ut*2,height:1*qe*labelScale,label:Tt,"label-size":labelSize*qe*labelScale,"label-x":(.1+.5)*qe*labelScale,"label-y":1*qe*labelScale,"label-color":ue.text.primary}];return jsxRuntimeExports.jsx(NodeList,{nodes:[lodashExports.map(Gt,Nt=>({component:Nt,meta:{source:"path",sourceLayerIndex:-99999+oe}}))]})}}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})},[ne,oe,ce,ue,pe])}const mapValuesDeep=(ne,oe)=>lodashExports.isArray(ne)?lodashExports.map(ne,ce=>mapValuesDeep(ce,oe)):lodashExports.isObject(ne)?lodashExports.mapValues(ne,ce=>mapValuesDeep(ce,oe)):oe(ne);async function findConnection(ne,oe,ce){for(const ue of ne){const pe=await ue.transport().call("features/algorithms"),me=await ue.transport().call("features/formats");if(lodashExports.find(pe,{id:oe})&&lodashExports.find(me,{id:ce}))return ue}}const maxStringPropLength=40,controller={...lodashExports.omit(controller$1,"claimImportedFile"),key:"query",icon:jsxRuntimeExports.jsx(SvgIcon$w,{}),compress:ne=>lodashExports.pick(ne,["mapLayerKey","query","start","end","algorithm","onion","step","code","breakpoints"]),editor:withProduce(({value:ne,produce:oe})=>{var ve,_e;const{algorithm:ce}=(ne==null?void 0:ne.source)??{},{layers:ue,allLayers:pe,layer:me,key:ge}=useLayer(void 0,we=>{var Se;return((Se=we.source)==null?void 0:Se.type)==="map"}),[{algorithms:ye}]=useFeatures(),[xe]=useConnections();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Option,{label:"Algorithm",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(SvgIcon$T,{}),label:"Algorithm",value:ce,items:ye.map(we=>{var Se;return{...we,description:(Se=lodashExports.find(xe,{url:we.source}))==null?void 0:Se.name}}),onChange:async we=>oe(Se=>lodashExports.set(Se,"source.algorithm",we))})}),!(ye!=null&&ye.length)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"warning.main",sx:{mb:1},children:"No connected solver has declared support for running algorithms"}),jsxRuntimeExports.jsx(Option,{label:"Map",content:jsxRuntimeExports.jsx(FeaturePicker,{arrow:!0,paper:!0,icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),label:"Layer",value:ge,items:pe.map(we=>({id:we.key,hidden:!lodashExports.find(ue,Se=>Se.key===we.key),name:inferLayerName(we)})),onChange:async we=>oe(Se=>lodashExports.set(Se,"source.mapLayerKey",we))})}),me&&jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",sx:{mb:1,mt:1},children:["Define source and destination nodes by clicking on valid regions on"," ",inferLayerName(me)]}),jsxRuntimeExports.jsx(Heading,{label:"Preview"}),jsxRuntimeExports.jsx(Box,{sx:{height:240,mx:-2},children:jsxRuntimeExports.jsx(TracePreview,{trace:(_e=(ve=ne==null?void 0:ne.source)==null?void 0:ve.trace)==null?void 0:_e.content})})]})}),service:withProduce(({value:ne,produce:oe,onChange:ce})=>{var Te;const ue=controller$1.service,pe=useSnackbar(),{algorithm:me,mapLayerKey:ge,start:ye,end:xe}=(ne==null?void 0:ne.source)??{},[{layers:ve}]=useLayers(),[_e]=useConnections(),[{algorithms:we}]=useFeatures(),Se=reactExports.useMemo(()=>{if(ge&&me)return lodashExports.find(ve,{key:ge})},[ge,me,ve]),{result:$e}=useMapContent((Te=Se==null?void 0:Se.source)==null?void 0:Te.map);return useEffectWhenAsync(async Re=>{var Ae;if(Se&&$e&&me){const{format:ke}=((Ae=Se==null?void 0:Se.source)==null?void 0:Ae.map)??{},{content:Be}=$e??{};if(ke&&Be){const Ie=await findConnection(_e,me,ke),Ne=lodashExports.find(we,{id:me});if(Ie){pe(`Executing ${inferLayerName(ne)} using ${Ie.name}...`);const je={format:ke,instances:[{start:ye??0,end:xe??0}],mapURI:`map:${encodeURIComponent(Be)}`,algorithm:me},ze=await Ie.transport().call("solve/pathfinding",je);Re.aborted?pe("Canceled"):oe(Ue=>{lodashExports.set(Ue,"source.trace",{name:`${Ne==null?void 0:Ne.name}`,content:ze,key:nanoid(),id:nanoid()}),lodashExports.set(Ue,"source.query",je)})}}}},[Se,_e,me,ye,xe,oe,pe,ne,we],[Se,$e,_e,me,ye,xe]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(ue,{value:ne,onChange:ce})})}),inferName:ne=>{var oe,ce;return((ce=(oe=ne.source)==null?void 0:oe.trace)==null?void 0:ce.name)??"Untitled Query"},provideSelectionInfo:({children:ne,event:oe,layer:ce})=>{const ue=controller$1.provideSelectionInfo,{layer:pe,setLayer:me,layers:ge}=useLayer(ce),ye=reactExports.useMemo(()=>{const ve=lodashExports.filter(ge,{source:{type:"map"}});return lodashExports.filter(lodashExports.map(ve,_e=>{var Se,$e,Te,Re;const{parsedMap:we}=(_e==null?void 0:_e.source)??{};if(we&&oe){const Ae=(Re=(Te=getParser(($e=(Se=_e==null?void 0:_e.source)==null?void 0:Se.map)==null?void 0:$e.format))==null?void 0:Te.hydrate)==null?void 0:Re.call(Te,we);if(Ae){const ke=(oe==null?void 0:oe.world)&&Ae.snap(oe.world);if(ke){const Be=(oe==null?void 0:oe.world)&&Ae.nodeAt(ke);return{point:ke,node:Be,key:_e.key,name:inferLayerName(_e)}}}}}))},[ge]),xe=reactExports.useMemo(()=>!!pe&&!!ye.length&&{[pe.key]:{primary:inferLayerName(pe),items:{...lodashExports.reduce(ye,(ve,_e)=>({...ve,[`${ce}-${_e==null?void 0:_e.key}-source`]:{primary:"Set as source",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,we=>{lodashExports.set(we,"source.start",_e==null?void 0:_e.node),lodashExports.set(we,"source.query",void 0),lodashExports.set(we,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports.set(we,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(SvgIcon$q,{sx:{transform:"scale(0.5)"}})},[`${ce}-${_e==null?void 0:_e.key}-destination`]:{primary:"Set as destination",secondary:_e==null?void 0:_e.name,action:()=>me(produce(pe,we=>{lodashExports.set(we,"source.end",_e==null?void 0:_e.node),lodashExports.set(we,"source.query",void 0),lodashExports.set(we,"source.mapLayerKey",_e==null?void 0:_e.key),lodashExports.set(we,"source.trace",void 0)})),icon:jsxRuntimeExports.jsx(SvgIcon$E,{})}}),{})}}},[ye,pe,ge,me]);return jsxRuntimeExports.jsx(ue,{event:oe,layer:ce,children:ve=>ne==null?void 0:ne(lodashExports.merge(ve,xe))})},getSources:ne=>{const{algorithm:oe=null,start:ce=0,end:ue=0,query:pe}=(ne==null?void 0:ne.source)??{};return[{id:"params",name:"Query",language:"yaml",content:dump({algorithm:oe,instances:[{start:ce,end:ue}],mapURI:"(...)",format:"(...)",...mapValuesDeep(pe,me=>typeof me=="string"&&me.length>maxStringPropLength?`${lodashExports.truncate(me,{length:maxStringPropLength})} (${me.length} characters)`:me)},{noCompatMode:!0})},...controller$1.getSources(ne)]}};function getController(ne){var oe;return getControllers()[((oe=ne==null?void 0:ne.source)==null?void 0:oe.type)??""]}const getControllers=lodashExports.once(()=>({trace:controller$1,map:controller$2,query:controller}));var byte_size={STRING:2,BOOLEAN:4,BYTES:4,NUMBER:8,Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=ye,base64Js.toByteArray=ve,base64Js.fromByteArray=Se;for(var ne=[],oe=[],ce=typeof Uint8Array<"u"?Uint8Array:Array,ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pe=0,me=ue.length;pe0)throw new Error("Invalid string. Length must be a multiple of 4");var Re=$e.indexOf("=");Re===-1&&(Re=Te);var Ae=Re===Te?0:4-Re%4;return[Re,Ae]}function ye($e){var Te=ge($e),Re=Te[0],Ae=Te[1];return(Re+Ae)*3/4-Ae}function xe($e,Te,Re){return(Te+Re)*3/4-Re}function ve($e){var Te,Re=ge($e),Ae=Re[0],ke=Re[1],Be=new ce(xe($e,Ae,ke)),Ie=0,Ne=ke>0?Ae-4:Ae,je;for(je=0;je>16&255,Be[Ie++]=Te>>8&255,Be[Ie++]=Te&255;return ke===2&&(Te=oe[$e.charCodeAt(je)]<<2|oe[$e.charCodeAt(je+1)]>>4,Be[Ie++]=Te&255),ke===1&&(Te=oe[$e.charCodeAt(je)]<<10|oe[$e.charCodeAt(je+1)]<<4|oe[$e.charCodeAt(je+2)]>>2,Be[Ie++]=Te>>8&255,Be[Ie++]=Te&255),Be}function _e($e){return ne[$e>>18&63]+ne[$e>>12&63]+ne[$e>>6&63]+ne[$e&63]}function we($e,Te,Re){for(var Ae,ke=[],Be=Te;BeNe?Ne:Ie+Be));return Ae===1?(Te=$e[Re-1],ke.push(ne[Te>>2]+ne[Te<<4&63]+"==")):Ae===2&&(Te=($e[Re-2]<<8)+$e[Re-1],ke.push(ne[Te>>10]+ne[Te>>4&63]+ne[Te<<2&63]+"=")),ke.join("")}return base64Js}var ieee754$1={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754$1.read=function(ne,oe,ce,ue,pe){var me,ge,ye=pe*8-ue-1,xe=(1<>1,_e=-7,we=ce?pe-1:0,Se=ce?-1:1,$e=ne[oe+we];for(we+=Se,me=$e&(1<<-_e)-1,$e>>=-_e,_e+=ye;_e>0;me=me*256+ne[oe+we],we+=Se,_e-=8);for(ge=me&(1<<-_e)-1,me>>=-_e,_e+=ue;_e>0;ge=ge*256+ne[oe+we],we+=Se,_e-=8);if(me===0)me=1-ve;else{if(me===xe)return ge?NaN:($e?-1:1)*(1/0);ge=ge+Math.pow(2,ue),me=me-ve}return($e?-1:1)*ge*Math.pow(2,me-ue)},ieee754$1.write=function(ne,oe,ce,ue,pe,me){var ge,ye,xe,ve=me*8-pe-1,_e=(1<>1,Se=pe===23?Math.pow(2,-24)-Math.pow(2,-77):0,$e=ue?0:me-1,Te=ue?1:-1,Re=oe<0||oe===0&&1/oe<0?1:0;for(oe=Math.abs(oe),isNaN(oe)||oe===1/0?(ye=isNaN(oe)?1:0,ge=_e):(ge=Math.floor(Math.log(oe)/Math.LN2),oe*(xe=Math.pow(2,-ge))<1&&(ge--,xe*=2),ge+we>=1?oe+=Se/xe:oe+=Se*Math.pow(2,1-we),oe*xe>=2&&(ge++,xe/=2),ge+we>=_e?(ye=0,ge=_e):ge+we>=1?(ye=(oe*xe-1)*Math.pow(2,pe),ge=ge+we):(ye=oe*Math.pow(2,we-1)*Math.pow(2,pe),ge=0));pe>=8;ne[ce+$e]=ye&255,$e+=Te,ye/=256,pe-=8);for(ge=ge<0;ne[ce+$e]=ge&255,$e+=Te,ge/=256,ve-=8);ne[ce+$e-Te]|=Re*128}),ieee754$1}/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh @@ -2419,7 +2419,7 @@ void main(void)\r src: url('${oe.dataSrc}'); font-weight: ${oe.weight}; font-style: ${oe.style}; - }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(ne){this._stylesheet!==ne&&(this._stylesheet=ne,this.styleID++)}normalizeColor(ne){return Array.isArray(ne)&&(ne=rgb2hex(ne)),typeof ne=="number"?hex2string(ne):ne}dropShadowToCSS(){let ne=this.normalizeColor(this.dropShadowColor);const oe=this.dropShadowAlpha,ce=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),ue=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);ne.startsWith("#")&&oe<1&&(ne+=(oe*255|0).toString(16).padStart(2,"0"));const pe=`${ce}px ${ue}px`;return this.dropShadowBlur>0?`text-shadow: ${pe} ${this.dropShadowBlur}px ${ne}`:`text-shadow: ${pe} ${ne}`}reset(){Object.assign(this,_HTMLTextStyle.defaultOptions)}onBeforeDraw(){const{fontsDirty:ne}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&ne?new Promise(oe=>setTimeout(oe,100)):Promise.resolve()}get isSafari(){const{userAgent:ne}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(ne)}set fillGradientStops(ne){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(ne){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(ne){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(ne){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(ne){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(ne){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(ne){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let HTMLTextStyle=_HTMLTextStyle;HTMLTextStyle.availableFonts={};HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const _HTMLText=class extends Sprite{constructor(ne="",oe={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const ce=new Image,ue=Texture.from(ce,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});ue.orig=new Rectangle,ue.trim=new Rectangle,this.texture=ue;const pe="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml",ge=document.createElementNS(pe,"svg"),ye=document.createElementNS(pe,"foreignObject"),xe=document.createElementNS(me,"div"),ve=document.createElementNS(me,"style");ye.setAttribute("width","10000"),ye.setAttribute("height","10000"),ye.style.overflow="hidden",ge.appendChild(ye),this.maxWidth=_HTMLText.defaultMaxWidth,this.maxHeight=_HTMLText.defaultMaxHeight,this._domElement=xe,this._styleElement=ve,this._svgRoot=ge,this._foreignObject=ye,this._foreignObject.appendChild(ve),this._foreignObject.appendChild(xe),this._image=ce,this._loadImage=new Image,this._autoResolution=_HTMLText.defaultAutoResolution,this._resolution=_HTMLText.defaultResolution??settings.RESOLUTION,this.text=ne,this.style=oe}measureText(ne){var ye,xe;const{text:oe,style:ce,resolution:ue}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},ne);Object.assign(this._domElement,{innerHTML:oe,style:ce.toCSS(ue)}),this._styleElement.textContent=ce.toGlobalCSS(),document.body.appendChild(this._svgRoot);const pe=this._domElement.getBoundingClientRect();this._svgRoot.remove();const me=Math.min(this.maxWidth,Math.ceil(pe.width)),ge=Math.min(this.maxHeight,Math.ceil(pe.height));return this._svgRoot.setAttribute("width",me.toString()),this._svgRoot.setAttribute("height",ge.toString()),oe!==this._text&&(this._domElement.innerHTML=this._text),ce!==this._style&&(Object.assign(this._domElement,{style:(ye=this._style)==null?void 0:ye.toCSS(ue)}),this._styleElement.textContent=(xe=this._style)==null?void 0:xe.toGlobalCSS()),{width:me+ce.padding*2,height:ge+ce.padding*2}}async updateText(ne=!0){const{style:oe,_image:ce,_loadImage:ue}=this;if(this.localStyleID!==oe.styleID&&(this.dirty=!0,this.localStyleID=oe.styleID),!this.dirty&&ne)return;const{width:pe,height:me}=this.measureText();ce.width=ue.width=Math.ceil(Math.max(1,pe)),ce.height=ue.height=Math.ceil(Math.max(1,me)),this._loading||(this._loading=!0,await new Promise(ge=>{ue.onload=async()=>{await oe.onBeforeDraw(),this._loading=!1,ce.src=ue.src,ue.onload=null,ue.src="",this.updateTexture(),ge()};const ye=new XMLSerializer().serializeToString(this._svgRoot);ue.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ye)}`}))}get source(){return this._image}updateTexture(){const{style:ne,texture:oe,_image:ce,resolution:ue}=this,{padding:pe}=ne,{baseTexture:me}=oe;oe.trim.width=oe._frame.width=ce.width/ue,oe.trim.height=oe._frame.height=ce.height/ue,oe.trim.x=-pe,oe.trim.y=-pe,oe.orig.width=oe._frame.width-pe*2,oe.orig.height=oe._frame.height-pe*2,this._onTextureUpdate(),me.setRealSize(ce.width,ce.height,ue),this.dirty=!1}_render(ne){this._autoResolution&&this._resolution!==ne.resolution&&(this._resolution=ne.resolution,this.dirty=!0),this.updateText(!0),super._render(ne)}_renderCanvas(ne){this._autoResolution&&this._resolution!==ne.resolution&&(this._resolution=ne.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(ne)}getLocalBounds(ne){return this.updateText(!0),super.getLocalBounds(ne)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(ne){var ce,ue,pe,me,ge;typeof ne=="boolean"&&(ne={children:ne}),ne=Object.assign({},_HTMLText.defaultDestroyOptions,ne),super.destroy(ne);const oe=null;this.ownsStyle&&((ce=this._style)==null||ce.cleanFonts()),this._style=oe,(ue=this._svgRoot)==null||ue.remove(),this._svgRoot=oe,(pe=this._domElement)==null||pe.remove(),this._domElement=oe,(me=this._foreignObject)==null||me.remove(),this._foreignObject=oe,(ge=this._styleElement)==null||ge.remove(),this._styleElement=oe,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=oe,this._image.src="",this._image=oe}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(ne){this.updateText(!0);const oe=sign(this.scale.x)||1;this.scale.x=oe*ne/this._image.width/this.resolution,this._width=ne}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(ne){this.updateText(!0);const oe=sign(this.scale.y)||1;this.scale.y=oe*ne/this._image.height/this.resolution,this._height=ne}get style(){return this._style}set style(ne){this._style!==ne&&(ne=ne||{},ne instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=ne):ne instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(ne)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(ne)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(ne){ne=String(ne===""||ne===null||ne===void 0?" ":ne),ne=this.sanitiseText(ne),this._text!==ne&&(this._text=ne,this.dirty=!0)}get resolution(){return this._resolution}set resolution(ne){this._autoResolution=!1,this._resolution!==ne&&(this._resolution=ne,this.dirty=!0)}sanitiseText(ne){return ne.replace(/
/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};let HTMLText=_HTMLText;HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0};HTMLText.defaultMaxWidth=2024;HTMLText.defaultMaxHeight=2024;HTMLText.defaultAutoResolution=!0;const{max:max$2,min:min$2}=Math;function handleNaN(ne,oe){return lodashExports.isNaN(ne)?oe:ne}var Xo,Io;class D2RendererBase extends EventEmitter$1{constructor(){super(...arguments);ai(this,Xo);ai(this,Io);this.options=defaultD2RendererOptions,this.system=new Bush(16),Jn(this,Xo,0),Jn(this,Io,lodashExports.once(()=>{if(typeof OffscreenCanvas>"u")return"OffscreenCanvas API is not supported by your system."})),this.getFrustumChangeQueue=lodashExports.once(()=>lodashExports.debounce(()=>this.handleFrustumChange(),this.options.debounceInterval))}next(){return ku(this,Xo)._++}setup(ce){if(xn(this,Io).call(this))throw new Error(xn(this,Io).call(this));const ue={...defaultD2RendererOptions,...ce};this.setupPixi(ue),this.setOptions(ue)}setupPixi(ce){this.app=new Application({backgroundAlpha:0,width:ce.screenSize.width,height:ce.screenSize.height,autoDensity:!0,resolution:2}),this.setupViewport(ce),this.setupOverlay()}setupOverlay(){this.viewport&&(this.overlay=new Graphics,this.viewport.addChild(this.overlay))}setupViewport(ce){this.app&&(this.viewport=new ht({stopPropagation:!0,screenWidth:ce.screenSize.width,screenHeight:ce.screenSize.height,events:this.app.renderer.events,passiveWheel:!1}),this.viewport.on("clicked",ue=>{const{x:pe,y:me}=ue.world,ge=this.system.search({minX:pe,minY:me,maxX:pe+Number.MIN_VALUE,maxY:me+Number.MIN_VALUE}).filter(ye=>primitives[ye.component.$].narrow(ye.component,{x:pe,y:me}));this.emit("click",ue.event,{world:ue.world,components:ge})}),this.app.stage.addChild(this.viewport),this.viewport.drag().pinch().wheel().decelerate({friction:.98}).clampZoom({maxScale:300,minScale:1e-5}),this.viewport.on("moved",()=>{this.getFrustumChangeQueue()()}))}destroy(){var ce,ue;(ue=(ce=this.app)==null?void 0:ce.destroy)==null||ue.call(ce)}handleWindowSizeChange(ce){var me,ge,ye,xe;const{width:ue,height:pe}=ce.screenSize;(ye=(ge=(me=this.app)==null?void 0:me.renderer)==null?void 0:ge.resize)==null||ye.call(ge,ue,pe),(xe=this.viewport)==null||xe.resize(ue,pe)}setOptions(ce){const ue={...this.options,...ce};this.handleWindowSizeChange(ue),this.options=ue,this.handleFrustumChange()}add(ce){const ue=this.makeBodies(ce);return this.system.load(ue),()=>{for(const pe of ue)this.system.remove(pe)}}getPx(){if(!this.viewport)return 1;const{right:ce,left:ue}=this.viewport,{width:pe}=this.options.screenSize;return(ce-ue)/pe}makeBodies(ce){return ce.map(({component:ue,meta:pe})=>({...defaultBounds,...lodashExports.pickBy(primitives[ue.$].test(ue),isValue),component:ue,meta:pe,index:this.next()}))}getView(){var ce;return(ce=this.app)==null?void 0:ce.view}fitCamera(ce=lodashExports.constant(!0)){var pe,me,ge,ye;const ue=lodashExports.values(this.system.all()).flat().filter(ce);if(ue.length){const xe=this.getBounds(ue);(ye=(pe=this.viewport)==null?void 0:pe.animate)==null||ye.call(pe,{position:new Point$2((xe.left+xe.right)/2,(xe.top+xe.bottom)/2),scale:((ge=(me=this.viewport)==null?void 0:me.findFit)==null?void 0:ge.call(me,xe.right-xe.left,xe.bottom-xe.top))*.8,ease:"easeOutExpo",time:this.options.animationDuration*1.5,callbackOnComplete:()=>this.getFrustumChangeQueue()()})}}getBounds(ce){return lodashExports.reduce(ce,(ue,pe)=>({top:handleNaN(min$2(ue.top,pe.top),ue.top),left:handleNaN(min$2(ue.left,pe.left),ue.left),bottom:handleNaN(max$2(ue.bottom,pe.bottom),ue.bottom),right:handleNaN(max$2(ue.right,pe.right),ue.right)}),{bottom:-1/0,top:1/0,left:1/0,right:-1/0})}handleFrustumChange(){}initialCamera(){var ce,ue;(ue=(ce=this.viewport)==null?void 0:ce.animate)==null||ue.call(ce,{scale:1,ease:"easeOutExpo",time:this.options.animationDuration*1.5,callbackOnComplete:()=>this.getFrustumChangeQueue()()})}getInstance(){return{app:this.app,viewport:this.viewport}}async toDataUrl(){var ce,ue,pe,me,ge;return(ue=(ce=this.app)==null?void 0:ce.render)==null||ue.call(ce),(ge=(me=(pe=this.app)==null?void 0:pe.view)==null?void 0:me.toDataURL)==null?void 0:ge.call(me)}}Xo=new WeakMap,Io=new WeakMap;function makeRenderer(ne,oe){return{constructor:ne,meta:oe}}const url=""+new URL("D2Renderer.worker-Bhx9fy0S.js",import.meta.url).href;class D2RendererWorkerAdapter extends Worker{constructor(){super(url,{type:"module"})}call(oe,ce,ue=[]){return this.postMessage({action:oe,payload:ce},ue)}on(oe,ce){const ue=pe=>{const{action:me,payload:ge}=pe.data;me===oe&&ce(ge)};return this.addEventListener("message",ue),()=>this.removeEventListener("message",ue)}}function intersect(ne,oe){return!(oe.left>=ne.right||oe.right<=ne.left||oe.top>=ne.bottom||oe.bottom<=ne.top)}const Va=class Va extends Sprite{constructor(oe,ce){super(oe),this.bounds=ce,this.destroying=!1,this.age=Va.age++}};Va.age=0;let Tile=Va;var Zi,gi,ji,ko,Zo,Fn,Ou,Du,Lu,pl,Bu,Nu,Fu,ju;class D2Renderer extends D2RendererBase{constructor(){super(...arguments);ai(this,Fn);ai(this,Zi);ai(this,gi);ai(this,ji);ai(this,ko);ai(this,Zo);this.options=defaultD2RendererOptions,this.system=new Bush(16),Jn(this,gi,[]),Jn(this,ko,lodashExports.once(()=>lodashExports.throttle(()=>Ri(this,Fn,pl).call(this),this.options.refreshInterval))),Jn(this,Zo,lodashExports.once(()=>lodashExports.throttle(ce=>Ri(this,Fn,Bu).call(this,ce),this.options.refreshInterval)))}setupPixi(ce){super.setupPixi(ce),this.viewport&&(Jn(this,Zi,new Container),this.viewport.addChild(xn(this,Zi)),Jn(this,ji,new Graphics),this.viewport.addChild(xn(this,ji)),Ri(this,Fn,Ou).call(this))}setup(ce){super.setup(ce),Ri(this,Fn,Du).call(this,this.options)}destroy(){lodashExports.map(xn(this,gi),ce=>ce.terminate()),super.destroy()}add(ce){var me,ge;const ue=nanoid(),pe=super.add(ce);return(ge=(me=xn(this,gi))==null?void 0:me.forEach)==null||ge.call(me,ye=>ye.call("add",[ce,ue])),()=>{requestIdleCallback(()=>{var ye,xe;pe(),(xe=(ye=xn(this,gi))==null?void 0:ye.forEach)==null||xe.call(ye,ve=>ve.call("remove",[ue]))},{timeout:this.options.animationDuration})}}setOptions(ce){super.setOptions(ce),Ri(this,Fn,pl).call(this)}setupViewport(ce){super.setupViewport(ce),this.viewport&&(this.viewport.on("moved",()=>{xn(this,ko).call(this)()}),this.viewport.on("mousemove",ue=>xn(this,Zo).call(this)(ue)))}handleWindowSizeChange(ce){super.handleWindowSizeChange(ce),lodashExports.map(xn(this,gi),ue=>{ue.call("setTileResolution",[{width:lodashExports.ceil(ce.tileResolution.width),height:lodashExports.ceil(ce.tileResolution.height)}])})}handleFrustumChange(){if(!this.viewport)return;const{top:ce,bottom:ue,left:pe,right:me}=this.viewport;lodashExports.map(xn(this,gi),ge=>ge.call("setFrustum",[{top:ce,bottom:ue,left:pe,right:me}]))}}Zi=new WeakMap,gi=new WeakMap,ji=new WeakMap,ko=new WeakMap,Zo=new WeakMap,Fn=new WeakSet,Ou=function(){const{dynamicResolution:ce}=this.options,{dtMax:ue,dtMin:pe,increment:me,intervalMs:ge,maxScale:ye,minScale:xe}=ce,ve=lodashExports.floor(Ticker.targetFPMS*ge);let _e=0,we=0,Se=1;this.app.ticker.add($e=>{const{tileResolution:Te}=this.options;if(!(_e%ve)){const Re=we/ve;Se=lodashExports.clamp(Re>=ue?Se+me:Re<=pe?Se-me:Se,xe,ye),lodashExports.map(xn(this,gi),Ae=>{Ae.call("setTileResolution",[{width:lodashExports.ceil(Te.width/Se),height:lodashExports.ceil(Te.height/Se)}])}),we=0}we+=$e,_e++})},Du=function(ce){lodashExports.map(xn(this,gi),ue=>ue.terminate()),Jn(this,gi,lodashExports.times(ce.workerCount,ue=>{const pe=new D2RendererWorkerAdapter;return pe.on("update",me=>Ri(this,Fn,Lu).call(this,me)),pe.onerror=me=>{throw me},pe.call("setup",[{...ce,workerIndex:ue}]),pe}))},Lu=function({bounds:ce,bitmap:ue}){const pe=Texture.from(ue);Ri(this,Fn,Nu).call(this,pe,ce)},pl=function(){var ge,ye,xe,ve,_e;if(!this.viewport)return;const{tileSubdivision:ce,accentColor:ue}=this.options,{tiles:pe}=getTiles(this.viewport,ce),me=this.getPx();(ge=xn(this,ji))==null||ge.clear(),(ye=xn(this,ji))==null||ye.lineStyle(1*me,ue,.5),(xe=xn(this,ji))==null||xe.beginFill(ue,.05);for(const{bounds:we}of pe)lodashExports.find((ve=xn(this,Zi))==null?void 0:ve.children,Se=>lodashExports.isEqual(Se.bounds,we))||(_e=xn(this,ji))==null||_e.drawRect(we.left,we.top,we.right-we.left,we.bottom-we.top)},Bu=function(ce){var xe;const{accentColor:ue}=this.options,pe=this.getPx(),{x:me,y:ge}=this.viewport.toWorld(ce.globalX,ce.globalY),ye=this.system.search({minX:me,minY:ge,maxX:me+Number.MIN_VALUE,maxY:ge+Number.MIN_VALUE}).filter(ve=>primitives[ve.component.$].narrow(ve.component,{x:me,y:ge}));this.overlay.clear();for(const ve of ye)this.overlay.lineStyle(2*pe,ue,"$info"in ve.component?1:.02),(xe=this.overlay)==null||xe.drawRect(ve.left,ve.top,ve.right-ve.left,ve.bottom-ve.top)},Nu=async function(ce,ue){var xe,ve;if(!this.viewport)return;const{tileSubdivision:pe}=this.options,{tiles:me}=getTiles(this.viewport,pe);if(!lodashExports.find(me,_e=>lodashExports.isEqual(_e.bounds,ue)))return;const ge={x:(ue.right-ue.left)/ce.width,y:(ue.bottom-ue.top)/ce.height},ye=new Tile(ce,ue);(xe=xn(this,Zi))==null||xe.addChild(ye).setTransform(ue.left,ue.top,ge.x,ge.y),xn(this,ko).call(this)(),await Ri(this,Fn,Fu).call(this,ye),lodashExports.forEach((ve=xn(this,Zi))==null?void 0:ve.children,async _e=>{intersect(_e.bounds,ue)&&_e.age{const me=ge=>{ce.alpha+=ge/Ticker.targetFPMS/this.options.animationDuration,ce.alpha>1&&(ue.remove(me),pe())};ce.alpha=0,ue.add(me)})},ju=function(ce){const ue=this.app.ticker;return new Promise(pe=>{const me=ge=>{ce.alpha-=ge/Ticker.targetFPMS/this.options.animationDuration,ce.alpha<0&&(ue.remove(me),pe())};ce.alpha=1,ue.add(me)})};const D2Renderer$1=makeRenderer(D2Renderer,{components:["rect","circle","path","polygon"],id:"d2-renderer",name:"Pixel",description:"Comfortably performant 2D renderer",version:"1.0.0"}),{max:max$1,min:min$1}=Math,CANVAS_MAXSIZE=4095,canvas=new OffscreenCanvas(1,1),getCanvas=(ne,oe)=>{var ce,ue;return canvas.width=max$1(1,lodashExports.ceil(ne)),canvas.height=max$1(1,lodashExports.ceil(oe)),(ue=(ce=canvas.getContext("2d"))==null?void 0:ce.clearRect)==null||ue.call(ce,0,0,canvas.width,canvas.height),canvas},getClampedScale=(ne,oe)=>min$1(max$1(lodashExports.round(ne)/devicePixelRatio,1),oe);var Qo,Jo;class Elem extends Sprite{constructor(ce,ue,pe){const me=CANVAS_MAXSIZE/max$1(ce.right-ce.left,ce.bottom-ce.top,1);super(getTexture(ce,ue,getClampedScale(pe,me)));ai(this,Qo,1);ai(this,Jo,1);this.bounds=ce,this.bodies=ue,this.rerender(pe,ce,ue,me),Jn(this,Jo,me)}rerender(ce,ue=this.bounds,pe=this.bodies,me=xn(this,Jo)){const ge=getClampedScale(ce,me);if(ge===xn(this,Qo))return;const ye=getTexture(ue,pe,ge);this.texture=ye,this.setTransform(ue.left,ue.top,1/ge,1/ge),Jn(this,Qo,ge)}}Qo=new WeakMap,Jo=new WeakMap;function getTexture(ne,oe,ce){const ue=getCanvas((ne.right-ne.left)*ce,(ne.bottom-ne.top)*ce),pe=ue.getContext("2d");for(const{component:me}of oe)draw(me,pe,{scale:{x:ce,y:ce},x:-(ne.left*ce),y:-(ne.top*ce)});return Texture.from(ue.transferToImageBitmap())}var zi,Ya;class D2MinimalRenderer extends D2RendererBase{constructor(){super(...arguments);ai(this,zi);ai(this,Ya);Jn(this,Ya,50),this.getFrustumChangeQueue=lodashExports.once(()=>lodashExports.debounce(()=>this.handleFrustumChange(),this.options.animationDuration))}setupPixi(ce){super.setupPixi(ce),this.viewport&&(Jn(this,zi,new Container),this.viewport.addChild(xn(this,zi)))}add(ce){var ue,pe;if(ce.length){const me=super.add(ce),ge=this.makeBodies(ce),ye=this.getBounds(ge),xe=new Elem(ye,ge,1/this.getPx());return(pe=(ue=xn(this,zi))==null?void 0:ue.addChild)==null||pe.call(ue,xe),()=>{var ve,_e;me(),(_e=(ve=xn(this,zi))==null?void 0:ve.removeChild)==null||_e.call(ve,xe),xe.destroy()}}return()=>{}}handleFrustumChange(){if(!xn(this,zi)||!this.viewport)return;const ce=1/this.getPx(),{left:ue,right:pe,top:me,bottom:ge}=this.viewport;for(const ye of xn(this,zi).children)intersect(ye.bounds,{left:ue,right:pe,top:me,bottom:ge})?ye.rerender(ce):ye.rerender(1)}}zi=new WeakMap,Ya=new WeakMap;const D2MinimalRenderer$1=makeRenderer(D2MinimalRenderer,{components:["rect","circle","path","polygon"],id:"d2-minimal-renderer",name:"Pixel Nano",description:"Simple 2D renderer",version:"1.0.0"}),renderers={"d2-renderer":D2Renderer$1,"d2-minimal-renderer":D2MinimalRenderer$1};class NativeRendererTransport{constructor(oe){this.options=oe}async get(){const{hostname:oe}=url$3(this.options.url);return renderers[oe]}}const transports={native:{name:"Internal",constructor:NativeRendererTransport}};function RendererService(){const ne=compilerRuntimeExports.c(9),[oe]=useSettings(),{renderer:ce}=oe,[,ue]=useRenderers();let pe;ne[0]!==ce||ne[1]!==ue?(pe=async()=>{const xe=[];for(const{transport:ve,url:_e,key:we,disabled:Se}of ce??[])if(!Se){const $e=new transports[ve].constructor({url:_e});xe.push({key:we,url:_e,renderer:await $e.get()})}ue(()=>xe)},ne[0]=ce,ne[1]=ue,ne[2]=pe):pe=ne[2];let me;ne[3]!==ce?(me=JSON.stringify(ce),ne[3]=ce,ne[4]=me):me=ne[4];let ge;ne[5]!==ue||ne[6]!==me?(ge=[me,ue],ne[5]=ue,ne[6]=me,ne[7]=ge):ge=ne[7],useAsync(pe,ge);let ye;return ne[8]===Symbol.for("react.memo_cache_sentinel")?(ye=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),ne[8]=ye):ye=ne[8],ye}const statusColor$1={connected:"success.light",connecting:"warning.light",error:"error.light",disabled:"text.disabled"};function RendererEditor(ne){const oe=compilerRuntimeExports.c(35),{value:ce,onValueChange:ue}=ne,[pe]=useRenderers(),me=usePaper();let ge;oe[0]!==pe||oe[1]!==ce.key?(ge=lodashExports.find(pe,{key:ce.key}),oe[0]=pe,oe[1]=ce.key,oe[2]=ge):ge=oe[2];const ye=ge;let xe;oe[3]!==ue||oe[4]!==ce?(xe=function(Ue){ue==null||ue(merge$6(ce,Ue))},oe[3]=ue,oe[4]=ce,oe[5]=xe):xe=oe[5];const ve=xe,_e=ce!=null&&ce.disabled?"disabled":ye!=null&&ye.renderer?"connected":"error";let we;oe[6]===Symbol.for("react.memo_cache_sentinel")?(we={paper:{sx:{width:480}},popover:{anchorOrigin:{horizontal:-18,vertical:"bottom"}}},oe[6]=we):we=oe[6];let Se;oe[7]!==ye||oe[8]!==ve||oe[9]!==me||oe[10]!==_e||oe[11]!==ce.disabled||oe[12]!==ce.key||oe[13]!==ce.transport||oe[14]!==ce.url?(Se=ze=>{var Ue,qe,Ke,Ge,Ye,Xe,Je,Qe,Ze;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{className:ce.key,onClick:ze,flex:1,sx:{width:0,overflow:"hidden","> *":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},children:[jsxRuntimeExports.jsx(Typography,{component:"div",children:ye!=null&&ye.renderer?`${(qe=(Ue=ye==null?void 0:ye.renderer)==null?void 0:Ue.meta)==null?void 0:qe.name} ${(Ge=(Ke=ye.renderer)==null?void 0:Ke.meta)==null?void 0:Ge.version}`:lodashExports.startCase(_e)}),!!(ye!=null&&ye.renderer)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:(Xe=(Ye=ye.renderer)==null?void 0:Ye.meta)==null?void 0:Xe.description}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("span",{children:["Contributes"," ",lodashExports.join((Qe=(Je=ye.renderer)==null?void 0:Je.meta)==null?void 0:Qe.components,", ")]})]})}),jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",children:[(Ze=transports[ce==null?void 0:ce.transport])==null?void 0:Ze.name,": ",(ce==null?void 0:ce.url)||"No URL"]})]}),jsxRuntimeExports.jsx(Chip,{sx:{minWidth:0,maxWidth:"fit-content",flex:1,mx:1,color:statusColor$1[_e],...lodashExports.omit(me(1),"borderRadius")},size:"small",label:lodashExports.startCase(_e)}),jsxRuntimeExports.jsx(Tooltip,{title:`${ce.disabled?"Enable":"Disable"} Renderer`,children:jsxRuntimeExports.jsx(Box,{mr:-3,children:jsxRuntimeExports.jsx(Switch$1,{checked:!ce.disabled,onChange:(Tt,Ut)=>ve({disabled:!Ut})})})})]})},oe[7]=ye,oe[8]=ve,oe[9]=me,oe[10]=_e,oe[11]=ce.disabled,oe[12]=ce.key,oe[13]=ce.transport,oe[14]=ce.url,oe[15]=Se):Se=oe[15];let $e;oe[16]===Symbol.for("react.memo_cache_sentinel")?($e={children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Edit Renderer"})},oe[16]=$e):$e=oe[16];let Te;oe[17]!==ve?(Te=ze=>ve({url:ze.target.value}),oe[17]=ve,oe[18]=Te):Te=oe[18];let Re;oe[19]===Symbol.for("react.memo_cache_sentinel")?(Re={mb:2},oe[19]=Re):Re=oe[19];let Ae;oe[20]!==Te||oe[21]!==ce.url?(Ae=jsxRuntimeExports.jsx(TextField,{autoFocus:!0,defaultValue:ce.url,onChange:Te,fullWidth:!0,variant:"filled",label:"URL",sx:Re}),oe[20]=Te,oe[21]=ce.url,oe[22]=Ae):Ae=oe[22];let ke;oe[23]===Symbol.for("react.memo_cache_sentinel")?(ke=lodashExports.entries(transports).map(_temp$e),oe[23]=ke):ke=oe[23];let Be;oe[24]!==ve?(Be=ze=>ve({transport:ze}),oe[24]=ve,oe[25]=Be):Be=oe[25];let Ie;oe[26]!==Be||oe[27]!==ce.transport?(Ie=jsxRuntimeExports.jsx(SelectField,{placeholder:"Renderer Type",items:ke,fullWidth:!0,value:ce.transport,onChange:Be}),oe[26]=Be,oe[27]=ce.transport,oe[28]=Ie):Ie=oe[28];let Ne;oe[29]!==Ie||oe[30]!==Ae?(Ne=jsxRuntimeExports.jsxs(Box,{p:2.5,children:[Ae,Ie]}),oe[29]=Ie,oe[30]=Ae,oe[31]=Ne):Ne=oe[31];let je;return oe[32]!==Ne||oe[33]!==Se?(je=jsxRuntimeExports.jsx(Flex,{alignItems:"center",py:1,children:jsxRuntimeExports.jsx(ManagedModal,{slotProps:we,popover:!0,trigger:Se,appBar:$e,children:Ne})}),oe[32]=Ne,oe[33]=Se,oe[34]=je):je=oe[34],je}function _temp$e(ne){const[oe,ce]=ne,{name:ue}=ce;return{value:oe,label:ue}}function RendererListEditor(){const ne=compilerRuntimeExports.c(10),[oe,ce]=useSettings(),{renderer:ue}=oe;let pe;ne[0]===Symbol.for("react.memo_cache_sentinel")?(pe={mx:-2},ne[0]=pe):pe=ne[0];let me;ne[1]!==ce?(me=lodashExports.debounce(ve=>ce(()=>({renderer:ve})),300),ne[1]=ce,ne[2]=me):me=ne[2];let ge;ne[3]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(SvgIcon$z,{}),ne[3]=ge):ge=ne[3];let ye;ne[4]!==ce?(ye=jsxRuntimeExports.jsx(FeaturePickerButton,{icon:ge,onClick:()=>ce(_temp3$6),children:"Reset"}),ne[4]=ce,ne[5]=ye):ye=ne[5];let xe;return ne[6]!==ue||ne[7]!==me||ne[8]!==ye?(xe=jsxRuntimeExports.jsx(Box,{sx:pe,children:jsxRuntimeExports.jsx(ListEditor,{sortable:!0,editor:_temp$d,icon:null,value:ue,onChange:me,addItemLabel:"Add renderer",create:_temp2$8,addItemExtras:ye,onFocus:_temp4$3})}),ne[6]=ue,ne[7]=me,ne[8]=ye,ne[9]=xe):xe=ne[9],xe}function _temp4$3(ne){const oe=lodashExports.head(document.getElementsByClassName(ne));oe&&"click"in oe&&typeof oe.click=="function"&&oe.click()}function _temp3$6(){return{renderer:defaultRenderers}}function _temp2$8(){return{transport:defaultTransport,url:"",disabled:!0}}function _temp$d(ne){return jsxRuntimeExports.jsx(RendererEditor,{value:ne})}function useConnectionStatus(ne){const[oe]=useLoading(),{connections:ce}=oe,ue=useConnectionResolver(),[pe]=useSettings(),{remote:me}=pe,ge=lodashExports.find(me,{url:ne});return ge&&!(ge!=null&&ge.disabled)?ue({url:ne})?"connected":ce?"connecting":ne?"error":"not-connected":"not-connected"}const statusColor={connected:"success.light",connecting:"warning.light",error:"error.light","not-connected":"text.disabled"};function ServerEditor(ne){const oe=compilerRuntimeExports.c(32),{value:ce,onValueChange:ue}=ne,pe=useConnection(ce.url),me=usePaper(),ge=useConnectionStatus(ce.url);let ye,xe;oe[0]!==ue||oe[1]!==ce?(xe=debounce$2(je=>{ue==null||ue(merge$6(ce,je))},300),oe[0]=ue,oe[1]=ce,oe[2]=xe):xe=oe[2],ye=xe;const ve=ye;let _e;oe[3]===Symbol.for("react.memo_cache_sentinel")?(_e={paper:{sx:{width:480}},popover:{anchorOrigin:{horizontal:-18,vertical:"bottom"}}},oe[3]=_e):_e=oe[3];let we;oe[4]!==pe||oe[5]!==ve||oe[6]!==me||oe[7]!==ge||oe[8]!==ce.disabled||oe[9]!==ce.key||oe[10]!==ce.transport||oe[11]!==ce.url?(we=je=>{var ze;return jsxRuntimeExports.jsxs(Stack,{direction:"row",flex:1,alignItems:"center",sx:{py:1,mr:-3},children:[jsxRuntimeExports.jsxs(Stack,{className:ce.key,direction:"row",flex:1,alignItems:"center",onClick:je,children:[jsxRuntimeExports.jsxs(Box,{flex:1,sx:{width:0,overflow:"hidden","> *":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},children:[jsxRuntimeExports.jsx(Typography,{component:"div",children:pe?`${pe.name} ${pe.version}`:lodashExports.startCase(ge)}),!!(pe!=null&&pe.description)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:pe.description}),jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",children:[(ze=transports$1[ce==null?void 0:ce.transport])==null?void 0:ze.name,": ",(ce==null?void 0:ce.url)||"No URL"]})]}),jsxRuntimeExports.jsx(Chip,{sx:{flex:1,minWidth:0,maxWidth:"fit-content",mx:1,color:statusColor[ge],...lodashExports.omit(me(1),"borderRadius")},size:"small",label:lodashExports.startCase(ge)})]}),jsxRuntimeExports.jsx(Tooltip,{title:`${ce.disabled?"Enable":"Disable"} adapter`,children:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Switch$1,{defaultChecked:!ce.disabled,onChange:(Ue,qe)=>ve({disabled:!qe})})})})]})},oe[4]=pe,oe[5]=ve,oe[6]=me,oe[7]=ge,oe[8]=ce.disabled,oe[9]=ce.key,oe[10]=ce.transport,oe[11]=ce.url,oe[12]=we):we=oe[12];let Se;oe[13]===Symbol.for("react.memo_cache_sentinel")?(Se={children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Edit Adapter"})},oe[13]=Se):Se=oe[13];let $e;oe[14]!==ve?($e=je=>ve({url:je.target.value}),oe[14]=ve,oe[15]=$e):$e=oe[15];let Te;oe[16]===Symbol.for("react.memo_cache_sentinel")?(Te={mb:2},oe[16]=Te):Te=oe[16];let Re;oe[17]!==$e||oe[18]!==ce.url?(Re=jsxRuntimeExports.jsx(TextField,{autoFocus:!0,defaultValue:ce.url,onChange:$e,fullWidth:!0,variant:"filled",label:"URL",sx:Te}),oe[17]=$e,oe[18]=ce.url,oe[19]=Re):Re=oe[19];let Ae;oe[20]===Symbol.for("react.memo_cache_sentinel")?(Ae=lodashExports.entries(transports$1).map(_temp$c),oe[20]=Ae):Ae=oe[20];let ke;oe[21]!==ve?(ke=je=>ve({transport:je}),oe[21]=ve,oe[22]=ke):ke=oe[22];let Be;oe[23]!==ke||oe[24]!==ce.transport?(Be=jsxRuntimeExports.jsx(SelectField,{placeholder:"Connection Type",items:Ae,fullWidth:!0,value:ce.transport,onChange:ke}),oe[23]=ke,oe[24]=ce.transport,oe[25]=Be):Be=oe[25];let Ie;oe[26]!==Be||oe[27]!==Re?(Ie=jsxRuntimeExports.jsxs(Box,{p:2.5,children:[Re,Be]}),oe[26]=Be,oe[27]=Re,oe[28]=Ie):Ie=oe[28];let Ne;return oe[29]!==Ie||oe[30]!==we?(Ne=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(ManagedModal,{slotProps:_e,popover:!0,trigger:we,appBar:Se,children:Ie})})}),oe[29]=Ie,oe[30]=we,oe[31]=Ne):Ne=oe[31],Ne}function _temp$c(ne){const[oe,ce]=ne,{name:ue}=ce;return{value:oe,label:ue}}function ServerListEditor(){const ne=compilerRuntimeExports.c(10),[oe,ce]=useSettings(),{remote:ue}=oe;let pe;ne[0]===Symbol.for("react.memo_cache_sentinel")?(pe={mx:-2},ne[0]=pe):pe=ne[0];let me;ne[1]!==ce?(me=lodashExports.debounce(ve=>ce(()=>({remote:ve})),300),ne[1]=ce,ne[2]=me):me=ne[2];let ge;ne[3]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(SvgIcon$z,{}),ne[3]=ge):ge=ne[3];let ye;ne[4]!==ce?(ye=jsxRuntimeExports.jsx(FeaturePickerButton,{icon:ge,onClick:()=>ce(_temp3$5),children:"Reset"}),ne[4]=ce,ne[5]=ye):ye=ne[5];let xe;return ne[6]!==ue||ne[7]!==me||ne[8]!==ye?(xe=jsxRuntimeExports.jsx(Box,{sx:pe,children:jsxRuntimeExports.jsx(ListEditor,{sortable:!0,editor:_temp$b,icon:null,value:ue,onChange:me,addItemLabel:"Add adapter",create:_temp2$7,addItemExtras:ye,onFocus:_temp4$2})}),ne[6]=ue,ne[7]=me,ne[8]=ye,ne[9]=xe):xe=ne[9],xe}function _temp4$2(ne){const oe=lodashExports.head(document.getElementsByClassName(ne));oe&&"click"in oe&&typeof oe.click=="function"&&oe.click()}function _temp3$5(){return{remote:defaultRemotes}}function _temp2$7(){return{transport:defaultTransport,url:"",disabled:!0}}function _temp$b(ne){return jsxRuntimeExports.jsx(ServerEditor,{value:ne})}const GitHub=createSvgIcon$2(jsxRuntimeExports.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),logo$1=""+new URL("logo512-Cm7nFPma.png",import.meta.url).href,contacts=[{name:"Dr Daniel Harabor",email:"daniel.harabor@monash.edu"},{name:"Dr Michael Wybrow",email:"michael.wybrow@monash.edu"},{name:"Kevin Zheng",email:"kevin.zheng@monash.edu"},{name:"Francis Anthony",email:"fant0003@student.monash.edu"},{name:"Karan Batta",email:"krnbatta@gmail.com"},{name:"Jay Wingate",email:"jaypeterwingate@gmail.com"},{name:"Leo Whitehead",email:"leo@whiteheadsoftware.dev"},{name:"Can Wang",email:"camwang@outlook.com"},{name:"Rory Tobin-Underwood",email:"rorytu@gmail.com"}];function parseUrl(ne){const oe=new URL(ne);return lodashExports.trimEnd(`${oe.hostname}${oe.pathname}`,"/")}function AboutContent(){const ne=compilerRuntimeExports.c(10);let oe;ne[0]===Symbol.for("react.memo_cache_sentinel")?(oe=function($e,Te){return jsxRuntimeExports.jsxs(Box,{sx:{pt:2},children:[jsxRuntimeExports.jsx(Typography,{component:"div",variant:"overline",color:"text.secondary",children:$e}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",children:Te})]})},ne[0]=oe):oe=ne[0];const ce=oe;let ue,pe;ne[1]===Symbol.for("react.memo_cache_sentinel")?(ue=jsxRuntimeExports.jsx(Box,{sx:{pt:0,pb:2},children:jsxRuntimeExports.jsx("img",{src:logo$1,height:"64"})}),pe=jsxRuntimeExports.jsx(Typography,{component:"div",variant:"h6",children:name}),ne[1]=ue,ne[2]=pe):(ue=ne[1],pe=ne[2]);let me;ne[3]===Symbol.for("react.memo_cache_sentinel")?(me=ce("Build Info",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:version_name})),ne[3]=me):me=ne[3];let ge;ne[4]===Symbol.for("react.memo_cache_sentinel")?(ge=ce("Team",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(List$1,{sx:{mx:-2},children:contacts.map(_temp$a)})})),ne[4]=ge):ge=ne[4];let ye;ne[5]===Symbol.for("react.memo_cache_sentinel")?(ye={mx:-2},ne[5]=ye):ye=ne[5];let xe;ne[6]===Symbol.for("react.memo_cache_sentinel")?(xe=jsxRuntimeExports.jsx(ListItemAvatar,{children:jsxRuntimeExports.jsx(Avatar,{sx:{width:24,height:24},src:logo$1})}),ne[6]=xe):xe=ne[6];let ve;ne[7]===Symbol.for("react.memo_cache_sentinel")?(ve=jsxRuntimeExports.jsxs(ListItemButton,{target:"_blank",href:homepage,children:[xe,jsxRuntimeExports.jsx(ListItemText,{primary:"Home",secondary:parseUrl(homepage)})]}),ne[7]=ve):ve=ne[7];let _e;ne[8]===Symbol.for("react.memo_cache_sentinel")?(_e=jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(GitHub,{})}),ne[8]=_e):_e=ne[8];let we;return ne[9]===Symbol.for("react.memo_cache_sentinel")?(we=jsxRuntimeExports.jsxs(Box,{children:[ue,pe,me,ge,ce("Resources",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(List$1,{sx:ye,children:[ve,jsxRuntimeExports.jsxs(ListItemButton,{target:"_blank",href:repository,children:[_e,jsxRuntimeExports.jsx(ListItemText,{primary:"Repository",secondary:parseUrl(repository)})]})]})}))]}),ne[9]=we):we=ne[9],we}function _temp$a(ne,oe){const{name:ce,email:ue}=ne;return jsxRuntimeExports.jsxs(ListItemButton,{href:`mailto:${ue}`,children:[jsxRuntimeExports.jsx(ListItemAvatar,{children:jsxRuntimeExports.jsx(Avatar,{children:lodashExports.head(ce)})}),jsxRuntimeExports.jsx(ListItemText,{primary:ce,secondary:ue})]},oe)}const formatLabel=ne=>`${ne}x`;function SettingsPage(ne){const oe=compilerRuntimeExports.c(102),{template:ce}=ne,{controls:ue,onChange:pe,state:me,dragHandle:ge}=useViewTreeContext(),ye=useSmallDisplay(),[xe,ve]=useUIState(),_e=useSnackbar(),we=useBusyState("reset"),[Se,$e]=useSettings(),{"playback/playbackRate":Te,"appearance/acrylic":Re,"appearance/theme":Ae,"appearance/accentColor":ke,"behaviour/showOnStart":Be}=Se,Ie=Te===void 0?1:Te,Ne=Ae===void 0?"light":Ae,je=ke===void 0?"teal":ke,[ze,Ue]=reactExports.useState("general");let qe;oe[0]===Symbol.for("react.memo_cache_sentinel")?(qe=function(Hr){return jsxRuntimeExports.jsx(Typography,{component:"div",variant:"overline",color:"text.secondary",children:Hr})},oe[0]=qe):qe=oe[0];const Ke=qe;let Ge;oe[1]===Symbol.for("react.memo_cache_sentinel")?(Ge=function(Hr){return jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body1",sx:{mr:4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:Hr})},oe[1]=Ge):Ge=oe[1];const Ye=Ge;let Xe;oe[2]!==ce.Key?(Xe=jsxRuntimeExports.jsx(ce.Key,{children:"settings"}),oe[2]=ce.Key,oe[3]=Xe):Xe=oe[3];let Je;oe[4]!==ce.Title?(Je=jsxRuntimeExports.jsx(ce.Title,{children:"Settings"}),oe[4]=ce.Title,oe[5]=Je):Je=oe[5];let Qe;oe[6]!==ce.Handle||oe[7]!==ge?(Qe=jsxRuntimeExports.jsx(ce.Handle,{children:ge}),oe[6]=ce.Handle,oe[7]=ge,oe[8]=Qe):Qe=oe[8];let Ze;oe[9]===Symbol.for("react.memo_cache_sentinel")?(Ze=jsxRuntimeExports.jsxs(TabList,{onChange:(zr,Hr)=>Ue(Hr),children:[jsxRuntimeExports.jsx(Tab,{label:"General",value:"general"}),jsxRuntimeExports.jsx(Tab,{label:"Extensions",value:"connections"}),jsxRuntimeExports.jsx(Tab,{label:"Security",value:"security"}),jsxRuntimeExports.jsx(Tab,{label:"About",value:"about"})]}),oe[9]=Ze):Ze=oe[9];let Tt;oe[10]!==ce.Options?(Tt=jsxRuntimeExports.jsx(ce.Options,{children:Ze}),oe[10]=ce.Options,oe[11]=Tt):Tt=oe[11];const Ut=ce.Content;let Gt;oe[12]===Symbol.for("react.memo_cache_sentinel")?(Gt={p:2},oe[12]=Gt):Gt=oe[12];let Nt;oe[13]===Symbol.for("react.memo_cache_sentinel")?(Nt=Ke("Playback"),oe[13]=Nt):Nt=oe[13];let Wt;oe[14]===Symbol.for("react.memo_cache_sentinel")?(Wt=Ye("Playback rate"),oe[14]=Wt):Wt=oe[14];let Mt,Yt;oe[15]===Symbol.for("react.memo_cache_sentinel")?(Mt={maxWidth:320,mr:2},Yt=[1,2,5,10].map(_temp$9),oe[15]=Mt,oe[16]=Yt):(Mt=oe[15],Yt=oe[16]);let ir;oe[17]!==$e?(ir=(zr,Hr)=>$e(()=>({"playback/playbackRate":Hr})),oe[17]=$e,oe[18]=ir):ir=oe[18];let tr;oe[19]!==Ie||oe[20]!==ir?(tr=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[Wt,jsxRuntimeExports.jsx(Slider,{sx:Mt,marks:Yt,step:1*defaultPlaybackRate,min:1*defaultPlaybackRate,max:10*defaultPlaybackRate,valueLabelFormat:_temp2$6,valueLabelDisplay:"auto",defaultValue:Ie,onChangeCommitted:ir})]}),oe[19]=Ie,oe[20]=ir,oe[21]=tr):tr=oe[21];let Qt;oe[22]===Symbol.for("react.memo_cache_sentinel")?(Qt=Ke("Appearance"),oe[22]=Qt):Qt=oe[22];let er;oe[23]===Symbol.for("react.memo_cache_sentinel")?(er=Ye("Acrylic"),oe[23]=er):er=oe[23];const hr=!!Re;let cr;oe[24]!==$e?(cr=(zr,Hr)=>$e(()=>({"appearance/acrylic":Hr})),oe[24]=$e,oe[25]=cr):cr=oe[25];let gr;oe[26]!==hr||oe[27]!==cr?(gr=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[er,jsxRuntimeExports.jsx(Switch$1,{defaultChecked:hr,onChange:cr})]}),oe[26]=hr,oe[27]=cr,oe[28]=gr):gr=oe[28];let ar,Pt;oe[29]===Symbol.for("react.memo_cache_sentinel")?(ar=Ye("Dark mode"),Pt=jsxRuntimeExports.jsx(Space,{flex:1}),oe[29]=ar,oe[30]=Pt):(ar=oe[29],Pt=oe[30]);const or=Ne==="dark";let Kt;oe[31]!==$e?(Kt=(zr,Hr)=>$e(()=>({"appearance/theme":Hr?"dark":"light"})),oe[31]=$e,oe[32]=Kt):Kt=oe[32];let Vt;oe[33]!==or||oe[34]!==Kt?(Vt=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[ar,Pt,jsxRuntimeExports.jsx(Switch$1,{defaultChecked:or,onChange:Kt})]}),oe[33]=or,oe[34]=Kt,oe[35]=Vt):Vt=oe[35];let Xt;oe[36]===Symbol.for("react.memo_cache_sentinel")?(Xt=Ye("Accent"),oe[36]=Xt):Xt=oe[36];let sr;oe[37]===Symbol.for("react.memo_cache_sentinel")?(sr={p:1},oe[37]=sr):sr=oe[37];let fr;oe[38]!==Ne?(fr=lodashExports.map(shades,zr=>({id:zr,name:lodashExports.startCase(zr),icon:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Box,{sx:{ml:.5,width:12,height:12,backgroundColor:getShade(zr,Ne),borderRadius:4}})})})),oe[38]=Ne,oe[39]=fr):fr=oe[39];let kt;oe[40]!==$e?(kt=zr=>$e(()=>({"appearance/accentColor":zr})),oe[40]=$e,oe[41]=kt):kt=oe[41];let qt;oe[42]!==je||oe[43]!==fr||oe[44]!==kt?(qt=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[Xt,jsxRuntimeExports.jsx(Box,{sx:sr,children:jsxRuntimeExports.jsx(FeaturePicker,{paper:!0,value:je,items:fr,arrow:!0,onChange:kt})})]}),oe[42]=je,oe[43]=fr,oe[44]=kt,oe[45]=qt):qt=oe[45];let Jt;oe[46]===Symbol.for("react.memo_cache_sentinel")?(Jt=Ke("Behaviour"),oe[46]=Jt):Jt=oe[46];let rr;oe[47]===Symbol.for("react.memo_cache_sentinel")?(rr=Ye("Show explore on start-up"),oe[47]=rr):rr=oe[47];const vr=!!Be;let mr;oe[48]!==$e?(mr=(zr,Hr)=>$e(()=>({"behaviour/showOnStart":Hr?"explore":void 0})),oe[48]=$e,oe[49]=mr):mr=oe[49];let $r;oe[50]!==vr||oe[51]!==mr?($r=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[rr,jsxRuntimeExports.jsx(Switch$1,{defaultChecked:vr,onChange:mr})]}),oe[50]=vr,oe[51]=mr,oe[52]=$r):$r=oe[52];let Mr;oe[53]===Symbol.for("react.memo_cache_sentinel")?(Mr=Ke("Advanced"),oe[53]=Mr):Mr=oe[53];let Pr;oe[54]===Symbol.for("react.memo_cache_sentinel")?(Pr=Ye("Reset settings and extensions"),oe[54]=Pr):Pr=oe[54];let lr;oe[55]===Symbol.for("react.memo_cache_sentinel")?(lr={children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Reset settings and extensions"})},oe[55]=lr):lr=oe[55];let jt;oe[56]!==_e||oe[57]!==$e||oe[58]!==ve||oe[59]!==ye||oe[60]!==we?(jt=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[Pr,jsxRuntimeExports.jsx(ManagedModal,{trigger:_temp3$4,appBar:lr,children:zr=>{const{close:Hr}=zr;return jsxRuntimeExports.jsxs(Stack,{sx:{p:ye?2:3,pt:2,gap:4},children:[jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",children:"If something's not working correctly, you can try to reset all settings and extensions. This cannot be undone."}),jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"flex-end",gap:2,children:[jsxRuntimeExports.jsx(Button,{variant:"text",onClick:()=>{Hr()},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:()=>{we(async()=>{await wait(300),$e(_temp4$1),Hr(),ve(_temp5$1),_e("Reset complete")},"Resetting settings and extensions")},color:"error",startIcon:jsxRuntimeExports.jsx(SvgIcon$y,{}),children:"Reset settings and extensions"})]})]})}})]}),oe[56]=_e,oe[57]=$e,oe[58]=ve,oe[59]=ye,oe[60]=we,oe[61]=jt):jt=oe[61];let Dt;oe[62]!==tr||oe[63]!==gr||oe[64]!==Vt||oe[65]!==qt||oe[66]!==$r||oe[67]!==jt?(Dt=jsxRuntimeExports.jsx(TabPanel,{value:"general",sx:Gt,children:jsxRuntimeExports.jsxs(Box,{children:[Nt,tr,Qt,gr,Vt,qt,Jt,$r,Mr,jt]})}),oe[62]=tr,oe[63]=gr,oe[64]=Vt,oe[65]=qt,oe[66]=$r,oe[67]=jt,oe[68]=Dt):Dt=oe[68];let ur;oe[69]===Symbol.for("react.memo_cache_sentinel")?(ur={p:2},oe[69]=ur):ur=oe[69];let br;oe[70]===Symbol.for("react.memo_cache_sentinel")?(br=jsxRuntimeExports.jsxs(Box,{children:[Ke("Adapters"),jsxRuntimeExports.jsx(ServerListEditor,{})]}),oe[70]=br):br=oe[70];let Sr;oe[71]===Symbol.for("react.memo_cache_sentinel")?(Sr=jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{sx:{mb:2}}),Ke("Renderers"),jsxRuntimeExports.jsx(RendererListEditor,{})]}),oe[71]=Sr):Sr=oe[71];let Cr;oe[72]===Symbol.for("react.memo_cache_sentinel")?(Cr=jsxRuntimeExports.jsxs(TabPanel,{value:"connections",sx:ur,children:[br,Sr,jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{sx:{mb:2}}),Ke("Map support"),jsxRuntimeExports.jsx(MapParserListEditor,{})]})]}),oe[72]=Cr):Cr=oe[72];let pr,Tr;oe[73]===Symbol.for("react.memo_cache_sentinel")?(pr={p:2},Tr=Ke("Trusted origins"),oe[73]=pr,oe[74]=Tr):(pr=oe[73],Tr=oe[74]);let xr;oe[75]===Symbol.for("react.memo_cache_sentinel")?(xr={maxWidth:480},oe[75]=xr):xr=oe[75];let Rr;oe[76]===Symbol.for("react.memo_cache_sentinel")?(Rr=jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",variant:"caption",sx:{pt:2},children:"Rendering traces in the viewport and using advanced debugger features sometimes requires running third-party code."}),oe[76]=Rr):Rr=oe[76];let dr;oe[77]===Symbol.for("react.memo_cache_sentinel")?(dr=jsxRuntimeExports.jsxs(Box,{sx:xr,children:[Rr,jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",variant:"caption",sx:{pt:2},children:"You'll be prompted to add origins when necessary, and you can stop trusting origins by removing them from this list."})]}),oe[77]=dr):dr=oe[77];let Lr;oe[78]===Symbol.for("react.memo_cache_sentinel")?(Lr=jsxRuntimeExports.jsxs(TabPanel,{value:"security",sx:pr,children:[Tr,dr,jsxRuntimeExports.jsx(Box,{sx:{pt:2},children:jsxRuntimeExports.jsx(TrustedOriginListEditor,{})})]}),oe[78]=Lr):Lr=oe[78];let qr;oe[79]===Symbol.for("react.memo_cache_sentinel")?(qr={p:2},oe[79]=qr):qr=oe[79];let Zt;oe[80]===Symbol.for("react.memo_cache_sentinel")?(Zt=jsxRuntimeExports.jsx(TabPanel,{value:"about",sx:qr,children:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(AboutContent,{})})}),oe[80]=Zt):Zt=oe[80];let kr;oe[81]!==Dt?(kr=jsxRuntimeExports.jsx(Flex,{vertical:!0,children:jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsxs(Flex,{vertical:!0,pt:6,children:[Dt,Cr,Lr,Zt]})})}),oe[81]=Dt,oe[82]=kr):kr=oe[82];let Ar;oe[83]!==ce.Content||oe[84]!==kr?(Ar=jsxRuntimeExports.jsx(Ut,{children:kr}),oe[83]=ce.Content,oe[84]=kr,oe[85]=Ar):Ar=oe[85];let wr;oe[86]!==ce.Extras||oe[87]!==ue?(wr=jsxRuntimeExports.jsx(ce.Extras,{children:ue}),oe[86]=ce.Extras,oe[87]=ue,oe[88]=wr):wr=oe[88];let Or;oe[89]!==ce||oe[90]!==pe||oe[91]!==me||oe[92]!==Tt||oe[93]!==Ar||oe[94]!==wr||oe[95]!==Xe||oe[96]!==Je||oe[97]!==Qe?(Or=jsxRuntimeExports.jsxs(ce,{onChange:pe,stack:me,children:[Xe,Je,Qe,Tt,Ar,wr]}),oe[89]=ce,oe[90]=pe,oe[91]=me,oe[92]=Tt,oe[93]=Ar,oe[94]=wr,oe[95]=Xe,oe[96]=Je,oe[97]=Qe,oe[98]=Or):Or=oe[98];let Br;return oe[99]!==Or||oe[100]!==ze?(Br=jsxRuntimeExports.jsx(TabContext,{value:ze,children:Or}),oe[99]=Or,oe[100]=ze,oe[101]=Br):Br=oe[101],Br}function _temp5$1(){return{sidebarOpen:!1,fullscreenModal:void 0}}function _temp4$1(){return defaults$3}function _temp3$4(ne){return jsxRuntimeExports.jsx(Button,{sx:{mx:1},color:"error",startIcon:jsxRuntimeExports.jsx(SvgIcon$y,{}),onClick:ne,children:"Reset now"})}function _temp2$6(ne){return formatLabel(ne/defaultPlaybackRate)}function _temp$9(ne){return{value:ne*defaultPlaybackRate,label:formatLabel(ne)}}const a$1=lodashExports.keys(mapParsers).map(ne=>({key:ne}));function Sink({children:ne}){return ne}function TrustedOriginListEditor(){const ne=compilerRuntimeExports.c(8),[oe,ce]=useSettings(),{trustedOrigins:ue}=oe;let pe,me;ne[0]!==ue?(me=lodashExports.map(ue,_temp6$1),ne[0]=ue,ne[1]=me):me=ne[1],pe=me;const ge=pe;let ye;ne[2]===Symbol.for("react.memo_cache_sentinel")?(ye={mx:-2},ne[2]=ye):ye=ne[2];let xe;ne[3]!==ce?(xe=lodashExports.debounce(_e=>ce(()=>({trustedOrigins:lodashExports.map(_e,"key")})),300),ne[3]=ce,ne[4]=xe):xe=ne[4];let ve;return ne[5]!==ge||ne[6]!==xe?(ve=jsxRuntimeExports.jsx(Box,{sx:ye,children:jsxRuntimeExports.jsx(ListEditor,{button:!1,sortable:!0,addable:!1,deletable:!0,editor:_temp7$1,icon:null,value:ge,onChange:xe,create:_temp8})}),ne[5]=ge,ne[6]=xe,ne[7]=ve):ve=ne[7],ve}function _temp8(){return{key:""}}function _temp7$1(ne){return jsxRuntimeExports.jsx(Sink,{children:jsxRuntimeExports.jsx(ListItemText,{primary:ne.key})},ne.key)}function _temp6$1(ne){return{key:ne}}function MapParserListEditor(){const ne=compilerRuntimeExports.c(1);let oe;return ne[0]===Symbol.for("react.memo_cache_sentinel")?(oe=jsxRuntimeExports.jsx(Box,{sx:{mx:-2},children:jsxRuntimeExports.jsx(ListEditor,{button:!1,sortable:!0,addable:!1,deletable:!1,editor:_temp9,icon:null,value:a$1,create:_temp10})}),ne[0]=oe):oe=ne[0],oe}function _temp10(){return{key:""}}function _temp9(ne){return jsxRuntimeExports.jsx(Sink,{children:jsxRuntimeExports.jsx(ListItemText,{primary:lodashExports.startCase(ne.key),secondary:`Support for *.${ne.key} maps`})},ne.key)}const isSourceLayer=ne=>{var oe;return!!((oe=getController(ne))!=null&&oe.getSources)};function SourcePage({template:ne}){const oe=useTheme();useMonacoTheme(oe);const{layers:ce}=useLayer(void 0,isSourceLayer),ue=reactExports.useMemo(()=>{var ve;return(ve=ce==null?void 0:ce.flatMap)==null?void 0:ve.call(ce,_e=>{var we,Se,$e,Te;return(Te=($e=(Se=(we=getController(_e))==null?void 0:we.getSources)==null?void 0:Se.call(we,_e))==null?void 0:$e.map)==null?void 0:Te.call($e,Re=>({layer:_e.key,source:Re}))})},[ce]),{controls:pe,onChange:me,state:ge,dragHandle:ye}=useViewTreeContext(),xe=reactExports.useMemo(()=>lodashExports.find(ue,ve=>ve&&ve.source.id===(ge==null?void 0:ge.source)&&ve.layer===(ge==null?void 0:ge.layer))??lodashExports.first(ue),[ue,ge==null?void 0:ge.source,ge==null?void 0:ge.layer]);return jsxRuntimeExports.jsxs(ne,{onChange:me,stack:ge,children:[jsxRuntimeExports.jsx(ne.Key,{children:"source"}),jsxRuntimeExports.jsx(ne.Title,{children:"Source"}),jsxRuntimeExports.jsx(ne.Handle,{children:ye}),jsxRuntimeExports.jsx(ne.Content,{children:ue!=null&&ue.length?jsxRuntimeExports.jsx(Flex,{pt:6,children:jsxRuntimeExports.jsx(AutoSizer,{children:ve=>{var _e,we;return jsxRuntimeExports.jsx(de,{theme:oe.palette.mode==="dark"?"posthoc-dark":"light",options:{readOnly:!0},language:(_e=xe==null?void 0:xe.source)==null?void 0:_e.language,loading:jsxRuntimeExports.jsx(CircularProgress,{variant:"indeterminate"}),...ve,value:(we=xe==null?void 0:xe.source)==null?void 0:we.content})}})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$T,{}),label:"Source"})}),jsxRuntimeExports.jsx(ne.Options,{children:!!(ue!=null&&ue.length)&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Tabs,{value:`${xe==null?void 0:xe.source.id}::${xe==null?void 0:xe.layer}`,onChange:(ve,_e)=>{const[we,Se]=_e.split("::");me==null||me({source:we,layer:Se})},children:lodashExports.map(ue,({source:ve,layer:_e})=>jsxRuntimeExports.jsx(Tab,{label:ve.name,value:`${ve.id}::${_e}`}))})})}),jsxRuntimeExports.jsx(ne.Extras,{children:pe})]})}const PUBLISH=0,SUBSCRIBE=1,RESET=2,VALUE=4;function compose(ne,oe){return ce=>ne(oe(ce))}function thrush(ne,oe){return oe(ne)}function curry2to1(ne,oe){return ce=>ne(oe,ce)}function curry1to0(ne,oe){return()=>ne(oe)}function tap(ne,oe){return oe(ne),ne}function tup(...ne){return ne}function call(ne){ne()}function always(ne){return()=>ne}function joinProc(...ne){return()=>{ne.map(call)}}function isDefined(ne){return ne!==void 0}function noop$4(){}function subscribe(ne,oe){return ne(SUBSCRIBE,oe)}function publish(ne,oe){ne(PUBLISH,oe)}function reset(ne){ne(RESET)}function getValue(ne){return ne(VALUE)}function connect(ne,oe){return subscribe(ne,curry2to1(oe,PUBLISH))}function handleNext(ne,oe){const ce=ne(SUBSCRIBE,ue=>{ce(),oe(ue)});return ce}function stream$1(){const ne=[];return(oe,ce)=>{switch(oe){case RESET:ne.splice(0,ne.length);return;case SUBSCRIBE:return ne.push(ce),()=>{const ue=ne.indexOf(ce);ue>-1&&ne.splice(ue,1)};case PUBLISH:ne.slice().forEach(ue=>{ue(ce)});return;default:throw new Error(`unrecognized action ${oe}`)}}}function statefulStream(ne){let oe=ne;const ce=stream$1();return(ue,pe)=>{switch(ue){case SUBSCRIBE:pe(oe);break;case PUBLISH:oe=pe;break;case VALUE:return oe}return ce(ue,pe)}}function eventHandler(ne){let oe,ce;const ue=()=>oe&&oe();return function(pe,me){switch(pe){case SUBSCRIBE:return me?ce===me?void 0:(ue(),ce=me,oe=subscribe(ne,me),oe):(ue(),noop$4);case RESET:ue(),ce=null;return;default:throw new Error(`unrecognized action ${pe}`)}}}function streamFromEmitter(ne){return tap(stream$1(),oe=>connect(ne,oe))}function statefulStreamFromEmitter(ne,oe){return tap(statefulStream(oe),ce=>connect(ne,ce))}function combineOperators(...ne){return oe=>ne.reduceRight(thrush,oe)}function pipe(ne,...oe){const ce=combineOperators(...oe);return(ue,pe)=>{switch(ue){case SUBSCRIBE:return subscribe(ne,ce(pe));case RESET:reset(ne);return}}}function defaultComparator(ne,oe){return ne===oe}function distinctUntilChanged(ne=defaultComparator){let oe;return ce=>ue=>{ne(oe,ue)||(oe=ue,ce(ue))}}function filter(ne){return oe=>ce=>{ne(ce)&&oe(ce)}}function map$1(ne){return oe=>compose(oe,ne)}function mapTo(ne){return oe=>()=>oe(ne)}function scan$1(ne,oe){return ce=>ue=>ce(oe=ne(oe,ue))}function skip(ne){return oe=>ce=>{ne>0?ne--:oe(ce)}}function throttleTime(ne){let oe=null,ce;return ue=>pe=>{oe=pe,!ce&&(ce=setTimeout(()=>{ce=void 0,ue(oe)},ne))}}function debounceTime(ne){let oe,ce;return ue=>pe=>{oe=pe,ce&&clearTimeout(ce),ce=setTimeout(()=>{ue(oe)},ne)}}function withLatestFrom(...ne){const oe=new Array(ne.length);let ce=0,ue=null;const pe=Math.pow(2,ne.length)-1;return ne.forEach((me,ge)=>{const ye=Math.pow(2,ge);subscribe(me,xe=>{const ve=ce;ce=ce|ye,oe[ge]=xe,ve!==pe&&ce===pe&&ue&&(ue(),ue=null)})}),me=>ge=>{const ye=()=>me([ge].concat(oe));ce===pe?ye():ue=ye}}function merge(...ne){return function(oe,ce){switch(oe){case SUBSCRIBE:return joinProc(...ne.map(ue=>subscribe(ue,ce)));case RESET:return;default:throw new Error(`unrecognized action ${oe}`)}}}function duc(ne,oe=defaultComparator){return pipe(ne,distinctUntilChanged(oe))}function combineLatest(...ne){const oe=stream$1(),ce=new Array(ne.length);let ue=0;const pe=Math.pow(2,ne.length)-1;return ne.forEach((me,ge)=>{const ye=Math.pow(2,ge);subscribe(me,xe=>{ce[ge]=xe,ue=ue|ye,ue===pe&&publish(oe,ce)})}),function(me,ge){switch(me){case SUBSCRIBE:return ue===pe&&ge(ce),subscribe(oe,ge);case RESET:return reset(oe);default:throw new Error(`unrecognized action ${me}`)}}}function system(ne,oe=[],{singleton:ce}={singleton:!0}){return{id:id(),constructor:ne,dependencies:oe,singleton:ce}}const id=()=>Symbol();function init$1(ne){const oe=new Map,ce=({id:ue,constructor:pe,dependencies:me,singleton:ge})=>{if(ge&&oe.has(ue))return oe.get(ue);const ye=pe(me.map(xe=>ce(xe)));return ge&&oe.set(ue,ye),ye};return ce(ne)}function omit(ne,oe){const ce={},ue={};let pe=0;const me=ne.length;for(;pe(Be[Ie]=Ne=>{const je=ke[oe.methods[Ie]];publish(je,Ne)},Be),{})}function _e(ke){return ge.reduce((Be,Ie)=>(Be[Ie]=eventHandler(ke[oe.events[Ie]]),Be),{})}const we=React$2.forwardRef((ke,Be)=>{const{children:Ie,...Ne}=ke,[je]=React$2.useState(()=>tap(init$1(ne),qe=>xe(qe,Ne))),[ze]=React$2.useState(curry1to0(_e,je));useIsomorphicLayoutEffect$1(()=>{for(const qe of ge)qe in Ne&&subscribe(ze[qe],Ne[qe]);return()=>{Object.values(ze).map(reset)}},[Ne,ze,je]),useIsomorphicLayoutEffect$1(()=>{xe(je,Ne)}),React$2.useImperativeHandle(Be,always(ve(je)));const Ue=ce;return jsxRuntimeExports.jsx(ye.Provider,{value:je,children:ce?jsxRuntimeExports.jsx(Ue,{...omit([...ue,...pe,...ge],Ne),children:Ie}):Ie})}),Se=ke=>React$2.useCallback(curry2to1(publish,React$2.useContext(ye)[ke]),[ke]),$e=ke=>{const Ie=React$2.useContext(ye)[ke],Ne=React$2.useCallback(je=>subscribe(Ie,je),[Ie]);return React$2.useSyncExternalStore(Ne,()=>getValue(Ie),()=>getValue(Ie))},Te=ke=>{const Ie=React$2.useContext(ye)[ke],[Ne,je]=React$2.useState(curry1to0(getValue,Ie));return useIsomorphicLayoutEffect$1(()=>subscribe(Ie,ze=>{ze!==Ne&&je(always(ze))}),[Ie,Ne]),Ne},Re=React$2.version.startsWith("18")?$e:Te;return{Component:we,usePublisher:Se,useEmitterValue:Re,useEmitter:(ke,Be)=>{const Ne=React$2.useContext(ye)[ke];useIsomorphicLayoutEffect$1(()=>subscribe(Ne,Be),[Be,Ne])}}}const useIsomorphicLayoutEffect=typeof document<"u"?React$2.useLayoutEffect:React$2.useEffect;var LogLevel=(ne=>(ne[ne.DEBUG=0]="DEBUG",ne[ne.INFO=1]="INFO",ne[ne.WARN=2]="WARN",ne[ne.ERROR=3]="ERROR",ne))(LogLevel||{});const CONSOLE_METHOD_MAP={0:"debug",1:"log",2:"warn",3:"error"},getGlobalThis=()=>typeof globalThis>"u"?window:globalThis,loggerSystem=system(()=>{const ne=statefulStream(3);return{log:statefulStream((ce,ue,pe=1)=>{var me;const ge=(me=getGlobalThis().VIRTUOSO_LOG_LEVEL)!=null?me:getValue(ne);pe>=ge&&console[CONSOLE_METHOD_MAP[pe]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",ce,ue)}),logLevel:ne}},[],{singleton:!0});function useSizeWithElRef(ne,oe,ce){const ue=React$2.useRef(null);let pe=me=>{};if(typeof ResizeObserver<"u"){const me=React$2.useMemo(()=>new ResizeObserver(ge=>{const ye=()=>{const xe=ge[0].target;xe.offsetParent!==null&&ne(xe)};ce?ye():requestAnimationFrame(ye)}),[ne]);pe=ge=>{ge&&oe?(me.observe(ge),ue.current=ge):(ue.current&&me.unobserve(ue.current),ue.current=null)}}return{ref:ue,callbackRef:pe}}function useSize(ne,oe,ce){return useSizeWithElRef(ne,oe,ce).callbackRef}function useChangedListContentsSizes(ne,oe,ce,ue,pe,me,ge,ye,xe){const ve=React$2.useCallback(_e=>{const we=getChangedChildSizes(_e.children,oe,ye?"offsetWidth":"offsetHeight",pe);let Se=_e.parentElement;for(;!Se.dataset.virtuosoScroller;)Se=Se.parentElement;const $e=Se.lastElementChild.dataset.viewportType==="window",Te=ge?ye?ge.scrollLeft:ge.scrollTop:$e?ye?window.pageXOffset||document.documentElement.scrollLeft:window.pageYOffset||document.documentElement.scrollTop:ye?Se.scrollLeft:Se.scrollTop,Re=ge?ye?ge.scrollWidth:ge.scrollHeight:$e?ye?document.documentElement.scrollWidth:document.documentElement.scrollHeight:ye?Se.scrollWidth:Se.scrollHeight,Ae=ge?ye?ge.offsetWidth:ge.offsetHeight:$e?ye?window.innerWidth:window.innerHeight:ye?Se.offsetWidth:Se.offsetHeight;ue({scrollTop:Math.max(Te,0),scrollHeight:Re,viewportHeight:Ae}),me==null||me(ye?resolveGapValue$1("column-gap",getComputedStyle(_e).columnGap,pe):resolveGapValue$1("row-gap",getComputedStyle(_e).rowGap,pe)),we!==null&&ne(we)},[ne,oe,pe,me,ge,ue]);return useSizeWithElRef(ve,ce,xe)}function getChangedChildSizes(ne,oe,ce,ue){const pe=ne.length;if(pe===0)return null;const me=[];for(let ge=0;ge{const $e=Se.target,Te=$e===window||$e===document,Re=me?Te?window.pageXOffset||document.documentElement.scrollLeft:$e.scrollLeft:Te?window.pageYOffset||document.documentElement.scrollTop:$e.scrollTop,Ae=me?Te?document.documentElement.scrollWidth:$e.scrollWidth:Te?document.documentElement.scrollHeight:$e.scrollHeight,ke=me?Te?window.innerWidth:$e.offsetWidth:Te?window.innerHeight:$e.offsetHeight,Be=()=>{ne({scrollTop:Math.max(Re,0),scrollHeight:Ae,viewportHeight:ke})};Se.suppressFlushSync?Be():ReactDOM$1.flushSync(Be),ye.current!==null&&(Re===ye.current||Re<=0||Re===Ae-ke)&&(ye.current=null,oe(!0),xe.current&&(clearTimeout(xe.current),xe.current=null))},[ne,oe]);React$2.useEffect(()=>{const Se=pe||ge.current;return ue(pe||ge.current),ve({target:Se,suppressFlushSync:!0}),Se.addEventListener("scroll",ve,{passive:!0}),()=>{ue(null),Se.removeEventListener("scroll",ve)}},[ge,ve,ce,ue,pe]);function _e(Se){const $e=ge.current;if(!$e||(me?"offsetWidth"in $e&&$e.offsetWidth===0:"offsetHeight"in $e&&$e.offsetHeight===0))return;const Te=Se.behavior==="smooth";let Re,Ae,ke;$e===window?(Ae=Math.max(correctItemSize(document.documentElement,me?"width":"height"),me?document.documentElement.scrollWidth:document.documentElement.scrollHeight),Re=me?window.innerWidth:window.innerHeight,ke=me?document.documentElement.scrollLeft:document.documentElement.scrollTop):(Ae=$e[me?"scrollWidth":"scrollHeight"],Re=correctItemSize($e,me?"width":"height"),ke=$e[me?"scrollLeft":"scrollTop"]);const Be=Ae-Re;if(Se.top=Math.ceil(Math.max(Math.min(Be,Se.top),0)),approximatelyEqual(Re,Ae)||Se.top===ke){ne({scrollTop:ke,scrollHeight:Ae,viewportHeight:Re}),Te&&oe(!0);return}Te?(ye.current=Se.top,xe.current&&clearTimeout(xe.current),xe.current=setTimeout(()=>{xe.current=null,ye.current=null,oe(!0)},1e3)):ye.current=null,me&&(Se={left:Se.top,behavior:Se.behavior}),$e.scrollTo(Se)}function we(Se){me&&(Se={left:Se.top,behavior:Se.behavior}),ge.current.scrollBy(Se)}return{scrollerRef:ge,scrollByCallback:we,scrollToCallback:_e}}const domIOSystem=system(()=>{const ne=stream$1(),oe=stream$1(),ce=statefulStream(0),ue=stream$1(),pe=statefulStream(0),me=stream$1(),ge=stream$1(),ye=statefulStream(0),xe=statefulStream(0),ve=statefulStream(0),_e=statefulStream(0),we=stream$1(),Se=stream$1(),$e=statefulStream(!1),Te=statefulStream(!1),Re=statefulStream(!1);return connect(pipe(ne,map$1(({scrollTop:Ae})=>Ae)),oe),connect(pipe(ne,map$1(({scrollHeight:Ae})=>Ae)),ge),connect(oe,pe),{scrollContainerState:ne,scrollTop:oe,viewportHeight:me,headerHeight:ye,fixedHeaderHeight:xe,fixedFooterHeight:ve,footerHeight:_e,scrollHeight:ge,smoothScrollTargetReached:ue,horizontalDirection:Te,skipAnimationFrameInResizeObserver:Re,scrollTo:we,scrollBy:Se,statefulScrollTop:pe,deviation:ce,scrollingInProgress:$e}},[],{singleton:!0}),NIL_NODE={lvl:0};function newAANode(ne,oe,ce,ue=NIL_NODE,pe=NIL_NODE){return{k:ne,v:oe,lvl:ce,l:ue,r:pe}}function empty(ne){return ne===NIL_NODE}function newTree(){return NIL_NODE}function remove(ne,oe){if(empty(ne))return NIL_NODE;const{k:ce,l:ue,r:pe}=ne;if(oe===ce){if(empty(ue))return pe;if(empty(pe))return ue;{const[me,ge]=last(ue);return adjust(clone$1(ne,{k:me,v:ge,l:deleteLast(ue)}))}}else return oeoe&&(ye=ye.concat(walkWithin(me,oe,ce))),ue>=oe&&ue<=ce&&ye.push({k:ue,v:pe}),ue<=ce&&(ye=ye.concat(walkWithin(ge,oe,ce))),ye}function walk(ne){return empty(ne)?[]:[...walk(ne.l),{k:ne.k,v:ne.v},...walk(ne.r)]}function last(ne){return empty(ne.r)?[ne.k,ne.v]:last(ne.r)}function deleteLast(ne){return empty(ne.r)?ne.l:adjust(clone$1(ne,{r:deleteLast(ne.r)}))}function clone$1(ne,oe){return newAANode(oe.k!==void 0?oe.k:ne.k,oe.v!==void 0?oe.v:ne.v,oe.lvl!==void 0?oe.lvl:ne.lvl,oe.l!==void 0?oe.l:ne.l,oe.r!==void 0?oe.r:ne.r)}function isSingle(ne){return empty(ne)||ne.lvl>ne.r.lvl}function rebalance(ne){return split(skew(ne))}function adjust(ne){const{l:oe,r:ce,lvl:ue}=ne;if(ce.lvl>=ue-1&&oe.lvl>=ue-1)return ne;if(ue>ce.lvl+1){if(isSingle(oe))return skew(clone$1(ne,{lvl:ue-1}));if(!empty(oe)&&!empty(oe.r))return clone$1(oe.r,{l:clone$1(oe,{r:oe.r.l}),r:clone$1(ne,{l:oe.r.r,lvl:ue-1}),lvl:ue});throw new Error("Unexpected empty nodes")}else{if(isSingle(ne))return split(clone$1(ne,{lvl:ue-1}));if(!empty(ce)&&!empty(ce.l)){const pe=ce.l,me=isSingle(pe)?ce.lvl-1:ce.lvl;return clone$1(pe,{l:clone$1(ne,{r:pe.l,lvl:ue-1}),r:split(clone$1(ce,{l:pe.r,lvl:me})),lvl:pe.lvl+1})}else throw new Error("Unexpected empty nodes")}}function rangesWithin(ne,oe,ce){if(empty(ne))return[];const ue=findMaxKeyValue(ne,oe)[0];return toRanges(walkWithin(ne,ue,ce))}function arrayToRanges(ne,oe){const ce=ne.length;if(ce===0)return[];let{index:ue,value:pe}=oe(ne[0]);const me=[];for(let ge=1;ge({index:oe,value:ce}))}function split(ne){const{r:oe,lvl:ce}=ne;return!empty(oe)&&!empty(oe.r)&&oe.lvl===ce&&oe.r.lvl===ce?clone$1(oe,{l:clone$1(ne,{r:oe.l}),lvl:ce+1}):ne}function skew(ne){const{l:oe}=ne;return!empty(oe)&&oe.lvl===ne.lvl?clone$1(oe,{r:clone$1(ne,{l:oe.r})}):ne}function findIndexOfClosestSmallerOrEqual(ne,oe,ce,ue=0){let pe=ne.length-1;for(;ue<=pe;){const me=Math.floor((ue+pe)/2),ge=ne[me],ye=ce(ge,oe);if(ye===0)return me;if(ye===-1){if(pe-ue<2)return me-1;pe=me-1}else{if(pe===ue)return me;ue=me+1}}throw new Error(`Failed binary finding record in array - ${ne.join(",")}, searched for ${oe}`)}function findClosestSmallerOrEqual(ne,oe,ce){return ne[findIndexOfClosestSmallerOrEqual(ne,oe,ce)]}function findRange(ne,oe,ce,ue){const pe=findIndexOfClosestSmallerOrEqual(ne,oe,ue),me=findIndexOfClosestSmallerOrEqual(ne,ce,ue,pe);return ne.slice(pe,me+1)}const recalcSystem=system(()=>({recalcInProgress:statefulStream(!1)}),[],{singleton:!0});function rangeIncludes(ne){const{size:oe,startIndex:ce,endIndex:ue}=ne;return pe=>pe.start===ce&&(pe.end===ue||pe.end===1/0)&&pe.value===oe}function affectedGroupCount(ne,oe){let ce=0,ue=0;for(;ce=_e||pe===Se)&&(ne=remove(ne,_e)):(ve=Se!==pe,xe=!0),we>ge&&ge>=_e&&Se!==pe&&(ne=insert(ne,ge+1,Se));ve&&(ne=insert(ne,me,pe))}return[ne,ce]}function initialSizeState(){return{offsetTree:[],sizeTree:newTree(),groupOffsetTree:newTree(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function indexComparator({index:ne},oe){return oe===ne?0:oe0&&(oe=Math.max(oe,findClosestSmallerOrEqual(ne,ue,indexComparator).offset)),arrayToRanges(findRange(ne,oe,ce,offsetComparator),offsetPointParser)}function createOffsetTree(ne,oe,ce,ue){let pe=ne,me=0,ge=0,ye=0,xe=0;if(oe!==0){xe=findIndexOfClosestSmallerOrEqual(pe,oe-1,indexComparator),ye=pe[xe].offset;const _e=findMaxKeyValue(ce,oe-1);me=_e[0],ge=_e[1],pe.length&&pe[xe].size===findMaxKeyValue(ce,oe)[1]&&(xe-=1),pe=pe.slice(0,xe+1)}else pe=[];for(const{start:ve,value:_e}of rangesWithin(ce,oe,1/0)){const we=ve-me,Se=we*ge+ye+we*ue;pe.push({offset:Se,size:_e,index:ve}),me=ve,ye=Se,ge=_e}return{offsetTree:pe,lastIndex:me,lastOffset:ye,lastSize:ge}}function sizeStateReducer(ne,[oe,ce,ue,pe]){oe.length>0&&ue("received item sizes",oe,LogLevel.DEBUG);const me=ne.sizeTree;let ge=me,ye=0;if(ce.length>0&&empty(me)&&oe.length===2){const Se=oe[0].size,$e=oe[1].size;ge=ce.reduce((Te,Re)=>insert(insert(Te,Re,Se),Re+1,$e),ge)}else[ge,ye]=insertRanges(ge,oe);if(ge===me)return ne;const{offsetTree:xe,lastIndex:ve,lastSize:_e,lastOffset:we}=createOffsetTree(ne.offsetTree,ye,ge,pe);return{sizeTree:ge,offsetTree:xe,lastIndex:ve,lastOffset:we,lastSize:_e,groupOffsetTree:ce.reduce((Se,$e)=>insert(Se,$e,offsetOf($e,xe,pe)),newTree()),groupIndices:ce}}function offsetOf(ne,oe,ce){if(oe.length===0)return 0;const{offset:ue,index:pe,size:me}=findClosestSmallerOrEqual(oe,ne,indexComparator),ge=ne-pe,ye=me*ge+(ge-1)*ce+ue;return ye>0?ye+ce:ye}function isGroupLocation(ne){return typeof ne.groupIndex<"u"}function originalIndexFromLocation(ne,oe,ce){if(isGroupLocation(ne))return oe.groupIndices[ne.groupIndex]+1;{const ue=ne.index==="LAST"?ce:ne.index;let pe=originalIndexFromItemIndex(ue,oe);return pe=Math.max(0,pe,Math.min(ce,pe)),pe}}function originalIndexFromItemIndex(ne,oe){if(!hasGroups(oe))return ne;let ce=0;for(;oe.groupIndices[ce]<=ne+ce;)ce++;return ne+ce}function hasGroups(ne){return!empty(ne.groupOffsetTree)}function sizeTreeToRanges(ne){return walk(ne).map(({k:oe,v:ce},ue,pe)=>{const me=pe[ue+1],ge=me?me.k-1:1/0;return{startIndex:oe,endIndex:ge,size:ce}})}const SIZE_MAP={offsetHeight:"height",offsetWidth:"width"},sizeSystem=system(([{log:ne},{recalcInProgress:oe}])=>{const ce=stream$1(),ue=stream$1(),pe=statefulStreamFromEmitter(ue,0),me=stream$1(),ge=stream$1(),ye=statefulStream(0),xe=statefulStream([]),ve=statefulStream(void 0),_e=statefulStream(void 0),we=statefulStream((je,ze)=>correctItemSize(je,SIZE_MAP[ze])),Se=statefulStream(void 0),$e=statefulStream(0),Te=initialSizeState(),Re=statefulStreamFromEmitter(pipe(ce,withLatestFrom(xe,ne,$e),scan$1(sizeStateReducer,Te),distinctUntilChanged()),Te),Ae=statefulStreamFromEmitter(pipe(xe,distinctUntilChanged(),scan$1((je,ze)=>({prev:je.current,current:ze}),{prev:[],current:[]}),map$1(({prev:je})=>je)),[]);connect(pipe(xe,filter(je=>je.length>0),withLatestFrom(Re,$e),map$1(([je,ze,Ue])=>{const qe=je.reduce((Ke,Ge,Ye)=>insert(Ke,Ge,offsetOf(Ge,ze.offsetTree,Ue)||Ye),newTree());return{...ze,groupIndices:je,groupOffsetTree:qe}})),Re),connect(pipe(ue,withLatestFrom(Re),filter(([je,{lastIndex:ze}])=>je[{startIndex:je,endIndex:ze,size:Ue}])),ce),connect(ve,_e);const ke=statefulStreamFromEmitter(pipe(ve,map$1(je=>je===void 0)),!0);connect(pipe(_e,filter(je=>je!==void 0&&empty(getValue(Re).sizeTree)),map$1(je=>[{startIndex:0,endIndex:0,size:je}])),ce);const Be=streamFromEmitter(pipe(ce,withLatestFrom(Re),scan$1(({sizes:je},[ze,Ue])=>({changed:Ue!==je,sizes:Ue}),{changed:!1,sizes:Te}),map$1(je=>je.changed)));subscribe(pipe(ye,scan$1((je,ze)=>({diff:je.prev-ze,prev:ze}),{diff:0,prev:0}),map$1(je=>je.diff)),je=>{const{groupIndices:ze}=getValue(Re);if(je>0)publish(oe,!0),publish(me,je+affectedGroupCount(je,ze));else if(je<0){const Ue=getValue(Ae);Ue.length>0&&(je-=affectedGroupCount(-je,Ue)),publish(ge,je)}}),subscribe(pipe(ye,withLatestFrom(ne)),([je,ze])=>{je<0&&ze("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:ye},LogLevel.ERROR)});const Ie=streamFromEmitter(me);connect(pipe(me,withLatestFrom(Re),map$1(([je,ze])=>{const Ue=ze.groupIndices.length>0,qe=[],Ke=ze.lastSize;if(Ue){const Ge=find(ze.sizeTree,0);let Ye=0,Xe=0;for(;Ye{let Gt=Ze.ranges;return Ze.prevSize!==0&&(Gt=[...Ze.ranges,{startIndex:Ze.prevIndex,endIndex:Tt+je-1,size:Ze.prevSize}]),{ranges:Gt,prevIndex:Tt+je,prevSize:Ut}},{ranges:qe,prevIndex:je,prevSize:0}).ranges}return walk(ze.sizeTree).reduce((Ge,{k:Ye,v:Xe})=>({ranges:[...Ge.ranges,{startIndex:Ge.prevIndex,endIndex:Ye+je-1,size:Ge.prevSize}],prevIndex:Ye+je,prevSize:Xe}),{ranges:[],prevIndex:0,prevSize:Ke}).ranges})),ce);const Ne=streamFromEmitter(pipe(ge,withLatestFrom(Re,$e),map$1(([je,{offsetTree:ze},Ue])=>{const qe=-je;return offsetOf(qe,ze,Ue)})));return connect(pipe(ge,withLatestFrom(Re,$e),map$1(([je,ze,Ue])=>{if(ze.groupIndices.length>0){if(empty(ze.sizeTree))return ze;let Ke=newTree();const Ge=getValue(Ae);let Ye=0,Xe=0,Je=0;for(;Ye<-je;){Je=Ge[Xe];const Ze=Ge[Xe+1]-Je-1;Xe++,Ye+=Ze+1}if(Ke=walk(ze.sizeTree).reduce((Ze,{k:Tt,v:Ut})=>insert(Ze,Math.max(0,Tt+je),Ut),Ke),Ye!==-je){const Ze=find(ze.sizeTree,Je);Ke=insert(Ke,0,Ze);const Tt=findMaxKeyValue(ze.sizeTree,-je+1)[1];Ke=insert(Ke,1,Tt)}return{...ze,sizeTree:Ke,...createOffsetTree(ze.offsetTree,0,Ke,Ue)}}else{const Ke=walk(ze.sizeTree).reduce((Ge,{k:Ye,v:Xe})=>insert(Ge,Math.max(0,Ye+je),Xe),newTree());return{...ze,sizeTree:Ke,...createOffsetTree(ze.offsetTree,0,Ke,Ue)}}})),Re),{data:Se,totalCount:ue,sizeRanges:ce,groupIndices:xe,defaultItemSize:_e,fixedItemSize:ve,unshiftWith:me,shiftWith:ge,shiftWithOffset:Ne,beforeUnshiftWith:Ie,firstItemIndex:ye,gap:$e,sizes:Re,listRefresh:Be,statefulTotalCount:pe,trackItemSizes:ke,itemSize:we}},tup(loggerSystem,recalcSystem),{singleton:!0}),SUPPORTS_SCROLL_TO_OPTIONS=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function normalizeIndexLocation(ne){const oe=typeof ne=="number"?{index:ne}:ne;return oe.align||(oe.align="start"),(!oe.behavior||!SUPPORTS_SCROLL_TO_OPTIONS)&&(oe.behavior="auto"),oe.offset||(oe.offset=0),oe}const scrollToIndexSystem=system(([{sizes:ne,totalCount:oe,listRefresh:ce,gap:ue},{scrollingInProgress:pe,viewportHeight:me,scrollTo:ge,smoothScrollTargetReached:ye,headerHeight:xe,footerHeight:ve,fixedHeaderHeight:_e,fixedFooterHeight:we},{log:Se}])=>{const $e=stream$1(),Te=stream$1(),Re=statefulStream(0);let Ae=null,ke=null,Be=null;function Ie(){Ae&&(Ae(),Ae=null),Be&&(Be(),Be=null),ke&&(clearTimeout(ke),ke=null),publish(pe,!1)}return connect(pipe($e,withLatestFrom(ne,me,oe,Re,xe,ve,Se),withLatestFrom(ue,_e,we),map$1(([[Ne,je,ze,Ue,qe,Ke,Ge,Ye],Xe,Je,Qe])=>{const Ze=normalizeIndexLocation(Ne),{align:Tt,behavior:Ut,offset:Gt}=Ze,Nt=Ue-1,Wt=originalIndexFromLocation(Ze,je,Nt);let Mt=offsetOf(Wt,je.offsetTree,Xe)+Ke;Tt==="end"?(Mt+=Je+findMaxKeyValue(je.sizeTree,Wt)[1]-ze+Qe,Wt===Nt&&(Mt+=Ge)):Tt==="center"?Mt+=(Je+findMaxKeyValue(je.sizeTree,Wt)[1]-ze+Qe)/2:Mt-=qe,Gt&&(Mt+=Gt);const Yt=ir=>{Ie(),ir?(Ye("retrying to scroll to",{location:Ne},LogLevel.DEBUG),publish($e,Ne)):(publish(Te,!0),Ye("list did not change, scroll successful",{},LogLevel.DEBUG))};if(Ie(),Ut==="smooth"){let ir=!1;Be=subscribe(ce,tr=>{ir=ir||tr}),Ae=handleNext(ye,()=>{Yt(ir)})}else Ae=handleNext(pipe(ce,watchChangesFor(150)),Yt);return ke=setTimeout(()=>{Ie()},1200),publish(pe,!0),Ye("scrolling from index to",{index:Wt,top:Mt,behavior:Ut},LogLevel.DEBUG),{top:Mt,behavior:Ut}})),ge),{scrollToIndex:$e,scrollTargetReached:Te,topListHeight:Re}},tup(sizeSystem,domIOSystem,loggerSystem),{singleton:!0});function watchChangesFor(ne){return oe=>{const ce=setTimeout(()=>{oe(!1)},ne);return ue=>{ue&&(oe(!0),clearTimeout(ce))}}}const UP="up",DOWN="down",NONE$1="none",INITIAL_BOTTOM_STATE={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},DEFAULT_AT_TOP_THRESHOLD=0,stateFlagsSystem=system(([{scrollContainerState:ne,scrollTop:oe,viewportHeight:ce,headerHeight:ue,footerHeight:pe,scrollBy:me}])=>{const ge=statefulStream(!1),ye=statefulStream(!0),xe=stream$1(),ve=stream$1(),_e=statefulStream(4),we=statefulStream(DEFAULT_AT_TOP_THRESHOLD),Se=statefulStreamFromEmitter(pipe(merge(pipe(duc(oe),skip(1),mapTo(!0)),pipe(duc(oe),skip(1),mapTo(!1),debounceTime(100))),distinctUntilChanged()),!1),$e=statefulStreamFromEmitter(pipe(merge(pipe(me,mapTo(!0)),pipe(me,mapTo(!1),debounceTime(200))),distinctUntilChanged()),!1);connect(pipe(combineLatest(duc(oe),duc(we)),map$1(([Be,Ie])=>Be<=Ie),distinctUntilChanged()),ye),connect(pipe(ye,throttleTime(50)),ve);const Te=streamFromEmitter(pipe(combineLatest(ne,duc(ce),duc(ue),duc(pe),duc(_e)),scan$1((Be,[{scrollTop:Ie,scrollHeight:Ne},je,ze,Ue,qe])=>{const Ke=Ie+je-Ne>-qe,Ge={viewportHeight:je,scrollTop:Ie,scrollHeight:Ne};if(Ke){let Xe,Je;return Ie>Be.state.scrollTop?(Xe="SCROLLED_DOWN",Je=Be.state.scrollTop-Ie):(Xe="SIZE_DECREASED",Je=Be.state.scrollTop-Ie||Be.scrollTopDelta),{atBottom:!0,state:Ge,atBottomBecause:Xe,scrollTopDelta:Je}}let Ye;return Ge.scrollHeight>Be.state.scrollHeight?Ye="SIZE_INCREASED":jeBe&&Be.atBottom===Ie.atBottom))),Re=statefulStreamFromEmitter(pipe(ne,scan$1((Be,{scrollTop:Ie,scrollHeight:Ne,viewportHeight:je})=>{if(approximatelyEqual(Be.scrollHeight,Ne))return{scrollTop:Ie,scrollHeight:Ne,jump:0,changed:!1};{const ze=Ne-(Ie+je)<1;return Be.scrollTop!==Ie&&ze?{scrollHeight:Ne,scrollTop:Ie,jump:Be.scrollTop-Ie,changed:!0}:{scrollHeight:Ne,scrollTop:Ie,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),filter(Be=>Be.changed),map$1(Be=>Be.jump)),0);connect(pipe(Te,map$1(Be=>Be.atBottom)),ge),connect(pipe(ge,throttleTime(50)),xe);const Ae=statefulStream(DOWN);connect(pipe(ne,map$1(({scrollTop:Be})=>Be),distinctUntilChanged(),scan$1((Be,Ie)=>getValue($e)?{direction:Be.direction,prevScrollTop:Ie}:{direction:IeBe.direction)),Ae),connect(pipe(ne,throttleTime(50),mapTo(NONE$1)),Ae);const ke=statefulStream(0);return connect(pipe(Se,filter(Be=>!Be),mapTo(0)),ke),connect(pipe(oe,throttleTime(100),withLatestFrom(Se),filter(([Be,Ie])=>!!Ie),scan$1(([Be,Ie],[Ne])=>[Ie,Ne],[0,0]),map$1(([Be,Ie])=>Ie-Be)),ke),{isScrolling:Se,isAtTop:ye,isAtBottom:ge,atBottomState:Te,atTopStateChange:ve,atBottomStateChange:xe,scrollDirection:Ae,atBottomThreshold:_e,atTopThreshold:we,scrollVelocity:ke,lastJumpDueToItemResize:Re}},tup(domIOSystem)),propsReadySystem=system(([{log:ne}])=>{const oe=statefulStream(!1),ce=streamFromEmitter(pipe(oe,filter(ue=>ue),distinctUntilChanged()));return subscribe(oe,ue=>{ue&&getValue(ne)("props updated",{},LogLevel.DEBUG)}),{propsReady:oe,didMount:ce}},tup(loggerSystem),{singleton:!0});function skipFrames(ne,oe){ne==0?oe():requestAnimationFrame(()=>skipFrames(ne-1,oe))}function getInitialTopMostItemIndexNumber(ne,oe){const ce=oe-1;return typeof ne=="number"?ne:ne.index==="LAST"?ce:ne.index}const initialTopMostItemIndexSystem=system(([{sizes:ne,listRefresh:oe,defaultItemSize:ce},{scrollTop:ue},{scrollToIndex:pe,scrollTargetReached:me},{didMount:ge}])=>{const ye=statefulStream(!0),xe=statefulStream(0),ve=statefulStream(!0);return connect(pipe(ge,withLatestFrom(xe),filter(([_e,we])=>!!we),mapTo(!1)),ye),connect(pipe(ge,withLatestFrom(xe),filter(([_e,we])=>!!we),mapTo(!1)),ve),subscribe(pipe(combineLatest(oe,ge),withLatestFrom(ye,ne,ce,ve),filter(([[,_e],we,{sizeTree:Se},$e,Te])=>_e&&(!empty(Se)||isDefined($e))&&!we&&!Te),withLatestFrom(xe)),([,_e])=>{handleNext(me,()=>{publish(ve,!0)}),skipFrames(4,()=>{handleNext(ue,()=>{publish(ye,!0)}),publish(pe,_e)})}),{scrolledToInitialItem:ye,initialTopMostItemIndex:xe,initialItemFinalLocationReached:ve}},tup(sizeSystem,domIOSystem,scrollToIndexSystem,propsReadySystem),{singleton:!0});function normalizeFollowOutput(ne){return ne?ne==="smooth"?"smooth":"auto":!1}const behaviorFromFollowOutput=(ne,oe)=>typeof ne=="function"?normalizeFollowOutput(ne(oe)):oe&&normalizeFollowOutput(ne),followOutputSystem=system(([{totalCount:ne,listRefresh:oe},{isAtBottom:ce,atBottomState:ue},{scrollToIndex:pe},{scrolledToInitialItem:me},{propsReady:ge,didMount:ye},{log:xe},{scrollingInProgress:ve}])=>{const _e=statefulStream(!1),we=stream$1();let Se=null;function $e(Re){publish(pe,{index:"LAST",align:"end",behavior:Re})}subscribe(pipe(combineLatest(pipe(duc(ne),skip(1)),ye),withLatestFrom(duc(_e),ce,me,ve),map$1(([[Re,Ae],ke,Be,Ie,Ne])=>{let je=Ae&&Ie,ze="auto";return je&&(ze=behaviorFromFollowOutput(ke,Be||Ne),je=je&&!!ze),{totalCount:Re,shouldFollow:je,followOutputBehavior:ze}}),filter(({shouldFollow:Re})=>Re)),({totalCount:Re,followOutputBehavior:Ae})=>{Se&&(Se(),Se=null),Se=handleNext(oe,()=>{getValue(xe)("following output to ",{totalCount:Re},LogLevel.DEBUG),$e(Ae),Se=null})});function Te(Re){const Ae=handleNext(ue,ke=>{Re&&!ke.atBottom&&ke.notAtBottomBecause==="SIZE_INCREASED"&&!Se&&(getValue(xe)("scrolling to bottom due to increased size",{},LogLevel.DEBUG),$e("auto"))});setTimeout(Ae,100)}return subscribe(pipe(combineLatest(duc(_e),ne,ge),filter(([Re,,Ae])=>Re&&Ae),scan$1(({value:Re},[,Ae])=>({refreshed:Re===Ae,value:Ae}),{refreshed:!1,value:0}),filter(({refreshed:Re})=>Re),withLatestFrom(_e,ne)),([,Re])=>{getValue(me)&&Te(Re!==!1)}),subscribe(we,()=>{Te(getValue(_e)!==!1)}),subscribe(combineLatest(duc(_e),ue),([Re,Ae])=>{Re&&!Ae.atBottom&&Ae.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&$e("auto")}),{followOutput:_e,autoscrollToBottom:we}},tup(sizeSystem,stateFlagsSystem,scrollToIndexSystem,initialTopMostItemIndexSystem,propsReadySystem,loggerSystem,domIOSystem));function groupCountsToIndicesAndCount(ne){return ne.reduce((oe,ce)=>(oe.groupIndices.push(oe.totalCount),oe.totalCount+=ce+1,oe),{totalCount:0,groupIndices:[]})}const groupedListSystem=system(([{totalCount:ne,groupIndices:oe,sizes:ce},{scrollTop:ue,headerHeight:pe}])=>{const me=stream$1(),ge=stream$1(),ye=streamFromEmitter(pipe(me,map$1(groupCountsToIndicesAndCount)));return connect(pipe(ye,map$1(xe=>xe.totalCount)),ne),connect(pipe(ye,map$1(xe=>xe.groupIndices)),oe),connect(pipe(combineLatest(ue,ce,pe),filter(([xe,ve])=>hasGroups(ve)),map$1(([xe,ve,_e])=>findMaxKeyValue(ve.groupOffsetTree,Math.max(xe-_e,0),"v")[0]),distinctUntilChanged(),map$1(xe=>[xe])),ge),{groupCounts:me,topItemsIndexes:ge}},tup(sizeSystem,domIOSystem));function tupleComparator(ne,oe){return!!(ne&&ne[0]===oe[0]&&ne[1]===oe[1])}function rangeComparator(ne,oe){return!!(ne&&ne.startIndex===oe.startIndex&&ne.endIndex===oe.endIndex)}const TOP="top",BOTTOM="bottom",NONE="none";function getOverscan(ne,oe,ce){return typeof ne=="number"?ce===UP&&oe===TOP||ce===DOWN&&oe===BOTTOM?ne:0:ce===UP?oe===TOP?ne.main:ne.reverse:oe===BOTTOM?ne.main:ne.reverse}function getViewportIncrease(ne,oe){return typeof ne=="number"?ne:ne[oe]||0}const sizeRangeSystem=system(([{scrollTop:ne,viewportHeight:oe,deviation:ce,headerHeight:ue,fixedHeaderHeight:pe}])=>{const me=stream$1(),ge=statefulStream(0),ye=statefulStream(0),xe=statefulStream(0),ve=statefulStreamFromEmitter(pipe(combineLatest(duc(ne),duc(oe),duc(ue),duc(me,tupleComparator),duc(xe),duc(ge),duc(pe),duc(ce),duc(ye)),map$1(([_e,we,Se,[$e,Te],Re,Ae,ke,Be,Ie])=>{const Ne=_e-Be,je=Ae+ke,ze=Math.max(Se-Ne,0);let Ue=NONE;const qe=getViewportIncrease(Ie,TOP),Ke=getViewportIncrease(Ie,BOTTOM);return $e-=Be,$e+=Se+ke,Te+=Se+ke,Te-=Be,$e>_e+je-qe&&(Ue=UP),Te<_e-ze+we+Ke&&(Ue=DOWN),Ue!==NONE?[Math.max(Ne-Se-getOverscan(Re,TOP,Ue)-qe,0),Ne-ze-ke+we+getOverscan(Re,BOTTOM,Ue)+Ke]:null}),filter(_e=>_e!=null),distinctUntilChanged(tupleComparator)),[0,0]);return{listBoundary:me,overscan:xe,topListHeight:ge,increaseViewportBy:ye,visibleRange:ve}},tup(domIOSystem),{singleton:!0});function probeItemSet(ne,oe,ce){if(hasGroups(oe)){const ue=originalIndexFromItemIndex(ne,oe);return[{index:findMaxKeyValue(oe.groupOffsetTree,ue)[0],size:0,offset:0},{index:ue,size:0,offset:0,data:ce&&ce[0]}]}return[{index:ne,size:0,offset:0,data:ce&&ce[0]}]}const EMPTY_LIST_STATE={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function transposeItems(ne,oe,ce){if(ne.length===0)return[];if(!hasGroups(oe))return ne.map(ve=>({...ve,index:ve.index+ce,originalIndex:ve.index}));const ue=ne[0].index,pe=ne[ne.length-1].index,me=[],ge=rangesWithin(oe.groupOffsetTree,ue,pe);let ye,xe=0;for(const ve of ne){(!ye||ye.end0){ve=ne[0].offset;const Re=ne[ne.length-1];_e=Re.offset+Re.size}const we=ce-xe,Se=ye+we*ge+(we-1)*ue,$e=ve,Te=Se-_e;return{items:transposeItems(ne,pe,me),topItems:transposeItems(oe,pe,me),topListHeight:oe.reduce((Re,Ae)=>Ae.size+Re,0),offsetTop:ve,offsetBottom:Te,top:$e,bottom:_e,totalCount:ce,firstItemIndex:me}}function buildListStateFromItemCount(ne,oe,ce,ue,pe,me){let ge=0;if(ce.groupIndices.length>0)for(const _e of ce.groupIndices){if(_e-ge>=ne)break;ge++}const ye=ne+ge,xe=getInitialTopMostItemIndexNumber(oe,ye),ve=Array.from({length:ye}).map((_e,we)=>({index:we+xe,size:0,offset:0,data:me[we+xe]}));return buildListState(ve,[],ye,pe,ce,ue)}const listStateSystem=system(([{sizes:ne,totalCount:oe,data:ce,firstItemIndex:ue,gap:pe},me,{visibleRange:ge,listBoundary:ye,topListHeight:xe},{scrolledToInitialItem:ve,initialTopMostItemIndex:_e},{topListHeight:we},Se,{didMount:$e},{recalcInProgress:Te}])=>{const Re=statefulStream([]),Ae=statefulStream(0),ke=stream$1();connect(me.topItemsIndexes,Re);const Be=statefulStreamFromEmitter(pipe(combineLatest($e,Te,duc(ge,tupleComparator),duc(oe),duc(ne),duc(_e),ve,duc(Re),duc(ue),duc(pe),ce),filter(([ze,Ue,,qe,,,,,,,Ke])=>{const Ge=Ke&&Ke.length!==qe;return ze&&!Ue&&!Ge}),map$1(([,,[ze,Ue],qe,Ke,Ge,Ye,Xe,Je,Qe,Ze])=>{const Tt=Ke,{sizeTree:Ut,offsetTree:Gt}=Tt,Nt=getValue(Ae);if(qe===0)return{...EMPTY_LIST_STATE,totalCount:qe};if(ze===0&&Ue===0)return Nt===0?{...EMPTY_LIST_STATE,totalCount:qe}:buildListStateFromItemCount(Nt,Ge,Ke,Je,Qe,Ze||[]);if(empty(Ut))return Nt>0?null:buildListState(probeItemSet(getInitialTopMostItemIndexNumber(Ge,qe),Tt,Ze),[],qe,Qe,Tt,Je);const Wt=[];if(Xe.length>0){const Qt=Xe[0],er=Xe[Xe.length-1];let hr=0;for(const cr of rangesWithin(Ut,Qt,er)){const gr=cr.value,ar=Math.max(cr.start,Qt),Pt=Math.min(cr.end,er);for(let or=ar;or<=Pt;or++)Wt.push({index:or,size:gr,offset:hr,data:Ze&&Ze[or]}),hr+=gr}}if(!Ye)return buildListState([],Wt,qe,Qe,Tt,Je);const Mt=Xe.length>0?Xe[Xe.length-1]+1:0,Yt=rangesWithinOffsets(Gt,ze,Ue,Mt);if(Yt.length===0)return null;const ir=qe-1,tr=tap([],Qt=>{for(const er of Yt){const hr=er.value;let cr=hr.offset,gr=er.start;const ar=hr.size;if(hr.offset=Ue);or++)Qt.push({index:or,size:ar,offset:cr,data:Ze&&Ze[or]}),cr+=ar+Qe}});return buildListState(tr,Wt,qe,Qe,Tt,Je)}),filter(ze=>ze!==null),distinctUntilChanged()),EMPTY_LIST_STATE);connect(pipe(ce,filter(isDefined),map$1(ze=>ze==null?void 0:ze.length)),oe),connect(pipe(Be,map$1(ze=>ze.topListHeight)),we),connect(we,xe),connect(pipe(Be,map$1(ze=>[ze.top,ze.bottom])),ye),connect(pipe(Be,map$1(ze=>ze.items)),ke);const Ie=streamFromEmitter(pipe(Be,filter(({items:ze})=>ze.length>0),withLatestFrom(oe,ce),filter(([{items:ze},Ue])=>ze[ze.length-1].originalIndex===Ue-1),map$1(([,ze,Ue])=>[ze-1,Ue]),distinctUntilChanged(tupleComparator),map$1(([ze])=>ze))),Ne=streamFromEmitter(pipe(Be,throttleTime(200),filter(({items:ze,topItems:Ue})=>ze.length>0&&ze[0].originalIndex===Ue.length),map$1(({items:ze})=>ze[0].index),distinctUntilChanged())),je=streamFromEmitter(pipe(Be,filter(({items:ze})=>ze.length>0),map$1(({items:ze})=>{let Ue=0,qe=ze.length-1;for(;ze[Ue].type==="group"&&UeUe;)qe--;return{startIndex:ze[Ue].index,endIndex:ze[qe].index}}),distinctUntilChanged(rangeComparator)));return{listState:Be,topItemsIndexes:Re,endReached:Ie,startReached:Ne,rangeChanged:je,itemsRendered:ke,initialItemCount:Ae,...Se}},tup(sizeSystem,groupedListSystem,sizeRangeSystem,initialTopMostItemIndexSystem,scrollToIndexSystem,stateFlagsSystem,propsReadySystem,recalcSystem),{singleton:!0}),initialItemCountSystem=system(([{sizes:ne,firstItemIndex:oe,data:ce,gap:ue},{initialTopMostItemIndex:pe},{initialItemCount:me,listState:ge},{didMount:ye}])=>(connect(pipe(ye,withLatestFrom(me),filter(([,xe])=>xe!==0),withLatestFrom(pe,ne,oe,ue,ce),map$1(([[,xe],ve,_e,we,Se,$e=[]])=>buildListStateFromItemCount(xe,ve,_e,we,Se,$e))),ge),{}),tup(sizeSystem,initialTopMostItemIndexSystem,listStateSystem,propsReadySystem),{singleton:!0}),scrollSeekSystem=system(([{scrollVelocity:ne}])=>{const oe=statefulStream(!1),ce=stream$1(),ue=statefulStream(!1);return connect(pipe(ne,withLatestFrom(ue,oe,ce),filter(([pe,me])=>!!me),map$1(([pe,me,ge,ye])=>{const{exit:xe,enter:ve}=me;if(ge){if(xe(pe,ye))return!1}else if(ve(pe,ye))return!0;return ge}),distinctUntilChanged()),oe),subscribe(pipe(combineLatest(oe,ne,ce),withLatestFrom(ue)),([[pe,me,ge],ye])=>pe&&ye&&ye.change&&ye.change(me,ge)),{isSeeking:oe,scrollSeekConfiguration:ue,scrollVelocity:ne,scrollSeekRangeChanged:ce}},tup(stateFlagsSystem),{singleton:!0}),topItemCountSystem=system(([{topItemsIndexes:ne}])=>{const oe=statefulStream(0);return connect(pipe(oe,filter(ce=>ce>0),map$1(ce=>Array.from({length:ce}).map((ue,pe)=>pe))),ne),{topItemCount:oe}},tup(listStateSystem)),totalListHeightSystem=system(([{footerHeight:ne,headerHeight:oe,fixedHeaderHeight:ce,fixedFooterHeight:ue},{listState:pe}])=>{const me=stream$1(),ge=statefulStreamFromEmitter(pipe(combineLatest(ne,ue,oe,ce,pe),map$1(([ye,xe,ve,_e,we])=>ye+xe+ve+_e+we.offsetBottom+we.bottom)),0);return connect(duc(ge),me),{totalListHeight:ge,totalListHeightChanged:me}},tup(domIOSystem,listStateSystem),{singleton:!0});function simpleMemoize(ne){let oe=!1,ce;return()=>(oe||(oe=!0,ce=ne()),ce)}const isMobileSafari=simpleMemoize(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),upwardScrollFixSystem=system(([{scrollBy:ne,scrollTop:oe,deviation:ce,scrollingInProgress:ue},{isScrolling:pe,isAtBottom:me,scrollDirection:ge,lastJumpDueToItemResize:ye},{listState:xe},{beforeUnshiftWith:ve,shiftWithOffset:_e,sizes:we,gap:Se},{log:$e},{recalcInProgress:Te}])=>{const Re=streamFromEmitter(pipe(xe,withLatestFrom(ye),scan$1(([,ke,Be,Ie],[{items:Ne,totalCount:je,bottom:ze,offsetBottom:Ue},qe])=>{const Ke=ze+Ue;let Ge=0;return Be===je&&ke.length>0&&Ne.length>0&&(Ne[0].originalIndex===0&&ke[0].originalIndex===0||(Ge=Ke-Ie,Ge!==0&&(Ge+=qe))),[Ge,Ne,je,Ke]},[0,[],0,0]),filter(([ke])=>ke!==0),withLatestFrom(oe,ge,ue,me,$e,Te),filter(([,ke,Be,Ie,,,Ne])=>!Ne&&!Ie&&ke!==0&&Be===UP),map$1(([[ke],,,,,Be])=>(Be("Upward scrolling compensation",{amount:ke},LogLevel.DEBUG),ke))));function Ae(ke){ke>0?(publish(ne,{top:-ke,behavior:"auto"}),publish(ce,0)):(publish(ce,0),publish(ne,{top:-ke,behavior:"auto"}))}return subscribe(pipe(Re,withLatestFrom(ce,pe)),([ke,Be,Ie])=>{Ie&&isMobileSafari()?publish(ce,Be-ke):Ae(-ke)}),subscribe(pipe(combineLatest(statefulStreamFromEmitter(pe,!1),ce,Te),filter(([ke,Be,Ie])=>!ke&&!Ie&&Be!==0),map$1(([ke,Be])=>Be),throttleTime(1)),Ae),connect(pipe(_e,map$1(ke=>({top:-ke}))),ne),subscribe(pipe(ve,withLatestFrom(we,Se),map$1(([ke,{lastSize:Be,groupIndices:Ie,sizeTree:Ne},je])=>{function ze(Ue){return Ue*(Be+je)}if(Ie.length===0)return ze(ke);{let Ue=0;const qe=find(Ne,0);let Ke=0,Ge=0;for(;Keke&&(Ue-=qe,Ye=ke-Ke+1),Ke+=Ye,Ue+=ze(Ye),Ge++}return Ue}})),ke=>{publish(ce,ke),requestAnimationFrame(()=>{publish(ne,{top:ke}),requestAnimationFrame(()=>{publish(ce,0),publish(Te,!1)})})}),{deviation:ce}},tup(domIOSystem,stateFlagsSystem,listStateSystem,sizeSystem,loggerSystem,recalcSystem)),initialScrollTopSystem=system(([{didMount:ne},{scrollTo:oe},{listState:ce}])=>{const ue=statefulStream(0);return subscribe(pipe(ne,withLatestFrom(ue),filter(([,pe])=>pe!==0),map$1(([,pe])=>({top:pe}))),pe=>{handleNext(pipe(ce,skip(1),filter(me=>me.items.length>1)),()=>{requestAnimationFrame(()=>{publish(oe,pe)})})}),{initialScrollTop:ue}},tup(propsReadySystem,domIOSystem,listStateSystem),{singleton:!0}),alignToBottomSystem=system(([{viewportHeight:ne},{totalListHeight:oe}])=>{const ce=statefulStream(!1),ue=statefulStreamFromEmitter(pipe(combineLatest(ce,ne,oe),filter(([pe])=>pe),map$1(([,pe,me])=>Math.max(0,pe-me)),throttleTime(0),distinctUntilChanged()),0);return{alignToBottom:ce,paddingTopAddition:ue}},tup(domIOSystem,totalListHeightSystem),{singleton:!0}),windowScrollerSystem=system(([{scrollTo:ne,scrollContainerState:oe}])=>{const ce=stream$1(),ue=stream$1(),pe=stream$1(),me=statefulStream(!1),ge=statefulStream(void 0);return connect(pipe(combineLatest(ce,ue),map$1(([{viewportHeight:ye,scrollTop:xe,scrollHeight:ve},{offsetTop:_e}])=>({scrollTop:Math.max(0,xe-_e),scrollHeight:ve,viewportHeight:ye}))),oe),connect(pipe(ne,withLatestFrom(ue),map$1(([ye,{offsetTop:xe}])=>({...ye,top:ye.top+xe}))),pe),{useWindowScroll:me,customScrollParent:ge,windowScrollContainerState:ce,windowViewportRect:ue,windowScrollTo:pe}},tup(domIOSystem)),defaultCalculateViewLocation=({itemTop:ne,itemBottom:oe,viewportTop:ce,viewportBottom:ue,locationParams:{behavior:pe,align:me,...ge}})=>neue?{...ge,behavior:pe,align:me??"end"}:null,scrollIntoViewSystem=system(([{sizes:ne,totalCount:oe,gap:ce},{scrollTop:ue,viewportHeight:pe,headerHeight:me,fixedHeaderHeight:ge,fixedFooterHeight:ye,scrollingInProgress:xe},{scrollToIndex:ve}])=>{const _e=stream$1();return connect(pipe(_e,withLatestFrom(ne,pe,oe,me,ge,ye,ue),withLatestFrom(ce),map$1(([[we,Se,$e,Te,Re,Ae,ke,Be],Ie])=>{const{done:Ne,behavior:je,align:ze,calculateViewLocation:Ue=defaultCalculateViewLocation,...qe}=we,Ke=originalIndexFromLocation(we,Se,Te-1),Ge=offsetOf(Ke,Se.offsetTree,Ie)+Re+Ae,Ye=Ge+findMaxKeyValue(Se.sizeTree,Ke)[1],Xe=Be+Ae,Je=Be+$e-ke,Qe=Ue({itemTop:Ge,itemBottom:Ye,viewportTop:Xe,viewportBottom:Je,locationParams:{behavior:je,align:ze,...qe}});return Qe?Ne&&handleNext(pipe(xe,filter(Ze=>Ze===!1),skip(getValue(xe)?1:2)),Ne):Ne&&Ne(),Qe}),filter(we=>we!==null)),ve),{scrollIntoView:_e}},tup(sizeSystem,domIOSystem,scrollToIndexSystem,listStateSystem,loggerSystem),{singleton:!0}),stateLoadSystem=system(([{sizes:ne,sizeRanges:oe},{scrollTop:ce,headerHeight:ue},{initialTopMostItemIndex:pe},{didMount:me},{useWindowScroll:ge,windowScrollContainerState:ye,windowViewportRect:xe}])=>{const ve=stream$1(),_e=statefulStream(void 0),we=statefulStream(null),Se=statefulStream(null);return connect(ye,we),connect(xe,Se),subscribe(pipe(ve,withLatestFrom(ne,ce,ge,we,Se,ue)),([$e,Te,Re,Ae,ke,Be,Ie])=>{const Ne=sizeTreeToRanges(Te.sizeTree);Ae&&ke!==null&&Be!==null&&(Re=ke.scrollTop-Be.offsetTop),Re-=Ie,$e({ranges:Ne,scrollTop:Re})}),connect(pipe(_e,filter(isDefined),map$1(locationFromSnapshot)),pe),connect(pipe(me,withLatestFrom(_e),filter(([,$e])=>$e!==void 0),distinctUntilChanged(),map$1(([,$e])=>$e.ranges)),oe),{getState:ve,restoreStateFrom:_e}},tup(sizeSystem,domIOSystem,initialTopMostItemIndexSystem,propsReadySystem,windowScrollerSystem));function locationFromSnapshot(ne){return{offset:ne.scrollTop,index:0,align:"start"}}const featureGroup1System=system(([ne,oe,ce,ue,pe,me,ge,ye,xe,ve])=>({...ne,...oe,...ce,...ue,...pe,...me,...ge,...ye,...xe,...ve}),tup(sizeRangeSystem,initialItemCountSystem,propsReadySystem,scrollSeekSystem,totalListHeightSystem,initialScrollTopSystem,alignToBottomSystem,windowScrollerSystem,scrollIntoViewSystem,loggerSystem)),listSystem=system(([{totalCount:ne,sizeRanges:oe,fixedItemSize:ce,defaultItemSize:ue,trackItemSizes:pe,itemSize:me,data:ge,firstItemIndex:ye,groupIndices:xe,statefulTotalCount:ve,gap:_e,sizes:we},{initialTopMostItemIndex:Se,scrolledToInitialItem:$e,initialItemFinalLocationReached:Te},Re,Ae,ke,{listState:Be,topItemsIndexes:Ie,...Ne},{scrollToIndex:je},ze,{topItemCount:Ue},{groupCounts:qe},Ke])=>(connect(Ne.rangeChanged,Ke.scrollSeekRangeChanged),connect(pipe(Ke.windowViewportRect,map$1(Ge=>Ge.visibleHeight)),Re.viewportHeight),{totalCount:ne,data:ge,firstItemIndex:ye,sizeRanges:oe,initialTopMostItemIndex:Se,scrolledToInitialItem:$e,initialItemFinalLocationReached:Te,topItemsIndexes:Ie,topItemCount:Ue,groupCounts:qe,fixedItemHeight:ce,defaultItemHeight:ue,gap:_e,...ke,statefulTotalCount:ve,listState:Be,scrollToIndex:je,trackItemSizes:pe,itemSize:me,groupIndices:xe,...Ne,...Ke,...Re,sizes:we,...Ae}),tup(sizeSystem,initialTopMostItemIndexSystem,domIOSystem,stateLoadSystem,followOutputSystem,listStateSystem,scrollToIndexSystem,upwardScrollFixSystem,topItemCountSystem,groupedListSystem,featureGroup1System)),WEBKIT_STICKY="-webkit-sticky",STICKY="sticky",positionStickyCssValue=simpleMemoize(()=>{if(typeof document>"u")return STICKY;const ne=document.createElement("div");return ne.style.position=WEBKIT_STICKY,ne.style.position===WEBKIT_STICKY?WEBKIT_STICKY:STICKY});function useWindowViewportRectRef(ne,oe,ce){const ue=React$2.useRef(null),pe=React$2.useCallback(xe=>{if(xe===null||!xe.offsetParent)return;const ve=xe.getBoundingClientRect(),_e=ve.width;let we,Se;if(oe){const $e=oe.getBoundingClientRect(),Te=ve.top-$e.top;we=$e.height-Math.max(0,Te),Se=Te+oe.scrollTop}else we=window.innerHeight-Math.max(0,ve.top),Se=ve.top+window.pageYOffset;ue.current={offsetTop:Se,visibleHeight:we,visibleWidth:_e},ne(ue.current)},[ne,oe]),{callbackRef:me,ref:ge}=useSizeWithElRef(pe,!0,ce),ye=React$2.useCallback(()=>{pe(ge.current)},[pe,ge]);return React$2.useEffect(()=>{if(oe){oe.addEventListener("scroll",ye);const xe=new ResizeObserver(()=>{requestAnimationFrame(ye)});return xe.observe(oe),()=>{oe.removeEventListener("scroll",ye),xe.unobserve(oe)}}else return window.addEventListener("scroll",ye),window.addEventListener("resize",ye),()=>{window.removeEventListener("scroll",ye),window.removeEventListener("resize",ye)}},[ye,oe]),me}const VirtuosoMockContext=React$2.createContext(void 0),VirtuosoGridMockContext=React$2.createContext(void 0);function identity(ne){return ne}const listComponentPropsSystem=system(()=>{const ne=statefulStream(xe=>`Item ${xe}`),oe=statefulStream(null),ce=statefulStream(xe=>`Group ${xe}`),ue=statefulStream({}),pe=statefulStream(identity),me=statefulStream("div"),ge=statefulStream(noop$4),ye=(xe,ve=null)=>statefulStreamFromEmitter(pipe(ue,map$1(_e=>_e[xe]),distinctUntilChanged()),ve);return{context:oe,itemContent:ne,groupContent:ce,components:ue,computeItemKey:pe,HeaderFooterTag:me,scrollerRef:ge,FooterComponent:ye("Footer"),HeaderComponent:ye("Header"),TopItemListComponent:ye("TopItemList"),ListComponent:ye("List","div"),ItemComponent:ye("Item","div"),GroupComponent:ye("Group","div"),ScrollerComponent:ye("Scroller","div"),EmptyPlaceholder:ye("EmptyPlaceholder"),ScrollSeekPlaceholder:ye("ScrollSeekPlaceholder")}}),combinedSystem$2=system(([ne,oe])=>({...ne,...oe}),tup(listSystem,listComponentPropsSystem)),DefaultScrollSeekPlaceholder$1=({height:ne})=>jsxRuntimeExports.jsx("div",{style:{height:ne}}),GROUP_STYLE={position:positionStickyCssValue(),zIndex:1,overflowAnchor:"none"},ITEM_STYLE$1={overflowAnchor:"none"},HORIZONTAL_ITEM_STYLE={...ITEM_STYLE$1,display:"inline-block",height:"100%"},Items$1=React$2.memo(function({showTopList:oe=!1}){const ce=useEmitterValue$2("listState"),ue=usePublisher$2("sizeRanges"),pe=useEmitterValue$2("useWindowScroll"),me=useEmitterValue$2("customScrollParent"),ge=usePublisher$2("windowScrollContainerState"),ye=usePublisher$2("scrollContainerState"),xe=me||pe?ge:ye,ve=useEmitterValue$2("itemContent"),_e=useEmitterValue$2("context"),we=useEmitterValue$2("groupContent"),Se=useEmitterValue$2("trackItemSizes"),$e=useEmitterValue$2("itemSize"),Te=useEmitterValue$2("log"),Re=usePublisher$2("gap"),Ae=useEmitterValue$2("horizontalDirection"),{callbackRef:ke}=useChangedListContentsSizes(ue,$e,Se,oe?noop$4:xe,Te,Re,me,Ae,useEmitterValue$2("skipAnimationFrameInResizeObserver")),[Be,Ie]=React$2.useState(0);useEmitter$2("deviation",Ze=>{Be!==Ze&&Ie(Ze)});const Ne=useEmitterValue$2("EmptyPlaceholder"),je=useEmitterValue$2("ScrollSeekPlaceholder")||DefaultScrollSeekPlaceholder$1,ze=useEmitterValue$2("ListComponent"),Ue=useEmitterValue$2("ItemComponent"),qe=useEmitterValue$2("GroupComponent"),Ke=useEmitterValue$2("computeItemKey"),Ge=useEmitterValue$2("isSeeking"),Ye=useEmitterValue$2("groupIndices").length>0,Xe=useEmitterValue$2("alignToBottom"),Je=useEmitterValue$2("initialItemFinalLocationReached"),Qe=oe?{}:{boxSizing:"border-box",...Ae?{whiteSpace:"nowrap",display:"inline-block",height:"100%",paddingLeft:ce.offsetTop,paddingRight:ce.offsetBottom,marginLeft:Be!==0?Be:Xe?"auto":0}:{marginTop:Be!==0?Be:Xe?"auto":0,paddingTop:ce.offsetTop,paddingBottom:ce.offsetBottom},...Je?{}:{visibility:"hidden"}};return!oe&&ce.totalCount===0&&Ne?jsxRuntimeExports.jsx(Ne,{...contextPropIfNotDomElement(Ne,_e)}):jsxRuntimeExports.jsx(ze,{...contextPropIfNotDomElement(ze,_e),ref:ke,style:Qe,"data-testid":oe?"virtuoso-top-item-list":"virtuoso-item-list",children:(oe?ce.topItems:ce.items).map(Ze=>{const Tt=Ze.originalIndex,Ut=Ke(Tt+ce.firstItemIndex,Ze.data,_e);return Ge?reactExports.createElement(je,{...contextPropIfNotDomElement(je,_e),key:Ut,index:Ze.index,height:Ze.size,type:Ze.type||"item",...Ze.type==="group"?{}:{groupIndex:Ze.groupIndex}}):Ze.type==="group"?reactExports.createElement(qe,{...contextPropIfNotDomElement(qe,_e),key:Ut,"data-index":Tt,"data-known-size":Ze.size,"data-item-index":Ze.index,style:GROUP_STYLE},we(Ze.index,_e)):reactExports.createElement(Ue,{...contextPropIfNotDomElement(Ue,_e),...itemPropIfNotDomElement(Ue,Ze.data),key:Ut,"data-index":Tt,"data-known-size":Ze.size,"data-item-index":Ze.index,"data-item-group-index":Ze.groupIndex,style:Ae?HORIZONTAL_ITEM_STYLE:ITEM_STYLE$1},Ye?ve(Ze.index,Ze.groupIndex,Ze.data,_e):ve(Ze.index,Ze.data,_e))})})}),scrollerStyle={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},horizontalScrollerStyle={outline:"none",overflowX:"auto",position:"relative"},viewportStyle=ne=>({width:"100%",height:"100%",position:"absolute",top:0,...ne?{display:"flex",flexDirection:"column"}:{}}),topItemListStyle={width:"100%",position:positionStickyCssValue(),top:0,zIndex:1};function contextPropIfNotDomElement(ne,oe){if(typeof ne!="string")return{context:oe}}function itemPropIfNotDomElement(ne,oe){return{item:typeof ne=="string"?void 0:oe}}const Header$1=React$2.memo(function(){const oe=useEmitterValue$2("HeaderComponent"),ce=usePublisher$2("headerHeight"),ue=useEmitterValue$2("HeaderFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,useEmitterValue$2("skipAnimationFrameInResizeObserver")),me=useEmitterValue$2("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null}),Footer$1=React$2.memo(function(){const oe=useEmitterValue$2("FooterComponent"),ce=usePublisher$2("footerHeight"),ue=useEmitterValue$2("HeaderFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,useEmitterValue$2("skipAnimationFrameInResizeObserver")),me=useEmitterValue$2("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null});function buildScroller({usePublisher:ne,useEmitter:oe,useEmitterValue:ce}){return React$2.memo(function({style:me,children:ge,...ye}){const xe=ne("scrollContainerState"),ve=ce("ScrollerComponent"),_e=ne("smoothScrollTargetReached"),we=ce("scrollerRef"),Se=ce("context"),$e=ce("horizontalDirection")||!1,{scrollerRef:Te,scrollByCallback:Re,scrollToCallback:Ae}=useScrollTop(xe,_e,ve,we,void 0,$e);oe("scrollTo",Ae),oe("scrollBy",Re);const ke=$e?horizontalScrollerStyle:scrollerStyle;return jsxRuntimeExports.jsx(ve,{ref:Te,style:{...ke,...me},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...ye,...contextPropIfNotDomElement(ve,Se),children:ge})})}function buildWindowScroller({usePublisher:ne,useEmitter:oe,useEmitterValue:ce}){return React$2.memo(function({style:me,children:ge,...ye}){const xe=ne("windowScrollContainerState"),ve=ce("ScrollerComponent"),_e=ne("smoothScrollTargetReached"),we=ce("totalListHeight"),Se=ce("deviation"),$e=ce("customScrollParent"),Te=ce("context"),{scrollerRef:Re,scrollByCallback:Ae,scrollToCallback:ke}=useScrollTop(xe,_e,ve,noop$4,$e);return useIsomorphicLayoutEffect(()=>(Re.current=$e||window,()=>{Re.current=null}),[Re,$e]),oe("windowScrollTo",ke),oe("scrollBy",Ae),jsxRuntimeExports.jsx(ve,{style:{position:"relative",...me,...we!==0?{height:we+Se}:{}},"data-virtuoso-scroller":!0,...ye,...contextPropIfNotDomElement(ve,Te),children:ge})})}const Viewport$2=({children:ne})=>{const oe=React$2.useContext(VirtuosoMockContext),ce=usePublisher$2("viewportHeight"),ue=usePublisher$2("fixedItemHeight"),pe=useEmitterValue$2("alignToBottom"),me=useEmitterValue$2("horizontalDirection"),ge=React$2.useMemo(()=>compose(ce,xe=>correctItemSize(xe,me?"width":"height")),[ce,me]),ye=useSize(ge,!0,useEmitterValue$2("skipAnimationFrameInResizeObserver"));return React$2.useEffect(()=>{oe&&(ce(oe.viewportHeight),ue(oe.itemHeight))},[oe,ce,ue]),jsxRuntimeExports.jsx("div",{style:viewportStyle(pe),ref:ye,"data-viewport-type":"element",children:ne})},WindowViewport$2=({children:ne})=>{const oe=React$2.useContext(VirtuosoMockContext),ce=usePublisher$2("windowViewportRect"),ue=usePublisher$2("fixedItemHeight"),pe=useEmitterValue$2("customScrollParent"),me=useWindowViewportRectRef(ce,pe,useEmitterValue$2("skipAnimationFrameInResizeObserver")),ge=useEmitterValue$2("alignToBottom");return React$2.useEffect(()=>{oe&&(ue(oe.itemHeight),ce({offsetTop:0,visibleHeight:oe.viewportHeight,visibleWidth:100}))},[oe,ce,ue]),jsxRuntimeExports.jsx("div",{ref:me,style:viewportStyle(ge),"data-viewport-type":"window",children:ne})},TopItemListContainer=({children:ne})=>{const oe=useEmitterValue$2("TopItemListComponent")||"div",ce=useEmitterValue$2("headerHeight"),ue={...topItemListStyle,marginTop:`${ce}px`},pe=useEmitterValue$2("context");return jsxRuntimeExports.jsx(oe,{style:ue,...contextPropIfNotDomElement(oe,pe),children:ne})},ListRoot=React$2.memo(function(oe){const ce=useEmitterValue$2("useWindowScroll"),ue=useEmitterValue$2("topItemsIndexes").length>0,pe=useEmitterValue$2("customScrollParent"),me=pe||ce?WindowScroller$2:Scroller$2,ge=pe||ce?WindowViewport$2:Viewport$2;return jsxRuntimeExports.jsxs(me,{...oe,children:[ue&&jsxRuntimeExports.jsx(TopItemListContainer,{children:jsxRuntimeExports.jsx(Items$1,{showTopList:!0})}),jsxRuntimeExports.jsxs(ge,{children:[jsxRuntimeExports.jsx(Header$1,{}),jsxRuntimeExports.jsx(Items$1,{}),jsxRuntimeExports.jsx(Footer$1,{})]})]})}),{Component:List,usePublisher:usePublisher$2,useEmitterValue:useEmitterValue$2,useEmitter:useEmitter$2}=systemToComponent(combinedSystem$2,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ListRoot),Scroller$2=buildScroller({usePublisher:usePublisher$2,useEmitterValue:useEmitterValue$2,useEmitter:useEmitter$2}),WindowScroller$2=buildWindowScroller({usePublisher:usePublisher$2,useEmitterValue:useEmitterValue$2,useEmitter:useEmitter$2}),Virtuoso=List,INITIAL_GRID_STATE={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},PROBE_GRID_STATE={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round,ceil,floor,min,max}=Math;function buildProbeGridState(ne){return{...PROBE_GRID_STATE,items:ne}}function buildItems(ne,oe,ce){return Array.from({length:oe-ne+1}).map((ue,pe)=>{const me=ce===null?null:ce[pe+ne];return{index:pe+ne,data:me}})}function gapComparator(ne,oe){return ne&&ne.column===oe.column&&ne.row===oe.row}function dimensionComparator(ne,oe){return ne&&ne.width===oe.width&&ne.height===oe.height}const gridSystem=system(([{overscan:ne,visibleRange:oe,listBoundary:ce,increaseViewportBy:ue},{scrollTop:pe,viewportHeight:me,scrollBy:ge,scrollTo:ye,smoothScrollTargetReached:xe,scrollContainerState:ve,footerHeight:_e,headerHeight:we},Se,$e,{propsReady:Te,didMount:Re},{windowViewportRect:Ae,useWindowScroll:ke,customScrollParent:Be,windowScrollContainerState:Ie,windowScrollTo:Ne},je])=>{const ze=statefulStream(0),Ue=statefulStream(0),qe=statefulStream(INITIAL_GRID_STATE),Ke=statefulStream({height:0,width:0}),Ge=statefulStream({height:0,width:0}),Ye=stream$1(),Xe=stream$1(),Je=statefulStream(0),Qe=statefulStream(null),Ze=statefulStream({row:0,column:0}),Tt=stream$1(),Ut=stream$1(),Gt=statefulStream(!1),Nt=statefulStream(0),Wt=statefulStream(!0),Mt=statefulStream(!1),Yt=statefulStream(!1);subscribe(pipe(Re,withLatestFrom(Nt),filter(([cr,gr])=>!!gr)),()=>{publish(Wt,!1)}),subscribe(pipe(combineLatest(Re,Wt,Ge,Ke,Nt,Mt),filter(([cr,gr,ar,Pt,,or])=>cr&&!gr&&ar.height!==0&&Pt.height!==0&&!or)),([,,,,cr])=>{publish(Mt,!0),skipFrames(1,()=>{publish(Ye,cr)}),handleNext(pipe(pe),()=>{publish(ce,[0,0]),publish(Wt,!0)})}),connect(pipe(Ut,filter(cr=>cr!=null&&cr.scrollTop>0),mapTo(0)),Ue),subscribe(pipe(Re,withLatestFrom(Ut),filter(([,cr])=>cr!=null)),([,cr])=>{cr&&(publish(Ke,cr.viewport),publish(Ge,cr==null?void 0:cr.item),publish(Ze,cr.gap),cr.scrollTop>0&&(publish(Gt,!0),handleNext(pipe(pe,skip(1)),gr=>{publish(Gt,!1)}),publish(ye,{top:cr.scrollTop})))}),connect(pipe(Ke,map$1(({height:cr})=>cr)),me),connect(pipe(combineLatest(duc(Ke,dimensionComparator),duc(Ge,dimensionComparator),duc(Ze,(cr,gr)=>cr&&cr.column===gr.column&&cr.row===gr.row),duc(pe)),map$1(([cr,gr,ar,Pt])=>({viewport:cr,item:gr,gap:ar,scrollTop:Pt}))),Tt),connect(pipe(combineLatest(duc(ze),oe,duc(Ze,gapComparator),duc(Ge,dimensionComparator),duc(Ke,dimensionComparator),duc(Qe),duc(Ue),duc(Gt),duc(Wt),duc(Nt)),filter(([,,,,,,,cr])=>!cr),map$1(([cr,[gr,ar],Pt,or,Kt,Vt,Xt,,sr,fr])=>{const{row:kt,column:qt}=Pt,{height:Jt,width:rr}=or,{width:vr}=Kt;if(Xt===0&&(cr===0||vr===0))return INITIAL_GRID_STATE;if(rr===0){const Sr=getInitialTopMostItemIndexNumber(fr,cr),Cr=Math.max(Sr+Xt-1,0);return buildProbeGridState(buildItems(Sr,Cr,Vt))}const mr=itemsPerRow(vr,rr,qt);let $r,Mr;sr?gr===0&&ar===0&&Xt>0?($r=0,Mr=Xt-1):($r=mr*floor((gr+kt)/(Jt+kt)),Mr=mr*ceil((ar+kt)/(Jt+kt))-1,Mr=min(cr-1,max(Mr,mr-1)),$r=min(Mr,max(0,$r))):($r=0,Mr=-1);const Pr=buildItems($r,Mr,Vt),{top:lr,bottom:jt}=gridLayout(Kt,Pt,or,Pr),Dt=ceil(cr/mr),br=Dt*Jt+(Dt-1)*kt-jt;return{items:Pr,offsetTop:lr,offsetBottom:br,top:lr,bottom:jt,itemHeight:Jt,itemWidth:rr}})),qe),connect(pipe(Qe,filter(cr=>cr!==null),map$1(cr=>cr.length)),ze),connect(pipe(combineLatest(Ke,Ge,qe,Ze),filter(([cr,gr,{items:ar}])=>ar.length>0&&gr.height!==0&&cr.height!==0),map$1(([cr,gr,{items:ar},Pt])=>{const{top:or,bottom:Kt}=gridLayout(cr,Pt,gr,ar);return[or,Kt]}),distinctUntilChanged(tupleComparator)),ce);const ir=statefulStream(!1);connect(pipe(pe,withLatestFrom(ir),map$1(([cr,gr])=>gr||cr!==0)),ir);const tr=streamFromEmitter(pipe(duc(qe),filter(({items:cr})=>cr.length>0),withLatestFrom(ze,ir),filter(([{items:cr},gr,ar])=>ar&&cr[cr.length-1].index===gr-1),map$1(([,cr])=>cr-1),distinctUntilChanged())),Qt=streamFromEmitter(pipe(duc(qe),filter(({items:cr})=>cr.length>0&&cr[0].index===0),mapTo(0),distinctUntilChanged())),er=streamFromEmitter(pipe(duc(qe),withLatestFrom(Gt),filter(([{items:cr},gr])=>cr.length>0&&!gr),map$1(([{items:cr}])=>({startIndex:cr[0].index,endIndex:cr[cr.length-1].index})),distinctUntilChanged(rangeComparator),throttleTime(0)));connect(er,$e.scrollSeekRangeChanged),connect(pipe(Ye,withLatestFrom(Ke,Ge,ze,Ze),map$1(([cr,gr,ar,Pt,or])=>{const Kt=normalizeIndexLocation(cr),{align:Vt,behavior:Xt,offset:sr}=Kt;let fr=Kt.index;fr==="LAST"&&(fr=Pt-1),fr=max(0,fr,min(Pt-1,fr));let kt=itemTop(gr,or,ar,fr);return Vt==="end"?kt=round(kt-gr.height+ar.height):Vt==="center"&&(kt=round(kt-gr.height/2+ar.height/2)),sr&&(kt+=sr),{top:kt,behavior:Xt}})),ye);const hr=statefulStreamFromEmitter(pipe(qe,map$1(cr=>cr.offsetBottom+cr.bottom)),0);return connect(pipe(Ae,map$1(cr=>({width:cr.visibleWidth,height:cr.visibleHeight}))),Ke),{data:Qe,totalCount:ze,viewportDimensions:Ke,itemDimensions:Ge,scrollTop:pe,scrollHeight:Xe,overscan:ne,increaseViewportBy:ue,scrollBy:ge,scrollTo:ye,scrollToIndex:Ye,smoothScrollTargetReached:xe,windowViewportRect:Ae,windowScrollTo:Ne,useWindowScroll:ke,customScrollParent:Be,windowScrollContainerState:Ie,deviation:Je,scrollContainerState:ve,footerHeight:_e,headerHeight:we,initialItemCount:Ue,gap:Ze,restoreStateFrom:Ut,...$e,initialTopMostItemIndex:Nt,horizontalDirection:Yt,gridState:qe,totalListHeight:hr,...Se,startReached:Qt,endReached:tr,rangeChanged:er,stateChanged:Tt,propsReady:Te,stateRestoreInProgress:Gt,...je}},tup(sizeRangeSystem,domIOSystem,stateFlagsSystem,scrollSeekSystem,propsReadySystem,windowScrollerSystem,loggerSystem));function gridLayout(ne,oe,ce,ue){const{height:pe}=ce;if(pe===void 0||ue.length===0)return{top:0,bottom:0};const me=itemTop(ne,oe,ce,ue[0].index),ge=itemTop(ne,oe,ce,ue[ue.length-1].index)+pe;return{top:me,bottom:ge}}function itemTop(ne,oe,ce,ue){const pe=itemsPerRow(ne.width,ce.width,oe.column),me=floor(ue/pe),ge=me*ce.height+max(0,me-1)*oe.row;return ge>0?ge+oe.row:ge}function itemsPerRow(ne,oe,ce){return max(1,floor((ne+ce)/(floor(oe)+ce)))}const gridComponentPropsSystem=system(()=>{const ne=statefulStream(we=>`Item ${we}`),oe=statefulStream({}),ce=statefulStream(null),ue=statefulStream("virtuoso-grid-item"),pe=statefulStream("virtuoso-grid-list"),me=statefulStream(identity),ge=statefulStream("div"),ye=statefulStream(noop$4),xe=(we,Se=null)=>statefulStreamFromEmitter(pipe(oe,map$1($e=>$e[we]),distinctUntilChanged()),Se),ve=statefulStream(!1),_e=statefulStream(!1);return connect(duc(_e),ve),{readyStateChanged:ve,reportReadyState:_e,context:ce,itemContent:ne,components:oe,computeItemKey:me,itemClassName:ue,listClassName:pe,headerFooterTag:ge,scrollerRef:ye,FooterComponent:xe("Footer"),HeaderComponent:xe("Header"),ListComponent:xe("List","div"),ItemComponent:xe("Item","div"),ScrollerComponent:xe("Scroller","div"),ScrollSeekPlaceholder:xe("ScrollSeekPlaceholder","div")}}),combinedSystem$1=system(([ne,oe])=>({...ne,...oe}),tup(gridSystem,gridComponentPropsSystem)),GridItems=React$2.memo(function(){const oe=useEmitterValue$1("gridState"),ce=useEmitterValue$1("listClassName"),ue=useEmitterValue$1("itemClassName"),pe=useEmitterValue$1("itemContent"),me=useEmitterValue$1("computeItemKey"),ge=useEmitterValue$1("isSeeking"),ye=usePublisher$1("scrollHeight"),xe=useEmitterValue$1("ItemComponent"),ve=useEmitterValue$1("ListComponent"),_e=useEmitterValue$1("ScrollSeekPlaceholder"),we=useEmitterValue$1("context"),Se=usePublisher$1("itemDimensions"),$e=usePublisher$1("gap"),Te=useEmitterValue$1("log"),Re=useEmitterValue$1("stateRestoreInProgress"),Ae=usePublisher$1("reportReadyState"),ke=useSize(React$2.useMemo(()=>Be=>{const Ie=Be.parentElement.parentElement.scrollHeight;ye(Ie);const Ne=Be.firstChild;if(Ne){const{width:je,height:ze}=Ne.getBoundingClientRect();Se({width:je,height:ze})}$e({row:resolveGapValue("row-gap",getComputedStyle(Be).rowGap,Te),column:resolveGapValue("column-gap",getComputedStyle(Be).columnGap,Te)})},[ye,Se,$e,Te]),!0,!1);return useIsomorphicLayoutEffect(()=>{oe.itemHeight>0&&oe.itemWidth>0&&Ae(!0)},[oe]),Re?null:jsxRuntimeExports.jsx(ve,{ref:ke,className:ce,...contextPropIfNotDomElement(ve,we),style:{paddingTop:oe.offsetTop,paddingBottom:oe.offsetBottom},"data-testid":"virtuoso-item-list",children:oe.items.map(Be=>{const Ie=me(Be.index,Be.data,we);return ge?jsxRuntimeExports.jsx(_e,{...contextPropIfNotDomElement(_e,we),index:Be.index,height:oe.itemHeight,width:oe.itemWidth},Ie):reactExports.createElement(xe,{...contextPropIfNotDomElement(xe,we),className:ue,"data-index":Be.index,key:Ie},pe(Be.index,Be.data,we))})})}),Header=React$2.memo(function(){const oe=useEmitterValue$1("HeaderComponent"),ce=usePublisher$1("headerHeight"),ue=useEmitterValue$1("headerFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,!1),me=useEmitterValue$1("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null}),Footer=React$2.memo(function(){const oe=useEmitterValue$1("FooterComponent"),ce=usePublisher$1("footerHeight"),ue=useEmitterValue$1("headerFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,!1),me=useEmitterValue$1("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null}),Viewport$1=({children:ne})=>{const oe=React$2.useContext(VirtuosoGridMockContext),ce=usePublisher$1("itemDimensions"),ue=usePublisher$1("viewportDimensions"),pe=useSize(React$2.useMemo(()=>me=>{ue(me.getBoundingClientRect())},[ue]),!0,!1);return React$2.useEffect(()=>{oe&&(ue({height:oe.viewportHeight,width:oe.viewportWidth}),ce({height:oe.itemHeight,width:oe.itemWidth}))},[oe,ue,ce]),jsxRuntimeExports.jsx("div",{style:viewportStyle(!1),ref:pe,children:ne})},WindowViewport$1=({children:ne})=>{const oe=React$2.useContext(VirtuosoGridMockContext),ce=usePublisher$1("windowViewportRect"),ue=usePublisher$1("itemDimensions"),pe=useEmitterValue$1("customScrollParent"),me=useWindowViewportRectRef(ce,pe,!1);return React$2.useEffect(()=>{oe&&(ue({height:oe.itemHeight,width:oe.itemWidth}),ce({offsetTop:0,visibleHeight:oe.viewportHeight,visibleWidth:oe.viewportWidth}))},[oe,ce,ue]),jsxRuntimeExports.jsx("div",{ref:me,style:viewportStyle(!1),children:ne})},GridRoot=React$2.memo(function({...oe}){const ce=useEmitterValue$1("useWindowScroll"),ue=useEmitterValue$1("customScrollParent"),pe=ue||ce?WindowScroller$1:Scroller$1,me=ue||ce?WindowViewport$1:Viewport$1;return jsxRuntimeExports.jsx(pe,{...oe,children:jsxRuntimeExports.jsxs(me,{children:[jsxRuntimeExports.jsx(Header,{}),jsxRuntimeExports.jsx(GridItems,{}),jsxRuntimeExports.jsx(Footer,{})]})})}),{Component:Grid,usePublisher:usePublisher$1,useEmitterValue:useEmitterValue$1,useEmitter:useEmitter$1}=systemToComponent(combinedSystem$1,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},GridRoot),Scroller$1=buildScroller({usePublisher:usePublisher$1,useEmitterValue:useEmitterValue$1,useEmitter:useEmitter$1}),WindowScroller$1=buildWindowScroller({usePublisher:usePublisher$1,useEmitterValue:useEmitterValue$1,useEmitter:useEmitter$1});function resolveGapValue(ne,oe,ce){return oe!=="normal"&&!(oe!=null&&oe.endsWith("px"))&&ce(`${ne} was not resolved to pixel value correctly`,oe,LogLevel.WARN),oe==="normal"?0:parseInt(oe??"0",10)}const Scroller=reactExports.forwardRef((ne,oe)=>{const ce=compilerRuntimeExports.c(36);let ue,pe,me;ce[0]!==ne?({style:me,children:ue,...pe}=ne,ce[0]=ne,ce[1]=ue,ce[2]=pe,ce[3]=me):(ue=ce[1],pe=ce[2],me=ce[3]);const ge=reactExports.useRef(null),{palette:ye,spacing:xe}=useTheme();let ve;ce[4]===Symbol.for("react.memo_cache_sentinel")?(ve={visibility:"visible",opacity:1},ce[4]=ve):ve=ce[4];let _e;ce[5]!==xe?(_e=xe(12),ce[5]=xe,ce[6]=_e):_e=ce[6];let we;ce[7]!==_e?(we={"min-height":_e},ce[7]=_e,ce[8]=we):we=ce[8];const Se=`calc(100% - ${xe(6)})`;let $e;ce[9]!==xe?($e=xe(6),ce[9]=xe,ce[10]=$e):$e=ce[10];let Te;ce[11]!==Se||ce[12]!==$e?(Te={height:Se,marginTop:$e},ce[11]=Se,ce[12]=$e,ce[13]=Te):Te=ce[13];let Re;ce[14]===Symbol.for("react.memo_cache_sentinel")?(Re={"--os-handle-perpendicular-size":"2px","--os-handle-perpendicular-size-hover":"6px","--os-handle-perpendicular-size-active":"6px","> div.os-scrollbar-handle":{borderRadius:0,opacity:.5,"&:hover":{opacity:.8}}},ce[14]=Re):Re=ce[14];let Ae;ce[15]!==we||ce[16]!==Te?(Ae={"--os-padding-perpendicular":"2px",".os-scrollbar":ve,".os-scrollbar-vertical > .os-scrollbar-track > .os-scrollbar-handle":we,"div.os-scrollbar-vertical > div.os-scrollbar-track":Te,"div > div.os-scrollbar-track":Re},ce[15]=we,ce[16]=Te,ce[17]=Ae):Ae=ce[17];const ke=useCss(Ae);let Be;ce[18]===Symbol.for("react.memo_cache_sentinel")?(Be={x:"hidden",y:"scroll"},ce[18]=Be):Be=ce[18];const Ie=ye.mode==="dark"?"os-theme-light":"os-theme-dark";let Ne;ce[19]!==Ie?(Ne={options:{overflow:Be,scrollbars:{autoHide:"move",theme:Ie}}},ce[19]=Ie,ce[20]=Ne):Ne=ce[20];const[je]=F$3(Ne);let ze;ce[21]!==je||ce[22]!==oe?(ze=()=>{typeof oe!="function"&&(oe!=null&&oe.current)&&(ge!=null&&ge.current)&&je({target:ge.current,elements:{viewport:oe.current}})},ce[21]=je,ce[22]=oe,ce[23]=ze):ze=ce[23];let Ue;ce[24]!==je?(Ue=[je],ce[24]=je,ce[25]=Ue):Ue=ce[25],reactExports.useEffect(ze,Ue);let qe;ce[26]!==oe?(qe=Xe=>{Xe&&oe&&(typeof oe=="function"?oe(Xe):oe.current=Xe)},ce[26]=oe,ce[27]=qe):qe=ce[27];const Ke=qe;let Ge;ce[28]!==ue||ce[29]!==Ke||ce[30]!==pe?(Ge=jsxRuntimeExports.jsx("div",{ref:Ke,...pe,children:ue}),ce[28]=ue,ce[29]=Ke,ce[30]=pe,ce[31]=Ge):Ge=ce[31];let Ye;return ce[32]!==ke||ce[33]!==me||ce[34]!==Ge?(Ye=jsxRuntimeExports.jsx("div",{ref:ge,style:me,className:ke,children:Ge}),ce[32]=ke,ce[33]=me,ce[34]=Ge,ce[35]=Ye):Ye=ce[35],Ye});function LazyList(ne){const oe=compilerRuntimeExports.c(18);let ce,ue,pe,me;if(oe[0]!==ne){const{items:Se,renderItem:$e,listOptions:Te,placeholder:Re,...Ae}=ne;me=Se,pe=$e,ce=Te,ue=Ae,oe[0]=ne,oe[1]=ce,oe[2]=ue,oe[3]=pe,oe[4]=me}else ce=oe[1],ue=oe[2],pe=oe[3],me=oe[4];let ge;oe[5]!==me?(ge=me===void 0?[]:me,oe[5]=me,oe[6]=ge):ge=oe[6];const ye=ge;let xe;oe[7]===Symbol.for("react.memo_cache_sentinel")?(xe={Scroller},oe[7]=xe):xe=oe[7];let ve;oe[8]!==ye||oe[9]!==pe?(ve=Se=>pe==null?void 0:pe(ye[Se],Se),oe[8]=ye,oe[9]=pe,oe[10]=ve):ve=oe[10];let _e;oe[11]!==ye.length||oe[12]!==ce||oe[13]!==ve?(_e=jsxRuntimeExports.jsx(Virtuoso,{components:xe,totalCount:ye.length,itemContent:ve,...ce}),oe[11]=ye.length,oe[12]=ce,oe[13]=ve,oe[14]=_e):_e=oe[14];let we;return oe[15]!==ue||oe[16]!==_e?(we=jsxRuntimeExports.jsx(Box,{...ue,children:_e}),oe[15]=ue,oe[16]=_e,oe[17]=we):we=oe[17],we}function Dot(ne){const oe=compilerRuntimeExports.c(3),{label:ce}=ne;let ue;oe[0]===Symbol.for("react.memo_cache_sentinel")?(ue=jsxRuntimeExports.jsx(SvgIcon$L,{sx:{color:"error.main",transform:"scale(0.5)",pl:.5,mr:2},fontSize:"small"}),oe[0]=ue):ue=oe[0];let pe;return oe[1]!==ce?(pe=jsxRuntimeExports.jsx(Tooltip,{title:ce,children:ue}),oe[1]=ce,oe[2]=pe):pe=oe[2],pe}function EventInspector({event:ne,index:oe,selected:ce,label:ue,...pe}){const{spacing:me}=useTheme(),ge=useCss({}),ye=useCss({}),xe=lodashExports.omit(ne,...OMIT_PROPS),ve=lodashExports.pick(xe,...ESSENTIAL_PROPS),_e=lodashExports.omit(xe,...ESSENTIAL_PROPS);return jsxRuntimeExports.jsxs(Box,{sx:{position:"relative",[`> .${ye}`]:{opacity:0},[`&:hover > .${ye}`]:{opacity:1},[`&:hover > .${ge}`]:{pr:8}},children:[jsxRuntimeExports.jsxs(ListItemButton,{className:ge,selected:ce,...pe,sx:{height:80,borderLeft:`${me(.5)} solid ${getColorHex(ne==null?void 0:ne.type)}`,...pe.sx},children:[jsxRuntimeExports.jsxs(ListItemIcon,{sx:{alignItems:"center"},children:[jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",children:oe}),ue&&jsxRuntimeExports.jsx(Dot,{label:ue})]}),jsxRuntimeExports.jsx(ListItemText,{sx:{overflow:"hidden"},primary:jsxRuntimeExports.jsxs(Box,{sx:{overflow:"hidden",whiteSpace:"nowrap",display:"block",textOverflow:"ellipsis",my:.5},children:[lodashExports.startCase((ne==null?void 0:ne.type)??"event")," ",(ne==null?void 0:ne.id)??"-"]}),secondaryTypographyProps:{component:"div",whiteSpace:"nowrap",overflow:"hidden"},secondary:jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"flex-start",sx:{"> *":{flex:0}},children:[jsxRuntimeExports.jsx(PropertyList,{event:ve,simple:!0}),jsxRuntimeExports.jsx(PropertyList,{event:_e,simple:!0})]})})]}),jsxRuntimeExports.jsx(Stack,{className:ye,direction:"row",sx:{p:1,justifyContent:"center",position:"absolute",right:0,alignItems:"center",top:0,height:"100%"},children:jsxRuntimeExports.jsx(PropertyDialog,{event:ne,trigger:we=>jsxRuntimeExports.jsx(IconButtonWithTooltip,{onClick:we,sx:{p:1.5,color:"text.secondary"},label:"See All Properties",icon:jsxRuntimeExports.jsx(SvgIcon$S,{fontSize:"small"})})})})]})}function Skeleton(ne){const oe=compilerRuntimeExports.c(12),{event:ce}=ne,{spacing:ue}=useTheme(),pe=`${ue(.5)} solid ${getColorHex(ce==null?void 0:ce.type)}`;let me;oe[0]!==pe?(me={height:80,borderLeft:pe},oe[0]=pe,oe[1]=me):me=oe[1];let ge;oe[2]!==ue?(ge=ue(4),oe[2]=ue,oe[3]=ge):ge=oe[3];let ye;oe[4]!==ge?(ye=jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(Skeleton$1,{animation:!1,width:ge})}),oe[4]=ge,oe[5]=ye):ye=oe[5];let xe;oe[6]!==me||oe[7]!==ye?(xe=jsxRuntimeExports.jsx(ListItem,{sx:me,children:ye}),oe[6]=me,oe[7]=ye,oe[8]=xe):xe=oe[8];let ve;oe[9]===Symbol.for("react.memo_cache_sentinel")?(ve=jsxRuntimeExports.jsx(Divider,{variant:"inset"}),oe[9]=ve):ve=oe[9];let _e;return oe[10]!==xe?(_e=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[xe,ve]}),oe[10]=xe,oe[11]=_e):_e=oe[11],_e}function lerp(ne,oe,ce){return ne+lodashExports.clamp(ce,0,1)*(oe-ne)}const ITEM_HEIGHT=80,PADDING_TOP=8,divider$2=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1}}),pxToInt=ne=>Number(ne.replace(/px$/,"")),SYMBOL_ALL=nanoid(),stepsLayerGuard=ne=>!!getController(ne).steps;function useStepsPageState(ne,oe){const ce=compilerRuntimeExports.c(13),{key:ue,setKey:pe,layers:me,layer:ge,allLayers:ye}=useLayer(ne==null?void 0:ne.layer,stepsLayerGuard),[xe,ve]=reactExports.useState(ne==null?void 0:ne.selectedType);let _e;ce[0]!==oe||ce[1]!==pe?(_e=function(Ae){oe==null||oe({layer:Ae}),pe(Ae)},ce[0]=oe,ce[1]=pe,ce[2]=_e):_e=ce[2];const we=_e;let Se;ce[3]!==oe?(Se=function(Ae){oe==null||oe({selectedType:Ae}),ve(Ae)},ce[3]=oe,ce[4]=Se):Se=ce[4];const $e=Se;let Te;return ce[5]!==ye||ce[6]!==ue||ce[7]!==ge||ce[8]!==me||ce[9]!==xe||ce[10]!==we||ce[11]!==$e?(Te={setSelectedType:$e,setKey:we,selectedType:xe,layers:me,allLayers:ye,key:ue,layer:ge},ce[5]=ye,ce[6]=ue,ce[7]=ge,ce[8]=me,ce[9]=xe,ce[10]=we,ce[11]=$e,ce[12]=Te):Te=ce[12],Te}const getStepsPageDescription=ne=>ne?`${ne} contains 0 steps.`:"When you load a trace, you'll see its steps here.";function StepsPage({template:ne}){const{spacing:oe}=useTheme(),ce=usePaper(),ue=useAcrylic(),pe=reactExports.useRef(null),[me,ge]=reactExports.useState(null),{controls:ye,onChange:xe,state:ve,dragHandle:_e}=useViewTreeContext(),{allLayers:we,key:Se,layers:$e,selectedType:Te,setKey:Re,setSelectedType:Ae,layer:ke}=useStepsPageState(ve,xe),{step:Be,playing:Ie,stepTo:Ne}=usePlaybackState(Se),je=reactExports.useMemo(()=>{if(ke){const{steps:Ye}=getController(ke);return Ye(ke)}},[ke]),{steps:ze,types:Ue,stepToFilteredStep:qe,selectedType:Ke}=reactExports.useMemo(()=>{if(je){const Ye=je.map((Tt,Ut)=>[Tt,Ut]),Xe=lodashExports.chain(Ye).map(([Tt])=>Tt.type).filter().uniq().value(),Je=!Xe.includes(Te),Qe=Je?Ye:Ye.filter(([Tt])=>Tt.type===Te),{stepMap:Ze}=lodashExports.reduce(Ye,(Tt,[,Ut])=>{const Gt=lodashExports.findIndex(Qe,([,Wt])=>Wt>=Ut,Tt.from),Nt=Gt===-1?Qe.length:Gt;return Tt.from=Nt,Tt.stepMap.push(Nt),Tt},{from:0,stepMap:[]});return{steps:Qe,types:Xe,stepToFilteredStep:Tt=>Ze[Tt],selectedType:Je?SYMBOL_ALL:Te}}return{}},[je,Te]),Ge=useBreakpoints(Se);return reactExports.useEffect(()=>{if(qe&&me&&pe.current){const Ye=qe(Be);if(Ie){let Xe=!1;const Je=Qe=>{var Ze;if(!Xe&&"scrollTop"in me&&!lodashExports.isUndefined(Be)){const{scrollTop:Tt}=me,Ut=Ye*ITEM_HEIGHT;(Ze=pe.current)==null||Ze.scrollTo({top:lerp(Tt,Ut,1e-6*Qe)}),requestAnimationFrame(Je)}};return requestAnimationFrame(Je),()=>{Xe=!0}}else pe.current.scrollToIndex({index:Ye,behavior:"smooth",offset:-pxToInt(oe(12+PADDING_TOP))})}},[Be,pe,me,qe,Ie]),jsxRuntimeExports.jsxs(ne,{onChange:xe,stack:ve,children:[jsxRuntimeExports.jsx(ne.Title,{children:"Steps"}),jsxRuntimeExports.jsx(ne.Handle,{children:_e}),jsxRuntimeExports.jsxs(ne.Content,{children:[jsxRuntimeExports.jsx(Flex,{vertical:!0,alignItems:"center",children:ze?ze.length?jsxRuntimeExports.jsx(LazyList,{sx:{width:"100%",height:"100%"},items:ze,listOptions:{scrollerRef:ge,ref:pe,defaultItemHeight:ITEM_HEIGHT,overscan:0},renderItem:([Ye,Xe],Je)=>{var Qe;return Ie?jsxRuntimeExports.jsx(Box,{sx:{pt:Je?0:oe(6+PADDING_TOP)},children:jsxRuntimeExports.jsx(Skeleton,{event:Ye})},Je):jsxRuntimeExports.jsxs(Box,{sx:{height:pxToInt(oe(Je?0:6+PADDING_TOP))+ITEM_HEIGHT,pt:Je?0:oe(6+PADDING_TOP)},children:[jsxRuntimeExports.jsx(EventInspector,{event:Ye,index:Xe,selected:Xe===Be,label:(Qe=Ge(Xe))==null?void 0:Qe.result,onClick:()=>Ne(Xe)}),jsxRuntimeExports.jsx(Divider,{variant:"inset"})]},Je)}}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$u,{}),label:"Events",secondary:getStepsPageDescription(inferLayerName(ke))}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$u,{}),label:"Events",secondary:getStepsPageDescription()})}),!!(ze!=null&&ze.length)&&jsxRuntimeExports.jsx(Stack,{direction:"row",sx:{...ce(1),...ue,alignItems:"center",position:"absolute",top:Ye=>Ye.spacing(6),height:Ye=>Ye.spacing(6),borderRadius:1,px:1,m:1},children:jsxRuntimeExports.jsx(Playback,{layer:ke})})]}),jsxRuntimeExports.jsxs(ne.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),label:"Layer",value:Se,items:lodashExports.map(we,Ye=>({id:Ye.key,hidden:!lodashExports.find($e,{key:Ye.key}),name:inferLayerName(Ye)})),onChange:Re,arrow:!0,ellipsis:12}),divider$2,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$K,{sx:{color:Ke===SYMBOL_ALL||!Ke?grey$2[tint]:getColorHex(Ke)}}),label:"Event Type",value:Ke,items:[{id:SYMBOL_ALL,name:"All Events"},...lodashExports.map(Ue,Ye=>({id:`${Ye}`,name:lodashExports.startCase(Ye)}))],onChange:Ae,arrow:!0,ellipsis:12})]}),jsxRuntimeExports.jsx(ne.Extras,{children:ye})]})}function SelectMulti(ne){const oe=compilerRuntimeExports.c(7),{trigger:ce,items:ue,value:pe,onChange:me,placeholder:ge,defaultChecked:ye}=ne,xe=ge===void 0?"Select Options":ge;useSmallDisplay(),lodashExports.max([lodashExports.findIndex(ue,_e=>{const{value:we}=_e;return!!(pe!=null&&pe[we])}),0]);let ve;return oe[0]!==ye||oe[1]!==ue||oe[2]!==me||oe[3]!==xe||oe[4]!==ce||oe[5]!==pe?(ve=jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:_e=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip,{title:xe,children:jsxRuntimeExports.jsx("span",{children:ce==null?void 0:ce(bindTrigger(_e))})}),jsxRuntimeExports.jsx(Menu,{...bindMenu(_e),anchorOrigin:{horizontal:"left",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"left"},children:lodashExports.map(ue,we=>{const{value:Se,label:$e,disabled:Te}=we;return jsxRuntimeExports.jsxs(MenuItem,{disabled:Te,onClick:()=>{me==null||me({...pe,[Se]:!((pe==null?void 0:pe[Se])??ye)})},children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(Checkbox,{sx:{p:0},checked:!!((pe==null?void 0:pe[Se])??ye)})}),$e]},Se)})})]})}),oe[0]=ye,oe[1]=ue,oe[2]=me,oe[3]=xe,oe[4]=ce,oe[5]=pe,oe[6]=ve):ve=oe[6],ve}function FeaturePickerMulti(ne){var Be;const oe=compilerRuntimeExports.c(23),{label:ce,value:ue,onChange:pe,items:me,icon:ge,showArrow:ye,defaultChecked:xe,ellipsis:ve}=ne,_e=ve===void 0?1/0:ve;let we;oe[0]!==xe||oe[1]!==ue?(we=Ie=>{const{id:Ne}=Ie;return!!((ue==null?void 0:ue[Ne])??xe)},oe[0]=xe,oe[1]=ue,oe[2]=we):we=oe[2];let Se;if(oe[3]!==me||oe[4]!==ce||oe[5]!==we){const Ie=lodashExports.filter(me,we);Se=Ie.length?Ie.length===1?(Be=lodashExports.head(Ie))==null?void 0:Be.name:`${Ie.length} Selected`:ce,oe[3]=me,oe[4]=ce,oe[5]=we,oe[6]=Se}else Se=oe[6];const $e=Se;let Te;oe[7]!==ce?(Te=lodashExports.startCase(ce),oe[7]=ce,oe[8]=Te):Te=oe[8];let Re;oe[9]!==$e||oe[10]!==_e||oe[11]!==ge||oe[12]!==(me==null?void 0:me.length)||oe[13]!==ye?(Re=Ie=>jsxRuntimeExports.jsx(FeaturePickerButton,{...Ie,disabled:!(me!=null&&me.length),icon:ge,arrow:ye,children:lodashExports.truncate($e,{length:_e})}),oe[9]=$e,oe[10]=_e,oe[11]=ge,oe[12]=me==null?void 0:me.length,oe[13]=ye,oe[14]=Re):Re=oe[14];let Ae;oe[15]!==me?(Ae=lodashExports.map(me,_temp$8),oe[15]=me,oe[16]=Ae):Ae=oe[16];let ke;return oe[17]!==pe||oe[18]!==Te||oe[19]!==Re||oe[20]!==Ae||oe[21]!==ue?(ke=jsxRuntimeExports.jsx(SelectMulti,{defaultChecked:!0,placeholder:Te,trigger:Re,items:Ae,value:ue,onChange:pe}),oe[17]=pe,oe[18]=Te,oe[19]=Re,oe[20]=Ae,oe[21]=ue,oe[22]=ke):ke=oe[22],ke}function _temp$8(ne){const{id:oe,name:ce,description:ue,hidden:pe}=ne;return{value:oe,label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{component:"div",children:ce}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:ue})]}),disabled:pe}}function useRendererResolver(ne){var xe,ve;const oe=compilerRuntimeExports.c(5),[ce]=useRenderers();let ue,pe;oe[0]!==ce?(pe=lodashExports.head(ce),oe[0]=ce,oe[1]=pe):pe=oe[1],ue=pe;const me=ue,ge=ne&&ne!=="internal:auto"?ne:(ve=(xe=me==null?void 0:me.renderer)==null?void 0:xe.meta)==null?void 0:ve.id;let ye;return oe[2]!==me||oe[3]!==ge?(ye={auto:me,selected:ge},oe[2]=me,oe[3]=ge,oe[4]=ye):ye=oe[4],ye}const divider$1=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1}});function ViewportPage({template:ne}){var Ae,ke;const{controls:oe,onChange:ce,state:ue,dragHandle:pe}=useViewTreeContext(),[me]=useRenderers(),ge=usePaper(),ye=useAcrylic(),[{layers:xe}]=useLayers(),[ve,_e]=reactExports.useState({}),we=reactExports.useMemo(()=>lodashExports.filter(xe,Be=>(ve==null?void 0:ve[Be.key])??!0),[ve,xe,xe==null?void 0:xe.length]),[Se,$e]=reactExports.useState(),{selected:Te,auto:Re}=useRendererResolver(ue==null?void 0:ue.renderer);return reactExports.useEffect(()=>{lodashExports.delay(()=>{var Be;(Be=Se==null?void 0:Se.fitCamera)==null||Be.call(Se,Ie=>{var Ne;return lodashExports.chain(we).filter("viewKey").map("key").includes(((Ne=Ie.meta)==null?void 0:Ne.sourceLayer)??"").value()})},150)},[Se,lodashExports.chain(we).map("viewKey").sort().join(".").value()]),jsxRuntimeExports.jsxs(ne,{onChange:ce,stack:ue,children:[jsxRuntimeExports.jsx(ne.Key,{children:"viewport"}),jsxRuntimeExports.jsx(ne.Title,{children:"Viewport"}),jsxRuntimeExports.jsx(ne.Handle,{children:pe}),jsxRuntimeExports.jsx(ne.Content,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(AutoSizer,{children:Be=>jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(TraceRenderer,{...Be,layers:we,renderer:Te,rendererRef:$e}),jsxRuntimeExports.jsx(Stack,{sx:{pt:6,position:"absolute",top:0,left:0},children:jsxRuntimeExports.jsxs(Stack,{direction:"row",sx:{...ge(1),...ye,alignItems:"center",height:Ie=>Ie.spacing(6),px:1,m:1},children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",disabled:!Se,onClick:()=>{Se==null||Se.fitCamera()},label:"Fit",icon:jsxRuntimeExports.jsx(SvgIcon$g,{})}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",disabled:!Se,onClick:()=>{var Ie;(Ie=Se==null?void 0:Se.initialCamera)==null||Ie.call(Se)},icon:jsxRuntimeExports.jsx(SvgIcon$1,{}),label:"1 to 1"}),divider$1,jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",disabled:!Se,onClick:async()=>{const Ie=await(Se==null?void 0:Se.toDataUrl());Ie&&download(Ie,dist$3.generateUsername("-"))},icon:jsxRuntimeExports.jsx(SvgIcon$h,{}),label:"capture-screenshot"})]})})]})})})}),jsxRuntimeExports.jsx(ne.Options,{children:jsxRuntimeExports.jsxs(Stack,{direction:"row",children:[jsxRuntimeExports.jsx(FeaturePicker,{label:"Renderer",icon:jsxRuntimeExports.jsx(SvgIcon$Y,{}),value:(ue==null?void 0:ue.renderer)??"internal:auto",onChange:Be=>ce==null?void 0:ce({renderer:Be}),items:[{id:"internal:auto",name:`Auto (${((ke=(Ae=Re==null?void 0:Re.renderer)==null?void 0:Ae.meta)==null?void 0:ke.name)??"None"})`},...lodashExports.map(lodashExports.filter(me,Be=>!!Be.renderer),({renderer:Be})=>{var Ie,Ne,je;return{id:(Ie=Be==null?void 0:Be.meta)==null?void 0:Ie.id,name:(Ne=Be==null?void 0:Be.meta)==null?void 0:Ne.name,description:(je=Be==null?void 0:Be.meta)==null?void 0:je.id}})],arrow:!0}),divider$1,jsxRuntimeExports.jsx(FeaturePickerMulti,{defaultChecked:!0,label:"Layers",icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),value:ve,onChange:_e,items:lodashExports.map(xe,Be=>({id:Be==null?void 0:Be.key,name:inferLayerName(Be)})),showArrow:!0,ellipsis:12})]})}),jsxRuntimeExports.jsx(ne.Extras,{children:oe})]})}const pages={explore:{id:"explore",name:"Explore",color:"deepOrange",description:"Browse examples and guides",icon:jsxRuntimeExports.jsx(SvgIcon$x,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$6,{}),content:ExplorePage,allowFullscreen:!0,showInSidebar:"always"},layers:{id:"layers",name:"Layers",description:"",color:"pink",icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$b,{}),content:LayersPage,allowFullscreen:!0,showInSidebar:"mobile-only"},steps:{id:"steps",name:"Events",description:"",color:"pink",icon:jsxRuntimeExports.jsx(SvgIcon$u,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$5,{}),content:StepsPage,allowFullscreen:!0},viewport:{id:"viewport",name:"Viewport",description:"",color:"deepPurple",icon:jsxRuntimeExports.jsx(SvgIcon$o,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon,{}),content:ViewportPage,allowFullscreen:!0},tree:{id:"tree",name:"Graph",description:"",color:"deepPurple",icon:jsxRuntimeExports.jsx(SvgIcon$10,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$k,{}),content:TreePage,allowFullscreen:!0},source:{id:"source",name:"Sources",description:"",color:"deepPurple",icon:jsxRuntimeExports.jsx(SvgIcon$T,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$d,{}),content:SourcePage,allowFullscreen:!0,showInSidebar:"mobile-only"},debug:{id:"debug",name:"Debugger",description:"",color:"indigo",icon:jsxRuntimeExports.jsx(SvgIcon$W,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$i,{}),content:DebugPage,allowFullscreen:!0,showInSidebar:"mobile-only"},info:{id:"info",name:"Logs",description:"",color:"grey",icon:jsxRuntimeExports.jsx(SvgIcon$F,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$a,{}),content:InfoPage,allowFullscreen:!0},settings:{id:"settings",name:"Settings",description:"",color:"grey",icon:jsxRuntimeExports.jsx(SvgIcon$t,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$4,{}),content:SettingsPage,allowFullscreen:!0,showInSidebar:"always"}},ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(oe){super(oe),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(oe){return{didCatch:!0,error:oe}}resetErrorBoundary(){const{error:oe}=this.state;if(oe!==null){for(var ce,ue,pe=arguments.length,me=new Array(pe),ge=0;ge0&&arguments[0]!==void 0?arguments[0]:[],oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return ne.length!==oe.length||ne.some((ce,ue)=>!Object.is(ce,oe[ue]))}const divider=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1,height:ne=>ne.spacing(3),alignSelf:"auto"}}),Page=withSlots(({slotProps:ne,onChange:oe,stack:ce})=>{var pe,me,ge,ye;const ue=useAcrylic();return jsxRuntimeExports.jsx(ErrorBoundary,{fallbackRender:xe=>{var ve,_e;return jsxRuntimeExports.jsxs(Stack,{sx:{background:we=>we.palette.background.paper,height:"100%"},children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",sx:{height:we=>we.spacing(6),alignItems:"center",pl:1,borderBottom:1,borderColor:"divider"},children:[(ve=ne.Handle)==null?void 0:ve.children,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$n,{}),label:"Choose View",onChange:we=>oe==null?void 0:oe({...ce,type:we}),value:ce==null?void 0:ce.type,items:lodashExports.values(pages),itemOrientation:"vertical"}),jsxRuntimeExports.jsx(Space,{sx:{mx:"auto"}}),(_e=ne.Extras)==null?void 0:_e.children]}),jsxRuntimeExports.jsx(Placeholder$2,{secondary:`${xe.error}`,icon:jsxRuntimeExports.jsx(SvgIcon$M,{})})]})},children:jsxRuntimeExports.jsxs(Flex,{vertical:!0,children:[jsxRuntimeExports.jsx(Flex,{sx:{position:"absolute",top:0,left:0,width:"100%"},children:jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"100%",bgcolor:"background.paper"},children:(pe=ne.Content)==null?void 0:pe.children})}),jsxRuntimeExports.jsxs(Flex,{sx:{height:xe=>xe.spacing(6),alignItems:"center"},children:[jsxRuntimeExports.jsx(Flex,{sx:{p:0,position:"absolute",top:0,left:0,width:"100%",borderBottom:1,borderColor:"divider",alignItems:"center",pr:6,...ue},children:jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsxs(Flex,{sx:{width:"max-content",height:xe=>xe.spacing(6),alignItems:"center",p:1},children:[(me=ne.Handle)==null?void 0:me.children,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$n,{}),label:"Choose View",onChange:xe=>oe==null?void 0:oe({...ce,type:xe}),value:ce==null?void 0:ce.type,items:lodashExports.values(pages),itemOrientation:"vertical"}),((ge=ne.Options)==null?void 0:ge.children)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[divider,ne.Options.children]})]})})}),jsxRuntimeExports.jsx(Space,{sx:{mx:"auto"}}),(ye=ne.Extras)==null?void 0:ye.children]})]})})}),SidebarPage=withSlots(({slotProps:ne})=>{var pe,me,ge;const oe=useSidebarBackground(),ce=useAcrylic(oe),[,ue]=useUIState();return jsxRuntimeExports.jsx(ErrorBoundary,{fallback:jsxRuntimeExports.jsx(Box,{sx:{p:6,background:ye=>ye.palette.background.paper,height:"100%"},children:"This page encountered an error."}),children:jsxRuntimeExports.jsxs(Flex,{vertical:!0,children:[jsxRuntimeExports.jsx(Flex,{sx:{position:"absolute",top:0,left:0,width:"100%"},children:jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"100%",bgcolor:oe},children:(pe=ne.Content)==null?void 0:pe.children})}),jsxRuntimeExports.jsx(Flex,{sx:{height:ye=>ye.spacing(6)},children:jsxRuntimeExports.jsxs(Flex,{sx:{p:0,position:"absolute",top:0,left:0,width:"100%",borderBottom:1,borderColor:"divider",alignItems:"center",...ce},children:[jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsxs(Flex,{sx:{width:"max-content",height:ye=>ye.spacing(6),alignItems:"center",p:1},children:[jsxRuntimeExports.jsx(Typography,{component:"div",sx:{p:1,color:"text.secondary"},children:(me=ne.Title)==null?void 0:me.children}),((ge=ne.Options)==null?void 0:ge.children)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[divider,ne.Options.children]})]})}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{onClick:()=>{ue(()=>{var ye;return{fullscreenModal:(ye=ne.Key)==null?void 0:ye.children,sidebarOpen:!1}})},size:"small",sx:{m:1},icon:jsxRuntimeExports.jsx(SvgIcon$I,{sx:{color:"text.secondary"},fontSize:"small"}),label:"Maximise"})]})})]})})});var sysend$1={exports:{}};/**@license + }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(ne){this._stylesheet!==ne&&(this._stylesheet=ne,this.styleID++)}normalizeColor(ne){return Array.isArray(ne)&&(ne=rgb2hex(ne)),typeof ne=="number"?hex2string(ne):ne}dropShadowToCSS(){let ne=this.normalizeColor(this.dropShadowColor);const oe=this.dropShadowAlpha,ce=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),ue=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);ne.startsWith("#")&&oe<1&&(ne+=(oe*255|0).toString(16).padStart(2,"0"));const pe=`${ce}px ${ue}px`;return this.dropShadowBlur>0?`text-shadow: ${pe} ${this.dropShadowBlur}px ${ne}`:`text-shadow: ${pe} ${ne}`}reset(){Object.assign(this,_HTMLTextStyle.defaultOptions)}onBeforeDraw(){const{fontsDirty:ne}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&ne?new Promise(oe=>setTimeout(oe,100)):Promise.resolve()}get isSafari(){const{userAgent:ne}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(ne)}set fillGradientStops(ne){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(ne){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(ne){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(ne){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(ne){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(ne){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(ne){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};let HTMLTextStyle=_HTMLTextStyle;HTMLTextStyle.availableFonts={};HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};const _HTMLText=class extends Sprite{constructor(ne="",oe={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this._loading=!1,this.localStyleID=-1,this.dirty=!1,this.ownsStyle=!1;const ce=new Image,ue=Texture.from(ce,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});ue.orig=new Rectangle,ue.trim=new Rectangle,this.texture=ue;const pe="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml",ge=document.createElementNS(pe,"svg"),ye=document.createElementNS(pe,"foreignObject"),xe=document.createElementNS(me,"div"),ve=document.createElementNS(me,"style");ye.setAttribute("width","10000"),ye.setAttribute("height","10000"),ye.style.overflow="hidden",ge.appendChild(ye),this.maxWidth=_HTMLText.defaultMaxWidth,this.maxHeight=_HTMLText.defaultMaxHeight,this._domElement=xe,this._styleElement=ve,this._svgRoot=ge,this._foreignObject=ye,this._foreignObject.appendChild(ve),this._foreignObject.appendChild(xe),this._image=ce,this._loadImage=new Image,this._autoResolution=_HTMLText.defaultAutoResolution,this._resolution=_HTMLText.defaultResolution??settings.RESOLUTION,this.text=ne,this.style=oe}measureText(ne){var ye,xe;const{text:oe,style:ce,resolution:ue}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},ne);Object.assign(this._domElement,{innerHTML:oe,style:ce.toCSS(ue)}),this._styleElement.textContent=ce.toGlobalCSS(),document.body.appendChild(this._svgRoot);const pe=this._domElement.getBoundingClientRect();this._svgRoot.remove();const me=Math.min(this.maxWidth,Math.ceil(pe.width)),ge=Math.min(this.maxHeight,Math.ceil(pe.height));return this._svgRoot.setAttribute("width",me.toString()),this._svgRoot.setAttribute("height",ge.toString()),oe!==this._text&&(this._domElement.innerHTML=this._text),ce!==this._style&&(Object.assign(this._domElement,{style:(ye=this._style)==null?void 0:ye.toCSS(ue)}),this._styleElement.textContent=(xe=this._style)==null?void 0:xe.toGlobalCSS()),{width:me+ce.padding*2,height:ge+ce.padding*2}}async updateText(ne=!0){const{style:oe,_image:ce,_loadImage:ue}=this;if(this.localStyleID!==oe.styleID&&(this.dirty=!0,this.localStyleID=oe.styleID),!this.dirty&&ne)return;const{width:pe,height:me}=this.measureText();ce.width=ue.width=Math.ceil(Math.max(1,pe)),ce.height=ue.height=Math.ceil(Math.max(1,me)),this._loading||(this._loading=!0,await new Promise(ge=>{ue.onload=async()=>{await oe.onBeforeDraw(),this._loading=!1,ce.src=ue.src,ue.onload=null,ue.src="",this.updateTexture(),ge()};const ye=new XMLSerializer().serializeToString(this._svgRoot);ue.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ye)}`}))}get source(){return this._image}updateTexture(){const{style:ne,texture:oe,_image:ce,resolution:ue}=this,{padding:pe}=ne,{baseTexture:me}=oe;oe.trim.width=oe._frame.width=ce.width/ue,oe.trim.height=oe._frame.height=ce.height/ue,oe.trim.x=-pe,oe.trim.y=-pe,oe.orig.width=oe._frame.width-pe*2,oe.orig.height=oe._frame.height-pe*2,this._onTextureUpdate(),me.setRealSize(ce.width,ce.height,ue),this.dirty=!1}_render(ne){this._autoResolution&&this._resolution!==ne.resolution&&(this._resolution=ne.resolution,this.dirty=!0),this.updateText(!0),super._render(ne)}_renderCanvas(ne){this._autoResolution&&this._resolution!==ne.resolution&&(this._resolution=ne.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(ne)}getLocalBounds(ne){return this.updateText(!0),super.getLocalBounds(ne)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(ne){var ce,ue,pe,me,ge;typeof ne=="boolean"&&(ne={children:ne}),ne=Object.assign({},_HTMLText.defaultDestroyOptions,ne),super.destroy(ne);const oe=null;this.ownsStyle&&((ce=this._style)==null||ce.cleanFonts()),this._style=oe,(ue=this._svgRoot)==null||ue.remove(),this._svgRoot=oe,(pe=this._domElement)==null||pe.remove(),this._domElement=oe,(me=this._foreignObject)==null||me.remove(),this._foreignObject=oe,(ge=this._styleElement)==null||ge.remove(),this._styleElement=oe,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=oe,this._image.src="",this._image=oe}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(ne){this.updateText(!0);const oe=sign(this.scale.x)||1;this.scale.x=oe*ne/this._image.width/this.resolution,this._width=ne}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(ne){this.updateText(!0);const oe=sign(this.scale.y)||1;this.scale.y=oe*ne/this._image.height/this.resolution,this._height=ne}get style(){return this._style}set style(ne){this._style!==ne&&(ne=ne||{},ne instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=ne):ne instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(ne)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(ne)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(ne){ne=String(ne===""||ne===null||ne===void 0?" ":ne),ne=this.sanitiseText(ne),this._text!==ne&&(this._text=ne,this.dirty=!0)}get resolution(){return this._resolution}set resolution(ne){this._autoResolution=!1,this._resolution!==ne&&(this._resolution=ne,this.dirty=!0)}sanitiseText(ne){return ne.replace(/
/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};let HTMLText=_HTMLText;HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0};HTMLText.defaultMaxWidth=2024;HTMLText.defaultMaxHeight=2024;HTMLText.defaultAutoResolution=!0;const{max:max$2,min:min$2}=Math;function handleNaN(ne,oe){return lodashExports.isNaN(ne)?oe:ne}var Xo,Io;class D2RendererBase extends EventEmitter$1{constructor(){super(...arguments);ai(this,Xo);ai(this,Io);this.options=defaultD2RendererOptions,this.system=new Bush(16),Jn(this,Xo,0),Jn(this,Io,lodashExports.once(()=>{if(typeof OffscreenCanvas>"u")return"OffscreenCanvas API is not supported by your system."})),this.getFrustumChangeQueue=lodashExports.once(()=>lodashExports.debounce(()=>this.handleFrustumChange(),this.options.debounceInterval))}next(){return ku(this,Xo)._++}setup(ce){if(xn(this,Io).call(this))throw new Error(xn(this,Io).call(this));const ue={...defaultD2RendererOptions,...ce};this.setupPixi(ue),this.setOptions(ue)}setupPixi(ce){this.app=new Application({backgroundAlpha:0,width:ce.screenSize.width,height:ce.screenSize.height,autoDensity:!0,resolution:2}),this.setupViewport(ce),this.setupOverlay()}setupOverlay(){this.viewport&&(this.overlay=new Graphics,this.viewport.addChild(this.overlay))}setupViewport(ce){this.app&&(this.viewport=new ht({stopPropagation:!0,screenWidth:ce.screenSize.width,screenHeight:ce.screenSize.height,events:this.app.renderer.events,passiveWheel:!1}),this.viewport.on("clicked",ue=>{const{x:pe,y:me}=ue.world,ge=this.system.search({minX:pe,minY:me,maxX:pe+Number.MIN_VALUE,maxY:me+Number.MIN_VALUE}).filter(ye=>primitives[ye.component.$].narrow(ye.component,{x:pe,y:me}));this.emit("click",ue.event,{world:ue.world,components:ge})}),this.app.stage.addChild(this.viewport),this.viewport.drag().pinch().wheel().decelerate({friction:.98}).clampZoom({maxScale:300,minScale:1e-5}),this.viewport.on("moved",()=>{this.getFrustumChangeQueue()()}))}destroy(){var ce,ue;(ue=(ce=this.app)==null?void 0:ce.destroy)==null||ue.call(ce)}handleWindowSizeChange(ce){var me,ge,ye,xe;const{width:ue,height:pe}=ce.screenSize;(ye=(ge=(me=this.app)==null?void 0:me.renderer)==null?void 0:ge.resize)==null||ye.call(ge,ue,pe),(xe=this.viewport)==null||xe.resize(ue,pe)}setOptions(ce){const ue={...this.options,...ce};this.handleWindowSizeChange(ue),this.options=ue,this.handleFrustumChange()}add(ce){const ue=this.makeBodies(ce);return this.system.load(ue),()=>{for(const pe of ue)this.system.remove(pe)}}getPx(){if(!this.viewport)return 1;const{right:ce,left:ue}=this.viewport,{width:pe}=this.options.screenSize;return(ce-ue)/pe}makeBodies(ce){return ce.map(({component:ue,meta:pe})=>({...defaultBounds,...lodashExports.pickBy(primitives[ue.$].test(ue),isValue),component:ue,meta:pe,index:this.next()}))}getView(){var ce;return(ce=this.app)==null?void 0:ce.view}fitCamera(ce=lodashExports.constant(!0)){var pe,me,ge,ye;const ue=lodashExports.values(this.system.all()).flat().filter(ce);if(ue.length){const xe=this.getBounds(ue);(ye=(pe=this.viewport)==null?void 0:pe.animate)==null||ye.call(pe,{position:new Point$2((xe.left+xe.right)/2,(xe.top+xe.bottom)/2),scale:((ge=(me=this.viewport)==null?void 0:me.findFit)==null?void 0:ge.call(me,xe.right-xe.left,xe.bottom-xe.top))*.8,ease:"easeOutExpo",time:this.options.animationDuration*1.5,callbackOnComplete:()=>this.getFrustumChangeQueue()()})}}getBounds(ce){return lodashExports.reduce(ce,(ue,pe)=>({top:handleNaN(min$2(ue.top,pe.top),ue.top),left:handleNaN(min$2(ue.left,pe.left),ue.left),bottom:handleNaN(max$2(ue.bottom,pe.bottom),ue.bottom),right:handleNaN(max$2(ue.right,pe.right),ue.right)}),{bottom:-1/0,top:1/0,left:1/0,right:-1/0})}handleFrustumChange(){}initialCamera(){var ce,ue;(ue=(ce=this.viewport)==null?void 0:ce.animate)==null||ue.call(ce,{scale:1,ease:"easeOutExpo",time:this.options.animationDuration*1.5,callbackOnComplete:()=>this.getFrustumChangeQueue()()})}getInstance(){return{app:this.app,viewport:this.viewport}}async toDataUrl(){var ce,ue,pe,me,ge;return(ue=(ce=this.app)==null?void 0:ce.render)==null||ue.call(ce),(ge=(me=(pe=this.app)==null?void 0:pe.view)==null?void 0:me.toDataURL)==null?void 0:ge.call(me)}}Xo=new WeakMap,Io=new WeakMap;function makeRenderer(ne,oe){return{constructor:ne,meta:oe}}const url=""+new URL("D2Renderer.worker-D5n7AaL-.js",import.meta.url).href;class D2RendererWorkerAdapter extends Worker{constructor(){super(url,{type:"module"})}call(oe,ce,ue=[]){return this.postMessage({action:oe,payload:ce},ue)}on(oe,ce){const ue=pe=>{const{action:me,payload:ge}=pe.data;me===oe&&ce(ge)};return this.addEventListener("message",ue),()=>this.removeEventListener("message",ue)}}function intersect(ne,oe){return!(oe.left>=ne.right||oe.right<=ne.left||oe.top>=ne.bottom||oe.bottom<=ne.top)}const Va=class Va extends Sprite{constructor(oe,ce){super(oe),this.bounds=ce,this.destroying=!1,this.age=Va.age++}};Va.age=0;let Tile=Va;var Zi,gi,ji,ko,Zo,Fn,Ou,Du,Lu,pl,Bu,Nu,Fu,ju;class D2Renderer extends D2RendererBase{constructor(){super(...arguments);ai(this,Fn);ai(this,Zi);ai(this,gi);ai(this,ji);ai(this,ko);ai(this,Zo);this.options=defaultD2RendererOptions,this.system=new Bush(16),Jn(this,gi,[]),Jn(this,ko,lodashExports.once(()=>lodashExports.throttle(()=>Ri(this,Fn,pl).call(this),this.options.refreshInterval))),Jn(this,Zo,lodashExports.once(()=>lodashExports.throttle(ce=>Ri(this,Fn,Bu).call(this,ce),this.options.refreshInterval)))}setupPixi(ce){super.setupPixi(ce),this.viewport&&(Jn(this,Zi,new Container),this.viewport.addChild(xn(this,Zi)),Jn(this,ji,new Graphics),this.viewport.addChild(xn(this,ji)),Ri(this,Fn,Ou).call(this))}setup(ce){super.setup(ce),Ri(this,Fn,Du).call(this,this.options)}destroy(){lodashExports.map(xn(this,gi),ce=>ce.terminate()),super.destroy()}add(ce){var me,ge;const ue=nanoid(),pe=super.add(ce);return(ge=(me=xn(this,gi))==null?void 0:me.forEach)==null||ge.call(me,ye=>ye.call("add",[ce,ue])),()=>{requestIdleCallback(()=>{var ye,xe;pe(),(xe=(ye=xn(this,gi))==null?void 0:ye.forEach)==null||xe.call(ye,ve=>ve.call("remove",[ue]))},{timeout:this.options.animationDuration})}}setOptions(ce){super.setOptions(ce),Ri(this,Fn,pl).call(this)}setupViewport(ce){super.setupViewport(ce),this.viewport&&(this.viewport.on("moved",()=>{xn(this,ko).call(this)()}),this.viewport.on("mousemove",ue=>xn(this,Zo).call(this)(ue)))}handleWindowSizeChange(ce){super.handleWindowSizeChange(ce),lodashExports.map(xn(this,gi),ue=>{ue.call("setTileResolution",[{width:lodashExports.ceil(ce.tileResolution.width),height:lodashExports.ceil(ce.tileResolution.height)}])})}handleFrustumChange(){if(!this.viewport)return;const{top:ce,bottom:ue,left:pe,right:me}=this.viewport;lodashExports.map(xn(this,gi),ge=>ge.call("setFrustum",[{top:ce,bottom:ue,left:pe,right:me}]))}}Zi=new WeakMap,gi=new WeakMap,ji=new WeakMap,ko=new WeakMap,Zo=new WeakMap,Fn=new WeakSet,Ou=function(){const{dynamicResolution:ce}=this.options,{dtMax:ue,dtMin:pe,increment:me,intervalMs:ge,maxScale:ye,minScale:xe}=ce,ve=lodashExports.floor(Ticker.targetFPMS*ge);let _e=0,we=0,Se=1;this.app.ticker.add($e=>{const{tileResolution:Te}=this.options;if(!(_e%ve)){const Re=we/ve;Se=lodashExports.clamp(Re>=ue?Se+me:Re<=pe?Se-me:Se,xe,ye),lodashExports.map(xn(this,gi),Ae=>{Ae.call("setTileResolution",[{width:lodashExports.ceil(Te.width/Se),height:lodashExports.ceil(Te.height/Se)}])}),we=0}we+=$e,_e++})},Du=function(ce){lodashExports.map(xn(this,gi),ue=>ue.terminate()),Jn(this,gi,lodashExports.times(ce.workerCount,ue=>{const pe=new D2RendererWorkerAdapter;return pe.on("update",me=>Ri(this,Fn,Lu).call(this,me)),pe.onerror=me=>{throw me},pe.call("setup",[{...ce,workerIndex:ue}]),pe}))},Lu=function({bounds:ce,bitmap:ue}){const pe=Texture.from(ue);Ri(this,Fn,Nu).call(this,pe,ce)},pl=function(){var ge,ye,xe,ve,_e;if(!this.viewport)return;const{tileSubdivision:ce,accentColor:ue}=this.options,{tiles:pe}=getTiles(this.viewport,ce),me=this.getPx();(ge=xn(this,ji))==null||ge.clear(),(ye=xn(this,ji))==null||ye.lineStyle(1*me,ue,.5),(xe=xn(this,ji))==null||xe.beginFill(ue,.05);for(const{bounds:we}of pe)lodashExports.find((ve=xn(this,Zi))==null?void 0:ve.children,Se=>lodashExports.isEqual(Se.bounds,we))||(_e=xn(this,ji))==null||_e.drawRect(we.left,we.top,we.right-we.left,we.bottom-we.top)},Bu=function(ce){var xe;const{accentColor:ue}=this.options,pe=this.getPx(),{x:me,y:ge}=this.viewport.toWorld(ce.globalX,ce.globalY),ye=this.system.search({minX:me,minY:ge,maxX:me+Number.MIN_VALUE,maxY:ge+Number.MIN_VALUE}).filter(ve=>primitives[ve.component.$].narrow(ve.component,{x:me,y:ge}));this.overlay.clear();for(const ve of ye)this.overlay.lineStyle(2*pe,ue,"$info"in ve.component?1:.02),(xe=this.overlay)==null||xe.drawRect(ve.left,ve.top,ve.right-ve.left,ve.bottom-ve.top)},Nu=async function(ce,ue){var xe,ve;if(!this.viewport)return;const{tileSubdivision:pe}=this.options,{tiles:me}=getTiles(this.viewport,pe);if(!lodashExports.find(me,_e=>lodashExports.isEqual(_e.bounds,ue)))return;const ge={x:(ue.right-ue.left)/ce.width,y:(ue.bottom-ue.top)/ce.height},ye=new Tile(ce,ue);(xe=xn(this,Zi))==null||xe.addChild(ye).setTransform(ue.left,ue.top,ge.x,ge.y),xn(this,ko).call(this)(),await Ri(this,Fn,Fu).call(this,ye),lodashExports.forEach((ve=xn(this,Zi))==null?void 0:ve.children,async _e=>{intersect(_e.bounds,ue)&&_e.age{const me=ge=>{ce.alpha+=ge/Ticker.targetFPMS/this.options.animationDuration,ce.alpha>1&&(ue.remove(me),pe())};ce.alpha=0,ue.add(me)})},ju=function(ce){const ue=this.app.ticker;return new Promise(pe=>{const me=ge=>{ce.alpha-=ge/Ticker.targetFPMS/this.options.animationDuration,ce.alpha<0&&(ue.remove(me),pe())};ce.alpha=1,ue.add(me)})};const D2Renderer$1=makeRenderer(D2Renderer,{components:["rect","circle","path","polygon"],id:"d2-renderer",name:"Pixel",description:"Comfortably performant 2D renderer",version:"1.0.0"}),{max:max$1,min:min$1}=Math,CANVAS_MAXSIZE=4095,canvas=new OffscreenCanvas(1,1),getCanvas=(ne,oe)=>{var ce,ue;return canvas.width=max$1(1,lodashExports.ceil(ne)),canvas.height=max$1(1,lodashExports.ceil(oe)),(ue=(ce=canvas.getContext("2d"))==null?void 0:ce.clearRect)==null||ue.call(ce,0,0,canvas.width,canvas.height),canvas},getClampedScale=(ne,oe)=>min$1(max$1(lodashExports.round(ne)/devicePixelRatio,1),oe);var Qo,Jo;class Elem extends Sprite{constructor(ce,ue,pe){const me=CANVAS_MAXSIZE/max$1(ce.right-ce.left,ce.bottom-ce.top,1);super(getTexture(ce,ue,getClampedScale(pe,me)));ai(this,Qo,1);ai(this,Jo,1);this.bounds=ce,this.bodies=ue,this.rerender(pe,ce,ue,me),Jn(this,Jo,me)}rerender(ce,ue=this.bounds,pe=this.bodies,me=xn(this,Jo)){const ge=getClampedScale(ce,me);if(ge===xn(this,Qo))return;const ye=getTexture(ue,pe,ge);this.texture=ye,this.setTransform(ue.left,ue.top,1/ge,1/ge),Jn(this,Qo,ge)}}Qo=new WeakMap,Jo=new WeakMap;function getTexture(ne,oe,ce){const ue=getCanvas((ne.right-ne.left)*ce,(ne.bottom-ne.top)*ce),pe=ue.getContext("2d");for(const{component:me}of oe)draw(me,pe,{scale:{x:ce,y:ce},x:-(ne.left*ce),y:-(ne.top*ce)});return Texture.from(ue.transferToImageBitmap())}var zi,Ya;class D2MinimalRenderer extends D2RendererBase{constructor(){super(...arguments);ai(this,zi);ai(this,Ya);Jn(this,Ya,50),this.getFrustumChangeQueue=lodashExports.once(()=>lodashExports.debounce(()=>this.handleFrustumChange(),this.options.animationDuration))}setupPixi(ce){super.setupPixi(ce),this.viewport&&(Jn(this,zi,new Container),this.viewport.addChild(xn(this,zi)))}add(ce){var ue,pe;if(ce.length){const me=super.add(ce),ge=this.makeBodies(ce),ye=this.getBounds(ge),xe=new Elem(ye,ge,1/this.getPx());return(pe=(ue=xn(this,zi))==null?void 0:ue.addChild)==null||pe.call(ue,xe),()=>{var ve,_e;me(),(_e=(ve=xn(this,zi))==null?void 0:ve.removeChild)==null||_e.call(ve,xe),xe.destroy()}}return()=>{}}handleFrustumChange(){if(!xn(this,zi)||!this.viewport)return;const ce=1/this.getPx(),{left:ue,right:pe,top:me,bottom:ge}=this.viewport;for(const ye of xn(this,zi).children)intersect(ye.bounds,{left:ue,right:pe,top:me,bottom:ge})?ye.rerender(ce):ye.rerender(1)}}zi=new WeakMap,Ya=new WeakMap;const D2MinimalRenderer$1=makeRenderer(D2MinimalRenderer,{components:["rect","circle","path","polygon"],id:"d2-minimal-renderer",name:"Pixel Nano",description:"Simple 2D renderer",version:"1.0.0"}),renderers={"d2-renderer":D2Renderer$1,"d2-minimal-renderer":D2MinimalRenderer$1};class NativeRendererTransport{constructor(oe){this.options=oe}async get(){const{hostname:oe}=url$3(this.options.url);return renderers[oe]}}const transports={native:{name:"Internal",constructor:NativeRendererTransport}};function RendererService(){const ne=compilerRuntimeExports.c(9),[oe]=useSettings(),{renderer:ce}=oe,[,ue]=useRenderers();let pe;ne[0]!==ce||ne[1]!==ue?(pe=async()=>{const xe=[];for(const{transport:ve,url:_e,key:we,disabled:Se}of ce??[])if(!Se){const $e=new transports[ve].constructor({url:_e});xe.push({key:we,url:_e,renderer:await $e.get()})}ue(()=>xe)},ne[0]=ce,ne[1]=ue,ne[2]=pe):pe=ne[2];let me;ne[3]!==ce?(me=JSON.stringify(ce),ne[3]=ce,ne[4]=me):me=ne[4];let ge;ne[5]!==ue||ne[6]!==me?(ge=[me,ue],ne[5]=ue,ne[6]=me,ne[7]=ge):ge=ne[7],useAsync(pe,ge);let ye;return ne[8]===Symbol.for("react.memo_cache_sentinel")?(ye=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),ne[8]=ye):ye=ne[8],ye}const statusColor$1={connected:"success.light",connecting:"warning.light",error:"error.light",disabled:"text.disabled"};function RendererEditor(ne){const oe=compilerRuntimeExports.c(35),{value:ce,onValueChange:ue}=ne,[pe]=useRenderers(),me=usePaper();let ge;oe[0]!==pe||oe[1]!==ce.key?(ge=lodashExports.find(pe,{key:ce.key}),oe[0]=pe,oe[1]=ce.key,oe[2]=ge):ge=oe[2];const ye=ge;let xe;oe[3]!==ue||oe[4]!==ce?(xe=function(Ue){ue==null||ue(merge$6(ce,Ue))},oe[3]=ue,oe[4]=ce,oe[5]=xe):xe=oe[5];const ve=xe,_e=ce!=null&&ce.disabled?"disabled":ye!=null&&ye.renderer?"connected":"error";let we;oe[6]===Symbol.for("react.memo_cache_sentinel")?(we={paper:{sx:{width:480}},popover:{anchorOrigin:{horizontal:-18,vertical:"bottom"}}},oe[6]=we):we=oe[6];let Se;oe[7]!==ye||oe[8]!==ve||oe[9]!==me||oe[10]!==_e||oe[11]!==ce.disabled||oe[12]!==ce.key||oe[13]!==ce.transport||oe[14]!==ce.url?(Se=ze=>{var Ue,qe,Ke,Ge,Ye,Xe,Je,Qe,Ze;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{className:ce.key,onClick:ze,flex:1,sx:{width:0,overflow:"hidden","> *":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},children:[jsxRuntimeExports.jsx(Typography,{component:"div",children:ye!=null&&ye.renderer?`${(qe=(Ue=ye==null?void 0:ye.renderer)==null?void 0:Ue.meta)==null?void 0:qe.name} ${(Ge=(Ke=ye.renderer)==null?void 0:Ke.meta)==null?void 0:Ge.version}`:lodashExports.startCase(_e)}),!!(ye!=null&&ye.renderer)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{children:(Xe=(Ye=ye.renderer)==null?void 0:Ye.meta)==null?void 0:Xe.description}),jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsxs("span",{children:["Contributes"," ",lodashExports.join((Qe=(Je=ye.renderer)==null?void 0:Je.meta)==null?void 0:Qe.components,", ")]})]})}),jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",children:[(Ze=transports[ce==null?void 0:ce.transport])==null?void 0:Ze.name,": ",(ce==null?void 0:ce.url)||"No URL"]})]}),jsxRuntimeExports.jsx(Chip,{sx:{minWidth:0,maxWidth:"fit-content",flex:1,mx:1,color:statusColor$1[_e],...lodashExports.omit(me(1),"borderRadius")},size:"small",label:lodashExports.startCase(_e)}),jsxRuntimeExports.jsx(Tooltip,{title:`${ce.disabled?"Enable":"Disable"} Renderer`,children:jsxRuntimeExports.jsx(Box,{mr:-3,children:jsxRuntimeExports.jsx(Switch$1,{checked:!ce.disabled,onChange:(Tt,Ut)=>ve({disabled:!Ut})})})})]})},oe[7]=ye,oe[8]=ve,oe[9]=me,oe[10]=_e,oe[11]=ce.disabled,oe[12]=ce.key,oe[13]=ce.transport,oe[14]=ce.url,oe[15]=Se):Se=oe[15];let $e;oe[16]===Symbol.for("react.memo_cache_sentinel")?($e={children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Edit Renderer"})},oe[16]=$e):$e=oe[16];let Te;oe[17]!==ve?(Te=ze=>ve({url:ze.target.value}),oe[17]=ve,oe[18]=Te):Te=oe[18];let Re;oe[19]===Symbol.for("react.memo_cache_sentinel")?(Re={mb:2},oe[19]=Re):Re=oe[19];let Ae;oe[20]!==Te||oe[21]!==ce.url?(Ae=jsxRuntimeExports.jsx(TextField,{autoFocus:!0,defaultValue:ce.url,onChange:Te,fullWidth:!0,variant:"filled",label:"URL",sx:Re}),oe[20]=Te,oe[21]=ce.url,oe[22]=Ae):Ae=oe[22];let ke;oe[23]===Symbol.for("react.memo_cache_sentinel")?(ke=lodashExports.entries(transports).map(_temp$e),oe[23]=ke):ke=oe[23];let Be;oe[24]!==ve?(Be=ze=>ve({transport:ze}),oe[24]=ve,oe[25]=Be):Be=oe[25];let Ie;oe[26]!==Be||oe[27]!==ce.transport?(Ie=jsxRuntimeExports.jsx(SelectField,{placeholder:"Renderer Type",items:ke,fullWidth:!0,value:ce.transport,onChange:Be}),oe[26]=Be,oe[27]=ce.transport,oe[28]=Ie):Ie=oe[28];let Ne;oe[29]!==Ie||oe[30]!==Ae?(Ne=jsxRuntimeExports.jsxs(Box,{p:2.5,children:[Ae,Ie]}),oe[29]=Ie,oe[30]=Ae,oe[31]=Ne):Ne=oe[31];let je;return oe[32]!==Ne||oe[33]!==Se?(je=jsxRuntimeExports.jsx(Flex,{alignItems:"center",py:1,children:jsxRuntimeExports.jsx(ManagedModal,{slotProps:we,popover:!0,trigger:Se,appBar:$e,children:Ne})}),oe[32]=Ne,oe[33]=Se,oe[34]=je):je=oe[34],je}function _temp$e(ne){const[oe,ce]=ne,{name:ue}=ce;return{value:oe,label:ue}}function RendererListEditor(){const ne=compilerRuntimeExports.c(10),[oe,ce]=useSettings(),{renderer:ue}=oe;let pe;ne[0]===Symbol.for("react.memo_cache_sentinel")?(pe={mx:-2},ne[0]=pe):pe=ne[0];let me;ne[1]!==ce?(me=lodashExports.debounce(ve=>ce(()=>({renderer:ve})),300),ne[1]=ce,ne[2]=me):me=ne[2];let ge;ne[3]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(SvgIcon$z,{}),ne[3]=ge):ge=ne[3];let ye;ne[4]!==ce?(ye=jsxRuntimeExports.jsx(FeaturePickerButton,{icon:ge,onClick:()=>ce(_temp3$6),children:"Reset"}),ne[4]=ce,ne[5]=ye):ye=ne[5];let xe;return ne[6]!==ue||ne[7]!==me||ne[8]!==ye?(xe=jsxRuntimeExports.jsx(Box,{sx:pe,children:jsxRuntimeExports.jsx(ListEditor,{sortable:!0,editor:_temp$d,icon:null,value:ue,onChange:me,addItemLabel:"Add renderer",create:_temp2$8,addItemExtras:ye,onFocus:_temp4$3})}),ne[6]=ue,ne[7]=me,ne[8]=ye,ne[9]=xe):xe=ne[9],xe}function _temp4$3(ne){const oe=lodashExports.head(document.getElementsByClassName(ne));oe&&"click"in oe&&typeof oe.click=="function"&&oe.click()}function _temp3$6(){return{renderer:defaultRenderers}}function _temp2$8(){return{transport:defaultTransport,url:"",disabled:!0}}function _temp$d(ne){return jsxRuntimeExports.jsx(RendererEditor,{value:ne})}function useConnectionStatus(ne){const[oe]=useLoading(),{connections:ce}=oe,ue=useConnectionResolver(),[pe]=useSettings(),{remote:me}=pe,ge=lodashExports.find(me,{url:ne});return ge&&!(ge!=null&&ge.disabled)?ue({url:ne})?"connected":ce?"connecting":ne?"error":"not-connected":"not-connected"}const statusColor={connected:"success.light",connecting:"warning.light",error:"error.light","not-connected":"text.disabled"};function ServerEditor(ne){const oe=compilerRuntimeExports.c(32),{value:ce,onValueChange:ue}=ne,pe=useConnection(ce.url),me=usePaper(),ge=useConnectionStatus(ce.url);let ye,xe;oe[0]!==ue||oe[1]!==ce?(xe=debounce$2(je=>{ue==null||ue(merge$6(ce,je))},300),oe[0]=ue,oe[1]=ce,oe[2]=xe):xe=oe[2],ye=xe;const ve=ye;let _e;oe[3]===Symbol.for("react.memo_cache_sentinel")?(_e={paper:{sx:{width:480}},popover:{anchorOrigin:{horizontal:-18,vertical:"bottom"}}},oe[3]=_e):_e=oe[3];let we;oe[4]!==pe||oe[5]!==ve||oe[6]!==me||oe[7]!==ge||oe[8]!==ce.disabled||oe[9]!==ce.key||oe[10]!==ce.transport||oe[11]!==ce.url?(we=je=>{var ze;return jsxRuntimeExports.jsxs(Stack,{direction:"row",flex:1,alignItems:"center",sx:{py:1,mr:-3},children:[jsxRuntimeExports.jsxs(Stack,{className:ce.key,direction:"row",flex:1,alignItems:"center",onClick:je,children:[jsxRuntimeExports.jsxs(Box,{flex:1,sx:{width:0,overflow:"hidden","> *":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},children:[jsxRuntimeExports.jsx(Typography,{component:"div",children:pe?`${pe.name} ${pe.version}`:lodashExports.startCase(ge)}),!!(pe!=null&&pe.description)&&jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:pe.description}),jsxRuntimeExports.jsxs(Typography,{component:"div",variant:"body2",color:"text.secondary",children:[(ze=transports$1[ce==null?void 0:ce.transport])==null?void 0:ze.name,": ",(ce==null?void 0:ce.url)||"No URL"]})]}),jsxRuntimeExports.jsx(Chip,{sx:{flex:1,minWidth:0,maxWidth:"fit-content",mx:1,color:statusColor[ge],...lodashExports.omit(me(1),"borderRadius")},size:"small",label:lodashExports.startCase(ge)})]}),jsxRuntimeExports.jsx(Tooltip,{title:`${ce.disabled?"Enable":"Disable"} adapter`,children:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Switch$1,{defaultChecked:!ce.disabled,onChange:(Ue,qe)=>ve({disabled:!qe})})})})]})},oe[4]=pe,oe[5]=ve,oe[6]=me,oe[7]=ge,oe[8]=ce.disabled,oe[9]=ce.key,oe[10]=ce.transport,oe[11]=ce.url,oe[12]=we):we=oe[12];let Se;oe[13]===Symbol.for("react.memo_cache_sentinel")?(Se={children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Edit Adapter"})},oe[13]=Se):Se=oe[13];let $e;oe[14]!==ve?($e=je=>ve({url:je.target.value}),oe[14]=ve,oe[15]=$e):$e=oe[15];let Te;oe[16]===Symbol.for("react.memo_cache_sentinel")?(Te={mb:2},oe[16]=Te):Te=oe[16];let Re;oe[17]!==$e||oe[18]!==ce.url?(Re=jsxRuntimeExports.jsx(TextField,{autoFocus:!0,defaultValue:ce.url,onChange:$e,fullWidth:!0,variant:"filled",label:"URL",sx:Te}),oe[17]=$e,oe[18]=ce.url,oe[19]=Re):Re=oe[19];let Ae;oe[20]===Symbol.for("react.memo_cache_sentinel")?(Ae=lodashExports.entries(transports$1).map(_temp$c),oe[20]=Ae):Ae=oe[20];let ke;oe[21]!==ve?(ke=je=>ve({transport:je}),oe[21]=ve,oe[22]=ke):ke=oe[22];let Be;oe[23]!==ke||oe[24]!==ce.transport?(Be=jsxRuntimeExports.jsx(SelectField,{placeholder:"Connection Type",items:Ae,fullWidth:!0,value:ce.transport,onChange:ke}),oe[23]=ke,oe[24]=ce.transport,oe[25]=Be):Be=oe[25];let Ie;oe[26]!==Be||oe[27]!==Re?(Ie=jsxRuntimeExports.jsxs(Box,{p:2.5,children:[Re,Be]}),oe[26]=Be,oe[27]=Re,oe[28]=Ie):Ie=oe[28];let Ne;return oe[29]!==Ie||oe[30]!==we?(Ne=jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Flex,{alignItems:"center",children:jsxRuntimeExports.jsx(ManagedModal,{slotProps:_e,popover:!0,trigger:we,appBar:Se,children:Ie})})}),oe[29]=Ie,oe[30]=we,oe[31]=Ne):Ne=oe[31],Ne}function _temp$c(ne){const[oe,ce]=ne,{name:ue}=ce;return{value:oe,label:ue}}function ServerListEditor(){const ne=compilerRuntimeExports.c(10),[oe,ce]=useSettings(),{remote:ue}=oe;let pe;ne[0]===Symbol.for("react.memo_cache_sentinel")?(pe={mx:-2},ne[0]=pe):pe=ne[0];let me;ne[1]!==ce?(me=lodashExports.debounce(ve=>ce(()=>({remote:ve})),300),ne[1]=ce,ne[2]=me):me=ne[2];let ge;ne[3]===Symbol.for("react.memo_cache_sentinel")?(ge=jsxRuntimeExports.jsx(SvgIcon$z,{}),ne[3]=ge):ge=ne[3];let ye;ne[4]!==ce?(ye=jsxRuntimeExports.jsx(FeaturePickerButton,{icon:ge,onClick:()=>ce(_temp3$5),children:"Reset"}),ne[4]=ce,ne[5]=ye):ye=ne[5];let xe;return ne[6]!==ue||ne[7]!==me||ne[8]!==ye?(xe=jsxRuntimeExports.jsx(Box,{sx:pe,children:jsxRuntimeExports.jsx(ListEditor,{sortable:!0,editor:_temp$b,icon:null,value:ue,onChange:me,addItemLabel:"Add adapter",create:_temp2$7,addItemExtras:ye,onFocus:_temp4$2})}),ne[6]=ue,ne[7]=me,ne[8]=ye,ne[9]=xe):xe=ne[9],xe}function _temp4$2(ne){const oe=lodashExports.head(document.getElementsByClassName(ne));oe&&"click"in oe&&typeof oe.click=="function"&&oe.click()}function _temp3$5(){return{remote:defaultRemotes}}function _temp2$7(){return{transport:defaultTransport,url:"",disabled:!0}}function _temp$b(ne){return jsxRuntimeExports.jsx(ServerEditor,{value:ne})}const GitHub=createSvgIcon$2(jsxRuntimeExports.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub"),logo$1=""+new URL("logo512-Cm7nFPma.png",import.meta.url).href,contacts=[{name:"Dr Daniel Harabor",email:"daniel.harabor@monash.edu"},{name:"Dr Michael Wybrow",email:"michael.wybrow@monash.edu"},{name:"Kevin Zheng",email:"kevin.zheng@monash.edu"},{name:"Francis Anthony",email:"fant0003@student.monash.edu"},{name:"Karan Batta",email:"krnbatta@gmail.com"},{name:"Jay Wingate",email:"jaypeterwingate@gmail.com"},{name:"Leo Whitehead",email:"leo@whiteheadsoftware.dev"},{name:"Can Wang",email:"camwang@outlook.com"},{name:"Rory Tobin-Underwood",email:"rorytu@gmail.com"}];function parseUrl(ne){const oe=new URL(ne);return lodashExports.trimEnd(`${oe.hostname}${oe.pathname}`,"/")}function AboutContent(){const ne=compilerRuntimeExports.c(10);let oe;ne[0]===Symbol.for("react.memo_cache_sentinel")?(oe=function($e,Te){return jsxRuntimeExports.jsxs(Box,{sx:{pt:2},children:[jsxRuntimeExports.jsx(Typography,{component:"div",variant:"overline",color:"text.secondary",children:$e}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",children:Te})]})},ne[0]=oe):oe=ne[0];const ce=oe;let ue,pe;ne[1]===Symbol.for("react.memo_cache_sentinel")?(ue=jsxRuntimeExports.jsx(Box,{sx:{pt:0,pb:2},children:jsxRuntimeExports.jsx("img",{src:logo$1,height:"64"})}),pe=jsxRuntimeExports.jsx(Typography,{component:"div",variant:"h6",children:name}),ne[1]=ue,ne[2]=pe):(ue=ne[1],pe=ne[2]);let me;ne[3]===Symbol.for("react.memo_cache_sentinel")?(me=ce("Build Info",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:version_name})),ne[3]=me):me=ne[3];let ge;ne[4]===Symbol.for("react.memo_cache_sentinel")?(ge=ce("Team",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(List$1,{sx:{mx:-2},children:contacts.map(_temp$a)})})),ne[4]=ge):ge=ne[4];let ye;ne[5]===Symbol.for("react.memo_cache_sentinel")?(ye={mx:-2},ne[5]=ye):ye=ne[5];let xe;ne[6]===Symbol.for("react.memo_cache_sentinel")?(xe=jsxRuntimeExports.jsx(ListItemAvatar,{children:jsxRuntimeExports.jsx(Avatar,{sx:{width:24,height:24},src:logo$1})}),ne[6]=xe):xe=ne[6];let ve;ne[7]===Symbol.for("react.memo_cache_sentinel")?(ve=jsxRuntimeExports.jsxs(ListItemButton,{target:"_blank",href:homepage,children:[xe,jsxRuntimeExports.jsx(ListItemText,{primary:"Home",secondary:parseUrl(homepage)})]}),ne[7]=ve):ve=ne[7];let _e;ne[8]===Symbol.for("react.memo_cache_sentinel")?(_e=jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(GitHub,{})}),ne[8]=_e):_e=ne[8];let we;return ne[9]===Symbol.for("react.memo_cache_sentinel")?(we=jsxRuntimeExports.jsxs(Box,{children:[ue,pe,me,ge,ce("Resources",jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(List$1,{sx:ye,children:[ve,jsxRuntimeExports.jsxs(ListItemButton,{target:"_blank",href:repository,children:[_e,jsxRuntimeExports.jsx(ListItemText,{primary:"Repository",secondary:parseUrl(repository)})]})]})}))]}),ne[9]=we):we=ne[9],we}function _temp$a(ne,oe){const{name:ce,email:ue}=ne;return jsxRuntimeExports.jsxs(ListItemButton,{href:`mailto:${ue}`,children:[jsxRuntimeExports.jsx(ListItemAvatar,{children:jsxRuntimeExports.jsx(Avatar,{children:lodashExports.head(ce)})}),jsxRuntimeExports.jsx(ListItemText,{primary:ce,secondary:ue})]},oe)}const formatLabel=ne=>`${ne}x`;function SettingsPage(ne){const oe=compilerRuntimeExports.c(102),{template:ce}=ne,{controls:ue,onChange:pe,state:me,dragHandle:ge}=useViewTreeContext(),ye=useSmallDisplay(),[xe,ve]=useUIState(),_e=useSnackbar(),we=useBusyState("reset"),[Se,$e]=useSettings(),{"playback/playbackRate":Te,"appearance/acrylic":Re,"appearance/theme":Ae,"appearance/accentColor":ke,"behaviour/showOnStart":Be}=Se,Ie=Te===void 0?1:Te,Ne=Ae===void 0?"light":Ae,je=ke===void 0?"teal":ke,[ze,Ue]=reactExports.useState("general");let qe;oe[0]===Symbol.for("react.memo_cache_sentinel")?(qe=function(Hr){return jsxRuntimeExports.jsx(Typography,{component:"div",variant:"overline",color:"text.secondary",children:Hr})},oe[0]=qe):qe=oe[0];const Ke=qe;let Ge;oe[1]===Symbol.for("react.memo_cache_sentinel")?(Ge=function(Hr){return jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body1",sx:{mr:4,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:Hr})},oe[1]=Ge):Ge=oe[1];const Ye=Ge;let Xe;oe[2]!==ce.Key?(Xe=jsxRuntimeExports.jsx(ce.Key,{children:"settings"}),oe[2]=ce.Key,oe[3]=Xe):Xe=oe[3];let Je;oe[4]!==ce.Title?(Je=jsxRuntimeExports.jsx(ce.Title,{children:"Settings"}),oe[4]=ce.Title,oe[5]=Je):Je=oe[5];let Qe;oe[6]!==ce.Handle||oe[7]!==ge?(Qe=jsxRuntimeExports.jsx(ce.Handle,{children:ge}),oe[6]=ce.Handle,oe[7]=ge,oe[8]=Qe):Qe=oe[8];let Ze;oe[9]===Symbol.for("react.memo_cache_sentinel")?(Ze=jsxRuntimeExports.jsxs(TabList,{onChange:(zr,Hr)=>Ue(Hr),children:[jsxRuntimeExports.jsx(Tab,{label:"General",value:"general"}),jsxRuntimeExports.jsx(Tab,{label:"Extensions",value:"connections"}),jsxRuntimeExports.jsx(Tab,{label:"Security",value:"security"}),jsxRuntimeExports.jsx(Tab,{label:"About",value:"about"})]}),oe[9]=Ze):Ze=oe[9];let Tt;oe[10]!==ce.Options?(Tt=jsxRuntimeExports.jsx(ce.Options,{children:Ze}),oe[10]=ce.Options,oe[11]=Tt):Tt=oe[11];const Ut=ce.Content;let Gt;oe[12]===Symbol.for("react.memo_cache_sentinel")?(Gt={p:2},oe[12]=Gt):Gt=oe[12];let Nt;oe[13]===Symbol.for("react.memo_cache_sentinel")?(Nt=Ke("Playback"),oe[13]=Nt):Nt=oe[13];let Wt;oe[14]===Symbol.for("react.memo_cache_sentinel")?(Wt=Ye("Playback rate"),oe[14]=Wt):Wt=oe[14];let Mt,Yt;oe[15]===Symbol.for("react.memo_cache_sentinel")?(Mt={maxWidth:320,mr:2},Yt=[1,2,5,10].map(_temp$9),oe[15]=Mt,oe[16]=Yt):(Mt=oe[15],Yt=oe[16]);let ir;oe[17]!==$e?(ir=(zr,Hr)=>$e(()=>({"playback/playbackRate":Hr})),oe[17]=$e,oe[18]=ir):ir=oe[18];let tr;oe[19]!==Ie||oe[20]!==ir?(tr=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[Wt,jsxRuntimeExports.jsx(Slider,{sx:Mt,marks:Yt,step:1*defaultPlaybackRate,min:1*defaultPlaybackRate,max:10*defaultPlaybackRate,valueLabelFormat:_temp2$6,valueLabelDisplay:"auto",defaultValue:Ie,onChangeCommitted:ir})]}),oe[19]=Ie,oe[20]=ir,oe[21]=tr):tr=oe[21];let Qt;oe[22]===Symbol.for("react.memo_cache_sentinel")?(Qt=Ke("Appearance"),oe[22]=Qt):Qt=oe[22];let er;oe[23]===Symbol.for("react.memo_cache_sentinel")?(er=Ye("Acrylic"),oe[23]=er):er=oe[23];const hr=!!Re;let cr;oe[24]!==$e?(cr=(zr,Hr)=>$e(()=>({"appearance/acrylic":Hr})),oe[24]=$e,oe[25]=cr):cr=oe[25];let gr;oe[26]!==hr||oe[27]!==cr?(gr=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[er,jsxRuntimeExports.jsx(Switch$1,{defaultChecked:hr,onChange:cr})]}),oe[26]=hr,oe[27]=cr,oe[28]=gr):gr=oe[28];let ar,Pt;oe[29]===Symbol.for("react.memo_cache_sentinel")?(ar=Ye("Dark mode"),Pt=jsxRuntimeExports.jsx(Space,{flex:1}),oe[29]=ar,oe[30]=Pt):(ar=oe[29],Pt=oe[30]);const or=Ne==="dark";let Kt;oe[31]!==$e?(Kt=(zr,Hr)=>$e(()=>({"appearance/theme":Hr?"dark":"light"})),oe[31]=$e,oe[32]=Kt):Kt=oe[32];let Vt;oe[33]!==or||oe[34]!==Kt?(Vt=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[ar,Pt,jsxRuntimeExports.jsx(Switch$1,{defaultChecked:or,onChange:Kt})]}),oe[33]=or,oe[34]=Kt,oe[35]=Vt):Vt=oe[35];let Xt;oe[36]===Symbol.for("react.memo_cache_sentinel")?(Xt=Ye("Accent"),oe[36]=Xt):Xt=oe[36];let sr;oe[37]===Symbol.for("react.memo_cache_sentinel")?(sr={p:1},oe[37]=sr):sr=oe[37];let fr;oe[38]!==Ne?(fr=lodashExports.map(shades,zr=>({id:zr,name:lodashExports.startCase(zr),icon:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(Box,{sx:{ml:.5,width:12,height:12,backgroundColor:getShade(zr,Ne),borderRadius:4}})})})),oe[38]=Ne,oe[39]=fr):fr=oe[39];let kt;oe[40]!==$e?(kt=zr=>$e(()=>({"appearance/accentColor":zr})),oe[40]=$e,oe[41]=kt):kt=oe[41];let qt;oe[42]!==je||oe[43]!==fr||oe[44]!==kt?(qt=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[Xt,jsxRuntimeExports.jsx(Box,{sx:sr,children:jsxRuntimeExports.jsx(FeaturePicker,{paper:!0,value:je,items:fr,arrow:!0,onChange:kt})})]}),oe[42]=je,oe[43]=fr,oe[44]=kt,oe[45]=qt):qt=oe[45];let Jt;oe[46]===Symbol.for("react.memo_cache_sentinel")?(Jt=Ke("Behaviour"),oe[46]=Jt):Jt=oe[46];let rr;oe[47]===Symbol.for("react.memo_cache_sentinel")?(rr=Ye("Show explore on start-up"),oe[47]=rr):rr=oe[47];const vr=!!Be;let mr;oe[48]!==$e?(mr=(zr,Hr)=>$e(()=>({"behaviour/showOnStart":Hr?"explore":void 0})),oe[48]=$e,oe[49]=mr):mr=oe[49];let $r;oe[50]!==vr||oe[51]!==mr?($r=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[rr,jsxRuntimeExports.jsx(Switch$1,{defaultChecked:vr,onChange:mr})]}),oe[50]=vr,oe[51]=mr,oe[52]=$r):$r=oe[52];let Mr;oe[53]===Symbol.for("react.memo_cache_sentinel")?(Mr=Ke("Advanced"),oe[53]=Mr):Mr=oe[53];let Pr;oe[54]===Symbol.for("react.memo_cache_sentinel")?(Pr=Ye("Reset settings and extensions"),oe[54]=Pr):Pr=oe[54];let lr;oe[55]===Symbol.for("react.memo_cache_sentinel")?(lr={children:jsxRuntimeExports.jsx(AppBarTitle,{children:"Reset settings and extensions"})},oe[55]=lr):lr=oe[55];let jt;oe[56]!==_e||oe[57]!==$e||oe[58]!==ve||oe[59]!==ye||oe[60]!==we?(jt=jsxRuntimeExports.jsxs(Flex,{alignItems:"center",justifyContent:"space-between",children:[Pr,jsxRuntimeExports.jsx(ManagedModal,{trigger:_temp3$4,appBar:lr,children:zr=>{const{close:Hr}=zr;return jsxRuntimeExports.jsxs(Stack,{sx:{p:ye?2:3,pt:2,gap:4},children:[jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",children:"If something's not working correctly, you can try to reset all settings and extensions. This cannot be undone."}),jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"flex-end",gap:2,children:[jsxRuntimeExports.jsx(Button,{variant:"text",onClick:()=>{Hr()},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:()=>{we(async()=>{await wait(300),$e(_temp4$1),Hr(),ve(_temp5$1),_e("Reset complete")},"Resetting settings and extensions")},color:"error",startIcon:jsxRuntimeExports.jsx(SvgIcon$y,{}),children:"Reset settings and extensions"})]})]})}})]}),oe[56]=_e,oe[57]=$e,oe[58]=ve,oe[59]=ye,oe[60]=we,oe[61]=jt):jt=oe[61];let Dt;oe[62]!==tr||oe[63]!==gr||oe[64]!==Vt||oe[65]!==qt||oe[66]!==$r||oe[67]!==jt?(Dt=jsxRuntimeExports.jsx(TabPanel,{value:"general",sx:Gt,children:jsxRuntimeExports.jsxs(Box,{children:[Nt,tr,Qt,gr,Vt,qt,Jt,$r,Mr,jt]})}),oe[62]=tr,oe[63]=gr,oe[64]=Vt,oe[65]=qt,oe[66]=$r,oe[67]=jt,oe[68]=Dt):Dt=oe[68];let ur;oe[69]===Symbol.for("react.memo_cache_sentinel")?(ur={p:2},oe[69]=ur):ur=oe[69];let br;oe[70]===Symbol.for("react.memo_cache_sentinel")?(br=jsxRuntimeExports.jsxs(Box,{children:[Ke("Adapters"),jsxRuntimeExports.jsx(ServerListEditor,{})]}),oe[70]=br):br=oe[70];let Sr;oe[71]===Symbol.for("react.memo_cache_sentinel")?(Sr=jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{sx:{mb:2}}),Ke("Renderers"),jsxRuntimeExports.jsx(RendererListEditor,{})]}),oe[71]=Sr):Sr=oe[71];let Cr;oe[72]===Symbol.for("react.memo_cache_sentinel")?(Cr=jsxRuntimeExports.jsxs(TabPanel,{value:"connections",sx:ur,children:[br,Sr,jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Divider,{sx:{mb:2}}),Ke("Map support"),jsxRuntimeExports.jsx(MapParserListEditor,{})]})]}),oe[72]=Cr):Cr=oe[72];let pr,Tr;oe[73]===Symbol.for("react.memo_cache_sentinel")?(pr={p:2},Tr=Ke("Trusted origins"),oe[73]=pr,oe[74]=Tr):(pr=oe[73],Tr=oe[74]);let xr;oe[75]===Symbol.for("react.memo_cache_sentinel")?(xr={maxWidth:480},oe[75]=xr):xr=oe[75];let Rr;oe[76]===Symbol.for("react.memo_cache_sentinel")?(Rr=jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",variant:"caption",sx:{pt:2},children:"Rendering traces in the viewport and using advanced debugger features sometimes requires running third-party code."}),oe[76]=Rr):Rr=oe[76];let dr;oe[77]===Symbol.for("react.memo_cache_sentinel")?(dr=jsxRuntimeExports.jsxs(Box,{sx:xr,children:[Rr,jsxRuntimeExports.jsx(Typography,{component:"div",color:"text.secondary",variant:"caption",sx:{pt:2},children:"You'll be prompted to add origins when necessary, and you can stop trusting origins by removing them from this list."})]}),oe[77]=dr):dr=oe[77];let Lr;oe[78]===Symbol.for("react.memo_cache_sentinel")?(Lr=jsxRuntimeExports.jsxs(TabPanel,{value:"security",sx:pr,children:[Tr,dr,jsxRuntimeExports.jsx(Box,{sx:{pt:2},children:jsxRuntimeExports.jsx(TrustedOriginListEditor,{})})]}),oe[78]=Lr):Lr=oe[78];let qr;oe[79]===Symbol.for("react.memo_cache_sentinel")?(qr={p:2},oe[79]=qr):qr=oe[79];let Zt;oe[80]===Symbol.for("react.memo_cache_sentinel")?(Zt=jsxRuntimeExports.jsx(TabPanel,{value:"about",sx:qr,children:jsxRuntimeExports.jsx(Box,{children:jsxRuntimeExports.jsx(AboutContent,{})})}),oe[80]=Zt):Zt=oe[80];let kr;oe[81]!==Dt?(kr=jsxRuntimeExports.jsx(Flex,{vertical:!0,children:jsxRuntimeExports.jsx(Scroll,{y:!0,children:jsxRuntimeExports.jsxs(Flex,{vertical:!0,pt:6,children:[Dt,Cr,Lr,Zt]})})}),oe[81]=Dt,oe[82]=kr):kr=oe[82];let Ar;oe[83]!==ce.Content||oe[84]!==kr?(Ar=jsxRuntimeExports.jsx(Ut,{children:kr}),oe[83]=ce.Content,oe[84]=kr,oe[85]=Ar):Ar=oe[85];let wr;oe[86]!==ce.Extras||oe[87]!==ue?(wr=jsxRuntimeExports.jsx(ce.Extras,{children:ue}),oe[86]=ce.Extras,oe[87]=ue,oe[88]=wr):wr=oe[88];let Or;oe[89]!==ce||oe[90]!==pe||oe[91]!==me||oe[92]!==Tt||oe[93]!==Ar||oe[94]!==wr||oe[95]!==Xe||oe[96]!==Je||oe[97]!==Qe?(Or=jsxRuntimeExports.jsxs(ce,{onChange:pe,stack:me,children:[Xe,Je,Qe,Tt,Ar,wr]}),oe[89]=ce,oe[90]=pe,oe[91]=me,oe[92]=Tt,oe[93]=Ar,oe[94]=wr,oe[95]=Xe,oe[96]=Je,oe[97]=Qe,oe[98]=Or):Or=oe[98];let Br;return oe[99]!==Or||oe[100]!==ze?(Br=jsxRuntimeExports.jsx(TabContext,{value:ze,children:Or}),oe[99]=Or,oe[100]=ze,oe[101]=Br):Br=oe[101],Br}function _temp5$1(){return{sidebarOpen:!1,fullscreenModal:void 0}}function _temp4$1(){return defaults$3}function _temp3$4(ne){return jsxRuntimeExports.jsx(Button,{sx:{mx:1},color:"error",startIcon:jsxRuntimeExports.jsx(SvgIcon$y,{}),onClick:ne,children:"Reset now"})}function _temp2$6(ne){return formatLabel(ne/defaultPlaybackRate)}function _temp$9(ne){return{value:ne*defaultPlaybackRate,label:formatLabel(ne)}}const a$1=lodashExports.keys(mapParsers).map(ne=>({key:ne}));function Sink({children:ne}){return ne}function TrustedOriginListEditor(){const ne=compilerRuntimeExports.c(8),[oe,ce]=useSettings(),{trustedOrigins:ue}=oe;let pe,me;ne[0]!==ue?(me=lodashExports.map(ue,_temp6$1),ne[0]=ue,ne[1]=me):me=ne[1],pe=me;const ge=pe;let ye;ne[2]===Symbol.for("react.memo_cache_sentinel")?(ye={mx:-2},ne[2]=ye):ye=ne[2];let xe;ne[3]!==ce?(xe=lodashExports.debounce(_e=>ce(()=>({trustedOrigins:lodashExports.map(_e,"key")})),300),ne[3]=ce,ne[4]=xe):xe=ne[4];let ve;return ne[5]!==ge||ne[6]!==xe?(ve=jsxRuntimeExports.jsx(Box,{sx:ye,children:jsxRuntimeExports.jsx(ListEditor,{button:!1,sortable:!0,addable:!1,deletable:!0,editor:_temp7$1,icon:null,value:ge,onChange:xe,create:_temp8})}),ne[5]=ge,ne[6]=xe,ne[7]=ve):ve=ne[7],ve}function _temp8(){return{key:""}}function _temp7$1(ne){return jsxRuntimeExports.jsx(Sink,{children:jsxRuntimeExports.jsx(ListItemText,{primary:ne.key})},ne.key)}function _temp6$1(ne){return{key:ne}}function MapParserListEditor(){const ne=compilerRuntimeExports.c(1);let oe;return ne[0]===Symbol.for("react.memo_cache_sentinel")?(oe=jsxRuntimeExports.jsx(Box,{sx:{mx:-2},children:jsxRuntimeExports.jsx(ListEditor,{button:!1,sortable:!0,addable:!1,deletable:!1,editor:_temp9,icon:null,value:a$1,create:_temp10})}),ne[0]=oe):oe=ne[0],oe}function _temp10(){return{key:""}}function _temp9(ne){return jsxRuntimeExports.jsx(Sink,{children:jsxRuntimeExports.jsx(ListItemText,{primary:lodashExports.startCase(ne.key),secondary:`Support for *.${ne.key} maps`})},ne.key)}const isSourceLayer=ne=>{var oe;return!!((oe=getController(ne))!=null&&oe.getSources)};function SourcePage({template:ne}){const oe=useTheme();useMonacoTheme(oe);const{layers:ce}=useLayer(void 0,isSourceLayer),ue=reactExports.useMemo(()=>{var ve;return(ve=ce==null?void 0:ce.flatMap)==null?void 0:ve.call(ce,_e=>{var we,Se,$e,Te;return(Te=($e=(Se=(we=getController(_e))==null?void 0:we.getSources)==null?void 0:Se.call(we,_e))==null?void 0:$e.map)==null?void 0:Te.call($e,Re=>({layer:_e.key,source:Re}))})},[ce]),{controls:pe,onChange:me,state:ge,dragHandle:ye}=useViewTreeContext(),xe=reactExports.useMemo(()=>lodashExports.find(ue,ve=>ve&&ve.source.id===(ge==null?void 0:ge.source)&&ve.layer===(ge==null?void 0:ge.layer))??lodashExports.first(ue),[ue,ge==null?void 0:ge.source,ge==null?void 0:ge.layer]);return jsxRuntimeExports.jsxs(ne,{onChange:me,stack:ge,children:[jsxRuntimeExports.jsx(ne.Key,{children:"source"}),jsxRuntimeExports.jsx(ne.Title,{children:"Source"}),jsxRuntimeExports.jsx(ne.Handle,{children:ye}),jsxRuntimeExports.jsx(ne.Content,{children:ue!=null&&ue.length?jsxRuntimeExports.jsx(Flex,{pt:6,children:jsxRuntimeExports.jsx(AutoSizer,{children:ve=>{var _e,we;return jsxRuntimeExports.jsx(de,{theme:oe.palette.mode==="dark"?"posthoc-dark":"light",options:{readOnly:!0},language:(_e=xe==null?void 0:xe.source)==null?void 0:_e.language,loading:jsxRuntimeExports.jsx(CircularProgress,{variant:"indeterminate"}),...ve,value:(we=xe==null?void 0:xe.source)==null?void 0:we.content})}})}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$T,{}),label:"Source"})}),jsxRuntimeExports.jsx(ne.Options,{children:!!(ue!=null&&ue.length)&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Tabs,{value:`${xe==null?void 0:xe.source.id}::${xe==null?void 0:xe.layer}`,onChange:(ve,_e)=>{const[we,Se]=_e.split("::");me==null||me({source:we,layer:Se})},children:lodashExports.map(ue,({source:ve,layer:_e})=>jsxRuntimeExports.jsx(Tab,{label:ve.name,value:`${ve.id}::${_e}`}))})})}),jsxRuntimeExports.jsx(ne.Extras,{children:pe})]})}const PUBLISH=0,SUBSCRIBE=1,RESET=2,VALUE=4;function compose(ne,oe){return ce=>ne(oe(ce))}function thrush(ne,oe){return oe(ne)}function curry2to1(ne,oe){return ce=>ne(oe,ce)}function curry1to0(ne,oe){return()=>ne(oe)}function tap(ne,oe){return oe(ne),ne}function tup(...ne){return ne}function call(ne){ne()}function always(ne){return()=>ne}function joinProc(...ne){return()=>{ne.map(call)}}function isDefined(ne){return ne!==void 0}function noop$4(){}function subscribe(ne,oe){return ne(SUBSCRIBE,oe)}function publish(ne,oe){ne(PUBLISH,oe)}function reset(ne){ne(RESET)}function getValue(ne){return ne(VALUE)}function connect(ne,oe){return subscribe(ne,curry2to1(oe,PUBLISH))}function handleNext(ne,oe){const ce=ne(SUBSCRIBE,ue=>{ce(),oe(ue)});return ce}function stream$1(){const ne=[];return(oe,ce)=>{switch(oe){case RESET:ne.splice(0,ne.length);return;case SUBSCRIBE:return ne.push(ce),()=>{const ue=ne.indexOf(ce);ue>-1&&ne.splice(ue,1)};case PUBLISH:ne.slice().forEach(ue=>{ue(ce)});return;default:throw new Error(`unrecognized action ${oe}`)}}}function statefulStream(ne){let oe=ne;const ce=stream$1();return(ue,pe)=>{switch(ue){case SUBSCRIBE:pe(oe);break;case PUBLISH:oe=pe;break;case VALUE:return oe}return ce(ue,pe)}}function eventHandler(ne){let oe,ce;const ue=()=>oe&&oe();return function(pe,me){switch(pe){case SUBSCRIBE:return me?ce===me?void 0:(ue(),ce=me,oe=subscribe(ne,me),oe):(ue(),noop$4);case RESET:ue(),ce=null;return;default:throw new Error(`unrecognized action ${pe}`)}}}function streamFromEmitter(ne){return tap(stream$1(),oe=>connect(ne,oe))}function statefulStreamFromEmitter(ne,oe){return tap(statefulStream(oe),ce=>connect(ne,ce))}function combineOperators(...ne){return oe=>ne.reduceRight(thrush,oe)}function pipe(ne,...oe){const ce=combineOperators(...oe);return(ue,pe)=>{switch(ue){case SUBSCRIBE:return subscribe(ne,ce(pe));case RESET:reset(ne);return}}}function defaultComparator(ne,oe){return ne===oe}function distinctUntilChanged(ne=defaultComparator){let oe;return ce=>ue=>{ne(oe,ue)||(oe=ue,ce(ue))}}function filter(ne){return oe=>ce=>{ne(ce)&&oe(ce)}}function map$1(ne){return oe=>compose(oe,ne)}function mapTo(ne){return oe=>()=>oe(ne)}function scan$1(ne,oe){return ce=>ue=>ce(oe=ne(oe,ue))}function skip(ne){return oe=>ce=>{ne>0?ne--:oe(ce)}}function throttleTime(ne){let oe=null,ce;return ue=>pe=>{oe=pe,!ce&&(ce=setTimeout(()=>{ce=void 0,ue(oe)},ne))}}function debounceTime(ne){let oe,ce;return ue=>pe=>{oe=pe,ce&&clearTimeout(ce),ce=setTimeout(()=>{ue(oe)},ne)}}function withLatestFrom(...ne){const oe=new Array(ne.length);let ce=0,ue=null;const pe=Math.pow(2,ne.length)-1;return ne.forEach((me,ge)=>{const ye=Math.pow(2,ge);subscribe(me,xe=>{const ve=ce;ce=ce|ye,oe[ge]=xe,ve!==pe&&ce===pe&&ue&&(ue(),ue=null)})}),me=>ge=>{const ye=()=>me([ge].concat(oe));ce===pe?ye():ue=ye}}function merge(...ne){return function(oe,ce){switch(oe){case SUBSCRIBE:return joinProc(...ne.map(ue=>subscribe(ue,ce)));case RESET:return;default:throw new Error(`unrecognized action ${oe}`)}}}function duc(ne,oe=defaultComparator){return pipe(ne,distinctUntilChanged(oe))}function combineLatest(...ne){const oe=stream$1(),ce=new Array(ne.length);let ue=0;const pe=Math.pow(2,ne.length)-1;return ne.forEach((me,ge)=>{const ye=Math.pow(2,ge);subscribe(me,xe=>{ce[ge]=xe,ue=ue|ye,ue===pe&&publish(oe,ce)})}),function(me,ge){switch(me){case SUBSCRIBE:return ue===pe&&ge(ce),subscribe(oe,ge);case RESET:return reset(oe);default:throw new Error(`unrecognized action ${me}`)}}}function system(ne,oe=[],{singleton:ce}={singleton:!0}){return{id:id(),constructor:ne,dependencies:oe,singleton:ce}}const id=()=>Symbol();function init$1(ne){const oe=new Map,ce=({id:ue,constructor:pe,dependencies:me,singleton:ge})=>{if(ge&&oe.has(ue))return oe.get(ue);const ye=pe(me.map(xe=>ce(xe)));return ge&&oe.set(ue,ye),ye};return ce(ne)}function omit(ne,oe){const ce={},ue={};let pe=0;const me=ne.length;for(;pe(Be[Ie]=Ne=>{const je=ke[oe.methods[Ie]];publish(je,Ne)},Be),{})}function _e(ke){return ge.reduce((Be,Ie)=>(Be[Ie]=eventHandler(ke[oe.events[Ie]]),Be),{})}const we=React$2.forwardRef((ke,Be)=>{const{children:Ie,...Ne}=ke,[je]=React$2.useState(()=>tap(init$1(ne),qe=>xe(qe,Ne))),[ze]=React$2.useState(curry1to0(_e,je));useIsomorphicLayoutEffect$1(()=>{for(const qe of ge)qe in Ne&&subscribe(ze[qe],Ne[qe]);return()=>{Object.values(ze).map(reset)}},[Ne,ze,je]),useIsomorphicLayoutEffect$1(()=>{xe(je,Ne)}),React$2.useImperativeHandle(Be,always(ve(je)));const Ue=ce;return jsxRuntimeExports.jsx(ye.Provider,{value:je,children:ce?jsxRuntimeExports.jsx(Ue,{...omit([...ue,...pe,...ge],Ne),children:Ie}):Ie})}),Se=ke=>React$2.useCallback(curry2to1(publish,React$2.useContext(ye)[ke]),[ke]),$e=ke=>{const Ie=React$2.useContext(ye)[ke],Ne=React$2.useCallback(je=>subscribe(Ie,je),[Ie]);return React$2.useSyncExternalStore(Ne,()=>getValue(Ie),()=>getValue(Ie))},Te=ke=>{const Ie=React$2.useContext(ye)[ke],[Ne,je]=React$2.useState(curry1to0(getValue,Ie));return useIsomorphicLayoutEffect$1(()=>subscribe(Ie,ze=>{ze!==Ne&&je(always(ze))}),[Ie,Ne]),Ne},Re=React$2.version.startsWith("18")?$e:Te;return{Component:we,usePublisher:Se,useEmitterValue:Re,useEmitter:(ke,Be)=>{const Ne=React$2.useContext(ye)[ke];useIsomorphicLayoutEffect$1(()=>subscribe(Ne,Be),[Be,Ne])}}}const useIsomorphicLayoutEffect=typeof document<"u"?React$2.useLayoutEffect:React$2.useEffect;var LogLevel=(ne=>(ne[ne.DEBUG=0]="DEBUG",ne[ne.INFO=1]="INFO",ne[ne.WARN=2]="WARN",ne[ne.ERROR=3]="ERROR",ne))(LogLevel||{});const CONSOLE_METHOD_MAP={0:"debug",1:"log",2:"warn",3:"error"},getGlobalThis=()=>typeof globalThis>"u"?window:globalThis,loggerSystem=system(()=>{const ne=statefulStream(3);return{log:statefulStream((ce,ue,pe=1)=>{var me;const ge=(me=getGlobalThis().VIRTUOSO_LOG_LEVEL)!=null?me:getValue(ne);pe>=ge&&console[CONSOLE_METHOD_MAP[pe]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",ce,ue)}),logLevel:ne}},[],{singleton:!0});function useSizeWithElRef(ne,oe,ce){const ue=React$2.useRef(null);let pe=me=>{};if(typeof ResizeObserver<"u"){const me=React$2.useMemo(()=>new ResizeObserver(ge=>{const ye=()=>{const xe=ge[0].target;xe.offsetParent!==null&&ne(xe)};ce?ye():requestAnimationFrame(ye)}),[ne]);pe=ge=>{ge&&oe?(me.observe(ge),ue.current=ge):(ue.current&&me.unobserve(ue.current),ue.current=null)}}return{ref:ue,callbackRef:pe}}function useSize(ne,oe,ce){return useSizeWithElRef(ne,oe,ce).callbackRef}function useChangedListContentsSizes(ne,oe,ce,ue,pe,me,ge,ye,xe){const ve=React$2.useCallback(_e=>{const we=getChangedChildSizes(_e.children,oe,ye?"offsetWidth":"offsetHeight",pe);let Se=_e.parentElement;for(;!Se.dataset.virtuosoScroller;)Se=Se.parentElement;const $e=Se.lastElementChild.dataset.viewportType==="window",Te=ge?ye?ge.scrollLeft:ge.scrollTop:$e?ye?window.pageXOffset||document.documentElement.scrollLeft:window.pageYOffset||document.documentElement.scrollTop:ye?Se.scrollLeft:Se.scrollTop,Re=ge?ye?ge.scrollWidth:ge.scrollHeight:$e?ye?document.documentElement.scrollWidth:document.documentElement.scrollHeight:ye?Se.scrollWidth:Se.scrollHeight,Ae=ge?ye?ge.offsetWidth:ge.offsetHeight:$e?ye?window.innerWidth:window.innerHeight:ye?Se.offsetWidth:Se.offsetHeight;ue({scrollTop:Math.max(Te,0),scrollHeight:Re,viewportHeight:Ae}),me==null||me(ye?resolveGapValue$1("column-gap",getComputedStyle(_e).columnGap,pe):resolveGapValue$1("row-gap",getComputedStyle(_e).rowGap,pe)),we!==null&&ne(we)},[ne,oe,pe,me,ge,ue]);return useSizeWithElRef(ve,ce,xe)}function getChangedChildSizes(ne,oe,ce,ue){const pe=ne.length;if(pe===0)return null;const me=[];for(let ge=0;ge{const $e=Se.target,Te=$e===window||$e===document,Re=me?Te?window.pageXOffset||document.documentElement.scrollLeft:$e.scrollLeft:Te?window.pageYOffset||document.documentElement.scrollTop:$e.scrollTop,Ae=me?Te?document.documentElement.scrollWidth:$e.scrollWidth:Te?document.documentElement.scrollHeight:$e.scrollHeight,ke=me?Te?window.innerWidth:$e.offsetWidth:Te?window.innerHeight:$e.offsetHeight,Be=()=>{ne({scrollTop:Math.max(Re,0),scrollHeight:Ae,viewportHeight:ke})};Se.suppressFlushSync?Be():ReactDOM$1.flushSync(Be),ye.current!==null&&(Re===ye.current||Re<=0||Re===Ae-ke)&&(ye.current=null,oe(!0),xe.current&&(clearTimeout(xe.current),xe.current=null))},[ne,oe]);React$2.useEffect(()=>{const Se=pe||ge.current;return ue(pe||ge.current),ve({target:Se,suppressFlushSync:!0}),Se.addEventListener("scroll",ve,{passive:!0}),()=>{ue(null),Se.removeEventListener("scroll",ve)}},[ge,ve,ce,ue,pe]);function _e(Se){const $e=ge.current;if(!$e||(me?"offsetWidth"in $e&&$e.offsetWidth===0:"offsetHeight"in $e&&$e.offsetHeight===0))return;const Te=Se.behavior==="smooth";let Re,Ae,ke;$e===window?(Ae=Math.max(correctItemSize(document.documentElement,me?"width":"height"),me?document.documentElement.scrollWidth:document.documentElement.scrollHeight),Re=me?window.innerWidth:window.innerHeight,ke=me?document.documentElement.scrollLeft:document.documentElement.scrollTop):(Ae=$e[me?"scrollWidth":"scrollHeight"],Re=correctItemSize($e,me?"width":"height"),ke=$e[me?"scrollLeft":"scrollTop"]);const Be=Ae-Re;if(Se.top=Math.ceil(Math.max(Math.min(Be,Se.top),0)),approximatelyEqual(Re,Ae)||Se.top===ke){ne({scrollTop:ke,scrollHeight:Ae,viewportHeight:Re}),Te&&oe(!0);return}Te?(ye.current=Se.top,xe.current&&clearTimeout(xe.current),xe.current=setTimeout(()=>{xe.current=null,ye.current=null,oe(!0)},1e3)):ye.current=null,me&&(Se={left:Se.top,behavior:Se.behavior}),$e.scrollTo(Se)}function we(Se){me&&(Se={left:Se.top,behavior:Se.behavior}),ge.current.scrollBy(Se)}return{scrollerRef:ge,scrollByCallback:we,scrollToCallback:_e}}const domIOSystem=system(()=>{const ne=stream$1(),oe=stream$1(),ce=statefulStream(0),ue=stream$1(),pe=statefulStream(0),me=stream$1(),ge=stream$1(),ye=statefulStream(0),xe=statefulStream(0),ve=statefulStream(0),_e=statefulStream(0),we=stream$1(),Se=stream$1(),$e=statefulStream(!1),Te=statefulStream(!1),Re=statefulStream(!1);return connect(pipe(ne,map$1(({scrollTop:Ae})=>Ae)),oe),connect(pipe(ne,map$1(({scrollHeight:Ae})=>Ae)),ge),connect(oe,pe),{scrollContainerState:ne,scrollTop:oe,viewportHeight:me,headerHeight:ye,fixedHeaderHeight:xe,fixedFooterHeight:ve,footerHeight:_e,scrollHeight:ge,smoothScrollTargetReached:ue,horizontalDirection:Te,skipAnimationFrameInResizeObserver:Re,scrollTo:we,scrollBy:Se,statefulScrollTop:pe,deviation:ce,scrollingInProgress:$e}},[],{singleton:!0}),NIL_NODE={lvl:0};function newAANode(ne,oe,ce,ue=NIL_NODE,pe=NIL_NODE){return{k:ne,v:oe,lvl:ce,l:ue,r:pe}}function empty(ne){return ne===NIL_NODE}function newTree(){return NIL_NODE}function remove(ne,oe){if(empty(ne))return NIL_NODE;const{k:ce,l:ue,r:pe}=ne;if(oe===ce){if(empty(ue))return pe;if(empty(pe))return ue;{const[me,ge]=last(ue);return adjust(clone$1(ne,{k:me,v:ge,l:deleteLast(ue)}))}}else return oeoe&&(ye=ye.concat(walkWithin(me,oe,ce))),ue>=oe&&ue<=ce&&ye.push({k:ue,v:pe}),ue<=ce&&(ye=ye.concat(walkWithin(ge,oe,ce))),ye}function walk(ne){return empty(ne)?[]:[...walk(ne.l),{k:ne.k,v:ne.v},...walk(ne.r)]}function last(ne){return empty(ne.r)?[ne.k,ne.v]:last(ne.r)}function deleteLast(ne){return empty(ne.r)?ne.l:adjust(clone$1(ne,{r:deleteLast(ne.r)}))}function clone$1(ne,oe){return newAANode(oe.k!==void 0?oe.k:ne.k,oe.v!==void 0?oe.v:ne.v,oe.lvl!==void 0?oe.lvl:ne.lvl,oe.l!==void 0?oe.l:ne.l,oe.r!==void 0?oe.r:ne.r)}function isSingle(ne){return empty(ne)||ne.lvl>ne.r.lvl}function rebalance(ne){return split(skew(ne))}function adjust(ne){const{l:oe,r:ce,lvl:ue}=ne;if(ce.lvl>=ue-1&&oe.lvl>=ue-1)return ne;if(ue>ce.lvl+1){if(isSingle(oe))return skew(clone$1(ne,{lvl:ue-1}));if(!empty(oe)&&!empty(oe.r))return clone$1(oe.r,{l:clone$1(oe,{r:oe.r.l}),r:clone$1(ne,{l:oe.r.r,lvl:ue-1}),lvl:ue});throw new Error("Unexpected empty nodes")}else{if(isSingle(ne))return split(clone$1(ne,{lvl:ue-1}));if(!empty(ce)&&!empty(ce.l)){const pe=ce.l,me=isSingle(pe)?ce.lvl-1:ce.lvl;return clone$1(pe,{l:clone$1(ne,{r:pe.l,lvl:ue-1}),r:split(clone$1(ce,{l:pe.r,lvl:me})),lvl:pe.lvl+1})}else throw new Error("Unexpected empty nodes")}}function rangesWithin(ne,oe,ce){if(empty(ne))return[];const ue=findMaxKeyValue(ne,oe)[0];return toRanges(walkWithin(ne,ue,ce))}function arrayToRanges(ne,oe){const ce=ne.length;if(ce===0)return[];let{index:ue,value:pe}=oe(ne[0]);const me=[];for(let ge=1;ge({index:oe,value:ce}))}function split(ne){const{r:oe,lvl:ce}=ne;return!empty(oe)&&!empty(oe.r)&&oe.lvl===ce&&oe.r.lvl===ce?clone$1(oe,{l:clone$1(ne,{r:oe.l}),lvl:ce+1}):ne}function skew(ne){const{l:oe}=ne;return!empty(oe)&&oe.lvl===ne.lvl?clone$1(oe,{r:clone$1(ne,{l:oe.r})}):ne}function findIndexOfClosestSmallerOrEqual(ne,oe,ce,ue=0){let pe=ne.length-1;for(;ue<=pe;){const me=Math.floor((ue+pe)/2),ge=ne[me],ye=ce(ge,oe);if(ye===0)return me;if(ye===-1){if(pe-ue<2)return me-1;pe=me-1}else{if(pe===ue)return me;ue=me+1}}throw new Error(`Failed binary finding record in array - ${ne.join(",")}, searched for ${oe}`)}function findClosestSmallerOrEqual(ne,oe,ce){return ne[findIndexOfClosestSmallerOrEqual(ne,oe,ce)]}function findRange(ne,oe,ce,ue){const pe=findIndexOfClosestSmallerOrEqual(ne,oe,ue),me=findIndexOfClosestSmallerOrEqual(ne,ce,ue,pe);return ne.slice(pe,me+1)}const recalcSystem=system(()=>({recalcInProgress:statefulStream(!1)}),[],{singleton:!0});function rangeIncludes(ne){const{size:oe,startIndex:ce,endIndex:ue}=ne;return pe=>pe.start===ce&&(pe.end===ue||pe.end===1/0)&&pe.value===oe}function affectedGroupCount(ne,oe){let ce=0,ue=0;for(;ce=_e||pe===Se)&&(ne=remove(ne,_e)):(ve=Se!==pe,xe=!0),we>ge&&ge>=_e&&Se!==pe&&(ne=insert(ne,ge+1,Se));ve&&(ne=insert(ne,me,pe))}return[ne,ce]}function initialSizeState(){return{offsetTree:[],sizeTree:newTree(),groupOffsetTree:newTree(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function indexComparator({index:ne},oe){return oe===ne?0:oe0&&(oe=Math.max(oe,findClosestSmallerOrEqual(ne,ue,indexComparator).offset)),arrayToRanges(findRange(ne,oe,ce,offsetComparator),offsetPointParser)}function createOffsetTree(ne,oe,ce,ue){let pe=ne,me=0,ge=0,ye=0,xe=0;if(oe!==0){xe=findIndexOfClosestSmallerOrEqual(pe,oe-1,indexComparator),ye=pe[xe].offset;const _e=findMaxKeyValue(ce,oe-1);me=_e[0],ge=_e[1],pe.length&&pe[xe].size===findMaxKeyValue(ce,oe)[1]&&(xe-=1),pe=pe.slice(0,xe+1)}else pe=[];for(const{start:ve,value:_e}of rangesWithin(ce,oe,1/0)){const we=ve-me,Se=we*ge+ye+we*ue;pe.push({offset:Se,size:_e,index:ve}),me=ve,ye=Se,ge=_e}return{offsetTree:pe,lastIndex:me,lastOffset:ye,lastSize:ge}}function sizeStateReducer(ne,[oe,ce,ue,pe]){oe.length>0&&ue("received item sizes",oe,LogLevel.DEBUG);const me=ne.sizeTree;let ge=me,ye=0;if(ce.length>0&&empty(me)&&oe.length===2){const Se=oe[0].size,$e=oe[1].size;ge=ce.reduce((Te,Re)=>insert(insert(Te,Re,Se),Re+1,$e),ge)}else[ge,ye]=insertRanges(ge,oe);if(ge===me)return ne;const{offsetTree:xe,lastIndex:ve,lastSize:_e,lastOffset:we}=createOffsetTree(ne.offsetTree,ye,ge,pe);return{sizeTree:ge,offsetTree:xe,lastIndex:ve,lastOffset:we,lastSize:_e,groupOffsetTree:ce.reduce((Se,$e)=>insert(Se,$e,offsetOf($e,xe,pe)),newTree()),groupIndices:ce}}function offsetOf(ne,oe,ce){if(oe.length===0)return 0;const{offset:ue,index:pe,size:me}=findClosestSmallerOrEqual(oe,ne,indexComparator),ge=ne-pe,ye=me*ge+(ge-1)*ce+ue;return ye>0?ye+ce:ye}function isGroupLocation(ne){return typeof ne.groupIndex<"u"}function originalIndexFromLocation(ne,oe,ce){if(isGroupLocation(ne))return oe.groupIndices[ne.groupIndex]+1;{const ue=ne.index==="LAST"?ce:ne.index;let pe=originalIndexFromItemIndex(ue,oe);return pe=Math.max(0,pe,Math.min(ce,pe)),pe}}function originalIndexFromItemIndex(ne,oe){if(!hasGroups(oe))return ne;let ce=0;for(;oe.groupIndices[ce]<=ne+ce;)ce++;return ne+ce}function hasGroups(ne){return!empty(ne.groupOffsetTree)}function sizeTreeToRanges(ne){return walk(ne).map(({k:oe,v:ce},ue,pe)=>{const me=pe[ue+1],ge=me?me.k-1:1/0;return{startIndex:oe,endIndex:ge,size:ce}})}const SIZE_MAP={offsetHeight:"height",offsetWidth:"width"},sizeSystem=system(([{log:ne},{recalcInProgress:oe}])=>{const ce=stream$1(),ue=stream$1(),pe=statefulStreamFromEmitter(ue,0),me=stream$1(),ge=stream$1(),ye=statefulStream(0),xe=statefulStream([]),ve=statefulStream(void 0),_e=statefulStream(void 0),we=statefulStream((je,ze)=>correctItemSize(je,SIZE_MAP[ze])),Se=statefulStream(void 0),$e=statefulStream(0),Te=initialSizeState(),Re=statefulStreamFromEmitter(pipe(ce,withLatestFrom(xe,ne,$e),scan$1(sizeStateReducer,Te),distinctUntilChanged()),Te),Ae=statefulStreamFromEmitter(pipe(xe,distinctUntilChanged(),scan$1((je,ze)=>({prev:je.current,current:ze}),{prev:[],current:[]}),map$1(({prev:je})=>je)),[]);connect(pipe(xe,filter(je=>je.length>0),withLatestFrom(Re,$e),map$1(([je,ze,Ue])=>{const qe=je.reduce((Ke,Ge,Ye)=>insert(Ke,Ge,offsetOf(Ge,ze.offsetTree,Ue)||Ye),newTree());return{...ze,groupIndices:je,groupOffsetTree:qe}})),Re),connect(pipe(ue,withLatestFrom(Re),filter(([je,{lastIndex:ze}])=>je[{startIndex:je,endIndex:ze,size:Ue}])),ce),connect(ve,_e);const ke=statefulStreamFromEmitter(pipe(ve,map$1(je=>je===void 0)),!0);connect(pipe(_e,filter(je=>je!==void 0&&empty(getValue(Re).sizeTree)),map$1(je=>[{startIndex:0,endIndex:0,size:je}])),ce);const Be=streamFromEmitter(pipe(ce,withLatestFrom(Re),scan$1(({sizes:je},[ze,Ue])=>({changed:Ue!==je,sizes:Ue}),{changed:!1,sizes:Te}),map$1(je=>je.changed)));subscribe(pipe(ye,scan$1((je,ze)=>({diff:je.prev-ze,prev:ze}),{diff:0,prev:0}),map$1(je=>je.diff)),je=>{const{groupIndices:ze}=getValue(Re);if(je>0)publish(oe,!0),publish(me,je+affectedGroupCount(je,ze));else if(je<0){const Ue=getValue(Ae);Ue.length>0&&(je-=affectedGroupCount(-je,Ue)),publish(ge,je)}}),subscribe(pipe(ye,withLatestFrom(ne)),([je,ze])=>{je<0&&ze("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:ye},LogLevel.ERROR)});const Ie=streamFromEmitter(me);connect(pipe(me,withLatestFrom(Re),map$1(([je,ze])=>{const Ue=ze.groupIndices.length>0,qe=[],Ke=ze.lastSize;if(Ue){const Ge=find(ze.sizeTree,0);let Ye=0,Xe=0;for(;Ye{let Gt=Ze.ranges;return Ze.prevSize!==0&&(Gt=[...Ze.ranges,{startIndex:Ze.prevIndex,endIndex:Tt+je-1,size:Ze.prevSize}]),{ranges:Gt,prevIndex:Tt+je,prevSize:Ut}},{ranges:qe,prevIndex:je,prevSize:0}).ranges}return walk(ze.sizeTree).reduce((Ge,{k:Ye,v:Xe})=>({ranges:[...Ge.ranges,{startIndex:Ge.prevIndex,endIndex:Ye+je-1,size:Ge.prevSize}],prevIndex:Ye+je,prevSize:Xe}),{ranges:[],prevIndex:0,prevSize:Ke}).ranges})),ce);const Ne=streamFromEmitter(pipe(ge,withLatestFrom(Re,$e),map$1(([je,{offsetTree:ze},Ue])=>{const qe=-je;return offsetOf(qe,ze,Ue)})));return connect(pipe(ge,withLatestFrom(Re,$e),map$1(([je,ze,Ue])=>{if(ze.groupIndices.length>0){if(empty(ze.sizeTree))return ze;let Ke=newTree();const Ge=getValue(Ae);let Ye=0,Xe=0,Je=0;for(;Ye<-je;){Je=Ge[Xe];const Ze=Ge[Xe+1]-Je-1;Xe++,Ye+=Ze+1}if(Ke=walk(ze.sizeTree).reduce((Ze,{k:Tt,v:Ut})=>insert(Ze,Math.max(0,Tt+je),Ut),Ke),Ye!==-je){const Ze=find(ze.sizeTree,Je);Ke=insert(Ke,0,Ze);const Tt=findMaxKeyValue(ze.sizeTree,-je+1)[1];Ke=insert(Ke,1,Tt)}return{...ze,sizeTree:Ke,...createOffsetTree(ze.offsetTree,0,Ke,Ue)}}else{const Ke=walk(ze.sizeTree).reduce((Ge,{k:Ye,v:Xe})=>insert(Ge,Math.max(0,Ye+je),Xe),newTree());return{...ze,sizeTree:Ke,...createOffsetTree(ze.offsetTree,0,Ke,Ue)}}})),Re),{data:Se,totalCount:ue,sizeRanges:ce,groupIndices:xe,defaultItemSize:_e,fixedItemSize:ve,unshiftWith:me,shiftWith:ge,shiftWithOffset:Ne,beforeUnshiftWith:Ie,firstItemIndex:ye,gap:$e,sizes:Re,listRefresh:Be,statefulTotalCount:pe,trackItemSizes:ke,itemSize:we}},tup(loggerSystem,recalcSystem),{singleton:!0}),SUPPORTS_SCROLL_TO_OPTIONS=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function normalizeIndexLocation(ne){const oe=typeof ne=="number"?{index:ne}:ne;return oe.align||(oe.align="start"),(!oe.behavior||!SUPPORTS_SCROLL_TO_OPTIONS)&&(oe.behavior="auto"),oe.offset||(oe.offset=0),oe}const scrollToIndexSystem=system(([{sizes:ne,totalCount:oe,listRefresh:ce,gap:ue},{scrollingInProgress:pe,viewportHeight:me,scrollTo:ge,smoothScrollTargetReached:ye,headerHeight:xe,footerHeight:ve,fixedHeaderHeight:_e,fixedFooterHeight:we},{log:Se}])=>{const $e=stream$1(),Te=stream$1(),Re=statefulStream(0);let Ae=null,ke=null,Be=null;function Ie(){Ae&&(Ae(),Ae=null),Be&&(Be(),Be=null),ke&&(clearTimeout(ke),ke=null),publish(pe,!1)}return connect(pipe($e,withLatestFrom(ne,me,oe,Re,xe,ve,Se),withLatestFrom(ue,_e,we),map$1(([[Ne,je,ze,Ue,qe,Ke,Ge,Ye],Xe,Je,Qe])=>{const Ze=normalizeIndexLocation(Ne),{align:Tt,behavior:Ut,offset:Gt}=Ze,Nt=Ue-1,Wt=originalIndexFromLocation(Ze,je,Nt);let Mt=offsetOf(Wt,je.offsetTree,Xe)+Ke;Tt==="end"?(Mt+=Je+findMaxKeyValue(je.sizeTree,Wt)[1]-ze+Qe,Wt===Nt&&(Mt+=Ge)):Tt==="center"?Mt+=(Je+findMaxKeyValue(je.sizeTree,Wt)[1]-ze+Qe)/2:Mt-=qe,Gt&&(Mt+=Gt);const Yt=ir=>{Ie(),ir?(Ye("retrying to scroll to",{location:Ne},LogLevel.DEBUG),publish($e,Ne)):(publish(Te,!0),Ye("list did not change, scroll successful",{},LogLevel.DEBUG))};if(Ie(),Ut==="smooth"){let ir=!1;Be=subscribe(ce,tr=>{ir=ir||tr}),Ae=handleNext(ye,()=>{Yt(ir)})}else Ae=handleNext(pipe(ce,watchChangesFor(150)),Yt);return ke=setTimeout(()=>{Ie()},1200),publish(pe,!0),Ye("scrolling from index to",{index:Wt,top:Mt,behavior:Ut},LogLevel.DEBUG),{top:Mt,behavior:Ut}})),ge),{scrollToIndex:$e,scrollTargetReached:Te,topListHeight:Re}},tup(sizeSystem,domIOSystem,loggerSystem),{singleton:!0});function watchChangesFor(ne){return oe=>{const ce=setTimeout(()=>{oe(!1)},ne);return ue=>{ue&&(oe(!0),clearTimeout(ce))}}}const UP="up",DOWN="down",NONE$1="none",INITIAL_BOTTOM_STATE={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},DEFAULT_AT_TOP_THRESHOLD=0,stateFlagsSystem=system(([{scrollContainerState:ne,scrollTop:oe,viewportHeight:ce,headerHeight:ue,footerHeight:pe,scrollBy:me}])=>{const ge=statefulStream(!1),ye=statefulStream(!0),xe=stream$1(),ve=stream$1(),_e=statefulStream(4),we=statefulStream(DEFAULT_AT_TOP_THRESHOLD),Se=statefulStreamFromEmitter(pipe(merge(pipe(duc(oe),skip(1),mapTo(!0)),pipe(duc(oe),skip(1),mapTo(!1),debounceTime(100))),distinctUntilChanged()),!1),$e=statefulStreamFromEmitter(pipe(merge(pipe(me,mapTo(!0)),pipe(me,mapTo(!1),debounceTime(200))),distinctUntilChanged()),!1);connect(pipe(combineLatest(duc(oe),duc(we)),map$1(([Be,Ie])=>Be<=Ie),distinctUntilChanged()),ye),connect(pipe(ye,throttleTime(50)),ve);const Te=streamFromEmitter(pipe(combineLatest(ne,duc(ce),duc(ue),duc(pe),duc(_e)),scan$1((Be,[{scrollTop:Ie,scrollHeight:Ne},je,ze,Ue,qe])=>{const Ke=Ie+je-Ne>-qe,Ge={viewportHeight:je,scrollTop:Ie,scrollHeight:Ne};if(Ke){let Xe,Je;return Ie>Be.state.scrollTop?(Xe="SCROLLED_DOWN",Je=Be.state.scrollTop-Ie):(Xe="SIZE_DECREASED",Je=Be.state.scrollTop-Ie||Be.scrollTopDelta),{atBottom:!0,state:Ge,atBottomBecause:Xe,scrollTopDelta:Je}}let Ye;return Ge.scrollHeight>Be.state.scrollHeight?Ye="SIZE_INCREASED":jeBe&&Be.atBottom===Ie.atBottom))),Re=statefulStreamFromEmitter(pipe(ne,scan$1((Be,{scrollTop:Ie,scrollHeight:Ne,viewportHeight:je})=>{if(approximatelyEqual(Be.scrollHeight,Ne))return{scrollTop:Ie,scrollHeight:Ne,jump:0,changed:!1};{const ze=Ne-(Ie+je)<1;return Be.scrollTop!==Ie&&ze?{scrollHeight:Ne,scrollTop:Ie,jump:Be.scrollTop-Ie,changed:!0}:{scrollHeight:Ne,scrollTop:Ie,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),filter(Be=>Be.changed),map$1(Be=>Be.jump)),0);connect(pipe(Te,map$1(Be=>Be.atBottom)),ge),connect(pipe(ge,throttleTime(50)),xe);const Ae=statefulStream(DOWN);connect(pipe(ne,map$1(({scrollTop:Be})=>Be),distinctUntilChanged(),scan$1((Be,Ie)=>getValue($e)?{direction:Be.direction,prevScrollTop:Ie}:{direction:IeBe.direction)),Ae),connect(pipe(ne,throttleTime(50),mapTo(NONE$1)),Ae);const ke=statefulStream(0);return connect(pipe(Se,filter(Be=>!Be),mapTo(0)),ke),connect(pipe(oe,throttleTime(100),withLatestFrom(Se),filter(([Be,Ie])=>!!Ie),scan$1(([Be,Ie],[Ne])=>[Ie,Ne],[0,0]),map$1(([Be,Ie])=>Ie-Be)),ke),{isScrolling:Se,isAtTop:ye,isAtBottom:ge,atBottomState:Te,atTopStateChange:ve,atBottomStateChange:xe,scrollDirection:Ae,atBottomThreshold:_e,atTopThreshold:we,scrollVelocity:ke,lastJumpDueToItemResize:Re}},tup(domIOSystem)),propsReadySystem=system(([{log:ne}])=>{const oe=statefulStream(!1),ce=streamFromEmitter(pipe(oe,filter(ue=>ue),distinctUntilChanged()));return subscribe(oe,ue=>{ue&&getValue(ne)("props updated",{},LogLevel.DEBUG)}),{propsReady:oe,didMount:ce}},tup(loggerSystem),{singleton:!0});function skipFrames(ne,oe){ne==0?oe():requestAnimationFrame(()=>skipFrames(ne-1,oe))}function getInitialTopMostItemIndexNumber(ne,oe){const ce=oe-1;return typeof ne=="number"?ne:ne.index==="LAST"?ce:ne.index}const initialTopMostItemIndexSystem=system(([{sizes:ne,listRefresh:oe,defaultItemSize:ce},{scrollTop:ue},{scrollToIndex:pe,scrollTargetReached:me},{didMount:ge}])=>{const ye=statefulStream(!0),xe=statefulStream(0),ve=statefulStream(!0);return connect(pipe(ge,withLatestFrom(xe),filter(([_e,we])=>!!we),mapTo(!1)),ye),connect(pipe(ge,withLatestFrom(xe),filter(([_e,we])=>!!we),mapTo(!1)),ve),subscribe(pipe(combineLatest(oe,ge),withLatestFrom(ye,ne,ce,ve),filter(([[,_e],we,{sizeTree:Se},$e,Te])=>_e&&(!empty(Se)||isDefined($e))&&!we&&!Te),withLatestFrom(xe)),([,_e])=>{handleNext(me,()=>{publish(ve,!0)}),skipFrames(4,()=>{handleNext(ue,()=>{publish(ye,!0)}),publish(pe,_e)})}),{scrolledToInitialItem:ye,initialTopMostItemIndex:xe,initialItemFinalLocationReached:ve}},tup(sizeSystem,domIOSystem,scrollToIndexSystem,propsReadySystem),{singleton:!0});function normalizeFollowOutput(ne){return ne?ne==="smooth"?"smooth":"auto":!1}const behaviorFromFollowOutput=(ne,oe)=>typeof ne=="function"?normalizeFollowOutput(ne(oe)):oe&&normalizeFollowOutput(ne),followOutputSystem=system(([{totalCount:ne,listRefresh:oe},{isAtBottom:ce,atBottomState:ue},{scrollToIndex:pe},{scrolledToInitialItem:me},{propsReady:ge,didMount:ye},{log:xe},{scrollingInProgress:ve}])=>{const _e=statefulStream(!1),we=stream$1();let Se=null;function $e(Re){publish(pe,{index:"LAST",align:"end",behavior:Re})}subscribe(pipe(combineLatest(pipe(duc(ne),skip(1)),ye),withLatestFrom(duc(_e),ce,me,ve),map$1(([[Re,Ae],ke,Be,Ie,Ne])=>{let je=Ae&&Ie,ze="auto";return je&&(ze=behaviorFromFollowOutput(ke,Be||Ne),je=je&&!!ze),{totalCount:Re,shouldFollow:je,followOutputBehavior:ze}}),filter(({shouldFollow:Re})=>Re)),({totalCount:Re,followOutputBehavior:Ae})=>{Se&&(Se(),Se=null),Se=handleNext(oe,()=>{getValue(xe)("following output to ",{totalCount:Re},LogLevel.DEBUG),$e(Ae),Se=null})});function Te(Re){const Ae=handleNext(ue,ke=>{Re&&!ke.atBottom&&ke.notAtBottomBecause==="SIZE_INCREASED"&&!Se&&(getValue(xe)("scrolling to bottom due to increased size",{},LogLevel.DEBUG),$e("auto"))});setTimeout(Ae,100)}return subscribe(pipe(combineLatest(duc(_e),ne,ge),filter(([Re,,Ae])=>Re&&Ae),scan$1(({value:Re},[,Ae])=>({refreshed:Re===Ae,value:Ae}),{refreshed:!1,value:0}),filter(({refreshed:Re})=>Re),withLatestFrom(_e,ne)),([,Re])=>{getValue(me)&&Te(Re!==!1)}),subscribe(we,()=>{Te(getValue(_e)!==!1)}),subscribe(combineLatest(duc(_e),ue),([Re,Ae])=>{Re&&!Ae.atBottom&&Ae.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&$e("auto")}),{followOutput:_e,autoscrollToBottom:we}},tup(sizeSystem,stateFlagsSystem,scrollToIndexSystem,initialTopMostItemIndexSystem,propsReadySystem,loggerSystem,domIOSystem));function groupCountsToIndicesAndCount(ne){return ne.reduce((oe,ce)=>(oe.groupIndices.push(oe.totalCount),oe.totalCount+=ce+1,oe),{totalCount:0,groupIndices:[]})}const groupedListSystem=system(([{totalCount:ne,groupIndices:oe,sizes:ce},{scrollTop:ue,headerHeight:pe}])=>{const me=stream$1(),ge=stream$1(),ye=streamFromEmitter(pipe(me,map$1(groupCountsToIndicesAndCount)));return connect(pipe(ye,map$1(xe=>xe.totalCount)),ne),connect(pipe(ye,map$1(xe=>xe.groupIndices)),oe),connect(pipe(combineLatest(ue,ce,pe),filter(([xe,ve])=>hasGroups(ve)),map$1(([xe,ve,_e])=>findMaxKeyValue(ve.groupOffsetTree,Math.max(xe-_e,0),"v")[0]),distinctUntilChanged(),map$1(xe=>[xe])),ge),{groupCounts:me,topItemsIndexes:ge}},tup(sizeSystem,domIOSystem));function tupleComparator(ne,oe){return!!(ne&&ne[0]===oe[0]&&ne[1]===oe[1])}function rangeComparator(ne,oe){return!!(ne&&ne.startIndex===oe.startIndex&&ne.endIndex===oe.endIndex)}const TOP="top",BOTTOM="bottom",NONE="none";function getOverscan(ne,oe,ce){return typeof ne=="number"?ce===UP&&oe===TOP||ce===DOWN&&oe===BOTTOM?ne:0:ce===UP?oe===TOP?ne.main:ne.reverse:oe===BOTTOM?ne.main:ne.reverse}function getViewportIncrease(ne,oe){return typeof ne=="number"?ne:ne[oe]||0}const sizeRangeSystem=system(([{scrollTop:ne,viewportHeight:oe,deviation:ce,headerHeight:ue,fixedHeaderHeight:pe}])=>{const me=stream$1(),ge=statefulStream(0),ye=statefulStream(0),xe=statefulStream(0),ve=statefulStreamFromEmitter(pipe(combineLatest(duc(ne),duc(oe),duc(ue),duc(me,tupleComparator),duc(xe),duc(ge),duc(pe),duc(ce),duc(ye)),map$1(([_e,we,Se,[$e,Te],Re,Ae,ke,Be,Ie])=>{const Ne=_e-Be,je=Ae+ke,ze=Math.max(Se-Ne,0);let Ue=NONE;const qe=getViewportIncrease(Ie,TOP),Ke=getViewportIncrease(Ie,BOTTOM);return $e-=Be,$e+=Se+ke,Te+=Se+ke,Te-=Be,$e>_e+je-qe&&(Ue=UP),Te<_e-ze+we+Ke&&(Ue=DOWN),Ue!==NONE?[Math.max(Ne-Se-getOverscan(Re,TOP,Ue)-qe,0),Ne-ze-ke+we+getOverscan(Re,BOTTOM,Ue)+Ke]:null}),filter(_e=>_e!=null),distinctUntilChanged(tupleComparator)),[0,0]);return{listBoundary:me,overscan:xe,topListHeight:ge,increaseViewportBy:ye,visibleRange:ve}},tup(domIOSystem),{singleton:!0});function probeItemSet(ne,oe,ce){if(hasGroups(oe)){const ue=originalIndexFromItemIndex(ne,oe);return[{index:findMaxKeyValue(oe.groupOffsetTree,ue)[0],size:0,offset:0},{index:ue,size:0,offset:0,data:ce&&ce[0]}]}return[{index:ne,size:0,offset:0,data:ce&&ce[0]}]}const EMPTY_LIST_STATE={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function transposeItems(ne,oe,ce){if(ne.length===0)return[];if(!hasGroups(oe))return ne.map(ve=>({...ve,index:ve.index+ce,originalIndex:ve.index}));const ue=ne[0].index,pe=ne[ne.length-1].index,me=[],ge=rangesWithin(oe.groupOffsetTree,ue,pe);let ye,xe=0;for(const ve of ne){(!ye||ye.end0){ve=ne[0].offset;const Re=ne[ne.length-1];_e=Re.offset+Re.size}const we=ce-xe,Se=ye+we*ge+(we-1)*ue,$e=ve,Te=Se-_e;return{items:transposeItems(ne,pe,me),topItems:transposeItems(oe,pe,me),topListHeight:oe.reduce((Re,Ae)=>Ae.size+Re,0),offsetTop:ve,offsetBottom:Te,top:$e,bottom:_e,totalCount:ce,firstItemIndex:me}}function buildListStateFromItemCount(ne,oe,ce,ue,pe,me){let ge=0;if(ce.groupIndices.length>0)for(const _e of ce.groupIndices){if(_e-ge>=ne)break;ge++}const ye=ne+ge,xe=getInitialTopMostItemIndexNumber(oe,ye),ve=Array.from({length:ye}).map((_e,we)=>({index:we+xe,size:0,offset:0,data:me[we+xe]}));return buildListState(ve,[],ye,pe,ce,ue)}const listStateSystem=system(([{sizes:ne,totalCount:oe,data:ce,firstItemIndex:ue,gap:pe},me,{visibleRange:ge,listBoundary:ye,topListHeight:xe},{scrolledToInitialItem:ve,initialTopMostItemIndex:_e},{topListHeight:we},Se,{didMount:$e},{recalcInProgress:Te}])=>{const Re=statefulStream([]),Ae=statefulStream(0),ke=stream$1();connect(me.topItemsIndexes,Re);const Be=statefulStreamFromEmitter(pipe(combineLatest($e,Te,duc(ge,tupleComparator),duc(oe),duc(ne),duc(_e),ve,duc(Re),duc(ue),duc(pe),ce),filter(([ze,Ue,,qe,,,,,,,Ke])=>{const Ge=Ke&&Ke.length!==qe;return ze&&!Ue&&!Ge}),map$1(([,,[ze,Ue],qe,Ke,Ge,Ye,Xe,Je,Qe,Ze])=>{const Tt=Ke,{sizeTree:Ut,offsetTree:Gt}=Tt,Nt=getValue(Ae);if(qe===0)return{...EMPTY_LIST_STATE,totalCount:qe};if(ze===0&&Ue===0)return Nt===0?{...EMPTY_LIST_STATE,totalCount:qe}:buildListStateFromItemCount(Nt,Ge,Ke,Je,Qe,Ze||[]);if(empty(Ut))return Nt>0?null:buildListState(probeItemSet(getInitialTopMostItemIndexNumber(Ge,qe),Tt,Ze),[],qe,Qe,Tt,Je);const Wt=[];if(Xe.length>0){const Qt=Xe[0],er=Xe[Xe.length-1];let hr=0;for(const cr of rangesWithin(Ut,Qt,er)){const gr=cr.value,ar=Math.max(cr.start,Qt),Pt=Math.min(cr.end,er);for(let or=ar;or<=Pt;or++)Wt.push({index:or,size:gr,offset:hr,data:Ze&&Ze[or]}),hr+=gr}}if(!Ye)return buildListState([],Wt,qe,Qe,Tt,Je);const Mt=Xe.length>0?Xe[Xe.length-1]+1:0,Yt=rangesWithinOffsets(Gt,ze,Ue,Mt);if(Yt.length===0)return null;const ir=qe-1,tr=tap([],Qt=>{for(const er of Yt){const hr=er.value;let cr=hr.offset,gr=er.start;const ar=hr.size;if(hr.offset=Ue);or++)Qt.push({index:or,size:ar,offset:cr,data:Ze&&Ze[or]}),cr+=ar+Qe}});return buildListState(tr,Wt,qe,Qe,Tt,Je)}),filter(ze=>ze!==null),distinctUntilChanged()),EMPTY_LIST_STATE);connect(pipe(ce,filter(isDefined),map$1(ze=>ze==null?void 0:ze.length)),oe),connect(pipe(Be,map$1(ze=>ze.topListHeight)),we),connect(we,xe),connect(pipe(Be,map$1(ze=>[ze.top,ze.bottom])),ye),connect(pipe(Be,map$1(ze=>ze.items)),ke);const Ie=streamFromEmitter(pipe(Be,filter(({items:ze})=>ze.length>0),withLatestFrom(oe,ce),filter(([{items:ze},Ue])=>ze[ze.length-1].originalIndex===Ue-1),map$1(([,ze,Ue])=>[ze-1,Ue]),distinctUntilChanged(tupleComparator),map$1(([ze])=>ze))),Ne=streamFromEmitter(pipe(Be,throttleTime(200),filter(({items:ze,topItems:Ue})=>ze.length>0&&ze[0].originalIndex===Ue.length),map$1(({items:ze})=>ze[0].index),distinctUntilChanged())),je=streamFromEmitter(pipe(Be,filter(({items:ze})=>ze.length>0),map$1(({items:ze})=>{let Ue=0,qe=ze.length-1;for(;ze[Ue].type==="group"&&UeUe;)qe--;return{startIndex:ze[Ue].index,endIndex:ze[qe].index}}),distinctUntilChanged(rangeComparator)));return{listState:Be,topItemsIndexes:Re,endReached:Ie,startReached:Ne,rangeChanged:je,itemsRendered:ke,initialItemCount:Ae,...Se}},tup(sizeSystem,groupedListSystem,sizeRangeSystem,initialTopMostItemIndexSystem,scrollToIndexSystem,stateFlagsSystem,propsReadySystem,recalcSystem),{singleton:!0}),initialItemCountSystem=system(([{sizes:ne,firstItemIndex:oe,data:ce,gap:ue},{initialTopMostItemIndex:pe},{initialItemCount:me,listState:ge},{didMount:ye}])=>(connect(pipe(ye,withLatestFrom(me),filter(([,xe])=>xe!==0),withLatestFrom(pe,ne,oe,ue,ce),map$1(([[,xe],ve,_e,we,Se,$e=[]])=>buildListStateFromItemCount(xe,ve,_e,we,Se,$e))),ge),{}),tup(sizeSystem,initialTopMostItemIndexSystem,listStateSystem,propsReadySystem),{singleton:!0}),scrollSeekSystem=system(([{scrollVelocity:ne}])=>{const oe=statefulStream(!1),ce=stream$1(),ue=statefulStream(!1);return connect(pipe(ne,withLatestFrom(ue,oe,ce),filter(([pe,me])=>!!me),map$1(([pe,me,ge,ye])=>{const{exit:xe,enter:ve}=me;if(ge){if(xe(pe,ye))return!1}else if(ve(pe,ye))return!0;return ge}),distinctUntilChanged()),oe),subscribe(pipe(combineLatest(oe,ne,ce),withLatestFrom(ue)),([[pe,me,ge],ye])=>pe&&ye&&ye.change&&ye.change(me,ge)),{isSeeking:oe,scrollSeekConfiguration:ue,scrollVelocity:ne,scrollSeekRangeChanged:ce}},tup(stateFlagsSystem),{singleton:!0}),topItemCountSystem=system(([{topItemsIndexes:ne}])=>{const oe=statefulStream(0);return connect(pipe(oe,filter(ce=>ce>0),map$1(ce=>Array.from({length:ce}).map((ue,pe)=>pe))),ne),{topItemCount:oe}},tup(listStateSystem)),totalListHeightSystem=system(([{footerHeight:ne,headerHeight:oe,fixedHeaderHeight:ce,fixedFooterHeight:ue},{listState:pe}])=>{const me=stream$1(),ge=statefulStreamFromEmitter(pipe(combineLatest(ne,ue,oe,ce,pe),map$1(([ye,xe,ve,_e,we])=>ye+xe+ve+_e+we.offsetBottom+we.bottom)),0);return connect(duc(ge),me),{totalListHeight:ge,totalListHeightChanged:me}},tup(domIOSystem,listStateSystem),{singleton:!0});function simpleMemoize(ne){let oe=!1,ce;return()=>(oe||(oe=!0,ce=ne()),ce)}const isMobileSafari=simpleMemoize(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),upwardScrollFixSystem=system(([{scrollBy:ne,scrollTop:oe,deviation:ce,scrollingInProgress:ue},{isScrolling:pe,isAtBottom:me,scrollDirection:ge,lastJumpDueToItemResize:ye},{listState:xe},{beforeUnshiftWith:ve,shiftWithOffset:_e,sizes:we,gap:Se},{log:$e},{recalcInProgress:Te}])=>{const Re=streamFromEmitter(pipe(xe,withLatestFrom(ye),scan$1(([,ke,Be,Ie],[{items:Ne,totalCount:je,bottom:ze,offsetBottom:Ue},qe])=>{const Ke=ze+Ue;let Ge=0;return Be===je&&ke.length>0&&Ne.length>0&&(Ne[0].originalIndex===0&&ke[0].originalIndex===0||(Ge=Ke-Ie,Ge!==0&&(Ge+=qe))),[Ge,Ne,je,Ke]},[0,[],0,0]),filter(([ke])=>ke!==0),withLatestFrom(oe,ge,ue,me,$e,Te),filter(([,ke,Be,Ie,,,Ne])=>!Ne&&!Ie&&ke!==0&&Be===UP),map$1(([[ke],,,,,Be])=>(Be("Upward scrolling compensation",{amount:ke},LogLevel.DEBUG),ke))));function Ae(ke){ke>0?(publish(ne,{top:-ke,behavior:"auto"}),publish(ce,0)):(publish(ce,0),publish(ne,{top:-ke,behavior:"auto"}))}return subscribe(pipe(Re,withLatestFrom(ce,pe)),([ke,Be,Ie])=>{Ie&&isMobileSafari()?publish(ce,Be-ke):Ae(-ke)}),subscribe(pipe(combineLatest(statefulStreamFromEmitter(pe,!1),ce,Te),filter(([ke,Be,Ie])=>!ke&&!Ie&&Be!==0),map$1(([ke,Be])=>Be),throttleTime(1)),Ae),connect(pipe(_e,map$1(ke=>({top:-ke}))),ne),subscribe(pipe(ve,withLatestFrom(we,Se),map$1(([ke,{lastSize:Be,groupIndices:Ie,sizeTree:Ne},je])=>{function ze(Ue){return Ue*(Be+je)}if(Ie.length===0)return ze(ke);{let Ue=0;const qe=find(Ne,0);let Ke=0,Ge=0;for(;Keke&&(Ue-=qe,Ye=ke-Ke+1),Ke+=Ye,Ue+=ze(Ye),Ge++}return Ue}})),ke=>{publish(ce,ke),requestAnimationFrame(()=>{publish(ne,{top:ke}),requestAnimationFrame(()=>{publish(ce,0),publish(Te,!1)})})}),{deviation:ce}},tup(domIOSystem,stateFlagsSystem,listStateSystem,sizeSystem,loggerSystem,recalcSystem)),initialScrollTopSystem=system(([{didMount:ne},{scrollTo:oe},{listState:ce}])=>{const ue=statefulStream(0);return subscribe(pipe(ne,withLatestFrom(ue),filter(([,pe])=>pe!==0),map$1(([,pe])=>({top:pe}))),pe=>{handleNext(pipe(ce,skip(1),filter(me=>me.items.length>1)),()=>{requestAnimationFrame(()=>{publish(oe,pe)})})}),{initialScrollTop:ue}},tup(propsReadySystem,domIOSystem,listStateSystem),{singleton:!0}),alignToBottomSystem=system(([{viewportHeight:ne},{totalListHeight:oe}])=>{const ce=statefulStream(!1),ue=statefulStreamFromEmitter(pipe(combineLatest(ce,ne,oe),filter(([pe])=>pe),map$1(([,pe,me])=>Math.max(0,pe-me)),throttleTime(0),distinctUntilChanged()),0);return{alignToBottom:ce,paddingTopAddition:ue}},tup(domIOSystem,totalListHeightSystem),{singleton:!0}),windowScrollerSystem=system(([{scrollTo:ne,scrollContainerState:oe}])=>{const ce=stream$1(),ue=stream$1(),pe=stream$1(),me=statefulStream(!1),ge=statefulStream(void 0);return connect(pipe(combineLatest(ce,ue),map$1(([{viewportHeight:ye,scrollTop:xe,scrollHeight:ve},{offsetTop:_e}])=>({scrollTop:Math.max(0,xe-_e),scrollHeight:ve,viewportHeight:ye}))),oe),connect(pipe(ne,withLatestFrom(ue),map$1(([ye,{offsetTop:xe}])=>({...ye,top:ye.top+xe}))),pe),{useWindowScroll:me,customScrollParent:ge,windowScrollContainerState:ce,windowViewportRect:ue,windowScrollTo:pe}},tup(domIOSystem)),defaultCalculateViewLocation=({itemTop:ne,itemBottom:oe,viewportTop:ce,viewportBottom:ue,locationParams:{behavior:pe,align:me,...ge}})=>neue?{...ge,behavior:pe,align:me??"end"}:null,scrollIntoViewSystem=system(([{sizes:ne,totalCount:oe,gap:ce},{scrollTop:ue,viewportHeight:pe,headerHeight:me,fixedHeaderHeight:ge,fixedFooterHeight:ye,scrollingInProgress:xe},{scrollToIndex:ve}])=>{const _e=stream$1();return connect(pipe(_e,withLatestFrom(ne,pe,oe,me,ge,ye,ue),withLatestFrom(ce),map$1(([[we,Se,$e,Te,Re,Ae,ke,Be],Ie])=>{const{done:Ne,behavior:je,align:ze,calculateViewLocation:Ue=defaultCalculateViewLocation,...qe}=we,Ke=originalIndexFromLocation(we,Se,Te-1),Ge=offsetOf(Ke,Se.offsetTree,Ie)+Re+Ae,Ye=Ge+findMaxKeyValue(Se.sizeTree,Ke)[1],Xe=Be+Ae,Je=Be+$e-ke,Qe=Ue({itemTop:Ge,itemBottom:Ye,viewportTop:Xe,viewportBottom:Je,locationParams:{behavior:je,align:ze,...qe}});return Qe?Ne&&handleNext(pipe(xe,filter(Ze=>Ze===!1),skip(getValue(xe)?1:2)),Ne):Ne&&Ne(),Qe}),filter(we=>we!==null)),ve),{scrollIntoView:_e}},tup(sizeSystem,domIOSystem,scrollToIndexSystem,listStateSystem,loggerSystem),{singleton:!0}),stateLoadSystem=system(([{sizes:ne,sizeRanges:oe},{scrollTop:ce,headerHeight:ue},{initialTopMostItemIndex:pe},{didMount:me},{useWindowScroll:ge,windowScrollContainerState:ye,windowViewportRect:xe}])=>{const ve=stream$1(),_e=statefulStream(void 0),we=statefulStream(null),Se=statefulStream(null);return connect(ye,we),connect(xe,Se),subscribe(pipe(ve,withLatestFrom(ne,ce,ge,we,Se,ue)),([$e,Te,Re,Ae,ke,Be,Ie])=>{const Ne=sizeTreeToRanges(Te.sizeTree);Ae&&ke!==null&&Be!==null&&(Re=ke.scrollTop-Be.offsetTop),Re-=Ie,$e({ranges:Ne,scrollTop:Re})}),connect(pipe(_e,filter(isDefined),map$1(locationFromSnapshot)),pe),connect(pipe(me,withLatestFrom(_e),filter(([,$e])=>$e!==void 0),distinctUntilChanged(),map$1(([,$e])=>$e.ranges)),oe),{getState:ve,restoreStateFrom:_e}},tup(sizeSystem,domIOSystem,initialTopMostItemIndexSystem,propsReadySystem,windowScrollerSystem));function locationFromSnapshot(ne){return{offset:ne.scrollTop,index:0,align:"start"}}const featureGroup1System=system(([ne,oe,ce,ue,pe,me,ge,ye,xe,ve])=>({...ne,...oe,...ce,...ue,...pe,...me,...ge,...ye,...xe,...ve}),tup(sizeRangeSystem,initialItemCountSystem,propsReadySystem,scrollSeekSystem,totalListHeightSystem,initialScrollTopSystem,alignToBottomSystem,windowScrollerSystem,scrollIntoViewSystem,loggerSystem)),listSystem=system(([{totalCount:ne,sizeRanges:oe,fixedItemSize:ce,defaultItemSize:ue,trackItemSizes:pe,itemSize:me,data:ge,firstItemIndex:ye,groupIndices:xe,statefulTotalCount:ve,gap:_e,sizes:we},{initialTopMostItemIndex:Se,scrolledToInitialItem:$e,initialItemFinalLocationReached:Te},Re,Ae,ke,{listState:Be,topItemsIndexes:Ie,...Ne},{scrollToIndex:je},ze,{topItemCount:Ue},{groupCounts:qe},Ke])=>(connect(Ne.rangeChanged,Ke.scrollSeekRangeChanged),connect(pipe(Ke.windowViewportRect,map$1(Ge=>Ge.visibleHeight)),Re.viewportHeight),{totalCount:ne,data:ge,firstItemIndex:ye,sizeRanges:oe,initialTopMostItemIndex:Se,scrolledToInitialItem:$e,initialItemFinalLocationReached:Te,topItemsIndexes:Ie,topItemCount:Ue,groupCounts:qe,fixedItemHeight:ce,defaultItemHeight:ue,gap:_e,...ke,statefulTotalCount:ve,listState:Be,scrollToIndex:je,trackItemSizes:pe,itemSize:me,groupIndices:xe,...Ne,...Ke,...Re,sizes:we,...Ae}),tup(sizeSystem,initialTopMostItemIndexSystem,domIOSystem,stateLoadSystem,followOutputSystem,listStateSystem,scrollToIndexSystem,upwardScrollFixSystem,topItemCountSystem,groupedListSystem,featureGroup1System)),WEBKIT_STICKY="-webkit-sticky",STICKY="sticky",positionStickyCssValue=simpleMemoize(()=>{if(typeof document>"u")return STICKY;const ne=document.createElement("div");return ne.style.position=WEBKIT_STICKY,ne.style.position===WEBKIT_STICKY?WEBKIT_STICKY:STICKY});function useWindowViewportRectRef(ne,oe,ce){const ue=React$2.useRef(null),pe=React$2.useCallback(xe=>{if(xe===null||!xe.offsetParent)return;const ve=xe.getBoundingClientRect(),_e=ve.width;let we,Se;if(oe){const $e=oe.getBoundingClientRect(),Te=ve.top-$e.top;we=$e.height-Math.max(0,Te),Se=Te+oe.scrollTop}else we=window.innerHeight-Math.max(0,ve.top),Se=ve.top+window.pageYOffset;ue.current={offsetTop:Se,visibleHeight:we,visibleWidth:_e},ne(ue.current)},[ne,oe]),{callbackRef:me,ref:ge}=useSizeWithElRef(pe,!0,ce),ye=React$2.useCallback(()=>{pe(ge.current)},[pe,ge]);return React$2.useEffect(()=>{if(oe){oe.addEventListener("scroll",ye);const xe=new ResizeObserver(()=>{requestAnimationFrame(ye)});return xe.observe(oe),()=>{oe.removeEventListener("scroll",ye),xe.unobserve(oe)}}else return window.addEventListener("scroll",ye),window.addEventListener("resize",ye),()=>{window.removeEventListener("scroll",ye),window.removeEventListener("resize",ye)}},[ye,oe]),me}const VirtuosoMockContext=React$2.createContext(void 0),VirtuosoGridMockContext=React$2.createContext(void 0);function identity(ne){return ne}const listComponentPropsSystem=system(()=>{const ne=statefulStream(xe=>`Item ${xe}`),oe=statefulStream(null),ce=statefulStream(xe=>`Group ${xe}`),ue=statefulStream({}),pe=statefulStream(identity),me=statefulStream("div"),ge=statefulStream(noop$4),ye=(xe,ve=null)=>statefulStreamFromEmitter(pipe(ue,map$1(_e=>_e[xe]),distinctUntilChanged()),ve);return{context:oe,itemContent:ne,groupContent:ce,components:ue,computeItemKey:pe,HeaderFooterTag:me,scrollerRef:ge,FooterComponent:ye("Footer"),HeaderComponent:ye("Header"),TopItemListComponent:ye("TopItemList"),ListComponent:ye("List","div"),ItemComponent:ye("Item","div"),GroupComponent:ye("Group","div"),ScrollerComponent:ye("Scroller","div"),EmptyPlaceholder:ye("EmptyPlaceholder"),ScrollSeekPlaceholder:ye("ScrollSeekPlaceholder")}}),combinedSystem$2=system(([ne,oe])=>({...ne,...oe}),tup(listSystem,listComponentPropsSystem)),DefaultScrollSeekPlaceholder$1=({height:ne})=>jsxRuntimeExports.jsx("div",{style:{height:ne}}),GROUP_STYLE={position:positionStickyCssValue(),zIndex:1,overflowAnchor:"none"},ITEM_STYLE$1={overflowAnchor:"none"},HORIZONTAL_ITEM_STYLE={...ITEM_STYLE$1,display:"inline-block",height:"100%"},Items$1=React$2.memo(function({showTopList:oe=!1}){const ce=useEmitterValue$2("listState"),ue=usePublisher$2("sizeRanges"),pe=useEmitterValue$2("useWindowScroll"),me=useEmitterValue$2("customScrollParent"),ge=usePublisher$2("windowScrollContainerState"),ye=usePublisher$2("scrollContainerState"),xe=me||pe?ge:ye,ve=useEmitterValue$2("itemContent"),_e=useEmitterValue$2("context"),we=useEmitterValue$2("groupContent"),Se=useEmitterValue$2("trackItemSizes"),$e=useEmitterValue$2("itemSize"),Te=useEmitterValue$2("log"),Re=usePublisher$2("gap"),Ae=useEmitterValue$2("horizontalDirection"),{callbackRef:ke}=useChangedListContentsSizes(ue,$e,Se,oe?noop$4:xe,Te,Re,me,Ae,useEmitterValue$2("skipAnimationFrameInResizeObserver")),[Be,Ie]=React$2.useState(0);useEmitter$2("deviation",Ze=>{Be!==Ze&&Ie(Ze)});const Ne=useEmitterValue$2("EmptyPlaceholder"),je=useEmitterValue$2("ScrollSeekPlaceholder")||DefaultScrollSeekPlaceholder$1,ze=useEmitterValue$2("ListComponent"),Ue=useEmitterValue$2("ItemComponent"),qe=useEmitterValue$2("GroupComponent"),Ke=useEmitterValue$2("computeItemKey"),Ge=useEmitterValue$2("isSeeking"),Ye=useEmitterValue$2("groupIndices").length>0,Xe=useEmitterValue$2("alignToBottom"),Je=useEmitterValue$2("initialItemFinalLocationReached"),Qe=oe?{}:{boxSizing:"border-box",...Ae?{whiteSpace:"nowrap",display:"inline-block",height:"100%",paddingLeft:ce.offsetTop,paddingRight:ce.offsetBottom,marginLeft:Be!==0?Be:Xe?"auto":0}:{marginTop:Be!==0?Be:Xe?"auto":0,paddingTop:ce.offsetTop,paddingBottom:ce.offsetBottom},...Je?{}:{visibility:"hidden"}};return!oe&&ce.totalCount===0&&Ne?jsxRuntimeExports.jsx(Ne,{...contextPropIfNotDomElement(Ne,_e)}):jsxRuntimeExports.jsx(ze,{...contextPropIfNotDomElement(ze,_e),ref:ke,style:Qe,"data-testid":oe?"virtuoso-top-item-list":"virtuoso-item-list",children:(oe?ce.topItems:ce.items).map(Ze=>{const Tt=Ze.originalIndex,Ut=Ke(Tt+ce.firstItemIndex,Ze.data,_e);return Ge?reactExports.createElement(je,{...contextPropIfNotDomElement(je,_e),key:Ut,index:Ze.index,height:Ze.size,type:Ze.type||"item",...Ze.type==="group"?{}:{groupIndex:Ze.groupIndex}}):Ze.type==="group"?reactExports.createElement(qe,{...contextPropIfNotDomElement(qe,_e),key:Ut,"data-index":Tt,"data-known-size":Ze.size,"data-item-index":Ze.index,style:GROUP_STYLE},we(Ze.index,_e)):reactExports.createElement(Ue,{...contextPropIfNotDomElement(Ue,_e),...itemPropIfNotDomElement(Ue,Ze.data),key:Ut,"data-index":Tt,"data-known-size":Ze.size,"data-item-index":Ze.index,"data-item-group-index":Ze.groupIndex,style:Ae?HORIZONTAL_ITEM_STYLE:ITEM_STYLE$1},Ye?ve(Ze.index,Ze.groupIndex,Ze.data,_e):ve(Ze.index,Ze.data,_e))})})}),scrollerStyle={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},horizontalScrollerStyle={outline:"none",overflowX:"auto",position:"relative"},viewportStyle=ne=>({width:"100%",height:"100%",position:"absolute",top:0,...ne?{display:"flex",flexDirection:"column"}:{}}),topItemListStyle={width:"100%",position:positionStickyCssValue(),top:0,zIndex:1};function contextPropIfNotDomElement(ne,oe){if(typeof ne!="string")return{context:oe}}function itemPropIfNotDomElement(ne,oe){return{item:typeof ne=="string"?void 0:oe}}const Header$1=React$2.memo(function(){const oe=useEmitterValue$2("HeaderComponent"),ce=usePublisher$2("headerHeight"),ue=useEmitterValue$2("HeaderFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,useEmitterValue$2("skipAnimationFrameInResizeObserver")),me=useEmitterValue$2("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null}),Footer$1=React$2.memo(function(){const oe=useEmitterValue$2("FooterComponent"),ce=usePublisher$2("footerHeight"),ue=useEmitterValue$2("HeaderFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,useEmitterValue$2("skipAnimationFrameInResizeObserver")),me=useEmitterValue$2("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null});function buildScroller({usePublisher:ne,useEmitter:oe,useEmitterValue:ce}){return React$2.memo(function({style:me,children:ge,...ye}){const xe=ne("scrollContainerState"),ve=ce("ScrollerComponent"),_e=ne("smoothScrollTargetReached"),we=ce("scrollerRef"),Se=ce("context"),$e=ce("horizontalDirection")||!1,{scrollerRef:Te,scrollByCallback:Re,scrollToCallback:Ae}=useScrollTop(xe,_e,ve,we,void 0,$e);oe("scrollTo",Ae),oe("scrollBy",Re);const ke=$e?horizontalScrollerStyle:scrollerStyle;return jsxRuntimeExports.jsx(ve,{ref:Te,style:{...ke,...me},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...ye,...contextPropIfNotDomElement(ve,Se),children:ge})})}function buildWindowScroller({usePublisher:ne,useEmitter:oe,useEmitterValue:ce}){return React$2.memo(function({style:me,children:ge,...ye}){const xe=ne("windowScrollContainerState"),ve=ce("ScrollerComponent"),_e=ne("smoothScrollTargetReached"),we=ce("totalListHeight"),Se=ce("deviation"),$e=ce("customScrollParent"),Te=ce("context"),{scrollerRef:Re,scrollByCallback:Ae,scrollToCallback:ke}=useScrollTop(xe,_e,ve,noop$4,$e);return useIsomorphicLayoutEffect(()=>(Re.current=$e||window,()=>{Re.current=null}),[Re,$e]),oe("windowScrollTo",ke),oe("scrollBy",Ae),jsxRuntimeExports.jsx(ve,{style:{position:"relative",...me,...we!==0?{height:we+Se}:{}},"data-virtuoso-scroller":!0,...ye,...contextPropIfNotDomElement(ve,Te),children:ge})})}const Viewport$2=({children:ne})=>{const oe=React$2.useContext(VirtuosoMockContext),ce=usePublisher$2("viewportHeight"),ue=usePublisher$2("fixedItemHeight"),pe=useEmitterValue$2("alignToBottom"),me=useEmitterValue$2("horizontalDirection"),ge=React$2.useMemo(()=>compose(ce,xe=>correctItemSize(xe,me?"width":"height")),[ce,me]),ye=useSize(ge,!0,useEmitterValue$2("skipAnimationFrameInResizeObserver"));return React$2.useEffect(()=>{oe&&(ce(oe.viewportHeight),ue(oe.itemHeight))},[oe,ce,ue]),jsxRuntimeExports.jsx("div",{style:viewportStyle(pe),ref:ye,"data-viewport-type":"element",children:ne})},WindowViewport$2=({children:ne})=>{const oe=React$2.useContext(VirtuosoMockContext),ce=usePublisher$2("windowViewportRect"),ue=usePublisher$2("fixedItemHeight"),pe=useEmitterValue$2("customScrollParent"),me=useWindowViewportRectRef(ce,pe,useEmitterValue$2("skipAnimationFrameInResizeObserver")),ge=useEmitterValue$2("alignToBottom");return React$2.useEffect(()=>{oe&&(ue(oe.itemHeight),ce({offsetTop:0,visibleHeight:oe.viewportHeight,visibleWidth:100}))},[oe,ce,ue]),jsxRuntimeExports.jsx("div",{ref:me,style:viewportStyle(ge),"data-viewport-type":"window",children:ne})},TopItemListContainer=({children:ne})=>{const oe=useEmitterValue$2("TopItemListComponent")||"div",ce=useEmitterValue$2("headerHeight"),ue={...topItemListStyle,marginTop:`${ce}px`},pe=useEmitterValue$2("context");return jsxRuntimeExports.jsx(oe,{style:ue,...contextPropIfNotDomElement(oe,pe),children:ne})},ListRoot=React$2.memo(function(oe){const ce=useEmitterValue$2("useWindowScroll"),ue=useEmitterValue$2("topItemsIndexes").length>0,pe=useEmitterValue$2("customScrollParent"),me=pe||ce?WindowScroller$2:Scroller$2,ge=pe||ce?WindowViewport$2:Viewport$2;return jsxRuntimeExports.jsxs(me,{...oe,children:[ue&&jsxRuntimeExports.jsx(TopItemListContainer,{children:jsxRuntimeExports.jsx(Items$1,{showTopList:!0})}),jsxRuntimeExports.jsxs(ge,{children:[jsxRuntimeExports.jsx(Header$1,{}),jsxRuntimeExports.jsx(Items$1,{}),jsxRuntimeExports.jsx(Footer$1,{})]})]})}),{Component:List,usePublisher:usePublisher$2,useEmitterValue:useEmitterValue$2,useEmitter:useEmitter$2}=systemToComponent(combinedSystem$2,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},ListRoot),Scroller$2=buildScroller({usePublisher:usePublisher$2,useEmitterValue:useEmitterValue$2,useEmitter:useEmitter$2}),WindowScroller$2=buildWindowScroller({usePublisher:usePublisher$2,useEmitterValue:useEmitterValue$2,useEmitter:useEmitter$2}),Virtuoso=List,INITIAL_GRID_STATE={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},PROBE_GRID_STATE={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round,ceil,floor,min,max}=Math;function buildProbeGridState(ne){return{...PROBE_GRID_STATE,items:ne}}function buildItems(ne,oe,ce){return Array.from({length:oe-ne+1}).map((ue,pe)=>{const me=ce===null?null:ce[pe+ne];return{index:pe+ne,data:me}})}function gapComparator(ne,oe){return ne&&ne.column===oe.column&&ne.row===oe.row}function dimensionComparator(ne,oe){return ne&&ne.width===oe.width&&ne.height===oe.height}const gridSystem=system(([{overscan:ne,visibleRange:oe,listBoundary:ce,increaseViewportBy:ue},{scrollTop:pe,viewportHeight:me,scrollBy:ge,scrollTo:ye,smoothScrollTargetReached:xe,scrollContainerState:ve,footerHeight:_e,headerHeight:we},Se,$e,{propsReady:Te,didMount:Re},{windowViewportRect:Ae,useWindowScroll:ke,customScrollParent:Be,windowScrollContainerState:Ie,windowScrollTo:Ne},je])=>{const ze=statefulStream(0),Ue=statefulStream(0),qe=statefulStream(INITIAL_GRID_STATE),Ke=statefulStream({height:0,width:0}),Ge=statefulStream({height:0,width:0}),Ye=stream$1(),Xe=stream$1(),Je=statefulStream(0),Qe=statefulStream(null),Ze=statefulStream({row:0,column:0}),Tt=stream$1(),Ut=stream$1(),Gt=statefulStream(!1),Nt=statefulStream(0),Wt=statefulStream(!0),Mt=statefulStream(!1),Yt=statefulStream(!1);subscribe(pipe(Re,withLatestFrom(Nt),filter(([cr,gr])=>!!gr)),()=>{publish(Wt,!1)}),subscribe(pipe(combineLatest(Re,Wt,Ge,Ke,Nt,Mt),filter(([cr,gr,ar,Pt,,or])=>cr&&!gr&&ar.height!==0&&Pt.height!==0&&!or)),([,,,,cr])=>{publish(Mt,!0),skipFrames(1,()=>{publish(Ye,cr)}),handleNext(pipe(pe),()=>{publish(ce,[0,0]),publish(Wt,!0)})}),connect(pipe(Ut,filter(cr=>cr!=null&&cr.scrollTop>0),mapTo(0)),Ue),subscribe(pipe(Re,withLatestFrom(Ut),filter(([,cr])=>cr!=null)),([,cr])=>{cr&&(publish(Ke,cr.viewport),publish(Ge,cr==null?void 0:cr.item),publish(Ze,cr.gap),cr.scrollTop>0&&(publish(Gt,!0),handleNext(pipe(pe,skip(1)),gr=>{publish(Gt,!1)}),publish(ye,{top:cr.scrollTop})))}),connect(pipe(Ke,map$1(({height:cr})=>cr)),me),connect(pipe(combineLatest(duc(Ke,dimensionComparator),duc(Ge,dimensionComparator),duc(Ze,(cr,gr)=>cr&&cr.column===gr.column&&cr.row===gr.row),duc(pe)),map$1(([cr,gr,ar,Pt])=>({viewport:cr,item:gr,gap:ar,scrollTop:Pt}))),Tt),connect(pipe(combineLatest(duc(ze),oe,duc(Ze,gapComparator),duc(Ge,dimensionComparator),duc(Ke,dimensionComparator),duc(Qe),duc(Ue),duc(Gt),duc(Wt),duc(Nt)),filter(([,,,,,,,cr])=>!cr),map$1(([cr,[gr,ar],Pt,or,Kt,Vt,Xt,,sr,fr])=>{const{row:kt,column:qt}=Pt,{height:Jt,width:rr}=or,{width:vr}=Kt;if(Xt===0&&(cr===0||vr===0))return INITIAL_GRID_STATE;if(rr===0){const Sr=getInitialTopMostItemIndexNumber(fr,cr),Cr=Math.max(Sr+Xt-1,0);return buildProbeGridState(buildItems(Sr,Cr,Vt))}const mr=itemsPerRow(vr,rr,qt);let $r,Mr;sr?gr===0&&ar===0&&Xt>0?($r=0,Mr=Xt-1):($r=mr*floor((gr+kt)/(Jt+kt)),Mr=mr*ceil((ar+kt)/(Jt+kt))-1,Mr=min(cr-1,max(Mr,mr-1)),$r=min(Mr,max(0,$r))):($r=0,Mr=-1);const Pr=buildItems($r,Mr,Vt),{top:lr,bottom:jt}=gridLayout(Kt,Pt,or,Pr),Dt=ceil(cr/mr),br=Dt*Jt+(Dt-1)*kt-jt;return{items:Pr,offsetTop:lr,offsetBottom:br,top:lr,bottom:jt,itemHeight:Jt,itemWidth:rr}})),qe),connect(pipe(Qe,filter(cr=>cr!==null),map$1(cr=>cr.length)),ze),connect(pipe(combineLatest(Ke,Ge,qe,Ze),filter(([cr,gr,{items:ar}])=>ar.length>0&&gr.height!==0&&cr.height!==0),map$1(([cr,gr,{items:ar},Pt])=>{const{top:or,bottom:Kt}=gridLayout(cr,Pt,gr,ar);return[or,Kt]}),distinctUntilChanged(tupleComparator)),ce);const ir=statefulStream(!1);connect(pipe(pe,withLatestFrom(ir),map$1(([cr,gr])=>gr||cr!==0)),ir);const tr=streamFromEmitter(pipe(duc(qe),filter(({items:cr})=>cr.length>0),withLatestFrom(ze,ir),filter(([{items:cr},gr,ar])=>ar&&cr[cr.length-1].index===gr-1),map$1(([,cr])=>cr-1),distinctUntilChanged())),Qt=streamFromEmitter(pipe(duc(qe),filter(({items:cr})=>cr.length>0&&cr[0].index===0),mapTo(0),distinctUntilChanged())),er=streamFromEmitter(pipe(duc(qe),withLatestFrom(Gt),filter(([{items:cr},gr])=>cr.length>0&&!gr),map$1(([{items:cr}])=>({startIndex:cr[0].index,endIndex:cr[cr.length-1].index})),distinctUntilChanged(rangeComparator),throttleTime(0)));connect(er,$e.scrollSeekRangeChanged),connect(pipe(Ye,withLatestFrom(Ke,Ge,ze,Ze),map$1(([cr,gr,ar,Pt,or])=>{const Kt=normalizeIndexLocation(cr),{align:Vt,behavior:Xt,offset:sr}=Kt;let fr=Kt.index;fr==="LAST"&&(fr=Pt-1),fr=max(0,fr,min(Pt-1,fr));let kt=itemTop(gr,or,ar,fr);return Vt==="end"?kt=round(kt-gr.height+ar.height):Vt==="center"&&(kt=round(kt-gr.height/2+ar.height/2)),sr&&(kt+=sr),{top:kt,behavior:Xt}})),ye);const hr=statefulStreamFromEmitter(pipe(qe,map$1(cr=>cr.offsetBottom+cr.bottom)),0);return connect(pipe(Ae,map$1(cr=>({width:cr.visibleWidth,height:cr.visibleHeight}))),Ke),{data:Qe,totalCount:ze,viewportDimensions:Ke,itemDimensions:Ge,scrollTop:pe,scrollHeight:Xe,overscan:ne,increaseViewportBy:ue,scrollBy:ge,scrollTo:ye,scrollToIndex:Ye,smoothScrollTargetReached:xe,windowViewportRect:Ae,windowScrollTo:Ne,useWindowScroll:ke,customScrollParent:Be,windowScrollContainerState:Ie,deviation:Je,scrollContainerState:ve,footerHeight:_e,headerHeight:we,initialItemCount:Ue,gap:Ze,restoreStateFrom:Ut,...$e,initialTopMostItemIndex:Nt,horizontalDirection:Yt,gridState:qe,totalListHeight:hr,...Se,startReached:Qt,endReached:tr,rangeChanged:er,stateChanged:Tt,propsReady:Te,stateRestoreInProgress:Gt,...je}},tup(sizeRangeSystem,domIOSystem,stateFlagsSystem,scrollSeekSystem,propsReadySystem,windowScrollerSystem,loggerSystem));function gridLayout(ne,oe,ce,ue){const{height:pe}=ce;if(pe===void 0||ue.length===0)return{top:0,bottom:0};const me=itemTop(ne,oe,ce,ue[0].index),ge=itemTop(ne,oe,ce,ue[ue.length-1].index)+pe;return{top:me,bottom:ge}}function itemTop(ne,oe,ce,ue){const pe=itemsPerRow(ne.width,ce.width,oe.column),me=floor(ue/pe),ge=me*ce.height+max(0,me-1)*oe.row;return ge>0?ge+oe.row:ge}function itemsPerRow(ne,oe,ce){return max(1,floor((ne+ce)/(floor(oe)+ce)))}const gridComponentPropsSystem=system(()=>{const ne=statefulStream(we=>`Item ${we}`),oe=statefulStream({}),ce=statefulStream(null),ue=statefulStream("virtuoso-grid-item"),pe=statefulStream("virtuoso-grid-list"),me=statefulStream(identity),ge=statefulStream("div"),ye=statefulStream(noop$4),xe=(we,Se=null)=>statefulStreamFromEmitter(pipe(oe,map$1($e=>$e[we]),distinctUntilChanged()),Se),ve=statefulStream(!1),_e=statefulStream(!1);return connect(duc(_e),ve),{readyStateChanged:ve,reportReadyState:_e,context:ce,itemContent:ne,components:oe,computeItemKey:me,itemClassName:ue,listClassName:pe,headerFooterTag:ge,scrollerRef:ye,FooterComponent:xe("Footer"),HeaderComponent:xe("Header"),ListComponent:xe("List","div"),ItemComponent:xe("Item","div"),ScrollerComponent:xe("Scroller","div"),ScrollSeekPlaceholder:xe("ScrollSeekPlaceholder","div")}}),combinedSystem$1=system(([ne,oe])=>({...ne,...oe}),tup(gridSystem,gridComponentPropsSystem)),GridItems=React$2.memo(function(){const oe=useEmitterValue$1("gridState"),ce=useEmitterValue$1("listClassName"),ue=useEmitterValue$1("itemClassName"),pe=useEmitterValue$1("itemContent"),me=useEmitterValue$1("computeItemKey"),ge=useEmitterValue$1("isSeeking"),ye=usePublisher$1("scrollHeight"),xe=useEmitterValue$1("ItemComponent"),ve=useEmitterValue$1("ListComponent"),_e=useEmitterValue$1("ScrollSeekPlaceholder"),we=useEmitterValue$1("context"),Se=usePublisher$1("itemDimensions"),$e=usePublisher$1("gap"),Te=useEmitterValue$1("log"),Re=useEmitterValue$1("stateRestoreInProgress"),Ae=usePublisher$1("reportReadyState"),ke=useSize(React$2.useMemo(()=>Be=>{const Ie=Be.parentElement.parentElement.scrollHeight;ye(Ie);const Ne=Be.firstChild;if(Ne){const{width:je,height:ze}=Ne.getBoundingClientRect();Se({width:je,height:ze})}$e({row:resolveGapValue("row-gap",getComputedStyle(Be).rowGap,Te),column:resolveGapValue("column-gap",getComputedStyle(Be).columnGap,Te)})},[ye,Se,$e,Te]),!0,!1);return useIsomorphicLayoutEffect(()=>{oe.itemHeight>0&&oe.itemWidth>0&&Ae(!0)},[oe]),Re?null:jsxRuntimeExports.jsx(ve,{ref:ke,className:ce,...contextPropIfNotDomElement(ve,we),style:{paddingTop:oe.offsetTop,paddingBottom:oe.offsetBottom},"data-testid":"virtuoso-item-list",children:oe.items.map(Be=>{const Ie=me(Be.index,Be.data,we);return ge?jsxRuntimeExports.jsx(_e,{...contextPropIfNotDomElement(_e,we),index:Be.index,height:oe.itemHeight,width:oe.itemWidth},Ie):reactExports.createElement(xe,{...contextPropIfNotDomElement(xe,we),className:ue,"data-index":Be.index,key:Ie},pe(Be.index,Be.data,we))})})}),Header=React$2.memo(function(){const oe=useEmitterValue$1("HeaderComponent"),ce=usePublisher$1("headerHeight"),ue=useEmitterValue$1("headerFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,!1),me=useEmitterValue$1("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null}),Footer=React$2.memo(function(){const oe=useEmitterValue$1("FooterComponent"),ce=usePublisher$1("footerHeight"),ue=useEmitterValue$1("headerFooterTag"),pe=useSize(React$2.useMemo(()=>ge=>ce(correctItemSize(ge,"height")),[ce]),!0,!1),me=useEmitterValue$1("context");return oe?jsxRuntimeExports.jsx(ue,{ref:pe,children:jsxRuntimeExports.jsx(oe,{...contextPropIfNotDomElement(oe,me)})}):null}),Viewport$1=({children:ne})=>{const oe=React$2.useContext(VirtuosoGridMockContext),ce=usePublisher$1("itemDimensions"),ue=usePublisher$1("viewportDimensions"),pe=useSize(React$2.useMemo(()=>me=>{ue(me.getBoundingClientRect())},[ue]),!0,!1);return React$2.useEffect(()=>{oe&&(ue({height:oe.viewportHeight,width:oe.viewportWidth}),ce({height:oe.itemHeight,width:oe.itemWidth}))},[oe,ue,ce]),jsxRuntimeExports.jsx("div",{style:viewportStyle(!1),ref:pe,children:ne})},WindowViewport$1=({children:ne})=>{const oe=React$2.useContext(VirtuosoGridMockContext),ce=usePublisher$1("windowViewportRect"),ue=usePublisher$1("itemDimensions"),pe=useEmitterValue$1("customScrollParent"),me=useWindowViewportRectRef(ce,pe,!1);return React$2.useEffect(()=>{oe&&(ue({height:oe.itemHeight,width:oe.itemWidth}),ce({offsetTop:0,visibleHeight:oe.viewportHeight,visibleWidth:oe.viewportWidth}))},[oe,ce,ue]),jsxRuntimeExports.jsx("div",{ref:me,style:viewportStyle(!1),children:ne})},GridRoot=React$2.memo(function({...oe}){const ce=useEmitterValue$1("useWindowScroll"),ue=useEmitterValue$1("customScrollParent"),pe=ue||ce?WindowScroller$1:Scroller$1,me=ue||ce?WindowViewport$1:Viewport$1;return jsxRuntimeExports.jsx(pe,{...oe,children:jsxRuntimeExports.jsxs(me,{children:[jsxRuntimeExports.jsx(Header,{}),jsxRuntimeExports.jsx(GridItems,{}),jsxRuntimeExports.jsx(Footer,{})]})})}),{Component:Grid,usePublisher:usePublisher$1,useEmitterValue:useEmitterValue$1,useEmitter:useEmitter$1}=systemToComponent(combinedSystem$1,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},GridRoot),Scroller$1=buildScroller({usePublisher:usePublisher$1,useEmitterValue:useEmitterValue$1,useEmitter:useEmitter$1}),WindowScroller$1=buildWindowScroller({usePublisher:usePublisher$1,useEmitterValue:useEmitterValue$1,useEmitter:useEmitter$1});function resolveGapValue(ne,oe,ce){return oe!=="normal"&&!(oe!=null&&oe.endsWith("px"))&&ce(`${ne} was not resolved to pixel value correctly`,oe,LogLevel.WARN),oe==="normal"?0:parseInt(oe??"0",10)}const Scroller=reactExports.forwardRef((ne,oe)=>{const ce=compilerRuntimeExports.c(36);let ue,pe,me;ce[0]!==ne?({style:me,children:ue,...pe}=ne,ce[0]=ne,ce[1]=ue,ce[2]=pe,ce[3]=me):(ue=ce[1],pe=ce[2],me=ce[3]);const ge=reactExports.useRef(null),{palette:ye,spacing:xe}=useTheme();let ve;ce[4]===Symbol.for("react.memo_cache_sentinel")?(ve={visibility:"visible",opacity:1},ce[4]=ve):ve=ce[4];let _e;ce[5]!==xe?(_e=xe(12),ce[5]=xe,ce[6]=_e):_e=ce[6];let we;ce[7]!==_e?(we={"min-height":_e},ce[7]=_e,ce[8]=we):we=ce[8];const Se=`calc(100% - ${xe(6)})`;let $e;ce[9]!==xe?($e=xe(6),ce[9]=xe,ce[10]=$e):$e=ce[10];let Te;ce[11]!==Se||ce[12]!==$e?(Te={height:Se,marginTop:$e},ce[11]=Se,ce[12]=$e,ce[13]=Te):Te=ce[13];let Re;ce[14]===Symbol.for("react.memo_cache_sentinel")?(Re={"--os-handle-perpendicular-size":"2px","--os-handle-perpendicular-size-hover":"6px","--os-handle-perpendicular-size-active":"6px","> div.os-scrollbar-handle":{borderRadius:0,opacity:.5,"&:hover":{opacity:.8}}},ce[14]=Re):Re=ce[14];let Ae;ce[15]!==we||ce[16]!==Te?(Ae={"--os-padding-perpendicular":"2px",".os-scrollbar":ve,".os-scrollbar-vertical > .os-scrollbar-track > .os-scrollbar-handle":we,"div.os-scrollbar-vertical > div.os-scrollbar-track":Te,"div > div.os-scrollbar-track":Re},ce[15]=we,ce[16]=Te,ce[17]=Ae):Ae=ce[17];const ke=useCss(Ae);let Be;ce[18]===Symbol.for("react.memo_cache_sentinel")?(Be={x:"hidden",y:"scroll"},ce[18]=Be):Be=ce[18];const Ie=ye.mode==="dark"?"os-theme-light":"os-theme-dark";let Ne;ce[19]!==Ie?(Ne={options:{overflow:Be,scrollbars:{autoHide:"move",theme:Ie}}},ce[19]=Ie,ce[20]=Ne):Ne=ce[20];const[je]=F$3(Ne);let ze;ce[21]!==je||ce[22]!==oe?(ze=()=>{typeof oe!="function"&&(oe!=null&&oe.current)&&(ge!=null&&ge.current)&&je({target:ge.current,elements:{viewport:oe.current}})},ce[21]=je,ce[22]=oe,ce[23]=ze):ze=ce[23];let Ue;ce[24]!==je?(Ue=[je],ce[24]=je,ce[25]=Ue):Ue=ce[25],reactExports.useEffect(ze,Ue);let qe;ce[26]!==oe?(qe=Xe=>{Xe&&oe&&(typeof oe=="function"?oe(Xe):oe.current=Xe)},ce[26]=oe,ce[27]=qe):qe=ce[27];const Ke=qe;let Ge;ce[28]!==ue||ce[29]!==Ke||ce[30]!==pe?(Ge=jsxRuntimeExports.jsx("div",{ref:Ke,...pe,children:ue}),ce[28]=ue,ce[29]=Ke,ce[30]=pe,ce[31]=Ge):Ge=ce[31];let Ye;return ce[32]!==ke||ce[33]!==me||ce[34]!==Ge?(Ye=jsxRuntimeExports.jsx("div",{ref:ge,style:me,className:ke,children:Ge}),ce[32]=ke,ce[33]=me,ce[34]=Ge,ce[35]=Ye):Ye=ce[35],Ye});function LazyList(ne){const oe=compilerRuntimeExports.c(18);let ce,ue,pe,me;if(oe[0]!==ne){const{items:Se,renderItem:$e,listOptions:Te,placeholder:Re,...Ae}=ne;me=Se,pe=$e,ce=Te,ue=Ae,oe[0]=ne,oe[1]=ce,oe[2]=ue,oe[3]=pe,oe[4]=me}else ce=oe[1],ue=oe[2],pe=oe[3],me=oe[4];let ge;oe[5]!==me?(ge=me===void 0?[]:me,oe[5]=me,oe[6]=ge):ge=oe[6];const ye=ge;let xe;oe[7]===Symbol.for("react.memo_cache_sentinel")?(xe={Scroller},oe[7]=xe):xe=oe[7];let ve;oe[8]!==ye||oe[9]!==pe?(ve=Se=>pe==null?void 0:pe(ye[Se],Se),oe[8]=ye,oe[9]=pe,oe[10]=ve):ve=oe[10];let _e;oe[11]!==ye.length||oe[12]!==ce||oe[13]!==ve?(_e=jsxRuntimeExports.jsx(Virtuoso,{components:xe,totalCount:ye.length,itemContent:ve,...ce}),oe[11]=ye.length,oe[12]=ce,oe[13]=ve,oe[14]=_e):_e=oe[14];let we;return oe[15]!==ue||oe[16]!==_e?(we=jsxRuntimeExports.jsx(Box,{...ue,children:_e}),oe[15]=ue,oe[16]=_e,oe[17]=we):we=oe[17],we}function Dot(ne){const oe=compilerRuntimeExports.c(3),{label:ce}=ne;let ue;oe[0]===Symbol.for("react.memo_cache_sentinel")?(ue=jsxRuntimeExports.jsx(SvgIcon$L,{sx:{color:"error.main",transform:"scale(0.5)",pl:.5,mr:2},fontSize:"small"}),oe[0]=ue):ue=oe[0];let pe;return oe[1]!==ce?(pe=jsxRuntimeExports.jsx(Tooltip,{title:ce,children:ue}),oe[1]=ce,oe[2]=pe):pe=oe[2],pe}function EventInspector({event:ne,index:oe,selected:ce,label:ue,...pe}){const{spacing:me}=useTheme(),ge=useCss({}),ye=useCss({}),xe=lodashExports.omit(ne,...OMIT_PROPS),ve=lodashExports.pick(xe,...ESSENTIAL_PROPS),_e=lodashExports.omit(xe,...ESSENTIAL_PROPS);return jsxRuntimeExports.jsxs(Box,{sx:{position:"relative",[`> .${ye}`]:{opacity:0},[`&:hover > .${ye}`]:{opacity:1},[`&:hover > .${ge}`]:{pr:8}},children:[jsxRuntimeExports.jsxs(ListItemButton,{className:ge,selected:ce,...pe,sx:{height:80,borderLeft:`${me(.5)} solid ${getColorHex(ne==null?void 0:ne.type)}`,...pe.sx},children:[jsxRuntimeExports.jsxs(ListItemIcon,{sx:{alignItems:"center"},children:[jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",children:oe}),ue&&jsxRuntimeExports.jsx(Dot,{label:ue})]}),jsxRuntimeExports.jsx(ListItemText,{sx:{overflow:"hidden"},primary:jsxRuntimeExports.jsxs(Box,{sx:{overflow:"hidden",whiteSpace:"nowrap",display:"block",textOverflow:"ellipsis",my:.5},children:[lodashExports.startCase((ne==null?void 0:ne.type)??"event")," ",(ne==null?void 0:ne.id)??"-"]}),secondaryTypographyProps:{component:"div",whiteSpace:"nowrap",overflow:"hidden"},secondary:jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"flex-start",sx:{"> *":{flex:0}},children:[jsxRuntimeExports.jsx(PropertyList,{event:ve,simple:!0}),jsxRuntimeExports.jsx(PropertyList,{event:_e,simple:!0})]})})]}),jsxRuntimeExports.jsx(Stack,{className:ye,direction:"row",sx:{p:1,justifyContent:"center",position:"absolute",right:0,alignItems:"center",top:0,height:"100%"},children:jsxRuntimeExports.jsx(PropertyDialog,{event:ne,trigger:we=>jsxRuntimeExports.jsx(IconButtonWithTooltip,{onClick:we,sx:{p:1.5,color:"text.secondary"},label:"See All Properties",icon:jsxRuntimeExports.jsx(SvgIcon$S,{fontSize:"small"})})})})]})}function Skeleton(ne){const oe=compilerRuntimeExports.c(12),{event:ce}=ne,{spacing:ue}=useTheme(),pe=`${ue(.5)} solid ${getColorHex(ce==null?void 0:ce.type)}`;let me;oe[0]!==pe?(me={height:80,borderLeft:pe},oe[0]=pe,oe[1]=me):me=oe[1];let ge;oe[2]!==ue?(ge=ue(4),oe[2]=ue,oe[3]=ge):ge=oe[3];let ye;oe[4]!==ge?(ye=jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(Skeleton$1,{animation:!1,width:ge})}),oe[4]=ge,oe[5]=ye):ye=oe[5];let xe;oe[6]!==me||oe[7]!==ye?(xe=jsxRuntimeExports.jsx(ListItem,{sx:me,children:ye}),oe[6]=me,oe[7]=ye,oe[8]=xe):xe=oe[8];let ve;oe[9]===Symbol.for("react.memo_cache_sentinel")?(ve=jsxRuntimeExports.jsx(Divider,{variant:"inset"}),oe[9]=ve):ve=oe[9];let _e;return oe[10]!==xe?(_e=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[xe,ve]}),oe[10]=xe,oe[11]=_e):_e=oe[11],_e}function lerp(ne,oe,ce){return ne+lodashExports.clamp(ce,0,1)*(oe-ne)}const ITEM_HEIGHT=80,PADDING_TOP=8,divider$2=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1}}),pxToInt=ne=>Number(ne.replace(/px$/,"")),SYMBOL_ALL=nanoid(),stepsLayerGuard=ne=>!!getController(ne).steps;function useStepsPageState(ne,oe){const ce=compilerRuntimeExports.c(13),{key:ue,setKey:pe,layers:me,layer:ge,allLayers:ye}=useLayer(ne==null?void 0:ne.layer,stepsLayerGuard),[xe,ve]=reactExports.useState(ne==null?void 0:ne.selectedType);let _e;ce[0]!==oe||ce[1]!==pe?(_e=function(Ae){oe==null||oe({layer:Ae}),pe(Ae)},ce[0]=oe,ce[1]=pe,ce[2]=_e):_e=ce[2];const we=_e;let Se;ce[3]!==oe?(Se=function(Ae){oe==null||oe({selectedType:Ae}),ve(Ae)},ce[3]=oe,ce[4]=Se):Se=ce[4];const $e=Se;let Te;return ce[5]!==ye||ce[6]!==ue||ce[7]!==ge||ce[8]!==me||ce[9]!==xe||ce[10]!==we||ce[11]!==$e?(Te={setSelectedType:$e,setKey:we,selectedType:xe,layers:me,allLayers:ye,key:ue,layer:ge},ce[5]=ye,ce[6]=ue,ce[7]=ge,ce[8]=me,ce[9]=xe,ce[10]=we,ce[11]=$e,ce[12]=Te):Te=ce[12],Te}const getStepsPageDescription=ne=>ne?`${ne} contains 0 steps.`:"When you load a trace, you'll see its steps here.";function StepsPage({template:ne}){const{spacing:oe}=useTheme(),ce=usePaper(),ue=useAcrylic(),pe=reactExports.useRef(null),[me,ge]=reactExports.useState(null),{controls:ye,onChange:xe,state:ve,dragHandle:_e}=useViewTreeContext(),{allLayers:we,key:Se,layers:$e,selectedType:Te,setKey:Re,setSelectedType:Ae,layer:ke}=useStepsPageState(ve,xe),{step:Be,playing:Ie,stepTo:Ne}=usePlaybackState(Se),je=reactExports.useMemo(()=>{if(ke){const{steps:Ye}=getController(ke);return Ye(ke)}},[ke]),{steps:ze,types:Ue,stepToFilteredStep:qe,selectedType:Ke}=reactExports.useMemo(()=>{if(je){const Ye=je.map((Tt,Ut)=>[Tt,Ut]),Xe=lodashExports.chain(Ye).map(([Tt])=>Tt.type).filter().uniq().value(),Je=!Xe.includes(Te),Qe=Je?Ye:Ye.filter(([Tt])=>Tt.type===Te),{stepMap:Ze}=lodashExports.reduce(Ye,(Tt,[,Ut])=>{const Gt=lodashExports.findIndex(Qe,([,Wt])=>Wt>=Ut,Tt.from),Nt=Gt===-1?Qe.length:Gt;return Tt.from=Nt,Tt.stepMap.push(Nt),Tt},{from:0,stepMap:[]});return{steps:Qe,types:Xe,stepToFilteredStep:Tt=>Ze[Tt],selectedType:Je?SYMBOL_ALL:Te}}return{}},[je,Te]),Ge=useBreakpoints(Se);return reactExports.useEffect(()=>{if(qe&&me&&pe.current){const Ye=qe(Be);if(Ie){let Xe=!1;const Je=Qe=>{var Ze;if(!Xe&&"scrollTop"in me&&!lodashExports.isUndefined(Be)){const{scrollTop:Tt}=me,Ut=Ye*ITEM_HEIGHT;(Ze=pe.current)==null||Ze.scrollTo({top:lerp(Tt,Ut,1e-6*Qe)}),requestAnimationFrame(Je)}};return requestAnimationFrame(Je),()=>{Xe=!0}}else pe.current.scrollToIndex({index:Ye,behavior:"smooth",offset:-pxToInt(oe(12+PADDING_TOP))})}},[Be,pe,me,qe,Ie]),jsxRuntimeExports.jsxs(ne,{onChange:xe,stack:ve,children:[jsxRuntimeExports.jsx(ne.Title,{children:"Steps"}),jsxRuntimeExports.jsx(ne.Handle,{children:_e}),jsxRuntimeExports.jsxs(ne.Content,{children:[jsxRuntimeExports.jsx(Flex,{vertical:!0,alignItems:"center",children:ze?ze.length?jsxRuntimeExports.jsx(LazyList,{sx:{width:"100%",height:"100%"},items:ze,listOptions:{scrollerRef:ge,ref:pe,defaultItemHeight:ITEM_HEIGHT,overscan:0},renderItem:([Ye,Xe],Je)=>{var Qe;return Ie?jsxRuntimeExports.jsx(Box,{sx:{pt:Je?0:oe(6+PADDING_TOP)},children:jsxRuntimeExports.jsx(Skeleton,{event:Ye})},Je):jsxRuntimeExports.jsxs(Box,{sx:{height:pxToInt(oe(Je?0:6+PADDING_TOP))+ITEM_HEIGHT,pt:Je?0:oe(6+PADDING_TOP)},children:[jsxRuntimeExports.jsx(EventInspector,{event:Ye,index:Xe,selected:Xe===Be,label:(Qe=Ge(Xe))==null?void 0:Qe.result,onClick:()=>Ne(Xe)}),jsxRuntimeExports.jsx(Divider,{variant:"inset"})]},Je)}}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$u,{}),label:"Events",secondary:getStepsPageDescription(inferLayerName(ke))}):jsxRuntimeExports.jsx(Placeholder$2,{icon:jsxRuntimeExports.jsx(SvgIcon$u,{}),label:"Events",secondary:getStepsPageDescription()})}),!!(ze!=null&&ze.length)&&jsxRuntimeExports.jsx(Stack,{direction:"row",sx:{...ce(1),...ue,alignItems:"center",position:"absolute",top:Ye=>Ye.spacing(6),height:Ye=>Ye.spacing(6),borderRadius:1,px:1,m:1},children:jsxRuntimeExports.jsx(Playback,{layer:ke})})]}),jsxRuntimeExports.jsxs(ne.Options,{children:[jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),label:"Layer",value:Se,items:lodashExports.map(we,Ye=>({id:Ye.key,hidden:!lodashExports.find($e,{key:Ye.key}),name:inferLayerName(Ye)})),onChange:Re,arrow:!0,ellipsis:12}),divider$2,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$K,{sx:{color:Ke===SYMBOL_ALL||!Ke?grey$2[tint]:getColorHex(Ke)}}),label:"Event Type",value:Ke,items:[{id:SYMBOL_ALL,name:"All Events"},...lodashExports.map(Ue,Ye=>({id:`${Ye}`,name:lodashExports.startCase(Ye)}))],onChange:Ae,arrow:!0,ellipsis:12})]}),jsxRuntimeExports.jsx(ne.Extras,{children:ye})]})}function SelectMulti(ne){const oe=compilerRuntimeExports.c(7),{trigger:ce,items:ue,value:pe,onChange:me,placeholder:ge,defaultChecked:ye}=ne,xe=ge===void 0?"Select Options":ge;useSmallDisplay(),lodashExports.max([lodashExports.findIndex(ue,_e=>{const{value:we}=_e;return!!(pe!=null&&pe[we])}),0]);let ve;return oe[0]!==ye||oe[1]!==ue||oe[2]!==me||oe[3]!==xe||oe[4]!==ce||oe[5]!==pe?(ve=jsxRuntimeExports.jsx(PopupState,{variant:"popover",children:_e=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tooltip,{title:xe,children:jsxRuntimeExports.jsx("span",{children:ce==null?void 0:ce(bindTrigger(_e))})}),jsxRuntimeExports.jsx(Menu,{...bindMenu(_e),anchorOrigin:{horizontal:"left",vertical:"bottom"},transformOrigin:{vertical:"top",horizontal:"left"},children:lodashExports.map(ue,we=>{const{value:Se,label:$e,disabled:Te}=we;return jsxRuntimeExports.jsxs(MenuItem,{disabled:Te,onClick:()=>{me==null||me({...pe,[Se]:!((pe==null?void 0:pe[Se])??ye)})},children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(Checkbox,{sx:{p:0},checked:!!((pe==null?void 0:pe[Se])??ye)})}),$e]},Se)})})]})}),oe[0]=ye,oe[1]=ue,oe[2]=me,oe[3]=xe,oe[4]=ce,oe[5]=pe,oe[6]=ve):ve=oe[6],ve}function FeaturePickerMulti(ne){var Be;const oe=compilerRuntimeExports.c(23),{label:ce,value:ue,onChange:pe,items:me,icon:ge,showArrow:ye,defaultChecked:xe,ellipsis:ve}=ne,_e=ve===void 0?1/0:ve;let we;oe[0]!==xe||oe[1]!==ue?(we=Ie=>{const{id:Ne}=Ie;return!!((ue==null?void 0:ue[Ne])??xe)},oe[0]=xe,oe[1]=ue,oe[2]=we):we=oe[2];let Se;if(oe[3]!==me||oe[4]!==ce||oe[5]!==we){const Ie=lodashExports.filter(me,we);Se=Ie.length?Ie.length===1?(Be=lodashExports.head(Ie))==null?void 0:Be.name:`${Ie.length} Selected`:ce,oe[3]=me,oe[4]=ce,oe[5]=we,oe[6]=Se}else Se=oe[6];const $e=Se;let Te;oe[7]!==ce?(Te=lodashExports.startCase(ce),oe[7]=ce,oe[8]=Te):Te=oe[8];let Re;oe[9]!==$e||oe[10]!==_e||oe[11]!==ge||oe[12]!==(me==null?void 0:me.length)||oe[13]!==ye?(Re=Ie=>jsxRuntimeExports.jsx(FeaturePickerButton,{...Ie,disabled:!(me!=null&&me.length),icon:ge,arrow:ye,children:lodashExports.truncate($e,{length:_e})}),oe[9]=$e,oe[10]=_e,oe[11]=ge,oe[12]=me==null?void 0:me.length,oe[13]=ye,oe[14]=Re):Re=oe[14];let Ae;oe[15]!==me?(Ae=lodashExports.map(me,_temp$8),oe[15]=me,oe[16]=Ae):Ae=oe[16];let ke;return oe[17]!==pe||oe[18]!==Te||oe[19]!==Re||oe[20]!==Ae||oe[21]!==ue?(ke=jsxRuntimeExports.jsx(SelectMulti,{defaultChecked:!0,placeholder:Te,trigger:Re,items:Ae,value:ue,onChange:pe}),oe[17]=pe,oe[18]=Te,oe[19]=Re,oe[20]=Ae,oe[21]=ue,oe[22]=ke):ke=oe[22],ke}function _temp$8(ne){const{id:oe,name:ce,description:ue,hidden:pe}=ne;return{value:oe,label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Typography,{component:"div",children:ce}),jsxRuntimeExports.jsx(Space,{}),jsxRuntimeExports.jsx(Typography,{component:"div",variant:"body2",color:"text.secondary",children:ue})]}),disabled:pe}}function useRendererResolver(ne){var xe,ve;const oe=compilerRuntimeExports.c(5),[ce]=useRenderers();let ue,pe;oe[0]!==ce?(pe=lodashExports.head(ce),oe[0]=ce,oe[1]=pe):pe=oe[1],ue=pe;const me=ue,ge=ne&&ne!=="internal:auto"?ne:(ve=(xe=me==null?void 0:me.renderer)==null?void 0:xe.meta)==null?void 0:ve.id;let ye;return oe[2]!==me||oe[3]!==ge?(ye={auto:me,selected:ge},oe[2]=me,oe[3]=ge,oe[4]=ye):ye=oe[4],ye}const divider$1=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1}});function ViewportPage({template:ne}){var Ae,ke;const{controls:oe,onChange:ce,state:ue,dragHandle:pe}=useViewTreeContext(),[me]=useRenderers(),ge=usePaper(),ye=useAcrylic(),[{layers:xe}]=useLayers(),[ve,_e]=reactExports.useState({}),we=reactExports.useMemo(()=>lodashExports.filter(xe,Be=>(ve==null?void 0:ve[Be.key])??!0),[ve,xe,xe==null?void 0:xe.length]),[Se,$e]=reactExports.useState(),{selected:Te,auto:Re}=useRendererResolver(ue==null?void 0:ue.renderer);return reactExports.useEffect(()=>{lodashExports.delay(()=>{var Be;(Be=Se==null?void 0:Se.fitCamera)==null||Be.call(Se,Ie=>{var Ne;return lodashExports.chain(we).filter("viewKey").map("key").includes(((Ne=Ie.meta)==null?void 0:Ne.sourceLayer)??"").value()})},150)},[Se,lodashExports.chain(we).map("viewKey").sort().join(".").value()]),jsxRuntimeExports.jsxs(ne,{onChange:ce,stack:ue,children:[jsxRuntimeExports.jsx(ne.Key,{children:"viewport"}),jsxRuntimeExports.jsx(ne.Title,{children:"Viewport"}),jsxRuntimeExports.jsx(ne.Handle,{children:pe}),jsxRuntimeExports.jsx(ne.Content,{children:jsxRuntimeExports.jsx(Flex,{children:jsxRuntimeExports.jsx(AutoSizer,{children:Be=>jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(TraceRenderer,{...Be,layers:we,renderer:Te,rendererRef:$e}),jsxRuntimeExports.jsx(Stack,{sx:{pt:6,position:"absolute",top:0,left:0},children:jsxRuntimeExports.jsxs(Stack,{direction:"row",sx:{...ge(1),...ye,alignItems:"center",height:Ie=>Ie.spacing(6),px:1,m:1},children:[jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",disabled:!Se,onClick:()=>{Se==null||Se.fitCamera()},label:"Fit",icon:jsxRuntimeExports.jsx(SvgIcon$g,{})}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",disabled:!Se,onClick:()=>{var Ie;(Ie=Se==null?void 0:Se.initialCamera)==null||Ie.call(Se)},icon:jsxRuntimeExports.jsx(SvgIcon$1,{}),label:"1 to 1"}),divider$1,jsxRuntimeExports.jsx(IconButtonWithTooltip,{color:"primary",disabled:!Se,onClick:async()=>{const Ie=await(Se==null?void 0:Se.toDataUrl());Ie&&download(Ie,dist$3.generateUsername("-"))},icon:jsxRuntimeExports.jsx(SvgIcon$h,{}),label:"capture-screenshot"})]})})]})})})}),jsxRuntimeExports.jsx(ne.Options,{children:jsxRuntimeExports.jsxs(Stack,{direction:"row",children:[jsxRuntimeExports.jsx(FeaturePicker,{label:"Renderer",icon:jsxRuntimeExports.jsx(SvgIcon$Y,{}),value:(ue==null?void 0:ue.renderer)??"internal:auto",onChange:Be=>ce==null?void 0:ce({renderer:Be}),items:[{id:"internal:auto",name:`Auto (${((ke=(Ae=Re==null?void 0:Re.renderer)==null?void 0:Ae.meta)==null?void 0:ke.name)??"None"})`},...lodashExports.map(lodashExports.filter(me,Be=>!!Be.renderer),({renderer:Be})=>{var Ie,Ne,je;return{id:(Ie=Be==null?void 0:Be.meta)==null?void 0:Ie.id,name:(Ne=Be==null?void 0:Be.meta)==null?void 0:Ne.name,description:(je=Be==null?void 0:Be.meta)==null?void 0:je.id}})],arrow:!0}),divider$1,jsxRuntimeExports.jsx(FeaturePickerMulti,{defaultChecked:!0,label:"Layers",icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),value:ve,onChange:_e,items:lodashExports.map(xe,Be=>({id:Be==null?void 0:Be.key,name:inferLayerName(Be)})),showArrow:!0,ellipsis:12})]})}),jsxRuntimeExports.jsx(ne.Extras,{children:oe})]})}const pages={explore:{id:"explore",name:"Explore",color:"deepOrange",description:"Browse examples and guides",icon:jsxRuntimeExports.jsx(SvgIcon$x,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$6,{}),content:ExplorePage,allowFullscreen:!0,showInSidebar:"always"},layers:{id:"layers",name:"Layers",description:"",color:"pink",icon:jsxRuntimeExports.jsx(SvgIcon$G,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$b,{}),content:LayersPage,allowFullscreen:!0,showInSidebar:"mobile-only"},steps:{id:"steps",name:"Events",description:"",color:"pink",icon:jsxRuntimeExports.jsx(SvgIcon$u,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$5,{}),content:StepsPage,allowFullscreen:!0},viewport:{id:"viewport",name:"Viewport",description:"",color:"deepPurple",icon:jsxRuntimeExports.jsx(SvgIcon$o,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon,{}),content:ViewportPage,allowFullscreen:!0},tree:{id:"tree",name:"Graph",description:"",color:"deepPurple",icon:jsxRuntimeExports.jsx(SvgIcon$10,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$k,{}),content:TreePage,allowFullscreen:!0},source:{id:"source",name:"Sources",description:"",color:"deepPurple",icon:jsxRuntimeExports.jsx(SvgIcon$T,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$d,{}),content:SourcePage,allowFullscreen:!0,showInSidebar:"mobile-only"},debug:{id:"debug",name:"Debugger",description:"",color:"indigo",icon:jsxRuntimeExports.jsx(SvgIcon$W,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$i,{}),content:DebugPage,allowFullscreen:!0,showInSidebar:"mobile-only"},info:{id:"info",name:"Logs",description:"",color:"grey",icon:jsxRuntimeExports.jsx(SvgIcon$F,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$a,{}),content:InfoPage,allowFullscreen:!0},settings:{id:"settings",name:"Settings",description:"",color:"grey",icon:jsxRuntimeExports.jsx(SvgIcon$t,{}),iconThin:jsxRuntimeExports.jsx(SvgIcon$4,{}),content:SettingsPage,allowFullscreen:!0,showInSidebar:"always"}},ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(oe){super(oe),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(oe){return{didCatch:!0,error:oe}}resetErrorBoundary(){const{error:oe}=this.state;if(oe!==null){for(var ce,ue,pe=arguments.length,me=new Array(pe),ge=0;ge0&&arguments[0]!==void 0?arguments[0]:[],oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return ne.length!==oe.length||ne.some((ce,ue)=>!Object.is(ce,oe[ue]))}const divider=jsxRuntimeExports.jsx(Divider,{orientation:"vertical",flexItem:!0,sx:{m:1,height:ne=>ne.spacing(3),alignSelf:"auto"}}),Page=withSlots(({slotProps:ne,onChange:oe,stack:ce})=>{var pe,me,ge,ye;const ue=useAcrylic();return jsxRuntimeExports.jsx(ErrorBoundary,{fallbackRender:xe=>{var ve,_e;return jsxRuntimeExports.jsxs(Stack,{sx:{background:we=>we.palette.background.paper,height:"100%"},children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",sx:{height:we=>we.spacing(6),alignItems:"center",pl:1,borderBottom:1,borderColor:"divider"},children:[(ve=ne.Handle)==null?void 0:ve.children,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$n,{}),label:"Choose View",onChange:we=>oe==null?void 0:oe({...ce,type:we}),value:ce==null?void 0:ce.type,items:lodashExports.values(pages),itemOrientation:"vertical"}),jsxRuntimeExports.jsx(Space,{sx:{mx:"auto"}}),(_e=ne.Extras)==null?void 0:_e.children]}),jsxRuntimeExports.jsx(Placeholder$2,{secondary:`${xe.error}`,icon:jsxRuntimeExports.jsx(SvgIcon$M,{})})]})},children:jsxRuntimeExports.jsxs(Flex,{vertical:!0,children:[jsxRuntimeExports.jsx(Flex,{sx:{position:"absolute",top:0,left:0,width:"100%"},children:jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"100%",bgcolor:"background.paper"},children:(pe=ne.Content)==null?void 0:pe.children})}),jsxRuntimeExports.jsxs(Flex,{sx:{height:xe=>xe.spacing(6),alignItems:"center"},children:[jsxRuntimeExports.jsx(Flex,{sx:{p:0,position:"absolute",top:0,left:0,width:"100%",borderBottom:1,borderColor:"divider",alignItems:"center",pr:6,...ue},children:jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsxs(Flex,{sx:{width:"max-content",height:xe=>xe.spacing(6),alignItems:"center",p:1},children:[(me=ne.Handle)==null?void 0:me.children,jsxRuntimeExports.jsx(FeaturePicker,{icon:jsxRuntimeExports.jsx(SvgIcon$n,{}),label:"Choose View",onChange:xe=>oe==null?void 0:oe({...ce,type:xe}),value:ce==null?void 0:ce.type,items:lodashExports.values(pages),itemOrientation:"vertical"}),((ge=ne.Options)==null?void 0:ge.children)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[divider,ne.Options.children]})]})})}),jsxRuntimeExports.jsx(Space,{sx:{mx:"auto"}}),(ye=ne.Extras)==null?void 0:ye.children]})]})})}),SidebarPage=withSlots(({slotProps:ne})=>{var pe,me,ge;const oe=useSidebarBackground(),ce=useAcrylic(oe),[,ue]=useUIState();return jsxRuntimeExports.jsx(ErrorBoundary,{fallback:jsxRuntimeExports.jsx(Box,{sx:{p:6,background:ye=>ye.palette.background.paper,height:"100%"},children:"This page encountered an error."}),children:jsxRuntimeExports.jsxs(Flex,{vertical:!0,children:[jsxRuntimeExports.jsx(Flex,{sx:{position:"absolute",top:0,left:0,width:"100%"},children:jsxRuntimeExports.jsx(Box,{sx:{width:"100%",height:"100%",bgcolor:oe},children:(pe=ne.Content)==null?void 0:pe.children})}),jsxRuntimeExports.jsx(Flex,{sx:{height:ye=>ye.spacing(6)},children:jsxRuntimeExports.jsxs(Flex,{sx:{p:0,position:"absolute",top:0,left:0,width:"100%",borderBottom:1,borderColor:"divider",alignItems:"center",...ce},children:[jsxRuntimeExports.jsx(Scroll,{x:!0,children:jsxRuntimeExports.jsxs(Flex,{sx:{width:"max-content",height:ye=>ye.spacing(6),alignItems:"center",p:1},children:[jsxRuntimeExports.jsx(Typography,{component:"div",sx:{p:1,color:"text.secondary"},children:(me=ne.Title)==null?void 0:me.children}),((ge=ne.Options)==null?void 0:ge.children)&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[divider,ne.Options.children]})]})}),jsxRuntimeExports.jsx(IconButtonWithTooltip,{onClick:()=>{ue(()=>{var ye;return{fullscreenModal:(ye=ne.Key)==null?void 0:ye.children,sidebarOpen:!1}})},size:"small",sx:{m:1},icon:jsxRuntimeExports.jsx(SvgIcon$I,{sx:{color:"text.secondary"},fontSize:"small"}),label:"Maximise"})]})})]})})});var sysend$1={exports:{}};/**@license * sysend.js - send messages between browser windows/tabs version 1.17.5 * * Copyright (C) 2014 Jakub T. Jankiewicz diff --git a/assets/parseGrid.worker-CTnsDGUU.js b/assets/parseGrid.worker-CTnsDGUU.js new file mode 100644 index 0000000..5444bcc --- /dev/null +++ b/assets/parseGrid.worker-CTnsDGUU.js @@ -0,0 +1,27 @@ +(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $a(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Da={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},gu=Da,Ua=Na,pu={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Na(a){var g,u=[],A=1,x;if(typeof a=="string")if(a=a.toLowerCase(),gu[a])u=gu[a].slice(),x="rgb";else if(a==="transparent")A=0,x="rgb",u=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(a)){var y=a.slice(1),w=y.length,O=w<=4;A=1,O?(u=[parseInt(y[0]+y[0],16),parseInt(y[1]+y[1],16),parseInt(y[2]+y[2],16)],w===4&&(A=parseInt(y[3]+y[3],16)/255)):(u=[parseInt(y[0]+y[1],16),parseInt(y[2]+y[3],16),parseInt(y[4]+y[5],16)],w===8&&(A=parseInt(y[6]+y[7],16)/255)),u[0]||(u[0]=0),u[1]||(u[1]=0),u[2]||(u[2]=0),x="rgb"}else if(g=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(a)){var b=g[1],I=b==="rgb",y=b.replace(/a$/,"");x=y;var w=y==="cmyk"?4:y==="gray"?1:3;u=g[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(E,q){if(/%$/.test(E))return q===w?parseFloat(E)/100:y==="rgb"?parseFloat(E)*255/100:parseFloat(E);if(y[q]==="h"){if(/deg$/.test(E))return parseFloat(E);if(pu[E]!==void 0)return pu[E]}return parseFloat(E)}),b===y&&u.push(1),A=I||u[w]===void 0?1:u[w],u=u.slice(0,w)}else a.length>10&&/[0-9](?:\s|\/)/.test(a)&&(u=a.match(/([0-9]+)/g).map(function(U){return parseFloat(U)}),x=a.match(/([a-z])/ig).join("").toLowerCase());else isNaN(a)?Array.isArray(a)||a.length?(u=[a[0],a[1],a[2]],x="rgb",A=a.length===4?a[3]:1):a instanceof Object&&(a.r!=null||a.red!=null||a.R!=null?(x="rgb",u=[a.r||a.red||a.R||0,a.g||a.green||a.G||0,a.b||a.blue||a.B||0]):(x="hsl",u=[a.h||a.hue||a.H||0,a.s||a.saturation||a.S||0,a.l||a.lightness||a.L||a.b||a.brightness]),A=a.a||a.alpha||a.opacity||1,a.opacity!=null&&(A/=100)):(x="rgb",u=[a>>>16,(a&65280)>>>8,a&255]);return{space:x,values:u,alpha:A}}var Ga={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},Ha=Ga,za={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(a){var g=a[0]/360,u=a[1]/100,A=a[2]/100,x,y,w,O,b;if(u===0)return b=A*255,[b,b,b];A<.5?y=A*(1+u):y=A+u-A*u,x=2*A-y,O=[0,0,0];for(var I=0;I<3;I++)w=g+1/3*-(I-1),w<0?w++:w>1&&w--,6*w<1?b=x+(y-x)*6*w:2*w<1?b=y:3*w<2?b=x+(y-x)*(2/3-w)*6:b=x,O[I]=b*255;return O}};Ha.hsl=function(a){var g=a[0]/255,u=a[1]/255,A=a[2]/255,x=Math.min(g,u,A),y=Math.max(g,u,A),w=y-x,O,b,I;return y===x?O=0:g===y?O=(u-A)/w:u===y?O=2+(A-g)/w:A===y&&(O=4+(g-u)/w),O=Math.min(O*60,360),O<0&&(O+=360),I=(x+y)/2,y===x?b=0:I<=.5?b=w/(y+x):b=w/(2-y-x),[O,b*100,I*100]};function Ka(a,g,u){return a*(1-u)+g*u}var Ya=Ka,Za=Xa;function Xa(a,g,u){return gu?u:a:ag?g:a}const Ja=Ua,Qa=za,Va=Ya,ka=Za;var ja=nl;function nl(a){return a=a.map(function(g){if(g=Ja(g),g.space!="rgb"){if(g.space!="hsl")throw"c.spacespace is not supported.";g.values=Qa.rgb(g.values)}return g.values.push(g.alpha),g.values}),function(g,u){u=u||Va,g=ka(g,0,1);var A=(a.length-1)*g,x=Math.floor(A),y=Math.ceil(A);g=A-x;var w=a[x],O=a[y],b=w.map(function(I,U){return I=u(I,O[U],g),U<3&&(I=Math.round(I)),I});return b[3]===1?"rgb("+b.slice(0,3)+")":"rgba("+b+")"}}var el=$a(ja),dr={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 + */dr.exports,function(a,g){(function(){var u,A="4.17.21",x=200,y="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",w="Expected a function",O="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",I=500,U="__lodash_placeholder__",Z=1,E=2,q=4,un=1,an=2,M=1,_n=2,$=4,C=8,z=16,Q=32,k=64,en=128,cn=256,Kt=512,is=30,us="...",fs=800,os=16,uf=1,as=2,ls=3,me=1/0,ae=9007199254740991,ss=17976931348623157e292,mr=NaN,Xn=4294967295,cs=Xn-1,hs=Xn>>>1,gs=[["ary",en],["bind",M],["bindKey",_n],["curry",C],["curryRight",z],["flip",Kt],["partial",Q],["partialRight",k],["rearg",cn]],Ce="[object Arguments]",wr="[object Array]",ps="[object AsyncFunction]",Xe="[object Boolean]",Je="[object Date]",_s="[object DOMException]",yr="[object Error]",xr="[object Function]",ff="[object GeneratorFunction]",Gn="[object Map]",Qe="[object Number]",ds="[object Null]",kn="[object Object]",of="[object Promise]",vs="[object Proxy]",Ve="[object RegExp]",Hn="[object Set]",ke="[object String]",br="[object Symbol]",ms="[object Undefined]",je="[object WeakMap]",ws="[object WeakSet]",nr="[object ArrayBuffer]",Le="[object DataView]",Yt="[object Float32Array]",Zt="[object Float64Array]",Xt="[object Int8Array]",Jt="[object Int16Array]",Qt="[object Int32Array]",Vt="[object Uint8Array]",kt="[object Uint8ClampedArray]",jt="[object Uint16Array]",ni="[object Uint32Array]",ys=/\b__p \+= '';/g,xs=/\b(__p \+=) '' \+/g,bs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,af=/&(?:amp|lt|gt|quot|#39);/g,lf=/[&<>"']/g,As=RegExp(af.source),Ss=RegExp(lf.source),Is=/<%-([\s\S]+?)%>/g,Rs=/<%([\s\S]+?)%>/g,sf=/<%=([\s\S]+?)%>/g,Os=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ts=/^\w*$/,Es=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ei=/[\\^$.*+?()[\]{}|]/g,Cs=RegExp(ei.source),ri=/^\s+/,Ls=/\s/,Ps=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fs=/\{\n\/\* \[wrapped with (.+)\] \*/,qs=/,? & /,Ms=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ws=/[()=,{}\[\]\/\s]/,Bs=/\\(\\)?/g,$s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cf=/\w*$/,Ds=/^[-+]0x[0-9a-f]+$/i,Us=/^0b[01]+$/i,Ns=/^\[object .+?Constructor\]$/,Gs=/^0o[0-7]+$/i,Hs=/^(?:0|[1-9]\d*)$/,zs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ar=/($^)/,Ks=/['\n\r\u2028\u2029\\]/g,Sr="\\ud800-\\udfff",Ys="\\u0300-\\u036f",Zs="\\ufe20-\\ufe2f",Xs="\\u20d0-\\u20ff",hf=Ys+Zs+Xs,gf="\\u2700-\\u27bf",pf="a-z\\xdf-\\xf6\\xf8-\\xff",Js="\\xac\\xb1\\xd7\\xf7",Qs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vs="\\u2000-\\u206f",ks=" \\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",_f="A-Z\\xc0-\\xd6\\xd8-\\xde",df="\\ufe0e\\ufe0f",vf=Js+Qs+Vs+ks,ti="['’]",js="["+Sr+"]",mf="["+vf+"]",Ir="["+hf+"]",wf="\\d+",nc="["+gf+"]",yf="["+pf+"]",xf="[^"+Sr+vf+wf+gf+pf+_f+"]",ii="\\ud83c[\\udffb-\\udfff]",ec="(?:"+Ir+"|"+ii+")",bf="[^"+Sr+"]",ui="(?:\\ud83c[\\udde6-\\uddff]){2}",fi="[\\ud800-\\udbff][\\udc00-\\udfff]",Pe="["+_f+"]",Af="\\u200d",Sf="(?:"+yf+"|"+xf+")",rc="(?:"+Pe+"|"+xf+")",If="(?:"+ti+"(?:d|ll|m|re|s|t|ve))?",Rf="(?:"+ti+"(?:D|LL|M|RE|S|T|VE))?",Of=ec+"?",Tf="["+df+"]?",tc="(?:"+Af+"(?:"+[bf,ui,fi].join("|")+")"+Tf+Of+")*",ic="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ef=Tf+Of+tc,fc="(?:"+[nc,ui,fi].join("|")+")"+Ef,oc="(?:"+[bf+Ir+"?",Ir,ui,fi,js].join("|")+")",ac=RegExp(ti,"g"),lc=RegExp(Ir,"g"),oi=RegExp(ii+"(?="+ii+")|"+oc+Ef,"g"),sc=RegExp([Pe+"?"+yf+"+"+If+"(?="+[mf,Pe,"$"].join("|")+")",rc+"+"+Rf+"(?="+[mf,Pe+Sf,"$"].join("|")+")",Pe+"?"+Sf+"+"+If,Pe+"+"+Rf,uc,ic,wf,fc].join("|"),"g"),cc=RegExp("["+Af+Sr+hf+df+"]"),hc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gc=["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"],pc=-1,rn={};rn[Yt]=rn[Zt]=rn[Xt]=rn[Jt]=rn[Qt]=rn[Vt]=rn[kt]=rn[jt]=rn[ni]=!0,rn[Ce]=rn[wr]=rn[nr]=rn[Xe]=rn[Le]=rn[Je]=rn[yr]=rn[xr]=rn[Gn]=rn[Qe]=rn[kn]=rn[Ve]=rn[Hn]=rn[ke]=rn[je]=!1;var nn={};nn[Ce]=nn[wr]=nn[nr]=nn[Le]=nn[Xe]=nn[Je]=nn[Yt]=nn[Zt]=nn[Xt]=nn[Jt]=nn[Qt]=nn[Gn]=nn[Qe]=nn[kn]=nn[Ve]=nn[Hn]=nn[ke]=nn[br]=nn[Vt]=nn[kt]=nn[jt]=nn[ni]=!0,nn[yr]=nn[xr]=nn[je]=!1;var _c={À:"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"},dc={"&":"&","<":"<",">":">",'"':""","'":"'"},vc={"&":"&","<":"<",">":">",""":'"',"'":"'"},mc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wc=parseFloat,yc=parseInt,Cf=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,xc=typeof self=="object"&&self&&self.Object===Object&&self,dn=Cf||xc||Function("return this")(),ai=g&&!g.nodeType&&g,we=ai&&!0&&a&&!a.nodeType&&a,Lf=we&&we.exports===ai,li=Lf&&Cf.process,Fn=function(){try{var c=we&&we.require&&we.require("util").types;return c||li&&li.binding&&li.binding("util")}catch{}}(),Pf=Fn&&Fn.isArrayBuffer,Ff=Fn&&Fn.isDate,qf=Fn&&Fn.isMap,Mf=Fn&&Fn.isRegExp,Wf=Fn&&Fn.isSet,Bf=Fn&&Fn.isTypedArray;function On(c,_,p){switch(p.length){case 0:return c.call(_);case 1:return c.call(_,p[0]);case 2:return c.call(_,p[0],p[1]);case 3:return c.call(_,p[0],p[1],p[2])}return c.apply(_,p)}function bc(c,_,p,R){for(var W=-1,X=c==null?0:c.length;++W-1}function si(c,_,p){for(var R=-1,W=c==null?0:c.length;++R-1;);return p}function Kf(c,_){for(var p=c.length;p--&&Fe(_,c[p],0)>-1;);return p}function Lc(c,_){for(var p=c.length,R=0;p--;)c[p]===_&&++R;return R}var Pc=pi(_c),Fc=pi(dc);function qc(c){return"\\"+mc[c]}function Mc(c,_){return c==null?u:c[_]}function qe(c){return cc.test(c)}function Wc(c){return hc.test(c)}function Bc(c){for(var _,p=[];!(_=c.next()).done;)p.push(_.value);return p}function mi(c){var _=-1,p=Array(c.size);return c.forEach(function(R,W){p[++_]=[W,R]}),p}function Yf(c,_){return function(p){return c(_(p))}}function ce(c,_){for(var p=-1,R=c.length,W=0,X=[];++p-1}function Sh(n,e){var r=this.__data__,t=Hr(r,n);return t<0?(++this.size,r.push([n,e])):r[t][1]=e,this}jn.prototype.clear=yh,jn.prototype.delete=xh,jn.prototype.get=bh,jn.prototype.has=Ah,jn.prototype.set=Sh;function ne(n){var e=-1,r=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Bn(n,e,r,t,i,o){var l,s=e&Z,h=e&E,d=e&q;if(r&&(l=i?r(n,t,i,o):r(n)),l!==u)return l;if(!fn(n))return n;var v=B(n);if(v){if(l=Tg(n),!s)return An(n,l)}else{var m=wn(n),S=m==xr||m==ff;if(ve(n))return Eo(n,s);if(m==kn||m==Ce||S&&!i){if(l=h||S?{}:Xo(n),!s)return h?vg(n,Uh(l,n)):dg(n,io(l,n))}else{if(!nn[m])return i?n:{};l=Eg(n,m,s)}}o||(o=new Kn);var T=o.get(n);if(T)return T;o.set(n,l),Aa(n)?n.forEach(function(F){l.add(Bn(F,e,r,F,n,o))}):xa(n)&&n.forEach(function(F,H){l.set(H,Bn(F,e,r,H,n,o))});var P=d?h?zi:Hi:h?In:pn,N=v?u:P(n);return qn(N||n,function(F,H){N&&(H=F,F=n[H]),or(l,H,Bn(F,e,r,H,n,o))}),l}function Nh(n){var e=pn(n);return function(r){return uo(r,n,e)}}function uo(n,e,r){var t=r.length;if(n==null)return!t;for(n=j(n);t--;){var i=r[t],o=e[i],l=n[i];if(l===u&&!(i in n)||!o(l))return!1}return!0}function fo(n,e,r){if(typeof n!="function")throw new Mn(w);return pr(function(){n.apply(u,r)},e)}function ar(n,e,r,t){var i=-1,o=Rr,l=!0,s=n.length,h=[],d=e.length;if(!s)return h;r&&(e=tn(e,Tn(r))),t?(o=si,l=!1):e.length>=x&&(o=er,l=!1,e=new be(e));n:for(;++ii?0:i+r),t=t===u||t>i?i:D(t),t<0&&(t+=i),t=r>t?0:Ia(t);r0&&r(s)?e>1?vn(s,e-1,r,t,i):se(i,s):t||(i[i.length]=s)}return i}var Ii=Mo(),lo=Mo(!0);function Jn(n,e){return n&&Ii(n,e,pn)}function Ri(n,e){return n&&lo(n,e,pn)}function Kr(n,e){return le(e,function(r){return ue(n[r])})}function Se(n,e){e=_e(e,n);for(var r=0,t=e.length;n!=null&&re}function zh(n,e){return n!=null&&V.call(n,e)}function Kh(n,e){return n!=null&&e in j(n)}function Yh(n,e,r){return n>=mn(e,r)&&n=120&&v.length>=120)?new be(l&&v):u}v=n[0];var m=-1,S=s[0];n:for(;++m-1;)s!==n&&Wr.call(s,h,1),Wr.call(n,h,1);return n}function xo(n,e){for(var r=n?e.length:0,t=r-1;r--;){var i=e[r];if(r==t||i!==o){var o=i;ie(i)?Wr.call(n,i,1):Wi(n,i)}}return n}function Fi(n,e){return n+Dr(no()*(e-n+1))}function ug(n,e,r,t){for(var i=-1,o=gn($r((e-n)/(r||1)),0),l=p(o);o--;)l[t?o:++i]=n,n+=r;return l}function qi(n,e){var r="";if(!n||e<1||e>ae)return r;do e%2&&(r+=n),e=Dr(e/2),e&&(n+=n);while(e);return r}function G(n,e){return Vi(Vo(n,e,Rn),n+"")}function fg(n){return to(Ke(n))}function og(n,e){var r=Ke(n);return rt(r,Ae(e,0,r.length))}function cr(n,e,r,t){if(!fn(n))return n;e=_e(e,n);for(var i=-1,o=e.length,l=o-1,s=n;s!=null&&++ii?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=p(i);++t>>1,l=n[o];l!==null&&!Cn(l)&&(r?l<=e:l=x){var d=e?null:xg(n);if(d)return Tr(d);l=!1,i=er,h=new be}else h=e?[]:s;n:for(;++t=t?n:$n(n,e,r)}var To=kc||function(n){return dn.clearTimeout(n)};function Eo(n,e){if(e)return n.slice();var r=n.length,t=Jf?Jf(r):new n.constructor(r);return n.copy(t),t}function Ui(n){var e=new n.constructor(n.byteLength);return new qr(e).set(new qr(n)),e}function hg(n,e){var r=e?Ui(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}function gg(n){var e=new n.constructor(n.source,cf.exec(n));return e.lastIndex=n.lastIndex,e}function pg(n){return fr?j(fr.call(n)):{}}function Co(n,e){var r=e?Ui(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Lo(n,e){if(n!==e){var r=n!==u,t=n===null,i=n===n,o=Cn(n),l=e!==u,s=e===null,h=e===e,d=Cn(e);if(!s&&!d&&!o&&n>e||o&&l&&h&&!s&&!d||t&&l&&h||!r&&h||!i)return 1;if(!t&&!o&&!d&&n=s)return h;var d=r[t];return h*(d=="desc"?-1:1)}}return n.index-e.index}function Po(n,e,r,t){for(var i=-1,o=n.length,l=r.length,s=-1,h=e.length,d=gn(o-l,0),v=p(h+d),m=!t;++s1?r[i-1]:u,l=i>2?r[2]:u;for(o=n.length>3&&typeof o=="function"?(i--,o):u,l&&xn(r[0],r[1],l)&&(o=i<3?u:o,i=1),e=j(e);++t-1?i[o?e[l]:l]:u}}function $o(n){return te(function(e){var r=e.length,t=r,i=Wn.prototype.thru;for(n&&e.reverse();t--;){var o=e[t];if(typeof o!="function")throw new Mn(w);if(i&&!l&&nt(o)=="wrapper")var l=new Wn([],!0)}for(t=l?t:r;++t1&&Y.reverse(),v&&hs))return!1;var d=o.get(n),v=o.get(e);if(d&&v)return d==e&&v==n;var m=-1,S=!0,T=r&an?new be:u;for(o.set(n,e),o.set(e,n);++m1?"& ":"")+e[t],e=e.join(r>2?", ":" "),n.replace(Ps,`{ +/* [wrapped with `+e+`] */ +`)}function Lg(n){return B(n)||Oe(n)||!!(kf&&n&&n[kf])}function ie(n,e){var r=typeof n;return e=e??ae,!!e&&(r=="number"||r!="symbol"&&Hs.test(n))&&n>-1&&n%1==0&&n0){if(++e>=fs)return arguments[0]}else e=0;return n.apply(u,arguments)}}function rt(n,e){var r=-1,t=n.length,i=t-1;for(e=e===u?t:e;++r1?n[e-1]:u;return r=typeof r=="function"?(n.pop(),r):u,la(n,r)});function sa(n){var e=f(n);return e.__chain__=!0,e}function Gp(n,e){return e(n),n}function tt(n,e){return e(n)}var Hp=te(function(n){var e=n.length,r=e?n[0]:0,t=this.__wrapped__,i=function(o){return Si(o,n)};return e>1||this.__actions__.length||!(t instanceof K)||!ie(r)?this.thru(i):(t=t.slice(r,+r+(e?1:0)),t.__actions__.push({func:tt,args:[i],thisArg:u}),new Wn(t,this.__chain__).thru(function(o){return e&&!o.length&&o.push(u),o}))});function zp(){return sa(this)}function Kp(){return new Wn(this.value(),this.__chain__)}function Yp(){this.__values__===u&&(this.__values__=Sa(this.value()));var n=this.__index__>=this.__values__.length,e=n?u:this.__values__[this.__index__++];return{done:n,value:e}}function Zp(){return this}function Xp(n){for(var e,r=this;r instanceof Gr;){var t=ta(r);t.__index__=0,t.__values__=u,e?i.__wrapped__=t:e=t;var i=t;r=r.__wrapped__}return i.__wrapped__=n,e}function Jp(){var n=this.__wrapped__;if(n instanceof K){var e=n;return this.__actions__.length&&(e=new K(this)),e=e.reverse(),e.__actions__.push({func:tt,args:[ki],thisArg:u}),new Wn(e,this.__chain__)}return this.thru(ki)}function Qp(){return Ro(this.__wrapped__,this.__actions__)}var Vp=Jr(function(n,e,r){V.call(n,r)?++n[r]:ee(n,r,1)});function kp(n,e,r){var t=B(n)?$f:Gh;return r&&xn(n,e,r)&&(e=u),t(n,L(e,3))}function jp(n,e){var r=B(n)?le:ao;return r(n,L(e,3))}var n1=Bo(ia),e1=Bo(ua);function r1(n,e){return vn(it(n,e),1)}function t1(n,e){return vn(it(n,e),me)}function i1(n,e,r){return r=r===u?1:D(r),vn(it(n,e),r)}function ca(n,e){var r=B(n)?qn:ge;return r(n,L(e,3))}function ha(n,e){var r=B(n)?Ac:oo;return r(n,L(e,3))}var u1=Jr(function(n,e,r){V.call(n,r)?n[r].push(e):ee(n,r,[e])});function f1(n,e,r,t){n=Sn(n)?n:Ke(n),r=r&&!t?D(r):0;var i=n.length;return r<0&&(r=gn(i+r,0)),lt(n)?r<=i&&n.indexOf(e,r)>-1:!!i&&Fe(n,e,r)>-1}var o1=G(function(n,e,r){var t=-1,i=typeof e=="function",o=Sn(n)?p(n.length):[];return ge(n,function(l){o[++t]=i?On(e,l,r):lr(l,e,r)}),o}),a1=Jr(function(n,e,r){ee(n,r,e)});function it(n,e){var r=B(n)?tn:po;return r(n,L(e,3))}function l1(n,e,r,t){return n==null?[]:(B(e)||(e=e==null?[]:[e]),r=t?u:r,B(r)||(r=r==null?[]:[r]),wo(n,e,r))}var s1=Jr(function(n,e,r){n[r?0:1].push(e)},function(){return[[],[]]});function c1(n,e,r){var t=B(n)?ci:Gf,i=arguments.length<3;return t(n,L(e,4),r,i,ge)}function h1(n,e,r){var t=B(n)?Sc:Gf,i=arguments.length<3;return t(n,L(e,4),r,i,oo)}function g1(n,e){var r=B(n)?le:ao;return r(n,ot(L(e,3)))}function p1(n){var e=B(n)?to:fg;return e(n)}function _1(n,e,r){(r?xn(n,e,r):e===u)?e=1:e=D(e);var t=B(n)?Bh:og;return t(n,e)}function d1(n){var e=B(n)?$h:lg;return e(n)}function v1(n){if(n==null)return 0;if(Sn(n))return lt(n)?Me(n):n.length;var e=wn(n);return e==Gn||e==Hn?n.size:Ci(n).length}function m1(n,e,r){var t=B(n)?hi:sg;return r&&xn(n,e,r)&&(e=u),t(n,L(e,3))}var w1=G(function(n,e){if(n==null)return[];var r=e.length;return r>1&&xn(n,e[0],e[1])?e=[]:r>2&&xn(e[0],e[1],e[2])&&(e=[e[0]]),wo(n,vn(e,1),[])}),ut=jc||function(){return dn.Date.now()};function y1(n,e){if(typeof e!="function")throw new Mn(w);return n=D(n),function(){if(--n<1)return e.apply(this,arguments)}}function ga(n,e,r){return e=r?u:e,e=n&&e==null?n.length:e,re(n,en,u,u,u,u,e)}function pa(n,e){var r;if(typeof e!="function")throw new Mn(w);return n=D(n),function(){return--n>0&&(r=e.apply(this,arguments)),n<=1&&(e=u),r}}var nu=G(function(n,e,r){var t=M;if(r.length){var i=ce(r,He(nu));t|=Q}return re(n,t,e,r,i)}),_a=G(function(n,e,r){var t=M|_n;if(r.length){var i=ce(r,He(_a));t|=Q}return re(e,t,n,r,i)});function da(n,e,r){e=r?u:e;var t=re(n,C,u,u,u,u,u,e);return t.placeholder=da.placeholder,t}function va(n,e,r){e=r?u:e;var t=re(n,z,u,u,u,u,u,e);return t.placeholder=va.placeholder,t}function ma(n,e,r){var t,i,o,l,s,h,d=0,v=!1,m=!1,S=!0;if(typeof n!="function")throw new Mn(w);e=Un(e)||0,fn(r)&&(v=!!r.leading,m="maxWait"in r,o=m?gn(Un(r.maxWait)||0,e):o,S="trailing"in r?!!r.trailing:S);function T(sn){var Zn=t,oe=i;return t=i=u,d=sn,l=n.apply(oe,Zn),l}function P(sn){return d=sn,s=pr(H,e),v?T(sn):l}function N(sn){var Zn=sn-h,oe=sn-d,Ba=e-Zn;return m?mn(Ba,o-oe):Ba}function F(sn){var Zn=sn-h,oe=sn-d;return h===u||Zn>=e||Zn<0||m&&oe>=o}function H(){var sn=ut();if(F(sn))return Y(sn);s=pr(H,N(sn))}function Y(sn){return s=u,S&&t?T(sn):(t=i=u,l)}function Ln(){s!==u&&To(s),d=0,t=h=i=s=u}function bn(){return s===u?l:Y(ut())}function Pn(){var sn=ut(),Zn=F(sn);if(t=arguments,i=this,h=sn,Zn){if(s===u)return P(h);if(m)return To(s),s=pr(H,e),T(h)}return s===u&&(s=pr(H,e)),l}return Pn.cancel=Ln,Pn.flush=bn,Pn}var x1=G(function(n,e){return fo(n,1,e)}),b1=G(function(n,e,r){return fo(n,Un(e)||0,r)});function A1(n){return re(n,Kt)}function ft(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Mn(w);var r=function(){var t=arguments,i=e?e.apply(this,t):t[0],o=r.cache;if(o.has(i))return o.get(i);var l=n.apply(this,t);return r.cache=o.set(i,l)||o,l};return r.cache=new(ft.Cache||ne),r}ft.Cache=ne;function ot(n){if(typeof n!="function")throw new Mn(w);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function S1(n){return pa(2,n)}var I1=cg(function(n,e){e=e.length==1&&B(e[0])?tn(e[0],Tn(L())):tn(vn(e,1),Tn(L()));var r=e.length;return G(function(t){for(var i=-1,o=mn(t.length,r);++i=e}),Oe=co(function(){return arguments}())?co:function(n){return on(n)&&V.call(n,"callee")&&!Vf.call(n,"callee")},B=p.isArray,U1=Pf?Tn(Pf):Xh;function Sn(n){return n!=null&&at(n.length)&&!ue(n)}function ln(n){return on(n)&&Sn(n)}function N1(n){return n===!0||n===!1||on(n)&&yn(n)==Xe}var ve=eh||hu,G1=Ff?Tn(Ff):Jh;function H1(n){return on(n)&&n.nodeType===1&&!_r(n)}function z1(n){if(n==null)return!0;if(Sn(n)&&(B(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||ze(n)||Oe(n)))return!n.length;var e=wn(n);if(e==Gn||e==Hn)return!n.size;if(gr(n))return!Ci(n).length;for(var r in n)if(V.call(n,r))return!1;return!0}function K1(n,e){return sr(n,e)}function Y1(n,e,r){r=typeof r=="function"?r:u;var t=r?r(n,e):u;return t===u?sr(n,e,u,r):!!t}function ru(n){if(!on(n))return!1;var e=yn(n);return e==yr||e==_s||typeof n.message=="string"&&typeof n.name=="string"&&!_r(n)}function Z1(n){return typeof n=="number"&&jf(n)}function ue(n){if(!fn(n))return!1;var e=yn(n);return e==xr||e==ff||e==ps||e==vs}function ya(n){return typeof n=="number"&&n==D(n)}function at(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ae}function fn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function on(n){return n!=null&&typeof n=="object"}var xa=qf?Tn(qf):Vh;function X1(n,e){return n===e||Ei(n,e,Yi(e))}function J1(n,e,r){return r=typeof r=="function"?r:u,Ei(n,e,Yi(e),r)}function Q1(n){return ba(n)&&n!=+n}function V1(n){if(qg(n))throw new W(y);return ho(n)}function k1(n){return n===null}function j1(n){return n==null}function ba(n){return typeof n=="number"||on(n)&&yn(n)==Qe}function _r(n){if(!on(n)||yn(n)!=kn)return!1;var e=Mr(n);if(e===null)return!0;var r=V.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Lr.call(r)==Jc}var tu=Mf?Tn(Mf):kh;function n0(n){return ya(n)&&n>=-ae&&n<=ae}var Aa=Wf?Tn(Wf):jh;function lt(n){return typeof n=="string"||!B(n)&&on(n)&&yn(n)==ke}function Cn(n){return typeof n=="symbol"||on(n)&&yn(n)==br}var ze=Bf?Tn(Bf):ng;function e0(n){return n===u}function r0(n){return on(n)&&wn(n)==je}function t0(n){return on(n)&&yn(n)==ws}var i0=jr(Li),u0=jr(function(n,e){return n<=e});function Sa(n){if(!n)return[];if(Sn(n))return lt(n)?zn(n):An(n);if(rr&&n[rr])return Bc(n[rr]());var e=wn(n),r=e==Gn?mi:e==Hn?Tr:Ke;return r(n)}function fe(n){if(!n)return n===0?n:0;if(n=Un(n),n===me||n===-me){var e=n<0?-1:1;return e*ss}return n===n?n:0}function D(n){var e=fe(n),r=e%1;return e===e?r?e-r:e:0}function Ia(n){return n?Ae(D(n),0,Xn):0}function Un(n){if(typeof n=="number")return n;if(Cn(n))return mr;if(fn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=fn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Hf(n);var r=Us.test(n);return r||Gs.test(n)?yc(n.slice(2),r?2:8):Ds.test(n)?mr:+n}function Ra(n){return Qn(n,In(n))}function f0(n){return n?Ae(D(n),-ae,ae):n===0?n:0}function J(n){return n==null?"":En(n)}var o0=Ne(function(n,e){if(gr(e)||Sn(e)){Qn(e,pn(e),n);return}for(var r in e)V.call(e,r)&&or(n,r,e[r])}),Oa=Ne(function(n,e){Qn(e,In(e),n)}),st=Ne(function(n,e,r,t){Qn(e,In(e),n,t)}),a0=Ne(function(n,e,r,t){Qn(e,pn(e),n,t)}),l0=te(Si);function s0(n,e){var r=Ue(n);return e==null?r:io(r,e)}var c0=G(function(n,e){n=j(n);var r=-1,t=e.length,i=t>2?e[2]:u;for(i&&xn(e[0],e[1],i)&&(t=1);++r1),o}),Qn(n,zi(n),r),t&&(r=Bn(r,Z|E|q,bg));for(var i=e.length;i--;)Wi(r,e[i]);return r});function E0(n,e){return Ea(n,ot(L(e)))}var C0=te(function(n,e){return n==null?{}:tg(n,e)});function Ea(n,e){if(n==null)return{};var r=tn(zi(n),function(t){return[t]});return e=L(e),yo(n,r,function(t,i){return e(t,i[0])})}function L0(n,e,r){e=_e(e,n);var t=-1,i=e.length;for(i||(i=1,n=u);++te){var t=n;n=e,e=t}if(r||n%1||e%1){var i=no();return mn(n+i*(e-n+wc("1e-"+((i+"").length-1))),e)}return Fi(n,e)}var G0=Ge(function(n,e,r){return e=e.toLowerCase(),n+(r?Pa(e):e)});function Pa(n){return fu(J(n).toLowerCase())}function Fa(n){return n=J(n),n&&n.replace(zs,Pc).replace(lc,"")}function H0(n,e,r){n=J(n),e=En(e);var t=n.length;r=r===u?t:Ae(D(r),0,t);var i=r;return r-=e.length,r>=0&&n.slice(r,i)==e}function z0(n){return n=J(n),n&&Ss.test(n)?n.replace(lf,Fc):n}function K0(n){return n=J(n),n&&Cs.test(n)?n.replace(ei,"\\$&"):n}var Y0=Ge(function(n,e,r){return n+(r?"-":"")+e.toLowerCase()}),Z0=Ge(function(n,e,r){return n+(r?" ":"")+e.toLowerCase()}),X0=Wo("toLowerCase");function J0(n,e,r){n=J(n),e=D(e);var t=e?Me(n):0;if(!e||t>=e)return n;var i=(e-t)/2;return kr(Dr(i),r)+n+kr($r(i),r)}function Q0(n,e,r){n=J(n),e=D(e);var t=e?Me(n):0;return e&&t>>0,r?(n=J(n),n&&(typeof e=="string"||e!=null&&!tu(e))&&(e=En(e),!e&&qe(n))?de(zn(n),0,r):n.split(e,r)):[]}var t_=Ge(function(n,e,r){return n+(r?" ":"")+fu(e)});function i_(n,e,r){return n=J(n),r=r==null?0:Ae(D(r),0,n.length),e=En(e),n.slice(r,r+e.length)==e}function u_(n,e,r){var t=f.templateSettings;r&&xn(n,e,r)&&(e=u),n=J(n),e=st({},e,t,Ho);var i=st({},e.imports,t.imports,Ho),o=pn(i),l=vi(i,o),s,h,d=0,v=e.interpolate||Ar,m="__p += '",S=wi((e.escape||Ar).source+"|"+v.source+"|"+(v===sf?$s:Ar).source+"|"+(e.evaluate||Ar).source+"|$","g"),T="//# sourceURL="+(V.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++pc+"]")+` +`;n.replace(S,function(F,H,Y,Ln,bn,Pn){return Y||(Y=Ln),m+=n.slice(d,Pn).replace(Ks,qc),H&&(s=!0,m+=`' + +__e(`+H+`) + +'`),bn&&(h=!0,m+=`'; +`+bn+`; +__p += '`),Y&&(m+=`' + +((__t = (`+Y+`)) == null ? '' : __t) + +'`),d=Pn+F.length,F}),m+=`'; +`;var P=V.call(e,"variable")&&e.variable;if(!P)m=`with (obj) { +`+m+` +} +`;else if(Ws.test(P))throw new W(O);m=(h?m.replace(ys,""):m).replace(xs,"$1").replace(bs,"$1;"),m="function("+(P||"obj")+`) { +`+(P?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(h?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+m+`return __p +}`;var N=Ma(function(){return X(o,T+"return "+m).apply(u,l)});if(N.source=m,ru(N))throw N;return N}function f_(n){return J(n).toLowerCase()}function o_(n){return J(n).toUpperCase()}function a_(n,e,r){if(n=J(n),n&&(r||e===u))return Hf(n);if(!n||!(e=En(e)))return n;var t=zn(n),i=zn(e),o=zf(t,i),l=Kf(t,i)+1;return de(t,o,l).join("")}function l_(n,e,r){if(n=J(n),n&&(r||e===u))return n.slice(0,Zf(n)+1);if(!n||!(e=En(e)))return n;var t=zn(n),i=Kf(t,zn(e))+1;return de(t,0,i).join("")}function s_(n,e,r){if(n=J(n),n&&(r||e===u))return n.replace(ri,"");if(!n||!(e=En(e)))return n;var t=zn(n),i=zf(t,zn(e));return de(t,i).join("")}function c_(n,e){var r=is,t=us;if(fn(e)){var i="separator"in e?e.separator:i;r="length"in e?D(e.length):r,t="omission"in e?En(e.omission):t}n=J(n);var o=n.length;if(qe(n)){var l=zn(n);o=l.length}if(r>=o)return n;var s=r-Me(t);if(s<1)return t;var h=l?de(l,0,s).join(""):n.slice(0,s);if(i===u)return h+t;if(l&&(s+=h.length-s),tu(i)){if(n.slice(s).search(i)){var d,v=h;for(i.global||(i=wi(i.source,J(cf.exec(i))+"g")),i.lastIndex=0;d=i.exec(v);)var m=d.index;h=h.slice(0,m===u?s:m)}}else if(n.indexOf(En(i),s)!=s){var S=h.lastIndexOf(i);S>-1&&(h=h.slice(0,S))}return h+t}function h_(n){return n=J(n),n&&As.test(n)?n.replace(af,Nc):n}var g_=Ge(function(n,e,r){return n+(r?" ":"")+e.toUpperCase()}),fu=Wo("toUpperCase");function qa(n,e,r){return n=J(n),e=r?u:e,e===u?Wc(n)?zc(n):Oc(n):n.match(e)||[]}var Ma=G(function(n,e){try{return On(n,u,e)}catch(r){return ru(r)?r:new W(r)}}),p_=te(function(n,e){return qn(e,function(r){r=Vn(r),ee(n,r,nu(n[r],n))}),n});function __(n){var e=n==null?0:n.length,r=L();return n=e?tn(n,function(t){if(typeof t[1]!="function")throw new Mn(w);return[r(t[0]),t[1]]}):[],G(function(t){for(var i=-1;++iae)return[];var r=Xn,t=mn(n,Xn);e=L(e),n-=Xn;for(var i=di(t,e);++r0||e<0)?new K(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==u&&(e=D(e),r=e<0?r.dropRight(-e):r.take(e-n)),r)},K.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},K.prototype.toArray=function(){return this.take(Xn)},Jn(K.prototype,function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),t=/^(?:head|last)$/.test(e),i=f[t?"take"+(e=="last"?"Right":""):e],o=t||/^find/.test(e);i&&(f.prototype[e]=function(){var l=this.__wrapped__,s=t?[1]:arguments,h=l instanceof K,d=s[0],v=h||B(l),m=function(H){var Y=i.apply(f,se([H],s));return t&&S?Y[0]:Y};v&&r&&typeof d=="function"&&d.length!=1&&(h=v=!1);var S=this.__chain__,T=!!this.__actions__.length,P=o&&!S,N=h&&!T;if(!o&&v){l=N?l:new K(this);var F=n.apply(l,s);return F.__actions__.push({func:tt,args:[m],thisArg:u}),new Wn(F,S)}return P&&N?n.apply(this,s):(F=this.thru(m),P?t?F.value()[0]:F.value():F)})}),qn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Er[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",t=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var i=arguments;if(t&&!this.__chain__){var o=this.value();return e.apply(B(o)?o:[],i)}return this[r](function(l){return e.apply(B(l)?l:[],i)})}}),Jn(K.prototype,function(n,e){var r=f[e];if(r){var t=r.name+"";V.call(De,t)||(De[t]=[]),De[t].push({name:e,func:r})}}),De[Qr(u,_n).name]=[{name:"wrapper",func:u}],K.prototype.clone=hh,K.prototype.reverse=gh,K.prototype.value=ph,f.prototype.at=Hp,f.prototype.chain=zp,f.prototype.commit=Kp,f.prototype.next=Yp,f.prototype.plant=Xp,f.prototype.reverse=Jp,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=Qp,f.prototype.first=f.prototype.head,rr&&(f.prototype[rr]=Zp),f},We=Kc();we?((we.exports=We)._=We,ai._=We):dn._=We}).call(Ye)}(dr,dr.exports);var Nn=dr.exports;const _u=" `.-':_,^=;><+!rc*/z?sLTv)J7(|Fi{C}fI31tlu[neoZ5Yxjya]2ESwqkP6h9d4VpOGbUAKXHm8RD#$Bg0MNWQ%&@";function rl(a){return Nn.chain(_u).split("").indexOf(a).thru(g=>Math.max(g-3,0)/_u.length).value()}var tl=function(){},il=tl(),Te=function(a){return a!==il&&a!==null},ul=Te,fl=Array.prototype.forEach,ol=Object.create,al=function(a,g){var u;for(u in a)g[u]=a[u]},ll=function(a){var g=ol(null);return fl.call(arguments,function(u){ul(u)&&al(Object(u),g)}),g},sl=function(){var a=Math.sign;return typeof a!="function"?!1:a(10)===1&&a(-20)===-1},ct,du;function cl(){return du||(du=1,ct=function(a){return a=Number(a),isNaN(a)||a===0?a:a>0?1:-1}),ct}var hl=sl()?Math.sign:cl(),gl=hl,pl=Math.abs,_l=Math.floor,dl=function(a){return isNaN(a)?0:(a=Number(a),a===0||!isFinite(a)?a:gl(a)*_l(pl(a)))},vl=dl,ml=Math.max,wl=function(a){return ml(0,vl(a))},vu=function(a){if(typeof a!="function")throw new TypeError(a+" is not a function");return a},yl=Te,mu=function(a){if(!yl(a))throw new TypeError("Cannot use null or undefined");return a},xl={exports:{}},ht,wu;function bl(){return wu||(wu=1,ht=function(){var a=Object.assign,g;return typeof a!="function"?!1:(g={foo:"raz"},a(g,{bar:"dwa"},{trzy:"trzy"}),g.foo+g.bar+g.trzy==="razdwatrzy")}),ht}var gt,yu;function Al(){return yu||(yu=1,gt=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gt}var pt,xu;function Sl(){if(xu)return pt;xu=1;var a=Te,g=Object.keys;return pt=function(u){return g(a(u)?Object(u):u)},pt}var _t,bu;function Il(){return bu||(bu=1,_t=Al()()?Object.keys:Sl()),_t}var dt,Au;function Rl(){if(Au)return dt;Au=1;var a=Il(),g=mu,u=Math.max;return dt=function(A,x){var y,w,O=u(arguments.length,2),b;for(A=Object(g(A)),b=function(I){try{A[I]=x[I]}catch(U){y||(y=U)}},w=1;w-1},It}var Rt,Mu;function Wl(){return Mu||(Mu=1,Rt=ql()()?String.prototype.contains:Ml()),Rt}var Wu;function Ee(){if(Wu)return mt.exports;Wu=1;var a=Tu(),g=Fl(),u=Iu(),A=ll,x=Wl(),y=mt.exports=function(w,O){var b,I,U,Z,E;return arguments.length<2||typeof w!="string"?(Z=O,O=w,w=null):Z=arguments[2],a(w)?(b=x.call(w,"c"),I=x.call(w,"e"),U=x.call(w,"w")):(b=U=!0,I=!1),E={value:O,configurable:b,enumerable:I,writable:U},Z?u(A(Z),E):E};return y.gs=function(w,O,b){var I,U,Z,E;return typeof w!="string"?(Z=b,b=O,O=w,w=null):Z=arguments[3],a(O)?g(O)?a(b)?g(b)||(Z=b,b=void 0):b=void 0:(Z=O,O=b=void 0):O=void 0,a(w)?(I=x.call(w,"c"),U=x.call(w,"e")):(I=!0,U=!1),E={get:O,set:b,configurable:I,enumerable:U},Z?u(A(Z),E):E},mt.exports}var Ot={exports:{}};(function(a,g){var u=Ee(),A=vu,x=Function.prototype.apply,y=Function.prototype.call,w=Object.create,O=Object.defineProperty,b=Object.defineProperties,I=Object.prototype.hasOwnProperty,U={configurable:!0,enumerable:!1,writable:!0},Z,E,q,un,an,M,_n;Z=function($,C){var z;return A(C),I.call(this,"__ee__")?z=this.__ee__:(z=U.value=w(null),O(this,"__ee__",U),U.value=null),z[$]?typeof z[$]=="object"?z[$].push(C):z[$]=[z[$],C]:z[$]=C,this},E=function($,C){var z,Q;return A(C),Q=this,Z.call(this,$,z=function(){q.call(Q,$,z),x.call(C,this,arguments)}),z.__eeOnceListener__=C,this},q=function($,C){var z,Q,k,en;if(A(C),!I.call(this,"__ee__"))return this;if(z=this.__ee__,!z[$])return this;if(Q=z[$],typeof Q=="object")for(en=0;k=Q[en];++en)(k===C||k.__eeOnceListener__===C)&&(Q.length===2?z[$]=Q[en?0:1]:Q.splice(en,1));else(Q===C||Q.__eeOnceListener__===C)&&delete z[$];return this},un=function($){var C,z,Q,k,en;if(I.call(this,"__ee__")&&(k=this.__ee__[$],!!k))if(typeof k=="object"){for(z=arguments.length,en=new Array(z-1),C=1;C=55296&&z<=56319&&(cn+=E[++M])),cn=q?I.call(q,un,cn,_n):cn,an?(U.value=cn,Z($,_n,U)):$[_n]=cn,++_n;C=_n}}if(C===void 0)for(C=A(E.length),an&&($=new an(C)),M=0;Masync g=>{try{const u=await a(g);postMessage({result:u})}catch(u){postMessage({error:u})}};function tf({map:a}){const g=a.split(/\r?\n/),[,,,,...u]=g;return{symbols:Nn.chain(u).join("").trim().split("").uniq().map(A=>({symbol:A,value:rl(A)})).value()}}onmessage=rf(async({data:a})=>tf(a));function jl(a,g){return Nn.map(a,u=>Nn.map(u,A=>g(A)))}const{min:ns}=Math;function Ze(a,{x:g,y:u}){var A;return!!((A=a==null?void 0:a[u])!=null&&A[g])}function es(a,g,{x:u,y:A},x){let y=u,w=A;for(;y+1<=x.x&&w+1<=x.y&&!(Nn.range(u,y+1).map(I=>Ze(a,{x:I,y:w+1})).includes(!g)||Nn.range(A,w+2).map(I=>Ze(a,{x:y+1,y:I})).includes(!g));)y++,w++;for(;w+1<=x.y&&!Nn.range(u,y+1).map(b=>Ze(a,{x:b,y:w+1})).includes(!g);)w++;for(;y+1<=x.x&&!Nn.range(A,w+1).map(b=>Ze(a,{x:y+1,y:b})).includes(!g);)y++;return{x:y,y:w}}function rs(a,g,u={x:0,y:0},A={x:g.width-1,y:g.height-1}){const x=[[u,A]],y=[];for(;x.length>0;){const[w,O]=x.pop();if(w.x<=O.x&&w.y<=O.y){const b=Ze(a,w),I=es(a,b,w,O);x.push([{x:w.x,y:I.y+1},{x:ns(O.x,I.x),y:O.y}],[{x:I.x+1,y:w.y},{x:O.x,y:O.y}]),b&&y.push({...w,width:I.x-w.x+1,height:I.y-w.y+1})}}return y}function ts({map:a,options:{symbols:g={},color:u="#fff",background:A="#000"}={}}){const x=a.split(/\r?\n/),[,y="",w="",,...O]=x,[b,I]=[w,y].map(q=>+Nn.last(q.split(" "))),{symbols:U}=tf({map:a}),Z=el([A,u]),E=Nn.chain(U).filter(({value:q,symbol:un})=>!!q||!!g[un]).map(({symbol:q,value:un})=>[void 0,"auto"].includes(g[q])?[q,Z(un)]:[q,g[q]]).filter(([,q])=>!!q).map(([q,un])=>{const an=rs(jl(O,M=>M===q),{width:b,height:I});return Nn.map(an,M=>({$:"rect",fill:un,alpha:1,...M}))}).flatten().value();return{log:[`${(E.length*100/(b*I)).toFixed(2)}% of original`],bounds:{width:b,height:I,minX:0,minY:0,maxX:b,maxY:I},nodes:E.map(q=>({component:q}))}}onmessage=rf(async({data:a})=>ts(a))})(); diff --git a/assets/parseGrid.worker-DeCcDXY5.js b/assets/parseGrid.worker-DeCcDXY5.js deleted file mode 100644 index 142fbce..0000000 --- a/assets/parseGrid.worker-DeCcDXY5.js +++ /dev/null @@ -1,27 +0,0 @@ -(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ga(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Ha={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},du=Ha,za=Ka,vu={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Ka(a){var g,u=[],S=1,A;if(typeof a=="string")if(a=a.toLowerCase(),du[a])u=du[a].slice(),A="rgb";else if(a==="transparent")S=0,A="rgb",u=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(a)){var y=a.slice(1),d=y.length,x=d<=4;S=1,x?(u=[parseInt(y[0]+y[0],16),parseInt(y[1]+y[1],16),parseInt(y[2]+y[2],16)],d===4&&(S=parseInt(y[3]+y[3],16)/255)):(u=[parseInt(y[0]+y[1],16),parseInt(y[2]+y[3],16),parseInt(y[4]+y[5],16)],d===8&&(S=parseInt(y[6]+y[7],16)/255)),u[0]||(u[0]=0),u[1]||(u[1]=0),u[2]||(u[2]=0),A="rgb"}else if(g=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(a)){var b=g[1],I=b==="rgb",y=b.replace(/a$/,"");A=y;var d=y==="cmyk"?4:y==="gray"?1:3;u=g[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(E,q){if(/%$/.test(E))return q===d?parseFloat(E)/100:y==="rgb"?parseFloat(E)*255/100:parseFloat(E);if(y[q]==="h"){if(/deg$/.test(E))return parseFloat(E);if(vu[E]!==void 0)return vu[E]}return parseFloat(E)}),b===y&&u.push(1),S=I||u[d]===void 0?1:u[d],u=u.slice(0,d)}else a.length>10&&/[0-9](?:\s|\/)/.test(a)&&(u=a.match(/([0-9]+)/g).map(function(W){return parseFloat(W)}),A=a.match(/([a-z])/ig).join("").toLowerCase());else isNaN(a)?Array.isArray(a)||a.length?(u=[a[0],a[1],a[2]],A="rgb",S=a.length===4?a[3]:1):a instanceof Object&&(a.r!=null||a.red!=null||a.R!=null?(A="rgb",u=[a.r||a.red||a.R||0,a.g||a.green||a.G||0,a.b||a.blue||a.B||0]):(A="hsl",u=[a.h||a.hue||a.H||0,a.s||a.saturation||a.S||0,a.l||a.lightness||a.L||a.b||a.brightness]),S=a.a||a.alpha||a.opacity||1,a.opacity!=null&&(S/=100)):(A="rgb",u=[a>>>16,(a&65280)>>>8,a&255]);return{space:A,values:u,alpha:S}}var Ya={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},Za=Ya,Xa={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(a){var g=a[0]/360,u=a[1]/100,S=a[2]/100,A,y,d,x,b;if(u===0)return b=S*255,[b,b,b];S<.5?y=S*(1+u):y=S+u-S*u,A=2*S-y,x=[0,0,0];for(var I=0;I<3;I++)d=g+1/3*-(I-1),d<0?d++:d>1&&d--,6*d<1?b=A+(y-A)*6*d:2*d<1?b=y:3*d<2?b=A+(y-A)*(2/3-d)*6:b=A,x[I]=b*255;return x}};Za.hsl=function(a){var g=a[0]/255,u=a[1]/255,S=a[2]/255,A=Math.min(g,u,S),y=Math.max(g,u,S),d=y-A,x,b,I;return y===A?x=0:g===y?x=(u-S)/d:u===y?x=2+(S-g)/d:S===y&&(x=4+(g-u)/d),x=Math.min(x*60,360),x<0&&(x+=360),I=(A+y)/2,y===A?b=0:I<=.5?b=d/(y+A):b=d/(2-y-A),[x,b*100,I*100]};function Ja(a,g,u){return a*(1-u)+g*u}var Qa=Ja,Va=ka;function ka(a,g,u){return gu?u:a:ag?g:a}const ja=za,nl=Xa,el=Qa,rl=Va;var tl=il;function il(a){return a=a.map(function(g){if(g=ja(g),g.space!="rgb"){if(g.space!="hsl")throw"c.spacespace is not supported.";g.values=nl.rgb(g.values)}return g.values.push(g.alpha),g.values}),function(g,u){u=u||el,g=rl(g,0,1);var S=(a.length-1)*g,A=Math.floor(S),y=Math.ceil(S);g=S-A;var d=a[A],x=a[y],b=d.map(function(I,W){return I=u(I,x[W],g),W<3&&(I=Math.round(I)),I});return b[3]===1?"rgb("+b.slice(0,3)+")":"rgba("+b+")"}}var ul=Ga(tl),dr={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 - */dr.exports,function(a,g){(function(){var u,S="4.17.21",A=200,y="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",x="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",I=500,W="__lodash_placeholder__",Z=1,E=2,q=4,un=1,an=2,M=1,_n=2,D=4,C=8,z=16,Q=32,k=64,en=128,cn=256,Xt=512,ls=30,ss="...",cs=800,hs=16,lf=1,gs=2,ps=3,me=1/0,ae=9007199254740991,_s=17976931348623157e292,wr=NaN,Xn=4294967295,ds=Xn-1,vs=Xn>>>1,ms=[["ary",en],["bind",M],["bindKey",_n],["curry",C],["curryRight",z],["flip",Xt],["partial",Q],["partialRight",k],["rearg",cn]],Ce="[object Arguments]",yr="[object Array]",ws="[object AsyncFunction]",Xe="[object Boolean]",Je="[object Date]",ys="[object DOMException]",xr="[object Error]",br="[object Function]",sf="[object GeneratorFunction]",Gn="[object Map]",Qe="[object Number]",xs="[object Null]",kn="[object Object]",cf="[object Promise]",bs="[object Proxy]",Ve="[object RegExp]",Hn="[object Set]",ke="[object String]",Ar="[object Symbol]",As="[object Undefined]",je="[object WeakMap]",Ss="[object WeakSet]",nr="[object ArrayBuffer]",Le="[object DataView]",Jt="[object Float32Array]",Qt="[object Float64Array]",Vt="[object Int8Array]",kt="[object Int16Array]",jt="[object Int32Array]",ni="[object Uint8Array]",ei="[object Uint8ClampedArray]",ri="[object Uint16Array]",ti="[object Uint32Array]",Is=/\b__p \+= '';/g,Rs=/\b(__p \+=) '' \+/g,Os=/(__e\(.*?\)|\b__t\)) \+\n'';/g,hf=/&(?:amp|lt|gt|quot|#39);/g,gf=/[&<>"']/g,Ts=RegExp(hf.source),Es=RegExp(gf.source),Cs=/<%-([\s\S]+?)%>/g,Ls=/<%([\s\S]+?)%>/g,pf=/<%=([\s\S]+?)%>/g,Ps=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fs=/^\w*$/,qs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ii=/[\\^$.*+?()[\]{}|]/g,Ms=RegExp(ii.source),ui=/^\s+/,Ws=/\s/,Bs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$s=/\{\n\/\* \[wrapped with (.+)\] \*/,Ds=/,? & /,Us=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ns=/[()=,{}\[\]\/\s]/,Gs=/\\(\\)?/g,Hs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_f=/\w*$/,zs=/^[-+]0x[0-9a-f]+$/i,Ks=/^0b[01]+$/i,Ys=/^\[object .+?Constructor\]$/,Zs=/^0o[0-7]+$/i,Xs=/^(?:0|[1-9]\d*)$/,Js=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Sr=/($^)/,Qs=/['\n\r\u2028\u2029\\]/g,Ir="\\ud800-\\udfff",Vs="\\u0300-\\u036f",ks="\\ufe20-\\ufe2f",js="\\u20d0-\\u20ff",df=Vs+ks+js,vf="\\u2700-\\u27bf",mf="a-z\\xdf-\\xf6\\xf8-\\xff",nc="\\xac\\xb1\\xd7\\xf7",ec="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rc="\\u2000-\\u206f",tc=" \\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",wf="A-Z\\xc0-\\xd6\\xd8-\\xde",yf="\\ufe0e\\ufe0f",xf=nc+ec+rc+tc,fi="['’]",ic="["+Ir+"]",bf="["+xf+"]",Rr="["+df+"]",Af="\\d+",uc="["+vf+"]",Sf="["+mf+"]",If="[^"+Ir+xf+Af+vf+mf+wf+"]",oi="\\ud83c[\\udffb-\\udfff]",fc="(?:"+Rr+"|"+oi+")",Rf="[^"+Ir+"]",ai="(?:\\ud83c[\\udde6-\\uddff]){2}",li="[\\ud800-\\udbff][\\udc00-\\udfff]",Pe="["+wf+"]",Of="\\u200d",Tf="(?:"+Sf+"|"+If+")",oc="(?:"+Pe+"|"+If+")",Ef="(?:"+fi+"(?:d|ll|m|re|s|t|ve))?",Cf="(?:"+fi+"(?:D|LL|M|RE|S|T|VE))?",Lf=fc+"?",Pf="["+yf+"]?",ac="(?:"+Of+"(?:"+[Rf,ai,li].join("|")+")"+Pf+Lf+")*",lc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",sc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ff=Pf+Lf+ac,cc="(?:"+[uc,ai,li].join("|")+")"+Ff,hc="(?:"+[Rf+Rr+"?",Rr,ai,li,ic].join("|")+")",gc=RegExp(fi,"g"),pc=RegExp(Rr,"g"),si=RegExp(oi+"(?="+oi+")|"+hc+Ff,"g"),_c=RegExp([Pe+"?"+Sf+"+"+Ef+"(?="+[bf,Pe,"$"].join("|")+")",oc+"+"+Cf+"(?="+[bf,Pe+Tf,"$"].join("|")+")",Pe+"?"+Tf+"+"+Ef,Pe+"+"+Cf,sc,lc,Af,cc].join("|"),"g"),dc=RegExp("["+Of+Ir+df+yf+"]"),vc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mc=["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"],wc=-1,rn={};rn[Jt]=rn[Qt]=rn[Vt]=rn[kt]=rn[jt]=rn[ni]=rn[ei]=rn[ri]=rn[ti]=!0,rn[Ce]=rn[yr]=rn[nr]=rn[Xe]=rn[Le]=rn[Je]=rn[xr]=rn[br]=rn[Gn]=rn[Qe]=rn[kn]=rn[Ve]=rn[Hn]=rn[ke]=rn[je]=!1;var nn={};nn[Ce]=nn[yr]=nn[nr]=nn[Le]=nn[Xe]=nn[Je]=nn[Jt]=nn[Qt]=nn[Vt]=nn[kt]=nn[jt]=nn[Gn]=nn[Qe]=nn[kn]=nn[Ve]=nn[Hn]=nn[ke]=nn[Ar]=nn[ni]=nn[ei]=nn[ri]=nn[ti]=!0,nn[xr]=nn[br]=nn[je]=!1;var yc={À:"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"},xc={"&":"&","<":"<",">":">",'"':""","'":"'"},bc={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ac={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Sc=parseFloat,Ic=parseInt,qf=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,Rc=typeof self=="object"&&self&&self.Object===Object&&self,dn=qf||Rc||Function("return this")(),ci=g&&!g.nodeType&&g,we=ci&&!0&&a&&!a.nodeType&&a,Mf=we&&we.exports===ci,hi=Mf&&qf.process,Fn=function(){try{var c=we&&we.require&&we.require("util").types;return c||hi&&hi.binding&&hi.binding("util")}catch{}}(),Wf=Fn&&Fn.isArrayBuffer,Bf=Fn&&Fn.isDate,$f=Fn&&Fn.isMap,Df=Fn&&Fn.isRegExp,Uf=Fn&&Fn.isSet,Nf=Fn&&Fn.isTypedArray;function On(c,_,p){switch(p.length){case 0:return c.call(_);case 1:return c.call(_,p[0]);case 2:return c.call(_,p[0],p[1]);case 3:return c.call(_,p[0],p[1],p[2])}return c.apply(_,p)}function Oc(c,_,p,O){for(var B=-1,X=c==null?0:c.length;++B-1}function gi(c,_,p){for(var O=-1,B=c==null?0:c.length;++O-1;);return p}function Jf(c,_){for(var p=c.length;p--&&Fe(_,c[p],0)>-1;);return p}function Wc(c,_){for(var p=c.length,O=0;p--;)c[p]===_&&++O;return O}var Bc=vi(yc),$c=vi(xc);function Dc(c){return"\\"+Ac[c]}function Uc(c,_){return c==null?u:c[_]}function qe(c){return dc.test(c)}function Nc(c){return vc.test(c)}function Gc(c){for(var _,p=[];!(_=c.next()).done;)p.push(_.value);return p}function xi(c){var _=-1,p=Array(c.size);return c.forEach(function(O,B){p[++_]=[B,O]}),p}function Qf(c,_){return function(p){return c(_(p))}}function ce(c,_){for(var p=-1,O=c.length,B=0,X=[];++p-1}function Eh(n,e){var r=this.__data__,t=zr(r,n);return t<0?(++this.size,r.push([n,e])):r[t][1]=e,this}jn.prototype.clear=Ih,jn.prototype.delete=Rh,jn.prototype.get=Oh,jn.prototype.has=Th,jn.prototype.set=Eh;function ne(n){var e=-1,r=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Bn(n,e,r,t,i,o){var l,s=e&Z,h=e&E,v=e&q;if(r&&(l=i?r(n,t,i,o):r(n)),l!==u)return l;if(!fn(n))return n;var m=$(n);if(m){if(l=Fg(n),!s)return An(n,l)}else{var w=wn(n),R=w==br||w==sf;if(ve(n))return Fo(n,s);if(w==kn||w==Ce||R&&!i){if(l=h||R?{}:ko(n),!s)return h?bg(n,Kh(l,n)):xg(n,ao(l,n))}else{if(!nn[w])return i?n:{};l=qg(n,w,s)}}o||(o=new Kn);var T=o.get(n);if(T)return T;o.set(n,l),Oa(n)?n.forEach(function(F){l.add(Bn(F,e,r,F,n,o))}):Ia(n)&&n.forEach(function(F,H){l.set(H,Bn(F,e,r,H,n,o))});var P=v?h?Zi:Yi:h?In:pn,N=m?u:P(n);return qn(N||n,function(F,H){N&&(H=F,F=n[H]),or(l,H,Bn(F,e,r,H,n,o))}),l}function Yh(n){var e=pn(n);return function(r){return lo(r,n,e)}}function lo(n,e,r){var t=r.length;if(n==null)return!t;for(n=j(n);t--;){var i=r[t],o=e[i],l=n[i];if(l===u&&!(i in n)||!o(l))return!1}return!0}function so(n,e,r){if(typeof n!="function")throw new Mn(d);return pr(function(){n.apply(u,r)},e)}function ar(n,e,r,t){var i=-1,o=Or,l=!0,s=n.length,h=[],v=e.length;if(!s)return h;r&&(e=tn(e,Tn(r))),t?(o=gi,l=!1):e.length>=A&&(o=er,l=!1,e=new be(e));n:for(;++ii?0:i+r),t=t===u||t>i?i:U(t),t<0&&(t+=i),t=r>t?0:Ea(t);r0&&r(s)?e>1?vn(s,e-1,r,t,i):se(i,s):t||(i[i.length]=s)}return i}var Ti=Do(),go=Do(!0);function Jn(n,e){return n&&Ti(n,e,pn)}function Ei(n,e){return n&&go(n,e,pn)}function Yr(n,e){return le(e,function(r){return ue(n[r])})}function Se(n,e){e=_e(e,n);for(var r=0,t=e.length;n!=null&&re}function Jh(n,e){return n!=null&&V.call(n,e)}function Qh(n,e){return n!=null&&e in j(n)}function Vh(n,e,r){return n>=mn(e,r)&&n=120&&m.length>=120)?new be(l&&m):u}m=n[0];var w=-1,R=s[0];n:for(;++w-1;)s!==n&&Br.call(s,h,1),Br.call(n,h,1);return n}function Io(n,e){for(var r=n?e.length:0,t=r-1;r--;){var i=e[r];if(r==t||i!==o){var o=i;ie(i)?Br.call(n,i,1):Di(n,i)}}return n}function Wi(n,e){return n+Ur(io()*(e-n+1))}function sg(n,e,r,t){for(var i=-1,o=gn(Dr((e-n)/(r||1)),0),l=p(o);o--;)l[t?o:++i]=n,n+=r;return l}function Bi(n,e){var r="";if(!n||e<1||e>ae)return r;do e%2&&(r+=n),e=Ur(e/2),e&&(n+=n);while(e);return r}function G(n,e){return nu(ea(n,e,Rn),n+"")}function cg(n){return oo(Ke(n))}function hg(n,e){var r=Ke(n);return tt(r,Ae(e,0,r.length))}function cr(n,e,r,t){if(!fn(n))return n;e=_e(e,n);for(var i=-1,o=e.length,l=o-1,s=n;s!=null&&++ii?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=p(i);++t>>1,l=n[o];l!==null&&!Cn(l)&&(r?l<=e:l=A){var v=e?null:Rg(n);if(v)return Er(v);l=!1,i=er,h=new be}else h=e?[]:s;n:for(;++t=t?n:$n(n,e,r)}var Po=th||function(n){return dn.clearTimeout(n)};function Fo(n,e){if(e)return n.slice();var r=n.length,t=jf?jf(r):new n.constructor(r);return n.copy(t),t}function Hi(n){var e=new n.constructor(n.byteLength);return new Mr(e).set(new Mr(n)),e}function vg(n,e){var r=e?Hi(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}function mg(n){var e=new n.constructor(n.source,_f.exec(n));return e.lastIndex=n.lastIndex,e}function wg(n){return fr?j(fr.call(n)):{}}function qo(n,e){var r=e?Hi(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Mo(n,e){if(n!==e){var r=n!==u,t=n===null,i=n===n,o=Cn(n),l=e!==u,s=e===null,h=e===e,v=Cn(e);if(!s&&!v&&!o&&n>e||o&&l&&h&&!s&&!v||t&&l&&h||!r&&h||!i)return 1;if(!t&&!o&&!v&&n=s)return h;var v=r[t];return h*(v=="desc"?-1:1)}}return n.index-e.index}function Wo(n,e,r,t){for(var i=-1,o=n.length,l=r.length,s=-1,h=e.length,v=gn(o-l,0),m=p(h+v),w=!t;++s1?r[i-1]:u,l=i>2?r[2]:u;for(o=n.length>3&&typeof o=="function"?(i--,o):u,l&&xn(r[0],r[1],l)&&(o=i<3?u:o,i=1),e=j(e);++t-1?i[o?e[l]:l]:u}}function Go(n){return te(function(e){var r=e.length,t=r,i=Wn.prototype.thru;for(n&&e.reverse();t--;){var o=e[t];if(typeof o!="function")throw new Mn(d);if(i&&!l&&et(o)=="wrapper")var l=new Wn([],!0)}for(t=l?t:r;++t1&&Y.reverse(),m&&hs))return!1;var v=o.get(n),m=o.get(e);if(v&&m)return v==e&&m==n;var w=-1,R=!0,T=r&an?new be:u;for(o.set(n,e),o.set(e,n);++w1?"& ":"")+e[t],e=e.join(r>2?", ":" "),n.replace(Bs,`{ -/* [wrapped with `+e+`] */ -`)}function Wg(n){return $(n)||Oe(n)||!!(ro&&n&&n[ro])}function ie(n,e){var r=typeof n;return e=e??ae,!!e&&(r=="number"||r!="symbol"&&Xs.test(n))&&n>-1&&n%1==0&&n0){if(++e>=cs)return arguments[0]}else e=0;return n.apply(u,arguments)}}function tt(n,e){var r=-1,t=n.length,i=t-1;for(e=e===u?t:e;++r1?n[e-1]:u;return r=typeof r=="function"?(n.pop(),r):u,ga(n,r)});function pa(n){var e=f(n);return e.__chain__=!0,e}function Zp(n,e){return e(n),n}function it(n,e){return e(n)}var Xp=te(function(n){var e=n.length,r=e?n[0]:0,t=this.__wrapped__,i=function(o){return Oi(o,n)};return e>1||this.__actions__.length||!(t instanceof K)||!ie(r)?this.thru(i):(t=t.slice(r,+r+(e?1:0)),t.__actions__.push({func:it,args:[i],thisArg:u}),new Wn(t,this.__chain__).thru(function(o){return e&&!o.length&&o.push(u),o}))});function Jp(){return pa(this)}function Qp(){return new Wn(this.value(),this.__chain__)}function Vp(){this.__values__===u&&(this.__values__=Ta(this.value()));var n=this.__index__>=this.__values__.length,e=n?u:this.__values__[this.__index__++];return{done:n,value:e}}function kp(){return this}function jp(n){for(var e,r=this;r instanceof Hr;){var t=oa(r);t.__index__=0,t.__values__=u,e?i.__wrapped__=t:e=t;var i=t;r=r.__wrapped__}return i.__wrapped__=n,e}function n1(){var n=this.__wrapped__;if(n instanceof K){var e=n;return this.__actions__.length&&(e=new K(this)),e=e.reverse(),e.__actions__.push({func:it,args:[eu],thisArg:u}),new Wn(e,this.__chain__)}return this.thru(eu)}function e1(){return Co(this.__wrapped__,this.__actions__)}var r1=Qr(function(n,e,r){V.call(n,r)?++n[r]:ee(n,r,1)});function t1(n,e,r){var t=$(n)?Gf:Zh;return r&&xn(n,e,r)&&(e=u),t(n,L(e,3))}function i1(n,e){var r=$(n)?le:ho;return r(n,L(e,3))}var u1=No(aa),f1=No(la);function o1(n,e){return vn(ut(n,e),1)}function a1(n,e){return vn(ut(n,e),me)}function l1(n,e,r){return r=r===u?1:U(r),vn(ut(n,e),r)}function _a(n,e){var r=$(n)?qn:ge;return r(n,L(e,3))}function da(n,e){var r=$(n)?Tc:co;return r(n,L(e,3))}var s1=Qr(function(n,e,r){V.call(n,r)?n[r].push(e):ee(n,r,[e])});function c1(n,e,r,t){n=Sn(n)?n:Ke(n),r=r&&!t?U(r):0;var i=n.length;return r<0&&(r=gn(i+r,0)),st(n)?r<=i&&n.indexOf(e,r)>-1:!!i&&Fe(n,e,r)>-1}var h1=G(function(n,e,r){var t=-1,i=typeof e=="function",o=Sn(n)?p(n.length):[];return ge(n,function(l){o[++t]=i?On(e,l,r):lr(l,e,r)}),o}),g1=Qr(function(n,e,r){ee(n,r,e)});function ut(n,e){var r=$(n)?tn:wo;return r(n,L(e,3))}function p1(n,e,r,t){return n==null?[]:($(e)||(e=e==null?[]:[e]),r=t?u:r,$(r)||(r=r==null?[]:[r]),Ao(n,e,r))}var _1=Qr(function(n,e,r){n[r?0:1].push(e)},function(){return[[],[]]});function d1(n,e,r){var t=$(n)?pi:Yf,i=arguments.length<3;return t(n,L(e,4),r,i,ge)}function v1(n,e,r){var t=$(n)?Ec:Yf,i=arguments.length<3;return t(n,L(e,4),r,i,co)}function m1(n,e){var r=$(n)?le:ho;return r(n,at(L(e,3)))}function w1(n){var e=$(n)?oo:cg;return e(n)}function y1(n,e,r){(r?xn(n,e,r):e===u)?e=1:e=U(e);var t=$(n)?Gh:hg;return t(n,e)}function x1(n){var e=$(n)?Hh:pg;return e(n)}function b1(n){if(n==null)return 0;if(Sn(n))return st(n)?Me(n):n.length;var e=wn(n);return e==Gn||e==Hn?n.size:Fi(n).length}function A1(n,e,r){var t=$(n)?_i:_g;return r&&xn(n,e,r)&&(e=u),t(n,L(e,3))}var S1=G(function(n,e){if(n==null)return[];var r=e.length;return r>1&&xn(n,e[0],e[1])?e=[]:r>2&&xn(e[0],e[1],e[2])&&(e=[e[0]]),Ao(n,vn(e,1),[])}),ft=ih||function(){return dn.Date.now()};function I1(n,e){if(typeof e!="function")throw new Mn(d);return n=U(n),function(){if(--n<1)return e.apply(this,arguments)}}function va(n,e,r){return e=r?u:e,e=n&&e==null?n.length:e,re(n,en,u,u,u,u,e)}function ma(n,e){var r;if(typeof e!="function")throw new Mn(d);return n=U(n),function(){return--n>0&&(r=e.apply(this,arguments)),n<=1&&(e=u),r}}var tu=G(function(n,e,r){var t=M;if(r.length){var i=ce(r,He(tu));t|=Q}return re(n,t,e,r,i)}),wa=G(function(n,e,r){var t=M|_n;if(r.length){var i=ce(r,He(wa));t|=Q}return re(e,t,n,r,i)});function ya(n,e,r){e=r?u:e;var t=re(n,C,u,u,u,u,u,e);return t.placeholder=ya.placeholder,t}function xa(n,e,r){e=r?u:e;var t=re(n,z,u,u,u,u,u,e);return t.placeholder=xa.placeholder,t}function ba(n,e,r){var t,i,o,l,s,h,v=0,m=!1,w=!1,R=!0;if(typeof n!="function")throw new Mn(d);e=Un(e)||0,fn(r)&&(m=!!r.leading,w="maxWait"in r,o=w?gn(Un(r.maxWait)||0,e):o,R="trailing"in r?!!r.trailing:R);function T(sn){var Zn=t,oe=i;return t=i=u,v=sn,l=n.apply(oe,Zn),l}function P(sn){return v=sn,s=pr(H,e),m?T(sn):l}function N(sn){var Zn=sn-h,oe=sn-v,Na=e-Zn;return w?mn(Na,o-oe):Na}function F(sn){var Zn=sn-h,oe=sn-v;return h===u||Zn>=e||Zn<0||w&&oe>=o}function H(){var sn=ft();if(F(sn))return Y(sn);s=pr(H,N(sn))}function Y(sn){return s=u,R&&t?T(sn):(t=i=u,l)}function Ln(){s!==u&&Po(s),v=0,t=h=i=s=u}function bn(){return s===u?l:Y(ft())}function Pn(){var sn=ft(),Zn=F(sn);if(t=arguments,i=this,h=sn,Zn){if(s===u)return P(h);if(w)return Po(s),s=pr(H,e),T(h)}return s===u&&(s=pr(H,e)),l}return Pn.cancel=Ln,Pn.flush=bn,Pn}var R1=G(function(n,e){return so(n,1,e)}),O1=G(function(n,e,r){return so(n,Un(e)||0,r)});function T1(n){return re(n,Xt)}function ot(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Mn(d);var r=function(){var t=arguments,i=e?e.apply(this,t):t[0],o=r.cache;if(o.has(i))return o.get(i);var l=n.apply(this,t);return r.cache=o.set(i,l)||o,l};return r.cache=new(ot.Cache||ne),r}ot.Cache=ne;function at(n){if(typeof n!="function")throw new Mn(d);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function E1(n){return ma(2,n)}var C1=dg(function(n,e){e=e.length==1&&$(e[0])?tn(e[0],Tn(L())):tn(vn(e,1),Tn(L()));var r=e.length;return G(function(t){for(var i=-1,o=mn(t.length,r);++i=e}),Oe=_o(function(){return arguments}())?_o:function(n){return on(n)&&V.call(n,"callee")&&!eo.call(n,"callee")},$=p.isArray,K1=Wf?Tn(Wf):jh;function Sn(n){return n!=null&<(n.length)&&!ue(n)}function ln(n){return on(n)&&Sn(n)}function Y1(n){return n===!0||n===!1||on(n)&&yn(n)==Xe}var ve=fh||_u,Z1=Bf?Tn(Bf):ng;function X1(n){return on(n)&&n.nodeType===1&&!_r(n)}function J1(n){if(n==null)return!0;if(Sn(n)&&($(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||ze(n)||Oe(n)))return!n.length;var e=wn(n);if(e==Gn||e==Hn)return!n.size;if(gr(n))return!Fi(n).length;for(var r in n)if(V.call(n,r))return!1;return!0}function Q1(n,e){return sr(n,e)}function V1(n,e,r){r=typeof r=="function"?r:u;var t=r?r(n,e):u;return t===u?sr(n,e,u,r):!!t}function uu(n){if(!on(n))return!1;var e=yn(n);return e==xr||e==ys||typeof n.message=="string"&&typeof n.name=="string"&&!_r(n)}function k1(n){return typeof n=="number"&&to(n)}function ue(n){if(!fn(n))return!1;var e=yn(n);return e==br||e==sf||e==ws||e==bs}function Sa(n){return typeof n=="number"&&n==U(n)}function lt(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ae}function fn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function on(n){return n!=null&&typeof n=="object"}var Ia=$f?Tn($f):rg;function j1(n,e){return n===e||Pi(n,e,Ji(e))}function n0(n,e,r){return r=typeof r=="function"?r:u,Pi(n,e,Ji(e),r)}function e0(n){return Ra(n)&&n!=+n}function r0(n){if(Dg(n))throw new B(y);return vo(n)}function t0(n){return n===null}function i0(n){return n==null}function Ra(n){return typeof n=="number"||on(n)&&yn(n)==Qe}function _r(n){if(!on(n)||yn(n)!=kn)return!1;var e=Wr(n);if(e===null)return!0;var r=V.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Pr.call(r)==nh}var fu=Df?Tn(Df):tg;function u0(n){return Sa(n)&&n>=-ae&&n<=ae}var Oa=Uf?Tn(Uf):ig;function st(n){return typeof n=="string"||!$(n)&&on(n)&&yn(n)==ke}function Cn(n){return typeof n=="symbol"||on(n)&&yn(n)==Ar}var ze=Nf?Tn(Nf):ug;function f0(n){return n===u}function o0(n){return on(n)&&wn(n)==je}function a0(n){return on(n)&&yn(n)==Ss}var l0=nt(qi),s0=nt(function(n,e){return n<=e});function Ta(n){if(!n)return[];if(Sn(n))return st(n)?zn(n):An(n);if(rr&&n[rr])return Gc(n[rr]());var e=wn(n),r=e==Gn?xi:e==Hn?Er:Ke;return r(n)}function fe(n){if(!n)return n===0?n:0;if(n=Un(n),n===me||n===-me){var e=n<0?-1:1;return e*_s}return n===n?n:0}function U(n){var e=fe(n),r=e%1;return e===e?r?e-r:e:0}function Ea(n){return n?Ae(U(n),0,Xn):0}function Un(n){if(typeof n=="number")return n;if(Cn(n))return wr;if(fn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=fn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Zf(n);var r=Ks.test(n);return r||Zs.test(n)?Ic(n.slice(2),r?2:8):zs.test(n)?wr:+n}function Ca(n){return Qn(n,In(n))}function c0(n){return n?Ae(U(n),-ae,ae):n===0?n:0}function J(n){return n==null?"":En(n)}var h0=Ne(function(n,e){if(gr(e)||Sn(e)){Qn(e,pn(e),n);return}for(var r in e)V.call(e,r)&&or(n,r,e[r])}),La=Ne(function(n,e){Qn(e,In(e),n)}),ct=Ne(function(n,e,r,t){Qn(e,In(e),n,t)}),g0=Ne(function(n,e,r,t){Qn(e,pn(e),n,t)}),p0=te(Oi);function _0(n,e){var r=Ue(n);return e==null?r:ao(r,e)}var d0=G(function(n,e){n=j(n);var r=-1,t=e.length,i=t>2?e[2]:u;for(i&&xn(e[0],e[1],i)&&(t=1);++r1),o}),Qn(n,Zi(n),r),t&&(r=Bn(r,Z|E|q,Og));for(var i=e.length;i--;)Di(r,e[i]);return r});function q0(n,e){return Fa(n,at(L(e)))}var M0=te(function(n,e){return n==null?{}:ag(n,e)});function Fa(n,e){if(n==null)return{};var r=tn(Zi(n),function(t){return[t]});return e=L(e),So(n,r,function(t,i){return e(t,i[0])})}function W0(n,e,r){e=_e(e,n);var t=-1,i=e.length;for(i||(i=1,n=u);++te){var t=n;n=e,e=t}if(r||n%1||e%1){var i=io();return mn(n+i*(e-n+Sc("1e-"+((i+"").length-1))),e)}return Wi(n,e)}var Z0=Ge(function(n,e,r){return e=e.toLowerCase(),n+(r?Wa(e):e)});function Wa(n){return lu(J(n).toLowerCase())}function Ba(n){return n=J(n),n&&n.replace(Js,Bc).replace(pc,"")}function X0(n,e,r){n=J(n),e=En(e);var t=n.length;r=r===u?t:Ae(U(r),0,t);var i=r;return r-=e.length,r>=0&&n.slice(r,i)==e}function J0(n){return n=J(n),n&&Es.test(n)?n.replace(gf,$c):n}function Q0(n){return n=J(n),n&&Ms.test(n)?n.replace(ii,"\\$&"):n}var V0=Ge(function(n,e,r){return n+(r?"-":"")+e.toLowerCase()}),k0=Ge(function(n,e,r){return n+(r?" ":"")+e.toLowerCase()}),j0=Uo("toLowerCase");function n_(n,e,r){n=J(n),e=U(e);var t=e?Me(n):0;if(!e||t>=e)return n;var i=(e-t)/2;return jr(Ur(i),r)+n+jr(Dr(i),r)}function e_(n,e,r){n=J(n),e=U(e);var t=e?Me(n):0;return e&&t>>0,r?(n=J(n),n&&(typeof e=="string"||e!=null&&!fu(e))&&(e=En(e),!e&&qe(n))?de(zn(n),0,r):n.split(e,r)):[]}var a_=Ge(function(n,e,r){return n+(r?" ":"")+lu(e)});function l_(n,e,r){return n=J(n),r=r==null?0:Ae(U(r),0,n.length),e=En(e),n.slice(r,r+e.length)==e}function s_(n,e,r){var t=f.templateSettings;r&&xn(n,e,r)&&(e=u),n=J(n),e=ct({},e,t,Zo);var i=ct({},e.imports,t.imports,Zo),o=pn(i),l=yi(i,o),s,h,v=0,m=e.interpolate||Sr,w="__p += '",R=bi((e.escape||Sr).source+"|"+m.source+"|"+(m===pf?Hs:Sr).source+"|"+(e.evaluate||Sr).source+"|$","g"),T="//# sourceURL="+(V.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wc+"]")+` -`;n.replace(R,function(F,H,Y,Ln,bn,Pn){return Y||(Y=Ln),w+=n.slice(v,Pn).replace(Qs,Dc),H&&(s=!0,w+=`' + -__e(`+H+`) + -'`),bn&&(h=!0,w+=`'; -`+bn+`; -__p += '`),Y&&(w+=`' + -((__t = (`+Y+`)) == null ? '' : __t) + -'`),v=Pn+F.length,F}),w+=`'; -`;var P=V.call(e,"variable")&&e.variable;if(!P)w=`with (obj) { -`+w+` -} -`;else if(Ns.test(P))throw new B(x);w=(h?w.replace(Is,""):w).replace(Rs,"$1").replace(Os,"$1;"),w="function("+(P||"obj")+`) { -`+(P?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(h?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+w+`return __p -}`;var N=Da(function(){return X(o,T+"return "+w).apply(u,l)});if(N.source=w,uu(N))throw N;return N}function c_(n){return J(n).toLowerCase()}function h_(n){return J(n).toUpperCase()}function g_(n,e,r){if(n=J(n),n&&(r||e===u))return Zf(n);if(!n||!(e=En(e)))return n;var t=zn(n),i=zn(e),o=Xf(t,i),l=Jf(t,i)+1;return de(t,o,l).join("")}function p_(n,e,r){if(n=J(n),n&&(r||e===u))return n.slice(0,Vf(n)+1);if(!n||!(e=En(e)))return n;var t=zn(n),i=Jf(t,zn(e))+1;return de(t,0,i).join("")}function __(n,e,r){if(n=J(n),n&&(r||e===u))return n.replace(ui,"");if(!n||!(e=En(e)))return n;var t=zn(n),i=Xf(t,zn(e));return de(t,i).join("")}function d_(n,e){var r=ls,t=ss;if(fn(e)){var i="separator"in e?e.separator:i;r="length"in e?U(e.length):r,t="omission"in e?En(e.omission):t}n=J(n);var o=n.length;if(qe(n)){var l=zn(n);o=l.length}if(r>=o)return n;var s=r-Me(t);if(s<1)return t;var h=l?de(l,0,s).join(""):n.slice(0,s);if(i===u)return h+t;if(l&&(s+=h.length-s),fu(i)){if(n.slice(s).search(i)){var v,m=h;for(i.global||(i=bi(i.source,J(_f.exec(i))+"g")),i.lastIndex=0;v=i.exec(m);)var w=v.index;h=h.slice(0,w===u?s:w)}}else if(n.indexOf(En(i),s)!=s){var R=h.lastIndexOf(i);R>-1&&(h=h.slice(0,R))}return h+t}function v_(n){return n=J(n),n&&Ts.test(n)?n.replace(hf,Yc):n}var m_=Ge(function(n,e,r){return n+(r?" ":"")+e.toUpperCase()}),lu=Uo("toUpperCase");function $a(n,e,r){return n=J(n),e=r?u:e,e===u?Nc(n)?Jc(n):Pc(n):n.match(e)||[]}var Da=G(function(n,e){try{return On(n,u,e)}catch(r){return uu(r)?r:new B(r)}}),w_=te(function(n,e){return qn(e,function(r){r=Vn(r),ee(n,r,tu(n[r],n))}),n});function y_(n){var e=n==null?0:n.length,r=L();return n=e?tn(n,function(t){if(typeof t[1]!="function")throw new Mn(d);return[r(t[0]),t[1]]}):[],G(function(t){for(var i=-1;++iae)return[];var r=Xn,t=mn(n,Xn);e=L(e),n-=Xn;for(var i=wi(t,e);++r0||e<0)?new K(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==u&&(e=U(e),r=e<0?r.dropRight(-e):r.take(e-n)),r)},K.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},K.prototype.toArray=function(){return this.take(Xn)},Jn(K.prototype,function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),t=/^(?:head|last)$/.test(e),i=f[t?"take"+(e=="last"?"Right":""):e],o=t||/^find/.test(e);i&&(f.prototype[e]=function(){var l=this.__wrapped__,s=t?[1]:arguments,h=l instanceof K,v=s[0],m=h||$(l),w=function(H){var Y=i.apply(f,se([H],s));return t&&R?Y[0]:Y};m&&r&&typeof v=="function"&&v.length!=1&&(h=m=!1);var R=this.__chain__,T=!!this.__actions__.length,P=o&&!R,N=h&&!T;if(!o&&m){l=N?l:new K(this);var F=n.apply(l,s);return F.__actions__.push({func:it,args:[w],thisArg:u}),new Wn(F,R)}return P&&N?n.apply(this,s):(F=this.thru(w),P?t?F.value()[0]:F.value():F)})}),qn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Cr[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",t=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var i=arguments;if(t&&!this.__chain__){var o=this.value();return e.apply($(o)?o:[],i)}return this[r](function(l){return e.apply($(l)?l:[],i)})}}),Jn(K.prototype,function(n,e){var r=f[e];if(r){var t=r.name+"";V.call(De,t)||(De[t]=[]),De[t].push({name:e,func:r})}}),De[Vr(u,_n).name]=[{name:"wrapper",func:u}],K.prototype.clone=vh,K.prototype.reverse=mh,K.prototype.value=wh,f.prototype.at=Xp,f.prototype.chain=Jp,f.prototype.commit=Qp,f.prototype.next=Vp,f.prototype.plant=jp,f.prototype.reverse=n1,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=e1,f.prototype.first=f.prototype.head,rr&&(f.prototype[rr]=kp),f},We=Qc();we?((we.exports=We)._=We,ci._=We):dn._=We}).call(Ye)}(dr,dr.exports);var Nn=dr.exports;const mu=" `.-':_,^=;><+!rc*/z?sLTv)J7(|Fi{C}fI31tlu[neoZ5Yxjya]2ESwqkP6h9d4VpOGbUAKXHm8RD#$Bg0MNWQ%&@";function fl(a){return Nn.chain(mu).split("").indexOf(a).thru(g=>Math.max(g-3,0)/mu.length).value()}var ol=function(){},al=ol(),Te=function(a){return a!==al&&a!==null},ll=Te,sl=Array.prototype.forEach,cl=Object.create,hl=function(a,g){var u;for(u in a)g[u]=a[u]},gl=function(a){var g=cl(null);return sl.call(arguments,function(u){ll(u)&&hl(Object(u),g)}),g},pl=function(){var a=Math.sign;return typeof a!="function"?!1:a(10)===1&&a(-20)===-1},ht,wu;function _l(){return wu||(wu=1,ht=function(a){return a=Number(a),isNaN(a)||a===0?a:a>0?1:-1}),ht}var dl=pl()?Math.sign:_l(),vl=dl,ml=Math.abs,wl=Math.floor,yl=function(a){return isNaN(a)?0:(a=Number(a),a===0||!isFinite(a)?a:vl(a)*wl(ml(a)))},xl=yl,bl=Math.max,yu=function(a){return bl(0,xl(a))},xu=function(a){if(typeof a!="function")throw new TypeError(a+" is not a function");return a},Al=Te,gt=function(a){if(!Al(a))throw new TypeError("Cannot use null or undefined");return a},Sl={exports:{}},pt,bu;function Il(){return bu||(bu=1,pt=function(){var a=Object.assign,g;return typeof a!="function"?!1:(g={foo:"raz"},a(g,{bar:"dwa"},{trzy:"trzy"}),g.foo+g.bar+g.trzy==="razdwatrzy")}),pt}var _t,Au;function Rl(){return Au||(Au=1,_t=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),_t}var dt,Su;function Ol(){if(Su)return dt;Su=1;var a=Te,g=Object.keys;return dt=function(u){return g(a(u)?Object(u):u)},dt}var vt,Iu;function Tl(){return Iu||(Iu=1,vt=Rl()()?Object.keys:Ol()),vt}var mt,Ru;function El(){if(Ru)return mt;Ru=1;var a=Tl(),g=gt,u=Math.max;return mt=function(S,A){var y,d,x=u(arguments.length,2),b;for(S=Object(g(S)),b=function(I){try{S[I]=A[I]}catch(W){y||(y=W)}},d=1;d-1},Tt}var Et,Du;function Nl(){return Du||(Du=1,Et=Dl()()?String.prototype.contains:Ul()),Et}var Uu;function Ee(){if(Uu)return xt.exports;Uu=1;var a=Pu(),g=$l(),u=Tu(),S=gl,A=Nl(),y=xt.exports=function(d,x){var b,I,W,Z,E;return arguments.length<2||typeof d!="string"?(Z=x,x=d,d=null):Z=arguments[2],a(d)?(b=A.call(d,"c"),I=A.call(d,"e"),W=A.call(d,"w")):(b=W=!0,I=!1),E={value:x,configurable:b,enumerable:I,writable:W},Z?u(S(Z),E):E};return y.gs=function(d,x,b){var I,W,Z,E;return typeof d!="string"?(Z=b,b=x,x=d,d=null):Z=arguments[3],a(x)?g(x)?a(b)?g(b)||(Z=b,b=void 0):b=void 0:(Z=x,x=b=void 0):x=void 0,a(d)?(I=A.call(d,"c"),W=A.call(d,"e")):(I=!0,W=!1),E={get:x,set:b,configurable:I,enumerable:W},Z?u(S(Z),E):E},xt.exports}var Ct={exports:{}};(function(a,g){var u=Ee(),S=xu,A=Function.prototype.apply,y=Function.prototype.call,d=Object.create,x=Object.defineProperty,b=Object.defineProperties,I=Object.prototype.hasOwnProperty,W={configurable:!0,enumerable:!1,writable:!0},Z,E,q,un,an,M,_n;Z=function(D,C){var z;return S(C),I.call(this,"__ee__")?z=this.__ee__:(z=W.value=d(null),x(this,"__ee__",W),W.value=null),z[D]?typeof z[D]=="object"?z[D].push(C):z[D]=[z[D],C]:z[D]=C,this},E=function(D,C){var z,Q;return S(C),Q=this,Z.call(this,D,z=function(){q.call(Q,D,z),A.call(C,this,arguments)}),z.__eeOnceListener__=C,this},q=function(D,C){var z,Q,k,en;if(S(C),!I.call(this,"__ee__"))return this;if(z=this.__ee__,!z[D])return this;if(Q=z[D],typeof Q=="object")for(en=0;k=Q[en];++en)(k===C||k.__eeOnceListener__===C)&&(Q.length===2?z[D]=Q[en?0:1]:Q.splice(en,1));else(Q===C||Q.__eeOnceListener__===C)&&delete z[D];return this},un=function(D){var C,z,Q,k,en;if(I.call(this,"__ee__")&&(k=this.__ee__[D],!!k))if(typeof k=="object"){for(z=arguments.length,en=new Array(z-1),C=1;C=55296&&z<=56319&&(cn+=E[++M])),cn=q?I.call(q,un,cn,_n):cn,an?(W.value=cn,Z(D,_n,W)):D[_n]=cn,++_n;C=_n}}if(C===void 0)for(C=S(E.length),an&&(D=new an(C)),M=0;Masync g=>{try{const u=await a(g);postMessage({result:u})}catch(u){postMessage({error:u})}};function af({map:a}){const g=a.split(/\r?\n/),[,,,,...u]=g;return{symbols:Nn.chain(u).join("").trim().split("").uniq().map(S=>({symbol:S,value:fl(S)})).value()}}onmessage=of(async({data:a})=>af(a));function is(a,g){return Nn.map(a,u=>Nn.map(u,S=>g(S)))}const{min:us}=Math;function Ze(a,{x:g,y:u}){var S;return!!((S=a==null?void 0:a[u])!=null&&S[g])}function fs(a,g,{x:u,y:S},A){let y=u,d=S;for(;y+1<=A.x&&d+1<=A.y&&!(Nn.range(u,y+1).map(I=>Ze(a,{x:I,y:d+1})).includes(!g)||Nn.range(S,d+2).map(I=>Ze(a,{x:y+1,y:I})).includes(!g));)y++,d++;for(;d+1<=A.y&&!Nn.range(u,y+1).map(b=>Ze(a,{x:b,y:d+1})).includes(!g);)d++;for(;y+1<=A.x&&!Nn.range(S,d+1).map(b=>Ze(a,{x:y+1,y:b})).includes(!g);)y++;return{x:y,y:d}}function os(a,g,u={x:0,y:0},S={x:g.width-1,y:g.height-1}){const A=[[u,S]],y=[];for(;A.length>0;){const[d,x]=A.pop();if(d.x<=x.x&&d.y<=x.y){const b=Ze(a,d),I=fs(a,b,d,x);A.push([{x:d.x,y:I.y+1},{x:us(x.x,I.x),y:x.y}],[{x:I.x+1,y:d.y},{x:x.x,y:x.y}]),b&&y.push({...d,width:I.x-d.x+1,height:I.y-d.y+1})}}return y}function as({map:a,options:{symbols:g={},color:u="#fff",background:S="#000"}={}}){const A=a.split(/\r?\n/),[,y="",d="",,...x]=A,[b,I]=[d,y].map(q=>+Nn.last(q.split(" "))),{symbols:W}=af({map:a}),Z=ul([S,u]),E=Nn.chain(W).filter(({value:q,symbol:un})=>!!q||!!g[un]).map(({symbol:q,value:un})=>[void 0,"auto"].includes(g[q])?[q,Z(un)]:[q,g[q]]).filter(([,q])=>!!q).map(([q,un])=>{const an=os(is(x,M=>M===q),{width:b,height:I});return Nn.map(an,M=>({$:"rect",fill:un,alpha:1,...M}))}).flatten().value();return{log:[`${(E.length*100/(b*I)).toFixed(2)}% of original`],bounds:{width:b,height:I,minX:0,minY:0,maxX:b,maxY:I},nodes:E.map(q=>({component:q}))}}onmessage=of(async({data:a})=>as(a))})(); diff --git a/assets/parseTrace.worker-ahBXG5Yy.js b/assets/parseTrace.worker-ahBXG5Yy.js deleted file mode 100644 index e811ccf..0000000 --- a/assets/parseTrace.worker-ahBXG5Yy.js +++ /dev/null @@ -1,27 +0,0 @@ -(function(){"use strict";var Ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vt={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 - */vt.exports,function(h,w){(function(){var f,T="4.17.21",C=200,R="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",O="Expected a function",k="Invalid `variable` option passed into `_.template`",Z="__lodash_hash_undefined__",N=500,j="__lodash_placeholder__",an=1,G=2,z=4,pn=1,ln=2,P=1,_n=2,W=4,A=8,D=16,Y=32,J=64,nn=128,sn=256,Ur=512,Ws=30,Fs="...",Ms=800,Bs=16,qu=1,Us=2,Ds=3,de=1/0,oe=9007199254740991,qs=17976931348623157e292,mt=NaN,Yn=4294967295,$s=Yn-1,Ns=Yn>>>1,Gs=[["ary",nn],["bind",P],["bindKey",_n],["curry",A],["curryRight",D],["flip",Ur],["partial",Y],["partialRight",J],["rearg",sn]],Ee="[object Arguments]",xt="[object Array]",Hs="[object AsyncFunction]",Xe="[object Boolean]",Je="[object Date]",zs="[object DOMException]",yt="[object Error]",At="[object Function]",$u="[object GeneratorFunction]",Nn="[object Map]",Qe="[object Number]",Ks="[object Null]",Vn="[object Object]",Nu="[object Promise]",Zs="[object Proxy]",Ve="[object RegExp]",Gn="[object Set]",ke="[object String]",St="[object Symbol]",Ys="[object Undefined]",je="[object WeakMap]",Xs="[object WeakSet]",nt="[object ArrayBuffer]",Ce="[object DataView]",Dr="[object Float32Array]",qr="[object Float64Array]",$r="[object Int8Array]",Nr="[object Int16Array]",Gr="[object Int32Array]",Hr="[object Uint8Array]",zr="[object Uint8ClampedArray]",Kr="[object Uint16Array]",Zr="[object Uint32Array]",Js=/\b__p \+= '';/g,Qs=/\b(__p \+=) '' \+/g,Vs=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Gu=/&(?:amp|lt|gt|quot|#39);/g,Hu=/[&<>"']/g,ks=RegExp(Gu.source),js=RegExp(Hu.source),nl=/<%-([\s\S]+?)%>/g,el=/<%([\s\S]+?)%>/g,zu=/<%=([\s\S]+?)%>/g,tl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rl=/^\w*$/,il=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yr=/[\\^$.*+?()[\]{}|]/g,ul=RegExp(Yr.source),Xr=/^\s+/,fl=/\s/,ol=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,al=/\{\n\/\* \[wrapped with (.+)\] \*/,sl=/,? & /,ll=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cl=/[()=,{}\[\]\/\s]/,hl=/\\(\\)?/g,gl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ku=/\w*$/,pl=/^[-+]0x[0-9a-f]+$/i,_l=/^0b[01]+$/i,vl=/^\[object .+?Constructor\]$/,dl=/^0o[0-7]+$/i,wl=/^(?:0|[1-9]\d*)$/,ml=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,xl=/['\n\r\u2028\u2029\\]/g,It="\\ud800-\\udfff",yl="\\u0300-\\u036f",Al="\\ufe20-\\ufe2f",Sl="\\u20d0-\\u20ff",Zu=yl+Al+Sl,Yu="\\u2700-\\u27bf",Xu="a-z\\xdf-\\xf6\\xf8-\\xff",bl="\\xac\\xb1\\xd7\\xf7",Il="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Rl="\\u2000-\\u206f",Tl=" \\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",Ju="A-Z\\xc0-\\xd6\\xd8-\\xde",Qu="\\ufe0e\\ufe0f",Vu=bl+Il+Rl+Tl,Jr="['’]",Ol="["+It+"]",ku="["+Vu+"]",Rt="["+Zu+"]",ju="\\d+",El="["+Yu+"]",nf="["+Xu+"]",ef="[^"+It+Vu+ju+Yu+Xu+Ju+"]",Qr="\\ud83c[\\udffb-\\udfff]",Cl="(?:"+Rt+"|"+Qr+")",tf="[^"+It+"]",Vr="(?:\\ud83c[\\udde6-\\uddff]){2}",kr="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Ju+"]",rf="\\u200d",uf="(?:"+nf+"|"+ef+")",Ll="(?:"+Le+"|"+ef+")",ff="(?:"+Jr+"(?:d|ll|m|re|s|t|ve))?",of="(?:"+Jr+"(?:D|LL|M|RE|S|T|VE))?",af=Cl+"?",sf="["+Qu+"]?",Pl="(?:"+rf+"(?:"+[tf,Vr,kr].join("|")+")"+sf+af+")*",Wl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lf=sf+af+Pl,Ml="(?:"+[El,Vr,kr].join("|")+")"+lf,Bl="(?:"+[tf+Rt+"?",Rt,Vr,kr,Ol].join("|")+")",Ul=RegExp(Jr,"g"),Dl=RegExp(Rt,"g"),jr=RegExp(Qr+"(?="+Qr+")|"+Bl+lf,"g"),ql=RegExp([Le+"?"+nf+"+"+ff+"(?="+[ku,Le,"$"].join("|")+")",Ll+"+"+of+"(?="+[ku,Le+uf,"$"].join("|")+")",Le+"?"+uf+"+"+ff,Le+"+"+of,Fl,Wl,ju,Ml].join("|"),"g"),$l=RegExp("["+rf+It+Zu+Qu+"]"),Nl=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gl=["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"],Hl=-1,en={};en[Dr]=en[qr]=en[$r]=en[Nr]=en[Gr]=en[Hr]=en[zr]=en[Kr]=en[Zr]=!0,en[Ee]=en[xt]=en[nt]=en[Xe]=en[Ce]=en[Je]=en[yt]=en[At]=en[Nn]=en[Qe]=en[Vn]=en[Ve]=en[Gn]=en[ke]=en[je]=!1;var V={};V[Ee]=V[xt]=V[nt]=V[Ce]=V[Xe]=V[Je]=V[Dr]=V[qr]=V[$r]=V[Nr]=V[Gr]=V[Nn]=V[Qe]=V[Vn]=V[Ve]=V[Gn]=V[ke]=V[St]=V[Hr]=V[zr]=V[Kr]=V[Zr]=!0,V[yt]=V[At]=V[je]=!1;var zl={À:"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"},Kl={"&":"&","<":"<",">":">",'"':""","'":"'"},Zl={"&":"&","<":"<",">":">",""":'"',"'":"'"},Yl={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xl=parseFloat,Jl=parseInt,cf=typeof Ke=="object"&&Ke&&Ke.Object===Object&&Ke,Ql=typeof self=="object"&&self&&self.Object===Object&&self,vn=cf||Ql||Function("return this")(),ni=w&&!w.nodeType&&w,we=ni&&!0&&h&&!h.nodeType&&h,hf=we&&we.exports===ni,ei=hf&&cf.process,Wn=function(){try{var l=we&&we.require&&we.require("util").types;return l||ei&&ei.binding&&ei.binding("util")}catch{}}(),gf=Wn&&Wn.isArrayBuffer,pf=Wn&&Wn.isDate,_f=Wn&&Wn.isMap,vf=Wn&&Wn.isRegExp,df=Wn&&Wn.isSet,wf=Wn&&Wn.isTypedArray;function Tn(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function Vl(l,p,g,x){for(var E=-1,H=l==null?0:l.length;++E-1}function ti(l,p,g){for(var x=-1,E=l==null?0:l.length;++x-1;);return g}function Rf(l,p){for(var g=l.length;g--&&Pe(p,l[g],0)>-1;);return g}function fc(l,p){for(var g=l.length,x=0;g--;)l[g]===p&&++x;return x}var oc=fi(zl),ac=fi(Kl);function sc(l){return"\\"+Yl[l]}function lc(l,p){return l==null?f:l[p]}function We(l){return $l.test(l)}function cc(l){return Nl.test(l)}function hc(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function li(l){var p=-1,g=Array(l.size);return l.forEach(function(x,E){g[++p]=[E,x]}),g}function Tf(l,p){return function(g){return l(p(g))}}function le(l,p){for(var g=-1,x=l.length,E=0,H=[];++g-1}function jc(n,e){var t=this.__data__,r=zt(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}kn.prototype.clear=Jc,kn.prototype.delete=Qc,kn.prototype.get=Vc,kn.prototype.has=kc,kn.prototype.set=jc;function jn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Un(n,e,t,r,i,o){var a,s=e&an,c=e&G,_=e&z;if(t&&(a=i?t(n,r,i,o):t(n)),a!==f)return a;if(!rn(n))return n;var v=L(n);if(v){if(a=rg(n),!s)return Sn(n,a)}else{var d=mn(n),m=d==At||d==$u;if(ve(n))return so(n,s);if(d==Vn||d==Ee||m&&!i){if(a=c||m?{}:Eo(n),!s)return c?Zh(n,_h(a,n)):Kh(n,qf(a,n))}else{if(!V[d])return i?n:{};a=ig(n,d,s)}}o||(o=new zn);var y=o.get(n);if(y)return y;o.set(n,a),ia(n)?n.forEach(function(I){a.add(Un(I,e,t,I,n,o))}):ta(n)&&n.forEach(function(I,U){a.set(U,Un(I,e,t,U,n,o))});var b=_?c?Bi:Mi:c?In:gn,M=v?f:b(n);return Fn(M||n,function(I,U){M&&(U=I,I=n[U]),ot(a,U,Un(I,e,t,U,n,o))}),a}function vh(n){var e=gn(n);return function(t){return $f(t,n,e)}}function $f(n,e,t){var r=t.length;if(n==null)return!r;for(n=Q(n);r--;){var i=t[r],o=e[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function Nf(n,e,t){if(typeof n!="function")throw new Mn(O);return pt(function(){n.apply(f,t)},e)}function at(n,e,t,r){var i=-1,o=Tt,a=!0,s=n.length,c=[],_=e.length;if(!s)return c;t&&(e=tn(e,On(t))),r?(o=ti,a=!1):e.length>=C&&(o=et,a=!1,e=new ye(e));n:for(;++ii?0:i+t),r=r===f||r>i?i:F(r),r<0&&(r+=i),r=t>r?0:fa(r);t0&&t(s)?e>1?dn(s,e-1,t,r,i):se(i,s):r||(i[i.length]=s)}return i}var di=_o(),zf=_o(!0);function Xn(n,e){return n&&di(n,e,gn)}function wi(n,e){return n&&zf(n,e,gn)}function Zt(n,e){return ae(e,function(t){return ie(n[t])})}function Se(n,e){e=pe(e,n);for(var t=0,r=e.length;n!=null&&te}function mh(n,e){return n!=null&&X.call(n,e)}function xh(n,e){return n!=null&&e in Q(n)}function yh(n,e,t){return n>=wn(e,t)&&n=120&&v.length>=120)?new ye(a&&v):f}v=n[0];var d=-1,m=s[0];n:for(;++d-1;)s!==n&&Ut.call(s,c,1),Ut.call(n,c,1);return n}function eo(n,e){for(var t=n?e.length:0,r=t-1;t--;){var i=e[t];if(t==r||i!==o){var o=i;re(i)?Ut.call(n,i,1):Oi(n,i)}}return n}function Ii(n,e){return n+$t(Mf()*(e-n+1))}function Fh(n,e,t,r){for(var i=-1,o=hn(qt((e-n)/(t||1)),0),a=g(o);o--;)a[r?o:++i]=n,n+=t;return a}function Ri(n,e){var t="";if(!n||e<1||e>oe)return t;do e%2&&(t+=n),e=$t(e/2),e&&(n+=n);while(e);return t}function B(n,e){return Hi(Po(n,e,Rn),n+"")}function Mh(n){return Df(ze(n))}function Bh(n,e){var t=ze(n);return rr(t,Ae(e,0,t.length))}function ct(n,e,t,r){if(!rn(n))return n;e=pe(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++ii?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=g(i);++r>>1,a=n[o];a!==null&&!Cn(a)&&(t?a<=e:a=C){var _=e?null:Qh(n);if(_)return Et(_);a=!1,i=et,c=new ye}else c=e?[]:s;n:for(;++r=r?n:Dn(n,e,t)}var ao=Tc||function(n){return vn.clearTimeout(n)};function so(n,e){if(e)return n.slice();var t=n.length,r=Cf?Cf(t):new n.constructor(t);return n.copy(r),r}function Pi(n){var e=new n.constructor(n.byteLength);return new Mt(e).set(new Mt(n)),e}function Nh(n,e){var t=e?Pi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Gh(n){var e=new n.constructor(n.source,Ku.exec(n));return e.lastIndex=n.lastIndex,e}function Hh(n){return ft?Q(ft.call(n)):{}}function lo(n,e){var t=e?Pi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function co(n,e){if(n!==e){var t=n!==f,r=n===null,i=n===n,o=Cn(n),a=e!==f,s=e===null,c=e===e,_=Cn(e);if(!s&&!_&&!o&&n>e||o&&a&&c&&!s&&!_||r&&a&&c||!t&&c||!i)return 1;if(!r&&!o&&!_&&n=s)return c;var _=t[r];return c*(_=="desc"?-1:1)}}return n.index-e.index}function ho(n,e,t,r){for(var i=-1,o=n.length,a=t.length,s=-1,c=e.length,_=hn(o-a,0),v=g(c+_),d=!r;++s1?t[i-1]:f,a=i>2?t[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&yn(t[0],t[1],a)&&(o=i<3?f:o,i=1),e=Q(e);++r-1?i[o?e[a]:a]:f}}function mo(n){return te(function(e){var t=e.length,r=t,i=Bn.prototype.thru;for(n&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new Mn(O);if(i&&!a&&er(o)=="wrapper")var a=new Bn([],!0)}for(r=a?r:t;++r1&&$.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(e);if(_&&v)return _==e&&v==n;var d=-1,m=!0,y=t&ln?new ye:f;for(o.set(n,e),o.set(e,n);++d1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(ol,`{ -/* [wrapped with `+e+`] */ -`)}function fg(n){return L(n)||Re(n)||!!(Wf&&n&&n[Wf])}function re(n,e){var t=typeof n;return e=e??oe,!!e&&(t=="number"||t!="symbol"&&wl.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Ms)return arguments[0]}else e=0;return n.apply(f,arguments)}}function rr(n,e){var t=-1,r=n.length,i=r-1;for(e=e===f?r:e;++t1?n[e-1]:f;return t=typeof t=="function"?(n.pop(),t):f,zo(n,t)});function Ko(n){var e=u(n);return e.__chain__=!0,e}function dp(n,e){return e(n),n}function ir(n,e){return e(n)}var wp=te(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,i=function(o){return vi(o,n)};return e>1||this.__actions__.length||!(r instanceof q)||!re(t)?this.thru(i):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:ir,args:[i],thisArg:f}),new Bn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(f),o}))});function mp(){return Ko(this)}function xp(){return new Bn(this.value(),this.__chain__)}function yp(){this.__values__===f&&(this.__values__=ua(this.value()));var n=this.__index__>=this.__values__.length,e=n?f:this.__values__[this.__index__++];return{done:n,value:e}}function Ap(){return this}function Sp(n){for(var e,t=this;t instanceof Ht;){var r=Do(t);r.__index__=0,r.__values__=f,e?i.__wrapped__=r:e=r;var i=r;t=t.__wrapped__}return i.__wrapped__=n,e}function bp(){var n=this.__wrapped__;if(n instanceof q){var e=n;return this.__actions__.length&&(e=new q(this)),e=e.reverse(),e.__actions__.push({func:ir,args:[zi],thisArg:f}),new Bn(e,this.__chain__)}return this.thru(zi)}function Ip(){return fo(this.__wrapped__,this.__actions__)}var Rp=Qt(function(n,e,t){X.call(n,t)?++n[t]:ne(n,t,1)});function Tp(n,e,t){var r=L(n)?mf:dh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}function Op(n,e){var t=L(n)?ae:Hf;return t(n,S(e,3))}var Ep=wo(qo),Cp=wo($o);function Lp(n,e){return dn(ur(n,e),1)}function Pp(n,e){return dn(ur(n,e),de)}function Wp(n,e,t){return t=t===f?1:F(t),dn(ur(n,e),t)}function Zo(n,e){var t=L(n)?Fn:he;return t(n,S(e,3))}function Yo(n,e){var t=L(n)?kl:Gf;return t(n,S(e,3))}var Fp=Qt(function(n,e,t){X.call(n,t)?n[t].push(e):ne(n,t,[e])});function Mp(n,e,t,r){n=bn(n)?n:ze(n),t=t&&!r?F(t):0;var i=n.length;return t<0&&(t=hn(i+t,0)),lr(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&Pe(n,e,t)>-1}var Bp=B(function(n,e,t){var r=-1,i=typeof e=="function",o=bn(n)?g(n.length):[];return he(n,function(a){o[++r]=i?Tn(e,a,t):st(a,e,t)}),o}),Up=Qt(function(n,e,t){ne(n,t,e)});function ur(n,e){var t=L(n)?tn:Jf;return t(n,S(e,3))}function Dp(n,e,t,r){return n==null?[]:(L(e)||(e=e==null?[]:[e]),t=r?f:t,L(t)||(t=t==null?[]:[t]),jf(n,e,t))}var qp=Qt(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function $p(n,e,t){var r=L(n)?ri:Sf,i=arguments.length<3;return r(n,S(e,4),t,i,he)}function Np(n,e,t){var r=L(n)?jl:Sf,i=arguments.length<3;return r(n,S(e,4),t,i,Gf)}function Gp(n,e){var t=L(n)?ae:Hf;return t(n,ar(S(e,3)))}function Hp(n){var e=L(n)?Df:Mh;return e(n)}function zp(n,e,t){(t?yn(n,e,t):e===f)?e=1:e=F(e);var r=L(n)?hh:Bh;return r(n,e)}function Kp(n){var e=L(n)?gh:Dh;return e(n)}function Zp(n){if(n==null)return 0;if(bn(n))return lr(n)?Fe(n):n.length;var e=mn(n);return e==Nn||e==Gn?n.size:Ai(n).length}function Yp(n,e,t){var r=L(n)?ii:qh;return t&&yn(n,e,t)&&(e=f),r(n,S(e,3))}var Xp=B(function(n,e){if(n==null)return[];var t=e.length;return t>1&&yn(n,e[0],e[1])?e=[]:t>2&&yn(e[0],e[1],e[2])&&(e=[e[0]]),jf(n,dn(e,1),[])}),fr=Oc||function(){return vn.Date.now()};function Jp(n,e){if(typeof e!="function")throw new Mn(O);return n=F(n),function(){if(--n<1)return e.apply(this,arguments)}}function Xo(n,e,t){return e=t?f:e,e=n&&e==null?n.length:e,ee(n,nn,f,f,f,f,e)}function Jo(n,e){var t;if(typeof e!="function")throw new Mn(O);return n=F(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=f),t}}var Zi=B(function(n,e,t){var r=P;if(t.length){var i=le(t,Ge(Zi));r|=Y}return ee(n,r,e,t,i)}),Qo=B(function(n,e,t){var r=P|_n;if(t.length){var i=le(t,Ge(Qo));r|=Y}return ee(e,r,n,t,i)});function Vo(n,e,t){e=t?f:e;var r=ee(n,A,f,f,f,f,f,e);return r.placeholder=Vo.placeholder,r}function ko(n,e,t){e=t?f:e;var r=ee(n,D,f,f,f,f,f,e);return r.placeholder=ko.placeholder,r}function jo(n,e,t){var r,i,o,a,s,c,_=0,v=!1,d=!1,m=!0;if(typeof n!="function")throw new Mn(O);e=$n(e)||0,rn(t)&&(v=!!t.leading,d="maxWait"in t,o=d?hn($n(t.maxWait)||0,e):o,m="trailing"in t?!!t.trailing:m);function y(on){var Zn=r,fe=i;return r=i=f,_=on,a=n.apply(fe,Zn),a}function b(on){return _=on,s=pt(U,e),v?y(on):a}function M(on){var Zn=on-c,fe=on-_,wa=e-Zn;return d?wn(wa,o-fe):wa}function I(on){var Zn=on-c,fe=on-_;return c===f||Zn>=e||Zn<0||d&&fe>=o}function U(){var on=fr();if(I(on))return $(on);s=pt(U,M(on))}function $(on){return s=f,m&&r?y(on):(r=i=f,a)}function Ln(){s!==f&&ao(s),_=0,r=c=i=s=f}function An(){return s===f?a:$(fr())}function Pn(){var on=fr(),Zn=I(on);if(r=arguments,i=this,c=on,Zn){if(s===f)return b(c);if(d)return ao(s),s=pt(U,e),y(c)}return s===f&&(s=pt(U,e)),a}return Pn.cancel=Ln,Pn.flush=An,Pn}var Qp=B(function(n,e){return Nf(n,1,e)}),Vp=B(function(n,e,t){return Nf(n,$n(e)||0,t)});function kp(n){return ee(n,Ur)}function or(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Mn(O);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(or.Cache||jn),t}or.Cache=jn;function ar(n){if(typeof n!="function")throw new Mn(O);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function jp(n){return Jo(2,n)}var n_=$h(function(n,e){e=e.length==1&&L(e[0])?tn(e[0],On(S())):tn(dn(e,1),On(S()));var t=e.length;return B(function(r){for(var i=-1,o=wn(r.length,t);++i=e}),Re=Zf(function(){return arguments}())?Zf:function(n){return un(n)&&X.call(n,"callee")&&!Pf.call(n,"callee")},L=g.isArray,__=gf?On(gf):Sh;function bn(n){return n!=null&&sr(n.length)&&!ie(n)}function fn(n){return un(n)&&bn(n)}function v_(n){return n===!0||n===!1||un(n)&&xn(n)==Xe}var ve=Cc||iu,d_=pf?On(pf):bh;function w_(n){return un(n)&&n.nodeType===1&&!_t(n)}function m_(n){if(n==null)return!0;if(bn(n)&&(L(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||He(n)||Re(n)))return!n.length;var e=mn(n);if(e==Nn||e==Gn)return!n.size;if(gt(n))return!Ai(n).length;for(var t in n)if(X.call(n,t))return!1;return!0}function x_(n,e){return lt(n,e)}function y_(n,e,t){t=typeof t=="function"?t:f;var r=t?t(n,e):f;return r===f?lt(n,e,f,t):!!r}function Xi(n){if(!un(n))return!1;var e=xn(n);return e==yt||e==zs||typeof n.message=="string"&&typeof n.name=="string"&&!_t(n)}function A_(n){return typeof n=="number"&&Ff(n)}function ie(n){if(!rn(n))return!1;var e=xn(n);return e==At||e==$u||e==Hs||e==Zs}function ea(n){return typeof n=="number"&&n==F(n)}function sr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=oe}function rn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function un(n){return n!=null&&typeof n=="object"}var ta=_f?On(_f):Rh;function S_(n,e){return n===e||yi(n,e,Di(e))}function b_(n,e,t){return t=typeof t=="function"?t:f,yi(n,e,Di(e),t)}function I_(n){return ra(n)&&n!=+n}function R_(n){if(sg(n))throw new E(R);return Yf(n)}function T_(n){return n===null}function O_(n){return n==null}function ra(n){return typeof n=="number"||un(n)&&xn(n)==Qe}function _t(n){if(!un(n)||xn(n)!=Vn)return!1;var e=Bt(n);if(e===null)return!0;var t=X.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Pt.call(t)==bc}var Ji=vf?On(vf):Th;function E_(n){return ea(n)&&n>=-oe&&n<=oe}var ia=df?On(df):Oh;function lr(n){return typeof n=="string"||!L(n)&&un(n)&&xn(n)==ke}function Cn(n){return typeof n=="symbol"||un(n)&&xn(n)==St}var He=wf?On(wf):Eh;function C_(n){return n===f}function L_(n){return un(n)&&mn(n)==je}function P_(n){return un(n)&&xn(n)==Xs}var W_=nr(Si),F_=nr(function(n,e){return n<=e});function ua(n){if(!n)return[];if(bn(n))return lr(n)?Hn(n):Sn(n);if(tt&&n[tt])return hc(n[tt]());var e=mn(n),t=e==Nn?li:e==Gn?Et:ze;return t(n)}function ue(n){if(!n)return n===0?n:0;if(n=$n(n),n===de||n===-de){var e=n<0?-1:1;return e*qs}return n===n?n:0}function F(n){var e=ue(n),t=e%1;return e===e?t?e-t:e:0}function fa(n){return n?Ae(F(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return mt;if(rn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=rn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=bf(n);var t=_l.test(n);return t||dl.test(n)?Jl(n.slice(2),t?2:8):pl.test(n)?mt:+n}function oa(n){return Jn(n,In(n))}function M_(n){return n?Ae(F(n),-oe,oe):n===0?n:0}function K(n){return n==null?"":En(n)}var B_=$e(function(n,e){if(gt(e)||bn(e)){Jn(e,gn(e),n);return}for(var t in e)X.call(e,t)&&ot(n,t,e[t])}),aa=$e(function(n,e){Jn(e,In(e),n)}),cr=$e(function(n,e,t,r){Jn(e,In(e),n,r)}),U_=$e(function(n,e,t,r){Jn(e,gn(e),n,r)}),D_=te(vi);function q_(n,e){var t=qe(n);return e==null?t:qf(t,e)}var $_=B(function(n,e){n=Q(n);var t=-1,r=e.length,i=r>2?e[2]:f;for(i&&yn(e[0],e[1],i)&&(r=1);++t1),o}),Jn(n,Bi(n),t),r&&(t=Un(t,an|G|z,Vh));for(var i=e.length;i--;)Oi(t,e[i]);return t});function iv(n,e){return la(n,ar(S(e)))}var uv=te(function(n,e){return n==null?{}:Ph(n,e)});function la(n,e){if(n==null)return{};var t=tn(Bi(n),function(r){return[r]});return e=S(e),no(n,t,function(r,i){return e(r,i[0])})}function fv(n,e,t){e=pe(e,n);var r=-1,i=e.length;for(i||(i=1,n=f);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var i=Mf();return wn(n+i*(e-n+Xl("1e-"+((i+"").length-1))),e)}return Ii(n,e)}var dv=Ne(function(n,e,t){return e=e.toLowerCase(),n+(t?ga(e):e)});function ga(n){return ki(K(n).toLowerCase())}function pa(n){return n=K(n),n&&n.replace(ml,oc).replace(Dl,"")}function wv(n,e,t){n=K(n),e=En(e);var r=n.length;t=t===f?r:Ae(F(t),0,r);var i=t;return t-=e.length,t>=0&&n.slice(t,i)==e}function mv(n){return n=K(n),n&&js.test(n)?n.replace(Hu,ac):n}function xv(n){return n=K(n),n&&ul.test(n)?n.replace(Yr,"\\$&"):n}var yv=Ne(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),Av=Ne(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),Sv=vo("toLowerCase");function bv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;if(!e||r>=e)return n;var i=(e-r)/2;return jt($t(i),t)+n+jt(qt(i),t)}function Iv(n,e,t){n=K(n),e=F(e);var r=e?Fe(n):0;return e&&r>>0,t?(n=K(n),n&&(typeof e=="string"||e!=null&&!Ji(e))&&(e=En(e),!e&&We(n))?_e(Hn(n),0,t):n.split(e,t)):[]}var Pv=Ne(function(n,e,t){return n+(t?" ":"")+ki(e)});function Wv(n,e,t){return n=K(n),t=t==null?0:Ae(F(t),0,n.length),e=En(e),n.slice(t,t+e.length)==e}function Fv(n,e,t){var r=u.templateSettings;t&&yn(n,e,t)&&(e=f),n=K(n),e=cr({},e,r,bo);var i=cr({},e.imports,r.imports,bo),o=gn(i),a=si(i,o),s,c,_=0,v=e.interpolate||bt,d="__p += '",m=ci((e.escape||bt).source+"|"+v.source+"|"+(v===zu?gl:bt).source+"|"+(e.evaluate||bt).source+"|$","g"),y="//# sourceURL="+(X.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Hl+"]")+` -`;n.replace(m,function(I,U,$,Ln,An,Pn){return $||($=Ln),d+=n.slice(_,Pn).replace(xl,sc),U&&(s=!0,d+=`' + -__e(`+U+`) + -'`),An&&(c=!0,d+=`'; -`+An+`; -__p += '`),$&&(d+=`' + -((__t = (`+$+`)) == null ? '' : __t) + -'`),_=Pn+I.length,I}),d+=`'; -`;var b=X.call(e,"variable")&&e.variable;if(!b)d=`with (obj) { -`+d+` -} -`;else if(cl.test(b))throw new E(k);d=(c?d.replace(Js,""):d).replace(Qs,"$1").replace(Vs,"$1;"),d="function("+(b||"obj")+`) { -`+(b?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+d+`return __p -}`;var M=va(function(){return H(o,y+"return "+d).apply(f,a)});if(M.source=d,Xi(M))throw M;return M}function Mv(n){return K(n).toLowerCase()}function Bv(n){return K(n).toUpperCase()}function Uv(n,e,t){if(n=K(n),n&&(t||e===f))return bf(n);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Hn(e),o=If(r,i),a=Rf(r,i)+1;return _e(r,o,a).join("")}function Dv(n,e,t){if(n=K(n),n&&(t||e===f))return n.slice(0,Of(n)+1);if(!n||!(e=En(e)))return n;var r=Hn(n),i=Rf(r,Hn(e))+1;return _e(r,0,i).join("")}function qv(n,e,t){if(n=K(n),n&&(t||e===f))return n.replace(Xr,"");if(!n||!(e=En(e)))return n;var r=Hn(n),i=If(r,Hn(e));return _e(r,i).join("")}function $v(n,e){var t=Ws,r=Fs;if(rn(e)){var i="separator"in e?e.separator:i;t="length"in e?F(e.length):t,r="omission"in e?En(e.omission):r}n=K(n);var o=n.length;if(We(n)){var a=Hn(n);o=a.length}if(t>=o)return n;var s=t-Fe(r);if(s<1)return r;var c=a?_e(a,0,s).join(""):n.slice(0,s);if(i===f)return c+r;if(a&&(s+=c.length-s),Ji(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=ci(i.source,K(Ku.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var d=_.index;c=c.slice(0,d===f?s:d)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+r}function Nv(n){return n=K(n),n&&ks.test(n)?n.replace(Gu,vc):n}var Gv=Ne(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),ki=vo("toUpperCase");function _a(n,e,t){return n=K(n),e=t?f:e,e===f?cc(n)?mc(n):tc(n):n.match(e)||[]}var va=B(function(n,e){try{return Tn(n,f,e)}catch(t){return Xi(t)?t:new E(t)}}),Hv=te(function(n,e){return Fn(e,function(t){t=Qn(t),ne(n,t,Zi(n[t],n))}),n});function zv(n){var e=n==null?0:n.length,t=S();return n=e?tn(n,function(r){if(typeof r[1]!="function")throw new Mn(O);return[t(r[0]),r[1]]}):[],B(function(r){for(var i=-1;++ioe)return[];var t=Yn,r=wn(n,Yn);e=S(e),n-=Yn;for(var i=ai(r,e);++t0||e<0)?new q(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==f&&(e=F(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},q.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},q.prototype.toArray=function(){return this.take(Yn)},Xn(q.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=u[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(u.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,c=a instanceof q,_=s[0],v=c||L(a),d=function(U){var $=i.apply(u,se([U],s));return r&&m?$[0]:$};v&&t&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,y=!!this.__actions__.length,b=o&&!m,M=c&&!y;if(!o&&v){a=M?a:new q(this);var I=n.apply(a,s);return I.__actions__.push({func:ir,args:[d],thisArg:f}),new Bn(I,m)}return b&&M?n.apply(this,s):(I=this.thru(d),b?r?I.value()[0]:I.value():I)})}),Fn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Ct[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(L(o)?o:[],i)}return this[t](function(a){return e.apply(L(a)?a:[],i)})}}),Xn(q.prototype,function(n,e){var t=u[e];if(t){var r=t.name+"";X.call(De,r)||(De[r]=[]),De[r].push({name:e,func:t})}}),De[Vt(f,_n).name]=[{name:"wrapper",func:f}],q.prototype.clone=Nc,q.prototype.reverse=Gc,q.prototype.value=Hc,u.prototype.at=wp,u.prototype.chain=mp,u.prototype.commit=xp,u.prototype.next=yp,u.prototype.plant=Sp,u.prototype.reverse=bp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Ip,u.prototype.first=u.prototype.head,tt&&(u.prototype[tt]=Ap),u},Me=xc();we?((we.exports=Me)._=Me,ni._=Me):vn._=Me}).call(Ke)}(vt,vt.exports);var Te=vt.exports,ma=function(){},xa=ma(),Oe=function(h){return h!==xa&&h!==null},ya=Oe,Aa=Array.prototype.forEach,Sa=Object.create,ba=function(h,w){var f;for(f in h)w[f]=h[f]},Ia=function(h){var w=Sa(null);return Aa.call(arguments,function(f){ya(f)&&ba(Object(f),w)}),w},Ra=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},hr,uu;function Ta(){return uu||(uu=1,hr=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),hr}var Oa=Ra()?Math.sign:Ta(),Ea=Oa,Ca=Math.abs,La=Math.floor,Pa=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:Ea(h)*La(Ca(h)))},Wa=Pa,Fa=Math.max,Ma=function(h){return Fa(0,Wa(h))},fu=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},Ba=Oe,ou=function(h){if(!Ba(h))throw new TypeError("Cannot use null or undefined");return h},Ua={exports:{}},Da=function(){var h=Object.assign,w;return typeof h!="function"?!1:(w={foo:"raz"},h(w,{bar:"dwa"},{trzy:"trzy"}),w.foo+w.bar+w.trzy==="razdwatrzy")},gr,au;function qa(){return au||(au=1,gr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),gr}var pr,su;function $a(){if(su)return pr;su=1;var h=Oe,w=Object.keys;return pr=function(f){return w(h(f)?Object(f):f)},pr}var _r,lu;function Na(){return lu||(lu=1,_r=qa()()?Object.keys:$a()),_r}var vr,cu;function Ga(){if(cu)return vr;cu=1;var h=Na(),w=ou,f=Math.max;return vr=function(T,C){var R,O,k=f(arguments.length,2),Z;for(T=Object(w(T)),Z=function(N){try{T[N]=C[N]}catch(j){R||(R=j)}},O=1;O-1},wr}var fs=is()?String.prototype.contains:us(),dt=_u,du=rs,wu=hu,mu=Ia,Ze=fs,os=pu.exports=function(h,w){var f,T,C,R,O;return arguments.length<2||typeof h!="string"?(R=w,w=h,h=null):R=arguments[2],dt(h)?(f=Ze.call(h,"c"),T=Ze.call(h,"e"),C=Ze.call(h,"w")):(f=C=!0,T=!1),O={value:w,configurable:f,enumerable:T,writable:C},R?wu(mu(R),O):O};os.gs=function(h,w,f){var T,C,R,O;return typeof h!="string"?(R=f,f=w,w=h,h=null):R=arguments[3],dt(w)?du(w)?dt(f)?du(f)||(R=f,f=void 0):f=void 0:(R=w,w=f=void 0):w=void 0,dt(h)?(T=Ze.call(h,"c"),C=Ze.call(h,"e")):(T=!0,C=!1),O={get:w,set:f,configurable:T,enumerable:C},R?wu(mu(R),O):O};var Ye=pu.exports,mr={exports:{}};(function(h,w){var f=Ye,T=fu,C=Function.prototype.apply,R=Function.prototype.call,O=Object.create,k=Object.defineProperty,Z=Object.defineProperties,N=Object.prototype.hasOwnProperty,j={configurable:!0,enumerable:!1,writable:!0},an,G,z,pn,ln,P,_n;an=function(W,A){var D;return T(A),N.call(this,"__ee__")?D=this.__ee__:(D=j.value=O(null),k(this,"__ee__",j),j.value=null),D[W]?typeof D[W]=="object"?D[W].push(A):D[W]=[D[W],A]:D[W]=A,this},G=function(W,A){var D,Y;return T(A),Y=this,an.call(this,W,D=function(){z.call(Y,W,D),C.call(A,this,arguments)}),D.__eeOnceListener__=A,this},z=function(W,A){var D,Y,J,nn;if(T(A),!N.call(this,"__ee__"))return this;if(D=this.__ee__,!D[W])return this;if(Y=D[W],typeof Y=="object")for(nn=0;J=Y[nn];++nn)(J===A||J.__eeOnceListener__===A)&&(Y.length===2?D[W]=Y[nn?0:1]:Y.splice(nn,1));else(Y===A||Y.__eeOnceListener__===A)&&delete D[W];return this},pn=function(W){var A,D,Y,J,nn;if(N.call(this,"__ee__")&&(J=this.__ee__[W],!!J))if(typeof J=="object"){for(D=arguments.length,nn=new Array(D-1),A=1;A=55296&&D<=56319&&(sn+=G[++P])),sn=z?N.call(z,pn,sn,_n):sn,ln?(j.value=sn,an(W,_n,j)):W[_n]=sn,++_n;A=_n}}if(A===void 0)for(A=T(G.length),ln&&(W=new ln(A)),P=0;Pasync w=>{const f=new h,T=await w(f);if("error"in T)throw console.error(T.error),new Error(T.error);return f.terminate(),T.result},Is=h=>w=>bs(h)(f=>(f.postMessage(w),new Promise((T,C)=>{f.onmessage=R=>{T(R.data)},f.onerror=R=>{console.error(R),C(R)}}))),Rs=h=>async w=>{try{const f=await h(w);postMessage({result:f})}catch(f){postMessage({error:f})}};var Ts=""+new URL("parseTraceSlave.worker-MM7PTpMM.js",self.location.href).href;const{min:Os}=Math,Es=navigator.hardwareConcurrency??8;class Cs extends Worker{constructor(){super(Ts,{type:"module"})}}const Ls=Is(Cs);async function Ps({trace:h,context:w,view:f="main"}){var O,k;const T=Te.ceil((((O=h==null?void 0:h.events)==null?void 0:O.length)??0)/Es),C=Te.range(0,(k=h==null?void 0:h.events)==null?void 0:k.length,T),R=Te.flatten(await Promise.all(Te.map(C,Z=>{var N;return Ls({trace:h,context:w,view:f,from:Z,to:Os(Z+T,((N=h==null?void 0:h.events)==null?void 0:N.length)??0)})})));return{stepsPersistent:Te.flatMap(R,"stepsPersistent"),stepsTransient:Te.flatMap(R,"stepsTransient")}}onmessage=Rs(async({data:h})=>await Ps(h))})(); diff --git a/assets/parseTrace.worker-y8dm9SDW.js b/assets/parseTrace.worker-y8dm9SDW.js new file mode 100644 index 0000000..2974926 --- /dev/null +++ b/assets/parseTrace.worker-y8dm9SDW.js @@ -0,0 +1,27 @@ +(function(){"use strict";var Ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_r={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 + */_r.exports,function(h,d){(function(){var f,C="4.17.21",L=200,P="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",y="Expected a function",A="Invalid `variable` option passed into `_.template`",S="__lodash_hash_undefined__",R=500,N="__lodash_placeholder__",Z=1,q=2,X=4,pn=1,ln=2,M=1,_n=2,B=4,I=8,H=16,Q=32,k=64,en=128,sn=256,Yt=512,Gs=30,Hs="...",zs=800,Ks=16,rf=1,Zs=2,Ys=3,de=1/0,oe=9007199254740991,Xs=17976931348623157e292,wr=NaN,Yn=4294967295,Js=Yn-1,Qs=Yn>>>1,Vs=[["ary",en],["bind",M],["bindKey",_n],["curry",I],["curryRight",H],["flip",Yt],["partial",Q],["partialRight",k],["rearg",sn]],Ce="[object Arguments]",mr="[object Array]",ks="[object AsyncFunction]",Ye="[object Boolean]",Xe="[object Date]",js="[object DOMException]",yr="[object Error]",xr="[object Function]",tf="[object GeneratorFunction]",Nn="[object Map]",Je="[object Number]",nl="[object Null]",Vn="[object Object]",uf="[object Promise]",el="[object Proxy]",Qe="[object RegExp]",Gn="[object Set]",Ve="[object String]",br="[object Symbol]",rl="[object Undefined]",ke="[object WeakMap]",tl="[object WeakSet]",je="[object ArrayBuffer]",Le="[object DataView]",Xt="[object Float32Array]",Jt="[object Float64Array]",Qt="[object Int8Array]",Vt="[object Int16Array]",kt="[object Int32Array]",jt="[object Uint8Array]",ni="[object Uint8ClampedArray]",ei="[object Uint16Array]",ri="[object Uint32Array]",il=/\b__p \+= '';/g,ul=/\b(__p \+=) '' \+/g,fl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ff=/&(?:amp|lt|gt|quot|#39);/g,of=/[&<>"']/g,ol=RegExp(ff.source),al=RegExp(of.source),sl=/<%-([\s\S]+?)%>/g,ll=/<%([\s\S]+?)%>/g,af=/<%=([\s\S]+?)%>/g,cl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hl=/^\w*$/,gl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ti=/[\\^$.*+?()[\]{}|]/g,pl=RegExp(ti.source),ii=/^\s+/,_l=/\s/,vl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,dl=/\{\n\/\* \[wrapped with (.+)\] \*/,wl=/,? & /,ml=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yl=/[()=,{}\[\]\/\s]/,xl=/\\(\\)?/g,bl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,sf=/\w*$/,Al=/^[-+]0x[0-9a-f]+$/i,Sl=/^0b[01]+$/i,Il=/^\[object .+?Constructor\]$/,Rl=/^0o[0-7]+$/i,Ol=/^(?:0|[1-9]\d*)$/,Tl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ar=/($^)/,El=/['\n\r\u2028\u2029\\]/g,Sr="\\ud800-\\udfff",Cl="\\u0300-\\u036f",Ll="\\ufe20-\\ufe2f",Pl="\\u20d0-\\u20ff",lf=Cl+Ll+Pl,cf="\\u2700-\\u27bf",hf="a-z\\xdf-\\xf6\\xf8-\\xff",Wl="\\xac\\xb1\\xd7\\xf7",Fl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ql="\\u2000-\\u206f",Ml=" \\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",gf="A-Z\\xc0-\\xd6\\xd8-\\xde",pf="\\ufe0e\\ufe0f",_f=Wl+Fl+ql+Ml,ui="['’]",Bl="["+Sr+"]",vf="["+_f+"]",Ir="["+lf+"]",df="\\d+",Ul="["+cf+"]",wf="["+hf+"]",mf="[^"+Sr+_f+df+cf+hf+gf+"]",fi="\\ud83c[\\udffb-\\udfff]",Dl="(?:"+Ir+"|"+fi+")",yf="[^"+Sr+"]",oi="(?:\\ud83c[\\udde6-\\uddff]){2}",ai="[\\ud800-\\udbff][\\udc00-\\udfff]",Pe="["+gf+"]",xf="\\u200d",bf="(?:"+wf+"|"+mf+")",$l="(?:"+Pe+"|"+mf+")",Af="(?:"+ui+"(?:d|ll|m|re|s|t|ve))?",Sf="(?:"+ui+"(?:D|LL|M|RE|S|T|VE))?",If=Dl+"?",Rf="["+pf+"]?",Nl="(?:"+xf+"(?:"+[yf,oi,ai].join("|")+")"+Rf+If+")*",Gl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Of=Rf+If+Nl,zl="(?:"+[Ul,oi,ai].join("|")+")"+Of,Kl="(?:"+[yf+Ir+"?",Ir,oi,ai,Bl].join("|")+")",Zl=RegExp(ui,"g"),Yl=RegExp(Ir,"g"),si=RegExp(fi+"(?="+fi+")|"+Kl+Of,"g"),Xl=RegExp([Pe+"?"+wf+"+"+Af+"(?="+[vf,Pe,"$"].join("|")+")",$l+"+"+Sf+"(?="+[vf,Pe+bf,"$"].join("|")+")",Pe+"?"+bf+"+"+Af,Pe+"+"+Sf,Hl,Gl,df,zl].join("|"),"g"),Jl=RegExp("["+xf+Sr+lf+pf+"]"),Ql=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vl=["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"],kl=-1,rn={};rn[Xt]=rn[Jt]=rn[Qt]=rn[Vt]=rn[kt]=rn[jt]=rn[ni]=rn[ei]=rn[ri]=!0,rn[Ce]=rn[mr]=rn[je]=rn[Ye]=rn[Le]=rn[Xe]=rn[yr]=rn[xr]=rn[Nn]=rn[Je]=rn[Vn]=rn[Qe]=rn[Gn]=rn[Ve]=rn[ke]=!1;var nn={};nn[Ce]=nn[mr]=nn[je]=nn[Le]=nn[Ye]=nn[Xe]=nn[Xt]=nn[Jt]=nn[Qt]=nn[Vt]=nn[kt]=nn[Nn]=nn[Je]=nn[Vn]=nn[Qe]=nn[Gn]=nn[Ve]=nn[br]=nn[jt]=nn[ni]=nn[ei]=nn[ri]=!0,nn[yr]=nn[xr]=nn[ke]=!1;var jl={À:"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"},nc={"&":"&","<":"<",">":">",'"':""","'":"'"},ec={"&":"&","<":"<",">":">",""":'"',"'":"'"},rc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tc=parseFloat,ic=parseInt,Tf=typeof Ze=="object"&&Ze&&Ze.Object===Object&&Ze,uc=typeof self=="object"&&self&&self.Object===Object&&self,vn=Tf||uc||Function("return this")(),li=d&&!d.nodeType&&d,we=li&&!0&&h&&!h.nodeType&&h,Ef=we&&we.exports===li,ci=Ef&&Tf.process,Wn=function(){try{var l=we&&we.require&&we.require("util").types;return l||ci&&ci.binding&&ci.binding("util")}catch{}}(),Cf=Wn&&Wn.isArrayBuffer,Lf=Wn&&Wn.isDate,Pf=Wn&&Wn.isMap,Wf=Wn&&Wn.isRegExp,Ff=Wn&&Wn.isSet,qf=Wn&&Wn.isTypedArray;function On(l,p,g){switch(g.length){case 0:return l.call(p);case 1:return l.call(p,g[0]);case 2:return l.call(p,g[0],g[1]);case 3:return l.call(p,g[0],g[1],g[2])}return l.apply(p,g)}function fc(l,p,g,x){for(var W=-1,Y=l==null?0:l.length;++W-1}function hi(l,p,g){for(var x=-1,W=l==null?0:l.length;++x-1;);return g}function Hf(l,p){for(var g=l.length;g--&&We(p,l[g],0)>-1;);return g}function _c(l,p){for(var g=l.length,x=0;g--;)l[g]===p&&++x;return x}var vc=vi(jl),dc=vi(nc);function wc(l){return"\\"+rc[l]}function mc(l,p){return l==null?f:l[p]}function Fe(l){return Jl.test(l)}function yc(l){return Ql.test(l)}function xc(l){for(var p,g=[];!(p=l.next()).done;)g.push(p.value);return g}function yi(l){var p=-1,g=Array(l.size);return l.forEach(function(x,W){g[++p]=[W,x]}),g}function zf(l,p){return function(g){return l(p(g))}}function le(l,p){for(var g=-1,x=l.length,W=0,Y=[];++g-1}function ah(n,e){var r=this.__data__,t=Hr(r,n);return t<0?(++this.size,r.push([n,e])):r[t][1]=e,this}kn.prototype.clear=ih,kn.prototype.delete=uh,kn.prototype.get=fh,kn.prototype.has=oh,kn.prototype.set=ah;function jn(n){var e=-1,r=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Bn(n,e,r,t,i,o){var a,s=e&Z,c=e&q,_=e&X;if(r&&(a=i?r(n,t,i,o):r(n)),a!==f)return a;if(!un(n))return n;var v=F(n);if(v){if(a=hg(n),!s)return An(n,a)}else{var w=mn(n),m=w==xr||w==tf;if(ve(n))return Oo(n,s);if(w==Vn||w==Ce||m&&!i){if(a=c||m?{}:Zo(n),!s)return c?eg(n,Sh(a,n)):ng(n,ro(a,n))}else{if(!nn[w])return i?n:{};a=gg(n,w,s)}}o||(o=new zn);var b=o.get(n);if(b)return b;o.set(n,a),xa(n)?n.forEach(function(E){a.add(Bn(E,e,r,E,n,o))}):ma(n)&&n.forEach(function(E,G){a.set(G,Bn(E,e,r,G,n,o))});var T=_?c?Zi:Ki:c?In:gn,D=v?f:T(n);return Fn(D||n,function(E,G){D&&(G=E,E=n[G]),fr(a,G,Bn(E,e,r,G,n,o))}),a}function Ih(n){var e=gn(n);return function(r){return to(r,n,e)}}function to(n,e,r){var t=r.length;if(n==null)return!t;for(n=j(n);t--;){var i=r[t],o=e[i],a=n[i];if(a===f&&!(i in n)||!o(a))return!1}return!0}function io(n,e,r){if(typeof n!="function")throw new qn(y);return gr(function(){n.apply(f,r)},e)}function or(n,e,r,t){var i=-1,o=Rr,a=!0,s=n.length,c=[],_=e.length;if(!s)return c;r&&(e=tn(e,Tn(r))),t?(o=hi,a=!1):e.length>=L&&(o=nr,a=!1,e=new xe(e));n:for(;++ii?0:i+r),t=t===f||t>i?i:U(t),t<0&&(t+=i),t=r>t?0:Aa(t);r0&&r(s)?e>1?dn(s,e-1,r,t,i):se(i,s):t||(i[i.length]=s)}return i}var Oi=Wo(),oo=Wo(!0);function Xn(n,e){return n&&Oi(n,e,gn)}function Ti(n,e){return n&&oo(n,e,gn)}function Kr(n,e){return ae(e,function(r){return ie(n[r])})}function Ae(n,e){e=pe(e,n);for(var r=0,t=e.length;n!=null&&re}function Th(n,e){return n!=null&&V.call(n,e)}function Eh(n,e){return n!=null&&e in j(n)}function Ch(n,e,r){return n>=wn(e,r)&&n=120&&v.length>=120)?new xe(a&&v):f}v=n[0];var w=-1,m=s[0];n:for(;++w-1;)s!==n&&Mr.call(s,c,1),Mr.call(n,c,1);return n}function mo(n,e){for(var r=n?e.length:0,t=r-1;r--;){var i=e[r];if(r==t||i!==o){var o=i;te(i)?Mr.call(n,i,1):Ui(n,i)}}return n}function qi(n,e){return n+Dr(kf()*(e-n+1))}function Hh(n,e,r,t){for(var i=-1,o=hn(Ur((e-n)/(r||1)),0),a=g(o);o--;)a[t?o:++i]=n,n+=r;return a}function Mi(n,e){var r="";if(!n||e<1||e>oe)return r;do e%2&&(r+=n),e=Dr(e/2),e&&(n+=n);while(e);return r}function $(n,e){return ji(Jo(n,e,Rn),n+"")}function zh(n){return eo(Ke(n))}function Kh(n,e){var r=Ke(n);return rt(r,be(e,0,r.length))}function lr(n,e,r,t){if(!un(n))return n;e=pe(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++ii?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=g(i);++t>>1,a=n[o];a!==null&&!Cn(a)&&(r?a<=e:a=L){var _=e?null:ug(n);if(_)return Tr(_);a=!1,i=nr,c=new xe}else c=e?[]:s;n:for(;++t=t?n:Un(n,e,r)}var Ro=Mc||function(n){return vn.clearTimeout(n)};function Oo(n,e){if(e)return n.slice();var r=n.length,t=Yf?Yf(r):new n.constructor(r);return n.copy(t),t}function Gi(n){var e=new n.constructor(n.byteLength);return new Fr(e).set(new Fr(n)),e}function Qh(n,e){var r=e?Gi(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}function Vh(n){var e=new n.constructor(n.source,sf.exec(n));return e.lastIndex=n.lastIndex,e}function kh(n){return ur?j(ur.call(n)):{}}function To(n,e){var r=e?Gi(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Eo(n,e){if(n!==e){var r=n!==f,t=n===null,i=n===n,o=Cn(n),a=e!==f,s=e===null,c=e===e,_=Cn(e);if(!s&&!_&&!o&&n>e||o&&a&&c&&!s&&!_||t&&a&&c||!r&&c||!i)return 1;if(!t&&!o&&!_&&n=s)return c;var _=r[t];return c*(_=="desc"?-1:1)}}return n.index-e.index}function Co(n,e,r,t){for(var i=-1,o=n.length,a=r.length,s=-1,c=e.length,_=hn(o-a,0),v=g(c+_),w=!t;++s1?r[i-1]:f,a=i>2?r[2]:f;for(o=n.length>3&&typeof o=="function"?(i--,o):f,a&&xn(r[0],r[1],a)&&(o=i<3?f:o,i=1),e=j(e);++t-1?i[o?e[a]:a]:f}}function Mo(n){return re(function(e){var r=e.length,t=r,i=Mn.prototype.thru;for(n&&e.reverse();t--;){var o=e[t];if(typeof o!="function")throw new qn(y);if(i&&!a&&nt(o)=="wrapper")var a=new Mn([],!0)}for(t=a?t:r;++t1&&K.reverse(),v&&cs))return!1;var _=o.get(n),v=o.get(e);if(_&&v)return _==e&&v==n;var w=-1,m=!0,b=r&ln?new xe:f;for(o.set(n,e),o.set(e,n);++w1?"& ":"")+e[t],e=e.join(r>2?", ":" "),n.replace(vl,`{ +/* [wrapped with `+e+`] */ +`)}function _g(n){return F(n)||Re(n)||!!(Qf&&n&&n[Qf])}function te(n,e){var r=typeof n;return e=e??oe,!!e&&(r=="number"||r!="symbol"&&Ol.test(n))&&n>-1&&n%1==0&&n0){if(++e>=zs)return arguments[0]}else e=0;return n.apply(f,arguments)}}function rt(n,e){var r=-1,t=n.length,i=t-1;for(e=e===f?t:e;++r1?n[e-1]:f;return r=typeof r=="function"?(n.pop(),r):f,oa(n,r)});function aa(n){var e=u(n);return e.__chain__=!0,e}function Rp(n,e){return e(n),n}function tt(n,e){return e(n)}var Op=re(function(n){var e=n.length,r=e?n[0]:0,t=this.__wrapped__,i=function(o){return Ri(o,n)};return e>1||this.__actions__.length||!(t instanceof z)||!te(r)?this.thru(i):(t=t.slice(r,+r+(e?1:0)),t.__actions__.push({func:tt,args:[i],thisArg:f}),new Mn(t,this.__chain__).thru(function(o){return e&&!o.length&&o.push(f),o}))});function Tp(){return aa(this)}function Ep(){return new Mn(this.value(),this.__chain__)}function Cp(){this.__values__===f&&(this.__values__=ba(this.value()));var n=this.__index__>=this.__values__.length,e=n?f:this.__values__[this.__index__++];return{done:n,value:e}}function Lp(){return this}function Pp(n){for(var e,r=this;r instanceof Gr;){var t=ea(r);t.__index__=0,t.__values__=f,e?i.__wrapped__=t:e=t;var i=t;r=r.__wrapped__}return i.__wrapped__=n,e}function Wp(){var n=this.__wrapped__;if(n instanceof z){var e=n;return this.__actions__.length&&(e=new z(this)),e=e.reverse(),e.__actions__.push({func:tt,args:[nu],thisArg:f}),new Mn(e,this.__chain__)}return this.thru(nu)}function Fp(){return So(this.__wrapped__,this.__actions__)}var qp=Jr(function(n,e,r){V.call(n,r)?++n[r]:ne(n,r,1)});function Mp(n,e,r){var t=F(n)?Mf:Rh;return r&&xn(n,e,r)&&(e=f),t(n,O(e,3))}function Bp(n,e){var r=F(n)?ae:fo;return r(n,O(e,3))}var Up=qo(ra),Dp=qo(ta);function $p(n,e){return dn(it(n,e),1)}function Np(n,e){return dn(it(n,e),de)}function Gp(n,e,r){return r=r===f?1:U(r),dn(it(n,e),r)}function sa(n,e){var r=F(n)?Fn:he;return r(n,O(e,3))}function la(n,e){var r=F(n)?oc:uo;return r(n,O(e,3))}var Hp=Jr(function(n,e,r){V.call(n,r)?n[r].push(e):ne(n,r,[e])});function zp(n,e,r,t){n=Sn(n)?n:Ke(n),r=r&&!t?U(r):0;var i=n.length;return r<0&&(r=hn(i+r,0)),st(n)?r<=i&&n.indexOf(e,r)>-1:!!i&&We(n,e,r)>-1}var Kp=$(function(n,e,r){var t=-1,i=typeof e=="function",o=Sn(n)?g(n.length):[];return he(n,function(a){o[++t]=i?On(e,a,r):ar(a,e,r)}),o}),Zp=Jr(function(n,e,r){ne(n,r,e)});function it(n,e){var r=F(n)?tn:ho;return r(n,O(e,3))}function Yp(n,e,r,t){return n==null?[]:(F(e)||(e=e==null?[]:[e]),r=t?f:r,F(r)||(r=r==null?[]:[r]),vo(n,e,r))}var Xp=Jr(function(n,e,r){n[r?0:1].push(e)},function(){return[[],[]]});function Jp(n,e,r){var t=F(n)?gi:$f,i=arguments.length<3;return t(n,O(e,4),r,i,he)}function Qp(n,e,r){var t=F(n)?ac:$f,i=arguments.length<3;return t(n,O(e,4),r,i,uo)}function Vp(n,e){var r=F(n)?ae:fo;return r(n,ot(O(e,3)))}function kp(n){var e=F(n)?eo:zh;return e(n)}function jp(n,e,r){(r?xn(n,e,r):e===f)?e=1:e=U(e);var t=F(n)?xh:Kh;return t(n,e)}function n_(n){var e=F(n)?bh:Yh;return e(n)}function e_(n){if(n==null)return 0;if(Sn(n))return st(n)?qe(n):n.length;var e=mn(n);return e==Nn||e==Gn?n.size:Pi(n).length}function r_(n,e,r){var t=F(n)?pi:Xh;return r&&xn(n,e,r)&&(e=f),t(n,O(e,3))}var t_=$(function(n,e){if(n==null)return[];var r=e.length;return r>1&&xn(n,e[0],e[1])?e=[]:r>2&&xn(e[0],e[1],e[2])&&(e=[e[0]]),vo(n,dn(e,1),[])}),ut=Bc||function(){return vn.Date.now()};function i_(n,e){if(typeof e!="function")throw new qn(y);return n=U(n),function(){if(--n<1)return e.apply(this,arguments)}}function ca(n,e,r){return e=r?f:e,e=n&&e==null?n.length:e,ee(n,en,f,f,f,f,e)}function ha(n,e){var r;if(typeof e!="function")throw new qn(y);return n=U(n),function(){return--n>0&&(r=e.apply(this,arguments)),n<=1&&(e=f),r}}var ru=$(function(n,e,r){var t=M;if(r.length){var i=le(r,He(ru));t|=Q}return ee(n,t,e,r,i)}),ga=$(function(n,e,r){var t=M|_n;if(r.length){var i=le(r,He(ga));t|=Q}return ee(e,t,n,r,i)});function pa(n,e,r){e=r?f:e;var t=ee(n,I,f,f,f,f,f,e);return t.placeholder=pa.placeholder,t}function _a(n,e,r){e=r?f:e;var t=ee(n,H,f,f,f,f,f,e);return t.placeholder=_a.placeholder,t}function va(n,e,r){var t,i,o,a,s,c,_=0,v=!1,w=!1,m=!0;if(typeof n!="function")throw new qn(y);e=$n(e)||0,un(r)&&(v=!!r.leading,w="maxWait"in r,o=w?hn($n(r.maxWait)||0,e):o,m="trailing"in r?!!r.trailing:m);function b(an){var Zn=t,fe=i;return t=i=f,_=an,a=n.apply(fe,Zn),a}function T(an){return _=an,s=gr(G,e),v?b(an):a}function D(an){var Zn=an-c,fe=an-_,qa=e-Zn;return w?wn(qa,o-fe):qa}function E(an){var Zn=an-c,fe=an-_;return c===f||Zn>=e||Zn<0||w&&fe>=o}function G(){var an=ut();if(E(an))return K(an);s=gr(G,D(an))}function K(an){return s=f,m&&t?b(an):(t=i=f,a)}function Ln(){s!==f&&Ro(s),_=0,t=c=i=s=f}function bn(){return s===f?a:K(ut())}function Pn(){var an=ut(),Zn=E(an);if(t=arguments,i=this,c=an,Zn){if(s===f)return T(c);if(w)return Ro(s),s=gr(G,e),b(c)}return s===f&&(s=gr(G,e)),a}return Pn.cancel=Ln,Pn.flush=bn,Pn}var u_=$(function(n,e){return io(n,1,e)}),f_=$(function(n,e,r){return io(n,$n(e)||0,r)});function o_(n){return ee(n,Yt)}function ft(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new qn(y);var r=function(){var t=arguments,i=e?e.apply(this,t):t[0],o=r.cache;if(o.has(i))return o.get(i);var a=n.apply(this,t);return r.cache=o.set(i,a)||o,a};return r.cache=new(ft.Cache||jn),r}ft.Cache=jn;function ot(n){if(typeof n!="function")throw new qn(y);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function a_(n){return ha(2,n)}var s_=Jh(function(n,e){e=e.length==1&&F(e[0])?tn(e[0],Tn(O())):tn(dn(e,1),Tn(O()));var r=e.length;return $(function(t){for(var i=-1,o=wn(t.length,r);++i=e}),Re=so(function(){return arguments}())?so:function(n){return fn(n)&&V.call(n,"callee")&&!Jf.call(n,"callee")},F=g.isArray,S_=Cf?Tn(Cf):Ph;function Sn(n){return n!=null&&at(n.length)&&!ie(n)}function on(n){return fn(n)&&Sn(n)}function I_(n){return n===!0||n===!1||fn(n)&&yn(n)==Ye}var ve=Dc||pu,R_=Lf?Tn(Lf):Wh;function O_(n){return fn(n)&&n.nodeType===1&&!pr(n)}function T_(n){if(n==null)return!0;if(Sn(n)&&(F(n)||typeof n=="string"||typeof n.splice=="function"||ve(n)||ze(n)||Re(n)))return!n.length;var e=mn(n);if(e==Nn||e==Gn)return!n.size;if(hr(n))return!Pi(n).length;for(var r in n)if(V.call(n,r))return!1;return!0}function E_(n,e){return sr(n,e)}function C_(n,e,r){r=typeof r=="function"?r:f;var t=r?r(n,e):f;return t===f?sr(n,e,f,r):!!t}function iu(n){if(!fn(n))return!1;var e=yn(n);return e==yr||e==js||typeof n.message=="string"&&typeof n.name=="string"&&!pr(n)}function L_(n){return typeof n=="number"&&Vf(n)}function ie(n){if(!un(n))return!1;var e=yn(n);return e==xr||e==tf||e==ks||e==el}function wa(n){return typeof n=="number"&&n==U(n)}function at(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=oe}function un(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function fn(n){return n!=null&&typeof n=="object"}var ma=Pf?Tn(Pf):qh;function P_(n,e){return n===e||Li(n,e,Xi(e))}function W_(n,e,r){return r=typeof r=="function"?r:f,Li(n,e,Xi(e),r)}function F_(n){return ya(n)&&n!=+n}function q_(n){if(wg(n))throw new W(P);return lo(n)}function M_(n){return n===null}function B_(n){return n==null}function ya(n){return typeof n=="number"||fn(n)&&yn(n)==Je}function pr(n){if(!fn(n)||yn(n)!=Vn)return!1;var e=qr(n);if(e===null)return!0;var r=V.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Lr.call(r)==Wc}var uu=Wf?Tn(Wf):Mh;function U_(n){return wa(n)&&n>=-oe&&n<=oe}var xa=Ff?Tn(Ff):Bh;function st(n){return typeof n=="string"||!F(n)&&fn(n)&&yn(n)==Ve}function Cn(n){return typeof n=="symbol"||fn(n)&&yn(n)==br}var ze=qf?Tn(qf):Uh;function D_(n){return n===f}function $_(n){return fn(n)&&mn(n)==ke}function N_(n){return fn(n)&&yn(n)==tl}var G_=jr(Wi),H_=jr(function(n,e){return n<=e});function ba(n){if(!n)return[];if(Sn(n))return st(n)?Hn(n):An(n);if(er&&n[er])return xc(n[er]());var e=mn(n),r=e==Nn?yi:e==Gn?Tr:Ke;return r(n)}function ue(n){if(!n)return n===0?n:0;if(n=$n(n),n===de||n===-de){var e=n<0?-1:1;return e*Xs}return n===n?n:0}function U(n){var e=ue(n),r=e%1;return e===e?r?e-r:e:0}function Aa(n){return n?be(U(n),0,Yn):0}function $n(n){if(typeof n=="number")return n;if(Cn(n))return wr;if(un(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=un(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Nf(n);var r=Sl.test(n);return r||Rl.test(n)?ic(n.slice(2),r?2:8):Al.test(n)?wr:+n}function Sa(n){return Jn(n,In(n))}function z_(n){return n?be(U(n),-oe,oe):n===0?n:0}function J(n){return n==null?"":En(n)}var K_=Ne(function(n,e){if(hr(e)||Sn(e)){Jn(e,gn(e),n);return}for(var r in e)V.call(e,r)&&fr(n,r,e[r])}),Ia=Ne(function(n,e){Jn(e,In(e),n)}),lt=Ne(function(n,e,r,t){Jn(e,In(e),n,t)}),Z_=Ne(function(n,e,r,t){Jn(e,gn(e),n,t)}),Y_=re(Ri);function X_(n,e){var r=$e(n);return e==null?r:ro(r,e)}var J_=$(function(n,e){n=j(n);var r=-1,t=e.length,i=t>2?e[2]:f;for(i&&xn(e[0],e[1],i)&&(t=1);++r1),o}),Jn(n,Zi(n),r),t&&(r=Bn(r,Z|q|X,fg));for(var i=e.length;i--;)Ui(r,e[i]);return r});function gv(n,e){return Oa(n,ot(O(e)))}var pv=re(function(n,e){return n==null?{}:Nh(n,e)});function Oa(n,e){if(n==null)return{};var r=tn(Zi(n),function(t){return[t]});return e=O(e),wo(n,r,function(t,i){return e(t,i[0])})}function _v(n,e,r){e=pe(e,n);var t=-1,i=e.length;for(i||(i=1,n=f);++te){var t=n;n=e,e=t}if(r||n%1||e%1){var i=kf();return wn(n+i*(e-n+tc("1e-"+((i+"").length-1))),e)}return qi(n,e)}var Rv=Ge(function(n,e,r){return e=e.toLowerCase(),n+(r?Ca(e):e)});function Ca(n){return au(J(n).toLowerCase())}function La(n){return n=J(n),n&&n.replace(Tl,vc).replace(Yl,"")}function Ov(n,e,r){n=J(n),e=En(e);var t=n.length;r=r===f?t:be(U(r),0,t);var i=r;return r-=e.length,r>=0&&n.slice(r,i)==e}function Tv(n){return n=J(n),n&&al.test(n)?n.replace(of,dc):n}function Ev(n){return n=J(n),n&&pl.test(n)?n.replace(ti,"\\$&"):n}var Cv=Ge(function(n,e,r){return n+(r?"-":"")+e.toLowerCase()}),Lv=Ge(function(n,e,r){return n+(r?" ":"")+e.toLowerCase()}),Pv=Fo("toLowerCase");function Wv(n,e,r){n=J(n),e=U(e);var t=e?qe(n):0;if(!e||t>=e)return n;var i=(e-t)/2;return kr(Dr(i),r)+n+kr(Ur(i),r)}function Fv(n,e,r){n=J(n),e=U(e);var t=e?qe(n):0;return e&&t>>0,r?(n=J(n),n&&(typeof e=="string"||e!=null&&!uu(e))&&(e=En(e),!e&&Fe(n))?_e(Hn(n),0,r):n.split(e,r)):[]}var Nv=Ge(function(n,e,r){return n+(r?" ":"")+au(e)});function Gv(n,e,r){return n=J(n),r=r==null?0:be(U(r),0,n.length),e=En(e),n.slice(r,r+e.length)==e}function Hv(n,e,r){var t=u.templateSettings;r&&xn(n,e,r)&&(e=f),n=J(n),e=lt({},e,t,No);var i=lt({},e.imports,t.imports,No),o=gn(i),a=mi(i,o),s,c,_=0,v=e.interpolate||Ar,w="__p += '",m=xi((e.escape||Ar).source+"|"+v.source+"|"+(v===af?bl:Ar).source+"|"+(e.evaluate||Ar).source+"|$","g"),b="//# sourceURL="+(V.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++kl+"]")+` +`;n.replace(m,function(E,G,K,Ln,bn,Pn){return K||(K=Ln),w+=n.slice(_,Pn).replace(El,wc),G&&(s=!0,w+=`' + +__e(`+G+`) + +'`),bn&&(c=!0,w+=`'; +`+bn+`; +__p += '`),K&&(w+=`' + +((__t = (`+K+`)) == null ? '' : __t) + +'`),_=Pn+E.length,E}),w+=`'; +`;var T=V.call(e,"variable")&&e.variable;if(!T)w=`with (obj) { +`+w+` +} +`;else if(yl.test(T))throw new W(A);w=(c?w.replace(il,""):w).replace(ul,"$1").replace(fl,"$1;"),w="function("+(T||"obj")+`) { +`+(T?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+w+`return __p +}`;var D=Wa(function(){return Y(o,b+"return "+w).apply(f,a)});if(D.source=w,iu(D))throw D;return D}function zv(n){return J(n).toLowerCase()}function Kv(n){return J(n).toUpperCase()}function Zv(n,e,r){if(n=J(n),n&&(r||e===f))return Nf(n);if(!n||!(e=En(e)))return n;var t=Hn(n),i=Hn(e),o=Gf(t,i),a=Hf(t,i)+1;return _e(t,o,a).join("")}function Yv(n,e,r){if(n=J(n),n&&(r||e===f))return n.slice(0,Kf(n)+1);if(!n||!(e=En(e)))return n;var t=Hn(n),i=Hf(t,Hn(e))+1;return _e(t,0,i).join("")}function Xv(n,e,r){if(n=J(n),n&&(r||e===f))return n.replace(ii,"");if(!n||!(e=En(e)))return n;var t=Hn(n),i=Gf(t,Hn(e));return _e(t,i).join("")}function Jv(n,e){var r=Gs,t=Hs;if(un(e)){var i="separator"in e?e.separator:i;r="length"in e?U(e.length):r,t="omission"in e?En(e.omission):t}n=J(n);var o=n.length;if(Fe(n)){var a=Hn(n);o=a.length}if(r>=o)return n;var s=r-qe(t);if(s<1)return t;var c=a?_e(a,0,s).join(""):n.slice(0,s);if(i===f)return c+t;if(a&&(s+=c.length-s),uu(i)){if(n.slice(s).search(i)){var _,v=c;for(i.global||(i=xi(i.source,J(sf.exec(i))+"g")),i.lastIndex=0;_=i.exec(v);)var w=_.index;c=c.slice(0,w===f?s:w)}}else if(n.indexOf(En(i),s)!=s){var m=c.lastIndexOf(i);m>-1&&(c=c.slice(0,m))}return c+t}function Qv(n){return n=J(n),n&&ol.test(n)?n.replace(ff,Ic):n}var Vv=Ge(function(n,e,r){return n+(r?" ":"")+e.toUpperCase()}),au=Fo("toUpperCase");function Pa(n,e,r){return n=J(n),e=r?f:e,e===f?yc(n)?Tc(n):cc(n):n.match(e)||[]}var Wa=$(function(n,e){try{return On(n,f,e)}catch(r){return iu(r)?r:new W(r)}}),kv=re(function(n,e){return Fn(e,function(r){r=Qn(r),ne(n,r,ru(n[r],n))}),n});function jv(n){var e=n==null?0:n.length,r=O();return n=e?tn(n,function(t){if(typeof t[1]!="function")throw new qn(y);return[r(t[0]),t[1]]}):[],$(function(t){for(var i=-1;++ioe)return[];var r=Yn,t=wn(n,Yn);e=O(e),n-=Yn;for(var i=wi(t,e);++r0||e<0)?new z(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),e!==f&&(e=U(e),r=e<0?r.dropRight(-e):r.take(e-n)),r)},z.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},z.prototype.toArray=function(){return this.take(Yn)},Xn(z.prototype,function(n,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),t=/^(?:head|last)$/.test(e),i=u[t?"take"+(e=="last"?"Right":""):e],o=t||/^find/.test(e);i&&(u.prototype[e]=function(){var a=this.__wrapped__,s=t?[1]:arguments,c=a instanceof z,_=s[0],v=c||F(a),w=function(G){var K=i.apply(u,se([G],s));return t&&m?K[0]:K};v&&r&&typeof _=="function"&&_.length!=1&&(c=v=!1);var m=this.__chain__,b=!!this.__actions__.length,T=o&&!m,D=c&&!b;if(!o&&v){a=D?a:new z(this);var E=n.apply(a,s);return E.__actions__.push({func:tt,args:[w],thisArg:f}),new Mn(E,m)}return T&&D?n.apply(this,s):(E=this.thru(w),T?t?E.value()[0]:E.value():E)})}),Fn(["pop","push","shift","sort","splice","unshift"],function(n){var e=Er[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",t=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(t&&!this.__chain__){var o=this.value();return e.apply(F(o)?o:[],i)}return this[r](function(a){return e.apply(F(a)?a:[],i)})}}),Xn(z.prototype,function(n,e){var r=u[e];if(r){var t=r.name+"";V.call(De,t)||(De[t]=[]),De[t].push({name:e,func:r})}}),De[Qr(f,_n).name]=[{name:"wrapper",func:f}],z.prototype.clone=Qc,z.prototype.reverse=Vc,z.prototype.value=kc,u.prototype.at=Op,u.prototype.chain=Tp,u.prototype.commit=Ep,u.prototype.next=Cp,u.prototype.plant=Pp,u.prototype.reverse=Wp,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=Fp,u.prototype.first=u.prototype.head,er&&(u.prototype[er]=Lp),u},Me=Ec();we?((we.exports=Me)._=Me,li._=Me):vn._=Me}).call(Ze)}(_r,_r.exports);var Oe=_r.exports,Ma=function(){},Ba=Ma(),Te=function(h){return h!==Ba&&h!==null},Ua=Te,Da=Array.prototype.forEach,$a=Object.create,Na=function(h,d){var f;for(f in h)d[f]=h[f]},Ga=function(h){var d=$a(null);return Da.call(arguments,function(f){Ua(f)&&Na(Object(f),d)}),d},Ha=function(){var h=Math.sign;return typeof h!="function"?!1:h(10)===1&&h(-20)===-1},ct,_u;function za(){return _u||(_u=1,ct=function(h){return h=Number(h),isNaN(h)||h===0?h:h>0?1:-1}),ct}var Ka=Ha()?Math.sign:za(),Za=Ka,Ya=Math.abs,Xa=Math.floor,Ja=function(h){return isNaN(h)?0:(h=Number(h),h===0||!isFinite(h)?h:Za(h)*Xa(Ya(h)))},Qa=Ja,Va=Math.max,vu=function(h){return Va(0,Qa(h))},du=function(h){if(typeof h!="function")throw new TypeError(h+" is not a function");return h},ka=Te,ht=function(h){if(!ka(h))throw new TypeError("Cannot use null or undefined");return h},ja={exports:{}},gt,wu;function ns(){return wu||(wu=1,gt=function(){var h=Object.assign,d;return typeof h!="function"?!1:(d={foo:"raz"},h(d,{bar:"dwa"},{trzy:"trzy"}),d.foo+d.bar+d.trzy==="razdwatrzy")}),gt}var pt,mu;function es(){return mu||(mu=1,pt=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),pt}var _t,yu;function rs(){if(yu)return _t;yu=1;var h=Te,d=Object.keys;return _t=function(f){return d(h(f)?Object(f):f)},_t}var vt,xu;function ts(){return xu||(xu=1,vt=es()()?Object.keys:rs()),vt}var dt,bu;function is(){if(bu)return dt;bu=1;var h=ts(),d=ht,f=Math.max;return dt=function(C,L){var P,y,A=f(arguments.length,2),S;for(C=Object(d(C)),S=function(R){try{C[R]=L[R]}catch(N){P||(P=N)}},y=1;y-1},Ot}var Tt,qu;function vs(){return qu||(qu=1,Tt=ps()()?String.prototype.contains:_s()),Tt}var Mu;function Ee(){if(Mu)return yt.exports;Mu=1;var h=Tu(),d=gs(),f=Su(),C=Ga,L=vs(),P=yt.exports=function(y,A){var S,R,N,Z,q;return arguments.length<2||typeof y!="string"?(Z=A,A=y,y=null):Z=arguments[2],h(y)?(S=L.call(y,"c"),R=L.call(y,"e"),N=L.call(y,"w")):(S=N=!0,R=!1),q={value:A,configurable:S,enumerable:R,writable:N},Z?f(C(Z),q):q};return P.gs=function(y,A,S){var R,N,Z,q;return typeof y!="string"?(Z=S,S=A,A=y,y=null):Z=arguments[3],h(A)?d(A)?h(S)?d(S)||(Z=S,S=void 0):S=void 0:(Z=A,A=S=void 0):A=void 0,h(y)?(R=L.call(y,"c"),N=L.call(y,"e")):(R=!0,N=!1),q={get:A,set:S,configurable:R,enumerable:N},Z?f(C(Z),q):q},yt.exports}var Et={exports:{}};(function(h,d){var f=Ee(),C=du,L=Function.prototype.apply,P=Function.prototype.call,y=Object.create,A=Object.defineProperty,S=Object.defineProperties,R=Object.prototype.hasOwnProperty,N={configurable:!0,enumerable:!1,writable:!0},Z,q,X,pn,ln,M,_n;Z=function(B,I){var H;return C(I),R.call(this,"__ee__")?H=this.__ee__:(H=N.value=y(null),A(this,"__ee__",N),N.value=null),H[B]?typeof H[B]=="object"?H[B].push(I):H[B]=[H[B],I]:H[B]=I,this},q=function(B,I){var H,Q;return C(I),Q=this,Z.call(this,B,H=function(){X.call(Q,B,H),L.call(I,this,arguments)}),H.__eeOnceListener__=I,this},X=function(B,I){var H,Q,k,en;if(C(I),!R.call(this,"__ee__"))return this;if(H=this.__ee__,!H[B])return this;if(Q=H[B],typeof Q=="object")for(en=0;k=Q[en];++en)(k===I||k.__eeOnceListener__===I)&&(Q.length===2?H[B]=Q[en?0:1]:Q.splice(en,1));else(Q===I||Q.__eeOnceListener__===I)&&delete H[B];return this},pn=function(B){var I,H,Q,k,en;if(R.call(this,"__ee__")&&(k=this.__ee__[B],!!k))if(typeof k=="object"){for(H=arguments.length,en=new Array(H-1),I=1;I=55296&&H<=56319&&(sn+=q[++M])),sn=X?R.call(X,pn,sn,_n):sn,ln?(N.value=sn,Z(B,_n,N)):B[_n]=sn,++_n;I=_n}}if(I===void 0)for(I=C(q.length),ln&&(B=new ln(I)),M=0;Masync d=>{const f=new h,C=await d(f);if("error"in C)throw console.error(C.error),new Error(C.error);return f.terminate(),C.result},Fs=h=>d=>Ws(h)(f=>(f.postMessage(d),new Promise((C,L)=>{f.onmessage=P=>{C(P.data)},f.onerror=P=>{console.error(P),L(P)}}))),qs=h=>async d=>{try{const f=await h(d);postMessage({result:f})}catch(f){postMessage({error:f})}};var Ms=""+new URL("parseTraceSlave.worker-DaoiSWpC.js",self.location.href).href;const{min:Bs}=Math,Us=navigator.hardwareConcurrency??8;class Ds extends Worker{constructor(){super(Ms,{type:"module"})}}const $s=Fs(Ds);async function Ns({trace:h,context:d,view:f="main"}){var y,A;const C=Oe.ceil((((y=h==null?void 0:h.events)==null?void 0:y.length)??0)/Us),L=Oe.range(0,(A=h==null?void 0:h.events)==null?void 0:A.length,C),P=Oe.flatten(await Promise.all(Oe.map(L,S=>{var R;return $s({trace:h,context:d,view:f,from:S,to:Bs(S+C,((R=h==null?void 0:h.events)==null?void 0:R.length)??0)})})));return{stepsPersistent:Oe.flatMap(P,"stepsPersistent"),stepsTransient:Oe.flatMap(P,"stepsTransient")}}onmessage=qs(async({data:h})=>await Ns(h))})(); diff --git a/assets/parseTraceSlave.worker-DaoiSWpC.js b/assets/parseTraceSlave.worker-DaoiSWpC.js new file mode 100644 index 0000000..cc8fbf8 --- /dev/null +++ b/assets/parseTraceSlave.worker-DaoiSWpC.js @@ -0,0 +1,28 @@ +(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vs(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var ds=function(){},_s=ds(),Me=function(o){return o!==_s&&o!==null},ms=Me,ys=Array.prototype.forEach,ws=Object.create,xs=function(o,l){var i;for(i in o)l[i]=o[i]},cf=function(o){var l=ws(null);return ys.call(arguments,function(i){ms(i)&&xs(Object(i),l)}),l},bs=function(){var o=Math.sign;return typeof o!="function"?!1:o(10)===1&&o(-20)===-1},Wr,hf;function Ss(){return hf||(hf=1,Wr=function(o){return o=Number(o),isNaN(o)||o===0?o:o>0?1:-1}),Wr}var As=bs()?Math.sign:Ss(),Os=As,Ts=Math.abs,Is=Math.floor,Rs=function(o){return isNaN(o)?0:(o=Number(o),o===0||!isFinite(o)?o:Os(o)*Is(Ts(o)))},Es=Rs,Ps=Math.max,Fe=function(o){return Ps(0,Es(o))},Cs=Fe,pf=function(o,l,i){var p;return isNaN(o)?(p=l,p>=0?i&&p?p-1:p:1):o===!1?!1:Cs(o)},we=function(o){if(typeof o!="function")throw new TypeError(o+" is not a function");return o},Ls=Me,Qe=function(o){if(!Ls(o))throw new TypeError("Cannot use null or undefined");return o},qs=we,Ms=Qe,Fs=Function.prototype.bind,gf=Function.prototype.call,Ns=Object.keys,$s=Object.prototype.propertyIsEnumerable,Ds=function(o,l){return function(i,p){var y,_=arguments[2],h=arguments[3];return i=Object(Ms(i)),qs(p),y=Ns(i),h&&y.sort(typeof h=="function"?Fs.call(h,i):void 0),typeof o!="function"&&(o=y[o]),gf.call(o,y,function(d,w){return $s.call(i,d)?gf.call(p,_,i[d],d,i,w):l})}},Ft=Ds("forEach"),Ne={},vf={exports:{}},Ws=function(){var o=Object.assign,l;return typeof o!="function"?!1:(l={foo:"raz"},o(l,{bar:"dwa"},{trzy:"trzy"}),l.foo+l.bar+l.trzy==="razdwatrzy")},Br,df;function Bs(){return df||(df=1,Br=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Br}var Ur,_f;function Us(){if(_f)return Ur;_f=1;var o=Me,l=Object.keys;return Ur=function(i){return l(o(i)?Object(i):i)},Ur}var Gr,mf;function Gs(){return mf||(mf=1,Gr=Bs()()?Object.keys:Us()),Gr}var zr,yf;function zs(){if(yf)return zr;yf=1;var o=Gs(),l=Qe,i=Math.max;return zr=function(p,y){var _,h,d=i(arguments.length,2),w;for(p=Object(l(p)),w=function(m){try{p[m]=y[m]}catch(b){_||(_=b)}},h=1;h-1},Zr}var ac=fc()?String.prototype.contains:oc(),$t=Tf,Rf=uc,Ef=wf,Pf=cf,ht=ac,lc=Of.exports=function(o,l){var i,p,y,_,h;return arguments.length<2||typeof o!="string"?(_=l,l=o,o=null):_=arguments[2],$t(o)?(i=ht.call(o,"c"),p=ht.call(o,"e"),y=ht.call(o,"w")):(i=y=!0,p=!1),h={value:l,configurable:i,enumerable:p,writable:y},_?Ef(Pf(_),h):h};lc.gs=function(o,l,i){var p,y,_,h;return typeof o!="string"?(_=i,i=l,l=o,o=null):_=arguments[3],$t(l)?Rf(l)?$t(i)?Rf(i)||(_=i,i=void 0):i=void 0:(_=l,l=i=void 0):l=void 0,$t(o)?(p=ht.call(o,"c"),y=ht.call(o,"e")):(p=!0,y=!1),h={get:l,set:i,configurable:p,enumerable:y},_?Ef(Pf(_),h):h};var $e=Of.exports,Vr={exports:{}};(function(o,l){var i=$e,p=we,y=Function.prototype.apply,_=Function.prototype.call,h=Object.create,d=Object.defineProperty,w=Object.defineProperties,m=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0},q,F,C,D,M,I,P;q=function(L,A){var E;return p(A),m.call(this,"__ee__")?E=this.__ee__:(E=b.value=h(null),d(this,"__ee__",b),b.value=null),E[L]?typeof E[L]=="object"?E[L].push(A):E[L]=[E[L],A]:E[L]=A,this},F=function(L,A){var E,W;return p(A),W=this,q.call(this,L,E=function(){C.call(W,L,E),y.call(A,this,arguments)}),E.__eeOnceListener__=A,this},C=function(L,A){var E,W,U,J;if(p(A),!m.call(this,"__ee__"))return this;if(E=this.__ee__,!E[L])return this;if(W=E[L],typeof W=="object")for(J=0;U=W[J];++J)(U===A||U.__eeOnceListener__===A)&&(W.length===2?E[L]=W[J?0:1]:W.splice(J,1));else(W===A||W.__eeOnceListener__===A)&&delete E[L];return this},D=function(L){var A,E,W,U,J;if(m.call(this,"__ee__")&&(U=this.__ee__[L],!!U))if(typeof U=="object"){for(E=arguments.length,J=new Array(E-1),A=1;A=55296&&E<=56319&&(rn+=F[++I])),rn=C?m.call(C,D,rn,P):rn,M?(b.value=rn,q(L,P,b)):L[P]=rn,++P;A=P}}if(A===void 0)for(A=p(F.length),M&&(L=new M(A)),I=0;I=0?b=h(b):b=l(this.length)-h(_(b)),w=b;w"}},Ci}var Li,xo;function ih(){if(xo)return Li;xo=1;var o=rh(),l=/[\n\r\u2028\u2029]/g;return Li=function(i){var p=o(i);return p.length>100&&(p=p.slice(0,99)+"…"),p=p.replace(l,function(y){return JSON.stringify(y).slice(1,-1)}),p},Li}var Gt={exports:{}},bo;function So(){if(bo)return Gt.exports;bo=1,Gt.exports=o,Gt.exports.default=o;function o(l){return!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function"}return Gt.exports}var Ao;function uh(){if(Ao)return po;Ao=1;var o=so(),l=nh(),i=th(),p=ih(),y=So(),_=Ti(),h=Object.create,d=l("then","then:finally","done","done:finally");return Ne.promise=function(w,m){var b=h(null),q=h(null),F=h(null);if(w===!0)w=null;else if(w=i(w),!d[w])throw new TypeError("'"+p(w)+"' is not valid promise mode");m.on("set",function(C,D,M){var I=!1;if(!y(M)){q[C]=M,m.emit("setasync",C,1);return}b[C]=1,F[C]=M;var P=function(W){var U=b[C];if(I)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) +Consider to rely on 'then' or 'done' mode instead.`);U&&(delete b[C],q[C]=W,m.emit("setasync",C,U))},L=function(){I=!0,b[C]&&(delete b[C],delete F[C],m.delete(C))},A=w;if(A||(A="then"),A==="then"){var E=function(){_(L)};M=M.then(function(W){_(P.bind(this,W))},E),typeof M.finally=="function"&&M.finally(E)}else if(A==="done"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");M.done(P,L)}else if(A==="done:finally"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof M.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");M.done(P),M.finally(L)}}),m.on("get",function(C,D,M){var I;if(b[C]){++b[C];return}I=F[C];var P=function(){m.emit("getasync",C,D,M)};y(I)?typeof I.done=="function"?I.done(P):I.then(function(){_(P)}):P()}),m.on("delete",function(C){if(delete F[C],b[C]){delete b[C];return}if(hasOwnProperty.call(q,C)){var D=q[C];delete q[C],m.emit("deleteasync",C,[D])}}),m.on("clear",function(){var C=q;q=h(null),b=h(null),F=h(null),m.emit("clearasync",o(C,function(D){return[D]}))})},po}var Oo={},To;function fh(){if(To)return Oo;To=1;var o=we,l=Ft,i=Ne,p=Function.prototype.apply;return i.dispose=function(y,_,h){var d;if(o(y),h.async&&i.async||h.promise&&i.promise){_.on("deleteasync",d=function(w,m){p.call(y,null,m)}),_.on("clearasync",function(w){l(w,function(m,b){d(b,m)})});return}_.on("delete",d=function(w,m){y(m)}),_.on("clear",function(w){l(w,function(m,b){d(b,m)})})},Oo}var Io={},qi,Ro;function oh(){return Ro||(Ro=1,qi=2147483647),qi}var Mi,Eo;function ah(){if(Eo)return Mi;Eo=1;var o=Fe,l=oh();return Mi=function(i){if(i=o(i),i>l)throw new TypeError(i+" exceeds maximum possible timeout");return i},Mi}var Po;function lh(){if(Po)return Io;Po=1;var o=ci(),l=Ft,i=Ti(),p=So(),y=ah(),_=Ne,h=Function.prototype,d=Math.max,w=Math.min,m=Object.create;return _.maxAge=function(b,q,F){var C,D,M,I;b=y(b),b&&(C=m(null),D=F.async&&_.async||F.promise&&_.promise?"async":"",q.on("set"+D,function(P){C[P]=setTimeout(function(){q.delete(P)},b),typeof C[P].unref=="function"&&C[P].unref(),I&&(I[P]&&I[P]!=="nextTick"&&clearTimeout(I[P]),I[P]=setTimeout(function(){delete I[P]},M),typeof I[P].unref=="function"&&I[P].unref())}),q.on("delete"+D,function(P){clearTimeout(C[P]),delete C[P],I&&(I[P]!=="nextTick"&&clearTimeout(I[P]),delete I[P])}),F.preFetch&&(F.preFetch===!0||isNaN(F.preFetch)?M=.333:M=d(w(Number(F.preFetch),1),0),M&&(I={},M=(1-M)*b,q.on("get"+D,function(P,L,A){I[P]||(I[P]="nextTick",i(function(){var E;I[P]==="nextTick"&&(delete I[P],q.delete(P),F.async&&(L=o(L),L.push(h)),E=q.memoized.apply(A,L),F.promise&&p(E)&&(typeof E.done=="function"?E.done(h,h):E.then(h,h)))}))}))),q.on("clear"+D,function(){l(C,function(P){clearTimeout(P)}),C={},I&&(l(I,function(P){P!=="nextTick"&&clearTimeout(P)}),I={})}))},Io}var Co={},Fi,Lo;function sh(){if(Lo)return Fi;Lo=1;var o=Fe,l=Object.create,i=Object.prototype.hasOwnProperty;return Fi=function(p){var y=0,_=1,h=l(null),d=l(null),w=0,m;return p=o(p),{hit:function(b){var q=d[b],F=++w;if(h[F]=b,d[b]=F,!q)return++y,y<=p?void 0:(b=h[_],m(b),b);if(delete h[q],_===q)for(;!i.call(h,++_););},delete:m=function(b){var q=d[b];if(q&&(delete h[q],delete d[b],--y,_===q)){if(!y){w=0,_=1;return}for(;!i.call(h,++_););}},clear:function(){y=0,_=1,h=l(null),d=l(null),w=0}}},Fi}var qo;function ch(){if(qo)return Co;qo=1;var o=Fe,l=sh(),i=Ne;return i.max=function(p,y,_){var h,d,w;p=o(p),p&&(d=l(p),h=_.async&&i.async||_.promise&&i.promise?"async":"",y.on("set"+h,w=function(m){m=d.hit(m),m!==void 0&&y.delete(m)}),y.on("get"+h,w),y.on("delete"+h,d.delete),y.on("clear"+h,d.clear))},Co}var Mo={},Fo;function hh(){if(Fo)return Mo;Fo=1;var o=$e,l=Ne,i=Object.create,p=Object.defineProperties;return l.refCounter=function(y,_,h){var d,w;d=i(null),w=h.async&&l.async||h.promise&&l.promise?"async":"",_.on("set"+w,function(m,b){d[m]=b||1}),_.on("get"+w,function(m){++d[m]}),_.on("delete"+w,function(m){delete d[m]}),_.on("clear"+w,function(){d={}}),p(_.memoized,{deleteRef:o(function(){var m=_.get(arguments);return m===null||!d[m]?null:--d[m]?!1:(_.delete(m),!0)}),getRefCount:o(function(){var m=_.get(arguments);return m===null||!d[m]?0:d[m]})})},Mo}var ph=cf,gh=pf,vh=Hc,dh=function(o){var l=ph(arguments[1]),i;return l.normalizer||(i=l.length=gh(l.length,o.length,l.async),i!==0&&(l.primitive?i===!1?l.normalizer=Kc():i>1&&(l.normalizer=Zc()(i)):i===!1?l.normalizer=Xc()():i===1?l.normalizer=Jc()():l.normalizer=jc()(i))),l.async&&kc(),l.promise&&uh(),l.dispose&&fh(),l.maxAge&&lh(),l.max&&ch(),l.refCounter&&hh(),vh(o,l)},_h=vs(dh);const mh=o=>async l=>{try{const i=await o(l);postMessage({result:i})}catch(i){postMessage({error:i})}};var zt={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 + */zt.exports,function(o,l){(function(){var i,p="4.17.21",y=200,_="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",h="Expected a function",d="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",m=500,b="__lodash_placeholder__",q=1,F=2,C=4,D=1,M=2,I=1,P=2,L=4,A=8,E=16,W=32,U=64,J=128,rn=256,Pn=512,gt=30,Kt="...",Wi=800,Zt=16,vt=1,Bi=2,Ui=3,Nn=1/0,wn=9007199254740991,De=17976931348623157e292,ae=NaN,$n=4294967295,Gi=$n-1,Vt=$n>>>1,Yt=[["ary",J],["bind",I],["bindKey",P],["curry",A],["curryRight",E],["flip",Pn],["partial",W],["partialRight",U],["rearg",rn]],le="[object Arguments]",xe="[object Array]",dt="[object AsyncFunction]",se="[object Boolean]",be="[object Date]",un="[object DOMException]",ie="[object Error]",xn="[object Function]",Se="[object GeneratorFunction]",dn="[object Map]",Cn="[object Number]",Ae="[object Null]",Hn="[object Object]",_t="[object Promise]",Qt="[object Proxy]",an="[object RegExp]",_n="[object Set]",kn="[object String]",Xt="[object Symbol]",Rh="[object Undefined]",mt="[object WeakMap]",Eh="[object WeakSet]",yt="[object ArrayBuffer]",Je="[object DataView]",zi="[object Float32Array]",Hi="[object Float64Array]",Ki="[object Int8Array]",Zi="[object Int16Array]",Vi="[object Int32Array]",Yi="[object Uint8Array]",Qi="[object Uint8ClampedArray]",Xi="[object Uint16Array]",Ji="[object Uint32Array]",Ph=/\b__p \+= '';/g,Ch=/\b(__p \+=) '' \+/g,Lh=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Bo=/&(?:amp|lt|gt|quot|#39);/g,Uo=/[&<>"']/g,qh=RegExp(Bo.source),Mh=RegExp(Uo.source),Fh=/<%-([\s\S]+?)%>/g,Nh=/<%([\s\S]+?)%>/g,Go=/<%=([\s\S]+?)%>/g,$h=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dh=/^\w*$/,Wh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ji=/[\\^$.*+?()[\]{}|]/g,Bh=RegExp(ji.source),ki=/^\s+/,Uh=/\s/,Gh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,zh=/\{\n\/\* \[wrapped with (.+)\] \*/,Hh=/,? & /,Kh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Zh=/[()=,{}\[\]\/\s]/,Vh=/\\(\\)?/g,Yh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zo=/\w*$/,Qh=/^[-+]0x[0-9a-f]+$/i,Xh=/^0b[01]+$/i,Jh=/^\[object .+?Constructor\]$/,jh=/^0o[0-7]+$/i,kh=/^(?:0|[1-9]\d*)$/,np=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jt=/($^)/,ep=/['\n\r\u2028\u2029\\]/g,jt="\\ud800-\\udfff",tp="\\u0300-\\u036f",rp="\\ufe20-\\ufe2f",ip="\\u20d0-\\u20ff",Ho=tp+rp+ip,Ko="\\u2700-\\u27bf",Zo="a-z\\xdf-\\xf6\\xf8-\\xff",up="\\xac\\xb1\\xd7\\xf7",fp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",op="\\u2000-\\u206f",ap=" \\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",Vo="A-Z\\xc0-\\xd6\\xd8-\\xde",Yo="\\ufe0e\\ufe0f",Qo=up+fp+op+ap,nu="['’]",lp="["+jt+"]",Xo="["+Qo+"]",kt="["+Ho+"]",Jo="\\d+",sp="["+Ko+"]",jo="["+Zo+"]",ko="[^"+jt+Qo+Jo+Ko+Zo+Vo+"]",eu="\\ud83c[\\udffb-\\udfff]",cp="(?:"+kt+"|"+eu+")",na="[^"+jt+"]",tu="(?:\\ud83c[\\udde6-\\uddff]){2}",ru="[\\ud800-\\udbff][\\udc00-\\udfff]",je="["+Vo+"]",ea="\\u200d",ta="(?:"+jo+"|"+ko+")",hp="(?:"+je+"|"+ko+")",ra="(?:"+nu+"(?:d|ll|m|re|s|t|ve))?",ia="(?:"+nu+"(?:D|LL|M|RE|S|T|VE))?",ua=cp+"?",fa="["+Yo+"]?",pp="(?:"+ea+"(?:"+[na,tu,ru].join("|")+")"+fa+ua+")*",gp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",oa=fa+ua+pp,dp="(?:"+[sp,tu,ru].join("|")+")"+oa,_p="(?:"+[na+kt+"?",kt,tu,ru,lp].join("|")+")",mp=RegExp(nu,"g"),yp=RegExp(kt,"g"),iu=RegExp(eu+"(?="+eu+")|"+_p+oa,"g"),wp=RegExp([je+"?"+jo+"+"+ra+"(?="+[Xo,je,"$"].join("|")+")",hp+"+"+ia+"(?="+[Xo,je+ta,"$"].join("|")+")",je+"?"+ta+"+"+ra,je+"+"+ia,vp,gp,Jo,dp].join("|"),"g"),xp=RegExp("["+ea+jt+Ho+Yo+"]"),bp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sp=["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"],Ap=-1,ln={};ln[zi]=ln[Hi]=ln[Ki]=ln[Zi]=ln[Vi]=ln[Yi]=ln[Qi]=ln[Xi]=ln[Ji]=!0,ln[le]=ln[xe]=ln[yt]=ln[se]=ln[Je]=ln[be]=ln[ie]=ln[xn]=ln[dn]=ln[Cn]=ln[Hn]=ln[an]=ln[_n]=ln[kn]=ln[mt]=!1;var on={};on[le]=on[xe]=on[yt]=on[Je]=on[se]=on[be]=on[zi]=on[Hi]=on[Ki]=on[Zi]=on[Vi]=on[dn]=on[Cn]=on[Hn]=on[an]=on[_n]=on[kn]=on[Xt]=on[Yi]=on[Qi]=on[Xi]=on[Ji]=!0,on[ie]=on[xn]=on[mt]=!1;var Op={À:"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"},Tp={"&":"&","<":"<",">":">",'"':""","'":"'"},Ip={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ep=parseFloat,Pp=parseInt,aa=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,Cp=typeof self=="object"&&self&&self.Object===Object&&self,Sn=aa||Cp||Function("return this")(),uu=l&&!l.nodeType&&l,We=uu&&!0&&o&&!o.nodeType&&o,la=We&&We.exports===uu,fu=la&&aa.process,Kn=function(){try{var g=We&&We.require&&We.require("util").types;return g||fu&&fu.binding&&fu.binding("util")}catch{}}(),sa=Kn&&Kn.isArrayBuffer,ca=Kn&&Kn.isDate,ha=Kn&&Kn.isMap,pa=Kn&&Kn.isRegExp,ga=Kn&&Kn.isSet,va=Kn&&Kn.isTypedArray;function Dn(g,S,x){switch(x.length){case 0:return g.call(S);case 1:return g.call(S,x[0]);case 2:return g.call(S,x[0],x[1]);case 3:return g.call(S,x[0],x[1],x[2])}return g.apply(S,x)}function Lp(g,S,x,$){for(var K=-1,nn=g==null?0:g.length;++K-1}function ou(g,S,x){for(var $=-1,K=g==null?0:g.length;++$-1;);return x}function Sa(g,S){for(var x=g.length;x--&&ke(S,g[x],0)>-1;);return x}function Up(g,S){for(var x=g.length,$=0;x--;)g[x]===S&&++$;return $}var Gp=cu(Op),zp=cu(Tp);function Hp(g){return"\\"+Rp[g]}function Kp(g,S){return g==null?i:g[S]}function nt(g){return xp.test(g)}function Zp(g){return bp.test(g)}function Vp(g){for(var S,x=[];!(S=g.next()).done;)x.push(S.value);return x}function vu(g){var S=-1,x=Array(g.size);return g.forEach(function($,K){x[++S]=[K,$]}),x}function Aa(g,S){return function(x){return g(S(x))}}function Ie(g,S){for(var x=-1,$=g.length,K=0,nn=[];++x<$;){var mn=g[x];(mn===S||mn===b)&&(g[x]=b,nn[K++]=x)}return nn}function tr(g){var S=-1,x=Array(g.size);return g.forEach(function($){x[++S]=$}),x}function Yp(g){var S=-1,x=Array(g.size);return g.forEach(function($){x[++S]=[$,$]}),x}function Qp(g,S,x){for(var $=x-1,K=g.length;++$-1}function Mg(n,e){var t=this.__data__,r=_r(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}ce.prototype.clear=Pg,ce.prototype.delete=Cg,ce.prototype.get=Lg,ce.prototype.has=qg,ce.prototype.set=Mg;function he(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Qn(n,e,t,r,u,a){var s,c=e&q,v=e&F,O=e&C;if(t&&(s=u?t(n,r,u,a):t(n)),s!==i)return s;if(!hn(n))return n;var T=Z(n);if(T){if(s=Dv(n),!c)return Ln(n,s)}else{var R=Tn(n),N=R==xn||R==Se;if(qe(n))return fl(n,c);if(R==Hn||R==le||N&&!u){if(s=v||N?{}:Ol(n),!c)return v?Iv(n,Xg(s,n)):Tv(n,Na(s,n))}else{if(!on[R])return u?n:{};s=Wv(n,R,c)}}a||(a=new ee);var B=a.get(n);if(B)return B;a.set(n,s),ns(n)?n.forEach(function(H){s.add(Qn(H,e,t,H,n,a))}):jl(n)&&n.forEach(function(H,X){s.set(X,Qn(H,e,t,X,n,a))});var z=O?v?Uu:Bu:v?Mn:bn,Y=T?i:z(n);return Zn(Y||n,function(H,X){Y&&(X=H,H=n[X]),Tt(s,X,Qn(H,e,t,X,n,a))}),s}function Jg(n){var e=bn(n);return function(t){return $a(t,n,e)}}function $a(n,e,t){var r=t.length;if(n==null)return!r;for(n=fn(n);r--;){var u=t[r],a=e[u],s=n[u];if(s===i&&!(u in n)||!a(s))return!1}return!0}function Da(n,e,t){if(typeof n!="function")throw new Vn(h);return qt(function(){n.apply(i,t)},e)}function It(n,e,t,r){var u=-1,a=nr,s=!0,c=n.length,v=[],O=e.length;if(!c)return v;t&&(e=sn(e,Wn(t))),r?(a=ou,s=!1):e.length>=y&&(a=wt,s=!1,e=new Ge(e));n:for(;++uu?0:u+t),r=r===i||r>u?u:V(r),r<0&&(r+=u),r=t>r?0:ts(r);t0&&t(c)?e>1?An(c,e-1,t,r,u):Te(u,c):r||(u[u.length]=c)}return u}var bu=hl(),Ua=hl(!0);function ue(n,e){return n&&bu(n,e,bn)}function Su(n,e){return n&&Ua(n,e,bn)}function yr(n,e){return Oe(e,function(t){return _e(n[t])})}function He(n,e){e=Ce(e,n);for(var t=0,r=e.length;n!=null&&te}function nv(n,e){return n!=null&&tn.call(n,e)}function ev(n,e){return n!=null&&e in fn(n)}function tv(n,e,t){return n>=On(e,t)&&n=120&&T.length>=120)?new Ge(s&&T):i}T=n[0];var R=-1,N=c[0];n:for(;++R-1;)c!==n&&sr.call(c,v,1),sr.call(n,v,1);return n}function ja(n,e){for(var t=n?e.length:0,r=t-1;t--;){var u=e[t];if(t==r||u!==a){var a=u;de(u)?sr.call(n,u,1):qu(n,u)}}return n}function Pu(n,e){return n+pr(La()*(e-n+1))}function vv(n,e,t,r){for(var u=-1,a=yn(hr((e-n)/(t||1)),0),s=x(a);a--;)s[r?a:++u]=n,n+=t;return s}function Cu(n,e){var t="";if(!n||e<1||e>wn)return t;do e%2&&(t+=n),e=pr(e/2),e&&(n+=n);while(e);return t}function Q(n,e){return Yu(Rl(n,e,Fn),n+"")}function dv(n){return Fa(ct(n))}function _v(n,e){var t=ct(n);return Pr(t,ze(e,0,t.length))}function Pt(n,e,t,r){if(!hn(n))return n;e=Ce(e,n);for(var u=-1,a=e.length,s=a-1,c=n;c!=null&&++uu?0:u+e),t=t>u?u:t,t<0&&(t+=u),u=e>t?0:t-e>>>0,e>>>=0;for(var a=x(u);++r>>1,s=n[a];s!==null&&!Un(s)&&(t?s<=e:s=y){var O=e?null:Cv(n);if(O)return tr(O);s=!1,u=wt,v=new Ge}else v=e?[]:c;n:for(;++r=r?n:Xn(n,e,t)}var ul=ag||function(n){return Sn.clearTimeout(n)};function fl(n,e){if(e)return n.slice();var t=n.length,r=Ia?Ia(t):new n.constructor(t);return n.copy(r),r}function $u(n){var e=new n.constructor(n.byteLength);return new ar(e).set(new ar(n)),e}function bv(n,e){var t=e?$u(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Sv(n){var e=new n.constructor(n.source,zo.exec(n));return e.lastIndex=n.lastIndex,e}function Av(n){return Ot?fn(Ot.call(n)):{}}function ol(n,e){var t=e?$u(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function al(n,e){if(n!==e){var t=n!==i,r=n===null,u=n===n,a=Un(n),s=e!==i,c=e===null,v=e===e,O=Un(e);if(!c&&!O&&!a&&n>e||a&&s&&v&&!c&&!O||r&&s&&v||!t&&v||!u)return 1;if(!r&&!a&&!O&&n=c)return v;var O=t[r];return v*(O=="desc"?-1:1)}}return n.index-e.index}function ll(n,e,t,r){for(var u=-1,a=n.length,s=t.length,c=-1,v=e.length,O=yn(a-s,0),T=x(v+O),R=!r;++c1?t[u-1]:i,s=u>2?t[2]:i;for(a=n.length>3&&typeof a=="function"?(u--,a):i,s&&Rn(t[0],t[1],s)&&(a=u<3?i:a,u=1),e=fn(e);++r-1?u[a?e[s]:s]:i}}function vl(n){return ve(function(e){var t=e.length,r=t,u=Yn.prototype.thru;for(n&&e.reverse();r--;){var a=e[r];if(typeof a!="function")throw new Vn(h);if(u&&!s&&Rr(a)=="wrapper")var s=new Yn([],!0)}for(r=s?r:t;++r1&&k.reverse(),T&&vc))return!1;var O=a.get(n),T=a.get(e);if(O&&T)return O==e&&T==n;var R=-1,N=!0,B=t&M?new Ge:i;for(a.set(n,e),a.set(e,n);++R1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(Gh,`{ +/* [wrapped with `+e+`] */ +`)}function Uv(n){return Z(n)||Ve(n)||!!(Pa&&n&&n[Pa])}function de(n,e){var t=typeof n;return e=e??wn,!!e&&(t=="number"||t!="symbol"&&kh.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Wi)return arguments[0]}else e=0;return n.apply(i,arguments)}}function Pr(n,e){var t=-1,r=n.length,u=r-1;for(e=e===i?r:e;++t1?n[e-1]:i;return t=typeof t=="function"?(n.pop(),t):i,Bl(n,t)});function Ul(n){var e=f(n);return e.__chain__=!0,e}function jd(n,e){return e(n),n}function Cr(n,e){return e(n)}var kd=ve(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,u=function(a){return xu(a,n)};return e>1||this.__actions__.length||!(r instanceof j)||!de(t)?this.thru(u):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:Cr,args:[u],thisArg:i}),new Yn(r,this.__chain__).thru(function(a){return e&&!a.length&&a.push(i),a}))});function n_(){return Ul(this)}function e_(){return new Yn(this.value(),this.__chain__)}function t_(){this.__values__===i&&(this.__values__=es(this.value()));var n=this.__index__>=this.__values__.length,e=n?i:this.__values__[this.__index__++];return{done:n,value:e}}function r_(){return this}function i_(n){for(var e,t=this;t instanceof dr;){var r=Ml(t);r.__index__=0,r.__values__=i,e?u.__wrapped__=r:e=r;var u=r;t=t.__wrapped__}return u.__wrapped__=n,e}function u_(){var n=this.__wrapped__;if(n instanceof j){var e=n;return this.__actions__.length&&(e=new j(this)),e=e.reverse(),e.__actions__.push({func:Cr,args:[Qu],thisArg:i}),new Yn(e,this.__chain__)}return this.thru(Qu)}function f_(){return rl(this.__wrapped__,this.__actions__)}var o_=Sr(function(n,e,t){tn.call(n,t)?++n[t]:pe(n,t,1)});function a_(n,e,t){var r=Z(n)?da:jg;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}function l_(n,e){var t=Z(n)?Oe:Ba;return t(n,G(e,3))}var s_=gl(Fl),c_=gl(Nl);function h_(n,e){return An(Lr(n,e),1)}function p_(n,e){return An(Lr(n,e),Nn)}function g_(n,e,t){return t=t===i?1:V(t),An(Lr(n,e),t)}function Gl(n,e){var t=Z(n)?Zn:Ee;return t(n,G(e,3))}function zl(n,e){var t=Z(n)?qp:Wa;return t(n,G(e,3))}var v_=Sr(function(n,e,t){tn.call(n,t)?n[t].push(e):pe(n,t,[e])});function d_(n,e,t,r){n=qn(n)?n:ct(n),t=t&&!r?V(t):0;var u=n.length;return t<0&&(t=yn(u+t,0)),$r(n)?t<=u&&n.indexOf(e,t)>-1:!!u&&ke(n,e,t)>-1}var __=Q(function(n,e,t){var r=-1,u=typeof e=="function",a=qn(n)?x(n.length):[];return Ee(n,function(s){a[++r]=u?Dn(e,s,t):Rt(s,e,t)}),a}),m_=Sr(function(n,e,t){pe(n,t,e)});function Lr(n,e){var t=Z(n)?sn:Za;return t(n,G(e,3))}function y_(n,e,t,r){return n==null?[]:(Z(e)||(e=e==null?[]:[e]),t=r?i:t,Z(t)||(t=t==null?[]:[t]),Xa(n,e,t))}var w_=Sr(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function x_(n,e,t){var r=Z(n)?au:wa,u=arguments.length<3;return r(n,G(e,4),t,u,Ee)}function b_(n,e,t){var r=Z(n)?Mp:wa,u=arguments.length<3;return r(n,G(e,4),t,u,Wa)}function S_(n,e){var t=Z(n)?Oe:Ba;return t(n,Fr(G(e,3)))}function A_(n){var e=Z(n)?Fa:dv;return e(n)}function O_(n,e,t){(t?Rn(n,e,t):e===i)?e=1:e=V(e);var r=Z(n)?Vg:_v;return r(n,e)}function T_(n){var e=Z(n)?Yg:yv;return e(n)}function I_(n){if(n==null)return 0;if(qn(n))return $r(n)?et(n):n.length;var e=Tn(n);return e==dn||e==_n?n.size:Iu(n).length}function R_(n,e,t){var r=Z(n)?lu:wv;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}var E_=Q(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Rn(n,e[0],e[1])?e=[]:t>2&&Rn(e[0],e[1],e[2])&&(e=[e[0]]),Xa(n,An(e,1),[])}),qr=lg||function(){return Sn.Date.now()};function P_(n,e){if(typeof e!="function")throw new Vn(h);return n=V(n),function(){if(--n<1)return e.apply(this,arguments)}}function Hl(n,e,t){return e=t?i:e,e=n&&e==null?n.length:e,ge(n,J,i,i,i,i,e)}function Kl(n,e){var t;if(typeof e!="function")throw new Vn(h);return n=V(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=i),t}}var Ju=Q(function(n,e,t){var r=I;if(t.length){var u=Ie(t,lt(Ju));r|=W}return ge(n,r,e,t,u)}),Zl=Q(function(n,e,t){var r=I|P;if(t.length){var u=Ie(t,lt(Zl));r|=W}return ge(e,r,n,t,u)});function Vl(n,e,t){e=t?i:e;var r=ge(n,A,i,i,i,i,i,e);return r.placeholder=Vl.placeholder,r}function Yl(n,e,t){e=t?i:e;var r=ge(n,E,i,i,i,i,i,e);return r.placeholder=Yl.placeholder,r}function Ql(n,e,t){var r,u,a,s,c,v,O=0,T=!1,R=!1,N=!0;if(typeof n!="function")throw new Vn(h);e=jn(e)||0,hn(t)&&(T=!!t.leading,R="maxWait"in t,a=R?yn(jn(t.maxWait)||0,e):a,N="trailing"in t?!!t.trailing:N);function B(vn){var re=r,ye=u;return r=u=i,O=vn,s=n.apply(ye,re),s}function z(vn){return O=vn,c=qt(X,e),T?B(vn):s}function Y(vn){var re=vn-v,ye=vn-O,gs=e-re;return R?On(gs,a-ye):gs}function H(vn){var re=vn-v,ye=vn-O;return v===i||re>=e||re<0||R&&ye>=a}function X(){var vn=qr();if(H(vn))return k(vn);c=qt(X,Y(vn))}function k(vn){return c=i,N&&r?B(vn):(r=u=i,s)}function Gn(){c!==i&&ul(c),O=0,r=v=u=c=i}function En(){return c===i?s:k(qr())}function zn(){var vn=qr(),re=H(vn);if(r=arguments,u=this,v=vn,re){if(c===i)return z(v);if(R)return ul(c),c=qt(X,e),B(v)}return c===i&&(c=qt(X,e)),s}return zn.cancel=Gn,zn.flush=En,zn}var C_=Q(function(n,e){return Da(n,1,e)}),L_=Q(function(n,e,t){return Da(n,jn(e)||0,t)});function q_(n){return ge(n,Pn)}function Mr(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Vn(h);var t=function(){var r=arguments,u=e?e.apply(this,r):r[0],a=t.cache;if(a.has(u))return a.get(u);var s=n.apply(this,r);return t.cache=a.set(u,s)||a,s};return t.cache=new(Mr.Cache||he),t}Mr.Cache=he;function Fr(n){if(typeof n!="function")throw new Vn(h);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function M_(n){return Kl(2,n)}var F_=xv(function(n,e){e=e.length==1&&Z(e[0])?sn(e[0],Wn(G())):sn(An(e,1),Wn(G()));var t=e.length;return Q(function(r){for(var u=-1,a=On(r.length,t);++u=e}),Ve=za(function(){return arguments}())?za:function(n){return pn(n)&&tn.call(n,"callee")&&!Ea.call(n,"callee")},Z=x.isArray,X_=sa?Wn(sa):iv;function qn(n){return n!=null&&Nr(n.length)&&!_e(n)}function gn(n){return pn(n)&&qn(n)}function J_(n){return n===!0||n===!1||pn(n)&&In(n)==se}var qe=cg||sf,j_=ca?Wn(ca):uv;function k_(n){return pn(n)&&n.nodeType===1&&!Mt(n)}function n0(n){if(n==null)return!0;if(qn(n)&&(Z(n)||typeof n=="string"||typeof n.splice=="function"||qe(n)||st(n)||Ve(n)))return!n.length;var e=Tn(n);if(e==dn||e==_n)return!n.size;if(Lt(n))return!Iu(n).length;for(var t in n)if(tn.call(n,t))return!1;return!0}function e0(n,e){return Et(n,e)}function t0(n,e,t){t=typeof t=="function"?t:i;var r=t?t(n,e):i;return r===i?Et(n,e,i,t):!!r}function ku(n){if(!pn(n))return!1;var e=In(n);return e==ie||e==un||typeof n.message=="string"&&typeof n.name=="string"&&!Mt(n)}function r0(n){return typeof n=="number"&&Ca(n)}function _e(n){if(!hn(n))return!1;var e=In(n);return e==xn||e==Se||e==dt||e==Qt}function Jl(n){return typeof n=="number"&&n==V(n)}function Nr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wn}function hn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function pn(n){return n!=null&&typeof n=="object"}var jl=ha?Wn(ha):ov;function i0(n,e){return n===e||Tu(n,e,zu(e))}function u0(n,e,t){return t=typeof t=="function"?t:i,Tu(n,e,zu(e),t)}function f0(n){return kl(n)&&n!=+n}function o0(n){if(Hv(n))throw new K(_);return Ha(n)}function a0(n){return n===null}function l0(n){return n==null}function kl(n){return typeof n=="number"||pn(n)&&In(n)==Cn}function Mt(n){if(!pn(n)||In(n)!=Hn)return!1;var e=lr(n);if(e===null)return!0;var t=tn.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ur.call(t)==ug}var nf=pa?Wn(pa):av;function s0(n){return Jl(n)&&n>=-wn&&n<=wn}var ns=ga?Wn(ga):lv;function $r(n){return typeof n=="string"||!Z(n)&&pn(n)&&In(n)==kn}function Un(n){return typeof n=="symbol"||pn(n)&&In(n)==Xt}var st=va?Wn(va):sv;function c0(n){return n===i}function h0(n){return pn(n)&&Tn(n)==mt}function p0(n){return pn(n)&&In(n)==Eh}var g0=Ir(Ru),v0=Ir(function(n,e){return n<=e});function es(n){if(!n)return[];if(qn(n))return $r(n)?ne(n):Ln(n);if(xt&&n[xt])return Vp(n[xt]());var e=Tn(n),t=e==dn?vu:e==_n?tr:ct;return t(n)}function me(n){if(!n)return n===0?n:0;if(n=jn(n),n===Nn||n===-Nn){var e=n<0?-1:1;return e*De}return n===n?n:0}function V(n){var e=me(n),t=e%1;return e===e?t?e-t:e:0}function ts(n){return n?ze(V(n),0,$n):0}function jn(n){if(typeof n=="number")return n;if(Un(n))return ae;if(hn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=hn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=xa(n);var t=Xh.test(n);return t||jh.test(n)?Pp(n.slice(2),t?2:8):Qh.test(n)?ae:+n}function rs(n){return fe(n,Mn(n))}function d0(n){return n?ze(V(n),-wn,wn):n===0?n:0}function en(n){return n==null?"":Bn(n)}var _0=ot(function(n,e){if(Lt(e)||qn(e)){fe(e,bn(e),n);return}for(var t in e)tn.call(e,t)&&Tt(n,t,e[t])}),is=ot(function(n,e){fe(e,Mn(e),n)}),Dr=ot(function(n,e,t,r){fe(e,Mn(e),n,r)}),m0=ot(function(n,e,t,r){fe(e,bn(e),n,r)}),y0=ve(xu);function w0(n,e){var t=ft(n);return e==null?t:Na(t,e)}var x0=Q(function(n,e){n=fn(n);var t=-1,r=e.length,u=r>2?e[2]:i;for(u&&Rn(e[0],e[1],u)&&(r=1);++t1),a}),fe(n,Uu(n),t),r&&(t=Qn(t,q|F|C,Lv));for(var u=e.length;u--;)qu(t,e[u]);return t});function W0(n,e){return fs(n,Fr(G(e)))}var B0=ve(function(n,e){return n==null?{}:pv(n,e)});function fs(n,e){if(n==null)return{};var t=sn(Uu(n),function(r){return[r]});return e=G(e),Ja(n,t,function(r,u){return e(r,u[0])})}function U0(n,e,t){e=Ce(e,n);var r=-1,u=e.length;for(u||(u=1,n=i);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var u=La();return On(n+u*(e-n+Ep("1e-"+((u+"").length-1))),e)}return Pu(n,e)}var j0=at(function(n,e,t){return e=e.toLowerCase(),n+(t?ls(e):e)});function ls(n){return rf(en(n).toLowerCase())}function ss(n){return n=en(n),n&&n.replace(np,Gp).replace(yp,"")}function k0(n,e,t){n=en(n),e=Bn(e);var r=n.length;t=t===i?r:ze(V(t),0,r);var u=t;return t-=e.length,t>=0&&n.slice(t,u)==e}function n1(n){return n=en(n),n&&Mh.test(n)?n.replace(Uo,zp):n}function e1(n){return n=en(n),n&&Bh.test(n)?n.replace(ji,"\\$&"):n}var t1=at(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),r1=at(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),i1=pl("toLowerCase");function u1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;if(!e||r>=e)return n;var u=(e-r)/2;return Tr(pr(u),t)+n+Tr(hr(u),t)}function f1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;return e&&r>>0,t?(n=en(n),n&&(typeof e=="string"||e!=null&&!nf(e))&&(e=Bn(e),!e&&nt(n))?Le(ne(n),0,t):n.split(e,t)):[]}var p1=at(function(n,e,t){return n+(t?" ":"")+rf(e)});function g1(n,e,t){return n=en(n),t=t==null?0:ze(V(t),0,n.length),e=Bn(e),n.slice(t,t+e.length)==e}function v1(n,e,t){var r=f.templateSettings;t&&Rn(n,e,t)&&(e=i),n=en(n),e=Dr({},e,r,wl);var u=Dr({},e.imports,r.imports,wl),a=bn(u),s=gu(u,a),c,v,O=0,T=e.interpolate||Jt,R="__p += '",N=du((e.escape||Jt).source+"|"+T.source+"|"+(T===Go?Yh:Jt).source+"|"+(e.evaluate||Jt).source+"|$","g"),B="//# sourceURL="+(tn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ap+"]")+` +`;n.replace(N,function(H,X,k,Gn,En,zn){return k||(k=Gn),R+=n.slice(O,zn).replace(ep,Hp),X&&(c=!0,R+=`' + +__e(`+X+`) + +'`),En&&(v=!0,R+=`'; +`+En+`; +__p += '`),k&&(R+=`' + +((__t = (`+k+`)) == null ? '' : __t) + +'`),O=zn+H.length,H}),R+=`'; +`;var z=tn.call(e,"variable")&&e.variable;if(!z)R=`with (obj) { +`+R+` +} +`;else if(Zh.test(z))throw new K(d);R=(v?R.replace(Ph,""):R).replace(Ch,"$1").replace(Lh,"$1;"),R="function("+(z||"obj")+`) { +`+(z?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(c?", __e = _.escape":"")+(v?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+R+`return __p +}`;var Y=hs(function(){return nn(a,B+"return "+R).apply(i,s)});if(Y.source=R,ku(Y))throw Y;return Y}function d1(n){return en(n).toLowerCase()}function _1(n){return en(n).toUpperCase()}function m1(n,e,t){if(n=en(n),n&&(t||e===i))return xa(n);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=ne(e),a=ba(r,u),s=Sa(r,u)+1;return Le(r,a,s).join("")}function y1(n,e,t){if(n=en(n),n&&(t||e===i))return n.slice(0,Oa(n)+1);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Sa(r,ne(e))+1;return Le(r,0,u).join("")}function w1(n,e,t){if(n=en(n),n&&(t||e===i))return n.replace(ki,"");if(!n||!(e=Bn(e)))return n;var r=ne(n),u=ba(r,ne(e));return Le(r,u).join("")}function x1(n,e){var t=gt,r=Kt;if(hn(e)){var u="separator"in e?e.separator:u;t="length"in e?V(e.length):t,r="omission"in e?Bn(e.omission):r}n=en(n);var a=n.length;if(nt(n)){var s=ne(n);a=s.length}if(t>=a)return n;var c=t-et(r);if(c<1)return r;var v=s?Le(s,0,c).join(""):n.slice(0,c);if(u===i)return v+r;if(s&&(c+=v.length-c),nf(u)){if(n.slice(c).search(u)){var O,T=v;for(u.global||(u=du(u.source,en(zo.exec(u))+"g")),u.lastIndex=0;O=u.exec(T);)var R=O.index;v=v.slice(0,R===i?c:R)}}else if(n.indexOf(Bn(u),c)!=c){var N=v.lastIndexOf(u);N>-1&&(v=v.slice(0,N))}return v+r}function b1(n){return n=en(n),n&&qh.test(n)?n.replace(Bo,Jp):n}var S1=at(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),rf=pl("toUpperCase");function cs(n,e,t){return n=en(n),e=t?i:e,e===i?Zp(n)?ng(n):$p(n):n.match(e)||[]}var hs=Q(function(n,e){try{return Dn(n,i,e)}catch(t){return ku(t)?t:new K(t)}}),A1=ve(function(n,e){return Zn(e,function(t){t=oe(t),pe(n,t,Ju(n[t],n))}),n});function O1(n){var e=n==null?0:n.length,t=G();return n=e?sn(n,function(r){if(typeof r[1]!="function")throw new Vn(h);return[t(r[0]),r[1]]}):[],Q(function(r){for(var u=-1;++uwn)return[];var t=$n,r=On(n,$n);e=G(e),n-=$n;for(var u=pu(r,e);++t0||e<0)?new j(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==i&&(e=V(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},j.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},j.prototype.toArray=function(){return this.take($n)},ue(j.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),u=f[r?"take"+(e=="last"?"Right":""):e],a=r||/^find/.test(e);u&&(f.prototype[e]=function(){var s=this.__wrapped__,c=r?[1]:arguments,v=s instanceof j,O=c[0],T=v||Z(s),R=function(X){var k=u.apply(f,Te([X],c));return r&&N?k[0]:k};T&&t&&typeof O=="function"&&O.length!=1&&(v=T=!1);var N=this.__chain__,B=!!this.__actions__.length,z=a&&!N,Y=v&&!B;if(!a&&T){s=Y?s:new j(this);var H=n.apply(s,c);return H.__actions__.push({func:Cr,args:[R],thisArg:i}),new Yn(H,N)}return z&&Y?n.apply(this,c):(H=this.thru(R),z?r?H.value()[0]:H.value():H)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(n){var e=rr[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);f.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(Z(a)?a:[],u)}return this[t](function(s){return e.apply(Z(s)?s:[],u)})}}),ue(j.prototype,function(n,e){var t=f[e];if(t){var r=t.name+"";tn.call(ut,r)||(ut[r]=[]),ut[r].push({name:e,func:t})}}),ut[Ar(i,P).name]=[{name:"wrapper",func:i}],j.prototype.clone=bg,j.prototype.reverse=Sg,j.prototype.value=Ag,f.prototype.at=kd,f.prototype.chain=n_,f.prototype.commit=e_,f.prototype.next=t_,f.prototype.plant=i_,f.prototype.reverse=u_,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=f_,f.prototype.first=f.prototype.head,xt&&(f.prototype[xt]=r_),f},tt=eg();We?((We.exports=tt)._=tt,uu._=tt):Sn._=tt}).call(Ye)}(zt,zt.exports);var cn=zt.exports;function Ni(o={},l){const i={};for(const p of Object.keys(o))i[p]=p==="$"?o[p]:l(o[p],p,o);return Object.setPrototypeOf(i,o)}var No={exports:{}};(function(o,l){(function(i,p){o.exports=p()})(Ye,function(){return function(i){function p(_){if(y[_])return y[_].exports;var h=y[_]={i:_,l:!1,exports:{}};return i[_].call(h.exports,h,h.exports,p),h.l=!0,h.exports}var y={};return p.m=i,p.c=y,p.d=function(_,h,d){p.o(_,h)||Object.defineProperty(_,h,{configurable:!1,enumerable:!0,get:d})},p.n=function(_){var h=_&&_.__esModule?function(){return _.default}:function(){return _};return p.d(h,"a",h),h},p.o=function(_,h){return Object.prototype.hasOwnProperty.call(_,h)},p.p="",p(p.s=1)}([function(i,p,y){function _(d){var w=d===void 0?{}:d,m=w.ESCAPE,b=m===void 0?/^\\/:m,q=w.VARIABLE_START,F=q===void 0?/^\${\s*/:q,C=w.VARIABLE_END,D=C===void 0?/^\s*}/:C,M=w.PIPE_START,I=M===void 0?/^\s*\|\s*/:M,P=w.PIPE_PARAMETER_START,L=P===void 0?/^\s*:\s*/:P,A=w.QUOTED_STRING,E=A===void 0?p.DEFAULT_QUOTED_STRING_REGEX:A,W=w.QUOTED_STRING_TEST,U=W===void 0?null:W,J=w.QUOTED_STRING_GET_AND_ADVANCE,rn=J===void 0?null:J,Pn=w.QUOTED_STRING_IN_PARAMETER_TEST,gt=Pn===void 0?null:Pn,Kt=w.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Wi=Kt===void 0?null:Kt,Zt=U||function(Nn){return E.test(Nn)},vt=rn||h(E),Bi=gt||function(Nn){return E.test(Nn)},Ui=Wi||h(E);return function(Nn){function wn(an){an===void 0&&(an=1),un=un.substr(an)}function De(an){an===void 0&&(an=/^/),wn(un.match(an)[0].length)}function ae(){var an;return De(b),an=un.length>0?un[0]:"",wn(),an}function $n(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;dn={name:"",pipes:[]},Hn=!kn}function Gi(){ie.variables.push(dn),$n({isNull:!0})}function Vt(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Cn={name:"",parameters:[]},_t=!kn}function Yt(){dn.pipes.push(Cn),Vt({isNull:!0})}function le(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Ae="",Qt=!kn}function xe(){Cn.parameters.push(Ae),le({isNull:!0})}function dt(){return!!D.test(un)&&(De(D),xn>=3&&xe(),xn>=2&&Yt(),xn>=1&&Gi(),xn=0,!0)}function se(){return!!I.test(un)&&(De(I),xn>=3&&xe(),xn>=2&&Yt(),xn>=1&&Vt(),xn=2,!0)}function be(){return!!L.test(un)&&(De(L),xn>=3&&xe(),xn>=2&&le(),xn=3,!0)}for(var un=Nn,ie={literals:[],variables:[]},xn=0,Se="",dn={name:"",pipes:[]},Cn={name:"",parameters:[]},Ae="",Hn=!1,_t=!1,Qt=!1;un&&un.length>0;)switch(xn){case 0:if(b.test(un)){Se+=ae();continue}if(F.test(un)){xn=1,$n(),ie.literals.push(Se),Se="",De(F);continue}Se+=un[0],wn();break;case 1:if(b.test(un)){dn.name+=ae();continue}if(dt()||se())continue;if(Zt(un)){dn.name+=vt(un,wn);continue}dn.name+=un[0],wn();break;case 2:if(b.test(un)){Cn.name+=ae();continue}if(dt()||be()||se())continue;if(Zt(un)){Cn.name+=vt(un,wn);continue}Cn.name+=un[0],wn();break;case 3:if(b.test(un)){Ae+=ae();continue}if(dt()||be()||se())continue;if(Bi(un)){Ae+=Ui(un,wn);continue}Ae+=un[0],wn()}return Qt&&Cn.parameters.push(Ae),_t&&dn.pipes.push(Cn),Hn&&ie.variables.push(dn),ie.literals.push(Se),ie}}function h(d){return function(w,m){var b=w.match(d);return m(b[0].length),b.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(p,"__esModule",{value:!0}),p.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,p.parseStringTemplateGenerator=_,p.parseStringTemplate=_(),p.getQuotedStringAndAdvanceForRegex=h},function(i,p,y){i.exports=y(2)},function(i,p,y){function _(h){for(var d in h)p.hasOwnProperty(d)||(p[d]=h[d])}Object.defineProperty(p,"__esModule",{value:!0}),_(y(0)),_(y(3))},function(i,p,y){function _(b){return function(q){return b.hasOwnProperty(q)?b[q]:q.split(".").reduce(function(F,C){return F.hasOwnProperty(C)?F[C]:""},b)}}function h(b,q,F,C){C===void 0&&(C=_(q));var D=C(b.name);return b.pipes.reduce(function(M,I){return F.hasOwnProperty(I.name)?F[I.name](M,I.parameters):M},D??"")}function d(b,q,F,C){return C===void 0&&(C=_(q)),b.literals.length===0?"":b.literals.slice(1).reduce(function(D,M,I){return""+D+h(b.variables[I],q,F,C)+M},b.literals[0])}function w(b,q,F){return d(m.parseStringTemplate(b),q,F)}Object.defineProperty(p,"__esModule",{value:!0});var m=y(0);p.evaluateParsedString=d,p.evaluateStringTemplate=w}])})})(No);var $o=No.exports;const Do=o=>{const l=Function("$",`return ${o};`);return i=>l(new Proxy(Ht(i),{get(p,y){return typeof(p==null?void 0:p[y])=="function"?p[y]({}):p==null?void 0:p[y]}}))},yh=/^\{\{\s*/,wh=/^\s*\}\}/,$i=/\b\B/,xh=$o.parseStringTemplateGenerator({VARIABLE_START:yh,VARIABLE_END:wh,PIPE_START:$i,PIPE_PARAMETER_START:$i,QUOTED_STRING:$i}),bh=_h(o=>{const l=xh(o);return cn.join(l.literals,"")?i=>$o.evaluateParsedString(l,{},{},p=>Do(p)(i)):Do(l.variables[0].name)},{primitive:!0});function Xe(o){switch(o==null?void 0:o.constructor){case Array:{const l=cn.map(o,Xe);return i=>cn.map(l,p=>p(i))}case Object:{const l=cn.mapValues(o,Xe);return i=>cn.mapValues(l,p=>p(i))}case String:return bh(o);default:return()=>o}}function Ht(o={}){return Ni(o,l=>cn.isFunction(l)?l:Xe(l))}function Sh(o={}){return new Proxy(o,{get:(l,i)=>typeof l[i]=="function"?l[i]:()=>l[i]})}function Di(o,l){return Object.setPrototypeOf(Ni(l,i=>p=>i(o)),o)}function Ah(o){const{$for:l,...i}=o;if(l){const{$let:p="i",$from:y=0,$to:_=1,$step:h=1}=l,d=Xe(y),w=Xe(_),m=Xe(h);return(b={})=>cn.range(d(b),w(b),m(b)).map(q=>{const F=Di(b,Ht({[p]:q}));return Di(F,Ht(i))})}else return(p={})=>[Di(p,Ht(i))]}function Oh(o,l){const i=_=>{const{$:h}=_,d=Ah(_);return h in l?w=>cn.flatMap(d(w),m=>cn.flatMap(p[h],b=>b(m))):w=>cn.map(d(w),m=>Object.setPrototypeOf(Ni(m,b=>b(m)),null))},p=cn.mapValues(l,_=>cn.map(_,i)),y=cn.flatMap(o,i);return _=>cn.flatMap(y,h=>h(_))}const Th=o=>o==null,Wo=o=>o.display!=="transient";function Ih({trace:o,context:l,view:i="main",from:p=0,to:y=(_=>(_=o==null?void 0:o.events)==null?void 0:_.length)()??0}){var q,F,C,D;const h=Oh(((C=(F=(q=o==null?void 0:o.render)==null?void 0:q.views)==null?void 0:F[i])==null?void 0:C.components)??[],((D=o==null?void 0:o.render)==null?void 0:D.components)??{}),d=M=>M&&Object.hasOwn(M,"alpha")?M.alpha>0:!0,w=M=>I=>({component:I,meta:{source:"trace",step:p+M,info:I.$info}}),m=cn.chain(o==null?void 0:o.events).map((M,I)=>({step:I,id:M.id,data:M,pId:M.pId})).groupBy("id").value(),b=cn.chain(cn.range(p,y)).map(M=>{var W;const I=o.events[M],P=o.events,L=h(Sh({alpha:1,...l,step:M,parent:Th(I.pId)?void 0:P[((W=cn.findLast(m[I.pId],U=>U.step<=M))==null?void 0:W.step)??0],event:I,events:P})),A=L.filter(Wo),E=L.filter(cn.negate(Wo));return{persistent:A,transient:E}}).map(M=>cn.mapValues(M,I=>I.filter(d))).map((M,I)=>cn.mapValues(M,P=>P.map(w(I)))).value();return{stepsPersistent:cn.map(b,M=>M.persistent),stepsTransient:cn.map(b,M=>M.transient)}}onmessage=mh(async({data:o})=>Ih(o))})(); diff --git a/assets/parseTraceSlave.worker-MM7PTpMM.js b/assets/parseTraceSlave.worker-MM7PTpMM.js deleted file mode 100644 index f8817f2..0000000 --- a/assets/parseTraceSlave.worker-MM7PTpMM.js +++ /dev/null @@ -1,28 +0,0 @@ -(function(){"use strict";var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ws(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var xs=function(){},bs=xs(),Me=function(f){return f!==bs&&f!==null},Ss=Me,As=Array.prototype.forEach,Os=Object.create,Ts=function(f,l){var i;for(i in f)l[i]=f[i]},hf=function(f){var l=Os(null);return As.call(arguments,function(i){Ss(i)&&Ts(Object(i),l)}),l},Is=function(){var f=Math.sign;return typeof f!="function"?!1:f(10)===1&&f(-20)===-1},Dr,pf;function Rs(){return pf||(pf=1,Dr=function(f){return f=Number(f),isNaN(f)||f===0?f:f>0?1:-1}),Dr}var Es=Is()?Math.sign:Rs(),Ps=Es,Cs=Math.abs,Ls=Math.floor,qs=function(f){return isNaN(f)?0:(f=Number(f),f===0||!isFinite(f)?f:Ps(f)*Ls(Cs(f)))},Ms=qs,Fs=Math.max,Fe=function(f){return Fs(0,Ms(f))},Ns=Fe,gf=function(f,l,i){var h;return isNaN(f)?(h=l,h>=0?i&&h?h-1:h:1):f===!1?!1:Ns(f)},we=function(f){if(typeof f!="function")throw new TypeError(f+" is not a function");return f},$s=Me,Qe=function(f){if(!$s(f))throw new TypeError("Cannot use null or undefined");return f},Ds=we,Ws=Qe,Bs=Function.prototype.bind,vf=Function.prototype.call,Us=Object.keys,Gs=Object.prototype.propertyIsEnumerable,zs=function(f,l){return function(i,h){var m,d=arguments[2],g=arguments[3];return i=Object(Ws(i)),Ds(h),m=Us(i),g&&m.sort(typeof g=="function"?Bs.call(g,i):void 0),typeof f!="function"&&(f=m[f]),vf.call(f,m,function(y,w){return Gs.call(i,y)?vf.call(h,d,i[y],y,i,w):l})}},Ft=zs("forEach"),Ne={},df={exports:{}},Hs=function(){var f=Object.assign,l;return typeof f!="function"?!1:(l={foo:"raz"},f(l,{bar:"dwa"},{trzy:"trzy"}),l.foo+l.bar+l.trzy==="razdwatrzy")},Wr,_f;function Ks(){return _f||(_f=1,Wr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Wr}var Br,mf;function Zs(){if(mf)return Br;mf=1;var f=Me,l=Object.keys;return Br=function(i){return l(f(i)?Object(i):i)},Br}var Ur,yf;function Vs(){return yf||(yf=1,Ur=Ks()()?Object.keys:Zs()),Ur}var Gr,wf;function Ys(){if(wf)return Gr;wf=1;var f=Vs(),l=Qe,i=Math.max;return Gr=function(h,m){var d,g,y=i(arguments.length,2),w;for(h=Object(l(h)),w=function(_){try{h[_]=m[_]}catch(b){d||(d=b)}},g=1;g-1},Vr}var pc=cc()?String.prototype.contains:hc(),Nt=Cf,qf=sc,Mf=xf,Ff=hf,ht=pc,gc=Pf.exports=function(f,l){var i,h,m,d,g;return arguments.length<2||typeof f!="string"?(d=l,l=f,f=null):d=arguments[2],Nt(f)?(i=ht.call(f,"c"),h=ht.call(f,"e"),m=ht.call(f,"w")):(i=m=!0,h=!1),g={value:l,configurable:i,enumerable:h,writable:m},d?Mf(Ff(d),g):g};gc.gs=function(f,l,i){var h,m,d,g;return typeof f!="string"?(d=i,i=l,l=f,f=null):d=arguments[3],Nt(l)?qf(l)?Nt(i)?qf(i)||(d=i,i=void 0):i=void 0:(d=l,l=i=void 0):l=void 0,Nt(f)?(h=ht.call(f,"c"),m=ht.call(f,"e")):(h=!0,m=!1),g={get:l,set:i,configurable:h,enumerable:m},d?Mf(Ff(d),g):g};var $e=Pf.exports,Yr={exports:{}};(function(f,l){var i=$e,h=we,m=Function.prototype.apply,d=Function.prototype.call,g=Object.create,y=Object.defineProperty,w=Object.defineProperties,_=Object.prototype.hasOwnProperty,b={configurable:!0,enumerable:!1,writable:!0},q,F,C,D,M,I,P;q=function(L,A){var E;return h(A),_.call(this,"__ee__")?E=this.__ee__:(E=b.value=g(null),y(this,"__ee__",b),b.value=null),E[L]?typeof E[L]=="object"?E[L].push(A):E[L]=[E[L],A]:E[L]=A,this},F=function(L,A){var E,W;return h(A),W=this,q.call(this,L,E=function(){C.call(W,L,E),m.call(A,this,arguments)}),E.__eeOnceListener__=A,this},C=function(L,A){var E,W,U,J;if(h(A),!_.call(this,"__ee__"))return this;if(E=this.__ee__,!E[L])return this;if(W=E[L],typeof W=="object")for(J=0;U=W[J];++J)(U===A||U.__eeOnceListener__===A)&&(W.length===2?E[L]=W[J?0:1]:W.splice(J,1));else(W===A||W.__eeOnceListener__===A)&&delete E[L];return this},D=function(L){var A,E,W,U,J;if(_.call(this,"__ee__")&&(U=this.__ee__[L],!!U))if(typeof U=="object"){for(E=arguments.length,J=new Array(E-1),A=1;A=55296&&E<=56319&&(rn+=F[++I])),rn=C?_.call(C,D,rn,P):rn,M?(b.value=rn,q(L,P,b)):L[P]=rn,++P;A=P}}if(A===void 0)for(A=h(F.length),M&&(L=new M(A)),I=0;I=0?b=g(b):b=l(this.length)-g(d(b)),w=b;w<_;++w)if(m.call(this,w)&&(q=this[w],f(q)))return w;return-1},wi}var bi,so;function eh(){if(so)return bi;so=1;var f=xi(),l=Object.create;return bi=function(){var i=0,h=[],m=l(null);return{get:function(d){var g=0,y=h,w,_=d.length;if(_===0)return y[_]||null;if(y=y[_]){for(;g<_-1;){if(w=f.call(y[0],d[g]),w===-1)return null;y=y[1][w],++g}return w=f.call(y[0],d[g]),w===-1?null:y[1][w]||null}return null},set:function(d){var g=0,y=h,w,_=d.length;if(_===0)y[_]=++i;else{for(y[_]||(y[_]=[[],[]]),y=y[_];g<_-1;)w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1,y[1].push([[],[]])),y=y[1][w],++g;w=f.call(y[0],d[g]),w===-1&&(w=y[0].push(d[g])-1),y[1][w]=++i}return m[i]=d,i},delete:function(d){var g=0,y=h,w,_=m[d],b=_.length,q=[];if(b===0)delete y[b];else if(y=y[b]){for(;g"}},Li}var qi,To;function lh(){if(To)return qi;To=1;var f=ah(),l=/[\n\r\u2028\u2029]/g;return qi=function(i){var h=f(i);return h.length>100&&(h=h.slice(0,99)+"…"),h=h.replace(l,function(m){return JSON.stringify(m).slice(1,-1)}),h},qi}var Ut={exports:{}},Io;function Ro(){if(Io)return Ut.exports;Io=1,Ut.exports=f,Ut.exports.default=f;function f(l){return!!l&&(typeof l=="object"||typeof l=="function")&&typeof l.then=="function"}return Ut.exports}var Eo;function sh(){if(Eo)return yo;Eo=1;var f=vo(),l=uh(),i=oh(),h=lh(),m=Ro(),d=Ii(),g=Object.create,y=l("then","then:finally","done","done:finally");return Ne.promise=function(w,_){var b=g(null),q=g(null),F=g(null);if(w===!0)w=null;else if(w=i(w),!y[w])throw new TypeError("'"+h(w)+"' is not valid promise mode");_.on("set",function(C,D,M){var I=!1;if(!m(M)){q[C]=M,_.emit("setasync",C,1);return}b[C]=1,F[C]=M;var P=function(W){var U=b[C];if(I)throw new Error(`Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in 'done:finally' mode) -Consider to rely on 'then' or 'done' mode instead.`);U&&(delete b[C],q[C]=W,_.emit("setasync",C,U))},L=function(){I=!0,b[C]&&(delete b[C],delete F[C],_.delete(C))},A=w;if(A||(A="then"),A==="then"){var E=function(){d(L)};M=M.then(function(W){d(P.bind(this,W))},E),typeof M.finally=="function"&&M.finally(E)}else if(A==="done"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done' mode");M.done(P,L)}else if(A==="done:finally"){if(typeof M.done!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'done' in 'done:finally' mode");if(typeof M.finally!="function")throw new Error("Memoizee error: Retrieved promise does not implement 'finally' in 'done:finally' mode");M.done(P),M.finally(L)}}),_.on("get",function(C,D,M){var I;if(b[C]){++b[C];return}I=F[C];var P=function(){_.emit("getasync",C,D,M)};m(I)?typeof I.done=="function"?I.done(P):I.then(function(){d(P)}):P()}),_.on("delete",function(C){if(delete F[C],b[C]){delete b[C];return}if(hasOwnProperty.call(q,C)){var D=q[C];delete q[C],_.emit("deleteasync",C,[D])}}),_.on("clear",function(){var C=q;q=g(null),b=g(null),F=g(null),_.emit("clearasync",f(C,function(D){return[D]}))})},yo}var Po={},Co;function ch(){if(Co)return Po;Co=1;var f=we,l=Ft,i=Ne,h=Function.prototype.apply;return i.dispose=function(m,d,g){var y;if(f(m),g.async&&i.async||g.promise&&i.promise){d.on("deleteasync",y=function(w,_){h.call(m,null,_)}),d.on("clearasync",function(w){l(w,function(_,b){y(b,_)})});return}d.on("delete",y=function(w,_){m(_)}),d.on("clear",function(w){l(w,function(_,b){y(b,_)})})},Po}var Lo={},Mi,qo;function hh(){return qo||(qo=1,Mi=2147483647),Mi}var Fi,Mo;function ph(){if(Mo)return Fi;Mo=1;var f=Fe,l=hh();return Fi=function(i){if(i=f(i),i>l)throw new TypeError(i+" exceeds maximum possible timeout");return i},Fi}var Fo;function gh(){if(Fo)return Lo;Fo=1;var f=hi(),l=Ft,i=Ii(),h=Ro(),m=ph(),d=Ne,g=Function.prototype,y=Math.max,w=Math.min,_=Object.create;return d.maxAge=function(b,q,F){var C,D,M,I;b=m(b),b&&(C=_(null),D=F.async&&d.async||F.promise&&d.promise?"async":"",q.on("set"+D,function(P){C[P]=setTimeout(function(){q.delete(P)},b),typeof C[P].unref=="function"&&C[P].unref(),I&&(I[P]&&I[P]!=="nextTick"&&clearTimeout(I[P]),I[P]=setTimeout(function(){delete I[P]},M),typeof I[P].unref=="function"&&I[P].unref())}),q.on("delete"+D,function(P){clearTimeout(C[P]),delete C[P],I&&(I[P]!=="nextTick"&&clearTimeout(I[P]),delete I[P])}),F.preFetch&&(F.preFetch===!0||isNaN(F.preFetch)?M=.333:M=y(w(Number(F.preFetch),1),0),M&&(I={},M=(1-M)*b,q.on("get"+D,function(P,L,A){I[P]||(I[P]="nextTick",i(function(){var E;I[P]==="nextTick"&&(delete I[P],q.delete(P),F.async&&(L=f(L),L.push(g)),E=q.memoized.apply(A,L),F.promise&&h(E)&&(typeof E.done=="function"?E.done(g,g):E.then(g,g)))}))}))),q.on("clear"+D,function(){l(C,function(P){clearTimeout(P)}),C={},I&&(l(I,function(P){P!=="nextTick"&&clearTimeout(P)}),I={})}))},Lo}var No={},Ni,$o;function vh(){if($o)return Ni;$o=1;var f=Fe,l=Object.create,i=Object.prototype.hasOwnProperty;return Ni=function(h){var m=0,d=1,g=l(null),y=l(null),w=0,_;return h=f(h),{hit:function(b){var q=y[b],F=++w;if(g[F]=b,y[b]=F,!q)return++m,m<=h?void 0:(b=g[d],_(b),b);if(delete g[q],d===q)for(;!i.call(g,++d););},delete:_=function(b){var q=y[b];if(q&&(delete g[q],delete y[b],--m,d===q)){if(!m){w=0,d=1;return}for(;!i.call(g,++d););}},clear:function(){m=0,d=1,g=l(null),y=l(null),w=0}}},Ni}var Do;function dh(){if(Do)return No;Do=1;var f=Fe,l=vh(),i=Ne;return i.max=function(h,m,d){var g,y,w;h=f(h),h&&(y=l(h),g=d.async&&i.async||d.promise&&i.promise?"async":"",m.on("set"+g,w=function(_){_=y.hit(_),_!==void 0&&m.delete(_)}),m.on("get"+g,w),m.on("delete"+g,y.delete),m.on("clear"+g,y.clear))},No}var Wo={},Bo;function _h(){if(Bo)return Wo;Bo=1;var f=$e,l=Ne,i=Object.create,h=Object.defineProperties;return l.refCounter=function(m,d,g){var y,w;y=i(null),w=g.async&&l.async||g.promise&&l.promise?"async":"",d.on("set"+w,function(_,b){y[_]=b||1}),d.on("get"+w,function(_){++y[_]}),d.on("delete"+w,function(_){delete y[_]}),d.on("clear"+w,function(){y={}}),h(d.memoized,{deleteRef:f(function(){var _=d.get(arguments);return _===null||!y[_]?null:--y[_]?!1:(d.delete(_),!0)}),getRefCount:f(function(){var _=d.get(arguments);return _===null||!y[_]?0:y[_]})})},Wo}var mh=hf,yh=gf,wh=Qc,xh=function(f){var l=mh(arguments[1]),i;return l.normalizer||(i=l.length=yh(l.length,f.length,l.async),i!==0&&(l.primitive?i===!1?l.normalizer=Xc():i>1&&(l.normalizer=Jc()(i)):i===!1?l.normalizer=eh()():i===1?l.normalizer=th()():l.normalizer=rh()(i))),l.async&&ih(),l.promise&&sh(),l.dispose&&ch(),l.maxAge&&gh(),l.max&&dh(),l.refCounter&&_h(),wh(f,l)},bh=ws(xh);const Sh=f=>async l=>{try{const i=await f(l);postMessage({result:i})}catch(i){postMessage({error:i})}};var Gt={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 - */Gt.exports,function(f,l){(function(){var i,h="4.17.21",m=200,d="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",y="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",_=500,b="__lodash_placeholder__",q=1,F=2,C=4,D=1,M=2,I=1,P=2,L=4,A=8,E=16,W=32,U=64,J=128,rn=256,Pn=512,gt=30,Ht="...",Bi=800,Kt=16,vt=1,Ui=2,Gi=3,Nn=1/0,wn=9007199254740991,De=17976931348623157e292,ae=NaN,$n=4294967295,zi=$n-1,Zt=$n>>>1,Vt=[["ary",J],["bind",I],["bindKey",P],["curry",A],["curryRight",E],["flip",Pn],["partial",W],["partialRight",U],["rearg",rn]],le="[object Arguments]",xe="[object Array]",dt="[object AsyncFunction]",se="[object Boolean]",be="[object Date]",un="[object DOMException]",ie="[object Error]",xn="[object Function]",Se="[object GeneratorFunction]",dn="[object Map]",Cn="[object Number]",Ae="[object Null]",Hn="[object Object]",_t="[object Promise]",Yt="[object Proxy]",an="[object RegExp]",_n="[object Set]",kn="[object String]",Qt="[object Symbol]",qh="[object Undefined]",mt="[object WeakMap]",Mh="[object WeakSet]",yt="[object ArrayBuffer]",Je="[object DataView]",Hi="[object Float32Array]",Ki="[object Float64Array]",Zi="[object Int8Array]",Vi="[object Int16Array]",Yi="[object Int32Array]",Qi="[object Uint8Array]",Xi="[object Uint8ClampedArray]",Ji="[object Uint16Array]",ji="[object Uint32Array]",Fh=/\b__p \+= '';/g,Nh=/\b(__p \+=) '' \+/g,$h=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ko=/&(?:amp|lt|gt|quot|#39);/g,Zo=/[&<>"']/g,Dh=RegExp(Ko.source),Wh=RegExp(Zo.source),Bh=/<%-([\s\S]+?)%>/g,Uh=/<%([\s\S]+?)%>/g,Vo=/<%=([\s\S]+?)%>/g,Gh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zh=/^\w*$/,Hh=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ki=/[\\^$.*+?()[\]{}|]/g,Kh=RegExp(ki.source),nu=/^\s+/,Zh=/\s/,Vh=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yh=/\{\n\/\* \[wrapped with (.+)\] \*/,Qh=/,? & /,Xh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Jh=/[()=,{}\[\]\/\s]/,jh=/\\(\\)?/g,kh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yo=/\w*$/,np=/^[-+]0x[0-9a-f]+$/i,ep=/^0b[01]+$/i,tp=/^\[object .+?Constructor\]$/,rp=/^0o[0-7]+$/i,ip=/^(?:0|[1-9]\d*)$/,up=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,fp=/['\n\r\u2028\u2029\\]/g,Jt="\\ud800-\\udfff",op="\\u0300-\\u036f",ap="\\ufe20-\\ufe2f",lp="\\u20d0-\\u20ff",Qo=op+ap+lp,Xo="\\u2700-\\u27bf",Jo="a-z\\xdf-\\xf6\\xf8-\\xff",sp="\\xac\\xb1\\xd7\\xf7",cp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hp="\\u2000-\\u206f",pp=" \\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",jo="A-Z\\xc0-\\xd6\\xd8-\\xde",ko="\\ufe0e\\ufe0f",na=sp+cp+hp+pp,eu="['’]",gp="["+Jt+"]",ea="["+na+"]",jt="["+Qo+"]",ta="\\d+",vp="["+Xo+"]",ra="["+Jo+"]",ia="[^"+Jt+na+ta+Xo+Jo+jo+"]",tu="\\ud83c[\\udffb-\\udfff]",dp="(?:"+jt+"|"+tu+")",ua="[^"+Jt+"]",ru="(?:\\ud83c[\\udde6-\\uddff]){2}",iu="[\\ud800-\\udbff][\\udc00-\\udfff]",je="["+jo+"]",fa="\\u200d",oa="(?:"+ra+"|"+ia+")",_p="(?:"+je+"|"+ia+")",aa="(?:"+eu+"(?:d|ll|m|re|s|t|ve))?",la="(?:"+eu+"(?:D|LL|M|RE|S|T|VE))?",sa=dp+"?",ca="["+ko+"]?",mp="(?:"+fa+"(?:"+[ua,ru,iu].join("|")+")"+ca+sa+")*",yp="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ha=ca+sa+mp,xp="(?:"+[vp,ru,iu].join("|")+")"+ha,bp="(?:"+[ua+jt+"?",jt,ru,iu,gp].join("|")+")",Sp=RegExp(eu,"g"),Ap=RegExp(jt,"g"),uu=RegExp(tu+"(?="+tu+")|"+bp+ha,"g"),Op=RegExp([je+"?"+ra+"+"+aa+"(?="+[ea,je,"$"].join("|")+")",_p+"+"+la+"(?="+[ea,je+oa,"$"].join("|")+")",je+"?"+oa+"+"+aa,je+"+"+la,wp,yp,ta,xp].join("|"),"g"),Tp=RegExp("["+fa+Jt+Qo+ko+"]"),Ip=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rp=["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"],Ep=-1,ln={};ln[Hi]=ln[Ki]=ln[Zi]=ln[Vi]=ln[Yi]=ln[Qi]=ln[Xi]=ln[Ji]=ln[ji]=!0,ln[le]=ln[xe]=ln[yt]=ln[se]=ln[Je]=ln[be]=ln[ie]=ln[xn]=ln[dn]=ln[Cn]=ln[Hn]=ln[an]=ln[_n]=ln[kn]=ln[mt]=!1;var on={};on[le]=on[xe]=on[yt]=on[Je]=on[se]=on[be]=on[Hi]=on[Ki]=on[Zi]=on[Vi]=on[Yi]=on[dn]=on[Cn]=on[Hn]=on[an]=on[_n]=on[kn]=on[Qt]=on[Qi]=on[Xi]=on[Ji]=on[ji]=!0,on[ie]=on[xn]=on[mt]=!1;var Pp={À:"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"},Cp={"&":"&","<":"<",">":">",'"':""","'":"'"},Lp={"&":"&","<":"<",">":">",""":'"',"'":"'"},qp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mp=parseFloat,Fp=parseInt,pa=typeof Ye=="object"&&Ye&&Ye.Object===Object&&Ye,Np=typeof self=="object"&&self&&self.Object===Object&&self,Sn=pa||Np||Function("return this")(),fu=l&&!l.nodeType&&l,We=fu&&!0&&f&&!f.nodeType&&f,ga=We&&We.exports===fu,ou=ga&&pa.process,Kn=function(){try{var p=We&&We.require&&We.require("util").types;return p||ou&&ou.binding&&ou.binding("util")}catch{}}(),va=Kn&&Kn.isArrayBuffer,da=Kn&&Kn.isDate,_a=Kn&&Kn.isMap,ma=Kn&&Kn.isRegExp,ya=Kn&&Kn.isSet,wa=Kn&&Kn.isTypedArray;function Dn(p,S,x){switch(x.length){case 0:return p.call(S);case 1:return p.call(S,x[0]);case 2:return p.call(S,x[0],x[1]);case 3:return p.call(S,x[0],x[1],x[2])}return p.apply(S,x)}function $p(p,S,x,$){for(var K=-1,nn=p==null?0:p.length;++K-1}function au(p,S,x){for(var $=-1,K=p==null?0:p.length;++$-1;);return x}function Ra(p,S){for(var x=p.length;x--&&ke(S,p[x],0)>-1;);return x}function Zp(p,S){for(var x=p.length,$=0;x--;)p[x]===S&&++$;return $}var Vp=hu(Pp),Yp=hu(Cp);function Qp(p){return"\\"+qp[p]}function Xp(p,S){return p==null?i:p[S]}function nt(p){return Tp.test(p)}function Jp(p){return Ip.test(p)}function jp(p){for(var S,x=[];!(S=p.next()).done;)x.push(S.value);return x}function du(p){var S=-1,x=Array(p.size);return p.forEach(function($,K){x[++S]=[K,$]}),x}function Ea(p,S){return function(x){return p(S(x))}}function Ie(p,S){for(var x=-1,$=p.length,K=0,nn=[];++x<$;){var mn=p[x];(mn===S||mn===b)&&(p[x]=b,nn[K++]=x)}return nn}function er(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=$}),x}function kp(p){var S=-1,x=Array(p.size);return p.forEach(function($){x[++S]=[$,$]}),x}function ng(p,S,x){for(var $=x-1,K=p.length;++$-1}function Wg(n,e){var t=this.__data__,r=dr(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}ce.prototype.clear=Fg,ce.prototype.delete=Ng,ce.prototype.get=$g,ce.prototype.has=Dg,ce.prototype.set=Wg;function he(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e=e?n:e)),n}function Qn(n,e,t,r,u,a){var s,c=e&q,v=e&F,O=e&C;if(t&&(s=u?t(n,r,u,a):t(n)),s!==i)return s;if(!hn(n))return n;var T=Z(n);if(T){if(s=zv(n),!c)return Ln(n,s)}else{var R=Tn(n),N=R==xn||R==Se;if(qe(n))return cl(n,c);if(R==Hn||R==le||N&&!u){if(s=v||N?{}:Pl(n),!c)return v?Lv(n,ev(s,n)):Cv(n,Ua(s,n))}else{if(!on[R])return u?n:{};s=Hv(n,R,c)}}a||(a=new ee);var B=a.get(n);if(B)return B;a.set(n,s),us(n)?n.forEach(function(H){s.add(Qn(H,e,t,H,n,a))}):rs(n)&&n.forEach(function(H,X){s.set(X,Qn(H,e,t,X,n,a))});var z=O?v?Gu:Uu:v?Mn:bn,Y=T?i:z(n);return Zn(Y||n,function(H,X){Y&&(X=H,H=n[X]),Tt(s,X,Qn(H,e,t,X,n,a))}),s}function tv(n){var e=bn(n);return function(t){return Ga(t,n,e)}}function Ga(n,e,t){var r=t.length;if(n==null)return!r;for(n=fn(n);r--;){var u=t[r],a=e[u],s=n[u];if(s===i&&!(u in n)||!a(s))return!1}return!0}function za(n,e,t){if(typeof n!="function")throw new Vn(g);return qt(function(){n.apply(i,t)},e)}function It(n,e,t,r){var u=-1,a=kt,s=!0,c=n.length,v=[],O=e.length;if(!c)return v;t&&(e=sn(e,Wn(t))),r?(a=au,s=!1):e.length>=m&&(a=wt,s=!1,e=new Ge(e));n:for(;++uu?0:u+t),r=r===i||r>u?u:V(r),r<0&&(r+=u),r=t>r?0:os(r);t0&&t(c)?e>1?An(c,e-1,t,r,u):Te(u,c):r||(u[u.length]=c)}return u}var Su=_l(),Za=_l(!0);function ue(n,e){return n&&Su(n,e,bn)}function Au(n,e){return n&&Za(n,e,bn)}function mr(n,e){return Oe(e,function(t){return _e(n[t])})}function He(n,e){e=Ce(e,n);for(var t=0,r=e.length;n!=null&&te}function uv(n,e){return n!=null&&tn.call(n,e)}function fv(n,e){return n!=null&&e in fn(n)}function ov(n,e,t){return n>=On(e,t)&&n=120&&T.length>=120)?new Ge(s&&T):i}T=n[0];var R=-1,N=c[0];n:for(;++R-1;)c!==n&&lr.call(c,v,1),lr.call(n,v,1);return n}function rl(n,e){for(var t=n?e.length:0,r=t-1;t--;){var u=e[t];if(t==r||u!==a){var a=u;de(u)?lr.call(n,u,1):Mu(n,u)}}return n}function Cu(n,e){return n+hr($a()*(e-n+1))}function wv(n,e,t,r){for(var u=-1,a=yn(cr((e-n)/(t||1)),0),s=x(a);a--;)s[r?a:++u]=n,n+=t;return s}function Lu(n,e){var t="";if(!n||e<1||e>wn)return t;do e%2&&(t+=n),e=hr(e/2),e&&(n+=n);while(e);return t}function Q(n,e){return Qu(ql(n,e,Fn),n+"")}function xv(n){return Ba(ct(n))}function bv(n,e){var t=ct(n);return Er(t,ze(e,0,t.length))}function Pt(n,e,t,r){if(!hn(n))return n;e=Ce(e,n);for(var u=-1,a=e.length,s=a-1,c=n;c!=null&&++uu?0:u+e),t=t>u?u:t,t<0&&(t+=u),u=e>t?0:t-e>>>0,e>>>=0;for(var a=x(u);++r>>1,s=n[a];s!==null&&!Un(s)&&(t?s<=e:s=m){var O=e?null:Nv(n);if(O)return er(O);s=!1,u=wt,v=new Ge}else v=e?[]:c;n:for(;++r=r?n:Xn(n,e,t)}var sl=pg||function(n){return Sn.clearTimeout(n)};function cl(n,e){if(e)return n.slice();var t=n.length,r=La?La(t):new n.constructor(t);return n.copy(r),r}function Du(n){var e=new n.constructor(n.byteLength);return new or(e).set(new or(n)),e}function Iv(n,e){var t=e?Du(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}function Rv(n){var e=new n.constructor(n.source,Yo.exec(n));return e.lastIndex=n.lastIndex,e}function Ev(n){return Ot?fn(Ot.call(n)):{}}function hl(n,e){var t=e?Du(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}function pl(n,e){if(n!==e){var t=n!==i,r=n===null,u=n===n,a=Un(n),s=e!==i,c=e===null,v=e===e,O=Un(e);if(!c&&!O&&!a&&n>e||a&&s&&v&&!c&&!O||r&&s&&v||!t&&v||!u)return 1;if(!r&&!a&&!O&&n=c)return v;var O=t[r];return v*(O=="desc"?-1:1)}}return n.index-e.index}function gl(n,e,t,r){for(var u=-1,a=n.length,s=t.length,c=-1,v=e.length,O=yn(a-s,0),T=x(v+O),R=!r;++c1?t[u-1]:i,s=u>2?t[2]:i;for(a=n.length>3&&typeof a=="function"?(u--,a):i,s&&Rn(t[0],t[1],s)&&(a=u<3?i:a,u=1),e=fn(e);++r-1?u[a?e[s]:s]:i}}function wl(n){return ve(function(e){var t=e.length,r=t,u=Yn.prototype.thru;for(n&&e.reverse();r--;){var a=e[r];if(typeof a!="function")throw new Vn(g);if(u&&!s&&Ir(a)=="wrapper")var s=new Yn([],!0)}for(r=s?r:t;++r1&&k.reverse(),T&&vc))return!1;var O=a.get(n),T=a.get(e);if(O&&T)return O==e&&T==n;var R=-1,N=!0,B=t&M?new Ge:i;for(a.set(n,e),a.set(e,n);++R1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(Vh,`{ -/* [wrapped with `+e+`] */ -`)}function Zv(n){return Z(n)||Ve(n)||!!(Fa&&n&&n[Fa])}function de(n,e){var t=typeof n;return e=e??wn,!!e&&(t=="number"||t!="symbol"&&ip.test(n))&&n>-1&&n%1==0&&n0){if(++e>=Bi)return arguments[0]}else e=0;return n.apply(i,arguments)}}function Er(n,e){var t=-1,r=n.length,u=r-1;for(e=e===i?r:e;++t1?n[e-1]:i;return t=typeof t=="function"?(n.pop(),t):i,Kl(n,t)});function Zl(n){var e=o(n);return e.__chain__=!0,e}function r_(n,e){return e(n),n}function Pr(n,e){return e(n)}var i_=ve(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,u=function(a){return bu(a,n)};return e>1||this.__actions__.length||!(r instanceof j)||!de(t)?this.thru(u):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:Pr,args:[u],thisArg:i}),new Yn(r,this.__chain__).thru(function(a){return e&&!a.length&&a.push(i),a}))});function u_(){return Zl(this)}function f_(){return new Yn(this.value(),this.__chain__)}function o_(){this.__values__===i&&(this.__values__=fs(this.value()));var n=this.__index__>=this.__values__.length,e=n?i:this.__values__[this.__index__++];return{done:n,value:e}}function a_(){return this}function l_(n){for(var e,t=this;t instanceof vr;){var r=Wl(t);r.__index__=0,r.__values__=i,e?u.__wrapped__=r:e=r;var u=r;t=t.__wrapped__}return u.__wrapped__=n,e}function s_(){var n=this.__wrapped__;if(n instanceof j){var e=n;return this.__actions__.length&&(e=new j(this)),e=e.reverse(),e.__actions__.push({func:Pr,args:[Xu],thisArg:i}),new Yn(e,this.__chain__)}return this.thru(Xu)}function c_(){return al(this.__wrapped__,this.__actions__)}var h_=br(function(n,e,t){tn.call(n,t)?++n[t]:pe(n,t,1)});function p_(n,e,t){var r=Z(n)?xa:rv;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}function g_(n,e){var t=Z(n)?Oe:Ka;return t(n,G(e,3))}var v_=yl(Bl),d_=yl(Ul);function __(n,e){return An(Cr(n,e),1)}function m_(n,e){return An(Cr(n,e),Nn)}function y_(n,e,t){return t=t===i?1:V(t),An(Cr(n,e),t)}function Vl(n,e){var t=Z(n)?Zn:Ee;return t(n,G(e,3))}function Yl(n,e){var t=Z(n)?Dp:Ha;return t(n,G(e,3))}var w_=br(function(n,e,t){tn.call(n,t)?n[t].push(e):pe(n,t,[e])});function x_(n,e,t,r){n=qn(n)?n:ct(n),t=t&&!r?V(t):0;var u=n.length;return t<0&&(t=yn(u+t,0)),Nr(n)?t<=u&&n.indexOf(e,t)>-1:!!u&&ke(n,e,t)>-1}var b_=Q(function(n,e,t){var r=-1,u=typeof e=="function",a=qn(n)?x(n.length):[];return Ee(n,function(s){a[++r]=u?Dn(e,s,t):Rt(s,e,t)}),a}),S_=br(function(n,e,t){pe(n,t,e)});function Cr(n,e){var t=Z(n)?sn:Ja;return t(n,G(e,3))}function A_(n,e,t,r){return n==null?[]:(Z(e)||(e=e==null?[]:[e]),t=r?i:t,Z(t)||(t=t==null?[]:[t]),el(n,e,t))}var O_=br(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function T_(n,e,t){var r=Z(n)?lu:Oa,u=arguments.length<3;return r(n,G(e,4),t,u,Ee)}function I_(n,e,t){var r=Z(n)?Wp:Oa,u=arguments.length<3;return r(n,G(e,4),t,u,Ha)}function R_(n,e){var t=Z(n)?Oe:Ka;return t(n,Mr(G(e,3)))}function E_(n){var e=Z(n)?Ba:xv;return e(n)}function P_(n,e,t){(t?Rn(n,e,t):e===i)?e=1:e=V(e);var r=Z(n)?jg:bv;return r(n,e)}function C_(n){var e=Z(n)?kg:Av;return e(n)}function L_(n){if(n==null)return 0;if(qn(n))return Nr(n)?et(n):n.length;var e=Tn(n);return e==dn||e==_n?n.size:Ru(n).length}function q_(n,e,t){var r=Z(n)?su:Ov;return t&&Rn(n,e,t)&&(e=i),r(n,G(e,3))}var M_=Q(function(n,e){if(n==null)return[];var t=e.length;return t>1&&Rn(n,e[0],e[1])?e=[]:t>2&&Rn(e[0],e[1],e[2])&&(e=[e[0]]),el(n,An(e,1),[])}),Lr=gg||function(){return Sn.Date.now()};function F_(n,e){if(typeof e!="function")throw new Vn(g);return n=V(n),function(){if(--n<1)return e.apply(this,arguments)}}function Ql(n,e,t){return e=t?i:e,e=n&&e==null?n.length:e,ge(n,J,i,i,i,i,e)}function Xl(n,e){var t;if(typeof e!="function")throw new Vn(g);return n=V(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=i),t}}var ju=Q(function(n,e,t){var r=I;if(t.length){var u=Ie(t,lt(ju));r|=W}return ge(n,r,e,t,u)}),Jl=Q(function(n,e,t){var r=I|P;if(t.length){var u=Ie(t,lt(Jl));r|=W}return ge(e,r,n,t,u)});function jl(n,e,t){e=t?i:e;var r=ge(n,A,i,i,i,i,i,e);return r.placeholder=jl.placeholder,r}function kl(n,e,t){e=t?i:e;var r=ge(n,E,i,i,i,i,i,e);return r.placeholder=kl.placeholder,r}function ns(n,e,t){var r,u,a,s,c,v,O=0,T=!1,R=!1,N=!0;if(typeof n!="function")throw new Vn(g);e=jn(e)||0,hn(t)&&(T=!!t.leading,R="maxWait"in t,a=R?yn(jn(t.maxWait)||0,e):a,N="trailing"in t?!!t.trailing:N);function B(vn){var re=r,ye=u;return r=u=i,O=vn,s=n.apply(ye,re),s}function z(vn){return O=vn,c=qt(X,e),T?B(vn):s}function Y(vn){var re=vn-v,ye=vn-O,ys=e-re;return R?On(ys,a-ye):ys}function H(vn){var re=vn-v,ye=vn-O;return v===i||re>=e||re<0||R&&ye>=a}function X(){var vn=Lr();if(H(vn))return k(vn);c=qt(X,Y(vn))}function k(vn){return c=i,N&&r?B(vn):(r=u=i,s)}function Gn(){c!==i&&sl(c),O=0,r=v=u=c=i}function En(){return c===i?s:k(Lr())}function zn(){var vn=Lr(),re=H(vn);if(r=arguments,u=this,v=vn,re){if(c===i)return z(v);if(R)return sl(c),c=qt(X,e),B(v)}return c===i&&(c=qt(X,e)),s}return zn.cancel=Gn,zn.flush=En,zn}var N_=Q(function(n,e){return za(n,1,e)}),$_=Q(function(n,e,t){return za(n,jn(e)||0,t)});function D_(n){return ge(n,Pn)}function qr(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new Vn(g);var t=function(){var r=arguments,u=e?e.apply(this,r):r[0],a=t.cache;if(a.has(u))return a.get(u);var s=n.apply(this,r);return t.cache=a.set(u,s)||a,s};return t.cache=new(qr.Cache||he),t}qr.Cache=he;function Mr(n){if(typeof n!="function")throw new Vn(g);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function W_(n){return Xl(2,n)}var B_=Tv(function(n,e){e=e.length==1&&Z(e[0])?sn(e[0],Wn(G())):sn(An(e,1),Wn(G()));var t=e.length;return Q(function(r){for(var u=-1,a=On(r.length,t);++u=e}),Ve=Ya(function(){return arguments}())?Ya:function(n){return pn(n)&&tn.call(n,"callee")&&!Ma.call(n,"callee")},Z=x.isArray,e0=va?Wn(va):lv;function qn(n){return n!=null&&Fr(n.length)&&!_e(n)}function gn(n){return pn(n)&&qn(n)}function t0(n){return n===!0||n===!1||pn(n)&&In(n)==se}var qe=dg||cf,r0=da?Wn(da):sv;function i0(n){return pn(n)&&n.nodeType===1&&!Mt(n)}function u0(n){if(n==null)return!0;if(qn(n)&&(Z(n)||typeof n=="string"||typeof n.splice=="function"||qe(n)||st(n)||Ve(n)))return!n.length;var e=Tn(n);if(e==dn||e==_n)return!n.size;if(Lt(n))return!Ru(n).length;for(var t in n)if(tn.call(n,t))return!1;return!0}function f0(n,e){return Et(n,e)}function o0(n,e,t){t=typeof t=="function"?t:i;var r=t?t(n,e):i;return r===i?Et(n,e,i,t):!!r}function nf(n){if(!pn(n))return!1;var e=In(n);return e==ie||e==un||typeof n.message=="string"&&typeof n.name=="string"&&!Mt(n)}function a0(n){return typeof n=="number"&&Na(n)}function _e(n){if(!hn(n))return!1;var e=In(n);return e==xn||e==Se||e==dt||e==Yt}function ts(n){return typeof n=="number"&&n==V(n)}function Fr(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wn}function hn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function pn(n){return n!=null&&typeof n=="object"}var rs=_a?Wn(_a):hv;function l0(n,e){return n===e||Iu(n,e,Hu(e))}function s0(n,e,t){return t=typeof t=="function"?t:i,Iu(n,e,Hu(e),t)}function c0(n){return is(n)&&n!=+n}function h0(n){if(Qv(n))throw new K(d);return Qa(n)}function p0(n){return n===null}function g0(n){return n==null}function is(n){return typeof n=="number"||pn(n)&&In(n)==Cn}function Mt(n){if(!pn(n)||In(n)!=Hn)return!1;var e=ar(n);if(e===null)return!0;var t=tn.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ir.call(t)==sg}var ef=ma?Wn(ma):pv;function v0(n){return ts(n)&&n>=-wn&&n<=wn}var us=ya?Wn(ya):gv;function Nr(n){return typeof n=="string"||!Z(n)&&pn(n)&&In(n)==kn}function Un(n){return typeof n=="symbol"||pn(n)&&In(n)==Qt}var st=wa?Wn(wa):vv;function d0(n){return n===i}function _0(n){return pn(n)&&Tn(n)==mt}function m0(n){return pn(n)&&In(n)==Mh}var y0=Tr(Eu),w0=Tr(function(n,e){return n<=e});function fs(n){if(!n)return[];if(qn(n))return Nr(n)?ne(n):Ln(n);if(xt&&n[xt])return jp(n[xt]());var e=Tn(n),t=e==dn?du:e==_n?er:ct;return t(n)}function me(n){if(!n)return n===0?n:0;if(n=jn(n),n===Nn||n===-Nn){var e=n<0?-1:1;return e*De}return n===n?n:0}function V(n){var e=me(n),t=e%1;return e===e?t?e-t:e:0}function os(n){return n?ze(V(n),0,$n):0}function jn(n){if(typeof n=="number")return n;if(Un(n))return ae;if(hn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=hn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=Ta(n);var t=ep.test(n);return t||rp.test(n)?Fp(n.slice(2),t?2:8):np.test(n)?ae:+n}function as(n){return fe(n,Mn(n))}function x0(n){return n?ze(V(n),-wn,wn):n===0?n:0}function en(n){return n==null?"":Bn(n)}var b0=ot(function(n,e){if(Lt(e)||qn(e)){fe(e,bn(e),n);return}for(var t in e)tn.call(e,t)&&Tt(n,t,e[t])}),ls=ot(function(n,e){fe(e,Mn(e),n)}),$r=ot(function(n,e,t,r){fe(e,Mn(e),n,r)}),S0=ot(function(n,e,t,r){fe(e,bn(e),n,r)}),A0=ve(bu);function O0(n,e){var t=ft(n);return e==null?t:Ua(t,e)}var T0=Q(function(n,e){n=fn(n);var t=-1,r=e.length,u=r>2?e[2]:i;for(u&&Rn(e[0],e[1],u)&&(r=1);++t1),a}),fe(n,Gu(n),t),r&&(t=Qn(t,q|F|C,$v));for(var u=e.length;u--;)Mu(t,e[u]);return t});function H0(n,e){return cs(n,Mr(G(e)))}var K0=ve(function(n,e){return n==null?{}:mv(n,e)});function cs(n,e){if(n==null)return{};var t=sn(Gu(n),function(r){return[r]});return e=G(e),tl(n,t,function(r,u){return e(r,u[0])})}function Z0(n,e,t){e=Ce(e,n);var r=-1,u=e.length;for(u||(u=1,n=i);++re){var r=n;n=e,e=r}if(t||n%1||e%1){var u=$a();return On(n+u*(e-n+Mp("1e-"+((u+"").length-1))),e)}return Cu(n,e)}var r1=at(function(n,e,t){return e=e.toLowerCase(),n+(t?gs(e):e)});function gs(n){return uf(en(n).toLowerCase())}function vs(n){return n=en(n),n&&n.replace(up,Vp).replace(Ap,"")}function i1(n,e,t){n=en(n),e=Bn(e);var r=n.length;t=t===i?r:ze(V(t),0,r);var u=t;return t-=e.length,t>=0&&n.slice(t,u)==e}function u1(n){return n=en(n),n&&Wh.test(n)?n.replace(Zo,Yp):n}function f1(n){return n=en(n),n&&Kh.test(n)?n.replace(ki,"\\$&"):n}var o1=at(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),a1=at(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),l1=ml("toLowerCase");function s1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;if(!e||r>=e)return n;var u=(e-r)/2;return Or(hr(u),t)+n+Or(cr(u),t)}function c1(n,e,t){n=en(n),e=V(e);var r=e?et(n):0;return e&&r>>0,t?(n=en(n),n&&(typeof e=="string"||e!=null&&!ef(e))&&(e=Bn(e),!e&&nt(n))?Le(ne(n),0,t):n.split(e,t)):[]}var m1=at(function(n,e,t){return n+(t?" ":"")+uf(e)});function y1(n,e,t){return n=en(n),t=t==null?0:ze(V(t),0,n.length),e=Bn(e),n.slice(t,t+e.length)==e}function w1(n,e,t){var r=o.templateSettings;t&&Rn(n,e,t)&&(e=i),n=en(n),e=$r({},e,r,Ol);var u=$r({},e.imports,r.imports,Ol),a=bn(u),s=vu(u,a),c,v,O=0,T=e.interpolate||Xt,R="__p += '",N=_u((e.escape||Xt).source+"|"+T.source+"|"+(T===Vo?kh:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),B="//# sourceURL="+(tn.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ep+"]")+` -`;n.replace(N,function(H,X,k,Gn,En,zn){return k||(k=Gn),R+=n.slice(O,zn).replace(fp,Qp),X&&(c=!0,R+=`' + -__e(`+X+`) + -'`),En&&(v=!0,R+=`'; -`+En+`; -__p += '`),k&&(R+=`' + -((__t = (`+k+`)) == null ? '' : __t) + -'`),O=zn+H.length,H}),R+=`'; -`;var z=tn.call(e,"variable")&&e.variable;if(!z)R=`with (obj) { -`+R+` -} -`;else if(Jh.test(z))throw new K(y);R=(v?R.replace(Fh,""):R).replace(Nh,"$1").replace($h,"$1;"),R="function("+(z||"obj")+`) { -`+(z?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(c?", __e = _.escape":"")+(v?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+R+`return __p -}`;var Y=_s(function(){return nn(a,B+"return "+R).apply(i,s)});if(Y.source=R,nf(Y))throw Y;return Y}function x1(n){return en(n).toLowerCase()}function b1(n){return en(n).toUpperCase()}function S1(n,e,t){if(n=en(n),n&&(t||e===i))return Ta(n);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=ne(e),a=Ia(r,u),s=Ra(r,u)+1;return Le(r,a,s).join("")}function A1(n,e,t){if(n=en(n),n&&(t||e===i))return n.slice(0,Pa(n)+1);if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ra(r,ne(e))+1;return Le(r,0,u).join("")}function O1(n,e,t){if(n=en(n),n&&(t||e===i))return n.replace(nu,"");if(!n||!(e=Bn(e)))return n;var r=ne(n),u=Ia(r,ne(e));return Le(r,u).join("")}function T1(n,e){var t=gt,r=Ht;if(hn(e)){var u="separator"in e?e.separator:u;t="length"in e?V(e.length):t,r="omission"in e?Bn(e.omission):r}n=en(n);var a=n.length;if(nt(n)){var s=ne(n);a=s.length}if(t>=a)return n;var c=t-et(r);if(c<1)return r;var v=s?Le(s,0,c).join(""):n.slice(0,c);if(u===i)return v+r;if(s&&(c+=v.length-c),ef(u)){if(n.slice(c).search(u)){var O,T=v;for(u.global||(u=_u(u.source,en(Yo.exec(u))+"g")),u.lastIndex=0;O=u.exec(T);)var R=O.index;v=v.slice(0,R===i?c:R)}}else if(n.indexOf(Bn(u),c)!=c){var N=v.lastIndexOf(u);N>-1&&(v=v.slice(0,N))}return v+r}function I1(n){return n=en(n),n&&Dh.test(n)?n.replace(Ko,tg):n}var R1=at(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()}),uf=ml("toUpperCase");function ds(n,e,t){return n=en(n),e=t?i:e,e===i?Jp(n)?ug(n):Gp(n):n.match(e)||[]}var _s=Q(function(n,e){try{return Dn(n,i,e)}catch(t){return nf(t)?t:new K(t)}}),E1=ve(function(n,e){return Zn(e,function(t){t=oe(t),pe(n,t,ju(n[t],n))}),n});function P1(n){var e=n==null?0:n.length,t=G();return n=e?sn(n,function(r){if(typeof r[1]!="function")throw new Vn(g);return[t(r[0]),r[1]]}):[],Q(function(r){for(var u=-1;++uwn)return[];var t=$n,r=On(n,$n);e=G(e),n-=$n;for(var u=gu(r,e);++t0||e<0)?new j(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==i&&(e=V(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},j.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},j.prototype.toArray=function(){return this.take($n)},ue(j.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),u=o[r?"take"+(e=="last"?"Right":""):e],a=r||/^find/.test(e);u&&(o.prototype[e]=function(){var s=this.__wrapped__,c=r?[1]:arguments,v=s instanceof j,O=c[0],T=v||Z(s),R=function(X){var k=u.apply(o,Te([X],c));return r&&N?k[0]:k};T&&t&&typeof O=="function"&&O.length!=1&&(v=T=!1);var N=this.__chain__,B=!!this.__actions__.length,z=a&&!N,Y=v&&!B;if(!a&&T){s=Y?s:new j(this);var H=n.apply(s,c);return H.__actions__.push({func:Pr,args:[R],thisArg:i}),new Yn(H,N)}return z&&Y?n.apply(this,c):(H=this.thru(R),z?r?H.value()[0]:H.value():H)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(n){var e=tr[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);o.prototype[n]=function(){var u=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(Z(a)?a:[],u)}return this[t](function(s){return e.apply(Z(s)?s:[],u)})}}),ue(j.prototype,function(n,e){var t=o[e];if(t){var r=t.name+"";tn.call(ut,r)||(ut[r]=[]),ut[r].push({name:e,func:t})}}),ut[Sr(i,P).name]=[{name:"wrapper",func:i}],j.prototype.clone=Ig,j.prototype.reverse=Rg,j.prototype.value=Eg,o.prototype.at=i_,o.prototype.chain=u_,o.prototype.commit=f_,o.prototype.next=o_,o.prototype.plant=l_,o.prototype.reverse=s_,o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=c_,o.prototype.first=o.prototype.head,xt&&(o.prototype[xt]=a_),o},tt=fg();We?((We.exports=tt)._=tt,fu._=tt):Sn._=tt}).call(Ye)}(Gt,Gt.exports);var cn=Gt.exports;function $i(f={},l){const i={};for(const h of Object.keys(f))i[h]=h==="$"?f[h]:l(f[h],h,f);return Object.setPrototypeOf(i,f)}var Uo={exports:{}};(function(f,l){(function(i,h){f.exports=h()})(Ye,function(){return function(i){function h(d){if(m[d])return m[d].exports;var g=m[d]={i:d,l:!1,exports:{}};return i[d].call(g.exports,g,g.exports,h),g.l=!0,g.exports}var m={};return h.m=i,h.c=m,h.d=function(d,g,y){h.o(d,g)||Object.defineProperty(d,g,{configurable:!1,enumerable:!0,get:y})},h.n=function(d){var g=d&&d.__esModule?function(){return d.default}:function(){return d};return h.d(g,"a",g),g},h.o=function(d,g){return Object.prototype.hasOwnProperty.call(d,g)},h.p="",h(h.s=1)}([function(i,h,m){function d(y){var w=y===void 0?{}:y,_=w.ESCAPE,b=_===void 0?/^\\/:_,q=w.VARIABLE_START,F=q===void 0?/^\${\s*/:q,C=w.VARIABLE_END,D=C===void 0?/^\s*}/:C,M=w.PIPE_START,I=M===void 0?/^\s*\|\s*/:M,P=w.PIPE_PARAMETER_START,L=P===void 0?/^\s*:\s*/:P,A=w.QUOTED_STRING,E=A===void 0?h.DEFAULT_QUOTED_STRING_REGEX:A,W=w.QUOTED_STRING_TEST,U=W===void 0?null:W,J=w.QUOTED_STRING_GET_AND_ADVANCE,rn=J===void 0?null:J,Pn=w.QUOTED_STRING_IN_PARAMETER_TEST,gt=Pn===void 0?null:Pn,Ht=w.QUOTED_STRING_IN_PARAMETER_GET_AND_ADVANCE,Bi=Ht===void 0?null:Ht,Kt=U||function(Nn){return E.test(Nn)},vt=rn||g(E),Ui=gt||function(Nn){return E.test(Nn)},Gi=Bi||g(E);return function(Nn){function wn(an){an===void 0&&(an=1),un=un.substr(an)}function De(an){an===void 0&&(an=/^/),wn(un.match(an)[0].length)}function ae(){var an;return De(b),an=un.length>0?un[0]:"",wn(),an}function $n(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;dn={name:"",pipes:[]},Hn=!kn}function zi(){ie.variables.push(dn),$n({isNull:!0})}function Zt(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Cn={name:"",parameters:[]},_t=!kn}function Vt(){dn.pipes.push(Cn),Zt({isNull:!0})}function le(an){var _n=(an===void 0?{}:an).isNull,kn=_n!==void 0&&_n;Ae="",Yt=!kn}function xe(){Cn.parameters.push(Ae),le({isNull:!0})}function dt(){return!!D.test(un)&&(De(D),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&zi(),xn=0,!0)}function se(){return!!I.test(un)&&(De(I),xn>=3&&xe(),xn>=2&&Vt(),xn>=1&&Zt(),xn=2,!0)}function be(){return!!L.test(un)&&(De(L),xn>=3&&xe(),xn>=2&&le(),xn=3,!0)}for(var un=Nn,ie={literals:[],variables:[]},xn=0,Se="",dn={name:"",pipes:[]},Cn={name:"",parameters:[]},Ae="",Hn=!1,_t=!1,Yt=!1;un&&un.length>0;)switch(xn){case 0:if(b.test(un)){Se+=ae();continue}if(F.test(un)){xn=1,$n(),ie.literals.push(Se),Se="",De(F);continue}Se+=un[0],wn();break;case 1:if(b.test(un)){dn.name+=ae();continue}if(dt()||se())continue;if(Kt(un)){dn.name+=vt(un,wn);continue}dn.name+=un[0],wn();break;case 2:if(b.test(un)){Cn.name+=ae();continue}if(dt()||be()||se())continue;if(Kt(un)){Cn.name+=vt(un,wn);continue}Cn.name+=un[0],wn();break;case 3:if(b.test(un)){Ae+=ae();continue}if(dt()||be()||se())continue;if(Ui(un)){Ae+=Gi(un,wn);continue}Ae+=un[0],wn()}return Yt&&Cn.parameters.push(Ae),_t&&dn.pipes.push(Cn),Hn&&ie.variables.push(dn),ie.literals.push(Se),ie}}function g(y){return function(w,_){var b=w.match(y);return _(b[0].length),b.slice(2).join("").replace("\\\\","\\")}}Object.defineProperty(h,"__esModule",{value:!0}),h.DEFAULT_QUOTED_STRING_REGEX=/^('((?:[^'\\]|\\.)*)'|'((?:[^'\\]|\\.)*)$|"((?:[^"\\]|\\.)*)"|"((?:[^"\\]|\\.)*)$)/,h.parseStringTemplateGenerator=d,h.parseStringTemplate=d(),h.getQuotedStringAndAdvanceForRegex=g},function(i,h,m){i.exports=m(2)},function(i,h,m){function d(g){for(var y in g)h.hasOwnProperty(y)||(h[y]=g[y])}Object.defineProperty(h,"__esModule",{value:!0}),d(m(0)),d(m(3))},function(i,h,m){function d(b){return function(q){return b.hasOwnProperty(q)?b[q]:q.split(".").reduce(function(F,C){return F.hasOwnProperty(C)?F[C]:""},b)}}function g(b,q,F,C){C===void 0&&(C=d(q));var D=C(b.name);return b.pipes.reduce(function(M,I){return F.hasOwnProperty(I.name)?F[I.name](M,I.parameters):M},D??"")}function y(b,q,F,C){return C===void 0&&(C=d(q)),b.literals.length===0?"":b.literals.slice(1).reduce(function(D,M,I){return""+D+g(b.variables[I],q,F,C)+M},b.literals[0])}function w(b,q,F){return y(_.parseStringTemplate(b),q,F)}Object.defineProperty(h,"__esModule",{value:!0});var _=m(0);h.evaluateParsedString=y,h.evaluateStringTemplate=w}])})})(Uo);var Go=Uo.exports;const zo=f=>{const l=Function("$",`return ${f};`);return i=>l(new Proxy(zt(i),{get(h,m){return typeof(h==null?void 0:h[m])=="function"?h[m]({}):h==null?void 0:h[m]}}))},Ah=/^\{\{\s*/,Oh=/^\s*\}\}/,Di=/\b\B/,Th=Go.parseStringTemplateGenerator({VARIABLE_START:Ah,VARIABLE_END:Oh,PIPE_START:Di,PIPE_PARAMETER_START:Di,QUOTED_STRING:Di}),Ih=bh(f=>{const l=Th(f);return cn.join(l.literals,"")?i=>Go.evaluateParsedString(l,{},{},h=>zo(h)(i)):zo(l.variables[0].name)},{primitive:!0});function Xe(f){switch(f==null?void 0:f.constructor){case Array:{const l=cn.map(f,Xe);return i=>cn.map(l,h=>h(i))}case Object:{const l=cn.mapValues(f,Xe);return i=>cn.mapValues(l,h=>h(i))}case String:return Ih(f);default:return()=>f}}function zt(f={}){return $i(f,l=>cn.isFunction(l)?l:Xe(l))}function Rh(f={}){return new Proxy(f,{get:(l,i)=>typeof l[i]=="function"?l[i]:()=>l[i]})}function Wi(f,l){return Object.setPrototypeOf($i(l,i=>h=>i(f)),f)}function Eh(f){const{$for:l,...i}=f;if(l){const{$let:h="i",$from:m=0,$to:d=1,$step:g=1}=l,y=Xe(m),w=Xe(d),_=Xe(g);return(b={})=>cn.range(y(b),w(b),_(b)).map(q=>{const F=Wi(b,zt({[h]:q}));return Wi(F,zt(i))})}else return(h={})=>[Wi(h,zt(i))]}function Ph(f,l){const i=d=>{const{$:g}=d,y=Eh(d);return g in l?w=>cn.flatMap(y(w),_=>cn.flatMap(h[g],b=>b(_))):w=>cn.map(y(w),_=>Object.setPrototypeOf($i(_,b=>b(_)),null))},h=cn.mapValues(l,d=>cn.map(d,i)),m=cn.flatMap(f,i);return d=>cn.flatMap(m,g=>g(d))}const Ch=f=>f==null,Ho=f=>f.display!=="transient";function Lh({trace:f,context:l,view:i="main",from:h=0,to:m=(d=>(d=f==null?void 0:f.events)==null?void 0:d.length)()??0}){var q,F,C,D;const g=Ph(((C=(F=(q=f==null?void 0:f.render)==null?void 0:q.views)==null?void 0:F[i])==null?void 0:C.components)??[],((D=f==null?void 0:f.render)==null?void 0:D.components)??{}),y=M=>M&&Object.hasOwn(M,"alpha")?M.alpha>0:!0,w=M=>I=>({component:I,meta:{source:"trace",step:h+M,info:I.$info}}),_=cn.chain(f==null?void 0:f.events).map((M,I)=>({step:I,id:M.id,data:M,pId:M.pId})).groupBy("id").value(),b=cn.chain(cn.range(h,m)).map(M=>{var W;const I=f.events[M],P=f.events,L=g(Rh({alpha:1,...l,step:M,parent:Ch(I.pId)?void 0:P[((W=cn.findLast(_[I.pId],U=>U.step<=M))==null?void 0:W.step)??0],event:I,events:P})),A=L.filter(Ho),E=L.filter(cn.negate(Ho));return{persistent:A,transient:E}}).map(M=>cn.mapValues(M,I=>I.filter(y))).map((M,I)=>cn.mapValues(M,P=>P.map(w(I)))).value();return{stepsPersistent:cn.map(b,M=>M.persistent),stepsTransient:cn.map(b,M=>M.transient)}}onmessage=Sh(async({data:f})=>Lh(f))})(); diff --git a/assets/parseYaml.worker-CXyNYLS1.js b/assets/parseYaml.worker-CXyNYLS1.js new file mode 100644 index 0000000..0542404 --- /dev/null +++ b/assets/parseYaml.worker-CXyNYLS1.js @@ -0,0 +1,17 @@ +(function(){"use strict";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function qe(e){return typeof e>"u"||e===null}function Lr(e){return typeof e=="object"&&e!==null}function Dr(e){return Array.isArray(e)?e:qe(e)?[]:[e]}function Yr(e,r){var n,o,i,l;if(r)for(l=Object.keys(r),n=0,o=l.length;nu&&(l=" ... ",r=o-u+l.length),n-o>u&&(t=" ...",n=o+u-t.length),{str:l+e.slice(r,n).replace(/\t/g,"→")+t,pos:o-r+l.length}}function K(e,r){return C.repeat(" ",r-e.length)+e}function Zr(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,o=[0],i=[],l,t=-1;l=n.exec(e.buffer);)i.push(l.index),o.push(l.index+l[0].length),e.position<=l.index&&t<0&&(t=o.length-2);t<0&&(t=o.length-1);var u="",c,a,h=Math.min(e.line+r.linesAfter,i.length).toString().length,f=r.maxLength-(r.indent+h+3);for(c=1;c<=r.linesBefore&&!(t-c<0);c++)a=H(e.buffer,o[t-c],i[t-c],e.position-(o[t]-o[t-c]),f),u=C.repeat(" ",r.indent)+K((e.line-c+1).toString(),h)+" | "+a.str+` +`+u;for(a=H(e.buffer,o[t],i[t],e.position,f),u+=C.repeat(" ",r.indent)+K((e.line+1).toString(),h)+" | "+a.str+` +`,u+=C.repeat("-",r.indent+h+3+a.pos)+`^ +`,c=1;c<=r.linesAfter&&!(t+c>=i.length);c++)a=H(e.buffer,o[t+c],i[t+c],e.position-(o[t]-o[t+c]),f),u+=C.repeat(" ",r.indent)+K((e.line+c+1).toString(),h)+" | "+a.str+` +`;return u.replace(/\n$/,"")}var Xr=Zr,Qr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Jr=["scalar","sequence","mapping"];function en(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(o){r[String(o)]=n})}),r}function rn(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(Qr.indexOf(n)===-1)throw new k('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=en(r.styleAliases||null),Jr.indexOf(this.kind)===-1)throw new k('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var I=rn;function $e(e,r){var n=[];return e[r].forEach(function(o){var i=n.length;n.forEach(function(l,t){l.tag===o.tag&&l.kind===o.kind&&l.multi===o.multi&&(i=t)}),n[i]=o}),n}function nn(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function o(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(r=0,n=arguments.length;r=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Sn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function In(e){return!(e===null||!Sn.test(e)||e[e.length-1]==="_")}function Cn(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}var On=/^[-+]?[0-9]+e/;function Tn(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(C.isNegativeZero(e))return"-0.0";return n=e.toString(10),On.test(n)?n.replace("e",".e"):n}function Fn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||C.isNegativeZero(e))}var En=new I("tag:yaml.org,2002:float",{kind:"scalar",resolve:In,construct:Cn,predicate:Fn,represent:Tn,defaultStyle:"lowercase"}),kn=cn.extend({implicit:[pn,gn,wn,En]}),jn=kn,Me=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Pe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Nn(e){return e===null?!1:Me.exec(e)!==null||Pe.exec(e)!==null}function qn(e){var r,n,o,i,l,t,u,c=0,a=null,h,f,d;if(r=Me.exec(e),r===null&&(r=Pe.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],o=+r[2]-1,i=+r[3],!r[4])return new Date(Date.UTC(n,o,i));if(l=+r[4],t=+r[5],u=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(h=+r[10],f=+(r[11]||0),a=(h*60+f)*6e4,r[9]==="-"&&(a=-a)),d=new Date(Date.UTC(n,o,i,l,t,u,c)),a&&d.setTime(d.getTime()-a),d}function Rn(e){return e.toISOString()}var $n=new I("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Nn,construct:qn,instanceOf:Date,represent:Rn});function Mn(e){return e==="<<"||e===null}var Pn=new I("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Mn}),Z=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function Ln(e){if(e===null)return!1;var r,n,o=0,i=e.length,l=Z;for(n=0;n64)){if(r<0)return!1;o+=6}return o%8===0}function Dn(e){var r,n,o=e.replace(/[\r\n=]/g,""),i=o.length,l=Z,t=0,u=[];for(r=0;r>16&255),u.push(t>>8&255),u.push(t&255)),t=t<<6|l.indexOf(o.charAt(r));return n=i%4*6,n===0?(u.push(t>>16&255),u.push(t>>8&255),u.push(t&255)):n===18?(u.push(t>>10&255),u.push(t>>2&255)):n===12&&u.push(t>>4&255),new Uint8Array(u)}function Yn(e){var r="",n=0,o,i,l=e.length,t=Z;for(o=0;o>18&63],r+=t[n>>12&63],r+=t[n>>6&63],r+=t[n&63]),n=(n<<8)+e[o];return i=l%3,i===0?(r+=t[n>>18&63],r+=t[n>>12&63],r+=t[n>>6&63],r+=t[n&63]):i===2?(r+=t[n>>10&63],r+=t[n>>4&63],r+=t[n<<2&63],r+=t[64]):i===1&&(r+=t[n>>2&63],r+=t[n<<4&63],r+=t[64],r+=t[64]),r}function Bn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Un=new I("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ln,construct:Dn,predicate:Bn,represent:Yn}),Vn=Object.prototype.hasOwnProperty,Gn=Object.prototype.toString;function zn(e){if(e===null)return!0;var r=[],n,o,i,l,t,u=e;for(n=0,o=u.length;n>10)+55296,(e-65536&1023)+56320)}for(var ze=new Array(256),He=new Array(256),$=0;$<256;$++)ze[$]=Ge($)?1:0,He[$]=Ge($);function pi(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||ii,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ke(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Xr(n),new k(r,n)}function m(e,r){throw Ke(e,r)}function V(e,r){e.onWarning&&e.onWarning.call(null,Ke(e,r))}var We={YAML:function(r,n,o){var i,l,t;r.version!==null&&m(r,"duplication of %YAML directive"),o.length!==1&&m(r,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),i===null&&m(r,"ill-formed argument of the YAML directive"),l=parseInt(i[1],10),t=parseInt(i[2],10),l!==1&&m(r,"unacceptable YAML version of the document"),r.version=o[0],r.checkLineBreaks=t<2,t!==1&&t!==2&&V(r,"unsupported YAML version of the document")},TAG:function(r,n,o){var i,l;o.length!==2&&m(r,"TAG directive accepts exactly two arguments"),i=o[0],l=o[1],Be.test(i)||m(r,"ill-formed tag handle (first argument) of the TAG directive"),j.call(r.tagMap,i)&&m(r,'there is a previously declared suffix for "'+i+'" tag handle'),Ue.test(l)||m(r,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{m(r,"tag prefix is malformed: "+l)}r.tagMap[i]=l}};function N(e,r,n,o){var i,l,t,u;if(r1&&(e.result+=C.repeat(` +`,r-1))}function hi(e,r,n){var o,i,l,t,u,c,a,h,f=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),T(p)||R(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),T(i)||n&&R(i)))return!1;for(e.kind="scalar",e.result="",l=t=e.position,u=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),T(i)||n&&R(i))break}else if(p===35){if(o=e.input.charCodeAt(e.position-1),T(o))break}else{if(e.position===e.lineStart&&G(e)||n&&R(p))break;if(E(p))if(c=e.line,a=e.lineStart,h=e.lineIndent,_(e,!1,-1),e.lineIndent>=r){u=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=t,e.line=c,e.lineStart=a,e.lineIndent=h;break}}u&&(N(e,l,t,!1),J(e,e.line-c),l=t=e.position,u=!1),q(p)||(t=e.position+1),p=e.input.charCodeAt(++e.position)}return N(e,l,t,!1),e.result?!0:(e.kind=f,e.result=d,!1)}function di(e,r){var n,o,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(N(e,o,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)o=e.position,e.position++,i=e.position;else return!0;else E(n)?(N(e,o,i,!0),J(e,_(e,!1,r)),o=i=e.position):e.position===e.lineStart&&G(e)?m(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);m(e,"unexpected end of the stream within a single quoted scalar")}function mi(e,r){var n,o,i,l,t,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return N(e,n,e.position,!0),e.position++,!0;if(u===92){if(N(e,n,e.position,!0),u=e.input.charCodeAt(++e.position),E(u))_(e,!1,r);else if(u<256&&ze[u])e.result+=He[u],e.position++;else if((t=fi(u))>0){for(i=t,l=0;i>0;i--)u=e.input.charCodeAt(++e.position),(t=ci(u))>=0?l=(l<<4)+t:m(e,"expected hexadecimal character");e.result+=si(l),e.position++}else m(e,"unknown escape sequence");n=o=e.position}else E(u)?(N(e,n,o,!0),J(e,_(e,!1,r)),n=o=e.position):e.position===e.lineStart&&G(e)?m(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}m(e,"unexpected end of the stream within a double quoted scalar")}function gi(e,r){var n=!0,o,i,l,t=e.tag,u,c=e.anchor,a,h,f,d,p,x=Object.create(null),b,g,A,s;if(s=e.input.charCodeAt(e.position),s===91)h=93,p=!1,u=[];else if(s===123)h=125,p=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),s=e.input.charCodeAt(++e.position);s!==0;){if(_(e,!0,r),s=e.input.charCodeAt(e.position),s===h)return e.position++,e.tag=t,e.anchor=c,e.kind=p?"mapping":"sequence",e.result=u,!0;n?s===44&&m(e,"expected the node content, but found ','"):m(e,"missed comma between flow collection entries"),g=b=A=null,f=d=!1,s===63&&(a=e.input.charCodeAt(e.position+1),T(a)&&(f=d=!0,e.position++,_(e,!0,r))),o=e.line,i=e.lineStart,l=e.position,P(e,r,B,!1,!0),g=e.tag,b=e.result,_(e,!0,r),s=e.input.charCodeAt(e.position),(d||e.line===o)&&s===58&&(f=!0,s=e.input.charCodeAt(++e.position),_(e,!0,r),P(e,r,B,!1,!0),A=e.result),p?M(e,u,x,g,b,A,o,i,l):f?u.push(M(e,null,x,g,b,A,o,i,l)):u.push(b),_(e,!0,r),s=e.input.charCodeAt(e.position),s===44?(n=!0,s=e.input.charCodeAt(++e.position)):n=!1}m(e,"unexpected end of the stream within a flow collection")}function vi(e,r){var n,o,i=X,l=!1,t=!1,u=r,c=0,a=!1,h,f;if(f=e.input.charCodeAt(e.position),f===124)o=!1;else if(f===62)o=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)X===i?i=f===43?Ye:oi:m(e,"repeat of a chomping mode identifier");else if((h=ai(f))>=0)h===0?m(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):t?m(e,"repeat of an indentation width identifier"):(u=r+h-1,t=!0);else break;if(q(f)){do f=e.input.charCodeAt(++e.position);while(q(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!E(f)&&f!==0)}for(;f!==0;){for(Q(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!t||e.lineIndentu&&(u=e.lineIndent),E(f)){c++;continue}if(e.lineIndentr)&&c!==0)m(e,"bad indentation of a sequence entry");else if(e.lineIndentr)&&(g&&(t=e.line,u=e.lineStart,c=e.position),P(e,r,U,!0,i)&&(g?x=e.result:b=e.result),g||(M(e,f,d,p,x,b,t,u,c),p=x=b=null),_(e,!0,-1),s=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>r)&&s!==0)m(e,"bad indentation of a mapping entry");else if(e.lineIndentr?c=1:e.lineIndent===r?c=0:e.lineIndentr?c=1:e.lineIndent===r?c=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),f=0,d=e.implicitTypes.length;f"),e.result!==null&&x.kind!==e.kind&&m(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+x.kind+'", not "'+e.kind+'"'),x.resolve(e.result,e.tag)?(e.result=x.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||h}function _i(e){var r=e.position,n,o,i,l=!1,t;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(t=e.input.charCodeAt(e.position))!==0&&(_(e,!0,-1),t=e.input.charCodeAt(e.position),!(e.lineIndent>0||t!==37));){for(l=!0,t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!T(t);)t=e.input.charCodeAt(++e.position);for(o=e.input.slice(n,e.position),i=[],o.length<1&&m(e,"directive name must not be less than one character in length");t!==0;){for(;q(t);)t=e.input.charCodeAt(++e.position);if(t===35){do t=e.input.charCodeAt(++e.position);while(t!==0&&!E(t));break}if(E(t))break;for(n=e.position;t!==0&&!T(t);)t=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}t!==0&&Q(e),j.call(We,o)?We[o](e,o,i):V(e,'unknown document directive "'+o+'"')}if(_(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_(e,!0,-1)):l&&m(e,"directives end mark is expected"),P(e,e.lineIndent-1,U,!1,!0),_(e,!0,-1),e.checkLineBreaks&&li.test(e.input.slice(r,e.position))&&V(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&G(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_(e,!0,-1));return}if(e.position"u"&&(n=r,r=null);var o=Qe(e,n);if(typeof r!="function")return o;for(var i=0,l=o.length;i0?1:-1}),ee}var Pi=$i()?Math.sign:Mi(),Li=Pi,Di=Math.abs,Yi=Math.floor,Bi=function(e){return isNaN(e)?0:(e=Number(e),e===0||!isFinite(e)?e:Li(e)*Yi(Di(e)))},Ui=Bi,Vi=Math.max,Gi=function(e){return Vi(0,Ui(e))},er=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},zi=L,rr=function(e){if(!zi(e))throw new TypeError("Cannot use null or undefined");return e},Hi={exports:{}},re,nr;function Ki(){return nr||(nr=1,re=function(){var e=Object.assign,r;return typeof e!="function"?!1:(r={foo:"raz"},e(r,{bar:"dwa"},{trzy:"trzy"}),r.foo+r.bar+r.trzy==="razdwatrzy")}),re}var ne,ir;function Wi(){return ir||(ir=1,ne=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),ne}var ie,or;function Zi(){if(or)return ie;or=1;var e=L,r=Object.keys;return ie=function(n){return r(e(n)?Object(n):n)},ie}var oe,tr;function Xi(){return tr||(tr=1,oe=Wi()()?Object.keys:Zi()),oe}var te,lr;function Qi(){if(lr)return te;lr=1;var e=Xi(),r=rr,n=Math.max;return te=function(o,i){var l,t,u=n(arguments.length,2),c;for(o=Object(r(o)),c=function(a){try{o[a]=i[a]}catch(h){l||(l=h)}},t=1;t-1},de}var me,xr;function co(){return xr||(xr=1,me=lo()()?String.prototype.contains:uo()),me}var br;function D(){if(br)return ue.exports;br=1;var e=sr(),r=to(),n=cr(),o=Ri,i=co(),l=ue.exports=function(t,u){var c,a,h,f,d;return arguments.length<2||typeof t!="string"?(f=u,u=t,t=null):f=arguments[2],e(t)?(c=i.call(t,"c"),a=i.call(t,"e"),h=i.call(t,"w")):(c=h=!0,a=!1),d={value:u,configurable:c,enumerable:a,writable:h},f?n(o(f),d):d};return l.gs=function(t,u,c){var a,h,f,d;return typeof t!="string"?(f=c,c=u,u=t,t=null):f=arguments[3],e(u)?r(u)?e(c)?r(c)||(f=c,c=void 0):c=void 0:(f=u,u=c=void 0):u=void 0,e(t)?(a=i.call(t,"c"),h=i.call(t,"e")):(a=!0,h=!1),d={get:u,set:c,configurable:a,enumerable:h},f?n(o(f),d):d},ue.exports}var ge={exports:{}};(function(e,r){var n=D(),o=er,i=Function.prototype.apply,l=Function.prototype.call,t=Object.create,u=Object.defineProperty,c=Object.defineProperties,a=Object.prototype.hasOwnProperty,h={configurable:!0,enumerable:!1,writable:!0},f,d,p,x,b,g,A;f=function(s,v){var y;return o(v),a.call(this,"__ee__")?y=this.__ee__:(y=h.value=t(null),u(this,"__ee__",h),h.value=null),y[s]?typeof y[s]=="object"?y[s].push(v):y[s]=[y[s],v]:y[s]=v,this},d=function(s,v){var y,S;return o(v),S=this,f.call(this,s,y=function(){p.call(S,s,y),i.call(v,this,arguments)}),y.__eeOnceListener__=v,this},p=function(s,v){var y,S,w,O;if(o(v),!a.call(this,"__ee__"))return this;if(y=this.__ee__,!y[s])return this;if(S=y[s],typeof S=="object")for(O=0;w=S[O];++O)(w===v||w.__eeOnceListener__===v)&&(S.length===2?y[s]=S[O?0:1]:S.splice(O,1));else(S===v||S.__eeOnceListener__===v)&&delete y[s];return this},x=function(s){var v,y,S,w,O;if(a.call(this,"__ee__")&&(w=this.__ee__[s],!!w))if(typeof w=="object"){for(y=arguments.length,O=new Array(y-1),v=1;v=55296&&y<=56319&&(F+=d[++g])),F=p?a.call(p,x,F,A):F,b?(h.value=F,f(s,A,h)):s[A]=F,++A;v=A}}if(v===void 0)for(v=o(d.length),b&&(s=new b(v)),g=0;gasync r=>{try{const n=await e(r);postMessage({result:n})}catch(n){postMessage({error:n})}})(async e=>Ti(e.data))})(); diff --git a/assets/parseYaml.worker-D2goq2pP.js b/assets/parseYaml.worker-D2goq2pP.js deleted file mode 100644 index ab2417c..0000000 --- a/assets/parseYaml.worker-D2goq2pP.js +++ /dev/null @@ -1,17 +0,0 @@ -(function(){"use strict";/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function Oe(e){return typeof e>"u"||e===null}function Ir(e){return typeof e=="object"&&e!==null}function Or(e){return Array.isArray(e)?e:Oe(e)?[]:[e]}function Tr(e,r){var n,o,i,t;if(r)for(t=Object.keys(r),n=0,o=t.length;nu&&(t=" ... ",r=o-u+t.length),n-o>u&&(l=" ...",n=o+u-l.length),{str:t+e.slice(r,n).replace(/\t/g,"→")+l,pos:o-r+t.length}}function Z(e,r){return I.repeat(" ",r-e.length)+e}function $r(e,r){if(r=Object.create(r||null),!e.buffer)return null;r.maxLength||(r.maxLength=79),typeof r.indent!="number"&&(r.indent=1),typeof r.linesBefore!="number"&&(r.linesBefore=3),typeof r.linesAfter!="number"&&(r.linesAfter=2);for(var n=/\r?\n|\r|\0/g,o=[0],i=[],t,l=-1;t=n.exec(e.buffer);)i.push(t.index),o.push(t.index+t[0].length),e.position<=t.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);var u="",c,f,d=Math.min(e.line+r.linesAfter,i.length).toString().length,a=r.maxLength-(r.indent+d+3);for(c=1;c<=r.linesBefore&&!(l-c<0);c++)f=W(e.buffer,o[l-c],i[l-c],e.position-(o[l]-o[l-c]),a),u=I.repeat(" ",r.indent)+Z((e.line-c+1).toString(),d)+" | "+f.str+` -`+u;for(f=W(e.buffer,o[l],i[l],e.position,a),u+=I.repeat(" ",r.indent)+Z((e.line+1).toString(),d)+" | "+f.str+` -`,u+=I.repeat("-",r.indent+d+3+f.pos)+`^ -`,c=1;c<=r.linesAfter&&!(l+c>=i.length);c++)f=W(e.buffer,o[l+c],i[l+c],e.position-(o[l]-o[l+c]),a),u+=I.repeat(" ",r.indent)+Z((e.line+c+1).toString(),d)+" | "+f.str+` -`;return u.replace(/\n$/,"")}var Rr=$r,Lr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Dr=["scalar","sequence","mapping"];function Yr(e){var r={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(o){r[String(o)]=n})}),r}function Br(e,r){if(r=r||{},Object.keys(r).forEach(function(n){if(Lr.indexOf(n)===-1)throw new k('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=r,this.tag=e,this.kind=r.kind||null,this.resolve=r.resolve||function(){return!0},this.construct=r.construct||function(n){return n},this.instanceOf=r.instanceOf||null,this.predicate=r.predicate||null,this.represent=r.represent||null,this.representName=r.representName||null,this.defaultStyle=r.defaultStyle||null,this.multi=r.multi||!1,this.styleAliases=Yr(r.styleAliases||null),Dr.indexOf(this.kind)===-1)throw new k('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var C=Br;function Fe(e,r){var n=[];return e[r].forEach(function(o){var i=n.length;n.forEach(function(t,l){t.tag===o.tag&&t.kind===o.kind&&t.multi===o.multi&&(i=l)}),n[i]=o}),n}function Ur(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},r,n;function o(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(r=0,n=arguments.length;r=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),pn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function sn(e){return!(e===null||!pn.test(e)||e[e.length-1]==="_")}function hn(e){var r,n;return r=e.replace(/_/g,"").toLowerCase(),n=r[0]==="-"?-1:1,"+-".indexOf(r[0])>=0&&(r=r.slice(1)),r===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:r===".nan"?NaN:n*parseFloat(r,10)}var dn=/^[-+]?[0-9]+e/;function mn(e,r){var n;if(isNaN(e))switch(r){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(r){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(r){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(I.isNegativeZero(e))return"-0.0";return n=e.toString(10),dn.test(n)?n.replace("e",".e"):n}function gn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||I.isNegativeZero(e))}var vn=new C("tag:yaml.org,2002:float",{kind:"scalar",resolve:sn,construct:hn,predicate:gn,represent:mn,defaultStyle:"lowercase"}),xn=Kr.extend({implicit:[Qr,nn,an,vn]}),bn=xn,Ee=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ke=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function yn(e){return e===null?!1:Ee.exec(e)!==null||ke.exec(e)!==null}function An(e){var r,n,o,i,t,l,u,c=0,f=null,d,a,m;if(r=Ee.exec(e),r===null&&(r=ke.exec(e)),r===null)throw new Error("Date resolve error");if(n=+r[1],o=+r[2]-1,i=+r[3],!r[4])return new Date(Date.UTC(n,o,i));if(t=+r[4],l=+r[5],u=+r[6],r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}return r[9]&&(d=+r[10],a=+(r[11]||0),f=(d*60+a)*6e4,r[9]==="-"&&(f=-f)),m=new Date(Date.UTC(n,o,i,t,l,u,c)),f&&m.setTime(m.getTime()-f),m}function _n(e){return e.toISOString()}var wn=new C("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:yn,construct:An,instanceOf:Date,represent:_n});function Sn(e){return e==="<<"||e===null}var Cn=new C("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Sn}),Q=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function In(e){if(e===null)return!1;var r,n,o=0,i=e.length,t=Q;for(n=0;n64)){if(r<0)return!1;o+=6}return o%8===0}function On(e){var r,n,o=e.replace(/[\r\n=]/g,""),i=o.length,t=Q,l=0,u=[];for(r=0;r>16&255),u.push(l>>8&255),u.push(l&255)),l=l<<6|t.indexOf(o.charAt(r));return n=i%4*6,n===0?(u.push(l>>16&255),u.push(l>>8&255),u.push(l&255)):n===18?(u.push(l>>10&255),u.push(l>>2&255)):n===12&&u.push(l>>4&255),new Uint8Array(u)}function Tn(e){var r="",n=0,o,i,t=e.length,l=Q;for(o=0;o>18&63],r+=l[n>>12&63],r+=l[n>>6&63],r+=l[n&63]),n=(n<<8)+e[o];return i=t%3,i===0?(r+=l[n>>18&63],r+=l[n>>12&63],r+=l[n>>6&63],r+=l[n&63]):i===2?(r+=l[n>>10&63],r+=l[n>>4&63],r+=l[n<<2&63],r+=l[64]):i===1&&(r+=l[n>>2&63],r+=l[n<<4&63],r+=l[64],r+=l[64]),r}function Fn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var En=new C("tag:yaml.org,2002:binary",{kind:"scalar",resolve:In,construct:On,predicate:Fn,represent:Tn}),kn=Object.prototype.hasOwnProperty,jn=Object.prototype.toString;function Nn(e){if(e===null)return!0;var r=[],n,o,i,t,l,u=e;for(n=0,o=u.length;n>10)+55296,(e-65536&1023)+56320)}for(var Le=new Array(256),De=new Array(256),P=0;P<256;P++)Le[P]=Re(P)?1:0,De[P]=Re(P);function Jn(e,r){this.input=e,this.filename=r.filename||null,this.schema=r.schema||Vn,this.onWarning=r.onWarning||null,this.legacy=r.legacy||!1,this.json=r.json||!1,this.listener=r.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ye(e,r){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=Rr(n),new k(r,n)}function h(e,r){throw Ye(e,r)}function G(e,r){e.onWarning&&e.onWarning.call(null,Ye(e,r))}var Be={YAML:function(r,n,o){var i,t,l;r.version!==null&&h(r,"duplication of %YAML directive"),o.length!==1&&h(r,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),i===null&&h(r,"ill-formed argument of the YAML directive"),t=parseInt(i[1],10),l=parseInt(i[2],10),t!==1&&h(r,"unacceptable YAML version of the document"),r.version=o[0],r.checkLineBreaks=l<2,l!==1&&l!==2&&G(r,"unsupported YAML version of the document")},TAG:function(r,n,o){var i,t;o.length!==2&&h(r,"TAG directive accepts exactly two arguments"),i=o[0],t=o[1],qe.test(i)||h(r,"ill-formed tag handle (first argument) of the TAG directive"),j.call(r.tagMap,i)&&h(r,'there is a previously declared suffix for "'+i+'" tag handle'),Pe.test(t)||h(r,"ill-formed tag prefix (second argument) of the TAG directive");try{t=decodeURIComponent(t)}catch{h(r,"tag prefix is malformed: "+t)}r.tagMap[i]=t}};function N(e,r,n,o){var i,t,l,u;if(r1&&(e.result+=I.repeat(` -`,r-1))}function ei(e,r,n){var o,i,t,l,u,c,f,d,a=e.kind,m=e.result,s;if(s=e.input.charCodeAt(e.position),T(s)||q(s)||s===35||s===38||s===42||s===33||s===124||s===62||s===39||s===34||s===37||s===64||s===96||(s===63||s===45)&&(i=e.input.charCodeAt(e.position+1),T(i)||n&&q(i)))return!1;for(e.kind="scalar",e.result="",t=l=e.position,u=!1;s!==0;){if(s===58){if(i=e.input.charCodeAt(e.position+1),T(i)||n&&q(i))break}else if(s===35){if(o=e.input.charCodeAt(e.position-1),T(o))break}else{if(e.position===e.lineStart&&z(e)||n&&q(s))break;if(E(s))if(c=e.line,f=e.lineStart,d=e.lineIndent,_(e,!1,-1),e.lineIndent>=r){u=!0,s=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=c,e.lineStart=f,e.lineIndent=d;break}}u&&(N(e,t,l,!1),re(e,e.line-c),t=l=e.position,u=!1),M(s)||(l=e.position+1),s=e.input.charCodeAt(++e.position)}return N(e,t,l,!1),e.result?!0:(e.kind=a,e.result=m,!1)}function ri(e,r){var n,o,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(N(e,o,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)o=e.position,e.position++,i=e.position;else return!0;else E(n)?(N(e,o,i,!0),re(e,_(e,!1,r)),o=i=e.position):e.position===e.lineStart&&z(e)?h(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);h(e,"unexpected end of the stream within a single quoted scalar")}function ni(e,r){var n,o,i,t,l,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return N(e,n,e.position,!0),e.position++,!0;if(u===92){if(N(e,n,e.position,!0),u=e.input.charCodeAt(++e.position),E(u))_(e,!1,r);else if(u<256&&Le[u])e.result+=De[u],e.position++;else if((l=Zn(u))>0){for(i=l,t=0;i>0;i--)u=e.input.charCodeAt(++e.position),(l=Wn(u))>=0?t=(t<<4)+l:h(e,"expected hexadecimal character");e.result+=Qn(t),e.position++}else h(e,"unknown escape sequence");n=o=e.position}else E(u)?(N(e,n,o,!0),re(e,_(e,!1,r)),n=o=e.position):e.position===e.lineStart&&z(e)?h(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}h(e,"unexpected end of the stream within a double quoted scalar")}function ii(e,r){var n=!0,o,i,t,l=e.tag,u,c=e.anchor,f,d,a,m,s,x=Object.create(null),b,g,A,p;if(p=e.input.charCodeAt(e.position),p===91)d=93,s=!1,u=[];else if(p===123)d=125,s=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),p=e.input.charCodeAt(++e.position);p!==0;){if(_(e,!0,r),p=e.input.charCodeAt(e.position),p===d)return e.position++,e.tag=l,e.anchor=c,e.kind=s?"mapping":"sequence",e.result=u,!0;n?p===44&&h(e,"expected the node content, but found ','"):h(e,"missed comma between flow collection entries"),g=b=A=null,a=m=!1,p===63&&(f=e.input.charCodeAt(e.position+1),T(f)&&(a=m=!0,e.position++,_(e,!0,r))),o=e.line,i=e.lineStart,t=e.position,R(e,r,U,!1,!0),g=e.tag,b=e.result,_(e,!0,r),p=e.input.charCodeAt(e.position),(m||e.line===o)&&p===58&&(a=!0,p=e.input.charCodeAt(++e.position),_(e,!0,r),R(e,r,U,!1,!0),A=e.result),s?$(e,u,x,g,b,A,o,i,t):a?u.push($(e,null,x,g,b,A,o,i,t)):u.push(b),_(e,!0,r),p=e.input.charCodeAt(e.position),p===44?(n=!0,p=e.input.charCodeAt(++e.position)):n=!1}h(e,"unexpected end of the stream within a flow collection")}function oi(e,r){var n,o,i=J,t=!1,l=!1,u=r,c=0,f=!1,d,a;if(a=e.input.charCodeAt(e.position),a===124)o=!1;else if(a===62)o=!0;else return!1;for(e.kind="scalar",e.result="";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)J===i?i=a===43?Me:Gn:h(e,"repeat of a chomping mode identifier");else if((d=Xn(a))>=0)d===0?h(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?h(e,"repeat of an indentation width identifier"):(u=r+d-1,l=!0);else break;if(M(a)){do a=e.input.charCodeAt(++e.position);while(M(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!E(a)&&a!==0)}for(;a!==0;){for(ee(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndentu&&(u=e.lineIndent),E(a)){c++;continue}if(e.lineIndentr)&&c!==0)h(e,"bad indentation of a sequence entry");else if(e.lineIndentr)&&(g&&(l=e.line,u=e.lineStart,c=e.position),R(e,r,V,!0,i)&&(g?x=e.result:b=e.result),g||($(e,a,m,s,x,b,l,u,c),s=x=b=null),_(e,!0,-1),p=e.input.charCodeAt(e.position)),(e.line===t||e.lineIndent>r)&&p!==0)h(e,"bad indentation of a mapping entry");else if(e.lineIndentr?c=1:e.lineIndent===r?c=0:e.lineIndentr?c=1:e.lineIndent===r?c=0:e.lineIndent tag; it should be "scalar", not "'+e.kind+'"'),a=0,m=e.implicitTypes.length;a"),e.result!==null&&x.kind!==e.kind&&h(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+x.kind+'", not "'+e.kind+'"'),x.resolve(e.result,e.tag)?(e.result=x.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):h(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function fi(e){var r=e.position,n,o,i,t=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(_(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(t=!0,l=e.input.charCodeAt(++e.position),n=e.position;l!==0&&!T(l);)l=e.input.charCodeAt(++e.position);for(o=e.input.slice(n,e.position),i=[],o.length<1&&h(e,"directive name must not be less than one character in length");l!==0;){for(;M(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!E(l));break}if(E(l))break;for(n=e.position;l!==0&&!T(l);)l=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}l!==0&&ee(e),j.call(Be,o)?Be[o](e,o,i):G(e,'unknown document directive "'+o+'"')}if(_(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_(e,!0,-1)):t&&h(e,"directives end mark is expected"),R(e,e.lineIndent-1,V,!1,!0),_(e,!0,-1),e.checkLineBreaks&&Hn.test(e.input.slice(r,e.position))&&G(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&z(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_(e,!0,-1));return}if(e.position"u"&&(n=r,r=null);var o=Ge(e,n);if(typeof r!="function")return o;for(var i=0,t=o.length;i0?1:-1}),ne}var Ci=wi()?Math.sign:Si(),Ii=Ci,Oi=Math.abs,Ti=Math.floor,Fi=function(e){return isNaN(e)?0:(e=Number(e),e===0||!isFinite(e)?e:Ii(e)*Ti(Oi(e)))},Ei=Fi,ki=Math.max,ji=function(e){return ki(0,Ei(e))},He=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");return e},Ni=L,Ke=function(e){if(!Ni(e))throw new TypeError("Cannot use null or undefined");return e},Mi={exports:{}},qi=function(){var e=Object.assign,r;return typeof e!="function"?!1:(r={foo:"raz"},e(r,{bar:"dwa"},{trzy:"trzy"}),r.foo+r.bar+r.trzy==="razdwatrzy")},ie,We;function Pi(){return We||(We=1,ie=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),ie}var oe,Ze;function $i(){if(Ze)return oe;Ze=1;var e=L,r=Object.keys;return oe=function(n){return r(e(n)?Object(n):n)},oe}var le,Xe;function Ri(){return Xe||(Xe=1,le=Pi()()?Object.keys:$i()),le}var te,Qe;function Li(){if(Qe)return te;Qe=1;var e=Ri(),r=Ke,n=Math.max;return te=function(o,i){var t,l,u=n(arguments.length,2),c;for(o=Object(r(o)),c=function(f){try{o[f]=i[f]}catch(d){t||(t=d)}},l=1;l-1},ce}var io=ro()?String.prototype.contains:no(),H=nr,or=eo,lr=Je,tr=_i,Y=io,oo=rr.exports=function(e,r){var n,o,i,t,l;return arguments.length<2||typeof e!="string"?(t=r,r=e,e=null):t=arguments[2],H(e)?(n=Y.call(e,"c"),o=Y.call(e,"e"),i=Y.call(e,"w")):(n=i=!0,o=!1),l={value:r,configurable:n,enumerable:o,writable:i},t?lr(tr(t),l):l};oo.gs=function(e,r,n){var o,i,t,l;return typeof e!="string"?(t=n,n=r,r=e,e=null):t=arguments[3],H(r)?or(r)?H(n)?or(n)||(t=n,n=void 0):n=void 0:(t=r,r=n=void 0):r=void 0,H(e)?(o=Y.call(e,"c"),i=Y.call(e,"e")):(o=!0,i=!1),l={get:r,set:n,configurable:o,enumerable:i},t?lr(tr(t),l):l};var B=rr.exports,fe={exports:{}};(function(e,r){var n=B,o=He,i=Function.prototype.apply,t=Function.prototype.call,l=Object.create,u=Object.defineProperty,c=Object.defineProperties,f=Object.prototype.hasOwnProperty,d={configurable:!0,enumerable:!1,writable:!0},a,m,s,x,b,g,A;a=function(p,v){var y;return o(v),f.call(this,"__ee__")?y=this.__ee__:(y=d.value=l(null),u(this,"__ee__",d),d.value=null),y[p]?typeof y[p]=="object"?y[p].push(v):y[p]=[y[p],v]:y[p]=v,this},m=function(p,v){var y,S;return o(v),S=this,a.call(this,p,y=function(){s.call(S,p,y),i.call(v,this,arguments)}),y.__eeOnceListener__=v,this},s=function(p,v){var y,S,w,O;if(o(v),!f.call(this,"__ee__"))return this;if(y=this.__ee__,!y[p])return this;if(S=y[p],typeof S=="object")for(O=0;w=S[O];++O)(w===v||w.__eeOnceListener__===v)&&(S.length===2?y[p]=S[O?0:1]:S.splice(O,1));else(S===v||S.__eeOnceListener__===v)&&delete y[p];return this},x=function(p){var v,y,S,w,O;if(f.call(this,"__ee__")&&(w=this.__ee__[p],!!w))if(typeof w=="object"){for(y=arguments.length,O=new Array(y-1),v=1;v=55296&&y<=56319&&(F+=m[++g])),F=s?f.call(s,x,F,A):F,b?(d.value=F,a(p,A,d)):p[A]=F,++A;v=A}}if(v===void 0)for(v=o(m.length),b&&(p=new b(v)),g=0;gasync r=>{try{const n=await e(r);postMessage({result:n})}catch(n){postMessage({error:n})}})(async e=>mi(e.data))})(); diff --git a/assets/tree.worker-sIhKZmHR.js b/assets/tree.worker-sIhKZmHR.js deleted file mode 100644 index 2277e02..0000000 --- a/assets/tree.worker-sIhKZmHR.js +++ /dev/null @@ -1,27 +0,0 @@ -var Gb=Object.defineProperty;var Ub=(ze,tn,$e)=>tn in ze?Gb(ze,tn,{enumerable:!0,configurable:!0,writable:!0,value:$e}):ze[tn]=$e;var de=(ze,tn,$e)=>Ub(ze,typeof tn!="symbol"?tn+"":tn,$e);(function(){"use strict";var ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},tn="\0",$e="\0",Nu="";let js=class{constructor(u){de(this,"_isDirected",!0);de(this,"_isMultigraph",!1);de(this,"_isCompound",!1);de(this,"_label");de(this,"_defaultNodeLabelFn",()=>{});de(this,"_defaultEdgeLabelFn",()=>{});de(this,"_nodes",{});de(this,"_in",{});de(this,"_preds",{});de(this,"_out",{});de(this,"_sucs",{});de(this,"_edgeObjs",{});de(this,"_edgeLabels",{});de(this,"_nodeCount",0);de(this,"_edgeCount",0);de(this,"_parent");de(this,"_children");u&&(this._isDirected=Object.hasOwn(u,"directed")?u.directed:!0,this._isMultigraph=Object.hasOwn(u,"multigraph")?u.multigraph:!1,this._isCompound=Object.hasOwn(u,"compound")?u.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[$e]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(u){return this._label=u,this}graph(){return this._label}setDefaultNodeLabel(u){return this._defaultNodeLabelFn=u,typeof u!="function"&&(this._defaultNodeLabelFn=()=>u),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var u=this;return this.nodes().filter(r=>Object.keys(u._in[r]).length===0)}sinks(){var u=this;return this.nodes().filter(r=>Object.keys(u._out[r]).length===0)}setNodes(u,r){var o=arguments,f=this;return u.forEach(function(l){o.length>1?f.setNode(l,r):f.setNode(l)}),this}setNode(u,r){return Object.hasOwn(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=r),this):(this._nodes[u]=arguments.length>1?r:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=$e,this._children[u]={},this._children[$e][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)}node(u){return this._nodes[u]}hasNode(u){return Object.hasOwn(this._nodes,u)}removeNode(u){var r=this;if(Object.hasOwn(this._nodes,u)){var o=f=>r.removeEdge(r._edgeObjs[f]);delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],this.children(u).forEach(function(f){r.setParent(f)}),delete this._children[u]),Object.keys(this._in[u]).forEach(o),delete this._in[u],delete this._preds[u],Object.keys(this._out[u]).forEach(o),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this}setParent(u,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r===void 0)r=$e;else{r+="";for(var o=r;o!==void 0;o=this.parent(o))if(o===u)throw new Error("Setting "+r+" as parent of "+u+" would create a cycle");this.setNode(r)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=r,this._children[r][u]=!0,this}_removeFromParentsChildList(u){delete this._children[this._parent[u]][u]}parent(u){if(this._isCompound){var r=this._parent[u];if(r!==$e)return r}}children(u=$e){if(this._isCompound){var r=this._children[u];if(r)return Object.keys(r)}else{if(u===$e)return this.nodes();if(this.hasNode(u))return[]}}predecessors(u){var r=this._preds[u];if(r)return Object.keys(r)}successors(u){var r=this._sucs[u];if(r)return Object.keys(r)}neighbors(u){var r=this.predecessors(u);if(r){const f=new Set(r);for(var o of this.successors(u))f.add(o);return Array.from(f.values())}}isLeaf(u){var r;return this.isDirected()?r=this.successors(u):r=this.neighbors(u),r.length===0}filterNodes(u){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var o=this;Object.entries(this._nodes).forEach(function([h,g]){u(h)&&r.setNode(h,g)}),Object.values(this._edgeObjs).forEach(function(h){r.hasNode(h.v)&&r.hasNode(h.w)&&r.setEdge(h,o.edge(h))});var f={};function l(h){var g=o.parent(h);return g===void 0||r.hasNode(g)?(f[h]=g,g):g in f?f[g]:l(g)}return this._isCompound&&r.nodes().forEach(h=>r.setParent(h,l(h))),r}setDefaultEdgeLabel(u){return this._defaultEdgeLabelFn=u,typeof u!="function"&&(this._defaultEdgeLabelFn=()=>u),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(u,r){var o=this,f=arguments;return u.reduce(function(l,h){return f.length>1?o.setEdge(l,h,r):o.setEdge(l,h),h}),this}setEdge(){var u,r,o,f,l=!1,h=arguments[0];typeof h=="object"&&h!==null&&"v"in h?(u=h.v,r=h.w,o=h.name,arguments.length===2&&(f=arguments[1],l=!0)):(u=h,r=arguments[1],o=arguments[3],arguments.length>2&&(f=arguments[2],l=!0)),u=""+u,r=""+r,o!==void 0&&(o=""+o);var g=Qn(this._isDirected,u,r,o);if(Object.hasOwn(this._edgeLabels,g))return l&&(this._edgeLabels[g]=f),this;if(o!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(r),this._edgeLabels[g]=l?f:this._defaultEdgeLabelFn(u,r,o);var v=Ys(this._isDirected,u,r,o);return u=v.v,r=v.w,Object.freeze(v),this._edgeObjs[g]=v,Pu(this._preds[r],u),Pu(this._sucs[u],r),this._in[r][g]=v,this._out[u][g]=v,this._edgeCount++,this}edge(u,r,o){var f=arguments.length===1?Sr(this._isDirected,arguments[0]):Qn(this._isDirected,u,r,o);return this._edgeLabels[f]}edgeAsObj(){const u=this.edge(...arguments);return typeof u!="object"?{label:u}:u}hasEdge(u,r,o){var f=arguments.length===1?Sr(this._isDirected,arguments[0]):Qn(this._isDirected,u,r,o);return Object.hasOwn(this._edgeLabels,f)}removeEdge(u,r,o){var f=arguments.length===1?Sr(this._isDirected,arguments[0]):Qn(this._isDirected,u,r,o),l=this._edgeObjs[f];return l&&(u=l.v,r=l.w,delete this._edgeLabels[f],delete this._edgeObjs[f],$u(this._preds[r],u),$u(this._sucs[u],r),delete this._in[r][f],delete this._out[u][f],this._edgeCount--),this}inEdges(u,r){var o=this._in[u];if(o){var f=Object.values(o);return r?f.filter(l=>l.v===r):f}}outEdges(u,r){var o=this._out[u];if(o){var f=Object.values(o);return r?f.filter(l=>l.w===r):f}}nodeEdges(u,r){var o=this.inEdges(u,r);if(o)return o.concat(this.outEdges(u,r))}};function Pu(i,u){i[u]?i[u]++:i[u]=1}function $u(i,u){--i[u]||delete i[u]}function Qn(i,u,r,o){var f=""+u,l=""+r;if(!i&&f>l){var h=f;f=l,l=h}return f+Nu+l+Nu+(o===void 0?tn:o)}function Ys(i,u,r,o){var f=""+u,l=""+r;if(!i&&f>l){var h=f;f=l,l=h}var g={v:f,w:l};return o&&(g.name=o),g}function Sr(i,u){return Qn(i,u.v,u.w,u.name)}var Ar=js,Vs="2.2.4",Ks={Graph:Ar,version:Vs},Xs=Ar,Zs={write:Js,read:nl};function Js(i){var u={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:Qs(i),edges:el(i)};return i.graph()!==void 0&&(u.value=structuredClone(i.graph())),u}function Qs(i){return i.nodes().map(function(u){var r=i.node(u),o=i.parent(u),f={v:u};return r!==void 0&&(f.value=r),o!==void 0&&(f.parent=o),f})}function el(i){return i.edges().map(function(u){var r=i.edge(u),o={v:u.v,w:u.w};return u.name!==void 0&&(o.name=u.name),r!==void 0&&(o.value=r),o})}function nl(i){var u=new Xs(i.options).setGraph(i.value);return i.nodes.forEach(function(r){u.setNode(r.v,r.value),r.parent&&u.setParent(r.v,r.parent)}),i.edges.forEach(function(r){u.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),u}var tl=rl;function rl(i){var u={},r=[],o;function f(l){Object.hasOwn(u,l)||(u[l]=!0,o.push(l),i.successors(l).forEach(f),i.predecessors(l).forEach(f))}return i.nodes().forEach(function(l){o=[],f(l),o.length&&r.push(o)}),r}var Mu=class{constructor(){de(this,"_arr",[]);de(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(u){return u.key})}has(u){return Object.hasOwn(this._keyIndices,u)}priority(u){var r=this._keyIndices[u];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(u,r){var o=this._keyIndices;if(u=String(u),!Object.hasOwn(o,u)){var f=this._arr,l=f.length;return o[u]=l,f.push({key:u,priority:r}),this._decrease(l),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var u=this._arr.pop();return delete this._keyIndices[u.key],this._heapify(0),u.key}decrease(u,r){var o=this._keyIndices[u];if(r>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+u+" Old: "+this._arr[o].priority+" New: "+r);this._arr[o].priority=r,this._decrease(o)}_heapify(u){var r=this._arr,o=2*u,f=o+1,l=u;o>1,!(r[f].priority1;function al(i,u,r,o){return ol(i,String(u),r||ul,o||function(f){return i.outEdges(f)})}function ol(i,u,r,o){var f={},l=new il,h,g,v=function(w){var y=w.v!==h?w.v:w.w,S=f[y],C=r(w),T=g.distance+C;if(C<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+w+" Weight: "+C);T0&&(h=l.removeMin(),g=f[h],g.distance!==Number.POSITIVE_INFINITY);)o(h).forEach(v);return f}var fl=Fu,sl=ll;function ll(i,u,r){return i.nodes().reduce(function(o,f){return o[f]=fl(i,f,u,r),o},{})}var ku=cl;function cl(i){var u=0,r=[],o={},f=[];function l(h){var g=o[h]={onStack:!0,lowlink:u,index:u++};if(r.push(h),i.successors(h).forEach(function(y){Object.hasOwn(o,y)?o[y].onStack&&(g.lowlink=Math.min(g.lowlink,o[y].index)):(l(y),g.lowlink=Math.min(g.lowlink,o[y].lowlink))}),g.lowlink===g.index){var v=[],w;do w=r.pop(),o[w].onStack=!1,v.push(w);while(h!==w);f.push(v)}}return i.nodes().forEach(function(h){Object.hasOwn(o,h)||l(h)}),f}var hl=ku,dl=pl;function pl(i){return hl(i).filter(function(u){return u.length>1||u.length===1&&i.hasEdge(u[0],u[0])})}var gl=vl,_l=()=>1;function vl(i,u,r){return ml(i,u||_l,r||function(o){return i.outEdges(o)})}function ml(i,u,r){var o={},f=i.nodes();return f.forEach(function(l){o[l]={},o[l][l]={distance:0},f.forEach(function(h){l!==h&&(o[l][h]={distance:Number.POSITIVE_INFINITY})}),r(l).forEach(function(h){var g=h.v===l?h.w:h.v,v=u(h);o[l][g]={distance:v,predecessor:l}})}),f.forEach(function(l){var h=o[l];f.forEach(function(g){var v=o[g];f.forEach(function(w){var y=v[l],S=h[w],C=v[w],T=y.distance+S.distance;Ti.successors(g):g=>i.neighbors(g),f=r==="post"?El:xl,l=[],h={};return u.forEach(g=>{if(!i.hasNode(g))throw new Error("Graph does not have node: "+g);f(g,o,h,l)}),l}function El(i,u,r,o){for(var f=[[i,!1]];f.length>0;){var l=f.pop();l[1]?o.push(l[0]):Object.hasOwn(r,l[0])||(r[l[0]]=!0,f.push([l[0],!0]),Uu(u(l[0]),h=>f.push([h,!1])))}}function xl(i,u,r,o){for(var f=[i];f.length>0;){var l=f.pop();Object.hasOwn(r,l)||(r[l]=!0,o.push(l),Uu(u(l),h=>f.push(h)))}}function Uu(i,u){for(var r=i.length;r--;)u(i[r],r,i);return i}var Ol=Gu,Il=Sl;function Sl(i,u){return Ol(i,u,"post")}var Al=Gu,Cl=Rl;function Rl(i,u){return Al(i,u,"pre")}var Tl=Ar,Ll=Mu,Nl=Pl;function Pl(i,u){var r=new Tl,o={},f=new Ll,l;function h(v){var w=v.v===l?v.w:v.v,y=f.priority(w);if(y!==void 0){var S=u(v);S0;){if(l=f.removeMin(),Object.hasOwn(o,l))r.setEdge(l,o[l]);else{if(g)throw new Error("Input graph is not connected: "+i);g=!0}i.nodeEdges(l).forEach(h)}return r}var $l={components:tl,dijkstra:Fu,dijkstraAll:sl,findCycles:dl,floydWarshall:gl,isAcyclic:wl,postorder:Il,preorder:Cl,prim:Nl,tarjan:ku,topsort:Wu},qu=Ks,He={Graph:qu.Graph,json:Zs,alg:$l,version:qu.version};let Ml=class{constructor(){let u={};u._next=u._prev=u,this._sentinel=u}dequeue(){let u=this._sentinel,r=u._prev;if(r!==u)return zu(r),r}enqueue(u){let r=this._sentinel;u._prev&&u._next&&zu(u),u._next=r._next,r._next._prev=u,r._next=u,u._prev=r}toString(){let u=[],r=this._sentinel,o=r._prev;for(;o!==r;)u.push(JSON.stringify(o,Fl)),o=o._prev;return"["+u.join(", ")+"]"}};function zu(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function Fl(i,u){if(i!=="_next"&&i!=="_prev")return u}var kl=Ml;let Dl=He.Graph,Wl=kl;var Bl=Ul;let Gl=()=>1;function Ul(i,u){if(i.nodeCount()<=1)return[];let r=zl(i,u||Gl);return ql(r.graph,r.buckets,r.zeroIdx).flatMap(f=>i.outEdges(f.v,f.w))}function ql(i,u,r){let o=[],f=u[u.length-1],l=u[0],h;for(;i.nodeCount();){for(;h=l.dequeue();)Rr(i,u,r,h);for(;h=f.dequeue();)Rr(i,u,r,h);if(i.nodeCount()){for(let g=u.length-2;g>0;--g)if(h=u[g].dequeue(),h){o=o.concat(Rr(i,u,r,h,!0));break}}}return o}function Rr(i,u,r,o,f){let l=f?[]:void 0;return i.inEdges(o.v).forEach(h=>{let g=i.edge(h),v=i.node(h.v);f&&l.push({v:h.v,w:h.w}),v.out-=g,Tr(u,r,v)}),i.outEdges(o.v).forEach(h=>{let g=i.edge(h),v=h.w,w=i.node(v);w.in-=g,Tr(u,r,w)}),i.removeNode(o.v),l}function zl(i,u){let r=new Dl,o=0,f=0;i.nodes().forEach(g=>{r.setNode(g,{v:g,in:0,out:0})}),i.edges().forEach(g=>{let v=r.edge(g.v,g.w)||0,w=u(g),y=v+w;r.setEdge(g.v,g.w,y),f=Math.max(f,r.node(g.v).out+=w),o=Math.max(o,r.node(g.w).in+=w)});let l=Hl(f+o+3).map(()=>new Wl),h=o+1;return r.nodes().forEach(g=>{Tr(l,h,r.node(g))}),{graph:r,buckets:l,zeroIdx:h}}function Tr(i,u,r){r.out?r.in?i[r.out-r.in+u].enqueue(r):i[i.length-1].enqueue(r):i[0].enqueue(r)}function Hl(i){const u=[];for(let r=0;ru.setNode(r,i.node(r))),i.edges().forEach(r=>{let o=u.edge(r.v,r.w)||{weight:0,minlen:1},f=i.edge(r);u.setEdge(r.v,r.w,{weight:o.weight+f.weight,minlen:Math.max(o.minlen,f.minlen)})}),u}function Yl(i){let u=new Hu({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(r=>{i.children(r).length||u.setNode(r,i.node(r))}),i.edges().forEach(r=>{u.setEdge(r,i.edge(r))}),u}function Vl(i){let u=i.nodes().map(r=>{let o={};return i.outEdges(r).forEach(f=>{o[f.w]=(o[f.w]||0)+i.edge(f).weight}),o});return Lr(i.nodes(),u)}function Kl(i){let u=i.nodes().map(r=>{let o={};return i.inEdges(r).forEach(f=>{o[f.v]=(o[f.v]||0)+i.edge(f).weight}),o});return Lr(i.nodes(),u)}function Xl(i,u){let r=i.x,o=i.y,f=u.x-r,l=u.y-o,h=i.width/2,g=i.height/2;if(!f&&!l)throw new Error("Not possible to find intersection inside of the rectangle");let v,w;return Math.abs(l)*h>Math.abs(f)*g?(l<0&&(g=-g),v=g*f/l,w=g):(f<0&&(h=-h),v=h,w=h*l/f),{x:r+v,y:o+w}}function Zl(i){let u=Xu(Vu(i)+1).map(()=>[]);return i.nodes().forEach(r=>{let o=i.node(r),f=o.rank;f!==void 0&&(u[f][o.order]=r)}),u}function Jl(i){let u=i.nodes().map(o=>{let f=i.node(o).rank;return f===void 0?Number.MAX_VALUE:f}),r=Ot(Math.min,u);i.nodes().forEach(o=>{let f=i.node(o);Object.hasOwn(f,"rank")&&(f.rank-=r)})}function Ql(i){let u=i.nodes().map(h=>i.node(h).rank),r=Ot(Math.min,u),o=[];i.nodes().forEach(h=>{let g=i.node(h).rank-r;o[g]||(o[g]=[]),o[g].push(h)});let f=0,l=i.graph().nodeRankFactor;Array.from(o).forEach((h,g)=>{h===void 0&&g%l!==0?--f:h!==void 0&&f&&h.forEach(v=>i.node(v).rank+=f)})}function ec(i,u,r,o){let f={width:0,height:0};return arguments.length>=4&&(f.rank=r,f.order=o),ju(i,"border",f,u)}function nc(i,u=Yu){const r=[];for(let o=0;oYu){const r=nc(u);return i.apply(null,r.map(o=>i.apply(null,o)))}else return i.apply(null,u)}function Vu(i){const r=i.nodes().map(o=>{let f=i.node(o).rank;return f===void 0?Number.MIN_VALUE:f});return Ot(Math.max,r)}function tc(i,u){let r={lhs:[],rhs:[]};return i.forEach(o=>{u(o)?r.lhs.push(o):r.rhs.push(o)}),r}function rc(i,u){let r=Date.now();try{return u()}finally{console.log(i+" time: "+(Date.now()-r)+"ms")}}function ic(i,u){return u()}let uc=0;function Ku(i){var u=++uc;return toString(i)+u}function Xu(i,u,r=1){u==null&&(u=i,i=0);let o=l=>luo[u]),Object.entries(i).reduce((o,[f,l])=>(o[f]=r(l,f),o),{})}function Lr(i,u){return i.reduce((r,o,f)=>(r[o]=u[f],r),{})}let fc=Bl,sc=le.uniqueId;var lc={run:cc,undo:dc};function cc(i){(i.graph().acyclicer==="greedy"?fc(i,r(i)):hc(i)).forEach(o=>{let f=i.edge(o);i.removeEdge(o),f.forwardName=o.name,f.reversed=!0,i.setEdge(o.w,o.v,f,sc("rev"))});function r(o){return f=>o.edge(f).weight}}function hc(i){let u=[],r={},o={};function f(l){Object.hasOwn(o,l)||(o[l]=!0,r[l]=!0,i.outEdges(l).forEach(h=>{Object.hasOwn(r,h.w)?u.push(h):f(h.w)}),delete r[l])}return i.nodes().forEach(f),u}function dc(i){i.edges().forEach(u=>{let r=i.edge(u);if(r.reversed){i.removeEdge(u);let o=r.forwardName;delete r.reversed,delete r.forwardName,i.setEdge(u.w,u.v,r,o)}})}let pc=le;var gc={run:_c,undo:mc};function _c(i){i.graph().dummyChains=[],i.edges().forEach(u=>vc(i,u))}function vc(i,u){let r=u.v,o=i.node(r).rank,f=u.w,l=i.node(f).rank,h=u.name,g=i.edge(u),v=g.labelRank;if(l===o+1)return;i.removeEdge(u);let w,y,S;for(S=0,++o;o{let r=i.node(u),o=r.edgeLabel,f;for(i.setEdge(r.edgeObj,o);r.dummy;)f=i.successors(u)[0],i.removeNode(u),o.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),u=f,r=i.node(u)})}const{applyWithChunking:wc}=le;var It={longestPath:bc,slack:yc};function bc(i){var u={};function r(o){var f=i.node(o);if(Object.hasOwn(u,o))return f.rank;u[o]=!0;let l=i.outEdges(o).map(g=>g==null?Number.POSITIVE_INFINITY:r(g.w)-i.edge(g).minlen);var h=wc(Math.min,l);return h===Number.POSITIVE_INFINITY&&(h=0),f.rank=h}i.sources().forEach(r)}function yc(i,u){return i.node(u.w).rank-i.node(u.v).rank-i.edge(u).minlen}var Ec=He.Graph,St=It.slack,Zu=xc;function xc(i){var u=new Ec({directed:!1}),r=i.nodes()[0],o=i.nodeCount();u.setNode(r,{});for(var f,l;Oc(u,i){var l=f.v,h=o===l?f.w:l;!i.hasNode(h)&&!St(u,f)&&(i.setNode(h,{}),i.setEdge(o,h,{}),r(h))})}return i.nodes().forEach(r),i.nodeCount()}function Ic(i,u){return u.edges().reduce((o,f)=>{let l=Number.POSITIVE_INFINITY;return i.hasNode(f.v)!==i.hasNode(f.w)&&(l=St(u,f)),lu.node(o).rank+=r)}var Ac=Zu,Ju=It.slack,Cc=It.longestPath,Rc=He.alg.preorder,Tc=He.alg.postorder,Lc=le.simplify,Nc=In;In.initLowLimValues=Pr,In.initCutValues=Nr,In.calcCutValue=Qu,In.leaveEdge=na,In.enterEdge=ta,In.exchangeEdges=ra;function In(i){i=Lc(i),Cc(i);var u=Ac(i);Pr(u),Nr(u,i);for(var r,o;r=na(u);)o=ta(u,i,r),ra(u,i,r,o)}function Nr(i,u){var r=Tc(i,i.nodes());r=r.slice(0,r.length-1),r.forEach(o=>Pc(i,u,o))}function Pc(i,u,r){var o=i.node(r),f=o.parent;i.edge(r,f).cutvalue=Qu(i,u,r)}function Qu(i,u,r){var o=i.node(r),f=o.parent,l=!0,h=u.edge(r,f),g=0;return h||(l=!1,h=u.edge(f,r)),g=h.weight,u.nodeEdges(r).forEach(v=>{var w=v.v===r,y=w?v.w:v.v;if(y!==f){var S=w===l,C=u.edge(v).weight;if(g+=S?C:-C,Mc(i,r,y)){var T=i.edge(r,y).cutvalue;g+=S?-T:T}}}),g}function Pr(i,u){arguments.length<2&&(u=i.nodes()[0]),ea(i,{},1,u)}function ea(i,u,r,o,f){var l=r,h=i.node(o);return u[o]=!0,i.neighbors(o).forEach(g=>{Object.hasOwn(u,g)||(r=ea(i,u,r,g,o))}),h.low=l,h.lim=r++,f?h.parent=f:delete h.parent,r}function na(i){return i.edges().find(u=>i.edge(u).cutvalue<0)}function ta(i,u,r){var o=r.v,f=r.w;u.hasEdge(o,f)||(o=r.w,f=r.v);var l=i.node(o),h=i.node(f),g=l,v=!1;l.lim>h.lim&&(g=h,v=!0);var w=u.edges().filter(y=>v===ia(i,i.node(y.v),g)&&v!==ia(i,i.node(y.w),g));return w.reduce((y,S)=>Ju(u,S)!u.node(f).parent),o=Rc(i,r);o=o.slice(1),o.forEach(f=>{var l=i.node(f).parent,h=u.edge(f,l),g=!1;h||(h=u.edge(l,f),g=!0),u.node(f).rank=u.node(l).rank+(g?h.minlen:-h.minlen)})}function Mc(i,u,r){return i.hasEdge(u,r)}function ia(i,u,r){return r.low<=u.lim&&u.lim<=r.lim}var Fc=It,ua=Fc.longestPath,kc=Zu,Dc=Nc,Wc=Bc;function Bc(i){switch(i.graph().ranker){case"network-simplex":aa(i);break;case"tight-tree":Uc(i);break;case"longest-path":Gc(i);break;default:aa(i)}}var Gc=ua;function Uc(i){ua(i),kc(i)}function aa(i){Dc(i)}var qc=zc;function zc(i){let u=jc(i);i.graph().dummyChains.forEach(r=>{let o=i.node(r),f=o.edgeObj,l=Hc(i,u,f.v,f.w),h=l.path,g=l.lca,v=0,w=h[v],y=!0;for(;r!==f.w;){if(o=i.node(r),y){for(;(w=h[v])!==g&&i.node(w).maxRankh||g>u[v].lim));for(w=v,v=o;(v=i.parent(v))!==w;)l.push(v);return{path:f.concat(l.reverse()),lca:w}}function jc(i){let u={},r=0;function o(f){let l=r;i.children(f).forEach(o),u[f]={low:l,lim:r++}}return i.children().forEach(o),u}let At=le;var Yc={run:Vc,cleanup:Zc};function Vc(i){let u=At.addDummyNode(i,"root",{},"_root"),r=Kc(i),o=Object.values(r),f=At.applyWithChunking(Math.max,o)-1,l=2*f+1;i.graph().nestingRoot=u,i.edges().forEach(g=>i.edge(g).minlen*=l);let h=Xc(i)+1;i.children().forEach(g=>oa(i,u,l,h,f,r,g)),i.graph().nodeRankFactor=l}function oa(i,u,r,o,f,l,h){let g=i.children(h);if(!g.length){h!==u&&i.setEdge(u,h,{weight:0,minlen:r});return}let v=At.addBorderNode(i,"_bt"),w=At.addBorderNode(i,"_bb"),y=i.node(h);i.setParent(v,h),y.borderTop=v,i.setParent(w,h),y.borderBottom=w,g.forEach(S=>{oa(i,u,r,o,f,l,S);let C=i.node(S),T=C.borderTop?C.borderTop:S,U=C.borderBottom?C.borderBottom:S,K=C.borderTop?o:2*o,k=T!==U?1:f-l[h]+1;i.setEdge(v,T,{weight:K,minlen:k,nestingEdge:!0}),i.setEdge(U,w,{weight:K,minlen:k,nestingEdge:!0})}),i.parent(h)||i.setEdge(u,v,{weight:0,minlen:f+l[h]})}function Kc(i){var u={};function r(o,f){var l=i.children(o);l&&l.length&&l.forEach(h=>r(h,f+1)),u[o]=f}return i.children().forEach(o=>r(o,1)),u}function Xc(i){return i.edges().reduce((u,r)=>u+i.edge(r).weight,0)}function Zc(i){var u=i.graph();i.removeNode(u.nestingRoot),delete u.nestingRoot,i.edges().forEach(r=>{var o=i.edge(r);o.nestingEdge&&i.removeEdge(r)})}let Jc=le;var Qc=eh;function eh(i){function u(r){let o=i.children(r),f=i.node(r);if(o.length&&o.forEach(u),Object.hasOwn(f,"minRank")){f.borderLeft=[],f.borderRight=[];for(let l=f.minRank,h=f.maxRank+1;lla(i.node(u))),i.edges().forEach(u=>la(i.edge(u)))}function la(i){let u=i.width;i.width=i.height,i.height=u}function ih(i){i.nodes().forEach(u=>$r(i.node(u))),i.edges().forEach(u=>{let r=i.edge(u);r.points.forEach($r),Object.hasOwn(r,"y")&&$r(r)})}function $r(i){i.y=-i.y}function uh(i){i.nodes().forEach(u=>Mr(i.node(u))),i.edges().forEach(u=>{let r=i.edge(u);r.points.forEach(Mr),Object.hasOwn(r,"x")&&Mr(r)})}function Mr(i){let u=i.x;i.x=i.y,i.y=u}let ca=le;var ah=oh;function oh(i){let u={},r=i.nodes().filter(v=>!i.children(v).length),o=r.map(v=>i.node(v).rank),f=ca.applyWithChunking(Math.max,o),l=ca.range(f+1).map(()=>[]);function h(v){if(u[v])return;u[v]=!0;let w=i.node(v);l[w.rank].push(v),i.successors(v).forEach(h)}return r.sort((v,w)=>i.node(v).rank-i.node(w).rank).forEach(h),l}let fh=le.zipObject;var sh=lh;function lh(i,u){let r=0;for(let o=1;oy)),f=u.flatMap(w=>i.outEdges(w).map(y=>({pos:o[y.w],weight:i.edge(y).weight})).sort((y,S)=>y.pos-S.pos)),l=1;for(;l{let y=w.pos+l;g[y]+=w.weight;let S=0;for(;y>0;)y%2&&(S+=g[y+1]),y=y-1>>1,g[y]+=w.weight;v+=w.weight*S}),v}var hh=dh;function dh(i,u=[]){return u.map(r=>{let o=i.inEdges(r);if(o.length){let f=o.reduce((l,h)=>{let g=i.edge(h),v=i.node(h.v);return{sum:l.sum+g.weight*v.order,weight:l.weight+g.weight}},{sum:0,weight:0});return{v:r,barycenter:f.sum/f.weight,weight:f.weight}}else return{v:r}})}let ph=le;var gh=_h;function _h(i,u){let r={};i.forEach((f,l)=>{let h=r[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:l};f.barycenter!==void 0&&(h.barycenter=f.barycenter,h.weight=f.weight)}),u.edges().forEach(f=>{let l=r[f.v],h=r[f.w];l!==void 0&&h!==void 0&&(h.indegree++,l.out.push(r[f.w]))});let o=Object.values(r).filter(f=>!f.indegree);return vh(o)}function vh(i){let u=[];function r(f){return l=>{l.merged||(l.barycenter===void 0||f.barycenter===void 0||l.barycenter>=f.barycenter)&&mh(f,l)}}function o(f){return l=>{l.in.push(f),--l.indegree===0&&i.push(l)}}for(;i.length;){let f=i.pop();u.push(f),f.in.reverse().forEach(r(f)),f.out.forEach(o(f))}return u.filter(f=>!f.merged).map(f=>ph.pick(f,["vs","i","barycenter","weight"]))}function mh(i,u){let r=0,o=0;i.weight&&(r+=i.barycenter*i.weight,o+=i.weight),u.weight&&(r+=u.barycenter*u.weight,o+=u.weight),i.vs=u.vs.concat(i.vs),i.barycenter=r/o,i.weight=o,i.i=Math.min(u.i,i.i),u.merged=!0}let wh=le;var bh=yh;function yh(i,u){let r=wh.partition(i,y=>Object.hasOwn(y,"barycenter")),o=r.lhs,f=r.rhs.sort((y,S)=>S.i-y.i),l=[],h=0,g=0,v=0;o.sort(Eh(!!u)),v=ha(l,f,v),o.forEach(y=>{v+=y.vs.length,l.push(y.vs),h+=y.barycenter*y.weight,g+=y.weight,v=ha(l,f,v)});let w={vs:l.flat(!0)};return g&&(w.barycenter=h/g,w.weight=g),w}function ha(i,u,r){let o;for(;u.length&&(o=u[u.length-1]).i<=r;)u.pop(),i.push(o.vs),r++;return r}function Eh(i){return(u,r)=>u.barycenterr.barycenter?1:i?r.i-u.i:u.i-r.i}let xh=hh,Oh=gh,Ih=bh;var Sh=da;function da(i,u,r,o){let f=i.children(u),l=i.node(u),h=l?l.borderLeft:void 0,g=l?l.borderRight:void 0,v={};h&&(f=f.filter(C=>C!==h&&C!==g));let w=xh(i,f);w.forEach(C=>{if(i.children(C.v).length){let T=da(i,C.v,r,o);v[C.v]=T,Object.hasOwn(T,"barycenter")&&Ch(C,T)}});let y=Oh(w,r);Ah(y,v);let S=Ih(y,o);if(h&&(S.vs=[h,S.vs,g].flat(!0),i.predecessors(h).length)){let C=i.node(i.predecessors(h)[0]),T=i.node(i.predecessors(g)[0]);Object.hasOwn(S,"barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+C.order+T.order)/(S.weight+2),S.weight+=2}return S}function Ah(i,u){i.forEach(r=>{r.vs=r.vs.flatMap(o=>u[o]?u[o].vs:o)})}function Ch(i,u){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+u.barycenter*u.weight)/(i.weight+u.weight),i.weight+=u.weight):(i.barycenter=u.barycenter,i.weight=u.weight)}let Rh=He.Graph,Th=le;var Lh=Nh;function Nh(i,u,r){let o=Ph(i),f=new Rh({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(l=>i.node(l));return i.nodes().forEach(l=>{let h=i.node(l),g=i.parent(l);(h.rank===u||h.minRank<=u&&u<=h.maxRank)&&(f.setNode(l),f.setParent(l,g||o),i[r](l).forEach(v=>{let w=v.v===l?v.w:v.v,y=f.edge(w,l),S=y!==void 0?y.weight:0;f.setEdge(w,l,{weight:i.edge(v).weight+S})}),Object.hasOwn(h,"minRank")&&f.setNode(l,{borderLeft:h.borderLeft[u],borderRight:h.borderRight[u]}))}),f}function Ph(i){for(var u;i.hasNode(u=Th.uniqueId("_root")););return u}var $h=Mh;function Mh(i,u,r){let o={},f;r.forEach(l=>{let h=i.parent(l),g,v;for(;h;){if(g=i.parent(h),g?(v=o[g],o[g]=h):(v=f,f=h),v&&v!==h){u.setEdge(v,h);return}h=g}})}let Fh=ah,kh=sh,Dh=Sh,Wh=Lh,Bh=$h,Gh=He.Graph,Ct=le;var Uh=pa;function pa(i,u){if(u&&typeof u.customOrder=="function"){u.customOrder(i,pa);return}let r=Ct.maxRank(i),o=ga(i,Ct.range(1,r+1),"inEdges"),f=ga(i,Ct.range(r-1,-1,-1),"outEdges"),l=Fh(i);if(_a(i,l),u&&u.disableOptimalOrderHeuristic)return;let h=Number.POSITIVE_INFINITY,g;for(let v=0,w=0;w<4;++v,++w){qh(v%2?o:f,v%4>=2),l=Ct.buildLayerMatrix(i);let y=kh(i,l);yo.node(h).order=g),Bh(o,r,l.vs)})}function _a(i,u){Object.values(u).forEach(r=>r.forEach((o,f)=>i.node(o).order=f))}let zh=He.Graph,rn=le;var Hh={positionX:Vh,findType1Conflicts:va,findType2Conflicts:ma,addConflict:Fr,hasConflict:wa,verticalAlignment:ba,horizontalCompaction:ya,alignCoordinates:xa,findSmallestWidthAlignment:Ea,balance:Oa};function va(i,u){let r={};function o(f,l){let h=0,g=0,v=f.length,w=l[l.length-1];return l.forEach((y,S)=>{let C=jh(i,y),T=C?i.node(C).order:v;(C||y===w)&&(l.slice(g,S+1).forEach(U=>{i.predecessors(U).forEach(K=>{let k=i.node(K),ce=k.order;(ce{y=l[S],i.node(y).dummy&&i.predecessors(y).forEach(C=>{let T=i.node(C);T.dummy&&(T.orderw)&&Fr(r,C,y)})})}function f(l,h){let g=-1,v,w=0;return h.forEach((y,S)=>{if(i.node(y).dummy==="border"){let C=i.predecessors(y);C.length&&(v=i.node(C[0]).order,o(h,w,S,g,v),w=S,g=v)}o(h,w,h.length,v,l.length)}),h}return u.length&&u.reduce(f),r}function jh(i,u){if(i.node(u).dummy)return i.predecessors(u).find(r=>i.node(r).dummy)}function Fr(i,u,r){if(u>r){let f=u;u=r,r=f}let o=i[u];o||(i[u]=o={}),o[r]=!0}function wa(i,u,r){if(u>r){let o=u;u=r,r=o}return!!i[u]&&Object.hasOwn(i[u],r)}function ba(i,u,r,o){let f={},l={},h={};return u.forEach(g=>{g.forEach((v,w)=>{f[v]=v,l[v]=v,h[v]=w})}),u.forEach(g=>{let v=-1;g.forEach(w=>{let y=o(w);if(y.length){y=y.sort((C,T)=>h[C]-h[T]);let S=(y.length-1)/2;for(let C=Math.floor(S),T=Math.ceil(S);C<=T;++C){let U=y[C];l[w]===w&&vMath.max(C,l[T.v]+h.edge(T)),0)}function y(S){let C=h.outEdges(S).reduce((U,K)=>Math.min(U,l[K.w]-h.edge(K)),Number.POSITIVE_INFINITY),T=i.node(S);C!==Number.POSITIVE_INFINITY&&T.borderType!==g&&(l[S]=Math.max(l[S],C))}return v(w,h.predecessors.bind(h)),v(y,h.successors.bind(h)),Object.keys(o).forEach(S=>l[S]=l[r[S]]),l}function Yh(i,u,r,o){let f=new zh,l=i.graph(),h=Kh(l.nodesep,l.edgesep,o);return u.forEach(g=>{let v;g.forEach(w=>{let y=r[w];if(f.setNode(y),v){var S=r[v],C=f.edge(S,y);f.setEdge(S,y,Math.max(h(i,w,v),C||0))}v=w})}),f}function Ea(i,u){return Object.values(u).reduce((r,o)=>{let f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;Object.entries(o).forEach(([g,v])=>{let w=Xh(i,g)/2;f=Math.max(v+w,f),l=Math.min(v-w,l)});const h=f-l;return h{["l","r"].forEach(h=>{let g=l+h,v=i[g];if(v===u)return;let w=Object.values(v),y=o-rn.applyWithChunking(Math.min,w);h!=="l"&&(y=f-rn.applyWithChunking(Math.max,w)),y&&(i[g]=rn.mapValues(v,S=>S+y))})})}function Oa(i,u){return rn.mapValues(i.ul,(r,o)=>{if(u)return i[u.toLowerCase()][o];{let f=Object.values(i).map(l=>l[o]).sort((l,h)=>l-h);return(f[1]+f[2])/2}})}function Vh(i){let u=rn.buildLayerMatrix(i),r=Object.assign(va(i,u),ma(i,u)),o={},f;["u","d"].forEach(h=>{f=h==="u"?u:Object.values(u).reverse(),["l","r"].forEach(g=>{g==="r"&&(f=f.map(S=>Object.values(S).reverse()));let v=(h==="u"?i.predecessors:i.successors).bind(i),w=ba(i,f,r,v),y=ya(i,f,w.root,w.align,g==="r");g==="r"&&(y=rn.mapValues(y,S=>-S)),o[h+g]=y})});let l=Ea(i,o);return xa(o,l),Oa(o,i.graph().align)}function Kh(i,u,r){return(o,f,l)=>{let h=o.node(f),g=o.node(l),v=0,w;if(v+=h.width/2,Object.hasOwn(h,"labelpos"))switch(h.labelpos.toLowerCase()){case"l":w=-h.width/2;break;case"r":w=h.width/2;break}if(w&&(v+=r?w:-w),w=0,v+=(h.dummy?u:i)/2,v+=(g.dummy?u:i)/2,v+=g.width/2,Object.hasOwn(g,"labelpos"))switch(g.labelpos.toLowerCase()){case"l":w=g.width/2;break;case"r":w=-g.width/2;break}return w&&(v+=r?w:-w),w=0,v}}function Xh(i,u){return i.node(u).width}let Ia=le,Zh=Hh.positionX;var Jh=Qh;function Qh(i){i=Ia.asNonCompoundGraph(i),ed(i),Object.entries(Zh(i)).forEach(([u,r])=>i.node(u).x=r)}function ed(i){let u=Ia.buildLayerMatrix(i),r=i.graph().ranksep,o=0;u.forEach(f=>{const l=f.reduce((h,g)=>{const v=i.node(g).height;return h>v?h:v},0);f.forEach(h=>i.node(h).y=o+l/2),o+=l+r})}let Sa=lc,Aa=gc,nd=Wc,td=le.normalizeRanks,rd=qc,id=le.removeEmptyRanks,Ca=Yc,ud=Qc,Ra=nh,ad=Uh,od=Jh,Me=le,fd=He.Graph;var sd=ld;function ld(i,u){let r=u&&u.debugTiming?Me.time:Me.notime;r("layout",()=>{let o=r(" buildLayoutGraph",()=>bd(i));r(" runLayout",()=>cd(o,r,u)),r(" updateInputGraph",()=>hd(i,o))})}function cd(i,u,r){u(" makeSpaceForEdgeLabels",()=>yd(i)),u(" removeSelfEdges",()=>Td(i)),u(" acyclic",()=>Sa.run(i)),u(" nestingGraph.run",()=>Ca.run(i)),u(" rank",()=>nd(Me.asNonCompoundGraph(i))),u(" injectEdgeLabelProxies",()=>Ed(i)),u(" removeEmptyRanks",()=>id(i)),u(" nestingGraph.cleanup",()=>Ca.cleanup(i)),u(" normalizeRanks",()=>td(i)),u(" assignRankMinMax",()=>xd(i)),u(" removeEdgeLabelProxies",()=>Od(i)),u(" normalize.run",()=>Aa.run(i)),u(" parentDummyChains",()=>rd(i)),u(" addBorderSegments",()=>ud(i)),u(" order",()=>ad(i,r)),u(" insertSelfEdges",()=>Ld(i)),u(" adjustCoordinateSystem",()=>Ra.adjust(i)),u(" position",()=>od(i)),u(" positionSelfEdges",()=>Nd(i)),u(" removeBorderNodes",()=>Rd(i)),u(" normalize.undo",()=>Aa.undo(i)),u(" fixupEdgeLabelCoords",()=>Ad(i)),u(" undoCoordinateSystem",()=>Ra.undo(i)),u(" translateGraph",()=>Id(i)),u(" assignNodeIntersects",()=>Sd(i)),u(" reversePoints",()=>Cd(i)),u(" acyclic.undo",()=>Sa.undo(i))}function hd(i,u){i.nodes().forEach(r=>{let o=i.node(r),f=u.node(r);o&&(o.x=f.x,o.y=f.y,o.rank=f.rank,u.children(r).length&&(o.width=f.width,o.height=f.height))}),i.edges().forEach(r=>{let o=i.edge(r),f=u.edge(r);o.points=f.points,Object.hasOwn(f,"x")&&(o.x=f.x,o.y=f.y)}),i.graph().width=u.graph().width,i.graph().height=u.graph().height}let dd=["nodesep","edgesep","ranksep","marginx","marginy"],pd={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},gd=["acyclicer","ranker","rankdir","align"],_d=["width","height"],Ta={width:0,height:0},vd=["minlen","weight","width","height","labeloffset"],md={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},wd=["labelpos"];function bd(i){let u=new fd({multigraph:!0,compound:!0}),r=Dr(i.graph());return u.setGraph(Object.assign({},pd,kr(r,dd),Me.pick(r,gd))),i.nodes().forEach(o=>{let f=Dr(i.node(o));const l=kr(f,_d);Object.keys(Ta).forEach(h=>{l[h]===void 0&&(l[h]=Ta[h])}),u.setNode(o,l),u.setParent(o,i.parent(o))}),i.edges().forEach(o=>{let f=Dr(i.edge(o));u.setEdge(o,Object.assign({},md,kr(f,vd),Me.pick(f,wd)))}),u}function yd(i){let u=i.graph();u.ranksep/=2,i.edges().forEach(r=>{let o=i.edge(r);o.minlen*=2,o.labelpos.toLowerCase()!=="c"&&(u.rankdir==="TB"||u.rankdir==="BT"?o.width+=o.labeloffset:o.height+=o.labeloffset)})}function Ed(i){i.edges().forEach(u=>{let r=i.edge(u);if(r.width&&r.height){let o=i.node(u.v),l={rank:(i.node(u.w).rank-o.rank)/2+o.rank,e:u};Me.addDummyNode(i,"edge-proxy",l,"_ep")}})}function xd(i){let u=0;i.nodes().forEach(r=>{let o=i.node(r);o.borderTop&&(o.minRank=i.node(o.borderTop).rank,o.maxRank=i.node(o.borderBottom).rank,u=Math.max(u,o.maxRank))}),i.graph().maxRank=u}function Od(i){i.nodes().forEach(u=>{let r=i.node(u);r.dummy==="edge-proxy"&&(i.edge(r.e).labelRank=r.rank,i.removeNode(u))})}function Id(i){let u=Number.POSITIVE_INFINITY,r=0,o=Number.POSITIVE_INFINITY,f=0,l=i.graph(),h=l.marginx||0,g=l.marginy||0;function v(w){let y=w.x,S=w.y,C=w.width,T=w.height;u=Math.min(u,y-C/2),r=Math.max(r,y+C/2),o=Math.min(o,S-T/2),f=Math.max(f,S+T/2)}i.nodes().forEach(w=>v(i.node(w))),i.edges().forEach(w=>{let y=i.edge(w);Object.hasOwn(y,"x")&&v(y)}),u-=h,o-=g,i.nodes().forEach(w=>{let y=i.node(w);y.x-=u,y.y-=o}),i.edges().forEach(w=>{let y=i.edge(w);y.points.forEach(S=>{S.x-=u,S.y-=o}),Object.hasOwn(y,"x")&&(y.x-=u),Object.hasOwn(y,"y")&&(y.y-=o)}),l.width=r-u+h,l.height=f-o+g}function Sd(i){i.edges().forEach(u=>{let r=i.edge(u),o=i.node(u.v),f=i.node(u.w),l,h;r.points?(l=r.points[0],h=r.points[r.points.length-1]):(r.points=[],l=f,h=o),r.points.unshift(Me.intersectRect(o,l)),r.points.push(Me.intersectRect(f,h))})}function Ad(i){i.edges().forEach(u=>{let r=i.edge(u);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Cd(i){i.edges().forEach(u=>{let r=i.edge(u);r.reversed&&r.points.reverse()})}function Rd(i){i.nodes().forEach(u=>{if(i.children(u).length){let r=i.node(u),o=i.node(r.borderTop),f=i.node(r.borderBottom),l=i.node(r.borderLeft[r.borderLeft.length-1]),h=i.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(h.x-l.x),r.height=Math.abs(f.y-o.y),r.x=l.x+r.width/2,r.y=o.y+r.height/2}}),i.nodes().forEach(u=>{i.node(u).dummy==="border"&&i.removeNode(u)})}function Td(i){i.edges().forEach(u=>{if(u.v===u.w){var r=i.node(u.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:u,label:i.edge(u)}),i.removeEdge(u)}})}function Ld(i){var u=Me.buildLayerMatrix(i);u.forEach(r=>{var o=0;r.forEach((f,l)=>{var h=i.node(f);h.order=l+o,(h.selfEdges||[]).forEach(g=>{Me.addDummyNode(i,"selfedge",{width:g.label.width,height:g.label.height,rank:h.rank,order:l+ ++o,e:g.e,label:g.label},"_se")}),delete h.selfEdges})})}function Nd(i){i.nodes().forEach(u=>{var r=i.node(u);if(r.dummy==="selfedge"){var o=i.node(r.e.v),f=o.x+o.width/2,l=o.y,h=r.x-f,g=o.height/2;i.setEdge(r.e,r.label),i.removeNode(u),r.label.points=[{x:f+2*h/3,y:l-g},{x:f+5*h/6,y:l-g},{x:f+h,y:l},{x:f+5*h/6,y:l+g},{x:f+2*h/3,y:l+g}],r.label.x=r.x,r.label.y=r.y}})}function kr(i,u){return Me.mapValues(Me.pick(i,u),Number)}function Dr(i){var u={};return i&&Object.entries(i).forEach(([r,o])=>{typeof r=="string"&&(r=r.toLowerCase()),u[r]=o}),u}let Pd=le,$d=He.Graph;var Md={debugOrdering:Fd};function Fd(i){let u=Pd.buildLayerMatrix(i),r=new $d({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(o=>{r.setNode(o,{label:o}),r.setParent(o,"layer"+i.node(o).rank)}),i.edges().forEach(o=>r.setEdge(o.v,o.w,{},o.name)),u.forEach((o,f)=>{let l="layer"+f;r.setNode(l,{rank:"same"}),o.reduce((h,g)=>(r.setEdge(h,g,{style:"invis"}),g))}),r}var kd="1.1.4",La={graphlib:He,layout:sd,debug:Md,util:{time:le.time,notime:le.notime},version:kd},Rt={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 - */Rt.exports,function(i,u){(function(){var r,o="4.17.21",f=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",h="Expected a function",g="Invalid `variable` option passed into `_.template`",v="__lodash_hash_undefined__",w=500,y="__lodash_placeholder__",S=1,C=2,T=4,U=1,K=2,k=1,ce=2,B=4,P=8,j=16,J=32,ee=64,re=128,he=256,li=512,jp=30,Yp="...",Vp=800,Kp=16,ho=1,Xp=2,Zp=3,Sn=1/0,gn=9007199254740991,Jp=17976931348623157e292,Pt=NaN,Je=4294967295,Qp=Je-1,eg=Je>>>1,ng=[["ary",re],["bind",k],["bindKey",ce],["curry",P],["curryRight",j],["flip",li],["partial",J],["partialRight",ee],["rearg",he]],kn="[object Arguments]",$t="[object Array]",tg="[object AsyncFunction]",tt="[object Boolean]",rt="[object Date]",rg="[object DOMException]",Mt="[object Error]",Ft="[object Function]",po="[object GeneratorFunction]",je="[object Map]",it="[object Number]",ig="[object Null]",un="[object Object]",go="[object Promise]",ug="[object Proxy]",ut="[object RegExp]",Ye="[object Set]",at="[object String]",kt="[object Symbol]",ag="[object Undefined]",ot="[object WeakMap]",og="[object WeakSet]",ft="[object ArrayBuffer]",Dn="[object DataView]",ci="[object Float32Array]",hi="[object Float64Array]",di="[object Int8Array]",pi="[object Int16Array]",gi="[object Int32Array]",_i="[object Uint8Array]",vi="[object Uint8ClampedArray]",mi="[object Uint16Array]",wi="[object Uint32Array]",fg=/\b__p \+= '';/g,sg=/\b(__p \+=) '' \+/g,lg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_o=/&(?:amp|lt|gt|quot|#39);/g,vo=/[&<>"']/g,cg=RegExp(_o.source),hg=RegExp(vo.source),dg=/<%-([\s\S]+?)%>/g,pg=/<%([\s\S]+?)%>/g,mo=/<%=([\s\S]+?)%>/g,gg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_g=/^\w*$/,vg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bi=/[\\^$.*+?()[\]{}|]/g,mg=RegExp(bi.source),yi=/^\s+/,wg=/\s/,bg=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,yg=/\{\n\/\* \[wrapped with (.+)\] \*/,Eg=/,? & /,xg=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Og=/[()=,{}\[\]\/\s]/,Ig=/\\(\\)?/g,Sg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wo=/\w*$/,Ag=/^[-+]0x[0-9a-f]+$/i,Cg=/^0b[01]+$/i,Rg=/^\[object .+?Constructor\]$/,Tg=/^0o[0-7]+$/i,Lg=/^(?:0|[1-9]\d*)$/,Ng=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dt=/($^)/,Pg=/['\n\r\u2028\u2029\\]/g,Wt="\\ud800-\\udfff",$g="\\u0300-\\u036f",Mg="\\ufe20-\\ufe2f",Fg="\\u20d0-\\u20ff",bo=$g+Mg+Fg,yo="\\u2700-\\u27bf",Eo="a-z\\xdf-\\xf6\\xf8-\\xff",kg="\\xac\\xb1\\xd7\\xf7",Dg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wg="\\u2000-\\u206f",Bg=" \\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",xo="A-Z\\xc0-\\xd6\\xd8-\\xde",Oo="\\ufe0e\\ufe0f",Io=kg+Dg+Wg+Bg,Ei="['’]",Gg="["+Wt+"]",So="["+Io+"]",Bt="["+bo+"]",Ao="\\d+",Ug="["+yo+"]",Co="["+Eo+"]",Ro="[^"+Wt+Io+Ao+yo+Eo+xo+"]",xi="\\ud83c[\\udffb-\\udfff]",qg="(?:"+Bt+"|"+xi+")",To="[^"+Wt+"]",Oi="(?:\\ud83c[\\udde6-\\uddff]){2}",Ii="[\\ud800-\\udbff][\\udc00-\\udfff]",Wn="["+xo+"]",Lo="\\u200d",No="(?:"+Co+"|"+Ro+")",zg="(?:"+Wn+"|"+Ro+")",Po="(?:"+Ei+"(?:d|ll|m|re|s|t|ve))?",$o="(?:"+Ei+"(?:D|LL|M|RE|S|T|VE))?",Mo=qg+"?",Fo="["+Oo+"]?",Hg="(?:"+Lo+"(?:"+[To,Oi,Ii].join("|")+")"+Fo+Mo+")*",jg="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ko=Fo+Mo+Hg,Vg="(?:"+[Ug,Oi,Ii].join("|")+")"+ko,Kg="(?:"+[To+Bt+"?",Bt,Oi,Ii,Gg].join("|")+")",Xg=RegExp(Ei,"g"),Zg=RegExp(Bt,"g"),Si=RegExp(xi+"(?="+xi+")|"+Kg+ko,"g"),Jg=RegExp([Wn+"?"+Co+"+"+Po+"(?="+[So,Wn,"$"].join("|")+")",zg+"+"+$o+"(?="+[So,Wn+No,"$"].join("|")+")",Wn+"?"+No+"+"+Po,Wn+"+"+$o,Yg,jg,Ao,Vg].join("|"),"g"),Qg=RegExp("["+Lo+Wt+bo+Oo+"]"),e_=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,n_=["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"],t_=-1,ie={};ie[ci]=ie[hi]=ie[di]=ie[pi]=ie[gi]=ie[_i]=ie[vi]=ie[mi]=ie[wi]=!0,ie[kn]=ie[$t]=ie[ft]=ie[tt]=ie[Dn]=ie[rt]=ie[Mt]=ie[Ft]=ie[je]=ie[it]=ie[un]=ie[ut]=ie[Ye]=ie[at]=ie[ot]=!1;var te={};te[kn]=te[$t]=te[ft]=te[Dn]=te[tt]=te[rt]=te[ci]=te[hi]=te[di]=te[pi]=te[gi]=te[je]=te[it]=te[un]=te[ut]=te[Ye]=te[at]=te[kt]=te[_i]=te[vi]=te[mi]=te[wi]=!0,te[Mt]=te[Ft]=te[ot]=!1;var r_={À:"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"},i_={"&":"&","<":"<",">":">",'"':""","'":"'"},u_={"&":"&","<":"<",">":">",""":'"',"'":"'"},a_={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},o_=parseFloat,f_=parseInt,Do=typeof ze=="object"&&ze&&ze.Object===Object&&ze,s_=typeof self=="object"&&self&&self.Object===Object&&self,ve=Do||s_||Function("return this")(),Ai=u&&!u.nodeType&&u,An=Ai&&!0&&i&&!i.nodeType&&i,Wo=An&&An.exports===Ai,Ci=Wo&&Do.process,Fe=function(){try{var m=An&&An.require&&An.require("util").types;return m||Ci&&Ci.binding&&Ci.binding("util")}catch{}}(),Bo=Fe&&Fe.isArrayBuffer,Go=Fe&&Fe.isDate,Uo=Fe&&Fe.isMap,qo=Fe&&Fe.isRegExp,zo=Fe&&Fe.isSet,Ho=Fe&&Fe.isTypedArray;function Ce(m,x,E){switch(E.length){case 0:return m.call(x);case 1:return m.call(x,E[0]);case 2:return m.call(x,E[0],E[1]);case 3:return m.call(x,E[0],E[1],E[2])}return m.apply(x,E)}function l_(m,x,E,L){for(var D=-1,X=m==null?0:m.length;++D-1}function Ri(m,x,E){for(var L=-1,D=m==null?0:m.length;++L-1;);return E}function Qo(m,x){for(var E=m.length;E--&&Bn(x,m[E],0)>-1;);return E}function w_(m,x){for(var E=m.length,L=0;E--;)m[E]===x&&++L;return L}var b_=Pi(r_),y_=Pi(i_);function E_(m){return"\\"+a_[m]}function x_(m,x){return m==null?r:m[x]}function Gn(m){return Qg.test(m)}function O_(m){return e_.test(m)}function I_(m){for(var x,E=[];!(x=m.next()).done;)E.push(x.value);return E}function ki(m){var x=-1,E=Array(m.size);return m.forEach(function(L,D){E[++x]=[D,L]}),E}function ef(m,x){return function(E){return m(x(E))}}function mn(m,x){for(var E=-1,L=m.length,D=0,X=[];++E-1}function hv(e,n){var t=this.__data__,a=ir(t,e);return a<0?(++this.size,t.push([e,n])):t[a][1]=n,this}an.prototype.clear=fv,an.prototype.delete=sv,an.prototype.get=lv,an.prototype.has=cv,an.prototype.set=hv;function on(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n=n?e:n)),e}function Be(e,n,t,a,s,d){var p,_=n&S,b=n&C,O=n&T;if(t&&(p=s?t(e,a,s,d):t(e)),p!==r)return p;if(!ae(e))return e;var I=W(e);if(I){if(p=_0(e),!_)return Oe(e,p)}else{var A=be(e),R=A==Ft||A==po;if(On(e))return kf(e,_);if(A==un||A==kn||R&&!s){if(p=b||R?{}:ts(e),!_)return b?u0(e,Cv(p,e)):i0(e,df(p,e))}else{if(!te[A])return s?e:{};p=v0(e,A,_)}}d||(d=new Ke);var N=d.get(e);if(N)return N;d.set(e,p),Ls(e)?e.forEach(function(F){p.add(Be(F,n,t,F,e,d))}):Rs(e)&&e.forEach(function(F,H){p.set(H,Be(F,n,t,H,e,d))});var M=O?b?su:fu:b?Se:_e,q=I?r:M(e);return ke(q||e,function(F,H){q&&(H=F,F=e[H]),gt(p,H,Be(F,n,t,H,e,d))}),p}function Rv(e){var n=_e(e);return function(t){return pf(t,e,n)}}function pf(e,n,t){var a=t.length;if(e==null)return!a;for(e=ne(e);a--;){var s=t[a],d=n[s],p=e[s];if(p===r&&!(s in e)||!d(p))return!1}return!0}function gf(e,n,t){if(typeof e!="function")throw new De(h);return Et(function(){e.apply(r,t)},n)}function _t(e,n,t,a){var s=-1,d=Gt,p=!0,_=e.length,b=[],O=n.length;if(!_)return b;t&&(n=ue(n,Re(t))),a?(d=Ri,p=!1):n.length>=f&&(d=st,p=!1,n=new Tn(n));e:for(;++s<_;){var I=e[s],A=t==null?I:t(I);if(I=a||I!==0?I:0,p&&A===A){for(var R=O;R--;)if(n[R]===A)continue e;b.push(I)}else d(n,A,a)||b.push(I)}return b}var bn=Uf(Qe),_f=Uf(Hi,!0);function Tv(e,n){var t=!0;return bn(e,function(a,s,d){return t=!!n(a,s,d),t}),t}function ur(e,n,t){for(var a=-1,s=e.length;++as?0:s+t),a=a===r||a>s?s:G(a),a<0&&(a+=s),a=t>a?0:Ps(a);t0&&t(_)?n>1?me(_,n-1,t,a,s):vn(s,_):a||(s[s.length]=_)}return s}var zi=qf(),mf=qf(!0);function Qe(e,n){return e&&zi(e,n,_e)}function Hi(e,n){return e&&mf(e,n,_e)}function ar(e,n){return _n(n,function(t){return hn(e[t])})}function Nn(e,n){n=En(n,e);for(var t=0,a=n.length;e!=null&&tn}function Nv(e,n){return e!=null&&Q.call(e,n)}function Pv(e,n){return e!=null&&n in ne(e)}function $v(e,n,t){return e>=we(n,t)&&e=120&&I.length>=120)?new Tn(p&&I):r}I=e[0];var A=-1,R=_[0];e:for(;++A-1;)_!==e&&Zt.call(_,b,1),Zt.call(e,b,1);return e}function Rf(e,n){for(var t=e?n.length:0,a=t-1;t--;){var s=n[t];if(t==a||s!==d){var d=s;cn(s)?Zt.call(e,s,1):nu(e,s)}}return e}function Ji(e,n){return e+er(sf()*(n-e+1))}function Yv(e,n,t,a){for(var s=-1,d=ge(Qt((n-e)/(t||1)),0),p=E(d);d--;)p[a?d:++s]=e,e+=t;return p}function Qi(e,n){var t="";if(!e||n<1||n>gn)return t;do n%2&&(t+=e),n=er(n/2),n&&(e+=e);while(n);return t}function z(e,n){return _u(us(e,n,Ae),e+"")}function Vv(e){return hf(Jn(e))}function Kv(e,n){var t=Jn(e);return vr(t,Ln(n,0,t.length))}function wt(e,n,t,a){if(!ae(e))return e;n=En(n,e);for(var s=-1,d=n.length,p=d-1,_=e;_!=null&&++ss?0:s+n),t=t>s?s:t,t<0&&(t+=s),s=n>t?0:t-n>>>0,n>>>=0;for(var d=E(s);++a>>1,p=e[d];p!==null&&!Le(p)&&(t?p<=n:p=f){var O=n?null:s0(e);if(O)return qt(O);p=!1,s=st,b=new Tn}else b=n?[]:_;e:for(;++a=a?e:Ge(e,n,t)}var Ff=B_||function(e){return ve.clearTimeout(e)};function kf(e,n){if(n)return e.slice();var t=e.length,a=rf?rf(t):new e.constructor(t);return e.copy(a),a}function uu(e){var n=new e.constructor(e.byteLength);return new Kt(n).set(new Kt(e)),n}function e0(e,n){var t=n?uu(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}function n0(e){var n=new e.constructor(e.source,wo.exec(e));return n.lastIndex=e.lastIndex,n}function t0(e){return pt?ne(pt.call(e)):{}}function Df(e,n){var t=n?uu(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function Wf(e,n){if(e!==n){var t=e!==r,a=e===null,s=e===e,d=Le(e),p=n!==r,_=n===null,b=n===n,O=Le(n);if(!_&&!O&&!d&&e>n||d&&p&&b&&!_&&!O||a&&p&&b||!t&&b||!s)return 1;if(!a&&!d&&!O&&e=_)return b;var O=t[a];return b*(O=="desc"?-1:1)}}return e.index-n.index}function Bf(e,n,t,a){for(var s=-1,d=e.length,p=t.length,_=-1,b=n.length,O=ge(d-p,0),I=E(b+O),A=!a;++_1?t[s-1]:r,p=s>2?t[2]:r;for(d=e.length>3&&typeof d=="function"?(s--,d):r,p&&Ee(t[0],t[1],p)&&(d=s<3?r:d,s=1),n=ne(n);++a-1?s[d?n[p]:p]:r}}function jf(e){return ln(function(n){var t=n.length,a=t,s=We.prototype.thru;for(e&&n.reverse();a--;){var d=n[a];if(typeof d!="function")throw new De(h);if(s&&!p&&gr(d)=="wrapper")var p=new We([],!0)}for(a=p?a:t;++a1&&V.reverse(),I&&b_))return!1;var O=d.get(e),I=d.get(n);if(O&&I)return O==n&&I==e;var A=-1,R=!0,N=t&K?new Tn:r;for(d.set(e,n),d.set(n,e);++A<_;){var M=e[A],q=n[A];if(a)var F=p?a(q,M,A,n,e,d):a(M,q,A,e,n,d);if(F!==r){if(F)continue;R=!1;break}if(N){if(!Li(n,function(H,V){if(!st(N,V)&&(M===H||s(M,H,t,a,d)))return N.push(V)})){R=!1;break}}else if(!(M===q||s(M,q,t,a,d))){R=!1;break}}return d.delete(e),d.delete(n),R}function c0(e,n,t,a,s,d,p){switch(t){case Dn:if(e.byteLength!=n.byteLength||e.byteOffset!=n.byteOffset)return!1;e=e.buffer,n=n.buffer;case ft:return!(e.byteLength!=n.byteLength||!d(new Kt(e),new Kt(n)));case tt:case rt:case it:return Xe(+e,+n);case Mt:return e.name==n.name&&e.message==n.message;case ut:case at:return e==n+"";case je:var _=ki;case Ye:var b=a&U;if(_||(_=qt),e.size!=n.size&&!b)return!1;var O=p.get(e);if(O)return O==n;a|=K,p.set(e,n);var I=Qf(_(e),_(n),a,s,d,p);return p.delete(e),I;case kt:if(pt)return pt.call(e)==pt.call(n)}return!1}function h0(e,n,t,a,s,d){var p=t&U,_=fu(e),b=_.length,O=fu(n),I=O.length;if(b!=I&&!p)return!1;for(var A=b;A--;){var R=_[A];if(!(p?R in n:Q.call(n,R)))return!1}var N=d.get(e),M=d.get(n);if(N&&M)return N==n&&M==e;var q=!0;d.set(e,n),d.set(n,e);for(var F=p;++A1?"& ":"")+n[a],n=n.join(t>2?", ":" "),e.replace(bg,`{ -/* [wrapped with `+n+`] */ -`)}function w0(e){return W(e)||Mn(e)||!!(of&&e&&e[of])}function cn(e,n){var t=typeof e;return n=n??gn,!!n&&(t=="number"||t!="symbol"&&Lg.test(e))&&e>-1&&e%1==0&&e0){if(++n>=Vp)return arguments[0]}else n=0;return e.apply(r,arguments)}}function vr(e,n){var t=-1,a=e.length,s=a-1;for(n=n===r?a:n;++t1?e[n-1]:r;return t=typeof t=="function"?(e.pop(),t):r,vs(e,t)});function ms(e){var n=c(e);return n.__chain__=!0,n}function T1(e,n){return n(e),e}function mr(e,n){return n(e)}var L1=ln(function(e){var n=e.length,t=n?e[0]:0,a=this.__wrapped__,s=function(d){return qi(d,e)};return n>1||this.__actions__.length||!(a instanceof Y)||!cn(t)?this.thru(s):(a=a.slice(t,+t+(n?1:0)),a.__actions__.push({func:mr,args:[s],thisArg:r}),new We(a,this.__chain__).thru(function(d){return n&&!d.length&&d.push(r),d}))});function N1(){return ms(this)}function P1(){return new We(this.value(),this.__chain__)}function $1(){this.__values__===r&&(this.__values__=Ns(this.value()));var e=this.__index__>=this.__values__.length,n=e?r:this.__values__[this.__index__++];return{done:e,value:n}}function M1(){return this}function F1(e){for(var n,t=this;t instanceof rr;){var a=cs(t);a.__index__=0,a.__values__=r,n?s.__wrapped__=a:n=a;var s=a;t=t.__wrapped__}return s.__wrapped__=e,n}function k1(){var e=this.__wrapped__;if(e instanceof Y){var n=e;return this.__actions__.length&&(n=new Y(this)),n=n.reverse(),n.__actions__.push({func:mr,args:[vu],thisArg:r}),new We(n,this.__chain__)}return this.thru(vu)}function D1(){return $f(this.__wrapped__,this.__actions__)}var W1=lr(function(e,n,t){Q.call(e,t)?++e[t]:fn(e,t,1)});function B1(e,n,t){var a=W(e)?jo:Tv;return t&&Ee(e,n,t)&&(n=r),a(e,$(n,3))}function G1(e,n){var t=W(e)?_n:vf;return t(e,$(n,3))}var U1=Hf(hs),q1=Hf(ds);function z1(e,n){return me(wr(e,n),1)}function H1(e,n){return me(wr(e,n),Sn)}function j1(e,n,t){return t=t===r?1:G(t),me(wr(e,n),t)}function ws(e,n){var t=W(e)?ke:bn;return t(e,$(n,3))}function bs(e,n){var t=W(e)?c_:_f;return t(e,$(n,3))}var Y1=lr(function(e,n,t){Q.call(e,t)?e[t].push(n):fn(e,t,[n])});function V1(e,n,t,a){e=Ie(e)?e:Jn(e),t=t&&!a?G(t):0;var s=e.length;return t<0&&(t=ge(s+t,0)),Or(e)?t<=s&&e.indexOf(n,t)>-1:!!s&&Bn(e,n,t)>-1}var K1=z(function(e,n,t){var a=-1,s=typeof n=="function",d=Ie(e)?E(e.length):[];return bn(e,function(p){d[++a]=s?Ce(n,p,t):vt(p,n,t)}),d}),X1=lr(function(e,n,t){fn(e,t,n)});function wr(e,n){var t=W(e)?ue:xf;return t(e,$(n,3))}function Z1(e,n,t,a){return e==null?[]:(W(n)||(n=n==null?[]:[n]),t=a?r:t,W(t)||(t=t==null?[]:[t]),Af(e,n,t))}var J1=lr(function(e,n,t){e[t?0:1].push(n)},function(){return[[],[]]});function Q1(e,n,t){var a=W(e)?Ti:Xo,s=arguments.length<3;return a(e,$(n,4),t,s,bn)}function em(e,n,t){var a=W(e)?h_:Xo,s=arguments.length<3;return a(e,$(n,4),t,s,_f)}function nm(e,n){var t=W(e)?_n:vf;return t(e,Er($(n,3)))}function tm(e){var n=W(e)?hf:Vv;return n(e)}function rm(e,n,t){(t?Ee(e,n,t):n===r)?n=1:n=G(n);var a=W(e)?Iv:Kv;return a(e,n)}function im(e){var n=W(e)?Sv:Zv;return n(e)}function um(e){if(e==null)return 0;if(Ie(e))return Or(e)?Un(e):e.length;var n=be(e);return n==je||n==Ye?e.size:Ki(e).length}function am(e,n,t){var a=W(e)?Li:Jv;return t&&Ee(e,n,t)&&(n=r),a(e,$(n,3))}var om=z(function(e,n){if(e==null)return[];var t=n.length;return t>1&&Ee(e,n[0],n[1])?n=[]:t>2&&Ee(n[0],n[1],n[2])&&(n=[n[0]]),Af(e,me(n,1),[])}),br=G_||function(){return ve.Date.now()};function fm(e,n){if(typeof n!="function")throw new De(h);return e=G(e),function(){if(--e<1)return n.apply(this,arguments)}}function ys(e,n,t){return n=t?r:n,n=e&&n==null?e.length:n,sn(e,re,r,r,r,r,n)}function Es(e,n){var t;if(typeof n!="function")throw new De(h);return e=G(e),function(){return--e>0&&(t=n.apply(this,arguments)),e<=1&&(n=r),t}}var wu=z(function(e,n,t){var a=k;if(t.length){var s=mn(t,Xn(wu));a|=J}return sn(e,a,n,t,s)}),xs=z(function(e,n,t){var a=k|ce;if(t.length){var s=mn(t,Xn(xs));a|=J}return sn(n,a,e,t,s)});function Os(e,n,t){n=t?r:n;var a=sn(e,P,r,r,r,r,r,n);return a.placeholder=Os.placeholder,a}function Is(e,n,t){n=t?r:n;var a=sn(e,j,r,r,r,r,r,n);return a.placeholder=Is.placeholder,a}function Ss(e,n,t){var a,s,d,p,_,b,O=0,I=!1,A=!1,R=!0;if(typeof e!="function")throw new De(h);n=qe(n)||0,ae(t)&&(I=!!t.leading,A="maxWait"in t,d=A?ge(qe(t.maxWait)||0,n):d,R="trailing"in t?!!t.trailing:R);function N(se){var Ze=a,pn=s;return a=s=r,O=se,p=e.apply(pn,Ze),p}function M(se){return O=se,_=Et(H,n),I?N(se):p}function q(se){var Ze=se-b,pn=se-O,Hs=n-Ze;return A?we(Hs,d-pn):Hs}function F(se){var Ze=se-b,pn=se-O;return b===r||Ze>=n||Ze<0||A&&pn>=d}function H(){var se=br();if(F(se))return V(se);_=Et(H,q(se))}function V(se){return _=r,R&&a?N(se):(a=s=r,p)}function Ne(){_!==r&&Ff(_),O=0,a=b=s=_=r}function xe(){return _===r?p:V(br())}function Pe(){var se=br(),Ze=F(se);if(a=arguments,s=this,b=se,Ze){if(_===r)return M(b);if(A)return Ff(_),_=Et(H,n),N(b)}return _===r&&(_=Et(H,n)),p}return Pe.cancel=Ne,Pe.flush=xe,Pe}var sm=z(function(e,n){return gf(e,1,n)}),lm=z(function(e,n,t){return gf(e,qe(n)||0,t)});function cm(e){return sn(e,li)}function yr(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new De(h);var t=function(){var a=arguments,s=n?n.apply(this,a):a[0],d=t.cache;if(d.has(s))return d.get(s);var p=e.apply(this,a);return t.cache=d.set(s,p)||d,p};return t.cache=new(yr.Cache||on),t}yr.Cache=on;function Er(e){if(typeof e!="function")throw new De(h);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function hm(e){return Es(2,e)}var dm=Qv(function(e,n){n=n.length==1&&W(n[0])?ue(n[0],Re($())):ue(me(n,1),Re($()));var t=n.length;return z(function(a){for(var s=-1,d=we(a.length,t);++s=n}),Mn=bf(function(){return arguments}())?bf:function(e){return oe(e)&&Q.call(e,"callee")&&!af.call(e,"callee")},W=E.isArray,Cm=Bo?Re(Bo):Fv;function Ie(e){return e!=null&&xr(e.length)&&!hn(e)}function fe(e){return oe(e)&&Ie(e)}function Rm(e){return e===!0||e===!1||oe(e)&&ye(e)==tt}var On=q_||Lu,Tm=Go?Re(Go):kv;function Lm(e){return oe(e)&&e.nodeType===1&&!xt(e)}function Nm(e){if(e==null)return!0;if(Ie(e)&&(W(e)||typeof e=="string"||typeof e.splice=="function"||On(e)||Zn(e)||Mn(e)))return!e.length;var n=be(e);if(n==je||n==Ye)return!e.size;if(yt(e))return!Ki(e).length;for(var t in e)if(Q.call(e,t))return!1;return!0}function Pm(e,n){return mt(e,n)}function $m(e,n,t){t=typeof t=="function"?t:r;var a=t?t(e,n):r;return a===r?mt(e,n,r,t):!!a}function yu(e){if(!oe(e))return!1;var n=ye(e);return n==Mt||n==rg||typeof e.message=="string"&&typeof e.name=="string"&&!xt(e)}function Mm(e){return typeof e=="number"&&ff(e)}function hn(e){if(!ae(e))return!1;var n=ye(e);return n==Ft||n==po||n==tg||n==ug}function Cs(e){return typeof e=="number"&&e==G(e)}function xr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=gn}function ae(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function oe(e){return e!=null&&typeof e=="object"}var Rs=Uo?Re(Uo):Wv;function Fm(e,n){return e===n||Vi(e,n,cu(n))}function km(e,n,t){return t=typeof t=="function"?t:r,Vi(e,n,cu(n),t)}function Dm(e){return Ts(e)&&e!=+e}function Wm(e){if(E0(e))throw new D(l);return yf(e)}function Bm(e){return e===null}function Gm(e){return e==null}function Ts(e){return typeof e=="number"||oe(e)&&ye(e)==it}function xt(e){if(!oe(e)||ye(e)!=un)return!1;var n=Xt(e);if(n===null)return!0;var t=Q.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&jt.call(t)==k_}var Eu=qo?Re(qo):Bv;function Um(e){return Cs(e)&&e>=-gn&&e<=gn}var Ls=zo?Re(zo):Gv;function Or(e){return typeof e=="string"||!W(e)&&oe(e)&&ye(e)==at}function Le(e){return typeof e=="symbol"||oe(e)&&ye(e)==kt}var Zn=Ho?Re(Ho):Uv;function qm(e){return e===r}function zm(e){return oe(e)&&be(e)==ot}function Hm(e){return oe(e)&&ye(e)==og}var jm=pr(Xi),Ym=pr(function(e,n){return e<=n});function Ns(e){if(!e)return[];if(Ie(e))return Or(e)?Ve(e):Oe(e);if(lt&&e[lt])return I_(e[lt]());var n=be(e),t=n==je?ki:n==Ye?qt:Jn;return t(e)}function dn(e){if(!e)return e===0?e:0;if(e=qe(e),e===Sn||e===-Sn){var n=e<0?-1:1;return n*Jp}return e===e?e:0}function G(e){var n=dn(e),t=n%1;return n===n?t?n-t:n:0}function Ps(e){return e?Ln(G(e),0,Je):0}function qe(e){if(typeof e=="number")return e;if(Le(e))return Pt;if(ae(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ae(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Zo(e);var t=Cg.test(e);return t||Tg.test(e)?f_(e.slice(2),t?2:8):Ag.test(e)?Pt:+e}function $s(e){return en(e,Se(e))}function Vm(e){return e?Ln(G(e),-gn,gn):e===0?e:0}function Z(e){return e==null?"":Te(e)}var Km=Vn(function(e,n){if(yt(n)||Ie(n)){en(n,_e(n),e);return}for(var t in n)Q.call(n,t)&>(e,t,n[t])}),Ms=Vn(function(e,n){en(n,Se(n),e)}),Ir=Vn(function(e,n,t,a){en(n,Se(n),e,a)}),Xm=Vn(function(e,n,t,a){en(n,_e(n),e,a)}),Zm=ln(qi);function Jm(e,n){var t=Yn(e);return n==null?t:df(t,n)}var Qm=z(function(e,n){e=ne(e);var t=-1,a=n.length,s=a>2?n[2]:r;for(s&&Ee(n[0],n[1],s)&&(a=1);++t1),d}),en(e,su(e),t),a&&(t=Be(t,S|C|T,l0));for(var s=n.length;s--;)nu(t,n[s]);return t});function vw(e,n){return ks(e,Er($(n)))}var mw=ln(function(e,n){return e==null?{}:Hv(e,n)});function ks(e,n){if(e==null)return{};var t=ue(su(e),function(a){return[a]});return n=$(n),Cf(e,t,function(a,s){return n(a,s[0])})}function ww(e,n,t){n=En(n,e);var a=-1,s=n.length;for(s||(s=1,e=r);++an){var a=e;e=n,n=a}if(t||e%1||n%1){var s=sf();return we(e+s*(n-e+o_("1e-"+((s+"").length-1))),n)}return Ji(e,n)}var Tw=Kn(function(e,n,t){return n=n.toLowerCase(),e+(t?Bs(n):n)});function Bs(e){return Iu(Z(e).toLowerCase())}function Gs(e){return e=Z(e),e&&e.replace(Ng,b_).replace(Zg,"")}function Lw(e,n,t){e=Z(e),n=Te(n);var a=e.length;t=t===r?a:Ln(G(t),0,a);var s=t;return t-=n.length,t>=0&&e.slice(t,s)==n}function Nw(e){return e=Z(e),e&&hg.test(e)?e.replace(vo,y_):e}function Pw(e){return e=Z(e),e&&mg.test(e)?e.replace(bi,"\\$&"):e}var $w=Kn(function(e,n,t){return e+(t?"-":"")+n.toLowerCase()}),Mw=Kn(function(e,n,t){return e+(t?" ":"")+n.toLowerCase()}),Fw=zf("toLowerCase");function kw(e,n,t){e=Z(e),n=G(n);var a=n?Un(e):0;if(!n||a>=n)return e;var s=(n-a)/2;return dr(er(s),t)+e+dr(Qt(s),t)}function Dw(e,n,t){e=Z(e),n=G(n);var a=n?Un(e):0;return n&&a>>0,t?(e=Z(e),e&&(typeof n=="string"||n!=null&&!Eu(n))&&(n=Te(n),!n&&Gn(e))?xn(Ve(e),0,t):e.split(n,t)):[]}var Hw=Kn(function(e,n,t){return e+(t?" ":"")+Iu(n)});function jw(e,n,t){return e=Z(e),t=t==null?0:Ln(G(t),0,e.length),n=Te(n),e.slice(t,t+n.length)==n}function Yw(e,n,t){var a=c.templateSettings;t&&Ee(e,n,t)&&(n=r),e=Z(e),n=Ir({},n,a,Zf);var s=Ir({},n.imports,a.imports,Zf),d=_e(s),p=Fi(s,d),_,b,O=0,I=n.interpolate||Dt,A="__p += '",R=Di((n.escape||Dt).source+"|"+I.source+"|"+(I===mo?Sg:Dt).source+"|"+(n.evaluate||Dt).source+"|$","g"),N="//# sourceURL="+(Q.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++t_+"]")+` -`;e.replace(R,function(F,H,V,Ne,xe,Pe){return V||(V=Ne),A+=e.slice(O,Pe).replace(Pg,E_),H&&(_=!0,A+=`' + -__e(`+H+`) + -'`),xe&&(b=!0,A+=`'; -`+xe+`; -__p += '`),V&&(A+=`' + -((__t = (`+V+`)) == null ? '' : __t) + -'`),O=Pe+F.length,F}),A+=`'; -`;var M=Q.call(n,"variable")&&n.variable;if(!M)A=`with (obj) { -`+A+` -} -`;else if(Og.test(M))throw new D(g);A=(b?A.replace(fg,""):A).replace(sg,"$1").replace(lg,"$1;"),A="function("+(M||"obj")+`) { -`+(M?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(b?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+A+`return __p -}`;var q=qs(function(){return X(d,N+"return "+A).apply(r,p)});if(q.source=A,yu(q))throw q;return q}function Vw(e){return Z(e).toLowerCase()}function Kw(e){return Z(e).toUpperCase()}function Xw(e,n,t){if(e=Z(e),e&&(t||n===r))return Zo(e);if(!e||!(n=Te(n)))return e;var a=Ve(e),s=Ve(n),d=Jo(a,s),p=Qo(a,s)+1;return xn(a,d,p).join("")}function Zw(e,n,t){if(e=Z(e),e&&(t||n===r))return e.slice(0,nf(e)+1);if(!e||!(n=Te(n)))return e;var a=Ve(e),s=Qo(a,Ve(n))+1;return xn(a,0,s).join("")}function Jw(e,n,t){if(e=Z(e),e&&(t||n===r))return e.replace(yi,"");if(!e||!(n=Te(n)))return e;var a=Ve(e),s=Jo(a,Ve(n));return xn(a,s).join("")}function Qw(e,n){var t=jp,a=Yp;if(ae(n)){var s="separator"in n?n.separator:s;t="length"in n?G(n.length):t,a="omission"in n?Te(n.omission):a}e=Z(e);var d=e.length;if(Gn(e)){var p=Ve(e);d=p.length}if(t>=d)return e;var _=t-Un(a);if(_<1)return a;var b=p?xn(p,0,_).join(""):e.slice(0,_);if(s===r)return b+a;if(p&&(_+=b.length-_),Eu(s)){if(e.slice(_).search(s)){var O,I=b;for(s.global||(s=Di(s.source,Z(wo.exec(s))+"g")),s.lastIndex=0;O=s.exec(I);)var A=O.index;b=b.slice(0,A===r?_:A)}}else if(e.indexOf(Te(s),_)!=_){var R=b.lastIndexOf(s);R>-1&&(b=b.slice(0,R))}return b+a}function eb(e){return e=Z(e),e&&cg.test(e)?e.replace(_o,R_):e}var nb=Kn(function(e,n,t){return e+(t?" ":"")+n.toUpperCase()}),Iu=zf("toUpperCase");function Us(e,n,t){return e=Z(e),n=t?r:n,n===r?O_(e)?N_(e):g_(e):e.match(n)||[]}var qs=z(function(e,n){try{return Ce(e,r,n)}catch(t){return yu(t)?t:new D(t)}}),tb=ln(function(e,n){return ke(n,function(t){t=nn(t),fn(e,t,wu(e[t],e))}),e});function rb(e){var n=e==null?0:e.length,t=$();return e=n?ue(e,function(a){if(typeof a[1]!="function")throw new De(h);return[t(a[0]),a[1]]}):[],z(function(a){for(var s=-1;++sgn)return[];var t=Je,a=we(e,Je);n=$(n),e-=Je;for(var s=Mi(a,n);++t0||n<0)?new Y(t):(e<0?t=t.takeRight(-e):e&&(t=t.drop(e)),n!==r&&(n=G(n),t=n<0?t.dropRight(-n):t.take(n-e)),t)},Y.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Y.prototype.toArray=function(){return this.take(Je)},Qe(Y.prototype,function(e,n){var t=/^(?:filter|find|map|reject)|While$/.test(n),a=/^(?:head|last)$/.test(n),s=c[a?"take"+(n=="last"?"Right":""):n],d=a||/^find/.test(n);s&&(c.prototype[n]=function(){var p=this.__wrapped__,_=a?[1]:arguments,b=p instanceof Y,O=_[0],I=b||W(p),A=function(H){var V=s.apply(c,vn([H],_));return a&&R?V[0]:V};I&&t&&typeof O=="function"&&O.length!=1&&(b=I=!1);var R=this.__chain__,N=!!this.__actions__.length,M=d&&!R,q=b&&!N;if(!d&&I){p=q?p:new Y(this);var F=e.apply(p,_);return F.__actions__.push({func:mr,args:[A],thisArg:r}),new We(F,R)}return M&&q?e.apply(this,_):(F=this.thru(A),M?a?F.value()[0]:F.value():F)})}),ke(["pop","push","shift","sort","splice","unshift"],function(e){var n=zt[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);c.prototype[e]=function(){var s=arguments;if(a&&!this.__chain__){var d=this.value();return n.apply(W(d)?d:[],s)}return this[t](function(p){return n.apply(W(p)?p:[],s)})}}),Qe(Y.prototype,function(e,n){var t=c[n];if(t){var a=t.name+"";Q.call(jn,a)||(jn[a]=[]),jn[a].push({name:n,func:t})}}),jn[cr(r,ce).name]=[{name:"wrapper",func:r}],Y.prototype.clone=ev,Y.prototype.reverse=nv,Y.prototype.value=tv,c.prototype.at=L1,c.prototype.chain=N1,c.prototype.commit=P1,c.prototype.next=$1,c.prototype.plant=F1,c.prototype.reverse=k1,c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=D1,c.prototype.first=c.prototype.head,lt&&(c.prototype[lt]=M1),c},qn=P_();An?((An.exports=qn)._=qn,Ai._=qn):ve._=qn}).call(ze)}(Rt,Rt.exports);var Tt=Rt.exports,Dd=function(){},Wd=Dd(),Fn=function(i){return i!==Wd&&i!==null},Bd=Fn,Gd=Array.prototype.forEach,Ud=Object.create,qd=function(i,u){var r;for(r in i)u[r]=i[r]},zd=function(i){var u=Ud(null);return Gd.call(arguments,function(r){Bd(r)&&qd(Object(r),u)}),u},Hd=function(){var i=Math.sign;return typeof i!="function"?!1:i(10)===1&&i(-20)===-1},Wr,Na;function jd(){return Na||(Na=1,Wr=function(i){return i=Number(i),isNaN(i)||i===0?i:i>0?1:-1}),Wr}var Yd=Hd()?Math.sign:jd(),Vd=Yd,Kd=Math.abs,Xd=Math.floor,Zd=function(i){return isNaN(i)?0:(i=Number(i),i===0||!isFinite(i)?i:Vd(i)*Xd(Kd(i)))},Jd=Zd,Qd=Math.max,ep=function(i){return Qd(0,Jd(i))},Pa=function(i){if(typeof i!="function")throw new TypeError(i+" is not a function");return i},np=Fn,$a=function(i){if(!np(i))throw new TypeError("Cannot use null or undefined");return i},tp={exports:{}},rp=function(){var i=Object.assign,u;return typeof i!="function"?!1:(u={foo:"raz"},i(u,{bar:"dwa"},{trzy:"trzy"}),u.foo+u.bar+u.trzy==="razdwatrzy")},Br,Ma;function ip(){return Ma||(Ma=1,Br=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Br}var Gr,Fa;function up(){if(Fa)return Gr;Fa=1;var i=Fn,u=Object.keys;return Gr=function(r){return u(i(r)?Object(r):r)},Gr}var Ur,ka;function ap(){return ka||(ka=1,Ur=ip()()?Object.keys:up()),Ur}var qr,Da;function op(){if(Da)return qr;Da=1;var i=ap(),u=$a,r=Math.max;return qr=function(o,f){var l,h,g=r(arguments.length,2),v;for(o=Object(u(o)),v=function(w){try{o[w]=f[w]}catch(y){l||(l=y)}},h=1;h-1},Hr}var Ip=xp()?String.prototype.contains:Op(),Lt=Ua,za=Ep,Ha=Wa,ja=zd,et=Ip,Sp=Ga.exports=function(i,u){var r,o,f,l,h;return arguments.length<2||typeof i!="string"?(l=u,u=i,i=null):l=arguments[2],Lt(i)?(r=et.call(i,"c"),o=et.call(i,"e"),f=et.call(i,"w")):(r=f=!0,o=!1),h={value:u,configurable:r,enumerable:o,writable:f},l?Ha(ja(l),h):h};Sp.gs=function(i,u,r){var o,f,l,h;return typeof i!="string"?(l=r,r=u,u=i,i=null):l=arguments[3],Lt(u)?za(u)?Lt(r)?za(r)||(l=r,r=void 0):r=void 0:(l=u,u=r=void 0):u=void 0,Lt(i)?(o=et.call(i,"c"),f=et.call(i,"e")):(o=!0,f=!1),h={get:u,set:r,configurable:o,enumerable:f},l?Ha(ja(l),h):h};var nt=Ga.exports,jr={exports:{}};(function(i,u){var r=nt,o=Pa,f=Function.prototype.apply,l=Function.prototype.call,h=Object.create,g=Object.defineProperty,v=Object.defineProperties,w=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0},S,C,T,U,K,k,ce;S=function(B,P){var j;return o(P),w.call(this,"__ee__")?j=this.__ee__:(j=y.value=h(null),g(this,"__ee__",y),y.value=null),j[B]?typeof j[B]=="object"?j[B].push(P):j[B]=[j[B],P]:j[B]=P,this},C=function(B,P){var j,J;return o(P),J=this,S.call(this,B,j=function(){T.call(J,B,j),f.call(P,this,arguments)}),j.__eeOnceListener__=P,this},T=function(B,P){var j,J,ee,re;if(o(P),!w.call(this,"__ee__"))return this;if(j=this.__ee__,!j[B])return this;if(J=j[B],typeof J=="object")for(re=0;ee=J[re];++re)(ee===P||ee.__eeOnceListener__===P)&&(J.length===2?j[B]=J[re?0:1]:J.splice(re,1));else(J===P||J.__eeOnceListener__===P)&&delete j[B];return this},U=function(B){var P,j,J,ee,re;if(w.call(this,"__ee__")&&(ee=this.__ee__[B],!!ee))if(typeof ee=="object"){for(j=arguments.length,re=new Array(j-1),P=1;P=55296&&j<=56319&&(he+=C[++k])),he=T?w.call(T,U,he,ce):he,K?(y.value=he,S(B,ce,y)):B[ce]=he,++ce;P=ce}}if(P===void 0)for(P=o(C.length),K&&(B=new K(P)),k=0;kasync u=>{try{const r=await i(u);postMessage({result:r})}catch(r){postMessage({error:r})}};function zp(i){const u={};return Tt.forEach(i==null?void 0:i.events,({id:r,pId:o})=>{u[r]=o}),u}function Hp({trace:i,mode:u,orientation:r}){const o=new La.graphlib.Graph;switch(o.setGraph({}),u){case"directed-graph":Tt.forEach(i==null?void 0:i.events,({id:f,pId:l,type:h},g)=>{f&&(o.hasNode(`${f}`)?o.node(`${f}`).size+=1:o.setNode(`${f}`,{label:`${f}`,width:1,height:1,size:1}),l&&o.hasNode(`${l}`)&&o.setEdge(`${f}`,`${l}`,{label:`${f}`,width:1,height:1}))});break;case"tree":{const f=zp(i);Tt.forEach(i==null?void 0:i.events,({id:l,pId:h,type:g},v)=>{if(l){o.hasNode(`${l}`)?o.node(`${l}`).size+=1:o.setNode(`${l}`,{label:`${l}`,width:1,height:1,size:1});const w=f[l];w&&o.hasNode(`${w}`)&&o.setEdge(`${l}`,`${w}`,{label:`${l}`,width:1,height:1})}})}break}return o.setGraph({ranksep:100,align:"UL",rankdir:r==="horizontal"?"LR":"TB"}),La.layout(o),o.nodes().map(f=>Tt.pick(o.node(f),"x","y","label","size"))}onmessage=qp(async({data:i})=>Hp(i))})(); diff --git a/assets/tree.worker-w3km_BXF.js b/assets/tree.worker-w3km_BXF.js new file mode 100644 index 0000000..98f20ea --- /dev/null +++ b/assets/tree.worker-w3km_BXF.js @@ -0,0 +1,27 @@ +var Xb=Object.defineProperty;var Zb=(ze,tn,$e)=>tn in ze?Xb(ze,tn,{enumerable:!0,configurable:!0,writable:!0,value:$e}):ze[tn]=$e;var de=(ze,tn,$e)=>Zb(ze,typeof tn!="symbol"?tn+"":tn,$e);(function(){"use strict";var ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},tn="\0",$e="\0",Gu="";let sl=class{constructor(u){de(this,"_isDirected",!0);de(this,"_isMultigraph",!1);de(this,"_isCompound",!1);de(this,"_label");de(this,"_defaultNodeLabelFn",()=>{});de(this,"_defaultEdgeLabelFn",()=>{});de(this,"_nodes",{});de(this,"_in",{});de(this,"_preds",{});de(this,"_out",{});de(this,"_sucs",{});de(this,"_edgeObjs",{});de(this,"_edgeLabels",{});de(this,"_nodeCount",0);de(this,"_edgeCount",0);de(this,"_parent");de(this,"_children");u&&(this._isDirected=Object.hasOwn(u,"directed")?u.directed:!0,this._isMultigraph=Object.hasOwn(u,"multigraph")?u.multigraph:!1,this._isCompound=Object.hasOwn(u,"compound")?u.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[$e]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(u){return this._label=u,this}graph(){return this._label}setDefaultNodeLabel(u){return this._defaultNodeLabelFn=u,typeof u!="function"&&(this._defaultNodeLabelFn=()=>u),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var u=this;return this.nodes().filter(r=>Object.keys(u._in[r]).length===0)}sinks(){var u=this;return this.nodes().filter(r=>Object.keys(u._out[r]).length===0)}setNodes(u,r){var a=arguments,f=this;return u.forEach(function(l){a.length>1?f.setNode(l,r):f.setNode(l)}),this}setNode(u,r){return Object.hasOwn(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=r),this):(this._nodes[u]=arguments.length>1?r:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=$e,this._children[u]={},this._children[$e][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)}node(u){return this._nodes[u]}hasNode(u){return Object.hasOwn(this._nodes,u)}removeNode(u){var r=this;if(Object.hasOwn(this._nodes,u)){var a=f=>r.removeEdge(r._edgeObjs[f]);delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],this.children(u).forEach(function(f){r.setParent(f)}),delete this._children[u]),Object.keys(this._in[u]).forEach(a),delete this._in[u],delete this._preds[u],Object.keys(this._out[u]).forEach(a),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this}setParent(u,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r===void 0)r=$e;else{r+="";for(var a=r;a!==void 0;a=this.parent(a))if(a===u)throw new Error("Setting "+r+" as parent of "+u+" would create a cycle");this.setNode(r)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=r,this._children[r][u]=!0,this}_removeFromParentsChildList(u){delete this._children[this._parent[u]][u]}parent(u){if(this._isCompound){var r=this._parent[u];if(r!==$e)return r}}children(u=$e){if(this._isCompound){var r=this._children[u];if(r)return Object.keys(r)}else{if(u===$e)return this.nodes();if(this.hasNode(u))return[]}}predecessors(u){var r=this._preds[u];if(r)return Object.keys(r)}successors(u){var r=this._sucs[u];if(r)return Object.keys(r)}neighbors(u){var r=this.predecessors(u);if(r){const f=new Set(r);for(var a of this.successors(u))f.add(a);return Array.from(f.values())}}isLeaf(u){var r;return this.isDirected()?r=this.successors(u):r=this.neighbors(u),r.length===0}filterNodes(u){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var a=this;Object.entries(this._nodes).forEach(function([c,p]){u(c)&&r.setNode(c,p)}),Object.values(this._edgeObjs).forEach(function(c){r.hasNode(c.v)&&r.hasNode(c.w)&&r.setEdge(c,a.edge(c))});var f={};function l(c){var p=a.parent(c);return p===void 0||r.hasNode(p)?(f[c]=p,p):p in f?f[p]:l(p)}return this._isCompound&&r.nodes().forEach(c=>r.setParent(c,l(c))),r}setDefaultEdgeLabel(u){return this._defaultEdgeLabelFn=u,typeof u!="function"&&(this._defaultEdgeLabelFn=()=>u),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(u,r){var a=this,f=arguments;return u.reduce(function(l,c){return f.length>1?a.setEdge(l,c,r):a.setEdge(l,c),c}),this}setEdge(){var u,r,a,f,l=!1,c=arguments[0];typeof c=="object"&&c!==null&&"v"in c?(u=c.v,r=c.w,a=c.name,arguments.length===2&&(f=arguments[1],l=!0)):(u=c,r=arguments[1],a=arguments[3],arguments.length>2&&(f=arguments[2],l=!0)),u=""+u,r=""+r,a!==void 0&&(a=""+a);var p=et(this._isDirected,u,r,a);if(Object.hasOwn(this._edgeLabels,p))return l&&(this._edgeLabels[p]=f),this;if(a!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(r),this._edgeLabels[p]=l?f:this._defaultEdgeLabelFn(u,r,a);var _=ll(this._isDirected,u,r,a);return u=_.v,r=_.w,Object.freeze(_),this._edgeObjs[p]=_,Uu(this._preds[r],u),Uu(this._sucs[u],r),this._in[r][p]=_,this._out[u][p]=_,this._edgeCount++,this}edge(u,r,a){var f=arguments.length===1?Ir(this._isDirected,arguments[0]):et(this._isDirected,u,r,a);return this._edgeLabels[f]}edgeAsObj(){const u=this.edge(...arguments);return typeof u!="object"?{label:u}:u}hasEdge(u,r,a){var f=arguments.length===1?Ir(this._isDirected,arguments[0]):et(this._isDirected,u,r,a);return Object.hasOwn(this._edgeLabels,f)}removeEdge(u,r,a){var f=arguments.length===1?Ir(this._isDirected,arguments[0]):et(this._isDirected,u,r,a),l=this._edgeObjs[f];return l&&(u=l.v,r=l.w,delete this._edgeLabels[f],delete this._edgeObjs[f],zu(this._preds[r],u),zu(this._sucs[u],r),delete this._in[r][f],delete this._out[u][f],this._edgeCount--),this}inEdges(u,r){var a=this._in[u];if(a){var f=Object.values(a);return r?f.filter(l=>l.v===r):f}}outEdges(u,r){var a=this._out[u];if(a){var f=Object.values(a);return r?f.filter(l=>l.w===r):f}}nodeEdges(u,r){var a=this.inEdges(u,r);if(a)return a.concat(this.outEdges(u,r))}};function Uu(i,u){i[u]?i[u]++:i[u]=1}function zu(i,u){--i[u]||delete i[u]}function et(i,u,r,a){var f=""+u,l=""+r;if(!i&&f>l){var c=f;f=l,l=c}return f+Gu+l+Gu+(a===void 0?tn:a)}function ll(i,u,r,a){var f=""+u,l=""+r;if(!i&&f>l){var c=f;f=l,l=c}var p={v:f,w:l};return a&&(p.name=a),p}function Ir(i,u){return et(i,u.v,u.w,u.name)}var Sr=sl,cl="2.2.4",hl={Graph:Sr,version:cl},dl=Sr,pl={write:gl,read:ml};function gl(i){var u={options:{directed:i.isDirected(),multigraph:i.isMultigraph(),compound:i.isCompound()},nodes:_l(i),edges:vl(i)};return i.graph()!==void 0&&(u.value=structuredClone(i.graph())),u}function _l(i){return i.nodes().map(function(u){var r=i.node(u),a=i.parent(u),f={v:u};return r!==void 0&&(f.value=r),a!==void 0&&(f.parent=a),f})}function vl(i){return i.edges().map(function(u){var r=i.edge(u),a={v:u.v,w:u.w};return u.name!==void 0&&(a.name=u.name),r!==void 0&&(a.value=r),a})}function ml(i){var u=new dl(i.options).setGraph(i.value);return i.nodes.forEach(function(r){u.setNode(r.v,r.value),r.parent&&u.setParent(r.v,r.parent)}),i.edges.forEach(function(r){u.setEdge({v:r.v,w:r.w,name:r.name},r.value)}),u}var wl=bl;function bl(i){var u={},r=[],a;function f(l){Object.hasOwn(u,l)||(u[l]=!0,a.push(l),i.successors(l).forEach(f),i.predecessors(l).forEach(f))}return i.nodes().forEach(function(l){a=[],f(l),a.length&&r.push(a)}),r}var ju=class{constructor(){de(this,"_arr",[]);de(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(u){return u.key})}has(u){return Object.hasOwn(this._keyIndices,u)}priority(u){var r=this._keyIndices[u];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(u,r){var a=this._keyIndices;if(u=String(u),!Object.hasOwn(a,u)){var f=this._arr,l=f.length;return a[u]=l,f.push({key:u,priority:r}),this._decrease(l),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var u=this._arr.pop();return delete this._keyIndices[u.key],this._heapify(0),u.key}decrease(u,r){var a=this._keyIndices[u];if(r>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+u+" Old: "+this._arr[a].priority+" New: "+r);this._arr[a].priority=r,this._decrease(a)}_heapify(u){var r=this._arr,a=2*u,f=a+1,l=u;a>1,!(r[f].priority1;function xl(i,u,r,a){return Ol(i,String(u),r||El,a||function(f){return i.outEdges(f)})}function Ol(i,u,r,a){var f={},l=new yl,c,p,_=function(m){var y=m.v!==c?m.v:m.w,O=f[y],R=r(m),T=p.distance+R;if(R<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+R);T0&&(c=l.removeMin(),p=f[c],p.distance!==Number.POSITIVE_INFINITY);)a(c).forEach(_);return f}var Il=Hu,Sl=Al;function Al(i,u,r){return i.nodes().reduce(function(a,f){return a[f]=Il(i,f,u,r),a},{})}var Yu=Rl;function Rl(i){var u=0,r=[],a={},f=[];function l(c){var p=a[c]={onStack:!0,lowlink:u,index:u++};if(r.push(c),i.successors(c).forEach(function(y){Object.hasOwn(a,y)?a[y].onStack&&(p.lowlink=Math.min(p.lowlink,a[y].index)):(l(y),p.lowlink=Math.min(p.lowlink,a[y].lowlink))}),p.lowlink===p.index){var _=[],m;do m=r.pop(),a[m].onStack=!1,_.push(m);while(c!==m);f.push(_)}}return i.nodes().forEach(function(c){Object.hasOwn(a,c)||l(c)}),f}var Cl=Yu,Tl=Ll;function Ll(i){return Cl(i).filter(function(u){return u.length>1||u.length===1&&i.hasEdge(u[0],u[0])})}var Nl=$l,Pl=()=>1;function $l(i,u,r){return Ml(i,u||Pl,r||function(a){return i.outEdges(a)})}function Ml(i,u,r){var a={},f=i.nodes();return f.forEach(function(l){a[l]={},a[l][l]={distance:0},f.forEach(function(c){l!==c&&(a[l][c]={distance:Number.POSITIVE_INFINITY})}),r(l).forEach(function(c){var p=c.v===l?c.w:c.v,_=u(c);a[l][p]={distance:_,predecessor:l}})}),f.forEach(function(l){var c=a[l];f.forEach(function(p){var _=a[p];f.forEach(function(m){var y=_[l],O=c[m],R=_[m],T=y.distance+O.distance;Ti.successors(p):p=>i.neighbors(p),f=r==="post"?Wl:Bl,l=[],c={};return u.forEach(p=>{if(!i.hasNode(p))throw new Error("Graph does not have node: "+p);f(p,a,c,l)}),l}function Wl(i,u,r,a){for(var f=[[i,!1]];f.length>0;){var l=f.pop();l[1]?a.push(l[0]):Object.hasOwn(r,l[0])||(r[l[0]]=!0,f.push([l[0],!0]),Ju(u(l[0]),c=>f.push([c,!1])))}}function Bl(i,u,r,a){for(var f=[i];f.length>0;){var l=f.pop();Object.hasOwn(r,l)||(r[l]=!0,a.push(l),Ju(u(l),c=>f.push(c)))}}function Ju(i,u){for(var r=i.length;r--;)u(i[r],r,i);return i}var ql=Zu,Gl=Ul;function Ul(i,u){return ql(i,u,"post")}var zl=Zu,jl=Hl;function Hl(i,u){return zl(i,u,"pre")}var Yl=Sr,Vl=ju,Kl=Xl;function Xl(i,u){var r=new Yl,a={},f=new Vl,l;function c(_){var m=_.v===l?_.w:_.v,y=f.priority(m);if(y!==void 0){var O=u(_);O0;){if(l=f.removeMin(),Object.hasOwn(a,l))r.setEdge(l,a[l]);else{if(p)throw new Error("Input graph is not connected: "+i);p=!0}i.nodeEdges(l).forEach(c)}return r}var Zl={components:wl,dijkstra:Hu,dijkstraAll:Sl,findCycles:Tl,floydWarshall:Nl,isAcyclic:Fl,postorder:Gl,preorder:jl,prim:Kl,tarjan:Yu,topsort:Ku},Qu=hl,je={Graph:Qu.Graph,json:pl,alg:Zl,version:Qu.version};let Jl=class{constructor(){let u={};u._next=u._prev=u,this._sentinel=u}dequeue(){let u=this._sentinel,r=u._prev;if(r!==u)return eo(r),r}enqueue(u){let r=this._sentinel;u._prev&&u._next&&eo(u),u._next=r._next,r._next._prev=u,r._next=u,u._prev=r}toString(){let u=[],r=this._sentinel,a=r._prev;for(;a!==r;)u.push(JSON.stringify(a,Ql)),a=a._prev;return"["+u.join(", ")+"]"}};function eo(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function Ql(i,u){if(i!=="_next"&&i!=="_prev")return u}var ec=Jl;let nc=je.Graph,tc=ec;var rc=uc;let ic=()=>1;function uc(i,u){if(i.nodeCount()<=1)return[];let r=ac(i,u||ic);return oc(r.graph,r.buckets,r.zeroIdx).flatMap(f=>i.outEdges(f.v,f.w))}function oc(i,u,r){let a=[],f=u[u.length-1],l=u[0],c;for(;i.nodeCount();){for(;c=l.dequeue();)Rr(i,u,r,c);for(;c=f.dequeue();)Rr(i,u,r,c);if(i.nodeCount()){for(let p=u.length-2;p>0;--p)if(c=u[p].dequeue(),c){a=a.concat(Rr(i,u,r,c,!0));break}}}return a}function Rr(i,u,r,a,f){let l=f?[]:void 0;return i.inEdges(a.v).forEach(c=>{let p=i.edge(c),_=i.node(c.v);f&&l.push({v:c.v,w:c.w}),_.out-=p,Cr(u,r,_)}),i.outEdges(a.v).forEach(c=>{let p=i.edge(c),_=c.w,m=i.node(_);m.in-=p,Cr(u,r,m)}),i.removeNode(a.v),l}function ac(i,u){let r=new nc,a=0,f=0;i.nodes().forEach(p=>{r.setNode(p,{v:p,in:0,out:0})}),i.edges().forEach(p=>{let _=r.edge(p.v,p.w)||0,m=u(p),y=_+m;r.setEdge(p.v,p.w,y),f=Math.max(f,r.node(p.v).out+=m),a=Math.max(a,r.node(p.w).in+=m)});let l=fc(f+a+3).map(()=>new tc),c=a+1;return r.nodes().forEach(p=>{Cr(l,c,r.node(p))}),{graph:r,buckets:l,zeroIdx:c}}function Cr(i,u,r){r.out?r.in?i[r.out-r.in+u].enqueue(r):i[i.length-1].enqueue(r):i[0].enqueue(r)}function fc(i){const u=[];for(let r=0;ru.setNode(r,i.node(r))),i.edges().forEach(r=>{let a=u.edge(r.v,r.w)||{weight:0,minlen:1},f=i.edge(r);u.setEdge(r.v,r.w,{weight:a.weight+f.weight,minlen:Math.max(a.minlen,f.minlen)})}),u}function lc(i){let u=new no({multigraph:i.isMultigraph()}).setGraph(i.graph());return i.nodes().forEach(r=>{i.children(r).length||u.setNode(r,i.node(r))}),i.edges().forEach(r=>{u.setEdge(r,i.edge(r))}),u}function cc(i){let u=i.nodes().map(r=>{let a={};return i.outEdges(r).forEach(f=>{a[f.w]=(a[f.w]||0)+i.edge(f).weight}),a});return Tr(i.nodes(),u)}function hc(i){let u=i.nodes().map(r=>{let a={};return i.inEdges(r).forEach(f=>{a[f.v]=(a[f.v]||0)+i.edge(f).weight}),a});return Tr(i.nodes(),u)}function dc(i,u){let r=i.x,a=i.y,f=u.x-r,l=u.y-a,c=i.width/2,p=i.height/2;if(!f&&!l)throw new Error("Not possible to find intersection inside of the rectangle");let _,m;return Math.abs(l)*c>Math.abs(f)*p?(l<0&&(p=-p),_=p*f/l,m=p):(f<0&&(c=-c),_=c,m=c*l/f),{x:r+_,y:a+m}}function pc(i){let u=oo(io(i)+1).map(()=>[]);return i.nodes().forEach(r=>{let a=i.node(r),f=a.rank;f!==void 0&&(u[f][a.order]=r)}),u}function gc(i){let u=i.nodes().map(a=>{let f=i.node(a).rank;return f===void 0?Number.MAX_VALUE:f}),r=xt(Math.min,u);i.nodes().forEach(a=>{let f=i.node(a);Object.hasOwn(f,"rank")&&(f.rank-=r)})}function _c(i){let u=i.nodes().map(c=>i.node(c).rank),r=xt(Math.min,u),a=[];i.nodes().forEach(c=>{let p=i.node(c).rank-r;a[p]||(a[p]=[]),a[p].push(c)});let f=0,l=i.graph().nodeRankFactor;Array.from(a).forEach((c,p)=>{c===void 0&&p%l!==0?--f:c!==void 0&&f&&c.forEach(_=>i.node(_).rank+=f)})}function vc(i,u,r,a){let f={width:0,height:0};return arguments.length>=4&&(f.rank=r,f.order=a),to(i,"border",f,u)}function mc(i,u=ro){const r=[];for(let a=0;aro){const r=mc(u);return i.apply(null,r.map(a=>i.apply(null,a)))}else return i.apply(null,u)}function io(i){const r=i.nodes().map(a=>{let f=i.node(a).rank;return f===void 0?Number.MIN_VALUE:f});return xt(Math.max,r)}function wc(i,u){let r={lhs:[],rhs:[]};return i.forEach(a=>{u(a)?r.lhs.push(a):r.rhs.push(a)}),r}function bc(i,u){let r=Date.now();try{return u()}finally{console.log(i+" time: "+(Date.now()-r)+"ms")}}function yc(i,u){return u()}let Ec=0;function uo(i){var u=++Ec;return toString(i)+u}function oo(i,u,r=1){u==null&&(u=i,i=0);let a=l=>lua[u]),Object.entries(i).reduce((a,[f,l])=>(a[f]=r(l,f),a),{})}function Tr(i,u){return i.reduce((r,a,f)=>(r[a]=u[f],r),{})}let Ic=rc,Sc=le.uniqueId;var Ac={run:Rc,undo:Tc};function Rc(i){(i.graph().acyclicer==="greedy"?Ic(i,r(i)):Cc(i)).forEach(a=>{let f=i.edge(a);i.removeEdge(a),f.forwardName=a.name,f.reversed=!0,i.setEdge(a.w,a.v,f,Sc("rev"))});function r(a){return f=>a.edge(f).weight}}function Cc(i){let u=[],r={},a={};function f(l){Object.hasOwn(a,l)||(a[l]=!0,r[l]=!0,i.outEdges(l).forEach(c=>{Object.hasOwn(r,c.w)?u.push(c):f(c.w)}),delete r[l])}return i.nodes().forEach(f),u}function Tc(i){i.edges().forEach(u=>{let r=i.edge(u);if(r.reversed){i.removeEdge(u);let a=r.forwardName;delete r.reversed,delete r.forwardName,i.setEdge(u.w,u.v,r,a)}})}let Lc=le;var Nc={run:Pc,undo:Mc};function Pc(i){i.graph().dummyChains=[],i.edges().forEach(u=>$c(i,u))}function $c(i,u){let r=u.v,a=i.node(r).rank,f=u.w,l=i.node(f).rank,c=u.name,p=i.edge(u),_=p.labelRank;if(l===a+1)return;i.removeEdge(u);let m,y,O;for(O=0,++a;a{let r=i.node(u),a=r.edgeLabel,f;for(i.setEdge(r.edgeObj,a);r.dummy;)f=i.successors(u)[0],i.removeNode(u),a.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(a.x=r.x,a.y=r.y,a.width=r.width,a.height=r.height),u=f,r=i.node(u)})}const{applyWithChunking:Fc}=le;var Ot={longestPath:kc,slack:Dc};function kc(i){var u={};function r(a){var f=i.node(a);if(Object.hasOwn(u,a))return f.rank;u[a]=!0;let l=i.outEdges(a).map(p=>p==null?Number.POSITIVE_INFINITY:r(p.w)-i.edge(p).minlen);var c=Fc(Math.min,l);return c===Number.POSITIVE_INFINITY&&(c=0),f.rank=c}i.sources().forEach(r)}function Dc(i,u){return i.node(u.w).rank-i.node(u.v).rank-i.edge(u).minlen}var Wc=je.Graph,It=Ot.slack,ao=Bc;function Bc(i){var u=new Wc({directed:!1}),r=i.nodes()[0],a=i.nodeCount();u.setNode(r,{});for(var f,l;qc(u,i){var l=f.v,c=a===l?f.w:l;!i.hasNode(c)&&!It(u,f)&&(i.setNode(c,{}),i.setEdge(a,c,{}),r(c))})}return i.nodes().forEach(r),i.nodeCount()}function Gc(i,u){return u.edges().reduce((a,f)=>{let l=Number.POSITIVE_INFINITY;return i.hasNode(f.v)!==i.hasNode(f.w)&&(l=It(u,f)),lu.node(a).rank+=r)}var zc=ao,fo=Ot.slack,jc=Ot.longestPath,Hc=je.alg.preorder,Yc=je.alg.postorder,Vc=le.simplify,Kc=In;In.initLowLimValues=Nr,In.initCutValues=Lr,In.calcCutValue=so,In.leaveEdge=co,In.enterEdge=ho,In.exchangeEdges=po;function In(i){i=Vc(i),jc(i);var u=zc(i);Nr(u),Lr(u,i);for(var r,a;r=co(u);)a=ho(u,i,r),po(u,i,r,a)}function Lr(i,u){var r=Yc(i,i.nodes());r=r.slice(0,r.length-1),r.forEach(a=>Xc(i,u,a))}function Xc(i,u,r){var a=i.node(r),f=a.parent;i.edge(r,f).cutvalue=so(i,u,r)}function so(i,u,r){var a=i.node(r),f=a.parent,l=!0,c=u.edge(r,f),p=0;return c||(l=!1,c=u.edge(f,r)),p=c.weight,u.nodeEdges(r).forEach(_=>{var m=_.v===r,y=m?_.w:_.v;if(y!==f){var O=m===l,R=u.edge(_).weight;if(p+=O?R:-R,Jc(i,r,y)){var T=i.edge(r,y).cutvalue;p+=O?-T:T}}}),p}function Nr(i,u){arguments.length<2&&(u=i.nodes()[0]),lo(i,{},1,u)}function lo(i,u,r,a,f){var l=r,c=i.node(a);return u[a]=!0,i.neighbors(a).forEach(p=>{Object.hasOwn(u,p)||(r=lo(i,u,r,p,a))}),c.low=l,c.lim=r++,f?c.parent=f:delete c.parent,r}function co(i){return i.edges().find(u=>i.edge(u).cutvalue<0)}function ho(i,u,r){var a=r.v,f=r.w;u.hasEdge(a,f)||(a=r.w,f=r.v);var l=i.node(a),c=i.node(f),p=l,_=!1;l.lim>c.lim&&(p=c,_=!0);var m=u.edges().filter(y=>_===go(i,i.node(y.v),p)&&_!==go(i,i.node(y.w),p));return m.reduce((y,O)=>fo(u,O)!u.node(f).parent),a=Hc(i,r);a=a.slice(1),a.forEach(f=>{var l=i.node(f).parent,c=u.edge(f,l),p=!1;c||(c=u.edge(l,f),p=!0),u.node(f).rank=u.node(l).rank+(p?c.minlen:-c.minlen)})}function Jc(i,u,r){return i.hasEdge(u,r)}function go(i,u,r){return r.low<=u.lim&&u.lim<=r.lim}var Qc=Ot,_o=Qc.longestPath,eh=ao,nh=Kc,th=rh;function rh(i){switch(i.graph().ranker){case"network-simplex":vo(i);break;case"tight-tree":uh(i);break;case"longest-path":ih(i);break;default:vo(i)}}var ih=_o;function uh(i){_o(i),eh(i)}function vo(i){nh(i)}var oh=ah;function ah(i){let u=sh(i);i.graph().dummyChains.forEach(r=>{let a=i.node(r),f=a.edgeObj,l=fh(i,u,f.v,f.w),c=l.path,p=l.lca,_=0,m=c[_],y=!0;for(;r!==f.w;){if(a=i.node(r),y){for(;(m=c[_])!==p&&i.node(m).maxRankc||p>u[_].lim));for(m=_,_=a;(_=i.parent(_))!==m;)l.push(_);return{path:f.concat(l.reverse()),lca:m}}function sh(i){let u={},r=0;function a(f){let l=r;i.children(f).forEach(a),u[f]={low:l,lim:r++}}return i.children().forEach(a),u}let St=le;var lh={run:ch,cleanup:ph};function ch(i){let u=St.addDummyNode(i,"root",{},"_root"),r=hh(i),a=Object.values(r),f=St.applyWithChunking(Math.max,a)-1,l=2*f+1;i.graph().nestingRoot=u,i.edges().forEach(p=>i.edge(p).minlen*=l);let c=dh(i)+1;i.children().forEach(p=>mo(i,u,l,c,f,r,p)),i.graph().nodeRankFactor=l}function mo(i,u,r,a,f,l,c){let p=i.children(c);if(!p.length){c!==u&&i.setEdge(u,c,{weight:0,minlen:r});return}let _=St.addBorderNode(i,"_bt"),m=St.addBorderNode(i,"_bb"),y=i.node(c);i.setParent(_,c),y.borderTop=_,i.setParent(m,c),y.borderBottom=m,p.forEach(O=>{mo(i,u,r,a,f,l,O);let R=i.node(O),T=R.borderTop?R.borderTop:O,G=R.borderBottom?R.borderBottom:O,K=R.borderTop?a:2*a,k=T!==G?1:f-l[c]+1;i.setEdge(_,T,{weight:K,minlen:k,nestingEdge:!0}),i.setEdge(G,m,{weight:K,minlen:k,nestingEdge:!0})}),i.parent(c)||i.setEdge(u,_,{weight:0,minlen:f+l[c]})}function hh(i){var u={};function r(a,f){var l=i.children(a);l&&l.length&&l.forEach(c=>r(c,f+1)),u[a]=f}return i.children().forEach(a=>r(a,1)),u}function dh(i){return i.edges().reduce((u,r)=>u+i.edge(r).weight,0)}function ph(i){var u=i.graph();i.removeNode(u.nestingRoot),delete u.nestingRoot,i.edges().forEach(r=>{var a=i.edge(r);a.nestingEdge&&i.removeEdge(r)})}let gh=le;var _h=vh;function vh(i){function u(r){let a=i.children(r),f=i.node(r);if(a.length&&a.forEach(u),Object.hasOwn(f,"minRank")){f.borderLeft=[],f.borderRight=[];for(let l=f.minRank,c=f.maxRank+1;lyo(i.node(u))),i.edges().forEach(u=>yo(i.edge(u)))}function yo(i){let u=i.width;i.width=i.height,i.height=u}function yh(i){i.nodes().forEach(u=>Pr(i.node(u))),i.edges().forEach(u=>{let r=i.edge(u);r.points.forEach(Pr),Object.hasOwn(r,"y")&&Pr(r)})}function Pr(i){i.y=-i.y}function Eh(i){i.nodes().forEach(u=>$r(i.node(u))),i.edges().forEach(u=>{let r=i.edge(u);r.points.forEach($r),Object.hasOwn(r,"x")&&$r(r)})}function $r(i){let u=i.x;i.x=i.y,i.y=u}let Eo=le;var xh=Oh;function Oh(i){let u={},r=i.nodes().filter(_=>!i.children(_).length),a=r.map(_=>i.node(_).rank),f=Eo.applyWithChunking(Math.max,a),l=Eo.range(f+1).map(()=>[]);function c(_){if(u[_])return;u[_]=!0;let m=i.node(_);l[m.rank].push(_),i.successors(_).forEach(c)}return r.sort((_,m)=>i.node(_).rank-i.node(m).rank).forEach(c),l}let Ih=le.zipObject;var Sh=Ah;function Ah(i,u){let r=0;for(let a=1;ay)),f=u.flatMap(m=>i.outEdges(m).map(y=>({pos:a[y.w],weight:i.edge(y).weight})).sort((y,O)=>y.pos-O.pos)),l=1;for(;l{let y=m.pos+l;p[y]+=m.weight;let O=0;for(;y>0;)y%2&&(O+=p[y+1]),y=y-1>>1,p[y]+=m.weight;_+=m.weight*O}),_}var Ch=Th;function Th(i,u=[]){return u.map(r=>{let a=i.inEdges(r);if(a.length){let f=a.reduce((l,c)=>{let p=i.edge(c),_=i.node(c.v);return{sum:l.sum+p.weight*_.order,weight:l.weight+p.weight}},{sum:0,weight:0});return{v:r,barycenter:f.sum/f.weight,weight:f.weight}}else return{v:r}})}let Lh=le;var Nh=Ph;function Ph(i,u){let r={};i.forEach((f,l)=>{let c=r[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:l};f.barycenter!==void 0&&(c.barycenter=f.barycenter,c.weight=f.weight)}),u.edges().forEach(f=>{let l=r[f.v],c=r[f.w];l!==void 0&&c!==void 0&&(c.indegree++,l.out.push(r[f.w]))});let a=Object.values(r).filter(f=>!f.indegree);return $h(a)}function $h(i){let u=[];function r(f){return l=>{l.merged||(l.barycenter===void 0||f.barycenter===void 0||l.barycenter>=f.barycenter)&&Mh(f,l)}}function a(f){return l=>{l.in.push(f),--l.indegree===0&&i.push(l)}}for(;i.length;){let f=i.pop();u.push(f),f.in.reverse().forEach(r(f)),f.out.forEach(a(f))}return u.filter(f=>!f.merged).map(f=>Lh.pick(f,["vs","i","barycenter","weight"]))}function Mh(i,u){let r=0,a=0;i.weight&&(r+=i.barycenter*i.weight,a+=i.weight),u.weight&&(r+=u.barycenter*u.weight,a+=u.weight),i.vs=u.vs.concat(i.vs),i.barycenter=r/a,i.weight=a,i.i=Math.min(u.i,i.i),u.merged=!0}let Fh=le;var kh=Dh;function Dh(i,u){let r=Fh.partition(i,y=>Object.hasOwn(y,"barycenter")),a=r.lhs,f=r.rhs.sort((y,O)=>O.i-y.i),l=[],c=0,p=0,_=0;a.sort(Wh(!!u)),_=xo(l,f,_),a.forEach(y=>{_+=y.vs.length,l.push(y.vs),c+=y.barycenter*y.weight,p+=y.weight,_=xo(l,f,_)});let m={vs:l.flat(!0)};return p&&(m.barycenter=c/p,m.weight=p),m}function xo(i,u,r){let a;for(;u.length&&(a=u[u.length-1]).i<=r;)u.pop(),i.push(a.vs),r++;return r}function Wh(i){return(u,r)=>u.barycenterr.barycenter?1:i?r.i-u.i:u.i-r.i}let Bh=Ch,qh=Nh,Gh=kh;var Uh=Oo;function Oo(i,u,r,a){let f=i.children(u),l=i.node(u),c=l?l.borderLeft:void 0,p=l?l.borderRight:void 0,_={};c&&(f=f.filter(R=>R!==c&&R!==p));let m=Bh(i,f);m.forEach(R=>{if(i.children(R.v).length){let T=Oo(i,R.v,r,a);_[R.v]=T,Object.hasOwn(T,"barycenter")&&jh(R,T)}});let y=qh(m,r);zh(y,_);let O=Gh(y,a);if(c&&(O.vs=[c,O.vs,p].flat(!0),i.predecessors(c).length)){let R=i.node(i.predecessors(c)[0]),T=i.node(i.predecessors(p)[0]);Object.hasOwn(O,"barycenter")||(O.barycenter=0,O.weight=0),O.barycenter=(O.barycenter*O.weight+R.order+T.order)/(O.weight+2),O.weight+=2}return O}function zh(i,u){i.forEach(r=>{r.vs=r.vs.flatMap(a=>u[a]?u[a].vs:a)})}function jh(i,u){i.barycenter!==void 0?(i.barycenter=(i.barycenter*i.weight+u.barycenter*u.weight)/(i.weight+u.weight),i.weight+=u.weight):(i.barycenter=u.barycenter,i.weight=u.weight)}let Hh=je.Graph,Yh=le;var Vh=Kh;function Kh(i,u,r){let a=Xh(i),f=new Hh({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(l=>i.node(l));return i.nodes().forEach(l=>{let c=i.node(l),p=i.parent(l);(c.rank===u||c.minRank<=u&&u<=c.maxRank)&&(f.setNode(l),f.setParent(l,p||a),i[r](l).forEach(_=>{let m=_.v===l?_.w:_.v,y=f.edge(m,l),O=y!==void 0?y.weight:0;f.setEdge(m,l,{weight:i.edge(_).weight+O})}),Object.hasOwn(c,"minRank")&&f.setNode(l,{borderLeft:c.borderLeft[u],borderRight:c.borderRight[u]}))}),f}function Xh(i){for(var u;i.hasNode(u=Yh.uniqueId("_root")););return u}var Zh=Jh;function Jh(i,u,r){let a={},f;r.forEach(l=>{let c=i.parent(l),p,_;for(;c;){if(p=i.parent(c),p?(_=a[p],a[p]=c):(_=f,f=c),_&&_!==c){u.setEdge(_,c);return}c=p}})}let Qh=xh,ed=Sh,nd=Uh,td=Vh,rd=Zh,id=je.Graph,At=le;var ud=Io;function Io(i,u){if(u&&typeof u.customOrder=="function"){u.customOrder(i,Io);return}let r=At.maxRank(i),a=So(i,At.range(1,r+1),"inEdges"),f=So(i,At.range(r-1,-1,-1),"outEdges"),l=Qh(i);if(Ao(i,l),u&&u.disableOptimalOrderHeuristic)return;let c=Number.POSITIVE_INFINITY,p;for(let _=0,m=0;m<4;++_,++m){od(_%2?a:f,_%4>=2),l=At.buildLayerMatrix(i);let y=ed(i,l);ya.node(c).order=p),rd(a,r,l.vs)})}function Ao(i,u){Object.values(u).forEach(r=>r.forEach((a,f)=>i.node(a).order=f))}let ad=je.Graph,rn=le;var fd={positionX:cd,findType1Conflicts:Ro,findType2Conflicts:Co,addConflict:Mr,hasConflict:To,verticalAlignment:Lo,horizontalCompaction:No,alignCoordinates:$o,findSmallestWidthAlignment:Po,balance:Mo};function Ro(i,u){let r={};function a(f,l){let c=0,p=0,_=f.length,m=l[l.length-1];return l.forEach((y,O)=>{let R=sd(i,y),T=R?i.node(R).order:_;(R||y===m)&&(l.slice(p,O+1).forEach(G=>{i.predecessors(G).forEach(K=>{let k=i.node(K),ce=k.order;(ce{y=l[O],i.node(y).dummy&&i.predecessors(y).forEach(R=>{let T=i.node(R);T.dummy&&(T.order<_||T.order>m)&&Mr(r,R,y)})})}function f(l,c){let p=-1,_,m=0;return c.forEach((y,O)=>{if(i.node(y).dummy==="border"){let R=i.predecessors(y);R.length&&(_=i.node(R[0]).order,a(c,m,O,p,_),m=O,p=_)}a(c,m,c.length,_,l.length)}),c}return u.length&&u.reduce(f),r}function sd(i,u){if(i.node(u).dummy)return i.predecessors(u).find(r=>i.node(r).dummy)}function Mr(i,u,r){if(u>r){let f=u;u=r,r=f}let a=i[u];a||(i[u]=a={}),a[r]=!0}function To(i,u,r){if(u>r){let a=u;u=r,r=a}return!!i[u]&&Object.hasOwn(i[u],r)}function Lo(i,u,r,a){let f={},l={},c={};return u.forEach(p=>{p.forEach((_,m)=>{f[_]=_,l[_]=_,c[_]=m})}),u.forEach(p=>{let _=-1;p.forEach(m=>{let y=a(m);if(y.length){y=y.sort((R,T)=>c[R]-c[T]);let O=(y.length-1)/2;for(let R=Math.floor(O),T=Math.ceil(O);R<=T;++R){let G=y[R];l[m]===m&&_Math.max(R,l[T.v]+c.edge(T)),0)}function y(O){let R=c.outEdges(O).reduce((G,K)=>Math.min(G,l[K.w]-c.edge(K)),Number.POSITIVE_INFINITY),T=i.node(O);R!==Number.POSITIVE_INFINITY&&T.borderType!==p&&(l[O]=Math.max(l[O],R))}return _(m,c.predecessors.bind(c)),_(y,c.successors.bind(c)),Object.keys(a).forEach(O=>l[O]=l[r[O]]),l}function ld(i,u,r,a){let f=new ad,l=i.graph(),c=hd(l.nodesep,l.edgesep,a);return u.forEach(p=>{let _;p.forEach(m=>{let y=r[m];if(f.setNode(y),_){var O=r[_],R=f.edge(O,y);f.setEdge(O,y,Math.max(c(i,m,_),R||0))}_=m})}),f}function Po(i,u){return Object.values(u).reduce((r,a)=>{let f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;Object.entries(a).forEach(([p,_])=>{let m=dd(i,p)/2;f=Math.max(_+m,f),l=Math.min(_-m,l)});const c=f-l;return c{["l","r"].forEach(c=>{let p=l+c,_=i[p];if(_===u)return;let m=Object.values(_),y=a-rn.applyWithChunking(Math.min,m);c!=="l"&&(y=f-rn.applyWithChunking(Math.max,m)),y&&(i[p]=rn.mapValues(_,O=>O+y))})})}function Mo(i,u){return rn.mapValues(i.ul,(r,a)=>{if(u)return i[u.toLowerCase()][a];{let f=Object.values(i).map(l=>l[a]).sort((l,c)=>l-c);return(f[1]+f[2])/2}})}function cd(i){let u=rn.buildLayerMatrix(i),r=Object.assign(Ro(i,u),Co(i,u)),a={},f;["u","d"].forEach(c=>{f=c==="u"?u:Object.values(u).reverse(),["l","r"].forEach(p=>{p==="r"&&(f=f.map(O=>Object.values(O).reverse()));let _=(c==="u"?i.predecessors:i.successors).bind(i),m=Lo(i,f,r,_),y=No(i,f,m.root,m.align,p==="r");p==="r"&&(y=rn.mapValues(y,O=>-O)),a[c+p]=y})});let l=Po(i,a);return $o(a,l),Mo(a,i.graph().align)}function hd(i,u,r){return(a,f,l)=>{let c=a.node(f),p=a.node(l),_=0,m;if(_+=c.width/2,Object.hasOwn(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":m=-c.width/2;break;case"r":m=c.width/2;break}if(m&&(_+=r?m:-m),m=0,_+=(c.dummy?u:i)/2,_+=(p.dummy?u:i)/2,_+=p.width/2,Object.hasOwn(p,"labelpos"))switch(p.labelpos.toLowerCase()){case"l":m=p.width/2;break;case"r":m=-p.width/2;break}return m&&(_+=r?m:-m),m=0,_}}function dd(i,u){return i.node(u).width}let Fo=le,pd=fd.positionX;var gd=_d;function _d(i){i=Fo.asNonCompoundGraph(i),vd(i),Object.entries(pd(i)).forEach(([u,r])=>i.node(u).x=r)}function vd(i){let u=Fo.buildLayerMatrix(i),r=i.graph().ranksep,a=0;u.forEach(f=>{const l=f.reduce((c,p)=>{const _=i.node(p).height;return c>_?c:_},0);f.forEach(c=>i.node(c).y=a+l/2),a+=l+r})}let ko=Ac,Do=Nc,md=th,wd=le.normalizeRanks,bd=oh,yd=le.removeEmptyRanks,Wo=lh,Ed=_h,Bo=mh,xd=ud,Od=gd,Me=le,Id=je.Graph;var Sd=Ad;function Ad(i,u){let r=u&&u.debugTiming?Me.time:Me.notime;r("layout",()=>{let a=r(" buildLayoutGraph",()=>kd(i));r(" runLayout",()=>Rd(a,r,u)),r(" updateInputGraph",()=>Cd(i,a))})}function Rd(i,u,r){u(" makeSpaceForEdgeLabels",()=>Dd(i)),u(" removeSelfEdges",()=>Yd(i)),u(" acyclic",()=>ko.run(i)),u(" nestingGraph.run",()=>Wo.run(i)),u(" rank",()=>md(Me.asNonCompoundGraph(i))),u(" injectEdgeLabelProxies",()=>Wd(i)),u(" removeEmptyRanks",()=>yd(i)),u(" nestingGraph.cleanup",()=>Wo.cleanup(i)),u(" normalizeRanks",()=>wd(i)),u(" assignRankMinMax",()=>Bd(i)),u(" removeEdgeLabelProxies",()=>qd(i)),u(" normalize.run",()=>Do.run(i)),u(" parentDummyChains",()=>bd(i)),u(" addBorderSegments",()=>Ed(i)),u(" order",()=>xd(i,r)),u(" insertSelfEdges",()=>Vd(i)),u(" adjustCoordinateSystem",()=>Bo.adjust(i)),u(" position",()=>Od(i)),u(" positionSelfEdges",()=>Kd(i)),u(" removeBorderNodes",()=>Hd(i)),u(" normalize.undo",()=>Do.undo(i)),u(" fixupEdgeLabelCoords",()=>zd(i)),u(" undoCoordinateSystem",()=>Bo.undo(i)),u(" translateGraph",()=>Gd(i)),u(" assignNodeIntersects",()=>Ud(i)),u(" reversePoints",()=>jd(i)),u(" acyclic.undo",()=>ko.undo(i))}function Cd(i,u){i.nodes().forEach(r=>{let a=i.node(r),f=u.node(r);a&&(a.x=f.x,a.y=f.y,a.rank=f.rank,u.children(r).length&&(a.width=f.width,a.height=f.height))}),i.edges().forEach(r=>{let a=i.edge(r),f=u.edge(r);a.points=f.points,Object.hasOwn(f,"x")&&(a.x=f.x,a.y=f.y)}),i.graph().width=u.graph().width,i.graph().height=u.graph().height}let Td=["nodesep","edgesep","ranksep","marginx","marginy"],Ld={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Nd=["acyclicer","ranker","rankdir","align"],Pd=["width","height"],qo={width:0,height:0},$d=["minlen","weight","width","height","labeloffset"],Md={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Fd=["labelpos"];function kd(i){let u=new Id({multigraph:!0,compound:!0}),r=kr(i.graph());return u.setGraph(Object.assign({},Ld,Fr(r,Td),Me.pick(r,Nd))),i.nodes().forEach(a=>{let f=kr(i.node(a));const l=Fr(f,Pd);Object.keys(qo).forEach(c=>{l[c]===void 0&&(l[c]=qo[c])}),u.setNode(a,l),u.setParent(a,i.parent(a))}),i.edges().forEach(a=>{let f=kr(i.edge(a));u.setEdge(a,Object.assign({},Md,Fr(f,$d),Me.pick(f,Fd)))}),u}function Dd(i){let u=i.graph();u.ranksep/=2,i.edges().forEach(r=>{let a=i.edge(r);a.minlen*=2,a.labelpos.toLowerCase()!=="c"&&(u.rankdir==="TB"||u.rankdir==="BT"?a.width+=a.labeloffset:a.height+=a.labeloffset)})}function Wd(i){i.edges().forEach(u=>{let r=i.edge(u);if(r.width&&r.height){let a=i.node(u.v),l={rank:(i.node(u.w).rank-a.rank)/2+a.rank,e:u};Me.addDummyNode(i,"edge-proxy",l,"_ep")}})}function Bd(i){let u=0;i.nodes().forEach(r=>{let a=i.node(r);a.borderTop&&(a.minRank=i.node(a.borderTop).rank,a.maxRank=i.node(a.borderBottom).rank,u=Math.max(u,a.maxRank))}),i.graph().maxRank=u}function qd(i){i.nodes().forEach(u=>{let r=i.node(u);r.dummy==="edge-proxy"&&(i.edge(r.e).labelRank=r.rank,i.removeNode(u))})}function Gd(i){let u=Number.POSITIVE_INFINITY,r=0,a=Number.POSITIVE_INFINITY,f=0,l=i.graph(),c=l.marginx||0,p=l.marginy||0;function _(m){let y=m.x,O=m.y,R=m.width,T=m.height;u=Math.min(u,y-R/2),r=Math.max(r,y+R/2),a=Math.min(a,O-T/2),f=Math.max(f,O+T/2)}i.nodes().forEach(m=>_(i.node(m))),i.edges().forEach(m=>{let y=i.edge(m);Object.hasOwn(y,"x")&&_(y)}),u-=c,a-=p,i.nodes().forEach(m=>{let y=i.node(m);y.x-=u,y.y-=a}),i.edges().forEach(m=>{let y=i.edge(m);y.points.forEach(O=>{O.x-=u,O.y-=a}),Object.hasOwn(y,"x")&&(y.x-=u),Object.hasOwn(y,"y")&&(y.y-=a)}),l.width=r-u+c,l.height=f-a+p}function Ud(i){i.edges().forEach(u=>{let r=i.edge(u),a=i.node(u.v),f=i.node(u.w),l,c;r.points?(l=r.points[0],c=r.points[r.points.length-1]):(r.points=[],l=f,c=a),r.points.unshift(Me.intersectRect(a,l)),r.points.push(Me.intersectRect(f,c))})}function zd(i){i.edges().forEach(u=>{let r=i.edge(u);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function jd(i){i.edges().forEach(u=>{let r=i.edge(u);r.reversed&&r.points.reverse()})}function Hd(i){i.nodes().forEach(u=>{if(i.children(u).length){let r=i.node(u),a=i.node(r.borderTop),f=i.node(r.borderBottom),l=i.node(r.borderLeft[r.borderLeft.length-1]),c=i.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(c.x-l.x),r.height=Math.abs(f.y-a.y),r.x=l.x+r.width/2,r.y=a.y+r.height/2}}),i.nodes().forEach(u=>{i.node(u).dummy==="border"&&i.removeNode(u)})}function Yd(i){i.edges().forEach(u=>{if(u.v===u.w){var r=i.node(u.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:u,label:i.edge(u)}),i.removeEdge(u)}})}function Vd(i){var u=Me.buildLayerMatrix(i);u.forEach(r=>{var a=0;r.forEach((f,l)=>{var c=i.node(f);c.order=l+a,(c.selfEdges||[]).forEach(p=>{Me.addDummyNode(i,"selfedge",{width:p.label.width,height:p.label.height,rank:c.rank,order:l+ ++a,e:p.e,label:p.label},"_se")}),delete c.selfEdges})})}function Kd(i){i.nodes().forEach(u=>{var r=i.node(u);if(r.dummy==="selfedge"){var a=i.node(r.e.v),f=a.x+a.width/2,l=a.y,c=r.x-f,p=a.height/2;i.setEdge(r.e,r.label),i.removeNode(u),r.label.points=[{x:f+2*c/3,y:l-p},{x:f+5*c/6,y:l-p},{x:f+c,y:l},{x:f+5*c/6,y:l+p},{x:f+2*c/3,y:l+p}],r.label.x=r.x,r.label.y=r.y}})}function Fr(i,u){return Me.mapValues(Me.pick(i,u),Number)}function kr(i){var u={};return i&&Object.entries(i).forEach(([r,a])=>{typeof r=="string"&&(r=r.toLowerCase()),u[r]=a}),u}let Xd=le,Zd=je.Graph;var Jd={debugOrdering:Qd};function Qd(i){let u=Xd.buildLayerMatrix(i),r=new Zd({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(a=>{r.setNode(a,{label:a}),r.setParent(a,"layer"+i.node(a).rank)}),i.edges().forEach(a=>r.setEdge(a.v,a.w,{},a.name)),u.forEach((a,f)=>{let l="layer"+f;r.setNode(l,{rank:"same"}),a.reduce((c,p)=>(r.setEdge(c,p,{style:"invis"}),p))}),r}var ep="1.1.4",Go={graphlib:je,layout:Sd,debug:Jd,util:{time:le.time,notime:le.notime},version:ep},Rt={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 + */Rt.exports,function(i,u){(function(){var r,a="4.17.21",f=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",p="Invalid `variable` option passed into `_.template`",_="__lodash_hash_undefined__",m=500,y="__lodash_placeholder__",O=1,R=2,T=4,G=1,K=2,k=1,ce=2,B=4,P=8,H=16,J=32,ee=64,re=128,he=256,bi=512,ng=30,tg="...",rg=800,ig=16,Ta=1,ug=2,og=3,Sn=1/0,gn=9007199254740991,ag=17976931348623157e292,Nt=NaN,Je=4294967295,fg=Je-1,sg=Je>>>1,lg=[["ary",re],["bind",k],["bindKey",ce],["curry",P],["curryRight",H],["flip",bi],["partial",J],["partialRight",ee],["rearg",he]],Dn="[object Arguments]",Pt="[object Array]",cg="[object AsyncFunction]",nt="[object Boolean]",tt="[object Date]",hg="[object DOMException]",$t="[object Error]",Mt="[object Function]",La="[object GeneratorFunction]",He="[object Map]",rt="[object Number]",dg="[object Null]",un="[object Object]",Na="[object Promise]",pg="[object Proxy]",it="[object RegExp]",Ye="[object Set]",ut="[object String]",Ft="[object Symbol]",gg="[object Undefined]",ot="[object WeakMap]",_g="[object WeakSet]",at="[object ArrayBuffer]",Wn="[object DataView]",yi="[object Float32Array]",Ei="[object Float64Array]",xi="[object Int8Array]",Oi="[object Int16Array]",Ii="[object Int32Array]",Si="[object Uint8Array]",Ai="[object Uint8ClampedArray]",Ri="[object Uint16Array]",Ci="[object Uint32Array]",vg=/\b__p \+= '';/g,mg=/\b(__p \+=) '' \+/g,wg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Pa=/&(?:amp|lt|gt|quot|#39);/g,$a=/[&<>"']/g,bg=RegExp(Pa.source),yg=RegExp($a.source),Eg=/<%-([\s\S]+?)%>/g,xg=/<%([\s\S]+?)%>/g,Ma=/<%=([\s\S]+?)%>/g,Og=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ig=/^\w*$/,Sg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ti=/[\\^$.*+?()[\]{}|]/g,Ag=RegExp(Ti.source),Li=/^\s+/,Rg=/\s/,Cg=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tg=/\{\n\/\* \[wrapped with (.+)\] \*/,Lg=/,? & /,Ng=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pg=/[()=,{}\[\]\/\s]/,$g=/\\(\\)?/g,Mg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fa=/\w*$/,Fg=/^[-+]0x[0-9a-f]+$/i,kg=/^0b[01]+$/i,Dg=/^\[object .+?Constructor\]$/,Wg=/^0o[0-7]+$/i,Bg=/^(?:0|[1-9]\d*)$/,qg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kt=/($^)/,Gg=/['\n\r\u2028\u2029\\]/g,Dt="\\ud800-\\udfff",Ug="\\u0300-\\u036f",zg="\\ufe20-\\ufe2f",jg="\\u20d0-\\u20ff",ka=Ug+zg+jg,Da="\\u2700-\\u27bf",Wa="a-z\\xdf-\\xf6\\xf8-\\xff",Hg="\\xac\\xb1\\xd7\\xf7",Yg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vg="\\u2000-\\u206f",Kg=" \\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",qa="\\ufe0e\\ufe0f",Ga=Hg+Yg+Vg+Kg,Ni="['’]",Xg="["+Dt+"]",Ua="["+Ga+"]",Wt="["+ka+"]",za="\\d+",Zg="["+Da+"]",ja="["+Wa+"]",Ha="[^"+Dt+Ga+za+Da+Wa+Ba+"]",Pi="\\ud83c[\\udffb-\\udfff]",Jg="(?:"+Wt+"|"+Pi+")",Ya="[^"+Dt+"]",$i="(?:\\ud83c[\\udde6-\\uddff]){2}",Mi="[\\ud800-\\udbff][\\udc00-\\udfff]",Bn="["+Ba+"]",Va="\\u200d",Ka="(?:"+ja+"|"+Ha+")",Qg="(?:"+Bn+"|"+Ha+")",Xa="(?:"+Ni+"(?:d|ll|m|re|s|t|ve))?",Za="(?:"+Ni+"(?:D|LL|M|RE|S|T|VE))?",Ja=Jg+"?",Qa="["+qa+"]?",e_="(?:"+Va+"(?:"+[Ya,$i,Mi].join("|")+")"+Qa+Ja+")*",n_="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",t_="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",ef=Qa+Ja+e_,r_="(?:"+[Zg,$i,Mi].join("|")+")"+ef,i_="(?:"+[Ya+Wt+"?",Wt,$i,Mi,Xg].join("|")+")",u_=RegExp(Ni,"g"),o_=RegExp(Wt,"g"),Fi=RegExp(Pi+"(?="+Pi+")|"+i_+ef,"g"),a_=RegExp([Bn+"?"+ja+"+"+Xa+"(?="+[Ua,Bn,"$"].join("|")+")",Qg+"+"+Za+"(?="+[Ua,Bn+Ka,"$"].join("|")+")",Bn+"?"+Ka+"+"+Xa,Bn+"+"+Za,t_,n_,za,r_].join("|"),"g"),f_=RegExp("["+Va+Dt+ka+qa+"]"),s_=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,l_=["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"],c_=-1,ie={};ie[yi]=ie[Ei]=ie[xi]=ie[Oi]=ie[Ii]=ie[Si]=ie[Ai]=ie[Ri]=ie[Ci]=!0,ie[Dn]=ie[Pt]=ie[at]=ie[nt]=ie[Wn]=ie[tt]=ie[$t]=ie[Mt]=ie[He]=ie[rt]=ie[un]=ie[it]=ie[Ye]=ie[ut]=ie[ot]=!1;var te={};te[Dn]=te[Pt]=te[at]=te[Wn]=te[nt]=te[tt]=te[yi]=te[Ei]=te[xi]=te[Oi]=te[Ii]=te[He]=te[rt]=te[un]=te[it]=te[Ye]=te[ut]=te[Ft]=te[Si]=te[Ai]=te[Ri]=te[Ci]=!0,te[$t]=te[Mt]=te[ot]=!1;var h_={À:"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"},d_={"&":"&","<":"<",">":">",'"':""","'":"'"},p_={"&":"&","<":"<",">":">",""":'"',"'":"'"},g_={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},__=parseFloat,v_=parseInt,nf=typeof ze=="object"&&ze&&ze.Object===Object&&ze,m_=typeof self=="object"&&self&&self.Object===Object&&self,ve=nf||m_||Function("return this")(),ki=u&&!u.nodeType&&u,An=ki&&!0&&i&&!i.nodeType&&i,tf=An&&An.exports===ki,Di=tf&&nf.process,Fe=function(){try{var w=An&&An.require&&An.require("util").types;return w||Di&&Di.binding&&Di.binding("util")}catch{}}(),rf=Fe&&Fe.isArrayBuffer,uf=Fe&&Fe.isDate,of=Fe&&Fe.isMap,af=Fe&&Fe.isRegExp,ff=Fe&&Fe.isSet,sf=Fe&&Fe.isTypedArray;function Re(w,x,E){switch(E.length){case 0:return w.call(x);case 1:return w.call(x,E[0]);case 2:return w.call(x,E[0],E[1]);case 3:return w.call(x,E[0],E[1],E[2])}return w.apply(x,E)}function w_(w,x,E,L){for(var D=-1,X=w==null?0:w.length;++D-1}function Wi(w,x,E){for(var L=-1,D=w==null?0:w.length;++L-1;);return E}function vf(w,x){for(var E=w.length;E--&&qn(x,w[E],0)>-1;);return E}function R_(w,x){for(var E=w.length,L=0;E--;)w[E]===x&&++L;return L}var C_=Ui(h_),T_=Ui(d_);function L_(w){return"\\"+g_[w]}function N_(w,x){return w==null?r:w[x]}function Gn(w){return f_.test(w)}function P_(w){return s_.test(w)}function $_(w){for(var x,E=[];!(x=w.next()).done;)E.push(x.value);return E}function Yi(w){var x=-1,E=Array(w.size);return w.forEach(function(L,D){E[++x]=[D,L]}),E}function mf(w,x){return function(E){return w(x(E))}}function mn(w,x){for(var E=-1,L=w.length,D=0,X=[];++E-1}function yv(e,n){var t=this.__data__,o=rr(t,e);return o<0?(++this.size,t.push([e,n])):t[o][1]=n,this}on.prototype.clear=vv,on.prototype.delete=mv,on.prototype.get=wv,on.prototype.has=bv,on.prototype.set=yv;function an(e){var n=-1,t=e==null?0:e.length;for(this.clear();++n=n?e:n)),e}function Be(e,n,t,o,s,d){var g,v=n&O,b=n&R,I=n&T;if(t&&(g=s?t(e,o,s,d):t(e)),g!==r)return g;if(!oe(e))return e;var S=W(e);if(S){if(g=I1(e),!v)return Oe(e,g)}else{var A=be(e),C=A==Mt||A==La;if(On(e))return es(e,v);if(A==un||A==Dn||C&&!s){if(g=b||C?{}:ws(e),!v)return b?p1(e,kv(g,e)):d1(e,Tf(g,e))}else{if(!te[A])return s?e:{};g=S1(e,A,v)}}d||(d=new Ke);var N=d.get(e);if(N)return N;d.set(e,g),Vs(e)?e.forEach(function(F){g.add(Be(F,n,t,F,e,d))}):Hs(e)&&e.forEach(function(F,j){g.set(j,Be(F,n,t,j,e,d))});var M=I?b?wu:mu:b?Se:_e,U=S?r:M(e);return ke(U||e,function(F,j){U&&(j=F,F=e[j]),pt(g,j,Be(F,n,t,j,e,d))}),g}function Dv(e){var n=_e(e);return function(t){return Lf(t,e,n)}}function Lf(e,n,t){var o=t.length;if(e==null)return!o;for(e=ne(e);o--;){var s=t[o],d=n[s],g=e[s];if(g===r&&!(s in e)||!d(g))return!1}return!0}function Nf(e,n,t){if(typeof e!="function")throw new De(c);return yt(function(){e.apply(r,t)},n)}function gt(e,n,t,o){var s=-1,d=Bt,g=!0,v=e.length,b=[],I=n.length;if(!v)return b;t&&(n=ue(n,Ce(t))),o?(d=Wi,g=!1):n.length>=f&&(d=ft,g=!1,n=new Tn(n));e:for(;++ss?0:s+t),o=o===r||o>s?s:q(o),o<0&&(o+=s),o=t>o?0:Xs(o);t0&&t(v)?n>1?me(v,n-1,t,o,s):vn(s,v):o||(s[s.length]=v)}return s}var eu=os(),Mf=os(!0);function Qe(e,n){return e&&eu(e,n,_e)}function nu(e,n){return e&&Mf(e,n,_e)}function ur(e,n){return _n(n,function(t){return hn(e[t])})}function Nn(e,n){n=En(n,e);for(var t=0,o=n.length;e!=null&&tn}function qv(e,n){return e!=null&&Q.call(e,n)}function Gv(e,n){return e!=null&&n in ne(e)}function Uv(e,n,t){return e>=we(n,t)&&e=120&&S.length>=120)?new Tn(g&&S):r}S=e[0];var A=-1,C=v[0];e:for(;++A-1;)v!==e&&Xt.call(v,b,1),Xt.call(e,b,1);return e}function Hf(e,n){for(var t=e?n.length:0,o=t-1;t--;){var s=n[t];if(t==o||s!==d){var d=s;cn(s)?Xt.call(e,s,1):cu(e,s)}}return e}function fu(e,n){return e+Qt(Sf()*(n-e+1))}function t1(e,n,t,o){for(var s=-1,d=ge(Jt((n-e)/(t||1)),0),g=E(d);d--;)g[o?d:++s]=e,e+=t;return g}function su(e,n){var t="";if(!e||n<1||n>gn)return t;do n%2&&(t+=e),n=Qt(n/2),n&&(e+=e);while(n);return t}function z(e,n){return Su(Es(e,n,Ae),e+"")}function r1(e){return Cf(Qn(e))}function i1(e,n){var t=Qn(e);return _r(t,Ln(n,0,t.length))}function mt(e,n,t,o){if(!oe(e))return e;n=En(n,e);for(var s=-1,d=n.length,g=d-1,v=e;v!=null&&++ss?0:s+n),t=t>s?s:t,t<0&&(t+=s),s=n>t?0:t-n>>>0,n>>>=0;for(var d=E(s);++o>>1,g=e[d];g!==null&&!Le(g)&&(t?g<=n:g=f){var I=n?null:m1(e);if(I)return Gt(I);g=!1,s=ft,b=new Tn}else b=n?[]:v;e:for(;++o=o?e:qe(e,n,t)}var Qf=K_||function(e){return ve.clearTimeout(e)};function es(e,n){if(n)return e.slice();var t=e.length,o=yf?yf(t):new e.constructor(t);return e.copy(o),o}function gu(e){var n=new e.constructor(e.byteLength);return new Vt(n).set(new Vt(e)),n}function s1(e,n){var t=n?gu(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}function l1(e){var n=new e.constructor(e.source,Fa.exec(e));return n.lastIndex=e.lastIndex,n}function c1(e){return dt?ne(dt.call(e)):{}}function ns(e,n){var t=n?gu(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function ts(e,n){if(e!==n){var t=e!==r,o=e===null,s=e===e,d=Le(e),g=n!==r,v=n===null,b=n===n,I=Le(n);if(!v&&!I&&!d&&e>n||d&&g&&b&&!v&&!I||o&&g&&b||!t&&b||!s)return 1;if(!o&&!d&&!I&&e=v)return b;var I=t[o];return b*(I=="desc"?-1:1)}}return e.index-n.index}function rs(e,n,t,o){for(var s=-1,d=e.length,g=t.length,v=-1,b=n.length,I=ge(d-g,0),S=E(b+I),A=!o;++v1?t[s-1]:r,g=s>2?t[2]:r;for(d=e.length>3&&typeof d=="function"?(s--,d):r,g&&Ee(t[0],t[1],g)&&(d=s<3?r:d,s=1),n=ne(n);++o-1?s[d?n[g]:g]:r}}function ss(e){return ln(function(n){var t=n.length,o=t,s=We.prototype.thru;for(e&&n.reverse();o--;){var d=n[o];if(typeof d!="function")throw new De(c);if(s&&!g&&pr(d)=="wrapper")var g=new We([],!0)}for(o=g?o:t;++o1&&V.reverse(),S&&bv))return!1;var I=d.get(e),S=d.get(n);if(I&&S)return I==n&&S==e;var A=-1,C=!0,N=t&K?new Tn:r;for(d.set(e,n),d.set(n,e);++A1?"& ":"")+n[o],n=n.join(t>2?", ":" "),e.replace(Cg,`{ +/* [wrapped with `+n+`] */ +`)}function R1(e){return W(e)||Mn(e)||!!(Of&&e&&e[Of])}function cn(e,n){var t=typeof e;return n=n??gn,!!n&&(t=="number"||t!="symbol"&&Bg.test(e))&&e>-1&&e%1==0&&e0){if(++n>=rg)return arguments[0]}else n=0;return e.apply(r,arguments)}}function _r(e,n){var t=-1,o=e.length,s=o-1;for(n=n===r?o:n;++t1?e[n-1]:r;return t=typeof t=="function"?(e.pop(),t):r,$s(e,t)});function Ms(e){var n=h(e);return n.__chain__=!0,n}function W0(e,n){return n(e),e}function vr(e,n){return n(e)}var B0=ln(function(e){var n=e.length,t=n?e[0]:0,o=this.__wrapped__,s=function(d){return Qi(d,e)};return n>1||this.__actions__.length||!(o instanceof Y)||!cn(t)?this.thru(s):(o=o.slice(t,+t+(n?1:0)),o.__actions__.push({func:vr,args:[s],thisArg:r}),new We(o,this.__chain__).thru(function(d){return n&&!d.length&&d.push(r),d}))});function q0(){return Ms(this)}function G0(){return new We(this.value(),this.__chain__)}function U0(){this.__values__===r&&(this.__values__=Ks(this.value()));var e=this.__index__>=this.__values__.length,n=e?r:this.__values__[this.__index__++];return{done:e,value:n}}function z0(){return this}function j0(e){for(var n,t=this;t instanceof tr;){var o=Rs(t);o.__index__=0,o.__values__=r,n?s.__wrapped__=o:n=o;var s=o;t=t.__wrapped__}return s.__wrapped__=e,n}function H0(){var e=this.__wrapped__;if(e instanceof Y){var n=e;return this.__actions__.length&&(n=new Y(this)),n=n.reverse(),n.__actions__.push({func:vr,args:[Au],thisArg:r}),new We(n,this.__chain__)}return this.thru(Au)}function Y0(){return Zf(this.__wrapped__,this.__actions__)}var V0=sr(function(e,n,t){Q.call(e,t)?++e[t]:fn(e,t,1)});function K0(e,n,t){var o=W(e)?lf:Wv;return t&&Ee(e,n,t)&&(n=r),o(e,$(n,3))}function X0(e,n){var t=W(e)?_n:$f;return t(e,$(n,3))}var Z0=fs(Cs),J0=fs(Ts);function Q0(e,n){return me(mr(e,n),1)}function em(e,n){return me(mr(e,n),Sn)}function nm(e,n,t){return t=t===r?1:q(t),me(mr(e,n),t)}function Fs(e,n){var t=W(e)?ke:bn;return t(e,$(n,3))}function ks(e,n){var t=W(e)?b_:Pf;return t(e,$(n,3))}var tm=sr(function(e,n,t){Q.call(e,t)?e[t].push(n):fn(e,t,[n])});function rm(e,n,t,o){e=Ie(e)?e:Qn(e),t=t&&!o?q(t):0;var s=e.length;return t<0&&(t=ge(s+t,0)),xr(e)?t<=s&&e.indexOf(n,t)>-1:!!s&&qn(e,n,t)>-1}var im=z(function(e,n,t){var o=-1,s=typeof n=="function",d=Ie(e)?E(e.length):[];return bn(e,function(g){d[++o]=s?Re(n,g,t):_t(g,n,t)}),d}),um=sr(function(e,n,t){fn(e,t,n)});function mr(e,n){var t=W(e)?ue:Bf;return t(e,$(n,3))}function om(e,n,t,o){return e==null?[]:(W(n)||(n=n==null?[]:[n]),t=o?r:t,W(t)||(t=t==null?[]:[t]),zf(e,n,t))}var am=sr(function(e,n,t){e[t?0:1].push(n)},function(){return[[],[]]});function fm(e,n,t){var o=W(e)?Bi:pf,s=arguments.length<3;return o(e,$(n,4),t,s,bn)}function sm(e,n,t){var o=W(e)?y_:pf,s=arguments.length<3;return o(e,$(n,4),t,s,Pf)}function lm(e,n){var t=W(e)?_n:$f;return t(e,yr($(n,3)))}function cm(e){var n=W(e)?Cf:r1;return n(e)}function hm(e,n,t){(t?Ee(e,n,t):n===r)?n=1:n=q(n);var o=W(e)?$v:i1;return o(e,n)}function dm(e){var n=W(e)?Mv:o1;return n(e)}function pm(e){if(e==null)return 0;if(Ie(e))return xr(e)?Un(e):e.length;var n=be(e);return n==He||n==Ye?e.size:uu(e).length}function gm(e,n,t){var o=W(e)?qi:a1;return t&&Ee(e,n,t)&&(n=r),o(e,$(n,3))}var _m=z(function(e,n){if(e==null)return[];var t=n.length;return t>1&&Ee(e,n[0],n[1])?n=[]:t>2&&Ee(n[0],n[1],n[2])&&(n=[n[0]]),zf(e,me(n,1),[])}),wr=X_||function(){return ve.Date.now()};function vm(e,n){if(typeof n!="function")throw new De(c);return e=q(e),function(){if(--e<1)return n.apply(this,arguments)}}function Ds(e,n,t){return n=t?r:n,n=e&&n==null?e.length:n,sn(e,re,r,r,r,r,n)}function Ws(e,n){var t;if(typeof n!="function")throw new De(c);return e=q(e),function(){return--e>0&&(t=n.apply(this,arguments)),e<=1&&(n=r),t}}var Cu=z(function(e,n,t){var o=k;if(t.length){var s=mn(t,Zn(Cu));o|=J}return sn(e,o,n,t,s)}),Bs=z(function(e,n,t){var o=k|ce;if(t.length){var s=mn(t,Zn(Bs));o|=J}return sn(n,o,e,t,s)});function qs(e,n,t){n=t?r:n;var o=sn(e,P,r,r,r,r,r,n);return o.placeholder=qs.placeholder,o}function Gs(e,n,t){n=t?r:n;var o=sn(e,H,r,r,r,r,r,n);return o.placeholder=Gs.placeholder,o}function Us(e,n,t){var o,s,d,g,v,b,I=0,S=!1,A=!1,C=!0;if(typeof e!="function")throw new De(c);n=Ue(n)||0,oe(t)&&(S=!!t.leading,A="maxWait"in t,d=A?ge(Ue(t.maxWait)||0,n):d,C="trailing"in t?!!t.trailing:C);function N(se){var Ze=o,pn=s;return o=s=r,I=se,g=e.apply(pn,Ze),g}function M(se){return I=se,v=yt(j,n),S?N(se):g}function U(se){var Ze=se-b,pn=se-I,fl=n-Ze;return A?we(fl,d-pn):fl}function F(se){var Ze=se-b,pn=se-I;return b===r||Ze>=n||Ze<0||A&&pn>=d}function j(){var se=wr();if(F(se))return V(se);v=yt(j,U(se))}function V(se){return v=r,C&&o?N(se):(o=s=r,g)}function Ne(){v!==r&&Qf(v),I=0,o=b=s=v=r}function xe(){return v===r?g:V(wr())}function Pe(){var se=wr(),Ze=F(se);if(o=arguments,s=this,b=se,Ze){if(v===r)return M(b);if(A)return Qf(v),v=yt(j,n),N(b)}return v===r&&(v=yt(j,n)),g}return Pe.cancel=Ne,Pe.flush=xe,Pe}var mm=z(function(e,n){return Nf(e,1,n)}),wm=z(function(e,n,t){return Nf(e,Ue(n)||0,t)});function bm(e){return sn(e,bi)}function br(e,n){if(typeof e!="function"||n!=null&&typeof n!="function")throw new De(c);var t=function(){var o=arguments,s=n?n.apply(this,o):o[0],d=t.cache;if(d.has(s))return d.get(s);var g=e.apply(this,o);return t.cache=d.set(s,g)||d,g};return t.cache=new(br.Cache||an),t}br.Cache=an;function yr(e){if(typeof e!="function")throw new De(c);return function(){var n=arguments;switch(n.length){case 0:return!e.call(this);case 1:return!e.call(this,n[0]);case 2:return!e.call(this,n[0],n[1]);case 3:return!e.call(this,n[0],n[1],n[2])}return!e.apply(this,n)}}function ym(e){return Ws(2,e)}var Em=f1(function(e,n){n=n.length==1&&W(n[0])?ue(n[0],Ce($())):ue(me(n,1),Ce($()));var t=n.length;return z(function(o){for(var s=-1,d=we(o.length,t);++s=n}),Mn=kf(function(){return arguments}())?kf:function(e){return ae(e)&&Q.call(e,"callee")&&!xf.call(e,"callee")},W=E.isArray,km=rf?Ce(rf):jv;function Ie(e){return e!=null&&Er(e.length)&&!hn(e)}function fe(e){return ae(e)&&Ie(e)}function Dm(e){return e===!0||e===!1||ae(e)&&ye(e)==nt}var On=J_||qu,Wm=uf?Ce(uf):Hv;function Bm(e){return ae(e)&&e.nodeType===1&&!Et(e)}function qm(e){if(e==null)return!0;if(Ie(e)&&(W(e)||typeof e=="string"||typeof e.splice=="function"||On(e)||Jn(e)||Mn(e)))return!e.length;var n=be(e);if(n==He||n==Ye)return!e.size;if(bt(e))return!uu(e).length;for(var t in e)if(Q.call(e,t))return!1;return!0}function Gm(e,n){return vt(e,n)}function Um(e,n,t){t=typeof t=="function"?t:r;var o=t?t(e,n):r;return o===r?vt(e,n,r,t):!!o}function Lu(e){if(!ae(e))return!1;var n=ye(e);return n==$t||n==hg||typeof e.message=="string"&&typeof e.name=="string"&&!Et(e)}function zm(e){return typeof e=="number"&&If(e)}function hn(e){if(!oe(e))return!1;var n=ye(e);return n==Mt||n==La||n==cg||n==pg}function js(e){return typeof e=="number"&&e==q(e)}function Er(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=gn}function oe(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}function ae(e){return e!=null&&typeof e=="object"}var Hs=of?Ce(of):Vv;function jm(e,n){return e===n||iu(e,n,yu(n))}function Hm(e,n,t){return t=typeof t=="function"?t:r,iu(e,n,yu(n),t)}function Ym(e){return Ys(e)&&e!=+e}function Vm(e){if(L1(e))throw new D(l);return Df(e)}function Km(e){return e===null}function Xm(e){return e==null}function Ys(e){return typeof e=="number"||ae(e)&&ye(e)==rt}function Et(e){if(!ae(e)||ye(e)!=un)return!1;var n=Kt(e);if(n===null)return!0;var t=Q.call(n,"constructor")&&n.constructor;return typeof t=="function"&&t instanceof t&&jt.call(t)==H_}var Nu=af?Ce(af):Kv;function Zm(e){return js(e)&&e>=-gn&&e<=gn}var Vs=ff?Ce(ff):Xv;function xr(e){return typeof e=="string"||!W(e)&&ae(e)&&ye(e)==ut}function Le(e){return typeof e=="symbol"||ae(e)&&ye(e)==Ft}var Jn=sf?Ce(sf):Zv;function Jm(e){return e===r}function Qm(e){return ae(e)&&be(e)==ot}function ew(e){return ae(e)&&ye(e)==_g}var nw=dr(ou),tw=dr(function(e,n){return e<=n});function Ks(e){if(!e)return[];if(Ie(e))return xr(e)?Ve(e):Oe(e);if(st&&e[st])return $_(e[st]());var n=be(e),t=n==He?Yi:n==Ye?Gt:Qn;return t(e)}function dn(e){if(!e)return e===0?e:0;if(e=Ue(e),e===Sn||e===-Sn){var n=e<0?-1:1;return n*ag}return e===e?e:0}function q(e){var n=dn(e),t=n%1;return n===n?t?n-t:n:0}function Xs(e){return e?Ln(q(e),0,Je):0}function Ue(e){if(typeof e=="number")return e;if(Le(e))return Nt;if(oe(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=oe(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=gf(e);var t=kg.test(e);return t||Wg.test(e)?v_(e.slice(2),t?2:8):Fg.test(e)?Nt:+e}function Zs(e){return en(e,Se(e))}function rw(e){return e?Ln(q(e),-gn,gn):e===0?e:0}function Z(e){return e==null?"":Te(e)}var iw=Kn(function(e,n){if(bt(n)||Ie(n)){en(n,_e(n),e);return}for(var t in n)Q.call(n,t)&&pt(e,t,n[t])}),Js=Kn(function(e,n){en(n,Se(n),e)}),Or=Kn(function(e,n,t,o){en(n,Se(n),e,o)}),uw=Kn(function(e,n,t,o){en(n,_e(n),e,o)}),ow=ln(Qi);function aw(e,n){var t=Vn(e);return n==null?t:Tf(t,n)}var fw=z(function(e,n){e=ne(e);var t=-1,o=n.length,s=o>2?n[2]:r;for(s&&Ee(n[0],n[1],s)&&(o=1);++t1),d}),en(e,wu(e),t),o&&(t=Be(t,O|R|T,w1));for(var s=n.length;s--;)cu(t,n[s]);return t});function Sw(e,n){return el(e,yr($(n)))}var Aw=ln(function(e,n){return e==null?{}:e1(e,n)});function el(e,n){if(e==null)return{};var t=ue(wu(e),function(o){return[o]});return n=$(n),jf(e,t,function(o,s){return n(o,s[0])})}function Rw(e,n,t){n=En(n,e);var o=-1,s=n.length;for(s||(s=1,e=r);++on){var o=e;e=n,n=o}if(t||e%1||n%1){var s=Sf();return we(e+s*(n-e+__("1e-"+((s+"").length-1))),n)}return fu(e,n)}var Ww=Xn(function(e,n,t){return n=n.toLowerCase(),e+(t?rl(n):n)});function rl(e){return Mu(Z(e).toLowerCase())}function il(e){return e=Z(e),e&&e.replace(qg,C_).replace(o_,"")}function Bw(e,n,t){e=Z(e),n=Te(n);var o=e.length;t=t===r?o:Ln(q(t),0,o);var s=t;return t-=n.length,t>=0&&e.slice(t,s)==n}function qw(e){return e=Z(e),e&&yg.test(e)?e.replace($a,T_):e}function Gw(e){return e=Z(e),e&&Ag.test(e)?e.replace(Ti,"\\$&"):e}var Uw=Xn(function(e,n,t){return e+(t?"-":"")+n.toLowerCase()}),zw=Xn(function(e,n,t){return e+(t?" ":"")+n.toLowerCase()}),jw=as("toLowerCase");function Hw(e,n,t){e=Z(e),n=q(n);var o=n?Un(e):0;if(!n||o>=n)return e;var s=(n-o)/2;return hr(Qt(s),t)+e+hr(Jt(s),t)}function Yw(e,n,t){e=Z(e),n=q(n);var o=n?Un(e):0;return n&&o>>0,t?(e=Z(e),e&&(typeof n=="string"||n!=null&&!Nu(n))&&(n=Te(n),!n&&Gn(e))?xn(Ve(e),0,t):e.split(n,t)):[]}var eb=Xn(function(e,n,t){return e+(t?" ":"")+Mu(n)});function nb(e,n,t){return e=Z(e),t=t==null?0:Ln(q(t),0,e.length),n=Te(n),e.slice(t,t+n.length)==n}function tb(e,n,t){var o=h.templateSettings;t&&Ee(e,n,t)&&(n=r),e=Z(e),n=Or({},n,o,ps);var s=Or({},n.imports,o.imports,ps),d=_e(s),g=Hi(s,d),v,b,I=0,S=n.interpolate||kt,A="__p += '",C=Vi((n.escape||kt).source+"|"+S.source+"|"+(S===Ma?Mg:kt).source+"|"+(n.evaluate||kt).source+"|$","g"),N="//# sourceURL="+(Q.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++c_+"]")+` +`;e.replace(C,function(F,j,V,Ne,xe,Pe){return V||(V=Ne),A+=e.slice(I,Pe).replace(Gg,L_),j&&(v=!0,A+=`' + +__e(`+j+`) + +'`),xe&&(b=!0,A+=`'; +`+xe+`; +__p += '`),V&&(A+=`' + +((__t = (`+V+`)) == null ? '' : __t) + +'`),I=Pe+F.length,F}),A+=`'; +`;var M=Q.call(n,"variable")&&n.variable;if(!M)A=`with (obj) { +`+A+` +} +`;else if(Pg.test(M))throw new D(p);A=(b?A.replace(vg,""):A).replace(mg,"$1").replace(wg,"$1;"),A="function("+(M||"obj")+`) { +`+(M?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(v?", __e = _.escape":"")+(b?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+A+`return __p +}`;var U=ol(function(){return X(d,N+"return "+A).apply(r,g)});if(U.source=A,Lu(U))throw U;return U}function rb(e){return Z(e).toLowerCase()}function ib(e){return Z(e).toUpperCase()}function ub(e,n,t){if(e=Z(e),e&&(t||n===r))return gf(e);if(!e||!(n=Te(n)))return e;var o=Ve(e),s=Ve(n),d=_f(o,s),g=vf(o,s)+1;return xn(o,d,g).join("")}function ob(e,n,t){if(e=Z(e),e&&(t||n===r))return e.slice(0,wf(e)+1);if(!e||!(n=Te(n)))return e;var o=Ve(e),s=vf(o,Ve(n))+1;return xn(o,0,s).join("")}function ab(e,n,t){if(e=Z(e),e&&(t||n===r))return e.replace(Li,"");if(!e||!(n=Te(n)))return e;var o=Ve(e),s=_f(o,Ve(n));return xn(o,s).join("")}function fb(e,n){var t=ng,o=tg;if(oe(n)){var s="separator"in n?n.separator:s;t="length"in n?q(n.length):t,o="omission"in n?Te(n.omission):o}e=Z(e);var d=e.length;if(Gn(e)){var g=Ve(e);d=g.length}if(t>=d)return e;var v=t-Un(o);if(v<1)return o;var b=g?xn(g,0,v).join(""):e.slice(0,v);if(s===r)return b+o;if(g&&(v+=b.length-v),Nu(s)){if(e.slice(v).search(s)){var I,S=b;for(s.global||(s=Vi(s.source,Z(Fa.exec(s))+"g")),s.lastIndex=0;I=s.exec(S);)var A=I.index;b=b.slice(0,A===r?v:A)}}else if(e.indexOf(Te(s),v)!=v){var C=b.lastIndexOf(s);C>-1&&(b=b.slice(0,C))}return b+o}function sb(e){return e=Z(e),e&&bg.test(e)?e.replace(Pa,D_):e}var lb=Xn(function(e,n,t){return e+(t?" ":"")+n.toUpperCase()}),Mu=as("toUpperCase");function ul(e,n,t){return e=Z(e),n=t?r:n,n===r?P_(e)?q_(e):O_(e):e.match(n)||[]}var ol=z(function(e,n){try{return Re(e,r,n)}catch(t){return Lu(t)?t:new D(t)}}),cb=ln(function(e,n){return ke(n,function(t){t=nn(t),fn(e,t,Cu(e[t],e))}),e});function hb(e){var n=e==null?0:e.length,t=$();return e=n?ue(e,function(o){if(typeof o[1]!="function")throw new De(c);return[t(o[0]),o[1]]}):[],z(function(o){for(var s=-1;++sgn)return[];var t=Je,o=we(e,Je);n=$(n),e-=Je;for(var s=ji(o,n);++t0||n<0)?new Y(t):(e<0?t=t.takeRight(-e):e&&(t=t.drop(e)),n!==r&&(n=q(n),t=n<0?t.dropRight(-n):t.take(n-e)),t)},Y.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Y.prototype.toArray=function(){return this.take(Je)},Qe(Y.prototype,function(e,n){var t=/^(?:filter|find|map|reject)|While$/.test(n),o=/^(?:head|last)$/.test(n),s=h[o?"take"+(n=="last"?"Right":""):n],d=o||/^find/.test(n);s&&(h.prototype[n]=function(){var g=this.__wrapped__,v=o?[1]:arguments,b=g instanceof Y,I=v[0],S=b||W(g),A=function(j){var V=s.apply(h,vn([j],v));return o&&C?V[0]:V};S&&t&&typeof I=="function"&&I.length!=1&&(b=S=!1);var C=this.__chain__,N=!!this.__actions__.length,M=d&&!C,U=b&&!N;if(!d&&S){g=U?g:new Y(this);var F=e.apply(g,v);return F.__actions__.push({func:vr,args:[A],thisArg:r}),new We(F,C)}return M&&U?e.apply(this,v):(F=this.thru(A),M?o?F.value()[0]:F.value():F)})}),ke(["pop","push","shift","sort","splice","unshift"],function(e){var n=Ut[e],t=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);h.prototype[e]=function(){var s=arguments;if(o&&!this.__chain__){var d=this.value();return n.apply(W(d)?d:[],s)}return this[t](function(g){return n.apply(W(g)?g:[],s)})}}),Qe(Y.prototype,function(e,n){var t=h[n];if(t){var o=t.name+"";Q.call(Yn,o)||(Yn[o]=[]),Yn[o].push({name:n,func:t})}}),Yn[lr(r,ce).name]=[{name:"wrapper",func:r}],Y.prototype.clone=sv,Y.prototype.reverse=lv,Y.prototype.value=cv,h.prototype.at=B0,h.prototype.chain=q0,h.prototype.commit=G0,h.prototype.next=U0,h.prototype.plant=j0,h.prototype.reverse=H0,h.prototype.toJSON=h.prototype.valueOf=h.prototype.value=Y0,h.prototype.first=h.prototype.head,st&&(h.prototype[st]=z0),h},zn=G_();An?((An.exports=zn)._=zn,ki._=zn):ve._=zn}).call(ze)}(Rt,Rt.exports);var Ct=Rt.exports,np=function(){},tp=np(),Fn=function(i){return i!==tp&&i!==null},rp=Fn,ip=Array.prototype.forEach,up=Object.create,op=function(i,u){var r;for(r in i)u[r]=i[r]},ap=function(i){var u=up(null);return ip.call(arguments,function(r){rp(r)&&op(Object(r),u)}),u},fp=function(){var i=Math.sign;return typeof i!="function"?!1:i(10)===1&&i(-20)===-1},Dr,Uo;function sp(){return Uo||(Uo=1,Dr=function(i){return i=Number(i),isNaN(i)||i===0?i:i>0?1:-1}),Dr}var lp=fp()?Math.sign:sp(),cp=lp,hp=Math.abs,dp=Math.floor,pp=function(i){return isNaN(i)?0:(i=Number(i),i===0||!isFinite(i)?i:cp(i)*dp(hp(i)))},gp=pp,_p=Math.max,zo=function(i){return _p(0,gp(i))},jo=function(i){if(typeof i!="function")throw new TypeError(i+" is not a function");return i},vp=Fn,Wr=function(i){if(!vp(i))throw new TypeError("Cannot use null or undefined");return i},mp={exports:{}},Br,Ho;function wp(){return Ho||(Ho=1,Br=function(){var i=Object.assign,u;return typeof i!="function"?!1:(u={foo:"raz"},i(u,{bar:"dwa"},{trzy:"trzy"}),u.foo+u.bar+u.trzy==="razdwatrzy")}),Br}var qr,Yo;function bp(){return Yo||(Yo=1,qr=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),qr}var Gr,Vo;function yp(){if(Vo)return Gr;Vo=1;var i=Fn,u=Object.keys;return Gr=function(r){return u(i(r)?Object(r):r)},Gr}var Ur,Ko;function Ep(){return Ko||(Ko=1,Ur=bp()()?Object.keys:yp()),Ur}var zr,Xo;function xp(){if(Xo)return zr;Xo=1;var i=Ep(),u=Wr,r=Math.max;return zr=function(a,f){var l,c,p=r(arguments.length,2),_;for(a=Object(u(a)),_=function(m){try{a[m]=f[m]}catch(y){l||(l=y)}},c=1;c-1},ei}var ni,sa;function Mp(){return sa||(sa=1,ni=Pp()()?String.prototype.contains:$p()),ni}var la;function kn(){if(la)return Yr.exports;la=1;var i=ta(),u=Np(),r=Jo(),a=ap,f=Mp(),l=Yr.exports=function(c,p){var _,m,y,O,R;return arguments.length<2||typeof c!="string"?(O=p,p=c,c=null):O=arguments[2],i(c)?(_=f.call(c,"c"),m=f.call(c,"e"),y=f.call(c,"w")):(_=y=!0,m=!1),R={value:p,configurable:_,enumerable:m,writable:y},O?r(a(O),R):R};return l.gs=function(c,p,_){var m,y,O,R;return typeof c!="string"?(O=_,_=p,p=c,c=null):O=arguments[3],i(p)?u(p)?i(_)?u(_)||(O=_,_=void 0):_=void 0:(O=p,p=_=void 0):p=void 0,i(c)?(m=f.call(c,"c"),y=f.call(c,"e")):(m=!0,y=!1),R={get:p,set:_,configurable:m,enumerable:y},O?r(a(O),R):R},Yr.exports}var ti={exports:{}};(function(i,u){var r=kn(),a=jo,f=Function.prototype.apply,l=Function.prototype.call,c=Object.create,p=Object.defineProperty,_=Object.defineProperties,m=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0},O,R,T,G,K,k,ce;O=function(B,P){var H;return a(P),m.call(this,"__ee__")?H=this.__ee__:(H=y.value=c(null),p(this,"__ee__",y),y.value=null),H[B]?typeof H[B]=="object"?H[B].push(P):H[B]=[H[B],P]:H[B]=P,this},R=function(B,P){var H,J;return a(P),J=this,O.call(this,B,H=function(){T.call(J,B,H),f.call(P,this,arguments)}),H.__eeOnceListener__=P,this},T=function(B,P){var H,J,ee,re;if(a(P),!m.call(this,"__ee__"))return this;if(H=this.__ee__,!H[B])return this;if(J=H[B],typeof J=="object")for(re=0;ee=J[re];++re)(ee===P||ee.__eeOnceListener__===P)&&(J.length===2?H[B]=J[re?0:1]:J.splice(re,1));else(J===P||J.__eeOnceListener__===P)&&delete H[B];return this},G=function(B){var P,H,J,ee,re;if(m.call(this,"__ee__")&&(ee=this.__ee__[B],!!ee))if(typeof ee=="object"){for(H=arguments.length,re=new Array(H-1),P=1;P=55296&&H<=56319&&(he+=R[++k])),he=T?m.call(T,G,he,ce):he,K?(y.value=he,O(B,ce,y)):B[ce]=he,++ce;P=ce}}if(P===void 0)for(P=a(R.length),K&&(B=new K(P)),k=0;kasync u=>{try{const r=await i(u);postMessage({result:r})}catch(r){postMessage({error:r})}};function Qp(i){const u={};return Ct.forEach(i==null?void 0:i.events,({id:r,pId:a})=>{u[r]=a}),u}function eg({trace:i,mode:u,orientation:r}){const a=new Go.graphlib.Graph;switch(a.setGraph({}),u){case"directed-graph":Ct.forEach(i==null?void 0:i.events,({id:f,pId:l,type:c},p)=>{f&&(a.hasNode(`${f}`)?a.node(`${f}`).size+=1:a.setNode(`${f}`,{label:`${f}`,width:1,height:1,size:1}),l&&a.hasNode(`${l}`)&&a.setEdge(`${f}`,`${l}`,{label:`${f}`,width:1,height:1}))});break;case"tree":{const f=Qp(i);Ct.forEach(i==null?void 0:i.events,({id:l,pId:c,type:p},_)=>{if(l){a.hasNode(`${l}`)?a.node(`${l}`).size+=1:a.setNode(`${l}`,{label:`${l}`,width:1,height:1,size:1});const m=f[l];m&&a.hasNode(`${m}`)&&a.setEdge(`${l}`,`${m}`,{label:`${l}`,width:1,height:1})}})}break}return a.setGraph({ranksep:100,align:"UL",rankdir:r==="horizontal"?"LR":"TB"}),Go.layout(a),a.nodes().map(f=>Ct.pick(a.node(f),"x","y","label","size"))}onmessage=Jp(async({data:i})=>eg(i))})(); diff --git a/index.html b/index.html index 83e6caa..e335d1e 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ Posthoc - +