archgine 1.0.76 → 1.0.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs.js CHANGED
@@ -2,7 +2,7 @@
2
2
  `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(Id);var Oh={},La=Vi.NAMESPACE,uh=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,lp=new RegExp("[\\-\\.0-9"+uh.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),hp=new RegExp("^"+uh.source+lp.source+"*(?::"+uh.source+lp.source+"*)?$"),la=0,un=1,ms=2,ha=3,vs=4,xs=5,ca=6,qo=7;function Ls(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Ls)}Ls.prototype=new Error;Ls.prototype.name=Ls.name;function Rd(){}Rd.prototype={parse:function(i,e,t){var r=this.domBuilder;r.startDocument(),Pd(e,e={}),tE(i,e,t,r,this.errorHandler),r.endDocument()}};function tE(i,e,t,r,s){function o(B){if(B>65535){B-=65536;var xt=55296+(B>>10),Pt=56320+(B&1023);return String.fromCharCode(xt,Pt)}else return String.fromCharCode(B)}function u(B){var xt=B.slice(1,-1);return Object.hasOwnProperty.call(t,xt)?t[xt]:xt.charAt(0)==="#"?o(parseInt(xt.substr(1).replace("x","0x"))):(s.error("entity not found:"+B),B)}function h(B){if(B>O){var xt=i.substring(O,B).replace(/&#?\w+;/g,u);T&&c(O),r.characters(xt,0,B-O),O=B}}function c(B,xt){for(;B>=p&&(xt=A.exec(i));)y=xt.index,p=y+xt[0].length,T.lineNumber++;T.columnNumber=B-y+1}for(var y=0,p=0,A=/.*(?:\r\n?|\n)|.*$/g,T=r.locator,C=[{currentNSMap:e}],N={},O=0;;){try{var L=i.indexOf("<",O);if(L<0){if(!i.substr(O).match(/^\s*$/)){var P=r.doc,W=P.createTextNode(i.substr(O));P.appendChild(W),r.currentElement=W}return}switch(L>O&&h(L),i.charAt(L+1)){case"/":var rt=i.indexOf(">",L+3),q=i.substring(L+2,rt).replace(/[ \t\n\r]+$/g,""),b=C.pop();rt<0?(q=i.substring(L+2).replace(/[\s<].*/,""),s.error("end tag name: "+q+" is not complete:"+b.tagName),rt=L+1+q.length):q.match(/\s</)&&(q=q.replace(/[\s<].*/,""),s.error("end tag name: "+q+" maybe not complete"),rt=L+1+q.length);var Y=b.localNSMap,z=b.tagName==q,j=z||b.tagName&&b.tagName.toLowerCase()==q.toLowerCase();if(j){if(r.endElement(b.uri,b.localName,q),Y)for(var tt in Y)Object.prototype.hasOwnProperty.call(Y,tt)&&r.endPrefixMapping(tt);z||s.fatalError("end tag name: "+q+" is not match the current start tagName:"+b.tagName)}else C.push(b);rt++;break;case"?":T&&c(L),rt=sE(i,L,r);break;case"!":T&&c(L),rt=nE(i,L,r,s);break;default:T&&c(L);var Q=new Fd,K=C[C.length-1].currentNSMap,rt=eE(i,L,Q,K,u,s),at=Q.length;if(!Q.closed&&iE(i,rt,Q.tagName,N)&&(Q.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),T&&at){for(var ct=cp(T,{}),pt=0;pt<at;pt++){var dt=Q[pt];c(dt.offset),dt.locator=cp(T,{})}r.locator=ct,fp(Q,r,K)&&C.push(Q),r.locator=T}else fp(Q,r,K)&&C.push(Q);La.isHTML(Q.uri)&&!Q.closed?rt=rE(i,rt,Q.tagName,u,r):rt++}}catch(B){if(B instanceof Ls)throw B;s.error("element parse error: "+B),rt=-1}rt>O?O=rt:h(Math.max(L,O)+1)}}function cp(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function eE(i,e,t,r,s,o){function u(T,C,N){t.attributeNames.hasOwnProperty(T)&&o.fatalError("Attribute "+T+" redefined"),t.addValue(T,C.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),N)}for(var h,c,y=++e,p=la;;){var A=i.charAt(y);switch(A){case"=":if(p===un)h=i.slice(e,y),p=ha;else if(p===ms)p=ha;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(p===ha||p===un)if(p===un&&(o.warning('attribute value must after "="'),h=i.slice(e,y)),e=y+1,y=i.indexOf(A,e),y>0)c=i.slice(e,y),u(h,c,e-1),p=xs;else throw new Error("attribute value no end '"+A+"' match");else if(p==vs)c=i.slice(e,y),u(h,c,e),o.warning('attribute "'+h+'" missed start quot('+A+")!!"),e=y+1,p=xs;else throw new Error('attribute value must after "="');break;case"/":switch(p){case la:t.setTagName(i.slice(e,y));case xs:case ca:case qo:p=qo,t.closed=!0;case vs:case un:break;case ms:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),p==la&&t.setTagName(i.slice(e,y)),y;case">":switch(p){case la:t.setTagName(i.slice(e,y));case xs:case ca:case qo:break;case vs:case un:c=i.slice(e,y),c.slice(-1)==="/"&&(t.closed=!0,c=c.slice(0,-1));case ms:p===ms&&(c=h),p==vs?(o.warning('attribute "'+c+'" missed quot(")!'),u(h,c,e)):((!La.isHTML(r[""])||!c.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),u(c,c,e));break;case ha:throw new Error("attribute value missed!!")}return y;case"€":A=" ";default:if(A<=" ")switch(p){case la:t.setTagName(i.slice(e,y)),p=ca;break;case un:h=i.slice(e,y),p=ms;break;case vs:var c=i.slice(e,y);o.warning('attribute "'+c+'" missed quot(")!!'),u(h,c,e);case xs:p=ca;break}else switch(p){case ms:t.tagName,(!La.isHTML(r[""])||!h.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+h+'" missed value!! "'+h+'" instead2!!'),u(h,h,e),e=y,p=un;break;case xs:o.warning('attribute space is required"'+h+'"!!');case ca:p=un,e=y;break;case ha:p=vs,e=y;break;case qo:throw new Error("elements closed character '/' and '>' must be connected to")}}y++}}function fp(i,e,t){for(var r=i.tagName,s=null,A=i.length;A--;){var o=i[A],u=o.qName,h=o.value,T=u.indexOf(":");if(T>0)var c=o.prefix=u.slice(0,T),y=u.slice(T+1),p=c==="xmlns"&&y;else y=u,c=null,p=u==="xmlns"&&"";o.localName=y,p!==!1&&(s==null&&(s={},Pd(t,t={})),t[p]=s[p]=h,o.uri=La.XMLNS,e.startPrefixMapping(p,h))}for(var A=i.length;A--;){o=i[A];var c=o.prefix;c&&(c==="xml"&&(o.uri=La.XML),c!=="xmlns"&&(o.uri=t[c||""]))}var T=r.indexOf(":");T>0?(c=i.prefix=r.slice(0,T),y=i.localName=r.slice(T+1)):(c=null,y=i.localName=r);var C=i.uri=t[c||""];if(e.startElement(C,y,r,i),i.closed){if(e.endElement(C,y,r),s)for(c in s)Object.prototype.hasOwnProperty.call(s,c)&&e.endPrefixMapping(c)}else return i.currentNSMap=t,i.localNSMap=s,!0}function rE(i,e,t,r,s){if(/^(?:script|textarea)$/i.test(t)){var o=i.indexOf("</"+t+">",e),u=i.substring(e+1,o);if(/[&<]/.test(u))return/^script$/i.test(t)?(s.characters(u,0,u.length),o):(u=u.replace(/&#?\w+;/g,r),s.characters(u,0,u.length),o)}return e+1}function iE(i,e,t,r){var s=r[t];return s==null&&(s=i.lastIndexOf("</"+t+">"),s<e&&(s=i.lastIndexOf("</"+t)),r[t]=s),s<e}function Pd(i,e){for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t])}function nE(i,e,t,r){var s=i.charAt(e+2);switch(s){case"-":if(i.charAt(e+3)==="-"){var o=i.indexOf("-->",e+4);return o>e?(t.comment(i,e+4,o-e-4),o+3):(r.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var o=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,o-e-9),t.endCDATA(),o+3}var u=aE(i,e),h=u.length;if(h>1&&/!doctype/i.test(u[0][0])){var c=u[1][0],y=!1,p=!1;h>3&&(/^public$/i.test(u[2][0])?(y=u[3][0],p=h>4&&u[4][0]):/^system$/i.test(u[2][0])&&(p=u[3][0]));var A=u[h-1];return t.startDTD(c,y,p),t.endDTD(),A.index+A[0].length}}return-1}function sE(i,e,t){var r=i.indexOf("?>",e);if(r){var s=i.substring(e,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return s?(s[0].length,t.processingInstruction(s[1],s[2]),r+2):-1}return-1}function Fd(){this.attributeNames={}}Fd.prototype={setTagName:function(i){if(!hp.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!hp.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function aE(i,e){var t,r=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(i);t=s.exec(i);)if(r.push(t),t[1])return r}Oh.XMLReader=Rd;Oh.ParseError=Ls;var oE=Vi,uE=yn,pp=Id,kd=Oh,lE=uE.DOMImplementation,dp=oE.NAMESPACE,hE=kd.ParseError,cE=kd.XMLReader;function Hd(i){return i.replace(/\r[\n\u0085]/g,`
3
3
  `).replace(/[\r\u0085\u2028]/g,`
4
4
  `)}function Ud(i){this.options=i||{locator:{}}}Ud.prototype.parseFromString=function(i,e){var t=this.options,r=new cE,s=t.domBuilder||new qa,o=t.errorHandler,u=t.locator,h=t.xmlns||{},c=/\/x?html?$/.test(e),y=c?pp.HTML_ENTITIES:pp.XML_ENTITIES;u&&s.setDocumentLocator(u),r.errorHandler=fE(o,s,u),r.domBuilder=t.domBuilder||s,c&&(h[""]=dp.HTML),h.xml=h.xml||dp.XML;var p=t.normalizeLineEndings||Hd;return i&&typeof i=="string"?r.parse(p(i),h,y):r.errorHandler.error("invalid doc source"),s.doc};function fE(i,e,t){if(!i){if(e instanceof qa)return e;i=e}var r={},s=i instanceof Function;t=t||{};function o(u){var h=i[u];!h&&s&&(h=i.length==2?function(c){i(u,c)}:i),r[u]=h&&function(c){h("[xmldom "+u+"] "+c+lh(t))}||function(){}}return o("warning"),o("error"),o("fatalError"),r}function qa(){this.cdata=!1}function Es(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}qa.prototype={startDocument:function(){this.doc=new lE().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,r){var s=this.doc,o=s.createElementNS(i,t||e),u=r.length;Vo(this,o),this.currentElement=o,this.locator&&Es(this.locator,o);for(var h=0;h<u;h++){var i=r.getURI(h),c=r.getValue(h),t=r.getQName(h),y=s.createAttributeNS(i,t);this.locator&&Es(r.getLocator(h),y),y.value=y.nodeValue=c,o.setAttributeNode(y)}},endElement:function(i,e,t){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(i,e){},endPrefixMapping:function(i){},processingInstruction:function(i,e){var t=this.doc.createProcessingInstruction(i,e);this.locator&&Es(this.locator,t),Vo(this,t)},ignorableWhitespace:function(i,e,t){},characters:function(i,e,t){if(i=gp.apply(this,arguments),i){if(this.cdata)var r=this.doc.createCDATASection(i);else var r=this.doc.createTextNode(i);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(i)&&this.doc.appendChild(r),this.locator&&Es(this.locator,r)}},skippedEntity:function(i){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(i){(this.locator=i)&&(i.lineNumber=0)},comment:function(i,e,t){i=gp.apply(this,arguments);var r=this.doc.createComment(i);this.locator&&Es(this.locator,r),Vo(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(i,e,t){var r=this.doc.implementation;if(r&&r.createDocumentType){var s=r.createDocumentType(i,e,t);this.locator&&Es(this.locator,s),Vo(this,s),this.doc.doctype=s}},warning:function(i){console.warn("[xmldom warning] "+i,lh(this.locator))},error:function(i){console.error("[xmldom error] "+i,lh(this.locator))},fatalError:function(i){throw new hE(i,this.locator)}};function lh(i){if(i)return`
