@panoramax/web-viewer 5.2.0-develop-08c7a778 → 5.2.0-develop-bd0c390b
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/build/cjs/index.js
CHANGED
|
@@ -24,7 +24,7 @@ const E=globalThis,k=e=>e,S=E.trustedTypes,M=S?S.createPolicy("lit-html",{create
|
|
|
24
24
|
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
|
|
25
25
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
26
26
|
* Copyright 2024 Fonticons, Inc.
|
|
27
|
-
*/function gt(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ft(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function At(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(i),!0).forEach(function(t){gt(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ft(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}const _t=()=>{};let vt={},yt={},xt=null,bt={mark:_t,measure:_t};try{"undefined"!=typeof window&&(vt=window),"undefined"!=typeof document&&(yt=document),"undefined"!=typeof MutationObserver&&(xt=MutationObserver),"undefined"!=typeof performance&&(bt=performance)}catch(y2){}const{userAgent:wt=""}=vt.navigator||{},Et=vt,kt=yt,St=xt,Mt=bt;Et.document;const Ct=!!kt.documentElement&&!!kt.head&&"function"==typeof kt.addEventListener&&"function"==typeof kt.createElement,Tt=~wt.indexOf("MSIE")||~wt.indexOf("Trident/");var Dt={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"}},Pt=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],It="classic",Ft="duotone",zt=[It,Ft,"sharp","sharp-duotone"],Rt=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}]]),Lt=["fak","fa-kit","fakd","fa-kit-duotone"],Bt={fak:"kit","fa-kit":"kit"},Ot={fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"},Ut=["fak","fakd"],Nt={kit:"fak"},jt={"kit-duotone":"fakd"},Vt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},qt=["fak","fa-kit","fakd","fa-kit-duotone"],Gt={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"}},Ht=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt","fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands"],Wt=[1,2,3,4,5,6,7,8,9,10],Zt=Wt.concat([11,12,13,14,15,16,17,18,19,20]),Kt=[...Object.keys({classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"]}),"solid","regular","light","thin","duotone","brands","2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Vt.GROUP,Vt.SWAP_OPACITY,Vt.PRIMARY,Vt.SECONDARY].concat(Wt.map(e=>"".concat(e,"x"))).concat(Zt.map(e=>"w-".concat(e)));const Xt="___FONT_AWESOME___",Qt=16,Yt="svg-inline--fa",Jt="data-fa-i2svg",$t="data-fa-pseudo-element",ei="data-prefix",ti="data-icon",ii="fontawesome-i2svg",ni=["HTML","HEAD","STYLE","SCRIPT"],ai=(()=>{try{return"production"===process.env.NODE_ENV}catch(e){return!1}})();function ri(e){return new Proxy(e,{get:(e,t)=>t in e?e[t]:e[It]})}const si=At({},Dt);si[It]=At(At(At(At({},{"fa-duotone":"duotone"}),Dt[It]),Bt),Ot);const oi=ri(si),li=At({},{classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",brands:"fab"},duotone:{solid:"fad",regular:"fadr",light:"fadl",thin:"fadt"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds",regular:"fasdr",light:"fasdl",thin:"fasdt"}});li[It]=At(At(At(At({},{duotone:"fad"}),li[It]),Nt),jt);const ci=ri(li),ui=At({},Gt);ui[It]=At(At({},ui[It]),{fak:"fa-kit"});const hi=ri(ui),di=At({},{classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"}});di[It]=At(At({},di[It]),{"fa-kit":"fak"}),ri(di);const pi=/fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,mi="fa-layers-text",gi=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;ri(At({},{classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"}}));const fi=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],Ai={GROUP:"duotone-group",PRIMARY:"primary",SECONDARY:"secondary"},_i=["kit",...Kt],vi=Et.FontAwesomeConfig||{};if(kt&&"function"==typeof kt.querySelector){[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(e=>{let[t,i]=e;const n=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=kt.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(t));null!=n&&(vi[i]=n)})}const yi={styleDefault:"solid",familyDefault:It,cssPrefix:"fa",replacementClass:Yt,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};vi.familyPrefix&&(vi.cssPrefix=vi.familyPrefix);const xi=At(At({},yi),vi);xi.autoReplaceSvg||(xi.observeMutations=!1);const bi={};Object.keys(yi).forEach(e=>{Object.defineProperty(bi,e,{enumerable:!0,set:function(t){xi[e]=t,wi.forEach(e=>e(bi))},get:function(){return xi[e]}})}),Object.defineProperty(bi,"familyPrefix",{enumerable:!0,set:function(e){xi.cssPrefix=e,wi.forEach(e=>e(bi))},get:function(){return xi.cssPrefix}}),Et.FontAwesomeConfig=bi;const wi=[];const Ei=Qt,ki={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function Si(){let e=12,t="";for(;e-- >0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function Mi(e){const t=[];for(let i=(e||[]).length>>>0;i--;)t[i]=e[i];return t}function Ci(e){return e.classList?Mi(e.classList):(e.getAttribute("class")||"").split(" ").filter(e=>e)}function Ti(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Di(e){return Object.keys(e||{}).reduce((t,i)=>t+"".concat(i,": ").concat(e[i].trim(),";"),"")}function Pi(e){return e.size!==ki.size||e.x!==ki.x||e.y!==ki.y||e.rotate!==ki.rotate||e.flipX||e.flipY}function Ii(){const e="fa",t=Yt,i=bi.cssPrefix,n=bi.replacementClass;let a=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-duotone-regular: normal 400 1em/1 "Font Awesome 6 Duotone";\n --fa-font-duotone-light: normal 300 1em/1 "Font Awesome 6 Duotone";\n --fa-font-duotone-thin: normal 100 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone";\n --fa-font-sharp-duotone-regular: normal 400 1em/1 "Font Awesome 6 Sharp Duotone";\n --fa-font-sharp-duotone-light: normal 300 1em/1 "Font Awesome 6 Sharp Duotone";\n --fa-font-sharp-duotone-thin: normal 100 1em/1 "Font Awesome 6 Sharp Duotone";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-counter-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(-1 * var(--fa-li-width, 2em));\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n animation-name: fa-beat;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n animation-name: fa-bounce;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n animation-name: fa-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n animation-name: fa-beat-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n animation-name: fa-flip;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n animation-name: fa-shake;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n animation-name: fa-spin;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 2s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n animation-name: fa-spin;\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n animation-delay: -1ms;\n animation-duration: 1ms;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n transform: scale(1);\n }\n 45% {\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-bounce {\n 0% {\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-flip {\n 50% {\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-shake {\n 0% {\n transform: rotate(-15deg);\n }\n 4% {\n transform: rotate(15deg);\n }\n 8%, 24% {\n transform: rotate(-18deg);\n }\n 12%, 28% {\n transform: rotate(18deg);\n }\n 16% {\n transform: rotate(-22deg);\n }\n 20% {\n transform: rotate(22deg);\n }\n 32% {\n transform: rotate(-12deg);\n }\n 36% {\n transform: rotate(12deg);\n }\n 40%, 100% {\n transform: rotate(0deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}';if(i!==e||n!==t){const r=new RegExp("\\.".concat(e,"\\-"),"g"),s=new RegExp("\\--".concat(e,"\\-"),"g"),o=new RegExp("\\.".concat(t),"g");a=a.replace(r,".".concat(i,"-")).replace(s,"--".concat(i,"-")).replace(o,".".concat(n))}return a}let Fi=!1;function zi(){bi.autoAddCss&&!Fi&&(!function(e){if(!e||!Ct)return;const t=kt.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const i=kt.head.childNodes;let n=null;for(let e=i.length-1;e>-1;e--){const t=i[e],a=(t.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(n=t)}kt.head.insertBefore(t,n)}(Ii()),Fi=!0)}var Ri={mixout:()=>({dom:{css:Ii,insertCss:zi}}),hooks:()=>({beforeDOMElementCreation(){zi()},beforeI2svg(){zi()}})};const Li=Et||{};Li[Xt]||(Li[Xt]={}),Li[Xt].styles||(Li[Xt].styles={}),Li[Xt].hooks||(Li[Xt].hooks={}),Li[Xt].shims||(Li[Xt].shims=[]);var Bi=Li[Xt];const Oi=[],Ui=function(){kt.removeEventListener("DOMContentLoaded",Ui),Ni=1,Oi.map(e=>e())};let Ni=!1;function ji(e){const{tag:t,attributes:i={},children:n=[]}=e;return"string"==typeof e?Ti(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce((t,i)=>t+"".concat(i,'="').concat(Ti(e[i]),'" '),"").trim()}(i),">").concat(n.map(ji).join(""),"</").concat(t,">")}function Vi(e,t,i){if(e&&e[t]&&e[t][i])return{prefix:t,iconName:i,icon:e[t][i]}}Ct&&(Ni=(kt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(kt.readyState),Ni||kt.addEventListener("DOMContentLoaded",Ui));var qi=function(e,t,i,n){var a,r,s,o=Object.keys(e),l=o.length,c=t;for(void 0===i?(a=1,s=e[o[0]]):(a=0,s=i);a<l;a++)s=c(s,e[r=o[a]],r,e);return s};function Gi(e){const t=function(e){const t=[];let i=0;const n=e.length;for(;i<n;){const a=e.charCodeAt(i++);if(a>=55296&&a<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&a)<<10)+(1023&n)+65536):(t.push(a),i--)}else t.push(a)}return t}(e);return 1===t.length?t[0].toString(16):null}function Hi(e){return Object.keys(e).reduce((t,i)=>{const n=e[i];return!!n.icon?t[n.iconName]=n.icon:t[i]=n,t},{})}function Wi(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{skipHooks:n=!1}=i,a=Hi(t);"function"!=typeof Bi.hooks.addPack||n?Bi.styles[e]=At(At({},Bi.styles[e]||{}),a):Bi.hooks.addPack(e,Hi(t)),"fas"===e&&Wi("fa",t)}const{styles:Zi,shims:Ki}=Bi,Xi=Object.keys(hi),Qi=Xi.reduce((e,t)=>(e[t]=Object.keys(hi[t]),e),{});let Yi=null,Ji={},$i={},en={},tn={},nn={};function an(e,t){const i=t.split("-"),n=i[0],a=i.slice(1).join("-");return n!==e||""===a||(r=a,~_i.indexOf(r))?null:a;var r}const rn=()=>{const e=e=>qi(Zi,(t,i,n)=>(t[n]=qi(i,e,{}),t),{});Ji=e((e,t,i)=>{if(t[3]&&(e[t[3]]=i),t[2]){t[2].filter(e=>"number"==typeof e).forEach(t=>{e[t.toString(16)]=i})}return e}),$i=e((e,t,i)=>{if(e[i]=i,t[2]){t[2].filter(e=>"string"==typeof e).forEach(t=>{e[t]=i})}return e}),nn=e((e,t,i)=>{const n=t[2];return e[i]=i,n.forEach(t=>{e[t]=i}),e});const t="far"in Zi||bi.autoFetchSvg,i=qi(Ki,(e,i)=>{const n=i[0];let a=i[1];const r=i[2];return"far"!==a||t||(a="fas"),"string"==typeof n&&(e.names[n]={prefix:a,iconName:r}),"number"==typeof n&&(e.unicodes[n.toString(16)]={prefix:a,iconName:r}),e},{names:{},unicodes:{}});en=i.names,tn=i.unicodes,Yi=un(bi.styleDefault,{family:bi.familyDefault})};function sn(e,t){return(Ji[e]||{})[t]}function on(e,t){return(nn[e]||{})[t]}function ln(e){return en[e]||{prefix:null,iconName:null}}function cn(){return Yi}!function(e){wi.push(e)}(e=>{Yi=un(e.styleDefault,{family:bi.familyDefault})}),rn();function un(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{family:i=It}=t,n=oi[i][e];if(i===Ft&&!e)return"fad";const a=ci[i][e]||ci[i][n],r=e in Bi.styles?e:null;return a||r||null}function hn(e){return e.sort().filter((e,t,i)=>i.indexOf(e)===t)}function dn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipLookups:i=!1}=t;let n=null;const a=Ht.concat(qt),r=hn(e.filter(e=>a.includes(e))),s=hn(e.filter(e=>!Ht.includes(e))),o=r.filter(e=>(n=e,!Pt.includes(e))),[l=null]=o,c=function(e){let t=It;const i=Xi.reduce((e,t)=>(e[t]="".concat(bi.cssPrefix,"-").concat(t),e),{});return zt.forEach(n=>{(e.includes(i[n])||e.some(e=>Qi[n].includes(e)))&&(t=n)}),t}(r),u=At(At({},function(e){let t=[],i=null;return e.forEach(e=>{const n=an(bi.cssPrefix,e);n?i=n:e&&t.push(e)}),{iconName:i,rest:t}}(s)),{},{prefix:un(l,{family:c})});return At(At(At({},u),function(e){const{values:t,family:i,canonical:n,givenPrefix:a="",styles:r={},config:s={}}=e,o=i===Ft,l=t.includes("fa-duotone")||t.includes("fad"),c="duotone"===s.familyDefault,u="fad"===n.prefix||"fa-duotone"===n.prefix;!o&&(l||c||u)&&(n.prefix="fad");(t.includes("fa-brands")||t.includes("fab"))&&(n.prefix="fab");if(!n.prefix&&pn.includes(i)){const e=Object.keys(r).find(e=>mn.includes(e));if(e||s.autoFetchSvg){const e=Rt.get(i).defaultShortPrefixId;n.prefix=e,n.iconName=on(n.prefix,n.iconName)||n.iconName}}"fa"!==n.prefix&&"fa"!==a||(n.prefix=cn()||"fas");return n}({values:e,family:c,styles:Zi,config:bi,canonical:u,givenPrefix:n})),function(e,t,i){let{prefix:n,iconName:a}=i;if(e||!n||!a)return{prefix:n,iconName:a};const r="fa"===t?ln(a):{},s=on(n,a);a=r.iconName||s||a,n=r.prefix||n,"far"!==n||Zi.far||!Zi.fas||bi.autoFetchSvg||(n="fas");return{prefix:n,iconName:a}}(i,n,u))}const pn=zt.filter(e=>e!==It||e!==Ft),mn=Object.keys(Gt).filter(e=>e!==It).map(e=>Object.keys(Gt[e])).flat();let gn=[],fn={};const An={},_n=Object.keys(An);function vn(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];return(fn[e]||[]).forEach(e=>{t=e.apply(null,[t,...n])}),t}function yn(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];(fn[e]||[]).forEach(e=>{e.apply(null,i)})}function xn(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return An[e]?An[e].apply(null,t):void 0}function bn(e){"fa"===e.prefix&&(e.prefix="fas");let{iconName:t}=e;const i=e.prefix||cn();if(t)return t=on(i,t)||t,Vi(wn.definitions,i,t)||Vi(Bi.styles,i,t)}const wn=new class{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.reduce(this._pullDefinitions,{});Object.keys(n).forEach(e=>{this.definitions[e]=At(At({},this.definitions[e]||{}),n[e]),Wi(e,n[e]);const t=hi[It][e];t&&Wi(t,n[e]),rn()})}reset(){this.definitions={}}_pullDefinitions(e,t){const i=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(i).map(t=>{const{prefix:n,iconName:a,icon:r}=i[t],s=r[2];e[n]||(e[n]={}),s.length>0&&s.forEach(t=>{"string"==typeof t&&(e[n][t]=r)}),e[n][a]=r}),e}},En={i2svg:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ct?(yn("beforeI2svg",e),xn("pseudoElements2svg",e),xn("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;!1===bi.autoReplaceSvg&&(bi.autoReplaceSvg=!0),bi.observeMutations=!0,function(e){Ct&&(Ni?setTimeout(e,0):Oi.push(e))}(()=>{Mn({autoReplaceSvgRoot:t}),yn("watch",e)})}},kn={icon:e=>{if(null===e)return null;if("object"==typeof e&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:on(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){const t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],i=un(e[0]);return{prefix:i,iconName:on(i,t)||t}}if("string"==typeof e&&(e.indexOf("".concat(bi.cssPrefix,"-"))>-1||e.match(pi))){const t=dn(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||cn(),iconName:on(t.prefix,t.iconName)||t.iconName}}if("string"==typeof e){const t=cn();return{prefix:t,iconName:on(t,e)||e}}}},Sn={noAuto:()=>{bi.autoReplaceSvg=!1,bi.observeMutations=!1,yn("noAuto")},config:bi,dom:En,parse:kn,library:wn,findIconDefinition:bn,toHtml:ji},Mn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t=kt}=e;(Object.keys(Bi.styles).length>0||bi.autoFetchSvg)&&Ct&&bi.autoReplaceSvg&&Sn.dom.i2svg({node:t})};function Cn(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(e=>ji(e))}}),Object.defineProperty(e,"node",{get:function(){if(!Ct)return;const t=kt.createElement("div");return t.innerHTML=e.html,t.children}}),e}function Tn(e){const{icons:{main:t,mask:i},prefix:n,iconName:a,transform:r,symbol:s,title:o,maskId:l,titleId:c,extra:u,watchable:h=!1}=e,{width:d,height:p}=i.found?i:t,m=Ut.includes(n),g=[bi.replacementClass,a?"".concat(bi.cssPrefix,"-").concat(a):""].filter(e=>-1===u.classes.indexOf(e)).filter(e=>""!==e||!!e).concat(u.classes).join(" ");let f={children:[],attributes:At(At({},u.attributes),{},{"data-prefix":n,"data-icon":a,class:g,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(p)})};const A=m&&!~u.classes.indexOf("fa-fw")?{width:"".concat(d/p*16*.0625,"em")}:{};h&&(f.attributes[Jt]=""),o&&(f.children.push({tag:"title",attributes:{id:f.attributes["aria-labelledby"]||"title-".concat(c||Si())},children:[o]}),delete f.attributes.title);const _=At(At({},f),{},{prefix:n,iconName:a,main:t,mask:i,maskId:l,transform:r,symbol:s,styles:At(At({},A),u.styles)}),{children:v,attributes:y}=i.found&&t.found?xn("generateAbstractMask",_)||{children:[],attributes:{}}:xn("generateAbstractIcon",_)||{children:[],attributes:{}};return _.children=v,_.attributes=y,s?function(e){let{prefix:t,iconName:i,children:n,attributes:a,symbol:r}=e;const s=!0===r?"".concat(t,"-").concat(bi.cssPrefix,"-").concat(i):r;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:At(At({},a),{},{id:s}),children:n}]}]}(_):function(e){let{children:t,main:i,mask:n,attributes:a,styles:r,transform:s}=e;if(Pi(s)&&i.found&&!n.found){const{width:e,height:t}=i,n={x:e/t/2,y:.5};a.style=Di(At(At({},r),{},{"transform-origin":"".concat(n.x+s.x/16,"em ").concat(n.y+s.y/16,"em")}))}return[{tag:"svg",attributes:a,children:t}]}(_)}function Dn(e){const{content:t,width:i,height:n,transform:a,title:r,extra:s,watchable:o=!1}=e,l=At(At(At({},s.attributes),r?{title:r}:{}),{},{class:s.classes.join(" ")});o&&(l[Jt]="");const c=At({},s.styles);Pi(a)&&(c.transform=function(e){let{transform:t,width:i=Qt,height:n=Qt,startCentered:a=!1}=e,r="";return r+=a&&Tt?"translate(".concat(t.x/Ei-i/2,"em, ").concat(t.y/Ei-n/2,"em) "):a?"translate(calc(-50% + ".concat(t.x/Ei,"em), calc(-50% + ").concat(t.y/Ei,"em)) "):"translate(".concat(t.x/Ei,"em, ").concat(t.y/Ei,"em) "),r+="scale(".concat(t.size/Ei*(t.flipX?-1:1),", ").concat(t.size/Ei*(t.flipY?-1:1),") "),r+="rotate(".concat(t.rotate,"deg) "),r}({transform:a,startCentered:!0,width:i,height:n}),c["-webkit-transform"]=c.transform);const u=Di(c);u.length>0&&(l.style=u);const h=[];return h.push({tag:"span",attributes:l,children:[t]}),r&&h.push({tag:"span",attributes:{class:"sr-only"},children:[r]}),h}const{styles:Pn}=Bi;function In(e){const t=e[0],i=e[1],[n]=e.slice(4);let a=null;return a=Array.isArray(n)?{tag:"g",attributes:{class:"".concat(bi.cssPrefix,"-").concat(Ai.GROUP)},children:[{tag:"path",attributes:{class:"".concat(bi.cssPrefix,"-").concat(Ai.SECONDARY),fill:"currentColor",d:n[0]}},{tag:"path",attributes:{class:"".concat(bi.cssPrefix,"-").concat(Ai.PRIMARY),fill:"currentColor",d:n[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:n}},{found:!0,width:t,height:i,icon:a}}const Fn={found:!1,width:512,height:512};function zn(e,t){let i=t;return"fa"===t&&null!==bi.styleDefault&&(t=cn()),new Promise((n,a)=>{if("fa"===i){const i=ln(e)||{};e=i.iconName||e,t=i.prefix||t}if(e&&t&&Pn[t]&&Pn[t][e]){return n(In(Pn[t][e]))}!function(e,t){ai||bi.showMissingIcons||!e||console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}(e,t),n(At(At({},Fn),{},{icon:bi.showMissingIcons&&e&&xn("missingIconAbstract")||{}}))})}const Rn=()=>{},Ln=bi.measurePerformance&&Mt&&Mt.mark&&Mt.measure?Mt:{mark:Rn,measure:Rn},Bn='FA "6.7.2"',On=e=>{Ln.mark("".concat(Bn," ").concat(e," ends")),Ln.measure("".concat(Bn," ").concat(e),"".concat(Bn," ").concat(e," begins"),"".concat(Bn," ").concat(e," ends"))};var Un=e=>(Ln.mark("".concat(Bn," ").concat(e," begins")),()=>On(e));const Nn=()=>{};function jn(e){return"string"==typeof(e.getAttribute?e.getAttribute(Jt):null)}function Vn(e){return kt.createElementNS("http://www.w3.org/2000/svg",e)}function qn(e){return kt.createElement(e)}function Gn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ceFn:i=("svg"===e.tag?Vn:qn)}=t;if("string"==typeof e)return kt.createTextNode(e);const n=i(e.tag);Object.keys(e.attributes||[]).forEach(function(t){n.setAttribute(t,e.attributes[t])});return(e.children||[]).forEach(function(e){n.appendChild(Gn(e,{ceFn:i}))}),n}const Hn={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach(e=>{t.parentNode.insertBefore(Gn(e),t)}),null===t.getAttribute(Jt)&&bi.keepOriginalSource){let e=kt.createComment(function(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(e){const t=e[0],i=e[1];if(~Ci(t).indexOf(bi.replacementClass))return Hn.replace(e);const n=new RegExp("".concat(bi.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){const e=i[0].attributes.class.split(" ").reduce((e,t)=>(t===bi.replacementClass||t.match(n)?e.toSvg.push(t):e.toNode.push(t),e),{toNode:[],toSvg:[]});i[0].attributes.class=e.toSvg.join(" "),0===e.toNode.length?t.removeAttribute("class"):t.setAttribute("class",e.toNode.join(" "))}const a=i.map(e=>ji(e)).join("\n");t.setAttribute(Jt,""),t.innerHTML=a}};function Wn(e){e()}function Zn(e,t){const i="function"==typeof t?t:Nn;if(0===e.length)i();else{let t=Wn;"async"===bi.mutateApproach&&(t=Et.requestAnimationFrame||Wn),t(()=>{const t=!0===bi.autoReplaceSvg?Hn.replace:Hn[bi.autoReplaceSvg]||Hn.replace,n=Un("mutate");e.map(t),n(),i()})}}let Kn=!1;function Xn(){Kn=!0}function Qn(){Kn=!1}let Yn=null;function Jn(e){if(!St)return;if(!bi.observeMutations)return;const{treeCallback:t=Nn,nodeCallback:i=Nn,pseudoElementsCallback:n=Nn,observeMutationsRoot:a=kt}=e;Yn=new St(e=>{if(Kn)return;const a=cn();Mi(e).forEach(e=>{if("childList"===e.type&&e.addedNodes.length>0&&!jn(e.addedNodes[0])&&(bi.searchPseudoElements&&n(e.target),t(e.target)),"attributes"===e.type&&e.target.parentNode&&bi.searchPseudoElements&&n(e.target.parentNode),"attributes"===e.type&&jn(e.target)&&~fi.indexOf(e.attributeName))if("class"===e.attributeName&&function(e){const t=e.getAttribute?e.getAttribute(ei):null,i=e.getAttribute?e.getAttribute(ti):null;return t&&i}(e.target)){const{prefix:t,iconName:i}=dn(Ci(e.target));e.target.setAttribute(ei,t||a),i&&e.target.setAttribute(ti,i)}else(r=e.target)&&r.classList&&r.classList.contains&&r.classList.contains(bi.replacementClass)&&i(e.target);var r})}),Ct&&Yn.observe(a,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function $n(e){const t=e.getAttribute("data-prefix"),i=e.getAttribute("data-icon"),n=void 0!==e.innerText?e.innerText.trim():"";let a=dn(Ci(e));return a.prefix||(a.prefix=cn()),t&&i&&(a.prefix=t,a.iconName=i),a.iconName&&a.prefix||(a.prefix&&n.length>0&&(a.iconName=(r=a.prefix,s=e.innerText,($i[r]||{})[s]||sn(a.prefix,Gi(e.innerText)))),!a.iconName&&bi.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(a.iconName=e.firstChild.data)),a;var r,s}function ea(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0};const{iconName:i,prefix:n,rest:a}=$n(e),r=function(e){const t=Mi(e.attributes).reduce((e,t)=>("class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e),{}),i=e.getAttribute("title"),n=e.getAttribute("data-fa-title-id");return bi.autoA11y&&(i?t["aria-labelledby"]="".concat(bi.replacementClass,"-title-").concat(n||Si()):(t["aria-hidden"]="true",t.focusable="false")),t}(e),s=vn("parseNodeAttributes",{},e);let o=t.styleParser?function(e){const t=e.getAttribute("style");let i=[];return t&&(i=t.split(";").reduce((e,t)=>{const i=t.split(":"),n=i[0],a=i.slice(1);return n&&a.length>0&&(e[n]=a.join(":").trim()),e},{})),i}(e):[];return At({iconName:i,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:n,transform:ki,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:o,attributes:r}},s)}const{styles:ta}=Bi;function ia(e){const t="nest"===bi.autoReplaceSvg?ea(e,{styleParser:!1}):ea(e);return~t.extra.classes.indexOf(mi)?xn("generateLayersText",e,t):xn("generateSvgReplacementMutation",e,t)}function na(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!Ct)return Promise.resolve();const i=kt.documentElement.classList,n=e=>i.add("".concat(ii,"-").concat(e)),a=e=>i.remove("".concat(ii,"-").concat(e)),r=bi.autoFetchSvg?[...Lt,...Ht]:Pt.concat(Object.keys(ta));r.includes("fa")||r.push("fa");const s=[".".concat(mi,":not([").concat(Jt,"])")].concat(r.map(e=>".".concat(e,":not([").concat(Jt,"])"))).join(", ");if(0===s.length)return Promise.resolve();let o=[];try{o=Mi(e.querySelectorAll(s))}catch(e){}if(!(o.length>0))return Promise.resolve();n("pending"),a("complete");const l=Un("onTree"),c=o.reduce((e,t)=>{try{const i=ia(t);i&&e.push(i)}catch(e){ai||"MissingIcon"===e.name&&console.error(e)}return e},[]);return new Promise((e,i)=>{Promise.all(c).then(i=>{Zn(i,()=>{n("active"),n("complete"),a("pending"),"function"==typeof t&&t(),l(),e()})}).catch(e=>{l(),i(e)})})}function aa(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ia(e).then(e=>{e&&Zn([e],t)})}const ra=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:i=ki,symbol:n=!1,mask:a=null,maskId:r=null,title:s=null,titleId:o=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:h,iconName:d,icon:p}=e;return Cn(At({type:"icon"},e),()=>(yn("beforeDOMElementCreation",{iconDefinition:e,params:t}),bi.autoA11y&&(s?c["aria-labelledby"]="".concat(bi.replacementClass,"-title-").concat(o||Si()):(c["aria-hidden"]="true",c.focusable="false")),Tn({icons:{main:In(p),mask:a?In(a.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:d,transform:At(At({},ki),i),symbol:n,title:s,maskId:r,titleId:o,extra:{attributes:c,styles:u,classes:l}})))};var sa={mixout(){return{icon:(e=ra,function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(t||{}).icon?t:bn(t||{});let{mask:a}=i;return a&&(a=(a||{}).icon?a:bn(a||{})),e(n,At(At({},i),{},{mask:a}))})};var e},hooks:()=>({mutationObserverCallbacks:e=>(e.treeCallback=na,e.nodeCallback=aa,e)}),provides(e){e.i2svg=function(e){const{node:t=kt,callback:i=()=>{}}=e;return na(t,i)},e.generateSvgReplacementMutation=function(e,t){const{iconName:i,title:n,titleId:a,prefix:r,transform:s,symbol:o,mask:l,maskId:c,extra:u}=t;return new Promise((t,h)=>{Promise.all([zn(i,r),l.iconName?zn(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(l=>{let[h,d]=l;t([e,Tn({icons:{main:h,mask:d},prefix:r,iconName:i,transform:s,symbol:o,maskId:c,title:n,titleId:a,extra:u,watchable:!0})])}).catch(h)})},e.generateAbstractIcon=function(e){let{children:t,attributes:i,main:n,transform:a,styles:r}=e;const s=Di(r);let o;return s.length>0&&(i.style=s),Pi(a)&&(o=xn("generateAbstractTransformGrouping",{main:n,transform:a,containerWidth:n.width,iconWidth:n.width})),t.push(o||n.icon),{children:t,attributes:i}}}},oa={mixout:()=>({layer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{classes:i=[]}=t;return Cn({type:"layer"},()=>{yn("beforeDOMElementCreation",{assembler:e,params:t});let n=[];return e(e=>{Array.isArray(e)?e.map(e=>{n=n.concat(e.abstract)}):n=n.concat(e.abstract)}),[{tag:"span",attributes:{class:["".concat(bi.cssPrefix,"-layers"),...i].join(" ")},children:n}]})}})},la={mixout:()=>({counter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{title:i=null,classes:n=[],attributes:a={},styles:r={}}=t;return Cn({type:"counter",content:e},()=>(yn("beforeDOMElementCreation",{content:e,params:t}),function(e){const{content:t,title:i,extra:n}=e,a=At(At(At({},n.attributes),i?{title:i}:{}),{},{class:n.classes.join(" ")}),r=Di(n.styles);r.length>0&&(a.style=r);const s=[];return s.push({tag:"span",attributes:a,children:[t]}),i&&s.push({tag:"span",attributes:{class:"sr-only"},children:[i]}),s}({content:e.toString(),title:i,extra:{attributes:a,styles:r,classes:["".concat(bi.cssPrefix,"-layers-counter"),...n]}})))}})},ca={mixout:()=>({text(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:i=ki,title:n=null,classes:a=[],attributes:r={},styles:s={}}=t;return Cn({type:"text",content:e},()=>(yn("beforeDOMElementCreation",{content:e,params:t}),Dn({content:e,transform:At(At({},ki),i),title:n,extra:{attributes:r,styles:s,classes:["".concat(bi.cssPrefix,"-layers-text"),...a]}})))}}),provides(e){e.generateLayersText=function(e,t){const{title:i,transform:n,extra:a}=t;let r=null,s=null;if(Tt){const t=parseInt(getComputedStyle(e).fontSize,10),i=e.getBoundingClientRect();r=i.width/t,s=i.height/t}return bi.autoA11y&&!i&&(a.attributes["aria-hidden"]="true"),Promise.resolve([e,Dn({content:e.innerHTML,width:r,height:s,transform:n,title:i,extra:a,watchable:!0})])}}};const ua=new RegExp('"',"ug"),ha=[1105920,1112319],da=At(At(At(At({},{FontAwesome:{normal:"fas",400:"fas"}}),{"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"}}),{"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}}),{"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}}),pa=Object.keys(da).reduce((e,t)=>(e[t.toLowerCase()]=da[t],e),{}),ma=Object.keys(pa).reduce((e,t)=>{const i=pa[t];return e[t]=i[900]||[...Object.entries(i)][0][1],e},{});function ga(e,t){const i="".concat("data-fa-pseudo-element-pending").concat(t.replace(":","-"));return new Promise((n,a)=>{if(null!==e.getAttribute(i))return n();const r=Mi(e.children).filter(e=>e.getAttribute($t)===t)[0],s=Et.getComputedStyle(e,t),o=s.getPropertyValue("font-family"),l=o.match(gi),c=s.getPropertyValue("font-weight"),u=s.getPropertyValue("content");if(r&&!l)return e.removeChild(r),n();if(l&&"none"!==u&&""!==u){const u=s.getPropertyValue("content");let h=function(e,t){const i=e.replace(/^['"]|['"]$/g,"").toLowerCase(),n=parseInt(t),a=isNaN(n)?"normal":n;return(pa[i]||{})[a]||ma[i]}(o,c);const{value:d,isSecondary:p}=function(e){const t=e.replace(ua,""),i=function(e,t){const i=e.length;let n,a=e.charCodeAt(t);return a>=55296&&a<=56319&&i>t+1&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?1024*(a-55296)+n-56320+65536:a}(t,0),n=i>=ha[0]&&i<=ha[1],a=2===t.length&&t[0]===t[1];return{value:Gi(a?t[0]:t),isSecondary:n||a}}(u),m=l[0].startsWith("FontAwesome");let g=sn(h,d),f=g;if(m){const e=function(e){const t=tn[e],i=sn("fas",e);return t||(i?{prefix:"fas",iconName:i}:null)||{prefix:null,iconName:null}}(d);e.iconName&&e.prefix&&(g=e.iconName,h=e.prefix)}if(!g||p||r&&r.getAttribute(ei)===h&&r.getAttribute(ti)===f)n();else{e.setAttribute(i,f),r&&e.removeChild(r);const s={iconName:null,title:null,titleId:null,prefix:null,transform:ki,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},{extra:o}=s;o.attributes[$t]=t,zn(g,h).then(a=>{const r=Tn(At(At({},s),{},{icons:{main:a,mask:{prefix:null,iconName:null,rest:[]}},prefix:h,iconName:f,extra:o,watchable:!0})),l=kt.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===t?e.insertBefore(l,e.firstChild):e.appendChild(l),l.outerHTML=r.map(e=>ji(e)).join("\n"),e.removeAttribute(i),n()}).catch(a)}}else n()})}function fa(e){return Promise.all([ga(e,"::before"),ga(e,"::after")])}function Aa(e){return!(e.parentNode===document.head||~ni.indexOf(e.tagName.toUpperCase())||e.getAttribute($t)||e.parentNode&&"svg"===e.parentNode.tagName)}function _a(e){if(Ct)return new Promise((t,i)=>{const n=Mi(e.querySelectorAll("*")).filter(Aa).map(fa),a=Un("searchPseudoElements");Xn(),Promise.all(n).then(()=>{a(),Qn(),t()}).catch(()=>{a(),Qn(),i()})})}var va={hooks:()=>({mutationObserverCallbacks:e=>(e.pseudoElementsCallback=_a,e)}),provides(e){e.pseudoElements2svg=function(e){const{node:t=kt}=e;bi.searchPseudoElements&&_a(t)}}};let ya=!1;var xa={mixout:()=>({dom:{unwatch(){Xn(),ya=!0}}}),hooks:()=>({bootstrap(){Jn(vn("mutationObserverCallbacks",{}))},noAuto(){Yn&&Yn.disconnect()},watch(e){const{observeMutationsRoot:t}=e;ya?Qn():Jn(vn("mutationObserverCallbacks",{observeMutationsRoot:t}))}})};const ba=e=>e.toLowerCase().split(" ").reduce((e,t)=>{const i=t.toLowerCase().split("-"),n=i[0];let a=i.slice(1).join("-");if(n&&"h"===a)return e.flipX=!0,e;if(n&&"v"===a)return e.flipY=!0,e;if(a=parseFloat(a),isNaN(a))return e;switch(n){case"grow":e.size=e.size+a;break;case"shrink":e.size=e.size-a;break;case"left":e.x=e.x-a;break;case"right":e.x=e.x+a;break;case"up":e.y=e.y-a;break;case"down":e.y=e.y+a;break;case"rotate":e.rotate=e.rotate+a}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0});var wa={mixout:()=>({parse:{transform:e=>ba(e)}}),hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-transform");return i&&(e.transform=ba(i)),e}}),provides(e){e.generateAbstractTransformGrouping=function(e){let{main:t,transform:i,containerWidth:n,iconWidth:a}=e;const r={transform:"translate(".concat(n/2," 256)")},s="translate(".concat(32*i.x,", ").concat(32*i.y,") "),o="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),l="rotate(".concat(i.rotate," 0 0)"),c={outer:r,inner:{transform:"".concat(s," ").concat(o," ").concat(l)},path:{transform:"translate(".concat(a/2*-1," -256)")}};return{tag:"g",attributes:At({},c.outer),children:[{tag:"g",attributes:At({},c.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:At(At({},t.icon.attributes),c.path)}]}]}}}};const Ea={x:0,y:0,width:"100%",height:"100%"};function ka(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}var Sa={hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-mask"),n=i?dn(i.split(" ").map(e=>e.trim())):{prefix:null,iconName:null,rest:[]};return n.prefix||(n.prefix=cn()),e.mask=n,e.maskId=t.getAttribute("data-fa-mask-id"),e}}),provides(e){e.generateAbstractMask=function(e){let{children:t,attributes:i,main:n,mask:a,maskId:r,transform:s}=e;const{width:o,icon:l}=n,{width:c,icon:u}=a,h=function(e){let{transform:t,containerWidth:i,iconWidth:n}=e;const a={transform:"translate(".concat(i/2," 256)")},r="translate(".concat(32*t.x,", ").concat(32*t.y,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)");return{outer:a,inner:{transform:"".concat(r," ").concat(s," ").concat(o)},path:{transform:"translate(".concat(n/2*-1," -256)")}}}({transform:s,containerWidth:c,iconWidth:o}),d={tag:"rect",attributes:At(At({},Ea),{},{fill:"white"})},p=l.children?{children:l.children.map(ka)}:{},m={tag:"g",attributes:At({},h.inner),children:[ka(At({tag:l.tag,attributes:At(At({},l.attributes),h.path)},p))]},g={tag:"g",attributes:At({},h.outer),children:[m]},f="mask-".concat(r||Si()),A="clip-".concat(r||Si()),_={tag:"mask",attributes:At(At({},Ea),{},{id:f,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[d,g]},v={tag:"defs",children:[{tag:"clipPath",attributes:{id:A},children:(y=u,"g"===y.tag?y.children:[y])},_]};var y;return t.push(v,{tag:"rect",attributes:At({fill:"currentColor","clip-path":"url(#".concat(A,")"),mask:"url(#".concat(f,")")},Ea)}),{children:t,attributes:i}}}},Ma={provides(e){let t=!1;Et.matchMedia&&(t=Et.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const e=[],i={fill:"currentColor"},n={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:At(At({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});const a=At(At({},n),{},{attributeName:"opacity"}),r={tag:"circle",attributes:At(At({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||r.children.push({tag:"animate",attributes:At(At({},n),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:At(At({},a),{},{values:"1;0;1;1;0;1;"})}),e.push(r),e.push({tag:"path",attributes:At(At({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:At(At({},a),{},{values:"1;0;0;0;0;1;"})}]}),t||e.push({tag:"path",attributes:At(At({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:At(At({},a),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:e}}}};!function(e,t){let{mixoutsTo:i}=t;gn=e,fn={},Object.keys(An).forEach(e=>{-1===_n.indexOf(e)&&delete An[e]}),gn.forEach(e=>{const t=e.mixout?e.mixout():{};if(Object.keys(t).forEach(e=>{"function"==typeof t[e]&&(i[e]=t[e]),"object"==typeof t[e]&&Object.keys(t[e]).forEach(n=>{i[e]||(i[e]={}),i[e][n]=t[e][n]})}),e.hooks){const t=e.hooks();Object.keys(t).forEach(e=>{fn[e]||(fn[e]=[]),fn[e].push(t[e])})}e.provides&&e.provides(An)})}([Ri,sa,oa,la,ca,va,xa,wa,Sa,Ma,{hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-symbol"),n=null!==i&&(""===i||i);return e.symbol=n,e}})}],{mixoutsTo:Sn});const Ca=Sn.icon,Ta=Object.freeze({left:0,top:0,width:16,height:16}),Da=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Pa=Object.freeze({...Ta,...Da}),Ia=Object.freeze({...Pa,body:"",hidden:!1}),Fa=Object.freeze({width:null,height:null}),za=Object.freeze({...Fa,...Da});const Ra=/[\s,]+/;const La={...za,preserveAspectRatio:""};function Ba(e){const t={...La},i=(t,i)=>e.getAttribute(t)||i;var n;return t.width=i("width",null),t.height=i("height",null),t.rotate=function(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(e){for(;e<0;)e+=4;return e%4}if(""===i){const t=parseInt(e);return isNaN(t)?0:n(t)}if(i!==e){let t=0;switch(i){case"%":t=25;break;case"deg":t=90}if(t){let a=parseFloat(e.slice(0,e.length-i.length));return isNaN(a)?0:(a/=t,a%1==0?n(a):0)}}return t}(i("rotate","")),n=t,i("flip","").split(Ra).forEach(e=>{switch(e.trim()){case"horizontal":n.hFlip=!0;break;case"vertical":n.vFlip=!0}}),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}const Oa=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ua=(e,t,i,n="")=>{const a=e.split(":");if("@"===e.slice(0,1)){if(a.length<2||a.length>3)return null;n=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const e=a.pop(),i=a.pop(),r={provider:a.length>0?a[0]:n,prefix:i,name:e};return t&&!Na(r)?null:r}const r=a[0],s=r.split("-");if(s.length>1){const e={provider:n,prefix:s.shift(),name:s.join("-")};return t&&!Na(e)?null:e}if(i&&""===n){const e={provider:n,prefix:"",name:r};return t&&!Na(e,i)?null:e}return null},Na=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name);function ja(e,t){const i=function(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(i.rotate=n),i}(e,t);for(const n in Ia)n in Da?n in e&&!(n in i)&&(i[n]=Da[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function Va(e,t,i){const n=e.icons,a=e.aliases||Object.create(null);let r={};function s(e){r=ja(n[e]||a[e],r)}return s(t),i.forEach(s),ja(e,r)}function qa(e,t){const i=[];if("object"!=typeof e||"object"!=typeof e.icons)return i;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),i.push(e)});const n=function(e){const t=e.icons,i=e.aliases||Object.create(null),n=Object.create(null);return Object.keys(t).concat(Object.keys(i)).forEach(function e(a){if(t[a])return n[a]=[];if(!(a in n)){n[a]=null;const t=i[a]&&i[a].parent,r=t&&e(t);r&&(n[a]=[t].concat(r))}return n[a]}),n}(e);for(const a in n){const r=n[a];r&&(t(a,Va(e,a,r)),i.push(a))}return i}const Ga={provider:"",aliases:{},not_found:{},...Ta};function Ha(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function Wa(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!Ha(e,Ga))return null;const i=t.icons;for(const e in i){const t=i[e];if(!e||"string"!=typeof t.body||!Ha(t,Ia))return null}const n=t.aliases||Object.create(null);for(const e in n){const t=n[e],a=t.parent;if(!e||"string"!=typeof a||!i[a]&&!n[a]||!Ha(t,Ia))return null}return t}const Za=Object.create(null);function Ka(e,t){const i=Za[e]||(Za[e]=Object.create(null));return i[t]||(i[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function Xa(e,t){return Wa(t)?qa(t,(t,i)=>{i?e.icons[t]=i:e.missing.add(t)}):[]}function Qa(e,t){let i=[];return("string"==typeof e?[e]:Object.keys(Za)).forEach(e=>{("string"==typeof e&&"string"==typeof t?[t]:Object.keys(Za[e]||{})).forEach(t=>{const n=Ka(e,t);i=i.concat(Object.keys(n.icons).map(i=>(""!==e?"@"+e+":":"")+t+":"+i))})}),i}let Ya=!1;function Ja(e){return"boolean"==typeof e&&(Ya=e),Ya}function $a(e){const t="string"==typeof e?Ua(e,!0,Ya):e;if(t){const e=Ka(t.provider,t.prefix),i=t.name;return e.icons[i]||(e.missing.has(i)?null:void 0)}}function er(e,t){const i=Ua(e,!0,Ya);if(!i)return!1;const n=Ka(i.provider,i.prefix);return t?function(e,t,i){try{if("string"==typeof i.body)return e.icons[t]={...i},!0}catch(e){}return!1}(n,i.name,t):(n.missing.add(i.name),!0)}function tr(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),Ya&&!t&&!e.prefix){let t=!1;return Wa(e)&&(e.prefix="",qa(e,(e,i)=>{er(e,i)&&(t=!0)})),t}const i=e.prefix;return!!Na({prefix:i,name:"a"})&&!!Xa(Ka(t,i),e)}function ir(e){return!!$a(e)}function nr(e){const t=$a(e);return t?{...Pa,...t}:t}function ar(e,t){e.forEach(e=>{const i=e.loaderCallbacks;i&&(e.loaderCallbacks=i.filter(e=>e.id!==t))})}let rr=0;const sr=Object.create(null);function or(e,t){sr[e]=t}function lr(e){return sr[e]||sr[""]}function cr(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const ur=Object.create(null),hr=["https://api.simplesvg.com","https://api.unisvg.com"],dr=[];for(;hr.length>0;)1===hr.length||Math.random()>.5?dr.push(hr.shift()):dr.push(hr.pop());function pr(e,t){const i=cr(t);return null!==i&&(ur[e]=i,!0)}function mr(e){return ur[e]}function gr(){return Object.keys(ur)}ur[""]=cr({resources:["https://api.iconify.design"].concat(dr)});const fr={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ar(e,t,i,n){const a=e.resources.length,r=e.random?Math.floor(Math.random()*a):e.index;let s;if(e.random){let t=e.resources.slice(0);for(s=[];t.length>1;){const e=Math.floor(Math.random()*t.length);s.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}s=s.concat(t)}else s=e.resources.slice(r).concat(e.resources.slice(0,r));const o=Date.now();let l,c="pending",u=0,h=null,d=[],p=[];function m(){h&&(clearTimeout(h),h=null)}function g(){"pending"===c&&(c="aborted"),m(),d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function f(e,t){t&&(p=[]),"function"==typeof e&&p.push(e)}function A(){c="failed",p.forEach(e=>{e(void 0,l)})}function _(){d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function v(){if("pending"!==c)return;m();const n=s.shift();if(void 0===n)return d.length?void(h=setTimeout(()=>{m(),"pending"===c&&(_(),A())},e.timeout)):void A();const a={status:"pending",resource:n,callback:(t,i)=>{!function(t,i,n){const a="success"!==i;switch(d=d.filter(e=>e!==t),c){case"pending":break;case"failed":if(a||!e.dataAfterTimeout)return;break;default:return}if("abort"===i)return l=n,void A();if(a)return l=n,void(d.length||(s.length?v():A()));if(m(),_(),!e.random){const i=e.resources.indexOf(t.resource);-1!==i&&i!==e.index&&(e.index=i)}c="completed",p.forEach(e=>{e(n)})}(a,t,i)}};d.push(a),u++,h=setTimeout(v,e.rotate),i(n,t,a.callback)}return"function"==typeof n&&p.push(n),setTimeout(v),function(){return{startTime:o,payload:t,status:c,queriesSent:u,queriesPending:d.length,subscribe:f,abort:g}}}function _r(e){const t={...fr,...e};let i=[];function n(){i=i.filter(e=>"pending"===e().status)}return{query:function(e,a,r){const s=Ar(t,e,a,(e,t)=>{n(),r&&r(e,t)});return i.push(s),s},find:function(e){return i.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:n}}function vr(){}const yr=Object.create(null);function xr(e,t,i){let n,a;if("string"==typeof e){const t=lr(e);if(!t)return i(void 0,424),vr;a=t.send;const r=function(e){if(!yr[e]){const t=mr(e);if(!t)return;yr[e]={config:t,redundancy:_r(t)}}return yr[e]}(e);r&&(n=r.redundancy)}else{const t=cr(e);if(t){n=_r(t);const i=lr(e.resources?e.resources[0]:"");i&&(a=i.send)}}return n&&a?n.query(t,a,i)().abort:(i(void 0,424),vr)}function br(){}function wr(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let i=!1;const n=e.provider,a=e.prefix;t.forEach(t=>{const r=t.icons,s=r.pending.length;r.pending=r.pending.filter(t=>{if(t.prefix!==a)return!0;const s=t.name;if(e.icons[s])r.loaded.push({provider:n,prefix:a,name:s});else{if(!e.missing.has(s))return i=!0,!0;r.missing.push({provider:n,prefix:a,name:s})}return!1}),r.pending.length!==s&&(i||ar([e],t.id),t.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),t.abort))})}))}(e)}))}function Er(e,t,i){function n(){const i=e.pendingIcons;t.forEach(t=>{i&&i.delete(t),e.icons[t]||e.missing.add(t)})}if(i&&"object"==typeof i)try{if(!Xa(e,i).length)return void n()}catch(e){console.error(e)}n(),wr(e)}function kr(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Sr(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:i}=e,n=e.iconsToLoad;if(delete e.iconsToLoad,!n||!n.length)return;const a=e.loadIcon;if(e.loadIcons&&(n.length>1||!a))return void kr(e.loadIcons(n,i,t),t=>{Er(e,n,t)});if(a)return void n.forEach(n=>{kr(a(n,i,t),t=>{Er(e,[n],t?{prefix:i,icons:{[n]:t}}:null)})});const{valid:r,invalid:s}=function(e){const t=[],i=[];return e.forEach(e=>{(e.match(Oa)?t:i).push(e)}),{valid:t,invalid:i}}(n);if(s.length&&Er(e,s,null),!r.length)return;const o=i.match(Oa)?lr(t):null;o?o.prepare(t,i,r).forEach(i=>{xr(t,i,t=>{Er(e,i.icons,t)})}):Er(e,r,null)}))}const Mr=(e,t)=>{const i=function(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name));let n={provider:"",prefix:"",name:""};return e.forEach(e=>{if(n.name===e.name&&n.prefix===e.prefix&&n.provider===e.provider)return;n=e;const a=e.provider,r=e.prefix,s=e.name,o=i[a]||(i[a]=Object.create(null)),l=o[r]||(o[r]=Ka(a,r));let c;c=s in l.icons?t.loaded:""===r||l.missing.has(s)?t.missing:t.pending;const u={provider:a,prefix:r,name:s};c.push(u)}),t}(function(e,t=!0,i=!1){const n=[];return e.forEach(e=>{const a="string"==typeof e?Ua(e,t,i):e;a&&n.push(a)}),n}(e,!0,Ja()));if(!i.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(i.loaded,i.missing,i.pending,br)}),()=>{e=!1}}const n=Object.create(null),a=[];let r,s;return i.pending.forEach(e=>{const{provider:t,prefix:i}=e;if(i===s&&t===r)return;r=t,s=i,a.push(Ka(t,i));const o=n[t]||(n[t]=Object.create(null));o[i]||(o[i]=[])}),i.pending.forEach(e=>{const{provider:t,prefix:i,name:a}=e,r=Ka(t,i),s=r.pendingIcons||(r.pendingIcons=new Set);s.has(a)||(s.add(a),n[t][i].push(a))}),a.forEach(e=>{const t=n[e.provider][e.prefix];t.length&&Sr(e,t)}),t?function(e,t,i){const n=rr++,a=ar.bind(null,i,n);if(!t.pending.length)return a;const r={id:n,icons:t,callback:e,abort:a};return i.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(r)}),a}(t,i,a):br},Cr=e=>new Promise((t,i)=>{const n="string"==typeof e?Ua(e,!0):e;n?Mr([n||e],a=>{if(a.length&&n){const e=$a(n);if(e)return void t({...Pa,...e})}i(e)}):i(e)});function Tr(e){try{const t="string"==typeof e?JSON.parse(e):e;if("string"==typeof t.body)return{...t}}catch(e){}}let Dr=!1;try{Dr=0===navigator.vendor.indexOf("Apple")}catch(sB){}const Pr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ir=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Fr(e,t,i){if(1===t)return e;if(i=i||100,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;const n=e.split(Pr);if(null===n||!n.length)return e;const a=[];let r=n.shift(),s=Ir.test(r);for(;;){if(s){const e=parseFloat(r);isNaN(e)?a.push(r):a.push(Math.ceil(e*t*i)/i)}else a.push(r);if(r=n.shift(),void 0===r)return a.join("");s=!s}}function zr(e,t){const i={...Pa,...e},n={...za,...t},a={left:i.left,top:i.top,width:i.width,height:i.height};let r=i.body;[i,n].forEach(e=>{const t=[],i=e.hFlip,n=e.vFlip;let s,o=e.rotate;switch(i?n?o+=2:(t.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),t.push("scale(-1 1)"),a.top=a.left=0):n&&(t.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),t.push("scale(1 -1)"),a.top=a.left=0),o<0&&(o-=4*Math.floor(o/4)),o%=4,o){case 1:s=a.height/2+a.top,t.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:t.unshift("rotate(180 "+(a.width/2+a.left).toString()+" "+(a.height/2+a.top).toString()+")");break;case 3:s=a.width/2+a.left,t.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}o%2==1&&(a.left!==a.top&&(s=a.left,a.left=a.top,a.top=s),a.width!==a.height&&(s=a.width,a.width=a.height,a.height=s)),t.length&&(r=function(e,t,i){const n=function(e,t="defs"){let i="";const n=e.indexOf("<"+t);for(;n>=0;){const a=e.indexOf(">",n),r=e.indexOf("</"+t);if(-1===a||-1===r)break;const s=e.indexOf(">",r);if(-1===s)break;i+=e.slice(a+1,r).trim(),e=e.slice(0,n).trim()+e.slice(s+1)}return{defs:i,content:e}}(e);return a=n.defs,r=t+n.content+i,a?"<defs>"+a+"</defs>"+r:r;var a,r}(r,'<g transform="'+t.join(" ")+'">',"</g>"))});const s=n.width,o=n.height,l=a.width,c=a.height;let u,h;null===s?(h=null===o?"1em":"auto"===o?c:o,u=Fr(h,l/c)):(u="auto"===s?l:s,h=null===o?Fr(u,c/l):"auto"===o?c:o);const d={},p=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(d[e]=t.toString())};p("width",u),p("height",h);const m=[a.left,a.top,l,c];return d.viewBox=m.join(" "),{attributes:d,viewBox:m,body:r}}function Rr(e,t){let i=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in t)i+=" "+e+'="'+t[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+i+">"+e+"</svg>"}function Lr(e){return'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(e)+'")'}let Br=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();function Or(e){Br=e}function Ur(){return Br}const Nr={prepare:(e,t,i)=>{const n=[],a=function(e,t){const i=mr(e);if(!i)return 0;let n;if(i.maxURL){let e=0;i.resources.forEach(t=>{const i=t;e=Math.max(e,i.length)});const a=t+".json?icons=";n=i.maxURL-e-i.path.length-a.length}else n=0;return n}(e,t),r="icons";let s={type:r,provider:e,prefix:t,icons:[]},o=0;return i.forEach((i,l)=>{o+=i.length+1,o>=a&&l>0&&(n.push(s),s={type:r,provider:e,prefix:t,icons:[]},o=i.length),s.icons.push(i)}),n.push(s),n},send:(e,t,i)=>{if(!Br)return void i("abort",424);let n=function(e){if("string"==typeof e){const t=mr(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,i=t.icons.join(",");n+=e+".json?"+new URLSearchParams({icons:i}).toString();break}case"custom":{const e=t.uri;n+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void i("abort",400)}let a=503;Br(e+n).then(e=>{const t=e.status;if(200===t)return a=501,e.json();setTimeout(()=>{i(function(e){return 404===e}(t)?"abort":"next",t)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{i("success",e)}):setTimeout(()=>{404===e?i("abort",e):i("next",a)})}).catch(()=>{i("next",a)})}};function jr(e,t,i){Ka(i||"",t).loadIcons=e}function Vr(e,t,i){Ka(i||"",t).loadIcon=e}const qr="data-style";let Gr="";function Hr(e){Gr=e}function Wr(e,t){let i=Array.from(e.childNodes).find(e=>e.hasAttribute&&e.hasAttribute(qr));i||(i=document.createElement("style"),i.setAttribute(qr,qr),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block;margin:auto}"+Gr}function Zr(){let e;or("",Nr),Ja(!0);try{e=window}catch(e){}if(e){if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,i="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!tr(e))&&console.error(i)}catch(e){console.error(i)}})}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(const e in t){const i="IconifyProviders["+e+"] is invalid.";try{const n=t[e];if("object"!=typeof n||!n||void 0===n.resources)continue;pr(e,n)||console.error(i)}catch(e){console.error(i)}}}}return{iconLoaded:ir,getIcon:nr,listIcons:Qa,addIcon:er,addCollection:tr,calculateSize:Fr,buildIcon:zr,iconToHTML:Rr,svgToURL:Lr,loadIcons:Mr,loadIcon:Cr,addAPIProvider:pr,setCustomIconLoader:Vr,setCustomIconsLoader:jr,appendCustomStyle:Hr,_api:{getAPIConfig:mr,setAPIModule:or,sendAPIQuery:xr,setFetch:Or,getFetch:Ur,listAPIProviders:gr}}}const Kr={"background-color":"currentColor"},Xr={"background-color":"transparent"},Qr={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Yr={"-webkit-mask":Kr,mask:Kr,background:Xr};for(const e in Yr){const t=Yr[e];for(const i in Qr)t[e+"-"+i]=Qr[i]}function Jr(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}let $r;function es(e){return void 0===$r&&function(){try{$r=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){$r=null}}(),$r?$r.createHTML(e):e}function ts(e){return Array.from(e.childNodes).find(e=>{const t=e.tagName&&e.tagName.toUpperCase();return"SPAN"===t||"SVG"===t})}function is(e,t){const i=t.icon.data,n=t.customisations,a=zr(i,n);n.preserveAspectRatio&&(a.attributes.preserveAspectRatio=n.preserveAspectRatio);const r=t.renderedMode;let s;if("svg"===r)s=function(e){const t=document.createElement("span"),i=e.attributes;let n="";i.width||(n="width: inherit;"),i.height||(n+="height: inherit;"),n&&(i.style=n);const a=Rr(e.body,i);return t.innerHTML=es(a),t.firstChild}(a);else s=function(e,t,i){const n=document.createElement("span");let a=e.body;-1!==a.indexOf("<a")&&(a+="\x3c!-- "+Date.now()+" --\x3e");const r=e.attributes,s=Lr(Rr(a,{...r,width:t.width+"",height:t.height+""})),o=n.style,l={"--svg":s,width:Jr(r.width),height:Jr(r.height),...i?Kr:Xr};for(const e in l)o.setProperty(e,l[e]);return n}(a,{...Pa,...i},"mask"===r);const o=ts(e);o?"SPAN"===s.tagName&&o.tagName===s.tagName?o.setAttribute("style",s.getAttribute("style")):e.replaceChild(s,o):e.appendChild(s)}function ns(e,t,i){return{rendered:!1,inline:t,icon:e,lastRender:i&&(i.rendered?i:i.lastRender)}}const as=function(e="iconify-icon"){let t,i;try{t=window.customElements,i=window.HTMLElement}catch(e){return}if(!t||!i)return;const n=t.get(e);if(n)return n;const a=["icon","mode","inline","noobserver","width","height","rotate","flip"],r=class extends i{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();const e=this._shadowRoot=this.attachShadow({mode:"open"}),t=this.hasAttribute("inline");Wr(e,t),this._state=ns({value:""},t),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return a.slice(0)}attributeChangedCallback(e){switch(e){case"inline":{const e=this.hasAttribute("inline"),t=this._state;e!==t.inline&&(t.inline=e,Wr(this._shadowRoot,e));break}case"noobserver":this.hasAttribute("noobserver")?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){const e=this.getAttribute("icon");if(e&&"{"===e.slice(0,1))try{return JSON.parse(e)}catch(e){}return e}set icon(e){"object"==typeof e&&(e=JSON.stringify(e)),this.setAttribute("icon",e)}get inline(){return this.hasAttribute("inline")}set inline(e){e?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(e){e?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const e=this._state;if(e.rendered){const t=this._shadowRoot;if("svg"===e.renderedMode)try{return void t.lastChild.setCurrentTime(0)}catch(e){}is(t,e)}}get status(){const e=this._state;return e.rendered?"rendered":null===e.icon.data?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const e=this._state,t=this.getAttribute("icon");if(t!==e.icon.value)return void this._iconChanged(t);if(!e.rendered||!this._visible)return;const i=this.getAttribute("mode"),n=Ba(this);e.attrMode===i&&!function(e,t){for(const i in La)if(e[i]!==t[i])return!0;return!1}(e.customisations,n)&&ts(this._shadowRoot)||this._renderIcon(e.icon,n,i)}_iconChanged(e){const t=function(e,t){if("object"==typeof e)return{data:Tr(e),value:e};if("string"!=typeof e)return{value:e};if(e.includes("{")){const t=Tr(e);if(t)return{data:t,value:e}}const i=Ua(e,!0,!0);if(!i)return{value:e};const n=$a(i);if(void 0!==n||!i.prefix)return{value:e,name:i,data:n};const a=Mr([i],()=>t(e,i,$a(i)));return{value:e,name:i,loading:a}}(e,(e,t,i)=>{const n=this._state;if(n.rendered||this.getAttribute("icon")!==e)return;const a={value:e,name:t,data:i};a.data?this._gotIconData(a):n.icon=a});t.data?this._gotIconData(t):this._state=ns(t,this._state.inline,this._state)}_forceRender(){if(!this._visible){const e=ts(this._shadowRoot);return void(e&&this._shadowRoot.removeChild(e))}this._queueCheck()}_gotIconData(e){this._checkQueued=!1,this._renderIcon(e,Ba(this),this.getAttribute("mode"))}_renderIcon(e,t,i){const n=function(e,t){switch(t){case"svg":case"bg":case"mask":return t}return"style"===t||!Dr&&-1!==e.indexOf("<a")?-1===e.indexOf("currentColor")?"bg":"mask":"svg"}(e.data.body,i),a=this._state.inline;is(this._shadowRoot,this._state={rendered:!0,icon:e,inline:a,customisations:t,attrMode:i,renderedMode:n})}startObserver(){if(!this._observer&&!this.hasAttribute("noobserver"))try{this._observer=new IntersectionObserver(e=>{const t=e.some(e=>e.isIntersecting);t!==this._visible&&(this._visible=t,this._forceRender())}),this._observer.observe(this)}catch(e){if(this._observer){try{this._observer.disconnect()}catch(e){}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};a.forEach(e=>{e in r.prototype||Object.defineProperty(r.prototype,e,{get:function(){return this.getAttribute(e)},set:function(t){null!==t?this.setAttribute(e,t):this.removeAttribute(e)}})});const s=Zr();for(const e in s)r[e]=r.prototype[e]=s[e];return t.define(e,r),r}()||Zr(),{iconLoaded:rs,getIcon:ss,listIcons:os,addIcon:ls,addCollection:cs,calculateSize:us,buildIcon:hs,iconToHTML:ds,svgToURL:ps,loadIcons:ms,loadIcon:gs,setCustomIconLoader:fs,setCustomIconsLoader:As,addAPIProvider:_s,_api:vs}=as;function ys(e,t){return Ca(e,t).node[0]}function xs(){fs(async e=>{const t=await fetch(ge(e));return t.ok?{body:await t.text()}:null},"temaki")}function bs(e,t={}){const i=document.createElement(e);return Object.entries(t).forEach(([e,t])=>{e.startsWith("_")?i[e]=t:e.startsWith("fn")?i[e.substring(2)]=t:e.startsWith("on")?i.addEventListener(e.substring(2),t):t&&i.setAttribute(e,t)}),i}function ws(e,t){e._parent?.addEventListener("menu-opened",i=>{i.detail.menu!==e&&t()}),e._parent?.onceMapReady?.().then(()=>{e._parent.map?.on?.("click",()=>t())}),e._parent?.oncePSVReady?.().then(()=>{e._parent.psv.addEventListener("click",()=>t())}),e._parent?.onceReady?.().then(()=>{e._parent.legend?.addEventListener("click",()=>t())})}function Es(e){return e._parent?e._parent:e===document.body?null:e.parentNode?Es(e.parentNode):e.host?Es(e.host):void 0}function ks(e){return e._parent?Promise.resolve(e._parent):new Promise(t=>{const i=setInterval(()=>{const n=Es(e);n&&(e._parent=n,clearInterval(i),t(e._parent))},100)})}var Ss=Object.freeze({__proto__:null,createWebComp:bs,fa:ys,listenForMenuClosure:ws,moreIcons:xs,onceParentAvailable:ks}),Ms={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},Cs={isSpaceSeparator:e=>"string"==typeof e&&Ms.Space_Separator.test(e),isIdStartChar:e=>"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||Ms.ID_Start.test(e)),isIdContinueChar:e=>"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||""===e||""===e||Ms.ID_Continue.test(e)),isDigit:e=>"string"==typeof e&&/[0-9]/.test(e),isHexDigit:e=>"string"==typeof e&&/[0-9A-Fa-f]/.test(e)};let Ts,Ds,Ps,Is,Fs,zs,Rs,Ls,Bs;function Os(e,t,i){const n=e[t];if(null!=n&&"object"==typeof n)if(Array.isArray(n))for(let e=0;e<n.length;e++){const t=String(e),a=Os(n,t,i);void 0===a?delete n[t]:Object.defineProperty(n,t,{value:a,writable:!0,enumerable:!0,configurable:!0})}else for(const e in n){const t=Os(n,e,i);void 0===t?delete n[e]:Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}return i.call(e,t,n)}let Us,Ns,js,Vs,qs;function Gs(){for(Us="default",Ns="",js=!1,Vs=1;;){qs=Hs();const e=Zs[Us]();if(e)return e}}function Hs(){if(Ts[Is])return String.fromCodePoint(Ts.codePointAt(Is))}function Ws(){const e=Hs();return"\n"===e?(Fs++,zs=0):e?zs+=e.length:zs++,e&&(Is+=e.length),e}const Zs={default(){switch(qs){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void Ws();case"/":return Ws(),void(Us="comment");case void 0:return Ws(),Ks("eof")}if(!Cs.isSpaceSeparator(qs))return Zs[Ds]();Ws()},comment(){switch(qs){case"*":return Ws(),void(Us="multiLineComment");case"/":return Ws(),void(Us="singleLineComment")}throw eo(Ws())},multiLineComment(){switch(qs){case"*":return Ws(),void(Us="multiLineCommentAsterisk");case void 0:throw eo(Ws())}Ws()},multiLineCommentAsterisk(){switch(qs){case"*":return void Ws();case"/":return Ws(),void(Us="default");case void 0:throw eo(Ws())}Ws(),Us="multiLineComment"},singleLineComment(){switch(qs){case"\n":case"\r":case"\u2028":case"\u2029":return Ws(),void(Us="default");case void 0:return Ws(),Ks("eof")}Ws()},value(){switch(qs){case"{":case"[":return Ks("punctuator",Ws());case"n":return Ws(),Xs("ull"),Ks("null",null);case"t":return Ws(),Xs("rue"),Ks("boolean",!0);case"f":return Ws(),Xs("alse"),Ks("boolean",!1);case"-":case"+":return"-"===Ws()&&(Vs=-1),void(Us="sign");case".":return Ns=Ws(),void(Us="decimalPointLeading");case"0":return Ns=Ws(),void(Us="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Ns=Ws(),void(Us="decimalInteger");case"I":return Ws(),Xs("nfinity"),Ks("numeric",1/0);case"N":return Ws(),Xs("aN"),Ks("numeric",NaN);case'"':case"'":return js='"'===Ws(),Ns="",void(Us="string")}throw eo(Ws())},identifierNameStartEscape(){if("u"!==qs)throw eo(Ws());Ws();const e=Qs();switch(e){case"$":case"_":break;default:if(!Cs.isIdStartChar(e))throw io()}Ns+=e,Us="identifierName"},identifierName(){switch(qs){case"$":case"_":case"":case"":return void(Ns+=Ws());case"\\":return Ws(),void(Us="identifierNameEscape")}if(!Cs.isIdContinueChar(qs))return Ks("identifier",Ns);Ns+=Ws()},identifierNameEscape(){if("u"!==qs)throw eo(Ws());Ws();const e=Qs();switch(e){case"$":case"_":case"":case"":break;default:if(!Cs.isIdContinueChar(e))throw io()}Ns+=e,Us="identifierName"},sign(){switch(qs){case".":return Ns=Ws(),void(Us="decimalPointLeading");case"0":return Ns=Ws(),void(Us="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Ns=Ws(),void(Us="decimalInteger");case"I":return Ws(),Xs("nfinity"),Ks("numeric",Vs*(1/0));case"N":return Ws(),Xs("aN"),Ks("numeric",NaN)}throw eo(Ws())},zero(){switch(qs){case".":return Ns+=Ws(),void(Us="decimalPoint");case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent");case"x":case"X":return Ns+=Ws(),void(Us="hexadecimal")}return Ks("numeric",0*Vs)},decimalInteger(){switch(qs){case".":return Ns+=Ws(),void(Us="decimalPoint");case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent")}if(!Cs.isDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},decimalPointLeading(){if(Cs.isDigit(qs))return Ns+=Ws(),void(Us="decimalFraction");throw eo(Ws())},decimalPoint(){switch(qs){case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent")}return Cs.isDigit(qs)?(Ns+=Ws(),void(Us="decimalFraction")):Ks("numeric",Vs*Number(Ns))},decimalFraction(){switch(qs){case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent")}if(!Cs.isDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},decimalExponent(){switch(qs){case"+":case"-":return Ns+=Ws(),void(Us="decimalExponentSign")}if(Cs.isDigit(qs))return Ns+=Ws(),void(Us="decimalExponentInteger");throw eo(Ws())},decimalExponentSign(){if(Cs.isDigit(qs))return Ns+=Ws(),void(Us="decimalExponentInteger");throw eo(Ws())},decimalExponentInteger(){if(!Cs.isDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},hexadecimal(){if(Cs.isHexDigit(qs))return Ns+=Ws(),void(Us="hexadecimalInteger");throw eo(Ws())},hexadecimalInteger(){if(!Cs.isHexDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},string(){switch(qs){case"\\":return Ws(),void(Ns+=function(){switch(Hs()){case"b":return Ws(),"\b";case"f":return Ws(),"\f";case"n":return Ws(),"\n";case"r":return Ws(),"\r";case"t":return Ws(),"\t";case"v":return Ws(),"\v";case"0":if(Ws(),Cs.isDigit(Hs()))throw eo(Ws());return"\0";case"x":return Ws(),function(){let e="",t=Hs();if(!Cs.isHexDigit(t))throw eo(Ws());if(e+=Ws(),t=Hs(),!Cs.isHexDigit(t))throw eo(Ws());return e+=Ws(),String.fromCodePoint(parseInt(e,16))}();case"u":return Ws(),Qs();case"\n":case"\u2028":case"\u2029":return Ws(),"";case"\r":return Ws(),"\n"===Hs()&&Ws(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw eo(Ws())}return Ws()}());case'"':return js?(Ws(),Ks("string",Ns)):void(Ns+=Ws());case"'":return js?void(Ns+=Ws()):(Ws(),Ks("string",Ns));case"\n":case"\r":throw eo(Ws());case"\u2028":case"\u2029":!function(e){console.warn(`JSON5: '${no(e)}' in strings is not valid ECMAScript; consider escaping`)}(qs);break;case void 0:throw eo(Ws())}Ns+=Ws()},start(){switch(qs){case"{":case"[":return Ks("punctuator",Ws())}Us="value"},beforePropertyName(){switch(qs){case"$":case"_":return Ns=Ws(),void(Us="identifierName");case"\\":return Ws(),void(Us="identifierNameStartEscape");case"}":return Ks("punctuator",Ws());case'"':case"'":return js='"'===Ws(),void(Us="string")}if(Cs.isIdStartChar(qs))return Ns+=Ws(),void(Us="identifierName");throw eo(Ws())},afterPropertyName(){if(":"===qs)return Ks("punctuator",Ws());throw eo(Ws())},beforePropertyValue(){Us="value"},afterPropertyValue(){switch(qs){case",":case"}":return Ks("punctuator",Ws())}throw eo(Ws())},beforeArrayValue(){if("]"===qs)return Ks("punctuator",Ws());Us="value"},afterArrayValue(){switch(qs){case",":case"]":return Ks("punctuator",Ws())}throw eo(Ws())},end(){throw eo(Ws())}};function Ks(e,t){return{type:e,value:t,line:Fs,column:zs}}function Xs(e){for(const t of e){if(Hs()!==t)throw eo(Ws());Ws()}}function Qs(){let e="",t=4;for(;t-- >0;){const t=Hs();if(!Cs.isHexDigit(t))throw eo(Ws());e+=Ws()}return String.fromCodePoint(parseInt(e,16))}const Ys={start(){if("eof"===Rs.type)throw to();Js()},beforePropertyName(){switch(Rs.type){case"identifier":case"string":return Ls=Rs.value,void(Ds="afterPropertyName");case"punctuator":return void $s();case"eof":throw to()}},afterPropertyName(){if("eof"===Rs.type)throw to();Ds="beforePropertyValue"},beforePropertyValue(){if("eof"===Rs.type)throw to();Js()},beforeArrayValue(){if("eof"===Rs.type)throw to();"punctuator"!==Rs.type||"]"!==Rs.value?Js():$s()},afterPropertyValue(){if("eof"===Rs.type)throw to();switch(Rs.value){case",":return void(Ds="beforePropertyName");case"}":$s()}},afterArrayValue(){if("eof"===Rs.type)throw to();switch(Rs.value){case",":return void(Ds="beforeArrayValue");case"]":$s()}},end(){}};function Js(){let e;switch(Rs.type){case"punctuator":switch(Rs.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=Rs.value}if(void 0===Bs)Bs=e;else{const t=Ps[Ps.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,Ls,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)Ps.push(e),Ds=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Ps[Ps.length-1];Ds=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function $s(){Ps.pop();const e=Ps[Ps.length-1];Ds=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function eo(e){return ao(void 0===e?`JSON5: invalid end of input at ${Fs}:${zs}`:`JSON5: invalid character '${no(e)}' at ${Fs}:${zs}`)}function to(){return ao(`JSON5: invalid end of input at ${Fs}:${zs}`)}function io(){return zs-=5,ao(`JSON5: invalid identifier character at ${Fs}:${zs}`)}function no(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return e}function ao(e){const t=new SyntaxError(e);return t.lineNumber=Fs,t.columnNumber=zs,t}const ro={parse:function(e,t){Ts=String(e),Ds="start",Ps=[],Is=0,Fs=1,zs=0,Rs=void 0,Ls=void 0,Bs=void 0;do{Rs=Gs(),Ys[Ds]()}while("eof"!==Rs.type);return"function"==typeof t?Os({"":Bs},"",t):Bs},stringify:function(e,t,i){const n=[];let a,r,s,o="",l="";if(null==t||"object"!=typeof t||Array.isArray(t)||(i=t.space,s=t.quote,t=t.replacer),"function"==typeof t)r=t;else if(Array.isArray(t)){a=[];for(const e of t){let t;"string"==typeof e?t=e:("number"==typeof e||e instanceof String||e instanceof Number)&&(t=String(e)),void 0!==t&&a.indexOf(t)<0&&a.push(t)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),"number"==typeof i?i>0&&(i=Math.min(10,Math.floor(i)),l=" ".substr(0,i)):"string"==typeof i&&(l=i.substr(0,10)),c("",{"":e});function c(e,t){let i=t[e];switch(null!=i&&("function"==typeof i.toJSON5?i=i.toJSON5(e):"function"==typeof i.toJSON&&(i=i.toJSON(e))),r&&(i=r.call(t,e,i)),i instanceof Number?i=Number(i):i instanceof String?i=String(i):i instanceof Boolean&&(i=i.valueOf()),i){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof i?u(i):"number"==typeof i?String(i):"object"==typeof i?Array.isArray(i)?function(e){if(n.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");n.push(e);let t=o;o+=l;let i,a=[];for(let t=0;t<e.length;t++){const i=c(String(t),e);a.push(void 0!==i?i:"null")}if(0===a.length)i="[]";else if(""===l){i="["+a.join(",")+"]"}else{let e=",\n"+o,n=a.join(e);i="[\n"+o+n+",\n"+t+"]"}return n.pop(),o=t,i}(i):function(e){if(n.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");n.push(e);let t=o;o+=l;let i,r=a||Object.keys(e),s=[];for(const t of r){const i=c(t,e);if(void 0!==i){let e=h(t)+":";""!==l&&(e+=" "),e+=i,s.push(e)}}if(0===s.length)i="{}";else{let e;if(""===l)e=s.join(","),i="{"+e+"}";else{let n=",\n"+o;e=s.join(n),i="{\n"+o+e+",\n"+t+"}"}}return n.pop(),o=t,i}(i):void 0}function u(e){const t={"'":.1,'"':.2},i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let n="";for(let a=0;a<e.length;a++){const r=e[a];switch(r){case"'":case'"':t[r]++,n+=r;continue;case"\0":if(Cs.isDigit(e[a+1])){n+="\\x00";continue}}if(i[r])n+=i[r];else{if(r<" "){let e=r.charCodeAt(0).toString(16);n+="\\x"+("00"+e).substring(e.length);continue}n+=r}}const a=s||Object.keys(t).reduce((e,i)=>t[e]<t[i]?e:i);return n=n.replace(new RegExp(a,"g"),i[a]),a+n+a}function h(e){if(0===e.length)return u(e);const t=String.fromCodePoint(e.codePointAt(0));if(!Cs.isIdStartChar(t))return u(e);for(let i=t.length;i<e.length;i++)if(!Cs.isIdContinueChar(String.fromCodePoint(e.codePointAt(i))))return u(e);return e}}};var so=ro;const oo=new CSSStyleSheet;oo.replaceSync("/* atkinson-hyperlegible-next-latin-ext-400-normal */\n@font-face {\n font-family: 'Atkinson Hyperlegible Next';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url(/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format('woff2'), url(/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff) format('woff');\n unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;\n}\n\n/* atkinson-hyperlegible-next-latin-400-normal */\n@font-face {\n font-family: 'Atkinson Hyperlegible Next';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url(/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format('woff2'), url(/fonts/atkinson-hyperlegible-next-latin-400-normal.woff) format('woff');\n unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;\n}");const lo=new CSSStyleSheet;lo.replaceSync('/* Colors */\n:root, :host {\n\t--white: #ffffff;\n\t--black: #181818;\n\t--black-pale: #1b1a17;\n\t--red: #f70000;\n\t--red-transparent: rgba(247, 0, 0, 0.3);\n\t--red-pale: #ff726f;\n\t--grey: #f5f5f5;\n\t--grey-very-pale: #e6e6e6;\n\t--grey-pale: #cfd2cf;\n\t--grey-semi-dark: #808080;\n\t--grey-dark: #3e3e3e;\n\t--blue: #2954e9;\n\t--blue-dark: #0a1f69;\n\t--blue-semi: #d7dffc;\n\t--blue-pale: #f2f5ff;\n\t--blue-geovisio: #34495e;\n\t--beige: #f5f3ec;\n\t--yellow: #fec868;\n\t--orange: #ff6f00;\n\t--orange-transparent: rgba(255,111,0,0.3);\n\t--orange-pale: #fffafa;\n\t--green: #7ec636;\n\t--green-pale: #f0ffee;\n\t--widget-bg: var(--white);\n\t--widget-bg-hover: var(--grey);\n\t--widget-bg-active: var(--blue);\n\t--widget-bg-inactive: var(--grey-pale);\n\t--widget-bg-primary: var(--blue-semi);\n\t--widget-bg-primary-hover: #e0e7ff;\n\t--widget-bg-warn: #FFECB3;\n\t--widget-bg-danger: #FFCDD2;\n\t--widget-bg-success: #C8E6C9;\n\t--widget-border-div: var(--grey-pale);\n\t--widget-border-btn: var(--blue);\n\t--widget-font: var(--grey-dark);\n\t--widget-font-active: var(--white);\n\t--widget-font-direct: var(--blue);\n\t--widget-font-warn: #BF360C;\n\t--widget-font-danger: #B71C1C;\n\t--widget-font-success: #1B5E20;\n\t--font-family: "Atkinson Hyperlegible Next", sans-serif;\n\t--widget-option-left: #6A1B9A;\n\t--widget-option-right: #0D47A1;\n\toverscroll-behavior-y: contain;\n}\n\n.pnx-hidden { display: none !important; }\n\n/* Hidden elements on mobile */\n@container (max-width: 576px) {\n\t.pnx-mobile-hidden { display: none !important; }\n}\n\n/* Hidden elements on print */\n@media print {\n\t.pnx-print-hidden { display: none !important; }\n}\n'),document.adoptedStyleSheets.push(oo),document.adoptedStyleSheets.push(lo);class co extends ce{static properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},"fetch-options":{converter:co.GetJSONConverter()},lang:{type:String},endpoint:{type:String}};constructor(e=!1){super(),this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=this.getAttribute("picture")||null,this.sequence=this.getAttribute("sequence")||null,console.info(`📷 Panoramax ${this.getClassName()} - Version 5.2.0 (08c7a77)\n\n🆘 Issues can be reported at https://gitlab.com/panoramax/clients/web-viewer/-/work_items`),e||(this._isInternetFast=null,$e().then(e=>this._isInternetFast=e))}connectedCallback(){super.connectedCallback(),this._t=dt(this.lang),this.loader=bs("pnx-loader",{_parent:this,"no-label":Ye()}),this._loadsAPI&&this.endpoint&&this._loadsAPI===this.endpoint||this.api&&this.api._endpoint===this.endpoint||!this.endpoint||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI()),Object.entries({map:"map-options",psv:"psv-options",fetchOptions:"fetch-options",mapstyle:"map-style"}).forEach(([e,t])=>{this.getAttribute(e)&&console.error(`Component attribute "${e}" has been renamed into "${t}". Old attribute "${e}" is ignored.`)}),Ye()&&this.classList.add("pnx-iframed")}_setupAPI(){if(this.loader=this.loader||bs("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let e=this.endpoint;try{this.api=new st(this.endpoint,{fetch:this["fetch-options"]}),this.api.onceReady().then(()=>{if(e!==this._loadsAPI||!this.api)return;let t=this.api.getUnavailableFeatures(),i=this.api.getAvailableFeatures();i=0===t.length?"✅ All features available":"✅ Available features: "+i.join(", "),t=0===t.length?"":"🚫 Unavailable features: "+t.join(", "),console.info(`🌐 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\nℹ️ API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${i}\n ${t}\n`.trim())}).catch(e=>this.loader?.dismiss?.(e,this._t?.pnx.error_api)).finally(()=>delete this._loadsAPI)}catch(e){delete this._loadsAPI,this.loader?.dismiss?this.loader.dismiss(e,this._t.pnx.error_api):console.error(e)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise(e=>setTimeout(e,250)).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),"endpoint"===e&&(this._loadsAPI&&i&&this._loadsAPI===i||this.api&&this.api._endpoint===i||!i||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(e)){let n,a,r,s;"picture"===e?(n=this.sequence,r=this.sequence,a=i,s=t):(n=i,r=t,a=this.picture,s=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:n,picId:a,prevSeqId:r,prevPicId:s}}))}}getClassName(){return"Basic"}select(e=null,t=null,i=!1){i&&(this.picture=null,this.sequence=null),this.picture=t,this.sequence=e}isWidthSmall(){return this?.offsetWidth<576}isWidthMedium(){return this?.offsetWidth>=576&&this?.offsetWidth<768}isHeightSmall(){return this?.offsetHeight<400}render(){return H`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}getAPI(){return this.api}addEventListener(e,t,i){let n=e.split(":").shift();if(n&&this.getSubComponentsNames().includes(n)){const a=e.substring(n.length+1);this[n]?.addEventListener?this[n].addEventListener(a,t,i):setTimeout(()=>this.addEventListener(e,t,i),50)}else super.addEventListener(e,t,i)}static GetJSONConverter(){return{fromAttribute:e=>null==e||""===e?null:"object"==typeof e||Array.isArray(e)?e:so.parse(e),toAttribute:e=>null==e||""===e?"":"string"==typeof e?e:so.stringify(e)}}}var uo="data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e%3csvg width='48' height='48' viewBox='0 0 48 48' version='1.1' id='svg1' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3e %3cdefs id='defs1' /%3e %3cpath d='m 8.0222924%2c7.8597977 a 22.594107%2c22.594107 0 0 1 31.9555636%2c0.0027 L 24.001409%2c23.838916 Z' style='fill:%2354278f%3bfill-opacity:1%3bstroke:white%3bstroke-width:2.50003%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-opacity:1' id='path1' /%3e %3ccircle cx='24' cy='24' r='9.9777565' style='fill:%23b39ddb%3bfill-opacity:1%3bstroke:white%3bstroke-width:2.49449%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-opacity:1' id='circle1' /%3e%3c/svg%3e";const ho="pnx-aerial",po=15,mo=["!",["has","uncrowded"]],go=["==",["get","type"],"equirectangular"];function fo(e){return{PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],po,0,15.5,e?1:["case",mo,0,1],16.5,e?2:["case",mo,0,2],17,e?4:["case",mo,1,4],18,e?5:["case",mo,3,5],20,e?7:["case",mo,5,7],22,e?7:["case",mo,7,7]],"circle-opacity":["interpolate",["linear"],["zoom"],po,0,15.5,e?1:["case",mo,0,1],16.5,e?1:["case",mo,0,1],17,1],"circle-stroke-opacity":["case",["all",mo,go],.2,go,.4,0],"circle-stroke-width":["interpolate",["linear"],["zoom"],17.5,0,18.5,e?["case",go,10,2]:["case",["all",mo,go],0,go,10,mo,0,2],19.5,e?["case",go,10,2]:["case",["all",mo,go],10,go,10,mo,0,2]]},layout:{}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,1.5,14.5,1.5,15.5,e?2:["case",mo,.5,2],22,e?4:["case",mo,1,4]]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,16,30],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}},GRID:{layout:{"circle-sort-key":["get","coef"]},paint:{"circle-color":["interpolate",["linear"],["get","coef"],0,"#fff",.1,Te.PALETTE_1,.25,Te.PALETTE_1,.5,Te.PALETTE_2,.75,Te.PALETTE_3,1,Te.PALETTE_4],"circle-opacity":["interpolate",["linear"],["zoom"],4,.5,5,1,6.75,1,7,0],"circle-radius":["interpolate",["linear"],["zoom"],1,["match",["get","coef"],0,0,1],5,["match",["get","coef"],0,0,2.5],7,["match",["get","coef"],0,0,7]]}}}}const Ao=fo(!1),_o=fo(!0),vo=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Fe],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Ie],1]],yo=["case",["==",["get","gps_accuracy"],0],1,["has","gps_accuracy"],["step",["get","gps_accuracy"],...ze],1],xo=["round",["+",["*",vo,.8],["*",yo,.2]]],bo=864e5,wo=e=>new Date(e).toISOString().split("T")[0],Eo=Date.now(),ko=wo(Eo-180*bo),So=wo(Eo-365*bo),Mo=wo(Eo-94608e6),Co={default:{id:"default",sort:[],color:[["==",["get","coef"],1],Te.PALETTE_4,[">=",["get","coef"],.75],Te.PALETTE_3,[">=",["get","coef"],.5],Te.PALETTE_2,[">=",["get","coef"],.25],Te.PALETTE_1,[">=",["get","coef"],.1],Te.PALETTE_1,Te.PALETTE_0]},age:{id:"age",sort:[["!",["any",["has","date"],["has","ts"]]],0,[">=",["coalesce",["get","date"],["get","ts"]],ko],50,[">=",["coalesce",["get","date"],["get","ts"]],So],49,[">=",["coalesce",["get","date"],["get","ts"]],Mo],48],color:[["!",["any",["has","date"],["has","ts"]]],Te.BASE,[">=",["coalesce",["get","date"],["get","ts"]],ko],Te.PALETTE_4,[">=",["coalesce",["get","date"],["get","ts"]],So],Te.PALETTE_3,[">=",["coalesce",["get","date"],["get","ts"]],Mo],Te.PALETTE_2,Te.PALETTE_1]},type:{id:"type",sort:[["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50],color:[["!",["has","type"]],Te.BASE,["==",["get","type"],"equirectangular"],Te.QUALI_1,Te.QUALI_2]},score:{id:"score",sort:[["==",xo,5],80,["==",xo,4],65,["==",xo,3],50,["==",xo,2],35,["==",xo,1],20],color:[["==",xo,5],Pe[0].color,["==",xo,4],Pe[1].color,["==",xo,3],Pe[2].color,["==",xo,2],Pe[3].color,Pe[4].color]},gps:{id:"gps",sort:[["==",yo,5],80,["==",yo,4],65,["==",yo,3],50,["==",yo,2],35,["==",yo,1],20],color:[[">=",yo,Re[0].score],Re[0].color,["==",yo,Re[1].score],Re[1].color,["==",yo,Re[2].score],Re[2].color,Re[3].color]}};function To(e){const t=document.createElement("img");return Ue(uo,t),t.alt=e.loading,t.title=e.loading,t.classList.add("pnx-map-thumb","pnx-map-thumb-loader"),t}function Do(e){return null==e||Array.isArray(e)&&(2===e.length&&0===e[0]&&0===e[1]||e.length<2)}function Po(e){return"symbol"===e.type&&void 0!==e?.layout?.["text-field"]&&(void 0===e.minzoom||e.minzoom<15)}function Io(e){const t=e?.metadata?.["panoramax:fields"]||{};return t?.grid?.includes("logged_coef_360_pictures")&&t?.grid?.includes("logged_coef_flat_pictures")&&t?.grid?.includes("logged_coef")||!1}function Fo(e){const t=2===e.metadata?.["panoramax:tiles_version"],i=Object.keys(e.sources)[0],n="vector"===e.sources[i].type,a=n?Ao:_o;if(t)return e.layers.push({id:`${i}_sequences_plus`,type:"line",source:i,"source-layer":"sequences",layout:{...a.SEQUENCES_PLUS.layout},paint:{...a.SEQUENCES_PLUS.paint}}),e.layers;const r=[{id:`${i}_sequences`,type:"line",source:i,"source-layer":n?"sequences":void 0,layout:{...a.SEQUENCES.layout},paint:{...a.SEQUENCES.paint,"line-color":Te.BASE}},{id:`${i}_sequences_plus`,type:"line",source:i,"source-layer":n?"sequences":void 0,layout:{...a.SEQUENCES_PLUS.layout},paint:{...a.SEQUENCES_PLUS.paint}},{id:`${i}_pictures`,type:"circle",source:i,"source-layer":n?"pictures":void 0,layout:{...a.PICTURES.layout},paint:{...a.PICTURES.paint,"circle-color":Te.BASE}}];return e?.metadata?.["panoramax:fields"]?.grid&&r.push({id:`${i}_grid`,type:"circle",source:i,"source-layer":"grid",layout:{...a.GRID.layout},paint:{...a.GRID.paint}}),r}function zo(e){return!["default","metacatalog","",null,void 0].includes(e)}function Ro(e,t){if(Array.isArray(e))return e.map(e=>Ro(e,t));if("object"==typeof e&&null!==e){const i={};for(const n in e)i[n]=Ro(e[n],t);return i}return"string"==typeof e&&(e.startsWith("coef")||e.startsWith("logged_coef"))?t:e}function Lo(e){const t=t=>{Le(t.detail.picId)?(e.map.displayPictureMarker(),e?.isMapWide?.()&&e?.mini?.setAttribute("collapsed","")):(e.map.displayPictureMarker(t.detail.lon,t.detail.lat,e.psv.getXY().x,t.detail.first&&!Do(e._initParams?.getMapPostInit()?.center),t.detail.picId),e?.isMapWide?.()&&e?.mini?.removeAttribute("collapsed"))};e.psv.addEventListener("picture-loading",t),e.psv.addEventListener("picture-loaded",t),e.psv.addEventListener("picture-failed",t),e.psv.addEventListener("view-rotated",()=>{let t=nt(e.psv.getPosition().yaw);t+=e.psv.getPictureOriginalHeading(),e.map._picMarker.setRotation(t)}),e.psv.addEventListener("picture-preview-started",t=>{e.map._picMarkerPreview.setLngLat(t.detail.coordinates).setRotation(t.detail.direction||0).addTo(e.map)}),e.psv.addEventListener("picture-preview-stopped",()=>{e.map._picMarkerPreview.remove()}),e.psv.addEventListener("picture-loaded",t=>{e.isWidthSmall()&&e._picPopup&&t.detail.picId===e._picPopup._picId&&e._picPopup.remove()}),e.map.on("picture-click",t=>{e.select(t.seqId,t.picId),!e.psv._myVTour.state.currentNode&&e?._setFocus&&e._setFocus("pic")}),e.map.on("sequence-click",t=>{(e.getAPI?.()||e.api).getPicturesAroundCoordinates(t.coordinates.lat,t.coordinates.lng,.01,1,t.seqId).then(t=>{t?.features?.length>0&&(e.select(t.features[0]?.collection,t.features[0].id),!e.psv.getPictureMetadata()&&e?._setFocus&&e._setFocus("pic"))})}),e._setFocus&&(e.psv.addEventListener("dblclick",()=>{e.isMapWide()&&e._setFocus("pic")}),e.map.on("dblclick",()=>{e.isMapWide()?"any"===e.psv.getPicturesNavigation()&&e.select():e._setFocus("map")}),e.addEventListener("focus-changed",t=>{"map"!==t.detail.focus&&e.map._dropPreview()}))}function Bo(e){e.map.keyboard.keydown=function(t){if(t.altKey||t.ctrlKey||t.metaKey)return;switch(t.key){case"*":case"5":return void e.moveCenter();case"PageUp":case"9":return void e.psv.goToNextPicture();case"PageDown":case"3":return void e.psv.goToPrevPicture();case"Home":case"7":return t.stopPropagation(),void e._toggleFocus();case"End":case"1":return void e.mini.toggleAttribute("collapsed");case" ":case"0":return void e.psv.toggleSequencePlaying()}let i=0,n=0,a=0,r=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:case 100:t.shiftKey?n=-1:(t.preventDefault(),r=-1);break;case 39:case 102:t.shiftKey?n=1:(t.preventDefault(),r=1);break;case 38:case 104:t.shiftKey?a=1:(t.preventDefault(),s=-1);break;case 40:case 98:t.shiftKey?a=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(n=0,a=0),{cameraAnimation:e=>{const o=this._tr;e.easeTo({duration:300,easeId:"keyboardHandler",easing:e=>e*(2-e),zoom:i?Math.round(o.zoom)+i*(t.shiftKey?2:1):o.zoom,bearing:o.bearing+n*this._bearingStep,pitch:o.pitch+a*this._pitchStep,offset:[-r*this._panStep,-s*this._panStep],center:o.center},{originalEvent:t})}}}.bind(e.map.keyboard)}const Oo="pnx-map-parameters";function Uo(){const e=localStorage.getItem(Oo);if(!e)return{};try{return JSON.parse(e)}catch(e){return console.warn("Can't read map parameters stored in localStorage",e),{}}}function No(e){const t=()=>localStorage.setItem(Oo,JSON.stringify({center:Object.fromEntries(Object.entries(e.getCenter()).map(([e,t])=>[e,t.toFixed(7)])),zoom:e.getZoom().toFixed(1),background:e._parent.mapStyleComposer.basemap,theme:e._parent.mapStyleComposer.panoramaxTheme,endpoint:e._parent.mapStyleComposer.panoramax}));e._parent.mapStyleComposer.addEventListener("filters-changed",t),e._parent.mapStyleComposer.addEventListener("theme-changed",t),e._parent.mapStyleComposer.addEventListener("basemap-changed",t),e._parent.mapStyleComposer.addEventListener("panoramax-changed",t),e.on("moveend",t),e.on("zoomend",t),e.on("dragend",t),e.on("boxzoomend",t)}var jo=Object.freeze({__proto__:null,MAP_EXPR_QUALITYSCORE:xo,MAP_EXPR_QUALITYSCORE_GPS:yo,MAP_THEMES_STYLES:Co,RASTER_LAYER_ID:ho,TILES_PICTURES_SYMBOL_ZOOM:19,TILES_PICTURES_ZOOM:po,VECTOR_STYLES:Ao,VECTOR_STYLES_NOCROWD:_o,getMapParamsFromLocalStorage:Uo,getPanoramaxLayers:Fo,getThumbGif:To,hasStyleLoggedGridStats:Io,initMapKeyboardHandler:Bo,isLabelLayer:Po,isNullCoordinates:Do,isPanoramaxEndpointSingleUser:zo,linkMapAndPhoto:Lo,mapFiltersFormValues:function(e,t,i){const n=e?.shadowRoot.getElementById("pnx-filter-date-from"),a=e?.shadowRoot.getElementById("pnx-filter-date-end"),r=e?.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),s=e?.shadowRoot.getElementById("pnx-pictures-source");let o="";for(let e=0;e<r.length;e++){const t=r[e];if(t.checked){o=t.value;break}}let l=[],c=[];if(i){const t=e?.shadowRoot.getElementById("pnx-filter-qualityscore");l=(t?.grade||"").split(",").map(e=>parseInt(e)).filter(e=>!isNaN(e));const i=e?.shadowRoot.getElementById("pnx-filter-gps");c=(i?.grade||"").split(",").map(e=>parseInt(e)).filter(e=>!isNaN(e))}return{minDate:n?.value,maxDate:a?.value,pic_type:o,theme:t?.value,qualityscore:l,gps:c,source:s?.checked?"local":"metacatalog"}},mapFiltersToLayersFilters:function(e,t=!1,i=null){let n={},a=[],r=[],s=!1;if(e.minDate&&""!==e.minDate&&(n.minDate=e.minDate,a.push([">=",["get","date"],e.minDate]),r.push([">=",["get","ts"],e.minDate])),e.maxDate&&""!==e.maxDate){n.maxDate=e.maxDate,a.push(["<=",["get","date"],e.maxDate]);let t=new Date(e.maxDate);t.setDate(t.getDate()+1),t=t.toISOString().split("T")[0],r.push(["<=",["get","ts"],t])}if(e.pic_type&&""!==e.pic_type&&(n.pic_type="flat"===e.pic_type?"flat":"equirectangular",a.push(["==",["get","type"],n.pic_type]),r.push(["==",["get","type"],n.pic_type])),t&&(s=!0),e.camera&&""!==e.camera){n.camera=e.camera;const t=e.camera.toLowerCase().trim()+" ",i=e.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",s=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];a.push([">=",["get","model"],t,s]),a.push(["<=",["get","model"],i,s]),r.push([">=",["get","model"],t,s]),r.push(["<=",["get","model"],i,s])}return e.qualityscore&&e.qualityscore.length>0&&(n.qualityscore=e.qualityscore,a.push(["in",xo,["literal",n.qualityscore]]),r.push(["in",xo,["literal",n.qualityscore]])),e.gps&&e.gps.length>0&&(n.gps=e.gps,a.push(["in",yo,["literal",n.gps]]),r.push(["in",yo,["literal",n.gps]])),e.theme&&Co[e.theme]&&(n.theme=e.theme,s=!0),i?.pictures&&i.pictures.features?.length>=0&&("keep"===i.pictures.rule?r.push(["in",["get","id"],["literal",i.pictures.features]]):i.pictures.features.length>0&&r.push(["!",["in",["get","id"],["literal",i.pictures.features]]])),i?.sequences&&i.sequences.features?.length>=0&&("keep"===i.sequences.rule?a.push(["in",["get","id"],["literal",i.sequences.features]]):i.sequences.features.length>0&&a.push(["!",["in",["get","id"],["literal",i.sequences.features]]])),0===a.length?a=null:a.unshift("all"),0===r.length?r=null:(r.unshift("all"),r=["step",["zoom"],!0,po,r]),{mapFilters:n,mapSeqFilters:a,mapPicFilters:r,reloadMapStyle:s}},saveMapParamsToLocalStorage:No,switchCoefValue:Ro});function Vo(e,t,i,n){let a=n;const r=t+(i-t>>1);let s,o=i-t;const l=e[t],c=e[t+1],u=e[i],h=e[i+1];for(let n=t+3;n<i;n+=3){const t=qo(e[n],e[n+1],l,c,u,h);if(t>a)s=n,a=t;else if(t===a){const e=Math.abs(n-r);e<o&&(s=n,o=e)}}a>n&&(s-t>3&&Vo(e,t,s,n),e[s+2]=a,i-s>3&&Vo(e,s,i,n))}function qo(e,t,i,n,a,r){let s=a-i,o=r-n;if(0!==s||0!==o){const l=((e-i)*s+(t-n)*o)/(s*s+o*o);l>1?(i=a,n=r):l>0&&(i+=s*l,n+=o*l)}return s=e-i,o=t-n,s*s+o*o}function Go(e,t,i,n){const a={type:t,geom:i},r={id:null==e?null:e,type:a.type,geometry:a.geom,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(a.type){case"Point":case"MultiPoint":Wo(r,a.geom);break;case"LineString":Wo(r,a.geom.points);break;case"Polygon":Wo(r,a.geom[0].points);break;case"MultiLineString":for(const e of a.geom)Wo(r,e.points);break;case"MultiPolygon":for(const e of a.geom)Wo(r,e[0].points)}return r}function Ho(e){const t=e;e.points.length>64&&(t.points=new Float64Array(e.points))}function Wo(e,t){for(let i=0;i<t.length;i+=3)e.minX=Math.min(e.minX,t[i]),e.minY=Math.min(e.minY,t[i+1]),e.maxX=Math.max(e.maxX,t[i]),e.maxY=Math.max(e.maxY,t[i+1])}function Zo(e,t){const i=[];switch(e.type){case"FeatureCollection":for(let n=0;n<e.features.length;n++)Ko(i,e.features[n],t,n);break;case"Feature":Ko(i,e,t);break;default:Ko(i,{geometry:e,properties:void 0},t)}return i}function Ko(e,t,i,n,a=0){if(!t.geometry)return;if(a>1024)throw new Error("GeometryCollection nesting exceeds supported depth: 1024");if("GeometryCollection"===t.geometry.type)return void function(e,t,i,n,a,r=0){for(const s of i.geometries)Ko(e,{id:t.id,geometry:s,properties:t.properties},n,a,r)}(e,t,t.geometry,i,n,a+1);if(!t.geometry.coordinates?.length)return;const r=function(e,t,i){return t.promoteId?e.properties?.[t.promoteId]:t.generateId?i||0:e.id}(t,i,n),s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(t.geometry.type){case"Point":return void function(e,t,i,n){const a=[];a.push(Yo(i.coordinates[0]),Jo(i.coordinates[1]),0),e.push(Go(t,"Point",a,n))}(e,r,t.geometry,t.properties);case"MultiPoint":return void function(e,t,i,n){const a=[];for(const e of i.coordinates)a.push(Yo(e[0]),Jo(e[1]),0);e.push(Go(t,"MultiPoint",a,n))}(e,r,t.geometry,t.properties);case"LineString":return void function(e,t,i,n,a){const r={points:[]};Xo(i.coordinates,r,n,!1),e.push(Go(t,"LineString",r,a))}(e,r,t.geometry,s,t.properties);case"MultiLineString":return void function(e,t,i,n,a,r){if(a.lineMetrics)for(const a of i.coordinates){const i={points:[]};Xo(a,i,n,!1),e.push(Go(t,"LineString",i,r))}else{const a=[];Qo(i.coordinates,a,n,!1),e.push(Go(t,"MultiLineString",a,r))}}(e,r,t.geometry,s,i,t.properties);case"Polygon":return void function(e,t,i,n,a){const r=[];Qo(i.coordinates,r,n,!0),e.push(Go(t,"Polygon",r,a))}(e,r,t.geometry,s,t.properties);case"MultiPolygon":return void function(e,t,i,n,a){const r=[];for(const e of i.coordinates){const t=[];Qo(e,t,n,!0),r.push(t)}e.push(Go(t,"MultiPolygon",r,a))}(e,r,t.geometry,s,t.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function Xo(e,t,i,n){let a,r,s=0;for(let i=0;i<e.length;i++){const o=Yo(e[i][0]),l=Jo(e[i][1]);t.points.push(o,l,0),i>0&&(s+=n?(a*l-o*r)/2:Math.sqrt(Math.pow(o-a,2)+Math.pow(l-r,2))),a=o,r=l}const o=t.points.length-3;t.points[2]=1,i>0&&Vo(t.points,0,o,i),t.points[o+2]=1,Ho(t),t.size=Math.abs(s),t.start=0,t.end=t.size}function Qo(e,t,i,n){for(let a=0;a<e.length;a++){const r={points:[]};Xo(e[a],r,i,n),t.push(r)}}function Yo(e){return e/360+.5}function Jo(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function $o(e){const t={type:"Feature",geometry:el(e),properties:e.tags};return null!=e.id&&(t.id=e.id),t}function el(e){const{type:t,geometry:i}=e;switch(t){case"Point":return{type:t,coordinates:il(i[0],i[1])};case"MultiPoint":return{type:t,coordinates:tl(i)};case"LineString":return{type:t,coordinates:tl(i.points)};case"MultiLineString":case"Polygon":return{type:t,coordinates:i.map(e=>tl(e.points))};case"MultiPolygon":return{type:t,coordinates:i.map(e=>e.map(e=>tl(e.points)))}}}function tl(e){const t=[];for(let i=0;i<e.length;i+=3)t.push(il(e[i],e[i+1]));return t}function il(e,t){return[nl(e),al(t)]}function nl(e){return 360*(e-.5)}function al(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function rl(e,t,i,n,a,r,s,o){if(n/=t,r>=(i/=t)&&s<n)return e;if(s<i||r>=n)return null;const l=[];for(const t of e){const e=0===a?t.minX:t.minY,r=0===a?t.maxX:t.maxY;if(e>=i&&r<n)l.push(t);else if(!(r<i||e>=n))switch(t.type){case"Point":case"MultiPoint":sl(t,l,i,n,a);continue;case"LineString":ol(t,l,i,n,a,o);continue;case"MultiLineString":ll(t,l,i,n,a);continue;case"Polygon":cl(t,l,i,n,a);continue;case"MultiPolygon":ul(t,l,i,n,a);continue}}return l.length?l:null}function sl(e,t,i,n,a){const r=[];if(function(e,t,i,n,a){for(let r=0;r<e.length;r+=3){const s=e[r+a];s>=i&&s<=n&&ml(t,e[r],e[r+1],e[r+2])}}(e.geometry,r,i,n,a),!r.length)return;const s=3===r.length?"Point":"MultiPoint";t.push(Go(e.id,s,r,e.tags))}function ol(e,t,i,n,a,r){const s=[];if(hl(e.geometry,s,i,n,a,!1,r.lineMetrics),s.length)if(r.lineMetrics)for(const i of s)t.push(Go(e.id,"LineString",i,e.tags));else s.length>1?t.push(Go(e.id,"MultiLineString",s,e.tags)):t.push(Go(e.id,"LineString",s[0],e.tags))}function ll(e,t,i,n,a){const r=[];pl(e.geometry,r,i,n,a,!1),r.length&&(1!==r.length?t.push(Go(e.id,"MultiLineString",r,e.tags)):t.push(Go(e.id,"LineString",r[0],e.tags)))}function cl(e,t,i,n,a){const r=[];pl(e.geometry,r,i,n,a,!0),r.length&&t.push(Go(e.id,"Polygon",r,e.tags))}function ul(e,t,i,n,a){const r=[];for(const t of e.geometry){const e=[];pl(t,e,i,n,a,!0),e.length&&r.push(e)}r.length&&t.push(Go(e.id,"MultiPolygon",r,e.tags))}function hl(e,t,i,n,a,r,s){let o=dl(e);const l=0===a?gl:fl;let c,u,h=e.start;for(let d=0;d<e.points.length-3;d+=3){const p=e.points[d],m=e.points[d+1],g=e.points[d+2],f=e.points[d+3],A=e.points[d+4],_=0===a?p:m,v=0===a?f:A;let y=!1;s&&(c=Math.sqrt(Math.pow(p-f,2)+Math.pow(m-A,2))),_<i?v>i&&(u=l(o,p,m,f,A,i),s&&(o.start=h+c*u)):_>n?v<n&&(u=l(o,p,m,f,A,n),s&&(o.start=h+c*u)):ml(o.points,p,m,g),v<i&&_>=i&&(u=l(o,p,m,f,A,i),y=!0),v>n&&_<=n&&(u=l(o,p,m,f,A,n),y=!0),!r&&y&&(s&&(o.end=h+c*u),t.push(o),o=dl(e)),s&&(h+=c)}let d=e.points.length-3;const p=e.points[d],m=e.points[d+1],g=e.points[d+2],f=0===a?p:m;f>=i&&f<=n&&ml(o.points,p,m,g),d=o.points.length-3,r&&d>=3&&(o.points[d]!==o.points[0]||o.points[d+1]!==o.points[1])&&ml(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Ho(o),t.push(o))}function dl(e){return{points:[],size:e.size,start:e.start,end:e.end}}function pl(e,t,i,n,a,r){for(const s of e)hl(s,t,i,n,a,r,!1)}function ml(e,t,i,n){e.push(t,i,n)}function gl(e,t,i,n,a,r){const s=(r-t)/(n-t);return ml(e.points,r,i+(a-i)*s,1),s}function fl(e,t,i,n,a,r){const s=(r-i)/(a-i);return ml(e.points,t+(n-t)*s,r,1),s}function Al(e,t){const i=t.buffer/t.extent;let n=e;const a=rl(e,1,-1-i,i,0,-1,2,t),r=rl(e,1,1-i,2+i,0,-1,2,t);return a||r?(n=rl(e,1,-i,1+i,0,-1,2,t)||[],a&&(n=_l(a,1).concat(n)),r&&(n=n.concat(_l(r,-1))),n):n}function _l(e,t){const i=[];for(const n of e)switch(n.type){case"Point":case"MultiPoint":{const e=vl(n.geometry,t);i.push(Go(n.id,n.type,e,n.tags));continue}case"LineString":{const e=yl(n.geometry,t);i.push(Go(n.id,n.type,e,n.tags));continue}case"MultiLineString":case"Polygon":{const e=[];for(const i of n.geometry)e.push(yl(i,t));i.push(Go(n.id,n.type,e,n.tags));continue}case"MultiPolygon":{const e=[];for(const i of n.geometry){const n=[];for(const e of i)n.push(yl(e,t));e.push(n)}i.push(Go(n.id,n.type,e,n.tags));continue}}return i}function vl(e,t){const i=[];for(let n=0;n<e.length;n+=3)i.push(e[n]+t,e[n+1],e[n+2]);return i}function yl(e,t){const i={points:[],size:e.size};void 0!==e.start&&(i.start=e.start,i.end=e.end);for(let n=0;n<e.points.length;n+=3)i.points.push(e.points[n]+t,e.points[n+1],e.points[n+2]);return Ho(i),i}function xl(e,t,i){const n=function(e,t){return e?{removeAll:e.removeAll,remove:new Set(e.remove||[]),add:new Map(e.add?.map(e=>[t.promoteId?e.properties[t.promoteId]:e.id,e])),update:new Map(e.update?.map(e=>[e.id,e]))}:{remove:new Set,add:new Map,update:new Map}}(t,i);let a=[];if(n.removeAll&&(a=e,e=[]),n.remove.size||n.add.size){const t=[];for(const i of e)(n.remove.has(i.id)||n.add.has(i.id))&&t.push(i);if(t.length){a=a.concat(t);const i=new Set(t.map(e=>e.id));e=e.filter(e=>!i.has(e.id))}if(n.add.size){let t=Zo({type:"FeatureCollection",features:Array.from(n.add.values())},i);t=Al(t,i),a=a.concat(t),e=e.concat(t)}}if(n.update.size){const t=new Map;let r=[];for(const i of e)n.update.has(i.id)?t.set(i.id,[...t.get(i.id)||[],i]):r.push(i);for(const[e,s]of n.update){const n=t.get(e);if(!n||0===n.length)continue;const o=bl(n,s,i);a=a.concat(n,o),r=r.concat(o)}e=r}return{affected:a,source:e}}function bl(e,t,i){const n=!!t.newGeometry,a=t.removeAllProperties||t.removeProperties?.length>0||t.addOrUpdateProperties?.length>0;if(n){const n=e[0];let r=Zo({type:"FeatureCollection",features:[{type:"Feature",id:n.id,geometry:t.newGeometry,properties:a?wl(n.tags,t):n.tags}]},i);return r=Al(r,i),r}if(a){const i=[];for(const n of e){const e={...n};e.tags=wl(e.tags,t),i.push(e)}return i}return e}function wl(e,t){if(t.removeAllProperties)return{};const i={...e||{}};if(t.removeProperties)for(const e of t.removeProperties)delete i[e];if(t.addOrUpdateProperties)for(const{key:e,value:n}of t.addOrUpdateProperties)i[e]=n;return i}const El=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],kl=new Uint32Array(96);var Sl=class e{static from(t){if(!t||void 0===t.byteLength||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[i,n]=new Uint8Array(t,0,2);if(219!==i)throw new Error("Data does not appear to be in a KDBush format.");const a=n>>4;if(1!==a)throw new Error(`Got v${a} data when expected v1.`);const r=El[15&n];if(!r)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new e(o,s,r,void 0,t)}constructor(e,t=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw new Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const r=El.indexOf(this.ArrayType),s=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-o%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+o+l,2*e),this._pos=2*e,this._finished=!0;else{const a=this.data=new n(8+s+o+l);this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+o+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(a,0,2).set([219,16+r]),new Uint16Array(a,2,1)[0]=t,new Uint32Array(a,4,1)[0]=e}}add(e,t){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ml(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:r,nodeSize:s}=this;kl[0]=0,kl[1]=a.length-1,kl[2]=0;let o=3;const l=[];for(;o>0;){const c=kl[--o],u=kl[--o],h=kl[--o];if(u-h<=s){for(let s=h;s<=u;s++){const o=r[2*s],c=r[2*s+1];o>=e&&o<=i&&c>=t&&c<=n&&l.push(a[s])}continue}const d=h+u>>1,p=r[2*d],m=r[2*d+1];p>=e&&p<=i&&m>=t&&m<=n&&l.push(a[d]),(0===c?e<=p:t<=m)&&(kl[o++]=h,kl[o++]=d-1,kl[o++]=1-c),(0===c?i>=p:n>=m)&&(kl[o++]=d+1,kl[o++]=u,kl[o++]=1-c)}return l}within(e,t,i){const n=[];return this.withinInto(e,t,i,n),n}withinInto(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:r,nodeSize:s}=this;kl[0]=0,kl[1]=a.length-1,kl[2]=0;let o=3,l=0;const c=i*i;for(;o>0;){const u=kl[--o],h=kl[--o],d=kl[--o];if(h-d<=s){for(let i=d;i<=h;i++)Pl(r[2*i],r[2*i+1],e,t)<=c&&(n[l++]=a[i]);continue}const p=d+h>>1,m=r[2*p],g=r[2*p+1];Pl(m,g,e,t)<=c&&(n[l++]=a[p]),(0===u?e-i<=m:t-i<=g)&&(kl[o++]=d,kl[o++]=p-1,kl[o++]=1-u),(0===u?e+i>=m:t+i>=g)&&(kl[o++]=p+1,kl[o++]=h,kl[o++]=1-u)}return l}};function Ml(e,t,i,n,a,r){if(a-n<=i)return;const s=n+a>>1;Cl(e,t,s,n,a,r),Ml(e,t,i,n,s-1,1-r),Ml(e,t,i,s+1,a,1-r)}function Cl(e,t,i,n,a,r){for(;a>n;){if(a-n>600){const s=a-n+1,o=i-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(o-s/2<0?-1:1);Cl(e,t,i,Math.max(n,Math.floor(i-o*c/s+u)),Math.min(a,Math.floor(i+(s-o)*c/s+u)),r)}const s=t[2*i+r];let o=n,l=a;for(Tl(e,t,n,i),t[2*a+r]>s&&Tl(e,t,n,a);o<l;){for(Tl(e,t,o,l),o++,l--;t[2*o+r]<s;)o++;for(;t[2*l+r]>s;)l--}t[2*n+r]===s?Tl(e,t,n,l):(l++,Tl(e,t,l,a)),l<=i&&(n=l+1),i<=l&&(a=l-1)}}function Tl(e,t,i,n){Dl(e,i,n),Dl(t,2*i,2*n),Dl(t,2*i+1,2*n+1)}function Dl(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function Pl(e,t,i,n){const a=e-i,r=t-n;return a*a+r*r}const Il={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e};var Fl=class{constructor(e){this.options=Object.assign(Object.create(Il),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){const t=[];for(const i of e){if(!i.geometry)continue;const[e,n]=i.geometry.coordinates,[a,r]=[Yo(e),Jo(n)],s={id:i.id,type:"Point",geometry:[a,r],tags:i.properties};t.push(s)}this.createIndex(t)}initialize(e){const t=[];for(const i of e)"Point"===i.type&&t.push(i);this.createIndex(t)}updateIndex(e,t,i){this.options=Object.assign(Object.create(Il),i.clusterOptions),this.initialize(e)}createIndex(e){const{log:t,minZoom:i,maxZoom:n}=this.options;t&&console.time("total time");const a=`prepare ${e.length} points`;t&&console.time(a),this.points=e;const r=[];for(let t=0;t<e.length;t++){const i=e[t];if(!i?.geometry)continue;let[n,a]=i.geometry;n=Math.fround(n),a=Math.fround(a),r.push(n,a,1/0,t,-1,1),this.options.reduce&&r.push(0)}let s=this.trees[n+1]=this.createTree(r);t&&console.timeEnd(a);for(let e=n;e>=i;e--){const i=Date.now();s=this.trees[e]=this.createTree(this.cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,Date.now()-i)}t&&console.timeEnd("total time")}getClusters(e,t){return this.getClustersInternal(e,t).map(e=>$o(e))}getClustersInternal(e,t){let i=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let a=180===e[2]?180:((e[2]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,a=180;else if(i>a){const e=this.getClustersInternal([i,n,180,r],t),s=this.getClustersInternal([-180,n,a,r],t);return e.concat(s)}const s=this.trees[this.limitZoom(t)],o=s.range(Yo(i),Jo(r),Yo(a),Jo(n)),l=s.flatData,c=[];for(const e of o){const t=this.stride*e;c.push(l[t+5]>1?zl(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){const t=this.getOriginId(e),i=this.getOriginZoom(e),n=new Error("No cluster with the specified id: "+e),a=this.trees[i];if(!a)throw n;const r=a.flatData;if(t*this.stride>=r.length)throw n;const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),o=r[t*this.stride],l=r[t*this.stride+1],c=a.within(o,l,s),u=[];for(const t of c){const i=t*this.stride;r[i+4]===e&&u.push(r[i+5]>1?Rl(r,i,this.clusterProps):$o(this.points[r[i+3]]))}if(0===u.length)throw n;return u}getLeaves(e,t,i){t=t||10,i=i||0;const n=[];return this.appendLeaves(n,e,t,i,0),n}getTile(e,t,i){const n=this.trees[this.limitZoom(e)];if(!n)return null;const a=Math.pow(2,e),{extent:r,radius:s}=this.options,o=s/r,l=(i-o)/a,c=(i+1+o)/a,u={transformed:!0,features:[],source:null,x:t,y:i,z:e};return this.addTileFeatures(n.range((t-o)/a,l,(t+1+o)/a,c),n.flatData,t,i,a,u),0===t&&this.addTileFeatures(n.range(1-o/a,l,1,c),n.flatData,a,i,a,u),t===a-1&&this.addTileFeatures(n.range(0,l,o/a,c),n.flatData,-1,i,a,u),u}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,t,i,n,a){const r=this.getChildren(t);for(const t of r){const r=t.properties;if(r?.cluster?a+r.point_count<=n?a+=r.point_count:a=this.appendLeaves(e,r.cluster_id,i,n,a):a<n?a++:e.push(t),e.length===i)break}return a}createTree(e){const t=new Sl(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let i=0;i<e.length;i+=this.stride)t.add(e[i],e[i+1]);return t.finish(),t.flatData=e,t.data=null,t}addTileFeatures(e,t,i,n,a,r){for(const s of e){const e=s*this.stride,o=t[e+5]>1;let l,c,u;if(o)l=Ll(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const i=this.points[t[e+3]];l=i.tags,[c,u]=i.geometry}const h={type:1,geometry:[[Math.round(this.options.extent*(c*a-i)),Math.round(this.options.extent*(u*a-n))]],tags:l};let d;d=o||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==d&&(h.id=d),r.features.push(h)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,t){const{radius:i,extent:n,reduce:a,minPoints:r}=this.options,s=i/(n*Math.pow(2,t)),o=e.flatData,l=[],c=this.stride;for(let i=0;i<o.length;i+=c){if(o[i+2]<=t)continue;o[i+2]=t;const n=o[i],u=o[i+1],h=e.within(o[i],o[i+1],s),d=o[i+5];let p=d;for(const e of h){const i=e*c;o[i+2]>t&&(p+=o[i+5])}if(p>d&&p>=r){let e,r=n*d,s=u*d,m=-1;const g=(i/c<<5)+(t+1)+this.points.length;for(const n of h){const l=n*c;if(o[l+2]<=t)continue;o[l+2]=t;const u=o[l+5];r+=o[l]*u,s+=o[l+1]*u,o[l+4]=g,a&&(e||(e=this.map(o,i,!0),m=this.clusterProps.length,this.clusterProps.push(e)),a(e,this.map(o,l)))}o[i+4]=g,l.push(r/p,s/p,1/0,g,-1,p),a&&l.push(m)}else{for(let e=0;e<c;e++)l.push(o[i+e]);if(p>1)for(const e of h){const i=e*c;if(!(o[i+2]<=t)){o[i+2]=t;for(let e=0;e<c;e++)l.push(o[i+e])}}}}return l}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,t,i){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return i?Object.assign({},n):n}const n=this.points[e[t+3]].tags,a=this.options.map(n);return i&&a===n?Object.assign({},a):a}};function zl(e,t,i){return{id:e[t+3],type:"Point",tags:Ll(e,t,i),geometry:[e[t],e[t+1]]}}function Rl(e,t,i){return{type:"Feature",id:e[t+3],properties:Ll(e,t,i),geometry:{type:"Point",coordinates:[nl(e[t]),al(e[t+1])]}}}function Ll(e,t,i){const n=e[t+5],a=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,r=e[t+6],s=-1===r?{}:Object.assign({},i[r]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:a})}const Bl="geojsonvt_clip_start",Ol="geojsonvt_clip_end";function Ul(e,t,i,n,a){const r=t===a.maxZoom?0:a.tolerance/((1<<t)*a.extent),s={transformed:!1,features:[],source:null,x:i,y:n,z:t,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:e.length};for(const t of e)Nl(s,t,r,a);return s}function Nl(e,t,i,n){switch(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),t.type){case"Point":case"MultiPoint":return void function(e,t){const i=[];for(let n=0;n<t.geometry.length;n+=3)i.push(t.geometry[n],t.geometry[n+1]),e.numPoints++,e.numSimplified++;if(!i.length)return;const n={type:1,tags:t.tags||null,geometry:i};null!==t.id&&(n.id=t.id);e.features.push(n)}(e,t);case"LineString":return void function(e,t,i,n){const a=[];if(jl(a,t.geometry,e,i,!1,!1),!a.length)return;let r=t.tags||null;if(n.lineMetrics){r={};for(const e in t.tags)r[e]=t.tags[e];r[Bl]=t.geometry.start/t.geometry.size,r[Ol]=t.geometry.end/t.geometry.size}const s={type:2,tags:r,geometry:a};null!==t.id&&(s.id=t.id);e.features.push(s)}(e,t,i,n);case"MultiLineString":case"Polygon":return void function(e,t,i){const n=[];for(let a=0;a<t.geometry.length;a++)jl(n,t.geometry[a],e,i,"Polygon"===t.type,0===a);if(!n.length)return;const a={type:"Polygon"===t.type?3:2,tags:t.tags||null,geometry:n};null!==t.id&&(a.id=t.id);e.features.push(a)}(e,t,i);case"MultiPolygon":return void function(e,t,i){const n=[];for(let a=0;a<t.geometry.length;a++){const r=t.geometry[a];for(let t=0;t<r.length;t++)jl(n,r[t],e,i,!0,0===t)}if(!n.length)return;const a={type:3,tags:t.tags||null,geometry:n};null!==t.id&&(a.id=t.id);e.features.push(a)}(e,t,i)}}function jl(e,t,i,n,a,r){const s=n*n;if(n>0&&t.size<(a?s:n))return void(i.numPoints+=t.points.length/3);const o=[];for(let e=0;e<t.points.length;e+=3)(0===n||t.points[e+2]>s)&&(i.numSimplified++,o.push(t.points[e],t.points[e+1])),i.numPoints++;a&&function(e,t){let i=0;for(let t=0,n=e.length,a=n-2;t<n;a=t,t+=2)i+=(e[t]-e[a])*(e[t+1]+e[a+1]);if(i>0!==t)return;for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],a=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=a}}(o,r),e.push(o)}function Vl(e,t){if(e.transformed)return e;const i=1<<e.z,n=e.x,a=e.y;for(const r of e.features)1===r.type?ql(r,t,i,n,a):Gl(r,t,i,n,a);return e.transformed=!0,e}function ql(e,t,i,n,a){const r=e,s=e.geometry,o=[];for(let e=0;e<s.length;e+=2)o.push(Hl(s[e],s[e+1],t,i,n,a));return r.geometry=o,r}function Gl(e,t,i,n,a){const r=e,s=e.geometry,o=[];for(const e of s){const r=[];for(let s=0;s<e.length;s+=2)r.push(Hl(e[s],e[s+1],t,i,n,a));o.push(r)}return r.geometry=o,r}function Hl(e,t,i,n,a,r){return[Math.round(i*(e*n-a)),Math.round(i*(t*n-r))]}var Wl=class{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(e,t,i){i.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(t),i.debug>1&&console.timeEnd("invalidating");const[n,a,r]=[0,0,0],s=Ul(e,n,a,r,i);s.source=e;const o=Zl(n,a,r);if(this.tiles[o]=s,this.tileCoords.push({z:n,x:a,y:r,id:o}),i.debug){const e=`z${n}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,t,i){return null}getTile(e,t,i){const{extent:n,debug:a}=this.options,r=1<<e,s=Zl(e,t=t+r&r-1,i);if(this.tiles[s])return Vl(this.tiles[s],n);a>1&&console.log("drilling down to z%d-%d-%d",e,t,i);let o,l=e,c=t,u=i;for(;!o&&l>0;)l--,c>>=1,u>>=1,o=this.tiles[Zl(l,c,u)];return o?.source?(a>1&&(console.log("found parent tile z%d-%d-%d",l,c,u),console.time("drilling down")),this.splitTile(o.source,l,c,u,e,t,i),a>1&&console.timeEnd("drilling down"),this.tiles[s]?Vl(this.tiles[s],n):null):null}splitTile(e,t,i,n,a,r,s){const o=[e,t,i,n],l=this.options,c=l.debug;for(;o.length;){n=o.pop(),i=o.pop(),t=o.pop(),e=o.pop();const u=1<<t,h=Zl(t,i,n);let d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=Ul(e,t,i,n,l),this.tileCoords.push({z:t,x:i,y:n,id:h}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(d.source=e,null==a){if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===a)continue;if(null!=a){const e=a-t;if(i!==r>>e||n!==s>>e)continue}}if(d.source=null,!e.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,m=.5-p,g=.5+p,f=1+p;let A=null,_=null,v=null,y=null;const x=rl(e,u,i-p,i+g,0,d.minX,d.maxX,l),b=rl(e,u,i+m,i+f,0,d.minX,d.maxX,l);x&&(A=rl(x,u,n-p,n+g,1,d.minY,d.maxY,l),_=rl(x,u,n+m,n+f,1,d.minY,d.maxY,l)),b&&(v=rl(b,u,n-p,n+g,1,d.minY,d.maxY,l),y=rl(b,u,n+m,n+f,1,d.minY,d.maxY,l)),c>1&&console.timeEnd("clipping"),o.push(A||[],t+1,2*i,2*n),o.push(_||[],t+1,2*i,2*n+1),o.push(v||[],t+1,2*i+1,2*n),o.push(y||[],t+1,2*i+1,2*n+1)}}invalidateTiles(e){if(!e.length)return;const t=this.options,{debug:i}=t;let n=1/0,a=-1/0,r=1/0,s=-1/0;for(const t of e)n=Math.min(n,t.minX),a=Math.max(a,t.maxX),r=Math.min(r,t.minY),s=Math.max(s,t.maxY);const o=t.buffer/t.extent,l=new Set;for(const t in this.tiles){const c=this.tiles[t],u=1<<c.z,h=(c.x-o)/u,d=(c.x+1+o)/u,p=(c.y-o)/u,m=(c.y+1+o)/u;if(a<h||n>=d||s<p||r>=m)continue;let g=!1;for(const t of e)if(t.maxX>=h&&t.minX<d&&t.maxY>=p&&t.minY<m){g=!0;break}if(g){if(i){i>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",c.z,c.x,c.y,c.numFeatures,c.numPoints,c.numSimplified);const e=`z${c.z}`;this.stats[e]=(this.stats[e]||0)-1,this.total--}delete this.tiles[t],l.add(t)}}l.size&&(this.tileCoords=this.tileCoords.filter(e=>!l.has(e.id)))}};function Zl(e,t,i){return 32*((1<<e)*i+t)+e}const Kl={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Il,debug:0};var Xl=class{constructor(e,t){const i=(t=this.options=Object.assign({},Kl,t)).debug;if(i&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=Zo(e,t);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles")),n=Al(n,t),t.updateable&&(this.source=n),this.initializeIndex(n,t)}initializeIndex(e,t){this.tileIndex=t.cluster?new Fl(t.clusterOptions):new Wl(t),e.length&&this.tileIndex.initialize(e)}getTile(e,t,i){return t=+t,i=+i,(e=+e)<0||e>24?null:this.tileIndex.getTile(e,t,i)}updateData(e,t){const i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:n,source:a}=xl(this.source,e,i);t&&({affected:n,source:a}=this.filterUpdate(a,n,t)),n.length&&(this.source=a,this.tileIndex.updateIndex(a,n,i))}filterUpdate(e,t,i){const n=new Set;for(const a of e)null!=a.id&&(i($o(a))||(t.push(a),n.add(a.id)));return{affected:t,source:e=e.filter(e=>!n.has(e.id))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return function(e){return{type:"FeatureCollection",features:e.map(e=>$o(e))}}(this.source)}updateClusterOptions(e,t){const i=this.options.cluster;this.options.cluster=e,this.options.clusterOptions=t,i!=e?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(e){return this.tileIndex.getClusterExpansionZoom(e)}getClusterChildren(e){return this.tileIndex.getChildren(e)}getClusterLeaves(e,t,i){return this.tileIndex.getLeaves(e,t,i)}};const Ql=4294967296,Yl=1/Ql,Jl="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class $l{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,i=this.length){let n;for(;n=this.nextField(i);)e(n,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Ql;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Ql;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf,i=t[this.pos++];if(i<128)return i;let n,a=127&i;return n=t[this.pos++],a|=(127&n)<<7,n<128?a:(n=t[this.pos++],a|=(127&n)<<14,n<128?a:(n=t[this.pos++],a|=(127&n)<<21,n<128?a:(n=t[this.pos],a|=(15&n)<<28,function(e,t,i){const n=i.buf;let a,r;if(r=n[i.pos++],a=(112&r)>>4,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<3,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<10,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<17,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<24,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(1&r)<<31,r<128)return tc(e,a,t);throw new Error("Expected varint not more than 10 bytes")}(a,e,this))))}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Jl?Jl.decode(this.buf.subarray(t,e)):function(e,t,i){let n="",a=t;for(;a<i;){const t=e[a];let r,s,o,l=null,c=t>239?4:t>223?3:t>191?2:1;if(a+c>i)break;1===c?t<128&&(l=t):2===c?(r=e[a+1],128==(192&r)&&(l=(31&t)<<6|63&r,l<=127&&(l=null))):3===c?(r=e[a+1],s=e[a+2],128==(192&r)&&128==(192&s)&&(l=(15&t)<<12|(63&r)<<6|63&s,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(r=e[a+1],s=e[a+2],o=e[a+3],128==(192&r)&&128==(192&s)&&128==(192&o)&&(l=(15&t)<<18|(63&r)<<12|(63&s)<<6|63&o,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),a+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;const t=this.readVarint();return this.type=7&t,this._valueStart=this.pos,t>>>3}skip(e){const t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}}class ec{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Yl),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Yl),!0),this.pos+=8}writeVarint(e){if((e=+e||0)>=0&&e<128)return this.pos>=this.length&&this.realloc(1),void(this.buf[this.pos++]=e);e>268435455||e<0?function(e,t){let i,n;e>=0?(i=e%4294967296|0,n=e/4294967296|0):(i=~(-e%4294967296),n=~(-e/4294967296),4294967295^i?i=i+1|0:(i=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){const i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const t=this.pos;this.pos=function(e,t,i){for(let n,a,r=0;r<t.length;r++){if(n=t.charCodeAt(r),n>55295&&n<57344){if(!a){n>56319||r+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):a=n;continue}if(n<56320){e[i++]=239,e[i++]=191,e[i++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else a&&(e[i++]=239,e[i++]=191,e[i++]=189,a=null);n<128?e[i++]=n:(n<2048?e[i++]=n>>6|192:(n<65536?e[i++]=n>>12|224:(e[i++]=n>>18|240,e[i++]=n>>12&63|128),e[i++]=n>>6&63|128),e[i++]=63&n|128)}return i}(this.buf,e,this.pos);const i=this.pos-t;i>=128&&ic(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t),this.buf.set(e,this.pos),this.pos+=t}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const n=this.pos-i;n>=128&&ic(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,i){this.writeTag(e,2),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,nc,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,ac,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,oc,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,rc,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,sc,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,lc,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,cc,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,uc,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,hc,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function tc(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function ic(e,t,i){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(n),i.buf.copyWithin(e+n,e,i.pos)}function nc(e,t){const i=e.length;let n=t.buf,a=t.pos,r=t.length;for(let s=0;s<i;s++){let i=e[s];if(i<0||a+10>r)t.pos=a,t.writeVarint(i),n=t.buf,a=t.pos,r=t.length;else{for(;i>127;)n[a++]=i%128|128,i=Math.floor(i/128);n[a++]=i}}t.pos=a}function ac(e,t){for(let i=0;i<e.length;i++)t.writeSVarint(e[i])}function rc(e,t){for(let i=0;i<e.length;i++)t.writeFloat(e[i])}function sc(e,t){for(let i=0;i<e.length;i++)t.writeDouble(e[i])}function oc(e,t){for(let i=0;i<e.length;i++)t.writeBoolean(e[i])}function lc(e,t){for(let i=0;i<e.length;i++)t.writeFixed32(e[i])}function cc(e,t){for(let i=0;i<e.length;i++)t.writeSFixed32(e[i])}function uc(e,t){for(let i=0;i<e.length;i++)t.writeFixed64(e[i])}function hc(e,t){for(let i=0;i<e.length;i++)t.writeSFixed64(e[i])}function dc(e,t){this.x=e,this.y=t}dc.prototype={clone(){return new dc(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),i=Math.sin(e),n=t*this.x-i*this.y,a=i*this.x+t*this.y;return this.x=n,this.y=a,this},_rotateAround(e,t){const i=Math.cos(e),n=Math.sin(e),a=t.x+i*(this.x-t.x)-n*(this.y-t.y),r=t.y+n*(this.x-t.x)+i*(this.y-t.y);return this.x=a,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:dc},dc.convert=function(e){if(e instanceof dc)return e;if(Array.isArray(e))return new dc(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new dc(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};var pc=class{constructor(e,t){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=t,"id"in e&&("string"==typeof e.id?this.id=parseInt(e.id,10):"number"!=typeof e.id||isNaN(e.id)||(this.id=e.id))}loadGeometry(){const e=[],t=1===this.feature.type?[this.feature.geometry]:this.feature.geometry;for(const i of t){const t=[];for(const e of i)t.push(new dc(e[0],e[1]));e.push(t)}return e}};const mc="_geojsonTileLayer";var gc=class{constructor(e,t){this.layers={[mc]:this},this.name=mc,this.version=t?t.version:1,this.extent=t?t.extent:4096,this.length=e.length,this.features=e}feature(e){return new pc(this.features[e],this.extent)}};function fc(e,t=""){const i=new ec;return function(e,t,i=""){for(const n in e.layers)t.writeMessage(3,(e,t)=>Ac(e,t,i),e.layers[n])}(e,i,t),i.finish()}function Ac(e,t,i=""){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);const n={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let i=0;i<e.length;i++)n.feature=e.feature(i),t.writeMessage(2,_c,n);const a=n.keys;for(const e of a)t.writeStringField(3,e);const r=n.values;for(const e of r)t.writeMessage(4,wc,e)}function _c(e,t){if(!e.feature)return;const i=e.feature;void 0!==i.id&&t.writeVarintField(1,i.id),t.writeMessage(2,vc,e),t.writeVarintField(3,i.type),t.writeMessage(4,bc,i)}function vc(e,t){for(const i in e.feature?.properties){let n=e.feature.properties[i],a=e.keycache[i];if(null==n)continue;void 0===a&&(e.keys.push(i),a=e.keys.length-1,e.keycache[i]=a),t.writeVarint(a),"string"!=typeof n&&"boolean"!=typeof n&&"number"!=typeof n&&(n=e.jsonPrefix+JSON.stringify(n));const r=typeof n+":"+n;let s=e.valuecache[r];void 0===s&&(e.values.push(n),s=e.values.length-1,e.valuecache[r]=s),t.writeVarint(s)}}function yc(e,t){return(t<<3)+(7&e)}function xc(e){return e<<1^e>>31}function bc(e,t){const i=e.loadGeometry(),n=e.type;let a=0,r=0;for(const s of i){let i=1;1===n&&(i=s.length),t.writeVarint(yc(1,i));const o=3===n?s.length-1:s.length;for(let e=0;e<o;e++){1===e&&1!==n&&t.writeVarint(yc(2,o-1));const i=s[e].x-a,l=s[e].y-r;t.writeVarint(xc(i)),t.writeVarint(xc(l)),a+=i,r+=l}3===e.type&&t.writeVarint(yc(7,1))}}function wc(e,t){const i=typeof e;"string"===i?t.writeStringField(1,e):"boolean"===i?t.writeBooleanField(7,e):"number"===i&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}const Ec={15:100,16:300,17:500,18:800,19:1e3};class kc{constructor(e){this.tiles=new Map,this._parent=e}clearCache(){this.tiles=new Map}_tileToBbox(e,t,i){const n=Math.pow(2,i),a=e/n*360-180,r=(e+1)/n*360-180,s=nt(Math.atan(Math.sinh(Math.PI*(1-2*t/n))));return[a,nt(Math.atan(Math.sinh(Math.PI*(1-2*(t+1)/n)))),r,s]}_semanticsToBasicProps(e){const t={},i=e=>{t[e.key]?t[e.key].add(e.value):t[e.key]=new Set([e.value])};return(e.properties?.collection?.semantics||[]).forEach(i),(e.properties?.semantics||[]).forEach(i),(e.properties?.annotations||[]).forEach(e=>e.semantics.forEach(i)),Object.keys(t).forEach(e=>t[e]=[...t[e]].join(";")),t.picid=e.id,t.seqid=e.collection,t}tile(){return(e,t)=>{t=t||new AbortController;const i=e.url.match(/^sem:\/\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/);if(!i)throw new Error("Invalid URL");if(this.tiles.has(e.url))return{data:this.tiles.get(e.url).buffer.slice(0)};const[,n,a,r,s]=i,o=this._tileToBbox(parseInt(r),parseInt(s),parseInt(a)),l=`${this._parent.getAPI()._endpoint}/search?bbox=${o.join(",")}&limit=${Ec[parseInt(a)]}&sortby=id&filter=${encodeURIComponent(n)}`;return fetch(l,{signal:t.signal}).then(e=>e.json()).then(t=>{if(t.features){if(t.type="FeatureCollection",0===t.features.length){const t=new Uint8Array;return this.tiles.set(e.url,t),{data:t.buffer.slice(0)}}t.features=t.features.filter(e=>{let t=e.properties?.semantics?.length>0||e.properties?.annotations?.length>0;return t||e.properties?.collection?.semantics?.find(e=>"osm|level"===e.key)&&(t=!0),t}).map(e=>({type:e.type,geometry:e.geometry,id:e.id,properties:this._semanticsToBasicProps(e)}))}const i=new Xl(t,{minZoom:15,maxZoom:19}).getTile(a,r,s);if(!i)throw new Error("Can't create tile");const n=function(e,t){const i={};for(const n in e)i[n]=new gc(e[n].features,t),i[n].name=n,i[n].version=t?t.version:1,i[n].extent=t?t.extent:4096;return fc({layers:i})}({layer:i},{version:2});return this.tiles.set(e.url,n),{data:n.buffer.slice(0)}}).catch(e=>{e.message&&e.message.includes("The operation was aborted")||console.error(e)})}}}class Sc{constructor(e,t,i,n,a){for(this.properties=Object.create(null),this.extent=i,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=a;e.pos<t;){const t=e.readVarint();if(8===t)this.id=e.readVarint();else if(18===t){const t=e.readVarint()+e.pos;for(;e.pos<t;){const t=n[e.readVarint()],i=a[e.readVarint()];this.properties[t]=i}}else 24===t?this.type=e.readVarint():34===t?(this._geometry=e.pos,e.skip(t)):e.skip(t)}}loadGeometry(){if(this._geometry<0)throw new Error("feature has no geometry");const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos,i=[];let n,a=1,r=0,s=0,o=0;for(;e.pos<t;){if(r<=0){const t=e.readVarint();if(a=7&t,r=t>>3,0===r)continue}if(r--,1===a)s+=e.readSVarint(),o+=e.readSVarint(),n&&i.push(n),n=[new dc(s,o)];else if(2===a)s+=e.readSVarint(),o+=e.readSVarint(),n&&n.push(new dc(s,o));else{if(7!==a)throw new Error(`unknown command ${a}`);n&&n.push(n[0].clone())}}return n&&i.push(n),i}bbox(){if(this._geometry<0)throw new Error("feature has no geometry");const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let i=1,n=0,a=0,r=0,s=1/0,o=-1/0,l=1/0,c=-1/0;for(;e.pos<t;){if(n<=0){const t=e.readVarint();if(i=7&t,n=t>>3,0===n)continue}if(n--,1===i||2===i)a+=e.readSVarint(),r+=e.readSVarint(),a<s&&(s=a),a>o&&(o=a),r<l&&(l=r),r>c&&(c=r);else if(7!==i)throw new Error(`unknown command ${i}`)}return[s,l,o,c]}toGeoJSON(e,t,i){const n=this.extent*Math.pow(2,i),a=this.extent*e,r=this.extent*t,s=this.loadGeometry();function o(e){return[360*(e.x+a)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+r)/n)*Math.PI))-90]}function l(e){return e.map(o)}let c;if(1===this.type){const e=[];for(const t of s)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=s.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const i=[];let n,a;for(let r=0;r<t;r++){const t=Mc(e[r]);0!==t&&(void 0===a&&(a=t<0),a===t<0?(n&&i.push(n),n=[e[r]]):n&&n.push(e[r]))}n&&i.push(n);return i}(s),t=[];for(const i of e)t.push(i.map(l));c=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}const u={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(u.id=this.id),u}}function Mc(e){let t=0;for(let i,n,a=0,r=e.length,s=r-1;a<r;s=a++)i=e[a],n=e[s],t+=(n.x-i.x)*(i.y+n.y);return t}Sc.types=["Unknown","Point","LineString","Polygon"];class Cc{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],void 0===t&&(t=e.length);e.pos<t;){const t=e.readVarint();10===t?this.name=e.readString():18===t?(this._features.push(e.pos),e.skip(t)):26===t?this._keys.push(e.readString()):34===t?this._values.push(Tc(e)):40===t?this.extent=e.readVarint():120===t?this.version=e.readVarint():e.skip(t)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new Sc(this._pbf,t,this.extent,this._keys,this._values)}}function Tc(e){let t=null;const i=e.readVarint()+e.pos;for(;e.pos<i;){const i=e.readVarint();t=10===i?e.readString():21===i?e.readFloat():25===i?e.readDouble():32===i?e.readVarint(!0):40===i?e.readVarint():48===i?e.readSVarint():56===i?e.readBoolean():(e.skip(i),null)}if(null==t)throw new Error("unknown feature value");return t}class Dc{constructor(e,t=e.length){const i=Object.create(null);for(;e.pos<t;){const t=e.readVarint();if(26===t){const t=new Cc(e,e.readVarint()+e.pos);t.length&&(i[t.name]=t)}else e.skip(t)}this.layers=i}}class Pc{tile(){return(e,t)=>{t=t||new AbortController;const i=e.url.replace(/^panora/,"http");return fetch(i,{signal:t.signal}).then(e=>e.arrayBuffer()).then(e=>new Dc(new $l(e))).then(e=>(!e.layers.pictures||e.layers.pictures.length>=5e3||Object.values(e.layers).forEach(e=>{const t=e.feature.bind(e);e.feature=e=>{const i=t(e);return i.properties.uncrowded=!0,i}}),e)).then(e=>fc(e).buffer).then(e=>({data:e}))}}}const Ic="-1000",Fc="levels";function zc(){try{return IndoorEqual,!0}catch(e){return!1}}function Rc(e,t=!1){if(e._options.indoor)if(zc()){if(!t&&!1===e._options.indoor.visible)return;e.indoorEqual=new IndoorEqual(e,e._options.indoor),e.addControl(e.indoorEqual),e.indoorEqual.loadSprite("https://files.pavie.info/depot/remote/indoorequal/indoorequal"),e.indoorEqual._refreshAfterLevelsUpdate=function(){this.levels.includes(this.level)||this.level==Ic||this.setLevel("0")};const i="sem-"+Fc;e.indoorEqual._updateLevels=function(){if(this.map.getSource(this.source.sourceId)&&this.map.isSourceLoaded(this.source.sourceId)&&this.map.getSource(i)&&this.map.isSourceLoaded(i)){let e=new Set;this.map.querySourceFeatures(this.source.sourceId,{sourceLayer:"area"}).forEach(t=>{"level"!==t.properties.class&&void 0!==t.properties.level&&e.add(t.properties.level.toString())}),this.map.querySourceFeatures(i,{sourceLayer:"layer"}).forEach(t=>{void 0!==t.properties["osm|level"]&&e.add(t.properties["osm|level"].toString())}),e.size>0&&e.add("0"),0!==e.symmetricDifference(new Set(this.levels)).size&&(this.levels=[...e].sort((e,t)=>parseFloat(e)-parseFloat(t)).reverse(),this._emitLevelsChange(),this._refreshAfterLevelsUpdate())}},e._indoorFeaturesIDs={pictures:{},sequences:{}},e.on("sourcedata",Fc,t=>{t.sourceId===i&&(t.features.forEach(t=>{e._indoorFeaturesIDs.pictures[t.properties["osm|level"]]||(e._indoorFeaturesIDs.pictures[t.properties["osm|level"]]=new Set),e._indoorFeaturesIDs.sequences[t.properties["osm|level"]]||(e._indoorFeaturesIDs.sequences[t.properties["osm|level"]]=new Set),e._indoorFeaturesIDs.pictures[t.properties["osm|level"]].add(t.properties.picid),e._indoorFeaturesIDs.sequences[t.properties["osm|level"]].add(t.properties.seqid)}),s())});const n=()=>{e.addSemanticOverlay?.(Fc,'"semantics.osm|level" IS NOT NULL',{type:"circle",layout:{visibility:"visible"},paint:{"circle-opacity":0}}),t&&e._parent._initParams?.getMapPostInit()?.level===Ic?e.indoorEqual.setLevel("0"):[null,void 0,""].includes(e._parent._initParams?.getMapPostInit()?.level)||e.indoorEqual.setLevel(e._parent._initParams?.getMapPostInit()?.level)};if(e.isStyleLoaded())n();else{const t=setInterval(()=>{e.isStyleLoaded()&&(n(),clearInterval(t))},250)}let a;e._parent.grid.appendChild(bs("pnx-level-select",{slot:"bottom-right",_parent:e._parent,class:"pnx-only-map pnx-print-hidden"}));const r=()=>{if(e.indoorEqual.level===Ic)e.restrictVisibleFeatures("hide","pictures",[]),e.restrictVisibleFeatures("hide","sequences",[]);else if("0"===e.indoorEqual.level){const t=new Set;Object.entries(e._indoorFeaturesIDs.pictures).forEach(([e,i])=>{"0"!=e&&i.forEach(e=>t.add(e))}),e.restrictVisibleFeatures("hide","pictures",[...t]);let i=new Set;Object.entries(e._indoorFeaturesIDs.sequences).forEach(([e,t])=>{"0"!=e&&(i=i.union(t))}),e._indoorFeaturesIDs.sequences[0]&&(i=i.difference(e._indoorFeaturesIDs.sequences[0])),e.restrictVisibleFeatures("hide","sequences",[...i])}else e.restrictVisibleFeatures("keep","pictures",e._indoorFeaturesIDs.pictures[e.indoorEqual.level]?[...e._indoorFeaturesIDs.pictures[e.indoorEqual.level]]:[]),e.restrictVisibleFeatures("keep","sequences",e._indoorFeaturesIDs.sequences[e.indoorEqual.level]?[...e._indoorFeaturesIDs.sequences[e.indoorEqual.level]]:[])},s=()=>{a&&(clearTimeout(a),a=void 0),a=setTimeout(r,250)};e.indoorEqual.on("levelchange",s)}else console.error("The indoor= plugin is not enabled. Please add the maplibre-gl-indoorequal before calling 'indoor' option of Panoramax Viewer.")}var Lc=Object.freeze({__proto__:null,DISABLED_LEVEL:Ic,initIndoorEqualOnMap:Rc,isIndoorEqualAvailable:zc}),Bc=Object.create,Oc=Object.defineProperty,Uc=Object.getOwnPropertyDescriptor,Nc=Object.getOwnPropertyNames,jc=Object.getPrototypeOf,Vc=Object.prototype.hasOwnProperty,qc=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Gc=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,r=Nc(t),s=0,o=r.length;s<o;s++)a=r[s],!Vc.call(e,a)&&a!==i&&Oc(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(n=Uc(t,a))||n.enumerable});return e};
|
|
27
|
+
*/function gt(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ft(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function At(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ft(Object(i),!0).forEach(function(t){gt(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ft(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}const _t=()=>{};let vt={},yt={},xt=null,bt={mark:_t,measure:_t};try{"undefined"!=typeof window&&(vt=window),"undefined"!=typeof document&&(yt=document),"undefined"!=typeof MutationObserver&&(xt=MutationObserver),"undefined"!=typeof performance&&(bt=performance)}catch(y2){}const{userAgent:wt=""}=vt.navigator||{},Et=vt,kt=yt,St=xt,Mt=bt;Et.document;const Ct=!!kt.documentElement&&!!kt.head&&"function"==typeof kt.addEventListener&&"function"==typeof kt.createElement,Tt=~wt.indexOf("MSIE")||~wt.indexOf("Trident/");var Dt={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"}},Pt=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],It="classic",Ft="duotone",zt=[It,Ft,"sharp","sharp-duotone"],Rt=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}]]),Lt=["fak","fa-kit","fakd","fa-kit-duotone"],Bt={fak:"kit","fa-kit":"kit"},Ot={fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"},Ut=["fak","fakd"],Nt={kit:"fak"},jt={"kit-duotone":"fakd"},Vt={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},qt=["fak","fa-kit","fakd","fa-kit-duotone"],Gt={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"}},Ht=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt","fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands"],Wt=[1,2,3,4,5,6,7,8,9,10],Zt=Wt.concat([11,12,13,14,15,16,17,18,19,20]),Kt=[...Object.keys({classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"]}),"solid","regular","light","thin","duotone","brands","2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Vt.GROUP,Vt.SWAP_OPACITY,Vt.PRIMARY,Vt.SECONDARY].concat(Wt.map(e=>"".concat(e,"x"))).concat(Zt.map(e=>"w-".concat(e)));const Xt="___FONT_AWESOME___",Qt=16,Yt="svg-inline--fa",Jt="data-fa-i2svg",$t="data-fa-pseudo-element",ei="data-prefix",ti="data-icon",ii="fontawesome-i2svg",ni=["HTML","HEAD","STYLE","SCRIPT"],ai=(()=>{try{return"production"===process.env.NODE_ENV}catch(e){return!1}})();function ri(e){return new Proxy(e,{get:(e,t)=>t in e?e[t]:e[It]})}const si=At({},Dt);si[It]=At(At(At(At({},{"fa-duotone":"duotone"}),Dt[It]),Bt),Ot);const oi=ri(si),li=At({},{classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",brands:"fab"},duotone:{solid:"fad",regular:"fadr",light:"fadl",thin:"fadt"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds",regular:"fasdr",light:"fasdl",thin:"fasdt"}});li[It]=At(At(At(At({},{duotone:"fad"}),li[It]),Nt),jt);const ci=ri(li),ui=At({},Gt);ui[It]=At(At({},ui[It]),{fak:"fa-kit"});const hi=ri(ui),di=At({},{classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"}});di[It]=At(At({},di[It]),{"fa-kit":"fak"}),ri(di);const pi=/fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,mi="fa-layers-text",gi=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i;ri(At({},{classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"}}));const fi=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],Ai={GROUP:"duotone-group",PRIMARY:"primary",SECONDARY:"secondary"},_i=["kit",...Kt],vi=Et.FontAwesomeConfig||{};if(kt&&"function"==typeof kt.querySelector){[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(e=>{let[t,i]=e;const n=function(e){return""===e||"false"!==e&&("true"===e||e)}(function(e){var t=kt.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}(t));null!=n&&(vi[i]=n)})}const yi={styleDefault:"solid",familyDefault:It,cssPrefix:"fa",replacementClass:Yt,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};vi.familyPrefix&&(vi.cssPrefix=vi.familyPrefix);const xi=At(At({},yi),vi);xi.autoReplaceSvg||(xi.observeMutations=!1);const bi={};Object.keys(yi).forEach(e=>{Object.defineProperty(bi,e,{enumerable:!0,set:function(t){xi[e]=t,wi.forEach(e=>e(bi))},get:function(){return xi[e]}})}),Object.defineProperty(bi,"familyPrefix",{enumerable:!0,set:function(e){xi.cssPrefix=e,wi.forEach(e=>e(bi))},get:function(){return xi.cssPrefix}}),Et.FontAwesomeConfig=bi;const wi=[];const Ei=Qt,ki={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function Si(){let e=12,t="";for(;e-- >0;)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return t}function Mi(e){const t=[];for(let i=(e||[]).length>>>0;i--;)t[i]=e[i];return t}function Ci(e){return e.classList?Mi(e.classList):(e.getAttribute("class")||"").split(" ").filter(e=>e)}function Ti(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Di(e){return Object.keys(e||{}).reduce((t,i)=>t+"".concat(i,": ").concat(e[i].trim(),";"),"")}function Pi(e){return e.size!==ki.size||e.x!==ki.x||e.y!==ki.y||e.rotate!==ki.rotate||e.flipX||e.flipY}function Ii(){const e="fa",t=Yt,i=bi.cssPrefix,n=bi.replacementClass;let a=':root, :host {\n --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free";\n --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free";\n --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro";\n --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro";\n --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone";\n --fa-font-duotone-regular: normal 400 1em/1 "Font Awesome 6 Duotone";\n --fa-font-duotone-light: normal 300 1em/1 "Font Awesome 6 Duotone";\n --fa-font-duotone-thin: normal 100 1em/1 "Font Awesome 6 Duotone";\n --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands";\n --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp";\n --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone";\n --fa-font-sharp-duotone-regular: normal 400 1em/1 "Font Awesome 6 Sharp Duotone";\n --fa-font-sharp-duotone-light: normal 300 1em/1 "Font Awesome 6 Sharp Duotone";\n --fa-font-sharp-duotone-thin: normal 100 1em/1 "Font Awesome 6 Sharp Duotone";\n}\n\nsvg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {\n overflow: visible;\n box-sizing: content-box;\n}\n\n.svg-inline--fa {\n display: var(--fa-display, inline-block);\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-2xs {\n vertical-align: 0.1em;\n}\n.svg-inline--fa.fa-xs {\n vertical-align: 0em;\n}\n.svg-inline--fa.fa-sm {\n vertical-align: -0.0714285705em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.2em;\n}\n.svg-inline--fa.fa-xl {\n vertical-align: -0.25em;\n}\n.svg-inline--fa.fa-2xl {\n vertical-align: -0.3125em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: var(--fa-pull-margin, 0.3em);\n width: auto;\n}\n.svg-inline--fa.fa-li {\n width: var(--fa-li-width, 2em);\n top: 0.25em;\n}\n.svg-inline--fa.fa-fw {\n width: var(--fa-fw-width, 1.25em);\n}\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n transform-origin: center center;\n}\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: center center;\n}\n\n.fa-layers-counter {\n background-color: var(--fa-counter-background-color, #ff253a);\n border-radius: var(--fa-counter-border-radius, 1em);\n box-sizing: border-box;\n color: var(--fa-inverse, #fff);\n line-height: var(--fa-counter-line-height, 1);\n max-width: var(--fa-counter-max-width, 5em);\n min-width: var(--fa-counter-min-width, 1.5em);\n overflow: hidden;\n padding: var(--fa-counter-padding, 0.25em 0.5em);\n right: var(--fa-right, 0);\n text-overflow: ellipsis;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-counter-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-bottom-right {\n bottom: var(--fa-bottom, 0);\n right: var(--fa-right, 0);\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom right;\n}\n\n.fa-layers-bottom-left {\n bottom: var(--fa-bottom, 0);\n left: var(--fa-left, 0);\n right: auto;\n top: auto;\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: bottom left;\n}\n\n.fa-layers-top-right {\n top: var(--fa-top, 0);\n right: var(--fa-right, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top right;\n}\n\n.fa-layers-top-left {\n left: var(--fa-left, 0);\n right: auto;\n top: var(--fa-top, 0);\n transform: scale(var(--fa-layers-scale, 0.25));\n transform-origin: top left;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-2xs {\n font-size: 0.625em;\n line-height: 0.1em;\n vertical-align: 0.225em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n line-height: 0.0833333337em;\n vertical-align: 0.125em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n line-height: 0.0714285718em;\n vertical-align: 0.0535714295em;\n}\n\n.fa-lg {\n font-size: 1.25em;\n line-height: 0.05em;\n vertical-align: -0.075em;\n}\n\n.fa-xl {\n font-size: 1.5em;\n line-height: 0.0416666682em;\n vertical-align: -0.125em;\n}\n\n.fa-2xl {\n font-size: 2em;\n line-height: 0.03125em;\n vertical-align: -0.1875em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: var(--fa-li-margin, 2.5em);\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: calc(-1 * var(--fa-li-width, 2em));\n position: absolute;\n text-align: center;\n width: var(--fa-li-width, 2em);\n line-height: inherit;\n}\n\n.fa-border {\n border-color: var(--fa-border-color, #eee);\n border-radius: var(--fa-border-radius, 0.1em);\n border-style: var(--fa-border-style, solid);\n border-width: var(--fa-border-width, 0.08em);\n padding: var(--fa-border-padding, 0.2em 0.25em 0.15em);\n}\n\n.fa-pull-left {\n float: left;\n margin-right: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-pull-right {\n float: right;\n margin-left: var(--fa-pull-margin, 0.3em);\n}\n\n.fa-beat {\n animation-name: fa-beat;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-bounce {\n animation-name: fa-bounce;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1));\n}\n\n.fa-fade {\n animation-name: fa-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-beat-fade {\n animation-name: fa-beat-fade;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1));\n}\n\n.fa-flip {\n animation-name: fa-flip;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, ease-in-out);\n}\n\n.fa-shake {\n animation-name: fa-shake;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin {\n animation-name: fa-spin;\n animation-delay: var(--fa-animation-delay, 0s);\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 2s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, linear);\n}\n\n.fa-spin-reverse {\n --fa-animation-direction: reverse;\n}\n\n.fa-pulse,\n.fa-spin-pulse {\n animation-name: fa-spin;\n animation-direction: var(--fa-animation-direction, normal);\n animation-duration: var(--fa-animation-duration, 1s);\n animation-iteration-count: var(--fa-animation-iteration-count, infinite);\n animation-timing-function: var(--fa-animation-timing, steps(8));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fa-beat,\n.fa-bounce,\n.fa-fade,\n.fa-beat-fade,\n.fa-flip,\n.fa-pulse,\n.fa-shake,\n.fa-spin,\n.fa-spin-pulse {\n animation-delay: -1ms;\n animation-duration: 1ms;\n animation-iteration-count: 1;\n transition-delay: 0s;\n transition-duration: 0s;\n }\n}\n@keyframes fa-beat {\n 0%, 90% {\n transform: scale(1);\n }\n 45% {\n transform: scale(var(--fa-beat-scale, 1.25));\n }\n}\n@keyframes fa-bounce {\n 0% {\n transform: scale(1, 1) translateY(0);\n }\n 10% {\n transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0);\n }\n 30% {\n transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em));\n }\n 50% {\n transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0);\n }\n 57% {\n transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em));\n }\n 64% {\n transform: scale(1, 1) translateY(0);\n }\n 100% {\n transform: scale(1, 1) translateY(0);\n }\n}\n@keyframes fa-fade {\n 50% {\n opacity: var(--fa-fade-opacity, 0.4);\n }\n}\n@keyframes fa-beat-fade {\n 0%, 100% {\n opacity: var(--fa-beat-fade-opacity, 0.4);\n transform: scale(1);\n }\n 50% {\n opacity: 1;\n transform: scale(var(--fa-beat-fade-scale, 1.125));\n }\n}\n@keyframes fa-flip {\n 50% {\n transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg));\n }\n}\n@keyframes fa-shake {\n 0% {\n transform: rotate(-15deg);\n }\n 4% {\n transform: rotate(15deg);\n }\n 8%, 24% {\n transform: rotate(-18deg);\n }\n 12%, 28% {\n transform: rotate(18deg);\n }\n 16% {\n transform: rotate(-22deg);\n }\n 20% {\n transform: rotate(22deg);\n }\n 32% {\n transform: rotate(-12deg);\n }\n 36% {\n transform: rotate(12deg);\n }\n 40%, 100% {\n transform: rotate(0deg);\n }\n}\n@keyframes fa-spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n transform: scale(1, -1);\n}\n\n.fa-flip-both,\n.fa-flip-horizontal.fa-flip-vertical {\n transform: scale(-1, -1);\n}\n\n.fa-rotate-by {\n transform: rotate(var(--fa-rotate-angle, 0));\n}\n\n.fa-stack {\n display: inline-block;\n vertical-align: middle;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n z-index: var(--fa-stack-z-index, auto);\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: var(--fa-inverse, #fff);\n}\n\n.sr-only,\n.fa-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.sr-only-focusable:not(:focus),\n.fa-sr-only-focusable:not(:focus) {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}';if(i!==e||n!==t){const r=new RegExp("\\.".concat(e,"\\-"),"g"),s=new RegExp("\\--".concat(e,"\\-"),"g"),o=new RegExp("\\.".concat(t),"g");a=a.replace(r,".".concat(i,"-")).replace(s,"--".concat(i,"-")).replace(o,".".concat(n))}return a}let Fi=!1;function zi(){bi.autoAddCss&&!Fi&&(!function(e){if(!e||!Ct)return;const t=kt.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;const i=kt.head.childNodes;let n=null;for(let e=i.length-1;e>-1;e--){const t=i[e],a=(t.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(n=t)}kt.head.insertBefore(t,n)}(Ii()),Fi=!0)}var Ri={mixout:()=>({dom:{css:Ii,insertCss:zi}}),hooks:()=>({beforeDOMElementCreation(){zi()},beforeI2svg(){zi()}})};const Li=Et||{};Li[Xt]||(Li[Xt]={}),Li[Xt].styles||(Li[Xt].styles={}),Li[Xt].hooks||(Li[Xt].hooks={}),Li[Xt].shims||(Li[Xt].shims=[]);var Bi=Li[Xt];const Oi=[],Ui=function(){kt.removeEventListener("DOMContentLoaded",Ui),Ni=1,Oi.map(e=>e())};let Ni=!1;function ji(e){const{tag:t,attributes:i={},children:n=[]}=e;return"string"==typeof e?Ti(e):"<".concat(t," ").concat(function(e){return Object.keys(e||{}).reduce((t,i)=>t+"".concat(i,'="').concat(Ti(e[i]),'" '),"").trim()}(i),">").concat(n.map(ji).join(""),"</").concat(t,">")}function Vi(e,t,i){if(e&&e[t]&&e[t][i])return{prefix:t,iconName:i,icon:e[t][i]}}Ct&&(Ni=(kt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(kt.readyState),Ni||kt.addEventListener("DOMContentLoaded",Ui));var qi=function(e,t,i,n){var a,r,s,o=Object.keys(e),l=o.length,c=t;for(void 0===i?(a=1,s=e[o[0]]):(a=0,s=i);a<l;a++)s=c(s,e[r=o[a]],r,e);return s};function Gi(e){const t=function(e){const t=[];let i=0;const n=e.length;for(;i<n;){const a=e.charCodeAt(i++);if(a>=55296&&a<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&a)<<10)+(1023&n)+65536):(t.push(a),i--)}else t.push(a)}return t}(e);return 1===t.length?t[0].toString(16):null}function Hi(e){return Object.keys(e).reduce((t,i)=>{const n=e[i];return!!n.icon?t[n.iconName]=n.icon:t[i]=n,t},{})}function Wi(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{skipHooks:n=!1}=i,a=Hi(t);"function"!=typeof Bi.hooks.addPack||n?Bi.styles[e]=At(At({},Bi.styles[e]||{}),a):Bi.hooks.addPack(e,Hi(t)),"fas"===e&&Wi("fa",t)}const{styles:Zi,shims:Ki}=Bi,Xi=Object.keys(hi),Qi=Xi.reduce((e,t)=>(e[t]=Object.keys(hi[t]),e),{});let Yi=null,Ji={},$i={},en={},tn={},nn={};function an(e,t){const i=t.split("-"),n=i[0],a=i.slice(1).join("-");return n!==e||""===a||(r=a,~_i.indexOf(r))?null:a;var r}const rn=()=>{const e=e=>qi(Zi,(t,i,n)=>(t[n]=qi(i,e,{}),t),{});Ji=e((e,t,i)=>{if(t[3]&&(e[t[3]]=i),t[2]){t[2].filter(e=>"number"==typeof e).forEach(t=>{e[t.toString(16)]=i})}return e}),$i=e((e,t,i)=>{if(e[i]=i,t[2]){t[2].filter(e=>"string"==typeof e).forEach(t=>{e[t]=i})}return e}),nn=e((e,t,i)=>{const n=t[2];return e[i]=i,n.forEach(t=>{e[t]=i}),e});const t="far"in Zi||bi.autoFetchSvg,i=qi(Ki,(e,i)=>{const n=i[0];let a=i[1];const r=i[2];return"far"!==a||t||(a="fas"),"string"==typeof n&&(e.names[n]={prefix:a,iconName:r}),"number"==typeof n&&(e.unicodes[n.toString(16)]={prefix:a,iconName:r}),e},{names:{},unicodes:{}});en=i.names,tn=i.unicodes,Yi=un(bi.styleDefault,{family:bi.familyDefault})};function sn(e,t){return(Ji[e]||{})[t]}function on(e,t){return(nn[e]||{})[t]}function ln(e){return en[e]||{prefix:null,iconName:null}}function cn(){return Yi}!function(e){wi.push(e)}(e=>{Yi=un(e.styleDefault,{family:bi.familyDefault})}),rn();function un(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{family:i=It}=t,n=oi[i][e];if(i===Ft&&!e)return"fad";const a=ci[i][e]||ci[i][n],r=e in Bi.styles?e:null;return a||r||null}function hn(e){return e.sort().filter((e,t,i)=>i.indexOf(e)===t)}function dn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{skipLookups:i=!1}=t;let n=null;const a=Ht.concat(qt),r=hn(e.filter(e=>a.includes(e))),s=hn(e.filter(e=>!Ht.includes(e))),o=r.filter(e=>(n=e,!Pt.includes(e))),[l=null]=o,c=function(e){let t=It;const i=Xi.reduce((e,t)=>(e[t]="".concat(bi.cssPrefix,"-").concat(t),e),{});return zt.forEach(n=>{(e.includes(i[n])||e.some(e=>Qi[n].includes(e)))&&(t=n)}),t}(r),u=At(At({},function(e){let t=[],i=null;return e.forEach(e=>{const n=an(bi.cssPrefix,e);n?i=n:e&&t.push(e)}),{iconName:i,rest:t}}(s)),{},{prefix:un(l,{family:c})});return At(At(At({},u),function(e){const{values:t,family:i,canonical:n,givenPrefix:a="",styles:r={},config:s={}}=e,o=i===Ft,l=t.includes("fa-duotone")||t.includes("fad"),c="duotone"===s.familyDefault,u="fad"===n.prefix||"fa-duotone"===n.prefix;!o&&(l||c||u)&&(n.prefix="fad");(t.includes("fa-brands")||t.includes("fab"))&&(n.prefix="fab");if(!n.prefix&&pn.includes(i)){const e=Object.keys(r).find(e=>mn.includes(e));if(e||s.autoFetchSvg){const e=Rt.get(i).defaultShortPrefixId;n.prefix=e,n.iconName=on(n.prefix,n.iconName)||n.iconName}}"fa"!==n.prefix&&"fa"!==a||(n.prefix=cn()||"fas");return n}({values:e,family:c,styles:Zi,config:bi,canonical:u,givenPrefix:n})),function(e,t,i){let{prefix:n,iconName:a}=i;if(e||!n||!a)return{prefix:n,iconName:a};const r="fa"===t?ln(a):{},s=on(n,a);a=r.iconName||s||a,n=r.prefix||n,"far"!==n||Zi.far||!Zi.fas||bi.autoFetchSvg||(n="fas");return{prefix:n,iconName:a}}(i,n,u))}const pn=zt.filter(e=>e!==It||e!==Ft),mn=Object.keys(Gt).filter(e=>e!==It).map(e=>Object.keys(Gt[e])).flat();let gn=[],fn={};const An={},_n=Object.keys(An);function vn(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];return(fn[e]||[]).forEach(e=>{t=e.apply(null,[t,...n])}),t}function yn(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];(fn[e]||[]).forEach(e=>{e.apply(null,i)})}function xn(){const e=arguments[0],t=Array.prototype.slice.call(arguments,1);return An[e]?An[e].apply(null,t):void 0}function bn(e){"fa"===e.prefix&&(e.prefix="fas");let{iconName:t}=e;const i=e.prefix||cn();if(t)return t=on(i,t)||t,Vi(wn.definitions,i,t)||Vi(Bi.styles,i,t)}const wn=new class{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t.reduce(this._pullDefinitions,{});Object.keys(n).forEach(e=>{this.definitions[e]=At(At({},this.definitions[e]||{}),n[e]),Wi(e,n[e]);const t=hi[It][e];t&&Wi(t,n[e]),rn()})}reset(){this.definitions={}}_pullDefinitions(e,t){const i=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(i).map(t=>{const{prefix:n,iconName:a,icon:r}=i[t],s=r[2];e[n]||(e[n]={}),s.length>0&&s.forEach(t=>{"string"==typeof t&&(e[n][t]=r)}),e[n][a]=r}),e}},En={i2svg:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ct?(yn("beforeI2svg",e),xn("pseudoElements2svg",e),xn("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t}=e;!1===bi.autoReplaceSvg&&(bi.autoReplaceSvg=!0),bi.observeMutations=!0,function(e){Ct&&(Ni?setTimeout(e,0):Oi.push(e))}(()=>{Mn({autoReplaceSvgRoot:t}),yn("watch",e)})}},kn={icon:e=>{if(null===e)return null;if("object"==typeof e&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:on(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&2===e.length){const t=0===e[1].indexOf("fa-")?e[1].slice(3):e[1],i=un(e[0]);return{prefix:i,iconName:on(i,t)||t}}if("string"==typeof e&&(e.indexOf("".concat(bi.cssPrefix,"-"))>-1||e.match(pi))){const t=dn(e.split(" "),{skipLookups:!0});return{prefix:t.prefix||cn(),iconName:on(t.prefix,t.iconName)||t.iconName}}if("string"==typeof e){const t=cn();return{prefix:t,iconName:on(t,e)||e}}}},Sn={noAuto:()=>{bi.autoReplaceSvg=!1,bi.observeMutations=!1,yn("noAuto")},config:bi,dom:En,parse:kn,library:wn,findIconDefinition:bn,toHtml:ji},Mn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoReplaceSvgRoot:t=kt}=e;(Object.keys(Bi.styles).length>0||bi.autoFetchSvg)&&Ct&&bi.autoReplaceSvg&&Sn.dom.i2svg({node:t})};function Cn(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(e=>ji(e))}}),Object.defineProperty(e,"node",{get:function(){if(!Ct)return;const t=kt.createElement("div");return t.innerHTML=e.html,t.children}}),e}function Tn(e){const{icons:{main:t,mask:i},prefix:n,iconName:a,transform:r,symbol:s,title:o,maskId:l,titleId:c,extra:u,watchable:h=!1}=e,{width:d,height:p}=i.found?i:t,m=Ut.includes(n),g=[bi.replacementClass,a?"".concat(bi.cssPrefix,"-").concat(a):""].filter(e=>-1===u.classes.indexOf(e)).filter(e=>""!==e||!!e).concat(u.classes).join(" ");let f={children:[],attributes:At(At({},u.attributes),{},{"data-prefix":n,"data-icon":a,class:g,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(p)})};const A=m&&!~u.classes.indexOf("fa-fw")?{width:"".concat(d/p*16*.0625,"em")}:{};h&&(f.attributes[Jt]=""),o&&(f.children.push({tag:"title",attributes:{id:f.attributes["aria-labelledby"]||"title-".concat(c||Si())},children:[o]}),delete f.attributes.title);const _=At(At({},f),{},{prefix:n,iconName:a,main:t,mask:i,maskId:l,transform:r,symbol:s,styles:At(At({},A),u.styles)}),{children:v,attributes:y}=i.found&&t.found?xn("generateAbstractMask",_)||{children:[],attributes:{}}:xn("generateAbstractIcon",_)||{children:[],attributes:{}};return _.children=v,_.attributes=y,s?function(e){let{prefix:t,iconName:i,children:n,attributes:a,symbol:r}=e;const s=!0===r?"".concat(t,"-").concat(bi.cssPrefix,"-").concat(i):r;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:At(At({},a),{},{id:s}),children:n}]}]}(_):function(e){let{children:t,main:i,mask:n,attributes:a,styles:r,transform:s}=e;if(Pi(s)&&i.found&&!n.found){const{width:e,height:t}=i,n={x:e/t/2,y:.5};a.style=Di(At(At({},r),{},{"transform-origin":"".concat(n.x+s.x/16,"em ").concat(n.y+s.y/16,"em")}))}return[{tag:"svg",attributes:a,children:t}]}(_)}function Dn(e){const{content:t,width:i,height:n,transform:a,title:r,extra:s,watchable:o=!1}=e,l=At(At(At({},s.attributes),r?{title:r}:{}),{},{class:s.classes.join(" ")});o&&(l[Jt]="");const c=At({},s.styles);Pi(a)&&(c.transform=function(e){let{transform:t,width:i=Qt,height:n=Qt,startCentered:a=!1}=e,r="";return r+=a&&Tt?"translate(".concat(t.x/Ei-i/2,"em, ").concat(t.y/Ei-n/2,"em) "):a?"translate(calc(-50% + ".concat(t.x/Ei,"em), calc(-50% + ").concat(t.y/Ei,"em)) "):"translate(".concat(t.x/Ei,"em, ").concat(t.y/Ei,"em) "),r+="scale(".concat(t.size/Ei*(t.flipX?-1:1),", ").concat(t.size/Ei*(t.flipY?-1:1),") "),r+="rotate(".concat(t.rotate,"deg) "),r}({transform:a,startCentered:!0,width:i,height:n}),c["-webkit-transform"]=c.transform);const u=Di(c);u.length>0&&(l.style=u);const h=[];return h.push({tag:"span",attributes:l,children:[t]}),r&&h.push({tag:"span",attributes:{class:"sr-only"},children:[r]}),h}const{styles:Pn}=Bi;function In(e){const t=e[0],i=e[1],[n]=e.slice(4);let a=null;return a=Array.isArray(n)?{tag:"g",attributes:{class:"".concat(bi.cssPrefix,"-").concat(Ai.GROUP)},children:[{tag:"path",attributes:{class:"".concat(bi.cssPrefix,"-").concat(Ai.SECONDARY),fill:"currentColor",d:n[0]}},{tag:"path",attributes:{class:"".concat(bi.cssPrefix,"-").concat(Ai.PRIMARY),fill:"currentColor",d:n[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:n}},{found:!0,width:t,height:i,icon:a}}const Fn={found:!1,width:512,height:512};function zn(e,t){let i=t;return"fa"===t&&null!==bi.styleDefault&&(t=cn()),new Promise((n,a)=>{if("fa"===i){const i=ln(e)||{};e=i.iconName||e,t=i.prefix||t}if(e&&t&&Pn[t]&&Pn[t][e]){return n(In(Pn[t][e]))}!function(e,t){ai||bi.showMissingIcons||!e||console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}(e,t),n(At(At({},Fn),{},{icon:bi.showMissingIcons&&e&&xn("missingIconAbstract")||{}}))})}const Rn=()=>{},Ln=bi.measurePerformance&&Mt&&Mt.mark&&Mt.measure?Mt:{mark:Rn,measure:Rn},Bn='FA "6.7.2"',On=e=>{Ln.mark("".concat(Bn," ").concat(e," ends")),Ln.measure("".concat(Bn," ").concat(e),"".concat(Bn," ").concat(e," begins"),"".concat(Bn," ").concat(e," ends"))};var Un=e=>(Ln.mark("".concat(Bn," ").concat(e," begins")),()=>On(e));const Nn=()=>{};function jn(e){return"string"==typeof(e.getAttribute?e.getAttribute(Jt):null)}function Vn(e){return kt.createElementNS("http://www.w3.org/2000/svg",e)}function qn(e){return kt.createElement(e)}function Gn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{ceFn:i=("svg"===e.tag?Vn:qn)}=t;if("string"==typeof e)return kt.createTextNode(e);const n=i(e.tag);Object.keys(e.attributes||[]).forEach(function(t){n.setAttribute(t,e.attributes[t])});return(e.children||[]).forEach(function(e){n.appendChild(Gn(e,{ceFn:i}))}),n}const Hn={replace:function(e){const t=e[0];if(t.parentNode)if(e[1].forEach(e=>{t.parentNode.insertBefore(Gn(e),t)}),null===t.getAttribute(Jt)&&bi.keepOriginalSource){let e=kt.createComment(function(e){let t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}(t));t.parentNode.replaceChild(e,t)}else t.remove()},nest:function(e){const t=e[0],i=e[1];if(~Ci(t).indexOf(bi.replacementClass))return Hn.replace(e);const n=new RegExp("".concat(bi.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){const e=i[0].attributes.class.split(" ").reduce((e,t)=>(t===bi.replacementClass||t.match(n)?e.toSvg.push(t):e.toNode.push(t),e),{toNode:[],toSvg:[]});i[0].attributes.class=e.toSvg.join(" "),0===e.toNode.length?t.removeAttribute("class"):t.setAttribute("class",e.toNode.join(" "))}const a=i.map(e=>ji(e)).join("\n");t.setAttribute(Jt,""),t.innerHTML=a}};function Wn(e){e()}function Zn(e,t){const i="function"==typeof t?t:Nn;if(0===e.length)i();else{let t=Wn;"async"===bi.mutateApproach&&(t=Et.requestAnimationFrame||Wn),t(()=>{const t=!0===bi.autoReplaceSvg?Hn.replace:Hn[bi.autoReplaceSvg]||Hn.replace,n=Un("mutate");e.map(t),n(),i()})}}let Kn=!1;function Xn(){Kn=!0}function Qn(){Kn=!1}let Yn=null;function Jn(e){if(!St)return;if(!bi.observeMutations)return;const{treeCallback:t=Nn,nodeCallback:i=Nn,pseudoElementsCallback:n=Nn,observeMutationsRoot:a=kt}=e;Yn=new St(e=>{if(Kn)return;const a=cn();Mi(e).forEach(e=>{if("childList"===e.type&&e.addedNodes.length>0&&!jn(e.addedNodes[0])&&(bi.searchPseudoElements&&n(e.target),t(e.target)),"attributes"===e.type&&e.target.parentNode&&bi.searchPseudoElements&&n(e.target.parentNode),"attributes"===e.type&&jn(e.target)&&~fi.indexOf(e.attributeName))if("class"===e.attributeName&&function(e){const t=e.getAttribute?e.getAttribute(ei):null,i=e.getAttribute?e.getAttribute(ti):null;return t&&i}(e.target)){const{prefix:t,iconName:i}=dn(Ci(e.target));e.target.setAttribute(ei,t||a),i&&e.target.setAttribute(ti,i)}else(r=e.target)&&r.classList&&r.classList.contains&&r.classList.contains(bi.replacementClass)&&i(e.target);var r})}),Ct&&Yn.observe(a,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function $n(e){const t=e.getAttribute("data-prefix"),i=e.getAttribute("data-icon"),n=void 0!==e.innerText?e.innerText.trim():"";let a=dn(Ci(e));return a.prefix||(a.prefix=cn()),t&&i&&(a.prefix=t,a.iconName=i),a.iconName&&a.prefix||(a.prefix&&n.length>0&&(a.iconName=(r=a.prefix,s=e.innerText,($i[r]||{})[s]||sn(a.prefix,Gi(e.innerText)))),!a.iconName&&bi.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(a.iconName=e.firstChild.data)),a;var r,s}function ea(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{styleParser:!0};const{iconName:i,prefix:n,rest:a}=$n(e),r=function(e){const t=Mi(e.attributes).reduce((e,t)=>("class"!==e.name&&"style"!==e.name&&(e[t.name]=t.value),e),{}),i=e.getAttribute("title"),n=e.getAttribute("data-fa-title-id");return bi.autoA11y&&(i?t["aria-labelledby"]="".concat(bi.replacementClass,"-title-").concat(n||Si()):(t["aria-hidden"]="true",t.focusable="false")),t}(e),s=vn("parseNodeAttributes",{},e);let o=t.styleParser?function(e){const t=e.getAttribute("style");let i=[];return t&&(i=t.split(";").reduce((e,t)=>{const i=t.split(":"),n=i[0],a=i.slice(1);return n&&a.length>0&&(e[n]=a.join(":").trim()),e},{})),i}(e):[];return At({iconName:i,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:n,transform:ki,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:o,attributes:r}},s)}const{styles:ta}=Bi;function ia(e){const t="nest"===bi.autoReplaceSvg?ea(e,{styleParser:!1}):ea(e);return~t.extra.classes.indexOf(mi)?xn("generateLayersText",e,t):xn("generateSvgReplacementMutation",e,t)}function na(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!Ct)return Promise.resolve();const i=kt.documentElement.classList,n=e=>i.add("".concat(ii,"-").concat(e)),a=e=>i.remove("".concat(ii,"-").concat(e)),r=bi.autoFetchSvg?[...Lt,...Ht]:Pt.concat(Object.keys(ta));r.includes("fa")||r.push("fa");const s=[".".concat(mi,":not([").concat(Jt,"])")].concat(r.map(e=>".".concat(e,":not([").concat(Jt,"])"))).join(", ");if(0===s.length)return Promise.resolve();let o=[];try{o=Mi(e.querySelectorAll(s))}catch(e){}if(!(o.length>0))return Promise.resolve();n("pending"),a("complete");const l=Un("onTree"),c=o.reduce((e,t)=>{try{const i=ia(t);i&&e.push(i)}catch(e){ai||"MissingIcon"===e.name&&console.error(e)}return e},[]);return new Promise((e,i)=>{Promise.all(c).then(i=>{Zn(i,()=>{n("active"),n("complete"),a("pending"),"function"==typeof t&&t(),l(),e()})}).catch(e=>{l(),i(e)})})}function aa(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ia(e).then(e=>{e&&Zn([e],t)})}const ra=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:i=ki,symbol:n=!1,mask:a=null,maskId:r=null,title:s=null,titleId:o=null,classes:l=[],attributes:c={},styles:u={}}=t;if(!e)return;const{prefix:h,iconName:d,icon:p}=e;return Cn(At({type:"icon"},e),()=>(yn("beforeDOMElementCreation",{iconDefinition:e,params:t}),bi.autoA11y&&(s?c["aria-labelledby"]="".concat(bi.replacementClass,"-title-").concat(o||Si()):(c["aria-hidden"]="true",c.focusable="false")),Tn({icons:{main:In(p),mask:a?In(a.icon):{found:!1,width:null,height:null,icon:{}}},prefix:h,iconName:d,transform:At(At({},ki),i),symbol:n,title:s,maskId:r,titleId:o,extra:{attributes:c,styles:u,classes:l}})))};var sa={mixout(){return{icon:(e=ra,function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(t||{}).icon?t:bn(t||{});let{mask:a}=i;return a&&(a=(a||{}).icon?a:bn(a||{})),e(n,At(At({},i),{},{mask:a}))})};var e},hooks:()=>({mutationObserverCallbacks:e=>(e.treeCallback=na,e.nodeCallback=aa,e)}),provides(e){e.i2svg=function(e){const{node:t=kt,callback:i=()=>{}}=e;return na(t,i)},e.generateSvgReplacementMutation=function(e,t){const{iconName:i,title:n,titleId:a,prefix:r,transform:s,symbol:o,mask:l,maskId:c,extra:u}=t;return new Promise((t,h)=>{Promise.all([zn(i,r),l.iconName?zn(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(l=>{let[h,d]=l;t([e,Tn({icons:{main:h,mask:d},prefix:r,iconName:i,transform:s,symbol:o,maskId:c,title:n,titleId:a,extra:u,watchable:!0})])}).catch(h)})},e.generateAbstractIcon=function(e){let{children:t,attributes:i,main:n,transform:a,styles:r}=e;const s=Di(r);let o;return s.length>0&&(i.style=s),Pi(a)&&(o=xn("generateAbstractTransformGrouping",{main:n,transform:a,containerWidth:n.width,iconWidth:n.width})),t.push(o||n.icon),{children:t,attributes:i}}}},oa={mixout:()=>({layer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{classes:i=[]}=t;return Cn({type:"layer"},()=>{yn("beforeDOMElementCreation",{assembler:e,params:t});let n=[];return e(e=>{Array.isArray(e)?e.map(e=>{n=n.concat(e.abstract)}):n=n.concat(e.abstract)}),[{tag:"span",attributes:{class:["".concat(bi.cssPrefix,"-layers"),...i].join(" ")},children:n}]})}})},la={mixout:()=>({counter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{title:i=null,classes:n=[],attributes:a={},styles:r={}}=t;return Cn({type:"counter",content:e},()=>(yn("beforeDOMElementCreation",{content:e,params:t}),function(e){const{content:t,title:i,extra:n}=e,a=At(At(At({},n.attributes),i?{title:i}:{}),{},{class:n.classes.join(" ")}),r=Di(n.styles);r.length>0&&(a.style=r);const s=[];return s.push({tag:"span",attributes:a,children:[t]}),i&&s.push({tag:"span",attributes:{class:"sr-only"},children:[i]}),s}({content:e.toString(),title:i,extra:{attributes:a,styles:r,classes:["".concat(bi.cssPrefix,"-layers-counter"),...n]}})))}})},ca={mixout:()=>({text(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{transform:i=ki,title:n=null,classes:a=[],attributes:r={},styles:s={}}=t;return Cn({type:"text",content:e},()=>(yn("beforeDOMElementCreation",{content:e,params:t}),Dn({content:e,transform:At(At({},ki),i),title:n,extra:{attributes:r,styles:s,classes:["".concat(bi.cssPrefix,"-layers-text"),...a]}})))}}),provides(e){e.generateLayersText=function(e,t){const{title:i,transform:n,extra:a}=t;let r=null,s=null;if(Tt){const t=parseInt(getComputedStyle(e).fontSize,10),i=e.getBoundingClientRect();r=i.width/t,s=i.height/t}return bi.autoA11y&&!i&&(a.attributes["aria-hidden"]="true"),Promise.resolve([e,Dn({content:e.innerHTML,width:r,height:s,transform:n,title:i,extra:a,watchable:!0})])}}};const ua=new RegExp('"',"ug"),ha=[1105920,1112319],da=At(At(At(At({},{FontAwesome:{normal:"fas",400:"fas"}}),{"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"}}),{"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}}),{"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}}),pa=Object.keys(da).reduce((e,t)=>(e[t.toLowerCase()]=da[t],e),{}),ma=Object.keys(pa).reduce((e,t)=>{const i=pa[t];return e[t]=i[900]||[...Object.entries(i)][0][1],e},{});function ga(e,t){const i="".concat("data-fa-pseudo-element-pending").concat(t.replace(":","-"));return new Promise((n,a)=>{if(null!==e.getAttribute(i))return n();const r=Mi(e.children).filter(e=>e.getAttribute($t)===t)[0],s=Et.getComputedStyle(e,t),o=s.getPropertyValue("font-family"),l=o.match(gi),c=s.getPropertyValue("font-weight"),u=s.getPropertyValue("content");if(r&&!l)return e.removeChild(r),n();if(l&&"none"!==u&&""!==u){const u=s.getPropertyValue("content");let h=function(e,t){const i=e.replace(/^['"]|['"]$/g,"").toLowerCase(),n=parseInt(t),a=isNaN(n)?"normal":n;return(pa[i]||{})[a]||ma[i]}(o,c);const{value:d,isSecondary:p}=function(e){const t=e.replace(ua,""),i=function(e,t){const i=e.length;let n,a=e.charCodeAt(t);return a>=55296&&a<=56319&&i>t+1&&(n=e.charCodeAt(t+1),n>=56320&&n<=57343)?1024*(a-55296)+n-56320+65536:a}(t,0),n=i>=ha[0]&&i<=ha[1],a=2===t.length&&t[0]===t[1];return{value:Gi(a?t[0]:t),isSecondary:n||a}}(u),m=l[0].startsWith("FontAwesome");let g=sn(h,d),f=g;if(m){const e=function(e){const t=tn[e],i=sn("fas",e);return t||(i?{prefix:"fas",iconName:i}:null)||{prefix:null,iconName:null}}(d);e.iconName&&e.prefix&&(g=e.iconName,h=e.prefix)}if(!g||p||r&&r.getAttribute(ei)===h&&r.getAttribute(ti)===f)n();else{e.setAttribute(i,f),r&&e.removeChild(r);const s={iconName:null,title:null,titleId:null,prefix:null,transform:ki,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}},{extra:o}=s;o.attributes[$t]=t,zn(g,h).then(a=>{const r=Tn(At(At({},s),{},{icons:{main:a,mask:{prefix:null,iconName:null,rest:[]}},prefix:h,iconName:f,extra:o,watchable:!0})),l=kt.createElementNS("http://www.w3.org/2000/svg","svg");"::before"===t?e.insertBefore(l,e.firstChild):e.appendChild(l),l.outerHTML=r.map(e=>ji(e)).join("\n"),e.removeAttribute(i),n()}).catch(a)}}else n()})}function fa(e){return Promise.all([ga(e,"::before"),ga(e,"::after")])}function Aa(e){return!(e.parentNode===document.head||~ni.indexOf(e.tagName.toUpperCase())||e.getAttribute($t)||e.parentNode&&"svg"===e.parentNode.tagName)}function _a(e){if(Ct)return new Promise((t,i)=>{const n=Mi(e.querySelectorAll("*")).filter(Aa).map(fa),a=Un("searchPseudoElements");Xn(),Promise.all(n).then(()=>{a(),Qn(),t()}).catch(()=>{a(),Qn(),i()})})}var va={hooks:()=>({mutationObserverCallbacks:e=>(e.pseudoElementsCallback=_a,e)}),provides(e){e.pseudoElements2svg=function(e){const{node:t=kt}=e;bi.searchPseudoElements&&_a(t)}}};let ya=!1;var xa={mixout:()=>({dom:{unwatch(){Xn(),ya=!0}}}),hooks:()=>({bootstrap(){Jn(vn("mutationObserverCallbacks",{}))},noAuto(){Yn&&Yn.disconnect()},watch(e){const{observeMutationsRoot:t}=e;ya?Qn():Jn(vn("mutationObserverCallbacks",{observeMutationsRoot:t}))}})};const ba=e=>e.toLowerCase().split(" ").reduce((e,t)=>{const i=t.toLowerCase().split("-"),n=i[0];let a=i.slice(1).join("-");if(n&&"h"===a)return e.flipX=!0,e;if(n&&"v"===a)return e.flipY=!0,e;if(a=parseFloat(a),isNaN(a))return e;switch(n){case"grow":e.size=e.size+a;break;case"shrink":e.size=e.size-a;break;case"left":e.x=e.x-a;break;case"right":e.x=e.x+a;break;case"up":e.y=e.y-a;break;case"down":e.y=e.y+a;break;case"rotate":e.rotate=e.rotate+a}return e},{size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0});var wa={mixout:()=>({parse:{transform:e=>ba(e)}}),hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-transform");return i&&(e.transform=ba(i)),e}}),provides(e){e.generateAbstractTransformGrouping=function(e){let{main:t,transform:i,containerWidth:n,iconWidth:a}=e;const r={transform:"translate(".concat(n/2," 256)")},s="translate(".concat(32*i.x,", ").concat(32*i.y,") "),o="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),l="rotate(".concat(i.rotate," 0 0)"),c={outer:r,inner:{transform:"".concat(s," ").concat(o," ").concat(l)},path:{transform:"translate(".concat(a/2*-1," -256)")}};return{tag:"g",attributes:At({},c.outer),children:[{tag:"g",attributes:At({},c.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:At(At({},t.icon.attributes),c.path)}]}]}}}};const Ea={x:0,y:0,width:"100%",height:"100%"};function ka(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}var Sa={hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-mask"),n=i?dn(i.split(" ").map(e=>e.trim())):{prefix:null,iconName:null,rest:[]};return n.prefix||(n.prefix=cn()),e.mask=n,e.maskId=t.getAttribute("data-fa-mask-id"),e}}),provides(e){e.generateAbstractMask=function(e){let{children:t,attributes:i,main:n,mask:a,maskId:r,transform:s}=e;const{width:o,icon:l}=n,{width:c,icon:u}=a,h=function(e){let{transform:t,containerWidth:i,iconWidth:n}=e;const a={transform:"translate(".concat(i/2," 256)")},r="translate(".concat(32*t.x,", ").concat(32*t.y,") "),s="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),o="rotate(".concat(t.rotate," 0 0)");return{outer:a,inner:{transform:"".concat(r," ").concat(s," ").concat(o)},path:{transform:"translate(".concat(n/2*-1," -256)")}}}({transform:s,containerWidth:c,iconWidth:o}),d={tag:"rect",attributes:At(At({},Ea),{},{fill:"white"})},p=l.children?{children:l.children.map(ka)}:{},m={tag:"g",attributes:At({},h.inner),children:[ka(At({tag:l.tag,attributes:At(At({},l.attributes),h.path)},p))]},g={tag:"g",attributes:At({},h.outer),children:[m]},f="mask-".concat(r||Si()),A="clip-".concat(r||Si()),_={tag:"mask",attributes:At(At({},Ea),{},{id:f,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[d,g]},v={tag:"defs",children:[{tag:"clipPath",attributes:{id:A},children:(y=u,"g"===y.tag?y.children:[y])},_]};var y;return t.push(v,{tag:"rect",attributes:At({fill:"currentColor","clip-path":"url(#".concat(A,")"),mask:"url(#".concat(f,")")},Ea)}),{children:t,attributes:i}}}},Ma={provides(e){let t=!1;Et.matchMedia&&(t=Et.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const e=[],i={fill:"currentColor"},n={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};e.push({tag:"path",attributes:At(At({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});const a=At(At({},n),{},{attributeName:"opacity"}),r={tag:"circle",attributes:At(At({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||r.children.push({tag:"animate",attributes:At(At({},n),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:At(At({},a),{},{values:"1;0;1;1;0;1;"})}),e.push(r),e.push({tag:"path",attributes:At(At({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:At(At({},a),{},{values:"1;0;0;0;0;1;"})}]}),t||e.push({tag:"path",attributes:At(At({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:At(At({},a),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:e}}}};!function(e,t){let{mixoutsTo:i}=t;gn=e,fn={},Object.keys(An).forEach(e=>{-1===_n.indexOf(e)&&delete An[e]}),gn.forEach(e=>{const t=e.mixout?e.mixout():{};if(Object.keys(t).forEach(e=>{"function"==typeof t[e]&&(i[e]=t[e]),"object"==typeof t[e]&&Object.keys(t[e]).forEach(n=>{i[e]||(i[e]={}),i[e][n]=t[e][n]})}),e.hooks){const t=e.hooks();Object.keys(t).forEach(e=>{fn[e]||(fn[e]=[]),fn[e].push(t[e])})}e.provides&&e.provides(An)})}([Ri,sa,oa,la,ca,va,xa,wa,Sa,Ma,{hooks:()=>({parseNodeAttributes(e,t){const i=t.getAttribute("data-fa-symbol"),n=null!==i&&(""===i||i);return e.symbol=n,e}})}],{mixoutsTo:Sn});const Ca=Sn.icon,Ta=Object.freeze({left:0,top:0,width:16,height:16}),Da=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Pa=Object.freeze({...Ta,...Da}),Ia=Object.freeze({...Pa,body:"",hidden:!1}),Fa=Object.freeze({width:null,height:null}),za=Object.freeze({...Fa,...Da});const Ra=/[\s,]+/;const La={...za,preserveAspectRatio:""};function Ba(e){const t={...La},i=(t,i)=>e.getAttribute(t)||i;var n;return t.width=i("width",null),t.height=i("height",null),t.rotate=function(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(e){for(;e<0;)e+=4;return e%4}if(""===i){const t=parseInt(e);return isNaN(t)?0:n(t)}if(i!==e){let t=0;switch(i){case"%":t=25;break;case"deg":t=90}if(t){let a=parseFloat(e.slice(0,e.length-i.length));return isNaN(a)?0:(a/=t,a%1==0?n(a):0)}}return t}(i("rotate","")),n=t,i("flip","").split(Ra).forEach(e=>{switch(e.trim()){case"horizontal":n.hFlip=!0;break;case"vertical":n.vFlip=!0}}),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}const Oa=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ua=(e,t,i,n="")=>{const a=e.split(":");if("@"===e.slice(0,1)){if(a.length<2||a.length>3)return null;n=a.shift().slice(1)}if(a.length>3||!a.length)return null;if(a.length>1){const e=a.pop(),i=a.pop(),r={provider:a.length>0?a[0]:n,prefix:i,name:e};return t&&!Na(r)?null:r}const r=a[0],s=r.split("-");if(s.length>1){const e={provider:n,prefix:s.shift(),name:s.join("-")};return t&&!Na(e)?null:e}if(i&&""===n){const e={provider:n,prefix:"",name:r};return t&&!Na(e,i)?null:e}return null},Na=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name);function ja(e,t){const i=function(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(i.rotate=n),i}(e,t);for(const n in Ia)n in Da?n in e&&!(n in i)&&(i[n]=Da[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function Va(e,t,i){const n=e.icons,a=e.aliases||Object.create(null);let r={};function s(e){r=ja(n[e]||a[e],r)}return s(t),i.forEach(s),ja(e,r)}function qa(e,t){const i=[];if("object"!=typeof e||"object"!=typeof e.icons)return i;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),i.push(e)});const n=function(e){const t=e.icons,i=e.aliases||Object.create(null),n=Object.create(null);return Object.keys(t).concat(Object.keys(i)).forEach(function e(a){if(t[a])return n[a]=[];if(!(a in n)){n[a]=null;const t=i[a]&&i[a].parent,r=t&&e(t);r&&(n[a]=[t].concat(r))}return n[a]}),n}(e);for(const a in n){const r=n[a];r&&(t(a,Va(e,a,r)),i.push(a))}return i}const Ga={provider:"",aliases:{},not_found:{},...Ta};function Ha(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function Wa(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!Ha(e,Ga))return null;const i=t.icons;for(const e in i){const t=i[e];if(!e||"string"!=typeof t.body||!Ha(t,Ia))return null}const n=t.aliases||Object.create(null);for(const e in n){const t=n[e],a=t.parent;if(!e||"string"!=typeof a||!i[a]&&!n[a]||!Ha(t,Ia))return null}return t}const Za=Object.create(null);function Ka(e,t){const i=Za[e]||(Za[e]=Object.create(null));return i[t]||(i[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function Xa(e,t){return Wa(t)?qa(t,(t,i)=>{i?e.icons[t]=i:e.missing.add(t)}):[]}function Qa(e,t){let i=[];return("string"==typeof e?[e]:Object.keys(Za)).forEach(e=>{("string"==typeof e&&"string"==typeof t?[t]:Object.keys(Za[e]||{})).forEach(t=>{const n=Ka(e,t);i=i.concat(Object.keys(n.icons).map(i=>(""!==e?"@"+e+":":"")+t+":"+i))})}),i}let Ya=!1;function Ja(e){return"boolean"==typeof e&&(Ya=e),Ya}function $a(e){const t="string"==typeof e?Ua(e,!0,Ya):e;if(t){const e=Ka(t.provider,t.prefix),i=t.name;return e.icons[i]||(e.missing.has(i)?null:void 0)}}function er(e,t){const i=Ua(e,!0,Ya);if(!i)return!1;const n=Ka(i.provider,i.prefix);return t?function(e,t,i){try{if("string"==typeof i.body)return e.icons[t]={...i},!0}catch(e){}return!1}(n,i.name,t):(n.missing.add(i.name),!0)}function tr(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),Ya&&!t&&!e.prefix){let t=!1;return Wa(e)&&(e.prefix="",qa(e,(e,i)=>{er(e,i)&&(t=!0)})),t}const i=e.prefix;return!!Na({prefix:i,name:"a"})&&!!Xa(Ka(t,i),e)}function ir(e){return!!$a(e)}function nr(e){const t=$a(e);return t?{...Pa,...t}:t}function ar(e,t){e.forEach(e=>{const i=e.loaderCallbacks;i&&(e.loaderCallbacks=i.filter(e=>e.id!==t))})}let rr=0;const sr=Object.create(null);function or(e,t){sr[e]=t}function lr(e){return sr[e]||sr[""]}function cr(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const ur=Object.create(null),hr=["https://api.simplesvg.com","https://api.unisvg.com"],dr=[];for(;hr.length>0;)1===hr.length||Math.random()>.5?dr.push(hr.shift()):dr.push(hr.pop());function pr(e,t){const i=cr(t);return null!==i&&(ur[e]=i,!0)}function mr(e){return ur[e]}function gr(){return Object.keys(ur)}ur[""]=cr({resources:["https://api.iconify.design"].concat(dr)});const fr={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ar(e,t,i,n){const a=e.resources.length,r=e.random?Math.floor(Math.random()*a):e.index;let s;if(e.random){let t=e.resources.slice(0);for(s=[];t.length>1;){const e=Math.floor(Math.random()*t.length);s.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}s=s.concat(t)}else s=e.resources.slice(r).concat(e.resources.slice(0,r));const o=Date.now();let l,c="pending",u=0,h=null,d=[],p=[];function m(){h&&(clearTimeout(h),h=null)}function g(){"pending"===c&&(c="aborted"),m(),d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function f(e,t){t&&(p=[]),"function"==typeof e&&p.push(e)}function A(){c="failed",p.forEach(e=>{e(void 0,l)})}function _(){d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function v(){if("pending"!==c)return;m();const n=s.shift();if(void 0===n)return d.length?void(h=setTimeout(()=>{m(),"pending"===c&&(_(),A())},e.timeout)):void A();const a={status:"pending",resource:n,callback:(t,i)=>{!function(t,i,n){const a="success"!==i;switch(d=d.filter(e=>e!==t),c){case"pending":break;case"failed":if(a||!e.dataAfterTimeout)return;break;default:return}if("abort"===i)return l=n,void A();if(a)return l=n,void(d.length||(s.length?v():A()));if(m(),_(),!e.random){const i=e.resources.indexOf(t.resource);-1!==i&&i!==e.index&&(e.index=i)}c="completed",p.forEach(e=>{e(n)})}(a,t,i)}};d.push(a),u++,h=setTimeout(v,e.rotate),i(n,t,a.callback)}return"function"==typeof n&&p.push(n),setTimeout(v),function(){return{startTime:o,payload:t,status:c,queriesSent:u,queriesPending:d.length,subscribe:f,abort:g}}}function _r(e){const t={...fr,...e};let i=[];function n(){i=i.filter(e=>"pending"===e().status)}return{query:function(e,a,r){const s=Ar(t,e,a,(e,t)=>{n(),r&&r(e,t)});return i.push(s),s},find:function(e){return i.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:n}}function vr(){}const yr=Object.create(null);function xr(e,t,i){let n,a;if("string"==typeof e){const t=lr(e);if(!t)return i(void 0,424),vr;a=t.send;const r=function(e){if(!yr[e]){const t=mr(e);if(!t)return;yr[e]={config:t,redundancy:_r(t)}}return yr[e]}(e);r&&(n=r.redundancy)}else{const t=cr(e);if(t){n=_r(t);const i=lr(e.resources?e.resources[0]:"");i&&(a=i.send)}}return n&&a?n.query(t,a,i)().abort:(i(void 0,424),vr)}function br(){}function wr(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let i=!1;const n=e.provider,a=e.prefix;t.forEach(t=>{const r=t.icons,s=r.pending.length;r.pending=r.pending.filter(t=>{if(t.prefix!==a)return!0;const s=t.name;if(e.icons[s])r.loaded.push({provider:n,prefix:a,name:s});else{if(!e.missing.has(s))return i=!0,!0;r.missing.push({provider:n,prefix:a,name:s})}return!1}),r.pending.length!==s&&(i||ar([e],t.id),t.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),t.abort))})}))}(e)}))}function Er(e,t,i){function n(){const i=e.pendingIcons;t.forEach(t=>{i&&i.delete(t),e.icons[t]||e.missing.add(t)})}if(i&&"object"==typeof i)try{if(!Xa(e,i).length)return void n()}catch(e){console.error(e)}n(),wr(e)}function kr(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function Sr(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:i}=e,n=e.iconsToLoad;if(delete e.iconsToLoad,!n||!n.length)return;const a=e.loadIcon;if(e.loadIcons&&(n.length>1||!a))return void kr(e.loadIcons(n,i,t),t=>{Er(e,n,t)});if(a)return void n.forEach(n=>{kr(a(n,i,t),t=>{Er(e,[n],t?{prefix:i,icons:{[n]:t}}:null)})});const{valid:r,invalid:s}=function(e){const t=[],i=[];return e.forEach(e=>{(e.match(Oa)?t:i).push(e)}),{valid:t,invalid:i}}(n);if(s.length&&Er(e,s,null),!r.length)return;const o=i.match(Oa)?lr(t):null;o?o.prepare(t,i,r).forEach(i=>{xr(t,i,t=>{Er(e,i.icons,t)})}):Er(e,r,null)}))}const Mr=(e,t)=>{const i=function(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name));let n={provider:"",prefix:"",name:""};return e.forEach(e=>{if(n.name===e.name&&n.prefix===e.prefix&&n.provider===e.provider)return;n=e;const a=e.provider,r=e.prefix,s=e.name,o=i[a]||(i[a]=Object.create(null)),l=o[r]||(o[r]=Ka(a,r));let c;c=s in l.icons?t.loaded:""===r||l.missing.has(s)?t.missing:t.pending;const u={provider:a,prefix:r,name:s};c.push(u)}),t}(function(e,t=!0,i=!1){const n=[];return e.forEach(e=>{const a="string"==typeof e?Ua(e,t,i):e;a&&n.push(a)}),n}(e,!0,Ja()));if(!i.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(i.loaded,i.missing,i.pending,br)}),()=>{e=!1}}const n=Object.create(null),a=[];let r,s;return i.pending.forEach(e=>{const{provider:t,prefix:i}=e;if(i===s&&t===r)return;r=t,s=i,a.push(Ka(t,i));const o=n[t]||(n[t]=Object.create(null));o[i]||(o[i]=[])}),i.pending.forEach(e=>{const{provider:t,prefix:i,name:a}=e,r=Ka(t,i),s=r.pendingIcons||(r.pendingIcons=new Set);s.has(a)||(s.add(a),n[t][i].push(a))}),a.forEach(e=>{const t=n[e.provider][e.prefix];t.length&&Sr(e,t)}),t?function(e,t,i){const n=rr++,a=ar.bind(null,i,n);if(!t.pending.length)return a;const r={id:n,icons:t,callback:e,abort:a};return i.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(r)}),a}(t,i,a):br},Cr=e=>new Promise((t,i)=>{const n="string"==typeof e?Ua(e,!0):e;n?Mr([n||e],a=>{if(a.length&&n){const e=$a(n);if(e)return void t({...Pa,...e})}i(e)}):i(e)});function Tr(e){try{const t="string"==typeof e?JSON.parse(e):e;if("string"==typeof t.body)return{...t}}catch(e){}}let Dr=!1;try{Dr=0===navigator.vendor.indexOf("Apple")}catch(sB){}const Pr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ir=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Fr(e,t,i){if(1===t)return e;if(i=i||100,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;const n=e.split(Pr);if(null===n||!n.length)return e;const a=[];let r=n.shift(),s=Ir.test(r);for(;;){if(s){const e=parseFloat(r);isNaN(e)?a.push(r):a.push(Math.ceil(e*t*i)/i)}else a.push(r);if(r=n.shift(),void 0===r)return a.join("");s=!s}}function zr(e,t){const i={...Pa,...e},n={...za,...t},a={left:i.left,top:i.top,width:i.width,height:i.height};let r=i.body;[i,n].forEach(e=>{const t=[],i=e.hFlip,n=e.vFlip;let s,o=e.rotate;switch(i?n?o+=2:(t.push("translate("+(a.width+a.left).toString()+" "+(0-a.top).toString()+")"),t.push("scale(-1 1)"),a.top=a.left=0):n&&(t.push("translate("+(0-a.left).toString()+" "+(a.height+a.top).toString()+")"),t.push("scale(1 -1)"),a.top=a.left=0),o<0&&(o-=4*Math.floor(o/4)),o%=4,o){case 1:s=a.height/2+a.top,t.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:t.unshift("rotate(180 "+(a.width/2+a.left).toString()+" "+(a.height/2+a.top).toString()+")");break;case 3:s=a.width/2+a.left,t.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}o%2==1&&(a.left!==a.top&&(s=a.left,a.left=a.top,a.top=s),a.width!==a.height&&(s=a.width,a.width=a.height,a.height=s)),t.length&&(r=function(e,t,i){const n=function(e,t="defs"){let i="";const n=e.indexOf("<"+t);for(;n>=0;){const a=e.indexOf(">",n),r=e.indexOf("</"+t);if(-1===a||-1===r)break;const s=e.indexOf(">",r);if(-1===s)break;i+=e.slice(a+1,r).trim(),e=e.slice(0,n).trim()+e.slice(s+1)}return{defs:i,content:e}}(e);return a=n.defs,r=t+n.content+i,a?"<defs>"+a+"</defs>"+r:r;var a,r}(r,'<g transform="'+t.join(" ")+'">',"</g>"))});const s=n.width,o=n.height,l=a.width,c=a.height;let u,h;null===s?(h=null===o?"1em":"auto"===o?c:o,u=Fr(h,l/c)):(u="auto"===s?l:s,h=null===o?Fr(u,c/l):"auto"===o?c:o);const d={},p=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(d[e]=t.toString())};p("width",u),p("height",h);const m=[a.left,a.top,l,c];return d.viewBox=m.join(" "),{attributes:d,viewBox:m,body:r}}function Rr(e,t){let i=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in t)i+=" "+e+'="'+t[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+i+">"+e+"</svg>"}function Lr(e){return'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(e)+'")'}let Br=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();function Or(e){Br=e}function Ur(){return Br}const Nr={prepare:(e,t,i)=>{const n=[],a=function(e,t){const i=mr(e);if(!i)return 0;let n;if(i.maxURL){let e=0;i.resources.forEach(t=>{const i=t;e=Math.max(e,i.length)});const a=t+".json?icons=";n=i.maxURL-e-i.path.length-a.length}else n=0;return n}(e,t),r="icons";let s={type:r,provider:e,prefix:t,icons:[]},o=0;return i.forEach((i,l)=>{o+=i.length+1,o>=a&&l>0&&(n.push(s),s={type:r,provider:e,prefix:t,icons:[]},o=i.length),s.icons.push(i)}),n.push(s),n},send:(e,t,i)=>{if(!Br)return void i("abort",424);let n=function(e){if("string"==typeof e){const t=mr(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,i=t.icons.join(",");n+=e+".json?"+new URLSearchParams({icons:i}).toString();break}case"custom":{const e=t.uri;n+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void i("abort",400)}let a=503;Br(e+n).then(e=>{const t=e.status;if(200===t)return a=501,e.json();setTimeout(()=>{i(function(e){return 404===e}(t)?"abort":"next",t)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{i("success",e)}):setTimeout(()=>{404===e?i("abort",e):i("next",a)})}).catch(()=>{i("next",a)})}};function jr(e,t,i){Ka(i||"",t).loadIcons=e}function Vr(e,t,i){Ka(i||"",t).loadIcon=e}const qr="data-style";let Gr="";function Hr(e){Gr=e}function Wr(e,t){let i=Array.from(e.childNodes).find(e=>e.hasAttribute&&e.hasAttribute(qr));i||(i=document.createElement("style"),i.setAttribute(qr,qr),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block;margin:auto}"+Gr}function Zr(){let e;or("",Nr),Ja(!0);try{e=window}catch(e){}if(e){if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,i="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!tr(e))&&console.error(i)}catch(e){console.error(i)}})}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(const e in t){const i="IconifyProviders["+e+"] is invalid.";try{const n=t[e];if("object"!=typeof n||!n||void 0===n.resources)continue;pr(e,n)||console.error(i)}catch(e){console.error(i)}}}}return{iconLoaded:ir,getIcon:nr,listIcons:Qa,addIcon:er,addCollection:tr,calculateSize:Fr,buildIcon:zr,iconToHTML:Rr,svgToURL:Lr,loadIcons:Mr,loadIcon:Cr,addAPIProvider:pr,setCustomIconLoader:Vr,setCustomIconsLoader:jr,appendCustomStyle:Hr,_api:{getAPIConfig:mr,setAPIModule:or,sendAPIQuery:xr,setFetch:Or,getFetch:Ur,listAPIProviders:gr}}}const Kr={"background-color":"currentColor"},Xr={"background-color":"transparent"},Qr={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Yr={"-webkit-mask":Kr,mask:Kr,background:Xr};for(const e in Yr){const t=Yr[e];for(const i in Qr)t[e+"-"+i]=Qr[i]}function Jr(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}let $r;function es(e){return void 0===$r&&function(){try{$r=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){$r=null}}(),$r?$r.createHTML(e):e}function ts(e){return Array.from(e.childNodes).find(e=>{const t=e.tagName&&e.tagName.toUpperCase();return"SPAN"===t||"SVG"===t})}function is(e,t){const i=t.icon.data,n=t.customisations,a=zr(i,n);n.preserveAspectRatio&&(a.attributes.preserveAspectRatio=n.preserveAspectRatio);const r=t.renderedMode;let s;if("svg"===r)s=function(e){const t=document.createElement("span"),i=e.attributes;let n="";i.width||(n="width: inherit;"),i.height||(n+="height: inherit;"),n&&(i.style=n);const a=Rr(e.body,i);return t.innerHTML=es(a),t.firstChild}(a);else s=function(e,t,i){const n=document.createElement("span");let a=e.body;-1!==a.indexOf("<a")&&(a+="\x3c!-- "+Date.now()+" --\x3e");const r=e.attributes,s=Lr(Rr(a,{...r,width:t.width+"",height:t.height+""})),o=n.style,l={"--svg":s,width:Jr(r.width),height:Jr(r.height),...i?Kr:Xr};for(const e in l)o.setProperty(e,l[e]);return n}(a,{...Pa,...i},"mask"===r);const o=ts(e);o?"SPAN"===s.tagName&&o.tagName===s.tagName?o.setAttribute("style",s.getAttribute("style")):e.replaceChild(s,o):e.appendChild(s)}function ns(e,t,i){return{rendered:!1,inline:t,icon:e,lastRender:i&&(i.rendered?i:i.lastRender)}}const as=function(e="iconify-icon"){let t,i;try{t=window.customElements,i=window.HTMLElement}catch(e){return}if(!t||!i)return;const n=t.get(e);if(n)return n;const a=["icon","mode","inline","noobserver","width","height","rotate","flip"],r=class extends i{_shadowRoot;_initialised=!1;_state;_checkQueued=!1;_connected=!1;_observer=null;_visible=!0;constructor(){super();const e=this._shadowRoot=this.attachShadow({mode:"open"}),t=this.hasAttribute("inline");Wr(e,t),this._state=ns({value:""},t),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return a.slice(0)}attributeChangedCallback(e){switch(e){case"inline":{const e=this.hasAttribute("inline"),t=this._state;e!==t.inline&&(t.inline=e,Wr(this._shadowRoot,e));break}case"noobserver":this.hasAttribute("noobserver")?this.startObserver():this.stopObserver();break;default:this._queueCheck()}}get icon(){const e=this.getAttribute("icon");if(e&&"{"===e.slice(0,1))try{return JSON.parse(e)}catch(e){}return e}set icon(e){"object"==typeof e&&(e=JSON.stringify(e)),this.setAttribute("icon",e)}get inline(){return this.hasAttribute("inline")}set inline(e){e?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(e){e?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const e=this._state;if(e.rendered){const t=this._shadowRoot;if("svg"===e.renderedMode)try{return void t.lastChild.setCurrentTime(0)}catch(e){}is(t,e)}}get status(){const e=this._state;return e.rendered?"rendered":null===e.icon.data?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const e=this._state,t=this.getAttribute("icon");if(t!==e.icon.value)return void this._iconChanged(t);if(!e.rendered||!this._visible)return;const i=this.getAttribute("mode"),n=Ba(this);e.attrMode===i&&!function(e,t){for(const i in La)if(e[i]!==t[i])return!0;return!1}(e.customisations,n)&&ts(this._shadowRoot)||this._renderIcon(e.icon,n,i)}_iconChanged(e){const t=function(e,t){if("object"==typeof e)return{data:Tr(e),value:e};if("string"!=typeof e)return{value:e};if(e.includes("{")){const t=Tr(e);if(t)return{data:t,value:e}}const i=Ua(e,!0,!0);if(!i)return{value:e};const n=$a(i);if(void 0!==n||!i.prefix)return{value:e,name:i,data:n};const a=Mr([i],()=>t(e,i,$a(i)));return{value:e,name:i,loading:a}}(e,(e,t,i)=>{const n=this._state;if(n.rendered||this.getAttribute("icon")!==e)return;const a={value:e,name:t,data:i};a.data?this._gotIconData(a):n.icon=a});t.data?this._gotIconData(t):this._state=ns(t,this._state.inline,this._state)}_forceRender(){if(!this._visible){const e=ts(this._shadowRoot);return void(e&&this._shadowRoot.removeChild(e))}this._queueCheck()}_gotIconData(e){this._checkQueued=!1,this._renderIcon(e,Ba(this),this.getAttribute("mode"))}_renderIcon(e,t,i){const n=function(e,t){switch(t){case"svg":case"bg":case"mask":return t}return"style"===t||!Dr&&-1!==e.indexOf("<a")?-1===e.indexOf("currentColor")?"bg":"mask":"svg"}(e.data.body,i),a=this._state.inline;is(this._shadowRoot,this._state={rendered:!0,icon:e,inline:a,customisations:t,attrMode:i,renderedMode:n})}startObserver(){if(!this._observer&&!this.hasAttribute("noobserver"))try{this._observer=new IntersectionObserver(e=>{const t=e.some(e=>e.isIntersecting);t!==this._visible&&(this._visible=t,this._forceRender())}),this._observer.observe(this)}catch(e){if(this._observer){try{this._observer.disconnect()}catch(e){}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};a.forEach(e=>{e in r.prototype||Object.defineProperty(r.prototype,e,{get:function(){return this.getAttribute(e)},set:function(t){null!==t?this.setAttribute(e,t):this.removeAttribute(e)}})});const s=Zr();for(const e in s)r[e]=r.prototype[e]=s[e];return t.define(e,r),r}()||Zr(),{iconLoaded:rs,getIcon:ss,listIcons:os,addIcon:ls,addCollection:cs,calculateSize:us,buildIcon:hs,iconToHTML:ds,svgToURL:ps,loadIcons:ms,loadIcon:gs,setCustomIconLoader:fs,setCustomIconsLoader:As,addAPIProvider:_s,_api:vs}=as;function ys(e,t){return Ca(e,t).node[0]}function xs(){fs(async e=>{const t=await fetch(ge(e));return t.ok?{body:await t.text()}:null},"temaki")}function bs(e,t={}){const i=document.createElement(e);return Object.entries(t).forEach(([e,t])=>{e.startsWith("_")?i[e]=t:e.startsWith("fn")?i[e.substring(2)]=t:e.startsWith("on")?i.addEventListener(e.substring(2),t):t&&i.setAttribute(e,t)}),i}function ws(e,t){e._parent?.addEventListener("menu-opened",i=>{i.detail.menu!==e&&t()}),e._parent?.onceMapReady?.().then(()=>{e._parent.map?.on?.("click",()=>t())}),e._parent?.oncePSVReady?.().then(()=>{e._parent.psv.addEventListener("click",()=>t())}),e._parent?.onceReady?.().then(()=>{e._parent.legend?.addEventListener("click",()=>t())})}function Es(e){return e._parent?e._parent:e===document.body?null:e.parentNode?Es(e.parentNode):e.host?Es(e.host):void 0}function ks(e){return e._parent?Promise.resolve(e._parent):new Promise(t=>{const i=setInterval(()=>{const n=Es(e);n&&(e._parent=n,clearInterval(i),t(e._parent))},100)})}var Ss=Object.freeze({__proto__:null,createWebComp:bs,fa:ys,listenForMenuClosure:ws,moreIcons:xs,onceParentAvailable:ks}),Ms={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},Cs={isSpaceSeparator:e=>"string"==typeof e&&Ms.Space_Separator.test(e),isIdStartChar:e=>"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||"$"===e||"_"===e||Ms.ID_Start.test(e)),isIdContinueChar:e=>"string"==typeof e&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"$"===e||"_"===e||""===e||""===e||Ms.ID_Continue.test(e)),isDigit:e=>"string"==typeof e&&/[0-9]/.test(e),isHexDigit:e=>"string"==typeof e&&/[0-9A-Fa-f]/.test(e)};let Ts,Ds,Ps,Is,Fs,zs,Rs,Ls,Bs;function Os(e,t,i){const n=e[t];if(null!=n&&"object"==typeof n)if(Array.isArray(n))for(let e=0;e<n.length;e++){const t=String(e),a=Os(n,t,i);void 0===a?delete n[t]:Object.defineProperty(n,t,{value:a,writable:!0,enumerable:!0,configurable:!0})}else for(const e in n){const t=Os(n,e,i);void 0===t?delete n[e]:Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}return i.call(e,t,n)}let Us,Ns,js,Vs,qs;function Gs(){for(Us="default",Ns="",js=!1,Vs=1;;){qs=Hs();const e=Zs[Us]();if(e)return e}}function Hs(){if(Ts[Is])return String.fromCodePoint(Ts.codePointAt(Is))}function Ws(){const e=Hs();return"\n"===e?(Fs++,zs=0):e?zs+=e.length:zs++,e&&(Is+=e.length),e}const Zs={default(){switch(qs){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void Ws();case"/":return Ws(),void(Us="comment");case void 0:return Ws(),Ks("eof")}if(!Cs.isSpaceSeparator(qs))return Zs[Ds]();Ws()},comment(){switch(qs){case"*":return Ws(),void(Us="multiLineComment");case"/":return Ws(),void(Us="singleLineComment")}throw eo(Ws())},multiLineComment(){switch(qs){case"*":return Ws(),void(Us="multiLineCommentAsterisk");case void 0:throw eo(Ws())}Ws()},multiLineCommentAsterisk(){switch(qs){case"*":return void Ws();case"/":return Ws(),void(Us="default");case void 0:throw eo(Ws())}Ws(),Us="multiLineComment"},singleLineComment(){switch(qs){case"\n":case"\r":case"\u2028":case"\u2029":return Ws(),void(Us="default");case void 0:return Ws(),Ks("eof")}Ws()},value(){switch(qs){case"{":case"[":return Ks("punctuator",Ws());case"n":return Ws(),Xs("ull"),Ks("null",null);case"t":return Ws(),Xs("rue"),Ks("boolean",!0);case"f":return Ws(),Xs("alse"),Ks("boolean",!1);case"-":case"+":return"-"===Ws()&&(Vs=-1),void(Us="sign");case".":return Ns=Ws(),void(Us="decimalPointLeading");case"0":return Ns=Ws(),void(Us="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Ns=Ws(),void(Us="decimalInteger");case"I":return Ws(),Xs("nfinity"),Ks("numeric",1/0);case"N":return Ws(),Xs("aN"),Ks("numeric",NaN);case'"':case"'":return js='"'===Ws(),Ns="",void(Us="string")}throw eo(Ws())},identifierNameStartEscape(){if("u"!==qs)throw eo(Ws());Ws();const e=Qs();switch(e){case"$":case"_":break;default:if(!Cs.isIdStartChar(e))throw io()}Ns+=e,Us="identifierName"},identifierName(){switch(qs){case"$":case"_":case"":case"":return void(Ns+=Ws());case"\\":return Ws(),void(Us="identifierNameEscape")}if(!Cs.isIdContinueChar(qs))return Ks("identifier",Ns);Ns+=Ws()},identifierNameEscape(){if("u"!==qs)throw eo(Ws());Ws();const e=Qs();switch(e){case"$":case"_":case"":case"":break;default:if(!Cs.isIdContinueChar(e))throw io()}Ns+=e,Us="identifierName"},sign(){switch(qs){case".":return Ns=Ws(),void(Us="decimalPointLeading");case"0":return Ns=Ws(),void(Us="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return Ns=Ws(),void(Us="decimalInteger");case"I":return Ws(),Xs("nfinity"),Ks("numeric",Vs*(1/0));case"N":return Ws(),Xs("aN"),Ks("numeric",NaN)}throw eo(Ws())},zero(){switch(qs){case".":return Ns+=Ws(),void(Us="decimalPoint");case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent");case"x":case"X":return Ns+=Ws(),void(Us="hexadecimal")}return Ks("numeric",0*Vs)},decimalInteger(){switch(qs){case".":return Ns+=Ws(),void(Us="decimalPoint");case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent")}if(!Cs.isDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},decimalPointLeading(){if(Cs.isDigit(qs))return Ns+=Ws(),void(Us="decimalFraction");throw eo(Ws())},decimalPoint(){switch(qs){case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent")}return Cs.isDigit(qs)?(Ns+=Ws(),void(Us="decimalFraction")):Ks("numeric",Vs*Number(Ns))},decimalFraction(){switch(qs){case"e":case"E":return Ns+=Ws(),void(Us="decimalExponent")}if(!Cs.isDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},decimalExponent(){switch(qs){case"+":case"-":return Ns+=Ws(),void(Us="decimalExponentSign")}if(Cs.isDigit(qs))return Ns+=Ws(),void(Us="decimalExponentInteger");throw eo(Ws())},decimalExponentSign(){if(Cs.isDigit(qs))return Ns+=Ws(),void(Us="decimalExponentInteger");throw eo(Ws())},decimalExponentInteger(){if(!Cs.isDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},hexadecimal(){if(Cs.isHexDigit(qs))return Ns+=Ws(),void(Us="hexadecimalInteger");throw eo(Ws())},hexadecimalInteger(){if(!Cs.isHexDigit(qs))return Ks("numeric",Vs*Number(Ns));Ns+=Ws()},string(){switch(qs){case"\\":return Ws(),void(Ns+=function(){switch(Hs()){case"b":return Ws(),"\b";case"f":return Ws(),"\f";case"n":return Ws(),"\n";case"r":return Ws(),"\r";case"t":return Ws(),"\t";case"v":return Ws(),"\v";case"0":if(Ws(),Cs.isDigit(Hs()))throw eo(Ws());return"\0";case"x":return Ws(),function(){let e="",t=Hs();if(!Cs.isHexDigit(t))throw eo(Ws());if(e+=Ws(),t=Hs(),!Cs.isHexDigit(t))throw eo(Ws());return e+=Ws(),String.fromCodePoint(parseInt(e,16))}();case"u":return Ws(),Qs();case"\n":case"\u2028":case"\u2029":return Ws(),"";case"\r":return Ws(),"\n"===Hs()&&Ws(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw eo(Ws())}return Ws()}());case'"':return js?(Ws(),Ks("string",Ns)):void(Ns+=Ws());case"'":return js?void(Ns+=Ws()):(Ws(),Ks("string",Ns));case"\n":case"\r":throw eo(Ws());case"\u2028":case"\u2029":!function(e){console.warn(`JSON5: '${no(e)}' in strings is not valid ECMAScript; consider escaping`)}(qs);break;case void 0:throw eo(Ws())}Ns+=Ws()},start(){switch(qs){case"{":case"[":return Ks("punctuator",Ws())}Us="value"},beforePropertyName(){switch(qs){case"$":case"_":return Ns=Ws(),void(Us="identifierName");case"\\":return Ws(),void(Us="identifierNameStartEscape");case"}":return Ks("punctuator",Ws());case'"':case"'":return js='"'===Ws(),void(Us="string")}if(Cs.isIdStartChar(qs))return Ns+=Ws(),void(Us="identifierName");throw eo(Ws())},afterPropertyName(){if(":"===qs)return Ks("punctuator",Ws());throw eo(Ws())},beforePropertyValue(){Us="value"},afterPropertyValue(){switch(qs){case",":case"}":return Ks("punctuator",Ws())}throw eo(Ws())},beforeArrayValue(){if("]"===qs)return Ks("punctuator",Ws());Us="value"},afterArrayValue(){switch(qs){case",":case"]":return Ks("punctuator",Ws())}throw eo(Ws())},end(){throw eo(Ws())}};function Ks(e,t){return{type:e,value:t,line:Fs,column:zs}}function Xs(e){for(const t of e){if(Hs()!==t)throw eo(Ws());Ws()}}function Qs(){let e="",t=4;for(;t-- >0;){const t=Hs();if(!Cs.isHexDigit(t))throw eo(Ws());e+=Ws()}return String.fromCodePoint(parseInt(e,16))}const Ys={start(){if("eof"===Rs.type)throw to();Js()},beforePropertyName(){switch(Rs.type){case"identifier":case"string":return Ls=Rs.value,void(Ds="afterPropertyName");case"punctuator":return void $s();case"eof":throw to()}},afterPropertyName(){if("eof"===Rs.type)throw to();Ds="beforePropertyValue"},beforePropertyValue(){if("eof"===Rs.type)throw to();Js()},beforeArrayValue(){if("eof"===Rs.type)throw to();"punctuator"!==Rs.type||"]"!==Rs.value?Js():$s()},afterPropertyValue(){if("eof"===Rs.type)throw to();switch(Rs.value){case",":return void(Ds="beforePropertyName");case"}":$s()}},afterArrayValue(){if("eof"===Rs.type)throw to();switch(Rs.value){case",":return void(Ds="beforeArrayValue");case"]":$s()}},end(){}};function Js(){let e;switch(Rs.type){case"punctuator":switch(Rs.value){case"{":e={};break;case"[":e=[]}break;case"null":case"boolean":case"numeric":case"string":e=Rs.value}if(void 0===Bs)Bs=e;else{const t=Ps[Ps.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,Ls,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(null!==e&&"object"==typeof e)Ps.push(e),Ds=Array.isArray(e)?"beforeArrayValue":"beforePropertyName";else{const e=Ps[Ps.length-1];Ds=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function $s(){Ps.pop();const e=Ps[Ps.length-1];Ds=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}function eo(e){return ao(void 0===e?`JSON5: invalid end of input at ${Fs}:${zs}`:`JSON5: invalid character '${no(e)}' at ${Fs}:${zs}`)}function to(){return ao(`JSON5: invalid end of input at ${Fs}:${zs}`)}function io(){return zs-=5,ao(`JSON5: invalid identifier character at ${Fs}:${zs}`)}function no(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const t=e.charCodeAt(0).toString(16);return"\\x"+("00"+t).substring(t.length)}return e}function ao(e){const t=new SyntaxError(e);return t.lineNumber=Fs,t.columnNumber=zs,t}const ro={parse:function(e,t){Ts=String(e),Ds="start",Ps=[],Is=0,Fs=1,zs=0,Rs=void 0,Ls=void 0,Bs=void 0;do{Rs=Gs(),Ys[Ds]()}while("eof"!==Rs.type);return"function"==typeof t?Os({"":Bs},"",t):Bs},stringify:function(e,t,i){const n=[];let a,r,s,o="",l="";if(null==t||"object"!=typeof t||Array.isArray(t)||(i=t.space,s=t.quote,t=t.replacer),"function"==typeof t)r=t;else if(Array.isArray(t)){a=[];for(const e of t){let t;"string"==typeof e?t=e:("number"==typeof e||e instanceof String||e instanceof Number)&&(t=String(e)),void 0!==t&&a.indexOf(t)<0&&a.push(t)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),"number"==typeof i?i>0&&(i=Math.min(10,Math.floor(i)),l=" ".substr(0,i)):"string"==typeof i&&(l=i.substr(0,10)),c("",{"":e});function c(e,t){let i=t[e];switch(null!=i&&("function"==typeof i.toJSON5?i=i.toJSON5(e):"function"==typeof i.toJSON&&(i=i.toJSON(e))),r&&(i=r.call(t,e,i)),i instanceof Number?i=Number(i):i instanceof String?i=String(i):i instanceof Boolean&&(i=i.valueOf()),i){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof i?u(i):"number"==typeof i?String(i):"object"==typeof i?Array.isArray(i)?function(e){if(n.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");n.push(e);let t=o;o+=l;let i,a=[];for(let t=0;t<e.length;t++){const i=c(String(t),e);a.push(void 0!==i?i:"null")}if(0===a.length)i="[]";else if(""===l){i="["+a.join(",")+"]"}else{let e=",\n"+o,n=a.join(e);i="[\n"+o+n+",\n"+t+"]"}return n.pop(),o=t,i}(i):function(e){if(n.indexOf(e)>=0)throw TypeError("Converting circular structure to JSON5");n.push(e);let t=o;o+=l;let i,r=a||Object.keys(e),s=[];for(const t of r){const i=c(t,e);if(void 0!==i){let e=h(t)+":";""!==l&&(e+=" "),e+=i,s.push(e)}}if(0===s.length)i="{}";else{let e;if(""===l)e=s.join(","),i="{"+e+"}";else{let n=",\n"+o;e=s.join(n),i="{\n"+o+e+",\n"+t+"}"}}return n.pop(),o=t,i}(i):void 0}function u(e){const t={"'":.1,'"':.2},i={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let n="";for(let a=0;a<e.length;a++){const r=e[a];switch(r){case"'":case'"':t[r]++,n+=r;continue;case"\0":if(Cs.isDigit(e[a+1])){n+="\\x00";continue}}if(i[r])n+=i[r];else{if(r<" "){let e=r.charCodeAt(0).toString(16);n+="\\x"+("00"+e).substring(e.length);continue}n+=r}}const a=s||Object.keys(t).reduce((e,i)=>t[e]<t[i]?e:i);return n=n.replace(new RegExp(a,"g"),i[a]),a+n+a}function h(e){if(0===e.length)return u(e);const t=String.fromCodePoint(e.codePointAt(0));if(!Cs.isIdStartChar(t))return u(e);for(let i=t.length;i<e.length;i++)if(!Cs.isIdContinueChar(String.fromCodePoint(e.codePointAt(i))))return u(e);return e}}};var so=ro;const oo=new CSSStyleSheet;oo.replaceSync("/* atkinson-hyperlegible-next-latin-ext-400-normal */\n@font-face {\n font-family: 'Atkinson Hyperlegible Next';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url(/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format('woff2'), url(/fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff) format('woff');\n unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;\n}\n\n/* atkinson-hyperlegible-next-latin-400-normal */\n@font-face {\n font-family: 'Atkinson Hyperlegible Next';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src: url(/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format('woff2'), url(/fonts/atkinson-hyperlegible-next-latin-400-normal.woff) format('woff');\n unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;\n}");const lo=new CSSStyleSheet;lo.replaceSync('/* Colors */\n:root, :host {\n\t--white: #ffffff;\n\t--black: #181818;\n\t--black-pale: #1b1a17;\n\t--red: #f70000;\n\t--red-transparent: rgba(247, 0, 0, 0.3);\n\t--red-pale: #ff726f;\n\t--grey: #f5f5f5;\n\t--grey-very-pale: #e6e6e6;\n\t--grey-pale: #cfd2cf;\n\t--grey-semi-dark: #808080;\n\t--grey-dark: #3e3e3e;\n\t--blue: #2954e9;\n\t--blue-dark: #0a1f69;\n\t--blue-semi: #d7dffc;\n\t--blue-pale: #f2f5ff;\n\t--blue-geovisio: #34495e;\n\t--beige: #f5f3ec;\n\t--yellow: #fec868;\n\t--orange: #ff6f00;\n\t--orange-transparent: rgba(255,111,0,0.3);\n\t--orange-pale: #fffafa;\n\t--green: #7ec636;\n\t--green-pale: #f0ffee;\n\t--widget-bg: var(--white);\n\t--widget-bg-hover: var(--grey);\n\t--widget-bg-active: var(--blue);\n\t--widget-bg-inactive: var(--grey-pale);\n\t--widget-bg-primary: var(--blue-semi);\n\t--widget-bg-primary-hover: #e0e7ff;\n\t--widget-bg-warn: #FFECB3;\n\t--widget-bg-danger: #FFCDD2;\n\t--widget-bg-success: #C8E6C9;\n\t--widget-border-div: var(--grey-pale);\n\t--widget-border-btn: var(--blue);\n\t--widget-font: var(--grey-dark);\n\t--widget-font-active: var(--white);\n\t--widget-font-direct: var(--blue);\n\t--widget-font-warn: #BF360C;\n\t--widget-font-danger: #B71C1C;\n\t--widget-font-success: #1B5E20;\n\t--font-family: "Atkinson Hyperlegible Next", sans-serif;\n\t--widget-option-left: #6A1B9A;\n\t--widget-option-right: #0D47A1;\n\toverscroll-behavior-y: contain;\n}\n\n.pnx-hidden { display: none !important; }\n\n/* Hidden elements on mobile */\n@container (max-width: 576px) {\n\t.pnx-mobile-hidden { display: none !important; }\n}\n\n/* Hidden elements on print */\n@media print {\n\t.pnx-print-hidden { display: none !important; }\n}\n'),document.adoptedStyleSheets.push(oo),document.adoptedStyleSheets.push(lo);class co extends ce{static properties={picture:{type:String,reflect:!0},sequence:{type:String,reflect:!0},"fetch-options":{converter:co.GetJSONConverter()},lang:{type:String},endpoint:{type:String}};constructor(e=!1){super(),this.lang=this.getAttribute("lang")||null,this.endpoint=this.getAttribute("endpoint")||null,this.picture=this.getAttribute("picture")||null,this.sequence=this.getAttribute("sequence")||null,console.info(`📷 Panoramax ${this.getClassName()} - Version 5.2.0 (bd0c390)\n\n🆘 Issues can be reported at https://gitlab.com/panoramax/clients/web-viewer/-/work_items`),e||(this._isInternetFast=null,$e().then(e=>this._isInternetFast=e))}connectedCallback(){super.connectedCallback(),this._t=dt(this.lang),this.loader=bs("pnx-loader",{_parent:this,"no-label":Ye()}),this._loadsAPI&&this.endpoint&&this._loadsAPI===this.endpoint||this.api&&this.api._endpoint===this.endpoint||!this.endpoint||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI()),Object.entries({map:"map-options",psv:"psv-options",fetchOptions:"fetch-options",mapstyle:"map-style"}).forEach(([e,t])=>{this.getAttribute(e)&&console.error(`Component attribute "${e}" has been renamed into "${t}". Old attribute "${e}" is ignored.`)}),Ye()&&this.classList.add("pnx-iframed")}_setupAPI(){if(this.loader=this.loader||bs("pnx-loader",{_parent:this}),!this.endpoint)return void console.warn("No endpoint is defined");this._loadsAPI=this.endpoint;let e=this.endpoint;try{this.api=new st(this.endpoint,{fetch:this["fetch-options"]}),this.api.onceReady().then(()=>{if(e!==this._loadsAPI||!this.api)return;let t=this.api.getUnavailableFeatures(),i=this.api.getAvailableFeatures();i=0===t.length?"✅ All features available":"✅ Available features: "+i.join(", "),t=0===t.length?"":"🚫 Unavailable features: "+t.join(", "),console.info(`🌐 Connected to API "${this.api._metadata.name}" (${this.api._endpoint})\nℹ️ API runs STAC ${this.api._metadata.stac_version} ${this.api._metadata.geovisio_version?"& GeoVisio "+this.api._metadata.geovisio_version:""}\n ${i}\n ${t}\n`.trim())}).catch(e=>this.loader?.dismiss?.(e,this._t?.pnx.error_api)).finally(()=>delete this._loadsAPI)}catch(e){delete this._loadsAPI,this.loader?.dismiss?this.loader.dismiss(e,this._t.pnx.error_api):console.error(e)}}onceReady(){throw new Error("You must override this method on sub-class")}onceAPIReady(){return this.api?this.api.onceReady():new Promise(e=>setTimeout(e,250)).then(this.onceAPIReady.bind(this))}createRenderRoot(){return this}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),"endpoint"===e&&(this._loadsAPI&&i&&this._loadsAPI===i||this.api&&this.api._endpoint===i||!i||((this._loadsAPI||this.api)&&(delete this.api,delete this._loadsAPI),this._setupAPI())),["picture","sequence"].includes(e)){let n,a,r,s;"picture"===e?(n=this.sequence,r=this.sequence,a=i,s=t):(n=i,r=t,a=this.picture,s=this.picture),this.dispatchEvent(new CustomEvent("select",{bubbles:!0,composed:!0,detail:{seqId:n,picId:a,prevSeqId:r,prevPicId:s}}))}}getClassName(){return"Basic"}select(e=null,t=null,i=!1){i&&(this.picture=null,this.sequence=null),this.picture=t,this.sequence=e}isWidthSmall(){return this?.offsetWidth<576}isWidthMedium(){return this?.offsetWidth>=576&&this?.offsetWidth<768}isHeightSmall(){return this?.offsetHeight<400}render(){return H`<p>Should not be used directly, use Viewer/CoverageMap/Editor instead</p>`}getSubComponentsNames(){return["loader","api"]}getAPI(){return this.api}addEventListener(e,t,i){let n=e.split(":").shift();if(n&&this.getSubComponentsNames().includes(n)){const a=e.substring(n.length+1);this[n]?.addEventListener?this[n].addEventListener(a,t,i):setTimeout(()=>this.addEventListener(e,t,i),50)}else super.addEventListener(e,t,i)}static GetJSONConverter(){return{fromAttribute:e=>null==e||""===e?null:"object"==typeof e||Array.isArray(e)?e:so.parse(e),toAttribute:e=>null==e||""===e?"":"string"==typeof e?e:so.stringify(e)}}}var uo="data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8' standalone='no'%3f%3e%3csvg width='48' height='48' viewBox='0 0 48 48' version='1.1' id='svg1' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3e %3cdefs id='defs1' /%3e %3cpath d='m 8.0222924%2c7.8597977 a 22.594107%2c22.594107 0 0 1 31.9555636%2c0.0027 L 24.001409%2c23.838916 Z' style='fill:%2354278f%3bfill-opacity:1%3bstroke:white%3bstroke-width:2.50003%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-opacity:1' id='path1' /%3e %3ccircle cx='24' cy='24' r='9.9777565' style='fill:%23b39ddb%3bfill-opacity:1%3bstroke:white%3bstroke-width:2.49449%3bstroke-miterlimit:4%3bstroke-dasharray:none%3bstroke-opacity:1' id='circle1' /%3e%3c/svg%3e";const ho="pnx-aerial",po=15,mo=["!",["has","uncrowded"]],go=["==",["get","type"],"equirectangular"];function fo(e){return{PICTURES:{paint:{"circle-radius":["interpolate",["linear"],["zoom"],po,0,15.5,e?1:["case",mo,0,1],16.5,e?2:["case",mo,0,2],17,e?4:["case",mo,1,4],18,e?5:["case",mo,3,5],20,e?7:["case",mo,5,7],22,e?7:["case",mo,7,7]],"circle-opacity":["interpolate",["linear"],["zoom"],po,0,15.5,e?1:["case",mo,0,1],16.5,e?1:["case",mo,0,1],17,1],"circle-stroke-opacity":["case",["all",mo,go],.2,go,.4,0],"circle-stroke-width":["interpolate",["linear"],["zoom"],17.5,0,18.5,e?["case",go,10,2]:["case",["all",mo,go],0,go,10,mo,0,2],19.5,e?["case",go,10,2]:["case",["all",mo,go],10,go,10,mo,0,2]]},layout:{}},SEQUENCES:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,.5,10,1.5,14.5,1.5,15.5,e?2:["case",mo,.5,2],22,e?4:["case",mo,1,4]]},layout:{"line-cap":"square"}},SEQUENCES_PLUS:{paint:{"line-width":["interpolate",["linear"],["zoom"],0,15,16,30],"line-opacity":0,"line-color":"#ff0000"},layout:{"line-cap":"square"}},GRID:{layout:{"circle-sort-key":["get","coef"]},paint:{"circle-color":["interpolate",["linear"],["get","coef"],0,"#fff",.1,Te.PALETTE_1,.25,Te.PALETTE_1,.5,Te.PALETTE_2,.75,Te.PALETTE_3,1,Te.PALETTE_4],"circle-opacity":["interpolate",["linear"],["zoom"],4,.5,5,1,6.75,1,7,0],"circle-radius":["interpolate",["linear"],["zoom"],1,["match",["get","coef"],0,0,1],5,["match",["get","coef"],0,0,2.5],7,["match",["get","coef"],0,0,7]]}}}}const Ao=fo(!1),_o=fo(!0),vo=["case",["==",["get","type"],"equirectangular"],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Fe],1],["case",["has","h_pixel_density"],["step",["get","h_pixel_density"],...Ie],1]],yo=["case",["==",["get","gps_accuracy"],0],1,["has","gps_accuracy"],["step",["get","gps_accuracy"],...ze],1],xo=["round",["+",["*",vo,.8],["*",yo,.2]]],bo=864e5,wo=e=>new Date(e).toISOString().split("T")[0],Eo=Date.now(),ko=wo(Eo-180*bo),So=wo(Eo-365*bo),Mo=wo(Eo-94608e6),Co={default:{id:"default",sort:[],color:[["==",["get","coef"],1],Te.PALETTE_4,[">=",["get","coef"],.75],Te.PALETTE_3,[">=",["get","coef"],.5],Te.PALETTE_2,[">=",["get","coef"],.25],Te.PALETTE_1,[">=",["get","coef"],.1],Te.PALETTE_1,Te.PALETTE_0]},age:{id:"age",sort:[["!",["any",["has","date"],["has","ts"]]],0,[">=",["coalesce",["get","date"],["get","ts"]],ko],50,[">=",["coalesce",["get","date"],["get","ts"]],So],49,[">=",["coalesce",["get","date"],["get","ts"]],Mo],48],color:[["!",["any",["has","date"],["has","ts"]]],Te.BASE,[">=",["coalesce",["get","date"],["get","ts"]],ko],Te.PALETTE_4,[">=",["coalesce",["get","date"],["get","ts"]],So],Te.PALETTE_3,[">=",["coalesce",["get","date"],["get","ts"]],Mo],Te.PALETTE_2,Te.PALETTE_1]},type:{id:"type",sort:[["!",["has","type"]],0,["==",["get","type"],"equirectangular"],50],color:[["!",["has","type"]],Te.BASE,["==",["get","type"],"equirectangular"],Te.QUALI_1,Te.QUALI_2]},score:{id:"score",sort:[["==",xo,5],80,["==",xo,4],65,["==",xo,3],50,["==",xo,2],35,["==",xo,1],20],color:[["==",xo,5],Pe[0].color,["==",xo,4],Pe[1].color,["==",xo,3],Pe[2].color,["==",xo,2],Pe[3].color,Pe[4].color]},gps:{id:"gps",sort:[["==",yo,5],80,["==",yo,4],65,["==",yo,3],50,["==",yo,2],35,["==",yo,1],20],color:[[">=",yo,Re[0].score],Re[0].color,["==",yo,Re[1].score],Re[1].color,["==",yo,Re[2].score],Re[2].color,Re[3].color]}};function To(e){const t=document.createElement("img");return Ue(uo,t),t.alt=e.loading,t.title=e.loading,t.classList.add("pnx-map-thumb","pnx-map-thumb-loader"),t}function Do(e){return null==e||Array.isArray(e)&&(2===e.length&&0===e[0]&&0===e[1]||e.length<2)}function Po(e){return"symbol"===e.type&&void 0!==e?.layout?.["text-field"]&&(void 0===e.minzoom||e.minzoom<15)}function Io(e){const t=e?.metadata?.["panoramax:fields"]||{};return t?.grid?.includes("logged_coef_360_pictures")&&t?.grid?.includes("logged_coef_flat_pictures")&&t?.grid?.includes("logged_coef")||!1}function Fo(e){const t=2===e.metadata?.["panoramax:tiles_version"],i=Object.keys(e.sources)[0],n="vector"===e.sources[i].type,a=n?Ao:_o;if(t)return e.layers.push({id:`${i}_sequences_plus`,type:"line",source:i,"source-layer":"sequences",layout:{...a.SEQUENCES_PLUS.layout},paint:{...a.SEQUENCES_PLUS.paint}}),e.layers;const r=[{id:`${i}_sequences`,type:"line",source:i,"source-layer":n?"sequences":void 0,layout:{...a.SEQUENCES.layout},paint:{...a.SEQUENCES.paint,"line-color":Te.BASE}},{id:`${i}_sequences_plus`,type:"line",source:i,"source-layer":n?"sequences":void 0,layout:{...a.SEQUENCES_PLUS.layout},paint:{...a.SEQUENCES_PLUS.paint}},{id:`${i}_pictures`,type:"circle",source:i,"source-layer":n?"pictures":void 0,layout:{...a.PICTURES.layout},paint:{...a.PICTURES.paint,"circle-color":Te.BASE}}];return e?.metadata?.["panoramax:fields"]?.grid&&r.push({id:`${i}_grid`,type:"circle",source:i,"source-layer":"grid",layout:{...a.GRID.layout},paint:{...a.GRID.paint}}),r}function zo(e){return!["default","metacatalog","",null,void 0].includes(e)}function Ro(e,t){if(Array.isArray(e))return e.map(e=>Ro(e,t));if("object"==typeof e&&null!==e){const i={};for(const n in e)i[n]=Ro(e[n],t);return i}return"string"==typeof e&&(e.startsWith("coef")||e.startsWith("logged_coef"))?t:e}function Lo(e){const t=t=>{Le(t.detail.picId)?(e.map.displayPictureMarker(),e?.isMapWide?.()&&e?.mini?.setAttribute("collapsed","")):(e.map.displayPictureMarker(t.detail.lon,t.detail.lat,e.psv.getXY().x,t.detail.first&&!Do(e._initParams?.getMapPostInit()?.center),t.detail.picId),e?.isMapWide?.()&&e?.mini?.removeAttribute("collapsed"))};e.psv.addEventListener("picture-loading",t),e.psv.addEventListener("picture-loaded",t),e.psv.addEventListener("picture-failed",t),e.psv.addEventListener("view-rotated",()=>{let t=nt(e.psv.getPosition().yaw);t+=e.psv.getPictureOriginalHeading(),e.map._picMarker.setRotation(t)}),e.psv.addEventListener("picture-preview-started",t=>{e.map._picMarkerPreview.setLngLat(t.detail.coordinates).setRotation(t.detail.direction||0).addTo(e.map)}),e.psv.addEventListener("picture-preview-stopped",()=>{e.map._picMarkerPreview.remove()}),e.psv.addEventListener("picture-loaded",t=>{e.isWidthSmall()&&e._picPopup&&t.detail.picId===e._picPopup._picId&&e._picPopup.remove()}),e.map.on("picture-click",t=>{e.select(t.seqId,t.picId),!e.psv._myVTour.state.currentNode&&e?._setFocus&&e._setFocus("pic")}),e.map.on("sequence-click",t=>{(e.getAPI?.()||e.api).getPicturesAroundCoordinates(t.coordinates.lat,t.coordinates.lng,.01,1,t.seqId).then(t=>{t?.features?.length>0&&(e.select(t.features[0]?.collection,t.features[0].id),!e.psv.getPictureMetadata()&&e?._setFocus&&e._setFocus("pic"))})}),e._setFocus&&(e.psv.addEventListener("dblclick",()=>{e.isMapWide()&&e._setFocus("pic")}),e.map.on("dblclick",()=>{e.isMapWide()?"any"===e.psv.getPicturesNavigation()&&e.select():e._setFocus("map")}),e.addEventListener("focus-changed",t=>{"map"!==t.detail.focus&&e.map._dropPreview()}))}function Bo(e){e.map.keyboard.keydown=function(t){if(t.altKey||t.ctrlKey||t.metaKey)return;switch(t.key){case"*":case"5":return void e.moveCenter();case"PageUp":case"9":return void e.psv.goToNextPicture();case"PageDown":case"3":return void e.psv.goToPrevPicture();case"Home":case"7":return t.stopPropagation(),void e._toggleFocus();case"End":case"1":return void e.mini.toggleAttribute("collapsed");case" ":case"0":return void e.psv.toggleSequencePlaying()}let i=0,n=0,a=0,r=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:case 100:t.shiftKey?n=-1:(t.preventDefault(),r=-1);break;case 39:case 102:t.shiftKey?n=1:(t.preventDefault(),r=1);break;case 38:case 104:t.shiftKey?a=1:(t.preventDefault(),s=-1);break;case 40:case 98:t.shiftKey?a=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(n=0,a=0),{cameraAnimation:e=>{const o=this._tr;e.easeTo({duration:300,easeId:"keyboardHandler",easing:e=>e*(2-e),zoom:i?Math.round(o.zoom)+i*(t.shiftKey?2:1):o.zoom,bearing:o.bearing+n*this._bearingStep,pitch:o.pitch+a*this._pitchStep,offset:[-r*this._panStep,-s*this._panStep],center:o.center},{originalEvent:t})}}}.bind(e.map.keyboard)}const Oo="pnx-map-parameters";function Uo(){const e=localStorage.getItem(Oo);if(!e)return{};try{return JSON.parse(e)}catch(e){return console.warn("Can't read map parameters stored in localStorage",e),{}}}function No(e){const t=()=>localStorage.setItem(Oo,JSON.stringify({center:Object.fromEntries(Object.entries(e.getCenter()).map(([e,t])=>[e,t.toFixed(7)])),zoom:e.getZoom().toFixed(1),background:e._parent.mapStyleComposer.basemap,theme:e._parent.mapStyleComposer.panoramaxTheme,endpoint:e._parent.mapStyleComposer.panoramax}));e._parent.mapStyleComposer.addEventListener("filters-changed",t),e._parent.mapStyleComposer.addEventListener("theme-changed",t),e._parent.mapStyleComposer.addEventListener("basemap-changed",t),e._parent.mapStyleComposer.addEventListener("panoramax-changed",t),e.on("moveend",t),e.on("zoomend",t),e.on("dragend",t),e.on("boxzoomend",t)}var jo=Object.freeze({__proto__:null,MAP_EXPR_QUALITYSCORE:xo,MAP_EXPR_QUALITYSCORE_GPS:yo,MAP_THEMES_STYLES:Co,RASTER_LAYER_ID:ho,TILES_PICTURES_SYMBOL_ZOOM:19,TILES_PICTURES_ZOOM:po,VECTOR_STYLES:Ao,VECTOR_STYLES_NOCROWD:_o,getMapParamsFromLocalStorage:Uo,getPanoramaxLayers:Fo,getThumbGif:To,hasStyleLoggedGridStats:Io,initMapKeyboardHandler:Bo,isLabelLayer:Po,isNullCoordinates:Do,isPanoramaxEndpointSingleUser:zo,linkMapAndPhoto:Lo,mapFiltersFormValues:function(e,t,i){const n=e?.shadowRoot.getElementById("pnx-filter-date-from"),a=e?.shadowRoot.getElementById("pnx-filter-date-end"),r=e?.shadowRoot.querySelectorAll("input[name='pnx-filter-type']"),s=e?.shadowRoot.getElementById("pnx-pictures-source");let o="";for(let e=0;e<r.length;e++){const t=r[e];if(t.checked){o=t.value;break}}let l=[],c=[];if(i){const t=e?.shadowRoot.getElementById("pnx-filter-qualityscore");l=(t?.grade||"").split(",").map(e=>parseInt(e)).filter(e=>!isNaN(e));const i=e?.shadowRoot.getElementById("pnx-filter-gps");c=(i?.grade||"").split(",").map(e=>parseInt(e)).filter(e=>!isNaN(e))}return{minDate:n?.value,maxDate:a?.value,pic_type:o,theme:t?.value,qualityscore:l,gps:c,source:s?.checked?"local":"metacatalog"}},mapFiltersToLayersFilters:function(e,t=!1,i=null){let n={},a=[],r=[],s=!1;if(e.minDate&&""!==e.minDate&&(n.minDate=e.minDate,a.push([">=",["get","date"],e.minDate]),r.push([">=",["get","ts"],e.minDate])),e.maxDate&&""!==e.maxDate){n.maxDate=e.maxDate,a.push(["<=",["get","date"],e.maxDate]);let t=new Date(e.maxDate);t.setDate(t.getDate()+1),t=t.toISOString().split("T")[0],r.push(["<=",["get","ts"],t])}if(e.pic_type&&""!==e.pic_type&&(n.pic_type="flat"===e.pic_type?"flat":"equirectangular",a.push(["==",["get","type"],n.pic_type]),r.push(["==",["get","type"],n.pic_type])),t&&(s=!0),e.camera&&""!==e.camera){n.camera=e.camera;const t=e.camera.toLowerCase().trim()+" ",i=e.camera.toLowerCase().trim()+"zzzzzzzzzzzzzzzzzzzz",s=["collator",{"case-sensitive":!1,"diacritic-sensitive":!1}];a.push([">=",["get","model"],t,s]),a.push(["<=",["get","model"],i,s]),r.push([">=",["get","model"],t,s]),r.push(["<=",["get","model"],i,s])}return e.qualityscore&&e.qualityscore.length>0&&(n.qualityscore=e.qualityscore,a.push(["in",xo,["literal",n.qualityscore]]),r.push(["in",xo,["literal",n.qualityscore]])),e.gps&&e.gps.length>0&&(n.gps=e.gps,a.push(["in",yo,["literal",n.gps]]),r.push(["in",yo,["literal",n.gps]])),e.theme&&Co[e.theme]&&(n.theme=e.theme,s=!0),i?.pictures&&i.pictures.features?.length>=0&&("keep"===i.pictures.rule?r.push(["in",["get","id"],["literal",i.pictures.features]]):i.pictures.features.length>0&&r.push(["!",["in",["get","id"],["literal",i.pictures.features]]])),i?.sequences&&i.sequences.features?.length>=0&&("keep"===i.sequences.rule?a.push(["in",["get","id"],["literal",i.sequences.features]]):i.sequences.features.length>0&&a.push(["!",["in",["get","id"],["literal",i.sequences.features]]])),0===a.length?a=null:a.unshift("all"),0===r.length?r=null:(r.unshift("all"),r=["step",["zoom"],!0,po,r]),{mapFilters:n,mapSeqFilters:a,mapPicFilters:r,reloadMapStyle:s}},saveMapParamsToLocalStorage:No,switchCoefValue:Ro});function Vo(e,t,i,n){let a=n;const r=t+(i-t>>1);let s,o=i-t;const l=e[t],c=e[t+1],u=e[i],h=e[i+1];for(let n=t+3;n<i;n+=3){const t=qo(e[n],e[n+1],l,c,u,h);if(t>a)s=n,a=t;else if(t===a){const e=Math.abs(n-r);e<o&&(s=n,o=e)}}a>n&&(s-t>3&&Vo(e,t,s,n),e[s+2]=a,i-s>3&&Vo(e,s,i,n))}function qo(e,t,i,n,a,r){let s=a-i,o=r-n;if(0!==s||0!==o){const l=((e-i)*s+(t-n)*o)/(s*s+o*o);l>1?(i=a,n=r):l>0&&(i+=s*l,n+=o*l)}return s=e-i,o=t-n,s*s+o*o}function Go(e,t,i,n){const a={type:t,geom:i},r={id:null==e?null:e,type:a.type,geometry:a.geom,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(a.type){case"Point":case"MultiPoint":Wo(r,a.geom);break;case"LineString":Wo(r,a.geom.points);break;case"Polygon":Wo(r,a.geom[0].points);break;case"MultiLineString":for(const e of a.geom)Wo(r,e.points);break;case"MultiPolygon":for(const e of a.geom)Wo(r,e[0].points)}return r}function Ho(e){const t=e;e.points.length>64&&(t.points=new Float64Array(e.points))}function Wo(e,t){for(let i=0;i<t.length;i+=3)e.minX=Math.min(e.minX,t[i]),e.minY=Math.min(e.minY,t[i+1]),e.maxX=Math.max(e.maxX,t[i]),e.maxY=Math.max(e.maxY,t[i+1])}function Zo(e,t){const i=[];switch(e.type){case"FeatureCollection":for(let n=0;n<e.features.length;n++)Ko(i,e.features[n],t,n);break;case"Feature":Ko(i,e,t);break;default:Ko(i,{geometry:e,properties:void 0},t)}return i}function Ko(e,t,i,n,a=0){if(!t.geometry)return;if(a>1024)throw new Error("GeometryCollection nesting exceeds supported depth: 1024");if("GeometryCollection"===t.geometry.type)return void function(e,t,i,n,a,r=0){for(const s of i.geometries)Ko(e,{id:t.id,geometry:s,properties:t.properties},n,a,r)}(e,t,t.geometry,i,n,a+1);if(!t.geometry.coordinates?.length)return;const r=function(e,t,i){return t.promoteId?e.properties?.[t.promoteId]:t.generateId?i||0:e.id}(t,i,n),s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(t.geometry.type){case"Point":return void function(e,t,i,n){const a=[];a.push(Yo(i.coordinates[0]),Jo(i.coordinates[1]),0),e.push(Go(t,"Point",a,n))}(e,r,t.geometry,t.properties);case"MultiPoint":return void function(e,t,i,n){const a=[];for(const e of i.coordinates)a.push(Yo(e[0]),Jo(e[1]),0);e.push(Go(t,"MultiPoint",a,n))}(e,r,t.geometry,t.properties);case"LineString":return void function(e,t,i,n,a){const r={points:[]};Xo(i.coordinates,r,n,!1),e.push(Go(t,"LineString",r,a))}(e,r,t.geometry,s,t.properties);case"MultiLineString":return void function(e,t,i,n,a,r){if(a.lineMetrics)for(const a of i.coordinates){const i={points:[]};Xo(a,i,n,!1),e.push(Go(t,"LineString",i,r))}else{const a=[];Qo(i.coordinates,a,n,!1),e.push(Go(t,"MultiLineString",a,r))}}(e,r,t.geometry,s,i,t.properties);case"Polygon":return void function(e,t,i,n,a){const r=[];Qo(i.coordinates,r,n,!0),e.push(Go(t,"Polygon",r,a))}(e,r,t.geometry,s,t.properties);case"MultiPolygon":return void function(e,t,i,n,a){const r=[];for(const e of i.coordinates){const t=[];Qo(e,t,n,!0),r.push(t)}e.push(Go(t,"MultiPolygon",r,a))}(e,r,t.geometry,s,t.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function Xo(e,t,i,n){let a,r,s=0;for(let i=0;i<e.length;i++){const o=Yo(e[i][0]),l=Jo(e[i][1]);t.points.push(o,l,0),i>0&&(s+=n?(a*l-o*r)/2:Math.sqrt(Math.pow(o-a,2)+Math.pow(l-r,2))),a=o,r=l}const o=t.points.length-3;t.points[2]=1,i>0&&Vo(t.points,0,o,i),t.points[o+2]=1,Ho(t),t.size=Math.abs(s),t.start=0,t.end=t.size}function Qo(e,t,i,n){for(let a=0;a<e.length;a++){const r={points:[]};Xo(e[a],r,i,n),t.push(r)}}function Yo(e){return e/360+.5}function Jo(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function $o(e){const t={type:"Feature",geometry:el(e),properties:e.tags};return null!=e.id&&(t.id=e.id),t}function el(e){const{type:t,geometry:i}=e;switch(t){case"Point":return{type:t,coordinates:il(i[0],i[1])};case"MultiPoint":return{type:t,coordinates:tl(i)};case"LineString":return{type:t,coordinates:tl(i.points)};case"MultiLineString":case"Polygon":return{type:t,coordinates:i.map(e=>tl(e.points))};case"MultiPolygon":return{type:t,coordinates:i.map(e=>e.map(e=>tl(e.points)))}}}function tl(e){const t=[];for(let i=0;i<e.length;i+=3)t.push(il(e[i],e[i+1]));return t}function il(e,t){return[nl(e),al(t)]}function nl(e){return 360*(e-.5)}function al(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function rl(e,t,i,n,a,r,s,o){if(n/=t,r>=(i/=t)&&s<n)return e;if(s<i||r>=n)return null;const l=[];for(const t of e){const e=0===a?t.minX:t.minY,r=0===a?t.maxX:t.maxY;if(e>=i&&r<n)l.push(t);else if(!(r<i||e>=n))switch(t.type){case"Point":case"MultiPoint":sl(t,l,i,n,a);continue;case"LineString":ol(t,l,i,n,a,o);continue;case"MultiLineString":ll(t,l,i,n,a);continue;case"Polygon":cl(t,l,i,n,a);continue;case"MultiPolygon":ul(t,l,i,n,a);continue}}return l.length?l:null}function sl(e,t,i,n,a){const r=[];if(function(e,t,i,n,a){for(let r=0;r<e.length;r+=3){const s=e[r+a];s>=i&&s<=n&&ml(t,e[r],e[r+1],e[r+2])}}(e.geometry,r,i,n,a),!r.length)return;const s=3===r.length?"Point":"MultiPoint";t.push(Go(e.id,s,r,e.tags))}function ol(e,t,i,n,a,r){const s=[];if(hl(e.geometry,s,i,n,a,!1,r.lineMetrics),s.length)if(r.lineMetrics)for(const i of s)t.push(Go(e.id,"LineString",i,e.tags));else s.length>1?t.push(Go(e.id,"MultiLineString",s,e.tags)):t.push(Go(e.id,"LineString",s[0],e.tags))}function ll(e,t,i,n,a){const r=[];pl(e.geometry,r,i,n,a,!1),r.length&&(1!==r.length?t.push(Go(e.id,"MultiLineString",r,e.tags)):t.push(Go(e.id,"LineString",r[0],e.tags)))}function cl(e,t,i,n,a){const r=[];pl(e.geometry,r,i,n,a,!0),r.length&&t.push(Go(e.id,"Polygon",r,e.tags))}function ul(e,t,i,n,a){const r=[];for(const t of e.geometry){const e=[];pl(t,e,i,n,a,!0),e.length&&r.push(e)}r.length&&t.push(Go(e.id,"MultiPolygon",r,e.tags))}function hl(e,t,i,n,a,r,s){let o=dl(e);const l=0===a?gl:fl;let c,u,h=e.start;for(let d=0;d<e.points.length-3;d+=3){const p=e.points[d],m=e.points[d+1],g=e.points[d+2],f=e.points[d+3],A=e.points[d+4],_=0===a?p:m,v=0===a?f:A;let y=!1;s&&(c=Math.sqrt(Math.pow(p-f,2)+Math.pow(m-A,2))),_<i?v>i&&(u=l(o,p,m,f,A,i),s&&(o.start=h+c*u)):_>n?v<n&&(u=l(o,p,m,f,A,n),s&&(o.start=h+c*u)):ml(o.points,p,m,g),v<i&&_>=i&&(u=l(o,p,m,f,A,i),y=!0),v>n&&_<=n&&(u=l(o,p,m,f,A,n),y=!0),!r&&y&&(s&&(o.end=h+c*u),t.push(o),o=dl(e)),s&&(h+=c)}let d=e.points.length-3;const p=e.points[d],m=e.points[d+1],g=e.points[d+2],f=0===a?p:m;f>=i&&f<=n&&ml(o.points,p,m,g),d=o.points.length-3,r&&d>=3&&(o.points[d]!==o.points[0]||o.points[d+1]!==o.points[1])&&ml(o.points,o.points[0],o.points[1],o.points[2]),o.points.length&&(Ho(o),t.push(o))}function dl(e){return{points:[],size:e.size,start:e.start,end:e.end}}function pl(e,t,i,n,a,r){for(const s of e)hl(s,t,i,n,a,r,!1)}function ml(e,t,i,n){e.push(t,i,n)}function gl(e,t,i,n,a,r){const s=(r-t)/(n-t);return ml(e.points,r,i+(a-i)*s,1),s}function fl(e,t,i,n,a,r){const s=(r-i)/(a-i);return ml(e.points,t+(n-t)*s,r,1),s}function Al(e,t){const i=t.buffer/t.extent;let n=e;const a=rl(e,1,-1-i,i,0,-1,2,t),r=rl(e,1,1-i,2+i,0,-1,2,t);return a||r?(n=rl(e,1,-i,1+i,0,-1,2,t)||[],a&&(n=_l(a,1).concat(n)),r&&(n=n.concat(_l(r,-1))),n):n}function _l(e,t){const i=[];for(const n of e)switch(n.type){case"Point":case"MultiPoint":{const e=vl(n.geometry,t);i.push(Go(n.id,n.type,e,n.tags));continue}case"LineString":{const e=yl(n.geometry,t);i.push(Go(n.id,n.type,e,n.tags));continue}case"MultiLineString":case"Polygon":{const e=[];for(const i of n.geometry)e.push(yl(i,t));i.push(Go(n.id,n.type,e,n.tags));continue}case"MultiPolygon":{const e=[];for(const i of n.geometry){const n=[];for(const e of i)n.push(yl(e,t));e.push(n)}i.push(Go(n.id,n.type,e,n.tags));continue}}return i}function vl(e,t){const i=[];for(let n=0;n<e.length;n+=3)i.push(e[n]+t,e[n+1],e[n+2]);return i}function yl(e,t){const i={points:[],size:e.size};void 0!==e.start&&(i.start=e.start,i.end=e.end);for(let n=0;n<e.points.length;n+=3)i.points.push(e.points[n]+t,e.points[n+1],e.points[n+2]);return Ho(i),i}function xl(e,t,i){const n=function(e,t){return e?{removeAll:e.removeAll,remove:new Set(e.remove||[]),add:new Map(e.add?.map(e=>[t.promoteId?e.properties[t.promoteId]:e.id,e])),update:new Map(e.update?.map(e=>[e.id,e]))}:{remove:new Set,add:new Map,update:new Map}}(t,i);let a=[];if(n.removeAll&&(a=e,e=[]),n.remove.size||n.add.size){const t=[];for(const i of e)(n.remove.has(i.id)||n.add.has(i.id))&&t.push(i);if(t.length){a=a.concat(t);const i=new Set(t.map(e=>e.id));e=e.filter(e=>!i.has(e.id))}if(n.add.size){let t=Zo({type:"FeatureCollection",features:Array.from(n.add.values())},i);t=Al(t,i),a=a.concat(t),e=e.concat(t)}}if(n.update.size){const t=new Map;let r=[];for(const i of e)n.update.has(i.id)?t.set(i.id,[...t.get(i.id)||[],i]):r.push(i);for(const[e,s]of n.update){const n=t.get(e);if(!n||0===n.length)continue;const o=bl(n,s,i);a=a.concat(n,o),r=r.concat(o)}e=r}return{affected:a,source:e}}function bl(e,t,i){const n=!!t.newGeometry,a=t.removeAllProperties||t.removeProperties?.length>0||t.addOrUpdateProperties?.length>0;if(n){const n=e[0];let r=Zo({type:"FeatureCollection",features:[{type:"Feature",id:n.id,geometry:t.newGeometry,properties:a?wl(n.tags,t):n.tags}]},i);return r=Al(r,i),r}if(a){const i=[];for(const n of e){const e={...n};e.tags=wl(e.tags,t),i.push(e)}return i}return e}function wl(e,t){if(t.removeAllProperties)return{};const i={...e||{}};if(t.removeProperties)for(const e of t.removeProperties)delete i[e];if(t.addOrUpdateProperties)for(const{key:e,value:n}of t.addOrUpdateProperties)i[e]=n;return i}const El=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],kl=new Uint32Array(96);var Sl=class e{static from(t){if(!t||void 0===t.byteLength||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");const[i,n]=new Uint8Array(t,0,2);if(219!==i)throw new Error("Data does not appear to be in a KDBush format.");const a=n>>4;if(1!==a)throw new Error(`Got v${a} data when expected v1.`);const r=El[15&n];if(!r)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new e(o,s,r,void 0,t)}constructor(e,t=64,i=Float64Array,n=ArrayBuffer,a){if(isNaN(e)||e<0)throw new Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const r=El.indexOf(this.ArrayType),s=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-o%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);if(a)this.data=a,this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+o+l,2*e),this._pos=2*e,this._finished=!0;else{const a=this.data=new n(8+s+o+l);this.ids=new this.IndexArrayType(a,8,e),this.coords=new i(a,8+o+l,2*e),this._pos=0,this._finished=!1,new Uint8Array(a,0,2).set([219,16+r]),new Uint16Array(a,2,1)[0]=t,new Uint32Array(a,4,1)[0]=e}}add(e,t){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ml(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:r,nodeSize:s}=this;kl[0]=0,kl[1]=a.length-1,kl[2]=0;let o=3;const l=[];for(;o>0;){const c=kl[--o],u=kl[--o],h=kl[--o];if(u-h<=s){for(let s=h;s<=u;s++){const o=r[2*s],c=r[2*s+1];o>=e&&o<=i&&c>=t&&c<=n&&l.push(a[s])}continue}const d=h+u>>1,p=r[2*d],m=r[2*d+1];p>=e&&p<=i&&m>=t&&m<=n&&l.push(a[d]),(0===c?e<=p:t<=m)&&(kl[o++]=h,kl[o++]=d-1,kl[o++]=1-c),(0===c?i>=p:n>=m)&&(kl[o++]=d+1,kl[o++]=u,kl[o++]=1-c)}return l}within(e,t,i){const n=[];return this.withinInto(e,t,i,n),n}withinInto(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:r,nodeSize:s}=this;kl[0]=0,kl[1]=a.length-1,kl[2]=0;let o=3,l=0;const c=i*i;for(;o>0;){const u=kl[--o],h=kl[--o],d=kl[--o];if(h-d<=s){for(let i=d;i<=h;i++)Pl(r[2*i],r[2*i+1],e,t)<=c&&(n[l++]=a[i]);continue}const p=d+h>>1,m=r[2*p],g=r[2*p+1];Pl(m,g,e,t)<=c&&(n[l++]=a[p]),(0===u?e-i<=m:t-i<=g)&&(kl[o++]=d,kl[o++]=p-1,kl[o++]=1-u),(0===u?e+i>=m:t+i>=g)&&(kl[o++]=p+1,kl[o++]=h,kl[o++]=1-u)}return l}};function Ml(e,t,i,n,a,r){if(a-n<=i)return;const s=n+a>>1;Cl(e,t,s,n,a,r),Ml(e,t,i,n,s-1,1-r),Ml(e,t,i,s+1,a,1-r)}function Cl(e,t,i,n,a,r){for(;a>n;){if(a-n>600){const s=a-n+1,o=i-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(o-s/2<0?-1:1);Cl(e,t,i,Math.max(n,Math.floor(i-o*c/s+u)),Math.min(a,Math.floor(i+(s-o)*c/s+u)),r)}const s=t[2*i+r];let o=n,l=a;for(Tl(e,t,n,i),t[2*a+r]>s&&Tl(e,t,n,a);o<l;){for(Tl(e,t,o,l),o++,l--;t[2*o+r]<s;)o++;for(;t[2*l+r]>s;)l--}t[2*n+r]===s?Tl(e,t,n,l):(l++,Tl(e,t,l,a)),l<=i&&(n=l+1),i<=l&&(a=l-1)}}function Tl(e,t,i,n){Dl(e,i,n),Dl(t,2*i,2*n),Dl(t,2*i+1,2*n+1)}function Dl(e,t,i){const n=e[t];e[t]=e[i],e[i]=n}function Pl(e,t,i,n){const a=e-i,r=t-n;return a*a+r*r}const Il={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e};var Fl=class{constructor(e){this.options=Object.assign(Object.create(Il),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){const t=[];for(const i of e){if(!i.geometry)continue;const[e,n]=i.geometry.coordinates,[a,r]=[Yo(e),Jo(n)],s={id:i.id,type:"Point",geometry:[a,r],tags:i.properties};t.push(s)}this.createIndex(t)}initialize(e){const t=[];for(const i of e)"Point"===i.type&&t.push(i);this.createIndex(t)}updateIndex(e,t,i){this.options=Object.assign(Object.create(Il),i.clusterOptions),this.initialize(e)}createIndex(e){const{log:t,minZoom:i,maxZoom:n}=this.options;t&&console.time("total time");const a=`prepare ${e.length} points`;t&&console.time(a),this.points=e;const r=[];for(let t=0;t<e.length;t++){const i=e[t];if(!i?.geometry)continue;let[n,a]=i.geometry;n=Math.fround(n),a=Math.fround(a),r.push(n,a,1/0,t,-1,1),this.options.reduce&&r.push(0)}let s=this.trees[n+1]=this.createTree(r);t&&console.timeEnd(a);for(let e=n;e>=i;e--){const i=Date.now();s=this.trees[e]=this.createTree(this.cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,Date.now()-i)}t&&console.timeEnd("total time")}getClusters(e,t){return this.getClustersInternal(e,t).map(e=>$o(e))}getClustersInternal(e,t){let i=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let a=180===e[2]?180:((e[2]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,a=180;else if(i>a){const e=this.getClustersInternal([i,n,180,r],t),s=this.getClustersInternal([-180,n,a,r],t);return e.concat(s)}const s=this.trees[this.limitZoom(t)],o=s.range(Yo(i),Jo(r),Yo(a),Jo(n)),l=s.flatData,c=[];for(const e of o){const t=this.stride*e;c.push(l[t+5]>1?zl(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(e){const t=this.getOriginId(e),i=this.getOriginZoom(e),n=new Error("No cluster with the specified id: "+e),a=this.trees[i];if(!a)throw n;const r=a.flatData;if(t*this.stride>=r.length)throw n;const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),o=r[t*this.stride],l=r[t*this.stride+1],c=a.within(o,l,s),u=[];for(const t of c){const i=t*this.stride;r[i+4]===e&&u.push(r[i+5]>1?Rl(r,i,this.clusterProps):$o(this.points[r[i+3]]))}if(0===u.length)throw n;return u}getLeaves(e,t,i){t=t||10,i=i||0;const n=[];return this.appendLeaves(n,e,t,i,0),n}getTile(e,t,i){const n=this.trees[this.limitZoom(e)];if(!n)return null;const a=Math.pow(2,e),{extent:r,radius:s}=this.options,o=s/r,l=(i-o)/a,c=(i+1+o)/a,u={transformed:!0,features:[],source:null,x:t,y:i,z:e};return this.addTileFeatures(n.range((t-o)/a,l,(t+1+o)/a,c),n.flatData,t,i,a,u),0===t&&this.addTileFeatures(n.range(1-o/a,l,1,c),n.flatData,a,i,a,u),t===a-1&&this.addTileFeatures(n.range(0,l,o/a,c),n.flatData,-1,i,a,u),u}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,t,i,n,a){const r=this.getChildren(t);for(const t of r){const r=t.properties;if(r?.cluster?a+r.point_count<=n?a+=r.point_count:a=this.appendLeaves(e,r.cluster_id,i,n,a):a<n?a++:e.push(t),e.length===i)break}return a}createTree(e){const t=new Sl(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let i=0;i<e.length;i+=this.stride)t.add(e[i],e[i+1]);return t.finish(),t.flatData=e,t.data=null,t}addTileFeatures(e,t,i,n,a,r){for(const s of e){const e=s*this.stride,o=t[e+5]>1;let l,c,u;if(o)l=Ll(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const i=this.points[t[e+3]];l=i.tags,[c,u]=i.geometry}const h={type:1,geometry:[[Math.round(this.options.extent*(c*a-i)),Math.round(this.options.extent*(u*a-n))]],tags:l};let d;d=o||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==d&&(h.id=d),r.features.push(h)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,t){const{radius:i,extent:n,reduce:a,minPoints:r}=this.options,s=i/(n*Math.pow(2,t)),o=e.flatData,l=[],c=this.stride;for(let i=0;i<o.length;i+=c){if(o[i+2]<=t)continue;o[i+2]=t;const n=o[i],u=o[i+1],h=e.within(o[i],o[i+1],s),d=o[i+5];let p=d;for(const e of h){const i=e*c;o[i+2]>t&&(p+=o[i+5])}if(p>d&&p>=r){let e,r=n*d,s=u*d,m=-1;const g=(i/c<<5)+(t+1)+this.points.length;for(const n of h){const l=n*c;if(o[l+2]<=t)continue;o[l+2]=t;const u=o[l+5];r+=o[l]*u,s+=o[l+1]*u,o[l+4]=g,a&&(e||(e=this.map(o,i,!0),m=this.clusterProps.length,this.clusterProps.push(e)),a(e,this.map(o,l)))}o[i+4]=g,l.push(r/p,s/p,1/0,g,-1,p),a&&l.push(m)}else{for(let e=0;e<c;e++)l.push(o[i+e]);if(p>1)for(const e of h){const i=e*c;if(!(o[i+2]<=t)){o[i+2]=t;for(let e=0;e<c;e++)l.push(o[i+e])}}}}return l}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,t,i){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return i?Object.assign({},n):n}const n=this.points[e[t+3]].tags,a=this.options.map(n);return i&&a===n?Object.assign({},a):a}};function zl(e,t,i){return{id:e[t+3],type:"Point",tags:Ll(e,t,i),geometry:[e[t],e[t+1]]}}function Rl(e,t,i){return{type:"Feature",id:e[t+3],properties:Ll(e,t,i),geometry:{type:"Point",coordinates:[nl(e[t]),al(e[t+1])]}}}function Ll(e,t,i){const n=e[t+5],a=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,r=e[t+6],s=-1===r?{}:Object.assign({},i[r]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:a})}const Bl="geojsonvt_clip_start",Ol="geojsonvt_clip_end";function Ul(e,t,i,n,a){const r=t===a.maxZoom?0:a.tolerance/((1<<t)*a.extent),s={transformed:!1,features:[],source:null,x:i,y:n,z:t,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:e.length};for(const t of e)Nl(s,t,r,a);return s}function Nl(e,t,i,n){switch(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),t.type){case"Point":case"MultiPoint":return void function(e,t){const i=[];for(let n=0;n<t.geometry.length;n+=3)i.push(t.geometry[n],t.geometry[n+1]),e.numPoints++,e.numSimplified++;if(!i.length)return;const n={type:1,tags:t.tags||null,geometry:i};null!==t.id&&(n.id=t.id);e.features.push(n)}(e,t);case"LineString":return void function(e,t,i,n){const a=[];if(jl(a,t.geometry,e,i,!1,!1),!a.length)return;let r=t.tags||null;if(n.lineMetrics){r={};for(const e in t.tags)r[e]=t.tags[e];r[Bl]=t.geometry.start/t.geometry.size,r[Ol]=t.geometry.end/t.geometry.size}const s={type:2,tags:r,geometry:a};null!==t.id&&(s.id=t.id);e.features.push(s)}(e,t,i,n);case"MultiLineString":case"Polygon":return void function(e,t,i){const n=[];for(let a=0;a<t.geometry.length;a++)jl(n,t.geometry[a],e,i,"Polygon"===t.type,0===a);if(!n.length)return;const a={type:"Polygon"===t.type?3:2,tags:t.tags||null,geometry:n};null!==t.id&&(a.id=t.id);e.features.push(a)}(e,t,i);case"MultiPolygon":return void function(e,t,i){const n=[];for(let a=0;a<t.geometry.length;a++){const r=t.geometry[a];for(let t=0;t<r.length;t++)jl(n,r[t],e,i,!0,0===t)}if(!n.length)return;const a={type:3,tags:t.tags||null,geometry:n};null!==t.id&&(a.id=t.id);e.features.push(a)}(e,t,i)}}function jl(e,t,i,n,a,r){const s=n*n;if(n>0&&t.size<(a?s:n))return void(i.numPoints+=t.points.length/3);const o=[];for(let e=0;e<t.points.length;e+=3)(0===n||t.points[e+2]>s)&&(i.numSimplified++,o.push(t.points[e],t.points[e+1])),i.numPoints++;a&&function(e,t){let i=0;for(let t=0,n=e.length,a=n-2;t<n;a=t,t+=2)i+=(e[t]-e[a])*(e[t+1]+e[a+1]);if(i>0!==t)return;for(let t=0,i=e.length;t<i/2;t+=2){const n=e[t],a=e[t+1];e[t]=e[i-2-t],e[t+1]=e[i-1-t],e[i-2-t]=n,e[i-1-t]=a}}(o,r),e.push(o)}function Vl(e,t){if(e.transformed)return e;const i=1<<e.z,n=e.x,a=e.y;for(const r of e.features)1===r.type?ql(r,t,i,n,a):Gl(r,t,i,n,a);return e.transformed=!0,e}function ql(e,t,i,n,a){const r=e,s=e.geometry,o=[];for(let e=0;e<s.length;e+=2)o.push(Hl(s[e],s[e+1],t,i,n,a));return r.geometry=o,r}function Gl(e,t,i,n,a){const r=e,s=e.geometry,o=[];for(const e of s){const r=[];for(let s=0;s<e.length;s+=2)r.push(Hl(e[s],e[s+1],t,i,n,a));o.push(r)}return r.geometry=o,r}function Hl(e,t,i,n,a,r){return[Math.round(i*(e*n-a)),Math.round(i*(t*n-r))]}var Wl=class{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(e,t,i){i.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(t),i.debug>1&&console.timeEnd("invalidating");const[n,a,r]=[0,0,0],s=Ul(e,n,a,r,i);s.source=e;const o=Zl(n,a,r);if(this.tiles[o]=s,this.tileCoords.push({z:n,x:a,y:r,id:o}),i.debug){const e=`z${n}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,t,i){return null}getTile(e,t,i){const{extent:n,debug:a}=this.options,r=1<<e,s=Zl(e,t=t+r&r-1,i);if(this.tiles[s])return Vl(this.tiles[s],n);a>1&&console.log("drilling down to z%d-%d-%d",e,t,i);let o,l=e,c=t,u=i;for(;!o&&l>0;)l--,c>>=1,u>>=1,o=this.tiles[Zl(l,c,u)];return o?.source?(a>1&&(console.log("found parent tile z%d-%d-%d",l,c,u),console.time("drilling down")),this.splitTile(o.source,l,c,u,e,t,i),a>1&&console.timeEnd("drilling down"),this.tiles[s]?Vl(this.tiles[s],n):null):null}splitTile(e,t,i,n,a,r,s){const o=[e,t,i,n],l=this.options,c=l.debug;for(;o.length;){n=o.pop(),i=o.pop(),t=o.pop(),e=o.pop();const u=1<<t,h=Zl(t,i,n);let d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=Ul(e,t,i,n,l),this.tileCoords.push({z:t,x:i,y:n,id:h}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(d.source=e,null==a){if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===a)continue;if(null!=a){const e=a-t;if(i!==r>>e||n!==s>>e)continue}}if(d.source=null,!e.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,m=.5-p,g=.5+p,f=1+p;let A=null,_=null,v=null,y=null;const x=rl(e,u,i-p,i+g,0,d.minX,d.maxX,l),b=rl(e,u,i+m,i+f,0,d.minX,d.maxX,l);x&&(A=rl(x,u,n-p,n+g,1,d.minY,d.maxY,l),_=rl(x,u,n+m,n+f,1,d.minY,d.maxY,l)),b&&(v=rl(b,u,n-p,n+g,1,d.minY,d.maxY,l),y=rl(b,u,n+m,n+f,1,d.minY,d.maxY,l)),c>1&&console.timeEnd("clipping"),o.push(A||[],t+1,2*i,2*n),o.push(_||[],t+1,2*i,2*n+1),o.push(v||[],t+1,2*i+1,2*n),o.push(y||[],t+1,2*i+1,2*n+1)}}invalidateTiles(e){if(!e.length)return;const t=this.options,{debug:i}=t;let n=1/0,a=-1/0,r=1/0,s=-1/0;for(const t of e)n=Math.min(n,t.minX),a=Math.max(a,t.maxX),r=Math.min(r,t.minY),s=Math.max(s,t.maxY);const o=t.buffer/t.extent,l=new Set;for(const t in this.tiles){const c=this.tiles[t],u=1<<c.z,h=(c.x-o)/u,d=(c.x+1+o)/u,p=(c.y-o)/u,m=(c.y+1+o)/u;if(a<h||n>=d||s<p||r>=m)continue;let g=!1;for(const t of e)if(t.maxX>=h&&t.minX<d&&t.maxY>=p&&t.minY<m){g=!0;break}if(g){if(i){i>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",c.z,c.x,c.y,c.numFeatures,c.numPoints,c.numSimplified);const e=`z${c.z}`;this.stats[e]=(this.stats[e]||0)-1,this.total--}delete this.tiles[t],l.add(t)}}l.size&&(this.tileCoords=this.tileCoords.filter(e=>!l.has(e.id)))}};function Zl(e,t,i){return 32*((1<<e)*i+t)+e}const Kl={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Il,debug:0};var Xl=class{constructor(e,t){const i=(t=this.options=Object.assign({},Kl,t)).debug;if(i&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=Zo(e,t);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles")),n=Al(n,t),t.updateable&&(this.source=n),this.initializeIndex(n,t)}initializeIndex(e,t){this.tileIndex=t.cluster?new Fl(t.clusterOptions):new Wl(t),e.length&&this.tileIndex.initialize(e)}getTile(e,t,i){return t=+t,i=+i,(e=+e)<0||e>24?null:this.tileIndex.getTile(e,t,i)}updateData(e,t){const i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:n,source:a}=xl(this.source,e,i);t&&({affected:n,source:a}=this.filterUpdate(a,n,t)),n.length&&(this.source=a,this.tileIndex.updateIndex(a,n,i))}filterUpdate(e,t,i){const n=new Set;for(const a of e)null!=a.id&&(i($o(a))||(t.push(a),n.add(a.id)));return{affected:t,source:e=e.filter(e=>!n.has(e.id))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return function(e){return{type:"FeatureCollection",features:e.map(e=>$o(e))}}(this.source)}updateClusterOptions(e,t){const i=this.options.cluster;this.options.cluster=e,this.options.clusterOptions=t,i!=e?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(e){return this.tileIndex.getClusterExpansionZoom(e)}getClusterChildren(e){return this.tileIndex.getChildren(e)}getClusterLeaves(e,t,i){return this.tileIndex.getLeaves(e,t,i)}};const Ql=4294967296,Yl=1/Ql,Jl="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class $l{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,i=this.length){let n;for(;n=this.nextField(i);)e(n,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){const e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Ql;return this.pos+=8,e}readSFixed64(){const e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Ql;return this.pos+=8,e}readFloat(){const e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){const e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){const t=this.buf,i=t[this.pos++];if(i<128)return i;let n,a=127&i;return n=t[this.pos++],a|=(127&n)<<7,n<128?a:(n=t[this.pos++],a|=(127&n)<<14,n<128?a:(n=t[this.pos++],a|=(127&n)<<21,n<128?a:(n=t[this.pos],a|=(15&n)<<28,function(e,t,i){const n=i.buf;let a,r;if(r=n[i.pos++],a=(112&r)>>4,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<3,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<10,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<17,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(127&r)<<24,r<128)return tc(e,a,t);if(r=n[i.pos++],a|=(1&r)<<31,r<128)return tc(e,a,t);throw new Error("Expected varint not more than 10 bytes")}(a,e,this))))}readSVarint(){const e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return Boolean(this.readVarint())}readString(){const e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Jl?Jl.decode(this.buf.subarray(t,e)):function(e,t,i){let n="",a=t;for(;a<i;){const t=e[a];let r,s,o,l=null,c=t>239?4:t>223?3:t>191?2:1;if(a+c>i)break;1===c?t<128&&(l=t):2===c?(r=e[a+1],128==(192&r)&&(l=(31&t)<<6|63&r,l<=127&&(l=null))):3===c?(r=e[a+1],s=e[a+2],128==(192&r)&&128==(192&s)&&(l=(15&t)<<12|(63&r)<<6|63&s,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(r=e[a+1],s=e[a+2],o=e[a+3],128==(192&r)&&128==(192&s)&&128==(192&o)&&(l=(15&t)<<18|(63&r)<<12|(63&s)<<6|63&o,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),a+=c}return n}(this.buf,t,e)}readBytes(){const e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){const i=this.readPackedEnd();for(;this.pos<i;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){const t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;const t=this.readVarint();return this.type=7&t,this._valueStart=this.pos,t>>>3}skip(e){const t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}}class ec{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.length=this.buf.length}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){const e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Yl),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Yl),!0),this.pos+=8}writeVarint(e){if((e=+e||0)>=0&&e<128)return this.pos>=this.length&&this.realloc(1),void(this.buf[this.pos++]=e);e>268435455||e<0?function(e,t){let i,n;e>=0?(i=e%4294967296|0,n=e/4294967296|0):(i=~(-e%4294967296),n=~(-e/4294967296),4294967295^i?i=i+1|0:(i=0,n=n+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){const i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;const t=this.pos;this.pos=function(e,t,i){for(let n,a,r=0;r<t.length;r++){if(n=t.charCodeAt(r),n>55295&&n<57344){if(!a){n>56319||r+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):a=n;continue}if(n<56320){e[i++]=239,e[i++]=191,e[i++]=189,a=n;continue}n=a-55296<<10|n-56320|65536,a=null}else a&&(e[i++]=239,e[i++]=191,e[i++]=189,a=null);n<128?e[i++]=n:(n<2048?e[i++]=n>>6|192:(n<65536?e[i++]=n>>12|224:(e[i++]=n>>18|240,e[i++]=n>>12&63|128),e[i++]=n>>6&63|128),e[i++]=63&n|128)}return i}(this.buf,e,this.pos);const i=this.pos-t;i>=128&&ic(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){const t=e.length;this.writeVarint(t),this.realloc(t),this.buf.set(e,this.pos),this.pos+=t}writeRawMessage(e,t){this.pos++;const i=this.pos;e(t,this);const n=this.pos-i;n>=128&&ic(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeMessage(e,t,i){this.writeTag(e,2),this.writeRawMessage(t,i)}writePackedVarint(e,t){t.length&&this.writeMessage(e,nc,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,ac,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,oc,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,rc,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,sc,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,lc,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,cc,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,uc,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,hc,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function tc(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function ic(e,t,i){const n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(n),i.buf.copyWithin(e+n,e,i.pos)}function nc(e,t){const i=e.length;let n=t.buf,a=t.pos,r=t.length;for(let s=0;s<i;s++){let i=e[s];if(i<0||a+10>r)t.pos=a,t.writeVarint(i),n=t.buf,a=t.pos,r=t.length;else{for(;i>127;)n[a++]=i%128|128,i=Math.floor(i/128);n[a++]=i}}t.pos=a}function ac(e,t){for(let i=0;i<e.length;i++)t.writeSVarint(e[i])}function rc(e,t){for(let i=0;i<e.length;i++)t.writeFloat(e[i])}function sc(e,t){for(let i=0;i<e.length;i++)t.writeDouble(e[i])}function oc(e,t){for(let i=0;i<e.length;i++)t.writeBoolean(e[i])}function lc(e,t){for(let i=0;i<e.length;i++)t.writeFixed32(e[i])}function cc(e,t){for(let i=0;i<e.length;i++)t.writeSFixed32(e[i])}function uc(e,t){for(let i=0;i<e.length;i++)t.writeFixed64(e[i])}function hc(e,t){for(let i=0;i<e.length;i++)t.writeSFixed64(e[i])}function dc(e,t){this.x=e,this.y=t}dc.prototype={clone(){return new dc(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),i=Math.sin(e),n=t*this.x-i*this.y,a=i*this.x+t*this.y;return this.x=n,this.y=a,this},_rotateAround(e,t){const i=Math.cos(e),n=Math.sin(e),a=t.x+i*(this.x-t.x)-n*(this.y-t.y),r=t.y+n*(this.x-t.x)+i*(this.y-t.y);return this.x=a,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:dc},dc.convert=function(e){if(e instanceof dc)return e;if(Array.isArray(e))return new dc(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new dc(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};var pc=class{constructor(e,t){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=t,"id"in e&&("string"==typeof e.id?this.id=parseInt(e.id,10):"number"!=typeof e.id||isNaN(e.id)||(this.id=e.id))}loadGeometry(){const e=[],t=1===this.feature.type?[this.feature.geometry]:this.feature.geometry;for(const i of t){const t=[];for(const e of i)t.push(new dc(e[0],e[1]));e.push(t)}return e}};const mc="_geojsonTileLayer";var gc=class{constructor(e,t){this.layers={[mc]:this},this.name=mc,this.version=t?t.version:1,this.extent=t?t.extent:4096,this.length=e.length,this.features=e}feature(e){return new pc(this.features[e],this.extent)}};function fc(e,t=""){const i=new ec;return function(e,t,i=""){for(const n in e.layers)t.writeMessage(3,(e,t)=>Ac(e,t,i),e.layers[n])}(e,i,t),i.finish()}function Ac(e,t,i=""){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);const n={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let i=0;i<e.length;i++)n.feature=e.feature(i),t.writeMessage(2,_c,n);const a=n.keys;for(const e of a)t.writeStringField(3,e);const r=n.values;for(const e of r)t.writeMessage(4,wc,e)}function _c(e,t){if(!e.feature)return;const i=e.feature;void 0!==i.id&&t.writeVarintField(1,i.id),t.writeMessage(2,vc,e),t.writeVarintField(3,i.type),t.writeMessage(4,bc,i)}function vc(e,t){for(const i in e.feature?.properties){let n=e.feature.properties[i],a=e.keycache[i];if(null==n)continue;void 0===a&&(e.keys.push(i),a=e.keys.length-1,e.keycache[i]=a),t.writeVarint(a),"string"!=typeof n&&"boolean"!=typeof n&&"number"!=typeof n&&(n=e.jsonPrefix+JSON.stringify(n));const r=typeof n+":"+n;let s=e.valuecache[r];void 0===s&&(e.values.push(n),s=e.values.length-1,e.valuecache[r]=s),t.writeVarint(s)}}function yc(e,t){return(t<<3)+(7&e)}function xc(e){return e<<1^e>>31}function bc(e,t){const i=e.loadGeometry(),n=e.type;let a=0,r=0;for(const s of i){let i=1;1===n&&(i=s.length),t.writeVarint(yc(1,i));const o=3===n?s.length-1:s.length;for(let e=0;e<o;e++){1===e&&1!==n&&t.writeVarint(yc(2,o-1));const i=s[e].x-a,l=s[e].y-r;t.writeVarint(xc(i)),t.writeVarint(xc(l)),a+=i,r+=l}3===e.type&&t.writeVarint(yc(7,1))}}function wc(e,t){const i=typeof e;"string"===i?t.writeStringField(1,e):"boolean"===i?t.writeBooleanField(7,e):"number"===i&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}const Ec={15:100,16:300,17:500,18:800,19:1e3};class kc{constructor(e){this.tiles=new Map,this._parent=e}clearCache(){this.tiles=new Map}_tileToBbox(e,t,i){const n=Math.pow(2,i),a=e/n*360-180,r=(e+1)/n*360-180,s=nt(Math.atan(Math.sinh(Math.PI*(1-2*t/n))));return[a,nt(Math.atan(Math.sinh(Math.PI*(1-2*(t+1)/n)))),r,s]}_semanticsToBasicProps(e){const t={},i=e=>{t[e.key]?t[e.key].add(e.value):t[e.key]=new Set([e.value])};return(e.properties?.collection?.semantics||[]).forEach(i),(e.properties?.semantics||[]).forEach(i),(e.properties?.annotations||[]).forEach(e=>e.semantics.forEach(i)),Object.keys(t).forEach(e=>t[e]=[...t[e]].join(";")),t.picid=e.id,t.seqid=e.collection,t}tile(){return(e,t)=>{t=t||new AbortController;const i=e.url.match(/^sem:\/\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/);if(!i)throw new Error("Invalid URL");if(this.tiles.has(e.url))return{data:this.tiles.get(e.url).buffer.slice(0)};const[,n,a,r,s]=i,o=this._tileToBbox(parseInt(r),parseInt(s),parseInt(a)),l=`${this._parent.getAPI()._endpoint}/search?bbox=${o.join(",")}&limit=${Ec[parseInt(a)]}&sortby=id&filter=${encodeURIComponent(n)}`;return fetch(l,{signal:t.signal}).then(e=>e.json()).then(t=>{if(t.features){if(t.type="FeatureCollection",0===t.features.length){const t=new Uint8Array;return this.tiles.set(e.url,t),{data:t.buffer.slice(0)}}t.features=t.features.filter(e=>{let t=e.properties?.semantics?.length>0||e.properties?.annotations?.length>0;return t||e.properties?.collection?.semantics?.find(e=>"osm|level"===e.key)&&(t=!0),t}).map(e=>({type:e.type,geometry:e.geometry,id:e.id,properties:this._semanticsToBasicProps(e)}))}const i=new Xl(t,{minZoom:15,maxZoom:19}).getTile(a,r,s);if(!i)throw new Error("Can't create tile");const n=function(e,t){const i={};for(const n in e)i[n]=new gc(e[n].features,t),i[n].name=n,i[n].version=t?t.version:1,i[n].extent=t?t.extent:4096;return fc({layers:i})}({layer:i},{version:2});return this.tiles.set(e.url,n),{data:n.buffer.slice(0)}}).catch(e=>{e.message&&e.message.includes("The operation was aborted")||console.error(e)})}}}class Sc{constructor(e,t,i,n,a){for(this.properties=Object.create(null),this.extent=i,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=a;e.pos<t;){const t=e.readVarint();if(8===t)this.id=e.readVarint();else if(18===t){const t=e.readVarint()+e.pos;for(;e.pos<t;){const t=n[e.readVarint()],i=a[e.readVarint()];this.properties[t]=i}}else 24===t?this.type=e.readVarint():34===t?(this._geometry=e.pos,e.skip(t)):e.skip(t)}}loadGeometry(){if(this._geometry<0)throw new Error("feature has no geometry");const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos,i=[];let n,a=1,r=0,s=0,o=0;for(;e.pos<t;){if(r<=0){const t=e.readVarint();if(a=7&t,r=t>>3,0===r)continue}if(r--,1===a)s+=e.readSVarint(),o+=e.readSVarint(),n&&i.push(n),n=[new dc(s,o)];else if(2===a)s+=e.readSVarint(),o+=e.readSVarint(),n&&n.push(new dc(s,o));else{if(7!==a)throw new Error(`unknown command ${a}`);n&&n.push(n[0].clone())}}return n&&i.push(n),i}bbox(){if(this._geometry<0)throw new Error("feature has no geometry");const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let i=1,n=0,a=0,r=0,s=1/0,o=-1/0,l=1/0,c=-1/0;for(;e.pos<t;){if(n<=0){const t=e.readVarint();if(i=7&t,n=t>>3,0===n)continue}if(n--,1===i||2===i)a+=e.readSVarint(),r+=e.readSVarint(),a<s&&(s=a),a>o&&(o=a),r<l&&(l=r),r>c&&(c=r);else if(7!==i)throw new Error(`unknown command ${i}`)}return[s,l,o,c]}toGeoJSON(e,t,i){const n=this.extent*Math.pow(2,i),a=this.extent*e,r=this.extent*t,s=this.loadGeometry();function o(e){return[360*(e.x+a)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+r)/n)*Math.PI))-90]}function l(e){return e.map(o)}let c;if(1===this.type){const e=[];for(const t of s)e.push(t[0]);const t=l(e);c=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){const e=s.map(l);c=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{const e=function(e){const t=e.length;if(t<=1)return[e];const i=[];let n,a;for(let r=0;r<t;r++){const t=Mc(e[r]);0!==t&&(void 0===a&&(a=t<0),a===t<0?(n&&i.push(n),n=[e[r]]):n&&n.push(e[r]))}n&&i.push(n);return i}(s),t=[];for(const i of e)t.push(i.map(l));c=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}const u={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(u.id=this.id),u}}function Mc(e){let t=0;for(let i,n,a=0,r=e.length,s=r-1;a<r;s=a++)i=e[a],n=e[s],t+=(n.x-i.x)*(i.y+n.y);return t}Sc.types=["Unknown","Point","LineString","Polygon"];class Cc{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],void 0===t&&(t=e.length);e.pos<t;){const t=e.readVarint();10===t?this.name=e.readString():18===t?(this._features.push(e.pos),e.skip(t)):26===t?this._keys.push(e.readString()):34===t?this._values.push(Tc(e)):40===t?this.extent=e.readVarint():120===t?this.version=e.readVarint():e.skip(t)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new Sc(this._pbf,t,this.extent,this._keys,this._values)}}function Tc(e){let t=null;const i=e.readVarint()+e.pos;for(;e.pos<i;){const i=e.readVarint();t=10===i?e.readString():21===i?e.readFloat():25===i?e.readDouble():32===i?e.readVarint(!0):40===i?e.readVarint():48===i?e.readSVarint():56===i?e.readBoolean():(e.skip(i),null)}if(null==t)throw new Error("unknown feature value");return t}class Dc{constructor(e,t=e.length){const i=Object.create(null);for(;e.pos<t;){const t=e.readVarint();if(26===t){const t=new Cc(e,e.readVarint()+e.pos);t.length&&(i[t.name]=t)}else e.skip(t)}this.layers=i}}class Pc{tile(){return(e,t)=>{t=t||new AbortController;const i=e.url.replace(/^panora/,"http");return fetch(i,{signal:t.signal}).then(e=>e.arrayBuffer()).then(e=>new Dc(new $l(e))).then(e=>(!e.layers.pictures||e.layers.pictures.length>=5e3||Object.values(e.layers).forEach(e=>{const t=e.feature.bind(e);e.feature=e=>{const i=t(e);return i.properties.uncrowded=!0,i}}),e)).then(e=>fc(e).buffer).then(e=>({data:e}))}}}const Ic="-1000",Fc="levels";function zc(){try{return IndoorEqual,!0}catch(e){return!1}}function Rc(e,t=!1){if(e._options.indoor)if(zc()){if(!t&&!1===e._options.indoor.visible)return;e.indoorEqual=new IndoorEqual(e,e._options.indoor),e.addControl(e.indoorEqual),e.indoorEqual.loadSprite("https://files.pavie.info/depot/remote/indoorequal/indoorequal"),e.indoorEqual._refreshAfterLevelsUpdate=function(){this.levels.includes(this.level)||this.level==Ic||this.setLevel("0")};const i="sem-"+Fc;e.indoorEqual._updateLevels=function(){if(this.map.getSource(this.source.sourceId)&&this.map.isSourceLoaded(this.source.sourceId)&&this.map.getSource(i)&&this.map.isSourceLoaded(i)){let e=new Set;this.map.querySourceFeatures(this.source.sourceId,{sourceLayer:"area"}).forEach(t=>{"level"!==t.properties.class&&void 0!==t.properties.level&&e.add(t.properties.level.toString())}),this.map.querySourceFeatures(i,{sourceLayer:"layer"}).forEach(t=>{void 0!==t.properties["osm|level"]&&e.add(t.properties["osm|level"].toString())}),e.size>0&&e.add("0"),0!==e.symmetricDifference(new Set(this.levels)).size&&(this.levels=[...e].sort((e,t)=>parseFloat(e)-parseFloat(t)).reverse(),this._emitLevelsChange(),this._refreshAfterLevelsUpdate())}},e._indoorFeaturesIDs={pictures:{},sequences:{}},e.on("sourcedata",Fc,t=>{t.sourceId===i&&(t.features.forEach(t=>{e._indoorFeaturesIDs.pictures[t.properties["osm|level"]]||(e._indoorFeaturesIDs.pictures[t.properties["osm|level"]]=new Set),e._indoorFeaturesIDs.sequences[t.properties["osm|level"]]||(e._indoorFeaturesIDs.sequences[t.properties["osm|level"]]=new Set),e._indoorFeaturesIDs.pictures[t.properties["osm|level"]].add(t.properties.picid),e._indoorFeaturesIDs.sequences[t.properties["osm|level"]].add(t.properties.seqid)}),s())});const n=()=>{e.addSemanticOverlay?.(Fc,'"semantics.osm|level" IS NOT NULL',{type:"circle",layout:{visibility:"visible"},paint:{"circle-opacity":0}}),t&&e._parent._initParams?.getMapPostInit()?.level===Ic?e.indoorEqual.setLevel("0"):[null,void 0,""].includes(e._parent._initParams?.getMapPostInit()?.level)||e.indoorEqual.setLevel(e._parent._initParams?.getMapPostInit()?.level)};if(e.isStyleLoaded())n();else{const t=setInterval(()=>{e.isStyleLoaded()&&(n(),clearInterval(t))},250)}let a;e._parent.grid.appendChild(bs("pnx-level-select",{slot:"bottom-right",_parent:e._parent,class:"pnx-only-map pnx-print-hidden"}));const r=()=>{if(e.indoorEqual.level===Ic)e.restrictVisibleFeatures("hide","pictures",[]),e.restrictVisibleFeatures("hide","sequences",[]);else if("0"===e.indoorEqual.level){const t=new Set;Object.entries(e._indoorFeaturesIDs.pictures).forEach(([e,i])=>{"0"!=e&&i.forEach(e=>t.add(e))}),e.restrictVisibleFeatures("hide","pictures",[...t]);let i=new Set;Object.entries(e._indoorFeaturesIDs.sequences).forEach(([e,t])=>{"0"!=e&&(i=i.union(t))}),e._indoorFeaturesIDs.sequences[0]&&(i=i.difference(e._indoorFeaturesIDs.sequences[0])),e.restrictVisibleFeatures("hide","sequences",[...i])}else e.restrictVisibleFeatures("keep","pictures",e._indoorFeaturesIDs.pictures[e.indoorEqual.level]?[...e._indoorFeaturesIDs.pictures[e.indoorEqual.level]]:[]),e.restrictVisibleFeatures("keep","sequences",e._indoorFeaturesIDs.sequences[e.indoorEqual.level]?[...e._indoorFeaturesIDs.sequences[e.indoorEqual.level]]:[])},s=()=>{a&&(clearTimeout(a),a=void 0),a=setTimeout(r,250)};e.indoorEqual.on("levelchange",s)}else console.error("The indoor= plugin is not enabled. Please add the maplibre-gl-indoorequal before calling 'indoor' option of Panoramax Viewer.")}var Lc=Object.freeze({__proto__:null,DISABLED_LEVEL:Ic,initIndoorEqualOnMap:Rc,isIndoorEqualAvailable:zc}),Bc=Object.create,Oc=Object.defineProperty,Uc=Object.getOwnPropertyDescriptor,Nc=Object.getOwnPropertyNames,jc=Object.getPrototypeOf,Vc=Object.prototype.hasOwnProperty,qc=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Gc=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,r=Nc(t),s=0,o=r.length;s<o;s++)a=r[s],!Vc.call(e,a)&&a!==i&&Oc(e,a,{get:(e=>t[e]).bind(null,a),enumerable:!(n=Uc(t,a))||n.enumerable});return e};
|
|
28
28
|
/**
|
|
29
29
|
* MapLibre GL JS
|
|
30
30
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.9.0/LICENSE.txt
|
|
@@ -37,7 +37,7 @@ const E=globalThis,k=e=>e,S=E.trustedTypes,M=S?S.createPolicy("lit-html",{create
|
|
|
37
37
|
* @license
|
|
38
38
|
* Copyright 2010-2026 Three.js Authors
|
|
39
39
|
* SPDX-License-Identifier: MIT
|
|
40
|
-
*/(nt(t.pitch)),s=50*r,o=EO*r;this._cursor.style.top=e.clientY-3*s/5+"px",this._cursor.style.left=e.clientX-o/2+"px",this._cursor.style.height=`${s}px`,this._cursor.style.width=`${o}px`,this._cursor.style.display="block",clearTimeout(this._throttledBestPicMap),this._throttledBestPicMap=setTimeout(()=>{const e=(nt(t.yaw)+this.psv.getPictureOriginalHeading())%360,r=DO(n.gps,a,e),s=this._getMapNearbyPictures(r);if(s?.length>0){const e=(nt(t.yaw)+this.psv.getPictureOriginalHeading())%360,r=DO(n.gps,a,e),o=this._bestPicAround(n,r,e,s);o?(this._cursor.src=bO,this._mapPreviewPic=o,i._picMarkerPreview.setLngLat(o.geometry.coordinates).setRotation(360===o.properties?.["pers:interior_orientation"]?.field_of_view?this.psv.getXYZ().x||0:o.properties?.["view:azimuth"]||0).addTo(i)):(this._cursor.src=wO,i._picMarkerPreview?.remove(),this._mapPreviewPic=null)}else this._cursor.src=bO,this._mapPreviewPic=null,i&&(this._isMapShowingPictures()||0===this._getMapNearbySequences(r).length)?(this._cursor.src=wO,i?._picMarkerPreview?.remove()):(this._cursor.src=bO,i?._picMarkerPreview.setLngLat(r).setRotation(e).addTo(i))},10)}}else this.isDesktop&&(this._cursor.style.display="none",this._mapPreviewPic=null,this._hideCursor||i?._picMarkerPreview?.remove())}_onPointerLeave(){this.isDesktop&&(this._cursor.style.display="none"),this._couldGoSomewhere=!1}_onHoverOtherStuff(){this._hideCursor=!0,this._onPointerLeave()}_onLeaveOtherStuff(){this._hideCursor=!1}_onPSVPicNavChanged(e){if("pic"===e?.detail?.value)this._onHoverOtherStuff();else this._onLeaveOtherStuff()}_pitchDegToProjectedDistance(e,t){return t?this.isDesktop?e>=30?0:e>=-2.5?kO:e>=-6?25:e>=-15?12.5:e>=SO?6.25:0:e>=20?0:e>=4?kO/3:e>=-4?kO/1.5:e>=-20?kO/3:0:kO/3}_isMapShowingPictures(){if(this.psv._parent.map){const e=this.psv._parent.map;let t=e.getLayersOrder().find(e=>e.endsWith("pictures"));if(t){return e.queryRenderedFeatures({layers:[t]}).length>0}}return!1}_getMapNearbyPictures(e){const t=this.psv._parent.map;if(t){const i=this.psv._parent?.mapStyleComposer;if(i){const n=Object.keys(i.layerRanges.panoramax[i.panoramax].sources)[0];if(n)return t.querySourceFeatures(n,{sourceLayer:"pictures",filter:["within",{type:"Polygon",coordinates:[[[e[0]-MO,e[1]-MO],[e[0]+MO,e[1]-MO],[e[0]+MO,e[1]+MO],[e[0]-MO,e[1]+MO],[e[0]-MO,e[1]-MO]]]}]}).map(e=>({id:e.properties.id,collection:e.properties.first_sequence||e.properties?.sequences?.[0],geometry:e.geometry,properties:{datetime:e.properties.datetime||e.properties.ts,"view:azimuth":e.properties?.["view:azimuth"]||e.properties.heading,"pers:interior_orientation":e.properties?.["pers:interior_orientation"]||{field_of_view:"equirectangular"===e.properties.type?360:void 0}}}))}}return null}_getMapNearbySequences(e){const t=this.psv._parent.map;if(t){const i=t.getLayersOrder().find(e=>e.endsWith("sequences"));if(i){const n=25e-6,a=[t.project([e[0]-n,e[1]-n]),t.project([e[0]+n,e[1]+n])];return t.queryRenderedFeatures(a,{layers:[i]})}}return[]}_bestPicAround(e,t,i,n){if(!Array.isArray(n)||!n.length)return null;const a=new Date(e.properties?.datetime),r=n.filter(t=>t.id!==e.id).map(n=>{const r=360===n.properties?.["pers:interior_orientation"]?.field_of_view,s=Oe(t,n.geometry.coordinates),o=n.collection===e.sequence?.id||"any"===this.psv.getPicturesNavigation(),l=n.properties?.["view:azimuth"],c=r||"number"==typeof l&&qe(i,l)<=45,u=Math.abs((i-Ve(e.gps,n.geometry.coordinates))%360)<=45,h=new Date(n.properties?.datetime),d=a.toDateString()===h.toDateString(),p=Math.abs((a-h)/864e5);let m=!0;if(this.psv._parent.map){const e=this.psv._parent.map;e.indoorEqual&&e.indoorEqual.level!==Ic&&(m=e._indoorFeaturesIDs.pictures[e.indoorEqual.level]?.has(n.id),m||"0"!==e.indoorEqual.level||(m=!0,Object.entries(e._indoorFeaturesIDs.pictures).forEach(([e,t])=>{m&&"0"!==e&&(m=!t.has(n.id))})))}let g=1/0;return o&&u&&m&&(d&&r?g=1:r&&p<=30?g=2:c&&p<=30?g=3:r?g=4:c&&(g=5)),{p:n,category:g,dist:s,daysDiff:p,headingMatch:c,sameDay:d,is360:r}});if(!r.length)return null;r.sort((e,t)=>e.category!==t.category?e.category-t.category:e.dist!==t.dist?e.dist-t.dist:e.daysDiff!==t.daysDiff?e.daysDiff-t.daysDiff:0);const s=r[0];return s.category<1/0?s.p:null}}function TO(e){return void 0!==e?.properties?.["pers:roll"]||void 0!==e?.properties?.["pers:pitch"]}function DO(e,t,i){const[n,a]=e,r=at(a),s=at(n),o=at(i),l=t/6378137,c=Math.sin(r),u=Math.cos(r),h=Math.sin(l),d=Math.cos(l),p=Math.sin(o),m=c*d+u*h*Math.cos(o),g=Math.asin(m),f=p*h*u,A=d-c*m;return[nt(s+Math.atan2(f,A)),nt(g)]}const PO="185",IO=1,FO=3,zO=0,RO=1,LO=2,BO=100,OO=101,UO=102,NO=200,jO=201,VO=202,qO=203,GO=204,HO=205,WO=206,ZO=207,KO=208,XO=209,QO=210,YO=211,JO=212,$O=213,eU=214,tU=0,iU=1,nU=2,aU=3,rU=4,sU=5,oU=6,lU=7,cU=0,uU=1,hU=2,dU=1,pU=2,mU=3,gU=4,fU=5,AU=6,_U=7,vU=301,yU=302,xU=303,bU=304,wU=306,EU=1e3,kU=1001,SU=1002,MU=1003,CU=1004,TU=1005,DU=1006,PU=1007,IU=1008,FU=1009,zU=1010,RU=1011,LU=1012,BU=1013,OU=1014,UU=1015,NU=1016,jU=1017,VU=1018,qU=1020,GU=35902,HU=35899,WU=1023,ZU=1026,KU=1027,XU=1029,QU=1030,YU=1031,JU=1033,$U=33776,eN=33777,tN=33778,iN=33779,nN=35840,aN=35841,rN=35842,sN=35843,oN=36196,lN=37492,cN=37496,uN=37488,hN=37489,dN=37490,pN=37491,mN=37808,gN=37809,fN=37810,AN=37811,_N=37812,vN=37813,yN=37814,xN=37815,bN=37816,wN=37817,EN=37818,kN=37819,SN=37820,MN=37821,CN=36492,TN=36494,DN=36495,PN=36283,IN=36284,FN=36285,zN=36286,RN="",LN="srgb",BN="srgb-linear",ON="linear",UN="srgb",NN=7680,jN=512,VN=513,qN=514,GN=515,HN=516,WN=517,ZN=518,KN=519,XN="300 es",QN=2e3,YN=2001;function JN(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function $N(){const e=JN("canvas");return e.style.display="block",e}const ej={};function tj(...e){const t="THREE."+e.shift();console.log(t,...e)}function ij(e){const t=e[0];if("string"==typeof t&&t.startsWith("TSL:")){const t=e[1];t&&t.isStackTrace?e[0]+=" "+t.getLocation():e[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return e}function nj(...e){const t="THREE."+(e=ij(e)).shift();{const i=e[0];i&&i.isStackTrace?console.warn(i.getError(t)):console.warn(t,...e)}}function aj(...e){const t="THREE."+(e=ij(e)).shift();{const i=e[0];i&&i.isStackTrace?console.error(i.getError(t)):console.error(t,...e)}}function rj(...e){const t=e.join(" ");t in ej||(ej[t]=!0,nj(...e))}const sj={[tU]:1,[nU]:6,[rU]:7,[aU]:5,[iU]:0,[oU]:2,[lU]:4,[sU]:3};class oj{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return void 0!==i&&(void 0!==i[e]&&-1!==i[e].indexOf(t))}removeEventListener(e,t){const i=this._listeners;if(void 0===i)return;const n=i[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){const t=this._listeners;if(void 0===t)return;const i=t[e.type];if(void 0!==i){e.target=this;const t=i.slice(0);for(let i=0,n=t.length;i<n;i++)t[i].call(this,e);e.target=null}}}const lj=["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"];let cj=1234567;const uj=Math.PI/180,hj=180/Math.PI;function dj(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(lj[255&e]+lj[e>>8&255]+lj[e>>16&255]+lj[e>>24&255]+"-"+lj[255&t]+lj[t>>8&255]+"-"+lj[t>>16&15|64]+lj[t>>24&255]+"-"+lj[63&i|128]+lj[i>>8&255]+"-"+lj[i>>16&255]+lj[i>>24&255]+lj[255&n]+lj[n>>8&255]+lj[n>>16&255]+lj[n>>24&255]).toLowerCase()}function pj(e,t,i){return Math.max(t,Math.min(i,e))}function mj(e,t){return(e%t+t)%t}function gj(e,t,i){return(1-i)*e+i*t}function fj(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Aj(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const _j={DEG2RAD:uj,RAD2DEG:hj,generateUUID:dj,clamp:pj,euclideanModulo:mj,mapLinear:function(e,t,i,n,a){return n+(e-t)*(a-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:gj,damp:function(e,t,i,n){return gj(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(mj(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(cj=e);let t=cj+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*uj},radToDeg:function(e){return e*hj},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,i,n,a){const r=Math.cos,s=Math.sin,o=r(i/2),l=s(i/2),c=r((t+n)/2),u=s((t+n)/2),h=r((t-n)/2),d=s((t-n)/2),p=r((n-t)/2),m=s((n-t)/2);switch(a){case"XYX":e.set(o*u,l*h,l*d,o*c);break;case"YZY":e.set(l*d,o*u,l*h,o*c);break;case"ZXZ":e.set(l*h,l*d,o*u,o*c);break;case"XZX":e.set(o*u,l*m,l*p,o*c);break;case"YXY":e.set(l*p,o*u,l*m,o*c);break;case"ZYZ":e.set(l*m,l*p,o*u,o*c);break;default:nj("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}},normalize:Aj,denormalize:fj};class vj{static{vj.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,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}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=pj(this.x,e.x,t.x),this.y=pj(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=pj(this.x,e,t),this.y=pj(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pj(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pj(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,r=this.y-e.y;return this.x=a*i-r*n+e.x,this.y=a*n+r*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class yj{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,a,r,s){let o=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],h=a[r+0],d=a[r+1],p=a[r+2],m=a[r+3];if(u!==m||o!==h||l!==d||c!==p){let e=o*h+l*d+c*p+u*m;e<0&&(h=-h,d=-d,p=-p,m=-m,e=-e);let t=1-s;if(e<.9995){const i=Math.acos(e),n=Math.sin(i);t=Math.sin(t*i)/n,o=o*t+h*(s=Math.sin(s*i)/n),l=l*t+d*s,c=c*t+p*s,u=u*t+m*s}else{o=o*t+h*s,l=l*t+d*s,c=c*t+p*s,u=u*t+m*s;const e=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,n,a,r){const s=i[n],o=i[n+1],l=i[n+2],c=i[n+3],u=a[r],h=a[r+1],d=a[r+2],p=a[r+3];return e[t]=s*p+c*u+o*d-l*h,e[t+1]=o*p+c*h+l*u-s*d,e[t+2]=l*p+c*d+s*h-o*u,e[t+3]=c*p-s*u-o*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,n=e._y,a=e._z,r=e._order,s=Math.cos,o=Math.sin,l=s(i/2),c=s(n/2),u=s(a/2),h=o(i/2),d=o(n/2),p=o(a/2);switch(r){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:nj("Quaternion: .setFromEuler() encountered an unknown order: "+r)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],a=t[8],r=t[1],s=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=i+s+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(a-l)*e,this._z=(r-n)*e}else if(i>s&&i>u){const e=2*Math.sqrt(1+i-s-u);this._w=(c-o)/e,this._x=.25*e,this._y=(n+r)/e,this._z=(a+l)/e}else if(s>u){const e=2*Math.sqrt(1+s-i-u);this._w=(a-l)/e,this._x=(n+r)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+u-i-s);this._w=(r-n)/e,this._x=(a+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(pj(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(0===i)return this;const n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,n=e._y,a=e._z,r=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=i*c+r*s+n*l-a*o,this._y=n*c+r*o+a*s-i*l,this._z=a*c+r*l+i*o-n*s,this._w=r*c-i*s-n*o-a*l,this._onChangeCallback(),this}slerp(e,t){let i=e._x,n=e._y,a=e._z,r=e._w,s=this.dot(e);s<0&&(i=-i,n=-n,a=-a,r=-r,s=-s);let o=1-t;if(s<.9995){const e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+i*t,this._y=this._y*o+n*t,this._z=this._z*o+a*t,this._w=this._w*o+r*t,this._onChangeCallback()}else this._x=this._x*o+i*t,this._y=this._y*o+n*t,this._z=this._z*o+a*t,this._w=this._w*o+r*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class xj{static{xj.prototype.isVector3=!0}constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,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("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(wj.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(wj.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,a=e.elements,r=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*r,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*r,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*r,this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z,a=e.x,r=e.y,s=e.z,o=e.w,l=2*(r*n-s*i),c=2*(s*t-a*n),u=2*(a*i-r*t);return this.x=t+o*l+r*u-s*c,this.y=i+o*c+s*l-a*u,this.z=n+o*u+a*c-r*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=pj(this.x,e.x,t.x),this.y=pj(this.y,e.y,t.y),this.z=pj(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=pj(this.x,e,t),this.y=pj(this.y,e,t),this.z=pj(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pj(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,n=e.y,a=e.z,r=t.x,s=t.y,o=t.z;return this.x=n*o-a*s,this.y=a*r-i*o,this.z=i*s-n*r,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return bj.copy(this).projectOnVector(e),this.sub(bj)}reflect(e){return this.sub(bj.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pj(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bj=new xj,wj=new yj;class Ej{static{Ej.prototype.isMatrix3=!0}constructor(e,t,i,n,a,r,s,o,l){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,i,n,a,r,s,o,l)}set(e,t,i,n,a,r,s,o,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=o,c[6]=i,c[7]=r,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,a=this.elements,r=i[0],s=i[3],o=i[6],l=i[1],c=i[4],u=i[7],h=i[2],d=i[5],p=i[8],m=n[0],g=n[3],f=n[6],A=n[1],_=n[4],v=n[7],y=n[2],x=n[5],b=n[8];return a[0]=r*m+s*A+o*y,a[3]=r*g+s*_+o*x,a[6]=r*f+s*v+o*b,a[1]=l*m+c*A+u*y,a[4]=l*g+c*_+u*x,a[7]=l*f+c*v+u*b,a[2]=h*m+d*A+p*y,a[5]=h*g+d*_+p*x,a[8]=h*f+d*v+p*b,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}determinant(){const e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],r=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*r*c-t*s*l-i*a*c+i*s*o+n*a*l-n*r*o}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],r=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=c*r-s*l,h=s*o-c*a,d=l*a-r*o,p=t*u+i*h+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=u*m,e[1]=(n*l-c*i)*m,e[2]=(s*i-n*r)*m,e[3]=h*m,e[4]=(c*t-n*o)*m,e[5]=(n*a-s*t)*m,e[6]=d*m,e[7]=(i*o-l*t)*m,e[8]=(r*t-i*a)*m,this}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}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}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}setUvTransform(e,t,i,n,a,r,s){const o=Math.cos(a),l=Math.sin(a);return this.set(i*o,i*l,-i*(o*r+l*s)+r+e,-n*l,n*o,-n*(-l*r+o*s)+s+t,0,0,1),this}scale(e,t){return rj("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(kj.makeScale(e,t)),this}rotate(e){return rj("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(kj.makeRotation(-e)),this}translate(e,t){return rj("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(kj.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const kj=new Ej,Sj=(new Ej).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Mj=(new Ej).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Cj(){const e={enabled:!0,workingColorSpace:BN,spaces:{},convert:function(e,t,i){return!1!==this.enabled&&t!==i&&t&&i?(this.spaces[t].transfer===UN&&(e.r=Dj(e.r),e.g=Dj(e.g),e.b=Dj(e.b)),this.spaces[t].primaries!==this.spaces[i].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===UN&&(e.r=Pj(e.r),e.g=Pj(e.g),e.b=Pj(e.b)),e):e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===RN?ON:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,i){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,i){return rj("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,i)},toWorkingColorSpace:function(t,i){return rj("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(t,i)}},t=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],n=[.3127,.329];return e.define({[BN]:{primaries:t,whitePoint:n,transfer:ON,toXYZ:Sj,fromXYZ:Mj,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:LN},outputColorSpaceConfig:{drawingBufferColorSpace:LN}},[LN]:{primaries:t,whitePoint:n,transfer:UN,toXYZ:Sj,fromXYZ:Mj,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:LN}}}),e}const Tj=Cj();function Dj(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Pj(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let Ij;class Fj{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{void 0===Ij&&(Ij=JN("canvas")),Ij.width=e.width,Ij.height=e.height;const t=Ij.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),i=Ij}return i.toDataURL(t)}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=JN("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let e=0;e<a.length;e++)a[e]=255*Dj(a[e]/255);return i.putImageData(n,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*Dj(t[e]/255)):t[e]=Dj(t[e]);return{data:t,width:e.width,height:e.height}}return nj("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let zj=0;class Rj{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:zj++}),this.uuid=dj(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(Lj(n[t].image)):e.push(Lj(n[t]))}else e=Lj(n);i.url=e}return t||(e.images[this.uuid]=i),i}}function Lj(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Fj.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(nj("Texture: Unable to serialize Texture."),{})}let Bj=0;const Oj=new xj;class Uj extends oj{constructor(e=Uj.DEFAULT_IMAGE,t=Uj.DEFAULT_MAPPING,i=1001,n=1001,a=1006,r=1008,s=1023,o=FU,l=Uj.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Bj++}),this.uuid=dj(),this.name="",this.source=new Rj(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=a,this.minFilter=r,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new vj(0,0),this.repeat=new vj(1,1),this.center=new vj(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ej,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Oj).x}get height(){return this.source.getSize(Oj).y}get depth(){return this.source.getSize(Oj).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(void 0===i){nj(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&i&&n.isVector2&&i.isVector2||n&&i&&n.isVector3&&i.isVector3||n&&i&&n.isMatrix3&&i.isMatrix3?n.copy(i):this[t]=i:nj(`Texture.setValues(): property '${t}' does not exist.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case EU:e.x=e.x-Math.floor(e.x);break;case kU:e.x=e.x<0?0:1;break;case SU:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case EU:e.y=e.y-Math.floor(e.y);break;case kU:e.y=e.y<0?0:1;break;case SU:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Uj.DEFAULT_IMAGE=null,Uj.DEFAULT_MAPPING=300,Uj.DEFAULT_ANISOTROPY=1;class Nj{static{Nj.prototype.isVector4=!0}constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,a=this.w,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n+r[12]*a,this.y=r[1]*t+r[5]*i+r[9]*n+r[13]*a,this.z=r[2]*t+r[6]*i+r[10]*n+r[14]*a,this.w=r[3]*t+r[7]*i+r[11]*n+r[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a;const r=.01,s=.1,o=e.elements,l=o[0],c=o[4],u=o[8],h=o[1],d=o[5],p=o[9],m=o[2],g=o[6],f=o[10];if(Math.abs(c-h)<r&&Math.abs(u-m)<r&&Math.abs(p-g)<r){if(Math.abs(c+h)<s&&Math.abs(u+m)<s&&Math.abs(p+g)<s&&Math.abs(l+d+f-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(d+1)/2,A=(f+1)/2,_=(c+h)/4,v=(u+m)/4,y=(p+g)/4;return e>o&&e>A?e<r?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(e),n=_/i,a=v/i):o>A?o<r?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(o),i=_/n,a=y/n):A<r?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(A),i=v/a,n=y/a),this.set(i,n,a,t),this}let A=Math.sqrt((g-p)*(g-p)+(u-m)*(u-m)+(h-c)*(h-c));return Math.abs(A)<.001&&(A=1),this.x=(g-p)/A,this.y=(u-m)/A,this.z=(h-c)/A,this.w=Math.acos((l+d+f-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=pj(this.x,e.x,t.x),this.y=pj(this.y,e.y,t.y),this.z=pj(this.z,e.z,t.z),this.w=pj(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=pj(this.x,e,t),this.y=pj(this.y,e,t),this.z=pj(this.z,e,t),this.w=pj(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pj(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class jj extends oj{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:DU,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Nj(0,0,e,t),this.scissorTest=!1,this.viewport=new Nj(0,0,e,t),this.textures=[];const n={width:e,height:t,depth:i.depth},a=new Uj(n),r=i.count;for(let e=0;e<r;e++)this.textures[e]=a.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview,this.useArrayDepthTexture=i.useArrayDepthTexture}_setTextureOptions(e={}){const t={minFilter:DU,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++){this.textures[e].setValues(t)}}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,a=this.textures.length;n<a;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i,!0!==this.textures[n].isData3DTexture&&(this.textures[n].isArrayTexture=this.textures[n].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Rj(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Vj extends jj{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class qj extends Uj{constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=MU,this.minFilter=MU,this.wrapR=kU,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Gj extends Uj{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=MU,this.minFilter=MU,this.wrapR=kU,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Hj{static{Hj.prototype.isMatrix4=!0}constructor(e,t,i,n,a,r,s,o,l,c,u,h,d,p,m,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,i,n,a,r,s,o,l,c,u,h,d,p,m,g)}set(e,t,i,n,a,r,s,o,l,c,u,h,d,p,m,g){const f=this.elements;return f[0]=e,f[4]=t,f[8]=i,f[12]=n,f[1]=a,f[5]=r,f[9]=s,f[13]=o,f[2]=l,f[6]=c,f[10]=u,f[14]=h,f[3]=d,f[7]=p,f[11]=m,f[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Hj).fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return 0===this.determinantAffine()?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinantAffine())return this.identity();const t=this.elements,i=e.elements,n=1/Wj.setFromMatrixColumn(e,0).length(),a=1/Wj.setFromMatrixColumn(e,1).length(),r=1/Wj.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*r,t[9]=i[9]*r,t[10]=i[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,n=e.y,a=e.z,r=Math.cos(i),s=Math.sin(i),o=Math.cos(n),l=Math.sin(n),c=Math.cos(a),u=Math.sin(a);if("XYZ"===e.order){const e=r*c,i=r*u,n=s*c,a=s*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=i+n*l,t[5]=e-a*l,t[9]=-s*o,t[2]=a-e*l,t[6]=n+i*l,t[10]=r*o}else if("YXZ"===e.order){const e=o*c,i=o*u,n=l*c,a=l*u;t[0]=e+a*s,t[4]=n*s-i,t[8]=r*l,t[1]=r*u,t[5]=r*c,t[9]=-s,t[2]=i*s-n,t[6]=a+e*s,t[10]=r*o}else if("ZXY"===e.order){const e=o*c,i=o*u,n=l*c,a=l*u;t[0]=e-a*s,t[4]=-r*u,t[8]=n+i*s,t[1]=i+n*s,t[5]=r*c,t[9]=a-e*s,t[2]=-r*l,t[6]=s,t[10]=r*o}else if("ZYX"===e.order){const e=r*c,i=r*u,n=s*c,a=s*u;t[0]=o*c,t[4]=n*l-i,t[8]=e*l+a,t[1]=o*u,t[5]=a*l+e,t[9]=i*l-n,t[2]=-l,t[6]=s*o,t[10]=r*o}else if("YZX"===e.order){const e=r*o,i=r*l,n=s*o,a=s*l;t[0]=o*c,t[4]=a-e*u,t[8]=n*u+i,t[1]=u,t[5]=r*c,t[9]=-s*c,t[2]=-l*c,t[6]=i*u+n,t[10]=e-a*u}else if("XZY"===e.order){const e=r*o,i=r*l,n=s*o,a=s*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+a,t[5]=r*c,t[9]=i*u-n,t[2]=n*u-i,t[6]=s*c,t[10]=a*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Kj,e,Xj)}lookAt(e,t,i){const n=this.elements;return Jj.subVectors(e,t),0===Jj.lengthSq()&&(Jj.z=1),Jj.normalize(),Qj.crossVectors(i,Jj),0===Qj.lengthSq()&&(1===Math.abs(i.z)?Jj.x+=1e-4:Jj.z+=1e-4,Jj.normalize(),Qj.crossVectors(i,Jj)),Qj.normalize(),Yj.crossVectors(Jj,Qj),n[0]=Qj.x,n[4]=Yj.x,n[8]=Jj.x,n[1]=Qj.y,n[5]=Yj.y,n[9]=Jj.y,n[2]=Qj.z,n[6]=Yj.z,n[10]=Jj.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,a=this.elements,r=i[0],s=i[4],o=i[8],l=i[12],c=i[1],u=i[5],h=i[9],d=i[13],p=i[2],m=i[6],g=i[10],f=i[14],A=i[3],_=i[7],v=i[11],y=i[15],x=n[0],b=n[4],w=n[8],E=n[12],k=n[1],S=n[5],M=n[9],C=n[13],T=n[2],D=n[6],P=n[10],I=n[14],F=n[3],z=n[7],R=n[11],L=n[15];return a[0]=r*x+s*k+o*T+l*F,a[4]=r*b+s*S+o*D+l*z,a[8]=r*w+s*M+o*P+l*R,a[12]=r*E+s*C+o*I+l*L,a[1]=c*x+u*k+h*T+d*F,a[5]=c*b+u*S+h*D+d*z,a[9]=c*w+u*M+h*P+d*R,a[13]=c*E+u*C+h*I+d*L,a[2]=p*x+m*k+g*T+f*F,a[6]=p*b+m*S+g*D+f*z,a[10]=p*w+m*M+g*P+f*R,a[14]=p*E+m*C+g*I+f*L,a[3]=A*x+_*k+v*T+y*F,a[7]=A*b+_*S+v*D+y*z,a[11]=A*w+_*M+v*P+y*R,a[15]=A*E+_*C+v*I+y*L,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],r=e[1],s=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14],p=e[3],m=e[7],g=e[11],f=e[15],A=o*d-l*h,_=s*d-l*u,v=s*h-o*u,y=r*d-l*c,x=r*h-o*c,b=r*u-s*c;return t*(m*A-g*_+f*v)-i*(p*A-g*y+f*x)+n*(p*_-m*y+f*b)-a*(p*v-m*x+g*b)}determinantAffine(){const e=this.elements,t=e[0],i=e[4],n=e[8],a=e[1],r=e[5],s=e[9],o=e[2],l=e[6],c=e[10];return t*(r*c-s*l)-i*(a*c-s*o)+n*(a*l-r*o)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],r=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],m=e[13],g=e[14],f=e[15],A=t*s-i*r,_=t*o-n*r,v=t*l-a*r,y=i*o-n*s,x=i*l-a*s,b=n*l-a*o,w=c*m-u*p,E=c*g-h*p,k=c*f-d*p,S=u*g-h*m,M=u*f-d*m,C=h*f-d*g,T=A*C-_*M+v*S+y*k-x*E+b*w;if(0===T)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/T;return e[0]=(s*C-o*M+l*S)*D,e[1]=(n*M-i*C-a*S)*D,e[2]=(m*b-g*x+f*y)*D,e[3]=(h*x-u*b-d*y)*D,e[4]=(o*k-r*C-l*E)*D,e[5]=(t*C-n*k+a*E)*D,e[6]=(g*v-p*b-f*_)*D,e[7]=(c*b-h*v+d*_)*D,e[8]=(r*M-s*k+l*w)*D,e[9]=(i*k-t*M-a*w)*D,e[10]=(p*x-m*v+f*A)*D,e[11]=(u*v-c*x-d*A)*D,e[12]=(s*E-r*S-o*w)*D,e[13]=(t*S-i*E+n*w)*D,e[14]=(m*_-p*y-g*A)*D,e[15]=(c*y-u*_+h*A)*D,this}scale(e){const t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),n=Math.sin(t),a=1-i,r=e.x,s=e.y,o=e.z,l=a*r,c=a*s;return this.set(l*r+i,l*s-n*o,l*o+n*s,0,l*s+n*o,c*s+i,c*o-n*r,0,l*o-n*s,c*o+n*r,a*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,r){return this.set(1,i,a,0,e,1,r,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){const n=this.elements,a=t._x,r=t._y,s=t._z,o=t._w,l=a+a,c=r+r,u=s+s,h=a*l,d=a*c,p=a*u,m=r*c,g=r*u,f=s*u,A=o*l,_=o*c,v=o*u,y=i.x,x=i.y,b=i.z;return n[0]=(1-(m+f))*y,n[1]=(d+v)*y,n[2]=(p-_)*y,n[3]=0,n[4]=(d-v)*x,n[5]=(1-(h+f))*x,n[6]=(g+A)*x,n[7]=0,n[8]=(p+_)*b,n[9]=(g-A)*b,n[10]=(1-(h+m))*b,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){const n=this.elements;e.x=n[12],e.y=n[13],e.z=n[14];const a=this.determinantAffine();if(0===a)return i.set(1,1,1),t.identity(),this;let r=Wj.set(n[0],n[1],n[2]).length();const s=Wj.set(n[4],n[5],n[6]).length(),o=Wj.set(n[8],n[9],n[10]).length();a<0&&(r=-r),Zj.copy(this);const l=1/r,c=1/s,u=1/o;return Zj.elements[0]*=l,Zj.elements[1]*=l,Zj.elements[2]*=l,Zj.elements[4]*=c,Zj.elements[5]*=c,Zj.elements[6]*=c,Zj.elements[8]*=u,Zj.elements[9]*=u,Zj.elements[10]*=u,t.setFromRotationMatrix(Zj),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,n,a,r,s=2e3,o=!1){const l=this.elements,c=2*a/(t-e),u=2*a/(i-n),h=(t+e)/(t-e),d=(i+n)/(i-n);let p,m;if(o)p=a/(r-a),m=r*a/(r-a);else if(s===QN)p=-(r+a)/(r-a),m=-2*r*a/(r-a);else{if(s!==YN)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);p=-r/(r-a),m=-r*a/(r-a)}return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,r,s=2e3,o=!1){const l=this.elements,c=2/(t-e),u=2/(i-n),h=-(t+e)/(t-e),d=-(i+n)/(i-n);let p,m;if(o)p=1/(r-a),m=r/(r-a);else if(s===QN)p=-2/(r-a),m=-(r+a)/(r-a);else{if(s!==YN)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);p=-1/(r-a),m=-a/(r-a)}return l[0]=c,l[4]=0,l[8]=0,l[12]=h,l[1]=0,l[5]=u,l[9]=0,l[13]=d,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Wj=new xj,Zj=new Hj,Kj=new xj(0,0,0),Xj=new xj(1,1,1),Qj=new xj,Yj=new xj,Jj=new xj,$j=new Hj,eV=new yj;class tV{constructor(e=0,t=0,i=0,n=tV.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const n=e.elements,a=n[0],r=n[4],s=n[8],o=n[1],l=n[5],c=n[9],u=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(pj(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-r,a)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-pj(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(pj(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-r,l)):(this._y=0,this._z=Math.atan2(o,a));break;case"ZYX":this._y=Math.asin(-pj(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,a)):(this._x=0,this._z=Math.atan2(-r,l));break;case"YZX":this._z=Math.asin(pj(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-pj(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,d),this._y=0);break;default:nj("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return $j.makeRotationFromQuaternion(e),this.setFromRotationMatrix($j,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return eV.setFromEuler(this),this.setFromQuaternion(eV,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}tV.DEFAULT_ORDER="XYZ";class iV{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return 0!==(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let nV=0;const aV=new xj,rV=new yj,sV=new Hj,oV=new xj,lV=new xj,cV=new xj,uV=new yj,hV=new xj(1,0,0),dV=new xj(0,1,0),pV=new xj(0,0,1),mV={type:"added"},gV={type:"removed"},fV={type:"childadded",child:null},AV={type:"childremoved",child:null};class _V extends oj{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:nV++}),this.uuid=dj(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=_V.DEFAULT_UP.clone();const e=new xj,t=new tV,i=new yj,n=new xj(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Hj},normalMatrix:{value:new Ej}}),this.matrix=new Hj,this.matrixWorld=new Hj,this.matrixAutoUpdate=_V.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=_V.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new iV,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return rV.setFromAxisAngle(e,t),this.quaternion.multiply(rV),this}rotateOnWorldAxis(e,t){return rV.setFromAxisAngle(e,t),this.quaternion.premultiply(rV),this}rotateX(e){return this.rotateOnAxis(hV,e)}rotateY(e){return this.rotateOnAxis(dV,e)}rotateZ(e){return this.rotateOnAxis(pV,e)}translateOnAxis(e,t){return aV.copy(e).applyQuaternion(this.quaternion),this.position.add(aV.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(hV,e)}translateY(e){return this.translateOnAxis(dV,e)}translateZ(e){return this.translateOnAxis(pV,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(sV.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?oV.copy(e):oV.set(e,t,i);const n=this.parent;this.updateWorldMatrix(!0,!1),lV.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?sV.lookAt(lV,oV,this.up):sV.lookAt(oV,lV,this.up),this.quaternion.setFromRotationMatrix(sV),n&&(sV.extractRotation(n.matrixWorld),rV.setFromRotationMatrix(sV),this.quaternion.premultiply(rV.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(aj("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(mV),fV.child=e,this.dispatchEvent(fV),fV.child=null):aj("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(gV),AV.child=e,this.dispatchEvent(AV),AV.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),sV.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),sV.multiply(e.parent.matrixWorld)),e.applyMatrix4(sV),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(mV),fV.child=e,this.dispatchEvent(fV),fV.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const n=this.children;for(let a=0,r=n.length;a<r;a++)n[a].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(lV,e,cV),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(lV,uV,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(null!==e){const t=e.x,i=e.y,n=e.z,a=this.matrix.elements;a[12]+=t-a[0]*t-a[4]*i-a[8]*n,a[13]+=i-a[1]*t-a[5]*i-a[9]*n,a[14]+=n-a[2]*t-a[6]*i-a[10]*n}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,n=t.length;i<n;i++){t[i].updateMatrixWorld(e)}}updateWorldMatrix(e,t,i=!1){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,i=!0),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){e[t].updateWorldMatrix(!1,!0,i)}}}toJSON(e){const t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const n={};function a(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),!1!==this.static&&(n.static=this.static),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),null!==this.pivot&&(n.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(n.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(n.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),n.instanceInfo=this._instanceInfo.map(e=>({...e})),n.availableInstanceIds=this._availableInstanceIds.slice(),n.availableGeometryIds=this._availableGeometryIds.slice(),n.nextIndexStart=this._nextIndexStart,n.nextVertexStart=this._nextVertexStart,n.geometryCount=this._geometryCount,n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.matricesTexture=this._matricesTexture.toJSON(e),n.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(n.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(n.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=a(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const n=i[t];a(e.shapes,n)}else a(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(a(e.materials,this.material[i]));n.material=t}else n.material=a(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){const i=this.animations[t];n.animations.push(a(e.animations,i))}}if(t){const t=r(e.geometries),n=r(e.materials),a=r(e.textures),s=r(e.images),o=r(e.shapes),l=r(e.skeletons),c=r(e.animations),u=r(e.nodes);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),a.length>0&&(i.textures=a),s.length>0&&(i.images=s),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),u.length>0&&(i.nodes=u)}return i.object=n,i;function r(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=null!==e.pivot?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const i=e.children[t];this.add(i.clone())}return this}}_V.DEFAULT_UP=new xj(0,1,0),_V.DEFAULT_MATRIX_AUTO_UPDATE=!0,_V.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class vV extends _V{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yV={type:"move"};class xV{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new vV,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new vV,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new xj,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new xj),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new vV,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new xj,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new xj,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let n=null,a=null,r=null;const s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){r=!0;for(const n of e.hand.values()){const e=t.getJointPose(n,i),a=this._getHandJoint(l,n);null!==e&&(a.matrix.fromArray(e.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,a.jointRadius=e.radius),a.visible=null!==e}const n=l.joints["index-finger-tip"],a=l.joints["thumb-tip"],s=n.position.distanceTo(a.position),o=.02,c=.005;l.inputState.pinching&&s>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),null!==a&&(o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,a.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(a.linearVelocity)):o.hasLinearVelocity=!1,a.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(a.angularVelocity)):o.hasAngularVelocity=!1,o.eventsEnabled&&o.dispatchEvent({type:"gripUpdated",data:e,target:this})));null!==s&&(n=t.getPose(e.targetRaySpace,i),null===n&&null!==a&&(n=a),null!==n&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(yV)))}return null!==s&&(s.visible=null!==n),null!==o&&(o.visible=null!==a),null!==l&&(l.visible=null!==r),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const i=new vV;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const bV={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},wV={h:0,s:0,l:0},EV={h:0,s:0,l:0};function kV(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}class SV{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(void 0===t&&void 0===i){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=LN){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Tj.colorSpaceToWorking(this,t),this}setRGB(e,t,i,n=Tj.workingColorSpace){return this.r=e,this.g=t,this.b=i,Tj.colorSpaceToWorking(this,n),this}setHSL(e,t,i,n=Tj.workingColorSpace){if(e=mj(e,1),t=pj(t,0,1),i=pj(i,0,1),0===t)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+t):i+t-i*t,a=2*i-n;this.r=kV(a,n,e+1/3),this.g=kV(a,n,e),this.b=kV(a,n,e-1/3)}return Tj.colorSpaceToWorking(this,n),this}setStyle(e,t=LN){function i(t){void 0!==t&&parseFloat(t)<1&&nj("Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const r=n[1],s=n[2];switch(r){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:nj("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=n[1],a=i.length;if(3===a)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===a)return this.setHex(parseInt(i,16),t);nj("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=LN){const i=bV[e.toLowerCase()];return void 0!==i?this.setHex(i,t):nj("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Dj(e.r),this.g=Dj(e.g),this.b=Dj(e.b),this}copyLinearToSRGB(e){return this.r=Pj(e.r),this.g=Pj(e.g),this.b=Pj(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=LN){return Tj.workingToColorSpace(MV.copy(this),e),65536*Math.round(pj(255*MV.r,0,255))+256*Math.round(pj(255*MV.g,0,255))+Math.round(pj(255*MV.b,0,255))}getHexString(e=LN){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Tj.workingColorSpace){Tj.workingToColorSpace(MV.copy(this),t);const i=MV.r,n=MV.g,a=MV.b,r=Math.max(i,n,a),s=Math.min(i,n,a);let o,l;const c=(s+r)/2;if(s===r)o=0,l=0;else{const e=r-s;switch(l=c<=.5?e/(r+s):e/(2-r-s),r){case i:o=(n-a)/e+(n<a?6:0);break;case n:o=(a-i)/e+2;break;case a:o=(i-n)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e,t=Tj.workingColorSpace){return Tj.workingToColorSpace(MV.copy(this),t),e.r=MV.r,e.g=MV.g,e.b=MV.b,e}getStyle(e=LN){Tj.workingToColorSpace(MV.copy(this),e);const t=MV.r,i=MV.g,n=MV.b;return e!==LN?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*i)},${Math.round(255*n)})`}offsetHSL(e,t,i){return this.getHSL(wV),this.setHSL(wV.h+e,wV.s+t,wV.l+i)}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,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(wV),e.getHSL(EV);const i=gj(wV.h,EV.h,t),n=gj(wV.s,EV.s,t),a=gj(wV.l,EV.l,t);return this.setHSL(i,n,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,n=this.b,a=e.elements;return this.r=a[0]*t+a[3]*i+a[6]*n,this.g=a[1]*t+a[4]*i+a[7]*n,this.b=a[2]*t+a[5]*i+a[8]*n,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}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const MV=new SV;SV.NAMES=bV;class CV extends _V{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new tV,this.environmentIntensity=1,this.environmentRotation=new tV,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const TV=new xj,DV=new xj,PV=new xj,IV=new xj,FV=new xj,zV=new xj,RV=new xj,LV=new xj,BV=new xj,OV=new xj,UV=new Nj,NV=new Nj,jV=new Nj;class VV{constructor(e=new xj,t=new xj,i=new xj){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),TV.subVectors(e,t),n.cross(TV);const a=n.lengthSq();return a>0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){TV.subVectors(n,t),DV.subVectors(i,t),PV.subVectors(e,t);const r=TV.dot(TV),s=TV.dot(DV),o=TV.dot(PV),l=DV.dot(DV),c=DV.dot(PV),u=r*l-s*s;if(0===u)return a.set(0,0,0),null;const h=1/u,d=(l*o-s*c)*h,p=(r*c-s*o)*h;return a.set(1-d-p,p,d)}static containsPoint(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,IV)&&(IV.x>=0&&IV.y>=0&&IV.x+IV.y<=1)}static getInterpolation(e,t,i,n,a,r,s,o){return null===this.getBarycoord(e,t,i,n,IV)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(a,IV.x),o.addScaledVector(r,IV.y),o.addScaledVector(s,IV.z),o)}static getInterpolatedAttribute(e,t,i,n,a,r){return UV.setScalar(0),NV.setScalar(0),jV.setScalar(0),UV.fromBufferAttribute(e,t),NV.fromBufferAttribute(e,i),jV.fromBufferAttribute(e,n),r.setScalar(0),r.addScaledVector(UV,a.x),r.addScaledVector(NV,a.y),r.addScaledVector(jV,a.z),r}static isFrontFacing(e,t,i,n){return TV.subVectors(i,t),DV.subVectors(e,t),TV.cross(DV).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return TV.subVectors(this.c,this.b),DV.subVectors(this.a,this.b),.5*TV.cross(DV).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return VV.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return VV.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return VV.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return VV.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return VV.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,n=this.b,a=this.c;let r,s;FV.subVectors(n,i),zV.subVectors(a,i),LV.subVectors(e,i);const o=FV.dot(LV),l=zV.dot(LV);if(o<=0&&l<=0)return t.copy(i);BV.subVectors(e,n);const c=FV.dot(BV),u=zV.dot(BV);if(c>=0&&u<=c)return t.copy(n);const h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return r=o/(o-c),t.copy(i).addScaledVector(FV,r);OV.subVectors(e,a);const d=FV.dot(OV),p=zV.dot(OV);if(p>=0&&d<=p)return t.copy(a);const m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(i).addScaledVector(zV,s);const g=c*p-d*u;if(g<=0&&u-c>=0&&d-p>=0)return RV.subVectors(a,n),s=(u-c)/(u-c+(d-p)),t.copy(n).addScaledVector(RV,s);const f=1/(g+m+h);return r=m*f,s=h*f,t.copy(i).addScaledVector(FV,r).addScaledVector(zV,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class qV{constructor(e=new xj(1/0,1/0,1/0),t=new xj(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(HV.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(HV.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=HV.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),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,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(void 0!==i){const n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(let t=0,i=n.count;t<i;t++)!0===e.isMesh?e.getVertexPosition(t,HV):HV.fromBufferAttribute(n,t),HV.applyMatrix4(e.matrixWorld),this.expandByPoint(HV);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),WV.copy(e.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),WV.copy(i.boundingBox)),WV.applyMatrix4(e.matrixWorld),this.union(WV)}const n=e.children;for(let e=0,i=n.length;e<i;e++)this.expandByObject(n[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}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&&this.min.z<=e.min.z&&e.max.z<=this.max.z}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),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,HV),HV.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter($V),eq.subVectors(this.max,$V),ZV.subVectors(e.a,$V),KV.subVectors(e.b,$V),XV.subVectors(e.c,$V),QV.subVectors(KV,ZV),YV.subVectors(XV,KV),JV.subVectors(ZV,XV);let t=[0,-QV.z,QV.y,0,-YV.z,YV.y,0,-JV.z,JV.y,QV.z,0,-QV.x,YV.z,0,-YV.x,JV.z,0,-JV.x,-QV.y,QV.x,0,-YV.y,YV.x,0,-JV.y,JV.x,0];return!!nq(t,ZV,KV,XV,eq)&&(t=[1,0,0,0,1,0,0,0,1],!!nq(t,ZV,KV,XV,eq)&&(tq.crossVectors(QV,YV),t=[tq.x,tq.y,tq.z],nq(t,ZV,KV,XV,eq)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,HV).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(HV).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(GV[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),GV[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),GV[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),GV[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),GV[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),GV[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),GV[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),GV[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(GV)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const GV=[new xj,new xj,new xj,new xj,new xj,new xj,new xj,new xj],HV=new xj,WV=new qV,ZV=new xj,KV=new xj,XV=new xj,QV=new xj,YV=new xj,JV=new xj,$V=new xj,eq=new xj,tq=new xj,iq=new xj;function nq(e,t,i,n,a){for(let r=0,s=e.length-3;r<=s;r+=3){iq.fromArray(e,r);const s=a.x*Math.abs(iq.x)+a.y*Math.abs(iq.y)+a.z*Math.abs(iq.z),o=t.dot(iq),l=i.dot(iq),c=n.dot(iq);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}const aq=new xj,rq=new vj;let sq=0;class oq extends oj{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:sq++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=35044,this.updateRanges=[],this.gpuType=UU,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n<a;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)rq.fromBufferAttribute(this,t),rq.applyMatrix3(e),this.setXY(t,rq.x,rq.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.applyMatrix3(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.applyMatrix4(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.applyNormalMatrix(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.transformDirection(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=fj(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Aj(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=fj(t,this.array)),t}setX(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=fj(t,this.array)),t}setY(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=fj(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=fj(t,this.array)),t}setW(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Aj(t,this.array),i=Aj(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=Aj(t,this.array),i=Aj(i,this.array),n=Aj(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,a){return e*=this.itemSize,this.normalized&&(t=Aj(t,this.array),i=Aj(i,this.array),n=Aj(n,this.array),a=Aj(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class lq extends oq{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class cq extends oq{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class uq extends oq{constructor(e,t,i){super(new Float32Array(e),t,i)}}const hq=new qV,dq=new xj,pq=new xj;class mq{constructor(e=new xj,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;void 0!==t?i.copy(t):hq.setFromPoints(e).getCenter(i);let n=0;for(let t=0,a=e.length;t<a;t++)n=Math.max(n,i.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;dq.subVectors(e,this.center);const t=dq.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),i=.5*(e-this.radius);this.center.addScaledVector(dq,i/e),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(pq.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(dq.copy(e.center).add(pq)),this.expandByPoint(dq.copy(e.center).sub(pq))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let gq=0;const fq=new Hj,Aq=new _V,_q=new xj,vq=new qV,yq=new qV,xq=new xj;class bq extends oj{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:gq++}),this.uuid=dj(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(function(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}(e)?cq:lq)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const t=(new Ej).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return fq.makeRotationFromQuaternion(e),this.applyMatrix4(fq),this}rotateX(e){return fq.makeRotationX(e),this.applyMatrix4(fq),this}rotateY(e){return fq.makeRotationY(e),this.applyMatrix4(fq),this}rotateZ(e){return fq.makeRotationZ(e),this.applyMatrix4(fq),this}translate(e,t,i){return fq.makeTranslation(e,t,i),this.applyMatrix4(fq),this}scale(e,t,i){return fq.makeScale(e,t,i),this.applyMatrix4(fq),this}lookAt(e){return Aq.lookAt(e),Aq.updateMatrix(),this.applyMatrix4(Aq.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(_q).negate(),this.translate(_q.x,_q.y,_q.z),this}setFromPoints(e){const t=this.getAttribute("position");if(void 0===t){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];t.push(n.x,n.y,n.z||0)}this.setAttribute("position",new uq(t,3))}else{const i=Math.min(e.length,t.count);for(let n=0;n<i;n++){const i=e[n];t.setXYZ(n,i.x,i.y,i.z||0)}e.length>t.count&&nj("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new qV);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return aj("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new xj(-1/0,-1/0,-1/0),new xj(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const i=t[e];vq.setFromBufferAttribute(i),this.morphTargetsRelative?(xq.addVectors(this.boundingBox.min,vq.min),this.boundingBox.expandByPoint(xq),xq.addVectors(this.boundingBox.max,vq.max),this.boundingBox.expandByPoint(xq)):(this.boundingBox.expandByPoint(vq.min),this.boundingBox.expandByPoint(vq.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&aj('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new mq);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return aj("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new xj,1/0);if(e){const i=this.boundingSphere.center;if(vq.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const i=t[e];yq.setFromBufferAttribute(i),this.morphTargetsRelative?(xq.addVectors(vq.min,yq.min),vq.expandByPoint(xq),xq.addVectors(vq.max,yq.max),vq.expandByPoint(xq)):(vq.expandByPoint(yq.min),vq.expandByPoint(yq.max))}vq.getCenter(i);let n=0;for(let t=0,a=e.count;t<a;t++)xq.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(xq));if(t)for(let a=0,r=t.length;a<r;a++){const r=t[a],s=this.morphTargetsRelative;for(let t=0,a=r.count;t<a;t++)xq.fromBufferAttribute(r,t),s&&(_q.fromBufferAttribute(e,t),xq.add(_q)),n=Math.max(n,i.distanceToSquared(xq))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&aj('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void aj("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=t.position,n=t.normal,a=t.uv;let r=this.getAttribute("tangent");void 0!==r&&r.count===i.count||(r=new oq(new Float32Array(4*i.count),4),this.setAttribute("tangent",r));const s=[],o=[];for(let e=0;e<i.count;e++)s[e]=new xj,o[e]=new xj;const l=new xj,c=new xj,u=new xj,h=new vj,d=new vj,p=new vj,m=new xj,g=new xj;function f(e,t,n){l.fromBufferAttribute(i,e),c.fromBufferAttribute(i,t),u.fromBufferAttribute(i,n),h.fromBufferAttribute(a,e),d.fromBufferAttribute(a,t),p.fromBufferAttribute(a,n),c.sub(l),u.sub(l),d.sub(h),p.sub(h);const r=1/(d.x*p.y-p.x*d.y);isFinite(r)&&(m.copy(c).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(r),g.copy(u).multiplyScalar(d.x).addScaledVector(c,-p.x).multiplyScalar(r),s[e].add(m),s[t].add(m),s[n].add(m),o[e].add(g),o[t].add(g),o[n].add(g))}let A=this.groups;0===A.length&&(A=[{start:0,count:e.count}]);for(let t=0,i=A.length;t<i;++t){const i=A[t],n=i.start;for(let t=n,a=n+i.count;t<a;t+=3)f(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const _=new xj,v=new xj,y=new xj,x=new xj;function b(e){y.fromBufferAttribute(n,e),x.copy(y);const t=s[e];_.copy(t),_.sub(y.multiplyScalar(y.dot(t))).normalize(),v.crossVectors(x,t);const i=v.dot(o[e])<0?-1:1;r.setXYZW(e,_.x,_.y,_.z,i)}for(let t=0,i=A.length;t<i;++t){const i=A[t],n=i.start;for(let t=n,a=n+i.count;t<a;t+=3)b(e.getX(t+0)),b(e.getX(t+1)),b(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i||i.count!==t.count)i=new oq(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);const n=new xj,a=new xj,r=new xj,s=new xj,o=new xj,l=new xj,c=new xj,u=new xj;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),p=e.getX(h+1),m=e.getX(h+2);n.fromBufferAttribute(t,d),a.fromBufferAttribute(t,p),r.fromBufferAttribute(t,m),c.subVectors(r,a),u.subVectors(n,a),c.cross(u),s.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,m),s.add(c),o.add(c),l.add(c),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(m,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)n.fromBufferAttribute(t,e+0),a.fromBufferAttribute(t,e+1),r.fromBufferAttribute(t,e+2),c.subVectors(r,a),u.subVectors(n,a),c.cross(u),i.setXYZ(e+0,c.x,c.y,c.z),i.setXYZ(e+1,c.x,c.y,c.z),i.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)xq.fromBufferAttribute(e,t),xq.normalize(),e.setXYZ(t,xq.x,xq.y,xq.z)}toNonIndexed(){function e(e,t){const i=e.array,n=e.itemSize,a=e.normalized,r=new i.constructor(t.length*n);let s=0,o=0;for(let a=0,l=t.length;a<l;a++){s=e.isInterleavedBufferAttribute?t[a]*e.data.stride+e.offset:t[a]*n;for(let e=0;e<n;e++)r[o++]=i[s++]}return new oq(r,n,a)}if(null===this.index)return nj("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new bq,i=this.index.array,n=this.attributes;for(const a in n){const r=e(n[a],i);t.setAttribute(a,r)}const a=this.morphAttributes;for(const n in a){const r=[],s=a[n];for(let t=0,n=s.length;t<n;t++){const n=e(s[t],i);r.push(n)}t.morphAttributes[n]=r}t.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let e=0,i=r.length;e<i;e++){const i=r[e];t.addGroup(i.start,i.count,i.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){const t=this.parameters;for(const i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const t in i){const n=i[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let a=!1;for(const t in this.morphAttributes){const i=this.morphAttributes[t],r=[];for(let t=0,n=i.length;t<n;t++){const n=i[t];r.push(n.toJSON(e.data))}r.length>0&&(n[t]=r,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;null!==i&&this.setIndex(i.clone());const n=e.attributes;for(const e in n){const i=n[e];this.setAttribute(e,i.clone(t))}const a=e.morphAttributes;for(const e in a){const i=[],n=a[e];for(let e=0,a=n.length;e<a;e++)i.push(n[e].clone(t));this.morphAttributes[e]=i}this.morphTargetsRelative=e.morphTargetsRelative;const r=e.groups;for(let e=0,t=r.length;e<t;e++){const t=r[e];this.addGroup(t.start,t.count,t.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}let wq=0;class Eq extends oj{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:wq++}),this.uuid=dj(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=BO,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new SV(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=NN,this.stencilZFail=NN,this.stencilZPass=NN,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const i=e[t];if(void 0===i){nj(`Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector2&&i&&i.isVector2||n&&n.isEuler&&i&&i.isEuler||n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:nj(`Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),this.blendEquation!==BO&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==NN&&(i.stencilFail=this.stencilFail),this.stencilZFail!==NN&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==NN&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!1===this.allowOverride&&(i.allowOverride=!1),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){const t=n(e.textures),a=n(e.images);t.length>0&&(i.textures=t),a.length>0&&(i.images=a)}return i}fromJSON(e,t){if(void 0!==e.uuid&&(this.uuid=e.uuid),void 0!==e.name&&(this.name=e.name),void 0!==e.color&&void 0!==this.color&&this.color.setHex(e.color),void 0!==e.roughness&&(this.roughness=e.roughness),void 0!==e.metalness&&(this.metalness=e.metalness),void 0!==e.sheen&&(this.sheen=e.sheen),void 0!==e.sheenColor&&(this.sheenColor=(new SV).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(this.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==this.emissive&&this.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==this.specular&&this.specular.setHex(e.specular),void 0!==e.specularIntensity&&(this.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(this.shininess=e.shininess),void 0!==e.clearcoat&&(this.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(this.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(this.dispersion=e.dispersion),void 0!==e.iridescence&&(this.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(this.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(this.transmission=e.transmission),void 0!==e.thickness&&(this.thickness=e.thickness),void 0!==e.attenuationDistance&&(this.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(this.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(this.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(this.fog=e.fog),void 0!==e.flatShading&&(this.flatShading=e.flatShading),void 0!==e.blending&&(this.blending=e.blending),void 0!==e.combine&&(this.combine=e.combine),void 0!==e.side&&(this.side=e.side),void 0!==e.shadowSide&&(this.shadowSide=e.shadowSide),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.transparent&&(this.transparent=e.transparent),void 0!==e.alphaTest&&(this.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(this.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(this.depthFunc=e.depthFunc),void 0!==e.depthTest&&(this.depthTest=e.depthTest),void 0!==e.depthWrite&&(this.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(this.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(this.blendSrc=e.blendSrc),void 0!==e.blendDst&&(this.blendDst=e.blendDst),void 0!==e.blendEquation&&(this.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(this.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(this.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(this.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(this.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(this.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(this.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(this.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(this.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(this.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(this.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(this.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(this.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(this.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(this.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(this.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(this.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(this.rotation=e.rotation),void 0!==e.linewidth&&(this.linewidth=e.linewidth),void 0!==e.dashSize&&(this.dashSize=e.dashSize),void 0!==e.gapSize&&(this.gapSize=e.gapSize),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.polygonOffset&&(this.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(this.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(this.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(this.dithering=e.dithering),void 0!==e.alphaToCoverage&&(this.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(this.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(this.forceSinglePass=e.forceSinglePass),void 0!==e.allowOverride&&(this.allowOverride=e.allowOverride),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.toneMapped&&(this.toneMapped=e.toneMapped),void 0!==e.userData&&(this.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),void 0!==e.size&&(this.size=e.size),void 0!==e.sizeAttenuation&&(this.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(this.map=t[e.map]||null),void 0!==e.matcap&&(this.matcap=t[e.matcap]||null),void 0!==e.alphaMap&&(this.alphaMap=t[e.alphaMap]||null),void 0!==e.bumpMap&&(this.bumpMap=t[e.bumpMap]||null),void 0!==e.bumpScale&&(this.bumpScale=e.bumpScale),void 0!==e.normalMap&&(this.normalMap=t[e.normalMap]||null),void 0!==e.normalMapType&&(this.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),this.normalScale=(new vj).fromArray(t)}return void 0!==e.displacementMap&&(this.displacementMap=t[e.displacementMap]||null),void 0!==e.displacementScale&&(this.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(this.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(this.roughnessMap=t[e.roughnessMap]||null),void 0!==e.metalnessMap&&(this.metalnessMap=t[e.metalnessMap]||null),void 0!==e.emissiveMap&&(this.emissiveMap=t[e.emissiveMap]||null),void 0!==e.emissiveIntensity&&(this.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(this.specularMap=t[e.specularMap]||null),void 0!==e.specularIntensityMap&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),void 0!==e.specularColorMap&&(this.specularColorMap=t[e.specularColorMap]||null),void 0!==e.envMap&&(this.envMap=t[e.envMap]||null),void 0!==e.envMapRotation&&this.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(this.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(this.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(this.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(this.lightMap=t[e.lightMap]||null),void 0!==e.lightMapIntensity&&(this.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(this.aoMap=t[e.aoMap]||null),void 0!==e.aoMapIntensity&&(this.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(this.gradientMap=t[e.gradientMap]||null),void 0!==e.clearcoatMap&&(this.clearcoatMap=t[e.clearcoatMap]||null),void 0!==e.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),void 0!==e.clearcoatNormalMap&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),void 0!==e.clearcoatNormalScale&&(this.clearcoatNormalScale=(new vj).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(this.iridescenceMap=t[e.iridescenceMap]||null),void 0!==e.iridescenceThicknessMap&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),void 0!==e.transmissionMap&&(this.transmissionMap=t[e.transmissionMap]||null),void 0!==e.thicknessMap&&(this.thicknessMap=t[e.thicknessMap]||null),void 0!==e.anisotropyMap&&(this.anisotropyMap=t[e.anisotropyMap]||null),void 0!==e.sheenColorMap&&(this.sheenColorMap=t[e.sheenColorMap]||null),void 0!==e.sheenRoughnessMap&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(null!==t){const e=t.length;i=new Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}const kq=new xj,Sq=new xj,Mq=new xj,Cq=new xj,Tq=new xj,Dq=new xj,Pq=new xj;class Iq{constructor(e=new xj,t=new xj(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,kq)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=kq.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kq.copy(this.origin).addScaledVector(this.direction,t),kq.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Sq.copy(e).add(t).multiplyScalar(.5),Mq.copy(t).sub(e).normalize(),Cq.copy(this.origin).sub(Sq);const a=.5*e.distanceTo(t),r=-this.direction.dot(Mq),s=Cq.dot(this.direction),o=-Cq.dot(Mq),l=Cq.lengthSq(),c=Math.abs(1-r*r);let u,h,d,p;if(c>0)if(u=r*o-s,h=r*s-o,p=a*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+r*h+2*s)+h*(r*u+h+2*o)+l}else h=a,u=Math.max(0,-(r*h+s)),d=-u*u+h*(h+2*o)+l;else h=-a,u=Math.max(0,-(r*h+s)),d=-u*u+h*(h+2*o)+l;else h<=-p?(u=Math.max(0,-(-r*a+s)),h=u>0?-a:Math.min(Math.max(-a,-o),a),d=-u*u+h*(h+2*o)+l):h<=p?(u=0,h=Math.min(Math.max(-a,-o),a),d=h*(h+2*o)+l):(u=Math.max(0,-(r*a+s)),h=u>0?a:Math.min(Math.max(-a,-o),a),d=-u*u+h*(h+2*o)+l);else h=r>0?-a:a,u=Math.max(0,-(r*h+s)),d=-u*u+h*(h+2*o)+l;return i&&i.copy(this.origin).addScaledVector(this.direction,u),n&&n.copy(Sq).addScaledVector(Mq,h),d}intersectSphere(e,t){kq.subVectors(e.center,this.origin);const i=kq.dot(this.direction),n=kq.dot(kq)-i*i,a=e.radius*e.radius;if(n>a)return null;const r=Math.sqrt(a-n),s=i-r,o=i+r;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,r,s,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(i=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(i=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(a=(e.min.y-h.y)*c,r=(e.max.y-h.y)*c):(a=(e.max.y-h.y)*c,r=(e.min.y-h.y)*c),i>r||a>n?null:((a>i||isNaN(i))&&(i=a),(r<n||isNaN(n))&&(n=r),u>=0?(s=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),i>o||s>n?null:((s>i||i!=i)&&(i=s),(o<n||n!=n)&&(n=o),n<0?null:this.at(i>=0?i:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,kq)}intersectTriangle(e,t,i,n,a){Tq.subVectors(t,e),Dq.subVectors(i,e),Pq.crossVectors(Tq,Dq);let r,s=this.direction.dot(Pq);if(s>0){if(n)return null;r=1}else{if(!(s<0))return null;r=-1,s=-s}Cq.subVectors(this.origin,e);const o=r*this.direction.dot(Dq.crossVectors(Cq,Dq));if(o<0)return null;const l=r*this.direction.dot(Tq.cross(Cq));if(l<0)return null;if(o+l>s)return null;const c=-r*Cq.dot(Pq);return c<0?null:this.at(c/s,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Fq extends Eq{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new SV(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tV,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const zq=new Hj,Rq=new Iq,Lq=new mq,Bq=new xj,Oq=new xj,Uq=new xj,Nq=new xj,jq=new xj,Vq=new xj,qq=new xj,Gq=new xj;class Hq extends _V{constructor(e=new bq,t=new Fq){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){const t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const i=this.geometry,n=i.attributes.position,a=i.morphAttributes.position,r=i.morphTargetsRelative;t.fromBufferAttribute(n,e);const s=this.morphTargetInfluences;if(a&&s){Vq.set(0,0,0);for(let i=0,n=a.length;i<n;i++){const n=s[i],o=a[i];0!==n&&(jq.fromBufferAttribute(o,e),r?Vq.addScaledVector(jq,n):Vq.addScaledVector(jq.sub(t),n))}t.add(Vq)}return t}raycast(e,t){const i=this.geometry,n=this.material,a=this.matrixWorld;if(void 0!==n){if(null===i.boundingSphere&&i.computeBoundingSphere(),Lq.copy(i.boundingSphere),Lq.applyMatrix4(a),Rq.copy(e.ray).recast(e.near),!1===Lq.containsPoint(Rq.origin)){if(null===Rq.intersectSphere(Lq,Bq))return;if(Rq.origin.distanceToSquared(Bq)>(e.far-e.near)**2)return}zq.copy(a).invert(),Rq.copy(e.ray).applyMatrix4(zq),null!==i.boundingBox&&!1===Rq.intersectsBox(i.boundingBox)||this._computeIntersections(e,t,Rq)}}_computeIntersections(e,t,i){let n;const a=this.geometry,r=this.material,s=a.index,o=a.attributes.position,l=a.attributes.uv,c=a.attributes.uv1,u=a.attributes.normal,h=a.groups,d=a.drawRange;if(null!==s)if(Array.isArray(r))for(let a=0,o=h.length;a<o;a++){const o=h[a],p=r[o.materialIndex];for(let a=Math.max(o.start,d.start),r=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));a<r;a+=3){n=Wq(this,p,e,i,l,c,u,s.getX(a),s.getX(a+1),s.getX(a+2)),n&&(n.faceIndex=Math.floor(a/3),n.face.materialIndex=o.materialIndex,t.push(n))}}else{for(let a=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);a<o;a+=3){n=Wq(this,r,e,i,l,c,u,s.getX(a),s.getX(a+1),s.getX(a+2)),n&&(n.faceIndex=Math.floor(a/3),t.push(n))}}else if(void 0!==o)if(Array.isArray(r))for(let a=0,s=h.length;a<s;a++){const s=h[a],p=r[s.materialIndex];for(let a=Math.max(s.start,d.start),r=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));a<r;a+=3){n=Wq(this,p,e,i,l,c,u,a,a+1,a+2),n&&(n.faceIndex=Math.floor(a/3),n.face.materialIndex=s.materialIndex,t.push(n))}}else{for(let a=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);a<s;a+=3){n=Wq(this,r,e,i,l,c,u,a,a+1,a+2),n&&(n.faceIndex=Math.floor(a/3),t.push(n))}}}}function Wq(e,t,i,n,a,r,s,o,l,c){e.getVertexPosition(o,Oq),e.getVertexPosition(l,Uq),e.getVertexPosition(c,Nq);const u=function(e,t,i,n,a,r,s,o){let l;if(l=1===t.side?n.intersectTriangle(s,r,a,!0,o):n.intersectTriangle(a,r,s,0===t.side,o),null===l)return null;Gq.copy(o),Gq.applyMatrix4(e.matrixWorld);const c=i.ray.origin.distanceTo(Gq);return c<i.near||c>i.far?null:{distance:c,point:Gq.clone(),object:e}}(e,t,i,n,Oq,Uq,Nq,qq);if(u){const e=new xj;VV.getBarycoord(qq,Oq,Uq,Nq,e),a&&(u.uv=VV.getInterpolatedAttribute(a,o,l,c,e,new vj)),r&&(u.uv1=VV.getInterpolatedAttribute(r,o,l,c,e,new vj)),s&&(u.normal=VV.getInterpolatedAttribute(s,o,l,c,e,new xj),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const t={a:o,b:l,c:c,normal:new xj,materialIndex:0};VV.getNormal(Oq,Uq,Nq,t.normal),u.face=t,u.barycoord=e}return u}class Zq extends Uj{constructor(e=null,t=1,i=1,n,a,r,s,o,l=1003,c=1003,u,h){super(null,r,s,o,l,c,n,a,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Kq=new xj,Xq=new xj,Qq=new Ej;class Yq{constructor(e=new xj(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const n=Kq.subVectors(i,t).cross(Xq.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const n=e.delta(Kq),a=this.normal.dot(n);if(0===a)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/a;return!0===i&&(r<0||r>1)?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Qq.getNormalMatrix(e),n=this.coplanarPoint(Kq).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Jq=new mq,$q=new vj(.5,.5),eG=new xj;class tG{constructor(e=new Yq,t=new Yq,i=new Yq,n=new Yq,a=new Yq,r=new Yq){this.planes=[e,t,i,n,a,r]}set(e,t,i,n,a,r){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(r),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=2e3,i=!1){const n=this.planes,a=e.elements,r=a[0],s=a[1],o=a[2],l=a[3],c=a[4],u=a[5],h=a[6],d=a[7],p=a[8],m=a[9],g=a[10],f=a[11],A=a[12],_=a[13],v=a[14],y=a[15];if(n[0].setComponents(l-r,d-c,f-p,y-A).normalize(),n[1].setComponents(l+r,d+c,f+p,y+A).normalize(),n[2].setComponents(l+s,d+u,f+m,y+_).normalize(),n[3].setComponents(l-s,d-u,f-m,y-_).normalize(),i)n[4].setComponents(o,h,g,v).normalize(),n[5].setComponents(l-o,d-h,f-g,y-v).normalize();else if(n[4].setComponents(l-o,d-h,f-g,y-v).normalize(),t===QN)n[5].setComponents(l+o,d+h,f+g,y+v).normalize();else{if(t!==YN)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(o,h,g,v).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Jq.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Jq.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Jq)}intersectsSprite(e){Jq.center.set(0,0,0);const t=$q.distanceTo(e.center);return Jq.radius=.7071067811865476+t,Jq.applyMatrix4(e.matrixWorld),this.intersectsSphere(Jq)}intersectsSphere(e){const t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(i)<n)return!1}return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const n=t[i];if(eG.x=n.normal.x>0?e.max.x:e.min.x,eG.y=n.normal.y>0?e.max.y:e.min.y,eG.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(eG)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}class iG extends Eq{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new SV(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const nG=new xj,aG=new xj,rG=new Hj,sG=new Iq,oG=new mq,lG=new xj,cG=new xj;class uG extends _V{constructor(e=new bq,t=new iG){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,i=[0];for(let e=1,n=t.count;e<n;e++)nG.fromBufferAttribute(t,e-1),aG.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=nG.distanceTo(aG);e.setAttribute("lineDistance",new uq(i,1))}else nj("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,n=this.matrixWorld,a=e.params.Line.threshold,r=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),oG.copy(i.boundingSphere),oG.applyMatrix4(n),oG.radius+=a,!1===e.ray.intersectsSphere(oG))return;rG.copy(n).invert(),sG.copy(e.ray).applyMatrix4(rG);const s=a/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=this.isLineSegments?2:1,c=i.index,u=i.attributes.position;if(null!==c){const i=Math.max(0,r.start),n=Math.min(c.count,r.start+r.count);for(let a=i,r=n-1;a<r;a+=l){const i=c.getX(a),n=c.getX(a+1),r=hG(this,e,sG,o,i,n,a);r&&t.push(r)}if(this.isLineLoop){const a=c.getX(n-1),r=c.getX(i),s=hG(this,e,sG,o,a,r,n-1);s&&t.push(s)}}else{const i=Math.max(0,r.start),n=Math.min(u.count,r.start+r.count);for(let a=i,r=n-1;a<r;a+=l){const i=hG(this,e,sG,o,a,a+1,a);i&&t.push(i)}if(this.isLineLoop){const a=hG(this,e,sG,o,n-1,i,n-1);a&&t.push(a)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){const t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function hG(e,t,i,n,a,r,s){const o=e.geometry.attributes.position;nG.fromBufferAttribute(o,a),aG.fromBufferAttribute(o,r);if(i.distanceSqToSegment(nG,aG,lG,cG)>n)return;lG.applyMatrix4(e.matrixWorld);const l=t.ray.origin.distanceTo(lG);return l<t.near||l>t.far?void 0:{distance:l,point:cG.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}const dG=new xj,pG=new xj;class mG extends uG{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,i=[];for(let e=0,n=t.count;e<n;e+=2)dG.fromBufferAttribute(t,e),pG.fromBufferAttribute(t,e+1),i[e]=0===e?0:i[e-1],i[e+1]=i[e]+dG.distanceTo(pG);e.setAttribute("lineDistance",new uq(i,1))}else nj("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class gG extends Uj{constructor(e,t,i,n,a=1006,r=1006,s,o,l){super(e,t,i,n,a,r,s,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const c=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){c.needsUpdate=!0,c._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class fG extends Uj{constructor(e=[],t=301,i,n,a,r,s,o,l,c){super(e,t,i,n,a,r,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class AG extends Uj{constructor(e,t,i=1014,n,a,r,s=1003,o=1003,l,c=1026,u=1){if(c!==ZU&&c!==KU)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:u},n,a,r,s,o,c,i,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Rj(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class _G extends AG{constructor(e,t=1014,i=301,n,a,r=1003,s=1003,o,l=1026){const c={width:e,height:e,depth:1},u=[c,c,c,c,c,c];super(e,e,t,i,n,a,r,s,o,l),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class vG extends Uj{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class yG extends bq{constructor(e=1,t=1,i=1,n=1,a=1,r=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:r};const s=this;n=Math.floor(n),a=Math.floor(a),r=Math.floor(r);const o=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,i,n,a,r,p,m,g,f,A){const _=r/g,v=p/f,y=r/2,x=p/2,b=m/2,w=g+1,E=f+1;let k=0,S=0;const M=new xj;for(let r=0;r<E;r++){const s=r*v-x;for(let o=0;o<w;o++){const h=o*_-y;M[e]=h*n,M[t]=s*a,M[i]=b,l.push(M.x,M.y,M.z),M[e]=0,M[t]=0,M[i]=m>0?1:-1,c.push(M.x,M.y,M.z),u.push(o/g),u.push(1-r/f),k+=1}}for(let e=0;e<f;e++)for(let t=0;t<g;t++){const i=h+t+w*e,n=h+t+w*(e+1),a=h+(t+1)+w*(e+1),r=h+(t+1)+w*e;o.push(i,n,r),o.push(n,a,r),S+=6}s.addGroup(d,S,A),d+=S,h+=k}p("z","y","x",-1,-1,i,t,e,r,a,0),p("z","y","x",1,-1,i,t,-e,r,a,1),p("x","z","y",1,1,e,i,t,n,r,2),p("x","z","y",1,-1,e,i,-t,n,r,3),p("x","y","z",1,-1,e,t,i,n,a,4),p("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(o),this.setAttribute("position",new uq(l,3)),this.setAttribute("normal",new uq(c,3)),this.setAttribute("uv",new uq(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yG(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class xG extends bq{constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};const a=e/2,r=t/2,s=Math.floor(i),o=Math.floor(n),l=s+1,c=o+1,u=e/s,h=t/o,d=[],p=[],m=[],g=[];for(let e=0;e<c;e++){const t=e*h-r;for(let i=0;i<l;i++){const n=i*u-a;p.push(n,-t,0),m.push(0,0,1),g.push(i/s),g.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<s;t++){const i=t+l*e,n=t+l*(e+1),a=t+1+l*(e+1),r=t+1+l*e;d.push(i,n,r),d.push(n,a,r)}this.setIndex(d),this.setAttribute("position",new uq(p,3)),this.setAttribute("normal",new uq(m,3)),this.setAttribute("uv",new uq(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xG(e.width,e.height,e.widthSegments,e.heightSegments)}}class bG extends bq{constructor(e=1,t=32,i=16,n=0,a=2*Math.PI,r=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:a,thetaStart:r,thetaLength:s},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const o=Math.min(r+s,Math.PI);let l=0;const c=[],u=new xj,h=new xj,d=[],p=[],m=[],g=[];for(let d=0;d<=i;d++){const f=[],A=d/i,_=r+A*s,v=e*Math.cos(_),y=Math.sqrt(e*e-v*v);let x=0;0===d&&0===r?x=.5/t:d===i&&o===Math.PI&&(x=-.5/t);for(let e=0;e<=t;e++){const i=e/t,r=n+i*a;u.x=-y*Math.cos(r),u.y=v,u.z=y*Math.sin(r),p.push(u.x,u.y,u.z),h.copy(u).normalize(),m.push(h.x,h.y,h.z),g.push(i+x,1-A),f.push(l++)}c.push(f)}for(let e=0;e<i;e++)for(let n=0;n<t;n++){const t=c[e][n+1],a=c[e][n],s=c[e+1][n],l=c[e+1][n+1];(0!==e||r>0)&&d.push(t,a,l),(e!==i-1||o<Math.PI)&&d.push(a,s,l)}this.setIndex(d),this.setAttribute("position",new uq(p,3)),this.setAttribute("normal",new uq(m,3)),this.setAttribute("uv",new uq(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new bG(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class wG extends bq{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],i=new Set,n=new xj,a=new xj;if(null!==e.index){const r=e.attributes.position,s=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:s.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],c=l.start;for(let e=c,o=c+l.count;e<o;e+=3)for(let o=0;o<3;o++){const l=s.getX(e+o),c=s.getX(e+(o+1)%3);n.fromBufferAttribute(r,l),a.fromBufferAttribute(r,c),!0===EG(n,a,i)&&(t.push(n.x,n.y,n.z),t.push(a.x,a.y,a.z))}}}else{const r=e.attributes.position;for(let e=0,s=r.count/3;e<s;e++)for(let s=0;s<3;s++){const o=3*e+s,l=3*e+(s+1)%3;n.fromBufferAttribute(r,o),a.fromBufferAttribute(r,l),!0===EG(n,a,i)&&(t.push(n.x,n.y,n.z),t.push(a.x,a.y,a.z))}}this.setAttribute("position",new uq(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function EG(e,t,i){const n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,a=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==i.has(n)&&!0!==i.has(a)&&(i.add(n),i.add(a),!0)}function kG(e){const t={};for(const i in e){t[i]={};for(const n in e[i]){const a=e[i][n];if(MG(a))a.isRenderTargetTexture?(nj("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][n]=null):t[i][n]=a.clone();else if(Array.isArray(a))if(MG(a[0])){const e=[];for(let t=0,i=a.length;t<i;t++)e[t]=a[t].clone();t[i][n]=e}else t[i][n]=a.slice();else t[i][n]=a}}return t}function SG(e){const t={};for(let i=0;i<e.length;i++){const n=kG(e[i]);for(const e in n)t[e]=n[e]}return t}function MG(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function CG(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:Tj.workingColorSpace}const TG={clone:kG,merge:SG};class DG extends Eq{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=kG(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}fromJSON(e,t){if(super.fromJSON(e,t),void 0!==e.uniforms)for(const i in e.uniforms){const n=e.uniforms[i];switch(this.uniforms[i]={},n.type){case"t":this.uniforms[i].value=t[n.value]||null;break;case"c":this.uniforms[i].value=(new SV).setHex(n.value);break;case"v2":this.uniforms[i].value=(new vj).fromArray(n.value);break;case"v3":this.uniforms[i].value=(new xj).fromArray(n.value);break;case"v4":this.uniforms[i].value=(new Nj).fromArray(n.value);break;case"m3":this.uniforms[i].value=(new Ej).fromArray(n.value);break;case"m4":this.uniforms[i].value=(new Hj).fromArray(n.value);break;default:this.uniforms[i].value=n.value}}if(void 0!==e.defines&&(this.defines=e.defines),void 0!==e.vertexShader&&(this.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(this.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(this.glslVersion=e.glslVersion),void 0!==e.extensions)for(const t in e.extensions)this.extensions[t]=e.extensions[t];return void 0!==e.lights&&(this.lights=e.lights),void 0!==e.clipping&&(this.clipping=e.clipping),this}}class PG extends DG{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class IG extends Eq{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class FG extends Eq{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const zG={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(RG(e)||(this.files[e]=t))},get:function(e){if(!1!==this.enabled&&!RG(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function RG(e){try{const t=e.slice(e.indexOf(":")+1);return"blob:"===new URL(t).protocol}catch(e){return!1}}class LG{constructor(e,t,i){const n=this;let a,r=!1,s=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this._abortController=null,this.itemStart=function(e){o++,!1===r&&void 0!==n.onStart&&n.onStart(e,s,o),r=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,o),s===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return e=e.normalize("NFC"),a?a(e):e},this.setURLModifier=function(e){return a=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,i=l.length;t<i;t+=2){const i=l[t],n=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return n}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const BG=new LG;let OG=class{constructor(e){this.manager=void 0!==e?e:BG,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const i=this;return new Promise(function(n,a){i.load(e,n,t,a)})}parse(){}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}abort(){return this}};OG.DEFAULT_MATERIAL_NAME="__DEFAULT";const UG={};class NG extends Error{constructor(e,t){super(e),this.response=t}}class jG extends OG{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const a=zG.get(`file:${e}`);if(void 0!==a)return this.manager.itemStart(e),void setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0);if(void 0!==UG[e])return void UG[e].push({onLoad:t,onProgress:i,onError:n});UG[e]=[],UG[e].push({onLoad:t,onProgress:i,onError:n});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,o=this.responseType;fetch(r).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&nj("FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const i=UG[e],n=t.body.getReader(),a=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),r=a?parseInt(a):0,s=0!==r;let o=0;const l=new ReadableStream({start(e){!function t(){n.read().then(({done:n,value:a})=>{if(n)e.close();else{o+=a.byteLength;const n=new ProgressEvent("progress",{lengthComputable:s,loaded:o,total:r});for(let e=0,t=i.length;e<t;e++){const t=i[e];t.onProgress&&t.onProgress(n)}e.enqueue(a),t()}},t=>{e.error(t)})}()}});return new Response(l)}throw new NG(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>(new DOMParser).parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(s),i=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(i);return e.arrayBuffer().then(e=>n.decode(e))}}}).then(t=>{zG.add(`file:${e}`,t);const i=UG[e];delete UG[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];n.onLoad&&n.onLoad(t)}}).catch(t=>{const i=UG[e];if(void 0===i)throw this.manager.itemError(e),t;delete UG[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];n.onError&&n.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const VG=new WeakMap;class qG extends OG{constructor(e){super(e)}load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,r=zG.get(`image:${e}`);if(void 0!==r){if(!0===r.complete)a.manager.itemStart(e),setTimeout(function(){t&&t(r),a.manager.itemEnd(e)},0);else{let e=VG.get(r);void 0===e&&(e=[],VG.set(r,e)),e.push({onLoad:t,onError:n})}return r}const s=JN("img");function o(){c(),t&&t(this);const i=VG.get(this)||[];for(let e=0;e<i.length;e++){const t=i[e];t.onLoad&&t.onLoad(this)}VG.delete(this),a.manager.itemEnd(e)}function l(t){c(),n&&n(t),zG.remove(`image:${e}`);const i=VG.get(this)||[];for(let e=0;e<i.length;e++){const n=i[e];n.onError&&n.onError(t)}VG.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),zG.add(`image:${e}`,s),a.manager.itemStart(e),s.src=e,s}}const GG=new xj,HG=new yj,WG=new xj;class ZG extends _V{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Hj,this.projectionMatrix=new Hj,this.projectionMatrixInverse=new Hj,this.coordinateSystem=QN,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(GG,HG,WG),1===WG.x&&1===WG.y&&1===WG.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(GG,HG,WG.set(1,1,1)).invert()}updateWorldMatrix(e,t,i=!1){super.updateWorldMatrix(e,t,i),this.matrixWorld.decompose(GG,HG,WG),1===WG.x&&1===WG.y&&1===WG.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(GG,HG,WG.set(1,1,1)).invert()}clone(){return(new this.constructor).copy(this)}}const KG=new xj,XG=new vj,QG=new vj;class YG extends ZG{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*hj*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*uj*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*hj*Math.atan(Math.tan(.5*uj*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){KG.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(KG.x,KG.y).multiplyScalar(-e/KG.z),KG.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(KG.x,KG.y).multiplyScalar(-e/KG.z)}getViewSize(e,t){return this.getViewBounds(e,XG,QG),t.subVectors(QG,XG)}setViewOffset(e,t,i,n,a,r){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*uj*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n;const r=this.view;if(null!==this.view&&this.view.enabled){const e=r.fullWidth,s=r.fullHeight;a+=r.offsetX*n/e,t-=r.offsetY*i/s,n*=r.width/e,i*=r.height/s}const s=this.filmOffset;0!==s&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class JG extends ZG{constructor(e=-1,t=1,i=1,n=-1,a=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,a,r){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let a=i-e,r=i+e,s=n+t,o=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=e*this.view.offsetX,r=a+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(a,r,s,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const $G=-90;class eH extends _V{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const n=new YG($G,1,e,t);n.layers=this.layers,this.add(n);const a=new YG($G,1,e,t);a.layers=this.layers,this.add(a);const r=new YG($G,1,e,t);r.layers=this.layers,this.add(r);const s=new YG($G,1,e,t);s.layers=this.layers,this.add(s);const o=new YG($G,1,e,t);o.layers=this.layers,this.add(o);const l=new YG($G,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,n,a,r,s,o]=t;for(const e of t)this.remove(e);if(e===QN)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),r.up.set(0,0,1),r.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(e!==YN)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),r.up.set(0,0,-1),r.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,r,s,o,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let g=!1;g=!0===e.isWebGLRenderer?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(i,0,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,a),e.setRenderTarget(i,1,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,r),e.setRenderTarget(i,2,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,s),e.setRenderTarget(i,3,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,o),e.setRenderTarget(i,4,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,l),i.texture.generateMipmaps=m,e.setRenderTarget(i,5,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class tH extends YG{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const iH=new Hj;class nH{constructor(e,t,i=0,n=1/0){this.ray=new Iq(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new iV,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,t.projectionMatrix.elements[14]).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):aj("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return iH.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(iH),this}intersectObject(e,t=!0,i=[]){return rH(e,this,i,t),i.sort(aH),i}intersectObjects(e,t=!0,i=[]){for(let n=0,a=e.length;n<a;n++)rH(e[n],this,i,t);return i.sort(aH),i}}function aH(e,t){return e.distance-t.distance}function rH(e,t,i,n){let a=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,i)&&(a=!1)}if(!0===a&&!0===n){const n=e.children;for(let e=0,a=n.length;e<a;e++)rH(n[e],t,i,!0)}}class sH{static{sH.prototype.isMatrix2=!0}constructor(e,t,i,n){this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,i,n)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,n){const a=this.elements;return a[0]=e,a[2]=t,a[1]=i,a[3]=n,this}}function oH(e,t,i,n){const a=function(e){switch(e){case FU:case zU:return{byteLength:1,components:1};case LU:case RU:case NU:return{byteLength:2,components:1};case jU:case VU:return{byteLength:2,components:4};case OU:case BU:case UU:return{byteLength:4,components:1};case GU:case HU:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${e}.`)}(n);switch(i){case 1021:return e*t;case 1028:case XU:return e*t/a.components*a.byteLength;case QU:case YU:return e*t*2/a.components*a.byteLength;case 1022:return e*t*3/a.components*a.byteLength;case WU:case JU:return e*t*4/a.components*a.byteLength;case $U:case eN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case tN:case iN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case aN:case sN:return Math.max(e,16)*Math.max(t,8)/4;case nN:case rN:return Math.max(e,8)*Math.max(t,8)/2;case oN:case lN:case uN:case hN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case cN:case dN:case pN:case mN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case gN:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case fN:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case AN:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case _N:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case vN:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case yN:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case xN:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case bN:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case wN:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case EN:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case kN:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case SN:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case MN:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case CN:case TN:case DN:return Math.ceil(e/4)*Math.ceil(t/4)*16;case PN:case IN:return Math.ceil(e/4)*Math.ceil(t/4)*8;case FN:case zN:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}
|
|
40
|
+
*/(nt(t.pitch)),s=50*r,o=EO*r;this._cursor.style.top=e.layerY-3*s/5+"px",this._cursor.style.left=e.layerX-o/2+"px",this._cursor.style.height=`${s}px`,this._cursor.style.width=`${o}px`,this._cursor.style.display="block",clearTimeout(this._throttledBestPicMap),this._throttledBestPicMap=setTimeout(()=>{const e=(nt(t.yaw)+this.psv.getPictureOriginalHeading())%360,r=DO(n.gps,a,e),s=this._getMapNearbyPictures(r);if(s?.length>0){const e=(nt(t.yaw)+this.psv.getPictureOriginalHeading())%360,r=DO(n.gps,a,e),o=this._bestPicAround(n,r,e,s);o?(this._cursor.src=bO,this._mapPreviewPic=o,i._picMarkerPreview.setLngLat(o.geometry.coordinates).setRotation(360===o.properties?.["pers:interior_orientation"]?.field_of_view?this.psv.getXYZ().x||0:o.properties?.["view:azimuth"]||0).addTo(i)):(this._cursor.src=wO,i._picMarkerPreview?.remove(),this._mapPreviewPic=null)}else this._cursor.src=bO,this._mapPreviewPic=null,i&&(this._isMapShowingPictures()||0===this._getMapNearbySequences(r).length)?(this._cursor.src=wO,i?._picMarkerPreview?.remove()):(this._cursor.src=bO,i?._picMarkerPreview.setLngLat(r).setRotation(e).addTo(i))},10)}}else this.isDesktop&&(this._cursor.style.display="none",this._mapPreviewPic=null,this._hideCursor||i?._picMarkerPreview?.remove())}_onPointerLeave(){this.isDesktop&&(this._cursor.style.display="none"),this._couldGoSomewhere=!1}_onHoverOtherStuff(){this._hideCursor=!0,this._onPointerLeave()}_onLeaveOtherStuff(){this._hideCursor=!1}_onPSVPicNavChanged(e){if("pic"===e?.detail?.value)this._onHoverOtherStuff();else this._onLeaveOtherStuff()}_pitchDegToProjectedDistance(e,t){return t?this.isDesktop?e>=30?0:e>=-2.5?kO:e>=-6?25:e>=-15?12.5:e>=SO?6.25:0:e>=20?0:e>=4?kO/3:e>=-4?kO/1.5:e>=-20?kO/3:0:kO/3}_isMapShowingPictures(){if(this.psv._parent.map){const e=this.psv._parent.map;let t=e.getLayersOrder().find(e=>e.endsWith("pictures"));if(t){return e.queryRenderedFeatures({layers:[t]}).length>0}}return!1}_getMapNearbyPictures(e){const t=this.psv._parent.map;if(t){const i=this.psv._parent?.mapStyleComposer;if(i){const n=Object.keys(i.layerRanges.panoramax[i.panoramax].sources)[0];if(n)return t.querySourceFeatures(n,{sourceLayer:"pictures",filter:["within",{type:"Polygon",coordinates:[[[e[0]-MO,e[1]-MO],[e[0]+MO,e[1]-MO],[e[0]+MO,e[1]+MO],[e[0]-MO,e[1]+MO],[e[0]-MO,e[1]-MO]]]}]}).map(e=>({id:e.properties.id,collection:e.properties.first_sequence||e.properties?.sequences?.[0],geometry:e.geometry,properties:{datetime:e.properties.datetime||e.properties.ts,"view:azimuth":e.properties?.["view:azimuth"]||e.properties.heading,"pers:interior_orientation":e.properties?.["pers:interior_orientation"]||{field_of_view:"equirectangular"===e.properties.type?360:void 0}}}))}}return null}_getMapNearbySequences(e){const t=this.psv._parent.map;if(t){const i=t.getLayersOrder().find(e=>e.endsWith("sequences"));if(i){const n=25e-6,a=[t.project([e[0]-n,e[1]-n]),t.project([e[0]+n,e[1]+n])];return t.queryRenderedFeatures(a,{layers:[i]})}}return[]}_bestPicAround(e,t,i,n){if(!Array.isArray(n)||!n.length)return null;const a=new Date(e.properties?.datetime),r=n.filter(t=>t.id!==e.id).map(n=>{const r=360===n.properties?.["pers:interior_orientation"]?.field_of_view,s=Oe(t,n.geometry.coordinates),o=n.collection===e.sequence?.id||"any"===this.psv.getPicturesNavigation(),l=n.properties?.["view:azimuth"],c=r||"number"==typeof l&&qe(i,l)<=45,u=Math.abs((i-Ve(e.gps,n.geometry.coordinates))%360)<=45,h=new Date(n.properties?.datetime),d=a.toDateString()===h.toDateString(),p=Math.abs((a-h)/864e5);let m=!0;if(this.psv._parent.map){const e=this.psv._parent.map;e.indoorEqual&&e.indoorEqual.level!==Ic&&(m=e._indoorFeaturesIDs.pictures[e.indoorEqual.level]?.has(n.id),m||"0"!==e.indoorEqual.level||(m=!0,Object.entries(e._indoorFeaturesIDs.pictures).forEach(([e,t])=>{m&&"0"!==e&&(m=!t.has(n.id))})))}let g=1/0;return o&&u&&m&&(d&&r?g=1:r&&p<=30?g=2:c&&p<=30?g=3:r?g=4:c&&(g=5)),{p:n,category:g,dist:s,daysDiff:p,headingMatch:c,sameDay:d,is360:r}});if(!r.length)return null;r.sort((e,t)=>e.category!==t.category?e.category-t.category:e.dist!==t.dist?e.dist-t.dist:e.daysDiff!==t.daysDiff?e.daysDiff-t.daysDiff:0);const s=r[0];return s.category<1/0?s.p:null}}function TO(e){return 360===e.properties?.["pers:interior_orientation"]?.field_of_view||void 0!==e?.properties?.["pers:roll"]||void 0!==e?.properties?.["pers:pitch"]}function DO(e,t,i){const[n,a]=e,r=at(a),s=at(n),o=at(i),l=t/6378137,c=Math.sin(r),u=Math.cos(r),h=Math.sin(l),d=Math.cos(l),p=Math.sin(o),m=c*d+u*h*Math.cos(o),g=Math.asin(m),f=p*h*u,A=d-c*m;return[nt(s+Math.atan2(f,A)),nt(g)]}const PO="185",IO=1,FO=3,zO=0,RO=1,LO=2,BO=100,OO=101,UO=102,NO=200,jO=201,VO=202,qO=203,GO=204,HO=205,WO=206,ZO=207,KO=208,XO=209,QO=210,YO=211,JO=212,$O=213,eU=214,tU=0,iU=1,nU=2,aU=3,rU=4,sU=5,oU=6,lU=7,cU=0,uU=1,hU=2,dU=1,pU=2,mU=3,gU=4,fU=5,AU=6,_U=7,vU=301,yU=302,xU=303,bU=304,wU=306,EU=1e3,kU=1001,SU=1002,MU=1003,CU=1004,TU=1005,DU=1006,PU=1007,IU=1008,FU=1009,zU=1010,RU=1011,LU=1012,BU=1013,OU=1014,UU=1015,NU=1016,jU=1017,VU=1018,qU=1020,GU=35902,HU=35899,WU=1023,ZU=1026,KU=1027,XU=1029,QU=1030,YU=1031,JU=1033,$U=33776,eN=33777,tN=33778,iN=33779,nN=35840,aN=35841,rN=35842,sN=35843,oN=36196,lN=37492,cN=37496,uN=37488,hN=37489,dN=37490,pN=37491,mN=37808,gN=37809,fN=37810,AN=37811,_N=37812,vN=37813,yN=37814,xN=37815,bN=37816,wN=37817,EN=37818,kN=37819,SN=37820,MN=37821,CN=36492,TN=36494,DN=36495,PN=36283,IN=36284,FN=36285,zN=36286,RN="",LN="srgb",BN="srgb-linear",ON="linear",UN="srgb",NN=7680,jN=512,VN=513,qN=514,GN=515,HN=516,WN=517,ZN=518,KN=519,XN="300 es",QN=2e3,YN=2001;function JN(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function $N(){const e=JN("canvas");return e.style.display="block",e}const ej={};function tj(...e){const t="THREE."+e.shift();console.log(t,...e)}function ij(e){const t=e[0];if("string"==typeof t&&t.startsWith("TSL:")){const t=e[1];t&&t.isStackTrace?e[0]+=" "+t.getLocation():e[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return e}function nj(...e){const t="THREE."+(e=ij(e)).shift();{const i=e[0];i&&i.isStackTrace?console.warn(i.getError(t)):console.warn(t,...e)}}function aj(...e){const t="THREE."+(e=ij(e)).shift();{const i=e[0];i&&i.isStackTrace?console.error(i.getError(t)):console.error(t,...e)}}function rj(...e){const t=e.join(" ");t in ej||(ej[t]=!0,nj(...e))}const sj={[tU]:1,[nU]:6,[rU]:7,[aU]:5,[iU]:0,[oU]:2,[lU]:4,[sU]:3};class oj{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return void 0!==i&&(void 0!==i[e]&&-1!==i[e].indexOf(t))}removeEventListener(e,t){const i=this._listeners;if(void 0===i)return;const n=i[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){const t=this._listeners;if(void 0===t)return;const i=t[e.type];if(void 0!==i){e.target=this;const t=i.slice(0);for(let i=0,n=t.length;i<n;i++)t[i].call(this,e);e.target=null}}}const lj=["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"];let cj=1234567;const uj=Math.PI/180,hj=180/Math.PI;function dj(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(lj[255&e]+lj[e>>8&255]+lj[e>>16&255]+lj[e>>24&255]+"-"+lj[255&t]+lj[t>>8&255]+"-"+lj[t>>16&15|64]+lj[t>>24&255]+"-"+lj[63&i|128]+lj[i>>8&255]+"-"+lj[i>>16&255]+lj[i>>24&255]+lj[255&n]+lj[n>>8&255]+lj[n>>16&255]+lj[n>>24&255]).toLowerCase()}function pj(e,t,i){return Math.max(t,Math.min(i,e))}function mj(e,t){return(e%t+t)%t}function gj(e,t,i){return(1-i)*e+i*t}function fj(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("THREE.MathUtils: Invalid component type.")}}function Aj(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("THREE.MathUtils: Invalid component type.")}}const _j={DEG2RAD:uj,RAD2DEG:hj,generateUUID:dj,clamp:pj,euclideanModulo:mj,mapLinear:function(e,t,i,n,a){return n+(e-t)*(a-n)/(i-t)},inverseLerp:function(e,t,i){return e!==t?(i-e)/(t-e):0},lerp:gj,damp:function(e,t,i,n){return gj(e,t,1-Math.exp(-i*n))},pingpong:function(e,t=1){return t-Math.abs(mj(e,2*t)-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(cj=e);let t=cj+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*uj},radToDeg:function(e){return e*hj},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,i,n,a){const r=Math.cos,s=Math.sin,o=r(i/2),l=s(i/2),c=r((t+n)/2),u=s((t+n)/2),h=r((t-n)/2),d=s((t-n)/2),p=r((n-t)/2),m=s((n-t)/2);switch(a){case"XYX":e.set(o*u,l*h,l*d,o*c);break;case"YZY":e.set(l*d,o*u,l*h,o*c);break;case"ZXZ":e.set(l*h,l*d,o*u,o*c);break;case"XZX":e.set(o*u,l*m,l*p,o*c);break;case"YXY":e.set(l*p,o*u,l*m,o*c);break;case"ZYZ":e.set(l*m,l*p,o*u,o*c);break;default:nj("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}},normalize:Aj,denormalize:fj};class vj{static{vj.prototype.isVector2=!0}constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,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}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=pj(this.x,e.x,t.x),this.y=pj(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=pj(this.x,e,t),this.y=pj(this.y,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pj(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pj(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y;return t*t+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const i=Math.cos(t),n=Math.sin(t),a=this.x-e.x,r=this.y-e.y;return this.x=a*i-r*n+e.x,this.y=a*n+r*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class yj{constructor(e=0,t=0,i=0,n=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=i,this._w=n}static slerpFlat(e,t,i,n,a,r,s){let o=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],h=a[r+0],d=a[r+1],p=a[r+2],m=a[r+3];if(u!==m||o!==h||l!==d||c!==p){let e=o*h+l*d+c*p+u*m;e<0&&(h=-h,d=-d,p=-p,m=-m,e=-e);let t=1-s;if(e<.9995){const i=Math.acos(e),n=Math.sin(i);t=Math.sin(t*i)/n,o=o*t+h*(s=Math.sin(s*i)/n),l=l*t+d*s,c=c*t+p*s,u=u*t+m*s}else{o=o*t+h*s,l=l*t+d*s,c=c*t+p*s,u=u*t+m*s;const e=1/Math.sqrt(o*o+l*l+c*c+u*u);o*=e,l*=e,c*=e,u*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,i,n,a,r){const s=i[n],o=i[n+1],l=i[n+2],c=i[n+3],u=a[r],h=a[r+1],d=a[r+2],p=a[r+3];return e[t]=s*p+c*u+o*d-l*h,e[t+1]=o*p+c*h+l*u-s*d,e[t+2]=l*p+c*d+s*h-o*u,e[t+3]=c*p-s*u-o*h-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const i=e._x,n=e._y,a=e._z,r=e._order,s=Math.cos,o=Math.sin,l=s(i/2),c=s(n/2),u=s(a/2),h=o(i/2),d=o(n/2),p=o(a/2);switch(r){case"XYZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"YXZ":this._x=h*c*u+l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"ZXY":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u-h*d*p;break;case"ZYX":this._x=h*c*u-l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u+h*d*p;break;case"YZX":this._x=h*c*u+l*d*p,this._y=l*d*u+h*c*p,this._z=l*c*p-h*d*u,this._w=l*c*u-h*d*p;break;case"XZY":this._x=h*c*u-l*d*p,this._y=l*d*u-h*c*p,this._z=l*c*p+h*d*u,this._w=l*c*u+h*d*p;break;default:nj("Quaternion: .setFromEuler() encountered an unknown order: "+r)}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,i=t[0],n=t[4],a=t[8],r=t[1],s=t[5],o=t[9],l=t[2],c=t[6],u=t[10],h=i+s+u;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(c-o)*e,this._y=(a-l)*e,this._z=(r-n)*e}else if(i>s&&i>u){const e=2*Math.sqrt(1+i-s-u);this._w=(c-o)/e,this._x=.25*e,this._y=(n+r)/e,this._z=(a+l)/e}else if(s>u){const e=2*Math.sqrt(1+s-i-u);this._w=(a-l)/e,this._x=(n+r)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+u-i-s);this._w=(r-n)/e,this._x=(a+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let i=e.dot(t)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(pj(this.dot(e),-1,1)))}rotateTowards(e,t){const i=this.angleTo(e);if(0===i)return this;const n=Math.min(1,t/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const i=e._x,n=e._y,a=e._z,r=e._w,s=t._x,o=t._y,l=t._z,c=t._w;return this._x=i*c+r*s+n*l-a*o,this._y=n*c+r*o+a*s-i*l,this._z=a*c+r*l+i*o-n*s,this._w=r*c-i*s-n*o-a*l,this._onChangeCallback(),this}slerp(e,t){let i=e._x,n=e._y,a=e._z,r=e._w,s=this.dot(e);s<0&&(i=-i,n=-n,a=-a,r=-r,s=-s);let o=1-t;if(s<.9995){const e=Math.acos(s),l=Math.sin(e);o=Math.sin(o*e)/l,t=Math.sin(t*e)/l,this._x=this._x*o+i*t,this._y=this._y*o+n*t,this._z=this._z*o+a*t,this._w=this._w*o+r*t,this._onChangeCallback()}else this._x=this._x*o+i*t,this._y=this._y*o+n*t,this._z=this._z*o+a*t,this._w=this._w*o+r*t,this.normalize();return this}slerpQuaternions(e,t,i){return this.copy(e).slerp(t,i)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),a=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class xj{static{xj.prototype.isVector3=!0}constructor(e=0,t=0,i=0){this.x=e,this.y=t,this.z=i}set(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,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("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(wj.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(wj.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[3]*i+a[6]*n,this.y=a[1]*t+a[4]*i+a[7]*n,this.z=a[2]*t+a[5]*i+a[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,a=e.elements,r=1/(a[3]*t+a[7]*i+a[11]*n+a[15]);return this.x=(a[0]*t+a[4]*i+a[8]*n+a[12])*r,this.y=(a[1]*t+a[5]*i+a[9]*n+a[13])*r,this.z=(a[2]*t+a[6]*i+a[10]*n+a[14])*r,this}applyQuaternion(e){const t=this.x,i=this.y,n=this.z,a=e.x,r=e.y,s=e.z,o=e.w,l=2*(r*n-s*i),c=2*(s*t-a*n),u=2*(a*i-r*t);return this.x=t+o*l+r*u-s*c,this.y=i+o*c+s*l-a*u,this.z=n+o*u+a*c-r*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,i=this.y,n=this.z,a=e.elements;return this.x=a[0]*t+a[4]*i+a[8]*n,this.y=a[1]*t+a[5]*i+a[9]*n,this.z=a[2]*t+a[6]*i+a[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=pj(this.x,e.x,t.x),this.y=pj(this.y,e.y,t.y),this.z=pj(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=pj(this.x,e,t),this.y=pj(this.y,e,t),this.z=pj(this.z,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pj(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const i=e.x,n=e.y,a=e.z,r=t.x,s=t.y,o=t.z;return this.x=n*o-a*s,this.y=a*r-i*o,this.z=i*s-n*r,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return bj.copy(this).projectOnVector(e),this.sub(bj)}reflect(e){return this.sub(bj.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const i=this.dot(e)/t;return Math.acos(pj(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,i){const n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const bj=new xj,wj=new yj;class Ej{static{Ej.prototype.isMatrix3=!0}constructor(e,t,i,n,a,r,s,o,l){this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,i,n,a,r,s,o,l)}set(e,t,i,n,a,r,s,o,l){const c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=a,c[5]=o,c[6]=i,c[7]=r,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}extractBasis(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,a=this.elements,r=i[0],s=i[3],o=i[6],l=i[1],c=i[4],u=i[7],h=i[2],d=i[5],p=i[8],m=n[0],g=n[3],f=n[6],A=n[1],_=n[4],v=n[7],y=n[2],x=n[5],b=n[8];return a[0]=r*m+s*A+o*y,a[3]=r*g+s*_+o*x,a[6]=r*f+s*v+o*b,a[1]=l*m+c*A+u*y,a[4]=l*g+c*_+u*x,a[7]=l*f+c*v+u*b,a[2]=h*m+d*A+p*y,a[5]=h*g+d*_+p*x,a[8]=h*f+d*v+p*b,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}determinant(){const e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],r=e[4],s=e[5],o=e[6],l=e[7],c=e[8];return t*r*c-t*s*l-i*a*c+i*s*o+n*a*l-n*r*o}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],r=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=c*r-s*l,h=s*o-c*a,d=l*a-r*o,p=t*u+i*h+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=u*m,e[1]=(n*l-c*i)*m,e[2]=(s*i-n*r)*m,e[3]=h*m,e[4]=(c*t-n*o)*m,e[5]=(n*a-s*t)*m,e[6]=d*m,e[7]=(i*o-l*t)*m,e[8]=(r*t-i*a)*m,this}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}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}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}setUvTransform(e,t,i,n,a,r,s){const o=Math.cos(a),l=Math.sin(a);return this.set(i*o,i*l,-i*(o*r+l*s)+r+e,-n*l,n*o,-n*(-l*r+o*s)+s+t,0,0,1),this}scale(e,t){return rj("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(kj.makeScale(e,t)),this}rotate(e){return rj("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(kj.makeRotation(-e)),this}translate(e,t){return rj("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(kj.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<9;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<9;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const kj=new Ej,Sj=(new Ej).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Mj=(new Ej).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Cj(){const e={enabled:!0,workingColorSpace:BN,spaces:{},convert:function(e,t,i){return!1!==this.enabled&&t!==i&&t&&i?(this.spaces[t].transfer===UN&&(e.r=Dj(e.r),e.g=Dj(e.g),e.b=Dj(e.b)),this.spaces[t].primaries!==this.spaces[i].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===UN&&(e.r=Pj(e.r),e.g=Pj(e.g),e.b=Pj(e.b)),e):e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===RN?ON:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,i){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,i){return rj("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,i)},toWorkingColorSpace:function(t,i){return rj("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(t,i)}},t=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],n=[.3127,.329];return e.define({[BN]:{primaries:t,whitePoint:n,transfer:ON,toXYZ:Sj,fromXYZ:Mj,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:LN},outputColorSpaceConfig:{drawingBufferColorSpace:LN}},[LN]:{primaries:t,whitePoint:n,transfer:UN,toXYZ:Sj,fromXYZ:Mj,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:LN}}}),e}const Tj=Cj();function Dj(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Pj(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let Ij;class Fj{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{void 0===Ij&&(Ij=JN("canvas")),Ij.width=e.width,Ij.height=e.height;const t=Ij.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),i=Ij}return i.toDataURL(t)}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=JN("canvas");t.width=e.width,t.height=e.height;const i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const n=i.getImageData(0,0,e.width,e.height),a=n.data;for(let e=0;e<a.length;e++)a[e]=255*Dj(a[e]/255);return i.putImageData(n,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*Dj(t[e]/255)):t[e]=Dj(t[e]);return{data:t,width:e.width,height:e.height}}return nj("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let zj=0;class Rj{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:zj++}),this.uuid=dj(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):"undefined"!=typeof VideoFrame&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(Lj(n[t].image)):e.push(Lj(n[t]))}else e=Lj(n);i.url=e}return t||(e.images[this.uuid]=i),i}}function Lj(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Fj.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(nj("Texture: Unable to serialize Texture."),{})}let Bj=0;const Oj=new xj;class Uj extends oj{constructor(e=Uj.DEFAULT_IMAGE,t=Uj.DEFAULT_MAPPING,i=1001,n=1001,a=1006,r=1008,s=1023,o=FU,l=Uj.DEFAULT_ANISOTROPY,c=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Bj++}),this.uuid=dj(),this.name="",this.source=new Rj(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=i,this.wrapT=n,this.magFilter=a,this.minFilter=r,this.anisotropy=l,this.format=s,this.internalFormat=null,this.type=o,this.offset=new vj(0,0),this.repeat=new vj(1,1),this.center=new vj(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ej,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=c,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(Oj).x}get height(){return this.source.getSize(Oj).y}get depth(){return this.source.getSize(Oj).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const i=e[t];if(void 0===i){nj(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&i&&n.isVector2&&i.isVector2||n&&i&&n.isVector3&&i.isVector3||n&&i&&n.isMatrix3&&i.isMatrix3?n.copy(i):this[t]=i:nj(`Texture.setValues(): property '${t}' does not exist.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case EU:e.x=e.x-Math.floor(e.x);break;case kU:e.x=e.x<0?0:1;break;case SU:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case EU:e.y=e.y-Math.floor(e.y);break;case kU:e.y=e.y<0?0:1;break;case SU:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}Uj.DEFAULT_IMAGE=null,Uj.DEFAULT_MAPPING=300,Uj.DEFAULT_ANISOTROPY=1;class Nj{static{Nj.prototype.isVector4=!0}constructor(e=0,t=0,i=0,n=1){this.x=e,this.y=t,this.z=i,this.w=n}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,i=this.y,n=this.z,a=this.w,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n+r[12]*a,this.y=r[1]*t+r[5]*i+r[9]*n+r[13]*a,this.z=r[2]*t+r[6]*i+r[10]*n+r[14]*a,this.w=r[3]*t+r[7]*i+r[11]*n+r[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,i,n,a;const r=.01,s=.1,o=e.elements,l=o[0],c=o[4],u=o[8],h=o[1],d=o[5],p=o[9],m=o[2],g=o[6],f=o[10];if(Math.abs(c-h)<r&&Math.abs(u-m)<r&&Math.abs(p-g)<r){if(Math.abs(c+h)<s&&Math.abs(u+m)<s&&Math.abs(p+g)<s&&Math.abs(l+d+f-3)<s)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(d+1)/2,A=(f+1)/2,_=(c+h)/4,v=(u+m)/4,y=(p+g)/4;return e>o&&e>A?e<r?(i=0,n=.707106781,a=.707106781):(i=Math.sqrt(e),n=_/i,a=v/i):o>A?o<r?(i=.707106781,n=0,a=.707106781):(n=Math.sqrt(o),i=_/n,a=y/n):A<r?(i=.707106781,n=.707106781,a=0):(a=Math.sqrt(A),i=v/a,n=y/a),this.set(i,n,a,t),this}let A=Math.sqrt((g-p)*(g-p)+(u-m)*(u-m)+(h-c)*(h-c));return Math.abs(A)<.001&&(A=1),this.x=(g-p)/A,this.y=(u-m)/A,this.z=(h-c)/A,this.w=Math.acos((l+d+f-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=pj(this.x,e.x,t.x),this.y=pj(this.y,e.y,t.y),this.z=pj(this.z,e.z,t.z),this.w=pj(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=pj(this.x,e,t),this.y=pj(this.y,e,t),this.z=pj(this.z,e,t),this.w=pj(this.w,e,t),this}clampLength(e,t){const i=this.length();return this.divideScalar(i||1).multiplyScalar(pj(i,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this.w=e.w+(t.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class jj extends oj{constructor(e=1,t=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:DU,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1,useArrayDepthTexture:!1},i),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=i.depth,this.scissor=new Nj(0,0,e,t),this.scissorTest=!1,this.viewport=new Nj(0,0,e,t),this.textures=[];const n={width:e,height:t,depth:i.depth},a=new Uj(n),r=i.count;for(let e=0;e<r;e++)this.textures[e]=a.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview,this.useArrayDepthTexture=i.useArrayDepthTexture}_setTextureOptions(e={}){const t={minFilter:DU,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++){this.textures[e].setValues(t)}}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,i=1){if(this.width!==e||this.height!==t||this.depth!==i){this.width=e,this.height=t,this.depth=i;for(let n=0,a=this.textures.length;n<a;n++)this.textures[n].image.width=e,this.textures[n].image.height=t,this.textures[n].image.depth=i,!0!==this.textures[n].isData3DTexture&&(this.textures[n].isArrayTexture=this.textures[n].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,i=e.textures.length;t<i;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Rj(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this.useArrayDepthTexture=e.useArrayDepthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Vj extends jj{constructor(e=1,t=1,i={}){super(e,t,i),this.isWebGLRenderTarget=!0}}class qj extends Uj{constructor(e=null,t=1,i=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=MU,this.minFilter=MU,this.wrapR=kU,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Gj extends Uj{constructor(e=null,t=1,i=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:i,depth:n},this.magFilter=MU,this.minFilter=MU,this.wrapR=kU,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Hj{static{Hj.prototype.isMatrix4=!0}constructor(e,t,i,n,a,r,s,o,l,c,u,h,d,p,m,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,i,n,a,r,s,o,l,c,u,h,d,p,m,g)}set(e,t,i,n,a,r,s,o,l,c,u,h,d,p,m,g){const f=this.elements;return f[0]=e,f[4]=t,f[8]=i,f[12]=n,f[1]=a,f[5]=r,f[9]=s,f[13]=o,f[2]=l,f[6]=c,f[10]=u,f[14]=h,f[3]=d,f[7]=p,f[11]=m,f[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Hj).fromArray(this.elements)}copy(e){const t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}copyPosition(e){const t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,i){return 0===this.determinantAffine()?(e.set(1,0,0),t.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}extractRotation(e){if(0===e.determinantAffine())return this.identity();const t=this.elements,i=e.elements,n=1/Wj.setFromMatrixColumn(e,0).length(),a=1/Wj.setFromMatrixColumn(e,1).length(),r=1/Wj.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*a,t[5]=i[5]*a,t[6]=i[6]*a,t[7]=0,t[8]=i[8]*r,t[9]=i[9]*r,t[10]=i[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,i=e.x,n=e.y,a=e.z,r=Math.cos(i),s=Math.sin(i),o=Math.cos(n),l=Math.sin(n),c=Math.cos(a),u=Math.sin(a);if("XYZ"===e.order){const e=r*c,i=r*u,n=s*c,a=s*u;t[0]=o*c,t[4]=-o*u,t[8]=l,t[1]=i+n*l,t[5]=e-a*l,t[9]=-s*o,t[2]=a-e*l,t[6]=n+i*l,t[10]=r*o}else if("YXZ"===e.order){const e=o*c,i=o*u,n=l*c,a=l*u;t[0]=e+a*s,t[4]=n*s-i,t[8]=r*l,t[1]=r*u,t[5]=r*c,t[9]=-s,t[2]=i*s-n,t[6]=a+e*s,t[10]=r*o}else if("ZXY"===e.order){const e=o*c,i=o*u,n=l*c,a=l*u;t[0]=e-a*s,t[4]=-r*u,t[8]=n+i*s,t[1]=i+n*s,t[5]=r*c,t[9]=a-e*s,t[2]=-r*l,t[6]=s,t[10]=r*o}else if("ZYX"===e.order){const e=r*c,i=r*u,n=s*c,a=s*u;t[0]=o*c,t[4]=n*l-i,t[8]=e*l+a,t[1]=o*u,t[5]=a*l+e,t[9]=i*l-n,t[2]=-l,t[6]=s*o,t[10]=r*o}else if("YZX"===e.order){const e=r*o,i=r*l,n=s*o,a=s*l;t[0]=o*c,t[4]=a-e*u,t[8]=n*u+i,t[1]=u,t[5]=r*c,t[9]=-s*c,t[2]=-l*c,t[6]=i*u+n,t[10]=e-a*u}else if("XZY"===e.order){const e=r*o,i=r*l,n=s*o,a=s*l;t[0]=o*c,t[4]=-u,t[8]=l*c,t[1]=e*u+a,t[5]=r*c,t[9]=i*u-n,t[2]=n*u-i,t[6]=s*c,t[10]=a*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Kj,e,Xj)}lookAt(e,t,i){const n=this.elements;return Jj.subVectors(e,t),0===Jj.lengthSq()&&(Jj.z=1),Jj.normalize(),Qj.crossVectors(i,Jj),0===Qj.lengthSq()&&(1===Math.abs(i.z)?Jj.x+=1e-4:Jj.z+=1e-4,Jj.normalize(),Qj.crossVectors(i,Jj)),Qj.normalize(),Yj.crossVectors(Jj,Qj),n[0]=Qj.x,n[4]=Yj.x,n[8]=Jj.x,n[1]=Qj.y,n[5]=Yj.y,n[9]=Jj.y,n[2]=Qj.z,n[6]=Yj.z,n[10]=Jj.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const i=e.elements,n=t.elements,a=this.elements,r=i[0],s=i[4],o=i[8],l=i[12],c=i[1],u=i[5],h=i[9],d=i[13],p=i[2],m=i[6],g=i[10],f=i[14],A=i[3],_=i[7],v=i[11],y=i[15],x=n[0],b=n[4],w=n[8],E=n[12],k=n[1],S=n[5],M=n[9],C=n[13],T=n[2],D=n[6],P=n[10],I=n[14],F=n[3],z=n[7],R=n[11],L=n[15];return a[0]=r*x+s*k+o*T+l*F,a[4]=r*b+s*S+o*D+l*z,a[8]=r*w+s*M+o*P+l*R,a[12]=r*E+s*C+o*I+l*L,a[1]=c*x+u*k+h*T+d*F,a[5]=c*b+u*S+h*D+d*z,a[9]=c*w+u*M+h*P+d*R,a[13]=c*E+u*C+h*I+d*L,a[2]=p*x+m*k+g*T+f*F,a[6]=p*b+m*S+g*D+f*z,a[10]=p*w+m*M+g*P+f*R,a[14]=p*E+m*C+g*I+f*L,a[3]=A*x+_*k+v*T+y*F,a[7]=A*b+_*S+v*D+y*z,a[11]=A*w+_*M+v*P+y*R,a[15]=A*E+_*C+v*I+y*L,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],i=e[4],n=e[8],a=e[12],r=e[1],s=e[5],o=e[9],l=e[13],c=e[2],u=e[6],h=e[10],d=e[14],p=e[3],m=e[7],g=e[11],f=e[15],A=o*d-l*h,_=s*d-l*u,v=s*h-o*u,y=r*d-l*c,x=r*h-o*c,b=r*u-s*c;return t*(m*A-g*_+f*v)-i*(p*A-g*y+f*x)+n*(p*_-m*y+f*b)-a*(p*v-m*x+g*b)}determinantAffine(){const e=this.elements,t=e[0],i=e[4],n=e[8],a=e[1],r=e[5],s=e[9],o=e[2],l=e[6],c=e[10];return t*(r*c-s*l)-i*(a*c-s*o)+n*(a*l-r*o)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,i){const n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}invert(){const e=this.elements,t=e[0],i=e[1],n=e[2],a=e[3],r=e[4],s=e[5],o=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11],p=e[12],m=e[13],g=e[14],f=e[15],A=t*s-i*r,_=t*o-n*r,v=t*l-a*r,y=i*o-n*s,x=i*l-a*s,b=n*l-a*o,w=c*m-u*p,E=c*g-h*p,k=c*f-d*p,S=u*g-h*m,M=u*f-d*m,C=h*f-d*g,T=A*C-_*M+v*S+y*k-x*E+b*w;if(0===T)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/T;return e[0]=(s*C-o*M+l*S)*D,e[1]=(n*M-i*C-a*S)*D,e[2]=(m*b-g*x+f*y)*D,e[3]=(h*x-u*b-d*y)*D,e[4]=(o*k-r*C-l*E)*D,e[5]=(t*C-n*k+a*E)*D,e[6]=(g*v-p*b-f*_)*D,e[7]=(c*b-h*v+d*_)*D,e[8]=(r*M-s*k+l*w)*D,e[9]=(i*k-t*M-a*w)*D,e[10]=(p*x-m*v+f*A)*D,e[11]=(u*v-c*x-d*A)*D,e[12]=(s*E-r*S-o*w)*D,e[13]=(t*S-i*E+n*w)*D,e[14]=(m*_-p*y-g*A)*D,e[15]=(c*y-u*_+h*A)*D,this}scale(e){const t=this.elements,i=e.x,n=e.y,a=e.z;return t[0]*=i,t[4]*=n,t[8]*=a,t[1]*=i,t[5]*=n,t[9]*=a,t[2]*=i,t[6]*=n,t[10]*=a,t[3]*=i,t[7]*=n,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}makeTranslation(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const i=Math.cos(t),n=Math.sin(t),a=1-i,r=e.x,s=e.y,o=e.z,l=a*r,c=a*s;return this.set(l*r+i,l*s-n*o,l*o+n*s,0,l*s+n*o,c*s+i,c*o-n*r,0,l*o-n*s,c*o+n*r,a*o*o+i,0,0,0,0,1),this}makeScale(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,t,i,n,a,r){return this.set(1,i,a,0,e,1,r,0,t,n,1,0,0,0,0,1),this}compose(e,t,i){const n=this.elements,a=t._x,r=t._y,s=t._z,o=t._w,l=a+a,c=r+r,u=s+s,h=a*l,d=a*c,p=a*u,m=r*c,g=r*u,f=s*u,A=o*l,_=o*c,v=o*u,y=i.x,x=i.y,b=i.z;return n[0]=(1-(m+f))*y,n[1]=(d+v)*y,n[2]=(p-_)*y,n[3]=0,n[4]=(d-v)*x,n[5]=(1-(h+f))*x,n[6]=(g+A)*x,n[7]=0,n[8]=(p+_)*b,n[9]=(g-A)*b,n[10]=(1-(h+m))*b,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,t,i){const n=this.elements;e.x=n[12],e.y=n[13],e.z=n[14];const a=this.determinantAffine();if(0===a)return i.set(1,1,1),t.identity(),this;let r=Wj.set(n[0],n[1],n[2]).length();const s=Wj.set(n[4],n[5],n[6]).length(),o=Wj.set(n[8],n[9],n[10]).length();a<0&&(r=-r),Zj.copy(this);const l=1/r,c=1/s,u=1/o;return Zj.elements[0]*=l,Zj.elements[1]*=l,Zj.elements[2]*=l,Zj.elements[4]*=c,Zj.elements[5]*=c,Zj.elements[6]*=c,Zj.elements[8]*=u,Zj.elements[9]*=u,Zj.elements[10]*=u,t.setFromRotationMatrix(Zj),i.x=r,i.y=s,i.z=o,this}makePerspective(e,t,i,n,a,r,s=2e3,o=!1){const l=this.elements,c=2*a/(t-e),u=2*a/(i-n),h=(t+e)/(t-e),d=(i+n)/(i-n);let p,m;if(o)p=a/(r-a),m=r*a/(r-a);else if(s===QN)p=-(r+a)/(r-a),m=-2*r*a/(r-a);else{if(s!==YN)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);p=-r/(r-a),m=-r*a/(r-a)}return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,i,n,a,r,s=2e3,o=!1){const l=this.elements,c=2/(t-e),u=2/(i-n),h=-(t+e)/(t-e),d=-(i+n)/(i-n);let p,m;if(o)p=1/(r-a),m=r/(r-a);else if(s===QN)p=-2/(r-a),m=-(r+a)/(r-a);else{if(s!==YN)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);p=-1/(r-a),m=-a/(r-a)}return l[0]=c,l[4]=0,l[8]=0,l[12]=h,l[1]=0,l[5]=u,l[9]=0,l[13]=d,l[2]=0,l[6]=0,l[10]=p,l[14]=m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,i=e.elements;for(let e=0;e<16;e++)if(t[e]!==i[e])return!1;return!0}fromArray(e,t=0){for(let i=0;i<16;i++)this.elements[i]=e[i+t];return this}toArray(e=[],t=0){const i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}const Wj=new xj,Zj=new Hj,Kj=new xj(0,0,0),Xj=new xj(1,1,1),Qj=new xj,Yj=new xj,Jj=new xj,$j=new Hj,eV=new yj;class tV{constructor(e=0,t=0,i=0,n=tV.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=i,this._order=n}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,i,n=this._order){return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,i=!0){const n=e.elements,a=n[0],r=n[4],s=n[8],o=n[1],l=n[5],c=n[9],u=n[2],h=n[6],d=n[10];switch(t){case"XYZ":this._y=Math.asin(pj(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-r,a)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-pj(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(pj(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-r,l)):(this._y=0,this._z=Math.atan2(o,a));break;case"ZYX":this._y=Math.asin(-pj(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,d),this._z=Math.atan2(o,a)):(this._x=0,this._z=Math.atan2(-r,l));break;case"YZX":this._z=Math.asin(pj(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-pj(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,d),this._y=0);break;default:nj("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}setFromQuaternion(e,t,i){return $j.makeRotationFromQuaternion(e),this.setFromRotationMatrix($j,t,i)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return eV.setFromEuler(this),this.setFromQuaternion(eV,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}tV.DEFAULT_ORDER="XYZ";class iV{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return 0!==(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let nV=0;const aV=new xj,rV=new yj,sV=new Hj,oV=new xj,lV=new xj,cV=new xj,uV=new yj,hV=new xj(1,0,0),dV=new xj(0,1,0),pV=new xj(0,0,1),mV={type:"added"},gV={type:"removed"},fV={type:"childadded",child:null},AV={type:"childremoved",child:null};class _V extends oj{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:nV++}),this.uuid=dj(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=_V.DEFAULT_UP.clone();const e=new xj,t=new tV,i=new yj,n=new xj(1,1,1);t._onChange(function(){i.setFromEuler(t,!1)}),i._onChange(function(){t.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Hj},normalMatrix:{value:new Ej}}),this.matrix=new Hj,this.matrixWorld=new Hj,this.matrixAutoUpdate=_V.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=_V.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new iV,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return rV.setFromAxisAngle(e,t),this.quaternion.multiply(rV),this}rotateOnWorldAxis(e,t){return rV.setFromAxisAngle(e,t),this.quaternion.premultiply(rV),this}rotateX(e){return this.rotateOnAxis(hV,e)}rotateY(e){return this.rotateOnAxis(dV,e)}rotateZ(e){return this.rotateOnAxis(pV,e)}translateOnAxis(e,t){return aV.copy(e).applyQuaternion(this.quaternion),this.position.add(aV.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(hV,e)}translateY(e){return this.translateOnAxis(dV,e)}translateZ(e){return this.translateOnAxis(pV,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(sV.copy(this.matrixWorld).invert())}lookAt(e,t,i){e.isVector3?oV.copy(e):oV.set(e,t,i);const n=this.parent;this.updateWorldMatrix(!0,!1),lV.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?sV.lookAt(lV,oV,this.up):sV.lookAt(oV,lV,this.up),this.quaternion.setFromRotationMatrix(sV),n&&(sV.extractRotation(n.matrixWorld),rV.setFromRotationMatrix(sV),this.quaternion.premultiply(rV.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(aj("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(mV),fV.child=e,this.dispatchEvent(fV),fV.child=null):aj("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(gV),AV.child=e,this.dispatchEvent(AV),AV.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),sV.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),sV.multiply(e.parent.matrixWorld)),e.applyMatrix4(sV),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(mV),fV.child=e,this.dispatchEvent(fV),fV.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(e,t);if(void 0!==n)return n}}getObjectsByProperty(e,t,i=[]){this[e]===t&&i.push(this);const n=this.children;for(let a=0,r=n.length;a<r;a++)n[a].getObjectsByProperty(e,t,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(lV,e,cV),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(lV,uV,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let i=0,n=t.length;i<n;i++)t[i].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(null!==e){const t=e.x,i=e.y,n=e.z,a=this.matrix.elements;a[12]+=t-a[0]*t-a[4]*i-a[8]*n,a[13]+=i-a[1]*t-a[5]*i-a[9]*n,a[14]+=n-a[2]*t-a[6]*i-a[10]*n}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let i=0,n=t.length;i<n;i++){t[i].updateMatrixWorld(e)}}updateWorldMatrix(e,t,i=!1){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,i=!0),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++){e[t].updateWorldMatrix(!1,!0,i)}}}toJSON(e){const t=void 0===e||"string"==typeof e,i={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const n={};function a(t,i){return void 0===t[i.uuid]&&(t[i.uuid]=i.toJSON(e)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),!1!==this.static&&(n.static=this.static),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),null!==this.pivot&&(n.pivot=this.pivot.toArray()),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),void 0!==this.morphTargetDictionary&&(n.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),void 0!==this.morphTargetInfluences&&(n.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),n.instanceInfo=this._instanceInfo.map(e=>({...e})),n.availableInstanceIds=this._availableInstanceIds.slice(),n.availableGeometryIds=this._availableGeometryIds.slice(),n.nextIndexStart=this._nextIndexStart,n.nextVertexStart=this._nextVertexStart,n.geometryCount=this._geometryCount,n.maxInstanceCount=this._maxInstanceCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.matricesTexture=this._matricesTexture.toJSON(e),n.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(n.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(n.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(n.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=a(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const i=t.shapes;if(Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const n=i[t];a(e.shapes,n)}else a(e.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(a(e.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let i=0,n=this.material.length;i<n;i++)t.push(a(e.materials,this.material[i]));n.material=t}else n.material=a(e.materials,this.material);if(this.children.length>0){n.children=[];for(let t=0;t<this.children.length;t++)n.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){n.animations=[];for(let t=0;t<this.animations.length;t++){const i=this.animations[t];n.animations.push(a(e.animations,i))}}if(t){const t=r(e.geometries),n=r(e.materials),a=r(e.textures),s=r(e.images),o=r(e.shapes),l=r(e.skeletons),c=r(e.animations),u=r(e.nodes);t.length>0&&(i.geometries=t),n.length>0&&(i.materials=n),a.length>0&&(i.textures=a),s.length>0&&(i.images=s),o.length>0&&(i.shapes=o),l.length>0&&(i.skeletons=l),c.length>0&&(i.animations=c),u.length>0&&(i.nodes=u)}return i.object=n,i;function r(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=null!==e.pivot?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const i=e.children[t];this.add(i.clone())}return this}}_V.DEFAULT_UP=new xj(0,1,0),_V.DEFAULT_MATRIX_AUTO_UPDATE=!0,_V.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class vV extends _V{constructor(){super(),this.isGroup=!0,this.type="Group"}}const yV={type:"move"};class xV{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new vV,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new vV,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new xj,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new xj),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new vV,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new xj,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new xj,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const i of e.hand.values())this._getHandJoint(t,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,i){let n=null,a=null,r=null;const s=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){r=!0;for(const n of e.hand.values()){const e=t.getJointPose(n,i),a=this._getHandJoint(l,n);null!==e&&(a.matrix.fromArray(e.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,a.jointRadius=e.radius),a.visible=null!==e}const n=l.joints["index-finger-tip"],a=l.joints["thumb-tip"],s=n.position.distanceTo(a.position),o=.02,c=.005;l.inputState.pinching&&s>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&s<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(a=t.getPose(e.gripSpace,i),null!==a&&(o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,a.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(a.linearVelocity)):o.hasLinearVelocity=!1,a.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(a.angularVelocity)):o.hasAngularVelocity=!1,o.eventsEnabled&&o.dispatchEvent({type:"gripUpdated",data:e,target:this})));null!==s&&(n=t.getPose(e.targetRaySpace,i),null===n&&null!==a&&(n=a),null!==n&&(s.matrix.fromArray(n.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,n.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(n.linearVelocity)):s.hasLinearVelocity=!1,n.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(n.angularVelocity)):s.hasAngularVelocity=!1,this.dispatchEvent(yV)))}return null!==s&&(s.visible=null!==n),null!==o&&(o.visible=null!==a),null!==l&&(l.visible=null!==r),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const i=new vV;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[t.jointName]=i,e.add(i)}return e.joints[t.jointName]}}const bV={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},wV={h:0,s:0,l:0},EV={h:0,s:0,l:0};function kV(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}class SV{constructor(e,t,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,i)}set(e,t,i){if(void 0===t&&void 0===i){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=LN){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Tj.colorSpaceToWorking(this,t),this}setRGB(e,t,i,n=Tj.workingColorSpace){return this.r=e,this.g=t,this.b=i,Tj.colorSpaceToWorking(this,n),this}setHSL(e,t,i,n=Tj.workingColorSpace){if(e=mj(e,1),t=pj(t,0,1),i=pj(i,0,1),0===t)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+t):i+t-i*t,a=2*i-n;this.r=kV(a,n,e+1/3),this.g=kV(a,n,e),this.b=kV(a,n,e-1/3)}return Tj.colorSpaceToWorking(this,n),this}setStyle(e,t=LN){function i(t){void 0!==t&&parseFloat(t)<1&&nj("Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const r=n[1],s=n[2];switch(r){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return i(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:nj("Color: Unknown color model "+e)}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const i=n[1],a=i.length;if(3===a)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,t);if(6===a)return this.setHex(parseInt(i,16),t);nj("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=LN){const i=bV[e.toLowerCase()];return void 0!==i?this.setHex(i,t):nj("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Dj(e.r),this.g=Dj(e.g),this.b=Dj(e.b),this}copyLinearToSRGB(e){return this.r=Pj(e.r),this.g=Pj(e.g),this.b=Pj(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=LN){return Tj.workingToColorSpace(MV.copy(this),e),65536*Math.round(pj(255*MV.r,0,255))+256*Math.round(pj(255*MV.g,0,255))+Math.round(pj(255*MV.b,0,255))}getHexString(e=LN){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Tj.workingColorSpace){Tj.workingToColorSpace(MV.copy(this),t);const i=MV.r,n=MV.g,a=MV.b,r=Math.max(i,n,a),s=Math.min(i,n,a);let o,l;const c=(s+r)/2;if(s===r)o=0,l=0;else{const e=r-s;switch(l=c<=.5?e/(r+s):e/(2-r-s),r){case i:o=(n-a)/e+(n<a?6:0);break;case n:o=(a-i)/e+2;break;case a:o=(i-n)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e,t=Tj.workingColorSpace){return Tj.workingToColorSpace(MV.copy(this),t),e.r=MV.r,e.g=MV.g,e.b=MV.b,e}getStyle(e=LN){Tj.workingToColorSpace(MV.copy(this),e);const t=MV.r,i=MV.g,n=MV.b;return e!==LN?`color(${e} ${t.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*i)},${Math.round(255*n)})`}offsetHSL(e,t,i){return this.getHSL(wV),this.setHSL(wV.h+e,wV.s+t,wV.l+i)}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,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}lerpHSL(e,t){this.getHSL(wV),e.getHSL(EV);const i=gj(wV.h,EV.h,t),n=gj(wV.s,EV.s,t),a=gj(wV.l,EV.l,t);return this.setHSL(i,n,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,i=this.g,n=this.b,a=e.elements;return this.r=a[0]*t+a[3]*i+a[6]*n,this.g=a[1]*t+a[4]*i+a[7]*n,this.b=a[2]*t+a[5]*i+a[8]*n,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}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const MV=new SV;SV.NAMES=bV;class CV extends _V{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new tV,this.environmentIntensity=1,this.environmentRotation=new tV,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const TV=new xj,DV=new xj,PV=new xj,IV=new xj,FV=new xj,zV=new xj,RV=new xj,LV=new xj,BV=new xj,OV=new xj,UV=new Nj,NV=new Nj,jV=new Nj;class VV{constructor(e=new xj,t=new xj,i=new xj){this.a=e,this.b=t,this.c=i}static getNormal(e,t,i,n){n.subVectors(i,t),TV.subVectors(e,t),n.cross(TV);const a=n.lengthSq();return a>0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(e,t,i,n,a){TV.subVectors(n,t),DV.subVectors(i,t),PV.subVectors(e,t);const r=TV.dot(TV),s=TV.dot(DV),o=TV.dot(PV),l=DV.dot(DV),c=DV.dot(PV),u=r*l-s*s;if(0===u)return a.set(0,0,0),null;const h=1/u,d=(l*o-s*c)*h,p=(r*c-s*o)*h;return a.set(1-d-p,p,d)}static containsPoint(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,IV)&&(IV.x>=0&&IV.y>=0&&IV.x+IV.y<=1)}static getInterpolation(e,t,i,n,a,r,s,o){return null===this.getBarycoord(e,t,i,n,IV)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(a,IV.x),o.addScaledVector(r,IV.y),o.addScaledVector(s,IV.z),o)}static getInterpolatedAttribute(e,t,i,n,a,r){return UV.setScalar(0),NV.setScalar(0),jV.setScalar(0),UV.fromBufferAttribute(e,t),NV.fromBufferAttribute(e,i),jV.fromBufferAttribute(e,n),r.setScalar(0),r.addScaledVector(UV,a.x),r.addScaledVector(NV,a.y),r.addScaledVector(jV,a.z),r}static isFrontFacing(e,t,i,n){return TV.subVectors(i,t),DV.subVectors(e,t),TV.cross(DV).dot(n)<0}set(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}setFromPointsAndIndices(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}setFromAttributeAndIndices(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return TV.subVectors(this.c,this.b),DV.subVectors(this.a,this.b),.5*TV.cross(DV).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return VV.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return VV.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,i,n,a){return VV.getInterpolation(e,this.a,this.b,this.c,t,i,n,a)}containsPoint(e){return VV.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return VV.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const i=this.a,n=this.b,a=this.c;let r,s;FV.subVectors(n,i),zV.subVectors(a,i),LV.subVectors(e,i);const o=FV.dot(LV),l=zV.dot(LV);if(o<=0&&l<=0)return t.copy(i);BV.subVectors(e,n);const c=FV.dot(BV),u=zV.dot(BV);if(c>=0&&u<=c)return t.copy(n);const h=o*u-c*l;if(h<=0&&o>=0&&c<=0)return r=o/(o-c),t.copy(i).addScaledVector(FV,r);OV.subVectors(e,a);const d=FV.dot(OV),p=zV.dot(OV);if(p>=0&&d<=p)return t.copy(a);const m=d*l-o*p;if(m<=0&&l>=0&&p<=0)return s=l/(l-p),t.copy(i).addScaledVector(zV,s);const g=c*p-d*u;if(g<=0&&u-c>=0&&d-p>=0)return RV.subVectors(a,n),s=(u-c)/(u-c+(d-p)),t.copy(n).addScaledVector(RV,s);const f=1/(g+m+h);return r=m*f,s=h*f,t.copy(i).addScaledVector(FV,r).addScaledVector(zV,s)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class qV{constructor(e=new xj(1/0,1/0,1/0),t=new xj(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t+=3)this.expandByPoint(HV.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,i=e.count;t<i;t++)this.expandByPoint(HV.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=HV.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),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,t=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(void 0!==i){const n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(let t=0,i=n.count;t<i;t++)!0===e.isMesh?e.getVertexPosition(t,HV):HV.fromBufferAttribute(n,t),HV.applyMatrix4(e.matrixWorld),this.expandByPoint(HV);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),WV.copy(e.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),WV.copy(i.boundingBox)),WV.applyMatrix4(e.matrixWorld),this.union(WV)}const n=e.children;for(let e=0,i=n.length;e<i;e++)this.expandByObject(n[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}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&&this.min.z<=e.min.z&&e.max.z<=this.max.z}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),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,HV),HV.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter($V),eq.subVectors(this.max,$V),ZV.subVectors(e.a,$V),KV.subVectors(e.b,$V),XV.subVectors(e.c,$V),QV.subVectors(KV,ZV),YV.subVectors(XV,KV),JV.subVectors(ZV,XV);let t=[0,-QV.z,QV.y,0,-YV.z,YV.y,0,-JV.z,JV.y,QV.z,0,-QV.x,YV.z,0,-YV.x,JV.z,0,-JV.x,-QV.y,QV.x,0,-YV.y,YV.x,0,-JV.y,JV.x,0];return!!nq(t,ZV,KV,XV,eq)&&(t=[1,0,0,0,1,0,0,0,1],!!nq(t,ZV,KV,XV,eq)&&(tq.crossVectors(QV,YV),t=[tq.x,tq.y,tq.z],nq(t,ZV,KV,XV,eq)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,HV).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(HV).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(GV[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),GV[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),GV[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),GV[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),GV[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),GV[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),GV[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),GV[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(GV)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const GV=[new xj,new xj,new xj,new xj,new xj,new xj,new xj,new xj],HV=new xj,WV=new qV,ZV=new xj,KV=new xj,XV=new xj,QV=new xj,YV=new xj,JV=new xj,$V=new xj,eq=new xj,tq=new xj,iq=new xj;function nq(e,t,i,n,a){for(let r=0,s=e.length-3;r<=s;r+=3){iq.fromArray(e,r);const s=a.x*Math.abs(iq.x)+a.y*Math.abs(iq.y)+a.z*Math.abs(iq.z),o=t.dot(iq),l=i.dot(iq),c=n.dot(iq);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>s)return!1}return!0}const aq=new xj,rq=new vj;let sq=0;class oq extends oj{constructor(e,t,i=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:sq++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i,this.usage=35044,this.updateRanges=[],this.gpuType=UU,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,i){e*=this.itemSize,i*=t.itemSize;for(let n=0,a=this.itemSize;n<a;n++)this.array[e+n]=t.array[i+n];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,i=this.count;t<i;t++)rq.fromBufferAttribute(this,t),rq.applyMatrix3(e),this.setXY(t,rq.x,rq.y);else if(3===this.itemSize)for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.applyMatrix3(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}applyMatrix4(e){for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.applyMatrix4(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.applyNormalMatrix(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)aq.fromBufferAttribute(this,t),aq.transformDirection(e),this.setXYZ(t,aq.x,aq.y,aq.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let i=this.array[e*this.itemSize+t];return this.normalized&&(i=fj(i,this.array)),i}setComponent(e,t,i){return this.normalized&&(i=Aj(i,this.array)),this.array[e*this.itemSize+t]=i,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=fj(t,this.array)),t}setX(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=fj(t,this.array)),t}setY(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=fj(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=fj(t,this.array)),t}setW(e,t){return this.normalized&&(t=Aj(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,i){return e*=this.itemSize,this.normalized&&(t=Aj(t,this.array),i=Aj(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}setXYZ(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=Aj(t,this.array),i=Aj(i,this.array),n=Aj(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}setXYZW(e,t,i,n,a){return e*=this.itemSize,this.normalized&&(t=Aj(t,this.array),i=Aj(i,this.array),n=Aj(n,this.array),a=Aj(a,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=a,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class lq extends oq{constructor(e,t,i){super(new Uint16Array(e),t,i)}}class cq extends oq{constructor(e,t,i){super(new Uint32Array(e),t,i)}}class uq extends oq{constructor(e,t,i){super(new Float32Array(e),t,i)}}const hq=new qV,dq=new xj,pq=new xj;class mq{constructor(e=new xj,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const i=this.center;void 0!==t?i.copy(t):hq.setFromPoints(e).getCenter(i);let n=0;for(let t=0,a=e.length;t<a;t++)n=Math.max(n,i.distanceToSquared(e[t]));return this.radius=Math.sqrt(n),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const i=this.center.distanceToSquared(e);return t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;dq.subVectors(e,this.center);const t=dq.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),i=.5*(e-this.radius);this.center.addScaledVector(dq,i/e),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(pq.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(dq.copy(e.center).add(pq)),this.expandByPoint(dq.copy(e.center).sub(pq))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let gq=0;const fq=new Hj,Aq=new _V,_q=new xj,vq=new qV,yq=new qV,xq=new xj;class bq extends oj{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:gq++}),this.uuid=dj(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={},this._transformed=!1}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(function(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}(e)?cq:lq)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,i=0){this.groups.push({start:e,count:t,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const t=(new Ej).getNormalMatrix(e);i.applyNormalMatrix(t),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(e),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return fq.makeRotationFromQuaternion(e),this.applyMatrix4(fq),this}rotateX(e){return fq.makeRotationX(e),this.applyMatrix4(fq),this}rotateY(e){return fq.makeRotationY(e),this.applyMatrix4(fq),this}rotateZ(e){return fq.makeRotationZ(e),this.applyMatrix4(fq),this}translate(e,t,i){return fq.makeTranslation(e,t,i),this.applyMatrix4(fq),this}scale(e,t,i){return fq.makeScale(e,t,i),this.applyMatrix4(fq),this}lookAt(e){return Aq.lookAt(e),Aq.updateMatrix(),this.applyMatrix4(Aq.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(_q).negate(),this.translate(_q.x,_q.y,_q.z),this}setFromPoints(e){const t=this.getAttribute("position");if(void 0===t){const t=[];for(let i=0,n=e.length;i<n;i++){const n=e[i];t.push(n.x,n.y,n.z||0)}this.setAttribute("position",new uq(t,3))}else{const i=Math.min(e.length,t.count);for(let n=0;n<i;n++){const i=e[n];t.setXYZ(n,i.x,i.y,i.z||0)}e.length>t.count&&nj("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new qV);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return aj("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new xj(-1/0,-1/0,-1/0),new xj(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const i=t[e];vq.setFromBufferAttribute(i),this.morphTargetsRelative?(xq.addVectors(this.boundingBox.min,vq.min),this.boundingBox.expandByPoint(xq),xq.addVectors(this.boundingBox.max,vq.max),this.boundingBox.expandByPoint(xq)):(this.boundingBox.expandByPoint(vq.min),this.boundingBox.expandByPoint(vq.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&aj('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new mq);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return aj("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new xj,1/0);if(e){const i=this.boundingSphere.center;if(vq.setFromBufferAttribute(e),t)for(let e=0,i=t.length;e<i;e++){const i=t[e];yq.setFromBufferAttribute(i),this.morphTargetsRelative?(xq.addVectors(vq.min,yq.min),vq.expandByPoint(xq),xq.addVectors(vq.max,yq.max),vq.expandByPoint(xq)):(vq.expandByPoint(yq.min),vq.expandByPoint(yq.max))}vq.getCenter(i);let n=0;for(let t=0,a=e.count;t<a;t++)xq.fromBufferAttribute(e,t),n=Math.max(n,i.distanceToSquared(xq));if(t)for(let a=0,r=t.length;a<r;a++){const r=t[a],s=this.morphTargetsRelative;for(let t=0,a=r.count;t<a;t++)xq.fromBufferAttribute(r,t),s&&(_q.fromBufferAttribute(e,t),xq.add(_q)),n=Math.max(n,i.distanceToSquared(xq))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&aj('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void aj("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=t.position,n=t.normal,a=t.uv;let r=this.getAttribute("tangent");void 0!==r&&r.count===i.count||(r=new oq(new Float32Array(4*i.count),4),this.setAttribute("tangent",r));const s=[],o=[];for(let e=0;e<i.count;e++)s[e]=new xj,o[e]=new xj;const l=new xj,c=new xj,u=new xj,h=new vj,d=new vj,p=new vj,m=new xj,g=new xj;function f(e,t,n){l.fromBufferAttribute(i,e),c.fromBufferAttribute(i,t),u.fromBufferAttribute(i,n),h.fromBufferAttribute(a,e),d.fromBufferAttribute(a,t),p.fromBufferAttribute(a,n),c.sub(l),u.sub(l),d.sub(h),p.sub(h);const r=1/(d.x*p.y-p.x*d.y);isFinite(r)&&(m.copy(c).multiplyScalar(p.y).addScaledVector(u,-d.y).multiplyScalar(r),g.copy(u).multiplyScalar(d.x).addScaledVector(c,-p.x).multiplyScalar(r),s[e].add(m),s[t].add(m),s[n].add(m),o[e].add(g),o[t].add(g),o[n].add(g))}let A=this.groups;0===A.length&&(A=[{start:0,count:e.count}]);for(let t=0,i=A.length;t<i;++t){const i=A[t],n=i.start;for(let t=n,a=n+i.count;t<a;t+=3)f(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const _=new xj,v=new xj,y=new xj,x=new xj;function b(e){y.fromBufferAttribute(n,e),x.copy(y);const t=s[e];_.copy(t),_.sub(y.multiplyScalar(y.dot(t))).normalize(),v.crossVectors(x,t);const i=v.dot(o[e])<0?-1:1;r.setXYZW(e,_.x,_.y,_.z,i)}for(let t=0,i=A.length;t<i;++t){const i=A[t],n=i.start;for(let t=n,a=n+i.count;t<a;t+=3)b(e.getX(t+0)),b(e.getX(t+1)),b(e.getX(t+2))}this._transformed=!0}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let i=this.getAttribute("normal");if(void 0===i||i.count!==t.count)i=new oq(new Float32Array(3*t.count),3),this.setAttribute("normal",i);else for(let e=0,t=i.count;e<t;e++)i.setXYZ(e,0,0,0);const n=new xj,a=new xj,r=new xj,s=new xj,o=new xj,l=new xj,c=new xj,u=new xj;if(e)for(let h=0,d=e.count;h<d;h+=3){const d=e.getX(h+0),p=e.getX(h+1),m=e.getX(h+2);n.fromBufferAttribute(t,d),a.fromBufferAttribute(t,p),r.fromBufferAttribute(t,m),c.subVectors(r,a),u.subVectors(n,a),c.cross(u),s.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),l.fromBufferAttribute(i,m),s.add(c),o.add(c),l.add(c),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(m,l.x,l.y,l.z)}else for(let e=0,s=t.count;e<s;e+=3)n.fromBufferAttribute(t,e+0),a.fromBufferAttribute(t,e+1),r.fromBufferAttribute(t,e+2),c.subVectors(r,a),u.subVectors(n,a),c.cross(u),i.setXYZ(e+0,c.x,c.y,c.z),i.setXYZ(e+1,c.x,c.y,c.z),i.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,i=e.count;t<i;t++)xq.fromBufferAttribute(e,t),xq.normalize(),e.setXYZ(t,xq.x,xq.y,xq.z)}toNonIndexed(){function e(e,t){const i=e.array,n=e.itemSize,a=e.normalized,r=new i.constructor(t.length*n);let s=0,o=0;for(let a=0,l=t.length;a<l;a++){s=e.isInterleavedBufferAttribute?t[a]*e.data.stride+e.offset:t[a]*n;for(let e=0;e<n;e++)r[o++]=i[s++]}return new oq(r,n,a)}if(null===this.index)return nj("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new bq,i=this.index.array,n=this.attributes;for(const a in n){const r=e(n[a],i);t.setAttribute(a,r)}const a=this.morphAttributes;for(const n in a){const r=[],s=a[n];for(let t=0,n=s.length;t<n;t++){const n=e(s[t],i);r.push(n)}t.morphAttributes[n]=r}t.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let e=0,i=r.length;e<i;e++){const i=r[e];t.addGroup(i.start,i.count,i.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=void 0!==this.parameters&&!0===this._transformed?"BufferGeometry":this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters&&!0!==this._transformed){const t=this.parameters;for(const i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const i=this.attributes;for(const t in i){const n=i[t];e.data.attributes[t]=n.toJSON(e.data)}const n={};let a=!1;for(const t in this.morphAttributes){const i=this.morphAttributes[t],r=[];for(let t=0,n=i.length;t<n;t++){const n=i[t];r.push(n.toJSON(e.data))}r.length>0&&(n[t]=r,a=!0)}a&&(e.data.morphAttributes=n,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const s=this.boundingSphere;return null!==s&&(e.data.boundingSphere=s.toJSON()),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const i=e.index;null!==i&&this.setIndex(i.clone());const n=e.attributes;for(const e in n){const i=n[e];this.setAttribute(e,i.clone(t))}const a=e.morphAttributes;for(const e in a){const i=[],n=a[e];for(let e=0,a=n.length;e<a;e++)i.push(n[e].clone(t));this.morphAttributes[e]=i}this.morphTargetsRelative=e.morphTargetsRelative;const r=e.groups;for(let e=0,t=r.length;e<t;e++){const t=r[e];this.addGroup(t.start,t.count,t.materialIndex)}const s=e.boundingBox;null!==s&&(this.boundingBox=s.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this._transformed=e._transformed,this}dispose(){this.dispatchEvent({type:"dispose"})}}let wq=0;class Eq extends oj{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:wq++}),this.uuid=dj(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=BO,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new SV(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=NN,this.stencilZFail=NN,this.stencilZPass=NN,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const i=e[t];if(void 0===i){nj(`Material: parameter '${t}' has value of undefined.`);continue}const n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector2&&i&&i.isVector2||n&&n.isEuler&&i&&i.isEuler||n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:nj(`Material: '${t}' is not a property of THREE.${this.type}.`)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function n(e){const t=[];for(const i in e){const n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),this.blendEquation!==BO&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==NN&&(i.stencilFail=this.stencilFail),this.stencilZFail!==NN&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==NN&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!1===this.allowOverride&&(i.allowOverride=!1),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){const t=n(e.textures),a=n(e.images);t.length>0&&(i.textures=t),a.length>0&&(i.images=a)}return i}fromJSON(e,t){if(void 0!==e.uuid&&(this.uuid=e.uuid),void 0!==e.name&&(this.name=e.name),void 0!==e.color&&void 0!==this.color&&this.color.setHex(e.color),void 0!==e.roughness&&(this.roughness=e.roughness),void 0!==e.metalness&&(this.metalness=e.metalness),void 0!==e.sheen&&(this.sheen=e.sheen),void 0!==e.sheenColor&&(this.sheenColor=(new SV).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(this.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==this.emissive&&this.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==this.specular&&this.specular.setHex(e.specular),void 0!==e.specularIntensity&&(this.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==this.specularColor&&this.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(this.shininess=e.shininess),void 0!==e.clearcoat&&(this.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(this.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.dispersion&&(this.dispersion=e.dispersion),void 0!==e.iridescence&&(this.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(this.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(this.transmission=e.transmission),void 0!==e.thickness&&(this.thickness=e.thickness),void 0!==e.attenuationDistance&&(this.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==this.attenuationColor&&this.attenuationColor.setHex(e.attenuationColor),void 0!==e.anisotropy&&(this.anisotropy=e.anisotropy),void 0!==e.anisotropyRotation&&(this.anisotropyRotation=e.anisotropyRotation),void 0!==e.fog&&(this.fog=e.fog),void 0!==e.flatShading&&(this.flatShading=e.flatShading),void 0!==e.blending&&(this.blending=e.blending),void 0!==e.combine&&(this.combine=e.combine),void 0!==e.side&&(this.side=e.side),void 0!==e.shadowSide&&(this.shadowSide=e.shadowSide),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.transparent&&(this.transparent=e.transparent),void 0!==e.alphaTest&&(this.alphaTest=e.alphaTest),void 0!==e.alphaHash&&(this.alphaHash=e.alphaHash),void 0!==e.depthFunc&&(this.depthFunc=e.depthFunc),void 0!==e.depthTest&&(this.depthTest=e.depthTest),void 0!==e.depthWrite&&(this.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(this.colorWrite=e.colorWrite),void 0!==e.blendSrc&&(this.blendSrc=e.blendSrc),void 0!==e.blendDst&&(this.blendDst=e.blendDst),void 0!==e.blendEquation&&(this.blendEquation=e.blendEquation),void 0!==e.blendSrcAlpha&&(this.blendSrcAlpha=e.blendSrcAlpha),void 0!==e.blendDstAlpha&&(this.blendDstAlpha=e.blendDstAlpha),void 0!==e.blendEquationAlpha&&(this.blendEquationAlpha=e.blendEquationAlpha),void 0!==e.blendColor&&void 0!==this.blendColor&&this.blendColor.setHex(e.blendColor),void 0!==e.blendAlpha&&(this.blendAlpha=e.blendAlpha),void 0!==e.stencilWriteMask&&(this.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(this.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(this.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(this.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(this.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(this.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(this.stencilZPass=e.stencilZPass),void 0!==e.stencilWrite&&(this.stencilWrite=e.stencilWrite),void 0!==e.wireframe&&(this.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(this.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(this.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(this.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(this.rotation=e.rotation),void 0!==e.linewidth&&(this.linewidth=e.linewidth),void 0!==e.dashSize&&(this.dashSize=e.dashSize),void 0!==e.gapSize&&(this.gapSize=e.gapSize),void 0!==e.scale&&(this.scale=e.scale),void 0!==e.polygonOffset&&(this.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(this.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(this.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(this.dithering=e.dithering),void 0!==e.alphaToCoverage&&(this.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(this.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.forceSinglePass&&(this.forceSinglePass=e.forceSinglePass),void 0!==e.allowOverride&&(this.allowOverride=e.allowOverride),void 0!==e.visible&&(this.visible=e.visible),void 0!==e.toneMapped&&(this.toneMapped=e.toneMapped),void 0!==e.userData&&(this.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),void 0!==e.size&&(this.size=e.size),void 0!==e.sizeAttenuation&&(this.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(this.map=t[e.map]||null),void 0!==e.matcap&&(this.matcap=t[e.matcap]||null),void 0!==e.alphaMap&&(this.alphaMap=t[e.alphaMap]||null),void 0!==e.bumpMap&&(this.bumpMap=t[e.bumpMap]||null),void 0!==e.bumpScale&&(this.bumpScale=e.bumpScale),void 0!==e.normalMap&&(this.normalMap=t[e.normalMap]||null),void 0!==e.normalMapType&&(this.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),this.normalScale=(new vj).fromArray(t)}return void 0!==e.displacementMap&&(this.displacementMap=t[e.displacementMap]||null),void 0!==e.displacementScale&&(this.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(this.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(this.roughnessMap=t[e.roughnessMap]||null),void 0!==e.metalnessMap&&(this.metalnessMap=t[e.metalnessMap]||null),void 0!==e.emissiveMap&&(this.emissiveMap=t[e.emissiveMap]||null),void 0!==e.emissiveIntensity&&(this.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(this.specularMap=t[e.specularMap]||null),void 0!==e.specularIntensityMap&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),void 0!==e.specularColorMap&&(this.specularColorMap=t[e.specularColorMap]||null),void 0!==e.envMap&&(this.envMap=t[e.envMap]||null),void 0!==e.envMapRotation&&this.envMapRotation.fromArray(e.envMapRotation),void 0!==e.envMapIntensity&&(this.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(this.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(this.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(this.lightMap=t[e.lightMap]||null),void 0!==e.lightMapIntensity&&(this.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(this.aoMap=t[e.aoMap]||null),void 0!==e.aoMapIntensity&&(this.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(this.gradientMap=t[e.gradientMap]||null),void 0!==e.clearcoatMap&&(this.clearcoatMap=t[e.clearcoatMap]||null),void 0!==e.clearcoatRoughnessMap&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),void 0!==e.clearcoatNormalMap&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),void 0!==e.clearcoatNormalScale&&(this.clearcoatNormalScale=(new vj).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(this.iridescenceMap=t[e.iridescenceMap]||null),void 0!==e.iridescenceThicknessMap&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),void 0!==e.transmissionMap&&(this.transmissionMap=t[e.transmissionMap]||null),void 0!==e.thicknessMap&&(this.thicknessMap=t[e.thicknessMap]||null),void 0!==e.anisotropyMap&&(this.anisotropyMap=t[e.anisotropyMap]||null),void 0!==e.sheenColorMap&&(this.sheenColorMap=t[e.sheenColorMap]||null),void 0!==e.sheenRoughnessMap&&(this.sheenRoughnessMap=t[e.sheenRoughnessMap]||null),this}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let i=null;if(null!==t){const e=t.length;i=new Array(e);for(let n=0;n!==e;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}const kq=new xj,Sq=new xj,Mq=new xj,Cq=new xj,Tq=new xj,Dq=new xj,Pq=new xj;class Iq{constructor(e=new xj,t=new xj(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,kq)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=kq.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(kq.copy(this.origin).addScaledVector(this.direction,t),kq.distanceToSquared(e))}distanceSqToSegment(e,t,i,n){Sq.copy(e).add(t).multiplyScalar(.5),Mq.copy(t).sub(e).normalize(),Cq.copy(this.origin).sub(Sq);const a=.5*e.distanceTo(t),r=-this.direction.dot(Mq),s=Cq.dot(this.direction),o=-Cq.dot(Mq),l=Cq.lengthSq(),c=Math.abs(1-r*r);let u,h,d,p;if(c>0)if(u=r*o-s,h=r*s-o,p=a*c,u>=0)if(h>=-p)if(h<=p){const e=1/c;u*=e,h*=e,d=u*(u+r*h+2*s)+h*(r*u+h+2*o)+l}else h=a,u=Math.max(0,-(r*h+s)),d=-u*u+h*(h+2*o)+l;else h=-a,u=Math.max(0,-(r*h+s)),d=-u*u+h*(h+2*o)+l;else h<=-p?(u=Math.max(0,-(-r*a+s)),h=u>0?-a:Math.min(Math.max(-a,-o),a),d=-u*u+h*(h+2*o)+l):h<=p?(u=0,h=Math.min(Math.max(-a,-o),a),d=h*(h+2*o)+l):(u=Math.max(0,-(r*a+s)),h=u>0?a:Math.min(Math.max(-a,-o),a),d=-u*u+h*(h+2*o)+l);else h=r>0?-a:a,u=Math.max(0,-(r*h+s)),d=-u*u+h*(h+2*o)+l;return i&&i.copy(this.origin).addScaledVector(this.direction,u),n&&n.copy(Sq).addScaledVector(Mq,h),d}intersectSphere(e,t){kq.subVectors(e.center,this.origin);const i=kq.dot(this.direction),n=kq.dot(kq)-i*i,a=e.radius*e.radius;if(n>a)return null;const r=Math.sqrt(a-n),s=i-r,o=i+r;return o<0?null:s<0?this.at(o,t):this.at(s,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}intersectPlane(e,t){const i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let i,n,a,r,s,o;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(i=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(i=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(a=(e.min.y-h.y)*c,r=(e.max.y-h.y)*c):(a=(e.max.y-h.y)*c,r=(e.min.y-h.y)*c),i>r||a>n?null:((a>i||isNaN(i))&&(i=a),(r<n||isNaN(n))&&(n=r),u>=0?(s=(e.min.z-h.z)*u,o=(e.max.z-h.z)*u):(s=(e.max.z-h.z)*u,o=(e.min.z-h.z)*u),i>o||s>n?null:((s>i||i!=i)&&(i=s),(o<n||n!=n)&&(n=o),n<0?null:this.at(i>=0?i:n,t)))}intersectsBox(e){return null!==this.intersectBox(e,kq)}intersectTriangle(e,t,i,n,a){Tq.subVectors(t,e),Dq.subVectors(i,e),Pq.crossVectors(Tq,Dq);let r,s=this.direction.dot(Pq);if(s>0){if(n)return null;r=1}else{if(!(s<0))return null;r=-1,s=-s}Cq.subVectors(this.origin,e);const o=r*this.direction.dot(Dq.crossVectors(Cq,Dq));if(o<0)return null;const l=r*this.direction.dot(Tq.cross(Cq));if(l<0)return null;if(o+l>s)return null;const c=-r*Cq.dot(Pq);return c<0?null:this.at(c/s,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Fq extends Eq{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new SV(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new tV,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const zq=new Hj,Rq=new Iq,Lq=new mq,Bq=new xj,Oq=new xj,Uq=new xj,Nq=new xj,jq=new xj,Vq=new xj,qq=new xj,Gq=new xj;class Hq extends _V{constructor(e=new bq,t=new Fq){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){const t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const i=this.geometry,n=i.attributes.position,a=i.morphAttributes.position,r=i.morphTargetsRelative;t.fromBufferAttribute(n,e);const s=this.morphTargetInfluences;if(a&&s){Vq.set(0,0,0);for(let i=0,n=a.length;i<n;i++){const n=s[i],o=a[i];0!==n&&(jq.fromBufferAttribute(o,e),r?Vq.addScaledVector(jq,n):Vq.addScaledVector(jq.sub(t),n))}t.add(Vq)}return t}raycast(e,t){const i=this.geometry,n=this.material,a=this.matrixWorld;if(void 0!==n){if(null===i.boundingSphere&&i.computeBoundingSphere(),Lq.copy(i.boundingSphere),Lq.applyMatrix4(a),Rq.copy(e.ray).recast(e.near),!1===Lq.containsPoint(Rq.origin)){if(null===Rq.intersectSphere(Lq,Bq))return;if(Rq.origin.distanceToSquared(Bq)>(e.far-e.near)**2)return}zq.copy(a).invert(),Rq.copy(e.ray).applyMatrix4(zq),null!==i.boundingBox&&!1===Rq.intersectsBox(i.boundingBox)||this._computeIntersections(e,t,Rq)}}_computeIntersections(e,t,i){let n;const a=this.geometry,r=this.material,s=a.index,o=a.attributes.position,l=a.attributes.uv,c=a.attributes.uv1,u=a.attributes.normal,h=a.groups,d=a.drawRange;if(null!==s)if(Array.isArray(r))for(let a=0,o=h.length;a<o;a++){const o=h[a],p=r[o.materialIndex];for(let a=Math.max(o.start,d.start),r=Math.min(s.count,Math.min(o.start+o.count,d.start+d.count));a<r;a+=3){n=Wq(this,p,e,i,l,c,u,s.getX(a),s.getX(a+1),s.getX(a+2)),n&&(n.faceIndex=Math.floor(a/3),n.face.materialIndex=o.materialIndex,t.push(n))}}else{for(let a=Math.max(0,d.start),o=Math.min(s.count,d.start+d.count);a<o;a+=3){n=Wq(this,r,e,i,l,c,u,s.getX(a),s.getX(a+1),s.getX(a+2)),n&&(n.faceIndex=Math.floor(a/3),t.push(n))}}else if(void 0!==o)if(Array.isArray(r))for(let a=0,s=h.length;a<s;a++){const s=h[a],p=r[s.materialIndex];for(let a=Math.max(s.start,d.start),r=Math.min(o.count,Math.min(s.start+s.count,d.start+d.count));a<r;a+=3){n=Wq(this,p,e,i,l,c,u,a,a+1,a+2),n&&(n.faceIndex=Math.floor(a/3),n.face.materialIndex=s.materialIndex,t.push(n))}}else{for(let a=Math.max(0,d.start),s=Math.min(o.count,d.start+d.count);a<s;a+=3){n=Wq(this,r,e,i,l,c,u,a,a+1,a+2),n&&(n.faceIndex=Math.floor(a/3),t.push(n))}}}}function Wq(e,t,i,n,a,r,s,o,l,c){e.getVertexPosition(o,Oq),e.getVertexPosition(l,Uq),e.getVertexPosition(c,Nq);const u=function(e,t,i,n,a,r,s,o){let l;if(l=1===t.side?n.intersectTriangle(s,r,a,!0,o):n.intersectTriangle(a,r,s,0===t.side,o),null===l)return null;Gq.copy(o),Gq.applyMatrix4(e.matrixWorld);const c=i.ray.origin.distanceTo(Gq);return c<i.near||c>i.far?null:{distance:c,point:Gq.clone(),object:e}}(e,t,i,n,Oq,Uq,Nq,qq);if(u){const e=new xj;VV.getBarycoord(qq,Oq,Uq,Nq,e),a&&(u.uv=VV.getInterpolatedAttribute(a,o,l,c,e,new vj)),r&&(u.uv1=VV.getInterpolatedAttribute(r,o,l,c,e,new vj)),s&&(u.normal=VV.getInterpolatedAttribute(s,o,l,c,e,new xj),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const t={a:o,b:l,c:c,normal:new xj,materialIndex:0};VV.getNormal(Oq,Uq,Nq,t.normal),u.face=t,u.barycoord=e}return u}class Zq extends Uj{constructor(e=null,t=1,i=1,n,a,r,s,o,l=1003,c=1003,u,h){super(null,r,s,o,l,c,n,a,u,h),this.isDataTexture=!0,this.image={data:e,width:t,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Kq=new xj,Xq=new xj,Qq=new Ej;class Yq{constructor(e=new xj(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,i){const n=Kq.subVectors(i,t).cross(Xq.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,i=!0){const n=e.delta(Kq),a=this.normal.dot(n);if(0===a)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/a;return!0===i&&(r<0||r>1)?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const i=t||Qq.getNormalMatrix(e),n=this.coplanarPoint(Kq).applyMatrix4(e),a=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Jq=new mq,$q=new vj(.5,.5),eG=new xj;class tG{constructor(e=new Yq,t=new Yq,i=new Yq,n=new Yq,a=new Yq,r=new Yq){this.planes=[e,t,i,n,a,r]}set(e,t,i,n,a,r){const s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(a),s[5].copy(r),this}copy(e){const t=this.planes;for(let i=0;i<6;i++)t[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,t=2e3,i=!1){const n=this.planes,a=e.elements,r=a[0],s=a[1],o=a[2],l=a[3],c=a[4],u=a[5],h=a[6],d=a[7],p=a[8],m=a[9],g=a[10],f=a[11],A=a[12],_=a[13],v=a[14],y=a[15];if(n[0].setComponents(l-r,d-c,f-p,y-A).normalize(),n[1].setComponents(l+r,d+c,f+p,y+A).normalize(),n[2].setComponents(l+s,d+u,f+m,y+_).normalize(),n[3].setComponents(l-s,d-u,f-m,y-_).normalize(),i)n[4].setComponents(o,h,g,v).normalize(),n[5].setComponents(l-o,d-h,f-g,y-v).normalize();else if(n[4].setComponents(l-o,d-h,f-g,y-v).normalize(),t===QN)n[5].setComponents(l+o,d+h,f+g,y+v).normalize();else{if(t!==YN)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(o,h,g,v).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),Jq.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),Jq.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Jq)}intersectsSprite(e){Jq.center.set(0,0,0);const t=$q.distanceTo(e.center);return Jq.radius=.7071067811865476+t,Jq.applyMatrix4(e.matrixWorld),this.intersectsSphere(Jq)}intersectsSphere(e){const t=this.planes,i=e.center,n=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(i)<n)return!1}return!0}intersectsBox(e){const t=this.planes;for(let i=0;i<6;i++){const n=t[i];if(eG.x=n.normal.x>0?e.max.x:e.min.x,eG.y=n.normal.y>0?e.max.y:e.min.y,eG.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(eG)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}class iG extends Eq{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new SV(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const nG=new xj,aG=new xj,rG=new Hj,sG=new Iq,oG=new mq,lG=new xj,cG=new xj;class uG extends _V{constructor(e=new bq,t=new iG){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,i=[0];for(let e=1,n=t.count;e<n;e++)nG.fromBufferAttribute(t,e-1),aG.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=nG.distanceTo(aG);e.setAttribute("lineDistance",new uq(i,1))}else nj("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const i=this.geometry,n=this.matrixWorld,a=e.params.Line.threshold,r=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),oG.copy(i.boundingSphere),oG.applyMatrix4(n),oG.radius+=a,!1===e.ray.intersectsSphere(oG))return;rG.copy(n).invert(),sG.copy(e.ray).applyMatrix4(rG);const s=a/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,l=this.isLineSegments?2:1,c=i.index,u=i.attributes.position;if(null!==c){const i=Math.max(0,r.start),n=Math.min(c.count,r.start+r.count);for(let a=i,r=n-1;a<r;a+=l){const i=c.getX(a),n=c.getX(a+1),r=hG(this,e,sG,o,i,n,a);r&&t.push(r)}if(this.isLineLoop){const a=c.getX(n-1),r=c.getX(i),s=hG(this,e,sG,o,a,r,n-1);s&&t.push(s)}}else{const i=Math.max(0,r.start),n=Math.min(u.count,r.start+r.count);for(let a=i,r=n-1;a<r;a+=l){const i=hG(this,e,sG,o,a,a+1,a);i&&t.push(i)}if(this.isLineLoop){const a=hG(this,e,sG,o,n-1,i,n-1);a&&t.push(a)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=i.length;e<t;e++){const t=i[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function hG(e,t,i,n,a,r,s){const o=e.geometry.attributes.position;nG.fromBufferAttribute(o,a),aG.fromBufferAttribute(o,r);if(i.distanceSqToSegment(nG,aG,lG,cG)>n)return;lG.applyMatrix4(e.matrixWorld);const l=t.ray.origin.distanceTo(lG);return l<t.near||l>t.far?void 0:{distance:l,point:cG.clone().applyMatrix4(e.matrixWorld),index:s,face:null,faceIndex:null,barycoord:null,object:e}}const dG=new xj,pG=new xj;class mG extends uG{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,i=[];for(let e=0,n=t.count;e<n;e+=2)dG.fromBufferAttribute(t,e),pG.fromBufferAttribute(t,e+1),i[e]=0===e?0:i[e-1],i[e+1]=i[e]+dG.distanceTo(pG);e.setAttribute("lineDistance",new uq(i,1))}else nj("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class gG extends Uj{constructor(e,t,i,n,a=1006,r=1006,s,o,l){super(e,t,i,n,a,r,s,o,l),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const c=this;"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(function t(){c.needsUpdate=!0,c._requestVideoFrameCallbackId=e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){0!==this._requestVideoFrameCallbackId&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class fG extends Uj{constructor(e=[],t=301,i,n,a,r,s,o,l,c){super(e,t,i,n,a,r,s,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class AG extends Uj{constructor(e,t,i=1014,n,a,r,s=1003,o=1003,l,c=1026,u=1){if(c!==ZU&&c!==KU)throw new Error("THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:u},n,a,r,s,o,c,i,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Rj(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class _G extends AG{constructor(e,t=1014,i=301,n,a,r=1003,s=1003,o,l=1026){const c={width:e,height:e,depth:1},u=[c,c,c,c,c,c];super(e,e,t,i,n,a,r,s,o,l),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class vG extends Uj{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class yG extends bq{constructor(e=1,t=1,i=1,n=1,a=1,r=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:a,depthSegments:r};const s=this;n=Math.floor(n),a=Math.floor(a),r=Math.floor(r);const o=[],l=[],c=[],u=[];let h=0,d=0;function p(e,t,i,n,a,r,p,m,g,f,A){const _=r/g,v=p/f,y=r/2,x=p/2,b=m/2,w=g+1,E=f+1;let k=0,S=0;const M=new xj;for(let r=0;r<E;r++){const s=r*v-x;for(let o=0;o<w;o++){const h=o*_-y;M[e]=h*n,M[t]=s*a,M[i]=b,l.push(M.x,M.y,M.z),M[e]=0,M[t]=0,M[i]=m>0?1:-1,c.push(M.x,M.y,M.z),u.push(o/g),u.push(1-r/f),k+=1}}for(let e=0;e<f;e++)for(let t=0;t<g;t++){const i=h+t+w*e,n=h+t+w*(e+1),a=h+(t+1)+w*(e+1),r=h+(t+1)+w*e;o.push(i,n,r),o.push(n,a,r),S+=6}s.addGroup(d,S,A),d+=S,h+=k}p("z","y","x",-1,-1,i,t,e,r,a,0),p("z","y","x",1,-1,i,t,-e,r,a,1),p("x","z","y",1,1,e,i,t,n,r,2),p("x","z","y",1,-1,e,i,-t,n,r,3),p("x","y","z",1,-1,e,t,i,n,a,4),p("x","y","z",-1,-1,e,t,-i,n,a,5),this.setIndex(o),this.setAttribute("position",new uq(l,3)),this.setAttribute("normal",new uq(c,3)),this.setAttribute("uv",new uq(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new yG(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class xG extends bq{constructor(e=1,t=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};const a=e/2,r=t/2,s=Math.floor(i),o=Math.floor(n),l=s+1,c=o+1,u=e/s,h=t/o,d=[],p=[],m=[],g=[];for(let e=0;e<c;e++){const t=e*h-r;for(let i=0;i<l;i++){const n=i*u-a;p.push(n,-t,0),m.push(0,0,1),g.push(i/s),g.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<s;t++){const i=t+l*e,n=t+l*(e+1),a=t+1+l*(e+1),r=t+1+l*e;d.push(i,n,r),d.push(n,a,r)}this.setIndex(d),this.setAttribute("position",new uq(p,3)),this.setAttribute("normal",new uq(m,3)),this.setAttribute("uv",new uq(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new xG(e.width,e.height,e.widthSegments,e.heightSegments)}}class bG extends bq{constructor(e=1,t=32,i=16,n=0,a=2*Math.PI,r=0,s=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:a,thetaStart:r,thetaLength:s},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const o=Math.min(r+s,Math.PI);let l=0;const c=[],u=new xj,h=new xj,d=[],p=[],m=[],g=[];for(let d=0;d<=i;d++){const f=[],A=d/i,_=r+A*s,v=e*Math.cos(_),y=Math.sqrt(e*e-v*v);let x=0;0===d&&0===r?x=.5/t:d===i&&o===Math.PI&&(x=-.5/t);for(let e=0;e<=t;e++){const i=e/t,r=n+i*a;u.x=-y*Math.cos(r),u.y=v,u.z=y*Math.sin(r),p.push(u.x,u.y,u.z),h.copy(u).normalize(),m.push(h.x,h.y,h.z),g.push(i+x,1-A),f.push(l++)}c.push(f)}for(let e=0;e<i;e++)for(let n=0;n<t;n++){const t=c[e][n+1],a=c[e][n],s=c[e+1][n],l=c[e+1][n+1];(0!==e||r>0)&&d.push(t,a,l),(e!==i-1||o<Math.PI)&&d.push(a,s,l)}this.setIndex(d),this.setAttribute("position",new uq(p,3)),this.setAttribute("normal",new uq(m,3)),this.setAttribute("uv",new uq(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new bG(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class wG extends bq{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],i=new Set,n=new xj,a=new xj;if(null!==e.index){const r=e.attributes.position,s=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:s.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],c=l.start;for(let e=c,o=c+l.count;e<o;e+=3)for(let o=0;o<3;o++){const l=s.getX(e+o),c=s.getX(e+(o+1)%3);n.fromBufferAttribute(r,l),a.fromBufferAttribute(r,c),!0===EG(n,a,i)&&(t.push(n.x,n.y,n.z),t.push(a.x,a.y,a.z))}}}else{const r=e.attributes.position;for(let e=0,s=r.count/3;e<s;e++)for(let s=0;s<3;s++){const o=3*e+s,l=3*e+(s+1)%3;n.fromBufferAttribute(r,o),a.fromBufferAttribute(r,l),!0===EG(n,a,i)&&(t.push(n.x,n.y,n.z),t.push(a.x,a.y,a.z))}}this.setAttribute("position",new uq(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function EG(e,t,i){const n=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,a=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==i.has(n)&&!0!==i.has(a)&&(i.add(n),i.add(a),!0)}function kG(e){const t={};for(const i in e){t[i]={};for(const n in e[i]){const a=e[i][n];if(MG(a))a.isRenderTargetTexture?(nj("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[i][n]=null):t[i][n]=a.clone();else if(Array.isArray(a))if(MG(a[0])){const e=[];for(let t=0,i=a.length;t<i;t++)e[t]=a[t].clone();t[i][n]=e}else t[i][n]=a.slice();else t[i][n]=a}}return t}function SG(e){const t={};for(let i=0;i<e.length;i++){const n=kG(e[i]);for(const e in n)t[e]=n[e]}return t}function MG(e){return e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture||e.isQuaternion)}function CG(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:Tj.workingColorSpace}const TG={clone:kG,merge:SG};class DG extends Eq{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=kG(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?t.uniforms[i]={type:"t",value:n.toJSON(e).uuid}:n&&n.isColor?t.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?t.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?t.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?t.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?t.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?t.uniforms[i]={type:"m4",value:n.toArray()}:t.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const i={};for(const e in this.extensions)!0===this.extensions[e]&&(i[e]=!0);return Object.keys(i).length>0&&(t.extensions=i),t}fromJSON(e,t){if(super.fromJSON(e,t),void 0!==e.uniforms)for(const i in e.uniforms){const n=e.uniforms[i];switch(this.uniforms[i]={},n.type){case"t":this.uniforms[i].value=t[n.value]||null;break;case"c":this.uniforms[i].value=(new SV).setHex(n.value);break;case"v2":this.uniforms[i].value=(new vj).fromArray(n.value);break;case"v3":this.uniforms[i].value=(new xj).fromArray(n.value);break;case"v4":this.uniforms[i].value=(new Nj).fromArray(n.value);break;case"m3":this.uniforms[i].value=(new Ej).fromArray(n.value);break;case"m4":this.uniforms[i].value=(new Hj).fromArray(n.value);break;default:this.uniforms[i].value=n.value}}if(void 0!==e.defines&&(this.defines=e.defines),void 0!==e.vertexShader&&(this.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(this.fragmentShader=e.fragmentShader),void 0!==e.glslVersion&&(this.glslVersion=e.glslVersion),void 0!==e.extensions)for(const t in e.extensions)this.extensions[t]=e.extensions[t];return void 0!==e.lights&&(this.lights=e.lights),void 0!==e.clipping&&(this.clipping=e.clipping),this}}class PG extends DG{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class IG extends Eq{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class FG extends Eq{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const zG={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(RG(e)||(this.files[e]=t))},get:function(e){if(!1!==this.enabled&&!RG(e))return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function RG(e){try{const t=e.slice(e.indexOf(":")+1);return"blob:"===new URL(t).protocol}catch(e){return!1}}class LG{constructor(e,t,i){const n=this;let a,r=!1,s=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this._abortController=null,this.itemStart=function(e){o++,!1===r&&void 0!==n.onStart&&n.onStart(e,s,o),r=!0},this.itemEnd=function(e){s++,void 0!==n.onProgress&&n.onProgress(e,s,o),s===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return e=e.normalize("NFC"),a?a(e):e},this.setURLModifier=function(e){return a=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,i=l.length;t<i;t+=2){const i=l[t],n=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return n}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const BG=new LG;let OG=class{constructor(e){this.manager=void 0!==e?e:BG,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const i=this;return new Promise(function(n,a){i.load(e,n,t,a)})}parse(){}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}abort(){return this}};OG.DEFAULT_MATERIAL_NAME="__DEFAULT";const UG={};class NG extends Error{constructor(e,t){super(e),this.response=t}}class jG extends OG{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,i,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const a=zG.get(`file:${e}`);if(void 0!==a)return this.manager.itemStart(e),void setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0);if(void 0!==UG[e])return void UG[e].push({onLoad:t,onProgress:i,onError:n});UG[e]=[],UG[e].push({onLoad:t,onProgress:i,onError:n});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:"function"==typeof AbortSignal.any?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),s=this.mimeType,o=this.responseType;fetch(r).then(t=>{if(200===t.status||0===t.status){if(0===t.status&&nj("FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const i=UG[e],n=t.body.getReader(),a=t.headers.get("X-File-Size")||t.headers.get("Content-Length"),r=a?parseInt(a):0,s=0!==r;let o=0;const l=new ReadableStream({start(e){!function t(){n.read().then(({done:n,value:a})=>{if(n)e.close();else{o+=a.byteLength;const n=new ProgressEvent("progress",{lengthComputable:s,loaded:o,total:r});for(let e=0,t=i.length;e<t;e++){const t=i[e];t.onProgress&&t.onProgress(n)}e.enqueue(a),t()}},t=>{e.error(t)})}()}});return new Response(l)}throw new NG(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then(e=>(new DOMParser).parseFromString(e,s));case"json":return e.json();default:if(""===s)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(s),i=t&&t[1]?t[1].toLowerCase():void 0,n=new TextDecoder(i);return e.arrayBuffer().then(e=>n.decode(e))}}}).then(t=>{zG.add(`file:${e}`,t);const i=UG[e];delete UG[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];n.onLoad&&n.onLoad(t)}}).catch(t=>{const i=UG[e];if(void 0===i)throw this.manager.itemError(e),t;delete UG[e];for(let e=0,n=i.length;e<n;e++){const n=i[e];n.onError&&n.onError(t)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}const VG=new WeakMap;class qG extends OG{constructor(e){super(e)}load(e,t,i,n){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,r=zG.get(`image:${e}`);if(void 0!==r){if(!0===r.complete)a.manager.itemStart(e),setTimeout(function(){t&&t(r),a.manager.itemEnd(e)},0);else{let e=VG.get(r);void 0===e&&(e=[],VG.set(r,e)),e.push({onLoad:t,onError:n})}return r}const s=JN("img");function o(){c(),t&&t(this);const i=VG.get(this)||[];for(let e=0;e<i.length;e++){const t=i[e];t.onLoad&&t.onLoad(this)}VG.delete(this),a.manager.itemEnd(e)}function l(t){c(),n&&n(t),zG.remove(`image:${e}`);const i=VG.get(this)||[];for(let e=0;e<i.length;e++){const n=i[e];n.onError&&n.onError(t)}VG.delete(this),a.manager.itemError(e),a.manager.itemEnd(e)}function c(){s.removeEventListener("load",o,!1),s.removeEventListener("error",l,!1)}return s.addEventListener("load",o,!1),s.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),zG.add(`image:${e}`,s),a.manager.itemStart(e),s.src=e,s}}const GG=new xj,HG=new yj,WG=new xj;class ZG extends _V{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Hj,this.projectionMatrix=new Hj,this.projectionMatrixInverse=new Hj,this.coordinateSystem=QN,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(GG,HG,WG),1===WG.x&&1===WG.y&&1===WG.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(GG,HG,WG.set(1,1,1)).invert()}updateWorldMatrix(e,t,i=!1){super.updateWorldMatrix(e,t,i),this.matrixWorld.decompose(GG,HG,WG),1===WG.x&&1===WG.y&&1===WG.z?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(GG,HG,WG.set(1,1,1)).invert()}clone(){return(new this.constructor).copy(this)}}const KG=new xj,XG=new vj,QG=new vj;class YG extends ZG{constructor(e=50,t=1,i=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*hj*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*uj*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*hj*Math.atan(Math.tan(.5*uj*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,i){KG.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(KG.x,KG.y).multiplyScalar(-e/KG.z),KG.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(KG.x,KG.y).multiplyScalar(-e/KG.z)}getViewSize(e,t){return this.getViewBounds(e,XG,QG),t.subVectors(QG,XG)}setViewOffset(e,t,i,n,a,r){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*uj*this.fov)/this.zoom,i=2*t,n=this.aspect*i,a=-.5*n;const r=this.view;if(null!==this.view&&this.view.enabled){const e=r.fullWidth,s=r.fullHeight;a+=r.offsetX*n/e,t-=r.offsetY*i/s,n*=r.width/e,i*=r.height/s}const s=this.filmOffset;0!==s&&(a+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,t,t-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class JG extends ZG{constructor(e=-1,t=1,i=1,n=-1,a=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=a,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,i,n,a,r){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=i,this.view.offsetY=n,this.view.width=a,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let a=i-e,r=i+e,s=n+t,o=n-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=e*this.view.offsetX,r=a+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}this.projectionMatrix.makeOrthographic(a,r,s,o,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const $G=-90;class eH extends _V{constructor(e,t,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const n=new YG($G,1,e,t);n.layers=this.layers,this.add(n);const a=new YG($G,1,e,t);a.layers=this.layers,this.add(a);const r=new YG($G,1,e,t);r.layers=this.layers,this.add(r);const s=new YG($G,1,e,t);s.layers=this.layers,this.add(s);const o=new YG($G,1,e,t);o.layers=this.layers,this.add(o);const l=new YG($G,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[i,n,a,r,s,o]=t;for(const e of t)this.remove(e);if(e===QN)i.up.set(0,1,0),i.lookAt(1,0,0),n.up.set(0,1,0),n.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),r.up.set(0,0,1),r.lookAt(0,-1,0),s.up.set(0,1,0),s.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(e!==YN)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);i.up.set(0,-1,0),i.lookAt(-1,0,0),n.up.set(0,-1,0),n.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),r.up.set(0,0,-1),r.lookAt(0,-1,0),s.up.set(0,-1,0),s.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:n}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,r,s,o,l,c]=this.children,u=e.getRenderTarget(),h=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1;let g=!1;g=!0===e.isWebGLRenderer?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(i,0,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,a),e.setRenderTarget(i,1,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,r),e.setRenderTarget(i,2,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,s),e.setRenderTarget(i,3,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,o),e.setRenderTarget(i,4,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,l),i.texture.generateMipmaps=m,e.setRenderTarget(i,5,n),g&&!1===e.autoClear&&e.clearDepth(),e.render(t,c),e.setRenderTarget(u,h,d),e.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class tH extends YG{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}const iH=new Hj;class nH{constructor(e,t,i=0,n=1/0){this.ray=new Iq(e,t),this.near=i,this.far=n,this.camera=null,this.layers=new iV,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,t.projectionMatrix.elements[14]).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):aj("Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return iH.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(iH),this}intersectObject(e,t=!0,i=[]){return rH(e,this,i,t),i.sort(aH),i}intersectObjects(e,t=!0,i=[]){for(let n=0,a=e.length;n<a;n++)rH(e[n],this,i,t);return i.sort(aH),i}}function aH(e,t){return e.distance-t.distance}function rH(e,t,i,n){let a=!0;if(e.layers.test(t.layers)){!1===e.raycast(t,i)&&(a=!1)}if(!0===a&&!0===n){const n=e.children;for(let e=0,a=n.length;e<a;e++)rH(n[e],t,i,!0)}}class sH{static{sH.prototype.isMatrix2=!0}constructor(e,t,i,n){this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,i,n)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let i=0;i<4;i++)this.elements[i]=e[i+t];return this}set(e,t,i,n){const a=this.elements;return a[0]=e,a[2]=t,a[1]=i,a[3]=n,this}}function oH(e,t,i,n){const a=function(e){switch(e){case FU:case zU:return{byteLength:1,components:1};case LU:case RU:case NU:return{byteLength:2,components:1};case jU:case VU:return{byteLength:2,components:4};case OU:case BU:case UU:return{byteLength:4,components:1};case GU:case HU:return{byteLength:4,components:3}}throw new Error(`THREE.TextureUtils: Unknown texture type ${e}.`)}(n);switch(i){case 1021:return e*t;case 1028:case XU:return e*t/a.components*a.byteLength;case QU:case YU:return e*t*2/a.components*a.byteLength;case 1022:return e*t*3/a.components*a.byteLength;case WU:case JU:return e*t*4/a.components*a.byteLength;case $U:case eN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case tN:case iN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case aN:case sN:return Math.max(e,16)*Math.max(t,8)/4;case nN:case rN:return Math.max(e,8)*Math.max(t,8)/2;case oN:case lN:case uN:case hN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case cN:case dN:case pN:case mN:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case gN:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case fN:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case AN:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case _N:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case vN:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case yN:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case xN:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case bN:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case wN:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case EN:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case kN:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case SN:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case MN:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case CN:case TN:case DN:return Math.ceil(e/4)*Math.ceil(t/4)*16;case PN:case IN:return Math.ceil(e/4)*Math.ceil(t/4)*8;case FN:case zN:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${i} format.`)}
|
|
41
41
|
/**
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2010-2026 Three.js Authors
|