5
- @`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function gp(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){qa.prototype[i]=function(){return null}});function Vo(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}mu.__DOMHandler=qa;mu.normalizeLineEndings=Hd;mu.DOMParser=Ud;var pE=mu.DOMParser;const dE="1.0.76";function gE(){return typeof window!="undefined"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Ns=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"?self:{document:void 0,tinyEngine:void 0};Ns.Path2D||Rx(Ns);Ns.DOMParser||(Ns.DOMParser=pE);const Wt={window:Ns,version:dE,isBrowser:gE(),dpr:typeof window!="undefined"&&window.devicePixelRatio||1,document:Ns.document,time:0,deltaTime:0,config:hd},fa=(i,e,t)=>Math.max(e,Math.min(t,i)),yp=(i,e=1e-6)=>Math.abs(i)<e?0:i<0?-1:1,yE=i=>i*(Math.PI/180),mE=(i,e)=>(i%e+e)%e,Hl=(i,e,t)=>(1-t)*i+t*e,vE=i=>{let e=i*(180/Math.PI);return e<0&&(e+=360),e>360&&(e-=360),e},Qt={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#314a43",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},xE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Vr={h:0,s:0,l:0},Wo={h:0,s:0,l:0};function Ul(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}const EE=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Yt{constructor(e,t,r,s){d(this,"isColor",!0);d(this,"r",1);d(this,"g",1);d(this,"b",1);d(this,"a",1);return t===void 0&&r===void 0?this.set(e):this.setRGBA(e,t,r,s)}static isColor(e){return typeof e=="string"?EE.test(e):typeof e=="number"?e>=0&&e<=16777215:!1}static getRandomStyle(){return Li.random().getStyle()}static getDarken(e,t=.8){return Li.set(e).getHSL(zo),Li.setHSL(zo.h,zo.s,zo.l*t).getStyle()}static getLighten(e,t=1.2){return this.getDarken(e,t)}static getContrast(e){return Li.set(e),Li.getContrastString()}static getArray(e){return Li.set(e).toArray()}static getComplementary(e){return Li.set(e),Li.getComplementaryString()}static getMoreTransparent(e,t){return Li.set(e).setA(t).getStyle()}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(e){return this.r=e,this.g=e,this.b=e,this.a=1,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this.a=1,this}setR(e){return this.r=e,this}setG(e){return this.g=e,this}setB(e){return this.b=e,this}setA(e){return this.a=e,this}setRGB(e,t,r){return this.setRGBA(e,t,r,this.a)}setRGBA(e,t,r,s=1){return this.r=e,this.g=t,this.b=r,this.a=s,this}setHSL(e,t,r,s=1){if(e=mE(e,1),t=fa(t,0,1),r=fa(r,0,1),t===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+t):r+t-r*t,u=2*r-o;this.r=Ul(u,o,e+1/3),this.g=Ul(u,o,e),this.b=Ul(u,o,e-1/3)}return this.a=s,this}setStyle(e){let t;if(t=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let r;const s=t[1],o=t[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const u=parseFloat(r[1])/360,h=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100,y=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0);return this.setHSL(u,h,c,y)}break}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=t[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this.a=1,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this.a=1,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=xE[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("Color: Unknown color "+e),this}clone(){return new Yt(this.r,this.g,this.b,this.a)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}getRGB(e=new Yt){return e.setRGB(this.r,this.g,this.b)}getRGBByBg(e=new Yt){const t=this.a,r=t*this.r+(1-t)*e.r,s=t*this.g+(1-t)*e.g,o=t*this.b+(1-t)*e.b;return new Yt(r,s,o)}getHex(){return fa(this.r*255,0,255)<<16^fa(this.g*255,0,255)<<8^fa(this.b*255,0,255)<<0}getHSL(e){const t=this.r,r=this.g,s=this.b,o=Math.max(t,r,s),u=Math.min(t,r,s);let h=0,c;const y=(u+o)/2;if(u===o)h=0,c=0;else{const p=o-u;switch(c=y<=.5?p/(o+u):p/(2-o-u),o){case t:h=(r-s)/p+(r<s?6:0);break;case r:h=(s-t)/p+2;break;case s:h=(t-r)/p+4;break}h/=6}return e.h=h,e.s=c,e.l=y,e}getStyle(){return this.a===1?`rgb(${this.r*255|0},${this.g*255|0},${this.b*255|0})`:`rgba(${this.r*255|0},${this.g*255|0},${this.b*255|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let e=(this.r*255*299+this.g*255*587+this.b*255*144)/1e3;return e+=(255-e)*(255-this.a*255)/255,e}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(e=new Yt){const t=this.toArray(),r=[0,0,0,1];for(let s=0;s<t.length;s++)if(s<3)r[s]=1-t[s];else if(s===3)t[s]>1||t[s]<=0?r[s]=1:r[s]=Math.max(Math.min(parseFloat(t[s].toFixed(2)),1),0);else continue;return e.setRGBA(r[0],r[1],r[2],parseFloat(r[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(e){if(typeof e=="undefined"||e>=1)return this.getHexString();const t=this.getRGBByBg(),r=t.r*e+(1-e),s=t.g*e+(1-e),o=t.b*e+(1-e);return new Yt(r,s,o).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(e,t,r){return this.getHSL(Vr),Vr.h+=e,Vr.s+=t,Vr.l+=r,this.setHSL(Vr.h,Vr.s,Vr.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Vr),e.getHSL(Wo);const r=Hl(Vr.h,Wo.h,t),s=Hl(Vr.s,Wo.s,t),o=Hl(Vr.l,Wo.l,t);return this.setHSL(r,s,o),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}toArray(e=[0,0,0,0],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Li=new Yt,zo={h:0,s:0,l:0};class k{constructor(e=0,t=0,r){d(this,"isVector2",!0);d(this,"x",0);d(this,"y",0);d(this,"z");this.x=e,this.y=t,this.z=r||0}static isZero(e){return e.x===0&&e.y===0}static isEmpty(e){return!Number.isFinite(e.x)&&!Number.isFinite(e.y)}static equals(e,t,r=!0){return r?e.x===t.x&&e.y===t.y:Math.abs(e.x-t.x)<Number.EPSILON&&Math.abs(e.y-t.y)<Number.EPSILON}static getInt32Array(e,t=2){const r=new ArrayBuffer(e.length*t*4),s=new Int32Array(r);for(let o=0,u=e.length;o<u;o++)s[o*2]=e[o].x,s[o*2+1]=e[o].y;return s}static getFloat64Array(e,t=2){const r=new ArrayBuffer(e.length*t*8),s=new Float64Array(r);for(let o=0,u=e.length;o<u;o++)s[o*2]=e[o].x,s[o*2+1]=e[o].y;return s}static getVectors(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(new k(e[r].x,e[r].y));return t}static getStrings(e){const t=[];if(!e||!e.length)return"";for(let r=0,s=e.length;r<s;r++)t.push(k.getString(e[r]));return t.join(",")}static getString(e){return`${e.x},${e.y}`}static getLength(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static getDistance(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}static dot(e,t){return e.x*t.x+e.y*t.y}static cross(e,t){return e.x*t.y-e.y*t.x}static sub(e,t){return new k().subVectors(e,t)}static isPointOnSegment(e,t,r){return yp(this.sub(e,r).cross(this.sub(t,r)))===0&&yp(this.sub(e,r).dot(this.sub(t,r)))<=0}static angle(e,t,r){return r?Math.atan2(e.y-t.y,e.x-t.x):vE(Math.atan2(e.y-t.y,e.x-t.x))}static getSamplingPoints(e,t=100){let r=this.getClothoidPoints(e,t),s=0;for(let o=0,u=r.length;o<u;o++){let h=Math.max(0,o-1);o>0?s+=this.getDistance(r[h],r[h+1]):s=0,r[o].l=Math.round(s);let c=this.angle(r[h+1],r[h]);r[o].a=Math.round(c*100)/100}return r}static getClothoidPoints(e,t=100){let r=[],s=e.concat([]);if(!s||s.length<2)return r;s.length===2?(s.push(s[1]),s.unshift(s[0])):s.length===3&&s.splice(2,0,s[1]);for(let o=0;o<s.length-3;o+=3){let u=new k(s[o].x,s[o].y),h=new k(s[o+1].x,s[o+1].y),c=new k(s[o+2].x,s[o+2].y),y=new k(s[o+3].x,s[o+3].y),p=0;p+=u.distanceTo(h),p+=h.distanceTo(c),p+=c.distanceTo(y);let A=Math.min(.5,1/(p/t));for(let T=A;T<1;T+=A){let C=3*(h.x-u.x),N=3*(c.x-h.x)-C,O=y.x-u.x-C-N,L=3*(h.y-u.y),P=3*(c.y-h.y)-L,W=y.y-u.y-L-P,q=O*Math.pow(T,3)+N*Math.pow(T,2)+C*T+u.x,b=W*Math.pow(T,3)+P*Math.pow(T,2)+L*T+u.y;r.push({x:Math.round(q),y:Math.round(b),a:0,l:0})}}return r.unshift({x:s[0].x,y:s[0].y,a:0,l:0}),r.push({x:s[s.length-1].x,y:s[s.length-1].y,a:0,l:0}),r}static getClothoidLength(e){let t=0;if(e.length>2)for(let r=0;r<e.length;r++){let s=Math.max(0,r-1);r>0&&(t+=this.getDistance(e[s],e[s+1]))}return t}static getCircleCenterByChord(e,t,r,s=!0,o=new k){const u=this.getDistance(e,t);if(u===0)return o.x=1/0,o.y=1/0,o;ql.set((e.x+t.x)/2,(e.y+t.y)/2);const h=Math.sqrt(r*r-u*u/4),c=s?-1:1;return o.x=ql.x+c*h*(t.y-e.y)/u,o.y=ql.y-c*h*(t.x-e.x)/u,o}static isPointInCircle(e,t,r){return this.getDistance(r,e)<t}static isPointInConvexHull(e,t){let r=!1;const s=t.length;for(let o=0,u=s-1;o<s;u=o++){const h=t[o],c=t[u];if(Math.min(h.x,c.x)<=e.x&&e.x<=Math.max(h.x,c.x)&&Math.min(h.y,c.y)<=e.y&&e.y<=Math.max(h.y,c.y)){const y=(c.x-h.x)*(e.y-h.y)-(c.y-h.y)*(e.x-h.x);if(Math.abs(y)<1e-12)return!0}h.y>e.y!=c.y>e.y&&e.x<(c.x-h.x)*(e.y-h.y)/(c.y-h.y)+h.x&&(r=!r)}return r}static isPointInPolygonByRay(e,t){let r=0;const s=new k().copy(e),o=new k,u=new k;for(let h=0;h<t.length;h++){h===t.length-1?(o.copy(t[h]),u.copy(t[0])):(o.copy(t[h]),u.copy(t[h+1]));let c=[o.y,u.y].sort((y,p)=>y-p);c[0]<s.y&&c[1]>s.y&&(o.x<s.x||u.x<s.x)&&r++}return r%2===1}static getIntersectionOfSegments(e,t,r,s,o=!1,u=new k){const h=(s.y-r.y)*(t.x-e.x)-(s.x-r.x)*(t.y-e.y);if(h===0)return u.makeEmpty();const c=(s.x-r.x)*(e.y-r.y)-(s.y-r.y)*(e.x-r.x),y=(t.x-e.x)*(e.y-r.y)-(t.y-e.y)*(e.x-r.x),p=c/h,A=y/h;return o&&(p<0||p>1||A<0||A>1)?u.makeEmpty():(u.x=e.x+p*(t.x-e.x),u.y=e.y+p*(t.y-e.y),u)}static getConvexHullByGrahamScan(e,t=!1,r=[]){if(!e||!e.length)return r;const s=e.length;let o=0;for(let c=0;c<s;c++)e[c].x<e[o].x&&(o=c);let u=o,h;do{r.push(e[u]),h=(u+1)%s;for(let c=0;c<s;c++)this.whichSideOfSegment(e[u],e[c],e[h])>0&&(h=c);u=h}while(u!==o);return t&&r.push(e[o]),r}static whichSideOfSegment(e,t,r){return(t.x-e.x)*(r.y-e.y)-(r.x-e.x)*(t.y-e.y)}static getPointsWithMatrix3(e,t){const r=[];if(!e)return r;for(let s=0,o=e.length;s<o;s++)r.push({x:t.elements[0]*e[s].x+t.elements[3]*e[s].y+t.elements[6],y:t.elements[1]*e[s].x+t.elements[4]*e[s].y+t.elements[7]});return r}static getPointsApplyMatrix3(e,t=[]){for(let r=0,s=t.length;r<s;r++){const o=e.elements[0]*t[r].x+e.elements[3]*t[r].y+e.elements[6],u=e.elements[1]*t[r].x+e.elements[4]*t[r].y+e.elements[7];t[r].x=o,t[r].y=u}return t}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(e){const t=this.x,r=this.y,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6],this.y=s[1]*t+s[4]*r+s[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clone(){return new k(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}cross(e){return this.x*e.y-this.y*e.x}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}dot(e){return this.x*e.x+this.y*e.y}equals(e,t=!0){return t?e.x===this.x&&e.y===this.y:Math.abs(e.x-this.x)<Number.EPSILON&&Math.abs(e.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+e)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}length(){return Math.sqrt(this.dot(this))}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}maxXY(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,t),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}minXY(e,t){return this.x=Math.min(this.x,e),this.y=Math.min(this.y,t),this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e,t){return this.x*=e,this.y*=t||e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(e){return this.applyMatrix3(e.matrixWorldInverse).applyMatrix3(e.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(e){const t=Math.cos(e),r=Math.sin(e),s=this.x,o=this.y;return this.x=s*t-o*r,this.y=s*r+o*t,this}rotateAround(e,t){const r=Math.cos(t),s=Math.sin(t),o=this.x-e.x,u=this.y-e.y;return this.x=o*r-u*s+e.x,this.y=o*s+u*r+e.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(e,t){return this.x=e,this.y=t,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("out of range: "+e)}return this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*3)}setLength(e){return this.normalize().multiplyScalar(e)}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(e,t=!1){return this.applyMatrix3(e.projectionMatrixInverse).applyMatrix3(e.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const ql=new k,AE=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));var lu={exports:{}};/**
5
+ @`+(i.systemId||"")+"#[line:"+i.lineNumber+",col:"+i.columnNumber+"]"}function gp(i,e,t){return typeof i=="string"?i.substr(e,t):i.length>=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){qa.prototype[i]=function(){return null}});function Vo(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}mu.__DOMHandler=qa;mu.normalizeLineEndings=Hd;mu.DOMParser=Ud;var pE=mu.DOMParser;const dE="1.0.77";function gE(){return typeof window!="undefined"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Ns=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"?self:{document:void 0,tinyEngine:void 0};Ns.Path2D||Rx(Ns);Ns.DOMParser||(Ns.DOMParser=pE);const Wt={window:Ns,version:dE,isBrowser:gE(),dpr:typeof window!="undefined"&&window.devicePixelRatio||1,document:Ns.document,time:0,deltaTime:0,config:hd},fa=(i,e,t)=>Math.max(e,Math.min(t,i)),yp=(i,e=1e-6)=>Math.abs(i)<e?0:i<0?-1:1,yE=i=>i*(Math.PI/180),mE=(i,e)=>(i%e+e)%e,Hl=(i,e,t)=>(1-t)*i+t*e,vE=i=>{let e=i*(180/Math.PI);return e<0&&(e+=360),e>360&&(e-=360),e},Qt={transparent:"rgba(1, 1, 1, 0)",green:"#45b787",darkGreen:"#314a43",blue:"#6e9bc5",darkBlue:"#2775b6",red:"#F26666",darkRed:"#D95970",brown:"#ECD2B9",darkBrown:"#BF9D8A",yellow:"#ECDEC0",darkYellow:"#D0AC57",lightGray:"#e0e0e0",gray:"#beb6b6",darkGray:"#918883",white:"#F2F2F2",darkWhite:"#ececec",lightBlack:"#2E3032",black:"#182327",blackAlpha5:"rgba(0, 0, 0, 0.5)"},xE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Vr={h:0,s:0,l:0},Wo={h:0,s:0,l:0};function Ul(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}const EE=/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8})$|rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)|rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)/;class Yt{constructor(e,t,r,s){d(this,"isColor",!0);d(this,"r",1);d(this,"g",1);d(this,"b",1);d(this,"a",1);return t===void 0&&r===void 0?this.set(e):this.setRGBA(e,t,r,s)}static isColor(e){return typeof e=="string"?EE.test(e):typeof e=="number"?e>=0&&e<=16777215:!1}static getRandomStyle(){return Li.random().getStyle()}static getDarken(e,t=.8){return Li.set(e).getHSL(zo),Li.setHSL(zo.h,zo.s,zo.l*t).getStyle()}static getLighten(e,t=1.2){return this.getDarken(e,t)}static getContrast(e){return Li.set(e),Li.getContrastString()}static getArray(e){return Li.set(e).toArray()}static getComplementary(e){return Li.set(e),Li.getComplementaryString()}static getMoreTransparent(e,t){return Li.set(e).setA(t).getStyle()}set(e){return e&&e.isColor?this.copy(e):typeof e=="number"?this.setHex(e):typeof e=="string"&&this.setStyle(e),this}random(){return this.setHex(Math.floor(Math.random()*(1<<24)))}setScalar(e){return this.r=e,this.g=e,this.b=e,this.a=1,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,this.a=1,this}setR(e){return this.r=e,this}setG(e){return this.g=e,this}setB(e){return this.b=e,this}setA(e){return this.a=e,this}setRGB(e,t,r){return this.setRGBA(e,t,r,this.a)}setRGBA(e,t,r,s=1){return this.r=e,this.g=t,this.b=r,this.a=s,this}setHSL(e,t,r,s=1){if(e=mE(e,1),t=fa(t,0,1),r=fa(r,0,1),t===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+t):r+t-r*t,u=2*r-o;this.r=Ul(u,o,e+1/3),this.g=Ul(u,o,e),this.b=Ul(u,o,e-1/3)}return this.a=s,this}setStyle(e){let t;if(t=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let r;const s=t[1],o=t[2];switch(s){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,this.a=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0),this;break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){const u=parseFloat(r[1])/360,h=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100,y=Math.max(Math.min(1,r[4]!==void 0?parseFloat(r[4]):1),0);return this.setHSL(u,h,c,y)}break}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=t[1],s=r.length;if(s===3)return this.r=parseInt(r.charAt(0)+r.charAt(0),16)/255,this.g=parseInt(r.charAt(1)+r.charAt(1),16)/255,this.b=parseInt(r.charAt(2)+r.charAt(2),16)/255,this.a=1,this;if(s===6)return this.r=parseInt(r.charAt(0)+r.charAt(1),16)/255,this.g=parseInt(r.charAt(2)+r.charAt(3),16)/255,this.b=parseInt(r.charAt(4)+r.charAt(5),16)/255,this.a=1,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=xE[e.toLowerCase()];return t!==void 0?this.setHex(t):console.warn("Color: Unknown color "+e),this}clone(){return new Yt(this.r,this.g,this.b,this.a)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this}getRGB(e=new Yt){return e.setRGB(this.r,this.g,this.b)}getRGBByBg(e=new Yt){const t=this.a,r=t*this.r+(1-t)*e.r,s=t*this.g+(1-t)*e.g,o=t*this.b+(1-t)*e.b;return new Yt(r,s,o)}getHex(){return fa(this.r*255,0,255)<<16^fa(this.g*255,0,255)<<8^fa(this.b*255,0,255)<<0}getHSL(e){const t=this.r,r=this.g,s=this.b,o=Math.max(t,r,s),u=Math.min(t,r,s);let h=0,c;const y=(u+o)/2;if(u===o)h=0,c=0;else{const p=o-u;switch(c=y<=.5?p/(o+u):p/(2-o-u),o){case t:h=(r-s)/p+(r<s?6:0);break;case r:h=(s-t)/p+2;break;case s:h=(t-r)/p+4;break}h/=6}return e.h=h,e.s=c,e.l=y,e}getStyle(){return this.a===1?`rgb(${this.r*255|0},${this.g*255|0},${this.b*255|0})`:`rgba(${this.r*255|0},${this.g*255|0},${this.b*255|0},${this.a||1})`}getHexString(){return"#"+("000000"+this.getHex().toString(16)).slice(-6)}getBrightness(){let e=(this.r*255*299+this.g*255*587+this.b*255*144)/1e3;return e+=(255-e)*(255-this.a*255)/255,e}getContrastString(){return this.getBrightness()>125?"#2f2f2f":"#f2f2f2"}getComplementary(e=new Yt){const t=this.toArray(),r=[0,0,0,1];for(let s=0;s<t.length;s++)if(s<3)r[s]=1-t[s];else if(s===3)t[s]>1||t[s]<=0?r[s]=1:r[s]=Math.max(Math.min(parseFloat(t[s].toFixed(2)),1),0);else continue;return e.setRGBA(r[0],r[1],r[2],parseFloat(r[3].toFixed(2)))}getComplementaryString(){return this.getComplementary().getStyle()}getLightenOrDarken(e){if(typeof e=="undefined"||e>=1)return this.getHexString();const t=this.getRGBByBg(),r=t.r*e+(1-e),s=t.g*e+(1-e),o=t.b*e+(1-e);return new Yt(r,s,o).getHexString()}getNormalized(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.a,1),0).toFixed(2))]}getNormalized3(){return[parseFloat(Math.max(Math.min(this.r,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.g,1),0).toFixed(2)),parseFloat(Math.max(Math.min(this.b,1),0).toFixed(2))]}offsetHSL(e,t,r){return this.getHSL(Vr),Vr.h+=e,Vr.s+=t,Vr.l+=r,this.setHSL(Vr.h,Vr.s,Vr.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,r){return this.r=e.r+(t.r-e.r)*r,this.g=e.g+(t.g-e.g)*r,this.b=e.b+(t.b-e.b)*r,this}lerpHSL(e,t){this.getHSL(Vr),e.getHSL(Wo);const r=Hl(Vr.h,Wo.h,t),s=Hl(Vr.s,Wo.s,t),o=Hl(Vr.l,Wo.l,t);return this.setHSL(r,s,o),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this.a=e[t+3],this}toArray(e=[0,0,0,0],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e[t+3]=this.a,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),e.normalized===!0&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Li=new Yt,zo={h:0,s:0,l:0};class k{constructor(e=0,t=0,r){d(this,"isVector2",!0);d(this,"x",0);d(this,"y",0);d(this,"z");this.x=e,this.y=t,this.z=r||0}static isZero(e){return e.x===0&&e.y===0}static isEmpty(e){return!Number.isFinite(e.x)&&!Number.isFinite(e.y)}static equals(e,t,r=!0){return r?e.x===t.x&&e.y===t.y:Math.abs(e.x-t.x)<Number.EPSILON&&Math.abs(e.y-t.y)<Number.EPSILON}static getInt32Array(e,t=2){const r=new ArrayBuffer(e.length*t*4),s=new Int32Array(r);for(let o=0,u=e.length;o<u;o++)s[o*2]=e[o].x,s[o*2+1]=e[o].y;return s}static getFloat64Array(e,t=2){const r=new ArrayBuffer(e.length*t*8),s=new Float64Array(r);for(let o=0,u=e.length;o<u;o++)s[o*2]=e[o].x,s[o*2+1]=e[o].y;return s}static getVectors(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(new k(e[r].x,e[r].y));return t}static getStrings(e){const t=[];if(!e||!e.length)return"";for(let r=0,s=e.length;r<s;r++)t.push(k.getString(e[r]));return t.join(",")}static getString(e){return`${e.x},${e.y}`}static getLength(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static getDistance(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}static dot(e,t){return e.x*t.x+e.y*t.y}static cross(e,t){return e.x*t.y-e.y*t.x}static sub(e,t){return new k().subVectors(e,t)}static isPointOnSegment(e,t,r){return yp(this.sub(e,r).cross(this.sub(t,r)))===0&&yp(this.sub(e,r).dot(this.sub(t,r)))<=0}static angle(e,t,r){return r?Math.atan2(e.y-t.y,e.x-t.x):vE(Math.atan2(e.y-t.y,e.x-t.x))}static getSamplingPoints(e,t=100){let r=this.getClothoidPoints(e,t),s=0;for(let o=0,u=r.length;o<u;o++){let h=Math.max(0,o-1);o>0?s+=this.getDistance(r[h],r[h+1]):s=0,r[o].l=Math.round(s);let c=this.angle(r[h+1],r[h]);r[o].a=Math.round(c*100)/100}return r}static getClothoidPoints(e,t=100){let r=[],s=e.concat([]);if(!s||s.length<2)return r;s.length===2?(s.push(s[1]),s.unshift(s[0])):s.length===3&&s.splice(2,0,s[1]);for(let o=0;o<s.length-3;o+=3){let u=new k(s[o].x,s[o].y),h=new k(s[o+1].x,s[o+1].y),c=new k(s[o+2].x,s[o+2].y),y=new k(s[o+3].x,s[o+3].y),p=0;p+=u.distanceTo(h),p+=h.distanceTo(c),p+=c.distanceTo(y);let A=Math.min(.5,1/(p/t));for(let T=A;T<1;T+=A){let C=3*(h.x-u.x),N=3*(c.x-h.x)-C,O=y.x-u.x-C-N,L=3*(h.y-u.y),P=3*(c.y-h.y)-L,W=y.y-u.y-L-P,q=O*Math.pow(T,3)+N*Math.pow(T,2)+C*T+u.x,b=W*Math.pow(T,3)+P*Math.pow(T,2)+L*T+u.y;r.push({x:Math.round(q),y:Math.round(b),a:0,l:0})}}return r.unshift({x:s[0].x,y:s[0].y,a:0,l:0}),r.push({x:s[s.length-1].x,y:s[s.length-1].y,a:0,l:0}),r}static getClothoidLength(e){let t=0;if(e.length>2)for(let r=0;r<e.length;r++){let s=Math.max(0,r-1);r>0&&(t+=this.getDistance(e[s],e[s+1]))}return t}static getCircleCenterByChord(e,t,r,s=!0,o=new k){const u=this.getDistance(e,t);if(u===0)return o.x=1/0,o.y=1/0,o;ql.set((e.x+t.x)/2,(e.y+t.y)/2);const h=Math.sqrt(r*r-u*u/4),c=s?-1:1;return o.x=ql.x+c*h*(t.y-e.y)/u,o.y=ql.y-c*h*(t.x-e.x)/u,o}static isPointInCircle(e,t,r){return this.getDistance(r,e)<t}static isPointInConvexHull(e,t){let r=!1;const s=t.length;for(let o=0,u=s-1;o<s;u=o++){const h=t[o],c=t[u];if(Math.min(h.x,c.x)<=e.x&&e.x<=Math.max(h.x,c.x)&&Math.min(h.y,c.y)<=e.y&&e.y<=Math.max(h.y,c.y)){const y=(c.x-h.x)*(e.y-h.y)-(c.y-h.y)*(e.x-h.x);if(Math.abs(y)<1e-12)return!0}h.y>e.y!=c.y>e.y&&e.x<(c.x-h.x)*(e.y-h.y)/(c.y-h.y)+h.x&&(r=!r)}return r}static isPointInPolygonByRay(e,t){let r=0;const s=new k().copy(e),o=new k,u=new k;for(let h=0;h<t.length;h++){h===t.length-1?(o.copy(t[h]),u.copy(t[0])):(o.copy(t[h]),u.copy(t[h+1]));let c=[o.y,u.y].sort((y,p)=>y-p);c[0]<s.y&&c[1]>s.y&&(o.x<s.x||u.x<s.x)&&r++}return r%2===1}static getIntersectionOfSegments(e,t,r,s,o=!1,u=new k){const h=(s.y-r.y)*(t.x-e.x)-(s.x-r.x)*(t.y-e.y);if(h===0)return u.makeEmpty();const c=(s.x-r.x)*(e.y-r.y)-(s.y-r.y)*(e.x-r.x),y=(t.x-e.x)*(e.y-r.y)-(t.y-e.y)*(e.x-r.x),p=c/h,A=y/h;return o&&(p<0||p>1||A<0||A>1)?u.makeEmpty():(u.x=e.x+p*(t.x-e.x),u.y=e.y+p*(t.y-e.y),u)}static getConvexHullByGrahamScan(e,t=!1,r=[]){if(!e||!e.length)return r;const s=e.length;let o=0;for(let c=0;c<s;c++)e[c].x<e[o].x&&(o=c);let u=o,h;do{r.push(e[u]),h=(u+1)%s;for(let c=0;c<s;c++)this.whichSideOfSegment(e[u],e[c],e[h])>0&&(h=c);u=h}while(u!==o);return t&&r.push(e[o]),r}static whichSideOfSegment(e,t,r){return(t.x-e.x)*(r.y-e.y)-(r.x-e.x)*(t.y-e.y)}static getPointsWithMatrix3(e,t){const r=[];if(!e)return r;for(let s=0,o=e.length;s<o;s++)r.push({x:t.elements[0]*e[s].x+t.elements[3]*e[s].y+t.elements[6],y:t.elements[1]*e[s].x+t.elements[4]*e[s].y+t.elements[7]});return r}static getPointsApplyMatrix3(e,t=[]){for(let r=0,s=t.length;r<s;r++){const o=e.elements[0]*t[r].x+e.elements[3]*t[r].y+e.elements[6],u=e.elements[1]*t[r].x+e.elements[4]*t[r].y+e.elements[7];t[r].x=o,t[r].y=u}return t}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}applyMatrix3(e){const t=this.x,r=this.y,s=e.elements;return this.x=s[0]*t+s[3]*r+s[6],this.y=s[1]*t+s[4]*r+s[7],this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}ceilToZero(){return this.x=this.x<0?Math.floor(this.x):Math.ceil(this.x),this.y=this.y<0?Math.floor(this.y):Math.ceil(this.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampLength(e,t){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clone(){return new k(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}cross(e){return this.x*e.y-this.y*e.x}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}dot(e){return this.x*e.x+this.y*e.y}equals(e,t=!0){return t?e.x===this.x&&e.y===this.y:Math.abs(e.x-this.x)<Number.EPSILON&&Math.abs(e.y-this.y)<Number.EPSILON}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}floorToZero(){return this.roundToZero()}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("out of range: "+e)}}identity(){return this.set(0,0)}isEmpty(){return!Number.isFinite(this.x)&&!Number.isFinite(this.y)}isZero(){return this.x===0&&this.y===0}length(){return Math.sqrt(this.dot(this))}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}makeEmpty(){return this.x=1/0,this.y=1/0,this}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}maxXY(e,t){return this.x=Math.max(this.x,e),this.y=Math.max(this.y,t),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}minXY(e,t){return this.x=Math.min(this.x,e),this.y=Math.min(this.y,t),this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e,t){return this.x*=e,this.y*=t||e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this}negate(){return this.x=-this.x,this.y=-this.y,this}normalize(){return this.divideScalar(this.length()||1)}project(e){return this.applyMatrix3(e.matrixWorldInverse).applyMatrix3(e.projectionMatrix)}random(){return this.x=Math.random(),this.y=Math.random(),this}rotate(e){const t=Math.cos(e),r=Math.sin(e),s=this.x,o=this.y;return this.x=s*t-o*r,this.y=s*r+o*t,this}rotateAround(e,t){const r=Math.cos(t),s=Math.sin(t),o=this.x-e.x,u=this.y-e.y;return this.x=o*r-u*s+e.x,this.y=o*s+u*r+e.y,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}set(e,t){return this.x=e,this.y=t,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("out of range: "+e)}return this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*3)}setLength(e){return this.normalize().multiplyScalar(e)}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}toString(){return`{"x":${this.x},"y":${this.y}}`}unproject(e,t=!1){return this.applyMatrix3(e.projectionMatrixInverse).applyMatrix3(e.matrixWorld)}validate(){return!(isNaN(this.x)||isNaN(this.y))}*[Symbol.iterator](){yield this.x,yield this.y}}const ql=new k,AE=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));var lu={exports:{}};/**
6
6
  * @license
7
7
  * Lodash <https://lodash.com/>
8
8
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -31,7 +31,7 @@ function print() { __p += __j.call(arguments, '') }
31
31
  }`;var bt=Qf(function(){return Rt(x,st+"return "+X).apply(t,w)});if(bt.source=X,Tl(bt))throw bt;return bt}function P1(n){return Ft(n).toLowerCase()}function F1(n){return Ft(n).toUpperCase()}function k1(n,a,l){if(n=Ft(n),n&&(l||a===t))return nc(n);if(!n||!(a=pr(a)))return n;var f=kr(n),g=kr(a),x=sc(f,g),w=ac(f,g)+1;return an(f,x,w).join("")}function H1(n,a,l){if(n=Ft(n),n&&(l||a===t))return n.slice(0,uc(n)+1);if(!n||!(a=pr(a)))return n;var f=kr(n),g=ac(f,kr(a))+1;return an(f,0,g).join("")}function U1(n,a,l){if(n=Ft(n),n&&(l||a===t))return n.replace(Hs,"");if(!n||!(a=pr(a)))return n;var f=kr(n),g=sc(f,kr(a));return an(f,g).join("")}function q1(n,a){var l=K,f=rt;if(Jt(a)){var g="separator"in a?a.separator:g;l="length"in a?vt(a.length):l,f="omission"in a?pr(a.omission):f}n=Ft(n);var x=n.length;if(ns(n)){var w=kr(n);x=w.length}if(l>=x)return n;var D=l-ss(f);if(D<1)return f;var M=w?an(w,0,D).join(""):n.slice(0,D);if(g===t)return M+f;if(w&&(D+=M.length-D),_l(g)){if(n.slice(D).search(g)){var $,G=M;for(g.global||(g=qu(g.source,Ft(qs.exec(g))+"g")),g.lastIndex=0;$=g.exec(G);)var X=$.index;M=M.slice(0,X===t?D:X)}}else if(n.indexOf(pr(g),D)!=D){var J=M.lastIndexOf(g);J>-1&&(M=M.slice(0,J))}return M+f}function V1(n){return n=Ft(n),n&&lr.test(n)?n.replace(Er,m0):n}var W1=fs(function(n,a,l){return n+(l?" ":"")+a.toUpperCase()}),Sl=Qc("toUpperCase");function Zf(n,a,l){return n=Ft(n),a=l?t:a,a===t?f0(n)?E0(n):i0(n):n.match(a)||[]}var Qf=wt(function(n,a){try{return cr(n,t,a)}catch(l){return Tl(l)?l:new gt(l)}}),z1=Ci(function(n,a){return Tr(a,function(l){l=ni(l),Ti(n,l,bl(n[l],n))}),n});function $1(n){var a=n==null?0:n.length,l=ut();return n=a?Zt(n,function(f){if(typeof f[1]!="function")throw new _r(u);return[l(f[0]),f[1]]}):[],wt(function(f){for(var g=-1;++g<a;){var x=n[g];if(cr(x[0],this,f))return cr(x[1],this,f)}})}function G1(n){return m2(Dr(n,A))}function Ol(n){return function(){return n}}function Y1(n,a){return n==null||n!==n?a:n}var X1=jc(),Z1=jc(!0);function Ke(n){return n}function Ml(n){return Sc(typeof n=="function"?n:Dr(n,A))}function Q1(n){return Mc(Dr(n,A))}function K1(n,a){return Lc(n,Dr(a,A))}var j1=wt(function(n,a){return function(l){return ta(l,n,a)}}),J1=wt(function(n,a){return function(l){return ta(n,l,a)}});function Ll(n,a,l){var f=be(a),g=Eo(a,f);l==null&&!(Jt(a)&&(g.length||!f.length))&&(l=a,a=n,n=this,g=Eo(a,be(a)));var x=!(Jt(l)&&"chain"in l)||!!l.chain,w=Si(n);return Tr(g,function(D){var M=a[D];n[D]=M,w&&(n.prototype[D]=function(){var $=this.__chain__;if(x||$){var G=n(this.__wrapped__),X=G.__actions__=Xe(this.__actions__);return X.push({func:M,args:arguments,thisArg:n}),G.__chain__=$,G}return M.apply(n,Ji([this.value()],arguments))})}),n}function tx(){return _e._===this&&(_e._=C0),this}function Nl(){}function ex(n){return n=vt(n),wt(function(a){return Nc(a,n)})}var rx=ll(Zt),ix=ll(Jh),nx=ll(Iu);function Kf(n){return yl(n)?Ru(ni(n)):I2(n)}function sx(n){return function(a){return n==null?t:Bn(n,a)}}var ax=tf(),ox=tf(!0);function Bl(){return[]}function Il(){return!1}function ux(){return{}}function lx(){return""}function hx(){return!0}function cx(n,a){if(n=vt(n),n<1||n>Pt)return[];var l=ue,f=Ne(n,ue);a=ut(a),n-=ue;for(var g=ku(f,a);++l<n;)a(l);return g}function fx(n){return yt(n)?Zt(n,ni):dr(n)?[n]:Xe(mf(Ft(n)))}function px(n){var a=++T0;return Ft(n)+a}var dx=Co(function(n,a){return n+a},0),gx=hl("ceil"),yx=Co(function(n,a){return n/a},1),mx=hl("floor");function vx(n){return n&&n.length?xo(n,Ke,Zu):t}function xx(n,a){return n&&n.length?xo(n,ut(a,2),Zu):t}function Ex(n){return rc(n,Ke)}function Ax(n,a){return rc(n,ut(a,2))}function bx(n){return n&&n.length?xo(n,Ke,Ju):t}function wx(n,a){return n&&n.length?xo(n,ut(a,2),Ju):t}var Tx=Co(function(n,a){return n*a},1),_x=hl("round"),Cx=Co(function(n,a){return n-a},0);function Dx(n){return n&&n.length?Fu(n,Ke):0}function Sx(n,a){return n&&n.length?Fu(n,ut(a,2)):0}return v.after=Qm,v.ary=Sf,v.assign=Fv,v.assignIn=Vf,v.assignInWith=Ho,v.assignWith=kv,v.at=Hv,v.before=Of,v.bind=bl,v.bindAll=z1,v.bindKey=Mf,v.castArray=uv,v.chain=_f,v.chunk=my,v.compact=vy,v.concat=xy,v.cond=$1,v.conforms=G1,v.constant=Ol,v.countBy=Dm,v.create=Uv,v.curry=Lf,v.curryRight=Nf,v.debounce=Bf,v.defaults=qv,v.defaultsDeep=Vv,v.defer=Km,v.delay=jm,v.difference=Ey,v.differenceBy=Ay,v.differenceWith=by,v.drop=wy,v.dropRight=Ty,v.dropRightWhile=_y,v.dropWhile=Cy,v.fill=Dy,v.filter=Om,v.flatMap=Nm,v.flatMapDeep=Bm,v.flatMapDepth=Im,v.flatten=Af,v.flattenDeep=Sy,v.flattenDepth=Oy,v.flip=Jm,v.flow=X1,v.flowRight=Z1,v.fromPairs=My,v.functions=Zv,v.functionsIn=Qv,v.groupBy=Rm,v.initial=Ny,v.intersection=By,v.intersectionBy=Iy,v.intersectionWith=Ry,v.invert=jv,v.invertBy=Jv,v.invokeMap=Fm,v.iteratee=Ml,v.keyBy=km,v.keys=be,v.keysIn=Qe,v.map=Bo,v.mapKeys=e1,v.mapValues=r1,v.matches=Q1,v.matchesProperty=K1,v.memoize=Ro,v.merge=i1,v.mergeWith=Wf,v.method=j1,v.methodOf=J1,v.mixin=Ll,v.negate=Po,v.nthArg=ex,v.omit=n1,v.omitBy=s1,v.once=tv,v.orderBy=Hm,v.over=rx,v.overArgs=ev,v.overEvery=ix,v.overSome=nx,v.partial=wl,v.partialRight=If,v.partition=Um,v.pick=a1,v.pickBy=zf,v.property=Kf,v.propertyOf=sx,v.pull=Hy,v.pullAll=wf,v.pullAllBy=Uy,v.pullAllWith=qy,v.pullAt=Vy,v.range=ax,v.rangeRight=ox,v.rearg=rv,v.reject=Wm,v.remove=Wy,v.rest=iv,v.reverse=El,v.sampleSize=$m,v.set=u1,v.setWith=l1,v.shuffle=Gm,v.slice=zy,v.sortBy=Zm,v.sortedUniq=Ky,v.sortedUniqBy=jy,v.split=N1,v.spread=nv,v.tail=Jy,v.take=tm,v.takeRight=em,v.takeRightWhile=rm,v.takeWhile=im,v.tap=vm,v.throttle=sv,v.thru=No,v.toArray=Hf,v.toPairs=$f,v.toPairsIn=Gf,v.toPath=fx,v.toPlainObject=qf,v.transform=h1,v.unary=av,v.union=nm,v.unionBy=sm,v.unionWith=am,v.uniq=om,v.uniqBy=um,v.uniqWith=lm,v.unset=c1,v.unzip=Al,v.unzipWith=Tf,v.update=f1,v.updateWith=p1,v.values=gs,v.valuesIn=d1,v.without=hm,v.words=Zf,v.wrap=ov,v.xor=cm,v.xorBy=fm,v.xorWith=pm,v.zip=dm,v.zipObject=gm,v.zipObjectDeep=ym,v.zipWith=mm,v.entries=$f,v.entriesIn=Gf,v.extend=Vf,v.extendWith=Ho,Ll(v,v),v.add=dx,v.attempt=Qf,v.camelCase=v1,v.capitalize=Yf,v.ceil=gx,v.clamp=g1,v.clone=lv,v.cloneDeep=cv,v.cloneDeepWith=fv,v.cloneWith=hv,v.conformsTo=pv,v.deburr=Xf,v.defaultTo=Y1,v.divide=yx,v.endsWith=x1,v.eq=Ur,v.escape=E1,v.escapeRegExp=A1,v.every=Sm,v.find=Mm,v.findIndex=xf,v.findKey=Wv,v.findLast=Lm,v.findLastIndex=Ef,v.findLastKey=zv,v.floor=mx,v.forEach=Cf,v.forEachRight=Df,v.forIn=$v,v.forInRight=Gv,v.forOwn=Yv,v.forOwnRight=Xv,v.get=Cl,v.gt=dv,v.gte=gv,v.has=Kv,v.hasIn=Dl,v.head=bf,v.identity=Ke,v.includes=Pm,v.indexOf=Ly,v.inRange=y1,v.invoke=t1,v.isArguments=Pn,v.isArray=yt,v.isArrayBuffer=yv,v.isArrayLike=Ze,v.isArrayLikeObject=ne,v.isBoolean=mv,v.isBuffer=on,v.isDate=vv,v.isElement=xv,v.isEmpty=Ev,v.isEqual=Av,v.isEqualWith=bv,v.isError=Tl,v.isFinite=wv,v.isFunction=Si,v.isInteger=Rf,v.isLength=Fo,v.isMap=Pf,v.isMatch=Tv,v.isMatchWith=_v,v.isNaN=Cv,v.isNative=Dv,v.isNil=Ov,v.isNull=Sv,v.isNumber=Ff,v.isObject=Jt,v.isObjectLike=re,v.isPlainObject=aa,v.isRegExp=_l,v.isSafeInteger=Mv,v.isSet=kf,v.isString=ko,v.isSymbol=dr,v.isTypedArray=ds,v.isUndefined=Lv,v.isWeakMap=Nv,v.isWeakSet=Bv,v.join=Py,v.kebabCase=b1,v.last=Or,v.lastIndexOf=Fy,v.lowerCase=w1,v.lowerFirst=T1,v.lt=Iv,v.lte=Rv,v.max=vx,v.maxBy=xx,v.mean=Ex,v.meanBy=Ax,v.min=bx,v.minBy=wx,v.stubArray=Bl,v.stubFalse=Il,v.stubObject=ux,v.stubString=lx,v.stubTrue=hx,v.multiply=Tx,v.nth=ky,v.noConflict=tx,v.noop=Nl,v.now=Io,v.pad=_1,v.padEnd=C1,v.padStart=D1,v.parseInt=S1,v.random=m1,v.reduce=qm,v.reduceRight=Vm,v.repeat=O1,v.replace=M1,v.result=o1,v.round=_x,v.runInContext=S,v.sample=zm,v.size=Ym,v.snakeCase=L1,v.some=Xm,v.sortedIndex=$y,v.sortedIndexBy=Gy,v.sortedIndexOf=Yy,v.sortedLastIndex=Xy,v.sortedLastIndexBy=Zy,v.sortedLastIndexOf=Qy,v.startCase=B1,v.startsWith=I1,v.subtract=Cx,v.sum=Dx,v.sumBy=Sx,v.template=R1,v.times=cx,v.toFinite=Oi,v.toInteger=vt,v.toLength=Uf,v.toLower=P1,v.toNumber=Mr,v.toSafeInteger=Pv,v.toString=Ft,v.toUpper=F1,v.trim=k1,v.trimEnd=H1,v.trimStart=U1,v.truncate=q1,v.unescape=V1,v.uniqueId=px,v.upperCase=W1,v.upperFirst=Sl,v.each=Cf,v.eachRight=Df,v.first=bf,Ll(v,function(){var n={};return ri(v,function(a,l){Ht.call(v.prototype,l)||(n[l]=a)}),n}(),{chain:!1}),v.VERSION=r,Tr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){v[n].placeholder=v}),Tr(["drop","take"],function(n,a){Ct.prototype[n]=function(l){l=l===t?1:ve(vt(l),0);var f=this.__filtered__&&!a?new Ct(this):this.clone();return f.__filtered__?f.__takeCount__=Ne(l,f.__takeCount__):f.__views__.push({size:Ne(l,ue),type:n+(f.__dir__<0?"Right":"")}),f},Ct.prototype[n+"Right"]=function(l){return this.reverse()[n](l).reverse()}}),Tr(["filter","map","takeWhile"],function(n,a){var l=a+1,f=l==pt||l==B;Ct.prototype[n]=function(g){var x=this.clone();return x.__iteratees__.push({iteratee:ut(g,3),type:l}),x.__filtered__=x.__filtered__||f,x}}),Tr(["head","last"],function(n,a){var l="take"+(a?"Right":"");Ct.prototype[n]=function(){return this[l](1).value()[0]}}),Tr(["initial","tail"],function(n,a){var l="drop"+(a?"":"Right");Ct.prototype[n]=function(){return this.__filtered__?new Ct(this):this[l](1)}}),Ct.prototype.compact=function(){return this.filter(Ke)},Ct.prototype.find=function(n){return this.filter(n).head()},Ct.prototype.findLast=function(n){return this.reverse().find(n)},Ct.prototype.invokeMap=wt(function(n,a){return typeof n=="function"?new Ct(this):this.map(function(l){return ta(l,n,a)})}),Ct.prototype.reject=function(n){return this.filter(Po(ut(n)))},Ct.prototype.slice=function(n,a){n=vt(n);var l=this;return l.__filtered__&&(n>0||a<0)?new Ct(l):(n<0?l=l.takeRight(-n):n&&(l=l.drop(n)),a!==t&&(a=vt(a),l=a<0?l.dropRight(-a):l.take(a-n)),l)},Ct.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Ct.prototype.toArray=function(){return this.take(ue)},ri(Ct.prototype,function(n,a){var l=/^(?:filter|find|map|reject)|While$/.test(a),f=/^(?:head|last)$/.test(a),g=v[f?"take"+(a=="last"?"Right":""):a],x=f||/^find/.test(a);g&&(v.prototype[a]=function(){var w=this.__wrapped__,D=f?[1]:arguments,M=w instanceof Ct,$=D[0],G=M||yt(w),X=function(_t){var Ot=g.apply(v,Ji([_t],D));return f&&J?Ot[0]:Ot};G&&l&&typeof $=="function"&&$.length!=1&&(M=G=!1);var J=this.__chain__,st=!!this.__actions__.length,lt=x&&!J,bt=M&&!st;if(!x&&G){w=bt?w:new Ct(this);var ht=n.apply(w,D);return ht.__actions__.push({func:No,args:[X],thisArg:t}),new Cr(ht,J)}return lt&&bt?n.apply(this,D):(ht=this.thru(X),lt?f?ht.value()[0]:ht.value():ht)})}),Tr(["pop","push","shift","sort","splice","unshift"],function(n){var a=io[n],l=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",f=/^(?:pop|shift)$/.test(n);v.prototype[n]=function(){var g=arguments;if(f&&!this.__chain__){var x=this.value();return a.apply(yt(x)?x:[],g)}return this[l](function(w){return a.apply(yt(w)?w:[],g)})}}),ri(Ct.prototype,function(n,a){var l=v[a];if(l){var f=l.name+"";Ht.call(ls,f)||(ls[f]=[]),ls[f].push({name:a,func:l})}}),ls[_o(t,P).name]=[{name:"wrapper",func:t}],Ct.prototype.clone=V0,Ct.prototype.reverse=W0,Ct.prototype.value=z0,v.prototype.at=xm,v.prototype.chain=Em,v.prototype.commit=Am,v.prototype.next=bm,v.prototype.plant=Tm,v.prototype.reverse=_m,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Cm,v.prototype.first=v.prototype.head,Ys&&(v.prototype[Ys]=wm),v},as=A0();Sn?((Sn.exports=as)._=as,Mu._=as):_e._=as}).call(ua)})(lu,lu.exports);var bE=lu.exports;const It=cd(bE);class Mt{constructor(e=new k(1/0,1/0),t=new k(-1/0,-1/0)){d(this,"isBox2",!0);d(this,"min");d(this,"max");this.min=e,this.max=t}applyMatrix3(e){return this.isEmpty()?this:(pa[0].set(this.min.x,this.min.y).applyMatrix3(e),pa[1].set(this.min.x,this.max.y).applyMatrix3(e),pa[3].set(this.max.x,this.max.y).applyMatrix3(e),pa[2].set(this.max.x,this.min.y).applyMatrix3(e),this.setFromPoints(pa),this)}clone(){return new Mt().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}ceil(){return this.min.ceilToZero(),this.max.ceilToZero(),this}distanceToPoint(e){return je.copy(e).clamp(this.min,this.max).sub(e).length()}expandByXY(e,t){return this.min.minXY(e,t),this.max.maxXY(e,t),this}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByPoints(e){if(!e||!e.length)return this;for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){return e.updateWorldMatrix(!1,!1),e.geometry.boundingBox!==void 0?((!e.geometry.boundingBox||e.geometry.boundingBox.isEmpty())&&e.computeBoundingBox(),As.copy(e.geometry.boundingBox),As.applyMatrix3(e.matrixWorld),this.union(As)):e.geometry.points&&e.geometry.points.length&&(As.setFromPoints(e.geometry.points),As.applyMatrix3(e.matrixWorld),this.union(As)),this}expandByBox(e){this.expandByPoint(e.min),this.expandByPoint(e.max)}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}floor(){return this.min.floorToZero(),this.max.floorToZero(),this}getCenter(e=new k){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e=new k){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}getPoints(e=[]){return e.length=0,e[0]={x:this.min.x,y:this.min.y},e[1]={x:this.min.x,y:this.max.y},e[2]={x:this.max.x,y:this.max.y},e[3]={x:this.max.x,y:this.min.y},e}getArea(){return this.getSize(je),je.x*je.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}intersectsBox(e){return e?!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y):!1}intersectsObject(e){return!e||!e.geometry?!1:this.intersectsBox(e.geometry.boundingBox)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}round(){return this.min.roundToZero(),this.max.roundToZero(),this}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t+=3)this.expandByPoint(je.fromArray(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,r=e.length;t<r;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const r=je.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}setFromProjectionMatrix(e){return this.min.set(e.elements[6],e.elements[7]),this.max.set(e.elements[6],e.elements[7]),this}setFromObject(e){return this.makeEmpty(),this.expandByObject(e)}setFromMinMaxString(e,t=" "){if(this.makeEmpty(),!(e!=null&&e.length))return this;let r=e.split(t),s=It.map(r,o=>parseFloat(o));for(let o=0,u=s.length;o<u;o+=2)this.expandByPoint(je.fromArray(s,o));return this}translate(e){return this.min.add(e),this.max.add(e),this}toString(){return`{"min":${this.min.toString()},"max":${this.max.toString()}}`}fromString(e){return e?(this.copy(JSON.parse(e)),this):this}union(e){return e.validate()?(this.min.min(e.min),this.max.max(e.max),this):this}validate(){return this.min.validate()&&this.max.validate()}unproject(e){return this.applyMatrix3(e.projectionMatrixInverse).applyMatrix3(e.matrixWorld)}centralArrange(e=1,t=20,r=10){const s=t+r;this.getCenter(je),this.getSize(si),si.subScalar(t);const o=Math.floor(si.x/s),u=Math.ceil(e/o),h=o*s,c=u*s;if(si.x<s||si.y<s||h>=si.x||c>=si.y)return je.clone();let p=[],A=0,T=0;for(let C=0;C<e;C++){const N=o>e?e*s:h,O=je.x-N/2+T*s+s/2,L=je.y-c/2+A*s+s/2;p.push(new k(O,L)),T++,T>=o&&(T=0,A++)}return p}flipY(){return je.copy(this.min).multiplyScalar(1,-1),si.copy(this.max).multiplyScalar(1,-1),this.min.set(je.x,si.y),this.max.set(si.x,je.y),this}}const As=new Mt,pa=[new k,new k,new k,new k],je=new k,si=new k,wE=Object.freeze(Object.defineProperty({__proto__:null,default:Mt},Symbol.toStringTag,{value:"Module"})),TE=Wt.window.requestAnimationFrame,da=Wt.window.performance?()=>Wt.window.performance.now():()=>new Date().getTime(),mp=TE,Bt=class Bt{constructor(){d(this,"id",Bt.idCounter++);d(this,"timers",new Map);d(this,"timersDuration",new Map);d(this,"counters",new Map);d(this,"countersAmount",new Map);d(this,"out",[])}static active(e){e?Bt.actived=!0:Bt.actived=!1,Bt.duration=e||0}static add(e){this.children.push(e),this.handleStart()}static remove(e){for(let t=0,r=Bt.children.length;t<r;t++)if(Bt.children[t].id===e.id){this.children.splice(t,1);break}}static handleStart(){this.isRunning||(this.isRunning=!0,mp(this.runLoop))}static runLoop(){Bt.children.length?(Bt.runFrames(),mp(Bt.runLoop)):Bt.isRunning=!1}static runFrames(){let e,t=da();if(!(t-Bt.lastTime<Bt.duration)){Bt.lastTime=t;for(let r=0,s=this.children.length;r<s;r++)e=this.children[r],e.calculateTimers(),e.calculateCounters(),Bt.messages=Bt.messages.concat(e.out),e.out.length=0;if(Bt.messages.length){if(Bt.actived){let r=[];r.push(_E),r.push(CE),r.push(DE),this.messages.forEach(s=>r.push(BE(s,this.maxLetters))),r.push(SE),console.log(r.join(`
32
32
  `))}Bt.messages.length=0}}}destroy(){Bt.remove(this)}addTimer(e,t=da(),r=da()-(this.timersDuration.get(e)||da())){this.addTimerDuration(e,r),this.timersDuration.set(e,t)}addTimerDuration(e,t){var r;this.timers.has(e)||this.timers.set(e,[]),(r=this.timers.get(e))==null||r.push(t)}calculateTimers(){this.timers.forEach((e,t)=>{!e||!e.length||(this.out.push(this.calculateDurations(t,e)),e.length=0)})}addCounterAmount(e,t){var r;this.counters.has(e)||this.counters.set(e,[]),(r=this.counters.get(e))==null||r.push(t)}calculateCounters(){this.counters.forEach((e,t)=>{!e||!e.length||(this.out.push(this.calculateAmounts(t,e)),e.length=0)})}start(){return this.stop(),Bt.add(this),this}stop(){return Bt.remove(this),this}calculateDurations(e,t){const r={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!t||!t.length)return r;const s=t.length,{min:o,max:u,avg:h}=this.minMaxAvg(t),c=parseFloat(this.stdDev(t,h).toFixed(2));return{name:e,avg:this.fd(h),min:this.fd(o),max:this.fd(u),stdDev:c,count:s,FPS:Math.ceil(s/Bt.duration*1e3)}}calculateAmounts(e,t){const r={name:e,avg:0,min:0,max:0,stdDev:0,count:0,FPS:0};if(!t||!t.length)return r;const s=t.length,{min:o,max:u,avg:h}=this.minMaxAvg(t),c=this.stdDev(t,h);return{name:e,avg:h,min:o,max:u,stdDev:c,count:s,FPS:Math.ceil(s/Bt.duration*1e3)}}minMaxAvg(e){let t=e[0],r=e[0],s=e.length,o=0;for(let h=0;h<e.length;h++){const c=e[h];o+=c,c<t&&(t=c),c>r&&(r=c)}const u=o/s;return{min:this.fx(t),max:this.fx(r),avg:this.fx(u)}}stdDev(e,t){let r=0;for(let o=0;o<e.length;o++){const u=e[o];r+=(u-t)*(u-t)}const s=e.length;return this.fx(Math.sqrt(r/s))}fd(e){return e>1e3?(e/1e3).toFixed(1)+"s":e.toFixed(1)+"ms"}fx(e,t=1){return t===1?Math.round(e*10)/10:t===2?Math.round(e*100)/100:t===3?Math.round(e*1e3)/1e3:e}};d(Bt,"idCounter",0),d(Bt,"children",[]),d(Bt,"isRunning",!1),d(Bt,"actived",!1),d(Bt,"duration",0),d(Bt,"lastTime",da()),d(Bt,"messages",[]),d(Bt,"maxLetters",20);let Bs=Bt;const vu=20,xu=["avg","min","max","stdDev","count","FPS"],li=ME(xu,1),_E=OE(xu,vu),CE=LE(xu,vu),DE=NE(xu,vu),SE=IE(vu);function OE(i,e=20){let t="┌";t+="─".repeat(e),t+="┬";for(let r=0,s=i.length;r<s;r++)t+="─".repeat(li),r<s-1?t+="┬":t+="┐";return t}function ME(i,e=0){let t=0;for(let r=0,s=i.length;r<s;r++)t=Math.max(t,i[r].length);return t+e}function LE(i,e=20){let t="│";t+=" ".repeat(e),t+="│";for(let r=0,s=i.length;r<s;r++)t+=" ".repeat(Math.max(li-i[r].length-1,0)),t+=i[r],t+=" │";return t}function NE(i,e=20){let t="├";t+="─".repeat(e),t+="┼";for(let r=0,s=i.length;r<s;r++)t+="─".repeat(li),r<s-1?t+="┴":t+="┘";return t}function BE(i,e=20){let t="│";t+=" ".repeat(Math.max(e-i.name.length,0)),t+=i.name,t+="│";const r=typeof i.avg=="string"?li-i.avg.length:li-i.avg.toString().length;return t+=" ".repeat(Math.max(r,0)),t+=i.avg+" ",t+=" ".repeat(Math.max(li-i.min.toString().length,0)),t+=i.min+" ",t+=" ".repeat(Math.max(li-i.max.toString().length,0)),t+=i.max+" ",t+=" ".repeat(Math.max(li-i.stdDev.toString().length,0)),t+=i.stdDev+" ",t+=" ".repeat(Math.max(li-i.count.toString().length,0)),t+=i.count+" ",t+=" ".repeat(Math.max(li-i.FPS.toString().length,0)),t+=i.FPS,t}function IE(i=20){let e="└";for(let t=0;t<i;t++)e+="─";return e+="┘",e}function Vl(i,e="http://www.w3.org/2000/svg"){var t,r;return(r=(t=Wt.window)==null?void 0:t.document)==null?void 0:r.createElementNS(e,i)}function ru(i=2e3){return Tt(this,null,function*(){return new Promise(e=>setTimeout(e,(Math.random()+.5)*i))})}function qd(i,e=[]){var t,r;return!i||!i.value||(e.push(i.value),(t=i.children)!=null&&t.length&&((r=i.children)==null||r.forEach(s=>qd(s,e)))),e}var er=(i=>(i.GROS="gros",i.RM="rm",i.WS="ws",i.SU="su",i.EQ="eq",i.FN="fn",i.GL="gl",i.IP="ip",i))(er||{}),Va=(i=>(i.BACKGROUND="background",i.ASSETS="assets",i.ANNOTATIONS="annotations",i.TEXT="text",i.ASSET_LABELS="asset-labels",i.LABELS="labels",i))(Va||{});const Is="ae",Vd="-",hh="rm-assets",RE="rm-labels",vp="ws-assets",xp="ws-labels";function Ds(i){return i+Vd+Va.ASSETS}function _a(i){return i+Vd+Va.LABELS}const Wd={rm:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],ws:["su-assets","su-labels","eq-assets","eq-labels","fn-assets","fn-labels"],su:[hh,RE,vp,xp,"eq-assets","eq-labels","fn-assets","fn-labels"],eq:[vp,xp,"su-assets","su-labels","fn-assets","fn-labels"]};class ar{constructor(){d(this,"_listeners",new Map)}destroy(){this._listeners.clear()}addEventListener(e,t){let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r)),r.includes(t)||r.push(t)}addEventListeners(e,t){const r=e.split(","),s=r.length;for(let o=0;o<s;o++)this.addEventListener(r[o].trim(),t)}isListening(e){var t;return this._listeners.has(e)&&!!((t=this._listeners.get(e))!=null&&t.length)}hasEventListener(e,t){var r;return this._listeners.size===0?!1:this._listeners.has(e)&&!!((r=this._listeners.get(e))!=null&&r.includes(t))}removeEventListener(e,t){const r=this._listeners.get(e);if(r){const s=r.indexOf(t);s>-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners.get(e.type);if(t){e.target=this;const r=t.slice(0);for(let s=0,o=r.length;s<o;s++)r[s].call(this,e);e.target=void 0}}dispatchEventAsync(e){const t=this._listeners.get(e.type);t&&setTimeout(()=>{for(const r of t)r.call(this,e)})}}function zd(i){if(!i)return"inches";let e=i.querySelector("#defaultView"),t=e==null?void 0:e.getAttribute("units");return t||"inches"}function PE(i){if(!i)return 1;let e=zd(i),t=1;switch(e){case"mm":t=500/39.3701;break;case"cm":t=50/39.3701;break;case"Metres":t=.5/39.3701;break;case"m":t=.5/39.3701;break;default:t=1}return t}function FE(i,e=new Mt){if(!i)return e;let t=i.split(" "),r=It.map(t,s=>parseFloat(s));return(r==null?void 0:r.length)!==4||(e.min.set(r[0],r[1]),e.max.set(r[0]+r[2],r[1]+r[3])),e}function kE(i=new Mt){let e="";const t=[];return t.push(i.min.x),t.push(i.min.y),t.push(Math.abs(i.max.x-i.min.x)),t.push(Math.abs(i.max.y-i.min.y)),e=t.join(" "),e}function $d(i){var e;if((e=i==null?void 0:i.children)!=null&&e.length){for(let t=0,r=i.children.length;t<r;t++)if(i.children[t].nodeName==="g")return i.children[t]}}const HE=new Bs().start();class UE extends ar{constructor(t){super();d(this,"isSvgRenderer",!0);d(this,"id");d(this,"params");d(this,"container",Wt.window.document.getElementsByTagName("body")[0]);d(this,"cameraVersion",-1);d(this,"viewAreaLimit",-1);d(this,"autoClear");this.id="SvgRenderer@"+Date.now(),this.params=t,Wt.config=t,this.initSvg(),Bs.active(this.params.monitorDuration)}destroy(){Bs.active(0)}initSvg(){if(this.params.containerId&&(this.container=Wt.window.document.getElementById(this.params.containerId)),this.container||(this.container=Wt.window.document.getElementsByTagName("body")[0]),!this.params.width||!this.params.height){const t=this.container.getBoundingClientRect();this.params.width=t.width,this.params.height=t.height}this.container.style.overflow="hidden",this.container.style.transform="translateZ(0)",this.setSize(this.params.width,this.params.height)}resize(){var p,A;const t=((p=this.container)==null?void 0:p.parentElement)||document.body,r=t.getBoundingClientRect();if(!r)return;const s=window.getComputedStyle(t),o=r.width-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight),u=r.height-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom),h=(A=this.container)==null?void 0:A.getBoundingClientRect();if(!h)return;const c=o-h.left+r.left,y=u-h.top+r.top;this.setSize(c,y)}setSize(t,r){this.container.style.width=t+"px",this.container.style.height=r+"px",this.params.width=t,this.params.height=r,this.params.camera||(this.params.camera={}),this.params.camera.width=this.params.width,this.params.camera.height=this.params.height,this.params.aspect=this.params.width/this.params.height,this.params.camera.aspect=this.params.aspect,this.params.camera.left=this.params.width*-.5,this.params.camera.right=this.params.width*.5,this.params.camera.top=this.params.height*.5,this.params.camera.bottom=this.params.height*-.5}getSize(t){return t.set(this.params.width,this.params.height)}clean(){}render(t,r){return Tt(this,null,function*(){var o;if(!t||!r||this.cameraVersion===(r==null?void 0:r.version))return;r.updateMatrixWorld(),Ap.set(0,0).unproject(r),bp.set(this.params.width,this.params.height).unproject(r),Ep.setFromPoints([Ap,bp]);let s=kE(Ep);(o=t.svg)==null||o.setAttribute("viewBox",s),this.cameraVersion=r.version||-1,HE.addTimer("render cycle")})}getRenderTarget(){}setRenderTarget(t){}renderTexture(t,r){}}const Ep=new Mt,Ap=new k,bp=new k;class ge{constructor(){d(this,"isMatrix3",!0);d(this,"elements",[1,0,0,0,1,0,0,0,1])}static equals(e,t,r=1e-6){if(e.elements.length!=t.elements.length)return!1;for(let s=0,o=e.elements.length;s<o;s++){const u=e.elements[s]-t.elements[s];if(Math.abs(u)>r)return!1}return!0}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}clone(){return new ge().fromArray(this.elements)}compose(e,t,r){const s=Math.sin(t.x),o=Math.cos(t.x);return this.set(r.x*o,r.y*s*-1,e.x,r.x*s,r.y*o,e.y,0,0,1)}composeWithCenter(e,t,r,s){return Wr.identity(),$o.makeTranslation(e.x,e.y),ga.makeRotation(t.x),Fn.makeScale(r.x,r.y),De.copy(s).applyMatrix3(Fn),Wr.multiply(Wl.makeTranslation(-De.x,-De.y)).multiply($o).multiply(Wl.makeTranslation(De.x,De.y)).multiply(ga).multiply(Wl.makeTranslation(-De.x,-De.y)).multiply(Fn),this.copy(Wr)}decompose(e,t,r){const s=Wr.copy(this).elements,o=Math.sqrt(s[0]*s[0]+s[3]*s[3]),u=Math.sqrt(s[1]*s[1]+s[4]*s[4]),h=s[0]*s[4]-s[3]*s[1];s[0]||s[3]?r.set(o,h/o):s[1]||s[4]?r.set(h/u,u):r.set(0,0);let c=0;s[0]||s[3]?c=s[3]>0?-Math.acos(s[0]/o):Math.acos(s[0]/o):s[1]||s[4]?c=Math.PI/2-(s[4]>0?Math.acos(-s[1]/u):-Math.acos(s[1]/u)):c=0,c!==0&&r.y<0&&(c*=-1),t.set(c,c),e.set(s[6],s[7])}compose2(e,t,r){return this.identity().translate(e.x,e.y).rotate(t.x).scale(r.x,r.y),this}decompose2(e,t,r){const s=this.clone();s.scale(-1,1);const o=s.elements[0],u=s.elements[1],h=s.elements[3],c=s.elements[4];let y=0,p=0,A=0;if(o!==0||h!==0){const T=Math.hypot(o,h);y=T,p=(o*c-u*h)/T;const C=Math.acos(o/T);A=h>0?-C:C}else if(u!==0||c!==0){const T=Math.hypot(u,c);y=(o*c-u*h)/T,p=T;const C=Math.acos(u/T);A=Math.PI/2+(c>0?-C:C)}else y=0,p=0,A=0;y=-y,e.x=s.elements[6],e.y=s.elements[7],t.x=t.y=A/Math.PI/180,r.x=y,r.y=p}composeSvgTransform(e=0,t=0,r,s=!1){if(!r&&!e&&!t)return this;this.identity(),Wr.identity();let o=r==null?void 0:r.split(") ").map(u=>u.trim()+")").filter(u=>u!==")");return o||(o=[]),(e||t)&&o.push(`translate(${e},${t})`),o.forEach(u=>{const h=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(u),c=/rotate\(\s*(-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+)(?:[ ,](-?\d*\.?\d+))?)?\s*\)/.exec(u),y=/translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(u);if(h){const p=Number(h[1])||1,A=Number(h[2])||p;Wr.multiply(Fn.makeScale(p,A))}else if(c){const p=yE(Number(c[1])||0);Number(c[2])||Number(c[3])?(Ie.set(Number(c[2]||"0"),Number(c[3]||"0")),Wr.multiply(ga.makeRotationByPoint(p,Ie))):Wr.multiply(ga.makeRotation(p))}else y&&Wr.multiply($o.makeTranslation(Number(y[1])||0,Number(y[2])||0))}),this.copy(Wr),s&&this.premultiply(Fn.makeScale(1,-1)),this}decomposeSvgMatrix(e,t,r){const s=Wr.copy(this).elements;Ie.set(s[0],s[1]),De.set(s[3],s[4]);let o=Ie.length();Ie.normalize();let u=Ie.dot(De);wp.copy(Ie).multiplyScalar(-u),De.add(wp);const h=De.length()||0;De.normalize(),Ie.x*De.y<De.x*Ie.y&&(Ie.x=-Ie.x,Ie.y=-Ie.y,o=-o,u=-u);const c=o?Math.atan2(Ie.y,Ie.x):Math.atan2(-Ie.x,De.y);e.set(s[6],s[7]),t.set(c,c),r.set(o,h)}determinant(){const e=this.elements,t=e[0],r=e[3],s=e[6],o=e[1],u=e[4],h=e[7],c=e[2],y=e[5],p=e[8];return t*u*p-t*y*h-o*r*p+o*y*s+c*r*h-c*u*s}equals(e,t=0){const r=this.elements,s=e.elements;for(let o=0;o<9;o++)if(Math.abs(r[o]-s[o])>t)return!1;return!0}extractBasis2(e,t){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),this}flipY(){return this.multiply(Fn.makeScale(1,-1))}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}getComponents(e=[1,0,0,1,0,0]){return e[0]=this.elements[0],e[1]=this.elements[1],e[2]=this.elements[3],e[3]=this.elements[4],e[4]=this.elements[6],e[5]=this.elements[7],e}getNormalMatrix(e){return this.setFromMatrix(e).invert().transpose()}getRotation(e){let t=this.elements;const r=Math.sqrt(t[0]*t[0]+t[3]*t[3]),s=Math.sqrt(t[1]*t[1]+t[4]*t[4]);let o=0;t[0]||t[3]?o=t[3]>0?-Math.acos(t[0]/r):Math.acos(t[0]/r):t[1]||t[4]?o=Math.PI/2-(t[4]>0?Math.acos(-t[1]/s):-Math.acos(t[1]/s)):o=0,this.getScale(De),o!==0&&De.x<0&&(o*=-1),e.set(o,o)}getScale(e){let t=this.elements,r=Math.sqrt(t[0]*t[0]+t[1]*t[1]),s=Math.sqrt(t[3]*t[3]+t[4]*t[4]),o=t[0]*t[4]-t[3]*t[1];t[0]||t[1]?e.set(o/s,s):t[3]||t[4]?e.set(r,o/r):e.set(0,0)}getTransition(e){e.set(this.elements[6],this.elements[7])}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}hasChange(){for(let e=0,t=this.elements.length;e<t;e++)if(Math.abs(this.elements[e]-qE[e])>Number.EPSILON)return!0;return!1}invert(){const e=this.elements,t=e[0],r=e[1],s=e[2],o=e[3],u=e[4],h=e[5],c=e[6],y=e[7],p=e[8],A=p*u-h*y,T=h*c-p*o,C=y*o-u*c,N=t*A+r*T+s*C;if(N===0)return this.set(0,0,0,0,0,0,0,0,0);const O=1/N;return e[0]=A*O,e[1]=(s*y-p*r)*O,e[2]=(h*r-s*u)*O,e[3]=T*O,e[4]=(p*t-s*c)*O,e[5]=(s*o-h*t)*O,e[6]=C*O,e[7]=(r*c-y*t)*O,e[8]=(u*t-r*o)*O,this}lookAt(e,t,r){return this.identity().rotate(t.angle()-e.angle()+r.angle())}makeProjection(e,t,r,s,o,u){const h=o/(t-e),c=u/(r-s),y=o/2-(t+e)*h,p=u/2+(r+s)*c;return this.elements[0]=h,this.elements[3]=0,this.elements[6]=y,this.elements[1]=0,this.elements[4]=-c,this.elements[7]=p,this.elements[2]=0,this.elements[5]=0,this.elements[8]=1,this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeRotationByPoint(e,t){const r=Math.cos(e),s=Math.sin(e),o=-t.x*r+t.y*s+t.x,u=-t.x*s-t.y*r+t.y;return this.set(r,-s,o,s,r,u,0,0,1),this}makeRotationFromQuaternion(e){return this.compose(VE,e,WE)}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}multiply(e){return this.multiplyMatrices(this,e)}multiplyMatrices(e,t){const r=e.elements,s=t.elements,o=this.elements,u=r[0],h=r[3],c=r[6],y=r[1],p=r[4],A=r[7],T=r[2],C=r[5],N=r[8],O=s[0],L=s[3],P=s[6],W=s[1],q=s[4],b=s[7],Y=s[2],z=s[5],j=s[8];return o[0]=u*O+h*W+c*Y,o[3]=u*L+h*q+c*z,o[6]=u*P+h*b+c*j,o[1]=y*O+p*W+A*Y,o[4]=y*L+p*q+A*z,o[7]=y*P+p*b+A*j,o[2]=T*O+C*W+N*Y,o[5]=T*L+C*q+N*z,o[8]=T*P+C*b+N*j,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}premultiply(e){return this.multiplyMatrices(e,this)}rotate(e){return this.premultiply(ga.makeRotation(-e))}scale(e,t){return this.premultiply(Fn.makeScale(e,t))}set(e,t,r,s,o,u,h,c,y){return this.elements[0]=e,this.elements[3]=t,this.elements[6]=r,this.elements[1]=s,this.elements[4]=o,this.elements[7]=u,this.elements[2]=h,this.elements[5]=c,this.elements[8]=y,this}setFromDomMatrix(e){return typeof e.m11!="undefined"&&typeof e.m21!="undefined"&&typeof e.m41!="undefined"&&typeof e.m12!="undefined"&&typeof e.m22!="undefined"&&typeof e.m42!="undefined"&&typeof e.m14!="undefined"&&typeof e.m24!="undefined"&&typeof e.m44!="undefined"?this.set(e.m11,e.m21,e.m41,e.m12,e.m22,e.m42,e.m14,e.m24,e.m44):typeof e.a!="undefined"&&typeof e.b!="undefined"&&typeof e.c!="undefined"&&typeof e.d!="undefined"&&typeof e.e!="undefined"&&typeof e.f!="undefined"&&this.set(e.a,e.c,e.e,e.b,e.d,e.f,0,0,1),this}setFromMatrix(e){const t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this}setUvTransform(e,t,r,s,o,u,h){const c=Math.cos(o),y=Math.sin(o);return this.set(r*c,r*y,-r*(c*u+y*h)+u+e,-s*y,s*c,-s*(-y*u+c*h)+h+t,0,0,1),this}toArray(e=[],t=0){const r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e}toString(){return`[${this.elements[0]},${this.elements[1]}, ${this.elements[3]},${this.elements[4]}, ${this.elements[6]},${this.elements[7]}]`}translate(e,t){return this.premultiply($o.makeTranslation(e,t))}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}}const qE=[1,0,0,0,1,0,0,0,1],Ie=new k,De=new k,wp=new k,Wr=new ge,$o=new ge,ga=new ge,Fn=new ge,Wl=new ge,VE=new k(0,0,0),WE=new k(1,1,1),Re=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Gd=()=>{const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,r=Math.random()*4294967295|0;return(Re[i&255]+Re[i>>8&255]+Re[i>>16&255]+Re[i>>24&255]+"-"+Re[e&255]+Re[e>>8&255]+"-"+Re[e>>16&15|64]+Re[e>>24&255]+"-"+Re[t&63|128]+Re[t>>8&255]+"-"+Re[t>>16&255]+Re[t>>24&255]+Re[r&255]+Re[r>>8&255]+Re[r>>16&255]+Re[r>>24&255]).toLowerCase()};class Yd extends ar{constructor(t={}){super();d(this,"isObject2",!0);d(this,"id",zE++);d(this,"uuid",Gd());d(this,"name");d(this,"type","Object2");d(this,"featureKey","Object2_"+this.id);d(this,"parent");d(this,"children",[]);d(this,"up",new k(0,1));d(this,"position",new k);d(this,"rotation",new k);d(this,"scaled",new k(1,1));d(this,"flipY",!1);d(this,"selectable",!1);d(this,"matrix",new ge);d(this,"matrixWorld",new ge);d(this,"matrixWorldInverse",new ge);d(this,"modelViewMatrix",new ge);d(this,"normalMatrix",new ge);d(this,"fixed",!1);d(this,"dynamically",!1);d(this,"matrixAutoUpdate",!1);d(this,"matrixWorldNeedsUpdate",!1);d(this,"matrixWorldAutoUpdate",!1);d(this,"composeNode",!1);d(this,"isInComposeNode",!1);d(this,"alignCenter",!1);d(this,"boundingBox",new Mt);d(this,"boundingBoxWorld",new Mt);d(this,"boundingBoxNeedsUpdate",!1);d(this,"centerPoint",new k);d(this,"visible",!0);d(this,"castShadow",!1);d(this,"receiveShadow",!1);d(this,"renderOrder",0);d(this,"animations",[]);d(this,"finalSize");d(this,"userData",{});d(this,"DefaultUp",new k(0,1));d(this,"_autoSort",!0);d(this,"_version",0);t.name!==void 0?this.name=t.name:this.name="Object2",t.flipY!==void 0&&(this.flipY=t.flipY),t.selectable!==void 0&&(this.selectable=t.selectable),t.finalSize!==void 0&&(this.finalSize=t.finalSize),this.setAttrs(t)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}destroy(){super.destroy(),this.clear(),this.removeFromParent(),this.dispatchEvent(Gl)}setPosition(t){return this.position.set(t.x,t.y),this}translate(t,r){this.position.x+=t,this.position.y+=r}setScale(t,r){return this.scaled.set(t,r),this}setRotationFromMatrix(t){t.decompose(ma,this.rotation,$l)}setRotation(t){return this.rotation.set(t,t),this}rotate(t){this.rotation.x+=t}scale(t,r){r?(this.scaled.x*=t,this.scaled.y*=r):this.scaled.multiplyScalar(t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix3(ai.copy(this.matrixWorld).invert())}lookAt(t){Tp.copy(t),this.updateWorldMatrix(!0,!1),this.matrixWorld.getTransition(ma),ai.lookAt(ma,Tp,$E),ai.getRotation(kn),this.rotation.set(kn.x,kn.x),this.parent&&(this.parent.matrixWorld.getRotation(kn),this.rotate(kn.x))}applyMatrix3(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.rotation,this.scaled)}updateMatrix(){zl.copy(this.scaled),this.flipY&&(zl.y*=-1),this.matrix.compose(this.position,this.rotation,zl),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),this.matrixWorldNeedsUpdate=!1,t=!0,this.boundingBoxNeedsUpdate=!0);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].updateMatrixWorld(t);this.boundingBoxNeedsUpdate&&(this.updateBoundingBox(),this.boundingBoxNeedsUpdate=!1)}updateWorldMatrix(t=!1,r=!1){const s=this.parent;if(t&&s&&s.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent?this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix):this.matrixWorld.copy(this.matrix),this.matrixWorldInverse.copy(this.matrixWorld).invert(),r){const o=this.children;for(let u=0,h=o.length;u<h;u++)o[u].updateWorldMatrix(!1,!0)}}updateModelViewMatrix(t){ai.copy(this.matrixWorld),t&&this.fixed?this.modelViewMatrix.copy(t.projectionMatrix):t?this.modelViewMatrix.multiplyMatrices(t.viewMatrix,ai):this.modelViewMatrix.copy(ai);for(let r=0,s=this.children.length;r<s;r++)this.children[r].updateModelViewMatrix(t)}computeBoundingBox(){this.boundingBox.makeEmpty(),this.centerPoint.set(0,0);for(let t=0,r=this.children.length;t<r;t++)this.children[t].updateMatrixWorld(),ya.copy(this.children[t].computeBoundingBox()),ya.applyMatrix3(ai.copy(this.children[t].matrixWorld)),this.boundingBox.union(ya);return this.boundingBox.applyMatrix3(this.matrixWorldInverse),this.boundingBox}updateBoundingBox(){this.boundingBox.isEmpty()||this.boundingBoxWorld.copy(this.boundingBox).applyMatrix3(this.matrixWorld)}setAttrs(t){if(!t)return this;for(const r in t)if(!(r==="children"||t[r]===void 0)){if(r==="userData"&&t[r]){Object.keys(t[r]).forEach(s=>this.userData[s]=t[r][s]);continue}this.userData[r]=t[r]}return this}add(t){return!t||!t.isObject2||t===this?this:(t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.isInComposeNode=this.composeNode||this.isInComposeNode,t.selectable&&t.parent.setSelectable(t.selectable),this._autoSort&&this.children.sort((r,s)=>r.renderOrder-s.renderOrder),t.dispatchEvent(GE),this.matrixAutoUpdate||(this.matrixWorldNeedsUpdate=!0),this)}adds(t){if(!t||!t.length)return this;this._autoSort=!1;for(let r=0,s=t.length;r<s;r++)r===t.length-1&&(this._autoSort=!0),this.add(t[r]);return this}remove(t){const r=this.children.indexOf(t);return r!==-1&&(t.parent=void 0,this.children.splice(r,1),t.dispatchEvent(Gl)),this}removes(t){for(let r=0,s=t.length;r<s;r++)this.remove(t[r]);return this}removeFromParent(){const t=this.parent;return t&&t.remove(this),this.parent=void 0,this}moveToLast(){const t=this.parent;t&&(this.removeFromParent(),t.add(this))}clear(){for(let t=0;t<this.children.length;t++){const r=this.children[t];r.parent=void 0,r.destroy(),r.dispatchEvent(Gl)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),ai.copy(this.matrixWorld).invert(),t.parent&&(t.parent.updateWorldMatrix(!0,!1),ai.multiply(t.parent.matrixWorld)),t.applyMatrix3(ai),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,r){if(this[t]===r)return this;for(let s=0,o=this.children.length;s<o;s++){const h=this.children[s].getObjectByProperty(t,r);if(h!==void 0)return h}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(t,kn,$l),t}getWorldRotation(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ma,t,$l),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(ma,kn,t),t}getWorldDirection(t){return this.updateWorldMatrix(!0,!1),t.set(this.matrixWorld.elements[6],this.matrixWorld.elements[7]).normalize()}traverse(t){t(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].traverse(t)}traverseVisible(t){if(this.visible)return;t(this);const r=this.children;for(let s=0,o=r.length;s<o;s++)r[s].traverseVisible(t)}traverseAncestors(t){const r=this.parent;r&&(t(r),r.traverseAncestors(t))}onBeforeRender(t,r,s,o){}render(t){}onAfterRender(t,r,s){}setSelectable(t){this.selectable=t,this.parent&&this.parent.setSelectable(t)}raycast(t,r=[]){}getByRange(t,r=!1,s=[]){if(ya.copy(t),ya.containsBox(this.boundingBoxWorld)&&s.push(this),!r||this.composeNode)return s;for(let o=0,u=this.children.length;o<u;o++)this.children[o].getByRange(t,r,s);return s}clone(t=!0,r=!1){const s=this.constructor;return new s(this.userData).copy(this,t,r)}copy(t,r=!0,s=!1){if(this.name=t.name,this.type=t.type,this.featureKey=t.featureKey,this._version=0,this.parent=t.parent,this.up.copy(t.up),this.position.copy(t.position),this.rotation.copy(t.rotation),this.scaled.copy(t.scaled),this.flipY=t.flipY,this.selectable=t.selectable,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.modelViewMatrix.copy(t.modelViewMatrix),this.normalMatrix.copy(t.normalMatrix),this.fixed=t.fixed,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.composeNode=t.composeNode,this.alignCenter=t.alignCenter,this.boundingBox.copy(t.boundingBox),this.boundingBoxWorld.copy(t.boundingBoxWorld),this.boundingBoxNeedsUpdate=t.boundingBoxNeedsUpdate,this.centerPoint.copy(t.centerPoint),this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),r)for(let o=0;o<t.children.length;o++){const u=t.children[o];this.add(u.clone(r,s))}return this}}let zE=0;const zl=new k,ai=new ge,Tp=new k,ya=new Mt,ma=new k,$l=new k,kn=new k,$E=new k(0,1),GE={type:"added"},Gl={type:"removed"};class YE extends Yd{constructor(){super();d(this,"name","Scene");d(this,"type","Scene");d(this,"isScene",!0);d(this,"view");d(this,"background");d(this,"featureKey","Scene_"+this.id);d(this,"matrixAutoUpdate",!1)}destroy(){super.destroy(),this.boundingBox.makeEmpty()}setup(t){this.view=t}render(t){var r;this.visible&&((r=this.children)==null||r.forEach(function(s){s.isShape&&s.render(t)}))}getIntersectObjects(t,r=er.RM,s=[]){throw new Error("must be implemented in derived")}}class XE{constructor(e,t,r){d(this,"isLoading",!1);d(this,"itemsLoaded",0);d(this,"itemsTotal",0);d(this,"urlModifier");d(this,"handlers",[]);d(this,"onStart");d(this,"onLoad");d(this,"onProgress");d(this,"onError");this.onLoad=e,this.onProgress=t,this.onError=r}itemStart(e){this.itemsTotal++,this.isLoading||this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier!==void 0?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,r=this.handlers.length;t<r;t+=2){const s=this.handlers[t],o=this.handlers[t+1];if(s.global&&(s.lastIndex=0),s.test(e))return o}return null}}const _p={enabled:!1,files:{},add:function(i,e){this.enabled&&(this.files[i]=e)},get:function(i){if(this.enabled)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}},ZE=new XE;class Xd{constructor(e=ZE){d(this,"manager");d(this,"crossOrigin","anonymous");d(this,"withCredentials",!1);d(this,"path","");d(this,"resourcePath","");d(this,"requestHeader",{});this.manager=e}loadAsync(e,t){const r=this;return new Promise(function(s,o){r.load(e,s,t,o)})}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Ni={};class QE extends Error{constructor(t,r){super(t);d(this,"response");this.response=r}}class KE extends Xd{constructor(t){super(t);d(this,"mimeType");d(this,"responseType")}load(t,r,s,o){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const u=_p.get(t);if(u!==void 0)return this.manager.itemStart(t),setTimeout(()=>{r&&r(u),this.manager.itemEnd(t)},0),u;if(Ni[t]!==void 0){Ni[t].push({onLoad:r,onProgress:s,onError:o});return}Ni[t]=[],Ni[t].push({onLoad:r,onProgress:s,onError:o});const h=new Wt.window.Request(t,{headers:new Wt.window.Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=this.mimeType,y=this.responseType;fetch(h).then(p=>{if(p.status===200||p.status===0){if(p.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream=="undefined"||p.body===void 0||p.body.getReader===void 0)return p;const A=Ni[t],T=p.body.getReader(),C=p.headers.get("Content-Length")||p.headers.get("X-File-Size"),N=C?parseInt(C):0,O=N!==0;let L=0;const P=new ReadableStream({start(W){q();function q(){T.read().then(({done:b,value:Y})=>{if(b)W.close();else{L+=Y.byteLength;const z=new ProgressEvent("progress",{lengthComputable:O,loaded:L,total:N});for(let j=0,tt=A.length;j<tt;j++){const Q=A[j];Q.onProgress&&Q.onProgress(z)}W.enqueue(Y),q()}})}}});return new Response(P)}else throw new QE(`fetch for "${p.url}" responded with ${p.status}: ${p.statusText}`,p)}).then(p=>{switch(y){case"arraybuffer":return p.arrayBuffer();case"blob":return p.blob();case"document":return p.text().then(A=>new DOMParser().parseFromString(A,c));case"json":return p.json();default:if(c===void 0)return p.text();{const T=/charset="?([^;"\s]*)"?/i.exec(c),C=T&&T[1]?T[1].toLowerCase():void 0,N=new TextDecoder(C);return p.arrayBuffer().then(O=>N.decode(O))}}}).then(p=>{_p.add(t,p);const A=Ni[t];delete Ni[t];for(let T=0,C=A.length;T<C;T++){const N=A[T];N.onLoad&&N.onLoad(p)}}).catch(p=>{const A=Ni[t];if(A===void 0)throw this.manager.itemError(t),p;delete Ni[t];for(let T=0,C=A.length;T<C;T++){const N=A[T];N.onError&&N.onError(p)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setMimeType(t){return this.mimeType=t,this}setResponseType(t){return this.responseType=t,this}}class Zd extends Xd{constructor(e){super(e)}load(e,t,r,s){const o=this,u=new KE(o.manager);u.setPath(o.path),u.setRequestHeader(o.requestHeader),u.setWithCredentials(o.withCredentials),u.load(e,function(h){try{t&&t(h)}catch(c){s?s(c):console.error(c),o.manager.itemError(e)}},r,s)}}function Ta(i,e,t){if(!i)return t;let r=t;if(typeof i.getAttribute=="function"?r=i==null?void 0:i.getAttribute(e):Object.hasOwnProperty.call(i,"attributes")&&(r=i.attributes[e]),!r)return t;if(typeof t!="undefined"){if(typeof t=="string")return r;if(typeof t=="number")return Number(r)}return r}function jE(i,e,t,r,s,o,u,h,c){let y=c*(Math.PI/180),p=Math.cos(y)*(i-t)/2+Math.sin(y)*(e-r)/2,A=-1*Math.sin(y)*(i-t)/2+Math.cos(y)*(e-r)/2,T=p*p/(u*u)+A*A/(h*h);T>1&&(u*=Math.sqrt(T),h*=Math.sqrt(T));let C=Math.sqrt((u*u*(h*h)-u*u*(A*A)-h*h*(p*p))/(u*u*(A*A)+h*h*(p*p)));s===o&&(C*=-1),isNaN(C)&&(C=0);let N=C*u*A/h,O=C*-h*p/u,L=(i+t)/2+Math.cos(y)*N-Math.sin(y)*O,P=(e+r)/2+Math.sin(y)*N+Math.cos(y)*O,W=function(Q){return Math.sqrt(Q[0]*Q[0]+Q[1]*Q[1])},q=function(Q,K){return(Q[0]*K[0]+Q[1]*K[1])/(W(Q)*W(K))},b=function(Q,K){return(Q[0]*K[1]<Q[1]*K[0]?-1:1)*Math.acos(q(Q,K))},Y=b([1,0],[(p-N)/u,(A-O)/h]),z=[(p-N)/u,(A-O)/h],j=[(-1*p-N)/u,(-1*A-O)/h],tt=b(z,j);return q(z,j)<=-1&&(tt=Math.PI),q(z,j)>=1&&(tt=0),o===0&&tt>0&&(tt=tt-2*Math.PI),o===1&&tt<0&&(tt=tt+2*Math.PI),[L,P,u,h,Y,tt,y,o]}function JE(i,e,t,r,s,o,u){const h=[],c=Math.max(Math.floor(Math.abs(o)/(Math.PI/2)),1),y=o/c;for(let p=0;p<c;p++){const A=s+p*y,T=A+y,C=Math.tan(T/4-A/4),N=Math.sin(A),O=Math.cos(A),L=Math.sin(T),P=Math.cos(T),W=i+t*O*Math.cos(u*Math.PI/180)-r*N*Math.sin(u*Math.PI/180),q=e+t*O*Math.sin(u*Math.PI/180)+r*N*Math.cos(u*Math.PI/180),b=i+t*P*Math.cos(u*Math.PI/180)-r*L*Math.sin(u*Math.PI/180),Y=e+t*P*Math.sin(u*Math.PI/180)+r*L*Math.cos(u*Math.PI/180),z=W+C*(-t*N*Math.cos(u*Math.PI/180)-r*O*Math.sin(u*Math.PI/180)),j=q+C*(-t*N*Math.sin(u*Math.PI/180)+r*O*Math.cos(u*Math.PI/180)),tt=b+C*(t*L*Math.cos(u*Math.PI/180)+r*P*Math.sin(u*Math.PI/180)),Q=Y+C*(t*L*Math.sin(u*Math.PI/180)-r*P*Math.cos(u*Math.PI/180));h.push([[W,q],[z,j],[tt,Q],[b,Y]])}return h}const fe=" ";function tA(i){let e="";Array.isArray(i)||(i=[i]);for(let t=0;t<i.length;t++){const r=i[t];if(r.type===R.CLOSE_PATH)e+="z";else if(r.type===R.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===R.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===R.MOVE_TO)e+=(r.relative?"m":"M")+r.x+fe+r.y;else if(r.type===R.LINE_TO)e+=(r.relative?"l":"L")+r.x+fe+r.y;else if(r.type===R.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+fe+r.y1+fe+r.x2+fe+r.y2+fe+r.x+fe+r.y;else if(r.type===R.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+fe+r.y2+fe+r.x+fe+r.y;else if(r.type===R.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+fe+r.y1+fe+r.x+fe+r.y;else if(r.type===R.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+fe+r.y;else if(r.type===R.ARC)e+=(r.relative?"a":"A")+r.rX+fe+r.rY+fe+r.xRot+fe+ +r.lArcFlag+fe+ +r.sweepFlag+fe+r.x+fe+r.y;else throw new Error(`Unexpected command type "${r==null?void 0:r.type}" at index ${t}.`)}return e}function ch([i,e],t){return[i*Math.cos(t)-e*Math.sin(t),i*Math.sin(t)+e*Math.cos(t)]}function Xr(...i){for(let e=0;e<i.length;e++)if(typeof i[e]!="number")throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof i[e]} == typeof ${i[e]}`);return!0}const pn=Math.PI;function Mh(i,e,t){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;let{rX:r,rY:s}=i;const{x:o,y:u}=i;if(Math.abs(r)<1e-10||Math.abs(s)<1e-10){i.rX=0,i.rY=0,i.cX=(e+o)/2,i.cY=(t+u)/2,i.phi1=0,i.phi2=0;return}r=Math.abs(i.rX),s=Math.abs(i.rY);const h=i.xRot/180*pn,[c,y]=ch([(e-o)/2,(t-u)/2],-h),p=Math.pow(c,2)/Math.pow(r,2)+Math.pow(y,2)/Math.pow(s,2);1<p&&(r*=Math.sqrt(p),s*=Math.sqrt(p)),i.rX=r,i.rY=s;const A=Math.pow(r,2)*Math.pow(y,2)+Math.pow(s,2)*Math.pow(c,2),T=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(s,2)-A)/A)),C=r*y/s*T,N=-s*c/r*T,O=ch([C,N],h);i.cX=O[0]+(e+o)/2,i.cY=O[1]+(t+u)/2,i.phi1=Math.atan2((y-N)/s,(c-C)/r),i.phi2=Math.atan2((-y-N)/s,(-c-C)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*pn),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*pn),i.phi1*=180/pn,i.phi2*=180/pn}function Cp(i,e,t){Xr(i,e,t);const r=i*i+e*e-t*t;if(0>r)return[];if(r===0)return[[i*t/(i*i+e*e),e*t/(i*i+e*e)]];const s=Math.sqrt(r);return[[(i*t+e*s)/(i*i+e*e),(e*t-i*s)/(i*i+e*e)],[(i*t-e*s)/(i*i+e*e),(e*t+i*s)/(i*i+e*e)]]}const Hn=Math.PI/180;function Dp(i,e,t){return(1-t)*i+t*e}function Sp(i,e,t,r){return i+Math.cos(r/180*pn)*e+Math.sin(r/180*pn)*t}function Op(i,e,t,r){const o=e-i,u=t-e,h=r-t,c=3*o+3*h-6*u,y=(u-o)*6,p=3*o;return Math.abs(c)<1e-6?Math.abs(y)<1e-6?[]:[-p/y]:eA(y/c,p/c,1e-6)}function Mp(i,e,t,r,s){const o=1-s,u=o*o*o,h=3*o*o*s,c=3*o*s*s,y=s*s*s;return i*u+e*h+t*c+r*y}function eA(i,e,t=1e-6){const r=i*i/4-e;if(r<-t)return[];if(r<=t)return[-i/2];const s=Math.sqrt(r);return[-(i/2)-s,-(i/2)+s]}function rA(i,e,t){i.cX||Mh(i,e,t);const r=i.xRot/180*pn;if(Math.abs(i.rX)<1e-10||Math.abs(i.rY)<1e-10)return[{relative:i.relative,type:R.CURVE_TO,x1:e+(i.x-e)/3,y1:t+(i.y-t)/3,x2:e+2*(i.x-e)/3,y2:t+2*(i.y-t)/3,x:i.x,y:i.y}];const s=Math.min(i.phi1,i.phi2),o=Math.max(i.phi1,i.phi2),u=o-s,h=Math.ceil(u/90),c=new Array(h);let y=e,p=t;const A=(T,C)=>{const[N,O]=ch([T*i.rX,C*i.rY],r);return[i.cX+N,i.cY+O]};for(let T=0;T<h;T++){const C=Dp(i.phi1,i.phi2,T/h),N=Dp(i.phi1,i.phi2,(T+1)/h),O=N-C,L=4/3*Math.tan(O*Hn/4),P=Math.cos(C*Hn)-L*Math.sin(C*Hn),W=Math.sin(C*Hn)+L*Math.cos(C*Hn),q=Math.cos(N*Hn),b=Math.sin(N*Hn),Y=q+L*b,z=b-L*q,j=A(P,W),tt=A(Y,z),Q=A(q,b),K={relative:i.relative,type:R.CURVE_TO,x:Q[0],y:Q[1],x1:j[0],y1:j[1],x2:tt[0],y2:tt[1]};i.relative&&(K.x1-=y,K.y1-=p,K.x2-=y,K.y2-=p,K.x-=y,K.y-=p),y=Q[0],p=Q[1],c[T]=K}return c}function Yl(i,e,t){const r=e[0]-i[0],s=e[1]-i[1],o=t[0]-i[0],u=t[1]-i[1],h=r*u-s*o;if(!(Math.abs(h)<1e-10))return!1;const y=r*o+s*u,p=r*r+s*s,A=o*o+u*u;return 0<=y&&y<=A&&p<=A}function iA(i,e=!0){if(i.length<2)return i;const t=de.INFO((o,u,h)=>{var c,y,p;return Uo(ys({},o),{x:(c=o.x)!=null?c:u,y:(y=o.y)!=null?y:h,relative:(p=o.relative)!=null?p:!1})}),r=[];let s=[];for(const o of i){const u=t(o);u.type===R.MOVE_TO&&s.length>0&&(e?r.push(...Go(s)):r.unshift(...Go(s)),s=[]),s.push(u)}return s.length>0&&(e?r.push(...Go(s)):r.unshift(...Go(s))),r}function Go(i){var s;const e=((s=i[i.length-1])==null?void 0:s.type)===R.CLOSE_PATH,t=e?i.length-2:i.length-1,r=[{type:R.MOVE_TO,relative:!1,x:i[t].x,y:i[t].y}];for(let o=t;o>0;o--){const u=i[o],h=i[o-1];if(u.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(u.type){case R.HORIZ_LINE_TO:r.push({type:R.HORIZ_LINE_TO,relative:!1,x:h.x});break;case R.VERT_LINE_TO:r.push({type:R.VERT_LINE_TO,relative:!1,y:h.y});break;case R.LINE_TO:case R.MOVE_TO:r.push({type:R.LINE_TO,relative:!1,x:h.x,y:h.y});break;case R.CURVE_TO:r.push({type:R.CURVE_TO,relative:!1,x:h.x,y:h.y,x1:u.x2,y1:u.y2,x2:u.x1,y2:u.y1});break;case R.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case R.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case R.ARC:throw new Error("Unsupported command: A (arc)");case R.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&r.push({type:R.CLOSE_PATH}),r}function nA(i=1e13){Xr(i);function e(t){return Math.round(t*i)/i}return function(r){return"x1"in r&&typeof r.x1!="undefined"&&(r.x1=e(r.x1)),"y1"in r&&typeof r.y1!="undefined"&&(r.y1=e(r.y1)),"x2"in r&&typeof r.x2!="undefined"&&(r.x2=e(r.x2)),"y2"in r&&typeof r.y2!="undefined"&&(r.y2=e(r.y2)),"x"in r&&typeof r.x!="undefined"&&(r.x=e(r.x)),"y"in r&&typeof r.y!="undefined"&&(r.y=e(r.y)),"rX"in r&&typeof r.rX!="undefined"&&(r.rX=e(r.rX)),"rY"in r&&typeof r.rY!="undefined"&&(r.rY=e(r.rY)),r}}function Qd(){return Zr((i,e,t)=>(i.relative&&(typeof i.x1!="undefined"&&(i.x1+=e),typeof i.y1!="undefined"&&(i.y1+=t),typeof i.x2!="undefined"&&(i.x2+=e),typeof i.y2!="undefined"&&(i.y2+=t),typeof i.x!="undefined"&&(i.x+=e),typeof i.y!="undefined"&&(i.y+=t),i.relative=!1),i))}function sA(){return Zr((i,e,t)=>(i.relative||(typeof i.x1!="undefined"&&(i.x1-=e),typeof i.y1!="undefined"&&(i.y1-=t),typeof i.x2!="undefined"&&(i.x2-=e),typeof i.y2!="undefined"&&(i.y2-=t),typeof i.x!="undefined"&&(i.x-=e),typeof i.y!="undefined"&&(i.y-=t),i.relative=!0),i))}function aA(i=!0,e=!0,t=!0,r=!0){return Zr((s,o,u,h,c)=>{if(isNaN(h)&&!(s.type&R.MOVE_TO))throw new Error("path must start with moveto");if(e&&s.type&R.HORIZ_LINE_TO&&(s.type=R.LINE_TO,s.y=s.relative?0:u),t&&s.type&R.VERT_LINE_TO&&(s.type=R.LINE_TO,s.x=s.relative?0:o),i&&s.type&R.CLOSE_PATH&&(s.type=R.LINE_TO,s.x=s.relative?h-o:h,s.y=s.relative?c-u:c),s.type&R.ARC&&(s.rX===0||s.rY===0)&&(s.type=R.LINE_TO,delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag),r&&s.type&R.QUAD_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x,u+s.y]:[s.x,s.y];Yl(y,p,A)&&(s.type=R.LINE_TO,delete s.x1,delete s.y1)}if(r&&s.type&R.CURVE_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x2,u+s.y2]:[s.x2,s.y2],T=s.relative?[o+s.x,u+s.y]:[s.x,s.y];Yl(y,p,T)&&Yl(y,A,T)&&(s.type=R.LINE_TO,delete s.x1,delete s.y1,delete s.x2,delete s.y2)}return s})}function Kd(){let i=NaN,e=NaN,t=NaN,r=NaN;return Zr((s,o,u)=>(s.type&R.SMOOTH_CURVE_TO&&(s.type=R.CURVE_TO,i=isNaN(i)?o:i,e=isNaN(e)?u:e,s.x1=s.relative?o-i:2*o-i,s.y1=s.relative?u-e:2*u-e),s.type&R.CURVE_TO?(i=s.relative?o+s.x2:s.x2,e=s.relative?u+s.y2:s.y2):(i=NaN,e=NaN),s.type&R.SMOOTH_QUAD_TO&&(s.type=R.QUAD_TO,t=isNaN(t)?o:t,r=isNaN(r)?u:r,s.x1=s.relative?o-t:2*o-t,s.y1=s.relative?u-r:2*u-r),s.type&R.QUAD_TO?(t=s.relative?o+s.x1:s.x1,r=s.relative?u+s.y1:s.y1):(t=NaN,r=NaN),s))}function jd(){let i=NaN,e=NaN;return Zr((t,r,s)=>{if(t.type&R.SMOOTH_QUAD_TO&&(t.type=R.QUAD_TO,i=isNaN(i)?r:i,e=isNaN(e)?s:e,t.x1=t.relative?r-i:2*r-i,t.y1=t.relative?s-e:2*s-e),t.type&R.QUAD_TO){i=t.relative?r+t.x1:t.x1,e=t.relative?s+t.y1:t.y1;const o=t.x1,u=t.y1;t.type=R.CURVE_TO,t.x1=((t.relative?0:r)+o*2)/3,t.y1=((t.relative?0:s)+u*2)/3,t.x2=(t.x+o*2)/3,t.y2=(t.y+u*2)/3}else i=NaN,e=NaN;return t})}function Zr(i){let e=0,t=0,r=NaN,s=NaN;return function(u){if(isNaN(r)&&!(u.type&R.MOVE_TO))throw new Error("path must start with moveto");const h=i(u,e,t,r,s);return u.type&R.CLOSE_PATH&&(e=r,t=s),"x"in u&&typeof u.x!="undefined"&&(e=u.relative?e+u.x:u.x),"y"in u&&typeof u.y!="undefined"&&(t=u.relative?t+u.y:u.y),u.type&R.MOVE_TO&&(r=e,s=t),h}}function oA(i=0){Xr(i);let e=NaN,t=NaN,r=NaN,s=NaN;return Zr((o,u,h,c,y)=>{const p=Math.abs;let A=!1,T=0,C=0;if(o.type&R.SMOOTH_CURVE_TO&&(T=isNaN(e)?0:u-e,C=isNaN(t)?0:h-t),o.type&(R.CURVE_TO|R.SMOOTH_CURVE_TO)?(e=o.relative?u+o.x2:o.x2,t=o.relative?h+o.y2:o.y2):(e=NaN,t=NaN),o.type&R.SMOOTH_QUAD_TO?(r=isNaN(r)?u:2*u-r,s=isNaN(s)?h:2*h-s):o.type&R.QUAD_TO?(r=o.relative?u+o.x1:o.x1,s=o.relative?h+o.y1:o.y2):(r=NaN,s=NaN),o.type&R.LINE_COMMANDS||o.type&R.ARC&&(o.rX===0||o.rY===0||!o.lArcFlag)||o.type&R.CURVE_TO||o.type&R.SMOOTH_CURVE_TO||o.type&R.QUAD_TO||o.type&R.SMOOTH_QUAD_TO){const N=typeof o.x=="undefined"?0:o.relative?o.x:o.x-u,O=typeof o.y=="undefined"?0:o.relative?o.y:o.y-h;T=isNaN(r)?typeof o.x1=="undefined"?T:o.relative?o.x:o.x1-u:r-u,C=isNaN(s)?typeof o.y1=="undefined"?C:o.relative?o.y:o.y1-h:s-h;const L=typeof o.x2=="undefined"?0:o.relative?o.x:o.x2-u,P=typeof o.y2=="undefined"?0:o.relative?o.y:o.y2-h;p(N)<=i&&p(O)<=i&&p(T)<=i&&p(C)<=i&&p(L)<=i&&p(P)<=i&&(A=!0)}return o.type&R.CLOSE_PATH&&p(u-c)<=i&&p(h-y)<=i&&(A=!0),A?[]:o})}function mn(i,e,t,r,s,o){return Xr(i,e,t,r,s,o),Zr((u,h,c,y)=>{const p=u.x1,A=u.x2,T=u.relative&&!isNaN(y),C=typeof u.x!="undefined"?u.x:T?0:h,N=typeof u.y!="undefined"?u.y:T?0:c;u.type&R.HORIZ_LINE_TO&&e!==0&&(u.type=R.LINE_TO,u.y=u.relative?0:c),u.type&R.VERT_LINE_TO&&t!==0&&(u.type=R.LINE_TO,u.x=u.relative?0:h),typeof u.x!="undefined"&&(u.x=u.x*i+N*t+(T?0:s)),typeof u.y!="undefined"&&(u.y=C*e+u.y*r+(T?0:o)),typeof u.x1!="undefined"&&(u.x1=u.x1*i+u.y1*t+(T?0:s)),typeof u.y1!="undefined"&&(u.y1=p*e+u.y1*r+(T?0:o)),typeof u.x2!="undefined"&&(u.x2=u.x2*i+u.y2*t+(T?0:s)),typeof u.y2!="undefined"&&(u.y2=A*e+u.y2*r+(T?0:o));function O(P){return P*P}const L=i*r-e*t;if(typeof u.xRot!="undefined"&&(i!==1||e!==0||t!==0||r!==1))if(L===0)delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag,u.type=R.LINE_TO;else{const P=u.xRot*Math.PI/180,W=Math.sin(P),q=Math.cos(P),b=1/O(u.rX),Y=1/O(u.rY),z=O(q)*b+O(W)*Y,j=2*W*q*(b-Y),tt=O(W)*b+O(q)*Y,Q=z*r*r-j*e*r+tt*e*e,K=j*(i*r+e*t)-2*(z*t*r+tt*i*e),rt=z*t*t-j*i*t+tt*i*i,at=(Math.atan2(K,Q-rt)+Math.PI)%Math.PI/2,ct=Math.sin(at),pt=Math.cos(at);u.rX=Math.abs(L)/Math.sqrt(Q*O(pt)+K*ct*pt+rt*O(ct)),u.rY=Math.abs(L)/Math.sqrt(Q*O(ct)-K*ct*pt+rt*O(pt)),u.xRot=at*180/Math.PI}return typeof u.sweepFlag!="undefined"&&0>L&&(u.sweepFlag=+!u.sweepFlag),u})}function uA(i,e=0,t=0){Xr(i,e,t);const r=Math.sin(i),s=Math.cos(i);return mn(s,r,-r,s,e-e*s+t*r,t-e*r-t*s)}function lA(i,e=0){return Xr(i,e),mn(1,0,0,1,i,e)}function hA(i,e=i){return Xr(i,e),mn(i,0,0,e,0,0)}function cA(i){return Xr(i),mn(1,0,Math.tan(i),1,0,0)}function fA(i){return Xr(i),mn(1,Math.tan(i),0,1,0,0)}function pA(i=0){return Xr(i),mn(-1,0,0,1,i,0)}function dA(i=0){return Xr(i),mn(1,0,0,-1,0,i)}function gA(){return Zr((i,e,t)=>R.ARC===i.type?rA(i,i.relative?0:e,i.relative?0:t):i)}function yA(){return Zr((i,e,t)=>(i.relative&&(e=0,t=0),R.ARC===i.type&&Mh(i,e,t),i))}function Jd(){return i=>ys({},i)}function mA(){const i=Jd(),e=Qd(),t=jd(),r=Kd(),s=Zr((o,u,h)=>{const c=r(t(e(i(o))));function y(A){A>s.maxX&&(s.maxX=A),A<s.minX&&(s.minX=A)}function p(A){A>s.maxY&&(s.maxY=A),A<s.minY&&(s.minY=A)}if(c.type&R.DRAWING_COMMANDS&&(y(u),p(h)),c.type&R.HORIZ_LINE_TO&&y(c.x),c.type&R.VERT_LINE_TO&&p(c.y),c.type&R.LINE_TO&&(y(c.x),p(c.y)),c.type&R.CURVE_TO){y(c.x),p(c.y);const A=Op(u,c.x1,c.x2,c.x);for(const C of A)0<C&&1>C&&y(Mp(u,c.x1,c.x2,c.x,C));const T=Op(h,c.y1,c.y2,c.y);for(const C of T)0<C&&1>C&&p(Mp(h,c.y1,c.y2,c.y,C))}if(c.type&R.ARC){y(c.x),p(c.y),Mh(c,u,h);const A=c.xRot/180*Math.PI,T=Math.cos(A)*c.rX,C=Math.sin(A)*c.rX,N=-Math.sin(A)*c.rY,O=Math.cos(A)*c.rY,[L,P]=c.phi1<c.phi2?[c.phi1,c.phi2]:-180>c.phi2?[c.phi2+360,c.phi1+360]:[c.phi2,c.phi1],W=([Y,z])=>{const tt=Math.atan2(z,Y)*180/Math.PI;return tt<L?tt+360:tt},q=Cp(N,-T,0).map(W);for(const Y of q)Y>L&&Y<P&&y(Sp(c.cX,T,N,Y));const b=Cp(O,-C,0).map(W);for(const Y of b)Y>L&&Y<P&&p(Sp(c.cY,C,O,Y))}return o});return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}const de={ROUND:nA,TO_ABS:Qd,TO_REL:sA,NORMALIZE_HVZ:aA,NORMALIZE_ST:Kd,QT_TO_C:jd,INFO:Zr,SANITIZE:oA,MATRIX:mn,ROTATE:uA,TRANSLATE:lA,SCALE:hA,SKEW_X:cA,SKEW_Y:fA,X_AXIS_SYMMETRY:pA,Y_AXIS_SYMMETRY:dA,A_TO_C:gA,ANNOTATE_ARCS:yA,CLONE:Jd,CALCULATE_BOUNDS:mA,REVERSE_PATH:iA};let tg=class{round(e){return this.transform(de.ROUND(e))}toAbs(){return this.transform(de.TO_ABS())}toRel(){return this.transform(de.TO_REL())}normalizeHVZ(e,t,r){return this.transform(de.NORMALIZE_HVZ(e,t,r))}normalizeST(){return this.transform(de.NORMALIZE_ST())}qtToC(){return this.transform(de.QT_TO_C())}aToC(){return this.transform(de.A_TO_C())}sanitize(e){return this.transform(de.SANITIZE(e))}translate(e,t){return this.transform(de.TRANSLATE(e,t))}scale(e,t){return this.transform(de.SCALE(e,t))}rotate(e,t,r){return this.transform(de.ROTATE(e,t,r))}matrix(e,t,r,s,o,u){return this.transform(de.MATRIX(e,t,r,s,o,u))}skewX(e){return this.transform(de.SKEW_X(e))}skewY(e){return this.transform(de.SKEW_Y(e))}xSymmetry(e){return this.transform(de.X_AXIS_SYMMETRY(e))}ySymmetry(e){return this.transform(de.Y_AXIS_SYMMETRY(e))}annotateArcs(){return this.transform(de.ANNOTATE_ARCS())}};const vA=i=>i===" "||i===" "||i==="\r"||i===`
33
33
  `,Lp=i=>48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57;let xA=class extends tg{constructor(){super();d(this,"curNumber","");d(this,"curCommandType",-1);d(this,"curCommandRelative",!1);d(this,"canParseCommandOrComma",!0);d(this,"curNumberHasExp",!1);d(this,"curNumberHasExpDigits",!1);d(this,"curNumberHasDecimal",!1);d(this,"curArgs",[])}finish(t=[]){if(this.parse(" ",t),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t}parse(t,r=[]){const s=o=>{r.push(o),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let o=0;o<t.length;o++){const u=t[o],h=this.curCommandType===R.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),c=Lp(u)&&(this.curNumber==="0"&&u==="0"||h);if(Lp(u)&&!c){this.curNumber+=u,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(u==="e"||u==="E"){this.curNumber+=u,this.curNumberHasExp=!0;continue}if((u==="-"||u==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=u;continue}if(u==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!h){this.curNumber+=u,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const y=Number(this.curNumber);if(isNaN(y))throw new SyntaxError(`Invalid number ending at ${o}`);if(this.curCommandType===R.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>y)throw new SyntaxError(`Expected positive number, got "${y}" at index "${o}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${o}"`)}this.curArgs.push(y),this.curArgs.length===EA[this.curCommandType]&&(R.HORIZ_LINE_TO===this.curCommandType?s({type:R.HORIZ_LINE_TO,relative:this.curCommandRelative,x:y}):R.VERT_LINE_TO===this.curCommandType?s({type:R.VERT_LINE_TO,relative:this.curCommandRelative,y}):this.curCommandType===R.MOVE_TO||this.curCommandType===R.LINE_TO||this.curCommandType===R.SMOOTH_QUAD_TO?(s({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),R.MOVE_TO===this.curCommandType&&(this.curCommandType=R.LINE_TO)):this.curCommandType===R.CURVE_TO?s({type:R.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===R.SMOOTH_CURVE_TO?s({type:R.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===R.QUAD_TO?s({type:R.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===R.ARC&&s({type:R.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!vA(u)){if(u===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(u==="+"||u==="-"||u==="."){this.curNumber=u,this.curNumberHasDecimal=u===".";continue}if(c){this.curNumber=u,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${o}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${u}" at index ${o}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,u==="z"||u==="Z"){r.push({type:R.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(u==="h"||u==="H")this.curCommandType=R.HORIZ_LINE_TO,this.curCommandRelative=u==="h";else if(u==="v"||u==="V")this.curCommandType=R.VERT_LINE_TO,this.curCommandRelative=u==="v";else if(u==="m"||u==="M")this.curCommandType=R.MOVE_TO,this.curCommandRelative=u==="m";else if(u==="l"||u==="L")this.curCommandType=R.LINE_TO,this.curCommandRelative=u==="l";else if(u==="c"||u==="C")this.curCommandType=R.CURVE_TO,this.curCommandRelative=u==="c";else if(u==="s"||u==="S")this.curCommandType=R.SMOOTH_CURVE_TO,this.curCommandRelative=u==="s";else if(u==="q"||u==="Q")this.curCommandType=R.QUAD_TO,this.curCommandRelative=u==="q";else if(u==="t"||u==="T")this.curCommandType=R.SMOOTH_QUAD_TO,this.curCommandRelative=u==="t";else if(u==="a"||u==="A")this.curCommandType=R.ARC,this.curCommandRelative=u==="a";else throw new SyntaxError(`Unexpected character "${u}" at index ${o}.`)}}return r}transform(t){return Object.create(this,{parse:{value(s,o=[]){const u=Object.getPrototypeOf(this).parse.call(this,s);for(const h of u){const c=t(h);Array.isArray(c)?o.push(...c):o.push(c)}return o}}})}};var kt;let R=(kt=class extends tg{constructor(t){super();d(this,"commands");typeof t=="string"?this.commands=kt.parse(t):this.commands=t}encode(){return kt.encode(this.commands)}getBounds(){const t=de.CALCULATE_BOUNDS();return this.transform(t),t}transform(t){const r=[];for(const s of this.commands){const o=t(s);Array.isArray(o)?r.push(...o):r.push(o)}return this.commands=r,this}reverse(t=!0){return this.commands=de.REVERSE_PATH(this.commands,t),this}static encode(t){return tA(t)}static parse(t){const r=new xA,s=[];return r.parse(t,s),r.finish(s),s}},d(kt,"CLOSE_PATH",1),d(kt,"MOVE_TO",2),d(kt,"HORIZ_LINE_TO",4),d(kt,"VERT_LINE_TO",8),d(kt,"LINE_TO",16),d(kt,"CURVE_TO",32),d(kt,"SMOOTH_CURVE_TO",64),d(kt,"QUAD_TO",128),d(kt,"SMOOTH_QUAD_TO",256),d(kt,"ARC",512),d(kt,"LINE_COMMANDS",kt.LINE_TO|kt.HORIZ_LINE_TO|kt.VERT_LINE_TO),d(kt,"DRAWING_COMMANDS",kt.HORIZ_LINE_TO|kt.VERT_LINE_TO|kt.LINE_TO|kt.CURVE_TO|kt.SMOOTH_CURVE_TO|kt.QUAD_TO|kt.SMOOTH_QUAD_TO|kt.ARC),kt);const EA={[R.MOVE_TO]:2,[R.LINE_TO]:2,[R.HORIZ_LINE_TO]:1,[R.VERT_LINE_TO]:1,[R.CLOSE_PATH]:0,[R.QUAD_TO]:4,[R.SMOOTH_QUAD_TO]:2,[R.CURVE_TO]:6,[R.SMOOTH_CURVE_TO]:4,[R.ARC]:7},pe=" ";function AA(i){let e="";Array.isArray(i)||(i=[i]);for(let t=0;t<i.length;t++){const r=i[t];if(r.type===V.CLOSE_PATH)e+="z";else if(r.type===V.HORIZ_LINE_TO)e+=(r.relative?"h":"H")+r.x;else if(r.type===V.VERT_LINE_TO)e+=(r.relative?"v":"V")+r.y;else if(r.type===V.MOVE_TO)e+=(r.relative?"m":"M")+r.x+pe+r.y;else if(r.type===V.LINE_TO)e+=(r.relative?"l":"L")+r.x+pe+r.y;else if(r.type===V.CURVE_TO)e+=(r.relative?"c":"C")+r.x1+pe+r.y1+pe+r.x2+pe+r.y2+pe+r.x+pe+r.y;else if(r.type===V.SMOOTH_CURVE_TO)e+=(r.relative?"s":"S")+r.x2+pe+r.y2+pe+r.x+pe+r.y;else if(r.type===V.QUAD_TO)e+=(r.relative?"q":"Q")+r.x1+pe+r.y1+pe+r.x+pe+r.y;else if(r.type===V.SMOOTH_QUAD_TO)e+=(r.relative?"t":"T")+r.x+pe+r.y;else if(r.type===V.ARC)e+=(r.relative?"a":"A")+r.rX+pe+r.rY+pe+r.xRot+pe+ +r.lArcFlag+pe+ +r.sweepFlag+pe+r.x+pe+r.y;else throw new Error(`Unexpected command type "${r==null?void 0:r.type}" at index ${t}.`)}return e}class eg{round(e){return this.transform(ae.ROUND(e))}toAbs(){return this.transform(ae.TO_ABS())}toRel(){return this.transform(ae.TO_REL())}normalizeHVZ(e,t,r){return this.transform(ae.NORMALIZE_HVZ(e,t,r))}normalizeST(){return this.transform(ae.NORMALIZE_ST())}qtToC(){return this.transform(ae.QT_TO_C())}aToC(){return this.transform(ae.A_TO_C())}sanitize(e){return this.transform(ae.SANITIZE(e))}translate(e,t){return this.transform(ae.TRANSLATE(e,t))}scale(e,t){return this.transform(ae.SCALE(e,t))}rotate(e,t,r){return this.transform(ae.ROTATE(e,t,r))}matrix(e,t,r,s,o,u){return this.transform(ae.MATRIX(e,t,r,s,o,u))}skewX(e){return this.transform(ae.SKEW_X(e))}skewY(e){return this.transform(ae.SKEW_Y(e))}xSymmetry(e){return this.transform(ae.X_AXIS_SYMMETRY(e))}ySymmetry(e){return this.transform(ae.Y_AXIS_SYMMETRY(e))}annotateArcs(){return this.transform(ae.ANNOTATE_ARCS())}}const bA=i=>i===" "||i===" "||i==="\r"||i===`
34
- `,Np=i=>48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57;class wA extends eg{constructor(){super(),this.curNumber="",this.curCommandType=-1,this.curCommandRelative=!1,this.canParseCommandOrComma=!0,this.curNumberHasExp=!1,this.curNumberHasExpDigits=!1,this.curNumberHasDecimal=!1,this.curArgs=[]}finish(e=[]){if(this.parse(" ",e),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e}parse(e,t=[]){const r=s=>{t.push(s),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let s=0;s<e.length;s++){const o=e[s],u=this.curCommandType===V.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),h=Np(o)&&(this.curNumber==="0"&&o==="0"||u);if(Np(o)&&!h){this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(o==="e"||o==="E"){this.curNumber+=o,this.curNumberHasExp=!0;continue}if((o==="-"||o==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=o;continue}if(o==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!u){this.curNumber+=o,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError(`Invalid number ending at ${s}`);if(this.curCommandType===V.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError(`Expected positive number, got "${c}" at index "${s}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${s}"`)}this.curArgs.push(c),this.curArgs.length===TA[this.curCommandType]&&(V.HORIZ_LINE_TO===this.curCommandType?r({type:V.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):V.VERT_LINE_TO===this.curCommandType?r({type:V.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===V.MOVE_TO||this.curCommandType===V.LINE_TO||this.curCommandType===V.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),V.MOVE_TO===this.curCommandType&&(this.curCommandType=V.LINE_TO)):this.curCommandType===V.CURVE_TO?r({type:V.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===V.SMOOTH_CURVE_TO?r({type:V.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===V.QUAD_TO?r({type:V.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===V.ARC&&r({type:V.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!bA(o)){if(o===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(o==="+"||o==="-"||o==="."){this.curNumber=o,this.curNumberHasDecimal=o===".";continue}if(h){this.curNumber=o,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${s}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${o}" at index ${s}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,o==="z"||o==="Z"){t.push({type:V.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(o==="h"||o==="H")this.curCommandType=V.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=V.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=V.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=V.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=V.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=V.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=V.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=V.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else if(o==="a"||o==="A")this.curCommandType=V.ARC,this.curCommandRelative=o==="a";else throw new SyntaxError(`Unexpected character "${o}" at index ${s}.`)}}return t}transform(e){return Object.create(this,{parse:{value(r,s=[]){const o=Object.getPrototypeOf(this).parse.call(this,r);for(const u of o){const h=e(u);Array.isArray(h)?s.push(...h):s.push(h)}return s}}})}}const Vt=class Vt extends eg{constructor(e){super(),typeof e=="string"?this.commands=Vt.parse(e):this.commands=e}encode(){return Vt.encode(this.commands)}getBounds(){const e=ae.CALCULATE_BOUNDS();return this.transform(e),e}transform(e){const t=[];for(const r of this.commands){const s=e(r);Array.isArray(s)?t.push(...s):t.push(s)}return this.commands=t,this}reverse(e=!0){return this.commands=ae.REVERSE_PATH(this.commands,e),this}static encode(e){return AA(e)}static parse(e){const t=new wA,r=[];return t.parse(e,r),t.finish(r),r}};Vt.CLOSE_PATH=1,Vt.MOVE_TO=2,Vt.HORIZ_LINE_TO=4,Vt.VERT_LINE_TO=8,Vt.LINE_TO=16,Vt.CURVE_TO=32,Vt.SMOOTH_CURVE_TO=64,Vt.QUAD_TO=128,Vt.SMOOTH_QUAD_TO=256,Vt.ARC=512,Vt.LINE_COMMANDS=Vt.LINE_TO|Vt.HORIZ_LINE_TO|Vt.VERT_LINE_TO,Vt.DRAWING_COMMANDS=Vt.HORIZ_LINE_TO|Vt.VERT_LINE_TO|Vt.LINE_TO|Vt.CURVE_TO|Vt.SMOOTH_CURVE_TO|Vt.QUAD_TO|Vt.SMOOTH_QUAD_TO|Vt.ARC;let V=Vt;const TA={[V.MOVE_TO]:2,[V.LINE_TO]:2,[V.HORIZ_LINE_TO]:1,[V.VERT_LINE_TO]:1,[V.CLOSE_PATH]:0,[V.QUAD_TO]:4,[V.SMOOTH_QUAD_TO]:2,[V.CURVE_TO]:6,[V.SMOOTH_CURVE_TO]:4,[V.ARC]:7};function fh([i,e],t){return[i*Math.cos(t)-e*Math.sin(t),i*Math.sin(t)+e*Math.cos(t)]}function Qr(...i){for(let e=0;e<i.length;e++)if(typeof i[e]!="number")throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof i[e]} == typeof ${i[e]}`);return!0}const dn=Math.PI;function Lh(i,e,t){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;let{rX:r,rY:s}=i;const{x:o,y:u}=i;if(Math.abs(r)<1e-10||Math.abs(s)<1e-10){i.rX=0,i.rY=0,i.cX=(e+o)/2,i.cY=(t+u)/2,i.phi1=0,i.phi2=0;return}r=Math.abs(i.rX),s=Math.abs(i.rY);const h=i.xRot/180*dn,[c,y]=fh([(e-o)/2,(t-u)/2],-h),p=Math.pow(c,2)/Math.pow(r,2)+Math.pow(y,2)/Math.pow(s,2);1<p&&(r*=Math.sqrt(p),s*=Math.sqrt(p)),i.rX=r,i.rY=s;const A=Math.pow(r,2)*Math.pow(y,2)+Math.pow(s,2)*Math.pow(c,2),T=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(s,2)-A)/A)),C=r*y/s*T,N=-s*c/r*T,O=fh([C,N],h);i.cX=O[0]+(e+o)/2,i.cY=O[1]+(t+u)/2,i.phi1=Math.atan2((y-N)/s,(c-C)/r),i.phi2=Math.atan2((-y-N)/s,(-c-C)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*dn),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*dn),i.phi1*=180/dn,i.phi2*=180/dn}function Bp(i,e,t){Qr(i,e,t);const r=i*i+e*e-t*t;if(0>r)return[];if(r===0)return[[i*t/(i*i+e*e),e*t/(i*i+e*e)]];const s=Math.sqrt(r);return[[(i*t+e*s)/(i*i+e*e),(e*t-i*s)/(i*i+e*e)],[(i*t-e*s)/(i*i+e*e),(e*t+i*s)/(i*i+e*e)]]}const Un=Math.PI/180;function Ip(i,e,t){return(1-t)*i+t*e}function Rp(i,e,t,r){return i+Math.cos(r/180*dn)*e+Math.sin(r/180*dn)*t}function Pp(i,e,t,r){const o=e-i,u=t-e,h=r-t,c=3*o+3*h-6*u,y=(u-o)*6,p=3*o;return Math.abs(c)<1e-6?Math.abs(y)<1e-6?[]:[-p/y]:_A(y/c,p/c,1e-6)}function Fp(i,e,t,r,s){const o=1-s,u=o*o*o,h=3*o*o*s,c=3*o*s*s,y=s*s*s;return i*u+e*h+t*c+r*y}function _A(i,e,t=1e-6){const r=i*i/4-e;if(r<-t)return[];if(r<=t)return[-i/2];const s=Math.sqrt(r);return[-(i/2)-s,-(i/2)+s]}function CA(i,e,t){i.cX||Lh(i,e,t);const r=i.xRot/180*dn;if(Math.abs(i.rX)<1e-10||Math.abs(i.rY)<1e-10)return[{relative:i.relative,type:V.CURVE_TO,x1:e+(i.x-e)/3,y1:t+(i.y-t)/3,x2:e+2*(i.x-e)/3,y2:t+2*(i.y-t)/3,x:i.x,y:i.y}];const s=Math.min(i.phi1,i.phi2),o=Math.max(i.phi1,i.phi2),u=o-s,h=Math.ceil(u/90),c=new Array(h);let y=e,p=t;const A=(T,C)=>{const[N,O]=fh([T*i.rX,C*i.rY],r);return[i.cX+N,i.cY+O]};for(let T=0;T<h;T++){const C=Ip(i.phi1,i.phi2,T/h),N=Ip(i.phi1,i.phi2,(T+1)/h),O=N-C,L=4/3*Math.tan(O*Un/4),P=Math.cos(C*Un)-L*Math.sin(C*Un),W=Math.sin(C*Un)+L*Math.cos(C*Un),q=Math.cos(N*Un),b=Math.sin(N*Un),Y=q+L*b,z=b-L*q,j=A(P,W),tt=A(Y,z),Q=A(q,b),K={relative:i.relative,type:V.CURVE_TO,x:Q[0],y:Q[1],x1:j[0],y1:j[1],x2:tt[0],y2:tt[1]};i.relative&&(K.x1-=y,K.y1-=p,K.x2-=y,K.y2-=p,K.x-=y,K.y-=p),y=Q[0],p=Q[1],c[T]=K}return c}function Xl(i,e,t){const r=e[0]-i[0],s=e[1]-i[1],o=t[0]-i[0],u=t[1]-i[1],h=r*u-s*o;if(!(Math.abs(h)<1e-10))return!1;const y=r*o+s*u,p=r*r+s*s,A=o*o+u*u;return 0<=y&&y<=A&&p<=A}function DA(i,e=!0){if(i.length<2)return i;const t=ae.INFO((o,u,h)=>{var c,y,p;return Uo(ys({},o),{x:(c=o.x)!=null?c:u,y:(y=o.y)!=null?y:h,relative:(p=o.relative)!=null?p:!1})}),r=[];let s=[];for(const o of i){const u=t(o);u.type===V.MOVE_TO&&s.length>0&&(e?r.push(...Yo(s)):r.unshift(...Yo(s)),s=[]),s.push(u)}return s.length>0&&(e?r.push(...Yo(s)):r.unshift(...Yo(s))),r}function Yo(i){var s;const e=((s=i[i.length-1])==null?void 0:s.type)===V.CLOSE_PATH,t=e?i.length-2:i.length-1,r=[{type:V.MOVE_TO,relative:!1,x:i[t].x,y:i[t].y}];for(let o=t;o>0;o--){const u=i[o],h=i[o-1];if(u.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(u.type){case V.HORIZ_LINE_TO:r.push({type:V.HORIZ_LINE_TO,relative:!1,x:h.x});break;case V.VERT_LINE_TO:r.push({type:V.VERT_LINE_TO,relative:!1,y:h.y});break;case V.LINE_TO:case V.MOVE_TO:r.push({type:V.LINE_TO,relative:!1,x:h.x,y:h.y});break;case V.CURVE_TO:r.push({type:V.CURVE_TO,relative:!1,x:h.x,y:h.y,x1:u.x2,y1:u.y2,x2:u.x1,y2:u.y1});break;case V.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case V.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case V.ARC:throw new Error("Unsupported command: A (arc)");case V.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&r.push({type:V.CLOSE_PATH}),r}function SA(i=1e13){Qr(i);function e(t){return Math.round(t*i)/i}return function(r){return"x1"in r&&typeof r.x1!="undefined"&&(r.x1=e(r.x1)),"y1"in r&&typeof r.y1!="undefined"&&(r.y1=e(r.y1)),"x2"in r&&typeof r.x2!="undefined"&&(r.x2=e(r.x2)),"y2"in r&&typeof r.y2!="undefined"&&(r.y2=e(r.y2)),"x"in r&&typeof r.x!="undefined"&&(r.x=e(r.x)),"y"in r&&typeof r.y!="undefined"&&(r.y=e(r.y)),"rX"in r&&typeof r.rX!="undefined"&&(r.rX=e(r.rX)),"rY"in r&&typeof r.rY!="undefined"&&(r.rY=e(r.rY)),r}}function rg(){return Kr((i,e,t)=>(i.relative&&(typeof i.x1!="undefined"&&(i.x1+=e),typeof i.y1!="undefined"&&(i.y1+=t),typeof i.x2!="undefined"&&(i.x2+=e),typeof i.y2!="undefined"&&(i.y2+=t),typeof i.x!="undefined"&&(i.x+=e),typeof i.y!="undefined"&&(i.y+=t),i.relative=!1),i))}function OA(){return Kr((i,e,t)=>(i.relative||(typeof i.x1!="undefined"&&(i.x1-=e),typeof i.y1!="undefined"&&(i.y1-=t),typeof i.x2!="undefined"&&(i.x2-=e),typeof i.y2!="undefined"&&(i.y2-=t),typeof i.x!="undefined"&&(i.x-=e),typeof i.y!="undefined"&&(i.y-=t),i.relative=!0),i))}function MA(i=!0,e=!0,t=!0,r=!0){return Kr((s,o,u,h,c)=>{if(isNaN(h)&&!(s.type&V.MOVE_TO))throw new Error("path must start with moveto");if(e&&s.type&V.HORIZ_LINE_TO&&(s.type=V.LINE_TO,s.y=s.relative?0:u),t&&s.type&V.VERT_LINE_TO&&(s.type=V.LINE_TO,s.x=s.relative?0:o),i&&s.type&V.CLOSE_PATH&&(s.type=V.LINE_TO,s.x=s.relative?h-o:h,s.y=s.relative?c-u:c),s.type&V.ARC&&(s.rX===0||s.rY===0)&&(s.type=V.LINE_TO,delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag),r&&s.type&V.QUAD_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x,u+s.y]:[s.x,s.y];Xl(y,p,A)&&(s.type=V.LINE_TO,delete s.x1,delete s.y1)}if(r&&s.type&V.CURVE_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x2,u+s.y2]:[s.x2,s.y2],T=s.relative?[o+s.x,u+s.y]:[s.x,s.y];Xl(y,p,T)&&Xl(y,A,T)&&(s.type=V.LINE_TO,delete s.x1,delete s.y1,delete s.x2,delete s.y2)}return s})}function ig(){let i=NaN,e=NaN,t=NaN,r=NaN;return Kr((s,o,u)=>(s.type&V.SMOOTH_CURVE_TO&&(s.type=V.CURVE_TO,i=isNaN(i)?o:i,e=isNaN(e)?u:e,s.x1=s.relative?o-i:2*o-i,s.y1=s.relative?u-e:2*u-e),s.type&V.CURVE_TO?(i=s.relative?o+s.x2:s.x2,e=s.relative?u+s.y2:s.y2):(i=NaN,e=NaN),s.type&V.SMOOTH_QUAD_TO&&(s.type=V.QUAD_TO,t=isNaN(t)?o:t,r=isNaN(r)?u:r,s.x1=s.relative?o-t:2*o-t,s.y1=s.relative?u-r:2*u-r),s.type&V.QUAD_TO?(t=s.relative?o+s.x1:s.x1,r=s.relative?u+s.y1:s.y1):(t=NaN,r=NaN),s))}function ng(){let i=NaN,e=NaN;return Kr((t,r,s)=>{if(t.type&V.SMOOTH_QUAD_TO&&(t.type=V.QUAD_TO,i=isNaN(i)?r:i,e=isNaN(e)?s:e,t.x1=t.relative?r-i:2*r-i,t.y1=t.relative?s-e:2*s-e),t.type&V.QUAD_TO){i=t.relative?r+t.x1:t.x1,e=t.relative?s+t.y1:t.y1;const o=t.x1,u=t.y1;t.type=V.CURVE_TO,t.x1=((t.relative?0:r)+o*2)/3,t.y1=((t.relative?0:s)+u*2)/3,t.x2=(t.x+o*2)/3,t.y2=(t.y+u*2)/3}else i=NaN,e=NaN;return t})}function Kr(i){let e=0,t=0,r=NaN,s=NaN;return function(u){if(isNaN(r)&&!(u.type&V.MOVE_TO))throw new Error("path must start with moveto");const h=i(u,e,t,r,s);return u.type&V.CLOSE_PATH&&(e=r,t=s),"x"in u&&typeof u.x!="undefined"&&(e=u.relative?e+u.x:u.x),"y"in u&&typeof u.y!="undefined"&&(t=u.relative?t+u.y:u.y),u.type&V.MOVE_TO&&(r=e,s=t),h}}function LA(i=0){Qr(i);let e=NaN,t=NaN,r=NaN,s=NaN;return Kr((o,u,h,c,y)=>{const p=Math.abs;let A=!1,T=0,C=0;if(o.type&V.SMOOTH_CURVE_TO&&(T=isNaN(e)?0:u-e,C=isNaN(t)?0:h-t),o.type&(V.CURVE_TO|V.SMOOTH_CURVE_TO)?(e=o.relative?u+o.x2:o.x2,t=o.relative?h+o.y2:o.y2):(e=NaN,t=NaN),o.type&V.SMOOTH_QUAD_TO?(r=isNaN(r)?u:2*u-r,s=isNaN(s)?h:2*h-s):o.type&V.QUAD_TO?(r=o.relative?u+o.x1:o.x1,s=o.relative?h+o.y1:o.y2):(r=NaN,s=NaN),o.type&V.LINE_COMMANDS||o.type&V.ARC&&(o.rX===0||o.rY===0||!o.lArcFlag)||o.type&V.CURVE_TO||o.type&V.SMOOTH_CURVE_TO||o.type&V.QUAD_TO||o.type&V.SMOOTH_QUAD_TO){const N=typeof o.x=="undefined"?0:o.relative?o.x:o.x-u,O=typeof o.y=="undefined"?0:o.relative?o.y:o.y-h;T=isNaN(r)?typeof o.x1=="undefined"?T:o.relative?o.x:o.x1-u:r-u,C=isNaN(s)?typeof o.y1=="undefined"?C:o.relative?o.y:o.y1-h:s-h;const L=typeof o.x2=="undefined"?0:o.relative?o.x:o.x2-u,P=typeof o.y2=="undefined"?0:o.relative?o.y:o.y2-h;p(N)<=i&&p(O)<=i&&p(T)<=i&&p(C)<=i&&p(L)<=i&&p(P)<=i&&(A=!0)}return o.type&V.CLOSE_PATH&&p(u-c)<=i&&p(h-y)<=i&&(A=!0),A?[]:o})}function vn(i,e,t,r,s,o){return Qr(i,e,t,r,s,o),Kr((u,h,c,y)=>{const p=u.x1,A=u.x2,T=u.relative&&!isNaN(y),C=typeof u.x!="undefined"?u.x:T?0:h,N=typeof u.y!="undefined"?u.y:T?0:c;u.type&V.HORIZ_LINE_TO&&e!==0&&(u.type=V.LINE_TO,u.y=u.relative?0:c),u.type&V.VERT_LINE_TO&&t!==0&&(u.type=V.LINE_TO,u.x=u.relative?0:h),typeof u.x!="undefined"&&(u.x=u.x*i+N*t+(T?0:s)),typeof u.y!="undefined"&&(u.y=C*e+u.y*r+(T?0:o)),typeof u.x1!="undefined"&&(u.x1=u.x1*i+u.y1*t+(T?0:s)),typeof u.y1!="undefined"&&(u.y1=p*e+u.y1*r+(T?0:o)),typeof u.x2!="undefined"&&(u.x2=u.x2*i+u.y2*t+(T?0:s)),typeof u.y2!="undefined"&&(u.y2=A*e+u.y2*r+(T?0:o));function O(P){return P*P}const L=i*r-e*t;if(typeof u.xRot!="undefined"&&(i!==1||e!==0||t!==0||r!==1))if(L===0)delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag,u.type=V.LINE_TO;else{const P=u.xRot*Math.PI/180,W=Math.sin(P),q=Math.cos(P),b=1/O(u.rX),Y=1/O(u.rY),z=O(q)*b+O(W)*Y,j=2*W*q*(b-Y),tt=O(W)*b+O(q)*Y,Q=z*r*r-j*e*r+tt*e*e,K=j*(i*r+e*t)-2*(z*t*r+tt*i*e),rt=z*t*t-j*i*t+tt*i*i,at=(Math.atan2(K,Q-rt)+Math.PI)%Math.PI/2,ct=Math.sin(at),pt=Math.cos(at);u.rX=Math.abs(L)/Math.sqrt(Q*O(pt)+K*ct*pt+rt*O(ct)),u.rY=Math.abs(L)/Math.sqrt(Q*O(ct)-K*ct*pt+rt*O(pt)),u.xRot=at*180/Math.PI}return typeof u.sweepFlag!="undefined"&&0>L&&(u.sweepFlag=+!u.sweepFlag),u})}function NA(i,e=0,t=0){Qr(i,e,t);const r=Math.sin(i),s=Math.cos(i);return vn(s,r,-r,s,e-e*s+t*r,t-e*r-t*s)}function BA(i,e=0){return Qr(i,e),vn(1,0,0,1,i,e)}function IA(i,e=i){return Qr(i,e),vn(i,0,0,e,0,0)}function RA(i){return Qr(i),vn(1,0,Math.tan(i),1,0,0)}function PA(i){return Qr(i),vn(1,Math.tan(i),0,1,0,0)}function FA(i=0){return Qr(i),vn(-1,0,0,1,i,0)}function kA(i=0){return Qr(i),vn(1,0,0,-1,0,i)}function HA(){return Kr((i,e,t)=>V.ARC===i.type?CA(i,i.relative?0:e,i.relative?0:t):i)}function UA(){return Kr((i,e,t)=>(i.relative&&(e=0,t=0),V.ARC===i.type&&Lh(i,e,t),i))}function sg(){return i=>ys({},i)}function qA(){const i=sg(),e=rg(),t=ng(),r=ig(),s=Kr((o,u,h)=>{const c=r(t(e(i(o))));function y(A){A>s.maxX&&(s.maxX=A),A<s.minX&&(s.minX=A)}function p(A){A>s.maxY&&(s.maxY=A),A<s.minY&&(s.minY=A)}if(c.type&V.DRAWING_COMMANDS&&(y(u),p(h)),c.type&V.HORIZ_LINE_TO&&y(c.x),c.type&V.VERT_LINE_TO&&p(c.y),c.type&V.LINE_TO&&(y(c.x),p(c.y)),c.type&V.CURVE_TO){y(c.x),p(c.y);const A=Pp(u,c.x1,c.x2,c.x);for(const C of A)0<C&&1>C&&y(Fp(u,c.x1,c.x2,c.x,C));const T=Pp(h,c.y1,c.y2,c.y);for(const C of T)0<C&&1>C&&p(Fp(h,c.y1,c.y2,c.y,C))}if(c.type&V.ARC){y(c.x),p(c.y),Lh(c,u,h);const A=c.xRot/180*Math.PI,T=Math.cos(A)*c.rX,C=Math.sin(A)*c.rX,N=-Math.sin(A)*c.rY,O=Math.cos(A)*c.rY,[L,P]=c.phi1<c.phi2?[c.phi1,c.phi2]:-180>c.phi2?[c.phi2+360,c.phi1+360]:[c.phi2,c.phi1],W=([Y,z])=>{const tt=Math.atan2(z,Y)*180/Math.PI;return tt<L?tt+360:tt},q=Bp(N,-T,0).map(W);for(const Y of q)Y>L&&Y<P&&y(Rp(c.cX,T,N,Y));const b=Bp(O,-C,0).map(W);for(const Y of b)Y>L&&Y<P&&p(Rp(c.cY,C,O,Y))}return o});return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}const ae={ROUND:SA,TO_ABS:rg,TO_REL:OA,NORMALIZE_HVZ:MA,NORMALIZE_ST:ig,QT_TO_C:ng,INFO:Kr,SANITIZE:LA,MATRIX:vn,ROTATE:NA,TRANSLATE:BA,SCALE:IA,SKEW_X:RA,SKEW_Y:PA,X_AXIS_SYMMETRY:FA,Y_AXIS_SYMMETRY:kA,A_TO_C:HA,ANNOTATE_ARCS:UA,CLONE:sg,CALCULATE_BOUNDS:qA,REVERSE_PATH:DA};class Gr{static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(e){var s;if(!((s=Wt.window)!=null&&s.document))throw new Error("environment not support");let t;e.containerId&&(t=Wt.window.document.getElementById(e.containerId)),t||(t=Wt.window.document.getElementsByTagName("body")[0]);let r;if(e.canvasId&&(r=Wt.window.document.getElementById(e.canvasId)||void 0),e.width||(e.width=(t==null?void 0:t.offsetWidth)||100),e.height||(e.height=(t==null?void 0:t.offsetHeight)||100),e.dpr||(e.dpr=Wt.dpr),r)this.resizeCanvas(r,e.width,e.height,e.dpr);else{if(r=this.createHtmlCanvas(e.width,e.height,e.dpr),!r)throw new Error("error environment");e.canvasId&&r.setAttribute("id",e.canvasId),t==null||t.appendChild(r)}return r.style.background=e.background||"transparent",r}static getContext2D(e,t={}){const r={alpha:!0,willReadFrequently:!!t.willReadFrequently},s=e.getContext("2d",r);if(!s)throw new Error("getContext2D error");return s.scale(t.dpr||1,t.dpr||1),s}static resizeCanvas(e,t,r,s=1){e instanceof OffscreenCanvas?(e.width=t,e.height=r):e instanceof HTMLCanvasElement&&(e.setAttribute("width",(t*s).toString()),e.setAttribute("height",(r*s).toString()),e.style.width=t+"px",e.style.height=r+"px",e.style.padding="0",e.style.margin="0",e.style.border="0",e.style.imageRendering="pixelated",e.style.transform="translateZ(0)")}static getImageBitmapByCanvasAsync(e){return Tt(this,null,function*(){if(e)return e instanceof OffscreenCanvas?e.transferToImageBitmap():e instanceof HTMLCanvasElement?yield createImageBitmap(e):void 0})}static get(e,t,r,s=1){let o=this.cached.get(e);return o||(o=this.create(t,r,s),this.set(e,o)),this.resizeCanvas(o,t,r,s),o}static set(e,t){if(!e||!t)throw new Error("error input");return this.cached.set(e,t)}static remove(e){this.cached.has(e)&&this.cached.delete(e)}static create(e,t,r=1){var s;if((s=Wt.window)!=null&&s.OffscreenCanvas)return new OffscreenCanvas(e,t);throw new Error("environment does not support")}static createHtmlCanvas(e,t,r=1){if(!Wt.window.document)throw new Error("environment does not support");const s=Wt.window.document.createElement("canvas");return this.resizeCanvas(s,e,t,r),s}static measureText(e,t,r=new k){if(!e)throw new Error("input error");const o=this.get("measureText",1,1).getContext("2d");if(!o)throw new Error("bufferCtx not found");t.render(o);const u=o.measureText(e);if(!u)throw new Error("measureText error");const h=u.actualBoundingBoxRight+u.actualBoundingBoxLeft,c=u.actualBoundingBoxAscent+u.actualBoundingBoxDescent;return r.set(h,c),r}}d(Gr,"cached",new Map),d(Gr,"cachedCanvas",new Map);let VA=0;class iu extends R{constructor(t={}){var r;super(t.commands);d(this,"name","Geo2");d(this,"id",++VA);d(this,"params");d(this,"viewMatrix",new ge);d(this,"boundingBox",new Mt);d(this,"flipY",!1);d(this,"renderPath");d(this,"_version",0);typeof t.flipY!="undefined"&&(this.flipY=!!t.flipY),this.params=t,(r=this.commands)!=null&&r.length&&this.toAbs(),t.flipY&&this.scale(1,-1)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}setFromPoints(t){return t!=null&&t.length?(this.params.points=t,this.recomputePath(),this):this}recomputePath(){throw new Error("must be implemented in derived")}computeBoundingBox(){var t;this.boundingBox.makeEmpty(),mt.identity();for(let r=0,s=((t=this.commands)==null?void 0:t.length)||0;r<s;r++){const o=this.commands[r];switch(o.type){case R.MOVE_TO:this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break;case R.LINE_TO:this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break;case R.ARC:typeof o.xRot=="undefined"?(this.boundingBox.expandByXY(o.x,o.y),Bi.set(o.x,o.y).addScalar(-o.rX),this.boundingBox.expandByPoint(Bi),Bi.set(o.x,o.y).addScalar(o.rX),this.boundingBox.expandByPoint(Bi)):this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break;case R.HORIZ_LINE_TO:this.boundingBox.expandByXY(o.x,mt.y),mt.set(o.x,mt.y);break;case R.VERT_LINE_TO:this.boundingBox.expandByXY(mt.x,o.y),mt.set(mt.x,o.y);break;case R.QUAD_TO:this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break}}return this.boundingBox}render(t,r){if(this.renderPath=new Path2D,!(!t||!(r!=null&&r.length))){mt.identity();for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s];switch(u.type){case R.MOVE_TO:this.renderPath.moveTo(u.x,u.y),mt.set(u.x,u.y);break;case R.LINE_TO:this.renderPath.lineTo(u.x,u.y),mt.set(u.x,u.y);break;case R.ARC:this.renderPath.arc(u.x,u.y,u.rX,u.phi1||0,u.phi2||Math.PI*2,u.sweepFlag!==1),mt.set(u.x,u.y);break;case R.HORIZ_LINE_TO:this.renderPath.lineTo(u.x,mt.y),mt.set(u.x,mt.y);break;case R.VERT_LINE_TO:this.renderPath.lineTo(mt.x,u.y),mt.set(mt.x,u.y);break;case R.CURVE_TO:this.renderPath.bezierCurveTo(u.x1,u.y1,u.x2,u.y2,u.x,u.y),mt.set(u.x,u.y);break;case R.SMOOTH_CURVE_TO:mt.set(u.x,u.y);break;case R.QUAD_TO:mt.set(u.x,u.y);break;case R.SMOOTH_QUAD_TO:mt.set(u.x,u.y);break}}}}applyMatrix(t){return this.needsUpdate=!0,this.matrix(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),this}getRenderCommands(t){var u;const r=[];for(let h=0,c=((u=this.commands)==null?void 0:u.length)||0;h<c;h++)r.push(Object.assign({},this.commands[h]));if(!t)return r;mt.identity();const s=ae.MATRIX(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),o=[];for(let h=0,c=r.length;h<c;h++){const y=r[h],p=s(y);if(p.type===R.ARC){let[A,T,C,N,O,L,P,W]=jE(mt.x,mt.y,p.x,p.y,p.lArcFlag,p.sweepFlag,p.rX,p.rY,0);if(mt.set(p.x,p.y),p.rX===p.rY&&typeof p.xRot!="undefined")p.x=A,p.y=T,p.rx=C>N?C:N,p.phi1=O,p.phi2=O+L;else if(p.rX===p.rY)t.getScale(Bi),p.rX=p.rY*Math.abs(Bi.x),(p.phi1!==0||p.phi2!==Math.PI*2)&&(t.getRotation(Bi),p.phi1+=Bi.x,p.phi2+=Bi.x);else{const q=JE(A,T,C,N,O,L,P);if(!(q!=null&&q.length))break;p.type=R.MOVE_TO,p.x=A,p.y=T;for(let b=0,Y=q.length;b<Y;b++)o.push({type:R.CURVE_TO,x1:q[b][1][0],y1:q[b][1][1],x2:q[b][2][0],y2:q[b][2][1],x:q[b][3][0],y:q[b][3][1]})}}else mt.set(p.x||mt.x,p.y||mt.y);Array.isArray(p)?o.push(...p):o.push(p)}return o}copy(t){return this.commands=It.cloneDeep(t.commands),this.version=0,this}clone(){const t=this.constructor;return new t(this.params).copy(this)}getConvexHull(){var r,s;const t=[];if(!((r=this.commands)!=null&&r.length))return t;for(let o=0,u=((s=this.commands)==null?void 0:s.length)||0;o<u;o++){const h=this.commands[o];switch(h.type){case R.MOVE_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.LINE_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.ARC:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.HORIZ_LINE_TO:t.push({x:h.x,y:mt.y}),mt.set(h.x,mt.y);break;case R.VERT_LINE_TO:t.push({x:mt.x,y:h.y}),mt.set(mt.x,h.y);break;case R.CURVE_TO:case R.SMOOTH_CURVE_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.QUAD_TO:case R.SMOOTH_QUAD_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break}}return t}isPointInBoundingBox(t){return this.boundingBox?this.boundingBox.containsPoint(t):!1}isPointInPath(t){if(this.renderPath){ln.save(),ln.beginPath(),ln.lineWidth=5,ln.stroke(this.renderPath),ln.fill(this.renderPath),ln.closePath();const r=ln.isPointInPath(this.renderPath,t.x,t.y);return ln.restore(),r}return!1}}const mt=new k,Bi=new k,WA=Gr.get("RAY_CASTER",10,10),ln=WA.getContext("2d");class zA extends iu{constructor(t={}){t.commands||(t.commands=[]);super(t);d(this,"isCircle",!0);d(this,"radius",1);d(this,"start",0);d(this,"end",Math.PI*2);typeof t.radius!="undefined"&&(this.radius=t.radius),typeof t.start!="undefined"&&(this.start=t.start),typeof t.end!="undefined"&&(this.end=t.end),this.recomputePath()}recomputePath(){var s,o,u;if(!((o=(s=this.params)==null?void 0:s.points)!=null&&o.length))return this;const t=this.params.points,r=[];for(let h=0,c=t.length;h<c;h++)r.push({type:R.MOVE_TO,x:t[h].x+this.radius,y:t[h].y*(this.params.flipY?-1:1),relative:!1}),r.push({type:R.ARC,rX:this.radius,rY:this.radius,xRot:void 0,lArcFlag:0,sweepFlag:((u=this.params)==null?void 0:u.sweepFlag)||1,phi1:this.start,phi2:this.end,x:t[h].x,y:t[h].y*(this.params.flipY?-1:1),relative:!1});return this.commands=r,this}}class ag{constructor(e={}){d(this,"params");this.params=e}destroy(){}static getInstanceByElement(e,t=!1){if(!e)return;let r;switch(e.nodeName){case"path":r=this.getInstanceByPath(e,t);break;case"circle":r=this.getInstanceByCircle(e,t);break}return r||console.error(`unsupported: ${e}`),r}static getInstanceByPath(e,t=!1){if(!e)return;const r=Ta(e,"d");if(!r)return;const s=r.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""),o=s.match(/([Mm][^Mm]*)/g);if(!o||o.length<=this.splitLimit)try{return new iu({commands:s,flipY:t})}catch(h){console.error(`getInstanceByPath error: ${h}: ${s}`);return}const u=[];for(let h=0,c=o.length;h<c;h+=this.splitLimit){const p=o.slice(h,h+this.splitLimit).join(" ");try{u.push(new iu({commands:p,flipY:t}))}catch(A){console.error(`getInstanceByPath error: ${A}`)}}return u}static getInstanceByCircle(e,t=!1){if(!e||e.nodeName!=="circle")return;kp.set(Ta(e,"cx",0),Ta(e,"cy",0));const r=Ta(e,"r",0);return new zA({points:[kp.clone()],radius:r,flipY:t})}static getInstance(e,t=!1){if(e)return new iu({commands:e,flipY:t})}}d(ag,"splitLimit",100);const kp=new k;class $A{constructor(){d(this,"svg");d(this,"offset",new k);d(this,"svgRoot");d(this,"layers",[]);d(this,"elementsMap",{});d(this,"boundingBoxMap",{});d(this,"boundingBox",new Mt);d(this,"svgSkeletons",[]);d(this,"data");d(this,"_exceptTypes",["view"]);d(this,"_exceptIds",["viewer","mirror"]);d(this,"_lvi",0);d(this,"_lastLinked",[])}bindSvg(e){return this.svg=e,this.svgRoot=$d(this.svg),this.layers=this.getLayers(2),this.elementsMap={},this.boundingBoxMap={},this.boundingBox.makeEmpty(),this.getElementsMap(this.svg,this.elementsMap),this}getLayers(e){var t;if(!this.svg)throw new Error("please bind svg first");return e===2&&((t=this.layers)!=null&&t.length)?this.layers:(this.layers=this._getSvgLayer(this.svg,e),this.layers)}_getSvgLayer(e,t=0,r=0,s=[]){var h;let o,u=e.id;if(this._exceptTypes.includes(e.tagName)||e.tagName==="defs")return this._lvi--,s;if(t&&this._lvi>t)return s;u&&!this._exceptIds.includes(u)&&(o={value:u,label:u,children:[]},s.push(o)),this._lvi++;for(let c=0,y=e.children.length;c<y;c++)o?this._getSvgLayer(e.children[c],t,this._lvi,o.children):this._getSvgLayer(e.children[c],t,this._lvi,s);return((h=o==null?void 0:o.children)==null?void 0:h.length)===0&&delete o.children,this._lvi=r,s}getElementsMap(e,t={}){return this.traverseSvg(e,r=>{r!==e&&r.id&&(t[r.id]=r)}),t}computeBoundingBoxMap(){var t;if(Object.keys(this.boundingBoxMap).length)return this.boundingBoxMap;let e=(t=this.svg)==null?void 0:t.getBoundingClientRect();return e&&this.offset.set(e.left,e.top),this.traverseSvg(this.svg,r=>{if(!r.id)return;if(r.tagName==="use"){const u=this.getUseSymbolId(r);if(!u)return;const h=this.boundingBoxMap[u];if(h&&!h.isEmpty()){Ii.set(Number(r.getAttribute("x")||"0"),Number(r.getAttribute("y")||"0")),Xo.composeSvgTransform(Ii.x,Ii.y,r.getAttribute("transform"));const p=new Mt().copy(h).applyMatrix3(Xo);this.boundingBoxMap[r.id]=p;return}const c=this.getUseElementBoundingBoxWithSymbol(r);if(!c)return;this.boundingBoxMap[u]=c,Ii.set(Number(r.getAttribute("x")||"0"),Number(r.getAttribute("y")||"0")),Xo.composeSvgTransform(Ii.x,Ii.y,r.getAttribute("transform"));const y=new Mt().copy(c).applyMatrix3(Xo);this.boundingBoxMap[r.id]=y,this.boundingBox.expandByBox(y);return}if(typeof r.getBBox!="function")return;const s=r.getBBox();if((!s.width||!s.height)&&r.tagName==="path"){const u=ag.getInstanceByPath(r);if(!Array.isArray(u)){const h=u==null?void 0:u.computeBoundingBox();if(!h||h.isEmpty())return;h.getSize(Ii),s.x=h.min.x,s.y=h.max.y,s.width=Ii.x,s.height=Ii.y}}if(!s.width||!s.height)return;const o=new Mt(new k(s.x,s.y),new k(s.x+s.width,s.y+s.height));this.boundingBoxMap[r.id]=o.round(),this.boundingBox.expandByBox(o)}),this.boundingBoxMap}getLayerVisible(e){var r;const t=this.getElementById(e);if(t)return((r=t.style)==null?void 0:r.display)!=="none"}updateLayersVisibility(e,t=!1,r=!0){if(!this.elementsMap)throw new Error("please bind svg first");r&&this._updateAllLayersVisibility(!t),e!=null&&e.length||(e=["background"]);for(let s=0,o=e.length;s<o;s++){const u=this.getElementById(e[s]);u&&this._updateLayersVisibility(u,t,!0,!0)}}_updateAllLayersVisibility(e=!1){Object.values(this.elementsMap).forEach(t=>{t.tagName==="svg"||t.tagName==="symbol"||!t.getAttribute("id")||(t.style.display=e?"block":"none")})}_updateLayersVisibility(e,t=!1,r=!1,s=!1){var o,u;if(!(!e||e.tagName==="svg"||!e.getAttribute("id"))){if(e.style.display=t?"block":"none",r&&t){let h=e.parentElement;for(;h&&h.tagName!=="svg";)h.style.display=t?"block":"none",h=h.parentElement}if(s&&((o=e.children)==null?void 0:o.length)>0)for(let h=0,c=(u=e.children)==null?void 0:u.length;h<c;h++)this._updateLayersVisibility(e.children[h],t,!1,!0)}}updateVisibilityByAssetType(e,t=!1,r){r||(r=Wd[e]),this.updateLayersVisibility(r,!t)}updateVisibilityByAssetTypes(e,t=!1,r){if(Array.isArray(e)||(e=[e]),!!(e!=null&&e.length))for(let s=0,o=e.length;s<o;s++)this.updateVisibilityByAssetType(e[s],t,r)}getElementById(e){if(!this.elementsMap)throw new Error("please bind svg first");return this.elementsMap[e]}getElementBoundingBox(e){return this.boundingBoxMap[e]}findSkeletonByPath(e=[]){let t=0,r;const s=Object.keys(this.elementsMap);for(let o=0,u=s.length;o<u;o++){const h=this.elementsMap[s[o]];if(!h)continue;const c=h.getAttribute("d");c&&(c.length<t||(t=c.length,r=h.id?h:h.parent))}return r&&e.push(r),e}setTextInChildren2(e,t){var s;let r;((s=e==null?void 0:e.children)==null?void 0:s.length)<2?(r=Vl("text"),r.setAttribute("dy","1em"),e.appendChild(r)):r=e.children[e.children.length-1],r.innerHTML=t}traverseSvg(e,t){var r;if(!this._exceptTypes.includes(e.tagName)&&!(e.tagName!=="svg"&&e.tagName!=="defs"&&!e.id)&&!(e.tagName==="g"&&((r=e.children)==null?void 0:r.length)===0)){this._exceptIds.includes(e.id)||t(e);for(let s=0,o=e.children.length;s<o;s++)this.traverseSvg(e.children[s],t)}}traverseSvgTLayers(e,t){var r;if(Array.isArray(e)){for(let s=0,o=e.length;s<o;s++)this.traverseSvgTLayers(e[s],t);return}if(t(e),!!((r=e.children)!=null&&r.length))for(let s=0,o=e.children.length;s<o;s++)this.traverseSvgTLayers(e.children[s],t)}getLabelElementsByType(e,t={}){const r=this.getElementById(_a(e));return r&&this.getElementsMap(r,t),t}getLabelElementById(e,t="rm"){if(!e)return;const r=this.getElementById(e);if(!r)return;let s=r.getAttribute("aid");return s||(s="l-"+t+"-"+e),this.getElementById(s)}setLabelsById(e,t,r="rm"){var u,h;const s=this.getLabelElementById(e,r);if(!s)return;const o=((u=s.children)==null?void 0:u.length)||0;for(let c=0,y=((t==null?void 0:t.length)||0)-(o-1);c<y;c++){const p=Vl("text");p.setAttribute("x","0"),p.setAttribute("y",o+c+"em"),s.appendChild(p)}for(let c=1,y=(h=s.children)==null?void 0:h.length;c<y;c++)s.children[c].textContent=t&&c<=t.length?t[c-1]:""}clearAssetLabelsByType(e="rm"){var s;const t=this.getLabelElementsByType(e),r=It.keys(t);for(let o=0,u=r.length;o<u;o++){const h=t[r[o]];for(let c=1,y=((s=h.children)==null?void 0:s.length)||0;c<y;c++)h.children[c].textContent=""}}getUseSymbolId(e){var t;if(!(!e||e.tagName!=="use"))return(t=e.getAttribute("xlink:href"))==null?void 0:t.substring(1)}getUseSymbol(e){if(!e||e.tagName!=="use")return;const t=this.getUseSymbolId(e);if(t)return this.getElementById(t)}setElementState2selected(e,t=!1){var s;if(!e)return;if(e.tagName==="use"){const o=this._getSymbolBox(e);if(!o)return;t?(s=e.parentNode)==null||s.insertBefore(o,e):e.parentNode&&e.parentNode.contains(o)&&e.parentNode.removeChild(o);return}let r=e.getAttribute("class");r||(r=""),t?r="danger":r=It.replace(r,"danger","").trim(),e.setAttribute("class",r)}_getSymbolBox(e){if(!e)return;const t=e.id+"-boundingBox";let r=this.getElementById(t);if(r)return r;const s=this.getUseSymbol(e);if(!s)return;let o=this.getElementBoundingBox(e.id);if(!o||o.isEmpty())return;r=document.createElementNS("http://www.w3.org/2000/svg","rect"),r.setAttribute("id",t),r.setAttribute("class","danger"),r.setAttribute("x",o.min.x.toString()),r.setAttribute("y",o.min.y.toString());const u=new k;return o.getSize(u),r.setAttribute("width",u.x.toString()),r.setAttribute("height",u.y.toString()),s.getAttribute("transform")&&r.setAttribute("transform",s.getAttribute("transform")||""),s.getAttribute("style")&&r.setAttribute("style",s.getAttribute("style")||""),this.elementsMap[t]=r,r}getUseElementBoundingBoxWithSymbol(e){var c;if(!e)return;const t=(c=e.getAttribute("xlink:href"))==null?void 0:c.substring(1);if(!t)return;let r=this.getElementById(t);if(!r)return;const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px";let o;if(It.lowerCase(r.tagName)==="symbol"){o=document.createElementNS("http://www.w3.org/2000/svg","g");for(let y=0,p=r.childNodes.length;y<p;y++){const A=r.childNodes[y].cloneNode(!0);o.appendChild(A)}}else o=r.cloneNode(!0);s.appendChild(o),o.setAttribute("style","stroke: #333333;"),document.body.appendChild(s);const u=s.getBBox();if(document.body.removeChild(s),!u)return;const h=new Mt;return h.set(new k(u.x,u.y),new k(u.x+u.width,u.y+u.height)),h}fontZoom(e,t=1){const r=this.getElementById(e);if(!r)return;let s=r.getAttribute("font-size");s||(s="12");const o=/(\d+)([a-zA-Z%]+)/.exec(s),u=o&&(o==null?void 0:o.length)>2?o[2]:"";let h=Math.round(parseFloat(s)*t*100)/100;r.setAttribute("font-size",h+u)}strokeWidthChanged(e=1){var c;const t=(c=this.svg)==null?void 0:c.querySelector("#mirror");if(!t){console.error("Cannot find g SVGElement with ID mirror");return}let r=Ta(t,"stroke-width"),s,o="";if(typeof r=="string"){const y=r.match(/^(\d+(\.\d+)?)(\w*)$/);if(y)s=parseFloat(y[1]),o=y[3]||"px";else{console.error("Invalid stroke-width value:",r);return}}else{console.error("Invalid stroke-width type:",typeof r);return}const h=`${s*e}${o}`;t.setAttribute("stroke-width",h)}getCentroid(e,t=new k){const r=e.getAttribute("insX"),s=e.getAttribute("insY");return r||s?t.set(Number(r||"0"),Number(s||"0")):this.getCentroidByDom(e,t)}getCentroidByDom(e,t=new k){const r=Number(e.getAttribute("x")||"0"),s=Number(e.getAttribute("y")||"0"),o=e.getBBox();let u=1,h=1,c=e.getAttribute("transform");if(!c)return t.set(r,s);const y=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(c);if(typeof y=="undefined"||y==null){const p=e.transform.baseVal;if(c&&p.numberOfItems>0){let A=p.getItem(0);A&&A.type===SVGTransform.SVG_TRANSFORM_SCALE&&(u=A.matrix.a!==0?A.matrix.a:1,h=A.matrix.d!==0?A.matrix.d:u)}else return t.set((o.x+o.width/2)*u,(o.y+o.height/2)*h)}else u=y[1]&&Number(y[1])>0?Number(y[1]):1,h=y[2]&&Number(y[2])>0?Number(y[2]):u;return r&&s?t.set(r*u,s*h):t.set((o.x+o.width/2)*u,(o.y+o.height/2)*h),t}linkAssetsByTree(e,t){if(e||(e=er.RM),this.clearLinkedLines(e),!t||!t.value)return;const r=this.getLinesByTree(t);this.drawLinkedLines(e,r)}clearLinkedLines(e){var s;const t=Ds(e);if(this.getElementById(t)){for(let o=((s=this._lastLinked)==null?void 0:s.length)-1;o>=0;o--){const u=this._lastLinked[o];u.parentNode&&u.parentNode.removeChild(u),this._lastLinked.splice(o,1)}this._lastLinked.length=0}}drawLinkedLines(e,t){var o;if(!(t!=null&&t.length))return;const r=Ds(e),s=this.getElementById(r);if(s)for(let u=0,h=t.length;u<h;u++){const c=t[u][0],y=t[u][((o=t[u])==null?void 0:o.length)-1],p=Vl("line");p.setAttribute("x1",c.x.toString()),p.setAttribute("y1",c.y.toString()),p.setAttribute("x2",y.x.toString()),p.setAttribute("y2",y.y.toString()),p.setAttribute("class","danger"),p.setAttribute("style","stroke-width: 2;"),s.appendChild(p),this._lastLinked.push(p)}}getLinesByTree(e,t=[]){var o;if(!(e!=null&&e.value))return t;const r=this.getElementBoundingBox(e.value);if(!r)return t;const s=r.getCenter();return(o=e.children)==null||o.forEach(u=>{var y;const h=this.getElementBoundingBox(u==null?void 0:u.value);if(!h)return;const c=h.getCenter();t.push([s,c]),(y=u.children)!=null&&y.length&&this.getLinesByTree(u,t)}),t}}const Ii=new k,Xo=new ge;class GA{constructor(e={},t){d(this,"name","SvgPainter");d(this,"params");d(this,"chef");this.params=e,this.chef=t}drawSocialDistanceCircles(e,t="http://www.w3.org/2000/svg"){var C,N,O;if(!e)return;const r=PE(e),s=zd(e),o=2*r,u=(N=(C=this.params.socialDistance)==null?void 0:C.colors)!=null&&N.length?(O=this.params.socialDistance)==null?void 0:O.colors:[Qt.green,Qt.red],h=this.getRadius(s),c=e.querySelector(`#${hh}`),y=c==null?void 0:c.querySelectorAll("path");if(!c||!(y!=null&&y.length))return;let p,A;const T=new Array;for(let L=0,P=(y==null?void 0:y.length)||0;L<P;L++){if(p=y[L],A=p.getAttribute("id"),!A)continue;const W=this.chef.getElementBoundingBox(A);if(!W)continue;const q=new k;W.getCenter(q),T.push({id:A,cp:q})}for(let L=0,P=T.length;L<P;L++){T[L].color=u[0];for(let W=0,q=P;W<q;W++)T[L]!==T[W]&&k.getDistance(T[L].cp,T[W].cp)<h*2&&(T[L].color=u[1])}for(let L=0,P=T.length;L<P;L++){let W=this.createCircle(T[L],h,o,t);c.appendChild(W)}}clearSocialDistanceCircles(e){if(!e)return;const t=e.querySelector(`#${hh}`),r=t==null?void 0:t.querySelectorAll("circle");if(!(!t||!(r!=null&&r.length)))for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s].getAttribute("id");u&&(u==null?void 0:u.indexOf("_circle"))>-1&&t.removeChild(r[s])}}getRadius(e){var r,s,o;let t=((s=(r=this.params)==null?void 0:r.socialDistance)==null?void 0:s.radius)||3;return((o=this.params)==null?void 0:o.displayUnits)==="imperial"?e==="Metres"||e==="m"?t/=3.28084:e==="cm"?t=t/3.28084*100:e==="mm"?t=t/3.28084*1e3:(e==="INCH"||e==="inches")&&(t*=12):e==="INCH"||e==="inches"?t=t*3.28084*12:e==="cm"?t*=100:e==="mm"&&(t*=1e3),t}createCircle(e,t,r,s){const o=document.createElementNS(s,"circle");return o.setAttributeNS(null,"id",e.id+"_circle"),o.setAttributeNS(null,"cx",e.cp.x),o.setAttributeNS(null,"cy",e.cp.y),o.setAttributeNS(null,"r",String(t)),o.setAttributeNS(null,"style",`pointer-events:none;fill-opacity:0.1;stroke:${e.color};stroke-width:${r}px;`),o}}const YA=function(i){return(i||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")};function Eu(i,e){if(!i||!e)return!1;if(e.indexOf(" ")!==-1)throw new Error("className should not contain space.");return i.classList?i.classList.contains(e):(" "+i.className+" ").indexOf(" "+e+" ")>-1}function Na(i,e){if(!i)return;let t=i.className;const r=(e||"").split(" ");for(let s=0,o=r.length;s<o;s++){const u=r[s];u&&(i.classList?i.classList.add(u):Eu(i,u)||(t+=" "+u))}i.classList||(i.className=t)}function Ba(i,e){if(!i||!e)return;const t=e.split(" ");let r=" "+i.className+" ";for(let s=0,o=t.length;s<o;s++){const u=t[s];u&&(i.classList?i.classList.remove(u):Eu(i,u)&&(r=r.replace(" "+u+" "," ")))}i.classList||(i.className=YA(r))}class Nh extends YE{constructor(t={}){super();d(this,"isSvgScene",!0);d(this,"name","SvgScene");d(this,"dynamically",!0);d(this,"params");d(this,"socialDistanceEnable",!1);d(this,"container");d(this,"svg");d(this,"svgStr","");d(this,"svgRoot");d(this,"viewBox",new Mt);d(this,"chef");d(this,"defaultLayers",[]);d(this,"skeletonLayers",[]);d(this,"currentLayers",[]);d(this,"assetType");d(this,"assetsMap",{});d(this,"legend",[]);d(this,"selectedList",[]);d(this,"painter");d(this,"_lastHighlightType","");d(this,"_lastHighlightIds",[]);d(this,"clickSvgElementHandler",this.handleClickSvgElement.bind(this));d(this,"_lastLinkedIds",[]);this.params=t,this.assetType=t.assetType||er.RM,this.params.socialDistanceEnable&&(this.socialDistanceEnable=!0),this.container=this.params.containerId?document.getElementById(this.params.containerId):Wt.window.document.getElementsByTagName("body")[0],this.chef=new $A,this.painter=new GA(t,this.chef)}get isMounted(){var t;return((t=this.container.querySelectorAll("svg"))==null?void 0:t.length)>0}destroy(){var t;super.destroy(),this.unmount(),(t=this.camera)==null||t.destroy()}mount(){this.svg&&(this.container.contains(this.svg)||this.container.appendChild(this.svg),this.chef.computeBoundingBoxMap())}unmount(){this.svg&&this.svg.parentNode&&this.container.contains(this.svg)&&this.container.removeChild(this.svg)}computeBoundingBox(){return this.boundingBox.makeEmpty(),!this.chef||!this.svg?this.boundingBox:(this.chef.computeBoundingBoxMap(),this.boundingBox.copy(this.chef.boundingBox),console.warn("svgScene.computeBoundingBox: ",this.chef.boundingBox.toString()),this.boundingBox)}load(t){return Tt(this,null,function*(){return new Zd().loadAsync(t)})}bind(t){this.svgStr=t;const r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;return this.bindSvg(r),!0}bindSvg(t){if(this.svg=t,!this.svg)throw new Error("svg load failed");let r=this.svg.getAttribute("viewBox");r&&(FE(r,this.viewBox),this.chef.bindSvg(this.svg),this.svgRoot=$d(this.svg),this.svg.setAttribute("viewBox",`0 0 ${this.params.width} ${this.params.height}`),this.svg.setAttribute("style","transform: translateZ(0);"),this.appendStyles(),console.log(this.name,"viewBox -> ",r,this.viewBox.toString()),this.setAssetsMap(this.assetType,this.assetsMap))}recompute(t){t&&(this.bindSvg(t),this.computeBoundingBox(),this.viewBox.copy(this.boundingBox))}appendStyles(){var r;let t=(r=this.svg)==null?void 0:r.querySelector("style");t&&(t.appendChild(document.createTextNode(`.default { stroke: ${this.params.defaultStroke}; fill: ${this.params.defaultFill}; }`)),t.appendChild(document.createTextNode(`.info { stroke: ${this.params.infoStroke}; fill: ${this.params.infoFill}; }`)),t.appendChild(document.createTextNode(`.primary { stroke: ${this.params.primaryStroke}; fill: ${this.params.primaryFill}; }`)),t.appendChild(document.createTextNode(`.success { stroke: ${this.params.successStroke}; fill: ${this.params.successFill}; }`)),t.appendChild(document.createTextNode(`.warning { stroke: ${this.params.warningStroke}; fill: ${this.params.warningFill}; }`)),t.appendChild(document.createTextNode(`.danger { stroke: ${this.params.dangerStroke}; fill: ${this.params.dangerFill}; }`)),t.appendChild(document.createTextNode(`.active { stroke: ${this.params.activeStroke}; fill: ${this.params.activeFill}; }`)),t.appendChild(document.createTextNode(`text { font-family: ${this.params.fontFamily||"simhei"}; }`)))}getLayers(t=2){return this.svg?this.chef.getLayers(t):[]}setDefaultLayers(t){t!=null&&t.length&&(this.defaultLayers=t)}setSkeletonLayers(t){t!=null&&t.length&&(this.skeletonLayers=t)}setCurrentLayers(t){t!=null&&t.length&&(this.currentLayers=t)}showDefaultLayers(t,r=!1){this.setDefaultLayers(t),this.chef.updateLayersVisibility(t,r)}getLayerVisible(t){return this.chef.getLayerVisible(t)}updateLayersVisibility(t,r=!1,s=!0){this.chef.updateLayersVisibility(t,r,s)}setAssetType(t,r){this.assetsMap={},this.assetType=t,this.setAssetsMap(this.assetType,this.assetsMap),r||(r=[Ds(t)],t!==er.RM&&r.unshift(Ds(er.RM))),this.setDefaultLayers(r),this.updateLayersVisibility(this.defaultLayers,!0)}isBelongsToAssetType(t,r){r||(r=this.assetType);const s=this.getAssetsByType(r);return s?!!(s!=null&&s.hasOwnProperty(t)):!1}setAssetsMap(t,r={}){const s=this.chef.getElementById(Ds(t));if(!s)return r;r[t]=this.chef.getElementsMap(s);const o=_a(t),u=this.chef.getElementById(o);if(!u)return r;const h=this.chef.getElementsMap(u),c=It.keys(h);if(!(c!=null&&c.length))return r;if(It.startsWith(c[0],`l-${t}-`)){const y=`l-${t}-`.length;for(let p=0,A=c.length;p<A;p++){const T=c[p].slice(y);h[T]=h[c[p]],delete h[c[p]]}}return r[o]=h,r}getAssetsByType(t){return this.assetsMap.hasOwnProperty(t)||this.setAssetsMap(t,this.assetsMap),this.assetsMap[t]}getElementById(t){if(!t)return;const r=this.getAssetsByType(this.assetType);if(!(!r||!Object.hasOwnProperty.call(r,t)))return r[t]}getAssetIdsByType(t){const r=this.getAssetsByType(t),s=[];return r?It.keys(r):s}clearFillOrStroke(t="fill"){const r=this.getAssetsByType(this.assetType);if(!r)return;const s=It.keys(r);let o;for(let u=0,h=s.length;u<h;u++)o=r[s[u]],o&&(o.hasAttribute(t)&&o.removeAttribute(t),t==="stroke"&&o.removeAttribute("stroke-width"));this.clearLegendBy(t)}clearFillOrStrokeByIds(t,r="fill"){const s=this.getAssetsByType(this.assetType);if(!s)return;const o=It.keys(s);let u;for(let h=0,c=o.length;h<c;h++)t!=null&&t.length&&!t.includes(o[h])||(u=s[o[h]],!(!u||!u.hasAttribute(r))&&(u.removeAttribute(r),r==="stroke"&&u.removeAttribute("stroke-width")));this.clearLegendBy(r)}setFillOrStrokeByIds(t,r,s="fill",o="7em"){const u=this.getAssetsByType(this.assetType);if(!u)return;const h=It.keys(u);let c;for(let y=0,p=h.length;y<p;y++)t.includes(h[y])&&(c=u[h[y]],c&&(c.setAttribute(s,r),s==="stroke"&&c.setAttribute("stroke-width",o),this.addLegend(s,r,h[y])))}addLegend(t,r,s){let o=this.legend.find(u=>u.color===r);o||(o={type:t,color:r,ids:[]},this.legend.push(o)),o.ids.push(s)}clearLegendBy(t){var r;t||(this.legend.length=0);for(let s=((r=this.legend)==null?void 0:r.length)-1;s>=0;s--)this.legend[s].type===t&&this.legend.splice(s,s)}getLegend(){return this.legend}showSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.defaultLayers,!1),this.chef.updateLayersVisibility(this.skeletonLayers,!0))}hideSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.skeletonLayers,!1),this.chef.updateLayersVisibility(this.defaultLayers,!0))}setAssetLabels(t,r){this.chef.setLabelsById(t,r,this.assetType)}getAssetLabelsMap(t){var o,u;if(!t)return;const r=_a(t);let s=this.getAssetsByType(r);if(!s||!((o=Object.keys(s))!=null&&o.length)){let h=this.chef.getElementById(r);if(h||(h=this.chef.getElementById(t+"-txt-label")),!h)return;s=this.chef.getElementsMap(h),this.assetsMap[r]=s}if(!(!s||!((u=Object.keys(s))!=null&&u.length)))return s}getAssetLabelById(t,r){var h,c;const s=this.getAssetLabelsMap(t);if(!s)return;let o=s[r];if(o&&((h=o==null?void 0:o.childNodes)!=null&&h.length))return o.childNodes[0].textContent||"";const u="l-"+t+"-"+r;if(o=s[u],o&&((c=o==null?void 0:o.children)!=null&&c.length))return o.children[0].textContent||""}clearAssetLabels(){this.chef.clearAssetLabelsByType(this.assetType)}bindAssetsEvents(t){var o;const r=(o=this.svg)==null?void 0:o.querySelector("#"+t);if(!r)return;r.querySelectorAll("[id]").forEach(u=>{u instanceof SVGElement&&u.addEventListener("click",this.clickSvgElementHandler)})}handleClickSvgElement(t){var r;typeof t.preventDefault=="function"&&t.preventDefault(),console.warn("svgScene.handleClickSvgElement: ",(r=t==null?void 0:t.target)==null?void 0:r.id,t==null?void 0:t.target),this.dispatchEvent({type:"click",data:t})}socialDistanceEnableChanged(t){this.socialDistanceEnable=!!t,t?this.painter.drawSocialDistanceCircles(this.svg):this.painter.clearSocialDistanceCircles(this.svg)}highlightAssets(t,r){var o;this.resetHighlightAssets(t);const s=this.getAssetsByType(t);!s||!((o=Object.keys(s))!=null&&o.length)||(this._lastHighlightType=t,this._lastHighlightIds=Array.isArray(r)?r:[r],this._lastHighlightIds.forEach(u=>{u&&s[u]&&Na(s[u],"active")}))}resetHighlightAssets(t){var s;const r=this.getAssetsByType(t||this._lastHighlightType);!r||!((s=Object.keys(r))!=null&&s.length)||(this._lastHighlightIds.forEach(o=>{o&&r[o]&&Ba(r[o],"active")}),this._lastHighlightIds.length=0)}getIntersectObjects(t,r=er.RM,s=[]){s.length=0;const o=[],u=this.getAssetsByType(r);if(!u)return s;const h=It.keys(u);for(let y=0,p=h.length;y<p;y++){const A=this.chef.getElementBoundingBox(u[h[y]].id);A&&A.containsPoint(t.worldCoords)&&o.push(u[h[y]])}const c=It.sortBy(o,y=>{var p;return(p=this.chef.getElementBoundingBox(y.id))==null?void 0:p.getArea()});return s.push(...c),s}clearSelected(){var t,r;if((t=this.selectedList)!=null&&t.length)for(let s=((r=this.selectedList)==null?void 0:r.length)-1;s>=0;s--){let o=this.selectedList[s];this.selectedList.splice(s,1),this.chef.setElementState2selected(o,!1)}}clearSelectedById(t){var s,o;let r=(s=this.selectedList)==null?void 0:s.findIndex(u=>u.getAttribute("id")===t);r>-1&&(this.chef.setElementState2selected(this.selectedList[r],!1),(o=this.selectedList)==null||o.splice(r||0,1))}selectByIds(t,r=!1){Array.isArray(t)||(t=[t]),r||this.clearSelected();const s=It.uniq(It.map(this.selectedList,u=>u.getAttribute("id")||"")),o=this.getAssetsByType(this.assetType);if(o){for(let u=t.length-1;u>=0;u--)s.includes(t[u])?(this.clearSelectedById(t[u]),t.splice(u,1)):Object.hasOwnProperty.call(o,t[u])&&this.selectedList.push(o[t[u]]);this.selectedList.forEach(u=>{this.chef.setElementState2selected(u,!0)})}}getSelectedIds(){var r;if(!((r=this.selectedList)!=null&&r.length))return;const t=[];for(let s=0,o=this.selectedList.length;s<o;s++)this.selectedList[s].id&&t.push(this.selectedList[s].id);return t}getSelectedBoundingBox(){var r;const t=new Mt;return(r=this.selectedList)!=null&&r.length?(this.selectedList.forEach(s=>{const o=this.chef.boundingBoxMap[s.id];o&&t.expandByBox(o)}),t):t.copy(this.boundingBox)}getElementsByBox(t){const r=[],s=Object.keys(this.chef.boundingBoxMap),o=this.getAssetsByType(this.assetType);if(!o)return r;for(let u=0,h=s.length;u<h;u++)if(o.hasOwnProperty(s[u])&&!(s[u].indexOf("-assets")>-1)&&t.intersectsBox(this.chef.boundingBoxMap[s[u]])){const c=o[s[u]];c&&r.push(c)}return r}getBoundingBoxByIds(t){var s,o;if(!t||Array.isArray(t)&&!t.length)return;Array.isArray(t)||(t=[t]);const r=new Mt;for(let u=0,h=t==null?void 0:t.length;u<h;u++)(o=(s=this.chef)==null?void 0:s.boundingBoxMap)!=null&&o.hasOwnProperty(t[u])&&r.expandByBox(this.chef.boundingBoxMap[t[u]]);return r}getBoundingBoxById(t){if(this.chef.boundingBoxMap.hasOwnProperty(t))return new Mt().copy(this.chef.boundingBoxMap[t])}linkAssetsByTree(t){this.chef.linkAssetsByTree(this.assetType,t);const r=this.chef.getElementById(Va.ASSET_LABELS);r&&(r.style.display="block");const s=_a(this.assetType),o=this.chef.getElementById(s);o&&(o.style.display="block");const u=this.assetsMap[s];u&&(this._lastLinkedIds.forEach(h=>{u[h]&&(u[h].style.display="none")}),this._lastLinkedIds=qd(t),this._lastLinkedIds.forEach(h=>{u[h]&&(u[h].style.display="block")}))}onBeforeRender(){}fullscreen(t=1e3,r=!1){}update(){}}class XA extends Nh{constructor(t){super(t);d(this,"name","SvgLoadingScene");this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
34
+ `,Np=i=>48<=i.charCodeAt(0)&&i.charCodeAt(0)<=57;class wA extends eg{constructor(){super(),this.curNumber="",this.curCommandType=-1,this.curCommandRelative=!1,this.canParseCommandOrComma=!0,this.curNumberHasExp=!1,this.curNumberHasExpDigits=!1,this.curNumberHasDecimal=!1,this.curArgs=[]}finish(e=[]){if(this.parse(" ",e),this.curArgs.length!==0||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e}parse(e,t=[]){const r=s=>{t.push(s),this.curArgs.length=0,this.canParseCommandOrComma=!0};for(let s=0;s<e.length;s++){const o=e[s],u=this.curCommandType===V.ARC&&(this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber.length===1&&(this.curNumber==="0"||this.curNumber==="1"),h=Np(o)&&(this.curNumber==="0"&&o==="0"||u);if(Np(o)&&!h){this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp;continue}if(o==="e"||o==="E"){this.curNumber+=o,this.curNumberHasExp=!0;continue}if((o==="-"||o==="+")&&this.curNumberHasExp&&!this.curNumberHasExpDigits){this.curNumber+=o;continue}if(o==="."&&!this.curNumberHasExp&&!this.curNumberHasDecimal&&!u){this.curNumber+=o,this.curNumberHasDecimal=!0;continue}if(this.curNumber&&this.curCommandType!==-1){const c=Number(this.curNumber);if(isNaN(c))throw new SyntaxError(`Invalid number ending at ${s}`);if(this.curCommandType===V.ARC){if(this.curArgs.length===0||this.curArgs.length===1){if(0>c)throw new SyntaxError(`Expected positive number, got "${c}" at index "${s}"`)}else if((this.curArgs.length===3||this.curArgs.length===4)&&this.curNumber!=="0"&&this.curNumber!=="1")throw new SyntaxError(`Expected a flag, got "${this.curNumber}" at index "${s}"`)}this.curArgs.push(c),this.curArgs.length===TA[this.curCommandType]&&(V.HORIZ_LINE_TO===this.curCommandType?r({type:V.HORIZ_LINE_TO,relative:this.curCommandRelative,x:c}):V.VERT_LINE_TO===this.curCommandType?r({type:V.VERT_LINE_TO,relative:this.curCommandRelative,y:c}):this.curCommandType===V.MOVE_TO||this.curCommandType===V.LINE_TO||this.curCommandType===V.SMOOTH_QUAD_TO?(r({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),V.MOVE_TO===this.curCommandType&&(this.curCommandType=V.LINE_TO)):this.curCommandType===V.CURVE_TO?r({type:V.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===V.SMOOTH_CURVE_TO?r({type:V.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===V.QUAD_TO?r({type:V.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===V.ARC&&r({type:V.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!bA(o)){if(o===","&&this.canParseCommandOrComma){this.canParseCommandOrComma=!1;continue}if(o==="+"||o==="-"||o==="."){this.curNumber=o,this.curNumberHasDecimal=o===".";continue}if(h){this.curNumber=o,this.curNumberHasDecimal=!1;continue}if(this.curArgs.length!==0)throw new SyntaxError(`Unterminated command at index ${s}.`);if(!this.canParseCommandOrComma)throw new SyntaxError(`Unexpected character "${o}" at index ${s}. Command cannot follow comma`);if(this.canParseCommandOrComma=!1,o==="z"||o==="Z"){t.push({type:V.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1;continue}else if(o==="h"||o==="H")this.curCommandType=V.HORIZ_LINE_TO,this.curCommandRelative=o==="h";else if(o==="v"||o==="V")this.curCommandType=V.VERT_LINE_TO,this.curCommandRelative=o==="v";else if(o==="m"||o==="M")this.curCommandType=V.MOVE_TO,this.curCommandRelative=o==="m";else if(o==="l"||o==="L")this.curCommandType=V.LINE_TO,this.curCommandRelative=o==="l";else if(o==="c"||o==="C")this.curCommandType=V.CURVE_TO,this.curCommandRelative=o==="c";else if(o==="s"||o==="S")this.curCommandType=V.SMOOTH_CURVE_TO,this.curCommandRelative=o==="s";else if(o==="q"||o==="Q")this.curCommandType=V.QUAD_TO,this.curCommandRelative=o==="q";else if(o==="t"||o==="T")this.curCommandType=V.SMOOTH_QUAD_TO,this.curCommandRelative=o==="t";else if(o==="a"||o==="A")this.curCommandType=V.ARC,this.curCommandRelative=o==="a";else throw new SyntaxError(`Unexpected character "${o}" at index ${s}.`)}}return t}transform(e){return Object.create(this,{parse:{value(r,s=[]){const o=Object.getPrototypeOf(this).parse.call(this,r);for(const u of o){const h=e(u);Array.isArray(h)?s.push(...h):s.push(h)}return s}}})}}const Vt=class Vt extends eg{constructor(e){super(),typeof e=="string"?this.commands=Vt.parse(e):this.commands=e}encode(){return Vt.encode(this.commands)}getBounds(){const e=ae.CALCULATE_BOUNDS();return this.transform(e),e}transform(e){const t=[];for(const r of this.commands){const s=e(r);Array.isArray(s)?t.push(...s):t.push(s)}return this.commands=t,this}reverse(e=!0){return this.commands=ae.REVERSE_PATH(this.commands,e),this}static encode(e){return AA(e)}static parse(e){const t=new wA,r=[];return t.parse(e,r),t.finish(r),r}};Vt.CLOSE_PATH=1,Vt.MOVE_TO=2,Vt.HORIZ_LINE_TO=4,Vt.VERT_LINE_TO=8,Vt.LINE_TO=16,Vt.CURVE_TO=32,Vt.SMOOTH_CURVE_TO=64,Vt.QUAD_TO=128,Vt.SMOOTH_QUAD_TO=256,Vt.ARC=512,Vt.LINE_COMMANDS=Vt.LINE_TO|Vt.HORIZ_LINE_TO|Vt.VERT_LINE_TO,Vt.DRAWING_COMMANDS=Vt.HORIZ_LINE_TO|Vt.VERT_LINE_TO|Vt.LINE_TO|Vt.CURVE_TO|Vt.SMOOTH_CURVE_TO|Vt.QUAD_TO|Vt.SMOOTH_QUAD_TO|Vt.ARC;let V=Vt;const TA={[V.MOVE_TO]:2,[V.LINE_TO]:2,[V.HORIZ_LINE_TO]:1,[V.VERT_LINE_TO]:1,[V.CLOSE_PATH]:0,[V.QUAD_TO]:4,[V.SMOOTH_QUAD_TO]:2,[V.CURVE_TO]:6,[V.SMOOTH_CURVE_TO]:4,[V.ARC]:7};function fh([i,e],t){return[i*Math.cos(t)-e*Math.sin(t),i*Math.sin(t)+e*Math.cos(t)]}function Qr(...i){for(let e=0;e<i.length;e++)if(typeof i[e]!="number")throw new Error(`assertNumbers arguments[${e}] is not a number. ${typeof i[e]} == typeof ${i[e]}`);return!0}const dn=Math.PI;function Lh(i,e,t){i.lArcFlag=i.lArcFlag===0?0:1,i.sweepFlag=i.sweepFlag===0?0:1;let{rX:r,rY:s}=i;const{x:o,y:u}=i;if(Math.abs(r)<1e-10||Math.abs(s)<1e-10){i.rX=0,i.rY=0,i.cX=(e+o)/2,i.cY=(t+u)/2,i.phi1=0,i.phi2=0;return}r=Math.abs(i.rX),s=Math.abs(i.rY);const h=i.xRot/180*dn,[c,y]=fh([(e-o)/2,(t-u)/2],-h),p=Math.pow(c,2)/Math.pow(r,2)+Math.pow(y,2)/Math.pow(s,2);1<p&&(r*=Math.sqrt(p),s*=Math.sqrt(p)),i.rX=r,i.rY=s;const A=Math.pow(r,2)*Math.pow(y,2)+Math.pow(s,2)*Math.pow(c,2),T=(i.lArcFlag!==i.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(r,2)*Math.pow(s,2)-A)/A)),C=r*y/s*T,N=-s*c/r*T,O=fh([C,N],h);i.cX=O[0]+(e+o)/2,i.cY=O[1]+(t+u)/2,i.phi1=Math.atan2((y-N)/s,(c-C)/r),i.phi2=Math.atan2((-y-N)/s,(-c-C)/r),i.sweepFlag===0&&i.phi2>i.phi1&&(i.phi2-=2*dn),i.sweepFlag===1&&i.phi2<i.phi1&&(i.phi2+=2*dn),i.phi1*=180/dn,i.phi2*=180/dn}function Bp(i,e,t){Qr(i,e,t);const r=i*i+e*e-t*t;if(0>r)return[];if(r===0)return[[i*t/(i*i+e*e),e*t/(i*i+e*e)]];const s=Math.sqrt(r);return[[(i*t+e*s)/(i*i+e*e),(e*t-i*s)/(i*i+e*e)],[(i*t-e*s)/(i*i+e*e),(e*t+i*s)/(i*i+e*e)]]}const Un=Math.PI/180;function Ip(i,e,t){return(1-t)*i+t*e}function Rp(i,e,t,r){return i+Math.cos(r/180*dn)*e+Math.sin(r/180*dn)*t}function Pp(i,e,t,r){const o=e-i,u=t-e,h=r-t,c=3*o+3*h-6*u,y=(u-o)*6,p=3*o;return Math.abs(c)<1e-6?Math.abs(y)<1e-6?[]:[-p/y]:_A(y/c,p/c,1e-6)}function Fp(i,e,t,r,s){const o=1-s,u=o*o*o,h=3*o*o*s,c=3*o*s*s,y=s*s*s;return i*u+e*h+t*c+r*y}function _A(i,e,t=1e-6){const r=i*i/4-e;if(r<-t)return[];if(r<=t)return[-i/2];const s=Math.sqrt(r);return[-(i/2)-s,-(i/2)+s]}function CA(i,e,t){i.cX||Lh(i,e,t);const r=i.xRot/180*dn;if(Math.abs(i.rX)<1e-10||Math.abs(i.rY)<1e-10)return[{relative:i.relative,type:V.CURVE_TO,x1:e+(i.x-e)/3,y1:t+(i.y-t)/3,x2:e+2*(i.x-e)/3,y2:t+2*(i.y-t)/3,x:i.x,y:i.y}];const s=Math.min(i.phi1,i.phi2),o=Math.max(i.phi1,i.phi2),u=o-s,h=Math.ceil(u/90),c=new Array(h);let y=e,p=t;const A=(T,C)=>{const[N,O]=fh([T*i.rX,C*i.rY],r);return[i.cX+N,i.cY+O]};for(let T=0;T<h;T++){const C=Ip(i.phi1,i.phi2,T/h),N=Ip(i.phi1,i.phi2,(T+1)/h),O=N-C,L=4/3*Math.tan(O*Un/4),P=Math.cos(C*Un)-L*Math.sin(C*Un),W=Math.sin(C*Un)+L*Math.cos(C*Un),q=Math.cos(N*Un),b=Math.sin(N*Un),Y=q+L*b,z=b-L*q,j=A(P,W),tt=A(Y,z),Q=A(q,b),K={relative:i.relative,type:V.CURVE_TO,x:Q[0],y:Q[1],x1:j[0],y1:j[1],x2:tt[0],y2:tt[1]};i.relative&&(K.x1-=y,K.y1-=p,K.x2-=y,K.y2-=p,K.x-=y,K.y-=p),y=Q[0],p=Q[1],c[T]=K}return c}function Xl(i,e,t){const r=e[0]-i[0],s=e[1]-i[1],o=t[0]-i[0],u=t[1]-i[1],h=r*u-s*o;if(!(Math.abs(h)<1e-10))return!1;const y=r*o+s*u,p=r*r+s*s,A=o*o+u*u;return 0<=y&&y<=A&&p<=A}function DA(i,e=!0){if(i.length<2)return i;const t=ae.INFO((o,u,h)=>{var c,y,p;return Uo(ys({},o),{x:(c=o.x)!=null?c:u,y:(y=o.y)!=null?y:h,relative:(p=o.relative)!=null?p:!1})}),r=[];let s=[];for(const o of i){const u=t(o);u.type===V.MOVE_TO&&s.length>0&&(e?r.push(...Yo(s)):r.unshift(...Yo(s)),s=[]),s.push(u)}return s.length>0&&(e?r.push(...Yo(s)):r.unshift(...Yo(s))),r}function Yo(i){var s;const e=((s=i[i.length-1])==null?void 0:s.type)===V.CLOSE_PATH,t=e?i.length-2:i.length-1,r=[{type:V.MOVE_TO,relative:!1,x:i[t].x,y:i[t].y}];for(let o=t;o>0;o--){const u=i[o],h=i[o-1];if(u.relative)throw new Error("Relative command are not supported convert first with `toAbs()`");switch(u.type){case V.HORIZ_LINE_TO:r.push({type:V.HORIZ_LINE_TO,relative:!1,x:h.x});break;case V.VERT_LINE_TO:r.push({type:V.VERT_LINE_TO,relative:!1,y:h.y});break;case V.LINE_TO:case V.MOVE_TO:r.push({type:V.LINE_TO,relative:!1,x:h.x,y:h.y});break;case V.CURVE_TO:r.push({type:V.CURVE_TO,relative:!1,x:h.x,y:h.y,x1:u.x2,y1:u.y2,x2:u.x1,y2:u.y1});break;case V.SMOOTH_CURVE_TO:throw new Error("Unsupported command: S (smooth cubic bezier)");case V.SMOOTH_QUAD_TO:throw new Error("Unsupported command: T (smooth quadratic bezier)");case V.ARC:throw new Error("Unsupported command: A (arc)");case V.QUAD_TO:throw new Error("Unsupported command: Q (quadratic bezier)")}}return e&&r.push({type:V.CLOSE_PATH}),r}function SA(i=1e13){Qr(i);function e(t){return Math.round(t*i)/i}return function(r){return"x1"in r&&typeof r.x1!="undefined"&&(r.x1=e(r.x1)),"y1"in r&&typeof r.y1!="undefined"&&(r.y1=e(r.y1)),"x2"in r&&typeof r.x2!="undefined"&&(r.x2=e(r.x2)),"y2"in r&&typeof r.y2!="undefined"&&(r.y2=e(r.y2)),"x"in r&&typeof r.x!="undefined"&&(r.x=e(r.x)),"y"in r&&typeof r.y!="undefined"&&(r.y=e(r.y)),"rX"in r&&typeof r.rX!="undefined"&&(r.rX=e(r.rX)),"rY"in r&&typeof r.rY!="undefined"&&(r.rY=e(r.rY)),r}}function rg(){return Kr((i,e,t)=>(i.relative&&(typeof i.x1!="undefined"&&(i.x1+=e),typeof i.y1!="undefined"&&(i.y1+=t),typeof i.x2!="undefined"&&(i.x2+=e),typeof i.y2!="undefined"&&(i.y2+=t),typeof i.x!="undefined"&&(i.x+=e),typeof i.y!="undefined"&&(i.y+=t),i.relative=!1),i))}function OA(){return Kr((i,e,t)=>(i.relative||(typeof i.x1!="undefined"&&(i.x1-=e),typeof i.y1!="undefined"&&(i.y1-=t),typeof i.x2!="undefined"&&(i.x2-=e),typeof i.y2!="undefined"&&(i.y2-=t),typeof i.x!="undefined"&&(i.x-=e),typeof i.y!="undefined"&&(i.y-=t),i.relative=!0),i))}function MA(i=!0,e=!0,t=!0,r=!0){return Kr((s,o,u,h,c)=>{if(isNaN(h)&&!(s.type&V.MOVE_TO))throw new Error("path must start with moveto");if(e&&s.type&V.HORIZ_LINE_TO&&(s.type=V.LINE_TO,s.y=s.relative?0:u),t&&s.type&V.VERT_LINE_TO&&(s.type=V.LINE_TO,s.x=s.relative?0:o),i&&s.type&V.CLOSE_PATH&&(s.type=V.LINE_TO,s.x=s.relative?h-o:h,s.y=s.relative?c-u:c),s.type&V.ARC&&(s.rX===0||s.rY===0)&&(s.type=V.LINE_TO,delete s.rX,delete s.rY,delete s.xRot,delete s.lArcFlag,delete s.sweepFlag),r&&s.type&V.QUAD_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x,u+s.y]:[s.x,s.y];Xl(y,p,A)&&(s.type=V.LINE_TO,delete s.x1,delete s.y1)}if(r&&s.type&V.CURVE_TO){const y=[o,u],p=s.relative?[o+s.x1,u+s.y1]:[s.x1,s.y1],A=s.relative?[o+s.x2,u+s.y2]:[s.x2,s.y2],T=s.relative?[o+s.x,u+s.y]:[s.x,s.y];Xl(y,p,T)&&Xl(y,A,T)&&(s.type=V.LINE_TO,delete s.x1,delete s.y1,delete s.x2,delete s.y2)}return s})}function ig(){let i=NaN,e=NaN,t=NaN,r=NaN;return Kr((s,o,u)=>(s.type&V.SMOOTH_CURVE_TO&&(s.type=V.CURVE_TO,i=isNaN(i)?o:i,e=isNaN(e)?u:e,s.x1=s.relative?o-i:2*o-i,s.y1=s.relative?u-e:2*u-e),s.type&V.CURVE_TO?(i=s.relative?o+s.x2:s.x2,e=s.relative?u+s.y2:s.y2):(i=NaN,e=NaN),s.type&V.SMOOTH_QUAD_TO&&(s.type=V.QUAD_TO,t=isNaN(t)?o:t,r=isNaN(r)?u:r,s.x1=s.relative?o-t:2*o-t,s.y1=s.relative?u-r:2*u-r),s.type&V.QUAD_TO?(t=s.relative?o+s.x1:s.x1,r=s.relative?u+s.y1:s.y1):(t=NaN,r=NaN),s))}function ng(){let i=NaN,e=NaN;return Kr((t,r,s)=>{if(t.type&V.SMOOTH_QUAD_TO&&(t.type=V.QUAD_TO,i=isNaN(i)?r:i,e=isNaN(e)?s:e,t.x1=t.relative?r-i:2*r-i,t.y1=t.relative?s-e:2*s-e),t.type&V.QUAD_TO){i=t.relative?r+t.x1:t.x1,e=t.relative?s+t.y1:t.y1;const o=t.x1,u=t.y1;t.type=V.CURVE_TO,t.x1=((t.relative?0:r)+o*2)/3,t.y1=((t.relative?0:s)+u*2)/3,t.x2=(t.x+o*2)/3,t.y2=(t.y+u*2)/3}else i=NaN,e=NaN;return t})}function Kr(i){let e=0,t=0,r=NaN,s=NaN;return function(u){if(isNaN(r)&&!(u.type&V.MOVE_TO))throw new Error("path must start with moveto");const h=i(u,e,t,r,s);return u.type&V.CLOSE_PATH&&(e=r,t=s),"x"in u&&typeof u.x!="undefined"&&(e=u.relative?e+u.x:u.x),"y"in u&&typeof u.y!="undefined"&&(t=u.relative?t+u.y:u.y),u.type&V.MOVE_TO&&(r=e,s=t),h}}function LA(i=0){Qr(i);let e=NaN,t=NaN,r=NaN,s=NaN;return Kr((o,u,h,c,y)=>{const p=Math.abs;let A=!1,T=0,C=0;if(o.type&V.SMOOTH_CURVE_TO&&(T=isNaN(e)?0:u-e,C=isNaN(t)?0:h-t),o.type&(V.CURVE_TO|V.SMOOTH_CURVE_TO)?(e=o.relative?u+o.x2:o.x2,t=o.relative?h+o.y2:o.y2):(e=NaN,t=NaN),o.type&V.SMOOTH_QUAD_TO?(r=isNaN(r)?u:2*u-r,s=isNaN(s)?h:2*h-s):o.type&V.QUAD_TO?(r=o.relative?u+o.x1:o.x1,s=o.relative?h+o.y1:o.y2):(r=NaN,s=NaN),o.type&V.LINE_COMMANDS||o.type&V.ARC&&(o.rX===0||o.rY===0||!o.lArcFlag)||o.type&V.CURVE_TO||o.type&V.SMOOTH_CURVE_TO||o.type&V.QUAD_TO||o.type&V.SMOOTH_QUAD_TO){const N=typeof o.x=="undefined"?0:o.relative?o.x:o.x-u,O=typeof o.y=="undefined"?0:o.relative?o.y:o.y-h;T=isNaN(r)?typeof o.x1=="undefined"?T:o.relative?o.x:o.x1-u:r-u,C=isNaN(s)?typeof o.y1=="undefined"?C:o.relative?o.y:o.y1-h:s-h;const L=typeof o.x2=="undefined"?0:o.relative?o.x:o.x2-u,P=typeof o.y2=="undefined"?0:o.relative?o.y:o.y2-h;p(N)<=i&&p(O)<=i&&p(T)<=i&&p(C)<=i&&p(L)<=i&&p(P)<=i&&(A=!0)}return o.type&V.CLOSE_PATH&&p(u-c)<=i&&p(h-y)<=i&&(A=!0),A?[]:o})}function vn(i,e,t,r,s,o){return Qr(i,e,t,r,s,o),Kr((u,h,c,y)=>{const p=u.x1,A=u.x2,T=u.relative&&!isNaN(y),C=typeof u.x!="undefined"?u.x:T?0:h,N=typeof u.y!="undefined"?u.y:T?0:c;u.type&V.HORIZ_LINE_TO&&e!==0&&(u.type=V.LINE_TO,u.y=u.relative?0:c),u.type&V.VERT_LINE_TO&&t!==0&&(u.type=V.LINE_TO,u.x=u.relative?0:h),typeof u.x!="undefined"&&(u.x=u.x*i+N*t+(T?0:s)),typeof u.y!="undefined"&&(u.y=C*e+u.y*r+(T?0:o)),typeof u.x1!="undefined"&&(u.x1=u.x1*i+u.y1*t+(T?0:s)),typeof u.y1!="undefined"&&(u.y1=p*e+u.y1*r+(T?0:o)),typeof u.x2!="undefined"&&(u.x2=u.x2*i+u.y2*t+(T?0:s)),typeof u.y2!="undefined"&&(u.y2=A*e+u.y2*r+(T?0:o));function O(P){return P*P}const L=i*r-e*t;if(typeof u.xRot!="undefined"&&(i!==1||e!==0||t!==0||r!==1))if(L===0)delete u.rX,delete u.rY,delete u.xRot,delete u.lArcFlag,delete u.sweepFlag,u.type=V.LINE_TO;else{const P=u.xRot*Math.PI/180,W=Math.sin(P),q=Math.cos(P),b=1/O(u.rX),Y=1/O(u.rY),z=O(q)*b+O(W)*Y,j=2*W*q*(b-Y),tt=O(W)*b+O(q)*Y,Q=z*r*r-j*e*r+tt*e*e,K=j*(i*r+e*t)-2*(z*t*r+tt*i*e),rt=z*t*t-j*i*t+tt*i*i,at=(Math.atan2(K,Q-rt)+Math.PI)%Math.PI/2,ct=Math.sin(at),pt=Math.cos(at);u.rX=Math.abs(L)/Math.sqrt(Q*O(pt)+K*ct*pt+rt*O(ct)),u.rY=Math.abs(L)/Math.sqrt(Q*O(ct)-K*ct*pt+rt*O(pt)),u.xRot=at*180/Math.PI}return typeof u.sweepFlag!="undefined"&&0>L&&(u.sweepFlag=+!u.sweepFlag),u})}function NA(i,e=0,t=0){Qr(i,e,t);const r=Math.sin(i),s=Math.cos(i);return vn(s,r,-r,s,e-e*s+t*r,t-e*r-t*s)}function BA(i,e=0){return Qr(i,e),vn(1,0,0,1,i,e)}function IA(i,e=i){return Qr(i,e),vn(i,0,0,e,0,0)}function RA(i){return Qr(i),vn(1,0,Math.tan(i),1,0,0)}function PA(i){return Qr(i),vn(1,Math.tan(i),0,1,0,0)}function FA(i=0){return Qr(i),vn(-1,0,0,1,i,0)}function kA(i=0){return Qr(i),vn(1,0,0,-1,0,i)}function HA(){return Kr((i,e,t)=>V.ARC===i.type?CA(i,i.relative?0:e,i.relative?0:t):i)}function UA(){return Kr((i,e,t)=>(i.relative&&(e=0,t=0),V.ARC===i.type&&Lh(i,e,t),i))}function sg(){return i=>ys({},i)}function qA(){const i=sg(),e=rg(),t=ng(),r=ig(),s=Kr((o,u,h)=>{const c=r(t(e(i(o))));function y(A){A>s.maxX&&(s.maxX=A),A<s.minX&&(s.minX=A)}function p(A){A>s.maxY&&(s.maxY=A),A<s.minY&&(s.minY=A)}if(c.type&V.DRAWING_COMMANDS&&(y(u),p(h)),c.type&V.HORIZ_LINE_TO&&y(c.x),c.type&V.VERT_LINE_TO&&p(c.y),c.type&V.LINE_TO&&(y(c.x),p(c.y)),c.type&V.CURVE_TO){y(c.x),p(c.y);const A=Pp(u,c.x1,c.x2,c.x);for(const C of A)0<C&&1>C&&y(Fp(u,c.x1,c.x2,c.x,C));const T=Pp(h,c.y1,c.y2,c.y);for(const C of T)0<C&&1>C&&p(Fp(h,c.y1,c.y2,c.y,C))}if(c.type&V.ARC){y(c.x),p(c.y),Lh(c,u,h);const A=c.xRot/180*Math.PI,T=Math.cos(A)*c.rX,C=Math.sin(A)*c.rX,N=-Math.sin(A)*c.rY,O=Math.cos(A)*c.rY,[L,P]=c.phi1<c.phi2?[c.phi1,c.phi2]:-180>c.phi2?[c.phi2+360,c.phi1+360]:[c.phi2,c.phi1],W=([Y,z])=>{const tt=Math.atan2(z,Y)*180/Math.PI;return tt<L?tt+360:tt},q=Bp(N,-T,0).map(W);for(const Y of q)Y>L&&Y<P&&y(Rp(c.cX,T,N,Y));const b=Bp(O,-C,0).map(W);for(const Y of b)Y>L&&Y<P&&p(Rp(c.cY,C,O,Y))}return o});return s.minX=1/0,s.maxX=-1/0,s.minY=1/0,s.maxY=-1/0,s}const ae={ROUND:SA,TO_ABS:rg,TO_REL:OA,NORMALIZE_HVZ:MA,NORMALIZE_ST:ig,QT_TO_C:ng,INFO:Kr,SANITIZE:LA,MATRIX:vn,ROTATE:NA,TRANSLATE:BA,SCALE:IA,SKEW_X:RA,SKEW_Y:PA,X_AXIS_SYMMETRY:FA,Y_AXIS_SYMMETRY:kA,A_TO_C:HA,ANNOTATE_ARCS:UA,CLONE:sg,CALCULATE_BOUNDS:qA,REVERSE_PATH:DA};class Gr{static destroy(){this.cached.clear(),this.cachedCanvas.clear()}static createCanvas(e){var s;if(!((s=Wt.window)!=null&&s.document))throw new Error("environment not support");let t;e.containerId&&(t=Wt.window.document.getElementById(e.containerId)),t||(t=Wt.window.document.getElementsByTagName("body")[0]);let r;if(e.canvasId&&(r=Wt.window.document.getElementById(e.canvasId)||void 0),e.width||(e.width=(t==null?void 0:t.offsetWidth)||100),e.height||(e.height=(t==null?void 0:t.offsetHeight)||100),e.dpr||(e.dpr=Wt.dpr),r)this.resizeCanvas(r,e.width,e.height,e.dpr);else{if(r=this.createHtmlCanvas(e.width,e.height,e.dpr),!r)throw new Error("error environment");e.canvasId&&r.setAttribute("id",e.canvasId),t==null||t.appendChild(r)}return r.style.background=e.background||"transparent",r}static getContext2D(e,t={}){const r={alpha:!0,willReadFrequently:!!t.willReadFrequently},s=e.getContext("2d",r);if(!s)throw new Error("getContext2D error");return s.scale(t.dpr||1,t.dpr||1),s}static resizeCanvas(e,t,r,s=1){e instanceof OffscreenCanvas?(e.width=t,e.height=r):e instanceof HTMLCanvasElement&&(e.setAttribute("width",(t*s).toString()),e.setAttribute("height",(r*s).toString()),e.style.width=t+"px",e.style.height=r+"px",e.style.padding="0",e.style.margin="0",e.style.border="0",e.style.imageRendering="pixelated",e.style.transform="translateZ(0)")}static getImageBitmapByCanvasAsync(e){return Tt(this,null,function*(){if(e)return e instanceof OffscreenCanvas?e.transferToImageBitmap():e instanceof HTMLCanvasElement?yield createImageBitmap(e):void 0})}static get(e,t,r,s=1){let o=this.cached.get(e);return o||(o=this.create(t,r,s),this.set(e,o)),this.resizeCanvas(o,t,r,s),o}static set(e,t){if(!e||!t)throw new Error("error input");return this.cached.set(e,t)}static remove(e){this.cached.has(e)&&this.cached.delete(e)}static create(e,t,r=1){var s;if((s=Wt.window)!=null&&s.OffscreenCanvas)return new OffscreenCanvas(e,t);throw new Error("environment does not support")}static createHtmlCanvas(e,t,r=1){if(!Wt.window.document)throw new Error("environment does not support");const s=Wt.window.document.createElement("canvas");return this.resizeCanvas(s,e,t,r),s}static measureText(e,t,r=new k){if(!e)throw new Error("input error");const o=this.get("measureText",1,1).getContext("2d");if(!o)throw new Error("bufferCtx not found");t.render(o);const u=o.measureText(e);if(!u)throw new Error("measureText error");const h=u.actualBoundingBoxRight+u.actualBoundingBoxLeft,c=u.actualBoundingBoxAscent+u.actualBoundingBoxDescent;return r.set(h,c),r}}d(Gr,"cached",new Map),d(Gr,"cachedCanvas",new Map);let VA=0;class iu extends R{constructor(t={}){var r;super(t.commands);d(this,"name","Geo2");d(this,"id",++VA);d(this,"params");d(this,"viewMatrix",new ge);d(this,"boundingBox",new Mt);d(this,"flipY",!1);d(this,"renderPath");d(this,"_version",0);typeof t.flipY!="undefined"&&(this.flipY=!!t.flipY),this.params=t,(r=this.commands)!=null&&r.length&&this.toAbs(),t.flipY&&this.scale(1,-1)}get version(){return this._version}set version(t){this._version=t}set needsUpdate(t){t&&this._version++}setFromPoints(t){return t!=null&&t.length?(this.params.points=t,this.recomputePath(),this):this}recomputePath(){throw new Error("must be implemented in derived")}computeBoundingBox(){var t;this.boundingBox.makeEmpty(),mt.identity();for(let r=0,s=((t=this.commands)==null?void 0:t.length)||0;r<s;r++){const o=this.commands[r];switch(o.type){case R.MOVE_TO:this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break;case R.LINE_TO:this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break;case R.ARC:typeof o.xRot=="undefined"?(this.boundingBox.expandByXY(o.x,o.y),Bi.set(o.x,o.y).addScalar(-o.rX),this.boundingBox.expandByPoint(Bi),Bi.set(o.x,o.y).addScalar(o.rX),this.boundingBox.expandByPoint(Bi)):this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break;case R.HORIZ_LINE_TO:this.boundingBox.expandByXY(o.x,mt.y),mt.set(o.x,mt.y);break;case R.VERT_LINE_TO:this.boundingBox.expandByXY(mt.x,o.y),mt.set(mt.x,o.y);break;case R.QUAD_TO:this.boundingBox.expandByXY(o.x,o.y),mt.set(o.x,o.y);break}}return this.boundingBox}render(t,r){if(this.renderPath=new Path2D,!(!t||!(r!=null&&r.length))){mt.identity();for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s];switch(u.type){case R.MOVE_TO:this.renderPath.moveTo(u.x,u.y),mt.set(u.x,u.y);break;case R.LINE_TO:this.renderPath.lineTo(u.x,u.y),mt.set(u.x,u.y);break;case R.ARC:this.renderPath.arc(u.x,u.y,u.rX,u.phi1||0,u.phi2||Math.PI*2,u.sweepFlag!==1),mt.set(u.x,u.y);break;case R.HORIZ_LINE_TO:this.renderPath.lineTo(u.x,mt.y),mt.set(u.x,mt.y);break;case R.VERT_LINE_TO:this.renderPath.lineTo(mt.x,u.y),mt.set(mt.x,u.y);break;case R.CURVE_TO:this.renderPath.bezierCurveTo(u.x1,u.y1,u.x2,u.y2,u.x,u.y),mt.set(u.x,u.y);break;case R.SMOOTH_CURVE_TO:mt.set(u.x,u.y);break;case R.QUAD_TO:mt.set(u.x,u.y);break;case R.SMOOTH_QUAD_TO:mt.set(u.x,u.y);break}}}}applyMatrix(t){return this.needsUpdate=!0,this.matrix(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),this}getRenderCommands(t){var u;const r=[];for(let h=0,c=((u=this.commands)==null?void 0:u.length)||0;h<c;h++)r.push(Object.assign({},this.commands[h]));if(!t)return r;mt.identity();const s=ae.MATRIX(t.elements[0],t.elements[1],t.elements[3],t.elements[4],t.elements[6],t.elements[7]),o=[];for(let h=0,c=r.length;h<c;h++){const y=r[h],p=s(y);if(p.type===R.ARC){let[A,T,C,N,O,L,P,W]=jE(mt.x,mt.y,p.x,p.y,p.lArcFlag,p.sweepFlag,p.rX,p.rY,0);if(mt.set(p.x,p.y),p.rX===p.rY&&typeof p.xRot!="undefined")p.x=A,p.y=T,p.rx=C>N?C:N,p.phi1=O,p.phi2=O+L;else if(p.rX===p.rY)t.getScale(Bi),p.rX=p.rY*Math.abs(Bi.x),(p.phi1!==0||p.phi2!==Math.PI*2)&&(t.getRotation(Bi),p.phi1+=Bi.x,p.phi2+=Bi.x);else{const q=JE(A,T,C,N,O,L,P);if(!(q!=null&&q.length))break;p.type=R.MOVE_TO,p.x=A,p.y=T;for(let b=0,Y=q.length;b<Y;b++)o.push({type:R.CURVE_TO,x1:q[b][1][0],y1:q[b][1][1],x2:q[b][2][0],y2:q[b][2][1],x:q[b][3][0],y:q[b][3][1]})}}else mt.set(p.x||mt.x,p.y||mt.y);Array.isArray(p)?o.push(...p):o.push(p)}return o}copy(t){return this.commands=It.cloneDeep(t.commands),this.version=0,this}clone(){const t=this.constructor;return new t(this.params).copy(this)}getConvexHull(){var r,s;const t=[];if(!((r=this.commands)!=null&&r.length))return t;for(let o=0,u=((s=this.commands)==null?void 0:s.length)||0;o<u;o++){const h=this.commands[o];switch(h.type){case R.MOVE_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.LINE_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.ARC:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.HORIZ_LINE_TO:t.push({x:h.x,y:mt.y}),mt.set(h.x,mt.y);break;case R.VERT_LINE_TO:t.push({x:mt.x,y:h.y}),mt.set(mt.x,h.y);break;case R.CURVE_TO:case R.SMOOTH_CURVE_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break;case R.QUAD_TO:case R.SMOOTH_QUAD_TO:t.push({x:h.x,y:h.y}),mt.set(h.x,h.y);break}}return t}isPointInBoundingBox(t){return this.boundingBox?this.boundingBox.containsPoint(t):!1}isPointInPath(t){if(this.renderPath){ln.save(),ln.beginPath(),ln.lineWidth=5,ln.stroke(this.renderPath),ln.fill(this.renderPath),ln.closePath();const r=ln.isPointInPath(this.renderPath,t.x,t.y);return ln.restore(),r}return!1}}const mt=new k,Bi=new k,WA=Gr.get("RAY_CASTER",10,10),ln=WA.getContext("2d");class zA extends iu{constructor(t={}){t.commands||(t.commands=[]);super(t);d(this,"isCircle",!0);d(this,"radius",1);d(this,"start",0);d(this,"end",Math.PI*2);typeof t.radius!="undefined"&&(this.radius=t.radius),typeof t.start!="undefined"&&(this.start=t.start),typeof t.end!="undefined"&&(this.end=t.end),this.recomputePath()}recomputePath(){var s,o,u;if(!((o=(s=this.params)==null?void 0:s.points)!=null&&o.length))return this;const t=this.params.points,r=[];for(let h=0,c=t.length;h<c;h++)r.push({type:R.MOVE_TO,x:t[h].x+this.radius,y:t[h].y*(this.params.flipY?-1:1),relative:!1}),r.push({type:R.ARC,rX:this.radius,rY:this.radius,xRot:void 0,lArcFlag:0,sweepFlag:((u=this.params)==null?void 0:u.sweepFlag)||1,phi1:this.start,phi2:this.end,x:t[h].x,y:t[h].y*(this.params.flipY?-1:1),relative:!1});return this.commands=r,this}}class ag{constructor(e={}){d(this,"params");this.params=e}destroy(){}static getInstanceByElement(e,t=!1){if(!e)return;let r;switch(e.nodeName){case"path":r=this.getInstanceByPath(e,t);break;case"circle":r=this.getInstanceByCircle(e,t);break}return r||console.error(`unsupported: ${e}`),r}static getInstanceByPath(e,t=!1){if(!e)return;const r=Ta(e,"d");if(!r)return;const s=r.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""),o=s.match(/([Mm][^Mm]*)/g);if(!o||o.length<=this.splitLimit)try{return new iu({commands:s,flipY:t})}catch(h){console.error(`getInstanceByPath error: ${h}: ${s}`);return}const u=[];for(let h=0,c=o.length;h<c;h+=this.splitLimit){const p=o.slice(h,h+this.splitLimit).join(" ");try{u.push(new iu({commands:p,flipY:t}))}catch(A){console.error(`getInstanceByPath error: ${A}`)}}return u}static getInstanceByCircle(e,t=!1){if(!e||e.nodeName!=="circle")return;kp.set(Ta(e,"cx",0),Ta(e,"cy",0));const r=Ta(e,"r",0);return new zA({points:[kp.clone()],radius:r,flipY:t})}static getInstance(e,t=!1){if(e)return new iu({commands:e,flipY:t})}}d(ag,"splitLimit",100);const kp=new k;class $A{constructor(){d(this,"svg");d(this,"offset",new k);d(this,"svgRoot");d(this,"layers",[]);d(this,"elementsMap",{});d(this,"boundingBoxMap",{});d(this,"boundingBox",new Mt);d(this,"svgSkeletons",[]);d(this,"data");d(this,"_exceptTypes",["view"]);d(this,"_exceptIds",["viewer","mirror"]);d(this,"_lvi",0);d(this,"_lastLinked",[])}bindSvg(e){return this.svg=e,this.svgRoot=$d(this.svg),this.layers=this.getLayers(2),this.elementsMap={},this.boundingBoxMap={},this.boundingBox.makeEmpty(),this.getElementsMap(this.svg,this.elementsMap),this}getLayers(e){var t;if(!this.svg)throw new Error("please bind svg first");return e===2&&((t=this.layers)!=null&&t.length)?this.layers:(this.layers=this._getSvgLayer(this.svg,e),this.layers)}_getSvgLayer(e,t=0,r=0,s=[]){var h;let o,u=e.id;if(this._exceptTypes.includes(e.tagName)||e.tagName==="defs")return this._lvi--,s;if(t&&this._lvi>t)return s;u&&!this._exceptIds.includes(u)&&(o={value:u,label:u,children:[]},s.push(o)),this._lvi++;for(let c=0,y=e.children.length;c<y;c++)o?this._getSvgLayer(e.children[c],t,this._lvi,o.children):this._getSvgLayer(e.children[c],t,this._lvi,s);return((h=o==null?void 0:o.children)==null?void 0:h.length)===0&&delete o.children,this._lvi=r,s}getElementsMap(e,t={}){return this.traverseSvg(e,r=>{r!==e&&r.id&&(t[r.id]=r)}),t}computeBoundingBoxMap(){var t;if(Object.keys(this.boundingBoxMap).length)return this.boundingBoxMap;let e=(t=this.svg)==null?void 0:t.getBoundingClientRect();return e&&this.offset.set(e.left,e.top),this.traverseSvg(this.svg,r=>{if(!r.id)return;if(r.tagName==="use"){const u=this.getUseSymbolId(r);if(!u)return;const h=this.boundingBoxMap[u];if(h&&!h.isEmpty()){Ii.set(Number(r.getAttribute("x")||"0"),Number(r.getAttribute("y")||"0")),Xo.composeSvgTransform(Ii.x,Ii.y,r.getAttribute("transform"));const p=new Mt().copy(h).applyMatrix3(Xo);this.boundingBoxMap[r.id]=p;return}const c=this.getUseElementBoundingBoxWithSymbol(r);if(!c)return;this.boundingBoxMap[u]=c,Ii.set(Number(r.getAttribute("x")||"0"),Number(r.getAttribute("y")||"0")),Xo.composeSvgTransform(Ii.x,Ii.y,r.getAttribute("transform"));const y=new Mt().copy(c).applyMatrix3(Xo);this.boundingBoxMap[r.id]=y,this.boundingBox.expandByBox(y);return}if(typeof r.getBBox!="function")return;const s=r.getBBox();if((!s.width||!s.height)&&r.tagName==="path"){const u=ag.getInstanceByPath(r);if(!Array.isArray(u)){const h=u==null?void 0:u.computeBoundingBox();if(!h||h.isEmpty())return;h.getSize(Ii),s.x=h.min.x,s.y=h.max.y,s.width=Ii.x,s.height=Ii.y}}if(!s.width||!s.height)return;const o=new Mt(new k(s.x,s.y),new k(s.x+s.width,s.y+s.height));this.boundingBoxMap[r.id]=o.round(),this.boundingBox.expandByBox(o)}),this.boundingBoxMap}getLayerVisible(e){var r;const t=this.getElementById(e);if(t)return((r=t.style)==null?void 0:r.display)!=="none"}updateLayersVisibility(e,t=!1,r=!0){if(!this.elementsMap)throw new Error("please bind svg first");r&&this._updateAllLayersVisibility(!t),e!=null&&e.length||(e=["background"]);for(let s=0,o=e.length;s<o;s++){const u=this.getElementById(e[s]);u&&this._updateLayersVisibility(u,t,!0,!0)}}_updateAllLayersVisibility(e=!1){Object.values(this.elementsMap).forEach(t=>{t.tagName==="svg"||t.tagName==="symbol"||!t.getAttribute("id")||(t.style.display=e?"block":"none")})}_updateLayersVisibility(e,t=!1,r=!1,s=!1){var o,u;if(!(!e||e.tagName==="svg"||!e.getAttribute("id"))){if(e.style.display=t?"block":"none",r&&t){let h=e.parentElement;for(;h&&h.tagName!=="svg";)h.style.display=t?"block":"none",h=h.parentElement}if(s&&((o=e.children)==null?void 0:o.length)>0)for(let h=0,c=(u=e.children)==null?void 0:u.length;h<c;h++)this._updateLayersVisibility(e.children[h],t,!1,!0)}}updateVisibilityByAssetType(e,t=!1,r){r||(r=Wd[e]),this.updateLayersVisibility(r,!t)}updateVisibilityByAssetTypes(e,t=!1,r){if(Array.isArray(e)||(e=[e]),!!(e!=null&&e.length))for(let s=0,o=e.length;s<o;s++)this.updateVisibilityByAssetType(e[s],t,r)}getElementById(e){if(!this.elementsMap)throw new Error("please bind svg first");return this.elementsMap[e]}getElementBoundingBox(e){return this.boundingBoxMap[e]}findSkeletonByPath(e=[]){let t=0,r;const s=Object.keys(this.elementsMap);for(let o=0,u=s.length;o<u;o++){const h=this.elementsMap[s[o]];if(!h)continue;const c=h.getAttribute("d");c&&(c.length<t||(t=c.length,r=h.id?h:h.parent))}return r&&e.push(r),e}setTextInChildren2(e,t){var s;let r;((s=e==null?void 0:e.children)==null?void 0:s.length)<2?(r=Vl("text"),r.setAttribute("dy","1em"),e.appendChild(r)):r=e.children[e.children.length-1],r.innerHTML=t}traverseSvg(e,t){var r;if(!this._exceptTypes.includes(e.tagName)&&!(e.tagName!=="svg"&&e.tagName!=="defs"&&!e.id)&&!(e.tagName==="g"&&((r=e.children)==null?void 0:r.length)===0)){this._exceptIds.includes(e.id)||t(e);for(let s=0,o=e.children.length;s<o;s++)this.traverseSvg(e.children[s],t)}}traverseSvgTLayers(e,t){var r;if(Array.isArray(e)){for(let s=0,o=e.length;s<o;s++)this.traverseSvgTLayers(e[s],t);return}if(t(e),!!((r=e.children)!=null&&r.length))for(let s=0,o=e.children.length;s<o;s++)this.traverseSvgTLayers(e.children[s],t)}getLabelElementsByType(e,t={}){const r=this.getElementById(_a(e));return r&&this.getElementsMap(r,t),t}getLabelElementById(e,t="rm"){if(!e)return;const r=this.getElementById(e);if(!r)return;let s=r.getAttribute("aid");return s||(s="l-"+t+"-"+e),this.getElementById(s)}setLabelsById(e,t,r="rm"){var u,h;const s=this.getLabelElementById(e,r);if(!s)return;const o=((u=s.children)==null?void 0:u.length)||0;for(let c=0,y=((t==null?void 0:t.length)||0)-(o-1);c<y;c++){const p=Vl("text");p.setAttribute("x","0"),p.setAttribute("y",o+c+"em"),s.appendChild(p)}for(let c=1,y=(h=s.children)==null?void 0:h.length;c<y;c++)s.children[c].textContent=t&&c<=t.length?t[c-1]:""}clearAssetLabelsByType(e="rm"){var s;const t=this.getLabelElementsByType(e),r=It.keys(t);for(let o=0,u=r.length;o<u;o++){const h=t[r[o]];for(let c=1,y=((s=h.children)==null?void 0:s.length)||0;c<y;c++)h.children[c].textContent=""}}getUseSymbolId(e){var t;if(!(!e||e.tagName!=="use"))return(t=e.getAttribute("xlink:href"))==null?void 0:t.substring(1)}getUseSymbol(e){if(!e||e.tagName!=="use")return;const t=this.getUseSymbolId(e);if(t)return this.getElementById(t)}setElementState2selected(e,t=!1){var s;if(!e)return;if(e.tagName==="use"){const o=this._getSymbolBox(e);if(!o)return;t?(s=e.parentNode)==null||s.insertBefore(o,e):e.parentNode&&e.parentNode.contains(o)&&e.parentNode.removeChild(o);return}let r=e.getAttribute("class");r||(r=""),t?r="danger":r=It.replace(r,"danger","").trim(),e.setAttribute("class",r)}_getSymbolBox(e){if(!e)return;const t=e.id+"-boundingBox";let r=this.getElementById(t);if(r)return r;const s=this.getUseSymbol(e);if(!s)return;let o=this.getElementBoundingBox(e.id);if(!o||o.isEmpty())return;r=document.createElementNS("http://www.w3.org/2000/svg","rect"),r.setAttribute("id",t),r.setAttribute("class","danger"),r.setAttribute("x",o.min.x.toString()),r.setAttribute("y",o.min.y.toString());const u=new k;return o.getSize(u),r.setAttribute("width",u.x.toString()),r.setAttribute("height",u.y.toString()),s.getAttribute("transform")&&r.setAttribute("transform",s.getAttribute("transform")||""),s.getAttribute("style")&&r.setAttribute("style",s.getAttribute("style")||""),this.elementsMap[t]=r,r}getUseElementBoundingBoxWithSymbol(e){var c;if(!e)return;const t=(c=e.getAttribute("xlink:href"))==null?void 0:c.substring(1);if(!t)return;let r=this.getElementById(t);if(!r)return;const s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px";let o;if(It.lowerCase(r.tagName)==="symbol"){o=document.createElementNS("http://www.w3.org/2000/svg","g");for(let y=0,p=r.childNodes.length;y<p;y++){const A=r.childNodes[y].cloneNode(!0);o.appendChild(A)}}else o=r.cloneNode(!0);s.appendChild(o),o.setAttribute("style","stroke: #333333;"),document.body.appendChild(s);const u=s.getBBox();if(document.body.removeChild(s),!u)return;const h=new Mt;return h.set(new k(u.x,u.y),new k(u.x+u.width,u.y+u.height)),h}fontZoom(e,t=1){const r=this.getElementById(e);if(!r)return;let s=r.getAttribute("font-size");s||(s="12");const o=/(\d+)([a-zA-Z%]+)/.exec(s),u=o&&(o==null?void 0:o.length)>2?o[2]:"";let h=Math.round(parseFloat(s)*t*100)/100;r.setAttribute("font-size",h+u)}strokeWidthChanged(e=1){var y,p;const t=(y=this.svg)==null?void 0:y.querySelector("#mirror");if(!t){console.error("Cannot find g SVGElement with ID mirror");return}let r=(p=Ta(t,"stroke-width"))!=null?p:"1em";const s=String(r).match(/^([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(%|[a-z]*)$/i);if(!s){console.error("Invalid stroke-width format:",r);return}const o=parseFloat(s[1]),u=s[2]||"em",h=o*e,c=Number.isInteger(h)?h.toFixed(0):h.toString().replace(/\.?0+$/,"");t.setAttribute("stroke-width",`${c}${u}`),u==="em"&&(t.style.fontSize=`${c}${u}`)}getCentroid(e,t=new k){const r=e.getAttribute("insX"),s=e.getAttribute("insY");return r||s?t.set(Number(r||"0"),Number(s||"0")):this.getCentroidByDom(e,t)}getCentroidByDom(e,t=new k){const r=Number(e.getAttribute("x")||"0"),s=Number(e.getAttribute("y")||"0"),o=e.getBBox();let u=1,h=1,c=e.getAttribute("transform");if(!c)return t.set(r,s);const y=/scale\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(c);if(typeof y=="undefined"||y==null){const p=e.transform.baseVal;if(c&&p.numberOfItems>0){let A=p.getItem(0);A&&A.type===SVGTransform.SVG_TRANSFORM_SCALE&&(u=A.matrix.a!==0?A.matrix.a:1,h=A.matrix.d!==0?A.matrix.d:u)}else return t.set((o.x+o.width/2)*u,(o.y+o.height/2)*h)}else u=y[1]&&Number(y[1])>0?Number(y[1]):1,h=y[2]&&Number(y[2])>0?Number(y[2]):u;return r&&s?t.set(r*u,s*h):t.set((o.x+o.width/2)*u,(o.y+o.height/2)*h),t}linkAssetsByTree(e,t){if(e||(e=er.RM),this.clearLinkedLines(e),!t||!t.value)return;const r=this.getLinesByTree(t);this.drawLinkedLines(e,r)}clearLinkedLines(e){var s;const t=Ds(e);if(this.getElementById(t)){for(let o=((s=this._lastLinked)==null?void 0:s.length)-1;o>=0;o--){const u=this._lastLinked[o];u.parentNode&&u.parentNode.removeChild(u),this._lastLinked.splice(o,1)}this._lastLinked.length=0}}drawLinkedLines(e,t){var o;if(!(t!=null&&t.length))return;const r=Ds(e),s=this.getElementById(r);if(s)for(let u=0,h=t.length;u<h;u++){const c=t[u][0],y=t[u][((o=t[u])==null?void 0:o.length)-1],p=Vl("line");p.setAttribute("x1",c.x.toString()),p.setAttribute("y1",c.y.toString()),p.setAttribute("x2",y.x.toString()),p.setAttribute("y2",y.y.toString()),p.setAttribute("class","danger"),p.setAttribute("style","stroke-width: 2;"),s.appendChild(p),this._lastLinked.push(p)}}getLinesByTree(e,t=[]){var o;if(!(e!=null&&e.value))return t;const r=this.getElementBoundingBox(e.value);if(!r)return t;const s=r.getCenter();return(o=e.children)==null||o.forEach(u=>{var y;const h=this.getElementBoundingBox(u==null?void 0:u.value);if(!h)return;const c=h.getCenter();t.push([s,c]),(y=u.children)!=null&&y.length&&this.getLinesByTree(u,t)}),t}}const Ii=new k,Xo=new ge;class GA{constructor(e={},t){d(this,"name","SvgPainter");d(this,"params");d(this,"chef");this.params=e,this.chef=t}drawSocialDistanceCircles(e,t="http://www.w3.org/2000/svg"){var C,N,O;if(!e)return;const r=PE(e),s=zd(e),o=2*r,u=(N=(C=this.params.socialDistance)==null?void 0:C.colors)!=null&&N.length?(O=this.params.socialDistance)==null?void 0:O.colors:[Qt.green,Qt.red],h=this.getRadius(s),c=e.querySelector(`#${hh}`),y=c==null?void 0:c.querySelectorAll("path");if(!c||!(y!=null&&y.length))return;let p,A;const T=new Array;for(let L=0,P=(y==null?void 0:y.length)||0;L<P;L++){if(p=y[L],A=p.getAttribute("id"),!A)continue;const W=this.chef.getElementBoundingBox(A);if(!W)continue;const q=new k;W.getCenter(q),T.push({id:A,cp:q})}for(let L=0,P=T.length;L<P;L++){T[L].color=u[0];for(let W=0,q=P;W<q;W++)T[L]!==T[W]&&k.getDistance(T[L].cp,T[W].cp)<h*2&&(T[L].color=u[1])}for(let L=0,P=T.length;L<P;L++){let W=this.createCircle(T[L],h,o,t);c.appendChild(W)}}clearSocialDistanceCircles(e){if(!e)return;const t=e.querySelector(`#${hh}`),r=t==null?void 0:t.querySelectorAll("circle");if(!(!t||!(r!=null&&r.length)))for(let s=0,o=(r==null?void 0:r.length)||0;s<o;s++){const u=r[s].getAttribute("id");u&&(u==null?void 0:u.indexOf("_circle"))>-1&&t.removeChild(r[s])}}getRadius(e){var r,s,o;let t=((s=(r=this.params)==null?void 0:r.socialDistance)==null?void 0:s.radius)||3;return((o=this.params)==null?void 0:o.displayUnits)==="imperial"?e==="Metres"||e==="m"?t/=3.28084:e==="cm"?t=t/3.28084*100:e==="mm"?t=t/3.28084*1e3:(e==="INCH"||e==="inches")&&(t*=12):e==="INCH"||e==="inches"?t=t*3.28084*12:e==="cm"?t*=100:e==="mm"&&(t*=1e3),t}createCircle(e,t,r,s){const o=document.createElementNS(s,"circle");return o.setAttributeNS(null,"id",e.id+"_circle"),o.setAttributeNS(null,"cx",e.cp.x),o.setAttributeNS(null,"cy",e.cp.y),o.setAttributeNS(null,"r",String(t)),o.setAttributeNS(null,"style",`pointer-events:none;fill-opacity:0.1;stroke:${e.color};stroke-width:${r}px;`),o}}const YA=function(i){return(i||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")};function Eu(i,e){if(!i||!e)return!1;if(e.indexOf(" ")!==-1)throw new Error("className should not contain space.");return i.classList?i.classList.contains(e):(" "+i.className+" ").indexOf(" "+e+" ")>-1}function Na(i,e){if(!i)return;let t=i.className;const r=(e||"").split(" ");for(let s=0,o=r.length;s<o;s++){const u=r[s];u&&(i.classList?i.classList.add(u):Eu(i,u)||(t+=" "+u))}i.classList||(i.className=t)}function Ba(i,e){if(!i||!e)return;const t=e.split(" ");let r=" "+i.className+" ";for(let s=0,o=t.length;s<o;s++){const u=t[s];u&&(i.classList?i.classList.remove(u):Eu(i,u)&&(r=r.replace(" "+u+" "," ")))}i.classList||(i.className=YA(r))}class Nh extends YE{constructor(t={}){super();d(this,"isSvgScene",!0);d(this,"name","SvgScene");d(this,"dynamically",!0);d(this,"params");d(this,"socialDistanceEnable",!1);d(this,"container");d(this,"svg");d(this,"svgStr","");d(this,"svgRoot");d(this,"viewBox",new Mt);d(this,"chef");d(this,"defaultLayers",[]);d(this,"skeletonLayers",[]);d(this,"currentLayers",[]);d(this,"assetType");d(this,"assetsMap",{});d(this,"legend",[]);d(this,"selectedList",[]);d(this,"painter");d(this,"_lastHighlightType","");d(this,"_lastHighlightIds",[]);d(this,"clickSvgElementHandler",this.handleClickSvgElement.bind(this));d(this,"_lastLinkedIds",[]);this.params=t,this.assetType=t.assetType||er.RM,this.params.socialDistanceEnable&&(this.socialDistanceEnable=!0),this.container=this.params.containerId?document.getElementById(this.params.containerId):Wt.window.document.getElementsByTagName("body")[0],this.chef=new $A,this.painter=new GA(t,this.chef)}get isMounted(){var t;return((t=this.container.querySelectorAll("svg"))==null?void 0:t.length)>0}destroy(){var t;super.destroy(),this.unmount(),(t=this.camera)==null||t.destroy()}mount(){this.svg&&(this.container.contains(this.svg)||this.container.appendChild(this.svg),this.chef.computeBoundingBoxMap())}unmount(){this.svg&&this.svg.parentNode&&this.container.contains(this.svg)&&this.container.removeChild(this.svg)}computeBoundingBox(){return this.boundingBox.makeEmpty(),!this.chef||!this.svg?this.boundingBox:(this.chef.computeBoundingBoxMap(),this.boundingBox.copy(this.chef.boundingBox),console.warn("svgScene.computeBoundingBox: ",this.chef.boundingBox.toString()),this.boundingBox)}load(t){return Tt(this,null,function*(){return new Zd().loadAsync(t)})}bind(t){this.svgStr=t;const r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;return this.bindSvg(r),!0}bindSvg(t){if(this.svg=t,!this.svg)throw new Error("svg load failed");let r=this.svg.getAttribute("viewBox");r&&(FE(r,this.viewBox),this.chef.bindSvg(this.svg),this.svgRoot=$d(this.svg),this.svg.setAttribute("viewBox",`0 0 ${this.params.width} ${this.params.height}`),this.svg.setAttribute("style","transform: translateZ(0);"),this.appendStyles(),console.log(this.name,"viewBox -> ",r,this.viewBox.toString()),this.setAssetsMap(this.assetType,this.assetsMap))}recompute(t){t&&(this.bindSvg(t),this.computeBoundingBox(),this.viewBox.copy(this.boundingBox))}appendStyles(){var r;let t=(r=this.svg)==null?void 0:r.querySelector("style");t&&(t.appendChild(document.createTextNode(`.default { stroke: ${this.params.defaultStroke}; fill: ${this.params.defaultFill}; }`)),t.appendChild(document.createTextNode(`.info { stroke: ${this.params.infoStroke}; fill: ${this.params.infoFill}; }`)),t.appendChild(document.createTextNode(`.primary { stroke: ${this.params.primaryStroke}; fill: ${this.params.primaryFill}; }`)),t.appendChild(document.createTextNode(`.success { stroke: ${this.params.successStroke}; fill: ${this.params.successFill}; }`)),t.appendChild(document.createTextNode(`.warning { stroke: ${this.params.warningStroke}; fill: ${this.params.warningFill}; }`)),t.appendChild(document.createTextNode(`.danger { stroke: ${this.params.dangerStroke}; fill: ${this.params.dangerFill}; }`)),t.appendChild(document.createTextNode(`.active { stroke: ${this.params.activeStroke}; fill: ${this.params.activeFill}; }`)),t.appendChild(document.createTextNode(`text { font-family: ${this.params.fontFamily||"simhei"}; }`)))}getLayers(t=2){return this.svg?this.chef.getLayers(t):[]}setDefaultLayers(t){t!=null&&t.length&&(this.defaultLayers=t)}setSkeletonLayers(t){t!=null&&t.length&&(this.skeletonLayers=t)}setCurrentLayers(t){t!=null&&t.length&&(this.currentLayers=t)}showDefaultLayers(t,r=!1){this.setDefaultLayers(t),this.chef.updateLayersVisibility(t,r)}getLayerVisible(t){return this.chef.getLayerVisible(t)}updateLayersVisibility(t,r=!1,s=!0){this.chef.updateLayersVisibility(t,r,s)}setAssetType(t,r){this.assetsMap={},this.assetType=t,this.setAssetsMap(this.assetType,this.assetsMap),r||(r=[Ds(t)],t!==er.RM&&r.unshift(Ds(er.RM))),this.setDefaultLayers(r),this.updateLayersVisibility(this.defaultLayers,!0)}isBelongsToAssetType(t,r){r||(r=this.assetType);const s=this.getAssetsByType(r);return s?!!(s!=null&&s.hasOwnProperty(t)):!1}setAssetsMap(t,r={}){const s=this.chef.getElementById(Ds(t));if(!s)return r;r[t]=this.chef.getElementsMap(s);const o=_a(t),u=this.chef.getElementById(o);if(!u)return r;const h=this.chef.getElementsMap(u),c=It.keys(h);if(!(c!=null&&c.length))return r;if(It.startsWith(c[0],`l-${t}-`)){const y=`l-${t}-`.length;for(let p=0,A=c.length;p<A;p++){const T=c[p].slice(y);h[T]=h[c[p]],delete h[c[p]]}}return r[o]=h,r}getAssetsByType(t){return this.assetsMap.hasOwnProperty(t)||this.setAssetsMap(t,this.assetsMap),this.assetsMap[t]}getElementById(t){if(!t)return;const r=this.getAssetsByType(this.assetType);if(!(!r||!Object.hasOwnProperty.call(r,t)))return r[t]}getAssetIdsByType(t){const r=this.getAssetsByType(t),s=[];return r?It.keys(r):s}clearFillOrStroke(t="fill"){const r=this.getAssetsByType(this.assetType);if(!r)return;const s=It.keys(r);let o;for(let u=0,h=s.length;u<h;u++)o=r[s[u]],o&&(o.hasAttribute(t)&&o.removeAttribute(t),t==="stroke"&&o.removeAttribute("stroke-width"));this.clearLegendBy(t)}clearFillOrStrokeByIds(t,r="fill"){const s=this.getAssetsByType(this.assetType);if(!s)return;const o=It.keys(s);let u;for(let h=0,c=o.length;h<c;h++)t!=null&&t.length&&!t.includes(o[h])||(u=s[o[h]],!(!u||!u.hasAttribute(r))&&(u.removeAttribute(r),r==="stroke"&&u.removeAttribute("stroke-width")));this.clearLegendBy(r)}setFillOrStrokeByIds(t,r,s="fill",o="7em"){const u=this.getAssetsByType(this.assetType);if(!u)return;const h=It.keys(u);let c;for(let y=0,p=h.length;y<p;y++)t.includes(h[y])&&(c=u[h[y]],c&&(c.setAttribute(s,r),s==="stroke"&&c.setAttribute("stroke-width",o),this.addLegend(s,r,h[y])))}addLegend(t,r,s){let o=this.legend.find(u=>u.color===r);o||(o={type:t,color:r,ids:[]},this.legend.push(o)),o.ids.push(s)}clearLegendBy(t){var r;t||(this.legend.length=0);for(let s=((r=this.legend)==null?void 0:r.length)-1;s>=0;s--)this.legend[s].type===t&&this.legend.splice(s,s)}getLegend(){return this.legend}showSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.defaultLayers,!1),this.chef.updateLayersVisibility(this.skeletonLayers,!0))}hideSkeleton(){var t;(t=this.skeletonLayers)!=null&&t.length&&(this.chef.updateLayersVisibility(this.skeletonLayers,!1),this.chef.updateLayersVisibility(this.defaultLayers,!0))}setAssetLabels(t,r){this.chef.setLabelsById(t,r,this.assetType)}getAssetLabelsMap(t){var o,u;if(!t)return;const r=_a(t);let s=this.getAssetsByType(r);if(!s||!((o=Object.keys(s))!=null&&o.length)){let h=this.chef.getElementById(r);if(h||(h=this.chef.getElementById(t+"-txt-label")),!h)return;s=this.chef.getElementsMap(h),this.assetsMap[r]=s}if(!(!s||!((u=Object.keys(s))!=null&&u.length)))return s}getAssetLabelById(t,r){var h,c;const s=this.getAssetLabelsMap(t);if(!s)return;let o=s[r];if(o&&((h=o==null?void 0:o.childNodes)!=null&&h.length))return o.childNodes[0].textContent||"";const u="l-"+t+"-"+r;if(o=s[u],o&&((c=o==null?void 0:o.children)!=null&&c.length))return o.children[0].textContent||""}clearAssetLabels(){this.chef.clearAssetLabelsByType(this.assetType)}bindAssetsEvents(t){var o;const r=(o=this.svg)==null?void 0:o.querySelector("#"+t);if(!r)return;r.querySelectorAll("[id]").forEach(u=>{u instanceof SVGElement&&u.addEventListener("click",this.clickSvgElementHandler)})}handleClickSvgElement(t){var r;typeof t.preventDefault=="function"&&t.preventDefault(),console.warn("svgScene.handleClickSvgElement: ",(r=t==null?void 0:t.target)==null?void 0:r.id,t==null?void 0:t.target),this.dispatchEvent({type:"click",data:t})}socialDistanceEnableChanged(t){this.socialDistanceEnable=!!t,t?this.painter.drawSocialDistanceCircles(this.svg):this.painter.clearSocialDistanceCircles(this.svg)}highlightAssets(t,r){var o;this.resetHighlightAssets(t);const s=this.getAssetsByType(t);!s||!((o=Object.keys(s))!=null&&o.length)||(this._lastHighlightType=t,this._lastHighlightIds=Array.isArray(r)?r:[r],this._lastHighlightIds.forEach(u=>{u&&s[u]&&Na(s[u],"active")}))}resetHighlightAssets(t){var s;const r=this.getAssetsByType(t||this._lastHighlightType);!r||!((s=Object.keys(r))!=null&&s.length)||(this._lastHighlightIds.forEach(o=>{o&&r[o]&&Ba(r[o],"active")}),this._lastHighlightIds.length=0)}getIntersectObjects(t,r=er.RM,s=[]){s.length=0;const o=[],u=this.getAssetsByType(r);if(!u)return s;const h=It.keys(u);for(let y=0,p=h.length;y<p;y++){const A=this.chef.getElementBoundingBox(u[h[y]].id);A&&A.containsPoint(t.worldCoords)&&o.push(u[h[y]])}const c=It.sortBy(o,y=>{var p;return(p=this.chef.getElementBoundingBox(y.id))==null?void 0:p.getArea()});return s.push(...c),s}clearSelected(){var t,r;if((t=this.selectedList)!=null&&t.length)for(let s=((r=this.selectedList)==null?void 0:r.length)-1;s>=0;s--){let o=this.selectedList[s];this.selectedList.splice(s,1),this.chef.setElementState2selected(o,!1)}}clearSelectedById(t){var s,o;let r=(s=this.selectedList)==null?void 0:s.findIndex(u=>u.getAttribute("id")===t);r>-1&&(this.chef.setElementState2selected(this.selectedList[r],!1),(o=this.selectedList)==null||o.splice(r||0,1))}selectByIds(t,r=!1){Array.isArray(t)||(t=[t]),r||this.clearSelected();const s=It.uniq(It.map(this.selectedList,u=>u.getAttribute("id")||"")),o=this.getAssetsByType(this.assetType);if(o){for(let u=t.length-1;u>=0;u--)s.includes(t[u])?(this.clearSelectedById(t[u]),t.splice(u,1)):Object.hasOwnProperty.call(o,t[u])&&this.selectedList.push(o[t[u]]);this.selectedList.forEach(u=>{this.chef.setElementState2selected(u,!0)})}}getSelectedIds(){var r;if(!((r=this.selectedList)!=null&&r.length))return;const t=[];for(let s=0,o=this.selectedList.length;s<o;s++)this.selectedList[s].id&&t.push(this.selectedList[s].id);return t}getSelectedBoundingBox(){var r;const t=new Mt;return(r=this.selectedList)!=null&&r.length?(this.selectedList.forEach(s=>{const o=this.chef.boundingBoxMap[s.id];o&&t.expandByBox(o)}),t):t.copy(this.boundingBox)}getElementsByBox(t){const r=[],s=Object.keys(this.chef.boundingBoxMap),o=this.getAssetsByType(this.assetType);if(!o)return r;for(let u=0,h=s.length;u<h;u++)if(o.hasOwnProperty(s[u])&&!(s[u].indexOf("-assets")>-1)&&t.intersectsBox(this.chef.boundingBoxMap[s[u]])){const c=o[s[u]];c&&r.push(c)}return r}getBoundingBoxByIds(t){var s,o;if(!t||Array.isArray(t)&&!t.length)return;Array.isArray(t)||(t=[t]);const r=new Mt;for(let u=0,h=t==null?void 0:t.length;u<h;u++)(o=(s=this.chef)==null?void 0:s.boundingBoxMap)!=null&&o.hasOwnProperty(t[u])&&r.expandByBox(this.chef.boundingBoxMap[t[u]]);return r}getBoundingBoxById(t){if(this.chef.boundingBoxMap.hasOwnProperty(t))return new Mt().copy(this.chef.boundingBoxMap[t])}linkAssetsByTree(t){this.chef.linkAssetsByTree(this.assetType,t);const r=this.chef.getElementById(Va.ASSET_LABELS);r&&(r.style.display="block");const s=_a(this.assetType),o=this.chef.getElementById(s);o&&(o.style.display="block");const u=this.assetsMap[s];u&&(this._lastLinkedIds.forEach(h=>{u[h]&&(u[h].style.display="none")}),this._lastLinkedIds=qd(t),this._lastLinkedIds.forEach(h=>{u[h]&&(u[h].style.display="block")}))}onBeforeRender(){}fullscreen(t=1e3,r=!1){}update(){}}class XA extends Nh{constructor(t){super(t);d(this,"name","SvgLoadingScene");this.bind(`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-200 -200 500 500">
35
35
  <view id="defaultView" viewBox="-200 -200 500 500" />
36
36
  <style>
37
37
  /*#svg-loading-fast circle {animation: svg-loading-fast 2s ease infinite;}*/