diff --git a/app/public/drops/endless-journal/assets/index-D22DIc1j.js b/app/public/drops/endless-journal/assets/index-9EwT6NAf.js similarity index 100% rename from app/public/drops/endless-journal/assets/index-D22DIc1j.js rename to app/public/drops/endless-journal/assets/index-9EwT6NAf.js diff --git a/app/public/drops/endless-journal/assets/index-CjZd22yH.css b/app/public/drops/endless-journal/assets/index-PMwlnwUr.css similarity index 85% rename from app/public/drops/endless-journal/assets/index-CjZd22yH.css rename to app/public/drops/endless-journal/assets/index-PMwlnwUr.css index 1d5abb0..90e0e28 100644 --- a/app/public/drops/endless-journal/assets/index-CjZd22yH.css +++ b/app/public/drops/endless-journal/assets/index-PMwlnwUr.css @@ -1 +1 @@ -:root{--ivory:#fefdfc;--ivory-shade:#ecebea;--sand:#f7f4ef;--sand-shade:#b9b7b3;--charcoal:#181818;--charcoal-shade:#2a2a2a;--forest:#053f0a;--forest-shade:#f6fff6;--clay:#fa3812;--clay-shade:#ffefec;--sea:#1253fa;--sea-shade:#f0f8ff;--grey-700:#565656;--grey-600:#747474;--grey-500:#a3a3a3;--grey-400:#d1d1d1}:root .theme-light{--theme-bg:#fefdfc;--theme-fg:#181818;--theme-layout:#f7f4ef;--theme-grey:#747474;--theme-shade:#ecebea;--theme-contrast:#fa3812}:root .theme-dark{--theme-bg:#181818;--theme-fg:#fefdfc;--theme-layout:#f7f4ef;--theme-grey:#a3a3a3;--theme-shade:#2a2a2a;--theme-contrast:#fa3812}:root{--ease-in-quad:cubic-bezier(.55, .085, .68, .53);--ease-in-cubic:cubic-bezier(.55, .055, .675, .19);--ease-in-quart:cubic-bezier(.895, .03, .685, .22);--ease-in-quint:cubic-bezier(.755, .05, .855, .06);--ease-in-expo:cubic-bezier(.95, .05, .795, .035);--ease-in-circ:cubic-bezier(.6, .04, .98, .335);--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-cubic:cubic-bezier(.215, .61, .355, 1);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-quint:cubic-bezier(.23, 1, .32, 1);--ease-out-expo:cubic-bezier(.19, 1, .22, 1);--ease-out-circ:cubic-bezier(.075, .82, .165, 1);--ease-in-out-quad:cubic-bezier(.455, .03, .515, .955);--ease-in-out-cubic:cubic-bezier(.645, .045, .355, 1);--ease-in-out-quart:cubic-bezier(.77, 0, .175, 1);--ease-in-out-quint:cubic-bezier(.86, 0, .07, 1);--ease-in-out-expo:cubic-bezier(1, 0, 0, 1);--ease-in-out-circ:cubic-bezier(.785, .135, .15, .86)}:where(:not(html,iframe,canvas,img,svg,video,audio):not(svg *,symbol *)){all:unset;display:revert}*,:before,:after{box-sizing:border-box}a,button{cursor:revert}img{max-block-size:100%;max-inline-size:100%}table{border-collapse:collapse}input,textarea{-webkit-user-select:auto}textarea{white-space:revert}meter{appearance:revert}:where(pre){all:revert}::placeholder{color:unset}::marker{content:initial}:where([hidden]){display:none}:where([contenteditable]:not([contenteditable=false])){-moz-user-modify:read-write;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space;-webkit-user-select:auto}:where([draggable=true]){-webkit-user-drag:element}:where(dialog:modal){all:revert}@font-face{font-family:Instrument Serif;font-style:italic;font-weight:400;src:url(/drops/endless-journal/assets/instrument-serif-italic-Cnq-0GR0.woff2)format("woff2"),url(/drops/endless-journal/assets/instrument-serif-italic-CpREEq8K.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:400;src:url(/drops/endless-journal/assets/hanken-grotesk-BB3emo1n.woff2)format("woff2"),url(/drops/endless-journal/assets/hanken-grotesk-NweiADIQ.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:italic;font-weight:400;src:url(/drops/endless-journal/assets/hanken-grotesk-italic-jl8TIPSn.woff2)format("woff2"),url(/drops/endless-journal/assets/hanken-grotesk-italic-C_HjJa0S.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:600;src:url(/drops/endless-journal/assets/hanken-grotesk-semibold-TK-BXOrb.woff2)format("woff2"),url(/drops/endless-journal/assets/hanken-grotesk-semibold-vPR5A_Tb.woff)format("woff")}@font-face{font-family:Iosevka Charon Mono;font-style:normal;font-weight:700;src:url(/drops/endless-journal/assets/iosevka-charon-mono-bold-1nweGISG.woff2)format("woff2"),url(/drops/endless-journal/assets/iosevka-charon-mono-bold-DN5oOlAE.woff)format("woff")}:root{--font-serif:"Instrument Serif", serif;--font-sans:"Hanken Grotesk", sans-serif;--font-mono:"Iosevka Charon Mono", monospace;--layout-column-count:12;--layout-column-gap:20px;--layout-margin:20px;--layout-width:calc(100vw - (2 * var(--layout-margin)));--layout-column-width:calc(( var(--layout-width) - ((var(--layout-column-count) - 1) * var(--layout-column-gap)) ) / var(--layout-column-count))}.layout-block,.layout-grid{padding-left:var(--layout-margin);padding-right:var(--layout-margin);width:100%}.layout-grid{grid-template-columns:repeat(var(--layout-column-count), minmax(0, 1fr));grid-gap:var(--layout-column-gap);display:grid}html,html *{scrollbar-width:none!important;-ms-overflow-style:none!important}html::-webkit-scrollbar{width:0!important;height:0!important}html ::-webkit-scrollbar{width:0!important;height:0!important}:root{font-family:var(--font-sans), Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;background:var(--ivory);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{min-height:100vh;margin:0}.h1,h1{font-family:var(--font-serif);font-size:max(8vw,128px);font-style:italic;font-weight:400;line-height:1}.h2,h2{font-family:var(--font-serif);font-size:max(4vw,64px);font-style:italic;font-weight:400;line-height:1}.h3,h3{font-family:var(--font-serif);font-size:max(3vw,48px);font-style:italic;font-weight:400;line-height:1}.h4,h4{font-family:var(--font-serif);font-size:max(2vw,32px);font-style:italic;font-weight:400;line-height:1}.p,p,a,li{font-family:var(--font-sans);font-size:max(1vw,16px);font-weight:400;line-height:1.25}.label,label,button,pre{font-family:var(--font-mono);text-transform:uppercase;font-size:max(.875vw,14px);font-weight:700;line-height:1}.bold{font-weight:700}#app{min-height:100vh}button{cursor:pointer}::selection{color:var(--theme-bg);background:var(--theme-fg)}::selection{color:var(--theme-bg);background:var(--theme-fg)}.endless-journal-physics{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.endless-journal-physics .container{pointer-events:none;position:absolute;inset:0}.endless-journal{justify-content:center;align-items:center;height:100%;display:flex}.endless-journal .input{border:1px solid var(--theme-fg);opacity:0;position:absolute;top:20vh}.endless-journal .cursor{background:var(--theme-fg);opacity:.2;z-index:2;width:max(.625vw,10px);height:max(6.25vw,100px);animation:1s infinite cursor;position:absolute;top:15vh}.endless-journal .fill-line{padding:0 var(--layout-margin);z-index:2;position:absolute;left:0;right:0}.endless-journal .fill-line h6{text-transform:uppercase;color:var(--theme-grey);font-weight:400}.endless-journal .fill-line .line{background:var(--theme-grey);height:2px;position:absolute;bottom:-1em;left:0;right:0}.endless-journal .fill-line.one{bottom:20vh}.endless-journal .fill-line.two{bottom:40vh}.endless-journal .fill-line.three{bottom:60vh}@keyframes cursor{5%{opacity:0}40%{opacity:0}60%{opacity:.2}95%{opacity:.2}}main.drop{background:var(--theme-bg);color:var(--theme-fg);height:100vh} +:root{--ivory:#fefdfc;--ivory-shade:#ecebea;--sand:#f7f4ef;--sand-shade:#b9b7b3;--charcoal:#181818;--charcoal-shade:#2a2a2a;--forest:#053f0a;--forest-shade:#f6fff6;--clay:#fa3812;--clay-shade:#ffefec;--sea:#1253fa;--sea-shade:#f0f8ff;--grey-700:#565656;--grey-600:#747474;--grey-500:#a3a3a3;--grey-400:#d1d1d1}:root .theme-light{--theme-bg:#fefdfc;--theme-fg:#181818;--theme-layout:#f7f4ef;--theme-grey:#747474;--theme-shade:#ecebea;--theme-contrast:#fa3812}:root .theme-dark{--theme-bg:#181818;--theme-fg:#fefdfc;--theme-layout:#f7f4ef;--theme-grey:#a3a3a3;--theme-shade:#2a2a2a;--theme-contrast:#fa3812}:root{--ease-in-quad:cubic-bezier(.55, .085, .68, .53);--ease-in-cubic:cubic-bezier(.55, .055, .675, .19);--ease-in-quart:cubic-bezier(.895, .03, .685, .22);--ease-in-quint:cubic-bezier(.755, .05, .855, .06);--ease-in-expo:cubic-bezier(.95, .05, .795, .035);--ease-in-circ:cubic-bezier(.6, .04, .98, .335);--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-cubic:cubic-bezier(.215, .61, .355, 1);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-quint:cubic-bezier(.23, 1, .32, 1);--ease-out-expo:cubic-bezier(.19, 1, .22, 1);--ease-out-circ:cubic-bezier(.075, .82, .165, 1);--ease-in-out-quad:cubic-bezier(.455, .03, .515, .955);--ease-in-out-cubic:cubic-bezier(.645, .045, .355, 1);--ease-in-out-quart:cubic-bezier(.77, 0, .175, 1);--ease-in-out-quint:cubic-bezier(.86, 0, .07, 1);--ease-in-out-expo:cubic-bezier(1, 0, 0, 1);--ease-in-out-circ:cubic-bezier(.785, .135, .15, .86)}:where(:not(html,iframe,canvas,img,svg,video,audio):not(svg *,symbol *)){all:unset;display:revert}*,:before,:after{box-sizing:border-box}a,button{cursor:revert}img{max-block-size:100%;max-inline-size:100%}table{border-collapse:collapse}input,textarea{-webkit-user-select:auto}textarea{white-space:revert}meter{appearance:revert}:where(pre){all:revert}::placeholder{color:unset}::marker{content:initial}:where([hidden]){display:none}:where([contenteditable]:not([contenteditable=false])){-moz-user-modify:read-write;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space;-webkit-user-select:auto}:where([draggable=true]){-webkit-user-drag:element}:where(dialog:modal){all:revert}@font-face{font-family:Instrument Serif;font-style:italic;font-weight:400;src:url(/drops/endless-journal/assets/instrument-serif-italic-Cnq-0GR0.woff2)format("woff2"),url(/drops/endless-journal/assets/instrument-serif-italic-CpREEq8K.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:400;src:url(/drops/endless-journal/assets/hanken-grotesk-BB3emo1n.woff2)format("woff2"),url(/drops/endless-journal/assets/hanken-grotesk-NweiADIQ.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:italic;font-weight:400;src:url(/drops/endless-journal/assets/hanken-grotesk-italic-jl8TIPSn.woff2)format("woff2"),url(/drops/endless-journal/assets/hanken-grotesk-italic-C_HjJa0S.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:600;src:url(/drops/endless-journal/assets/hanken-grotesk-semibold-TK-BXOrb.woff2)format("woff2"),url(/drops/endless-journal/assets/hanken-grotesk-semibold-vPR5A_Tb.woff)format("woff")}@font-face{font-family:Iosevka Charon Mono;font-style:normal;font-weight:700;src:url(/drops/endless-journal/assets/iosevka-charon-mono-bold-1nweGISG.woff2)format("woff2"),url(/drops/endless-journal/assets/iosevka-charon-mono-bold-DN5oOlAE.woff)format("woff")}:root{--font-serif:"Instrument Serif", serif;--font-sans:"Hanken Grotesk", sans-serif;--font-mono:"Iosevka Charon Mono", monospace;--layout-column-count:12;--layout-column-gap:20px;--layout-margin:20px;--layout-width:calc(100vw - (2 * var(--layout-margin)));--layout-column-width:calc(( var(--layout-width) - ((var(--layout-column-count) - 1) * var(--layout-column-gap)) ) / var(--layout-column-count))}.layout-block,.layout-grid{padding-left:var(--layout-margin);padding-right:var(--layout-margin);width:100%}.layout-grid{grid-template-columns:repeat(var(--layout-column-count), minmax(0, 1fr));grid-gap:var(--layout-column-gap);display:grid}html,html *{scrollbar-width:none!important;-ms-overflow-style:none!important}html::-webkit-scrollbar{width:0!important;height:0!important}html ::-webkit-scrollbar{width:0!important;height:0!important}:root{font-family:var(--font-sans), Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;background:var(--ivory);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{min-height:100vh;margin:0}.h1,h1{font-family:var(--font-serif);font-size:max(8vw,128px);font-style:italic;font-weight:400;line-height:1}.h2,h2{font-family:var(--font-serif);font-size:max(4vw,64px);font-style:italic;font-weight:400;line-height:1}.h3,h3{font-family:var(--font-serif);font-size:max(3vw,48px);font-style:italic;font-weight:400;line-height:1}.h4,h4{font-family:var(--font-serif);font-size:max(2vw,32px);font-style:italic;font-weight:400;line-height:1}.p,p,a,li{font-family:var(--font-sans);font-size:max(1vw,16px);font-weight:400;line-height:1.25}.label,label,button,pre{font-family:var(--font-mono);text-transform:uppercase;font-size:max(.875vw,14px);font-weight:700;line-height:1}.bold{font-weight:700}#app{min-height:100vh}button{cursor:pointer}::selection{color:var(--theme-bg);background:var(--theme-fg)}::selection{color:var(--theme-bg);background:var(--theme-fg)}.endless-journal-physics{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.endless-journal-physics .container{pointer-events:none;position:absolute;inset:5px}.endless-journal{justify-content:center;align-items:center;height:100vh;display:flex}.endless-journal .input{border:1px solid var(--theme-fg);opacity:0;position:absolute;top:20vh}.endless-journal .cursor{background:var(--theme-fg);opacity:.2;z-index:2;width:max(.625vw,10px);height:max(6.25vw,100px);animation:1s infinite cursor;position:absolute;top:15vh}.endless-journal .fill-line{padding:0 var(--layout-margin);z-index:2;position:absolute;left:0;right:0}.endless-journal .fill-line h6{text-transform:uppercase;color:var(--theme-grey);font-weight:400}.endless-journal .fill-line .line{background:var(--theme-grey);height:2px;position:absolute;bottom:-1em;left:0;right:0}.endless-journal .fill-line.one{bottom:20vh}.endless-journal .fill-line.two{bottom:40vh}.endless-journal .fill-line.three{bottom:60vh}@keyframes cursor{5%{opacity:0}40%{opacity:0}60%{opacity:.2}95%{opacity:.2}}main.drop{background:var(--theme-bg);color:var(--theme-fg);height:100vh;overflow:hidden} diff --git a/app/public/drops/endless-journal/index.html b/app/public/drops/endless-journal/index.html index c144df3..57d3e9b 100644 --- a/app/public/drops/endless-journal/index.html +++ b/app/public/drops/endless-journal/index.html @@ -5,8 +5,8 @@ Endless Journal - - + +
diff --git a/app/public/drops/endless-journal/meta.json b/app/public/drops/endless-journal/meta.json index d2fa288..663e717 100644 --- a/app/public/drops/endless-journal/meta.json +++ b/app/public/drops/endless-journal/meta.json @@ -13,7 +13,7 @@ "content": [ { "type": "text", - "text": " Creativity is following the thread of intuition and seeing where it goes. It's about being in the moment and not looking back." + "text": "Creativity is following the thread of intuition and seeing where it goes. It's about being in the moment and not looking back." } ] }, @@ -121,4 +121,4 @@ ] }, "published": true -} \ No newline at end of file +} diff --git a/app/public/drops/image-melody/assets/hanken-grotesk-BB3emo1n.woff2 b/app/public/drops/image-melody/assets/hanken-grotesk-BB3emo1n.woff2 new file mode 100644 index 0000000..fd3c8a2 Binary files /dev/null and b/app/public/drops/image-melody/assets/hanken-grotesk-BB3emo1n.woff2 differ diff --git a/app/public/drops/image-melody/assets/hanken-grotesk-NweiADIQ.woff b/app/public/drops/image-melody/assets/hanken-grotesk-NweiADIQ.woff new file mode 100644 index 0000000..f95aff0 Binary files /dev/null and b/app/public/drops/image-melody/assets/hanken-grotesk-NweiADIQ.woff differ diff --git a/app/public/drops/image-melody/assets/hanken-grotesk-italic-C_HjJa0S.woff b/app/public/drops/image-melody/assets/hanken-grotesk-italic-C_HjJa0S.woff new file mode 100644 index 0000000..c3be08e Binary files /dev/null and b/app/public/drops/image-melody/assets/hanken-grotesk-italic-C_HjJa0S.woff differ diff --git a/app/public/drops/image-melody/assets/hanken-grotesk-italic-jl8TIPSn.woff2 b/app/public/drops/image-melody/assets/hanken-grotesk-italic-jl8TIPSn.woff2 new file mode 100644 index 0000000..290394e Binary files /dev/null and b/app/public/drops/image-melody/assets/hanken-grotesk-italic-jl8TIPSn.woff2 differ diff --git a/app/public/drops/image-melody/assets/hanken-grotesk-semibold-TK-BXOrb.woff2 b/app/public/drops/image-melody/assets/hanken-grotesk-semibold-TK-BXOrb.woff2 new file mode 100644 index 0000000..19e1415 Binary files /dev/null and b/app/public/drops/image-melody/assets/hanken-grotesk-semibold-TK-BXOrb.woff2 differ diff --git a/app/public/drops/image-melody/assets/hanken-grotesk-semibold-vPR5A_Tb.woff b/app/public/drops/image-melody/assets/hanken-grotesk-semibold-vPR5A_Tb.woff new file mode 100644 index 0000000..d6ae07c Binary files /dev/null and b/app/public/drops/image-melody/assets/hanken-grotesk-semibold-vPR5A_Tb.woff differ diff --git a/app/public/drops/image-melody/assets/index-CmoBfZze.css b/app/public/drops/image-melody/assets/index-CmoBfZze.css new file mode 100644 index 0000000..deb8e26 --- /dev/null +++ b/app/public/drops/image-melody/assets/index-CmoBfZze.css @@ -0,0 +1 @@ +:root{--ivory:#fefdfc;--ivory-shade:#ecebea;--sand:#f7f4ef;--sand-shade:#b9b7b3;--charcoal:#181818;--charcoal-shade:#2a2a2a;--forest:#053f0a;--forest-shade:#f6fff6;--clay:#fa3812;--clay-shade:#ffefec;--sea:#1253fa;--sea-shade:#f0f8ff;--grey-700:#565656;--grey-600:#747474;--grey-500:#a3a3a3;--grey-400:#d1d1d1}:root .theme-light{--theme-bg:#fefdfc;--theme-fg:#181818;--theme-layout:#f7f4ef;--theme-grey:#747474;--theme-shade:#ecebea;--theme-contrast:#fa3812}:root .theme-dark{--theme-bg:#181818;--theme-fg:#fefdfc;--theme-layout:#f7f4ef;--theme-grey:#a3a3a3;--theme-shade:#2a2a2a;--theme-contrast:#fa3812}:root{--ease-in-quad:cubic-bezier(.55, .085, .68, .53);--ease-in-cubic:cubic-bezier(.55, .055, .675, .19);--ease-in-quart:cubic-bezier(.895, .03, .685, .22);--ease-in-quint:cubic-bezier(.755, .05, .855, .06);--ease-in-expo:cubic-bezier(.95, .05, .795, .035);--ease-in-circ:cubic-bezier(.6, .04, .98, .335);--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-cubic:cubic-bezier(.215, .61, .355, 1);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-quint:cubic-bezier(.23, 1, .32, 1);--ease-out-expo:cubic-bezier(.19, 1, .22, 1);--ease-out-circ:cubic-bezier(.075, .82, .165, 1);--ease-in-out-quad:cubic-bezier(.455, .03, .515, .955);--ease-in-out-cubic:cubic-bezier(.645, .045, .355, 1);--ease-in-out-quart:cubic-bezier(.77, 0, .175, 1);--ease-in-out-quint:cubic-bezier(.86, 0, .07, 1);--ease-in-out-expo:cubic-bezier(1, 0, 0, 1);--ease-in-out-circ:cubic-bezier(.785, .135, .15, .86)}:where(:not(html,iframe,canvas,img,svg,video,audio):not(svg *,symbol *)){all:unset;display:revert}*,:before,:after{box-sizing:border-box}a,button{cursor:revert}img{max-block-size:100%;max-inline-size:100%}table{border-collapse:collapse}input,textarea{-webkit-user-select:auto}textarea{white-space:revert}meter{appearance:revert}:where(pre){all:revert}::placeholder{color:unset}::marker{content:initial}:where([hidden]){display:none}:where([contenteditable]:not([contenteditable=false])){-moz-user-modify:read-write;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space;-webkit-user-select:auto}:where([draggable=true]){-webkit-user-drag:element}:where(dialog:modal){all:revert}@font-face{font-family:Instrument Serif;font-style:italic;font-weight:400;src:url(/drops/image-melody/assets/instrument-serif-italic-Cnq-0GR0.woff2)format("woff2"),url(/drops/image-melody/assets/instrument-serif-italic-CpREEq8K.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:400;src:url(/drops/image-melody/assets/hanken-grotesk-BB3emo1n.woff2)format("woff2"),url(/drops/image-melody/assets/hanken-grotesk-NweiADIQ.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:italic;font-weight:400;src:url(/drops/image-melody/assets/hanken-grotesk-italic-jl8TIPSn.woff2)format("woff2"),url(/drops/image-melody/assets/hanken-grotesk-italic-C_HjJa0S.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:600;src:url(/drops/image-melody/assets/hanken-grotesk-semibold-TK-BXOrb.woff2)format("woff2"),url(/drops/image-melody/assets/hanken-grotesk-semibold-vPR5A_Tb.woff)format("woff")}@font-face{font-family:Iosevka Charon Mono;font-style:normal;font-weight:700;src:url(/drops/image-melody/assets/iosevka-charon-mono-bold-1nweGISG.woff2)format("woff2"),url(/drops/image-melody/assets/iosevka-charon-mono-bold-DN5oOlAE.woff)format("woff")}:root{--font-serif:"Instrument Serif", serif;--font-sans:"Hanken Grotesk", sans-serif;--font-mono:"Iosevka Charon Mono", monospace;--layout-column-count:12;--layout-column-gap:20px;--layout-margin:20px;--layout-width:calc(100vw - (2 * var(--layout-margin)));--layout-column-width:calc(( var(--layout-width) - ((var(--layout-column-count) - 1) * var(--layout-column-gap)) ) / var(--layout-column-count))}.layout-block,.layout-grid{padding-left:var(--layout-margin);padding-right:var(--layout-margin);width:100%}.layout-grid{grid-template-columns:repeat(var(--layout-column-count), minmax(0, 1fr));grid-gap:var(--layout-column-gap);display:grid}html,html *{scrollbar-width:none!important;-ms-overflow-style:none!important}html::-webkit-scrollbar{width:0!important;height:0!important}html ::-webkit-scrollbar{width:0!important;height:0!important}:root{font-family:var(--font-sans), Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;background:var(--ivory);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{min-height:100vh;margin:0}.h1,h1{font-family:var(--font-serif);font-size:max(8vw,128px);font-style:italic;font-weight:400;line-height:1}.h2,h2{font-family:var(--font-serif);font-size:max(4vw,64px);font-style:italic;font-weight:400;line-height:1}.h3,h3{font-family:var(--font-serif);font-size:max(3vw,48px);font-style:italic;font-weight:400;line-height:1}.h4,h4{font-family:var(--font-serif);font-size:max(2vw,32px);font-style:italic;font-weight:400;line-height:1}.p,p,a,li{font-family:var(--font-sans);font-size:max(1vw,16px);font-weight:400;line-height:1.25}.label,label,button,pre{font-family:var(--font-mono);text-transform:uppercase;font-size:max(.875vw,14px);font-weight:700;line-height:1}.bold{font-weight:700}#app{min-height:100vh}button{cursor:pointer}::selection{color:var(--theme-bg);background:var(--theme-fg)}::selection{color:var(--theme-bg);background:var(--theme-fg)}.btn{--t-duration:.35s;--t-ease:var(--ease-out-quad);background:var(--theme-contrast);color:var(--ivory);cursor:pointer;transition:color var(--t-duration) var(--t-ease);border-radius:max(.5vw,8px);align-items:center;padding:max(.375vw,6px) max(1vw,16px);display:inline-flex;position:relative;overflow:hidden}.btn .leading-icon{opacity:0;width:max(.625vw,10px);height:1em;transition:transform var(--t-duration) var(--t-ease), opacity var(--t-duration) var(--t-ease);align-items:center;display:flex;position:absolute;transform:translate(-100%)}.btn .text{width:100%;transition:transform var(--t-duration) var(--t-ease);display:block;position:relative;overflow:hidden}.btn .text span{transition:transform var(--t-duration) var(--t-ease);font-family:var(--font-mono);text-transform:uppercase;font-size:max(.875vw,14px);font-weight:700;line-height:1;display:inline-block}.btn .text span:first-child{color:var(--ivory)}.btn .text span:last-child{color:var(--ivory);position:absolute;bottom:0;left:0;right:0;transform:translateY(105%)}.btn .arrow{transition:transform var(--t-duration) var(--t-ease), opacity var(--t-duration) var(--t-ease)}.btn .arrow:not(:only-child){margin-left:.5em}.btn .loading{align-items:center;width:max(.625vw,10px);height:1em;display:flex}.btn .loading svg{width:100%;height:auto}.btn:before{content:"";background:var(--theme-contrast);clip-path:inset(100% 0 0);transition:clip-path var(--t-duration) var(--t-ease);display:block;position:absolute;inset:-2px}.btn:hover,.btn.active,.btn.router-link-active{color:var(--ivory)}.btn:hover:before,.btn.active:before,.btn.router-link-active:before{clip-path:inset(0)}.btn:hover .text span:first-child,.btn.active .text span:first-child,.btn.router-link-active .text span:first-child{transform:translateY(-105%)}.btn:hover .text span:last-child,.btn.active .text span:last-child,.btn.router-link-active .text span:last-child{transform:none}.btn:hover.text-icon .leading-icon,.btn.active.text-icon .leading-icon,.btn.router-link-active.text-icon .leading-icon{opacity:1;transform:none}.btn:hover.text-icon .text,.btn.active.text-icon .text,.btn.router-link-active.text-icon .text{transform:translate(1.5em)}.btn:hover.text-icon .arrow,.btn.active.text-icon .arrow,.btn.router-link-active.text-icon .arrow{opacity:0;transform:translate(100%)}.btn:disabled,.btn.disabled{opacity:.16;pointer-events:none}.image-melody{flex-direction:column;justify-content:center;align-items:center;gap:max(3.125vw,50px);height:100vh;display:flex}.image-melody .drop-zone{background:var(--theme-layout);cursor:pointer;border-radius:max(.625vw,10px);justify-content:center;align-items:center;width:max(31.25vw,500px);height:max(31.25vw,500px);display:flex}.image-melody .drop-zone.active{opacity:.7}.image-melody .images{border-radius:max(.625vw,10px);grid-template-columns:1fr 1fr;display:grid;overflow:hidden}.image-melody .images canvas{background:var(--theme-layout);width:max(31.25vw,500px);height:max(31.25vw,500px)}.image-melody .images canvas:first-child{border-right:1px solid var(--theme-grey)}.image-melody .audio{text-align:center;width:max(18.75vw,300px)}.image-melody .audio .controls{justify-content:center;gap:max(.5vw,8px);display:flex}.image-melody .audio .reset{margin-top:max(1vw,16px);text-decoration:underline}main.drop{background:var(--theme-bg);color:var(--theme-fg);height:100vh} diff --git a/app/public/drops/image-melody/assets/index-DOVFg_Mq.js b/app/public/drops/image-melody/assets/index-DOVFg_Mq.js new file mode 100644 index 0000000..4cf198a --- /dev/null +++ b/app/public/drops/image-melody/assets/index-DOVFg_Mq.js @@ -0,0 +1,209 @@ +var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function t(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var n={},r=[],i=()=>{},a=()=>!1,o=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith(`onUpdate:`),c=Object.assign,l=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},u=Object.prototype.hasOwnProperty,d=(e,t)=>u.call(e,t),f=Array.isArray,p=e=>S(e)===`[object Map]`,m=e=>S(e)===`[object Set]`,h=e=>S(e)===`[object Date]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,T=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,E=t(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),D=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},O=/-\w/g,k=D(e=>e.replace(O,e=>e.slice(1).toUpperCase())),ee=/\B([A-Z])/g,te=D(e=>e.replace(ee,`-$1`).toLowerCase()),ne=D(e=>e.charAt(0).toUpperCase()+e.slice(1)),re=D(e=>e?`on${ne(e)}`:``),A=(e,t)=>!Object.is(e,t),j=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},M=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ae=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},oe,se=()=>oe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function N(e){if(f(e)){let t={};for(let n=0;n{if(e){let n=e.split(le);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function fe(e){let t=``;if(_(e))t=e;else if(f(e))for(let n=0;n0&&--this._on===0){if(P===this)P=this.prevScope;else{let e=P;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Te){let e=Te;for(Te=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;we;){let t=we;for(we=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function ke(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ae(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ne(r),Pe(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function je(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Me(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Me(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Be)||(e.globalVersion=Be,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!je(e))))return;e.flags|=2;let t=e.dep,n=F,r=Fe;F=e,Fe=!0;try{ke(e);let n=e.fn(e._value);(t.version===0||A(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{F=n,Fe=r,Ae(e),e.flags&=-3}}function Ne(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ne(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Pe(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Fe=!0,Ie=[];function Le(){Ie.push(Fe),Fe=!1}function Re(){let e=Ie.pop();Fe=e===void 0||e}function ze(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=F;F=void 0;try{t()}finally{F=e}}}var Be=0,Ve=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},He=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!F||!Fe||F===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==F)t=this.activeLink=new Ve(F,this),F.deps?(t.prevDep=F.depsTail,F.depsTail.nextDep=t,F.depsTail=t):F.deps=F.depsTail=t,Ue(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=F.depsTail,t.nextDep=void 0,F.depsTail.nextDep=t,F.depsTail=t,F.deps===t&&(F.deps=e)}return t}trigger(e){this.version++,Be++,this.notify(e)}notify(e){De();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Oe()}}};function Ue(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ue(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var We=new WeakMap,Ge=Symbol(``),Ke=Symbol(``),qe=Symbol(``);function Je(e,t,n){if(Fe&&F){let t=We.get(e);t||We.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new He),r.map=t,r.key=n),r.track()}}function Ye(e,t,n,r,i,a){let o=We.get(e);if(!o){Be++;return}let s=e=>{e&&e.trigger()};if(De(),t===`clear`)o.forEach(s);else{let i=f(e),a=i&&T(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===qe||!v(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(qe)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Ge)),p(e)&&s(o.get(Ke)));break;case`delete`:i||(s(o.get(Ge)),p(e)&&s(o.get(Ke)));break;case`set`:p(e)&&s(o.get(Ge));break}}Oe()}function Xe(e){let t=I(e);return t===e?t:(Je(t,`iterate`,qe),Ft(e)?t:t.map(Rt))}function Ze(e){return Je(e=I(e),`iterate`,qe),e}function Qe(e,t){return Pt(e)?zt(Nt(e)?Rt(t):t):Rt(t)}var $e={__proto__:null,[Symbol.iterator](){return et(this,Symbol.iterator,e=>Qe(this,e))},concat(...e){return Xe(this).concat(...e.map(e=>f(e)?Xe(e):e))},entries(){return et(this,`entries`,e=>(e[1]=Qe(this,e[1]),e))},every(e,t){return nt(this,`every`,e,t,void 0,arguments)},filter(e,t){return nt(this,`filter`,e,t,e=>e.map(e=>Qe(this,e)),arguments)},find(e,t){return nt(this,`find`,e,t,e=>Qe(this,e),arguments)},findIndex(e,t){return nt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return nt(this,`findLast`,e,t,e=>Qe(this,e),arguments)},findLastIndex(e,t){return nt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return nt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return it(this,`includes`,e)},indexOf(...e){return it(this,`indexOf`,e)},join(e){return Xe(this).join(e)},lastIndexOf(...e){return it(this,`lastIndexOf`,e)},map(e,t){return nt(this,`map`,e,t,void 0,arguments)},pop(){return at(this,`pop`)},push(...e){return at(this,`push`,e)},reduce(e,...t){return rt(this,`reduce`,e,t)},reduceRight(e,...t){return rt(this,`reduceRight`,e,t)},shift(){return at(this,`shift`)},some(e,t){return nt(this,`some`,e,t,void 0,arguments)},splice(...e){return at(this,`splice`,e)},toReversed(){return Xe(this).toReversed()},toSorted(e){return Xe(this).toSorted(e)},toSpliced(...e){return Xe(this).toSpliced(...e)},unshift(...e){return at(this,`unshift`,e)},values(){return et(this,`values`,e=>Qe(this,e))}};function et(e,t,n){let r=Ze(e),i=r[t]();return r!==e&&!Ft(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var tt=Array.prototype;function nt(e,t,n,r,i,a){let o=Ze(e),s=o!==e&&!Ft(e),c=o[t];if(c!==tt[t]){let t=c.apply(e,a);return s?Rt(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,Qe(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function rt(e,t,n,r){let i=Ze(e),a=i!==e&&!Ft(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=Qe(e,t)),n.call(this,t,Qe(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?Qe(e,c):c}function it(e,t,n){let r=I(e);Je(r,`iterate`,qe);let i=r[t](...n);return(i===-1||i===!1)&&It(n[0])?(n[0]=I(n[0]),r[t](...n)):i}function at(e,t,n=[]){Le(),De();let r=I(e)[t].apply(e,n);return Oe(),Re(),r}var ot=t(`__proto__,__v_isRef,__isVue`),st=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(v));function ct(e){v(e)||(e=String(e));let t=I(this);return Je(t,`has`,e),t.hasOwnProperty(e)}var lt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Dt:Et:i?Tt:wt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=f(e);if(!r){let e;if(a&&(e=$e[t]))return e;if(t===`hasOwnProperty`)return ct}let o=Reflect.get(e,t,Bt(e)?e:n);if((v(t)?st.has(t):ot(t))||(r||Je(e,`get`,t),i))return o;if(Bt(o)){let e=a&&T(t)?o:o.value;return r&&y(e)?jt(e):e}return y(o)?r?jt(o):kt(o):o}},ut=class extends lt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=f(e)&&T(t);if(!this._isShallow){let e=Pt(i);if(!Ft(n)&&!Pt(n)&&(i=I(i),n=I(n)),!a&&Bt(i)&&!Bt(n))return e||(i.value=n),!0}let o=a?Number(t)e,gt=e=>Reflect.getPrototypeOf(e);function _t(e,t,n){return function(...r){let i=this.__v_raw,a=I(i),o=p(a),s=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?ht:t?zt:Rt;return!t&&Je(a,`iterate`,l?Ke:Ge),c(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function vt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function yt(e,t){let n={get(n){let r=this.__v_raw,i=I(r),a=I(n);e||(A(n,a)&&Je(i,`get`,n),Je(i,`get`,a));let{has:o}=gt(i),s=t?ht:e?zt:Rt;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&Je(I(t),`iterate`,Ge),t.size},has(t){let n=this.__v_raw,r=I(n),i=I(t);return e||(A(t,i)&&Je(r,`has`,t),Je(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=I(a),s=t?ht:e?zt:Rt;return!e&&Je(o,`iterate`,Ge),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return c(n,e?{add:vt(`add`),set:vt(`set`),delete:vt(`delete`),clear:vt(`clear`)}:{add(e){let n=I(this),r=gt(n),i=I(e),a=!t&&!Ft(e)&&!Pt(e)?i:e;return r.has.call(n,a)||A(e,a)&&r.has.call(n,e)||A(i,a)&&r.has.call(n,i)||(n.add(a),Ye(n,`add`,a,a)),this},set(e,n){!t&&!Ft(n)&&!Pt(n)&&(n=I(n));let r=I(this),{has:i,get:a}=gt(r),o=i.call(r,e);o||=(e=I(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?A(n,s)&&Ye(r,`set`,e,n,s):Ye(r,`add`,e,n),this},delete(e){let t=I(this),{has:n,get:r}=gt(t),i=n.call(t,e);i||=(e=I(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Ye(t,`delete`,e,void 0,a),o},clear(){let e=I(this),t=e.size!==0,n=e.clear();return t&&Ye(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=_t(r,e,t)}),n}function bt(e,t){let n=yt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(d(n,r)&&r in t?n:t,r,i)}var xt={get:bt(!1,!1)},St={get:bt(!1,!0)},Ct={get:bt(!0,!1)},wt=new WeakMap,Tt=new WeakMap,Et=new WeakMap,Dt=new WeakMap;function Ot(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function kt(e){return Pt(e)?e:Mt(e,!1,ft,xt,wt)}function At(e){return Mt(e,!1,mt,St,Tt)}function jt(e){return Mt(e,!0,pt,Ct,Et)}function Mt(e,t,n,r,i){if(!y(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Ot(C(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Nt(e){return Pt(e)?Nt(e.__v_raw):!!(e&&e.__v_isReactive)}function Pt(e){return!!(e&&e.__v_isReadonly)}function Ft(e){return!!(e&&e.__v_isShallow)}function It(e){return e?!!e.__v_raw:!1}function I(e){let t=e&&e.__v_raw;return t?I(t):e}function Lt(e){return!d(e,`__v_skip`)&&Object.isExtensible(e)&&ie(e,`__v_skip`,!0),e}var Rt=e=>y(e)?kt(e):e,zt=e=>y(e)?jt(e):e;function Bt(e){return e?e.__v_isRef===!0:!1}function Vt(e){return Ut(e,!1)}function Ht(e){return Ut(e,!0)}function Ut(e,t){return Bt(e)?e:new Wt(e,t)}var Wt=class{constructor(e,t){this.dep=new He,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:I(e),this._value=t?e:Rt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Ft(e)||Pt(e);e=n?e:I(e),A(e,t)&&(this._rawValue=e,this._value=n?e:Rt(e),this.dep.trigger())}};function Gt(e){return Bt(e)?e.value:e}function Kt(e){return g(e)?e():Gt(e)}var qt={get:(e,t,n)=>t===`__v_raw`?e:Gt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return Bt(i)&&!Bt(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Jt(e){return Nt(e)?e:new Proxy(e,qt)}var Yt=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new He(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Be-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&F!==this)return Ee(this,!0),!0}get value(){let e=this.dep.track();return Me(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Xt(e,t,n=!1){let r,i;return g(e)?r=e:(r=e.get,i=e.set),new Yt(r,i,n)}var Zt={},Qt=new WeakMap,$t=void 0;function en(e,t=!1,n=$t){if(n){let t=Qt.get(n);t||Qt.set(n,t=[]),t.push(e)}}function tn(e,t,r=n){let{immediate:a,deep:o,once:s,scheduler:c,augmentJob:u,call:d}=r,p=e=>o?e:Ft(e)||o===!1||o===0?nn(e,1):nn(e),m,h,_,v,y=!1,b=!1;if(Bt(e)?(h=()=>e.value,y=Ft(e)):Nt(e)?(h=()=>p(e),y=!0):f(e)?(b=!0,y=e.some(e=>Nt(e)||Ft(e)),h=()=>e.map(e=>{if(Bt(e))return e.value;if(Nt(e))return p(e);if(g(e))return d?d(e,2):e()})):h=g(e)?t?d?()=>d(e,2):e:()=>{if(_){Le();try{_()}finally{Re()}}let t=$t;$t=m;try{return d?d(e,3,[v]):e(v)}finally{$t=t}}:i,t&&o){let e=h,t=o===!0?1/0:o;h=()=>nn(e(),t)}let x=ye(),S=()=>{m.stop(),x&&x.active&&l(x.effects,m)};if(s&&t){let e=t;t=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(Zt):Zt,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e))if(t){let n=m.run();if(e||o||y||(b?n.some((e,t)=>A(e,C[t])):A(n,C))){_&&_();let e=$t;$t=m;try{let e=[n,C===Zt?void 0:b&&C[0]===Zt?[]:C,v];C=n,d?d(t,3,e):t(...e)}finally{$t=e}}}else m.run()};return u&&u(w),m=new Se(h),m.scheduler=c?()=>c(w,!1):w,v=e=>en(e,!1,m),_=m.onStop=()=>{let e=Qt.get(m);if(e){if(d)d(e,4);else for(let t of e)t();Qt.delete(m)}},t?a?w(!0):C=m.run():c?c(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function nn(e,t=1/0,n){if(t<=0||!y(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Bt(e))nn(e.value,t,n);else if(f(e))for(let r=0;r{nn(e,t,n)});else if(w(e)){for(let r in e)nn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&nn(e[r],t,n)}return e}function rn(e,t,n,r){try{return r?e(...r):e()}catch(e){on(e,t,n)}}function an(e,t,n,r){if(g(e)){let i=rn(e,t,n,r);return i&&b(i)&&i.catch(e=>{on(e,t,n)}),i}if(f(e)){let i=[];for(let a=0;a>>1,i=cn[r],a=Sn(i);a=Sn(n)?cn.push(e):cn.splice(gn(t),0,e),e.flags|=1,vn()}}function vn(){mn||=pn.then(Cn)}function yn(e){f(e)?un.push(...e):dn&&e.id===-1?dn.splice(fn+1,0,e):e.flags&1||(un.push(e),e.flags|=1),vn()}function bn(e,t,n=ln+1){for(;nSn(e)-Sn(t));if(un.length=0,dn){dn.push(...e);return}for(dn=e,fn=0;fne.id==null?e.flags&2?-1:1/0:e.id;function Cn(e){try{for(ln=0;ln{r._d&&ea(-1);let i=En(t),a=Yi.length,o;try{o=e(...n)}finally{for(let e=Yi.length;e>a;e--)Qi();En(i),r._d&&ea(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function On(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o1)return n&&g(t)?t.call(r&&r.proxy):t}}var jn=Symbol.for(`v-scx`),Mn=()=>An(jn);function Nn(e,t){return Fn(e,null,t)}function Pn(e,t,n){return Fn(e,t,n)}function Fn(e,t,r=n){let{immediate:a,deep:o,flush:s,once:l}=r,u=c({},r),d=t&&a||!t&&s!==`post`,f;if(ka){if(s===`sync`){let e=Mn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=i,e.resume=i,e.pause=i,e}}let p=Sa;u.call=(e,t,n)=>an(e,p,t,n);let m=!1;s===`post`?u.scheduler=e=>{Mi(e,p&&p.suspense)}:s!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():_n(e)}),u.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=tn(e,t,u);return ka&&(f?f.push(h):d&&h()),h}function In(e,t,n){let r=this.proxy,i=_(e)?e.includes(`.`)?Ln(r,e):()=>r[e]:e.bind(r,r),a;g(t)?a=t:(a=t.handler,n=t);let o=Ea(this),s=Fn(i,a.bind(r),n);return o(),s}function Ln(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,Bn=Symbol(`_leaveCb`),Vn=Symbol(`_enterCb`);function Hn(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return hr(()=>{e.isMounted=!0}),vr(()=>{e.isUnmounting=!0}),e}var Un=[Function,Array],Wn={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Un,onEnter:Un,onAfterEnter:Un,onEnterCancelled:Un,onBeforeLeave:Un,onLeave:Un,onAfterLeave:Un,onLeaveCancelled:Un,onBeforeAppear:Un,onAppear:Un,onAfterAppear:Un,onAppearCancelled:Un},Gn=e=>{let t=e.subTree;return t.component?Gn(t.component):t},Kn={name:`BaseTransition`,props:Wn,setup(e,{slots:t}){let n=Ca(),r=Hn();return()=>{let i=t.default&&er(t.default(),!0),a=i&&i.length?qn(i):n.subTree?pa():void 0;if(!a)return;let o=I(e),{mode:s}=o;if(r.isLeaving)return Zn(a);let c=Qn(a);if(!c)return Zn(a);let l=Xn(c,o,r,n,e=>l=e);c.type!==qi&&$n(c,l);let u=n.subTree&&Qn(n.subTree);if(u&&u.type!==qi&&!aa(u,c)&&Gn(n).type!==qi){let e=Xn(u,o,r,n);if($n(u,e),s===`out-in`&&c.type!==qi)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},Zn(a);s===`in-out`&&c.type!==qi?e.delayLeave=(e,t,n)=>{let i=Yn(r,u);i[String(u.key)]=u,e[Bn]=()=>{t(),e[Bn]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function qn(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==qi){t=n;break}}return t}var Jn=Kn;function Yn(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Xn(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=Yn(n,e),C=(e,t)=>{e&&an(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),f(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted)if(a)r=_||c;else return;t[Bn]&&t[Bn](!0);let i=S[x];i&&aa(e,i)&&i.el[Bn]&&i.el[Bn](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=d;if(!n.isMounted)if(a)r=v||l,i=y||u,o=b||d;else return;let s=!1;t[Vn]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[Vn]=void 0)};let c=t[Vn].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[Vn]&&t[Vn](!0),n.isUnmounting)return r();C(p,[t]);let a=!1;t[Bn]=n=>{a||(a=!0,r(),C(n?g:h,[t]),t[Bn]=void 0,S[i]===e&&delete S[i])};let o=t[Bn].bind(null,!1);S[i]=e,m?w(m,[t,o]):o()},clone(e){let a=Xn(e,t,n,r,i);return i&&i(a),a}};return T}function Zn(e){if(sr(e))return e=da(e),e.children=null,e}function Qn(e){if(!sr(e))return zn(e.type)&&e.children?qn(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&g(n.default))return n.default()}}function $n(e,t){e.shapeFlag&6&&e.component?(e.transition=t,$n(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function er(e,t=!1,n){let r=[],i=0;for(let a=0;a1)for(let e=0;eir(e,t&&(f(t)?t[n]:t),r,i,o));return}if(or(i)&&!o){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&ir(e,t,r,i.component.subTree);return}let s=i.shapeFlag&4?Ra(i.component):i.el,c=o?null:s,{i:u,r:p}=e,m=t&&t.r,h=u.refs===n?u.refs={}:u.refs,v=u.setupState,y=I(v),b=v===n?a:e=>!nr(h,e)&&d(y,e),x=(e,t)=>!(t&&nr(h,t));if(m!=null&&m!==p){if(ar(t),_(m))h[m]=null,b(m)&&(v[m]=null);else if(Bt(m)){let e=t;x(m,e.k)&&(m.value=null),e.k&&(h[e.k]=null)}}if(g(p))rn(p,u,12,[c,h]);else{let t=_(p),n=Bt(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:h[p]:x(p)||!e.k?p.value:h[e.k];if(o)f(n)&&l(n,s);else if(f(n))n.includes(s)||n.push(s);else if(t)h[p]=[s],b(p)&&(v[p]=h[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(h[e.k]=t)}}else t?(h[p]=c,b(p)&&(v[p]=c)):n&&(x(p,e.k)&&(p.value=c),e.k&&(h[e.k]=c))};if(c){let t=()=>{i(),rr.delete(e)};t.id=-1,rr.set(e,t),Mi(t,r)}else ar(e),i()}}}function ar(e){let t=rr.get(e);t&&(t.flags|=8,rr.delete(e))}se().requestIdleCallback,se().cancelIdleCallback;var or=e=>!!e.type.__asyncLoader,sr=e=>e.type.__isKeepAlive;function cr(e,t){ur(e,`a`,t)}function lr(e,t){ur(e,`da`,t)}function ur(e,t,n=Sa){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(fr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)sr(e.parent.vnode)&&dr(r,t,n,e),e=e.parent}}function dr(e,t,n,r){let i=fr(t,e,r,!0);yr(()=>{l(r[t],i)},n)}function fr(e,t,n=Sa,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Le();let i=Ea(n),a=an(t,n,e,r);return i(),Re(),a};return r?i.unshift(a):i.push(a),a}}var pr=e=>(t,n=Sa)=>{(!ka||e===`sp`)&&fr(e,(...e)=>t(...e),n)},mr=pr(`bm`),hr=pr(`m`),gr=pr(`bu`),_r=pr(`u`),vr=pr(`bum`),yr=pr(`um`),br=pr(`sp`),xr=pr(`rtg`),Sr=pr(`rtc`);function Cr(e,t=Sa){fr(`ec`,e,t)}var wr=`components`;function Tr(e,t){return Or(wr,e,!0,t)||e}var Er=Symbol.for(`v-ndc`);function Dr(e){return _(e)?Or(wr,e,!1)||e:e||Er}function Or(e,t,n=!0,r=!1){let i=wn||Sa;if(i){let n=i.type;if(e===wr){let e=za(n,!1);if(e&&(e===t||e===k(t)||e===ne(k(t))))return n}let a=kr(i[e]||n[e],t)||kr(i.appContext[e],t);return!a&&r?n:a}}function kr(e,t){return e&&(e[t]||e[k(t)]||e[ne(k(t))])}function Ar(e,t,n={},r,i,a){if(wn.ce||wn.parent&&or(wn.parent)&&wn.parent.ce){let e=a!=null&&n.key==null?c({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),Zi(),ra(Gi,null,[L(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=Yi.length;Zi();let l;try{let i=o&&jr(o(n)),s=n.key||a||i&&i.key;l=ra(Gi,{key:(s&&!v(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Yi.length;e>s;e--)Qi();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+`-s`]),l}function jr(e){return e.some(e=>!ia(e)||!(e.type===qi||e.type===Gi&&!jr(e.children)))?e:null}var Mr=e=>e?Oa(e)?Ra(e):Mr(e.parent):null,Nr=c(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Mr(e.parent),$root:e=>Mr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Hr(e),$forceUpdate:e=>e.f||=()=>{_n(e.update)},$nextTick:e=>e.n||=hn.bind(e.proxy),$watch:e=>In.bind(e)}),Pr=(e,t)=>e!==n&&!e.__isScriptSetup&&d(e,t),Fr={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return i[t];case 2:return a[t];case 4:return r[t];case 3:return o[t]}else if(Pr(i,t))return s[t]=1,i[t];else if(a!==n&&d(a,t))return s[t]=2,a[t];else if(d(o,t))return s[t]=3,o[t];else if(r!==n&&d(r,t))return s[t]=4,r[t];else Lr&&(s[t]=0)}let u=Nr[t],f,p;if(u)return t===`$attrs`&&Je(e.attrs,`get`,``),u(e);if((f=c.__cssModules)&&(f=f[t]))return f;if(r!==n&&d(r,t))return s[t]=4,r[t];if(p=l.config.globalProperties,d(p,t))return p[t]},set({_:e},t,r){let{data:i,setupState:a,ctx:o}=e;return Pr(a,t)?(a[t]=r,!0):i!==n&&d(i,t)?(i[t]=r,!0):d(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(o[t]=r,!0)},has({_:{data:e,setupState:t,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==n&&c[0]!==`$`&&d(e,c)||Pr(t,c)||d(o,c)||d(i,c)||d(Nr,c)||d(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?d(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function Ir(e){return f(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var Lr=!0;function Rr(e){let t=Hr(e),n=e.proxy,r=e.ctx;Lr=!1,t.beforeCreate&&Br(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:d,beforeMount:p,mounted:m,beforeUpdate:h,updated:_,activated:v,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:E,renderTriggered:D,errorCaptured:O,serverPrefetch:k,expose:ee,inheritAttrs:te,components:ne,directives:re,filters:A}=t;if(u&&zr(u,r,null),s)for(let e in s){let t=s[e];g(t)&&(r[e]=t.bind(n))}if(a){let t=a.call(n,n);y(t)&&(e.data=kt(t))}if(Lr=!0,o)for(let e in o){let t=o[e],a=Va({get:g(t)?t.bind(n,n):g(t.get)?t.get.bind(n,n):i,set:!g(t)&&g(t.set)?t.set.bind(n):i});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)Vr(c[e],r,n,e);if(l){let e=g(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{kn(t,e[t])})}d&&Br(d,e,`c`);function j(e,t){f(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(j(mr,p),j(hr,m),j(gr,h),j(_r,_),j(cr,v),j(lr,b),j(Cr,O),j(Sr,E),j(xr,D),j(vr,S),j(yr,w),j(br,k),f(ee))if(ee.length){let t=e.exposed||={};ee.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};T&&e.render===i&&(e.render=T),te!=null&&(e.inheritAttrs=te),ne&&(e.components=ne),re&&(e.directives=re),k&&tr(e)}function zr(e,t,n=i){f(e)&&(e=qr(e));for(let n in e){let r=e[n],i;i=y(r)?`default`in r?An(r.from||n,r.default,!0):An(r.from||n):An(r),Bt(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Br(e,t,n){an(f(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vr(e,t,n,r){let i=r.includes(`.`)?Ln(n,r):()=>n[r];if(_(e)){let n=t[e];g(n)&&Pn(i,n)}else if(g(e))Pn(i,e.bind(n));else if(y(e))if(f(e))e.forEach(e=>Vr(e,t,n,r));else{let r=g(e.handler)?e.handler.bind(n):t[e.handler];g(r)&&Pn(i,r,e)}}function Hr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Ur(c,e,o,!0)),Ur(c,t,o)),y(t)&&a.set(t,c),c}function Ur(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Ur(e,a,n,!0),i&&i.forEach(t=>Ur(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Wr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Wr={data:Gr,props:Xr,emits:Xr,methods:Yr,computed:Yr,beforeCreate:Jr,created:Jr,beforeMount:Jr,mounted:Jr,beforeUpdate:Jr,updated:Jr,beforeDestroy:Jr,beforeUnmount:Jr,destroyed:Jr,unmounted:Jr,activated:Jr,deactivated:Jr,errorCaptured:Jr,serverPrefetch:Jr,components:Yr,directives:Yr,watch:Zr,provide:Gr,inject:Kr};function Gr(e,t){return t?e?function(){return c(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function Kr(e,t){return Yr(qr(e),qr(t))}function qr(e){if(f(e)){let t={};for(let n=0;nt===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${k(t)}Modifiers`]||e[`${te(t)}Modifiers`];function ri(e,t,...r){if(e.isUnmounted)return;let i=e.vnode.props||n,a=r,o=t.startsWith(`update:`),s=o&&ni(i,t.slice(7));s&&(s.trim&&(a=r.map(e=>_(e)?e.trim():e)),s.number&&(a=r.map(M)));let c,l=i[c=re(t)]||i[c=re(k(t))];!l&&o&&(l=i[c=re(te(t))]),l&&an(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,an(u,e,6,a)}}var ii=new WeakMap;function ai(e,t,n=!1){let r=n?ii:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!g(e)){let r=e=>{let n=ai(e,t,!0);n&&(s=!0,c(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(y(e)&&r.set(e,null),null):(f(a)?a.forEach(e=>o[e]=null):c(o,a),y(e)&&r.set(e,o),o)}function oi(e,t){return!e||!o(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),d(e,t[0].toLowerCase()+t.slice(1))||d(e,te(t))||d(e,t))}function si(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=En(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=ma(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=ma(e.length>1?e(f,{attrs:c,slots:o,emit:l}):e(f,null)),y=t.props?c:ci(c)}}catch(t){Yi.length=0,on(t,e,1),v=L(qi)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(s)&&(y=li(y,a)),b=da(b,y,!1,!0))}return n.dirs&&(b=da(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&$n(b,n.transition),v=b,En(_),v}var ci=e=>{let t;for(let n in e)(n===`class`||n===`style`||o(n))&&((t||={})[n]=e[n]);return t},li=(e,t)=>{let n={};for(let r in e)(!s(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ui(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?di(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(mi),gi=e=>Object.getPrototypeOf(e)===mi;function _i(e,t,n,r=!1){let i={},a=hi();e.propsDefaults=Object.create(null),yi(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:At(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function vi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=I(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{p=!0;let[n,r]=Si(e,t,!0);c(l,n),r&&u.push(...r)};!i&&t.mixins.length&&t.mixins.forEach(n),e.extends&&n(e.extends),e.mixins&&e.mixins.forEach(n)}if(!s&&!p)return y(e)&&a.set(e,r),r;if(f(s))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Ti=e=>f(e)?e.map(ma):[ma(e)],Ei=(e,t,n)=>{if(t._n)return t;let r=Dn((...e)=>Ti(t(...e)),n);return r._c=!1,r},Di=(e,t,n)=>{let r=e._ctx;for(let n in e){if(wi(n))continue;let i=e[n];if(g(i))t[n]=Ei(n,i,r);else if(i!=null){let e=Ti(i);t[n]=()=>e}}},Oi=(e,t)=>{let n=Ti(t);e.slots.default=()=>n},ki=(e,t,n)=>{for(let r in t)(n||!wi(r))&&(e[r]=t[r])},Ai=(e,t,n)=>{let r=e.slots=hi();if(e.vnode.shapeFlag&32){let e=t._;e?(ki(r,t,n),n&&ie(r,`_`,e,!0)):Di(t,r)}else t&&Oi(e,t)},ji=(e,t,r)=>{let{vnode:i,slots:a}=e,o=!0,s=n;if(i.shapeFlag&32){let e=t._;e?r&&e===1?o=!1:ki(a,t,r):(o=!t.$stable,Di(t,a)),s=t}else t&&(Oi(e,t),s={default:1});if(o)for(let e in a)!wi(e)&&s[e]==null&&delete a[e]},Mi=Wi;function Ni(e){return Pi(e)}function Pi(e,t){let a=se();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=i,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!aa(e,t)&&(r=he(e),ue(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case Ki:y(e,t,n,r);break;case qi:b(e,t,n,r);break;case Ji:e??x(t,n,r,o);break;case Gi:ne(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?re(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,P)}u!=null&&i?ir(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&ir(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),k(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&O(e.children,d,null,r,i,Fi(e,a),s,u),_&&On(e,null,r,`created`),D(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!E(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&va(f,r,e)}_&&On(e,null,r,`beforeMount`);let v=Li(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&Mi(()=>{try{f&&va(f,r,e),v&&g.enter(d),_&&On(e,null,r,`mounted`)}finally{}},i)},D=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||n,h=t.props||n,g;if(r&&Ii(r,!1),(g=h.onVnodeBeforeUpdate)&&va(g,r,t,e),f&&On(t,e,r,`beforeUpdate`),r&&Ii(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?ee(e.dynamicChildren,d,l,r,i,Fi(t,a),o):s||oe(e,t,l,null,r,i,Fi(t,a),o,!1),u>0){if(u&16)te(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=t.dynamicProps;for(let t=0;t{g&&va(g,r,t,e),f&&On(t,e,r,`updated`)},i)},ee=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(t!==r){if(t!==n)for(let n in t)!E(n)&&!(n in r)&&c(e,n,t[n],null,a,i);for(let n in r){if(E(n))continue;let o=r[n],s=t[n];o!==s&&n!==`value`&&c(e,n,s,o,a,i)}`value`in r&&c(e,`value`,t.value,r.value,a)}},ne=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),O(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ee(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&Ri(e,t,!0)):oe(e,t,n,f,i,a,s,c,l)},re=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):A(t,n,r,i,a,o,c):ie(e,t,c)},A=(e,t,n,r,i,a,o)=>{let s=e.component=xa(e,r,i);if(sr(e)&&(s.ctx.renderer=P),Aa(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,M,o),!e.el){let r=s.subTree=L(qi);b(null,r,t,n),e.placeholder=r.el}}else M(s,e,t,n,i,a,o)},ie=(e,t,n)=>{let r=t.component=e.component;if(ui(e,t,n))if(r.asyncDep&&!r.asyncResolved){ae(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},M=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Bi(e);if(n){t&&(t.el=c.el,ae(e,t,o)),n.asyncDep.then(()=>{Mi(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Ii(e,!1),t?(t.el=c.el,ae(e,t,o)):t=c,n&&j(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&va(d,s,t,c),Ii(e,!0);let f=si(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),he(p),e,i,a),t.el=f.el,u===null&&pi(e,f.el),r&&Mi(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Mi(()=>va(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=or(t);if(Ii(e,!1),l&&j(l),!m&&(o=c&&c.onVnodeBeforeMount)&&va(o,d,t),Ii(e,!0),s&&ye){let t=()=>{e.subTree=si(e),ye(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=si(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Mi(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Mi(()=>va(o,d,e),i)}(t.shapeFlag&256||d&&or(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Mi(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Se(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>_n(u),Ii(e,!0),l()},ae=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,vi(e,t.props,r,n),ji(e,t.children,n),Le(),bn(e),Re()},oe=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){ce(l,d,n,r,i,a,o,s,c);return}else if(f&256){N(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&me(l,i,a),d!==l&&p(n,d)):u&16?m&16?ce(l,d,n,r,i,a,o,s,c):me(l,i,a,!0):(u&8&&p(n,``),m&16&&O(d,n,r,i,a,o,s,c))},N=(e,t,n,i,a,o,s,c,l)=>{e||=r,t||=r;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;pd?me(e,a,o,!0,!1,f):O(t,n,i,a,o,s,c,l,f)},ce=(e,t,n,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],i=t[u]=l?ha(t[u]):ma(t[u]);if(aa(r,i))v(r,i,n,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],i=t[p]=l?ha(t[p]):ma(t[p]);if(aa(r,i))v(r,i,n,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,r=ep)for(;u<=f;)ue(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?ha(t[u]):ma(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){ue(r,a,o,!0);continue}let i;if(r.key!=null)i=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&aa(r,t[_])){i=_;break}i===void 0?ue(r,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(r,t[i],n,null,a,o,s,c,l),y++)}let w=x?zi(C):r;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,r=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){le(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,P);return}if(c===Gi){o(a,t,n);for(let e=0;el.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Bn];a._isLeaving&&a[Bn](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}else o(a,t,n)},ue=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Le(),ir(s,null,n,e,!0),Re()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!or(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&va(_,t,e),u&6)pe(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&On(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,P,r):l&&!l.hasOnce&&(a!==Gi||d>0&&d&64)?me(l,t,n,!1,!0):(a===Gi&&d&384||!i&&u&16)&&me(c,t,n),r&&de(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Mi(()=>{_&&va(_,t,e),h&&On(e,null,t,`unmounted`),v&&(e.el=null)},n)},de=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===Gi){fe(n,r);return}if(t===Ji){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},fe=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},pe=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Vi(c),Vi(l),r&&j(r),i.stop(),a&&(a.flags|=8,ue(o,e,t,n)),s&&Mi(s,t),Mi(()=>{e.isUnmounted=!0},t)},me=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return he(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Rn];return n?h(n):t},ge=!1,_e=(e,t,n)=>{let r;e==null?t._vnode&&(ue(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,ge||=(ge=!0,bn(r),xn(),!1)},P={p:v,um:ue,m:le,r:de,mt:A,mc:O,pc:oe,pbc:ee,n:he,o:e},ve,ye;return t&&([ve,ye]=t(P)),{render:_e,hydrate:ve,createApp:ei(_e,ve)}}function Fi({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Ii({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Li(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ri(e,t,n=!1){let r=e.children,i=t.children;if(f(r)&&f(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Bi(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Bi(t)}function Vi(e){if(e)for(let t=0;te.__isSuspense;function Wi(e,t){t&&t.pendingBranch?f(e)?t.effects.push(...e):t.effects.push(e):yn(e)}var Gi=Symbol.for(`v-fgt`),Ki=Symbol.for(`v-txt`),qi=Symbol.for(`v-cmt`),Ji=Symbol.for(`v-stc`),Yi=[],Xi=null;function Zi(e=!1){Yi.push(Xi=e?null:[])}function Qi(){Yi.pop(),Xi=Yi[Yi.length-1]||null}var $i=1;function ea(e,t=!1){$i+=e,e<0&&Xi&&t&&(Xi.hasOnce=!0)}function ta(e){return e.dynamicChildren=$i>0?Xi||r:null,Qi(),$i>0&&Xi&&Xi.push(e),e}function na(e,t,n,r,i,a){return ta(ca(e,t,n,r,i,a,!0))}function ra(e,t,n,r,i){return ta(L(e,t,n,r,i,!0))}function ia(e){return e?e.__v_isVNode===!0:!1}function aa(e,t){return e.type===t.type&&e.key===t.key}var oa=({key:e})=>e??null,sa=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:_(e)||Bt(e)||g(e)?{i:wn,r:e,k:t,f:!!n}:e);function ca(e,t=null,n=null,r=0,i=null,a=e===Gi?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&oa(t),ref:t&&sa(t),scopeId:Tn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:wn};return s?(ga(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=_(n)?8:16),$i>0&&!o&&Xi&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&Xi.push(c),c}var L=la;function la(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Er)&&(e=qi),ia(e)){let r=da(e,t,!0);return n&&ga(r,n),$i>0&&!a&&Xi&&(r.shapeFlag&6?Xi[Xi.indexOf(e)]=r:Xi.push(r)),r.patchFlag=-2,r}if(Ba(e)&&(e=e.__vccOpts),t){t=ua(t);let{class:e,style:n}=t;e&&!_(e)&&(t.class=fe(e)),y(n)&&(It(n)&&!f(n)&&(n=c({},n)),t.style=N(n))}let o=_(e)?1:Ui(e)?128:zn(e)?64:y(e)?4:g(e)?2:0;return ca(e,t,n,r,i,o,a,!0)}function ua(e){return e?It(e)||gi(e)?c({},e):e:null}function da(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?_a(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&oa(l),ref:t&&t.ref?n&&a?f(a)?a.concat(sa(t)):[a,sa(t)]:sa(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Gi?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&da(e.ssContent),ssFallback:e.ssFallback&&da(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&$n(u,c.clone(u)),u}function fa(e=` `,t=0){return L(Ki,null,e,t)}function pa(e=``,t=!1){return t?(Zi(),ra(qi,null,e)):L(qi,null,e)}function ma(e){return e==null||typeof e==`boolean`?L(qi):f(e)?L(Gi,null,e.slice()):ia(e)?ha(e):L(Ki,null,String(e))}function ha(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:da(e)}function ga(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(f(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ga(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!gi(t)?t._ctx=wn:r===3&&wn&&(wn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(g(t)){if(r&65){ga(e,{default:t});return}t={default:t,_ctx:wn},n=32}else t=String(t),r&64?(n=16,t=[fa(t)]):n=8;e.children=t,e.shapeFlag|=n}function _a(...e){let t={};for(let n=0;nSa||wn,wa,Ta;{let e=se(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};wa=t(`__VUE_INSTANCE_SETTERS__`,e=>Sa=e),Ta=t(`__VUE_SSR_SETTERS__`,e=>ka=e)}var Ea=e=>{let t=Sa;return wa(e),e.scope.on(),()=>{e.scope.off(),wa(t)}},Da=()=>{Sa&&Sa.scope.off(),wa(null)};function Oa(e){return e.vnode.shapeFlag&4}var ka=!1;function Aa(e,t=!1,n=!1){t&&Ta(t);let{props:r,children:i}=e.vnode,a=Oa(e);_i(e,r,a,t),Ai(e,i,n||t);let o=a?ja(e,t):void 0;return t&&Ta(!1),o}function ja(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Fr);let{setup:r}=n;if(r){Le();let n=e.setupContext=r.length>1?La(e):null,i=Ea(e),a=rn(r,e,0,[e.props,n]),o=b(a);if(Re(),i(),(o||e.sp)&&!or(e)&&tr(e),o){if(a.then(Da,Da),t)return a.then(n=>{Ma(e,n,t)}).catch(t=>{on(t,e,0)});e.asyncDep=a}else Ma(e,a,t)}else Fa(e,t)}function Ma(e,t,n){g(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:y(t)&&(e.setupState=Jt(t)),Fa(e,n)}var Na,Pa;function Fa(e,t,n){let r=e.type;if(!e.render){if(!t&&Na&&!r.render){let t=r.template||Hr(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Na(t,c(c({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||i,Pa&&Pa(e)}{let t=Ea(e);Le();try{Rr(e)}finally{Re(),t()}}}var Ia={get(e,t){return Je(e,`get`,``),e[t]}};function La(e){return{attrs:new Proxy(e.attrs,Ia),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ra(e){return e.exposed?e.exposeProxy||=new Proxy(Jt(Lt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Nr)return Nr[n](e)},has(e,t){return t in e||t in Nr}}):e.proxy}function za(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}function Ba(e){return g(e)&&`__vccOpts`in e}var Va=(e,t)=>Xt(e,t,ka);function Ha(e,t,n){try{ea(-1);let r=arguments.length;return r===2?y(t)&&!f(t)?ia(t)?L(e,null,[t]):L(e,t):L(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ia(n)&&(n=[n]),L(e,t,n))}finally{ea(1)}}var Ua=`3.5.40`,Wa=void 0,Ga=typeof window<`u`&&window.trustedTypes;if(Ga)try{Wa=Ga.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Ka=Wa?e=>Wa.createHTML(e):e=>e,qa=`http://www.w3.org/2000/svg`,Ja=`http://www.w3.org/1998/Math/MathML`,Ya=typeof document<`u`?document:null,Xa=Ya&&Ya.createElement(`template`),Za={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Ya.createElementNS(qa,e):t===`mathml`?Ya.createElementNS(Ja,e):n?Ya.createElement(e,{is:n}):Ya.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Ya.createTextNode(e),createComment:e=>Ya.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ya.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Xa.innerHTML=Ka(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=Xa.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Qa=`transition`,$a=`animation`,eo=Symbol(`_vtc`),to={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},no=c({},Wn,to),ro=(e=>(e.displayName=`Transition`,e.props=no,e))((e,{slots:t})=>Ha(Jn,oo(e),t)),io=(e,t=[])=>{f(e)?e.forEach(e=>e(...t)):e&&e(...t)},ao=e=>e?f(e)?e.some(e=>e.length>1):e.length>1:!1;function oo(e){let t={};for(let n in e)n in to||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=s,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=so(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,uo(e,t?d:s),uo(e,t?u:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,uo(e,f),uo(e,m),uo(e,p),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);io(i,[t,o]),fo(()=>{uo(t,e?l:a),lo(t,e?d:s),ao(i)||mo(t,r,g,o)})};return c(t,{onBeforeEnter(e){io(v,[e]),lo(e,a),lo(e,o)},onBeforeAppear(e){io(C,[e]),lo(e,l),lo(e,u)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);lo(e,f),e._enterCancelled?(lo(e,p),vo(e)):(vo(e),lo(e,p)),fo(()=>{e._isLeaving&&(uo(e,f),lo(e,m),ao(x)||mo(e,r,_,n))}),io(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),io(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),io(T,[e])},onLeaveCancelled(e){D(e),io(S,[e])}})}function so(e){if(e==null)return null;if(y(e))return[co(e.enter),co(e.leave)];{let t=co(e);return[t,t]}}function co(e){return ae(e)}function lo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[eo]||(e[eo]=new Set)).add(t)}function uo(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[eo];n&&(n.delete(t),n.size||(e[eo]=void 0))}function fo(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var po=0;function mo(e,t,n,r){let i=e._endId=++po,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=ho(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${Qa}Delay`),a=r(`${Qa}Duration`),o=go(i,a),s=r(`${$a}Delay`),c=r(`${$a}Duration`),l=go(s,c),u=null,d=0,f=0;t===Qa?o>0&&(u=Qa,d=o,f=a.length):t===$a?l>0&&(u=$a,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?Qa:$a:null,f=u?u===Qa?a.length:c.length:0);let p=u===Qa&&/\b(?:transform|all)(?:,|$)/.test(r(`${Qa}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function go(e,t){for(;e.length_o(t)+_o(e[n])))}function _o(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function vo(e){return(e?e.ownerDocument:document).body.offsetHeight}function yo(e,t,n){let r=e[eo];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var bo=Symbol(`_vod`),xo=Symbol(`_vsh`),So=Symbol(``),Co=/(?:^|;)\s*display\s*:/;function wo(e,t,n){let r=e.style,i=_(n),a=!1;if(n&&!i){if(t)if(_(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Eo(r,t,``)}else for(let e in t)n[e]??Eo(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Eo(r,i,``):Ao(e,i,!_(t)&&t?t[i]:void 0,o)||Eo(r,i,o)}}else if(i){if(t!==n){let e=r[So];e&&(n+=`;`+e),r.cssText=n,a=Co.test(n)}}else t&&e.removeAttribute(`style`);bo in e&&(e[bo]=a?r.display:``,e[xo]&&(r.display=`none`))}var To=/\s*!important$/;function Eo(e,t,n){if(f(n))n.forEach(n=>Eo(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=ko(e,t);To.test(n)?e.setProperty(te(r),n.replace(To,``),`important`):e[r]=n}}var Do=[`Webkit`,`Moz`,`ms`],Oo={};function ko(e,t){let n=Oo[t];if(n)return n;let r=k(t);if(r!==`filter`&&r in e)return Oo[t]=r;r=ne(r);for(let n=0;nVo||=(Ho.then(()=>Vo=0),Date.now());function Wo(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(f(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ko=(e,t,n,r,i,a)=>{let c=i===`svg`;t===`class`?yo(e,r,c):t===`style`?wo(e,n,r):o(t)?s(t)||Lo(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):qo(e,t,r,c))?(No(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Mo(e,t,r,c,a,t!==`value`)):e._isVueCE&&(Jo(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!_(r)))?No(e,k(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Mo(e,t,r,c))};function qo(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Go(t)&&g(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Go(t)&&_(n)?!1:t in e}function Jo(e,t){let n=e._def.props;if(!n)return!1;let r=k(t);return Array.isArray(n)?n.some(e=>k(e)===r):Object.keys(n).some(e=>k(e)===r)}var Yo=c({patchProp:Ko},Za),Xo;function Zo(){return Xo||=Ni(Yo)}var Qo=((...e)=>{let t=Zo().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=es(e);if(!r)return;let i=t._component;!g(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,$o(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function $o(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function es(e){return _(e)?document.querySelector(e):e}function ts(e,t){return ye()?(be(e,t),!0):!1}function ns(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return ts(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}var rs=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var is=Object.prototype.toString,as=e=>is.call(e)===`[object Object]`,os=(e,t)=>Object.hasOwn(e,t);function ss(e){return Array.isArray(e)?e:[e]}function cs(e,t,n){return Pn(e,t,{...n,immediate:!0})}var ls=rs?window:void 0,us=rs?window.document:void 0;rs&&window.navigator,rs&&window.location;function ds(e){let t=Kt(e);return t?.$el??t}function fs(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=Va(()=>{let t=ss(Kt(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return cs(()=>[n.value?.map(e=>ds(e))??[ls].filter(e=>e!=null),ss(Kt(n.value?e[1]:e[0])),ss(Gt(n.value?e[2]:e[1])),Kt(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=as(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function ps(e,t={}){let n=Ht(!1),r=Ht(null),i=0,a=!0;if(rs){let o=typeof t==`function`?{onDrop:t}:t,s=o.multiple??!0,c=o.preventDefaultForUnhandled??!1,l=e=>{let t=Array.from(e.dataTransfer?.files??[]);return t.length===0?null:s?t:[t[0]]},u=e=>{let t=Gt(o.dataTypes);return typeof t==`function`?t(e):!t?.length||e.length!==0&&e.every(e=>t.some(t=>e.includes(t)))},d=e=>{if(o.checkValidity)return o.checkValidity(e);let t=u(Array.from(e??[]).map(e=>e.type)),n=s||e.length<=1;return t&&n},f=()=>/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent)&&!(`chrome`in window),p=(e,t)=>{let s=e.dataTransfer?.items;if(a=(s&&d(s))??!1,c&&e.preventDefault(),!f()&&!a){e.dataTransfer&&(e.dataTransfer.dropEffect=`none`);return}e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`);let u=l(e);switch(t){case`enter`:var p;i+=1,n.value=!0,(p=o.onEnter)==null||p.call(o,null,e);break;case`over`:var m;(m=o.onOver)==null||m.call(o,null,e);break;case`leave`:var h;--i,i===0&&(n.value=!1),(h=o.onLeave)==null||h.call(o,null,e);break;case`drop`:if(i=0,n.value=!1,a){var g;r.value=u,(g=o.onDrop)==null||g.call(o,u,e)}break}};fs(e,`dragenter`,e=>p(e,`enter`)),fs(e,`dragover`,e=>p(e,`over`)),fs(e,`dragleave`,e=>p(e,`leave`)),fs(e,`drop`,e=>p(e,`drop`))}return{files:r,isOverDropZone:n}}var ms={multiple:!0,accept:`*`,reset:!1,directory:!1};function hs(e){if(!e)return null;if(e instanceof FileList)return e;let t=new DataTransfer;for(let n of e)t.items.add(n);return t.files}function gs(e={}){let{document:t=us}=e,n=Vt(hs(e.initialFiles)),{on:r,trigger:i}=ns(),{on:a,trigger:o}=ns(),s=Va(()=>{let r=ds(e.input)??(t?t.createElement(`input`):void 0);return r&&(r.type=`file`,r.onchange=e=>{n.value=e.target.files,i(n.value)},r.oncancel=()=>{o()}),r}),c=()=>{n.value=null,s.value&&s.value.value&&(s.value.value=``,i(null))},l=e=>{let t=s.value;t&&(t.multiple=Kt(e.multiple),t.accept=Kt(e.accept),t.webkitdirectory=Kt(e.directory),os(e,`capture`)&&(t.capture=Kt(e.capture)))};return Nn(()=>{l(e)}),{files:jt(n),open:t=>{let n=s.value;if(!n)return;let r={...ms,...e,...t};l(r),Kt(r.reset)&&c(),n.click()},reset:c,onCancel:a,onChange:r}}function _s(e,t,n){if(e!==`cover`&&e!==`contain`)throw TypeError(`Invalid mode`);let r=t.width/t.height,i=n.width/n.height,{width:a}=n,{height:o}=n;return(e===`contain`?r>i:r`button`},arrow:{type:Boolean,default:()=>!1},loading:{type:Boolean,default:()=>!1}},setup(e){return(t,n)=>(Zi(),ra(Dr(e.tag),{class:`btn`},{default:Dn(()=>[e.arrow?(Zi(),na(`span`,vs,`→`)):pa(``,!0),ca(`span`,ys,[ca(`span`,null,[Ar(t.$slots,`default`)]),ca(`span`,null,[Ar(t.$slots,`default`)])]),e.arrow?(Zi(),na(`span`,bs,`→`)):pa(``,!0)]),_:3}))}},Ss=`15.1.22`,Cs=e(((e,t)=>{function n(e){if(Array.isArray(e))return e}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),ws=e(((e,t)=>{function n(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),Ts=e(((e,t)=>{function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{var n=Ts();function r(e,t){if(e){if(typeof e==`string`)return n(e,t);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),Ds=e(((e,t)=>{function n(){throw TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),Os=e(((e,t)=>{var n=Cs(),r=ws(),i=Es(),a=Ds();function o(e,t){return n(e)||r(e,t)||i(e,t)||a()}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports})),ks=e(((e,t)=>{function n(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),As=e(((e,t)=>{function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),js=e(((e,t)=>{var n=As().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),Ms=e(((e,t)=>{var n=As().default,r=js();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports})),Ns=e(((e,t)=>{var n=Ms();function r(e,t){for(var r=0;r{(function(n,r){typeof e==`object`&&t!==void 0?r(e,Os(),ks(),Ns()):typeof define==`function`&&define.amd?define([`exports`,`@babel/runtime/helpers/slicedToArray`,`@babel/runtime/helpers/classCallCheck`,`@babel/runtime/helpers/createClass`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.automationEvents={},n._slicedToArray,n._classCallCheck,n._createClass))})(e,(function(e,t,n,r){var i=function(e,t,n){return{endTime:t,insertTime:n,type:`exponentialRampToValue`,value:e}},a=function(e,t,n){return{endTime:t,insertTime:n,type:`linearRampToValue`,value:e}},o=function(e,t){return{startTime:t,type:`setValue`,value:e}},s=function(e,t,n){return{duration:n,startTime:t,type:`setValueCurve`,values:e}},c=function(e,t,n){var r=n.startTime,i=n.target,a=n.timeConstant;return i+(t-i)*Math.exp((r-e)/a)},l=function(e){return e.type===`exponentialRampToValue`},u=function(e){return e.type===`linearRampToValue`},d=function(e){return l(e)||u(e)},f=function(e){return e.type===`setValue`},p=function(e){return e.type===`setValueCurve`},m=function(e,t,n,r){var i=e[t];return i===void 0?r:d(i)||f(i)?i.value:p(i)?i.values[i.values.length-1]:c(n,m(e,t-1,i.startTime,r),i)},h=function(e,t,n,r,i){return n===void 0?[r.insertTime,i]:d(n)?[n.endTime,n.value]:f(n)?[n.startTime,n.value]:p(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,m(e,t-1,n.startTime,i)]},g=function(e){return e.type===`cancelAndHold`},_=function(e){return e.type===`cancelScheduledValues`},v=function(e){return g(e)||_(e)?e.cancelTime:l(e)||u(e)?e.endTime:e.startTime},y=function(e,t,n,r){var i=r.endTime,a=r.value;return n===a?a:0=t:v(n)>=t}),r=this._automationEvents[n];if(n!==-1&&(this._automationEvents=this._automationEvents.slice(0,n)),g(e)){var c=this._automationEvents[this._automationEvents.length-1];if(r!==void 0&&d(r)){if(c!==void 0&&w(c))throw Error(`The internal list is malformed.`);var f=c===void 0?r.insertTime:p(c)?c.startTime+c.duration:v(c),m=c===void 0?this._defaultValue:p(c)?c.values[c.values.length-1]:c.value,h=l(r)?y(t,f,m,r):b(t,f,m,r),x=l(r)?i(h,t,this._currenTime):a(h,t,this._currenTime);this._automationEvents.push(x)}if(c!==void 0&&w(c)&&this._automationEvents.push(o(this.getValue(t),t)),c!==void 0&&p(c)&&c.startTime+c.duration>t){var S=t-c.startTime;this._automationEvents[this._automationEvents.length-1]=s(C(c.values,c.duration,S),c.startTime,S)}}}else{var T=this._automationEvents.findIndex(function(e){return v(e)>t}),E=T===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[T-1];if(E!==void 0&&p(E)&&v(E)+E.duration>t)return!1;var D=l(e)?i(e.value,e.endTime,this._currenTime):u(e)?a(e.value,t,this._currenTime):e;if(T===-1)this._automationEvents.push(D);else{if(p(e)&&t+e.duration>v(this._automationEvents[T]))return!1;this._automationEvents.splice(T,0,D)}}return!0}},{key:`flush`,value:function(e){var t=this._automationEvents.findIndex(function(t){return v(t)>e});if(t>1){var n=this._automationEvents.slice(t-1),r=n[0];w(r)&&n.unshift(o(m(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:`getValue`,value:function(e){if(this._automationEvents.length===0)return this._defaultValue;var n=this._automationEvents.findIndex(function(t){return v(t)>e}),r=this._automationEvents[n],i=(n===-1?this._automationEvents.length:n)-1,a=this._automationEvents[i];if(a!==void 0&&w(a)&&(r===void 0||!d(r)||r.insertTime>e))return c(e,m(this._automationEvents,i-1,a.startTime,this._defaultValue),a);if(a!==void 0&&f(a)&&(r===void 0||!d(r)))return a.value;if(a!==void 0&&p(a)&&(r===void 0||!d(r)||a.startTime+a.duration>e))return enew DOMException(``,`AbortError`),Is=e=>(t,n,[r,i,a],o)=>{e(t[i],[n,r,a],e=>e[0]===n&&e[1]===r,o)},Ls=e=>(t,n,r)=>{let i=[];for(let e=0;e(t,n)=>{e.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:n})},zs=new WeakSet,Bs=new WeakMap,Vs=new WeakMap,Hs=new WeakMap,Us=new WeakMap,Ws=new WeakMap,Gs=new WeakMap,Ks=new WeakMap,qs=new WeakMap,Js=new WeakMap,Ys={construct(){return Ys}},Xs=e=>{try{new new Proxy(e,Ys)}catch{return!1}return!0},Zs=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,Qs=(e,t)=>{let n=[],r=e.replace(/^[\s]+/,``),i=r.match(Zs);for(;i!==null;){let e=i[1].slice(1,-1),a=i[0].replace(/([\s]+)?;?$/,``).replace(e,new URL(e,t).toString());n.push(a),r=r.slice(i[0].length).replace(/^[\s]+/,``),i=r.match(Zs)}return[n.join(`;`),r]},$s=e=>{if(e!==void 0&&!Array.isArray(e))throw TypeError(`The parameterDescriptors property of given value for processorCtor is not an array.`)},ec=e=>{if(!Xs(e))throw TypeError(`The given value for processorCtor should be a constructor.`);if(e.prototype===null||typeof e.prototype!=`object`)throw TypeError(`The given value for processorCtor should have a prototype.`)},tc=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=0;return(m,h,g={credentials:`omit`})=>{let _=u.get(m);if(_!==void 0&&_.has(h))return Promise.resolve();let v=l.get(m);if(v!==void 0){let e=v.get(h);if(e!==void 0)return e}let y=a(m),b=y.audioWorklet===void 0?i(h).then(([e,t])=>{let[r,i]=Qs(e,t);return n(`${r};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${i} +})})(window,'_AWGS')`)}).then(()=>{let e=f._AWGS.pop();if(e===void 0)throw SyntaxError();r(y.currentTime,y.sampleRate,()=>e(class{},void 0,(e,n)=>{if(e.trim()===``)throw t();let r=qs.get(y);if(r!==void 0){if(r.has(e))throw t();ec(n),$s(n.parameterDescriptors),r.set(e,n)}else ec(n),$s(n.parameterDescriptors),qs.set(y,new Map([[e,n]]))},y.sampleRate,void 0,void 0))}):Promise.all([i(h),Promise.resolve(e(d,d))]).then(([[e,t],n])=>{let r=p+1;p=r;let[i,a]=Qs(e,t),l=`${i};((AudioWorkletProcessor,registerProcessor)=>{${a} +})(${n?`AudioWorkletProcessor`:`class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}`},(n,p)=>registerProcessor(n,class extends p{${n?``:`__c = (a) => a.forEach(e=>this.__b.add(e.buffer));`}process(i,o,p){${n?``:`i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));`}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${r}',class extends AudioWorkletProcessor{process(){return !1}})`,u=new Blob([l],{type:`application/javascript; charset=utf-8`}),d=URL.createObjectURL(u);return y.audioWorklet.addModule(d,g).then(()=>{if(s(y))return y;let e=o(y);return e.audioWorklet.addModule(d,g).then(()=>e)}).then(e=>{if(c===null)throw SyntaxError();try{new c(e,`__sac${r}`)}catch{throw SyntaxError()}}).finally(()=>URL.revokeObjectURL(d))});return v===void 0?l.set(m,new Map([[h,b]])):v.set(h,b),b.then(()=>{let e=u.get(m);e===void 0?u.set(m,new Set([h])):e.add(h)}).finally(()=>{let e=l.get(m);e!==void 0&&e.delete(h)}),b}},nc=(e,t)=>{let n=e.get(t);if(n===void 0)throw Error(`A value with the given key could not be found.`);return n},rc=(e,t)=>{let n=Array.from(e).filter(t);if(n.length>1)throw Error(`More than one element was found.`);if(n.length===0)throw Error(`No element was found.`);let[r]=n;return e.delete(r),r},ic=(e,t,n,r)=>{let i=nc(e,t),a=rc(i,e=>e[0]===n&&e[1]===r);return i.size===0&&e.delete(t),a},ac=e=>nc(Gs,e),oc=e=>{if(zs.has(e))throw Error(`The AudioNode is already stored.`);zs.add(e),ac(e).forEach(e=>e(!0))},sc=e=>`port`in e,cc=e=>{if(!zs.has(e))throw Error(`The AudioNode is not stored.`);zs.delete(e),ac(e).forEach(e=>e(!1))},lc=(e,t)=>{!sc(e)&&t.every(e=>e.size===0)&&cc(e)},uc=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=new WeakMap;return(m,h,g,_,v)=>{let{activeInputs:y,passiveInputs:b}=a(h),{outputs:x}=a(m),S=s(m),C=a=>{let s=c(h),l=c(m);if(a){let t=ic(b,m,g,_);e(y,m,t,!1),!v&&!d(m)&&n(l,s,g,_),f(h)&&oc(h)}else{let e=r(y,m,g,_);t(b,_,e,!1),!v&&!d(m)&&i(l,s,g,_);let n=o(h);if(n===0)u(h)&&lc(h,y);else{let e=p.get(h);e!==void 0&&clearTimeout(e),p.set(h,setTimeout(()=>{u(h)&&lc(h,y)},n*1e3))}}};return l(x,[h,g,_],e=>e[0]===h&&e[1]===g&&e[2]===_,!0)?(S.add(C),u(m)?e(y,m,[g,_,C],!0):t(b,_,[m,g,C],!0),!0):!1}},dc=e=>(t,n,[r,i,a],o)=>{let s=t.get(r);s===void 0?t.set(r,new Set([[i,n,a]])):e(s,[i,n,a],e=>e[0]===i&&e[1]===n,o)},fc=e=>(t,n)=>{let r=e(t,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,gain:0});n.connect(r).connect(t.destination);let i=()=>{n.removeEventListener(`ended`,i),n.disconnect(r),r.disconnect()};n.addEventListener(`ended`,i)},pc=e=>(t,n)=>{e(t).add(n)},mc={channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},hc=(e,t,n,r,i,a)=>class extends e{constructor(e,n){let o=i(e),s=r(o,{...mc,...n}),c=a(o)?t():null;super(e,!1,s,c),this._nativeAnalyserNode=s}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){let t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){let t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}},gc=(e,t)=>e.context===t,_c=(e,t,n)=>()=>{let r=new WeakMap,i=async(i,a)=>{let o=t(i);return gc(o,a)||(o=e(a,{channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,fftSize:o.fftSize,maxDecibels:o.maxDecibels,minDecibels:o.minDecibels,smoothingTimeConstant:o.smoothingTimeConstant})),r.set(a,o),await n(i,a,o),o};return{render(e,t){let n=r.get(t);return n===void 0?i(e,t):Promise.resolve(n)}}},vc=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},yc=()=>new DOMException(``,`IndexSizeError`),bc=e=>{e.getChannelData=(t=>n=>{try{return t.call(e,n)}catch(e){throw e.code===12?yc():e}})(e.getChannelData)},xc={numberOfChannels:1},Sc=(e,t,n,r,i,a,o,s)=>{let c=null;return class l{constructor(l){if(i===null)throw Error(`Missing the native OfflineAudioContext constructor.`);let{length:u,numberOfChannels:d,sampleRate:f}={...xc,...l};c===null&&(c=new i(1,1,44100));let p=r!==null&&t(a,a)?new r({length:u,numberOfChannels:d,sampleRate:f}):c.createBuffer(d,u,f);if(p.numberOfChannels===0)throw n();return typeof p.copyFromChannel==`function`?t(vc,()=>vc(p))||s(p):(o(p),bc(p)),e.add(p),p}static[Symbol.hasInstance](t){return typeof t==`object`&&!!t&&Object.getPrototypeOf(t)===l.prototype||e.has(t)}}},Cc=-34028234663852886e22,wc=34028234663852886e22,Tc=e=>zs.has(e),Ec={buffer:null,channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,loop:!1,loopEnd:0,loopStart:0,playbackRate:1},Dc=(e,t,n,r,i,a,o,s)=>class extends e{constructor(e,r){let s=a(e),c={...Ec,...r},l=i(s,c),u=o(s),d=u?t():null;super(e,!1,l,d),this._audioBufferSourceNodeRenderer=d,this._isBufferNullified=!1,this._isBufferSet=c.buffer!==null,this._nativeAudioBufferSourceNode=l,this._onended=null,this._playbackRate=n(this,u,l.playbackRate,wc,Cc)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,e!==null){if(this._isBufferSet)throw r();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){let t=typeof e==`function`?s(this,e):null;this._nativeAudioBufferSourceNode.onended=t;let n=this._nativeAudioBufferSourceNode.onended;this._onended=n!==null&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=n===void 0?[e,t]:[e,t,n]),this.context.state!==`closed`){oc(this);let e=()=>{this._nativeAudioBufferSourceNode.removeEventListener(`ended`,e),Tc(this)&&cc(this)};this._nativeAudioBufferSourceNode.addEventListener(`ended`,e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=e)}},Oc=(e,t,n,r,i)=>()=>{let a=new WeakMap,o=null,s=null,c=async(c,l)=>{let u=n(c),d=gc(u,l);return d||(u=t(l,{buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value}),o!==null&&u.start(...o),s!==null&&u.stop(s)),a.set(l,u),d?await e(l,c.playbackRate,u.playbackRate):await r(l,c.playbackRate,u.playbackRate),await i(c,l,u),u};return{set start(e){o=e},set stop(e){s=e},render(e,t){let n=a.get(t);return n===void 0?c(e,t):Promise.resolve(n)}}},kc=e=>`playbackRate`in e,Ac=e=>`frequency`in e&&`gain`in e,jc=e=>`offset`in e,Mc=e=>!(`frequency`in e)&&`gain`in e,Nc=e=>`detune`in e&&`frequency`in e&&!(`gain`in e),Pc=e=>`pan`in e,Fc=e=>nc(Bs,e),Ic=e=>nc(Hs,e),Lc=(e,t)=>{let{activeInputs:n}=Fc(e);n.forEach(n=>n.forEach(([n])=>{t.includes(e)||Lc(n,[...t,e])}));let r=kc(e)?[e.playbackRate]:sc(e)?Array.from(e.parameters.values()):Ac(e)?[e.Q,e.detune,e.frequency,e.gain]:jc(e)?[e.offset]:Mc(e)?[e.gain]:Nc(e)?[e.detune,e.frequency]:Pc(e)?[e.pan]:[];for(let e of r){let n=Ic(e);n!==void 0&&n.activeInputs.forEach(([e])=>Lc(e,t))}Tc(e)&&cc(e)},Rc=e=>{Lc(e.destination,[])},zc=e=>e===void 0||typeof e==`number`||typeof e==`string`&&(e===`balanced`||e===`interactive`||e===`playback`),Bc=(e,t,n,r,i,a,o,s,c)=>class extends e{constructor(e={}){if(c===null)throw Error(`Missing the native AudioContext constructor.`);let t;try{t=new c(e)}catch(e){throw e.code===12&&e.message===`sampleRate is not in range`?n():e}if(t===null)throw r();if(!zc(e.latencyHint))throw TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(e.sampleRate!==void 0&&t.sampleRate!==e.sampleRate)throw n();super(t,2);let{latencyHint:i}=e,{sampleRate:a}=t;if(this._baseLatency=typeof t.baseLatency==`number`?t.baseLatency:i===`balanced`?512/a:i===`interactive`||i===void 0?256/a:i===`playback`?1024/a:Math.max(2,Math.min(128,Math.round(i*a/128)))*128/a,this._nativeAudioContext=t,c.name===`webkitAudioContext`?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,t.state===`running`){this._state=`suspended`;let e=()=>{this._state===`suspended`&&(this._state=null),t.removeEventListener(`statechange`,e)};t.addEventListener(`statechange`,e)}}get baseLatency(){return this._baseLatency}get state(){return this._state===null?this._nativeAudioContext.state:this._state}close(){return this.state===`closed`?this._nativeAudioContext.close().then(()=>{throw t()}):(this._state===`suspended`&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),Rc(this)}))}createMediaElementSource(e){return new i(this,{mediaElement:e})}createMediaStreamDestination(){return new a(this)}createMediaStreamSource(e){return new o(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new s(this,{mediaStreamTrack:e})}resume(){return this._state===`suspended`?new Promise((e,t)=>{let n=()=>{this._nativeAudioContext.removeEventListener(`statechange`,n),this._nativeAudioContext.state===`running`?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener(`statechange`,n)}):this._nativeAudioContext.resume().catch(e=>{throw e===void 0||e.code===15?t():e})}suspend(){return this._nativeAudioContext.suspend().catch(e=>{throw e===void 0?t():e})}},Vc=(e,t,n,r,i,a,o,s)=>class extends e{constructor(e,n){let r=a(e),c=o(r),l=i(r,n,c),u=c?t(s):null;super(e,!1,l,u),this._isNodeOfNativeOfflineAudioContext=c,this._nativeAudioDestinationNode=l}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},Hc=e=>{let t=new WeakMap,n=async(n,r)=>{let i=r.destination;return t.set(r,i),await e(n,r,i),i};return{render(e,r){let i=t.get(r);return i===void 0?n(e,r):Promise.resolve(i)}}},Uc=(e,t,n,r,i,a,o,s)=>(c,l)=>{let u=l.listener,{forwardX:d,forwardY:f,forwardZ:p,positionX:m,positionY:h,positionZ:g,upX:_,upY:v,upZ:y}=u.forwardX===void 0?(()=>{let d=new Float32Array(1),f=t(l,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`speakers`,numberOfInputs:9}),p=o(l),m=!1,h=[0,0,-1,0,1,0],g=[0,0,0],_=()=>{if(m)return;m=!0;let e=r(l,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{let t=[a(e,d,0),a(e,d,1),a(e,d,2),a(e,d,3),a(e,d,4),a(e,d,5)];t.some((e,t)=>e!==h[t])&&(u.setOrientation(...t),h=t);let n=[a(e,d,6),a(e,d,7),a(e,d,8)];n.some((e,t)=>e!==g[t])&&(u.setPosition(...n),g=n)},f.connect(e)},v=e=>t=>{t!==h[e]&&(h[e]=t,u.setOrientation(...h))},y=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},b=(t,r,a)=>{let o=n(l,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,offset:r});o.connect(f,0,t),o.start(),Object.defineProperty(o.offset,"defaultValue",{get(){return r}});let u=e({context:c},p,o.offset,wc,Cc);return s(u,`value`,e=>()=>e.call(u),e=>t=>{try{e.call(u,t)}catch(e){if(e.code!==9)throw e}_(),p&&a(t)}),u.cancelAndHoldAtTime=(e=>p?()=>{throw i()}:(...t)=>{let n=e.apply(u,t);return _(),n})(u.cancelAndHoldAtTime),u.cancelScheduledValues=(e=>p?()=>{throw i()}:(...t)=>{let n=e.apply(u,t);return _(),n})(u.cancelScheduledValues),u.exponentialRampToValueAtTime=(e=>p?()=>{throw i()}:(...t)=>{let n=e.apply(u,t);return _(),n})(u.exponentialRampToValueAtTime),u.linearRampToValueAtTime=(e=>p?()=>{throw i()}:(...t)=>{let n=e.apply(u,t);return _(),n})(u.linearRampToValueAtTime),u.setTargetAtTime=(e=>p?()=>{throw i()}:(...t)=>{let n=e.apply(u,t);return _(),n})(u.setTargetAtTime),u.setValueAtTime=(e=>p?()=>{throw i()}:(...t)=>{let n=e.apply(u,t);return _(),n})(u.setValueAtTime),u.setValueCurveAtTime=(e=>p?()=>{throw i()}:(...t)=>{let n=e.apply(u,t);return _(),n})(u.setValueCurveAtTime),u};return{forwardX:b(0,0,v(0)),forwardY:b(1,0,v(1)),forwardZ:b(2,-1,v(2)),positionX:b(6,0,y(0)),positionY:b(7,0,y(1)),positionZ:b(8,0,y(2)),upX:b(3,0,v(3)),upY:b(4,1,v(4)),upZ:b(5,0,v(5))}})():u;return{get forwardX(){return d},get forwardY(){return f},get forwardZ(){return p},get positionX(){return m},get positionY(){return h},get positionZ(){return g},get upX(){return _},get upY(){return v},get upZ(){return y}}},Wc=e=>`context`in e,Gc=e=>Wc(e[0]),Kc=(e,t,n,r)=>{for(let t of e)if(n(t)){if(r)return!1;throw Error(`The set contains at least one similar element.`)}return e.add(t),!0},qc=(e,t,[n,r],i)=>{Kc(e,[t,n,r],e=>e[0]===t&&e[1]===n,i)},Jc=(e,[t,n,r],i)=>{let a=e.get(t);a===void 0?e.set(t,new Set([[n,r]])):Kc(a,[n,r],e=>e[0]===n,i)},Yc=e=>`inputs`in e,Xc=(e,t,n,r)=>{if(Yc(t)){let i=t.inputs[r];return e.connect(i,n,0),[i,n,0]}return e.connect(t,n,r),[t,n,r]},Zc=(e,t,n)=>{for(let r of e)if(r[0]===t&&r[1]===n)return e.delete(r),r;return null},Qc=(e,t,n)=>rc(e,e=>e[0]===t&&e[1]===n),$c=(e,t)=>{if(!ac(e).delete(t))throw Error(`Missing the expected event listener.`)},el=(e,t,n)=>{let r=nc(e,t),i=rc(r,e=>e[0]===n);return r.size===0&&e.delete(t),i},tl=(e,t,n,r)=>{Yc(t)?e.disconnect(t.inputs[r],n,0):e.disconnect(t,n,r)},R=e=>nc(Vs,e),nl=e=>nc(Us,e),rl=e=>Ks.has(e),il=e=>!zs.has(e),al=(e,t)=>new Promise(n=>{if(t!==null)n(!0);else{let t=e.createScriptProcessor(256,1,1),r=e.createGain(),i=e.createBuffer(1,2,44100),a=i.getChannelData(0);a[0]=1,a[1]=1;let o=e.createBufferSource();o.buffer=i,o.loop=!0,o.connect(t).connect(e.destination),o.connect(r),o.disconnect(r),t.onaudioprocess=r=>{let i=r.inputBuffer.getChannelData(0);Array.prototype.some.call(i,e=>e===1)?n(!0):n(!1),o.stop(),t.onaudioprocess=null,o.disconnect(t),t.disconnect(e.destination)},o.start()}}),ol=(e,t)=>{let n=new Map;for(let t of e)for(let e of t){let t=n.get(e);n.set(e,t===void 0?1:t+1)}n.forEach((e,n)=>t(n,e))},sl=e=>`context`in e,cl=e=>{let t=new Map;e.connect=(e=>(n,r=0,i=0)=>{let a=sl(n)?e(n,r,i):e(n,r),o=t.get(n);return o===void 0?t.set(n,[{input:i,output:r}]):o.every(e=>e.input!==i||e.output!==r)&&o.push({input:i,output:r}),a})(e.connect.bind(e)),e.disconnect=(n=>(r,i,a)=>{if(n.apply(e),r===void 0)t.clear();else if(typeof r==`number`)for(let[e,n]of t){let i=n.filter(e=>e.output!==r);i.length===0?t.delete(e):t.set(e,i)}else if(t.has(r))if(i===void 0)t.delete(r);else{let e=t.get(r);if(e!==void 0){let n=e.filter(e=>e.output!==i&&(e.input!==a||a===void 0));n.length===0?t.delete(r):t.set(r,n)}}for(let[n,r]of t)r.forEach(t=>{sl(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)})})(e.disconnect)},ll=(e,t,n,r)=>{let{activeInputs:i,passiveInputs:a}=Ic(t),{outputs:o}=Fc(e),s=ac(e),c=o=>{let s=R(e),c=nl(t);if(o){let t=el(a,e,n);qc(i,e,t,!1),!r&&!rl(e)&&s.connect(c,n)}else{let t=Qc(i,e,n);Jc(a,t,!1),!r&&!rl(e)&&s.disconnect(c,n)}};return Kc(o,[t,n],e=>e[0]===t&&e[1]===n,!0)?(s.add(c),Tc(e)?qc(i,e,[n,c],!0):Jc(a,[e,n,c],!0),!0):!1},ul=(e,t,n,r)=>{let{activeInputs:i,passiveInputs:a}=Fc(t),o=Zc(i[r],e,n);return o===null?[ic(a,e,n,r)[2],!1]:[o[2],!0]},dl=(e,t,n)=>{let{activeInputs:r,passiveInputs:i}=Ic(t),a=Zc(r,e,n);return a===null?[el(i,e,n)[1],!1]:[a[2],!0]},fl=(e,t,n,r,i)=>{let[a,o]=ul(e,n,r,i);if(a!==null&&($c(e,a),o&&!t&&!rl(e)&&tl(R(e),R(n),r,i)),Tc(n)){let{activeInputs:e}=Fc(n);lc(n,e)}},pl=(e,t,n,r)=>{let[i,a]=dl(e,n,r);i!==null&&($c(e,i),a&&!t&&!rl(e)&&R(e).disconnect(nl(n),r))},ml=(e,t)=>{let n=Fc(e),r=[];for(let i of n.outputs)Gc(i)?fl(e,t,...i):pl(e,t,...i),r.push(i[0]);return n.outputs.clear(),r},hl=(e,t,n)=>{let r=Fc(e),i=[];for(let a of r.outputs)a[1]===n&&(Gc(a)?fl(e,t,...a):pl(e,t,...a),i.push(a[0]),r.outputs.delete(a));return i},gl=(e,t,n,r,i)=>{let a=Fc(e);return Array.from(a.outputs).filter(e=>e[0]===n&&(r===void 0||e[1]===r)&&(i===void 0||e[2]===i)).map(n=>(Gc(n)?fl(e,t,...n):pl(e,t,...n),a.outputs.delete(n),n[0]))},_l=(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)=>class extends l{constructor(t,r,i,a){super(i),this._context=t,this._nativeAudioNode=i;let o=u(t);d(o)&&!0!==n(al,()=>al(o,h))&&cl(i),Vs.set(this,i),Gs.set(this,new Set),t.state!==`closed`&&r&&oc(this),e(this,a,i)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,s=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw i();let l=m(u(this._context));if(f(e)||p(e))throw a();if(Wc(e)){let i=R(e);try{let t=Xc(this._nativeAudioNode,i,n,s),r=il(this);(l||r)&&this._nativeAudioNode.disconnect(...t),this.context.state!==`closed`&&!r&&il(e)&&oc(e)}catch(e){throw e.code===12?a():e}return t(this,e,n,s,l)&&ol(c([this],e),r(l)),e}let d=nl(e);if(d.name===`playbackRate`&&d.maxValue===1024)throw o();try{this._nativeAudioNode.connect(d,n),(l||il(this))&&this._nativeAudioNode.disconnect(d,n)}catch(e){throw e.code===12?a():e}ll(this,e,n,l)&&ol(c([this],e),r(l))}disconnect(e,t,n){let r,o=m(u(this._context));if(e===void 0)r=ml(this,o);else if(typeof e==`number`){if(e<0||e>=this.numberOfOutputs)throw i();r=hl(this,o,e)}else{if(t!==void 0&&(t<0||t>=this.numberOfOutputs)||Wc(e)&&n!==void 0&&(n<0||n>=e.numberOfInputs))throw i();if(r=gl(this,o,e,t,n),r.length===0)throw a()}for(let e of r)ol(c([this],e),s)}},vl=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>(p,m,h,g=null,_=null)=>{let v=h.value,y=new Ps.AutomationEventList(v),b=m?r(y):null,x={get defaultValue(){return v},get maxValue(){return g===null?h.maxValue:g},get minValue(){return _===null?h.minValue:_},get value(){return h.value},set value(e){h.value=e,x.setValueAtTime(e,p.context.currentTime)},cancelAndHoldAtTime(e){if(typeof h.cancelAndHoldAtTime==`function`)b===null&&y.flush(p.context.currentTime),y.add(i(e)),h.cancelAndHoldAtTime(e);else{let t=Array.from(y).pop();b===null&&y.flush(p.context.currentTime),y.add(i(e));let n=Array.from(y).pop();h.cancelScheduledValues(e),t!==n&&n!==void 0&&(n.type===`exponentialRampToValue`?h.exponentialRampToValueAtTime(n.value,n.endTime):n.type===`linearRampToValue`?h.linearRampToValueAtTime(n.value,n.endTime):n.type===`setValue`?h.setValueAtTime(n.value,n.startTime):n.type===`setValueCurve`&&h.setValueCurveAtTime(n.values,n.startTime,n.duration))}return x},cancelScheduledValues(e){return b===null&&y.flush(p.context.currentTime),y.add(a(e)),h.cancelScheduledValues(e),x},exponentialRampToValueAtTime(e,t){if(e===0||!Number.isFinite(t)||t<0)throw RangeError();let n=p.context.currentTime;return b===null&&y.flush(n),Array.from(y).length===0&&(y.add(l(v,n)),h.setValueAtTime(v,n)),y.add(o(e,t)),h.exponentialRampToValueAtTime(e,t),x},linearRampToValueAtTime(e,t){let n=p.context.currentTime;return b===null&&y.flush(n),Array.from(y).length===0&&(y.add(l(v,n)),h.setValueAtTime(v,n)),y.add(s(e,t)),h.linearRampToValueAtTime(e,t),x},setTargetAtTime(e,t,n){return b===null&&y.flush(p.context.currentTime),y.add(c(e,t,n)),h.setTargetAtTime(e,t,n),x},setValueAtTime(e,t){return b===null&&y.flush(p.context.currentTime),y.add(l(e,t)),h.setValueAtTime(e,t),x},setValueCurveAtTime(e,t,n){let r=e instanceof Float32Array?e:new Float32Array(e);if(d!==null&&d.name===`webkitAudioContext`){let e=t+n,i=p.context.sampleRate,a=Math.ceil(t*i),o=Math.floor(e*i),s=o-a,c=new Float32Array(s);for(let e=0;e({replay(t){for(let n of e)if(n.type===`exponentialRampToValue`){let{endTime:e,value:r}=n;t.exponentialRampToValueAtTime(r,e)}else if(n.type===`linearRampToValue`){let{endTime:e,value:r}=n;t.linearRampToValueAtTime(r,e)}else if(n.type===`setTarget`){let{startTime:e,target:r,timeConstant:i}=n;t.setTargetAtTime(r,e,i)}else if(n.type===`setValue`){let{startTime:e,value:r}=n;t.setValueAtTime(r,e)}else if(n.type===`setValueCurve`){let{duration:e,startTime:r,values:i}=n;t.setValueCurveAtTime(i,r,e)}else throw Error(`Can't apply an unknown automation.`)}}),bl=class{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach((n,r)=>e.call(t,n,r,this))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}},xl={channelCount:2,channelCountMode:`explicit`,channelInterpretation:`speakers`,numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},Sl=(e,t,n,r,i,a,o,s,c,l,u,d,f,p)=>class extends t{constructor(t,p,m){let h=s(t),g=c(h),_=u({...xl,...m});f(_);let v=qs.get(h)?.get(p),y=i(g||h.state!==`closed`?h:o(h)??h,g?null:t.baseLatency,l,p,v,_),b=g?r(p,_,v):null;super(t,!0,y,b);let x=[];y.parameters.forEach((e,t)=>{let r=n(this,g,e);x.push([t,r])}),this._nativeAudioWorkletNode=y,this._onprocessorerror=null,this._parameters=new bl(x),g&&e(h,this);let{activeInputs:S}=a(this);d(y,S)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(e){let t=typeof e==`function`?p(this,e):null;this._nativeAudioWorkletNode.onprocessorerror=t;let n=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=n!==null&&n===t?e:n}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function Cl(e,t,n,r,i){if(typeof e.copyFromChannel==`function`)t[n].byteLength===0&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],r,i);else{let a=e.getChannelData(r);if(t[n].byteLength===0)t[n]=a.slice(i,i+128);else{let e=new Float32Array(a.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}var wl=(e,t,n,r,i)=>{typeof e.copyToChannel==`function`?t[n].byteLength!==0&&e.copyToChannel(t[n],r,i):t[n].byteLength!==0&&e.getChannelData(r).set(t[n],i)},Tl=(e,t)=>{let n=[];for(let r=0;rnc(nc(Js,e),R(t)),Dl=async(e,t,n,r,i,a,o)=>{let s=t===null?Math.ceil(e.context.length/128)*128:t.length,c=r.channelCount*r.numberOfInputs,l=i.reduce((e,t)=>e+t,0),u=l===0?null:n.createBuffer(l,s,n.sampleRate);if(a===void 0)throw Error(`Missing the processor constructor.`);let d=Fc(e),f=await El(n,e),p=Tl(r.numberOfInputs,r.channelCount),m=Tl(r.numberOfOutputs,i),h=Array.from(e.parameters.keys()).reduce((e,t)=>({...e,[t]:new Float32Array(128)}),{});for(let l=0;l0&&t!==null)for(let e=0;e{Cl(t,h,e,c+n,l)});for(let e=0;ed.activeInputs[t].size===0?[]:e),t=o(l/n.sampleRate,n.sampleRate,()=>f.process(e,m,h));if(u!==null)for(let e=0,t=0;e(g,_,v)=>{let y=new WeakMap,b=null,x=async(s,x)=>{let S=u(s),C=null,w=gc(S,x),T=Array.isArray(_.outputChannelCount)?_.outputChannelCount:Array.from(_.outputChannelCount);if(d===null){let e=T.reduce((e,t)=>e+t,0),n=i(x,{channelCount:Math.max(1,e),channelCountMode:`explicit`,channelInterpretation:`discrete`,numberOfOutputs:Math.max(1,e)}),a=[];for(let e=0;e{let c=new f(n,Math.ceil(s.context.length/128)*128,x.sampleRate),l=[],u=[];for(let e=0;e<_.numberOfInputs;e+=1)l.push(o(c,{channelCount:_.channelCount,channelCountMode:_.channelCountMode,channelInterpretation:_.channelInterpretation,gain:1})),u.push(i(c,{channelCount:_.channelCount,channelCountMode:`explicit`,channelInterpretation:`discrete`,numberOfOutputs:_.channelCount}));let d=await Promise.all(Array.from(s.parameters.values()).map(async e=>{let t=a(c,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,offset:e.value});return await p(c,e,t.offset),t})),g=r(c,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`speakers`,numberOfInputs:Math.max(1,e+t)});for(let e=0;e<_.numberOfInputs;e+=1){l[e].connect(u[e]);for(let t=0;t<_.channelCount;t+=1)u[e].connect(g,t,e*_.channelCount+t)}for(let[t,n]of d.entries())n.connect(g,0,e+t),n.start(0);return g.connect(c.destination),await Promise.all(l.map(e=>m(s,c,e))),h(c)})(),x,_,T,v,l)}let e=await b,t=n(x,{buffer:null,channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[c,u,d]=C;e!==null&&(t.buffer=e,t.start(0)),t.connect(c);for(let e=0,t=0;eclass extends m{constructor(t,n){super(t,n),this._nativeContext=t,this._audioWorklet=e===void 0?void 0:{addModule:(t,n)=>e(this,t,n)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new i(this)}createBuffer(e,t,r){return new n({length:t,numberOfChannels:e,sampleRate:r})}createBufferSource(){return new r(this)}createChannelMerger(e=6){return new a(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new o(this,{numberOfOutputs:e})}createConstantSource(){return new s(this)}createConvolver(){return new c(this)}createDelay(e=1){return new u(this,{maxDelayTime:e})}createDynamicsCompressor(){return new d(this)}createGain(){return new f(this)}createIIRFilter(e,t){return new p(this,{feedback:t,feedforward:e})}createOscillator(){return new h(this)}createPanner(){return new g(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new _(this,{...n,imag:t,real:e})}createStereoPanner(){return new v(this)}createWaveShaper(){return new y(this)}decodeAudioData(e,t,n){return l(this._nativeContext,e).then(e=>(typeof t==`function`&&t(e),e),e=>{throw typeof n==`function`&&n(e),e})}},Al={Q:1,channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,detune:0,frequency:350,gain:0,type:`lowpass`},jl=(e,t,n,r,i,a,o,s)=>class extends e{constructor(e,r){let c=a(e),l=i(c,{...Al,...r}),u=o(c),d=u?n():null;super(e,!1,l,d),this._Q=t(this,u,l.Q,wc,Cc),this._detune=t(this,u,l.detune,1200*Math.log2(wc),-1200*Math.log2(wc)),this._frequency=t(this,u,l.frequency,e.sampleRate/2,0),this._gain=t(this,u,l.gain,40*Math.log10(wc),Cc),this._nativeBiquadFilterNode=l,s(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){throw e.code===11?r():e}if(e.length!==t.length||t.length!==n.length)throw r()}},Ml=(e,t,n,r,i)=>()=>{let a=new WeakMap,o=async(o,s)=>{let c=n(o),l=gc(c,s);return l||(c=t(s,{Q:c.Q.value,channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,detune:c.detune.value,frequency:c.frequency.value,gain:c.gain.value,type:c.type})),a.set(s,c),l?(await e(s,o.Q,c.Q),await e(s,o.detune,c.detune),await e(s,o.frequency,c.frequency),await e(s,o.gain,c.gain)):(await r(s,o.Q,c.Q),await r(s,o.detune,c.detune),await r(s,o.frequency,c.frequency),await r(s,o.gain,c.gain)),await i(o,s,c),c};return{render(e,t){let n=a.get(t);return n===void 0?o(e,t):Promise.resolve(n)}}},Nl=(e,t)=>(n,r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e.get(n);if(a!==void 0)return a;try{let i=r();return i instanceof Promise?(e.set(n,i),i.catch(()=>!1).then(r=>(e.delete(n),t.set(n,r),r))):(t.set(n,i),i)}catch{return t.set(n,!1),!1}},Pl={channelCount:1,channelCountMode:`explicit`,channelInterpretation:`speakers`,numberOfInputs:6},Fl=(e,t,n,r,i)=>class extends e{constructor(e,a){let o=r(e),s=n(o,{...Pl,...a}),c=i(o)?t():null;super(e,!1,s,c)}},Il=(e,t,n)=>()=>{let r=new WeakMap,i=async(i,a)=>{let o=t(i);return gc(o,a)||(o=e(a,{channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,numberOfInputs:o.numberOfInputs})),r.set(a,o),await n(i,a,o),o};return{render(e,t){let n=r.get(t);return n===void 0?i(e,t):Promise.resolve(n)}}},Ll={channelCount:6,channelCountMode:`explicit`,channelInterpretation:`discrete`,numberOfOutputs:6},Rl=(e,t,n,r,i,a)=>class extends e{constructor(e,o){let s=r(e),c=n(s,a({...Ll,...o})),l=i(s)?t():null;super(e,!1,c,l)}},zl=(e,t,n)=>()=>{let r=new WeakMap,i=async(i,a)=>{let o=t(i);return gc(o,a)||(o=e(a,{channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,numberOfOutputs:o.numberOfOutputs})),r.set(a,o),await n(i,a,o),o};return{render(e,t){let n=r.get(t);return n===void 0?i(e,t):Promise.resolve(n)}}},Bl=e=>(t,n,r)=>e(n,t,r),Vl=e=>(t,n,r=0,i=0)=>{let a=t[r];if(a===void 0)throw e();return sl(n)?a.connect(n,0,i):a.connect(n,0)},Hl=e=>(t,n)=>{let r=e(t,{buffer:null,channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,loop:!1,loopEnd:0,loopStart:0,playbackRate:1});return r.buffer=t.createBuffer(1,2,44100),r.loop=!0,r.connect(n),r.start(),()=>{r.stop(),r.disconnect(n)}},Ul={channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,offset:1},Wl=(e,t,n,r,i,a,o)=>class extends e{constructor(e,o){let s=i(e),c=r(s,{...Ul,...o}),l=a(s),u=l?n():null;super(e,!1,c,u),this._constantSourceNodeRenderer=u,this._nativeConstantSourceNode=c,this._offset=t(this,l,c.offset,wc,Cc),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){let t=typeof e==`function`?o(this,e):null;this._nativeConstantSourceNode.onended=t;let n=this._nativeConstantSourceNode.onended;this._onended=n!==null&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=e),this.context.state!==`closed`){oc(this);let e=()=>{this._nativeConstantSourceNode.removeEventListener(`ended`,e),Tc(this)&&cc(this)};this._nativeConstantSourceNode.addEventListener(`ended`,e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=e)}},Gl=(e,t,n,r,i)=>()=>{let a=new WeakMap,o=null,s=null,c=async(c,l)=>{let u=n(c),d=gc(u,l);return d||(u=t(l,{channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value}),o!==null&&u.start(o),s!==null&&u.stop(s)),a.set(l,u),d?await e(l,c.offset,u.offset):await r(l,c.offset,u.offset),await i(c,l,u),u};return{set start(e){o=e},set stop(e){s=e},render(e,t){let n=a.get(t);return n===void 0?c(e,t):Promise.resolve(n)}}},Kl=e=>t=>(e[0]=t,e[0]),ql={buffer:null,channelCount:2,channelCountMode:`clamped-max`,channelInterpretation:`speakers`,disableNormalization:!1},Jl=(e,t,n,r,i,a)=>class extends e{constructor(e,o){let s=r(e),c={...ql,...o},l=n(s,c),u=i(s)?t():null;super(e,!1,l,u),this._isBufferNullified=!1,this._nativeConvolverNode=l,c.buffer!==null&&a(this,c.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,e===null&&this._nativeConvolverNode.buffer!==null){let e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,a(this,0)}else this._isBufferNullified=!1,a(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}},Yl=(e,t,n)=>()=>{let r=new WeakMap,i=async(i,a)=>{let o=t(i);return gc(o,a)||(o=e(a,{buffer:o.buffer,channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,disableNormalization:!o.normalize})),r.set(a,o),Yc(o)?await n(i,a,o.inputs[0]):await n(i,a,o),o};return{render(e,t){let n=r.get(t);return n===void 0?i(e,t):Promise.resolve(n)}}},Xl=(e,t)=>(n,r,i)=>{if(t===null)throw Error(`Missing the native OfflineAudioContext constructor.`);try{return new t(n,r,i)}catch(t){throw t.name===`SyntaxError`?e():t}},Zl=()=>new DOMException(``,`DataCloneError`),Ql=e=>{let{port1:t,port2:n}=new MessageChannel;return new Promise(r=>{let i=()=>{n.onmessage=null,t.close(),n.close(),r()};n.onmessage=()=>i();try{t.postMessage(e,[e])}catch{}finally{i()}})},$l=(e,t,n,r,i,a,o,s,c,l,u)=>(d,f)=>{let p=o(d)?d:a(d);if(i.has(f)){let e=n();return Promise.reject(e)}try{i.add(f)}catch{}return t(c,()=>c(p))?p.decodeAudioData(f).then(n=>(Ql(f).catch(()=>{}),t(s,()=>s(n))||u(n),e.add(n),n)):new Promise((t,n)=>{let i=async()=>{try{await Ql(f)}catch{}},a=e=>{n(e),i()};try{p.decodeAudioData(f,n=>{typeof n.copyFromChannel!=`function`&&(l(n),bc(n)),e.add(n),i().then(()=>t(n))},e=>{a(e===null?r():e)})}catch(e){a(e)}})},eu=(e,t,n,r,i,a,o,s)=>(c,l)=>{let u=t.get(c);if(u===void 0)throw Error(`Missing the expected cycle count.`);let d=s(a(c.context));if(u===l){if(t.delete(c),!d&&o(c)){let t=r(c),{outputs:a}=n(c);for(let n of a)if(Gc(n))e(t,r(n[0]),n[1],n[2]);else{let e=i(n[0]);t.connect(e,n[1])}}}else t.set(c,u-l)},tu={channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,delayTime:0,maxDelayTime:1},nu=(e,t,n,r,i,a,o)=>class extends e{constructor(e,s){let c=i(e),l={...tu,...s},u=r(c,l),d=a(c),f=d?n(l.maxDelayTime):null;super(e,!1,u,f),this._delayTime=t(this,d,u.delayTime),o(this,l.maxDelayTime)}get delayTime(){return this._delayTime}},ru=(e,t,n,r,i)=>a=>{let o=new WeakMap,s=async(s,c)=>{let l=n(s),u=gc(l,c);return u||(l=t(c,{channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,delayTime:l.delayTime.value,maxDelayTime:a})),o.set(c,l),u?await e(c,s.delayTime,l.delayTime):await r(c,s.delayTime,l.delayTime),await i(s,c,l),l};return{render(e,t){let n=o.get(t);return n===void 0?s(e,t):Promise.resolve(n)}}},iu=e=>(t,n,r,i)=>e(t[i],e=>e[0]===n&&e[1]===r),au=e=>(t,n)=>{e(t).delete(n)},ou=e=>`delayTime`in e,su=(e,t,n)=>function r(i,a){let o=Wc(a)?a:n(e,a);if(ou(o))return[];if(i[0]===o)return[i];if(i.includes(o))return[];let{outputs:s}=t(o);return Array.from(s).map(e=>r([...i,o],e[0])).reduce((e,t)=>e.concat(t),[])},cu=(e,t,n)=>{let r=t[n];if(r===void 0)throw e();return r},lu=e=>(t,n=void 0,r=void 0,i=0)=>n===void 0?t.forEach(e=>e.disconnect()):typeof n==`number`?cu(e,t,n).disconnect():sl(n)?r===void 0?t.forEach(e=>e.disconnect(n)):i===void 0?cu(e,t,r).disconnect(n,0):cu(e,t,r).disconnect(n,0,i):r===void 0?t.forEach(e=>e.disconnect(n)):cu(e,t,r).disconnect(n,0),uu={attack:.003,channelCount:2,channelCountMode:`clamped-max`,channelInterpretation:`speakers`,knee:30,ratio:12,release:.25,threshold:-24},du=(e,t,n,r,i,a,o,s)=>class extends e{constructor(e,i){let c=a(e),l=r(c,{...uu,...i}),u=o(c),d=u?n():null;super(e,!1,l,d),this._attack=t(this,u,l.attack),this._knee=t(this,u,l.knee),this._nativeDynamicsCompressorNode=l,this._ratio=t(this,u,l.ratio),this._release=t(this,u,l.release),this._threshold=t(this,u,l.threshold),s(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){let t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){let t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,e===`max`)throw this._nativeDynamicsCompressorNode.channelCountMode=t,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value==`number`?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},fu=(e,t,n,r,i)=>()=>{let a=new WeakMap,o=async(o,s)=>{let c=n(o),l=gc(c,s);return l||(c=t(s,{attack:c.attack.value,channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,knee:c.knee.value,ratio:c.ratio.value,release:c.release.value,threshold:c.threshold.value})),a.set(s,c),l?(await e(s,o.attack,c.attack),await e(s,o.knee,c.knee),await e(s,o.ratio,c.ratio),await e(s,o.release,c.release),await e(s,o.threshold,c.threshold)):(await r(s,o.attack,c.attack),await r(s,o.knee,c.knee),await r(s,o.ratio,c.ratio),await r(s,o.release,c.release),await r(s,o.threshold,c.threshold)),await i(o,s,c),c};return{render(e,t){let n=a.get(t);return n===void 0?o(e,t):Promise.resolve(n)}}},pu=()=>new DOMException(``,`EncodingError`),mu=e=>t=>new Promise((n,r)=>{if(e===null){r(SyntaxError());return}let i=e.document.head;if(i===null)r(SyntaxError());else{let a=e.document.createElement(`script`),o=new Blob([t],{type:`application/javascript`}),s=URL.createObjectURL(o),c=e.onerror,l=()=>{e.onerror=c,URL.revokeObjectURL(s)};e.onerror=(t,n,i,a,o)=>{if(n===s||n===e.location.href&&i===1&&a===1)return l(),r(o),!1;if(c!==null)return c(t,n,i,a,o)},a.onerror=()=>{l(),r(SyntaxError())},a.onload=()=>{l(),n()},a.src=s,a.type=`module`,i.appendChild(a)}}),hu=e=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(t,n,r){if(n!==null){let i=this._listeners.get(n);i===void 0&&(i=e(this,n),typeof n==`function`&&this._listeners.set(n,i)),this._nativeEventTarget.addEventListener(t,i,r)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){let r=t===null?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,r===void 0?null:r,n)}},gu=e=>(t,n,r)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get(){return Math.round(t*n)}},currentTime:{configurable:!0,get(){return t}}});try{return r()}finally{e!==null&&(delete e.currentFrame,delete e.currentTime)}},_u=e=>async t=>{try{let e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw e()},vu={channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,gain:1},yu=(e,t,n,r,i,a)=>class extends e{constructor(e,o){let s=i(e),c=r(s,{...vu,...o}),l=a(s),u=l?n():null;super(e,!1,c,u),this._gain=t(this,l,c.gain,wc,Cc)}get gain(){return this._gain}},bu=(e,t,n,r,i)=>()=>{let a=new WeakMap,o=async(o,s)=>{let c=n(o),l=gc(c,s);return l||(c=t(s,{channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,gain:c.gain.value})),a.set(s,c),l?await e(s,o.gain,c.gain):await r(s,o.gain,c.gain),await i(o,s,c),c};return{render(e,t){let n=a.get(t);return n===void 0?o(e,t):Promise.resolve(n)}}},xu=(e,t)=>n=>t(e,n),Su=e=>t=>{let n=e(t);if(n.renderer===null)throw Error(`Missing the renderer of the given AudioNode in the audio graph.`);return n.renderer},Cu=e=>t=>e.get(t)??0,wu=e=>t=>{let n=e(t);if(n.renderer===null)throw Error(`Missing the renderer of the given AudioParam in the audio graph.`);return n.renderer},Tu=e=>t=>e.get(t),z=()=>new DOMException(``,`InvalidStateError`),Eu=e=>t=>{let n=e.get(t);if(n===void 0)throw z();return n},Du=(e,t)=>n=>{let r=e.get(n);if(r!==void 0)return r;if(t===null)throw Error(`Missing the native OfflineAudioContext constructor.`);return r=new t(1,1,44100),e.set(n,r),r},Ou=e=>t=>{let n=e.get(t);if(n===void 0)throw Error(`The context has no set of AudioWorkletNodes.`);return n},ku=()=>new DOMException(``,`InvalidAccessError`),Au=e=>{e.getFrequencyResponse=(t=>(n,r,i)=>{if(n.length!==r.length||r.length!==i.length)throw ku();return t.call(e,n,r,i)})(e.getFrequencyResponse)},ju={channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`},Mu=(e,t,n,r,i,a)=>class extends e{constructor(e,o){let s=r(e),c=i(s),l={...ju,...o},u=t(s,c?null:e.baseLatency,l),d=c?n(l.feedback,l.feedforward):null;super(e,!1,u,d),Au(u),this._nativeIIRFilterNode=u,a(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}},Nu=(e,t,n,r,i,a,o,s,c,l,u)=>{let d=l.length,f=s;for(let s=0;s{let i=n instanceof Float64Array?n:new Float64Array(n),a=r instanceof Float64Array?r:new Float64Array(r),o=i.length,s=a.length,c=Math.min(o,s);if(i[0]!==1){for(let e=0;e(a,o)=>{let s=new WeakMap,c=null,l=async(l,u)=>{let d=null,f=t(l),p=gc(f,u);if(u.createIIRFilter===void 0?d=e(u,{buffer:null,channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):p||(f=u.createIIRFilter(o,a)),s.set(u,d===null?f:d),d!==null){if(c===null){if(n===null)throw Error(`Missing the native OfflineAudioContext constructor.`);let e=new n(l.context.destination.channelCount,l.context.length,u.sampleRate);c=(async()=>(await r(l,e,e.destination),Pu(await i(e),u,a,o)))()}let e=await c;return d.buffer=e,d.start(0),d}return await r(l,u,f),f};return{render(e,t){let n=s.get(t);return n===void 0?l(e,t):Promise.resolve(n)}}},Iu=(e,t,n,r,i,a)=>o=>(s,c)=>{let l=e.get(s);if(l===void 0){if(!o&&a(s)){let e=r(s),{outputs:a}=n(s);for(let n of a)if(Gc(n))t(e,r(n[0]),n[1],n[2]);else{let t=i(n[0]);e.disconnect(t,n[1])}}e.set(s,c)}else e.set(s,l+c)},Lu=(e,t)=>n=>t(e.get(n))||t(n),Ru=(e,t)=>n=>e.has(n)||t(n),zu=(e,t)=>n=>e.has(n)||t(n),Bu=(e,t)=>n=>t(e.get(n))||t(n),Vu=e=>t=>e!==null&&t instanceof e,Hu=e=>t=>e!==null&&typeof e.AudioNode==`function`&&t instanceof e.AudioNode,Uu=e=>t=>e!==null&&typeof e.AudioParam==`function`&&t instanceof e.AudioParam,Wu=(e,t)=>n=>e(n)||t(n),Gu=e=>t=>e!==null&&t instanceof e,Ku=e=>e!==null&&e.isSecureContext,qu=(e,t,n,r)=>class extends e{constructor(e,i){let a=n(e),o=t(a,i);if(r(a))throw TypeError();super(e,!0,o,null),this._nativeMediaElementAudioSourceNode=o}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},Ju={channelCount:2,channelCountMode:`explicit`,channelInterpretation:`speakers`},Yu=(e,t,n,r)=>class extends e{constructor(e,i){let a=n(e);if(r(a))throw TypeError();let o=t(a,{...Ju,...i});super(e,!1,o,null),this._nativeMediaStreamAudioDestinationNode=o}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},Xu=(e,t,n,r)=>class extends e{constructor(e,i){let a=n(e),o=t(a,i);if(r(a))throw TypeError();super(e,!0,o,null),this._nativeMediaStreamAudioSourceNode=o}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},Zu=(e,t,n)=>class extends e{constructor(e,r){let i=t(n(e),r);super(e,!0,i,null)}},Qu=(e,t,n,r,i,a)=>class extends n{constructor(n,a){super(n),this._nativeContext=n,Ws.set(this,n),r(n)&&i.set(n,new Set),this._destination=new e(this,a),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){let t=typeof e==`function`?a(this,e):null;this._nativeContext.onstatechange=t;let n=this._nativeContext.onstatechange;this._onstatechange=n!==null&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},$u=e=>{let t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{let n=e.decodeAudioData(t.buffer,()=>{});return n===void 0?!1:(n.catch(()=>{}),!0)}catch{}return!1},ed=(e,t)=>(n,r,i)=>{let a=new Set;return n.connect=(i=>(o,s=0,c=0)=>{let l=a.size===0;if(t(o))return i.call(n,o,s,c),e(a,[o,s,c],e=>e[0]===o&&e[1]===s&&e[2]===c,!0),l&&r(),o;i.call(n,o,s),e(a,[o,s],e=>e[0]===o&&e[1]===s,!0),l&&r()})(n.connect),n.disconnect=(e=>(r,o,s)=>{let c=a.size>0;if(r===void 0)e.apply(n),a.clear();else if(typeof r==`number`){e.call(n,r);for(let e of a)e[1]===r&&a.delete(e)}else{t(r)?e.call(n,r,o,s):e.call(n,r,o);for(let e of a)e[0]===r&&(o===void 0||e[1]===o)&&(s===void 0||e[2]===s)&&a.delete(e)}let l=a.size===0;c&&l&&i()})(n.disconnect),n},B=(e,t,n)=>{let r=t[n];r!==void 0&&r!==e[n]&&(e[n]=r)},V=(e,t)=>{B(e,t,`channelCount`),B(e,t,`channelCountMode`),B(e,t,`channelInterpretation`)},td=e=>typeof e.getFloatTimeDomainData==`function`,nd=e=>{e.getFloatTimeDomainData=t=>{let n=new Uint8Array(t.length);e.getByteTimeDomainData(n);let r=Math.max(n.length,e.fftSize);for(let e=0;e(n,r)=>{let i=n.createAnalyser();if(V(i,r),!(r.maxDecibels>r.minDecibels))throw t();return B(i,r,`fftSize`),B(i,r,`maxDecibels`),B(i,r,`minDecibels`),B(i,r,`smoothingTimeConstant`),e(td,()=>td(i))||nd(i),i},id=e=>e===null?null:e.hasOwnProperty(`AudioBuffer`)?e.AudioBuffer:null,H=(e,t,n)=>{let r=t[n];r!==void 0&&r!==e[n].value&&(e[n].value=r)},ad=e=>{e.start=(t=>{let n=!1;return(r=0,i=0,a)=>{if(n)throw z();t.call(e,r,i,a),n=!0}})(e.start)},od=e=>{e.start=(t=>(n=0,r=0,i)=>{if(typeof i==`number`&&i<0||r<0||n<0)throw RangeError(`The parameters can't be negative.`);t.call(e,n,r,i)})(e.start)},sd=e=>{e.stop=(t=>(n=0)=>{if(n<0)throw RangeError(`The parameter can't be negative.`);t.call(e,n)})(e.stop)},cd=(e,t,n,r,i,a,o,s,c,l,u)=>(d,f)=>{let p=d.createBufferSource();return V(p,f),H(p,f,`playbackRate`),B(p,f,`buffer`),B(p,f,`loop`),B(p,f,`loopEnd`),B(p,f,`loopStart`),t(n,()=>n(d))||ad(p),t(r,()=>r(d))||c(p),t(i,()=>i(d))||l(p,d),t(a,()=>a(d))||od(p),t(o,()=>o(d))||u(p,d),t(s,()=>s(d))||sd(p),e(d,p),p},ld=e=>e===null?null:e.hasOwnProperty(`AudioContext`)?e.AudioContext:e.hasOwnProperty(`webkitAudioContext`)?e.webkitAudioContext:null,ud=(e,t)=>(n,r,i)=>{let a=n.destination;if(a.channelCount!==r)try{a.channelCount=r}catch{}i&&a.channelCountMode!==`explicit`&&(a.channelCountMode=`explicit`),a.maxChannelCount===0&&Object.defineProperty(a,"maxChannelCount",{value:r});let o=e(n,{channelCount:r,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,gain:1});return t(o,`channelCount`,e=>()=>e.call(o),e=>t=>{e.call(o,t);try{a.channelCount=t}catch(e){if(t>a.maxChannelCount)throw e}}),t(o,`channelCountMode`,e=>()=>e.call(o),e=>t=>{e.call(o,t),a.channelCountMode=t}),t(o,`channelInterpretation`,e=>()=>e.call(o),e=>t=>{e.call(o,t),a.channelInterpretation=t}),Object.defineProperty(o,"maxChannelCount",{get:()=>a.maxChannelCount}),o.connect(a),o},dd=e=>e===null?null:e.hasOwnProperty(`AudioWorkletNode`)?e.AudioWorkletNode:null,fd=e=>{let{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}},pd=(e,t,n,r,i)=>(a,o,s,c,l,u)=>{if(s!==null)try{let t=new s(a,c,u),r=new Map,o=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>`explicit`,set:()=>{throw e()}},onprocessorerror:{get:()=>o,set:e=>{typeof o==`function`&&t.removeEventListener(`processorerror`,o),o=typeof e==`function`?e:null,typeof o==`function`&&t.addEventListener(`processorerror`,o)}}}),t.addEventListener=(e=>(...n)=>{if(n[0]===`processorerror`){let e=typeof n[1]==`function`?n[1]:typeof n[1]==`object`&&n[1]!==null&&typeof n[1].handleEvent==`function`?n[1].handleEvent:null;if(e!==null){let t=r.get(n[1]);t===void 0?(n[1]=t=>{t.type===`error`?(Object.defineProperties(t,{type:{value:`processorerror`}}),e(t)):e(new ErrorEvent(n[0],{...t}))},r.set(e,n[1])):n[1]=t}}return e.call(t,`error`,n[1],n[2]),e.call(t,...n)})(t.addEventListener),t.removeEventListener=(e=>(...n)=>{if(n[0]===`processorerror`){let e=r.get(n[1]);e!==void 0&&(r.delete(n[1]),n[1]=e)}return e.call(t,`error`,n[1],n[2]),e.call(t,n[0],n[1],n[2])})(t.removeEventListener),u.numberOfOutputs!==0){let e=n(a,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,gain:0});return t.connect(e).connect(a.destination),i(t,()=>e.disconnect(),()=>e.connect(a.destination))}return t}catch(e){throw e.code===11?r():e}if(l===void 0)throw r();return fd(u),t(a,o,l,u)},md=(e,t)=>e===null?512:Math.max(512,Math.min(16384,2**Math.round(Math.log2(e*t)))),hd=e=>new Promise((t,n)=>{let{port1:r,port2:i}=new MessageChannel;r.onmessage=({data:e})=>{r.close(),i.close(),t(e)},r.onmessageerror=({data:e})=>{r.close(),i.close(),n(e)},i.postMessage(e)}),gd=async(e,t)=>new e(await hd(t)),_d=(e,t,n,r)=>{let i=Js.get(e);i===void 0&&(i=new WeakMap,Js.set(e,i));let a=gd(n,r);return i.set(t,a),a},vd=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>(p,m,h,g)=>{if(g.numberOfInputs===0&&g.numberOfOutputs===0)throw c();let _=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(_.some(e=>e<1))throw c();if(_.length!==g.numberOfOutputs)throw t();if(g.channelCountMode!==`explicit`)throw c();let v=g.channelCount*g.numberOfInputs,y=_.reduce((e,t)=>e+t,0),b=h.parameterDescriptors===void 0?0:h.parameterDescriptors.length;if(v+b>6||y>6)throw c();let x=new MessageChannel,S=[],C=[];for(let e=0;ee===void 0?0:e},maxValue:{get:()=>t===void 0?wc:t},minValue:{get:()=>n===void 0?Cc:n}}),w.push(i)}let T=r(p,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`speakers`,numberOfInputs:Math.max(1,v+b)}),E=md(m,p.sampleRate),D=s(p,E,v+b,Math.max(1,y)),O=i(p,{channelCount:Math.max(1,y),channelCountMode:`explicit`,channelInterpretation:`discrete`,numberOfOutputs:Math.max(1,y)}),k=[];for(let e=0;e{let n=w[t];return n.connect(T,0,v+t),n.start(0),[e,n.offset]}));T.connect(D);let te=g.channelInterpretation,ne=null,re=g.numberOfOutputs===0?[D]:k,A={get bufferSize(){return E},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return te},set channelInterpretation(e){for(let t of S)t.channelInterpretation=e;te=e},get context(){return D.context},get inputs(){return S},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return ne},set onprocessorerror(e){typeof ne==`function`&&A.removeEventListener(`processorerror`,ne),ne=typeof e==`function`?e:null,typeof ne==`function`&&A.addEventListener(`processorerror`,ne)},get parameters(){return ee},get port(){return x.port2},addEventListener(...e){return D.addEventListener(e[0],e[1],e[2])},connect:e.bind(null,re),disconnect:l.bind(null,re),dispatchEvent(...e){return D.dispatchEvent(e[0])},removeEventListener(...e){return D.removeEventListener(e[0],e[1],e[2])}},j=new Map;x.port1.addEventListener=(e=>(...t)=>{if(t[0]===`message`){let e=typeof t[1]==`function`?t[1]:typeof t[1]==`object`&&t[1]!==null&&typeof t[1].handleEvent==`function`?t[1].handleEvent:null;if(e!==null){let n=j.get(t[1]);n===void 0?(t[1]=t=>{u(p.currentTime,p.sampleRate,()=>e(t))},j.set(e,t[1])):t[1]=n}}return e.call(x.port1,t[0],t[1],t[2])})(x.port1.addEventListener),x.port1.removeEventListener=(e=>(...t)=>{if(t[0]===`message`){let e=j.get(t[1]);e!==void 0&&(j.delete(t[1]),t[1]=e)}return e.call(x.port1,t[0],t[1],t[2])})(x.port1.removeEventListener);let ie=null;Object.defineProperty(x.port1,"onmessage",{get:()=>ie,set:e=>{typeof ie==`function`&&x.port1.removeEventListener(`message`,ie),ie=typeof e==`function`?e:null,typeof ie==`function`&&(x.port1.addEventListener(`message`,ie),x.port1.start())}}),h.prototype.port=x.port1;let M=null;_d(p,A,h,g).then(e=>M=e);let ae=Tl(g.numberOfInputs,g.channelCount),oe=Tl(g.numberOfOutputs,_),se=h.parameterDescriptors===void 0?[]:h.parameterDescriptors.reduce((e,{name:t})=>({...e,[t]:new Float32Array(128)}),{}),N=!0,ce=()=>{g.numberOfOutputs>0&&D.disconnect(O);for(let e=0,t=0;e{if(M!==null){let n=d(A);for(let r=0;r{Cl(e,se,t,v+n,r)});for(let e=0;e{if(n[t].size>0)return le.set(t,E/128),e;let r=le.get(t);return r===void 0?[]:(e.every(e=>e.every(e=>e===0))&&(r===1?le.delete(t):le.set(t,r-1)),e)});N=u(p.currentTime+r/p.sampleRate,p.sampleRate,()=>M.process(e,oe,se));for(let e=0,n=0;eD.connect(de).connect(p.destination),pe=()=>{D.disconnect(de),de.disconnect()};return fe(),f(A,()=>{if(N){pe(),g.numberOfOutputs>0&&D.connect(O);for(let e=0,t=0;e{N&&(fe(),ce()),ue=!1})},yd=(e,t)=>{let n=e.createBiquadFilter();return V(n,t),H(n,t,`Q`),H(n,t,`detune`),H(n,t,`frequency`),H(n,t,`gain`),B(n,t,`type`),n},bd=(e,t)=>(n,r)=>{let i=n.createChannelMerger(r.numberOfInputs);return e!==null&&e.name===`webkitAudioContext`&&t(n,i),V(i,r),i},xd=e=>{let t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw z()}}),Object.defineProperty(e,"channelCountMode",{get:()=>`explicit`,set:e=>{if(e!==`explicit`)throw z()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>`discrete`,set:e=>{if(e!==`discrete`)throw z()}})},Sd=(e,t)=>{let n=e.createChannelSplitter(t.numberOfOutputs);return V(n,t),xd(n),n},Cd=(e,t,n,r,i)=>(a,o)=>{if(a.createConstantSource===void 0)return n(a,o);let s=a.createConstantSource();return V(s,o),H(s,o,`offset`),t(r,()=>r(a))||od(s),t(i,()=>i(a))||sd(s),e(a,s),s},wd=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),Td=(e,t,n,r)=>(i,{offset:a,...o})=>{let s=i.createBuffer(1,2,44100),c=t(i,{buffer:null,channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=n(i,{...o,gain:a}),u=s.getChannelData(0);return u[0]=1,u[1]=1,c.buffer=s,c.loop=!0,e(i,c),r(wd({get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(e){l.channelCount=e},get channelCountMode(){return l.channelCountMode},set channelCountMode(e){l.channelCountMode=e},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(e){l.channelInterpretation=e},get context(){return l.context},get inputs(){return[]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get offset(){return l.gain},get onended(){return c.onended},set onended(e){c.onended=e},addEventListener(...e){return c.addEventListener(e[0],e[1],e[2])},dispatchEvent(...e){return c.dispatchEvent(e[0])},removeEventListener(...e){return c.removeEventListener(e[0],e[1],e[2])},start(e=0){c.start.call(c,e)},stop(e=0){c.stop.call(c,e)}},l),()=>c.connect(l),()=>c.disconnect(l))},Ed=(e,t)=>(n,r)=>{let i=n.createConvolver();if(V(i,r),r.disableNormalization===i.normalize&&(i.normalize=!r.disableNormalization),B(i,r,`buffer`),r.channelCount>2||(t(i,`channelCount`,e=>()=>e.call(i),t=>n=>{if(n>2)throw e();return t.call(i,n)}),r.channelCountMode===`max`))throw e();return t(i,`channelCountMode`,e=>()=>e.call(i),t=>n=>{if(n===`max`)throw e();return t.call(i,n)}),i},Dd=(e,t)=>{let n=e.createDelay(t.maxDelayTime);return V(n,t),H(n,t,`delayTime`),n},Od=e=>(t,n)=>{let r=t.createDynamicsCompressor();if(V(r,n),n.channelCount>2||n.channelCountMode===`max`)throw e();return H(r,n,`attack`),H(r,n,`knee`),H(r,n,`ratio`),H(r,n,`release`),H(r,n,`threshold`),r},kd=(e,t)=>{let n=e.createGain();return V(n,t),H(n,t,`gain`),n},Ad=e=>(t,n,r)=>{if(t.createIIRFilter===void 0)return e(t,n,r);let i=t.createIIRFilter(r.feedforward,r.feedback);return V(i,r),i};function jd(e,t){let n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function Md(e,t){return[e[0]*t[0]-e[1]*t[1],e[0]*t[1]+e[1]*t[0]]}function Nd(e,t){let n=[0,0];for(let r=e.length-1;r>=0;--r)n=Md(n,t),n[0]+=e[r];return n}var Pd=(e,t,n,r)=>(i,a,{channelCount:o,channelCountMode:s,channelInterpretation:c,feedback:l,feedforward:u})=>{let d=md(a,i.sampleRate),f=l instanceof Float64Array?l:new Float64Array(l),p=u instanceof Float64Array?u:new Float64Array(u),m=f.length,h=p.length,g=Math.min(m,h);if(m===0||m>20)throw r();if(f[0]===0)throw t();if(h===0||h>20)throw r();if(p[0]===0)throw t();if(f[0]!==1){for(let e=0;e{let t=e.inputBuffer,n=e.outputBuffer,r=t.numberOfChannels;for(let e=0;ee.createMediaElementSource(t.mediaElement),Id=(e,t)=>{let n=e.createMediaStreamDestination();return V(n,t),n.numberOfOutputs===1&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n},Ld=(e,{mediaStream:t})=>{let n=t.getAudioTracks();n.sort((e,t)=>e.idt.id));let r=n.slice(0,1),i=e.createMediaStreamSource(new MediaStream(r));return Object.defineProperty(i,"mediaStream",{value:t}),i},Rd=(e,t)=>(n,{mediaStreamTrack:r})=>{if(typeof n.createMediaStreamTrackSource==`function`)return n.createMediaStreamTrackSource(r);let i=new MediaStream([r]),a=n.createMediaStreamSource(i);if(r.kind!==`audio`)throw e();if(t(n))throw TypeError();return a},zd=e=>e===null?null:e.hasOwnProperty(`OfflineAudioContext`)?e.OfflineAudioContext:e.hasOwnProperty(`webkitOfflineAudioContext`)?e.webkitOfflineAudioContext:null,Bd=(e,t,n,r,i,a)=>(o,s)=>{let c=o.createOscillator();return V(c,s),H(c,s,`detune`),H(c,s,`frequency`),s.periodicWave===void 0?B(c,s,`type`):c.setPeriodicWave(s.periodicWave),t(n,()=>n(o))||od(c),t(r,()=>r(o))||a(c,o),t(i,()=>i(o))||sd(c),e(o,c),c},Vd=e=>(t,n)=>{let r=t.createPanner();return r.orientationX===void 0?e(t,n):(V(r,n),H(r,n,`orientationX`),H(r,n,`orientationY`),H(r,n,`orientationZ`),H(r,n,`positionX`),H(r,n,`positionY`),H(r,n,`positionZ`),B(r,n,`coneInnerAngle`),B(r,n,`coneOuterAngle`),B(r,n,`coneOuterGain`),B(r,n,`distanceModel`),B(r,n,`maxDistance`),B(r,n,`panningModel`),B(r,n,`refDistance`),B(r,n,`rolloffFactor`),r)},Hd=(e,t,n,r,i,a,o,s,c,l)=>(u,{coneInnerAngle:d,coneOuterAngle:f,coneOuterGain:p,distanceModel:m,maxDistance:h,orientationX:g,orientationY:_,orientationZ:v,panningModel:y,positionX:b,positionY:x,positionZ:S,refDistance:C,rolloffFactor:w,...T})=>{let E=u.createPanner();if(T.channelCount>2||T.channelCountMode===`max`)throw o();V(E,T);let D={channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`},O=n(u,{...D,channelInterpretation:`speakers`,numberOfInputs:6}),k=r(u,{...T,gain:1}),ee=r(u,{...D,gain:1}),te=r(u,{...D,gain:0}),ne=r(u,{...D,gain:0}),re=r(u,{...D,gain:0}),A=r(u,{...D,gain:0}),j=r(u,{...D,gain:0}),ie=i(u,256,6,1),M=a(u,{...D,curve:new Float32Array([1,1]),oversample:`none`}),ae=[g,_,v],oe=[b,x,S],se=new Float32Array(1);ie.onaudioprocess=({inputBuffer:e})=>{let t=[c(e,se,0),c(e,se,1),c(e,se,2)];t.some((e,t)=>e!==ae[t])&&(E.setOrientation(...t),ae=t);let n=[c(e,se,3),c(e,se,4),c(e,se,5)];n.some((e,t)=>e!==oe[t])&&(E.setPosition(...n),oe=n)},Object.defineProperty(te.gain,"defaultValue",{get:()=>0}),Object.defineProperty(ne.gain,"defaultValue",{get:()=>0}),Object.defineProperty(re.gain,"defaultValue",{get:()=>0}),Object.defineProperty(A.gain,"defaultValue",{get:()=>0}),Object.defineProperty(j.gain,"defaultValue",{get:()=>0});let N={get bufferSize(){},get channelCount(){return E.channelCount},set channelCount(e){if(e>2)throw o();k.channelCount=e,E.channelCount=e},get channelCountMode(){return E.channelCountMode},set channelCountMode(e){if(e===`max`)throw o();k.channelCountMode=e,E.channelCountMode=e},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(e){k.channelInterpretation=e,E.channelInterpretation=e},get coneInnerAngle(){return E.coneInnerAngle},set coneInnerAngle(e){E.coneInnerAngle=e},get coneOuterAngle(){return E.coneOuterAngle},set coneOuterAngle(e){E.coneOuterAngle=e},get coneOuterGain(){return E.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();E.coneOuterGain=e},get context(){return E.context},get distanceModel(){return E.distanceModel},set distanceModel(e){E.distanceModel=e},get inputs(){return[k]},get maxDistance(){return E.maxDistance},set maxDistance(e){if(e<0)throw RangeError();E.maxDistance=e},get numberOfInputs(){return E.numberOfInputs},get numberOfOutputs(){return E.numberOfOutputs},get orientationX(){return ee.gain},get orientationY(){return te.gain},get orientationZ(){return ne.gain},get panningModel(){return E.panningModel},set panningModel(e){E.panningModel=e},get positionX(){return re.gain},get positionY(){return A.gain},get positionZ(){return j.gain},get refDistance(){return E.refDistance},set refDistance(e){if(e<0)throw RangeError();E.refDistance=e},get rolloffFactor(){return E.rolloffFactor},set rolloffFactor(e){if(e<0)throw RangeError();E.rolloffFactor=e},addEventListener(...e){return k.addEventListener(e[0],e[1],e[2])},dispatchEvent(...e){return k.dispatchEvent(e[0])},removeEventListener(...e){return k.removeEventListener(e[0],e[1],e[2])}};return d!==N.coneInnerAngle&&(N.coneInnerAngle=d),f!==N.coneOuterAngle&&(N.coneOuterAngle=f),p!==N.coneOuterGain&&(N.coneOuterGain=p),m!==N.distanceModel&&(N.distanceModel=m),h!==N.maxDistance&&(N.maxDistance=h),g!==N.orientationX.value&&(N.orientationX.value=g),_!==N.orientationY.value&&(N.orientationY.value=_),v!==N.orientationZ.value&&(N.orientationZ.value=v),y!==N.panningModel&&(N.panningModel=y),b!==N.positionX.value&&(N.positionX.value=b),x!==N.positionY.value&&(N.positionY.value=x),S!==N.positionZ.value&&(N.positionZ.value=S),C!==N.refDistance&&(N.refDistance=C),w!==N.rolloffFactor&&(N.rolloffFactor=w),(ae[0]!==1||ae[1]!==0||ae[2]!==0)&&E.setOrientation(...ae),(oe[0]!==0||oe[1]!==0||oe[2]!==0)&&E.setPosition(...oe),l(wd(N,E),()=>{k.connect(E),e(k,M,0,0),M.connect(ee).connect(O,0,0),M.connect(te).connect(O,0,1),M.connect(ne).connect(O,0,2),M.connect(re).connect(O,0,3),M.connect(A).connect(O,0,4),M.connect(j).connect(O,0,5),O.connect(ie).connect(u.destination)},()=>{k.disconnect(E),s(k,M,0,0),M.disconnect(ee),ee.disconnect(O),M.disconnect(te),te.disconnect(O),M.disconnect(ne),ne.disconnect(O),M.disconnect(re),re.disconnect(O),M.disconnect(A),A.disconnect(O),M.disconnect(j),j.disconnect(O),O.disconnect(ie),ie.disconnect(u.destination)})},Ud=e=>(t,{disableNormalization:n,imag:r,real:i})=>{let a=r instanceof Float32Array?r:new Float32Array(r),o=i instanceof Float32Array?i:new Float32Array(i),s=t.createPeriodicWave(o,a,{disableNormalization:n});if(Array.from(r).length<2)throw e();return s},Wd=(e,t,n,r)=>e.createScriptProcessor(t,n,r),Gd=(e,t)=>(n,r)=>{let i=r.channelCountMode;if(i===`clamped-max`)throw t();if(n.createStereoPanner===void 0)return e(n,r);let a=n.createStereoPanner();return V(a,r),H(a,r,`pan`),Object.defineProperty(a,"channelCountMode",{get:()=>i,set:e=>{if(e!==i)throw t()}}),a},Kd=(e,t,n,r,i,a)=>{let o=16385,s=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`},u={...l,oversample:`none`},d=(e,t,i,a)=>{let d=new Float32Array(o),f=new Float32Array(o);for(let e=0;e{let f=new Float32Array(o),p=new Float32Array(o),m=new Float32Array(o),h=new Float32Array(o),g=8192;for(let e=0;eg){let t=(e-g)/(o-1-g)*c;f[e]=Math.cos(t),p[e]=Math.sin(t),m[e]=0,h[e]=1}else{let t=e/(o-1-g)*c;f[e]=1,p[e]=0,m[e]=Math.cos(t),h[e]=Math.sin(t)}let _=t(e,{channelCount:2,channelCountMode:`explicit`,channelInterpretation:`discrete`,numberOfOutputs:2}),v=n(e,{...l,gain:0}),y=r(e,{...u,curve:f}),b=n(e,{...l,gain:0}),x=r(e,{...u,curve:p}),S=r(e,{...u,curve:s}),C=n(e,{...l,gain:0}),w=r(e,{...u,curve:m}),T=n(e,{...l,gain:0}),E=r(e,{...u,curve:h});return{connectGraph(){i.connect(_),i.connect(S.inputs===void 0?S:S.inputs[0]),_.connect(v,0),_.connect(b,0),_.connect(C,1),_.connect(T,1),S.connect(a),a.connect(y.inputs===void 0?y:y.inputs[0]),a.connect(x.inputs===void 0?x:x.inputs[0]),a.connect(w.inputs===void 0?w:w.inputs[0]),a.connect(E.inputs===void 0?E:E.inputs[0]),y.connect(v.gain),x.connect(b.gain),w.connect(C.gain),E.connect(T.gain),v.connect(d,0,0),C.connect(d,0,0),b.connect(d,0,1),T.connect(d,0,1)},disconnectGraph(){i.disconnect(_),i.disconnect(S.inputs===void 0?S:S.inputs[0]),_.disconnect(v,0),_.disconnect(b,0),_.disconnect(C,1),_.disconnect(T,1),S.disconnect(a),a.disconnect(y.inputs===void 0?y:y.inputs[0]),a.disconnect(x.inputs===void 0?x:x.inputs[0]),a.disconnect(w.inputs===void 0?w:w.inputs[0]),a.disconnect(E.inputs===void 0?E:E.inputs[0]),y.disconnect(v.gain),x.disconnect(b.gain),w.disconnect(C.gain),E.disconnect(T.gain),v.disconnect(d,0,0),C.disconnect(d,0,0),b.disconnect(d,0,1),T.disconnect(d,0,1)}}},p=(e,t,n,r,a)=>{if(t===1)return d(e,n,r,a);if(t===2)return f(e,n,r,a);throw i()};return(t,{channelCount:r,channelCountMode:o,pan:s,...c})=>{if(o===`max`)throw i();let l=e(t,{...c,channelCount:1,channelCountMode:o,numberOfInputs:2}),u=n(t,{...c,channelCount:r,channelCountMode:o,gain:1}),d=n(t,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,gain:s}),{connectGraph:f,disconnectGraph:m}=p(t,r,u,d,l);Object.defineProperty(d.gain,"defaultValue",{get:()=>0}),Object.defineProperty(d.gain,"maxValue",{get:()=>1}),Object.defineProperty(d.gain,"minValue",{get:()=>-1});let h={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&m(),{connectGraph:f,disconnectGraph:m}=p(t,e,u,d,l),g&&f()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if(e===`clamped-max`||e===`max`)throw i();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return d.gain},addEventListener(...e){return u.addEventListener(e[0],e[1],e[2])},dispatchEvent(...e){return u.dispatchEvent(e[0])},removeEventListener(...e){return u.removeEventListener(e[0],e[1],e[2])}},g=!1;return a(wd(h,l),()=>{f(),g=!0},()=>{m(),g=!1})}},qd=(e,t,n,r,i,a,o)=>(s,c)=>{let l=s.createWaveShaper();if(a!==null&&a.name===`webkitAudioContext`&&s.createGain().gain.automationRate===void 0)return n(s,c);V(l,c);let u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw t();B(l,{curve:u},`curve`),B(l,c,`oversample`);let d=null,f=!1;return o(l,`curve`,e=>()=>e.call(l),t=>n=>(t.call(l,n),f&&(r(n)&&d===null?d=e(s,l):!r(n)&&d!==null&&(d(),d=null)),n)),i(l,()=>{f=!0,r(l.curve)&&(d=e(s,l))},()=>{f=!1,d!==null&&(d(),d=null)})},Jd=(e,t,n,r,i)=>(a,{curve:o,oversample:s,...c})=>{let l=a.createWaveShaper(),u=a.createWaveShaper();V(l,c),V(u,c);let d=n(a,{...c,gain:1}),f=n(a,{...c,gain:-1}),p=n(a,{...c,gain:1}),m=n(a,{...c,gain:-1}),h=null,g=!1,_=null,v={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(e){d.channelCount=e,f.channelCount=e,l.channelCount=e,p.channelCount=e,u.channelCount=e,m.channelCount=e},get channelCountMode(){return l.channelCountMode},set channelCountMode(e){d.channelCountMode=e,f.channelCountMode=e,l.channelCountMode=e,p.channelCountMode=e,u.channelCountMode=e,m.channelCountMode=e},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(e){d.channelInterpretation=e,f.channelInterpretation=e,l.channelInterpretation=e,p.channelInterpretation=e,u.channelInterpretation=e,m.channelInterpretation=e},get context(){return l.context},get curve(){return _},set curve(n){if(n!==null&&n.length<2)throw t();if(n===null)l.curve=n,u.curve=n;else{let e=n.length,t=new Float32Array(e+2-e%2),r=new Float32Array(e+2-e%2);t[0]=n[0],r[0]=-n[e-1];let i=Math.ceil((e+1)/2),a=(e+1)/2-1;for(let o=1;o{d.connect(l).connect(p),d.connect(f).connect(u).connect(m).connect(p),g=!0,r(_)&&(h=e(a,d))},()=>{d.disconnect(l),l.disconnect(p),d.disconnect(f),f.disconnect(u),u.disconnect(m),m.disconnect(p),g=!1,h!==null&&(h(),h=null)})},Yd=()=>new DOMException(``,`NotSupportedError`),Xd={numberOfChannels:1},Zd=(e,t,n,r,i)=>class extends e{constructor(e,n,i){let a;if(typeof e==`number`&&n!==void 0&&i!==void 0)a={length:n,numberOfChannels:e,sampleRate:i};else if(typeof e==`object`)a=e;else throw Error(`The given parameters are not valid.`);let{length:o,numberOfChannels:s,sampleRate:c}={...Xd,...a},l=r(s,o,c);t($u,()=>$u(l))||l.addEventListener(`statechange`,(()=>{let e=0,t=n=>{this._state===`running`&&(e>0?(l.removeEventListener(`statechange`,t),n.stopImmediatePropagation(),this._waitForThePromiseToSettle(n)):e+=1)};return t})()),super(l,s),this._length=o,this._nativeOfflineAudioContext=l,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state===`running`?Promise.reject(n()):(this._state=`running`,i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,Rc(this)}))}_waitForThePromiseToSettle(e){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(e):setTimeout(()=>this._waitForThePromiseToSettle(e))}},Qd={channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,detune:0,frequency:440,periodicWave:void 0,type:`sine`},$d=(e,t,n,r,i,a,o)=>class extends e{constructor(e,o){let s=i(e),c={...Qd,...o},l=n(s,c),u=a(s),d=u?r():null,f=e.sampleRate/2;super(e,!1,l,d),this._detune=t(this,u,l.detune,153600,-153600),this._frequency=t(this,u,l.frequency,f,-f),this._nativeOscillatorNode=l,this._onended=null,this._oscillatorNodeRenderer=d,this._oscillatorNodeRenderer!==null&&c.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=c.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){let t=typeof e==`function`?o(this,e):null;this._nativeOscillatorNode.onended=t;let n=this._nativeOscillatorNode.onended;this._onended=n!==null&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=e),this.context.state!==`closed`){oc(this);let e=()=>{this._nativeOscillatorNode.removeEventListener(`ended`,e),Tc(this)&&cc(this)};this._nativeOscillatorNode.addEventListener(`ended`,e)}}stop(e=0){this._nativeOscillatorNode.stop(e),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=e)}},ef=(e,t,n,r,i)=>()=>{let a=new WeakMap,o=null,s=null,c=null,l=async(l,u)=>{let d=n(l),f=gc(d,u);return f||(d=t(u,{channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:o===null?void 0:o,type:d.type}),s!==null&&d.start(s),c!==null&&d.stop(c)),a.set(u,d),f?(await e(u,l.detune,d.detune),await e(u,l.frequency,d.frequency)):(await r(u,l.detune,d.detune),await r(u,l.frequency,d.frequency)),await i(l,u,d),d};return{set periodicWave(e){o=e},set start(e){s=e},set stop(e){c=e},render(e,t){let n=a.get(t);return n===void 0?l(e,t):Promise.resolve(n)}}},tf={channelCount:2,channelCountMode:`clamped-max`,channelInterpretation:`speakers`,coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:`inverse`,maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:`equalpower`,positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},nf=(e,t,n,r,i,a,o)=>class extends e{constructor(e,s){let c=i(e),l=n(c,{...tf,...s}),u=a(c),d=u?r():null;super(e,!1,l,d),this._nativePannerNode=l,this._orientationX=t(this,u,l.orientationX,wc,Cc),this._orientationY=t(this,u,l.orientationY,wc,Cc),this._orientationZ=t(this,u,l.orientationZ,wc,Cc),this._positionX=t(this,u,l.positionX,wc,Cc),this._positionY=t(this,u,l.positionY,wc,Cc),this._positionZ=t(this,u,l.positionZ,wc,Cc),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}},rf=(e,t,n,r,i,a,o,s,c,l)=>()=>{let u=new WeakMap,d=null,f=async(f,p)=>{let m=null,h=a(f),g={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation},_={...g,coneInnerAngle:h.coneInnerAngle,coneOuterAngle:h.coneOuterAngle,coneOuterGain:h.coneOuterGain,distanceModel:h.distanceModel,maxDistance:h.maxDistance,panningModel:h.panningModel,refDistance:h.refDistance,rolloffFactor:h.rolloffFactor},v=gc(h,p);if(`bufferSize`in h?m=r(p,{...g,gain:1}):v||(h=i(p,{..._,orientationX:h.orientationX.value,orientationY:h.orientationY.value,orientationZ:h.orientationZ.value,positionX:h.positionX.value,positionY:h.positionY.value,positionZ:h.positionZ.value})),u.set(p,m===null?h:m),m!==null){if(d===null){if(o===null)throw Error(`Missing the native OfflineAudioContext constructor.`);let e=new o(6,f.context.length,p.sampleRate),r=t(e,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`speakers`,numberOfInputs:6});r.connect(e.destination),d=(async()=>{let t=await Promise.all([f.orientationX,f.orientationY,f.orientationZ,f.positionX,f.positionY,f.positionZ].map(async(t,r)=>{let i=n(e,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,offset:+(r===0)});return await s(e,t,i.offset),i}));for(let e=0;e<6;e+=1)t[e].connect(r,0,e),t[e].start(0);return l(e)})()}let e=await d,a=r(p,{...g,gain:1});await c(f,p,a);let u=[];for(let t=0;te!==h[t])||n.some((e,t)=>e!==v[t])){h=e,v=n;let o=t/p.sampleRate;y.gain.setValueAtTime(0,o),y=r(p,{...g,gain:0}),b=i(p,{..._,orientationX:h[0],orientationY:h[1],orientationZ:h[2],positionX:v[0],positionY:v[1],positionZ:v[2]}),y.gain.setValueAtTime(1,o),a.connect(y).connect(b.inputs[0]),b.connect(m)}}return m}return v?(await e(p,f.orientationX,h.orientationX),await e(p,f.orientationY,h.orientationY),await e(p,f.orientationZ,h.orientationZ),await e(p,f.positionX,h.positionX),await e(p,f.positionY,h.positionY),await e(p,f.positionZ,h.positionZ)):(await s(p,f.orientationX,h.orientationX),await s(p,f.orientationY,h.orientationY),await s(p,f.orientationZ,h.orientationZ),await s(p,f.positionX,h.positionX),await s(p,f.positionY,h.positionY),await s(p,f.positionZ,h.positionZ)),Yc(h)?await c(f,p,h.inputs[0]):await c(f,p,h),h};return{render(e,t){let n=u.get(t);return n===void 0?f(e,t):Promise.resolve(n)}}},af={disableNormalization:!1},of=(e,t,n,r)=>class i{constructor(i,a){let o=e(t(i),r({...af,...a}));return n.add(o),o}static[Symbol.hasInstance](e){return typeof e==`object`&&!!e&&Object.getPrototypeOf(e)===i.prototype||n.has(e)}},sf=(e,t)=>(n,r,i)=>(e(r).replay(i),t(r,n,i)),cf=(e,t,n)=>async(r,i,a)=>{let o=e(r);await Promise.all(o.activeInputs.map((e,o)=>Array.from(e).map(async([e,s])=>{let c=await t(e).render(e,i),l=r.context.destination;!n(e)&&(r!==l||!n(r))&&c.connect(a,s,o)})).reduce((e,t)=>[...e,...t],[]))},lf=(e,t,n)=>async(r,i,a)=>{let o=t(r);await Promise.all(Array.from(o.activeInputs).map(async([t,r])=>{let o=await e(t).render(t,i);n(t)||o.connect(a,r)}))},uf=(e,t,n,r)=>i=>e($u,()=>$u(i))?Promise.resolve(e(r,r)).then(e=>{if(!e){let e=n(i,512,0,1);i.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>i.currentTime,e.connect(i.destination)}return i.startRendering()}):new Promise(e=>{let n=t(i,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,gain:0});i.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(i.destination),i.startRendering()}),df=e=>(t,n)=>{e.set(t,n)},ff=e=>(t,n)=>e.set(t,n),pf=(e,t,n,r,i,a,o,s)=>(c,l)=>n(c).render(c,l).then(()=>Promise.all(Array.from(r(l)).map(e=>n(e).render(e,l)))).then(()=>i(l)).then(n=>(typeof n.copyFromChannel==`function`?t(a,()=>a(n))||s(n):(o(n),bc(n)),e.add(n),n)),mf={channelCount:2,channelCountMode:`explicit`,channelInterpretation:`speakers`,pan:0},hf=(e,t,n,r,i,a)=>class extends e{constructor(e,o){let s=i(e),c=n(s,{...mf,...o}),l=a(s),u=l?r():null;super(e,!1,c,u),this._pan=t(this,l,c.pan)}get pan(){return this._pan}},gf=(e,t,n,r,i)=>()=>{let a=new WeakMap,o=async(o,s)=>{let c=n(o),l=gc(c,s);return l||(c=t(s,{channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,pan:c.pan.value})),a.set(s,c),l?await e(s,o.pan,c.pan):await r(s,o.pan,c.pan),Yc(c)?await i(o,s,c.inputs[0]):await i(o,s,c),c};return{render(e,t){let n=a.get(t);return n===void 0?o(e,t):Promise.resolve(n)}}},_f=e=>()=>{if(e===null)return!1;try{new e({length:1,sampleRate:44100})}catch{return!1}return!0},vf=(e,t)=>async()=>{if(e===null)return!0;if(t===null)return!1;let n=new Blob([`class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)`],{type:`application/javascript; charset=utf-8`}),r=new t(1,128,44100),i=URL.createObjectURL(n),a=!1,o=!1;try{await r.audioWorklet.addModule(i);let t=new e(r,`a`,{numberOfOutputs:0}),n=r.createOscillator();t.port.onmessage=()=>a=!0,t.onprocessorerror=()=>o=!0,n.connect(t),n.start(0),await r.startRendering(),await new Promise(e=>setTimeout(e))}catch{}finally{URL.revokeObjectURL(i)}return a&&!o},yf=(e,t)=>()=>{if(t===null)return Promise.resolve(!1);let n=new t(1,1,44100),r=e(n,{channelCount:1,channelCountMode:`explicit`,channelInterpretation:`discrete`,gain:0});return new Promise(e=>{n.oncomplete=()=>{r.disconnect(),e(n.currentTime!==0)},n.startRendering()})},bf=()=>new DOMException(``,`UnknownError`),xf={channelCount:2,channelCountMode:`max`,channelInterpretation:`speakers`,curve:null,oversample:`none`},Sf=(e,t,n,r,i,a,o)=>class extends e{constructor(e,t){let s=i(e),c=n(s,{...xf,...t}),l=a(s)?r():null;super(e,!0,c,l),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(e===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}},Cf=(e,t,n)=>()=>{let r=new WeakMap,i=async(i,a)=>{let o=t(i);return gc(o,a)||(o=e(a,{channelCount:o.channelCount,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,curve:o.curve,oversample:o.oversample})),r.set(a,o),Yc(o)?await n(i,a,o.inputs[0]):await n(i,a,o),o};return{render(e,t){let n=r.get(t);return n===void 0?i(e,t):Promise.resolve(n)}}},wf=()=>typeof window>`u`?null:window,Tf=(e,t)=>n=>{n.copyFromChannel=(r,i,a=0)=>{let o=e(a),s=e(i);if(s>=n.numberOfChannels)throw t();let c=n.length,l=n.getChannelData(s),u=r.length;for(let e=o<0?-o:0;e+o{let o=e(a),s=e(i);if(s>=n.numberOfChannels)throw t();let c=n.length,l=n.getChannelData(s),u=r.length;for(let e=o<0?-o:0;e+ot=>{t.copyFromChannel=(n=>(r,i,a=0)=>{let o=e(a),s=e(i);if(o(r,i,a=0)=>{let o=e(a),s=e(i);if(o(t,n)=>{let r=n.createBuffer(1,1,44100);t.buffer===null&&(t.buffer=r),e(t,`buffer`,e=>()=>{let n=e.call(t);return n===r?null:n},e=>n=>e.call(t,n===null?r:n))},Of=(e,t)=>(n,r)=>{r.channelCount=1,r.channelCountMode=`explicit`,Object.defineProperty(r,"channelCount",{get:()=>1,set:()=>{throw e()}}),Object.defineProperty(r,"channelCountMode",{get:()=>`explicit`,set:()=>{throw e()}});let i=n.createBufferSource();t(r,()=>{let e=r.numberOfInputs;for(let t=0;ti.disconnect(r))},kf=(e,t,n)=>e.copyFromChannel===void 0?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),Af=e=>{if(e===null)return!1;let t=e.length;return t%2==0?e[t/2-1]+e[t/2]!==0:e[Math.floor(t/2)]!==0},jf=(e,t,n,r)=>{let i=e;for(;!i.hasOwnProperty(t);)i=Object.getPrototypeOf(i);let{get:a,set:o}=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,{get:n(a),set:r(o)})},Mf=e=>({...e,outputChannelCount:e.outputChannelCount===void 0?e.numberOfInputs===1&&e.numberOfOutputs===1?[e.channelCount]:Array.from({length:e.numberOfOutputs},()=>1):e.outputChannelCount}),Nf=e=>({...e,channelCount:e.numberOfOutputs}),Pf=e=>{let{imag:t,real:n}=e;return t===void 0?n===void 0?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,()=>0),real:n}:n===void 0?{...e,imag:t,real:Array.from(t,()=>0)}:{...e,imag:t,real:n}},Ff=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(r){if(r.code!==9)throw r;Ff(e,t,n+1e-7)}},If=e=>{let t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1},Lf=e=>{let t=e.createBufferSource();t.buffer=e.createBuffer(1,1,44100);try{t.start(0,1)}catch{return!1}return!0},Rf=e=>{let t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0},zf=e=>{let t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Bf=e=>{let t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Vf=e=>{let t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},Hf=e=>{let{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}},Uf=e=>{e.start=(t=>(n=0,r=0,i)=>{let a=e.buffer,o=a===null?r:Math.min(a.duration,r);a!==null&&o>a.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,o,i)})(e.start)},Wf=(e,t)=>{let n=t.createGain();e.connect(n);let r=(t=>()=>{t.call(e,n),e.removeEventListener(`ended`,r)})(e.disconnect);e.addEventListener(`ended`,r),wd(e,n),e.stop=(t=>{let r=!1;return(i=0)=>{if(r)try{t.call(e,i)}catch{n.gain.setValueAtTime(0,i)}else t.call(e,i),r=!0}})(e.stop)},Gf=(e,t)=>n=>{let r={value:e};return Object.defineProperties(n,{currentTarget:r,target:r}),typeof t==`function`?t.call(e,n):t.handleEvent.call(e,n)},Kf=Is(Kc),qf=dc(Kc),Jf=iu(rc),Yf=new WeakMap,Xf=Cu(Yf),Zf=Nl(new Map,new WeakMap),Qf=wf(),$f=rd(Zf,yc),ep=Su(Fc),tp=cf(Fc,ep,rl),np=_c($f,R,tp),U=Eu(Ws),rp=zd(Qf),W=Gu(rp),ip=new WeakMap,ap=hu(Gf),op=ld(Qf),sp=Vu(op),cp=Hu(Qf),lp=Uu(Qf),up=dd(Qf),G=_l(Ls(Bs),uc(Kf,qf,Xc,Jf,tl,Fc,Xf,ac,R,Kc,Tc,rl,il),Zf,Iu(Ks,tl,Fc,R,nl,Tc),yc,ku,Yd,eu(Xc,Ks,Fc,R,nl,U,Tc,W),su(ip,Fc,nc),ap,U,sp,cp,lp,W,up),dp=hc(G,np,yc,$f,U,W),fp=new WeakSet,pp=id(Qf),mp=Kl(new Uint32Array(1)),hp=Tf(mp,yc),gp=Ef(mp),_p=Sc(fp,Zf,Yd,pp,rp,_f(pp),hp,gp),vp=fc(kd),yp=lf(ep,Ic,rl),bp=Bl(yp),xp=cd(vp,Zf,If,Lf,Rf,zf,Bf,Vf,Uf,Df(jf),Wf),Sp=sf(wu(Ic),yp),Cp=Oc(bp,xp,R,Sp,tp),wp=vl(Rs(Hs),ip,Us,yl,Ps.createCancelAndHoldAutomationEvent,Ps.createCancelScheduledValuesAutomationEvent,Ps.createExponentialRampToValueAutomationEvent,Ps.createLinearRampToValueAutomationEvent,Ps.createSetTargetAutomationEvent,Ps.createSetValueAutomationEvent,Ps.createSetValueCurveAutomationEvent,op,Ff),Tp=Dc(G,Cp,wp,z,xp,U,W,Gf),Ep=Vc(G,Hc,yc,z,ud(kd,jf),U,W,tp),Dp=Ml(bp,yd,R,Sp,tp),Op=ff(Yf),kp=jl(G,wp,Dp,ku,yd,U,W,Op),Ap=ed(Kc,cp),jp=bd(op,Of(z,Ap)),Mp=Fl(G,Il(jp,R,tp),jp,U,W),Np=Rl(G,zl(Sd,R,tp),Sd,U,W,Nf),Pp=Cd(vp,Zf,Td(vp,xp,kd,Ap),zf,Vf),Fp=Wl(G,wp,Gl(bp,Pp,R,Sp,tp),Pp,U,W,Gf),Ip=Ed(Yd,jf),Lp=Jl(G,Yl(Ip,R,tp),Ip,U,W,Op),Rp=nu(G,wp,ru(bp,Dd,R,Sp,tp),Dd,U,W,Op),zp=Od(Yd),Bp=du(G,wp,fu(bp,zp,R,Sp,tp),zp,Yd,U,W,Op),Vp=yu(G,wp,bu(bp,kd,R,Sp,tp),kd,U,W),Hp=Pd(ku,z,Wd,Yd),Up=uf(Zf,kd,Wd,yf(kd,rp)),Wp=Fu(xp,R,rp,tp,Up),Gp=Mu(G,Ad(Hp),Wp,U,W,Op),Kp=Uc(wp,jp,Pp,Wd,Yd,kf,W,jf),qp=new WeakMap,Jp=Qu(Ep,Kp,ap,W,qp,Gf),Yp=Bd(vp,Zf,zf,Bf,Vf,Wf),Xp=$d(G,wp,Yp,ef(bp,Yp,R,Sp,tp),U,W,Gf),Zp=Hl(xp),Qp=qd(Zp,z,Jd(Zp,z,kd,Af,Ap),Af,Ap,op,jf),$p=Vd(Hd(Xc,z,jp,kd,Wd,Qp,Yd,tl,kf,Ap)),em=nf(G,wp,$p,rf(bp,jp,Pp,kd,$p,R,rp,Sp,tp,Up),U,W,Op),tm=of(Ud(yc),U,new WeakSet,Pf),nm=Gd(Kd(jp,Sd,kd,Qp,Yd,Ap),Yd),rm=hf(G,wp,nm,gf(bp,nm,R,Sp,tp),U,W),im=Sf(G,z,Qp,Cf(Qp,R,tp),U,W,Op),am=Ku(Qf),om=gu(Qf),sm=new WeakMap,cm=Du(sm,rp),lm=am?tc(Zf,Yd,mu(Qf),om,_u(Fs),U,cm,W,up,new WeakMap,new WeakMap,vf(up,rp),Qf):void 0,um=Wu(sp,W),dm=kl(lm,dp,_p,Tp,kp,Mp,Np,Fp,Lp,$l(fp,Zf,Zl,pu,new WeakSet,U,um,vc,$u,hp,gp),Rp,Bp,Vp,Gp,Jp,Xp,em,tm,rm,im),fm=Bc(dm,z,Yd,bf,qu(G,Fd,U,W),Yu(G,Id,U,W),Xu(G,Ld,U,W),Zu(G,Rd(z,W),U),op),pm=Ou(qp),mm=pc(pm),hm=Vl(yc),gm=au(pm),_m=lu(yc),vm=new WeakMap,ym=pd(z,vd(hm,yc,z,jp,Sd,Pp,kd,Wd,Yd,_m,om,xu(vm,nc),Ap),kd,Yd,Ap),bm=Ol(bp,hm,xp,jp,Sd,Pp,kd,gm,_m,om,R,up,rp,Sp,tp,Up),xm=Tu(sm),Sm=df(vm),Cm=am?Sl(mm,G,wp,bm,ym,Fc,xm,U,W,up,Mf,Sm,Hf,Gf):void 0,wm=Zd(dm,Zf,z,Xl(Yd,rp),pf(fp,Zf,ep,pm,Up,vc,hp,gp)),Tm=Lu(Ws,sp),Em=Ru(Vs,cp),Dm=zu(Us,lp),Om=Bu(Ws,W);function km(e){return e===void 0}function K(e){return e!==void 0}function Am(e){return typeof e==`function`}function jm(e){return typeof e==`number`}function Mm(e){return Object.prototype.toString.call(e)===`[object Object]`&&e.constructor===Object}function Nm(e){return typeof e==`boolean`}function Pm(e){return Array.isArray(e)}function Fm(e){return typeof e==`string`}function Im(e){return Fm(e)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(e)}function q(e,t){if(!e)throw Error(t)}function Lm(e,t,n=1/0){if(!(t<=e&&e<=n))throw RangeError(`Value must be within [${t}, ${n}], got: ${e}`)}function Rm(e){!e.isOffline&&e.state!==`running`&&Gm(`The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.`)}var zm=!1,Bm=!1;function Vm(e){zm=e}function Hm(e){km(e)&&zm&&!Bm&&(Bm=!0,Gm(`Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing`))}var Um=console;function Wm(...e){Um.log(...e)}function Gm(...e){Um.warn(...e)}function Km(e){return new fm(e)}function qm(e,t,n){return new wm(e,t,n)}var Jm=typeof self==`object`?self:null,Ym=Jm&&(Jm.hasOwnProperty(`AudioContext`)||Jm.hasOwnProperty(`webkitAudioContext`));function Xm(e,t,n){return q(K(Cm),`AudioWorkletNode only works in a secure context (https or localhost)`),new(e instanceof Jm?.BaseAudioContext?Jm?.AudioWorkletNode:Cm)(e,t,n)}function Zm(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function J(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var Qm=class{constructor(e,t,n,r){this._callback=e,this._type=t,this._minimumUpdateInterval=Math.max(128/(r||44100),.001),this.updateInterval=n,this._createClock()}_createWorker(){let e=new Blob([` + // the initial timeout time + let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; + // onmessage callback + self.onmessage = function(msg){ + timeoutTime = parseInt(msg.data); + }; + // the tick function which posts a message + // and schedules a new tick + function tick(){ + setTimeout(tick, timeoutTime); + self.postMessage('tick'); + } + // call tick initially + tick(); + `],{type:`text/javascript`}),t=URL.createObjectURL(e),n=new Worker(t);n.onmessage=this._callback.bind(this),this._worker=n}_createTimeout(){this._timeout=setTimeout(()=>{this._createTimeout(),this._callback()},this._updateInterval*1e3)}_createClock(){if(this._type===`worker`)try{this._createWorker()}catch{this._type=`timeout`,this._createClock()}else this._type===`timeout`&&this._createTimeout()}_disposeClock(){this._timeout&&clearTimeout(this._timeout),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){var t;this._updateInterval=Math.max(e,this._minimumUpdateInterval),this._type===`worker`&&((t=this._worker)==null||t.postMessage(this._updateInterval*1e3))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}};function $m(e){return Dm(e)}function eh(e){return Em(e)}function th(e){return Om(e)}function nh(e){return Tm(e)}function rh(e){return e instanceof _p}function ih(e,t){return e===`value`||$m(t)||eh(t)||rh(t)}function ah(e,...t){if(!t.length)return e;let n=t.shift();if(Mm(e)&&Mm(n))for(let t in n)ih(t,n[t])?e[t]=n[t]:Mm(n[t])?(e[t]||Object.assign(e,{[t]:{}}),ah(e[t],n[t])):Object.assign(e,{[t]:n[t]});return ah(e,...t)}function oh(e,t){return e.length===t.length&&e.every((e,n)=>t[n]===e)}function Y(e,t,n=[],r){let i={},a=Array.from(t);if(Mm(a[0])&&r&&!Reflect.has(a[0],r)&&(Object.keys(a[0]).some(t=>Reflect.has(e,t))||(ah(i,{[r]:a[0]}),n.splice(n.indexOf(r),1),a.shift())),a.length===1&&Mm(a[0]))ah(i,a[0]);else for(let e=0;e{Reflect.has(e,t)&&delete e[t]}),e}var uh=class{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||Jm&&this.toString()===Jm.TONE_DEBUG_CLASS)&&Wm(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}};uh.version=Ss;var dh=1e-6;function fh(e,t){return e>t+dh}function ph(e,t){return fh(e,t)||hh(e,t)}function mh(e,t){return e+dhthis.memory){let e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(e){let t=this._timeline.indexOf(e);return t!==-1&&this._timeline.splice(t,1),this}get(e,t=`time`){let n=this._search(e,t);return n===-1?null:this._timeline[n]}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t=`time`){let n=this._search(e,t);return n+10&&this._timeline[t-1].time=0?this._timeline[n-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(hh(this._timeline[t].time,e)){for(let n=t;n>=0&&hh(this._timeline[n].time,e);n--)t=n;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else this._timeline.length===1&&ph(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){let t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){let t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t=`time`){if(this._timeline.length===0)return-1;let n=0,r=this._timeline.length,i=r;if(r>0&&this._timeline[r-1][t]<=e)return r-1;for(;n=0&&this._timeline[n].time>=e;)n--;return this._iterate(t,n+1),this}forEachAtTime(e,t){let n=this._search(e);if(n!==-1&&hh(this._timeline[n].time,e)){let r=n;for(let t=n;t>=0&&hh(this._timeline[t].time,e);t--)r=t;this._iterate(e=>{t(e)},r,n)}return this}dispose(){return super.dispose(),this._timeline=[],this}},vh=[];function yh(e){vh.push(e)}function bh(e){vh.forEach(t=>t(e))}var xh=[];function Sh(e){xh.push(e)}function Ch(e){xh.forEach(t=>t(e))}var wh=class e extends uh{constructor(){super(...arguments),this.name=`Emitter`}on(e,t){return e.split(/\W+/).forEach(e=>{km(this._events)&&(this._events={}),this._events.hasOwnProperty(e)||(this._events[e]=[]),this._events[e].push(t)}),this}once(e,t){let n=(...r)=>{t(...r),this.off(e,n)};return this.on(e,n),this}off(e,t){return e.split(/\W+/).forEach(e=>{if(km(this._events)&&(this._events={}),this._events.hasOwnProperty(e))if(km(t))this._events[e]=[];else{let n=this._events[e];for(let e=n.length-1;e>=0;e--)n[e]===t&&n.splice(e,1)}}),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){let n=this._events[e].slice(0);for(let e=0,r=n.length;e{let r=Object.getOwnPropertyDescriptor(e.prototype,n);Object.defineProperty(t.prototype,n,r)})}dispose(){return super.dispose(),this._events=void 0,this}},Th=class extends wh{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}},Eh=class e extends Th{constructor(){super(),this.name=`Context`,this._constants=new Map,this._timeouts=new _h,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;let t=Y(e.getDefaults(),arguments,[`context`]);t.context?(this._context=t.context,this._latencyHint=arguments[0]?.latencyHint||``):(this._context=Km({latencyHint:t.latencyHint}),this._latencyHint=t.latencyHint),this._ticker=new Qm(this.emit.bind(this,`tick`),t.clockSource,t.updateInterval,this._context.sampleRate),this.on(`tick`,this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit(`statechange`,this.state)},this[arguments[0]?.hasOwnProperty(`updateInterval`)?`_lookAhead`:`lookAhead`]=t.lookAhead}static getDefaults(){return{clockSource:`worker`,latencyHint:`interactive`,lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||=(bh(this),!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,t,n){return this._context.createBuffer(e,t,n)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,n){return this._context.createPeriodicWave(e,t,n)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){return q(nh(this._context),`Not available if OfflineAudioContext`),this._context.createMediaStreamSource(e)}createMediaElementSource(e){return q(nh(this._context),`Not available if OfflineAudioContext`),this._context.createMediaElementSource(e)}createMediaStreamDestination(){return q(nh(this._context),`Not available if OfflineAudioContext`),this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){q(!this._initialized,`The listener cannot be set after initialization.`),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){q(!this._initialized,`The transport cannot be set after initialization.`),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){q(!this._initialized,`Draw cannot be set after initialization.`),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){q(!this._initialized,`The destination cannot be set after initialization.`),this._destination=e}createAudioWorkletNode(e,t){return Xm(this.rawContext,e,t)}addAudioWorkletModule(e){return J(this,void 0,void 0,function*(){q(K(this.rawContext.audioWorklet),`AudioWorkletNode is only available in a secure context (https or localhost)`),this._workletPromise||=this.rawContext.audioWorklet.addModule(e),yield this._workletPromise})}workletsAreReady(){return J(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get lookAhead(){return this._lookAhead}set lookAhead(e){this._lookAhead=e,this.updateInterval=e?e/2:.01}get latencyHint(){return this._latencyHint}get rawContext(){return this._context}now(){return this._context.currentTime+this._lookAhead}immediate(){return this._context.currentTime}resume(){return nh(this._context)?this._context.resume():Promise.resolve()}close(){return J(this,void 0,void 0,function*(){nh(this._context)&&this.state!==`closed`&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&Ch(this)})}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{let t=this._context.createBuffer(1,128,this._context.sampleRate),n=t.getChannelData(0);for(let t=0;tthis._constants[e].disconnect()),this.close(),this}_timeoutLoop(){let e=this.now();this._timeouts.forEachBefore(e,e=>{e.callback(),this._timeouts.remove(e)})}setTimeout(e,t){this._timeoutIds++;let n=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:n+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach(t=>{t.id===e&&this._timeouts.remove(t)}),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){let n=++this._timeoutIds,r=()=>{let i=this.now();this._timeouts.add({callback:()=>{e(),r()},id:n,time:i+t})};return r(),n}},Dh=class extends Th{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,n){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,n){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e){return J(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}};function X(e,t){Pm(t)?t.forEach(t=>X(e,t)):Object.defineProperty(e,t,{enumerable:!0,writable:!1})}function Oh(e,t){Pm(t)?t.forEach(t=>Oh(e,t)):Object.defineProperty(e,t,{writable:!0})}var Z=()=>{},kh=class e extends uh{constructor(){super(),this.name=`ToneAudioBuffer`,this.onload=Z;let t=Y(e.getDefaults(),arguments,[`url`,`onload`,`onerror`]);this.reverse=t.reverse,this.onload=t.onload,Fm(t.url)?this.load(t.url).catch(t.onerror):t.url&&this.set(t.url)}static getDefaults(){return{onerror:Z,onload:Z,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Nh().sampleRate}set(t){return t instanceof e?t.loaded?this._buffer=t.get():t.onload=()=>{this.set(t),this.onload(this)}:this._buffer=t,this._reversed&&this._reverse(),this}get(){return this._buffer}load(t){return J(this,void 0,void 0,function*(){let n=e.load(t).then(e=>{this.set(e),this.onload(this)});e.downloads.push(n);try{yield n}finally{let t=e.downloads.indexOf(n);e.downloads.splice(t,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){let t=Pm(e)&&e[0].length>0,n=t?e.length:1,r=t?e[0].length:e.length,i=Nh(),a=i.createBuffer(n,r,i.sampleRate),o=!t&&n===1?[e]:e;for(let e=0;ee/t),this.fromArray(e)}return this}toArray(e){if(jm(e))return this.getChannelData(e);if(this.numberOfChannels===1)return this.toArray(0);{let e=[];for(let t=0;t0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(t){return new e().fromArray(t)}static fromUrl(t){return J(this,void 0,void 0,function*(){return yield new e().load(t)})}static load(t){return J(this,void 0,void 0,function*(){let n=e.baseUrl===``||e.baseUrl.endsWith(`/`)?e.baseUrl:e.baseUrl+`/`,r=yield fetch(n+t);if(!r.ok)throw Error(`could not load url: ${t}`);let i=yield r.arrayBuffer();return yield Nh().decodeAudioData(i)})}static supportsType(e){let t=e.split(`.`),n=t[t.length-1];return document.createElement(`audio`).canPlayType(`audio/`+n)!==``}static loaded(){return J(this,void 0,void 0,function*(){for(yield Promise.resolve();e.downloads.length;)yield e.downloads[0]})}};kh.baseUrl=``,kh.downloads=[];var Ah=class extends Eh{constructor(){super({clockSource:`offline`,context:th(arguments[0])?arguments[0]:qm(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:th(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name=`OfflineContext`,this._currentTime=0,this.isOffline=!0,this._duration=th(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return J(this,void 0,void 0,function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit(`tick`),this._currentTime+=128/this.sampleRate,t++;let n=Math.floor(this.sampleRate/128);e&&t%n===0&&(yield new Promise(e=>setTimeout(e,1)))}})}render(){return J(this,arguments,void 0,function*(e=!0){return yield this.workletsAreReady(),yield this._renderClock(e),new kh(yield this._context.startRendering())})}close(){return Promise.resolve()}},jh=new Dh,Mh=jh;function Nh(){return Mh===jh&&Ym&&Ph(new Eh),Mh}function Ph(e,t=!1){t&&Mh.dispose(),Mh=nh(e)?new Eh(e):th(e)?new Ah(e):e}if(Jm&&!Jm.TONE_SILENCE_LOGGING){let e=` * Tone.js v${Ss} * `;console.log(`%c${e}`,`background: #000; color: #fff`)}function Fh(e){return 10**(e/20)}function Ih(e){return Math.log(e)/Math.LN10*20}function Lh(e){return 2**(e/12)}var Rh=440;function zh(){return Rh}function Bh(e){Rh=e}function Vh(e){return Math.round(Hh(e))}function Hh(e){return 69+12*Math.log2(e/Rh)}function Uh(e){return Rh*2**((e-69)/12)}var Wh=class e extends uh{constructor(e,t,n){super(),this.defaultUnits=`s`,this._val=t,this._units=n,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{let n=parseInt(e,10),r=t===`.`?1.5:1;return n===1?this._beatsToUnits(this._getTimeSignature())*r:this._beatsToUnits(4/n)*r},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{let t=parseInt(e,10);return this._beatsToUnits(8/(Math.floor(t)*3))},regexp:/^(\d+)t$/i},tr:{method:(e,t,n)=>{let r=0;return e&&e!==`0`&&(r+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!==`0`&&(r+=this._beatsToUnits(parseFloat(t))),n&&n!==`0`&&(r+=this._beatsToUnits(parseFloat(n)/4)),r},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof e&&this.fromType(this._val),km(this._val))return this._noArg();if(Fm(this._val)&&km(this._units)){for(let e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(Mm(this._val)){let e=0;for(let t in this._val)if(K(this._val[t])){let n=this._val[t],r=new this.constructor(this.context,t).valueOf()*n;e+=r}return e}if(K(this._units)){let e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}else if(Fm(this._val))return parseFloat(this._val);else return this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case`s`:this._val=e.toSeconds();break;case`i`:this._val=e.toTicks();break;case`hz`:this._val=e.toFrequency();break;case`midi`:this._val=e.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}},Gh=class e extends Wh{constructor(){super(...arguments),this.name=`TimeClass`}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:t=>{let n=new e(this.context,t).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(n))},regexp:/^@(.+)/}})}quantize(e,t=1){let n=new this.constructor(this.context,e).valueOf(),r=this.valueOf();return r+(Math.round(r/n)*n-r)*t}toNotation(){let t=this.toSeconds(),n=[`1m`];for(let e=1;e<9;e++){let t=2**e;n.push(t+`n.`),n.push(t+`n`),n.push(t+`t`)}n.push(`0`);let r=n[0],i=new e(this.context,n[0]).toSeconds();return n.forEach(n=>{let a=new e(this.context,n).toSeconds();Math.abs(a-t)3&&(r=parseFloat(parseFloat(i).toFixed(3))),[n,t,r].join(`:`)}toTicks(){let e=this._beatsToUnits(1);return this.valueOf()/e*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return Vh(this.toFrequency())}_now(){return this.context.now()}},Kh=class e extends Gh{constructor(){super(...arguments),this.name=`Frequency`,this.defaultUnits=`hz`}static get A4(){return zh()}static set A4(e){Bh(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(t){return this.defaultUnits===`midi`?t:e.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(t,n){let r=qh[t.toLowerCase()]+(parseInt(n,10)+1)*12;return this.defaultUnits===`midi`?r:e.mtof(r)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,n){let r=1;return e&&e!==`0`&&(r*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!==`0`&&(r*=this._beatsToUnits(parseFloat(t))),n&&n!==`0`&&(r*=this._beatsToUnits(parseFloat(n)/4)),r}}})}transpose(t){return new e(this.context,this.valueOf()*Lh(t))}harmonize(e){return e.map(e=>this.transpose(e))}toMidi(){return Vh(this.valueOf())}toNote(){let t=this.toFrequency(),n=Math.log2(t/e.A4),r=Math.round(12*n)+57,i=Math.floor(r/12);return i<0&&(r+=-12*i),Jh[r%12]+i.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){let e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(e*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return Uh(e)}static ftom(e){return Vh(e)}},qh={cbbb:-3,cbb:-2,cb:-1,c:0,"c#":1,cx:2,"c##":2,"c###":3,"cx#":3,"c#x":3,dbbb:-1,dbb:0,db:1,d:2,"d#":3,dx:4,"d##":4,"d###":5,"dx#":5,"d#x":5,ebbb:1,ebb:2,eb:3,e:4,"e#":5,ex:6,"e##":6,"e###":7,"ex#":7,"e#x":7,fbbb:2,fbb:3,fb:4,f:5,"f#":6,fx:7,"f##":7,"f###":8,"fx#":8,"f#x":8,gbbb:4,gbb:5,gb:6,g:7,"g#":8,gx:9,"g##":9,"g###":10,"gx#":10,"g#x":10,abbb:6,abb:7,ab:8,a:9,"a#":10,ax:11,"a##":11,"a###":12,"ax#":12,"a#x":12,bbbb:8,bbb:9,bb:10,b:11,"b#":12,bx:13,"b##":13,"b###":14,"bx#":14,"b#x":14},Jh=[`C`,`C#`,`D`,`D#`,`E`,`F`,`F#`,`G`,`G#`,`A`,`A#`,`B`],Yh=class extends Gh{constructor(){super(...arguments),this.name=`TransportTime`}_now(){return this.context.transport.seconds}},Xh=class e extends uh{constructor(){super();let t=Y(e.getDefaults(),arguments,[`context`]);this.defaultContext?this.context=this.defaultContext:this.context=t.context}static getDefaults(){return{context:Nh()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return Hm(e),new Gh(this.context,e).toSeconds()}toFrequency(e){return new Kh(this.context,e).toFrequency()}toTicks(e){return new Yh(this.context,e).toTicks()}_getPartialProperties(e){let t=this.get();return Object.keys(t).forEach(n=>{km(e[n])&&delete t[n]}),t}get(){let t=sh(this);return Object.keys(t).forEach(n=>{if(Reflect.has(this,n)){let r=this[n];K(r)&&K(r.value)&&K(r.setValueAtTime)?t[n]=r.value:r instanceof e?t[n]=r._getPartialProperties(t[n]):Pm(r)||jm(r)||Fm(r)||Nm(r)?t[n]=r:delete t[n]}}),t}set(t){return Object.keys(t).forEach(n=>{Reflect.has(this,n)&&K(this[n])&&(this[n]&&K(this[n].value)&&K(this[n].setValueAtTime)?this[n].value!==t[n]&&(this[n].value=t[n]):this[n]instanceof e?this[n].set(t[n]):this[n]=t[n])}),this}},Zh=class extends _h{constructor(e=`stopped`){super(),this.name=`StateTimeline`,this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){let t=this.get(e);return t===null?this._initial:t.state}setStateAtTime(e,t,n){return Lm(t,0),this.add(Object.assign({},n,{state:e,time:t})),this}getLastState(e,t){let n=this._search(t);for(let t=n;t>=0;t--){let n=this._timeline[t];if(n.state===e)return n}}getNextState(e,t){let n=this._search(t);if(n!==-1)for(let t=n;t0,`timeConstant must be a number greater than 0`);let i=this.toSeconds(t);return this._assertRange(r),q(isFinite(r)&&isFinite(i),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:n,time:i,type:`setTargetAtTime`,value:r}),this.log(this.units,`setTargetAtTime`,e,i,n),this._param.setTargetAtTime(r,i,n),this}setValueCurveAtTime(e,t,n,r=1){n=this.toSeconds(n),t=this.toSeconds(t);let i=this._fromType(e[0])*r;this.setValueAtTime(this._toType(i),t);let a=n/(e.length-1);for(let n=1;n{t.type===`cancelScheduledValues`?e.cancelScheduledValues(t.time):t.type===`setTargetAtTime`?e.setTargetAtTime(t.value,t.time,t.constant):e[t.type](t.value,t.time)}),this}setParam(e){q(this._swappable,`The Param must be assigned as 'swappable' in the constructor`);let t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,n,r,i){return n+(t-n)*Math.exp(-(i-e)/r)}_linearInterpolate(e,t,n,r,i){return t+(r-t)*((i-e)/(n-e))}_exponentialInterpolate(e,t,n,r,i){return t*(r/t)**+((i-e)/(n-e))}},$=class e extends Xh{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return K(this.input)?$m(this.input)||this.input instanceof Q?1:this.input.numberOfInputs:0}get numberOfOutputs(){return K(this.output)?this.output.numberOfOutputs:0}_isAudioNode(t){return K(t)&&(t instanceof e||eh(t))}_getInternalNodes(){let e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach(t=>{t.channelCount=e.channelCount,t.channelCountMode=e.channelCountMode,t.channelInterpretation=e.channelInterpretation})}_getChannelProperties(){let e=this._getInternalNodes();q(e.length>0,`ToneAudioNode does not have any internal nodes`);let t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){let t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){let t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){let t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,n=0){return $h(this,e,t,n),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Gm(`toMaster() has been renamed toDestination()`),this.toDestination()}disconnect(e,t=0,n=0){return eg(this,e,t,n),this}chain(...e){return Qh(this,...e),this}fan(...e){return e.forEach(e=>this.connect(e)),this}dispose(){return super.dispose(),K(this.input)&&(this.input instanceof e?this.input.dispose():eh(this.input)&&this.input.disconnect()),K(this.output)&&(this.output instanceof e?this.output.dispose():eh(this.output)&&this.output.disconnect()),this._internalChannels=[],this}};function Qh(...e){let t=e.shift();e.reduce((e,t)=>(e instanceof $?e.connect(t):eh(e)&&$h(e,t),t),t)}function $h(e,t,n=0,r=0){for(q(K(e),`Cannot connect from undefined node`),q(K(t),`Cannot connect to undefined node`),(t instanceof $||eh(t))&&q(t.numberOfInputs>0,`Cannot connect to node with no inputs`),q(e.numberOfOutputs>0,`Cannot connect from node with no outputs`);t instanceof $||t instanceof Q;)K(t.input)&&(t=t.input);for(;e instanceof $;)K(e.output)&&(e=e.output);$m(t)?e.connect(t,n):e.connect(t,n,r)}function eg(e,t,n=0,r=0){if(K(t))for(;t instanceof $;)t=t.input;for(;!eh(e);)K(e.output)&&(e=e.output);$m(t)?e.disconnect(t,n):eh(t)?e.disconnect(t,n,r):e.disconnect()}var tg=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`gain`,`units`]);super(t),this.name=`Gain`,this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode,this.gain=new Q({context:this.context,convert:t.convert,param:this._gainNode.gain,units:t.units,value:t.gain,minValue:t.minValue,maxValue:t.maxValue}),X(this,`gain`)}static getDefaults(){return Object.assign($.getDefaults(),{convert:!0,gain:1,units:`gain`})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}},ng=class extends ${constructor(e){super(e),this.onended=Z,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new tg({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){let t=this.toSeconds(e);return this._startTime!==-1&&t>=this._startTime&&(this._stopTime===-1||t<=this._stopTime)?`started`:`stopped`},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign($.getDefaults(),{curve:`linear`,fadeIn:0,fadeOut:0,onended:Z})}_startGain(e,t=1){q(this._startTime===-1,`Source cannot be started more than once`);let n=this.toSeconds(this._fadeIn);return this._startTime=e+n,this._startTime=Math.max(this._startTime,this.context.currentTime),n>0?(this._gainNode.gain.setValueAtTime(0,e),this._curve===`linear`?this._gainNode.gain.linearRampToValueAtTime(t,e+n):this._gainNode.gain.exponentialApproachValueAtTime(t,e,n)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log(`stop`,e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){q(this._startTime!==-1,`'start' must be called before 'stop'`),this.cancelStop();let t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.now()),t>0?this._curve===`linear`?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{let e=this._curve===`exponential`?t*2:0;this._stopSource(this.now()+e),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==Z&&(this.onended(this),this.onended=Z,!this.context.isOffline)){let e=()=>this.dispose();typeof requestIdleCallback<`u`?requestIdleCallback(e):setTimeout(e,10)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log(`cancelStop`),q(this._startTime!==-1,`Source is not started`),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.dispose(),this.onended=Z,this}},rg=class e extends ng{constructor(){let t=Y(e.getDefaults(),arguments,[`offset`]);super(t),this.name=`ToneConstantSource`,this._source=this.context.createConstantSource(),$h(this._source,this._gainNode),this.offset=new Q({context:this.context,convert:t.convert,param:this._source.offset,units:t.units,value:t.offset,minValue:t.minValue,maxValue:t.maxValue})}static getDefaults(){return Object.assign(ng.getDefaults(),{convert:!0,offset:1,units:`number`})}start(e){let t=this.toSeconds(e);return this.log(`start`,t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),this.state===`started`&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}},ig=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`value`,`units`]);super(t),this.name=`Signal`,this.override=!0,this.output=this._constantSource=new rg({context:this.context,convert:t.convert,offset:t.value,units:t.units,minValue:t.minValue,maxValue:t.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign($.getDefaults(),{convert:!0,units:`number`,value:0})}connect(e,t=0,n=0){return ag(this,e,t,n),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,n){return this._param.exponentialRampTo(e,t,n),this}linearRampTo(e,t,n){return this._param.linearRampTo(e,t,n),this}targetRampTo(e,t,n){return this._param.targetRampTo(e,t,n),this}exponentialApproachValueAtTime(e,t,n){return this._param.exponentialApproachValueAtTime(e,t,n),this}setTargetAtTime(e,t,n){return this._param.setTargetAtTime(e,t,n),this}setValueCurveAtTime(e,t,n,r){return this._param.setValueCurveAtTime(e,t,n,r),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,n){return this._param.rampTo(e,t,n),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}};function ag(e,t,n,r){(t instanceof Q||$m(t)||t instanceof ig&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof ig&&(t.overridden=!0)),$h(e,t,n,r)}var og=class e extends Q{constructor(){let t=Y(e.getDefaults(),arguments,[`value`]);super(t),this.name=`TickParam`,this._events=new _h(1/0),this._multiplier=1,this._multiplier=t.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:`setValueAtTime`,value:this._fromType(t.value)}),this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(Q.getDefaults(),{multiplier:1,units:`hertz`,value:1})}setTargetAtTime(e,t,n){t=this.toSeconds(t),this.setRampPoint(t);let r=this._fromType(e),i=this._events.get(t),a=Math.round(Math.max(1/n,1));for(let e=0;e<=a;e++){let a=n*e+t,o=this._exponentialApproach(i.time,i.value,r,n,a);this.linearRampToValueAtTime(this._toType(o),a)}return this}setValueAtTime(e,t){let n=this.toSeconds(t);super.setValueAtTime(e,t);let r=this._events.get(n),i=this._events.previousEvent(r),a=this._getTicksUntilEvent(i,n);return r.ticks=Math.max(a,0),this}linearRampToValueAtTime(e,t){let n=this.toSeconds(t);super.linearRampToValueAtTime(e,t);let r=this._events.get(n),i=this._events.previousEvent(r),a=this._getTicksUntilEvent(i,n);return r.ticks=Math.max(a,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);let n=this._fromType(e),r=this._events.get(t),i=Math.round(Math.max((t-r.time)*10,1)),a=(t-r.time)/i;for(let e=0;e<=i;e++){let i=a*e+r.time,o=this._exponentialInterpolate(r.time,r.value,t,n,i);this.linearRampToValueAtTime(this._toType(o),i)}return this}_getTicksUntilEvent(e,t){if(e===null)e={ticks:0,time:0,type:`setValueAtTime`,value:0};else if(km(e.ticks)){let t=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(t,e.time)}let n=this._fromType(this.getValueAtTime(e.time)),r=this._fromType(this.getValueAtTime(t)),i=this._events.get(t);return i&&i.time===t&&i.type===`setValueAtTime`&&(r=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(n+r)+e.ticks}getTicksAtTime(e){let t=this.toSeconds(e),n=this._events.get(t);return Math.max(this._getTicksUntilEvent(n,t),0)}getDurationOfTicks(e,t){let n=this.toSeconds(t),r=this.getTicksAtTime(t);return this.getTimeOfTick(r+e)-n}getTimeOfTick(e){let t=this._events.get(e,`ticks`),n=this._events.getAfter(e,`ticks`);if(t&&t.ticks===e)return t.time;if(t&&n&&n.type===`linearRampToValueAtTime`&&t.value!==n.value){let r=this._fromType(this.getValueAtTime(t.time)),i=(this._fromType(this.getValueAtTime(n.time))-r)/(n.time-t.time),a=Math.sqrt(r**2-2*i*(t.ticks-e)),o=(-r+a)/i,s=(-r-a)/i;return(o>0?o:s)+t.time}else if(t)return t.value===0?1/0:t.time+(e-t.ticks)/t.value;else return e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){let n=this.toSeconds(t),r=this.toSeconds(e),i=this.getTicksAtTime(n);return this.getTicksAtTime(n+r)-i}_fromType(e){return this.units===`bpm`&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return this.units===`bpm`&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){let t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}},sg=class e extends ig{constructor(){let t=Y(e.getDefaults(),arguments,[`value`]);super(t),this.name=`TickSignal`,this.input=this._param=new og({context:this.context,convert:t.convert,multiplier:t.multiplier,param:this._constantSource.offset,units:t.units,value:t.value})}static getDefaults(){return Object.assign(ig.getDefaults(),{multiplier:1,units:`hertz`,value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}},cg=class e extends Xh{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`]);super(t),this.name=`TickSource`,this._state=new Zh,this._tickOffset=new _h,this._ticksAtTime=new _h,this._secondsAtTime=new _h,this.frequency=new sg({context:this.context,units:t.units,value:t.frequency}),X(this,`frequency`),this._state.setStateAtTime(`stopped`,0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:`hertz`},Xh.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){let n=this.toSeconds(e);return this._state.getValueAtTime(n)!==`started`&&(this._state.setStateAtTime(`started`,n),K(t)&&this.setTicksAtTime(t,n),this._ticksAtTime.cancel(n),this._secondsAtTime.cancel(n)),this}stop(e){let t=this.toSeconds(e);if(this._state.getValueAtTime(t)===`stopped`){let e=this._state.get(t);e&&e.time>0&&(this._tickOffset.cancel(e.time),this._state.cancel(e.time))}return this._state.cancel(t),this._state.setStateAtTime(`stopped`,t),this.setTicksAtTime(0,t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}pause(e){let t=this.toSeconds(e);return this._state.getValueAtTime(t)===`started`&&(this._state.setStateAtTime(`paused`,t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t)),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getTicksAtTime(e){let t=this.toSeconds(e),n=this._state.getLastState(`stopped`,t),r=this._ticksAtTime.get(t),i={state:`paused`,time:t};this._state.add(i);let a=r||n,o=r?r.ticks:0,s=null;return this._state.forEachBetween(a.time,t+this.sampleTime,e=>{let t=a.time,n=this._tickOffset.get(e.time);n&&n.time>=a.time&&(o=n.ticks,t=n.time),a.state===`started`&&e.state!==`started`&&(o+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(t),e.time!==i.time&&(s={state:e.state,time:e.time,ticks:o})),a=e}),this._state.remove(i),s&&this._ticksAtTime.add(s),o}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){let t=this.now(),n=this.frequency.timeToTicks(e,t);this.setTicksAtTime(n,t)}getSecondsAtTime(e){e=this.toSeconds(e);let t=this._state.getLastState(`stopped`,e),n={state:`paused`,time:e};this._state.add(n);let r=this._secondsAtTime.get(e),i=r||t,a=r?r.seconds:0,o=null;return this._state.forEachBetween(i.time,e+this.sampleTime,e=>{let t=i.time,r=this._tickOffset.get(e.time);r&&r.time>=i.time&&(a=r.seconds,t=r.time),i.state===`started`&&e.state!==`started`&&(a+=e.time-t,e.time!==n.time&&(o={state:e.state,time:e.time,seconds:a})),i=e}),this._state.remove(n),o&&this._secondsAtTime.add(o),a}setTicksAtTime(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){let n=this._tickOffset.get(t),r=this._state.get(t),i=Math.max(n.time,r.time),a=this.frequency.getTicksAtTime(i)+e-n.ticks;return this.frequency.getTimeOfTick(a)}forEachTickBetween(e,t,n){let r=this._state.get(e);this._state.forEachBetween(e,t,t=>{r&&r.state===`started`&&t.state!==`started`&&this.forEachTickBetween(Math.max(r.time,e),t.time-this.sampleTime,n),r=t});let i=null;if(r&&r.state===`started`){let a=Math.max(r.time,e),o=this.frequency.getTicksAtTime(a),s=o-this.frequency.getTicksAtTime(r.time),c=Math.ceil(s)-s;c=hh(c,1)?0:c;let l=this.frequency.getTimeOfTick(o+c);for(;l{switch(e.state){case`started`:let t=this._tickSource.getTicksAtTime(e.time);this.emit(`start`,e.time,t);break;case`stopped`:e.time!==0&&this.emit(`stop`,e.time);break;case`paused`:this.emit(`pause`,e.time);break}}),this._tickSource.forEachTickBetween(e,t,(e,t)=>{this.callback(e,t)}))}getStateAtTime(e){let t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off(`tick`,this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}};wh.mixin(lg);var ug=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`volume`]);super(t),this.name=`Volume`,this.input=this.output=new tg({context:this.context,gain:t.volume,units:`decibels`}),this.volume=this.output.gain,X(this,`volume`),this._unmutedVolume=t.volume,this.mute=t.mute}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}},dg=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments);super(t),this.name=`Destination`,this.input=new ug({context:this.context}),this.output=new tg({context:this.context}),this.volume=this.input.volume,Qh(this.input,this.output,this.context.rawContext.destination),this.mute=t.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),Qh(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};yh(e=>{e.destination=new dg({context:e})}),Sh(e=>{e.destination.dispose()});var fg=class extends ${constructor(){super(...arguments),this.name=`Listener`,this.positionX=new Q({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new Q({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new Q({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new Q({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new Q({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new Q({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new Q({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new Q({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new Q({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign($.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}};yh(e=>{e.listener=new fg({context:e})}),Sh(e=>{e.listener.dispose()});var pg=class e extends uh{constructor(){super(),this.name=`ToneAudioBuffers`,this._buffers=new Map,this._loadingCount=0;let t=Y(e.getDefaults(),arguments,[`urls`,`onload`,`baseUrl`],`urls`);this.baseUrl=t.baseUrl,Object.keys(t.urls).forEach(e=>{this._loadingCount++;let n=t.urls[e];this.add(e,n,this._bufferLoaded.bind(this,t.onload),t.onerror)})}static getDefaults(){return{baseUrl:``,onerror:Z,onload:Z,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return q(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,this._loadingCount===0&&e&&e()}get loaded(){return Array.from(this._buffers).every(([e,t])=>t.loaded)}add(e,t,n=Z,r=Z){return Fm(t)?(this.baseUrl&&t.trim().substring(0,11).toLowerCase()===`data:audio/`&&(this.baseUrl=``),this._buffers.set(e.toString(),new kh(this.baseUrl+t,n,r))):this._buffers.set(e.toString(),new kh(t,n,r)),this}dispose(){return super.dispose(),this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this}},mg=class extends Yh{constructor(){super(...arguments),this.name=`Ticks`,this.defaultUnits=`i`}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}},hg=class extends Xh{constructor(){super(...arguments),this.name=`Draw`,this.expiration=.25,this.anticipation=.008,this._events=new _h,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){let e=this.context.currentTime;this._events.forEachBefore(e+this.anticipation,t=>{e-t.time<=this.expiration&&t.callback(),this._events.remove(t)}),this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}};yh(e=>{e.draw=new hg({context:e})}),Sh(e=>{e.draw.dispose()});var gg=class extends uh{constructor(){super(...arguments),this.name=`IntervalTimeline`,this._root=null,this._length=0}add(e){q(K(e.time),`Events must have a time property`),q(K(e.duration),`Events must have a duration parameter`),e.time=e.time.valueOf();let t=new _g(e.time,e.time+e.duration,e);for(this._root===null?this._root=t:this._root.insert(t),this._length++;t!==null;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(this._root!==null){let t=[];this._root.search(e.time,t);for(let n of t)if(n.event===e){this._removeNode(n),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,e=>this.remove(e)),this}_setRoot(e){this._root=e,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(e,t){e.parent===null?this._setRoot(t):(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent))}_removeNode(e){if(e.left===null&&e.right===null)this._replaceNodeInParent(e,null);else if(e.right===null)this._replaceNodeInParent(e,e.left);else if(e.left===null)this._replaceNodeInParent(e,e.right);else{let t=e.getBalance(),n,r=null;if(t>0)if(e.left.right===null)n=e.left,n.right=e.right,r=n;else{for(n=e.left.right;n.right!==null;)n=n.right;n.parent&&(n.parent.right=n.left,r=n.parent,n.left=e.left,n.right=e.right)}else if(e.right.left===null)n=e.right,n.left=e.left,r=n;else{for(n=e.right.left;n.left!==null;)n=n.left;n.parent&&(n.parent.left=n.right,r=n.parent,n.left=e.left,n.right=e.right)}e.parent===null?this._setRoot(n):e.isLeftChild()?e.parent.left=n:e.parent.right=n,r&&this._rebalance(r)}e.dispose()}_rotateLeft(e){let t=e.parent,n=e.isLeftChild(),r=e.right;r&&(e.right=r.left,r.left=e),t===null?this._setRoot(r):n?t.left=r:t.right=r}_rotateRight(e){let t=e.parent,n=e.isLeftChild(),r=e.left;r&&(e.left=r.right,r.right=e),t===null?this._setRoot(r):n?t.left=r:t.right=r}_rebalance(e){let t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(this._root!==null){let t=[];if(this._root.search(e,t),t.length>0){let e=t[0];for(let n=1;ne.low&&(e=t[n]);return e.event}}return null}forEach(e){if(this._root!==null){let t=[];this._root.traverse(e=>t.push(e)),t.forEach(t=>{t.event&&e(t.event)})}return this}forEachAtTime(e,t){if(this._root!==null){let n=[];this._root.search(e,n),n.forEach(e=>{e.event&&t(e.event)})}return this}forEachFrom(e,t){if(this._root!==null){let n=[];this._root.searchAfter(e,n),n.forEach(e=>{e.event&&t(e.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(e=>e.dispose()),this._root=null,this}},_g=class{constructor(e,t,n){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=n,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?this.left===null?this.left=e:this.left.insert(e):this.right===null?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(this.left!==null&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),!(this.low>e)&&this.right!==null&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),this.left!==null&&this.left.searchAfter(e,t)),this.right!==null&&this.right.searchAfter(e,t)}traverse(e){e(this),this.left!==null&&this.left.traverse(e),this.right!==null&&this.right.traverse(e)}updateHeight(){this.left!==null&&this.right!==null?this.height=Math.max(this.left.height,this.right.height)+1:this.right===null?this.left===null?this.height=0:this.height=this.left.height+1:this.height=this.right.height+1}updateMax(){this.max=this.high,this.left!==null&&(this.max=Math.max(this.max,this.left.max)),this.right!==null&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return this.left!==null&&this.right!==null?e=this.left.height-this.right.height:this.left===null?this.right!==null&&(e=-(this.right.height+1)):e=this.left.height+1,e}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}},vg=class extends uh{constructor(e){super(),this.name=`TimelineValue`,this._timeline=new _h({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){let t=this._timeline.get(e);return t?t.value:this._initialValue}},yg=class e extends ${constructor(){super(Y(e.getDefaults(),arguments,[`context`]))}connect(e,t=0,n=0){return ag(this,e,t,n),this}},bg=class e extends yg{constructor(){let t=Y(e.getDefaults(),arguments,[`mapping`,`length`]);super(t),this.name=`WaveShaper`,this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper,Pm(t.mapping)||t.mapping instanceof Float32Array?this.curve=Float32Array.from(t.mapping):Am(t.mapping)&&this.setMap(t.mapping,t.length)}static getDefaults(){return Object.assign(ig.getDefaults(),{length:1024})}setMap(e,t=1024){let n=new Float32Array(t);for(let r=0,i=t;rt.includes(e)),`oversampling must be either 'none', '2x', or '4x'`),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}},xg=class e extends yg{constructor(){let t=Y(e.getDefaults(),arguments,[`value`]);super(t),this.name=`Pow`,this._exponentScaler=this.input=this.output=new bg({context:this.context,mapping:this._expFunc(t.value),length:8192}),this._exponent=t.value}static getDefaults(){return Object.assign(yg.getDefaults(),{value:1})}_expFunc(e){return t=>Math.abs(t)**+e}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}},Sg=class e{constructor(t,n){this.id=e._eventId++,this._remainderTime=0;let r=Object.assign(e.getDefaults(),n);this.transport=t,this.callback=r.callback,this._once=r.once,this.time=Math.floor(r.time),this._remainderTime=r.time-this.time}static getDefaults(){return{callback:Z,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(e){if(this.callback){let t=this.transport.bpm.getDurationOfTicks(1,e);this.callback(e+this._remainderTime*t),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}};Sg._eventId=0;var Cg=class e extends Sg{constructor(t,n){super(t,n),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);let r=Object.assign(e.getDefaults(),n);this.duration=r.duration,this._interval=r.interval,this._nextTick=r.time,this.transport.on(`start`,this._boundRestart),this.transport.on(`loopStart`,this._boundRestart),this.transport.on(`ticks`,this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Sg.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvent(){return mh(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new mg(this.context,this._nextTick).toSeconds()):-1}_createEvents(e){mh(this._nextTick+this._interval,this.floatTime+this.duration)&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new mg(this.context,this._nextTick).toSeconds()))}_restart(e){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;let t=this.transport.getTicksAtTime(e);fh(t,this.time)&&(this._nextTick=this.floatTime+Math.ceil((t-this.floatTime)/this._interval)*this._interval),this._currentId=this._createEvent(),this._nextTick+=this._interval,this._nextId=this._createEvent()}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off(`start`,this._boundRestart),this.transport.off(`loopStart`,this._boundRestart),this.transport.off(`ticks`,this._boundRestart),this}},wg=class e extends Xh{constructor(){let t=Y(e.getDefaults(),arguments);super(t),this.name=`Transport`,this._loop=new vg(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new _h,this._repeatedEvents=new gg,this._syncedSignals=[],this._swingAmount=0,this._ppq=t.ppq,this._clock=new lg({callback:this._processTick.bind(this),context:this.context,frequency:0,units:`bpm`}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=t.ppq,this.bpm.setValueAtTime(t.bpm,0),X(this,`bpm`),this._timeSignature=t.timeSignature,this._swingTicks=t.ppq/2}static getDefaults(){return Object.assign(Xh.getDefaults(),{bpm:120,loopEnd:`4m`,loopStart:0,ppq:192,swing:0,swingSubdivision:`8n`,timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit(`loopEnd`,e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit(`loopStart`,e,this._clock.getSecondsAtTime(e)),this.emit(`loop`,e)),this._swingAmount>0&&t%this._ppq!==0&&t%(this._swingTicks*2)!=0){let n=t%(this._swingTicks*2)/(this._swingTicks*2),r=Math.sin(n*Math.PI)*this._swingAmount;e+=new mg(this.context,this._swingTicks*2/3).toSeconds()*r}Vm(!0),this._timeline.forEachAtTime(t,t=>t.invoke(e)),Vm(!1)}schedule(e,t){let n=new Sg(this,{callback:e,time:new Yh(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}scheduleRepeat(e,t,n,r=1/0){let i=new Cg(this,{callback:e,duration:new Gh(this.context,r).toTicks(),interval:new Gh(this.context,t).toTicks(),time:new Yh(this.context,n).toTicks()});return this._addEvent(i,this._repeatedEvents)}scheduleOnce(e,t){let n=new Sg(this,{callback:e,once:!0,time:new Yh(this.context,t).toTicks()});return this._addEvent(n,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){let t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){let t=this.toTicks(e);return this._timeline.forEachFrom(t,e=>this.clear(e.id)),this._repeatedEvents.forEachFrom(t,e=>this.clear(e.id)),this}_bindClockEvents(){this._clock.on(`start`,(e,t)=>{t=new mg(this.context,t).toSeconds(),this.emit(`start`,e,t)}),this._clock.on(`stop`,e=>{this.emit(`stop`,e)}),this._clock.on(`pause`,e=>{this.emit(`pause`,e)})}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){this.context.resume();let n;return K(t)&&(n=this.toTicks(t)),this._clock.start(e,n),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),this._clock.getStateAtTime(e)===`started`?this.stop(e):this.start(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){Pm(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new Gh(this.context,this._loopStart,`i`).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new Gh(this.context,this._loopEnd,`i`).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new mg(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){let e=this.now(),t=this._clock.getTicksAtTime(e);return new mg(this.context,t).toBarsBeatsSixteenths()}set position(e){let t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){let t=this.now(),n=this._clock.frequency.timeToTicks(e,t);this.ticks=n}get progress(){if(this.loop){let e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){let t=this.now();if(this.state===`started`){let n=this._clock.getTicksAtTime(t),r=t+this._clock.frequency.getDurationOfTicks(Math.ceil(n)-n,t);this.emit(`stop`,r),this._clock.setTicksAtTime(e,r),this.emit(`start`,r,this._clock.getSecondsAtTime(r))}else this.emit(`ticks`,t),this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return this._clock.getTicksAtTime(e)}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),this.state!==`started`)return 0;{let t=this.now(),n=this.getTicksAtTime(t),r=e-n%e;return this._clock.nextTickTime(r,t)}}syncSignal(e,t){let n=this.now(),r=this.bpm,i=1/(60/r.getValueAtTime(n)/this.PPQ),a=[];if(e.units===`time`){let e=1/64/i,t=new tg(e),n=new xg(-1),o=new tg(e);r.chain(t,n,o),r=o,i=1/i,a=[t,n,o]}t||=e.getValueAtTime(n)===0?0:e.getValueAtTime(n)/i;let o=new tg(t);return r.connect(o),o.connect(e._param),a.push(o),this._syncedSignals.push({initial:e.value,nodes:a,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){let n=this._syncedSignals[t];n.signal===e&&(n.nodes.forEach(e=>e.dispose()),n.signal.value=n.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Oh(this,`bpm`),this._timeline.dispose(),this._repeatedEvents.dispose(),this}};wh.mixin(wg),yh(e=>{e.transport=new wg({context:e})}),Sh(e=>{e.transport.dispose()});var Tg=class extends ${constructor(e){super(e),this.input=void 0,this._state=new Zh(`stopped`),this._synced=!1,this._scheduled=[],this._syncedStart=Z,this._syncedStop=Z,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new ug({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,X(this,`volume`),this.onstop=e.onstop}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,onstop:Z,volume:0})}get state(){return this._synced?this.context.transport.state===`started`?this._state.getValueAtTime(this.context.transport.seconds):`stopped`:this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,n){let r=km(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(r=this._clampToCurrentTime(r),!this._synced&&this._state.getValueAtTime(r)===`started`)q(fh(r,this._state.get(r).time),`Start time must be strictly greater than previous start time`),this._state.cancel(r),this._state.setStateAtTime(`started`,r),this.log(`restart`,r),this.restart(r,t,n);else if(this.log(`start`,r),this._state.setStateAtTime(`started`,r),this._synced){let e=this._state.get(r);e&&(e.offset=this.toSeconds(ch(t,0)),e.duration=n?this.toSeconds(n):void 0);let i=this.context.transport.schedule(e=>{this._start(e,t,n)},r);this._scheduled.push(i),this.context.transport.state===`started`&&this.context.transport.getSecondsAtTime(this.immediate())>r&&this._syncedStart(this.now(),this.context.transport.seconds)}else Rm(this.context),this._start(r,t,n);return this}stop(e){let t=km(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),this._state.getValueAtTime(t)===`started`||K(this._state.getNextState(`started`,t))){if(this.log(`stop`,t),!this._synced)this._stop(t);else{let e=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(e)}this._state.cancel(t),this._state.setStateAtTime(`stopped`,t)}return this}restart(e,t,n){return e=this.toSeconds(e),this._state.getValueAtTime(e)===`started`&&(this._state.cancel(e),this._restart(e,t,n)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(fh(t,0)){let n=this._state.get(t);if(n&&n.state===`started`&&n.time!==t){let r=t-this.toSeconds(n.time),i;n.duration&&(i=this.toSeconds(n.duration)-r),this._start(e,this.toSeconds(n.offset)+r,i)}}},this._syncedStop=e=>{let t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));this._state.getValueAtTime(t)===`started`&&this._stop(e)},this.context.transport.on(`start`,this._syncedStart),this.context.transport.on(`loopStart`,this._syncedStart),this.context.transport.on(`stop`,this._syncedStop),this.context.transport.on(`pause`,this._syncedStop),this.context.transport.on(`loopEnd`,this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off(`stop`,this._syncedStop),this.context.transport.off(`pause`,this._syncedStop),this.context.transport.off(`loopEnd`,this._syncedStop),this.context.transport.off(`start`,this._syncedStart),this.context.transport.off(`loopStart`,this._syncedStart)),this._synced=!1,this._scheduled.forEach(e=>this.context.transport.clear(e)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=Z,this.unsync(),this._volume.dispose(),this._state.dispose(),this}},Eg=class e extends ng{constructor(){let t=Y(e.getDefaults(),arguments,[`url`,`onload`]);super(t),this.name=`ToneBufferSource`,this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1,$h(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new Q({context:this.context,param:this._source.playbackRate,units:`positive`,value:t.playbackRate}),this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this._buffer=new kh(t.url,t.onload,t.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(ng.getDefaults(),{url:new kh,loop:!1,loopEnd:0,loopStart:0,onload:Z,onerror:Z,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,n,r=1){q(this.buffer.loaded,`buffer is either not set or not loaded`);let i=this.toSeconds(e);this._startGain(i,r),t=this.loop?ch(t,this.loopStart):ch(t,0);let a=Math.max(this.toSeconds(t),0);if(this.loop){let e=this.toSeconds(this.loopEnd)||this.buffer.duration,t=this.toSeconds(this.loopStart),n=e-t;ph(a,e)&&(a=(a-t)%n+t),hh(a,this.buffer.duration)&&(a=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,mh(a,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(i,a)),K(n)){let e=this.toSeconds(n);e=Math.max(e,0),this.stop(i+e)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}};function Dg(e,t){return J(this,void 0,void 0,function*(){let n=t/e.context.sampleRate,r=new Ah(1,n,e.context.sampleRate);return new e.constructor(Object.assign(e.get(),{frequency:2/n,detune:0,context:r})).toDestination().start(0),(yield r.render()).getChannelData(0)})}var Og=class e extends ng{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`type`]);super(t),this.name=`ToneOscillatorNode`,this._oscillator=this.context.createOscillator(),this._internalChannels=[this._oscillator],$h(this._oscillator,this._gainNode),this.type=t.type,this.frequency=new Q({context:this.context,param:this._oscillator.frequency,units:`frequency`,value:t.frequency}),this.detune=new Q({context:this.context,param:this._oscillator.detune,units:`cents`,value:t.detune}),X(this,[`frequency`,`detune`])}static getDefaults(){return Object.assign(ng.getDefaults(),{detune:0,frequency:440,type:`sine`})}start(e){let t=this.toSeconds(e);return this.log(`start`,t),this._startGain(t),this._oscillator.start(t),this}_stopSource(e){this._oscillator.stop(e)}setPeriodicWave(e){return this._oscillator.setPeriodicWave(e),this}get type(){return this._oscillator.type}set type(e){this._oscillator.type=e}dispose(){return super.dispose(),this.state===`started`&&this.stop(),this._oscillator.disconnect(),this.frequency.dispose(),this.detune.dispose(),this}},kg=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`type`]);super(t),this.name=`Oscillator`,this._oscillator=null,this.frequency=new ig({context:this.context,units:`frequency`,value:t.frequency}),X(this,`frequency`),this.detune=new ig({context:this.context,units:`cents`,value:t.detune}),X(this,`detune`),this._partials=t.partials,this._partialCount=t.partialCount,this._type=t.type,t.partialCount&&t.type!==`custom`&&(this._type=this.baseType+t.partialCount.toString()),this.phase=t.phase}static getDefaults(){return Object.assign(Tg.getDefaults(),{detune:0,frequency:440,partialCount:0,partials:[],phase:0,type:`sine`})}_start(e){let t=this.toSeconds(e),n=new Og({context:this.context,onended:()=>this.onstop(this)});this._oscillator=n,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(t)}_stop(e){let t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){let t=this.toSeconds(e);return this.log(`restart`,t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if(this._type===`custom`)return e._periodicWaveCache.find(e=>e.phase===this._phase&&oh(e.partials,this._partials));{let t=e._periodicWaveCache.find(e=>e.type===this._type&&e.phase===this._phase);return this._partialCount=t?t.partialCount:this._partialCount,t}}get type(){return this._type}set type(t){this._type=t;let n=[`sine`,`square`,`sawtooth`,`triangle`].indexOf(t)!==-1;if(this._phase===0&&n)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=t);else{let n=this._getCachedPeriodicWave();if(K(n)){let{partials:e,wave:t}=n;this._wave=t,this._partials=e,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{let[n,r]=this._getRealImaginary(t,this._phase),i=this.context.createPeriodicWave(n,r);this._wave=i,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),e._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:n,type:this._type,wave:this._wave}),e._periodicWaveCache.length>100&&e._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),``)}set baseType(e){this.partialCount&&this._type!==`custom`&&e!==`custom`?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){Lm(e,0);let t=this._type,n=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(n&&(t=n[1]),this._type!==`custom`)e===0?this.type=t:this.type=t+e.toString();else{let t=new Float32Array(e);this._partials.forEach((e,n)=>t[n]=e),this._partials=Array.from(t),this.type=this._type}}_getRealImaginary(e,t){let n=4096/2,r=new Float32Array(n),i=new Float32Array(n),a=1;if(e===`custom`){if(a=this._partials.length+1,this._partialCount=this._partials.length,n=a,this._partials.length===0)return[r,i]}else{let t=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);t?(a=parseInt(t[2],10)+1,this._partialCount=parseInt(t[2],10),e=t[1],a=Math.max(a,2),n=a):this._partialCount=0,this._partials=[]}for(let o=1;o>1&1?-1:1):0,this._partials[o-1]=s;break;case`custom`:s=this._partials[o-1];break;default:throw TypeError(`Oscillator: invalid type: `+e)}s===0?(r[o]=0,i[o]=0):(r[o]=-s*Math.sin(t*o),i[o]=s*Math.cos(t*o))}return[r,i]}_inverseFFT(e,t,n){let r=0,i=e.length;for(let a=0;a(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}},jg=class e extends ig{constructor(){let t=Y(e.getDefaults(),arguments,[`value`]);super(t),this.name=`Multiply`,this.override=!1,this._mult=this.input=this.output=new tg({context:this.context,minValue:t.minValue,maxValue:t.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(ig.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}},Mg=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`type`,`modulationType`]);super(t),this.name=`AMOscillator`,this._modulationScale=new Ag({context:this.context}),this._modulationNode=new tg({context:this.context}),this._carrier=new kg({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new kg({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new jg({context:this.context,units:`positive`,value:t.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),X(this,[`frequency`,`detune`,`harmonicity`])}static getDefaults(){return Object.assign(kg.getDefaults(),{harmonicity:1,modulationType:`square`})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(){return J(this,arguments,void 0,function*(e=1024){return Dg(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}},Ng=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`type`,`modulationType`]);super(t),this.name=`FMOscillator`,this._modulationNode=new tg({context:this.context,gain:0}),this._carrier=new kg({context:this.context,detune:t.detune,frequency:0,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.detune=this._carrier.detune,this.frequency=new ig({context:this.context,units:`frequency`,value:t.frequency}),this._modulator=new kg({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new jg({context:this.context,units:`positive`,value:t.harmonicity}),this.modulationIndex=new jg({context:this.context,units:`positive`,value:t.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),X(this,[`modulationIndex`,`frequency`,`detune`,`harmonicity`])}static getDefaults(){return Object.assign(kg.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:`square`})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(){return J(this,arguments,void 0,function*(e=1024){return Dg(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}},Pg=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`width`]);super(t),this.name=`PulseOscillator`,this._widthGate=new tg({context:this.context,gain:0}),this._thresh=new bg({context:this.context,mapping:e=>e<=0?-1:1}),this.width=new ig({context:this.context,units:`audioRange`,value:t.width}),this._triangle=new kg({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:`triangle`}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),X(this,[`width`,`frequency`,`detune`])}static getDefaults(){return Object.assign(Tg.getDefaults(),{detune:0,frequency:440,phase:0,type:`pulse`,width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return`pulse`}get baseType(){return`pulse`}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(){return J(this,arguments,void 0,function*(e=1024){return Dg(this,e)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}},Fg=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`type`,`spread`]);super(t),this.name=`FatOscillator`,this._oscillators=[],this.frequency=new ig({context:this.context,units:`frequency`,value:t.frequency}),this.detune=new ig({context:this.context,units:`cents`,value:t.detune}),this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=t.partials,this._partialCount=t.partialCount,this.count=t.count,X(this,[`frequency`,`detune`])}static getDefaults(){return Object.assign(kg.getDefaults(),{count:3,spread:20,type:`sawtooth`})}_start(e){e=this.toSeconds(e),this._forEach(t=>t.start(e))}_stop(e){e=this.toSeconds(e),this._forEach(t=>t.stop(e))}_restart(e){this._forEach(t=>t.restart(e))}_forEach(e){for(let t=0;tt.type=e)}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){let t=-e/2,n=e/(this._oscillators.length-1);this._forEach((e,r)=>e.detune.value=t+n*r)}}get count(){return this._oscillators.length}set count(e){if(Lm(e,1),this._oscillators.length!==e){this._forEach(e=>e.dispose()),this._oscillators=[];for(let t=0;tthis.onstop(this):Z});this.type===`custom`&&(n.partials=this._partials),this.frequency.connect(n.frequency),this.detune.connect(n.detune),n.detune.overridden=!1,n.connect(this.output),this._oscillators[t]=n}this.spread=this._spread,this.state===`started`&&this._forEach(e=>e.start())}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach((e,t)=>e.phase=this._phase+t/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach(t=>t.baseType=e),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type=`custom`,this._forEach(t=>t.partials=e))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach(t=>t.partialCount=e),this._type=this._oscillators[0].type}asArray(){return J(this,arguments,void 0,function*(e=1024){return Dg(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(e=>e.dispose()),this}},Ig=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`modulationFrequency`]);super(t),this.name=`PWMOscillator`,this.sourceType=`pwm`,this._scale=new jg({context:this.context,value:2}),this._pulse=new Pg({context:this.context,frequency:t.modulationFrequency}),this._pulse.carrierType=`sine`,this.modulationFrequency=this._pulse.frequency,this._modulator=new kg({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),X(this,[`modulationFrequency`,`frequency`,`detune`])}static getDefaults(){return Object.assign(Tg.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:`pwm`})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return`pwm`}get baseType(){return`pwm`}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(){return J(this,arguments,void 0,function*(e=1024){return Dg(this,e)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}},Lg={am:Mg,fat:Fg,fm:Ng,oscillator:kg,pulse:Pg,pwm:Ig},Rg=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`frequency`,`type`]);super(t),this.name=`OmniOscillator`,this.frequency=new ig({context:this.context,units:`frequency`,value:t.frequency}),this.detune=new ig({context:this.context,units:`cents`,value:t.detune}),X(this,[`frequency`,`detune`]),this.set(t)}static getDefaults(){return Object.assign(kg.getDefaults(),Ng.getDefaults(),Mg.getDefaults(),Fg.getDefaults(),Pg.getDefaults(),Ig.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e=``;return[`am`,`fm`,`fat`].some(e=>this._sourceType===e)&&(e=this._sourceType),e+this._oscillator.type}set type(e){e.substr(0,2)===`fm`?(this._createNewOscillator(`fm`),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,2)===`am`?(this._createNewOscillator(`am`),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,3)===`fat`?(this._createNewOscillator(`fat`),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):e===`pwm`?(this._createNewOscillator(`pwm`),this._oscillator=this._oscillator):e===`pulse`?this._createNewOscillator(`pulse`):(this._createNewOscillator(`oscillator`),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){!this._getOscType(this._oscillator,`pulse`)&&!this._getOscType(this._oscillator,`pwm`)&&(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){!this._getOscType(this._oscillator,`pulse`)&&!this._getOscType(this._oscillator,`pwm`)&&(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,`type`)&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;let t=Lg[e],n=this.now();if(this._oscillator){let e=this._oscillator;e.stop(n),this.context.setTimeout(()=>e.dispose(),this.blockTime)}this._oscillator=new t({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),this.state===`started`&&this._oscillator.start(n)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t=`sine`;this._oscillator.type!==`pwm`&&this._oscillator.type!==`pulse`&&(t=this._oscillator.type),e===`fm`?this.type=`fm`+t:e===`am`?this.type=`am`+t:e===`fat`?this.type=`fat`+t:e===`oscillator`?this.type=t:e===`pulse`?this.type=`pulse`:e===`pwm`&&(this.type=`pwm`)}_getOscType(e,t){return e instanceof Lg[t]}get baseType(){return this._oscillator.baseType}set baseType(e){!this._getOscType(this._oscillator,`pulse`)&&!this._getOscType(this._oscillator,`pwm`)&&e!==`pulse`&&e!==`pwm`&&(this._oscillator.baseType=e)}get width(){if(this._getOscType(this._oscillator,`pulse`))return this._oscillator.width}get count(){if(this._getOscType(this._oscillator,`fat`))return this._oscillator.count}set count(e){this._getOscType(this._oscillator,`fat`)&&jm(e)&&(this._oscillator.count=e)}get spread(){if(this._getOscType(this._oscillator,`fat`))return this._oscillator.spread}set spread(e){this._getOscType(this._oscillator,`fat`)&&jm(e)&&(this._oscillator.spread=e)}get modulationType(){if(this._getOscType(this._oscillator,`fm`)||this._getOscType(this._oscillator,`am`))return this._oscillator.modulationType}set modulationType(e){(this._getOscType(this._oscillator,`fm`)||this._getOscType(this._oscillator,`am`))&&Fm(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){if(this._getOscType(this._oscillator,`fm`))return this._oscillator.modulationIndex}get harmonicity(){if(this._getOscType(this._oscillator,`fm`)||this._getOscType(this._oscillator,`am`))return this._oscillator.harmonicity}get modulationFrequency(){if(this._getOscType(this._oscillator,`pwm`))return this._oscillator.modulationFrequency}asArray(){return J(this,arguments,void 0,function*(e=1024){return Dg(this,e)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}};function zg(e,t=1/0){let n=new WeakMap;return function(r,i){Reflect.defineProperty(r,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(r){Lm(r,e,t),n.set(this,r)}})}}function Bg(e,t=1/0){let n=new WeakMap;return function(r,i){Reflect.defineProperty(r,i,{configurable:!0,enumerable:!0,get:function(){return n.get(this)},set:function(r){Lm(this.toSeconds(r),e,t),n.set(this,r)}})}}var Vg=class e extends Tg{constructor(){let t=Y(e.getDefaults(),arguments,[`url`,`onload`]);super(t),this.name=`Player`,this._activeSources=new Set,this._buffer=new kh({onload:this._onload.bind(this,t.onload),onerror:t.onerror,reverse:t.reverse,url:t.url}),this.autostart=t.autostart,this._loop=t.loop,this._loopStart=t.loopStart,this._loopEnd=t.loopEnd,this._playbackRate=t.playbackRate,this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut}static getDefaults(){return Object.assign(Tg.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:Z,onerror:Z,playbackRate:1,reverse:!1})}load(e){return J(this,void 0,void 0,function*(){return yield this._buffer.load(e),this._onload(),this})}_onload(e=Z){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())===`started`&&(this._state.cancel(this.now()),this._state.setStateAtTime(`stopped`,this.now()))}start(e,t,n){return super.start(e,t,n),this}_start(e,t,n){t=this._loop?ch(t,this._loopStart):ch(t,0);let r=this.toSeconds(t),i=n;n=ch(n,Math.max(this._buffer.duration-r,0));let a=this.toSeconds(n);a/=this._playbackRate,e=this.toSeconds(e);let o=new Eg({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);!this._loop&&!this._synced&&(this._state.cancel(e+a),this._state.setStateAtTime(`stopped`,e+a,{implicitEnd:!0})),this._activeSources.add(o),this._loop&&km(i)?o.start(e,r):o.start(e,r,a-this.toSeconds(this.fadeOut))}_stop(e){let t=this.toSeconds(e);this._activeSources.forEach(e=>e.stop(t))}restart(e,t,n){return super.restart(e,t,n),this}_restart(e,t,n){var r;(r=[...this._activeSources].pop())==null||r.stop(e),this._start(e,t,n)}seek(e,t){let n=this.toSeconds(t);if(this._state.getValueAtTime(n)===`started`){let t=this.toSeconds(e);this._stop(n),this._start(n,t)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&Lm(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopStart=e})}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&Lm(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopEnd=e})}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach(t=>{t.loop=e}),e)){let e=this._state.getNextState(`stopped`,this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;let t=this.now(),n=this._state.getNextState(`stopped`,t);n&&n.implicitEnd&&(this._state.cancel(n.time),this._activeSources.forEach(e=>e.cancelStop())),this._activeSources.forEach(n=>{n.playbackRate.setValueAtTime(e,t)})}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(e=>e.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}};Zm([Bg(0)],Vg.prototype,`fadeIn`,void 0),Zm([Bg(0)],Vg.prototype,`fadeOut`,void 0);var Hg=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`attack`,`decay`,`sustain`,`release`]);super(t),this.name=`Envelope`,this._sig=new ig({context:this.context,value:0}),this.output=this._sig,this.input=void 0,this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve}static getDefaults(){return Object.assign($.getDefaults(),{attack:.01,attackCurve:`linear`,decay:.1,decayCurve:`exponential`,release:1,releaseCurve:`exponential`,sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(Fm(e))return e;{let n;for(n in Ug)if(Ug[n][t]===e)return n;return e}}_setCurve(e,t,n){if(Fm(n)&&Reflect.has(Ug,n)){let r=Ug[n];Mm(r)?e!==`_decayCurve`&&(this[e]=r[t]):this[e]=r}else if(Pm(n)&&e!==`_decayCurve`)this[e]=n;else throw Error(`Envelope: invalid curve: `+n)}get attackCurve(){return this._getCurve(this._attackCurve,`In`)}set attackCurve(e){this._setCurve(`_attackCurve`,`In`,e)}get releaseCurve(){return this._getCurve(this._releaseCurve,`Out`)}set releaseCurve(e){this._setCurve(`_releaseCurve`,`Out`,e)}get decayCurve(){return this._getCurve(this._decayCurve,`Out`)}set decayCurve(e){this._setCurve(`_decayCurve`,`Out`,e)}triggerAttack(e,t=1){this.log(`triggerAttack`,e,t),e=this.toSeconds(e);let n=this.toSeconds(this.attack),r=this.toSeconds(this.decay),i=this.getValueAtTime(e);if(i>0){let e=1/n;n=(1-i)/e}if(n0){let n=this.toSeconds(this.release);n{let e,t,n=[];for(e=0;e<128;e++)n[e]=Math.sin(e/127*(Math.PI/2));let r=[];for(e=0;e<127;e++)t=e/127,r[e]=(Math.sin(Math.PI*2*t*6.4-Math.PI/2)+1)/10+t*.83;r[127]=1;let i=[];for(e=0;e<128;e++)i[e]=Math.ceil(e/127*5)/5;let a=[];for(e=0;e<128;e++)t=e/127,a[e]=.5*(1-Math.cos(Math.PI*t));let o=[];for(e=0;e<128;e++){t=e/127;let n=t**3*4+.2,r=Math.cos(n*Math.PI*2*t);o[e]=Math.abs(r*(1-t))}function s(e){let t=Array(e.length);for(let n=0;nthis._original_triggerRelease(e),this._volume=this.output=new ug({context:this.context,volume:t.volume}),this.volume=this._volume.volume,X(this,`volume`)}static getDefaults(){return Object.assign($.getDefaults(),{volume:0})}sync(){return this._syncState()&&(this._syncMethod(`triggerAttack`,1),this._syncMethod(`triggerRelease`,0),this.context.transport.on(`stop`,this._syncedRelease),this.context.transport.on(`pause`,this._syncedRelease),this.context.transport.on(`loopEnd`,this._syncedRelease)),this}_syncState(){let e=!1;return this._synced||(this._synced=!0,e=!0),e}_syncMethod(e,t){let n=this[`_original_`+e]=this[e];this[e]=(...e)=>{let r=e[t],i=this.context.transport.schedule(r=>{e[t]=r,n.apply(this,e)},r);this._scheduledEvents.push(i)}}unsync(){return this._scheduledEvents.forEach(e=>this.context.transport.clear(e)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease,this.context.transport.off(`stop`,this._syncedRelease),this.context.transport.off(`pause`,this._syncedRelease),this.context.transport.off(`loopEnd`,this._syncedRelease)),this}triggerAttackRelease(e,t,n,r){let i=this.toSeconds(n),a=this.toSeconds(t);return this.triggerAttack(e,i,r),this.triggerRelease(i+a),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}},Gg=class e extends Wg{constructor(){let t=Y(e.getDefaults(),arguments);super(t),this.portamento=t.portamento,this.onsilence=t.onsilence}static getDefaults(){return Object.assign(Wg.getDefaults(),{detune:0,onsilence:Z,portamento:0})}triggerAttack(e,t,n=1){this.log(`triggerAttack`,e,t,n);let r=this.toSeconds(t);return this._triggerEnvelopeAttack(r,n),this.setNote(e,r),this}triggerRelease(e){this.log(`triggerRelease`,e);let t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){let n=this.toSeconds(t),r=e instanceof Kh?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(n)>.05){let e=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(r,e,n)}else this.frequency.setValueAtTime(r,n);return this}};Zm([Bg(0)],Gg.prototype,`portamento`,void 0);var Kg=class e extends Hg{constructor(){super(Y(e.getDefaults(),arguments,[`attack`,`decay`,`sustain`,`release`])),this.name=`AmplitudeEnvelope`,this._gainNode=new tg({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}},qg=class e extends Gg{constructor(){let t=Y(e.getDefaults(),arguments);super(t),this.name=`Synth`,this.oscillator=new Rg(Object.assign({context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)},t.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Kg(Object.assign({context:this.context},t.envelope)),this.oscillator.chain(this.envelope,this.output),X(this,[`oscillator`,`frequency`,`detune`,`envelope`])}static getDefaults(){return Object.assign(Gg.getDefaults(),{envelope:Object.assign(lh(Hg.getDefaults(),Object.keys($.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(lh(Rg.getDefaults(),[...Object.keys(Tg.getDefaults()),`frequency`,`detune`]),{type:`triangle`})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),this.envelope.sustain===0){let t=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+t+n)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}},Jg=class e extends qg{constructor(){let t=Y(e.getDefaults(),arguments);super(t),this.name=`MembraneSynth`,this.portamento=0,this.pitchDecay=t.pitchDecay,this.octaves=t.octaves,X(this,[`oscillator`,`envelope`])}static getDefaults(){return ah(Gg.getDefaults(),qg.getDefaults(),{envelope:{attack:.001,attackCurve:`exponential`,decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:`sine`},pitchDecay:.05})}setNote(e,t){let n=this.toSeconds(t),r=this.toFrequency(e instanceof Kh?e.toFrequency():e),i=r*this.octaves;return this.oscillator.frequency.setValueAtTime(i,n),this.oscillator.frequency.exponentialRampToValueAtTime(r,n+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}};Zm([zg(0)],Jg.prototype,`octaves`,void 0),Zm([Bg(0)],Jg.prototype,`pitchDecay`,void 0);var Yg=new Set;function Xg(e){Yg.add(e)}function Zg(e,t){let n=`registerProcessor("${e}", ${t})`;Yg.add(n)}Xg(` + /** + * The base AudioWorkletProcessor for use in Tone.js. Works with the {@link ToneAudioWorklet}. + */ + class ToneAudioWorkletProcessor extends AudioWorkletProcessor { + + constructor(options) { + + super(options); + /** + * If the processor was disposed or not. Keep alive until it's disposed. + */ + this.disposed = false; + /** + * The number of samples in the processing block + */ + this.blockSize = 128; + /** + * the sample rate + */ + this.sampleRate = sampleRate; + + this.port.onmessage = (event) => { + // when it receives a dispose + if (event.data === "dispose") { + this.disposed = true; + } + }; + } + } +`),Xg(` + /** + * Abstract class for a single input/output processor. + * has a 'generate' function which processes one sample at a time + */ + class SingleIOProcessor extends ToneAudioWorkletProcessor { + + constructor(options) { + super(Object.assign(options, { + numberOfInputs: 1, + numberOfOutputs: 1 + })); + /** + * Holds the name of the parameter and a single value of that + * parameter at the current sample + * @type { [name: string]: number } + */ + this.params = {} + } + + /** + * Generate an output sample from the input sample and parameters + * @abstract + * @param input number + * @param channel number + * @param parameters { [name: string]: number } + * @returns number + */ + generate(){} + + /** + * Update the private params object with the + * values of the parameters at the given index + * @param parameters { [name: string]: Float32Array }, + * @param index number + */ + updateParams(parameters, index) { + for (const paramName in parameters) { + const param = parameters[paramName]; + if (param.length > 1) { + this.params[paramName] = parameters[paramName][index]; + } else { + this.params[paramName] = parameters[paramName][0]; + } + } + } + + /** + * Process a single frame of the audio + * @param inputs Float32Array[][] + * @param outputs Float32Array[][] + */ + process(inputs, outputs, parameters) { + const input = inputs[0]; + const output = outputs[0]; + // get the parameter values + const channelCount = Math.max(input && input.length || 0, output.length); + for (let sample = 0; sample < this.blockSize; sample++) { + this.updateParams(parameters, sample); + for (let channel = 0; channel < channelCount; channel++) { + const inputSample = input && input.length ? input[channel][sample] : 0; + output[channel][sample] = this.generate(inputSample, channel, this.params); + } + } + return !this.disposed; + } + }; +`),Xg(` + /** + * A multichannel buffer for use within an AudioWorkletProcessor as a delay line + */ + class DelayLine { + + constructor(size, channels) { + this.buffer = []; + this.writeHead = [] + this.size = size; + + // create the empty channels + for (let i = 0; i < channels; i++) { + this.buffer[i] = new Float32Array(this.size); + this.writeHead[i] = 0; + } + } + + /** + * Push a value onto the end + * @param channel number + * @param value number + */ + push(channel, value) { + this.writeHead[channel] += 1; + if (this.writeHead[channel] > this.size) { + this.writeHead[channel] = 0; + } + this.buffer[channel][this.writeHead[channel]] = value; + } + + /** + * Get the recorded value of the channel given the delay + * @param channel number + * @param delay number delay samples + */ + get(channel, delay) { + let readHead = this.writeHead[channel] - Math.floor(delay); + if (readHead < 0) { + readHead += this.size; + } + return this.buffer[channel][readHead]; + } + } +`),Zg(`feedback-comb-filter`,` + class FeedbackCombFilterWorklet extends SingleIOProcessor { + + constructor(options) { + super(options); + this.delayLine = new DelayLine(this.sampleRate, options.channelCount || 2); + } + + static get parameterDescriptors() { + return [{ + name: "delayTime", + defaultValue: 0.1, + minValue: 0, + maxValue: 1, + automationRate: "k-rate" + }, { + name: "feedback", + defaultValue: 0.5, + minValue: 0, + maxValue: 0.9999, + automationRate: "k-rate" + }]; + } + + generate(input, channel, parameters) { + const delayedSample = this.delayLine.get(channel, parameters.delayTime * this.sampleRate); + this.delayLine.push(channel, input + delayedSample * parameters.feedback); + return delayedSample; + } + } +`);var Qg=class e extends Wg{constructor(){let t=Y(e.getDefaults(),arguments,[`urls`,`onload`,`baseUrl`],`urls`);super(t),this.name=`Sampler`,this._activeSources=new Map;let n={};Object.keys(t.urls).forEach(e=>{let r=parseInt(e,10);if(q(Im(e)||jm(r)&&isFinite(r),`url key is neither a note or midi pitch: ${e}`),Im(e)){let r=new Kh(this.context,e).toMidi();n[r]=t.urls[e]}else jm(r)&&isFinite(r)&&(n[r]=t.urls[r])}),this._buffers=new pg({urls:n,onload:t.onload,baseUrl:t.baseUrl,onerror:t.onerror}),this.attack=t.attack,this.release=t.release,this.curve=t.curve,this._buffers.loaded&&Promise.resolve().then(t.onload)}static getDefaults(){return Object.assign(Wg.getDefaults(),{attack:0,baseUrl:``,curve:`exponential`,onload:Z,onerror:Z,release:.1,urls:{}})}_findClosest(e){let t=0;for(;t<96;){if(this._buffers.has(e+t))return-t;if(this._buffers.has(e-t))return t;t++}throw Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,n=1){return this.log(`triggerAttack`,e,t,n),Array.isArray(e)||(e=[e]),e.forEach(e=>{let r=Hh(new Kh(this.context,e).toFrequency()),i=Math.round(r),a=r-i,o=this._findClosest(i),s=i-o,c=this._buffers.get(s),l=Lh(o+a),u=new Eg({url:c,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:l}).connect(this.output);u.start(t,0,c.duration/l,n),Pm(this._activeSources.get(i))||this._activeSources.set(i,[]),this._activeSources.get(i).push(u),u.onended=()=>{if(this._activeSources&&this._activeSources.has(i)){let e=this._activeSources.get(i),t=e.indexOf(u);t!==-1&&e.splice(t,1)}}}),this}triggerRelease(e,t){return this.log(`triggerRelease`,e,t),Array.isArray(e)||(e=[e]),e.forEach(e=>{let n=new Kh(this.context,e).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){let e=this._activeSources.get(n);t=this.toSeconds(t),e.forEach(e=>{e.stop(t)}),this._activeSources.set(n,[])}}),this}releaseAll(e){let t=this.toSeconds(e);return this._activeSources.forEach(e=>{for(;e.length;)e.shift().stop(t)}),this}sync(){return this._syncState()&&(this._syncMethod(`triggerAttack`,1),this._syncMethod(`triggerRelease`,1)),this}triggerAttackRelease(e,t,n,r=1){let i=this.toSeconds(n);return this.triggerAttack(e,i,r),Pm(t)?(q(Pm(e),`notes must be an array when duration is array`),e.forEach((e,n)=>{let r=t[Math.min(n,t.length-1)];this.triggerRelease(e,i+this.toSeconds(r))})):this.triggerRelease(e,i+this.toSeconds(t)),this}add(e,t,n){if(q(Im(e)||isFinite(e),`note must be a pitch or midi: ${e}`),Im(e)){let r=new Kh(this.context,e).toMidi();this._buffers.add(r,t,n)}else this._buffers.add(e,t,n);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(e=>{e.forEach(e=>e.dispose())}),this._activeSources.clear(),this}};Zm([Bg(0)],Qg.prototype,`attack`,void 0),Zm([Bg(0)],Qg.prototype,`release`,void 0);var $g=class e extends Xh{constructor(){let t=Y(e.getDefaults(),arguments,[`callback`,`value`]);super(t),this.name=`ToneEvent`,this._state=new Zh(`stopped`),this._startOffset=0,this._loop=t.loop,this.callback=t.callback,this.value=t.value,this._loopStart=this.toTicks(t.loopStart),this._loopEnd=this.toTicks(t.loopEnd),this._playbackRate=t.playbackRate,this._probability=t.probability,this._humanize=t.humanize,this.mute=t.mute,this._playbackRate=t.playbackRate,this._state.increasing=!0,this._rescheduleEvents()}static getDefaults(){return Object.assign(Xh.getDefaults(),{callback:Z,humanize:!1,loop:!1,loopEnd:`1m`,loopStart:0,mute:!1,playbackRate:1,probability:1,value:null})}_rescheduleEvents(e=-1){this._state.forEachFrom(e,e=>{let t;if(e.state===`started`){e.id!==-1&&this.context.transport.clear(e.id);let n=e.time+Math.round(this.startOffset/this._playbackRate);if(this._loop===!0||jm(this._loop)&&this._loop>1){t=1/0,jm(this._loop)&&(t=this._loop*this._getLoopDuration());let r=this._state.getAfter(n);r!==null&&(t=Math.min(t,r.time-n)),t!==1/0&&(t=new mg(this.context,t));let i=new mg(this.context,this._getLoopDuration());e.id=this.context.transport.scheduleRepeat(this._tick.bind(this),i,new mg(this.context,n),t)}else e.id=this.context.transport.schedule(this._tick.bind(this),new mg(this.context,n))}})}get state(){return this._state.getValueAtTime(this.context.transport.ticks)}get startOffset(){return this._startOffset}set startOffset(e){this._startOffset=e}get probability(){return this._probability}set probability(e){this._probability=e}get humanize(){return this._humanize}set humanize(e){this._humanize=e}start(e){let t=this.toTicks(e);return this._state.getValueAtTime(t)===`stopped`&&(this._state.add({id:-1,state:`started`,time:t}),this._rescheduleEvents(t)),this}stop(e){this.cancel(e);let t=this.toTicks(e);if(this._state.getValueAtTime(t)===`started`){this._state.setStateAtTime(`stopped`,t,{id:-1});let e=this._state.getBefore(t),n=t;e!==null&&(n=e.time),this._rescheduleEvents(n)}return this}cancel(e){e=ch(e,-1/0);let t=this.toTicks(e);return this._state.forEachFrom(t,e=>{this.context.transport.clear(e.id)}),this._state.cancel(t),this}_tick(e){let t=this.context.transport.getTicksAtTime(e);if(!this.mute&&this._state.getValueAtTime(t)===`started`){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){let t=.02;Nm(this.humanize)||(t=this.toSeconds(this.humanize)),e+=(Math.random()*2-1)*t}this.callback(e,this.value)}}_getLoopDuration(){return(this._loopEnd-this._loopStart)/this._playbackRate}get loop(){return this._loop}set loop(e){this._loop=e,this._rescheduleEvents()}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._rescheduleEvents()}get loopEnd(){return new mg(this.context,this._loopEnd).toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e),this._loop&&this._rescheduleEvents()}get loopStart(){return new mg(this.context,this._loopStart).toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e),this._loop&&this._rescheduleEvents()}get progress(){if(this._loop){let e=this.context.transport.ticks,t=this._state.get(e);if(t!==null&&t.state===`started`){let n=this._getLoopDuration();return(e-t.time)%n/n}else return 0}else return 0}dispose(){return super.dispose(),this.cancel(),this._state.dispose(),this}},e_=class e extends Xh{constructor(){let t=Y(e.getDefaults(),arguments,[`callback`,`interval`]);super(t),this.name=`Loop`,this._event=new $g({context:this.context,callback:this._tick.bind(this),loop:!0,loopEnd:t.interval,playbackRate:t.playbackRate,probability:t.probability,humanize:t.humanize}),this.callback=t.callback,this.iterations=t.iterations}static getDefaults(){return Object.assign(Xh.getDefaults(),{interval:`4n`,callback:Z,playbackRate:1,iterations:1/0,probability:1,mute:!1,humanize:!1})}start(e){return this._event.start(e),this}stop(e){return this._event.stop(e),this}cancel(e){return this._event.cancel(e),this}_tick(e){this.callback(e)}get state(){return this._event.state}get progress(){return this._event.progress}get interval(){return this._event.loopEnd}set interval(e){this._event.loopEnd=e}get playbackRate(){return this._event.playbackRate}set playbackRate(e){this._event.playbackRate=e}get humanize(){return this._event.humanize}set humanize(e){this._event.humanize=e}get probability(){return this._event.probability}set probability(e){this._event.probability=e}get mute(){return this._event.mute}set mute(e){this._event.mute=e}get iterations(){return this._event.loop===!0?1/0:this._event.loop}set iterations(e){e===1/0?this._event.loop=!0:this._event.loop=e}dispose(){return super.dispose(),this._event.dispose(),this}},t_=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`pan`]);super(t),this.name=`Panner`,this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner,this.pan=new Q({context:this.context,param:this._panner.pan,value:t.pan,minValue:-1,maxValue:1}),this._panner.channelCount=t.channelCount,this._panner.channelCountMode=`explicit`,X(this,`pan`)}static getDefaults(){return Object.assign($.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}};Zg(`bit-crusher`,` + class BitCrusherWorklet extends SingleIOProcessor { + + static get parameterDescriptors() { + return [{ + name: "bits", + defaultValue: 12, + minValue: 1, + maxValue: 16, + automationRate: 'k-rate' + }]; + } + + generate(input, _channel, parameters) { + const step = Math.pow(0.5, parameters.bits - 1); + const val = step * Math.floor(input / step + 0.5); + return val; + } + } +`);var n_=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`solo`]);super(t),this.name=`Solo`,this.input=this.output=new tg({context:this.context}),e._allSolos.has(this.context)||e._allSolos.set(this.context,new Set),e._allSolos.get(this.context).add(this),this.solo=t.solo}static getDefaults(){return Object.assign($.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(t){t?this._addSolo():this._removeSolo(),e._allSolos.get(this.context).forEach(e=>e._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){e._soloed.has(this.context)||e._soloed.set(this.context,new Set),e._soloed.get(this.context).add(this)}_removeSolo(){e._soloed.has(this.context)&&e._soloed.get(this.context).delete(this)}_isSoloed(){return e._soloed.has(this.context)&&e._soloed.get(this.context).has(this)}_noSolos(){return!e._soloed.has(this.context)||e._soloed.has(this.context)&&e._soloed.get(this.context).size===0}_updateSolo(){this._isSoloed()||this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),e._allSolos.get(this.context).delete(this),this._removeSolo(),this}};n_._allSolos=new Map,n_._soloed=new Map;var r_=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`pan`,`volume`]);super(t),this.name=`PanVol`,this._panner=this.input=new t_({context:this.context,pan:t.pan,channelCount:t.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new ug({context:this.context,volume:t.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,X(this,[`pan`,`volume`])}static getDefaults(){return Object.assign($.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}},i_=class e extends ${constructor(){let t=Y(e.getDefaults(),arguments,[`volume`,`pan`]);super(t),this.name=`Channel`,this._solo=this.input=new n_({solo:t.solo,context:this.context}),this._panVol=this.output=new r_({context:this.context,pan:t.pan,volume:t.volume,mute:t.mute,channelCount:t.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),X(this,[`pan`,`volume`])}static getDefaults(){return Object.assign($.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(t){return e.buses.has(t)||e.buses.set(t,new tg({context:this.context})),e.buses.get(t)}send(e,t=0){let n=this._getBus(e),r=new tg({context:this.context,units:`decibels`,gain:t});return this.connect(r),r.connect(n),r}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}};i_.buses=new Map;function a_(){return Nh().now()}Nh().transport;function o_(){return Nh().transport}Nh().destination,Nh().destination,Nh().listener,Nh().draw,Nh();var s_={class:`image-melody`},c_={key:1},l_={class:`images`,key:`images`},u_={key:0,class:`audio`},d_={class:`controls`},f_=500,p_={__name:`ImageMelody`,setup(e){let t=Vt(),n=Vt(0),r=Vt(),i=Vt(),a=Vt(),o=Vt(),s=Vt(),c=Vt(),l=async e=>{e?.[0]&&(r.value=!0,await new Promise(t=>{let n=new FileReader;n.onload=e=>{i.value=e.target.result,t()},n.readAsDataURL(e[0])}))},{isOverDropZone:u}=ps(t,{onDrop:l,dataTypes:[`image/jpeg`,`image/png`]}),{open:d,onChange:f}=gs({accept:[`image/jpeg`,`image/png`]});f(l);let p=(e,t)=>{e.width=f_,e.height=f_;let n=e.getContext(`2d`),{x:r,y:i,width:o,height:s}=_s(`cover`,{width:a.value.naturalWidth,height:a.value.naturalHeight},{width:e.width,height:e.height});if(t){let e=t.width/5,r=t.height/5,i=[];for(let a=0;a<5;a++)for(let o=0;o<5;o++){let s=Math.floor(o*e),c=(Math.floor(a*r)*t.width+s*t.height)*4,l=t.data[c],u=t.data[c+1],d=t.data[c+2];n.fillStyle=`rgba(${l}, ${u}, ${d}, ${t.data[c+3]/255})`,i.push(Math.round((l+u+d)/3));let f=f_/5;n.fillRect(o*f,a*f,f,f)}c.value=i}else n.drawImage(a.value,r,i,o,s);return n};Pn(i,async()=>{if(!i.value)return;a.value.src=i.value,await new Promise(e=>a.value.onload=e),r.value=!1,n.value=1,await new Promise(e=>setTimeout(e,f_));let e=p(o.value).getImageData(0,0,f_,f_);p(s.value,e)});let m=Vt(),h=(e,t)=>e.slice(0,t.length).map((e,t)=>({index:t,value:e})).sort((e,t)=>e.value-t.value).map(e=>e.index).map(e=>t[e]),g=()=>{if(m.value)return;let e=new qg().toDestination();a_();let t=h(c.value,[`C4`,`D4`,`E4`,`G4`,`A4`]),n=0;m.value=new e_(r=>{e.triggerAttackRelease(t[n],`8n`),n=(n+1)%t.length},`4n`).start(0),o_().start()},_=()=>{m.value?.dispose(),m.value=null,o_().stop()},v=()=>{_(),n.value=0,c.value=null};return(e,i)=>{let l=Tr(`svg-util-spinner`);return Zi(),na(`div`,s_,[ca(`img`,{ref_key:`image`,ref:a,hidden:``},null,512),L(ro,{name:`fade`,mode:`out-in`},{default:Dn(()=>[n.value===0?(Zi(),na(`div`,{class:fe([`drop-zone`,{active:Gt(u)}]),ref_key:`dropZone`,ref:t,key:`drop`,onClick:i[0]||=(...e)=>Gt(d)&&Gt(d)(...e)},[r.value?(Zi(),ra(l,{key:0})):(Zi(),na(`p`,c_,`Drop PNG or JPG`))],2)):n.value===1?(Zi(),na(`div`,l_,[ca(`canvas`,{ref_key:`viewCanvas`,ref:o},null,512),ca(`canvas`,{ref_key:`processCanvas`,ref:s},null,512)])):pa(``,!0)]),_:1}),c.value?(Zi(),na(`div`,u_,[ca(`div`,d_,[L(xs,{onClick:g,class:`play`},{default:Dn(()=>[...i[1]||=[fa(`Play`,-1)]]),_:1}),L(xs,{onClick:_},{default:Dn(()=>[...i[2]||=[fa(`Stop`,-1)]]),_:1})]),ca(`button`,{onClick:v,class:`reset`},`Reset`)])):pa(``,!0)])}}},m_={class:`drop theme-light`};Qo({__name:`App`,setup(e){return(e,t)=>(Zi(),na(`main`,m_,[L(p_)]))}}).mount(`#app`); \ No newline at end of file diff --git a/app/public/drops/image-melody/assets/instrument-serif-italic-Cnq-0GR0.woff2 b/app/public/drops/image-melody/assets/instrument-serif-italic-Cnq-0GR0.woff2 new file mode 100644 index 0000000..aef8321 Binary files /dev/null and b/app/public/drops/image-melody/assets/instrument-serif-italic-Cnq-0GR0.woff2 differ diff --git a/app/public/drops/image-melody/assets/instrument-serif-italic-CpREEq8K.woff b/app/public/drops/image-melody/assets/instrument-serif-italic-CpREEq8K.woff new file mode 100644 index 0000000..4dc470f Binary files /dev/null and b/app/public/drops/image-melody/assets/instrument-serif-italic-CpREEq8K.woff differ diff --git a/app/public/drops/image-melody/assets/iosevka-charon-mono-bold-1nweGISG.woff2 b/app/public/drops/image-melody/assets/iosevka-charon-mono-bold-1nweGISG.woff2 new file mode 100644 index 0000000..eb7f237 Binary files /dev/null and b/app/public/drops/image-melody/assets/iosevka-charon-mono-bold-1nweGISG.woff2 differ diff --git a/app/public/drops/image-melody/assets/iosevka-charon-mono-bold-DN5oOlAE.woff b/app/public/drops/image-melody/assets/iosevka-charon-mono-bold-DN5oOlAE.woff new file mode 100644 index 0000000..f2fe83d Binary files /dev/null and b/app/public/drops/image-melody/assets/iosevka-charon-mono-bold-DN5oOlAE.woff differ diff --git a/app/public/drops/image-melody/favicon.png b/app/public/drops/image-melody/favicon.png new file mode 100644 index 0000000..792433d Binary files /dev/null and b/app/public/drops/image-melody/favicon.png differ diff --git a/app/public/drops/image-melody/index.html b/app/public/drops/image-melody/index.html new file mode 100644 index 0000000..373b313 --- /dev/null +++ b/app/public/drops/image-melody/index.html @@ -0,0 +1,14 @@ + + + + + + + Image Melody + + + + +
+ + diff --git a/app/public/drops/image-melody/meta.json b/app/public/drops/image-melody/meta.json new file mode 100644 index 0000000..efc2955 --- /dev/null +++ b/app/public/drops/image-melody/meta.json @@ -0,0 +1,25 @@ +{ + "name": "image-melody", + "title": "Image Melody", + "date": "2026-07-20", + "tags": [ + "tag1", + "tag2", + "tag3" + ], + "description": { + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "My friend Patrick wanted to try generating music from an image. I made this simple experiment which plays notes in a scale based on some of the color values in a pixelated version of the image." + } + ] + } + ] + }, + "published": true +} \ No newline at end of file diff --git a/app/public/drops/noise-shader/assets/hanken-grotesk-BB3emo1n.woff2 b/app/public/drops/noise-shader/assets/hanken-grotesk-BB3emo1n.woff2 new file mode 100644 index 0000000..fd3c8a2 Binary files /dev/null and b/app/public/drops/noise-shader/assets/hanken-grotesk-BB3emo1n.woff2 differ diff --git a/app/public/drops/noise-shader/assets/hanken-grotesk-NweiADIQ.woff b/app/public/drops/noise-shader/assets/hanken-grotesk-NweiADIQ.woff new file mode 100644 index 0000000..f95aff0 Binary files /dev/null and b/app/public/drops/noise-shader/assets/hanken-grotesk-NweiADIQ.woff differ diff --git a/app/public/drops/noise-shader/assets/hanken-grotesk-italic-C_HjJa0S.woff b/app/public/drops/noise-shader/assets/hanken-grotesk-italic-C_HjJa0S.woff new file mode 100644 index 0000000..c3be08e Binary files /dev/null and b/app/public/drops/noise-shader/assets/hanken-grotesk-italic-C_HjJa0S.woff differ diff --git a/app/public/drops/noise-shader/assets/hanken-grotesk-italic-jl8TIPSn.woff2 b/app/public/drops/noise-shader/assets/hanken-grotesk-italic-jl8TIPSn.woff2 new file mode 100644 index 0000000..290394e Binary files /dev/null and b/app/public/drops/noise-shader/assets/hanken-grotesk-italic-jl8TIPSn.woff2 differ diff --git a/app/public/drops/noise-shader/assets/hanken-grotesk-semibold-TK-BXOrb.woff2 b/app/public/drops/noise-shader/assets/hanken-grotesk-semibold-TK-BXOrb.woff2 new file mode 100644 index 0000000..19e1415 Binary files /dev/null and b/app/public/drops/noise-shader/assets/hanken-grotesk-semibold-TK-BXOrb.woff2 differ diff --git a/app/public/drops/noise-shader/assets/hanken-grotesk-semibold-vPR5A_Tb.woff b/app/public/drops/noise-shader/assets/hanken-grotesk-semibold-vPR5A_Tb.woff new file mode 100644 index 0000000..d6ae07c Binary files /dev/null and b/app/public/drops/noise-shader/assets/hanken-grotesk-semibold-vPR5A_Tb.woff differ diff --git a/app/public/drops/noise-shader/assets/index-6pTyzO1j.js b/app/public/drops/noise-shader/assets/index-6pTyzO1j.js new file mode 100644 index 0000000..25e81b0 --- /dev/null +++ b/app/public/drops/noise-shader/assets/index-6pTyzO1j.js @@ -0,0 +1,4410 @@ +var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function r(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var i={},a=[],o=()=>{},s=()=>!1,c=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),l=e=>e.startsWith(`onUpdate:`),u=Object.assign,d=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},f=Object.prototype.hasOwnProperty,p=(e,t)=>f.call(e,t),m=Array.isArray,h=e=>w(e)===`[object Map]`,g=e=>w(e)===`[object Set]`,_=e=>w(e)===`[object Date]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=r(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),k=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},A=/-\w/g,j=k(e=>e.replace(A,e=>e.slice(1).toUpperCase())),ee=/\B([A-Z])/g,M=k(e=>e.replace(ee,`-$1`).toLowerCase()),te=k(e=>e.charAt(0).toUpperCase()+e.slice(1)),N=k(e=>e?`on${te(e)}`:``),P=(e,t)=>!Object.is(e,t),ne=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ie=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ae=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},oe,se=()=>oe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function ce(e){if(m(e)){let t={};for(let n=0;n{if(e){let n=e.split(ue);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function pe(e){let t=``;if(y(e))t=e;else if(m(e))for(let n=0;n0&&--this._on===0){if(be===this)be=this.prevScope;else{let e=be;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(L){let e=L;for(L=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ee;){let t=Ee;for(Ee=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ae(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function je(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Pe(r),Fe(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Me(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ne(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ne(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ve)||(e.globalVersion=Ve,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Me(e))))return;e.flags|=2;let t=e.dep,n=Ce,r=Ie;Ce=e,Ie=!0;try{Ae(e);let n=e.fn(e._value);(t.version===0||P(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Ce=n,Ie=r,je(e),e.flags&=-3}}function Pe(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Pe(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Fe(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ie=!0,Le=[];function Re(){Le.push(Ie),Ie=!1}function ze(){let e=Le.pop();Ie=e===void 0||e}function Be(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Ce;Ce=void 0;try{t()}finally{Ce=e}}}var Ve=0,He=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ue=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ce||!Ie||Ce===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Ce)t=this.activeLink=new He(Ce,this),Ce.deps?(t.prevDep=Ce.depsTail,Ce.depsTail.nextDep=t,Ce.depsTail=t):Ce.deps=Ce.depsTail=t,We(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Ce.depsTail,t.nextDep=void 0,Ce.depsTail.nextDep=t,Ce.depsTail=t,Ce.deps===t&&(Ce.deps=e)}return t}trigger(e){this.version++,Ve++,this.notify(e)}notify(e){Oe();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ke()}}};function We(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)We(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Ge=new WeakMap,Ke=Symbol(``),qe=Symbol(``),Je=Symbol(``);function Ye(e,t,n){if(Ie&&Ce){let t=Ge.get(e);t||Ge.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Ue),r.map=t,r.key=n),r.track()}}function Xe(e,t,n,r,i,a){let o=Ge.get(e);if(!o){Ve++;return}let s=e=>{e&&e.trigger()};if(Oe(),t===`clear`)o.forEach(s);else{let i=m(e),a=i&&D(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Je||!b(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Je)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(Ke)),h(e)&&s(o.get(qe)));break;case`delete`:i||(s(o.get(Ke)),h(e)&&s(o.get(qe)));break;case`set`:h(e)&&s(o.get(Ke));break}}ke()}function Ze(e){let t=Vt(e);return t===e?t:(Ye(t,`iterate`,Je),zt(e)?t:t.map(Ut))}function Qe(e){return Ye(e=Vt(e),`iterate`,Je),e}function $e(e,t){return Rt(e)?Wt(Lt(e)?Ut(t):t):Ut(t)}var et={__proto__:null,[Symbol.iterator](){return tt(this,Symbol.iterator,e=>$e(this,e))},concat(...e){return Ze(this).concat(...e.map(e=>m(e)?Ze(e):e))},entries(){return tt(this,`entries`,e=>(e[1]=$e(this,e[1]),e))},every(e,t){return rt(this,`every`,e,t,void 0,arguments)},filter(e,t){return rt(this,`filter`,e,t,e=>e.map(e=>$e(this,e)),arguments)},find(e,t){return rt(this,`find`,e,t,e=>$e(this,e),arguments)},findIndex(e,t){return rt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return rt(this,`findLast`,e,t,e=>$e(this,e),arguments)},findLastIndex(e,t){return rt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return rt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return at(this,`includes`,e)},indexOf(...e){return at(this,`indexOf`,e)},join(e){return Ze(this).join(e)},lastIndexOf(...e){return at(this,`lastIndexOf`,e)},map(e,t){return rt(this,`map`,e,t,void 0,arguments)},pop(){return ot(this,`pop`)},push(...e){return ot(this,`push`,e)},reduce(e,...t){return it(this,`reduce`,e,t)},reduceRight(e,...t){return it(this,`reduceRight`,e,t)},shift(){return ot(this,`shift`)},some(e,t){return rt(this,`some`,e,t,void 0,arguments)},splice(...e){return ot(this,`splice`,e)},toReversed(){return Ze(this).toReversed()},toSorted(e){return Ze(this).toSorted(e)},toSpliced(...e){return Ze(this).toSpliced(...e)},unshift(...e){return ot(this,`unshift`,e)},values(){return tt(this,`values`,e=>$e(this,e))}};function tt(e,t,n){let r=Qe(e),i=r[t]();return r!==e&&!zt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var nt=Array.prototype;function rt(e,t,n,r,i,a){let o=Qe(e),s=o!==e&&!zt(e),c=o[t];if(c!==nt[t]){let t=c.apply(e,a);return s?Ut(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,$e(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function it(e,t,n,r){let i=Qe(e),a=i!==e&&!zt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=$e(e,t)),n.call(this,t,$e(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?$e(e,c):c}function at(e,t,n){let r=Vt(e);Ye(r,`iterate`,Je);let i=r[t](...n);return(i===-1||i===!1)&&Bt(n[0])?(n[0]=Vt(n[0]),r[t](...n)):i}function ot(e,t,n=[]){Re(),Oe();let r=Vt(e)[t].apply(e,n);return ke(),ze(),r}var st=r(`__proto__,__v_isRef,__isVue`),ct=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(b));function lt(e){b(e)||(e=String(e));let t=Vt(this);return Ye(t,`has`,e),t.hasOwnProperty(e)}var ut=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?At:kt:i?Ot:Dt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=m(e);if(!r){let e;if(a&&(e=et[t]))return e;if(t===`hasOwnProperty`)return lt}let o=Reflect.get(e,t,Gt(e)?e:n);if((b(t)?ct.has(t):st(t))||(r||Ye(e,`get`,t),i))return o;if(Gt(o)){let e=a&&D(t)?o:o.value;return r&&x(e)?Pt(e):e}return x(o)?r?Pt(o):Mt(o):o}},dt=class extends ut{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=m(e)&&D(t);if(!this._isShallow){let e=Rt(i);if(!zt(n)&&!Rt(n)&&(i=Vt(i),n=Vt(n)),!a&&Gt(i)&&!Gt(n))return e||(i.value=n),!0}let o=a?Number(t)e,vt=e=>Reflect.getPrototypeOf(e);function yt(e,t,n){return function(...r){let i=this.__v_raw,a=Vt(i),o=h(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),d=n?_t:t?Wt:Ut;return!t&&Ye(a,`iterate`,c?qe:Ke),u(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function bt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function xt(e,t){let n={get(n){let r=this.__v_raw,i=Vt(r),a=Vt(n);e||(P(n,a)&&Ye(i,`get`,n),Ye(i,`get`,a));let{has:o}=vt(i),s=t?_t:e?Wt:Ut;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&Ye(Vt(t),`iterate`,Ke),t.size},has(t){let n=this.__v_raw,r=Vt(n),i=Vt(t);return e||(P(t,i)&&Ye(r,`has`,t),Ye(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=Vt(a),s=t?_t:e?Wt:Ut;return!e&&Ye(o,`iterate`,Ke),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return u(n,e?{add:bt(`add`),set:bt(`set`),delete:bt(`delete`),clear:bt(`clear`)}:{add(e){let n=Vt(this),r=vt(n),i=Vt(e),a=!t&&!zt(e)&&!Rt(e)?i:e;return r.has.call(n,a)||P(e,a)&&r.has.call(n,e)||P(i,a)&&r.has.call(n,i)||(n.add(a),Xe(n,`add`,a,a)),this},set(e,n){!t&&!zt(n)&&!Rt(n)&&(n=Vt(n));let r=Vt(this),{has:i,get:a}=vt(r),o=i.call(r,e);o||=(e=Vt(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?P(n,s)&&Xe(r,`set`,e,n,s):Xe(r,`add`,e,n),this},delete(e){let t=Vt(this),{has:n,get:r}=vt(t),i=n.call(t,e);i||=(e=Vt(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Xe(t,`delete`,e,void 0,a),o},clear(){let e=Vt(this),t=e.size!==0,n=e.clear();return t&&Xe(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=yt(r,e,t)}),n}function St(e,t){let n=xt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(p(n,r)&&r in t?n:t,r,i)}var Ct={get:St(!1,!1)},wt={get:St(!1,!0)},Tt={get:St(!0,!1)},Et={get:St(!0,!0)},Dt=new WeakMap,Ot=new WeakMap,kt=new WeakMap,At=new WeakMap;function jt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Mt(e){return Rt(e)?e:It(e,!1,pt,Ct,Dt)}function Nt(e){return It(e,!1,ht,wt,Ot)}function Pt(e){return It(e,!0,mt,Tt,kt)}function Ft(e){return It(e,!0,gt,Et,At)}function It(e,t,n,r,i){if(!x(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=jt(T(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Lt(e){return Rt(e)?Lt(e.__v_raw):!!(e&&e.__v_isReactive)}function Rt(e){return!!(e&&e.__v_isReadonly)}function zt(e){return!!(e&&e.__v_isShallow)}function Bt(e){return e?!!e.__v_raw:!1}function Vt(e){let t=e&&e.__v_raw;return t?Vt(t):e}function Ht(e){return!p(e,`__v_skip`)&&Object.isExtensible(e)&&re(e,`__v_skip`,!0),e}var Ut=e=>x(e)?Mt(e):e,Wt=e=>x(e)?Pt(e):e;function Gt(e){return e?e.__v_isRef===!0:!1}function Kt(e){return Jt(e,!1)}function qt(e){return Jt(e,!0)}function Jt(e,t){return Gt(e)?e:new Yt(e,t)}var Yt=class{constructor(e,t){this.dep=new Ue,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Vt(e),this._value=t?e:Ut(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||zt(e)||Rt(e);e=n?e:Vt(e),P(e,t)&&(this._rawValue=e,this._value=n?e:Ut(e),this.dep.trigger())}};function Xt(e){return Gt(e)?e.value:e}function Zt(e){return v(e)?e():Xt(e)}var Qt={get:(e,t,n)=>t===`__v_raw`?e:Xt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return Gt(i)&&!Gt(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function $t(e){return Lt(e)?e:new Proxy(e,Qt)}var en=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ue(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ve-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ce!==this)return De(this,!0),!0}get value(){let e=this.dep.track();return Ne(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function tn(e,t,n=!1){let r,i;return v(e)?r=e:(r=e.get,i=e.set),new en(r,i,n)}var nn={},rn=new WeakMap,an=void 0;function on(e,t=!1,n=an){if(n){let t=rn.get(n);t||rn.set(n,t=[]),t.push(e)}}function sn(e,t,n=i){let{immediate:r,deep:a,once:s,scheduler:c,augmentJob:l,call:u}=n,f=e=>a?e:zt(e)||a===!1||a===0?cn(e,1):cn(e),p,h,g,_,y=!1,b=!1;if(Gt(e)?(h=()=>e.value,y=zt(e)):Lt(e)?(h=()=>f(e),y=!0):m(e)?(b=!0,y=e.some(e=>Lt(e)||zt(e)),h=()=>e.map(e=>{if(Gt(e))return e.value;if(Lt(e))return f(e);if(v(e))return u?u(e,2):e()})):h=v(e)?t?u?()=>u(e,2):e:()=>{if(g){Re();try{g()}finally{ze()}}let t=an;an=p;try{return u?u(e,3,[_]):e(_)}finally{an=t}}:o,t&&a){let e=h,t=a===!0?1/0:a;h=()=>cn(e(),t)}let x=Se(),S=()=>{p.stop(),x&&x.active&&d(x.effects,p)};if(s&&t){let e=t;t=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(nn):nn,w=e=>{if(!(!(p.flags&1)||!p.dirty&&!e))if(t){let n=p.run();if(e||a||y||(b?n.some((e,t)=>P(e,C[t])):P(n,C))){g&&g();let e=an;an=p;try{let e=[n,C===nn?void 0:b&&C[0]===nn?[]:C,_];C=n,u?u(t,3,e):t(...e)}finally{an=e}}}else p.run()};return l&&l(w),p=new Te(h),p.scheduler=c?()=>c(w,!1):w,_=e=>on(e,!1,p),g=p.onStop=()=>{let e=rn.get(p);if(e){if(u)u(e,4);else for(let t of e)t();rn.delete(p)}},t?r?w(!0):C=p.run():c?c(w.bind(null,!0),!0):p.run(),S.pause=p.pause.bind(p),S.resume=p.resume.bind(p),S.stop=S,S}function cn(e,t=1/0,n){if(t<=0||!x(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Gt(e))cn(e.value,t,n);else if(m(e))for(let r=0;r{cn(e,t,n)});else if(E(e)){for(let r in e)cn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&cn(e[r],t,n)}return e}function ln(e,t,n,r){try{return r?e(...r):e()}catch(e){dn(e,t,n)}}function un(e,t,n,r){if(v(e)){let i=ln(e,t,n,r);return i&&S(i)&&i.catch(e=>{dn(e,t,n)}),i}if(m(e)){let i=[];for(let a=0;a>>1,i=pn[r],a=Dn(i);a=Dn(n)?pn.push(e):pn.splice(xn(t),0,e),e.flags|=1,Cn()}}function Cn(){yn||=vn.then(On)}function wn(e){m(e)?hn.push(...e):gn&&e.id===-1?gn.splice(_n+1,0,e):e.flags&1||(hn.push(e),e.flags|=1),Cn()}function Tn(e,t,n=mn+1){for(;nDn(e)-Dn(t));if(hn.length=0,gn){gn.push(...e);return}for(gn=e,_n=0;_ne.id==null?e.flags&2?-1:1/0:e.id;function On(e){try{for(mn=0;mn{r._d&&la(-1);let i=jn(t),a=ia.length,o;try{o=e(...n)}finally{for(let e=ia.length;e>a;e--)sa();jn(i),r._d&&la(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Nn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o1)return n&&v(t)?t.call(r&&r.proxy):t}}function In(){return!!(Na()||Qr)}var Ln=Symbol.for(`v-scx`),Rn=()=>Fn(Ln);function zn(e,t){return Vn(e,null,t)}function Bn(e,t,n){return Vn(e,t,n)}function Vn(e,t,n=i){let{immediate:r,deep:a,flush:s,once:c}=n,l=u({},n),d=t&&r||!t&&s!==`post`,f;if(za){if(s===`sync`){let e=Rn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=o,e.resume=o,e.pause=o,e}}let p=Ma;l.call=(e,t,n)=>un(e,p,t,n);let m=!1;s===`post`?l.scheduler=e=>{Ai(e,p&&p.suspense)}:s!==`sync`&&(m=!0,l.scheduler=(e,t)=>{t?e():Sn(e)}),l.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=sn(e,t,l);return za&&(f?f.push(h):d&&h()),h}function Hn(e,t,n){let r=this.proxy,i=y(e)?e.includes(`.`)?Un(r,e):()=>r[e]:e.bind(r,r),a;v(t)?a=t:(a=t.handler,n=t);let o=Ia(this),s=Vn(i,a.bind(r),n);return o(),s}function Un(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,Kn=Symbol(`_leaveCb`);function qn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,qn(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Jn(e,t){return v(e)?u({name:e.name},t,{setup:e}):e}function Yn(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Xn(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Zn=new WeakMap;function Qn(e,t,n,r,a=!1){if(m(e)){e.forEach((e,i)=>Qn(e,t&&(m(t)?t[i]:t),n,r,a));return}if(er(r)&&!a){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Qn(e,t,n,r.component.subTree);return}let o=r.shapeFlag&4?Ja(r.component):r.el,c=a?null:o,{i:l,r:u}=e,f=t&&t.r,h=l.refs===i?l.refs={}:l.refs,g=l.setupState,_=Vt(g),b=g===i?s:e=>!Xn(h,e)&&p(_,e),x=(e,t)=>!(t&&Xn(h,t));if(f!=null&&f!==u){if($n(t),y(f))h[f]=null,b(f)&&(g[f]=null);else if(Gt(f)){let e=t;x(f,e.k)&&(f.value=null),e.k&&(h[e.k]=null)}}if(v(u))ln(u,l,12,[c,h]);else{let t=y(u),r=Gt(u);if(t||r){let i=()=>{if(e.f){let n=t?b(u)?g[u]:h[u]:x(u)||!e.k?u.value:h[e.k];if(a)m(n)&&d(n,o);else if(m(n))n.includes(o)||n.push(o);else if(t)h[u]=[o],b(u)&&(g[u]=h[u]);else{let t=[o];x(u,e.k)&&(u.value=t),e.k&&(h[e.k]=t)}}else t?(h[u]=c,b(u)&&(g[u]=c)):r&&(x(u,e.k)&&(u.value=c),e.k&&(h[e.k]=c))};if(c){let t=()=>{i(),Zn.delete(e)};t.id=-1,Zn.set(e,t),Ai(t,n)}else $n(e),i()}}}function $n(e){let t=Zn.get(e);t&&(t.flags|=8,Zn.delete(e))}se().requestIdleCallback,se().cancelIdleCallback;var er=e=>!!e.type.__asyncLoader,tr=e=>e.type.__isKeepAlive;function nr(e,t){ir(e,`a`,t)}function rr(e,t){ir(e,`da`,t)}function ir(e,t,n=Ma){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(or(t,r,n),n){let e=n.parent;for(;e&&e.parent;)tr(e.parent.vnode)&&ar(r,t,n,e),e=e.parent}}function ar(e,t,n,r){let i=or(t,e,r,!0);pr(()=>{d(r[t],i)},n)}function or(e,t,n=Ma,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Re();let i=Ia(n),a=un(t,n,e,r);return i(),ze(),a};return r?i.unshift(a):i.push(a),a}}var sr=e=>(t,n=Ma)=>{(!za||e===`sp`)&&or(e,(...e)=>t(...e),n)},cr=sr(`bm`),lr=sr(`m`),ur=sr(`bu`),dr=sr(`u`),fr=sr(`bum`),pr=sr(`um`),mr=sr(`sp`),hr=sr(`rtg`),gr=sr(`rtc`);function _r(e,t=Ma){or(`ec`,e,t)}var vr=`components`;function yr(e,t){return xr(vr,e,!0,t)||e}var br=Symbol.for(`v-ndc`);function xr(e,t,n=!0,r=!1){let i=kn||Ma;if(i){let n=i.type;if(e===vr){let e=Ya(n,!1);if(e&&(e===t||e===j(t)||e===te(j(t))))return n}let a=Sr(i[e]||n[e],t)||Sr(i.appContext[e],t);return!a&&r?n:a}}function Sr(e,t){return e&&(e[t]||e[j(t)]||e[te(j(t))])}function Cr(e,t,n={},r,i,a){if(kn.ce||kn.parent&&er(kn.parent)&&kn.parent.ce){let e=a!=null&&n.key==null?u({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),oa(),fa(ea,null,[va(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=ia.length;oa();let c;try{let i=o&&wr(o(n)),s=n.key||a||i&&i.key;c=fa(ea,{key:(s&&!b(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=ia.length;e>s;e--)sa();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function wr(e){return e.some(e=>!pa(e)||!(e.type===na||e.type===ea&&!wr(e.children)))?e:null}var Tr=e=>e?Ra(e)?Ja(e):Tr(e.parent):null,Er=u(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Tr(e.parent),$root:e=>Tr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>zr(e),$forceUpdate:e=>e.f||=()=>{Sn(e.update)},$nextTick:e=>e.n||=bn.bind(e.proxy),$watch:e=>Hn.bind(e)}),Dr=(e,t)=>e!==i&&!e.__isScriptSetup&&p(e,t),Or={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else if(Dr(r,t))return s[t]=1,r[t];else if(a!==i&&p(a,t))return s[t]=2,a[t];else if(p(o,t))return s[t]=3,o[t];else if(n!==i&&p(n,t))return s[t]=4,n[t];else Pr&&(s[t]=0)}let u=Er[t],d,f;if(u)return t===`$attrs`&&Ye(e.attrs,`get`,``),u(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(n!==i&&p(n,t))return s[t]=4,n[t];if(f=l.config.globalProperties,p(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:a,ctx:o}=e;return Dr(a,t)?(a[t]=n,!0):r!==i&&p(r,t)?(r[t]=n,!0):p(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:a,props:o,type:s}},c){let l;return!!(n[c]||e!==i&&c[0]!==`$`&&p(e,c)||Dr(t,c)||p(o,c)||p(r,c)||p(Er,c)||p(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?p(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function kr(){return Ar(`useSlots`).slots}function Ar(e){let t=Na();return t.setupContext||=qa(t)}function jr(e){return m(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Mr(e,t){let n=jr(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?m(r)||v(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Nr(e){let t=Na(),n=za,r=e();La(),n&&Fa(!1);let i=()=>{Ia(t),n&&Fa(!0)},a=()=>{Na()!==t&&t.scope.off(),La(),n&&Fa(!1)};return S(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var Pr=!0;function Fr(e){let t=zr(e),n=e.proxy,r=e.ctx;Pr=!1,t.beforeCreate&&Lr(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:s,watch:c,provide:l,inject:u,created:d,beforeMount:f,mounted:p,beforeUpdate:h,updated:g,activated:_,deactivated:y,beforeDestroy:b,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:E,renderTriggered:D,errorCaptured:O,serverPrefetch:k,expose:A,inheritAttrs:j,components:ee,directives:M,filters:te}=t;if(u&&Ir(u,r,null),s)for(let e in s){let t=s[e];v(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);x(t)&&(e.data=Mt(t))}if(Pr=!0,a)for(let e in a){let t=a[e],i=Za({get:v(t)?t.bind(n,n):v(t.get)?t.get.bind(n,n):o,set:!v(t)&&v(t.set)?t.set.bind(n):o});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(c)for(let e in c)Rr(c[e],r,n,e);if(l){let e=v(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{Pn(t,e[t])})}d&&Lr(d,e,`c`);function N(e,t){m(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(N(cr,f),N(lr,p),N(ur,h),N(dr,g),N(nr,_),N(rr,y),N(_r,O),N(gr,E),N(hr,D),N(fr,S),N(pr,w),N(mr,k),m(A))if(A.length){let t=e.exposed||={};A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};T&&e.render===o&&(e.render=T),j!=null&&(e.inheritAttrs=j),ee&&(e.components=ee),M&&(e.directives=M),k&&Yn(e)}function Ir(e,t,n=o){m(e)&&(e=Wr(e));for(let n in e){let r=e[n],i;i=x(r)?`default`in r?Fn(r.from||n,r.default,!0):Fn(r.from||n):Fn(r),Gt(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Lr(e,t,n){un(m(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Rr(e,t,n,r){let i=r.includes(`.`)?Un(n,r):()=>n[r];if(y(e)){let n=t[e];v(n)&&Bn(i,n)}else if(v(e))Bn(i,e.bind(n));else if(x(e))if(m(e))e.forEach(e=>Rr(e,t,n,r));else{let r=v(e.handler)?e.handler.bind(n):t[e.handler];v(r)&&Bn(i,r,e)}}function zr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Br(c,e,o,!0)),Br(c,t,o)),x(t)&&a.set(t,c),c}function Br(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Br(e,a,n,!0),i&&i.forEach(t=>Br(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Vr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Vr={data:Hr,props:qr,emits:qr,methods:Kr,computed:Kr,beforeCreate:Gr,created:Gr,beforeMount:Gr,mounted:Gr,beforeUpdate:Gr,updated:Gr,beforeDestroy:Gr,beforeUnmount:Gr,destroyed:Gr,unmounted:Gr,activated:Gr,deactivated:Gr,errorCaptured:Gr,serverPrefetch:Gr,components:Kr,directives:Kr,watch:Jr,provide:Hr,inject:Ur};function Hr(e,t){return t?e?function(){return u(v(e)?e.call(this,this):e,v(t)?t.call(this,this):t)}:t:e}function Ur(e,t){return Kr(Wr(e),Wr(t))}function Wr(e){if(m(e)){let t={};for(let n=0;nt===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${j(t)}Modifiers`]||e[`${M(t)}Modifiers`];function ei(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||i,a=n,o=t.startsWith(`update:`),s=o&&$r(r,t.slice(7));s&&(s.trim&&(a=n.map(e=>y(e)?e.trim():e)),s.number&&(a=n.map(ie)));let c,l=r[c=N(t)]||r[c=N(j(t))];!l&&o&&(l=r[c=N(M(t))]),l&&un(l,e,6,a);let u=r[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,un(u,e,6,a)}}var ti=new WeakMap;function ni(e,t,n=!1){let r=n?ti:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!v(e)){let r=e=>{let n=ni(e,t,!0);n&&(s=!0,u(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(x(e)&&r.set(e,null),null):(m(a)?a.forEach(e=>o[e]=null):u(o,a),x(e)&&r.set(e,o),o)}function ri(e,t){return!e||!c(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),p(e,t[0].toLowerCase()+t.slice(1))||p(e,M(t))||p(e,t))}function ii(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=jn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=wa(u.call(t,e,d,f,m,p,h)),y=s}else{let e=t;v=wa(e.length>1?e(f,{attrs:s,slots:o,emit:c}):e(f,null)),y=t.props?s:oi(s)}}catch(t){ia.length=0,dn(t,e,1),v=va(na)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(l)&&(y=si(y,a)),b=xa(b,y,!1,!0))}return n.dirs&&(b=xa(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&qn(b,n.transition),v=b,jn(_),v}function ai(e,t=!0){let n;for(let t=0;t{let t;for(let n in e)(n===`class`||n===`style`||c(n))&&((t||={})[n]=e[n]);return t},si=(e,t)=>{let n={};for(let r in e)(!l(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ci(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?li(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(fi),mi=e=>Object.getPrototypeOf(e)===fi;function hi(e,t,n,r=!1){let i={},a=pi();e.propsDefaults=Object.create(null),_i(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:Nt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function gi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=Vt(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{d=!0;let[n,r]=bi(e,t,!0);u(c,n),r&&l.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!s&&!d)return x(e)&&r.set(e,a),a;if(m(s))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Ci=e=>m(e)?e.map(wa):[wa(e)],wi=(e,t,n)=>{if(t._n)return t;let r=Mn((...e)=>Ci(t(...e)),n);return r._c=!1,r},Ti=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Si(n))continue;let i=e[n];if(v(i))t[n]=wi(n,i,r);else if(i!=null){let e=Ci(i);t[n]=()=>e}}},Ei=(e,t)=>{let n=Ci(t);e.slots.default=()=>n},Di=(e,t,n)=>{for(let r in t)(n||!Si(r))&&(e[r]=t[r])},Oi=(e,t,n)=>{let r=e.slots=pi();if(e.vnode.shapeFlag&32){let e=t._;e?(Di(r,t,n),n&&re(r,`_`,e,!0)):Ti(t,r)}else t&&Ei(e,t)},ki=(e,t,n)=>{let{vnode:r,slots:a}=e,o=!0,s=i;if(r.shapeFlag&32){let e=t._;e?n&&e===1?o=!1:Di(a,t,n):(o=!t.$stable,Ti(t,a)),s=t}else t&&(Ei(e,t),s={default:1});if(o)for(let e in a)!Si(e)&&s[e]==null&&delete a[e]},Ai=Zi;function ji(e){return Mi(e)}function Mi(e,t){let n=se();n.__VUE__=!0;let{insert:r,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=o,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!ma(e,t)&&(r=me(e),le(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case ta:y(e,t,n,r);break;case na:b(e,t,n,r);break;case ra:e??x(t,n,r,o);break;case ea:ee(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?M(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,_e)}u!=null&&i?Qn(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Qn(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=u(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=d(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),k(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,a,o,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,o,m&&m.is,m),h&8?p(d,e.children):h&16&&D(e.children,d,null,i,a,Ni(e,o),s,u),_&&Nn(e,null,i,`created`),E(d,e,e.scopeId,s,i),m){for(let e in m)e!==`value`&&!O(e)&&c(d,e,null,m[e],o,i);`value`in m&&c(d,`value`,null,m.value,o),(f=m.onVnodeBeforeMount)&&Oa(f,i,e)}_&&Nn(e,null,i,`beforeMount`);let v=Fi(a,g);v&&g.beforeEnter(d),r(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&Ai(()=>{try{f&&Oa(f,i,e),v&&g.enter(d),_&&Nn(e,null,i,`mounted`)}finally{}},a)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||i,h=t.props||i,g;if(n&&Pi(n,!1),(g=h.onVnodeBeforeUpdate)&&Oa(g,n,t,e),f&&Nn(t,e,n,`beforeUpdate`),n&&Pi(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?A(e.dynamicChildren,d,l,n,r,Ni(t,a),o):s||ie(e,t,l,null,n,r,Ni(t,a),o,!1),u>0){if(u&16)j(l,m,h,n,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=t.dynamicProps;for(let t=0;t{g&&Oa(g,n,t,e),f&&Nn(t,e,n,`updated`)},r)},A=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(t!==n){if(t!==i)for(let i in t)!O(i)&&!(i in n)&&c(e,i,t[i],null,a,r);for(let i in n){if(O(i))continue;let o=n[i],s=t[i];o!==s&&i!==`value`&&c(e,i,s,o,a,r)}`value`in n&&c(e,`value`,t.value,n.value,a)}},ee=(e,t,n,i,a,o,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(r(d,n,i),r(f,n,i),D(t.children||[],n,f,a,o,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(A(e.dynamicChildren,m,n,a,o,s,c),(t.key!=null||a&&t===a.subTree)&&Ii(e,t,!0)):ie(e,t,n,f,a,o,s,c,l)},M=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):te(t,n,r,i,a,o,c):N(e,t,c)},te=(e,t,n,r,i,a,o)=>{let s=e.component=ja(e,r,i);if(tr(e)&&(s.ctx.renderer=_e),Ba(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,P,o),!e.el){let r=s.subTree=va(na);b(null,r,t,n),e.placeholder=r.el}}else P(s,e,t,n,i,a,o)},N=(e,t,n)=>{let r=t.component=e.component;if(ci(e,t,n))if(r.asyncDep&&!r.asyncResolved){re(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},P=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Ri(e);if(n){t&&(t.el=c.el,re(e,t,o)),n.asyncDep.then(()=>{Ai(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Pi(e,!1),t?(t.el=c.el,re(e,t,o)):t=c,n&&ne(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Oa(d,s,t,c),Pi(e,!0);let f=ii(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),me(p),e,i,a),t.el=f.el,u===null&&di(e,f.el),r&&Ai(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Ai(()=>Oa(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=er(t);if(Pi(e,!1),l&&ne(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Oa(o,d,t),Pi(e,!0),s&&ye){let t=()=>{e.subTree=ii(e),ye(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=ii(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Ai(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Ai(()=>Oa(o,d,e),i)}(t.shapeFlag&256||d&&er(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Ai(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Te(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Sn(u),Pi(e,!0),l()},re=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,gi(e,t.props,r,n),ki(e,t.children,n),Re(),Tn(e),ze()},ie=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){oe(l,d,n,r,i,a,o,s,c);return}else if(f&256){ae(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&pe(l,i,a),d!==l&&p(n,d)):u&16?m&16?oe(l,d,n,r,i,a,o,s,c):pe(l,i,a,!0):(u&8&&p(n,``),m&16&&D(d,n,r,i,a,o,s,c))},ae=(e,t,n,r,i,o,s,c,l)=>{e||=a,t||=a;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;pd?pe(e,i,o,!0,!1,f):D(t,n,r,i,o,s,c,l,f)},oe=(e,t,n,r,i,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],a=t[u]=l?Ta(t[u]):wa(t[u]);if(ma(r,a))v(r,a,n,null,i,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],a=t[p]=l?Ta(t[p]):wa(t[p]);if(ma(r,a))v(r,a,n,null,i,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,a=ep)for(;u<=f;)le(e[u],i,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Ta(t[u]):wa(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u=b){le(r,i,o,!0);continue}let a;if(r.key!=null)a=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&ma(r,t[_])){a=_;break}a===void 0?le(r,i,o,!0):(C[a-h]=u+1,a>=S?S=a:x=!0,v(r,t[a],n,null,i,o,s,c,l),y++)}let w=x?Li(C):a;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,a=t[e],f=t[e+1],p=e+1{let{el:o,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){ce(e.component.subTree,t,n,i);return}if(d&128){e.suspense.move(t,n,i);return}if(d&64){c.move(e,t,n,_e);return}if(c===ea){r(o,t,n);for(let e=0;el.enter(o),a));else{let{leave:i,delayLeave:a,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(o):r(o,t,n)},d=()=>{let e=o._isLeaving||!!o[Kn];o._isLeaving&&o[Kn](!0),l.persisted&&!e?u():i(o,()=>{u(),c&&c()})};a?a(o,u,d):d()}else r(o,t,n)},le=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Re(),Qn(s,null,n,e,!0),ze()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!er(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Oa(_,t,e),u&6)fe(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Nn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,_e,r):l&&!l.hasOnce&&(a!==ea||d>0&&d&64)?pe(l,t,n,!1,!0):(a===ea&&d&384||!i&&u&16)&&pe(c,t,n),r&&ue(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Ai(()=>{_&&Oa(_,t,e),h&&Nn(e,null,t,`unmounted`),v&&(e.el=null)},n)},ue=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===ea){de(n,r);return}if(t===ra){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},de=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},fe=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;zi(c),zi(l),r&&ne(r),i.stop(),a&&(a.flags|=8,le(o,e,t,n)),s&&Ai(s,t),Ai(()=>{e.isUnmounted=!0},t)},pe=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return me(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Wn];return n?h(n):t},he=!1,ge=(e,t,n)=>{let r;e==null?t._vnode&&(le(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,he||=(he=!0,Tn(r),En(),!1)},_e={p:v,um:le,m:ce,r:ue,mt:te,mc:D,pc:ie,pbc:A,n:me,o:e},ve,ye;return t&&([ve,ye]=t(_e)),{render:ge,hydrate:ve,createApp:Zr(ge,ve)}}function Ni({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Pi({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Fi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ii(e,t,n=!1){let r=e.children,i=t.children;if(m(r)&&m(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Ri(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ri(t)}function zi(e){if(e)for(let t=0;te.__isSuspense,Hi=0,Ui={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)Gi(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Ki(e,t,n,r,i,o,s,c,l)}},hydrate:Ji,normalize:Yi};function Wi(e,t){let n=e.props&&e.props[t];v(n)&&n()}function Gi(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=qi(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(Wi(e,`onPending`),Wi(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),Qi(f,e.ssFallback)):f.resolve(!1,!0)}function Ki(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,ma(h,f)?(c(h,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():g&&(_||(c(m,p,n,r,i,null,a,o,s),Qi(d,p)))):(d.pendingId=Hi++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():(c(m,p,n,r,i,null,a,o,s),Qi(d,p))):m&&ma(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&ma(m,f))c(m,f,n,r,i,d,a,o,s),Qi(d,f);else if(Wi(t,`onPending`),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=Hi++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function qi(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=$i(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?ae(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Hi++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),wn(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&Ai(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,Qi(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){y.effects.push(...c),S=!0;break}y=y.parent}!S&&!g&&wn(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!n&&t.resolve()),Wi(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;Wi(t,`onFallback`);let o=m(n),l=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(d(null,e,i,o,r,null,a,s,c),Qi(x,e))},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{dn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;La(),e.asyncResolved=!0;let{vnode:s}=e;Ha(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),di(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function Ji(e,t,n,r,i,a,o,s,c){let l=t.suspense=qi(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function Yi(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=Xi(r?n.default:n),e.ssFallback=r?Xi(n.fallback):va(na)}function Xi(e){let t;if(v(e)){let n=ca&&e._c;n&&(e._d=!1,oa()),e=e(),n&&(e._d=!0,t=aa,sa())}return m(e)&&(e=ai(e)),e=wa(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function Zi(e,t){t&&t.pendingBranch?m(e)?t.effects.push(...e):t.effects.push(e):wn(e)}function Qi(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,di(r,i))}function $i(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var ea=Symbol.for(`v-fgt`),ta=Symbol.for(`v-txt`),na=Symbol.for(`v-cmt`),ra=Symbol.for(`v-stc`),ia=[],aa=null;function oa(e=!1){ia.push(aa=e?null:[])}function sa(){ia.pop(),aa=ia[ia.length-1]||null}var ca=1;function la(e,t=!1){ca+=e,e<0&&aa&&t&&(aa.hasOnce=!0)}function ua(e){return e.dynamicChildren=ca>0?aa||a:null,sa(),ca>0&&aa&&aa.push(e),e}function da(e,t,n,r,i,a){return ua(_a(e,t,n,r,i,a,!0))}function fa(e,t,n,r,i){return ua(va(e,t,n,r,i,!0))}function pa(e){return e?e.__v_isVNode===!0:!1}function ma(e,t){return e.type===t.type&&e.key===t.key}var ha=({key:e})=>e??null,ga=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:y(e)||Gt(e)||v(e)?{i:kn,r:e,k:t,f:!!n}:e);function _a(e,t=null,n=null,r=0,i=null,a=e===ea?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ha(t),ref:t&&ga(t),scopeId:An,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:kn};return s?(Ea(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=y(n)?8:16),ca>0&&!o&&aa&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&aa.push(c),c}var va=ya;function ya(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===br)&&(e=na),pa(e)){let r=xa(e,t,!0);return n&&Ea(r,n),ca>0&&!a&&aa&&(r.shapeFlag&6?aa[aa.indexOf(e)]=r:aa.push(r)),r.patchFlag=-2,r}if(Xa(e)&&(e=e.__vccOpts),t){t=ba(t);let{class:e,style:n}=t;e&&!y(e)&&(t.class=pe(e)),x(n)&&(Bt(n)&&!m(n)&&(n=u({},n)),t.style=ce(n))}let o=y(e)?1:Vi(e)?128:Gn(e)?64:x(e)?4:v(e)?2:0;return _a(e,t,n,r,i,o,a,!0)}function ba(e){return e?Bt(e)||mi(e)?u({},e):e:null}function xa(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Da(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&ha(l),ref:t&&t.ref?n&&a?m(a)?a.concat(ga(t)):[a,ga(t)]:ga(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ea?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&xa(e.ssContent),ssFallback:e.ssFallback&&xa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&qn(u,c.clone(u)),u}function Sa(e=` `,t=0){return va(ta,null,e,t)}function Ca(e=``,t=!1){return t?(oa(),fa(na,null,e)):va(na,null,e)}function wa(e){return e==null||typeof e==`boolean`?va(na):m(e)?va(ea,null,e.slice()):pa(e)?Ta(e):va(ta,null,String(e))}function Ta(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:xa(e)}function Ea(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(m(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Ea(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!mi(t)?t._ctx=kn:r===3&&kn&&(kn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(v(t)){if(r&65){Ea(e,{default:t});return}t={default:t,_ctx:kn},n=32}else t=String(t),r&64?(n=16,t=[Sa(t)]):n=8;e.children=t,e.shapeFlag|=n}function Da(...e){let t={};for(let n=0;nMa||kn,Pa,Fa;{let e=se(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Pa=t(`__VUE_INSTANCE_SETTERS__`,e=>Ma=e),Fa=t(`__VUE_SSR_SETTERS__`,e=>za=e)}var Ia=e=>{let t=Ma;return Pa(e),e.scope.on(),()=>{e.scope.off(),Pa(t)}},La=()=>{Ma&&Ma.scope.off(),Pa(null)};function Ra(e){return e.vnode.shapeFlag&4}var za=!1;function Ba(e,t=!1,n=!1){t&&Fa(t);let{props:r,children:i}=e.vnode,a=Ra(e);hi(e,r,a,t),Oi(e,i,n||t);let o=a?Va(e,t):void 0;return t&&Fa(!1),o}function Va(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Or);let{setup:r}=n;if(r){Re();let n=e.setupContext=r.length>1?qa(e):null,i=Ia(e),a=ln(r,e,0,[e.props,n]),o=S(a);if(ze(),i(),(o||e.sp)&&!er(e)&&Yn(e),o){if(a.then(La,La),t)return a.then(n=>{Ha(e,n,t)}).catch(t=>{dn(t,e,0)});e.asyncDep=a}else Ha(e,a,t)}else Ga(e,t)}function Ha(e,t,n){v(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:x(t)&&(e.setupState=$t(t)),Ga(e,n)}var Ua,Wa;function Ga(e,t,n){let r=e.type;if(!e.render){if(!t&&Ua&&!r.render){let t=r.template||zr(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Ua(t,u(u({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||o,Wa&&Wa(e)}{let t=Ia(e);Re();try{Fr(e)}finally{ze(),t()}}}var Ka={get(e,t){return Ye(e,`get`,``),e[t]}};function qa(e){return{attrs:new Proxy(e.attrs,Ka),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Ja(e){return e.exposed?e.exposeProxy||=new Proxy($t(Ht(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Er)return Er[n](e)},has(e,t){return t in e||t in Er}}):e.proxy}function Ya(e,t=!0){return v(e)?e.displayName||e.name:e.name||t&&e.__name}function Xa(e){return v(e)&&`__vccOpts`in e}var Za=(e,t)=>tn(e,t,za);function Qa(e,t,n){try{la(-1);let r=arguments.length;return r===2?x(t)&&!m(t)?pa(t)?va(e,null,[t]):va(e,t):va(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&pa(n)&&(n=[n]),va(e,t,n))}finally{la(1)}}var $a=`3.5.40`,eo=void 0,to=typeof window<`u`&&window.trustedTypes;if(to)try{eo=to.createPolicy(`vue`,{createHTML:e=>e})}catch{}var no=eo?e=>eo.createHTML(e):e=>e,ro=`http://www.w3.org/2000/svg`,io=`http://www.w3.org/1998/Math/MathML`,ao=typeof document<`u`?document:null,oo=ao&&ao.createElement(`template`),so={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?ao.createElementNS(ro,e):t===`mathml`?ao.createElementNS(io,e):n?ao.createElement(e,{is:n}):ao.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ao.createTextNode(e),createComment:e=>ao.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ao.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{oo.innerHTML=no(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=oo.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},co=Symbol(`_vtc`);function lo(e,t,n){let r=e[co];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var uo=Symbol(`_vod`),fo=Symbol(`_vsh`),po=Symbol(``),mo=/(?:^|;)\s*display\s*:/;function ho(e,t,n){let r=e.style,i=y(n),a=!1;if(n&&!i){if(t)if(y(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??_o(r,t,``)}else for(let e in t)n[e]??_o(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?_o(r,i,``):xo(e,i,!y(t)&&t?t[i]:void 0,o)||_o(r,i,o)}}else if(i){if(t!==n){let e=r[po];e&&(n+=`;`+e),r.cssText=n,a=mo.test(n)}}else t&&e.removeAttribute(`style`);uo in e&&(e[uo]=a?r.display:``,e[fo]&&(r.display=`none`))}var go=/\s*!important$/;function _o(e,t,n){if(m(n))n.forEach(n=>_o(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=bo(e,t);go.test(n)?e.setProperty(M(r),n.replace(go,``),`important`):e[r]=n}}var vo=[`Webkit`,`Moz`,`ms`],yo={};function bo(e,t){let n=yo[t];if(n)return n;let r=j(t);if(r!==`filter`&&r in e)return yo[t]=r;r=te(r);for(let n=0;nMo||=(No.then(()=>Mo=0),Date.now());function Fo(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(m(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Lo=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?lo(e,r,o):t===`style`?ho(e,n,r):c(t)?l(t)||Oo(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Ro(e,t,r,o))?(wo(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Co(e,t,r,o,a,t!==`value`)):e._isVueCE&&(zo(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!y(r)))?wo(e,j(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Co(e,t,r,o))};function Ro(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Io(t)&&v(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Io(t)&&y(n)?!1:t in e}function zo(e,t){let n=e._def.props;if(!n)return!1;let r=j(t);return Array.isArray(n)?n.some(e=>j(e)===r):Object.keys(n).some(e=>j(e)===r)}var Bo=u({patchProp:Lo},so),Vo;function Ho(){return Vo||=ji(Bo)}var Uo=((...e)=>{let t=Ho().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Go(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Wo(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Wo(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Go(e){return y(e)?document.querySelector(e):e}var Ko={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},qo={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Jo=`attached`,Yo=`detached`,Xo=1e3,Zo=1001,Qo=1002,$o=1003,es=1004,ts=1004,ns=1005,rs=1005,is=1006,as=1007,os=1007,ss=1008,cs=1008,ls=1009,us=1010,ds=1011,fs=1012,ps=1013,ms=1014,hs=1015,gs=1016,_s=1017,vs=1018,ys=1020,bs=35902,xs=35899,Ss=1021,Cs=1022,ws=1023,Ts=1026,Es=1027,Ds=1028,Os=1029,ks=1030,As=1031,js=1032,Ms=1033,Ns=33776,Ps=33777,Fs=33778,Is=33779,Ls=35840,Rs=35841,zs=35842,Bs=35843,Vs=36196,Hs=37492,Us=37496,Ws=37488,Gs=37489,Ks=37490,qs=37491,Js=37808,Ys=37809,Xs=37810,Zs=37811,Qs=37812,$s=37813,ec=37814,tc=37815,nc=37816,rc=37817,ic=37818,ac=37819,oc=37820,sc=37821,cc=36492,lc=36494,uc=36495,dc=36283,fc=36284,pc=36285,mc=36286,hc=2200,gc=2201,_c=2202,vc=2300,yc=2301,bc=2302,xc=2303,Sc=2400,Cc=2401,wc=2402,Tc=2500,Ec=2501,Dc=3200,Oc=3201,kc=3202,Ac=3203,jc=`srgb`,Mc=`srgb-linear`,Nc=`linear`,Pc=`srgb`,Fc=7680,Ic=7681,Lc=7682,Rc=7683,zc=34055,Bc=34056,Vc=5386,Hc=35044,Uc=35048,Wc=35040,Gc=35045,Kc=35049,qc=35041,Jc=35046,Yc=35050,Xc=35042,Zc=`300 es`,Qc=2e3,$c=2001,el={COMPUTE:`compute`,RENDER:`render`},tl={PERSPECTIVE:`perspective`,LINEAR:`linear`,FLAT:`flat`},nl={NORMAL:`normal`,CENTROID:`centroid`,SAMPLE:`sample`,FIRST:`first`,EITHER:`either`},rl={TEXTURE_COMPARE:`depthTextureCompare`};function il(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var al={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function ol(e,t){return new al[e](t)}function sl(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function cl(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function ll(){let e=cl(`canvas`);return e.style.display=`block`,e}var ul={},dl=null;function fl(e){dl=e}function pl(){return dl}function ml(...e){let t=`THREE.`+e.shift();dl?dl(`log`,t,...e):console.log(t,...e)}function hl(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let 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 R(...e){e=hl(e);let t=`THREE.`+e.shift();if(dl)dl(`warn`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}function z(...e){e=hl(e);let t=`THREE.`+e.shift();if(dl)dl(`error`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.error(n.getError(t)):console.error(t,...e)}}function gl(...e){let t=e.join(` `);t in ul||(ul[t]=!0,R(...e))}function _l(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var vl={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3},yl=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n!==void 0&&n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+bl[e>>16&255]+bl[e>>24&255]+`-`+bl[t&255]+bl[t>>8&255]+`-`+bl[t>>16&15|64]+bl[t>>24&255]+`-`+bl[n&63|128]+bl[n>>8&255]+`-`+bl[n>>16&255]+bl[n>>24&255]+bl[r&255]+bl[r>>8&255]+bl[r>>16&255]+bl[r>>24&255]).toLowerCase()}function B(e,t,n){return Math.max(t,Math.min(n,e))}function Tl(e,t){return(e%t+t)%t}function El(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function Dl(e,t,n){return e===t?0:(n-e)/(t-e)}function Ol(e,t,n){return(1-n)*e+n*t}function kl(e,t,n,r){return Ol(e,t,1-Math.exp(-n*r))}function Al(e,t=1){return t-Math.abs(Tl(e,t*2)-t)}function jl(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Ml(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Nl(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Pl(e,t){return e+Math.random()*(t-e)}function Fl(e){return e*(.5-Math.random())}function Il(e){e!==void 0&&(xl=e);let t=xl+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Ll(e){return e*Sl}function Rl(e){return e*Cl}function zl(e){return(e&e-1)==0&&e!==0}function Bl(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Vl(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function Hl(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:R(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function Ul(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 Error(`THREE.MathUtils: Invalid component type.`)}}function V(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`THREE.MathUtils: Invalid component type.`)}}var Wl={DEG2RAD:Sl,RAD2DEG:Cl,generateUUID:wl,clamp:B,euclideanModulo:Tl,mapLinear:El,inverseLerp:Dl,lerp:Ol,damp:kl,pingpong:Al,smoothstep:jl,smootherstep:Ml,randInt:Nl,randFloat:Pl,randFloatSpread:Fl,seededRandom:Il,degToRad:Ll,radToDeg:Rl,isPowerOfTwo:zl,ceilPowerOfTwo:Bl,floorPowerOfTwo:Vl,setQuaternionFromProperEuler:Hl,normalize:V,denormalize:Ul},H=class e{static{e.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 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 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){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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=B(this.x,e.x,t.x),this.y=B(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=B(this.x,e,t),this.y=B(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,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){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(B(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,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){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Gl=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,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,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:R(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(B(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),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 e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*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}},U=class e{static{e.prototype.isVector3=!0}constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,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 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 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(ql.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ql.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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=B(this.x,e.x,t.x),this.y=B(this.y,e.y,t.y),this.z=B(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=B(this.x,e,t),this.y=B(this.y,e,t),this.z=B(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,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,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Kl.copy(this).projectOnVector(e),this.sub(Kl)}reflect(e){return this.sub(Kl.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(B(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}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,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}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(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},Kl=new U,ql=new Gl,W=class e{static{e.prototype.isMatrix3=!0}constructor(e,t,n,r,i,a,o,s,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,i,a,o,s,c)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let 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){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let 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(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,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){let 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,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return gl(`Matrix3: .scale() is deprecated. Use .makeScale() instead.`),this.premultiply(Jl.makeScale(e,t)),this}rotate(e){return gl(`Matrix3: .rotate() is deprecated. Use .makeRotation() instead.`),this.premultiply(Jl.makeRotation(-e)),this}translate(e,t){return gl(`Matrix3: .translate() is deprecated. Use .makeTranslation() instead.`),this.premultiply(Jl.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){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Jl=new W,Yl=new W().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Xl=new W().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Zl(){let e={enabled:!0,workingColorSpace:Mc,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=$l(e.r),e.g=$l(e.g),e.b=$l(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=eu(e.r),e.g=eu(e.g),e.b=eu(e.b)),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===``?Nc: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,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return gl(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return gl(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Mc]:{primaries:t,whitePoint:r,transfer:Nc,toXYZ:Yl,fromXYZ:Xl,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:jc},outputColorSpaceConfig:{drawingBufferColorSpace:jc}},[jc]:{primaries:t,whitePoint:r,transfer:Pc,toXYZ:Yl,fromXYZ:Xl,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:jc}}}),e}var Ql=Zl();function $l(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function eu(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var tu,nu=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{tu===void 0&&(tu=cl(`canvas`)),tu.width=e.width,tu.height=e.height;let t=tu.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=tu}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=cl(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(su).x}get height(){return this.source.getSize(su).y}get depth(){return this.source.getSize(su).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(let t in e){let n=e[t];if(n===void 0){R(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){R(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Xo:e.x-=Math.floor(e.x);break;case Zo:e.x=e.x<0?0:1;break;case Qo:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Xo:e.y-=Math.floor(e.y);break;case Zo:e.y=e.y<0?0:1;break;case Qo:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};cu.DEFAULT_IMAGE=null,cu.DEFAULT_MAPPING=300,cu.DEFAULT_ANISOTROPY=1;var lu=class e{static{e.prototype.isVector4=!0}constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}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,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,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 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 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=e.w===void 0?1:e.w,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){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,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);let 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,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);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,n=e.textures.length;t>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}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=e.pivot===null?null:e.pivot.clone(),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)),t===!0)for(let t=0;t.025?(c.inputState.pinching=!1,this.dispatchEvent({type:`pinchend`,handedness:e.handedness,target:this})):!c.inputState.pinching&&o<=.015&&(c.inputState.pinching=!0,this.dispatchEvent({type:`pinchstart`,handedness:e.handedness,target:this}))}else s!==null&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),i!==null&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1,s.eventsEnabled&&s.dispatchEvent({type:`gripUpdated`,data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&i!==null&&(r=i),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Wu)))}return o!==null&&(o.visible=r!==null),s!==null&&(s.visible=i!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){let n=new Uu;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}},Ku={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},qu={h:0,s:0,l:0},Ju={h:0,s:0,l:0};function Yu(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var K=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=jc){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Ql.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=Ql.workingColorSpace){return this.r=e,this.g=t,this.b=n,Ql.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=Ql.workingColorSpace){if(e=Tl(e,1),t=B(t,0,1),n=B(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Yu(i,r,e+1/3),this.g=Yu(i,r,e),this.b=Yu(i,r,e-1/3)}return Ql.colorSpaceToWorking(this,r),this}setStyle(e,t=jc){function n(t){t!==void 0&&parseFloat(t)<1&&R(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:R(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);R(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=jc){let n=Ku[e.toLowerCase()];return n===void 0?R(`Color: Unknown color `+e):this.setHex(n,t),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=$l(e.r),this.g=$l(e.g),this.b=$l(e.b),this}copyLinearToSRGB(e){return this.r=eu(e.r),this.g=eu(e.g),this.b=eu(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=jc){return Ql.workingToColorSpace(Xu.copy(this),e),Math.round(B(Xu.r*255,0,255))*65536+Math.round(B(Xu.g*255,0,255))*256+Math.round(B(Xu.b*255,0,255))}getHexString(e=jc){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Ql.workingColorSpace){Ql.workingToColorSpace(Xu.copy(this),t);let n=Xu.r,r=Xu.g,i=Xu.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}},ed=new U,td=new U,nd=new U,rd=new U,id=new U,ad=new U,od=new U,sd=new U,cd=new U,ld=new U,ud=new lu,dd=new lu,fd=new lu,pd=class e{constructor(e=new U,t=new U,n=new U){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),ed.subVectors(e,t),r.cross(ed);let i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){ed.subVectors(r,t),td.subVectors(n,t),nd.subVectors(e,t);let a=ed.dot(ed),o=ed.dot(td),s=ed.dot(nd),c=td.dot(td),l=td.dot(nd),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,rd)!==null&&rd.x>=0&&rd.y>=0&&rd.x+rd.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,rd)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,rd.x),s.addScaledVector(a,rd.y),s.addScaledVector(o,rd.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return ud.setScalar(0),dd.setScalar(0),fd.setScalar(0),ud.fromBufferAttribute(e,t),dd.fromBufferAttribute(e,n),fd.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(ud,i.x),a.addScaledVector(dd,i.y),a.addScaledVector(fd,i.z),a}static isFrontFacing(e,t,n,r){return ed.subVectors(n,t),td.subVectors(e,t),ed.cross(td).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),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 ed.subVectors(this.c,this.b),td.subVectors(this.a,this.b),ed.cross(td).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;id.subVectors(r,n),ad.subVectors(i,n),sd.subVectors(e,n);let s=id.dot(sd),c=ad.dot(sd);if(s<=0&&c<=0)return t.copy(n);cd.subVectors(e,r);let l=id.dot(cd),u=ad.dot(cd);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(id,a);ld.subVectors(e,i);let f=id.dot(ld),p=ad.dot(ld);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(ad,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return od.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(od,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(id,a).addScaledVector(ad,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},md=class{constructor(e=new U(1/0,1/0,1/0),t=new U(-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,n=e.length;t=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,gd),gd.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(wd),Td.subVectors(this.max,wd),vd.subVectors(e.a,wd),yd.subVectors(e.b,wd),bd.subVectors(e.c,wd),xd.subVectors(yd,vd),Sd.subVectors(bd,yd),Cd.subVectors(vd,bd);let t=[0,-xd.z,xd.y,0,-Sd.z,Sd.y,0,-Cd.z,Cd.y,xd.z,0,-xd.x,Sd.z,0,-Sd.x,Cd.z,0,-Cd.x,-xd.y,xd.x,0,-Sd.y,Sd.x,0,-Cd.y,Cd.x,0];return!Od(t,vd,yd,bd,Td)||(t=[1,0,0,0,1,0,0,0,1],!Od(t,vd,yd,bd,Td))?!1:(Ed.crossVectors(xd,Sd),t=[Ed.x,Ed.y,Ed.z],Od(t,vd,yd,bd,Td))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,gd).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(gd).length()*.5),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()?this:(hd[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),hd[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),hd[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),hd[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),hd[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),hd[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),hd[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),hd[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(hd),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}},hd=[new U,new U,new U,new U,new U,new U,new U,new U],gd=new U,_d=new md,vd=new U,yd=new U,bd=new U,xd=new U,Sd=new U,Cd=new U,wd=new U,Td=new U,Ed=new U,Dd=new U;function Od(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Dd.fromArray(e,a);let o=i.x*Math.abs(Dd.x)+i.y*Math.abs(Dd.y)+i.z*Math.abs(Dd.z),s=t.dot(Dd),c=n.dot(Dd),l=r.dot(Dd);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var kd=Ad();function Ad(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function jd(e){Math.abs(e)>65504&&R(`DataUtils.toHalfFloat(): Value out of range.`),e=B(e,-65504,65504),kd.floatView[0]=e;let t=kd.uint32View[0],n=t>>23&511;return kd.baseTable[n]+((t&8388607)>>kd.shiftTable[n])}function Md(e){let t=e>>10;return kd.uint32View[0]=kd.mantissaTable[kd.offsetTable[t]+(e&1023)]+kd.exponentTable[t],kd.floatView[0]}var Nd=class{static toHalfFloat(e){return jd(e)}static fromHalfFloat(e){return Md(e)}},Pd=new U,Fd=new H,Id=0,Ld=class extends yl{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Id++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=Hc,this.updateRanges=[],this.gpuType=hs,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&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,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rthis.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*=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;qd.subVectors(e,this.center);let t=qd.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(qd,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Jd.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(qd.copy(e.center).add(Jd)),this.expandByPoint(qd.copy(e.center).sub(Jd))),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}},Xd=0,Zd=new G,Qd=new Hu,$d=new U,ef=new md,tf=new md,nf=new U,J=class e extends yl{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Xd++}),this.uuid=wl(),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(il(e)?Wd:Hd)(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 this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){let t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let t=new W().getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this._transformed=!0,this}applyQuaternion(e){return Zd.makeRotationFromQuaternion(e),this.applyMatrix4(Zd),this}rotateX(e){return Zd.makeRotationX(e),this.applyMatrix4(Zd),this}rotateY(e){return Zd.makeRotationY(e),this.applyMatrix4(Zd),this}rotateZ(e){return Zd.makeRotationZ(e),this.applyMatrix4(Zd),this}translate(e,t,n){return Zd.makeTranslation(e,t,n),this.applyMatrix4(Zd),this}scale(e,t,n){return Zd.makeScale(e,t,n),this.applyMatrix4(Zd),this}lookAt(e){return Qd.lookAt(e),Qd.updateMatrix(),this.applyMatrix4(Qd.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter($d).negate(),this.translate($d.x,$d.y,$d.z),this}setFromPoints(e){let t=this.getAttribute(`position`);if(t===void 0){let t=[];for(let n=0,r=e.length;nt.count&&R(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new md);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){z(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0&&this._transformed!==!0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.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;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){R(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){R(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector2&&n&&n.isVector2||r&&r.isEuler&&n&&n.isEuler||r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}fromJSON(e,t){if(e.uuid!==void 0&&(this.uuid=e.uuid),e.name!==void 0&&(this.name=e.name),e.color!==void 0&&this.color!==void 0&&this.color.setHex(e.color),e.roughness!==void 0&&(this.roughness=e.roughness),e.metalness!==void 0&&(this.metalness=e.metalness),e.sheen!==void 0&&(this.sheen=e.sheen),e.sheenColor!==void 0&&(this.sheenColor=new K().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(this.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&this.emissive!==void 0&&this.emissive.setHex(e.emissive),e.specular!==void 0&&this.specular!==void 0&&this.specular.setHex(e.specular),e.specularIntensity!==void 0&&(this.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&this.specularColor!==void 0&&this.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(this.shininess=e.shininess),e.clearcoat!==void 0&&(this.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(this.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(this.dispersion=e.dispersion),e.iridescence!==void 0&&(this.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(this.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(this.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(this.transmission=e.transmission),e.thickness!==void 0&&(this.thickness=e.thickness),e.attenuationDistance!==void 0&&(this.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&this.attenuationColor!==void 0&&this.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(this.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(this.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(this.fog=e.fog),e.flatShading!==void 0&&(this.flatShading=e.flatShading),e.blending!==void 0&&(this.blending=e.blending),e.combine!==void 0&&(this.combine=e.combine),e.side!==void 0&&(this.side=e.side),e.shadowSide!==void 0&&(this.shadowSide=e.shadowSide),e.opacity!==void 0&&(this.opacity=e.opacity),e.transparent!==void 0&&(this.transparent=e.transparent),e.alphaTest!==void 0&&(this.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(this.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(this.depthFunc=e.depthFunc),e.depthTest!==void 0&&(this.depthTest=e.depthTest),e.depthWrite!==void 0&&(this.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(this.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(this.blendSrc=e.blendSrc),e.blendDst!==void 0&&(this.blendDst=e.blendDst),e.blendEquation!==void 0&&(this.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(this.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(this.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(this.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&this.blendColor!==void 0&&this.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(this.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(this.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(this.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(this.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(this.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(this.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(this.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(this.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(this.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(this.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(this.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(this.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(this.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(this.rotation=e.rotation),e.linewidth!==void 0&&(this.linewidth=e.linewidth),e.dashSize!==void 0&&(this.dashSize=e.dashSize),e.gapSize!==void 0&&(this.gapSize=e.gapSize),e.scale!==void 0&&(this.scale=e.scale),e.polygonOffset!==void 0&&(this.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(this.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(this.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(this.dithering=e.dithering),e.alphaToCoverage!==void 0&&(this.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(this.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(this.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(this.allowOverride=e.allowOverride),e.visible!==void 0&&(this.visible=e.visible),e.toneMapped!==void 0&&(this.toneMapped=e.toneMapped),e.userData!==void 0&&(this.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors==`number`?this.vertexColors=e.vertexColors>0:this.vertexColors=e.vertexColors),e.size!==void 0&&(this.size=e.size),e.sizeAttenuation!==void 0&&(this.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(this.map=t[e.map]||null),e.matcap!==void 0&&(this.matcap=t[e.matcap]||null),e.alphaMap!==void 0&&(this.alphaMap=t[e.alphaMap]||null),e.bumpMap!==void 0&&(this.bumpMap=t[e.bumpMap]||null),e.bumpScale!==void 0&&(this.bumpScale=e.bumpScale),e.normalMap!==void 0&&(this.normalMap=t[e.normalMap]||null),e.normalMapType!==void 0&&(this.normalMapType=e.normalMapType),e.normalScale!==void 0){let t=e.normalScale;Array.isArray(t)===!1&&(t=[t,t]),this.normalScale=new H().fromArray(t)}return e.displacementMap!==void 0&&(this.displacementMap=t[e.displacementMap]||null),e.displacementScale!==void 0&&(this.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(this.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(this.roughnessMap=t[e.roughnessMap]||null),e.metalnessMap!==void 0&&(this.metalnessMap=t[e.metalnessMap]||null),e.emissiveMap!==void 0&&(this.emissiveMap=t[e.emissiveMap]||null),e.emissiveIntensity!==void 0&&(this.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(this.specularMap=t[e.specularMap]||null),e.specularIntensityMap!==void 0&&(this.specularIntensityMap=t[e.specularIntensityMap]||null),e.specularColorMap!==void 0&&(this.specularColorMap=t[e.specularColorMap]||null),e.envMap!==void 0&&(this.envMap=t[e.envMap]||null),e.envMapRotation!==void 0&&this.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(this.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(this.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(this.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(this.lightMap=t[e.lightMap]||null),e.lightMapIntensity!==void 0&&(this.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(this.aoMap=t[e.aoMap]||null),e.aoMapIntensity!==void 0&&(this.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(this.gradientMap=t[e.gradientMap]||null),e.clearcoatMap!==void 0&&(this.clearcoatMap=t[e.clearcoatMap]||null),e.clearcoatRoughnessMap!==void 0&&(this.clearcoatRoughnessMap=t[e.clearcoatRoughnessMap]||null),e.clearcoatNormalMap!==void 0&&(this.clearcoatNormalMap=t[e.clearcoatNormalMap]||null),e.clearcoatNormalScale!==void 0&&(this.clearcoatNormalScale=new H().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(this.iridescenceMap=t[e.iridescenceMap]||null),e.iridescenceThicknessMap!==void 0&&(this.iridescenceThicknessMap=t[e.iridescenceThicknessMap]||null),e.transmissionMap!==void 0&&(this.transmissionMap=t[e.transmissionMap]||null),e.thicknessMap!==void 0&&(this.thicknessMap=t[e.thicknessMap]||null),e.anisotropyMap!==void 0&&(this.anisotropyMap=t[e.anisotropyMap]||null),e.sheenColorMap!==void 0&&(this.sheenColorMap=t[e.sheenColorMap]||null),e.sheenRoughnessMap!==void 0&&(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;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,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){e===!0&&this.version++}},lf=class extends cf{constructor(e){super(),this.isSpriteMaterial=!0,this.type=`SpriteMaterial`,this.color=new K(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}},uf,df=new U,ff=new U,pf=new U,mf=new H,hf=new H,gf=new G,_f=new U,vf=new U,yf=new U,bf=new H,xf=new H,Sf=new H,Cf=class extends Hu{constructor(e=new lf){if(super(),this.isSprite=!0,this.type=`Sprite`,uf===void 0){uf=new J;let e=new rf(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);uf.setIndex([0,1,2,0,2,3]),uf.setAttribute(`position`,new of(e,3,0,!1)),uf.setAttribute(`uv`,new of(e,2,3,!1))}this.geometry=uf,this.material=e,this.center=new H(.5,.5),this.count=1}raycast(e,t){e.camera===null&&z(`Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.`),ff.setFromMatrixScale(this.matrixWorld),gf.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),pf.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&ff.multiplyScalar(-pf.z);let n=this.material.rotation,r,i;n!==0&&(i=Math.cos(n),r=Math.sin(n));let a=this.center;wf(_f.set(-.5,-.5,0),pf,a,ff,r,i),wf(vf.set(.5,-.5,0),pf,a,ff,r,i),wf(yf.set(.5,.5,0),pf,a,ff,r,i),bf.set(0,0),xf.set(1,0),Sf.set(1,1);let o=e.ray.intersectTriangle(_f,vf,yf,!1,df);if(o===null&&(wf(vf.set(-.5,.5,0),pf,a,ff,r,i),xf.set(0,1),o=e.ray.intersectTriangle(_f,yf,vf,!1,df),o===null))return;let s=e.ray.origin.distanceTo(df);se.far||t.push({distance:s,point:df.clone(),uv:pd.getInterpolation(df,_f,vf,yf,bf,xf,Sf,new H),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}};function wf(e,t,n,r,i,a){mf.subVectors(e,n).addScalar(.5).multiply(r),i===void 0?hf.copy(mf):(hf.x=a*mf.x-i*mf.y,hf.y=i*mf.x+a*mf.y),e.copy(t),e.x+=hf.x,e.y+=hf.y,e.applyMatrix4(gf)}var Tf=new U,Ef=new U,Df=class extends Hu{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type=`LOD`,Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);let t=e.levels;for(let e=0,n=t.length;e0){let n,r;for(n=1,r=t.length;n0){Tf.setFromMatrixPosition(this.matrixWorld);let n=e.ray.origin.distanceTo(Tf);this.getObjectForDistance(n).raycast(e,t)}}update(e){let t=this.levels;if(t.length>1){Tf.setFromMatrixPosition(e.matrixWorld),Ef.setFromMatrixPosition(this.matrixWorld);let n=Tf.distanceTo(Ef)/e.zoom;t[0].object.visible=!0;let r,i;for(r=1,i=t.length;r=e)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(kf).addScaledVector(Af,d),f}intersectSphere(e,t){Of.subVectors(e.center,this.origin);let n=Of.dot(this.direction),r=Of.dot(Of)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Of)!==null}intersectTriangle(e,t,n,r,i){Mf.subVectors(t,e),Nf.subVectors(n,e),Pf.crossVectors(Mf,Nf);let a=this.direction.dot(Pf),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;jf.subVectors(this.origin,e);let s=o*this.direction.dot(Nf.crossVectors(jf,Nf));if(s<0)return null;let c=o*this.direction.dot(Mf.cross(jf));if(c<0||s+c>a)return null;let l=-o*jf.dot(Pf);return l<0?null:this.at(l/a,i)}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)}},If=class extends cf{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new K(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 Tu,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}},Lf=new G,Rf=new Ff,zf=new Yd,Bf=new U,Vf=new U,Hf=new U,Uf=new U,Wf=new U,Gf=new U,Kf=new U,qf=new U,Jf=class extends Hu{constructor(e=new J,t=new If){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),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))&&(Lf.copy(i).invert(),Rf.copy(e.ray).applyMatrix4(Lf),!(n.boundingBox!==null&&Rf.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Rf)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:qf.clone(),object:e}}function Xf(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Vf),e.getVertexPosition(c,Hf),e.getVertexPosition(l,Uf);let u=Yf(e,t,n,r,Vf,Hf,Uf,Kf);if(u){let e=new U;pd.getBarycoord(Kf,Vf,Hf,Uf,e),i&&(u.uv=pd.getInterpolatedAttribute(i,s,c,l,e,new H)),a&&(u.uv1=pd.getInterpolatedAttribute(a,s,c,l,e,new H)),o&&(u.normal=pd.getInterpolatedAttribute(o,s,c,l,e,new U),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new U,materialIndex:0};pd.getNormal(Vf,Hf,Uf,t.normal),u.face=t,u.barycoord=e}return u}var Zf=new lu,Qf=new lu,$f=new lu,ep=new lu,tp=new G,np=new U,rp=new Yd,ip=new G,ap=new Ff,op=class extends Jf{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type=`SkinnedMesh`,this.bindMode=Jo,this.bindMatrix=new G,this.bindMatrixInverse=new G,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){let e=this.geometry;this.boundingBox===null&&(this.boundingBox=new md),this.boundingBox.makeEmpty();let t=e.getAttribute(`position`);for(let e=0;e1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){let t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<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){let n=t||Cp.getNormalMatrix(e),r=this.coplanarPoint(xp).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),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)}},Tp=new Yd,Ep=new H(.5,.5),Dp=new U,Op=class{constructor(e=new wp,t=new wp,n=new wp,r=new wp,i=new wp,a=new wp){this.planes=[e,t,n,r,i,a]}set(e,t,n,r,i,a){let o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(e){let t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Qc,n=!1){let r=this.planes,i=e.elements,a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14],b=i[15];if(r[0].setComponents(c-a,f-l,g-p,b-_).normalize(),r[1].setComponents(c+a,f+l,g+p,b+_).normalize(),r[2].setComponents(c+o,f+u,g+m,b+v).normalize(),r[3].setComponents(c-o,f-u,g-m,b-v).normalize(),n)r[4].setComponents(s,d,h,y).normalize(),r[5].setComponents(c-s,f-d,g-h,b-y).normalize();else if(r[4].setComponents(c-s,f-d,g-h,b-y).normalize(),t===2e3)r[5].setComponents(c+s,f+d,g+h,b+y).normalize();else if(t===2001)r[5].setComponents(s,d,h,y).normalize();else throw Error(`THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: `+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Tp.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{let t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Tp.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Tp)}intersectsSprite(e){return Tp.center.set(0,0,0),Tp.radius=.7071067811865476+Ep.distanceTo(e.center),Tp.applyMatrix4(e.matrixWorld),this.intersectsSphere(Tp)}intersectsSphere(e){let t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,Dp.y=r.normal.y>0?e.max.y:e.min.y,Dp.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Dp)<0)return!1}return!0}containsPoint(e){let t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}},kp=new G,Ap=class e{constructor(){this.coordinateSystem=Qc,this._frustums=[],this._count=0}setFromArrayCamera(e){let t=e.cameras,n=this._frustums;for(let e=0;e=i.length&&i.push({start:-1,count:-1,z:-1,index:-1});let o=i[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=r}reset(){this.list.length=0,this.index=0}},Fp=new G,Ip=new K(1,1,1),Lp=new Op,Rp=new Ap,zp=new md,Bp=new Yd,Vp=new U,Hp=new U,Up=new U,Wp=new Pp,Gp=new Jf,Kp=[];function qp(e,t,n=0){let r=t.itemSize;if(e.isInterleavedBufferAttribute||e.array.constructor!==t.array.constructor){let i=e.count;for(let a=0;a65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new Ld(e,1))}this._geometryInitialized=!0}}_validateGeometry(e){let t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw Error(`THREE.BatchedMesh: All geometries must consistently have "index".`);for(let n in t.attributes){if(!e.hasAttribute(n))throw Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);let r=e.getAttribute(n),i=t.getAttribute(n);if(r.itemSize!==i.itemSize||r.normalized!==i.normalized)throw Error(`THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.`)}}validateInstanceId(e){let t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){let t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new md);let e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw Error(`THREE.BatchedMesh: Maximum item count reached.`);let t={visible:!0,active:!0,geometryIndex:e},n=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(jp),n=this._availableInstanceIds.shift(),this._instanceInfo[n]=t):(n=this._instanceInfo.length,this._instanceInfo.push(t));let r=this._matricesTexture;Fp.identity().toArray(r.image.data,n*16),r.needsUpdate=!0;let i=this._colorsTexture;return i&&(Ip.toArray(i.image.data,n*4),i.needsUpdate=!0),this._visibilityChanged=!0,n}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);let r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},i=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute(`position`).count:t;let a=e.getIndex();if(a!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?a.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw Error(`THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.`);let o;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(jp),o=this._availableGeometryIds.shift(),i[o]=r):(o=this._geometryCount,this._geometryCount++,i.push(r)),this.setGeometryAt(o,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,o}setGeometryAt(e,t){if(e>=this._geometryCount)throw Error(`THREE.BatchedMesh: Maximum geometry count reached.`);this._validateGeometry(t);let n=this.geometry,r=n.getIndex()!==null,i=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(r&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw Error(`THREE.BatchedMesh: Reserved space not large enough for provided geometry.`);let s=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=t.getAttribute(`position`).count;for(let e in n.attributes){let r=t.getAttribute(e),i=n.getAttribute(e);qp(r,i,s);let a=r.itemSize;for(let e=r.count,t=c;e=t.length||t[e].active===!1)return this;let n=this._instanceInfo;for(let t=0,r=n.length;tt).sort((e,t)=>n[e].vertexStart-n[t].vertexStart),i=this.geometry;for(let a=0,o=n.length;a=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){let e=new md,t=n.index,i=n.attributes.position;for(let n=r.start,a=r.start+r.count;n=this._geometryCount)return null;let n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){let t=new Yd;this.getBoundingBoxAt(e,zp),zp.getCenter(t.center);let i=n.index,a=n.attributes.position,o=0;for(let e=r.start,n=r.start+r.count;ee.active);if(Math.max(...n.map(e=>e.vertexStart+e.reservedVertexCount))>e)throw Error(`THREE.BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(e=>e.indexStart+e.reservedIndexCount))>t)throw Error(`THREE.BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);let r=this.geometry;r.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new J,this._initializeGeometry(r));let i=this.geometry;r.index&&Jp(r.index.array,i.index.array);for(let e in r.attributes)Jp(r.attributes[e].array,i.attributes[e].array)}raycast(e,t){let n=this._instanceInfo,r=this._geometryInfo,i=this.matrixWorld,a=this.geometry;Gp.material=this.material,Gp.geometry.index=a.index,Gp.geometry.attributes=a.attributes,Gp.geometry.boundingBox===null&&(Gp.geometry.boundingBox=new md),Gp.geometry.boundingSphere===null&&(Gp.geometry.boundingSphere=new Yd);for(let a=0,o=n.length;a({...e,boundingBox:e.boundingBox===null?null:e.boundingBox.clone(),boundingSphere:e.boundingSphere===null?null:e.boundingSphere.clone()})),this._instanceInfo=e._instanceInfo.map(e=>({...e})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,i){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;let a=r.getIndex(),o=a===null?1:a.array.BYTES_PER_ELEMENT,s=1;i.wireframe&&(s=2,o=r.attributes.position.count>65535?4:2);let c=this._instanceInfo,l=this._multiDrawStarts,u=this._multiDrawCounts,d=this._geometryInfo,f=this.perObjectFrustumCulled,p=this._indirectTexture,m=p.image.data,h=n.isArrayCamera?Rp:Lp;f&&(n.isArrayCamera?h.setFromArrayCamera(n):(Fp.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),h.setFromProjectionMatrix(Fp,n.coordinateSystem,n.reversedDepth)));let g=0;if(this.sortObjects){Fp.copy(this.matrixWorld).invert(),Vp.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Fp),Hp.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Fp);for(let e=0,t=c.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;er)return;nm.applyMatrix4(e.matrixWorld);let c=t.ray.origin.distanceTo(nm);if(!(ct.far))return{distance:c,point:rm.clone().applyMatrix4(e.matrixWorld),index:o,face:null,faceIndex:null,barycoord:null,object:e}}var om=new U,sm=new U,cm=class extends im{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type=`LineSegments`}computeLineDistances(){let e=this.geometry;if(e.index===null){let t=e.attributes.position,n=[];for(let e=0,r=t.count;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;ei.far)return;a.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:o})}}var _m=class extends cu{constructor(e,t,n,r,i=is,a=is,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;let l=this;function u(){l.needsUpdate=!0,l._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u)}`requestVideoFrameCallback`in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(u))}clone(){return new this.constructor(this.image).copy(this)}update(){let e=this.image;!(`requestVideoFrameCallback`in e)&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}},vm=class extends _m{constructor(e,t,n,r,i,a,o,s){super({},e,t,n,r,i,a,o,s),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}},ym=class extends cu{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=$o,this.minFilter=$o,this.generateMipmaps=!1,this.needsUpdate=!0}},bm=class extends cu{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(null,a,o,s,c,l,r,i,u,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}},xm=class extends bm{constructor(e,t,n,r,i,a){super(e,t,n,i,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=Zo,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}},Sm=class extends bm{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,301),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}},Cm=class extends cu{constructor(e=[],t=301,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,s,c,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}},wm=class extends cu{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},Tm=class extends cu{constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r,i,a,o,s,c),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;let l=e?e.parentNode:null;l!==null&&`requestPaint`in l&&(l.onpaint=()=>{this.needsUpdate=!0},l.requestPaint())}dispose(){let e=this.image?this.image.parentNode:null;e!==null&&`onpaint`in e&&(e.onpaint=null),super.dispose()}},Em=class extends cu{constructor(e,t,n=ms,r,i,a,o=$o,s=$o,c,l=Ts,u=1){if(l!==1026&&l!==1027)throw Error(`THREE.DepthTexture: format must be either THREE.DepthFormat or THREE.DepthStencilFormat`);super({width:e,height:t,depth:u},r,i,a,o,s,l,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new iu(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){let t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}},Dm=class extends Em{constructor(e,t=ms,n=301,r,i,a=$o,o=$o,s,c=Ts){let l={width:e,height:e,depth:1},u=[l,l,l,l,l,l];super(e,e,t,n,r,i,a,o,s,c),this.image=u,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}},Om=class extends cu{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}},km=class e extends J{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new q(c,3)),this.setAttribute(`normal`,new q(l,3)),this.setAttribute(`uv`,new q(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new U;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e0){let e=(_-1)*m;for(let t=0;t0&&v(!0),t>0&&v(!1)),this.setIndex(l),this.setAttribute(`position`,new q(u,3)),this.setAttribute(`normal`,new q(d,3)),this.setAttribute(`uv`,new q(f,2));function _(){let a=new U,_=new U,v=0,y=(t-e)/n;for(let c=0;c<=i;c++){let l=[],g=c/i,v=g*(t-e)+e;for(let e=0;e<=r;e++){let t=e/r,i=t*s+o,c=Math.sin(i),m=Math.cos(i);_.x=v*c,_.y=-g*n+h,_.z=v*m,u.push(_.x,_.y,_.z),a.set(c,y,m).normalize(),d.push(a.x,a.y,a.z),f.push(t,1-g),l.push(p++)}m.push(l)}for(let n=0;n0||r!==0)&&(l.push(a,o,c),v+=3),(t>0||r!==i-1)&&(l.push(o,s,c),v+=3)}c.addGroup(g,v,0),g+=v}function v(n){let i=p,a=new H,m=new U,_=0,v=n===!0?e:t,y=n===!0?1:-1;for(let e=1;e<=r;e++)u.push(0,h*y,0),d.push(0,y,0),f.push(.5,.5),p++;let b=p;for(let e=0;e<=r;e++){let t=e/r*s+o,n=Math.cos(t),i=Math.sin(t);m.x=v*i,m.y=h*y,m.z=v*n,u.push(m.x,m.y,m.z),d.push(0,y,0),a.x=n*.5+.5,a.y=i*.5*y+.5,f.push(a.x,a.y),p++}for(let e=0;e.9&&Math.min(t,n,r)<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),r<.2&&(a[e+4]+=1))}}function d(e){i.push(e.x,e.y,e.z)}function f(t,n){let r=t*3;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function p(){let e=new U,t=new U,n=new U,r=new U,o=new H,s=new H,c=new H;for(let l=0,u=0;l0)s=r-1;else{s=r;break}if(r=s,n[r]===a)return r/(i-1);let l=n[r],u=n[r+1]-l,d=(a-l)/u;return(r+d)/(i-1)}getTangent(e,t){let n=1e-4,r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);let a=this.getPoint(r),o=this.getPoint(i),s=t||(a.isVector2?new H:new U);return s.copy(o).sub(a).normalize(),s}getTangentAt(e,t){let n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){let n=new U,r=[],i=[],a=[],o=new U,s=new G;for(let t=0;t<=e;t++){let n=t/e;r[t]=this.getTangentAt(n,new U)}i[0]=new U,a[0]=new U;let c=Number.MAX_VALUE,l=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>2**-52){o.normalize();let e=Math.acos(B(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(t===!0){let t=Math.acos(B(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){let e={metadata:{version:4.7,type:`Curve`,generator:`Curve.toJSON`}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},Hm=class extends Vm{constructor(e=0,t=0,n=1,r=1,i=0,a=Math.PI*2,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type=`EllipseCurve`,this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(e,t=new H){let n=t,r=Math.PI*2,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<2**-52;for(;i<0;)i+=r;for(;i>r;)i-=r;i<2**-52&&(i=a?0:r),this.aClockwise===!0&&!a&&(i===r?i=-r:i-=r);let o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*e-r*t+this.aX,c=n*t+r*e+this.aY}return n.set(s,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){let e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}},Um=class extends Hm{constructor(e,t,n,r,i,a){super(e,t,n,n,r,i,a),this.isArcCurve=!0,this.type=`ArcCurve`}};function Wm(){let e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){let c=(t-e)/a-(n-e)/(a+o)+(n-t)/o,l=(n-t)/o-(r-t)/(o+s)+(r-n)/s;c*=o,l*=o,i(t,n,c,l)},calc:function(i){let a=i*i,o=a*i;return e+t*i+n*a+r*o}}}var Gm=new U,Km=new U,qm=new Wm,Jm=new Wm,Ym=new Wm,Xm=class extends Vm{constructor(e=[],t=!1,n=`centripetal`,r=.5){super(),this.isCatmullRomCurve3=!0,this.type=`CatmullRomCurve3`,this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new U){let n=t,r=this.points,i=r.length,a=(i-+!this.closed)*e,o=Math.floor(a),s=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:s===0&&o===i-1&&(o=i-2,s=1);let c,l;this.closed||o>0?c=r[(o-1)%i]:(Km.subVectors(r[0],r[1]).add(r[0]),c=Km);let u=r[o%i],d=r[(o+1)%i];if(this.closed||o+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(Zm(o,s.x,c.x,l.x,u.x),Zm(o,s.y,c.y,l.y,u.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){let e=r[i]-n,a=this.curves[i],o=a.getLength(),s=o===0?0:1-e/o;return a.getPointAt(s,t)}i++}return null}getLength(){let e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let e=[],t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){let e=c.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(c);let l=c.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){let e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}},_h=class extends gh{constructor(e){super(e),this.uuid=wl(),this.type=`Shape`,this.holes=[]}getPointsHoles(e){let t=[];for(let n=0,r=this.holes.length;n80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;at&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return xh(a,o,n,s,c,l,0),o}function yh(e,t,n,r,i){let a;if(i===Xh(e,t,n,r)>0)for(let i=t;i=t;i-=r)a=qh(i/r|0,e[i],e[i+1],a);return a&&zh(a,a.next)&&(Jh(a),a=a.next),a}function bh(e,t){if(!e)return e;t||=e;let n=e,r;do if(r=!1,!n.steiner&&(zh(n,n.next)||Rh(n.prev,n,n.next)===0)){if(Jh(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function xh(e,t,n,r,i,a,o){if(!e)return;!o&&a&&jh(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?Ch(e,r,i,a):Sh(e)){t.push(c.i,e.i,l.i),Jh(e),e=l.next,s=l.next;continue}if(e=l,e===s){o?o===1?(e=wh(bh(e),t),xh(e,t,n,r,i,a,2)):o===2&&Th(e,t,n,r,i,a):xh(bh(e),t,n,r,i,a,1);break}}}function Sh(e){let t=e.prev,n=e,r=e.next;if(Rh(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&Ih(i,s,a,c,o,l,m.x,m.y)&&Rh(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Ch(e,t,n,r){let i=e.prev,a=e,o=e.next;if(Rh(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=Nh(p,m,t,n,r),v=Nh(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&Ih(s,u,c,d,l,f,y.x,y.y)&&Rh(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&Ih(s,u,c,d,l,f,b.x,b.y)&&Rh(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&Ih(s,u,c,d,l,f,y.x,y.y)&&Rh(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&Ih(s,u,c,d,l,f,b.x,b.y)&&Rh(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function wh(e,t){let n=e;do{let r=n.prev,i=n.next.next;!zh(r,i)&&Bh(r,n,n.next,i)&&Wh(r,i)&&Wh(i,r)&&(t.push(r.i,n.i,i.i),Jh(n),Jh(n.next),n=e=i),n=n.next}while(n!==e);return bh(n)}function Th(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Lh(o,e)){let s=Kh(o,e);o=bh(o,o.next),s=bh(s,s.next),xh(o,t,n,r,i,a,0),xh(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function Eh(e,t,n,r){let i=[];for(let n=0,a=t.length;n=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,o=n.x=n.x&&n.x>=c&&r!==n.x&&Fh(io.x||n.x===o.x&&Ah(o,n)))&&(o=n,u=t)}n=n.next}while(n!==s);return o}function Ah(e,t){return Rh(e.prev,e,t.prev)<0&&Rh(t.next,e,e.next)<0}function jh(e,t,n,r){let i=e;do i.z===0&&(i.z=Nh(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,Mh(i)}function Mh(e){let t,n=1;do{let r=e,i;e=null;let a=null;for(t=0;r;){t++;let o=r,s=0;for(let e=0;e0||c>0&&o;)s!==0&&(c===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,s--):(i=o,o=o.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=o}a.nextZ=null,n*=2}while(t>1);return e}function Nh(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Ph(e){let t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function Ih(e,t,n,r,i,a,o,s){return!(e===o&&t===s)&&Fh(e,t,n,r,i,a,o,s)}function Lh(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Uh(e,t)&&(Wh(e,t)&&Wh(t,e)&&Gh(e,t)&&(Rh(e.prev,e,t.prev)||Rh(e,t.prev,t))||zh(e,t)&&Rh(e.prev,e,e.next)>0&&Rh(t.prev,t,t.next)>0)}function Rh(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function zh(e,t){return e.x===t.x&&e.y===t.y}function Bh(e,t,n,r){let i=Hh(Rh(e,t,n)),a=Hh(Rh(e,t,r)),o=Hh(Rh(n,r,e)),s=Hh(Rh(n,r,t));return!!(i!==a&&o!==s||i===0&&Vh(e,n,t)||a===0&&Vh(e,r,t)||o===0&&Vh(n,e,r)||s===0&&Vh(n,t,r))}function Vh(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Hh(e){return e>0?1:e<0?-1:0}function Uh(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Bh(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Wh(e,t){return Rh(e.prev,e,e.next)<0?Rh(e,t,e.next)>=0&&Rh(e,e.prev,t)>=0:Rh(e,t,e.prev)<0||Rh(e,e.next,t)<0}function Gh(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function Kh(e,t){let n=Yh(e.i,e.x,e.y),r=Yh(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function qh(e,t,n,r){let i=Yh(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Jh(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Yh(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Xh(e,t,n,r){let i=0;for(let a=t,o=n-r;a2&&e[t-1].equals(e[0])&&e.pop()}function eg(e,t){for(let n=0;n2**-52){let d=Math.sqrt(u),f=Math.sqrt(c*c+l*l),p=t.x-s/d,m=t.y+o/d,h=n.x-l/f,g=n.y+c/f,_=((h-p)*l-(g-m)*c)/(o*l-s*c);r=p+o*_-e.x,i=m+s*_-e.y;let v=r*r+i*i;if(v<=2)return new H(r,i);a=Math.sqrt(v/2)}else{let e=!1;o>2**-52?c>2**-52&&(e=!0):o<-(2**-52)?c<-(2**-52)&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new H(r/a,i/a)}let j=[];for(let e=0,t=D.length,n=t-1,r=e+1;e=0;e--){let t=e/p,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+f;for(let e=0,t=D.length;e=0;){let r=n,i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+p*2;e0)&&f.push(t,i,c),(e!==n-1||s0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;let n={};for(let e in this.extensions)this.extensions[e]===!0&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}fromJSON(e,t){if(super.fromJSON(e,t),e.uniforms!==void 0)for(let n in e.uniforms){let r=e.uniforms[n];switch(this.uniforms[n]={},r.type){case`t`:this.uniforms[n].value=t[r.value]||null;break;case`c`:this.uniforms[n].value=new K().setHex(r.value);break;case`v2`:this.uniforms[n].value=new H().fromArray(r.value);break;case`v3`:this.uniforms[n].value=new U().fromArray(r.value);break;case`v4`:this.uniforms[n].value=new lu().fromArray(r.value);break;case`m3`:this.uniforms[n].value=new W().fromArray(r.value);break;case`m4`:this.uniforms[n].value=new G().fromArray(r.value);break;default:this.uniforms[n].value=r.value}}if(e.defines!==void 0&&(this.defines=e.defines),e.vertexShader!==void 0&&(this.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(this.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(this.glslVersion=e.glslVersion),e.extensions!==void 0)for(let t in e.extensions)this.extensions[t]=e.extensions[t];return e.lights!==void 0&&(this.lights=e.lights),e.clipping!==void 0&&(this.clipping=e.clipping),this}},kg=class extends Og{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type=`RawShaderMaterial`}},Ag=class extends cf{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type=`MeshStandardMaterial`,this.defines={STANDARD:``},this.color=new K(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new K(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Tu,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:``},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},jg=class extends Ag{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:``,PHYSICAL:``},this.type=`MeshPhysicalMaterial`,this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new H(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return B(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new K(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new K(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new K(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:``,PHYSICAL:``},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}},Mg=class extends cf{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type=`MeshPhongMaterial`,this.color=new K(16777215),this.specular=new K(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new K(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Tu,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},Ng=class extends cf{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:``},this.type=`MeshToonMaterial`,this.color=new K(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new K(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,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.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Pg=class extends cf{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type=`MeshNormalMaterial`,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}},Fg=class extends cf{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type=`MeshLambertMaterial`,this.color=new K(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new K(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Tu,this.combine=0,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.flatShading=!1,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.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,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.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}},Ig=class extends cf{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type=`MeshDepthMaterial`,this.depthPacking=Dc,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}},Lg=class extends cf{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}},Rg=class extends cf{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:``},this.type=`MeshMatcapMaterial`,this.color=new K(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:``},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}},zg=class extends Xp{constructor(e){super(),this.isLineDashedMaterial=!0,this.type=`LineDashedMaterial`,this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};function Bg(e,t){return!e||e.constructor===t?e:typeof t.BYTES_PER_ELEMENT==`number`?new t(e):Array.prototype.slice.call(e)}function Vg(e){function t(t,n){return e[t]-e[n]}let n=e.length,r=Array(n);for(let e=0;e!==n;++e)r[e]=e;return r.sort(t),r}function Hg(e,t,n){let r=e.length,i=new e.constructor(r);for(let a=0,o=0;o!==r;++a){let r=n[a]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i}function Ug(e,t,n,r){let i=1,a=e[0];for(;a!==void 0&&a[r]===void 0;)a=e[i++];if(a===void 0)return;let o=a[r];if(o!==void 0)if(Array.isArray(o))do o=a[r],o!==void 0&&(t.push(a.time),n.push(...o)),a=e[i++];while(a!==void 0);else if(o.toArray!==void 0)do o=a[r],o!==void 0&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++];while(a!==void 0);else do o=a[r],o!==void 0&&(t.push(a.time),n.push(o)),a=e[i++];while(a!==void 0)}function Wg(e,t,n,r,i=30){let a=e.clone();a.name=t;let o=[];for(let e=0;e=r)){c.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e=r.times[d]){let e=d*c+s,t=e+c-s;f=r.values.slice(e,t)}else{let e=r.createInterpolant(),t=s,n=c-s;e.evaluate(a),f=e.resultBuffer.slice(t,n)}i===`quaternion`&&new Gl().fromArray(f).normalize().conjugate().toArray(f);let p=o.times.length;for(let e=0;e=i)){let o=t[1];e=i)break seek}a=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--a;if(++a,i!==0||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);let e=this.getValueSize();this.times=n.slice(i,a),this.values=this.values.slice(i*e,a*e)}return this}validate(){let e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(z(`KeyframeTrack: Invalid value size in track.`,this),e=!1);let n=this.times,r=this.values,i=n.length;i===0&&(z(`KeyframeTrack: Track is empty.`,this),e=!1);let a=null;for(let t=0;t!==i;t++){let r=n[t];if(typeof r==`number`&&isNaN(r)){z(`KeyframeTrack: Time is not a valid number.`,this,t,r),e=!1;break}if(a!==null&&a>r){z(`KeyframeTrack: Out of order keys.`,this,t,r,a),e=!1;break}a=r}if(r!==void 0&&sl(r))for(let t=0,n=r.length;t!==n;++t){let n=r[t];if(isNaN(n)){z(`KeyframeTrack: Value is not a valid number.`,this,t,n),e=!1;break}}return e}optimize(){let e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===bc,i=e.length-1,a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a===e.length?(this.times=e,this.values=t):(this.times=e.slice(0,a),this.values=t.slice(0,a*n)),this}clone(){let e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}};Qg.prototype.ValueTypeName=``,Qg.prototype.TimeBufferType=Float32Array,Qg.prototype.ValueBufferType=Float32Array,Qg.prototype.DefaultInterpolation=yc;var $g=class extends Qg{constructor(e,t,n){super(e,t,n)}};$g.prototype.ValueTypeName=`bool`,$g.prototype.ValueBufferType=Array,$g.prototype.DefaultInterpolation=vc,$g.prototype.InterpolantFactoryMethodLinear=void 0,$g.prototype.InterpolantFactoryMethodSmooth=void 0;var e_=class extends Qg{constructor(e,t,n,r){super(e,t,n,r)}};e_.prototype.ValueTypeName=`color`;var t_=class extends Qg{constructor(e,t,n,r){super(e,t,n,r)}};t_.prototype.ValueTypeName=`number`;var n_=class extends qg{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){let i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t),c=e*o;for(let e=c+o;c!==e;c+=4)Gl.slerpFlat(i,0,a,c-o,a,c,s);return i}},r_=class extends Qg{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new n_(this.times,this.values,this.getValueSize(),e)}};r_.prototype.ValueTypeName=`quaternion`,r_.prototype.InterpolantFactoryMethodSmooth=void 0;var i_=class extends Qg{constructor(e,t,n){super(e,t,n)}};i_.prototype.ValueTypeName=`string`,i_.prototype.ValueBufferType=Array,i_.prototype.DefaultInterpolation=vc,i_.prototype.InterpolantFactoryMethodLinear=void 0,i_.prototype.InterpolantFactoryMethodSmooth=void 0;var a_=class extends Qg{constructor(e,t,n,r){super(e,t,n,r)}};a_.prototype.ValueTypeName=`vector`;var o_=class{constructor(e=``,t=-1,n=[],r=Tc){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=wl(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){let t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(c_(n[e]).scale(r));let i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i.userData=JSON.parse(e.userData||`{}`),i}static toJSON(e){let t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let e=0,r=n.length;e!==r;++e)t.push(Qg.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){let i=t.length,a=[];for(let e=0;e1){let e=a[1],t=r[e];t||(r[e]=t=[]),t.push(n)}}let a=[];for(let e in r)a.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return a}resetDuration(){let e=this.tracks,t=0;for(let n=0,r=e.length;n!==r;++n){let e=this.tracks[n];t=Math.max(t,e.times[e.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e{t&&t(i),this.manager.itemEnd(e)},0);return}if(m_[e]!==void 0){m_[e].push({onLoad:t,onProgress:n,onError:r});return}m_[e]=[],m_[e].push({onLoad:t,onProgress:n,onError:r});let a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?`include`:`same-origin`,signal:typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,s=this.responseType;fetch(a).then(t=>{if(t.status===200||t.status===0){if(t.status===0&&R(`FileLoader: HTTP Status 0 received.`),typeof ReadableStream>`u`||t.body===void 0||t.body.getReader===void 0)return t;let n=m_[e],r=t.body.getReader(),i=t.headers.get(`X-File-Size`)||t.headers.get(`Content-Length`),a=i?parseInt(i):0,o=a!==0,s=0,c=new ReadableStream({start(e){t();function t(){r.read().then(({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;let r=new ProgressEvent(`progress`,{lengthComputable:o,loaded:s,total:a});for(let e=0,t=n.length;e{e.error(t)})}}});return new Response(c)}else throw new h_(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`,t)}).then(e=>{switch(s){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`document`:return e.text().then(e=>new DOMParser().parseFromString(e,o));case`json`:return e.json();default:if(o===``)return e.text();{let t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then(e=>r.decode(e))}}}).then(t=>{l_.add(`file:${e}`,t);let n=m_[e];delete m_[e];for(let e=0,r=n.length;e{let n=m_[e];if(n===void 0)throw this.manager.itemError(e),t;delete m_[e];for(let e=0,r=n.length;e{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}},__=class extends p_{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new g_(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):z(t),i.manager.itemError(e)}},n,r)}parse(e){let t=[];for(let n=0;n0){i=new b_(new d_(t)),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t0){r=new b_(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t{let t=null,n=null;return e.boundingBox!==void 0&&(t=new md().fromJSON(e.boundingBox)),e.boundingSphere!==void 0&&(n=new Yd().fromJSON(e.boundingSphere)),{...e,boundingBox:t,boundingSphere:n}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(a.boundingSphere=new Yd().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(a.boundingBox=new md().fromJSON(e.boundingBox));break;case`LOD`:a=new Df;break;case`Line`:a=new im(o(e.geometry),s(e.material));break;case`LineLoop`:a=new lm(o(e.geometry),s(e.material));break;case`LineSegments`:a=new cm(o(e.geometry),s(e.material));break;case`PointCloud`:case`Points`:a=new hm(o(e.geometry),s(e.material));break;case`Sprite`:a=new Cf(s(e.material));break;case`Group`:a=new Uu;break;case`Bone`:a=new sp;break;default:a=new Hu}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix===void 0?(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)):(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.pivot!==void 0&&(a.pivot=new U().fromArray(e.pivot)),e.morphTargetDictionary!==void 0&&(a.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),e.morphTargetInfluences!==void 0&&(a.morphTargetInfluences=e.morphTargetInfluences.slice()),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.static!==void 0&&(a.static=e.static),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){let o=e.children;for(let e=0;e`u`&&R(`ImageBitmapLoader: createImageBitmap() not supported.`),typeof fetch>`u`&&R(`ImageBitmapLoader: fetch() not supported.`),this.options={premultiplyAlpha:`none`},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=``),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);let i=this,a=l_.get(`image-bitmap:${e}`);if(a!==void 0){if(i.manager.itemStart(e),a.then){a.then(n=>{av.has(a)===!0?(r&&r(av.get(a)),i.manager.itemError(e),i.manager.itemEnd(e)):(t&&t(n),i.manager.itemEnd(e))});return}setTimeout(function(){t&&t(a),i.manager.itemEnd(e)},0);return}let o={};o.credentials=this.crossOrigin===`anonymous`?`same-origin`:`include`,o.headers=this.requestHeader,o.signal=typeof AbortSignal.any==`function`?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;let s=fetch(e,o).then(function(e){return e.blob()}).then(function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:`none`}))}).then(function(n){l_.add(`image-bitmap:${e}`,n),t&&t(n),i.manager.itemEnd(e)}).catch(function(t){r&&r(t),av.set(s,t),l_.remove(`image-bitmap:${e}`),i.manager.itemError(e),i.manager.itemEnd(e)});l_.add(`image-bitmap:${e}`,s),i.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}},sv,cv=class{static getContext(){return sv===void 0&&(sv=new(window.AudioContext||window.webkitAudioContext)),sv}static setContext(e){sv=e}},lv=class extends p_{constructor(e){super(e)}load(e,t,n,r){let i=this,a=new g_(this.manager);a.setResponseType(`arraybuffer`),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(n){try{let r=n.slice(0),a=cv.getContext(),s=e+`#decode`;i.manager.itemStart(s),a.decodeAudioData(r,function(e){t(e),i.manager.itemEnd(s)}).catch(function(e){o(e),i.manager.itemEnd(s)})}catch(e){o(e)}},n,r);function o(t){r?r(t):z(t),i.manager.itemError(e)}}},uv=new G,dv=new G,fv=new G,pv=class{constructor(){this.type=`StereoCamera`,this.aspect=1,this.eyeSep=.064,this.cameraL=new L_,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new L_,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){let t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,fv.copy(e.projectionMatrix);let n=t.eyeSep/2,r=n*t.near/t.focus,i=t.near*Math.tan(Sl*t.fov*.5)/t.zoom,a,o;dv.elements[12]=-n,uv.elements[12]=n,a=-i*t.aspect+r,o=i*t.aspect+r,fv.elements[0]=2*t.near/(o-a),fv.elements[8]=(o+a)/(o-a),this.cameraL.projectionMatrix.copy(fv),a=-i*t.aspect-r,o=i*t.aspect-r,fv.elements[0]=2*t.near/(o-a),fv.elements[8]=(o+a)/(o-a),this.cameraR.projectionMatrix.copy(fv)}this.cameraL.matrix.copy(e.matrixWorld).multiply(dv),this.cameraL.matrixWorldNeedsUpdate=!0,this.cameraR.matrix.copy(e.matrixWorld).multiply(uv),this.cameraR.matrixWorldNeedsUpdate=!0}},mv=-90,hv=1,gv=class extends Hu{constructor(e,t,n){super(),this.type=`CubeCamera`,this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let r=new L_(mv,hv,e,t);r.layers=this.layers,this.add(r);let i=new L_(mv,hv,e,t);i.layers=this.layers,this.add(i);let a=new L_(mv,hv,e,t);a.layers=this.layers,this.add(a);let o=new L_(mv,hv,e,t);o.layers=this.layers,this.add(o);let s=new L_(mv,hv,e,t);s.layers=this.layers,this.add(s);let c=new L_(mv,hv,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let e=this.coordinateSystem,t=this.children.concat(),[n,r,i,a,o,s]=t;for(let e of t)this.remove(e);if(e===2e3)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else if(e===2001)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1);else throw Error(`THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: `+e);for(let e of t)this.add(e),e.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());let[i,a,o,s,c,l]=this.children,u=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let h=!1;h=e.isWebGLRenderer===!0?e.state.buffers.depth.getReversed():e.reversedDepthBuffer,e.setRenderTarget(n,0,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,i),e.setRenderTarget(n,1,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,4,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=m,e.setRenderTarget(n,5,r),h&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(u,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}},_v=class extends L_{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}},vv=class{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=yv.bind(this),e.addEventListener(`visibilitychange`,this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener(`visibilitychange`,this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e===void 0?performance.now():e)-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}};function yv(){this._document.hidden===!1&&this.reset()}var bv=new U,xv=new Gl,Sv=new U,Cv=new U,wv=new U,Tv=class extends Hu{constructor(){super(),this.type=`AudioListener`,this.context=cv.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new vv}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter===null?this.gain.disconnect(this.context.destination):(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this._timer.update();let t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(bv,xv,Sv),Cv.set(0,0,-1).applyQuaternion(xv),wv.set(0,1,0).applyQuaternion(xv),t.positionX){let e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(bv.x,e),t.positionY.linearRampToValueAtTime(bv.y,e),t.positionZ.linearRampToValueAtTime(bv.z,e),t.forwardX.linearRampToValueAtTime(Cv.x,e),t.forwardY.linearRampToValueAtTime(Cv.y,e),t.forwardZ.linearRampToValueAtTime(Cv.z,e),t.upX.linearRampToValueAtTime(wv.x,e),t.upY.linearRampToValueAtTime(wv.y,e),t.upZ.linearRampToValueAtTime(wv.z,e)}else t.setPosition(bv.x,bv.y,bv.z),t.setOrientation(Cv.x,Cv.y,Cv.z,wv.x,wv.y,wv.z)}},Ev=class extends Hu{constructor(e){super(),this.type=`Audio`,this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType=`empty`,this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType=`audioNode`,this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaNode`,this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType=`mediaStreamNode`,this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType=`buffer`,this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){R(`Audio: Audio is already playing.`);return}if(this.hasPlaybackControl===!1){R(`Audio: this Audio has no playback control.`);return}this._startedAt=this.context.currentTime+e;let t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){R(`Audio: this Audio has no playback control.`);return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress%=this.duration||this.buffer.duration),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){R(`Audio: this Audio has no playback control.`);return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}}saveOriginalState(){let e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){let e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){Gl.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){let a=this._workIndex*i;Gl.multiplyQuaternionsFlat(e,a,e,t,e,n),Gl.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,i){let a=1-r;for(let o=0;o!==i;++o){let i=t+o;e[i]=e[i]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let a=0;a!==i;++a){let i=t+a;e[i]=e[i]+e[n+a]*r}}},Pv=`\\[\\]\\.:\\/`,Fv=RegExp(`[\\[\\]\\.:\\/]`,`g`),Iv=`[^\\[\\]\\.:\\/]`,Lv=`[^`+Pv.replace(`\\.`,``)+`]`,Rv=`((?:WC+[\\/:])*)`.replace(`WC`,Iv),zv=`(WCOD+)?`.replace(`WCOD`,Lv),Bv=`(?:\\.(WC+)(?:\\[(.+)\\])?)?`.replace(`WC`,Iv),Vv=`\\.(WC+)(?:\\[(.+)\\])?`.replace(`WC`,Iv),Hv=RegExp(`^`+Rv+zv+Bv+Vv+`$`),Uv=[`material`,`materials`,`bones`,`map`],Wv=class{constructor(e,t,n){let r=n||Gv.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();let n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){let n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){let e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},Gv=class e{constructor(t,n,r){this.path=n,this.parsedPath=r||e.parseTrackName(n),this.node=e.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,n,r){return t&&t.isAnimationObjectGroup?new e.Composite(t,n,r):new e(t,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,`_`).replace(Fv,``)}static parseTrackName(e){let t=Hv.exec(e);if(t===null)throw Error(`THREE.PropertyBinding: Cannot parse trackName: `+e);let n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(`.`);if(r!==void 0&&r!==-1){let e=n.nodeName.substring(r+1);Uv.indexOf(e)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(n.propertyName===null||n.propertyName.length===0)throw Error(`THREE.PropertyBinding: can not parse propertyName from trackName: `+e);return n}static findNode(e,t){if(t===void 0||t===``||t===`.`||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){let n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){let n=function(e){for(let r=0;r=i){let a=i++,l=e[a];t[l.uuid]=c,e[c]=l,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){let t=n[e],r=t[a],i=t[c];t[c]=r,t[a]=i}}}this.nCachedObjects_=i}uncache(){let e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length,i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){let s=arguments[o].uuid,c=t[s];if(c!==void 0)if(delete t[s],c0&&(t[o.uuid]=c),e[c]=o,e.pop();for(let e=0,t=r;e!==t;++e){let t=n[e];t[c]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){let n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(r!==void 0)return i[r];let a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=l,r=s.length;n!==r;++n){let r=s[n];u[n]=new Gv(r,e,t)}return u}unsubscribe_(e){let t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){let r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=e[o];t[c]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}},qv=class{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;let i=t.tracks,a=i.length,o=Array(a),s={endingStart:Sc,endingEnd:Sc};for(let e=0;e!==a;++e){let t=i[e].createInterpolant(null);o[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._restoreTimeScale=null,this._weightInterpolant=null,this.loop=gc,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){let n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e._restoreTimeScale=e.timeScale,this._restoreTimeScale=this.timeScale,e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){let e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){let r=this._mixer,i=r.time,a=this.timeScale,o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);let s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/a,c[1]=t/a,this}stopWarping(){let e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this._restoreTimeScale=null,this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}let i=this._startTime;if(i!==null){let r=(e-i)*n;r<0||n===0?t=0:(this._startTime=null,t=n*r)}t*=this._updateTimeScale(e);let a=this._updateTime(t),o=this._updateWeight(e);if(o>0){let e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case Ec:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case Tc:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;let n=this._weightInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;let n=this._timeScaleInterpolant;if(n!==null){let r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(t===0?this.paused=!0:(this._restoreTimeScale!==null&&(t=this._restoreTimeScale),this.timeScale=t),this.stopWarping())}}return this._effectiveTimeScale=t,t}_updateTime(e){let t=this._clip.duration,n=this.loop,r=this.time+e,i=this._loopCount,a=n===_c;if(e===0)return i===-1?r:a&&(i&1)==1?t-r:r;if(n===2200){i===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break handle_stop}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e<0?-1:1})}}else{if(i===-1&&(e>=0?(i=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=t||r<0){let n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);let o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:`finished`,action:this,direction:e>0?1:-1});else{if(o===1){let t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:`loop`,action:this,loopDelta:n})}}else this._loopCount=i,this.time=r;if(a&&(i&1)==1)return t-r}return r}_setEndings(e,t,n){let r=this._interpolantSettings;n?(r.endingStart=Cc,r.endingEnd=Cc):(e?r.endingStart=this.zeroSlopeAtStart?Cc:Sc:r.endingStart=wc,t?r.endingEnd=this.zeroSlopeAtEnd?Cc:Sc:r.endingEnd=wc)}_scheduleFading(e,t,n){let r=this._mixer,i=r.time,a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);let o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}},Jv=new Float32Array(1),Yv=class extends yl{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`observe`,{detail:this}))}_bindAction(e,t){let n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];l===void 0&&(l={},c[s]=l);for(let e=0;e!==i;++e){let i=r[e],c=i.name,u=l[c];if(u!==void 0)++u.referenceCount,a[e]=u;else{if(u=a[e],u!==void 0){u._cacheIndex===null&&(++u.referenceCount,this._addInactiveBinding(u,s,c));continue}let r=t&&t._propertyBindings[e].binding.parsedPath;u=new Nv(Gv.create(n,c,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,c),a[e]=u}o[e].resultBuffer=u.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){let t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];n.useCount++===0&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){let t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){let n=t[e];--n.useCount===0&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){let t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;let t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o)t[o]._update(r,e,i,a);let o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this}setTime(e){this.time=0;for(let e=0;e=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}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))}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}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,uy).distanceTo(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}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)}},fy=new U,py=new U,my=new U,hy=new U,gy=new U,_y=new U,vy=new U,yy=class{constructor(e=new U,t=new U){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){fy.subVectors(e,this.start),py.subVectors(this.end,this.start);let n=py.dot(py);if(n===0)return 0;let r=py.dot(fy)/n;return t&&(r=B(r,0,1)),r}closestPointToPoint(e,t,n){let r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,t=_y,n=vy){let r=1e-8*1e-8,i,a,o=this.start,s=e.start,c=this.end,l=e.end;my.subVectors(c,o),hy.subVectors(l,s),gy.subVectors(o,s);let u=my.dot(my),d=hy.dot(hy),f=hy.dot(gy);if(u<=r&&d<=r)return t.copy(o),n.copy(s),t.sub(n),t.dot(t);if(u<=r)i=0,a=f/d,a=B(a,0,1);else{let e=my.dot(gy);if(d<=r)a=0,i=B(-e/u,0,1);else{let t=my.dot(hy),n=u*d-t*t;i=n===0?0:B((t*f-e*d)/n,0,1),a=(t*i+f)/d,a<0?(a=0,i=B(-e/u,0,1)):a>1&&(a=1,i=B((t-e)/u,0,1))}}return t.copy(o).addScaledVector(my,i),n.copy(s).addScaledVector(hy,a),t.distanceToSquared(n)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},by=new U,xy=class extends Hu{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type=`SpotLightHelper`;let n=new J,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1;e<32;e++,t++){let n=e/32*Math.PI*2,i=t/32*Math.PI*2;r.push(Math.cos(n),Math.sin(n),1,Math.cos(i),Math.sin(i),1)}n.setAttribute(`position`,new q(r,3));let i=new Xp({fog:!1,toneMapped:!1});this.cone=new cm(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorldNeedsUpdate=!0;let e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),by.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(by),this.color===void 0?this.cone.material.color.copy(this.light.color):this.cone.material.color.set(this.color)}},Sy=new U,Cy=new G,wy=new G,Ty=class extends cm{constructor(e){let t=Ey(e),n=new J,r=[],i=[];for(let e=0;e1)for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Ky.set(e.z,0,-e.x).normalize();let t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Ky,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}},Xy=class extends cm{constructor(e=1){let t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new J;r.setAttribute(`position`,new q(t,3)),r.setAttribute(`color`,new q(n,3));let i=new Xp({vertexColors:!0,toneMapped:!1});super(r,i),this.type=`AxesHelper`}setColors(e,t,n){let r=new K,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},Zy=class{constructor(){this.type=`ShapePath`,this.color=new K,this.subPaths=[],this.currentPath=null,this.userData={}}moveTo(e,t){return this.currentPath=new gh,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(){function e(e,t){let n=!1,r=t.length;for(let i=0,a=r-1;ie.y!=o.y>e.y&&e.x<(o.x-r.x)*(e.y-r.y)/(o.y-r.y)+r.x&&(n=!n)}return n}function t(t,n){let r=n.getCenter(new H);if(e(r,t))return r;let i=r.y,a=[],o=t.length;for(let e=0;ei!=r.y>i){let e=n.x+(i-n.y)*(r.x-n.x)/(r.y-n.y);a.push(e)}}return a.length>1&&(a.sort((e,t)=>e-t),r.x=(a[0]+a[1])/2),r}let n=this.userData.style&&this.userData.style.fillRule||`nonzero`;n!==`nonzero`&&n!==`evenodd`&&(R(`Fill-rule "`+n+`" is not supported, falling back to "nonzero".`),n=`nonzero`);let r=n===`nonzero`?(e=>e!==0):(e=>(e&1)!=0),i=[];for(let e of this.subPaths){let n=e.getPoints();if(n.length<3)continue;let r=Qh.area(n);if(r===0)continue;let a=new dy;for(let e=0;et.absArea-e.absArea);for(let t=0;t=0;r--){let t=i[r];if(t.boundingBox.containsBox(n.boundingBox)&&e(n.interiorPoint,t.points)){n.container=t.exclude?t.container:t,a=t.winding,n.winding+=a;break}}r(n.winding)===r(a)&&(n.exclude=!0)}for(let e of i)e.exclude||(e.role=e.container===null||e.container.role===`hole`?`outer`:`hole`);let a=[],o=new Map;for(let e of i){if(e.exclude||e.role!==`outer`)continue;let t=new _h;t.curves=e.subPath.curves,a.push(t),o.set(e,t)}for(let e of i){if(e.exclude||e.role!==`hole`)continue;let t=o.get(e.container);if(!t)continue;let n=new gh;n.curves=e.subPath.curves,t.holes.push(n)}return a}},Qy=class extends yl{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){R(`Controls: connect() now requires an element.`);return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}};function $y(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2):(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0),e}function eb(e,t){let n=e.image&&e.image.width?e.image.width/e.image.height:1;return n>t?(e.repeat.x=t/n,e.repeat.y=1,e.offset.x=(1-e.repeat.x)/2,e.offset.y=0):(e.repeat.x=1,e.repeat.y=n/t,e.offset.x=0,e.offset.y=(1-e.repeat.y)/2),e}function tb(e){return e.repeat.x=1,e.repeat.y=1,e.offset.x=0,e.offset.y=0,e}function nb(e,t,n,r){let i=rb(r);switch(n){case Ss:return e*t;case Ds:return e*t/i.components*i.byteLength;case Os:return e*t/i.components*i.byteLength;case ks:return e*t*2/i.components*i.byteLength;case As:return e*t*2/i.components*i.byteLength;case Cs:return e*t*3/i.components*i.byteLength;case ws:return e*t*4/i.components*i.byteLength;case Ms:return e*t*4/i.components*i.byteLength;case Ns:case Ps:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Fs:case Is:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Rs:case Bs:return Math.max(e,16)*Math.max(t,8)/4;case Ls:case zs:return Math.max(e,8)*Math.max(t,8)/2;case Vs:case Hs:case Ws:case Gs:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Us:case Ks:case qs:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Js:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case Ys:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case Xs:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case Zs:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case Qs:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case $s:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case ec:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case tc:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case nc:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case rc:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case ic:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case ac:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case oc:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case sc:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case cc:case lc:case uc:return Math.ceil(e/4)*Math.ceil(t/4)*16;case dc:case fc:return Math.ceil(e/4)*Math.ceil(t/4)*8;case pc:case mc:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw Error(`Unable to determine texture byte length for ${n} format.`)}function rb(e){switch(e){case ls:case us:return{byteLength:1,components:1};case fs:case ds:case gs:return{byteLength:2,components:1};case _s:case vs:return{byteLength:2,components:4};case ms:case ps:case hs:return{byteLength:4,components:1};case bs:case xs:return{byteLength:4,components:3}}throw Error(`THREE.TextureUtils: Unknown texture type ${e}.`)}var ib=class{static contain(e,t){return $y(e,t)}static cover(e,t){return eb(e,t)}static fill(e){return tb(e)}static getByteLength(e,t,n,r){return nb(e,t,n,r)}};typeof __THREE_DEVTOOLS__<`u`&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent(`register`,{detail:{revision:`185`}})),typeof window<`u`&&(window.__THREE__?R(`WARNING: Multiple instances of Three.js being imported.`):window.__THREE__=`185`);var ab=n({ACESFilmicToneMapping:()=>4,AddEquation:()=>100,AddOperation:()=>2,AdditiveAnimationBlendMode:()=>Ec,AdditiveBlending:()=>2,AgXToneMapping:()=>6,AlphaFormat:()=>Ss,AlwaysCompare:()=>519,AlwaysDepth:()=>1,AlwaysStencilFunc:()=>519,AmbientLight:()=>G_,AnimationAction:()=>qv,AnimationClip:()=>o_,AnimationLoader:()=>__,AnimationMixer:()=>Yv,AnimationObjectGroup:()=>Kv,AnimationUtils:()=>Kg,ArcCurve:()=>Um,ArrayCamera:()=>_v,ArrowHelper:()=>Yy,AttachedBindMode:()=>Jo,Audio:()=>Ev,AudioAnalyser:()=>Mv,AudioContext:()=>cv,AudioListener:()=>Tv,AudioLoader:()=>lv,AxesHelper:()=>Xy,BackSide:()=>1,BasicDepthPacking:()=>Dc,BasicShadowMap:()=>0,BatchedMesh:()=>Yp,BezierInterpolant:()=>Zg,Bone:()=>sp,BooleanKeyframeTrack:()=>$g,Box2:()=>dy,Box3:()=>md,Box3Helper:()=>Wy,BoxGeometry:()=>km,BoxHelper:()=>Uy,BufferAttribute:()=>Ld,BufferGeometry:()=>J,BufferGeometryLoader:()=>$_,ByteType:()=>us,Cache:()=>l_,Camera:()=>N_,CameraHelper:()=>By,CanvasTexture:()=>wm,CapsuleGeometry:()=>Am,CatmullRomCurve3:()=>Xm,CineonToneMapping:()=>3,CircleGeometry:()=>jm,ClampToEdgeWrapping:()=>Zo,Clock:()=>oy,Color:()=>K,ColorKeyframeTrack:()=>e_,ColorManagement:()=>Ql,Compatibility:()=>rl,CompressedArrayTexture:()=>xm,CompressedCubeTexture:()=>Sm,CompressedTexture:()=>bm,CompressedTextureLoader:()=>v_,ConeGeometry:()=>Nm,ConstantAlphaFactor:()=>213,ConstantColorFactor:()=>211,Controls:()=>Qy,CubeCamera:()=>gv,CubeDepthTexture:()=>Dm,CubeReflectionMapping:()=>301,CubeRefractionMapping:()=>302,CubeTexture:()=>Cm,CubeTextureLoader:()=>x_,CubeUVReflectionMapping:()=>306,CubicBezierCurve:()=>sh,CubicBezierCurve3:()=>ch,CubicInterpolant:()=>Jg,CullFaceBack:()=>1,CullFaceFront:()=>2,CullFaceFrontBack:()=>3,CullFaceNone:()=>0,Curve:()=>Vm,CurvePath:()=>hh,CustomBlending:()=>5,CustomToneMapping:()=>5,CylinderGeometry:()=>Mm,Cylindrical:()=>cy,Data3DTexture:()=>mu,DataArrayTexture:()=>fu,DataTexture:()=>cp,DataTextureLoader:()=>S_,DataUtils:()=>Nd,DecrementStencilOp:()=>Rc,DecrementWrapStencilOp:()=>Bc,DefaultLoadingManager:()=>f_,DepthFormat:()=>Ts,DepthStencilFormat:()=>Es,DepthTexture:()=>Em,DetachedBindMode:()=>Yo,DirectionalLight:()=>W_,DirectionalLightHelper:()=>Ly,DiscreteInterpolant:()=>Xg,DodecahedronGeometry:()=>Fm,DoubleSide:()=>2,DstAlphaFactor:()=>206,DstColorFactor:()=>208,DynamicCopyUsage:()=>Yc,DynamicDrawUsage:()=>Uc,DynamicReadUsage:()=>Kc,EdgesGeometry:()=>Bm,EllipseCurve:()=>Hm,EqualCompare:()=>514,EqualDepth:()=>4,EqualStencilFunc:()=>514,EquirectangularReflectionMapping:()=>303,EquirectangularRefractionMapping:()=>304,Euler:()=>Tu,EventDispatcher:()=>yl,ExternalTexture:()=>Om,ExtrudeGeometry:()=>tg,FileLoader:()=>g_,Float16BufferAttribute:()=>Gd,Float32BufferAttribute:()=>q,FloatType:()=>hs,Fog:()=>Qu,FogExp2:()=>Zu,FramebufferTexture:()=>ym,FrontSide:()=>0,Frustum:()=>Op,FrustumArray:()=>Ap,GLBufferAttribute:()=>ty,GLSL1:()=>`100`,GLSL3:()=>Zc,GreaterCompare:()=>516,GreaterDepth:()=>6,GreaterEqualCompare:()=>518,GreaterEqualDepth:()=>5,GreaterEqualStencilFunc:()=>518,GreaterStencilFunc:()=>516,GridHelper:()=>My,Group:()=>Uu,HTMLTexture:()=>Tm,HalfFloatType:()=>gs,HemisphereLight:()=>T_,HemisphereLightHelper:()=>jy,IcosahedronGeometry:()=>ig,ImageBitmapLoader:()=>ov,ImageLoader:()=>b_,ImageUtils:()=>nu,IncrementStencilOp:()=>Lc,IncrementWrapStencilOp:()=>zc,InstancedBufferAttribute:()=>fp,InstancedBufferGeometry:()=>Q_,InstancedInterleavedBuffer:()=>ey,InstancedMesh:()=>bp,Int16BufferAttribute:()=>Vd,Int32BufferAttribute:()=>Ud,Int8BufferAttribute:()=>Rd,IntType:()=>ps,InterleavedBuffer:()=>rf,InterleavedBufferAttribute:()=>of,Interpolant:()=>qg,InterpolateBezier:()=>xc,InterpolateDiscrete:()=>vc,InterpolateLinear:()=>yc,InterpolateSmooth:()=>bc,InterpolationSamplingMode:()=>nl,InterpolationSamplingType:()=>tl,InvertStencilOp:()=>Vc,KeepStencilOp:()=>Fc,KeyframeTrack:()=>Qg,LOD:()=>Df,LatheGeometry:()=>ag,Layers:()=>Eu,LessCompare:()=>513,LessDepth:()=>2,LessEqualCompare:()=>515,LessEqualDepth:()=>3,LessEqualStencilFunc:()=>515,LessStencilFunc:()=>513,Light:()=>w_,LightProbe:()=>J_,Line:()=>im,Line3:()=>yy,LineBasicMaterial:()=>Xp,LineCurve:()=>lh,LineCurve3:()=>uh,LineDashedMaterial:()=>zg,LineLoop:()=>lm,LineSegments:()=>cm,LinearFilter:()=>is,LinearInterpolant:()=>Yg,LinearMipMapLinearFilter:()=>cs,LinearMipMapNearestFilter:()=>os,LinearMipmapLinearFilter:()=>ss,LinearMipmapNearestFilter:()=>as,LinearSRGBColorSpace:()=>Mc,LinearToneMapping:()=>1,LinearTransfer:()=>Nc,Loader:()=>p_,LoaderUtils:()=>Z_,LoadingManager:()=>d_,LoopOnce:()=>hc,LoopPingPong:()=>_c,LoopRepeat:()=>gc,MOUSE:()=>Ko,Material:()=>cf,MaterialBlending:()=>6,MaterialLoader:()=>X_,MathUtils:()=>Wl,Matrix2:()=>ly,Matrix3:()=>W,Matrix4:()=>G,MaxEquation:()=>104,Mesh:()=>Jf,MeshBasicMaterial:()=>If,MeshDepthMaterial:()=>Ig,MeshDistanceMaterial:()=>Lg,MeshLambertMaterial:()=>Fg,MeshMatcapMaterial:()=>Rg,MeshNormalMaterial:()=>Pg,MeshPhongMaterial:()=>Mg,MeshPhysicalMaterial:()=>jg,MeshStandardMaterial:()=>Ag,MeshToonMaterial:()=>Ng,MinEquation:()=>103,MirroredRepeatWrapping:()=>Qo,MixOperation:()=>1,MultiplyBlending:()=>4,MultiplyOperation:()=>0,NearestFilter:()=>$o,NearestMipMapLinearFilter:()=>rs,NearestMipMapNearestFilter:()=>ts,NearestMipmapLinearFilter:()=>ns,NearestMipmapNearestFilter:()=>es,NeutralToneMapping:()=>7,NeverCompare:()=>512,NeverDepth:()=>0,NeverStencilFunc:()=>512,NoBlending:()=>0,NoColorSpace:()=>``,NoNormalPacking:()=>``,NoToneMapping:()=>0,NormalAnimationBlendMode:()=>Tc,NormalBlending:()=>1,NormalGAPacking:()=>`ga`,NormalRGPacking:()=>`rg`,NotEqualCompare:()=>517,NotEqualDepth:()=>7,NotEqualStencilFunc:()=>517,NumberKeyframeTrack:()=>t_,Object3D:()=>Hu,ObjectLoader:()=>tv,ObjectSpaceNormalMap:()=>1,OctahedronGeometry:()=>og,OneFactor:()=>201,OneMinusConstantAlphaFactor:()=>214,OneMinusConstantColorFactor:()=>212,OneMinusDstAlphaFactor:()=>207,OneMinusDstColorFactor:()=>209,OneMinusSrcAlphaFactor:()=>205,OneMinusSrcColorFactor:()=>203,OrthographicCamera:()=>H_,PCFShadowMap:()=>1,PCFSoftShadowMap:()=>2,PMREMGenerator:()=>Ob,Path:()=>gh,PerspectiveCamera:()=>L_,Plane:()=>wp,PlaneGeometry:()=>sg,PlaneHelper:()=>Gy,PointLight:()=>V_,PointLightHelper:()=>Dy,Points:()=>hm,PointsMaterial:()=>um,PolarGridHelper:()=>Ny,PolyhedronGeometry:()=>Pm,PositionalAudio:()=>jv,PropertyBinding:()=>Gv,PropertyMixer:()=>Nv,QuadraticBezierCurve:()=>dh,QuadraticBezierCurve3:()=>fh,Quaternion:()=>Gl,QuaternionKeyframeTrack:()=>r_,QuaternionLinearInterpolant:()=>n_,R11_EAC_Format:()=>Ws,RED_GREEN_RGTC2_Format:()=>pc,RED_RGTC1_Format:()=>dc,REVISION:()=>`185`,RG11_EAC_Format:()=>Ks,RGBADepthPacking:()=>Oc,RGBAFormat:()=>ws,RGBAIntegerFormat:()=>Ms,RGBA_ASTC_10x10_Format:()=>ac,RGBA_ASTC_10x5_Format:()=>nc,RGBA_ASTC_10x6_Format:()=>rc,RGBA_ASTC_10x8_Format:()=>ic,RGBA_ASTC_12x10_Format:()=>oc,RGBA_ASTC_12x12_Format:()=>sc,RGBA_ASTC_4x4_Format:()=>Js,RGBA_ASTC_5x4_Format:()=>Ys,RGBA_ASTC_5x5_Format:()=>Xs,RGBA_ASTC_6x5_Format:()=>Zs,RGBA_ASTC_6x6_Format:()=>Qs,RGBA_ASTC_8x5_Format:()=>$s,RGBA_ASTC_8x6_Format:()=>ec,RGBA_ASTC_8x8_Format:()=>tc,RGBA_BPTC_Format:()=>cc,RGBA_ETC2_EAC_Format:()=>Us,RGBA_PVRTC_2BPPV1_Format:()=>Bs,RGBA_PVRTC_4BPPV1_Format:()=>zs,RGBA_S3TC_DXT1_Format:()=>Ps,RGBA_S3TC_DXT3_Format:()=>Fs,RGBA_S3TC_DXT5_Format:()=>Is,RGBDepthPacking:()=>kc,RGBFormat:()=>Cs,RGBIntegerFormat:()=>js,RGB_BPTC_SIGNED_Format:()=>lc,RGB_BPTC_UNSIGNED_Format:()=>uc,RGB_ETC1_Format:()=>Vs,RGB_ETC2_Format:()=>Hs,RGB_PVRTC_2BPPV1_Format:()=>Rs,RGB_PVRTC_4BPPV1_Format:()=>Ls,RGB_S3TC_DXT1_Format:()=>Ns,RGDepthPacking:()=>Ac,RGFormat:()=>ks,RGIntegerFormat:()=>As,RawShaderMaterial:()=>kg,Ray:()=>Ff,Raycaster:()=>ry,RectAreaLight:()=>K_,RedFormat:()=>Ds,RedIntegerFormat:()=>Os,ReinhardToneMapping:()=>2,RenderTarget:()=>uu,RenderTarget3D:()=>Xv,RepeatWrapping:()=>Xo,ReplaceStencilOp:()=>Ic,ReverseSubtractEquation:()=>102,RingGeometry:()=>cg,SIGNED_R11_EAC_Format:()=>Gs,SIGNED_RED_GREEN_RGTC2_Format:()=>mc,SIGNED_RED_RGTC1_Format:()=>fc,SIGNED_RG11_EAC_Format:()=>qs,SRGBColorSpace:()=>jc,SRGBTransfer:()=>Pc,Scene:()=>$u,ShaderChunk:()=>Y,ShaderLib:()=>cb,ShaderMaterial:()=>Og,ShadowMaterial:()=>yg,Shape:()=>_h,ShapeGeometry:()=>lg,ShapePath:()=>Zy,ShapeUtils:()=>Qh,ShortType:()=>ds,Skeleton:()=>dp,SkeletonHelper:()=>Ty,SkinnedMesh:()=>op,Source:()=>iu,Sphere:()=>Yd,SphereGeometry:()=>dg,Spherical:()=>sy,SphericalHarmonics3:()=>q_,SplineCurve:()=>ph,SpotLight:()=>z_,SpotLightHelper:()=>xy,Sprite:()=>Cf,SpriteMaterial:()=>lf,SrcAlphaFactor:()=>204,SrcAlphaSaturateFactor:()=>210,SrcColorFactor:()=>202,StaticCopyUsage:()=>Jc,StaticDrawUsage:()=>Hc,StaticReadUsage:()=>Gc,StereoCamera:()=>pv,StreamCopyUsage:()=>Xc,StreamDrawUsage:()=>Wc,StreamReadUsage:()=>qc,StringKeyframeTrack:()=>i_,SubtractEquation:()=>101,SubtractiveBlending:()=>3,TOUCH:()=>qo,TangentSpaceNormalMap:()=>0,TetrahedronGeometry:()=>fg,Texture:()=>cu,TextureLoader:()=>C_,TextureUtils:()=>ib,Timer:()=>vv,TimestampQuery:()=>el,TorusGeometry:()=>pg,TorusKnotGeometry:()=>mg,Triangle:()=>pd,TriangleFanDrawMode:()=>2,TriangleStripDrawMode:()=>1,TrianglesDrawMode:()=>0,TubeGeometry:()=>hg,UVMapping:()=>300,Uint16BufferAttribute:()=>Hd,Uint32BufferAttribute:()=>Wd,Uint8BufferAttribute:()=>zd,Uint8ClampedBufferAttribute:()=>Bd,Uniform:()=>Zv,UniformsGroup:()=>$v,UniformsLib:()=>X,UniformsUtils:()=>Tg,UnsignedByteType:()=>ls,UnsignedInt101111Type:()=>xs,UnsignedInt248Type:()=>ys,UnsignedInt5999Type:()=>bs,UnsignedIntType:()=>ms,UnsignedShort4444Type:()=>_s,UnsignedShort5551Type:()=>vs,UnsignedShortType:()=>fs,VSMShadowMap:()=>3,Vector2:()=>H,Vector3:()=>U,Vector4:()=>lu,VectorKeyframeTrack:()=>a_,VideoFrameTexture:()=>vm,VideoTexture:()=>_m,WebGL3DRenderTarget:()=>hu,WebGLArrayRenderTarget:()=>pu,WebGLCoordinateSystem:()=>Qc,WebGLCubeRenderTarget:()=>Lb,WebGLRenderTarget:()=>du,WebGLRenderer:()=>xC,WebGLUtils:()=>lC,WebGPUCoordinateSystem:()=>$c,WebXRController:()=>Gu,WireframeGeometry:()=>gg,WrapAroundEnding:()=>wc,ZeroCurvatureEnding:()=>Sc,ZeroFactor:()=>200,ZeroSlopeEnding:()=>Cc,ZeroStencilOp:()=>0,createCanvasElement:()=>ll,error:()=>z,getConsoleFunction:()=>pl,log:()=>ml,setConsoleFunction:()=>fl,warn:()=>R,warnOnce:()=>gl});function ob(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function sb(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,clipping_planes_pars_fragment:`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,clipping_planes_pars_vertex:`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,clipping_planes_vertex:`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,color_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#endif`,color_pars_fragment:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#endif`,color_pars_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + varying vec4 vColor; +#endif`,color_vertex:`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) + vColor = vec4( 1.0 ); +#endif +#ifdef USE_COLOR_ALPHA + vColor *= color; +#elif defined( USE_COLOR ) + vColor.rgb *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.rgb *= instanceColor.rgb; +#endif +#ifdef USE_BATCHING_COLOR + vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); +#endif`,common:`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +#define inverseTransformDirection transformDirectionByInverseViewMatrix +vec3 transformNormalByInverseViewMatrix( in vec3 normal, in mat4 viewMatrix ) { + return normalize( ( vec4( normal, 0.0 ) * viewMatrix ).xyz ); +} +vec3 transformDirectionByInverseViewMatrix( in vec3 dir, in mat4 viewMatrix ) { + return normalize( ( vec4( dir, 0.0 ) * viewMatrix ).xyz ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,cube_uv_reflection_fragment:`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,defaultnormal_vertex:`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; +#endif`,displacementmap_pars_vertex:`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,displacementmap_vertex:`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,emissivemap_fragment:`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE + emissiveColor = sRGBTransferEOTF( emissiveColor ); + #endif + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,emissivemap_pars_fragment:`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,colorspace_fragment:`gl_FragColor = linearToOutputTexel( gl_FragColor );`,colorspace_pars_fragment:`vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferEOTF( in vec4 value ) { + return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,envmap_fragment:`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, envMapRotation * reflectVec ); + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif + #endif +#endif`,envmap_common_pars_fragment:`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform mat3 envMapRotation; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif +#endif`,envmap_pars_fragment:`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,envmap_pars_vertex:`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,envmap_physical_pars_fragment:`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); + reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,envmap_vertex:`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,fog_vertex:`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,fog_pars_vertex:`#ifdef USE_FOG + varying float vFogDepth; +#endif`,fog_fragment:`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,fog_pars_fragment:`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,gradientmap_pars_fragment:`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,lightmap_pars_fragment:`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,lights_lambert_fragment:`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,lights_lambert_pars_fragment:`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,lights_pars_begin:`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif +#include `,lights_toon_fragment:`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,lights_toon_pars_fragment:`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,lights_phong_fragment:`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,lights_phong_pars_fragment:`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,lights_physical_fragment:`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +material.metalness = metalnessFactor; +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; + material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = vec3( 0.04 ); + material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_DISPERSION + material.dispersion = dispersion; +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,lights_physical_pars_fragment:`uniform sampler2D dfgLUT; +struct PhysicalMaterial { + vec3 diffuseColor; + vec3 diffuseContribution; + vec3 specularColor; + vec3 specularColorBlended; + float roughness; + float metalness; + float specularF90; + float dispersion; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + vec3 iridescenceFresnelDielectric; + vec3 iridescenceFresnelMetallic; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColorBlended; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float rInv = 1.0 / ( roughness + 0.1 ); + float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; + float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; + float DG = exp( a * dotNV + b ); + return saturate( DG ); +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; + vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; + vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; + vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; + float Ess_V = dfgV.x + dfgV.y; + float Ess_L = dfgL.x + dfgL.y; + float Ems_V = 1.0 - Ess_V; + float Ems_L = 1.0 - Ess_L; + vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; + vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); + float compensationFactor = Ems_V * Ems_L; + vec3 multiScatter = Fms * compensationFactor; + return singleScatter + multiScatter; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + #ifdef USE_CLEARCOAT + vec3 Ncc = geometryClearcoatNormal; + vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); + vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); + vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); + mat3 mInvClearcoat = mat3( + vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), + vec3( 0, 1, 0 ), + vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) + ); + vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; + clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); + #endif + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + + float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); + + float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); + + irradiance *= sheenEnergyComp; + + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); + #ifdef USE_SHEEN + float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; + diffuse *= sheenEnergyComp; + #endif + reflectedLight.indirectDiffuse += diffuse; +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; + #endif + vec3 singleScatteringDielectric = vec3( 0.0 ); + vec3 multiScatteringDielectric = vec3( 0.0 ); + vec3 singleScatteringMetallic = vec3( 0.0 ); + vec3 multiScatteringMetallic = vec3( 0.0 ); + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); + computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); + #endif + vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); + vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); + vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; + vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + vec3 indirectSpecular = radiance * singleScattering; + indirectSpecular += multiScattering * cosineWeightedIrradiance; + vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; + #ifdef USE_SHEEN + float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; + indirectSpecular *= sheenEnergyComp; + indirectDiffuse *= sheenEnergyComp; + #endif + reflectedLight.indirectSpecular += indirectSpecular; + reflectedLight.indirectDiffuse += indirectDiffuse; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,lights_fragment_begin:` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); + material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif + #ifdef USE_LIGHT_PROBES_GRID + vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz; + vec3 probeWorldNormal = transformNormalByInverseViewMatrix( geometryNormal, viewMatrix ); + irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal ); + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,lights_fragment_maps:`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV ) + #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,lights_fragment_end:`#if defined( RE_IndirectDiffuse ) + #if defined( LAMBERT ) || defined( PHONG ) + irradiance += iblIrradiance; + #endif + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,lightprobes_pars_fragment:`#ifdef USE_LIGHT_PROBES_GRID +uniform highp sampler3D probesSH; +uniform vec3 probesMin; +uniform vec3 probesMax; +uniform vec3 probesResolution; +vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) { + vec3 res = probesResolution; + vec3 gridRange = probesMax - probesMin; + vec3 resMinusOne = res - 1.0; + vec3 probeSpacing = gridRange / resMinusOne; + vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5; + vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 ); + uvw = uvw * resMinusOne / res + 0.5 / res; + float nz = res.z; + float paddedSlices = nz + 2.0; + float atlasDepth = 7.0 * paddedSlices; + float uvZBase = uvw.z * nz + 1.0; + vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) ); + vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) ); + vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) ); + vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) ); + vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) ); + vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) ); + vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) ); + vec3 c0 = s0.xyz; + vec3 c1 = vec3( s0.w, s1.xy ); + vec3 c2 = vec3( s1.zw, s2.x ); + vec3 c3 = s2.yzw; + vec3 c4 = s3.xyz; + vec3 c5 = vec3( s3.w, s4.xy ); + vec3 c6 = vec3( s4.zw, s5.x ); + vec3 c7 = s5.yzw; + vec3 c8 = s6.xyz; + float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z; + vec3 result = c0 * 0.886227; + result += c1 * 2.0 * 0.511664 * y; + result += c2 * 2.0 * 0.511664 * z; + result += c3 * 2.0 * 0.511664 * x; + result += c4 * 2.0 * 0.429043 * x * y; + result += c5 * 2.0 * 0.429043 * y * z; + result += c6 * ( 0.743125 * z * z - 0.247708 ); + result += c7 * 2.0 * 0.429043 * x * z; + result += c8 * 0.429043 * ( x * x - y * y ); + return max( result, vec3( 0.0 ) ); +} +#endif`,logdepthbuf_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,logdepthbuf_pars_fragment:`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,logdepthbuf_pars_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + varying float vFragDepth; + varying float vIsPerspective; +#endif`,logdepthbuf_vertex:`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); +#endif`,map_fragment:`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,map_pars_fragment:`#ifdef USE_MAP + uniform sampler2D map; +#endif`,map_particle_fragment:`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,map_particle_pars_fragment:`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,metalnessmap_fragment:`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,metalnessmap_pars_fragment:`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,morphinstance_vertex:`#ifdef USE_INSTANCING_MORPH + float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; + } +#endif`,morphcolor_vertex:`#if defined( USE_MORPHCOLORS ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,morphnormal_vertex:`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,morphtarget_pars_vertex:`#ifdef USE_MORPHTARGETS + #ifndef USE_INSTANCING_MORPH + uniform float morphTargetBaseInfluence; + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + #endif + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } +#endif`,morphtarget_vertex:`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } +#endif`,normal_fragment_begin:`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #ifdef DOUBLE_SIDED + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #ifdef DOUBLE_SIDED + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,normal_fragment_maps:`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #if defined( USE_PACKED_NORMALMAP ) + mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) ); + #endif + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,normal_pars_fragment:`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,normal_pars_vertex:`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,normal_vertex:`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #ifdef FLIP_SIDED + vBitangent = - vBitangent; + #endif + #endif +#endif`,normalmap_pars_fragment:`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,clearcoat_normal_fragment_begin:`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,clearcoat_normal_fragment_maps:`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,clearcoat_pars_fragment:`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,iridescence_pars_fragment:`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,opaque_fragment:`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,packing:`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; +const float Inv255 = 1. / 255.; +const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); +const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); +const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); +const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); +vec4 packDepthToRGBA( const in float v ) { + if( v <= 0.0 ) + return vec4( 0., 0., 0., 0. ); + if( v >= 1.0 ) + return vec4( 1., 1., 1., 1. ); + float vuf; + float af = modf( v * PackFactors.a, vuf ); + float bf = modf( vuf * ShiftRight8, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); +} +vec3 packDepthToRGB( const in float v ) { + if( v <= 0.0 ) + return vec3( 0., 0., 0. ); + if( v >= 1.0 ) + return vec3( 1., 1., 1. ); + float vuf; + float bf = modf( v * PackFactors.b, vuf ); + float gf = modf( vuf * ShiftRight8, vuf ); + return vec3( vuf * Inv255, gf * PackUpscale, bf ); +} +vec2 packDepthToRG( const in float v ) { + if( v <= 0.0 ) + return vec2( 0., 0. ); + if( v >= 1.0 ) + return vec2( 1., 1. ); + float vuf; + float gf = modf( v * 256., vuf ); + return vec2( vuf * Inv255, gf ); +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors4 ); +} +float unpackRGBToDepth( const in vec3 v ) { + return dot( v, UnpackFactors3 ); +} +float unpackRGToDepth( const in vec2 v ) { + return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; +} +vec4 pack2HalfToRGBA( const in vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( const in vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + #ifdef USE_REVERSED_DEPTH_BUFFER + + return depth * ( far - near ) - far; + #else + return depth * ( near - far ) - near; + #endif +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + + #ifdef USE_REVERSED_DEPTH_BUFFER + return ( near * far ) / ( ( near - far ) * depth - near ); + #else + return ( near * far ) / ( ( far - near ) * depth - far ); + #endif +}`,premultiplied_alpha_fragment:`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,project_vertex:`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,dithering_fragment:`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,dithering_pars_fragment:`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,roughnessmap_fragment:`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,roughnessmap_pars_fragment:`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,shadowmap_pars_fragment:`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + #else + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + #else + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + #elif defined( SHADOWMAP_TYPE_BASIC ) + uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + #if defined( SHADOWMAP_TYPE_PCF ) + float interleavedGradientNoise( vec2 position ) { + return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); + } + vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { + const float goldenAngle = 2.399963229728653; + float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); + float theta = float( sampleIndex ) * goldenAngle + phi; + return vec2( cos( theta ), sin( theta ) ) * r; + } + #endif + #if defined( SHADOWMAP_TYPE_PCF ) + float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float radius = shadowRadius * texelSize.x; + float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; + shadow = ( + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + + texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) + ) * 0.2; + } + return mix( 1.0, shadow, shadowIntensity ); + } + #elif defined( SHADOWMAP_TYPE_VSM ) + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + #ifdef USE_REVERSED_DEPTH_BUFFER + shadowCoord.z -= shadowBias; + #else + shadowCoord.z += shadowBias; + #endif + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; + float mean = distribution.x; + float variance = distribution.y * distribution.y; + #ifdef USE_REVERSED_DEPTH_BUFFER + float hard_shadow = step( mean, shadowCoord.z ); + #else + float hard_shadow = step( shadowCoord.z, mean ); + #endif + + if ( hard_shadow == 1.0 ) { + shadow = 1.0; + } else { + variance = max( variance, 0.0000001 ); + float d = shadowCoord.z - mean; + float p_max = variance / ( variance + d * d ); + p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); + shadow = max( hard_shadow, p_max ); + } + } + return mix( 1.0, shadow, shadowIntensity ); + } + #else + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + #ifdef USE_REVERSED_DEPTH_BUFFER + shadowCoord.z -= shadowBias; + #else + shadowCoord.z += shadowBias; + #endif + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + float depth = texture2D( shadowMap, shadowCoord.xy ).r; + #ifdef USE_REVERSED_DEPTH_BUFFER + shadow = step( depth, shadowCoord.z ); + #else + shadow = step( shadowCoord.z, depth ); + #endif + } + return mix( 1.0, shadow, shadowIntensity ); + } + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #if defined( SHADOWMAP_TYPE_PCF ) + float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + vec3 bd3D = normalize( lightToPosition ); + vec3 absVec = abs( lightToPosition ); + float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); + if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { + #ifdef USE_REVERSED_DEPTH_BUFFER + float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); + dp -= shadowBias; + #else + float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); + dp += shadowBias; + #endif + float texelSize = shadowRadius / shadowMapSize.x; + vec3 absDir = abs( bd3D ); + vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); + tangent = normalize( cross( bd3D, tangent ) ); + vec3 bitangent = cross( bd3D, tangent ); + float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; + vec2 sample0 = vogelDiskSample( 0, 5, phi ); + vec2 sample1 = vogelDiskSample( 1, 5, phi ); + vec2 sample2 = vogelDiskSample( 2, 5, phi ); + vec2 sample3 = vogelDiskSample( 3, 5, phi ); + vec2 sample4 = vogelDiskSample( 4, 5, phi ); + shadow = ( + texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + + texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) + ) * 0.2; + } + return mix( 1.0, shadow, shadowIntensity ); + } + #elif defined( SHADOWMAP_TYPE_BASIC ) + float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + float shadow = 1.0; + vec3 lightToPosition = shadowCoord.xyz; + vec3 absVec = abs( lightToPosition ); + float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); + if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { + float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); + dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + float depth = textureCube( shadowMap, bd3D ).r; + #ifdef USE_REVERSED_DEPTH_BUFFER + depth = 1.0 - depth; + #endif + shadow = step( dp, depth ); + } + return mix( 1.0, shadow, shadowIntensity ); + } + #endif + #endif +#endif`,shadowmap_pars_vertex:`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowIntensity; + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,shadowmap_vertex:`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + #ifdef HAS_NORMAL + vec3 shadowWorldNormal = transformNormalByInverseViewMatrix( transformedNormal, viewMatrix ); + #else + vec3 shadowWorldNormal = vec3( 0.0 ); + #endif + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,shadowmask_pars_fragment:`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,skinbase_vertex:`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,skinning_pars_vertex:`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,skinning_vertex:`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,skinnormal_vertex:`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,specularmap_fragment:`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,specularmap_pars_fragment:`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,tonemapping_fragment:`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,tonemapping_pars_fragment:`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 CineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 NeutralToneMapping( vec3 color ) { + const float StartCompression = 0.8 - 0.04; + const float Desaturation = 0.15; + color *= toneMappingExposure; + float x = min( color.r, min( color.g, color.b ) ); + float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; + color -= offset; + float peak = max( color.r, max( color.g, color.b ) ); + if ( peak < StartCompression ) return color; + float d = 1. - StartCompression; + float newPeak = 1. - d * d / ( peak + d - StartCompression ); + color *= newPeak / peak; + float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); + return mix( color, vec3( newPeak ), g ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,transmission_fragment:`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = transformNormalByInverseViewMatrix( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,transmission_pars_fragment:`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec4 transmittedLight; + vec3 transmittance; + #ifdef USE_DISPERSION + float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; + vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); + for ( int i = 0; i < 3; i ++ ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); + transmittedLight[ i ] = transmissionSample[ i ]; + transmittedLight.a += transmissionSample.a; + transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; + } + transmittedLight.a /= 3.0; + #else + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + #endif + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,uv_pars_fragment:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uv_pars_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uv_vertex:`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,worldpos_vertex:`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`,background_vert:`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,background_frag:`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,backgroundCube_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,backgroundCube_frag:`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +uniform mat3 backgroundRotation; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,cube_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,cube_frag:`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,depth_vert:`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,depth_frag:`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + #ifdef USE_REVERSED_DEPTH_BUFFER + float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; + #else + float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; + #endif + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #elif DEPTH_PACKING == 3202 + gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); + #elif DEPTH_PACKING == 3203 + gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); + #endif +}`,distance_vert:`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,distance_frag:`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); +}`,equirect_vert:`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,equirect_frag:`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,linedashed_vert:`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,linedashed_frag:`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,meshbasic_vert:`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,meshbasic_frag:`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,meshlambert_vert:`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,meshlambert_frag:`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,meshmatcap_vert:`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,meshmatcap_frag:`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,meshnormal_vert:`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,meshnormal_frag:`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,meshphong_vert:`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,meshphong_frag:`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,meshphysical_vert:`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,meshphysical_frag:`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_DISPERSION + uniform float dispersion; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + + outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; + + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,meshtoon_vert:`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,meshtoon_frag:`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,points_vert:`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,points_frag:`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,shadow_vert:`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,shadow_frag:`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include + #include +}`,sprite_vert:`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix[ 3 ]; + vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,sprite_frag:`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`},X={common:{diffuse:{value:new K(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new W},alphaMap:{value:null},alphaMapTransform:{value:new W},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new W}},envmap:{envMap:{value:null},envMapRotation:{value:new W},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new W}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new W}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new W},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new W},normalScale:{value:new H(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new W},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new W}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new W}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new W}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new K(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new U},probesMax:{value:new U},probesResolution:{value:new U}},points:{diffuse:{value:new K(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new W},alphaTest:{value:0},uvTransform:{value:new W}},sprite:{diffuse:{value:new K(16777215)},opacity:{value:1},center:{value:new H(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new W},alphaMap:{value:null},alphaMapTransform:{value:new W},alphaTest:{value:0}}},cb={basic:{uniforms:xg([X.common,X.specularmap,X.envmap,X.aomap,X.lightmap,X.fog]),vertexShader:Y.meshbasic_vert,fragmentShader:Y.meshbasic_frag},lambert:{uniforms:xg([X.common,X.specularmap,X.envmap,X.aomap,X.lightmap,X.emissivemap,X.bumpmap,X.normalmap,X.displacementmap,X.fog,X.lights,{emissive:{value:new K(0)},envMapIntensity:{value:1}}]),vertexShader:Y.meshlambert_vert,fragmentShader:Y.meshlambert_frag},phong:{uniforms:xg([X.common,X.specularmap,X.envmap,X.aomap,X.lightmap,X.emissivemap,X.bumpmap,X.normalmap,X.displacementmap,X.fog,X.lights,{emissive:{value:new K(0)},specular:{value:new K(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:Y.meshphong_vert,fragmentShader:Y.meshphong_frag},standard:{uniforms:xg([X.common,X.envmap,X.aomap,X.lightmap,X.emissivemap,X.bumpmap,X.normalmap,X.displacementmap,X.roughnessmap,X.metalnessmap,X.fog,X.lights,{emissive:{value:new K(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Y.meshphysical_vert,fragmentShader:Y.meshphysical_frag},toon:{uniforms:xg([X.common,X.aomap,X.lightmap,X.emissivemap,X.bumpmap,X.normalmap,X.displacementmap,X.gradientmap,X.fog,X.lights,{emissive:{value:new K(0)}}]),vertexShader:Y.meshtoon_vert,fragmentShader:Y.meshtoon_frag},matcap:{uniforms:xg([X.common,X.bumpmap,X.normalmap,X.displacementmap,X.fog,{matcap:{value:null}}]),vertexShader:Y.meshmatcap_vert,fragmentShader:Y.meshmatcap_frag},points:{uniforms:xg([X.points,X.fog]),vertexShader:Y.points_vert,fragmentShader:Y.points_frag},dashed:{uniforms:xg([X.common,X.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Y.linedashed_vert,fragmentShader:Y.linedashed_frag},depth:{uniforms:xg([X.common,X.displacementmap]),vertexShader:Y.depth_vert,fragmentShader:Y.depth_frag},normal:{uniforms:xg([X.common,X.bumpmap,X.normalmap,X.displacementmap,{opacity:{value:1}}]),vertexShader:Y.meshnormal_vert,fragmentShader:Y.meshnormal_frag},sprite:{uniforms:xg([X.sprite,X.fog]),vertexShader:Y.sprite_vert,fragmentShader:Y.sprite_frag},background:{uniforms:{uvTransform:{value:new W},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Y.background_vert,fragmentShader:Y.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new W}},vertexShader:Y.backgroundCube_vert,fragmentShader:Y.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Y.cube_vert,fragmentShader:Y.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Y.equirect_vert,fragmentShader:Y.equirect_frag},distance:{uniforms:xg([X.common,X.displacementmap,{referencePosition:{value:new U},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Y.distance_vert,fragmentShader:Y.distance_frag},shadow:{uniforms:xg([X.lights,X.fog,{color:{value:new K(0)},opacity:{value:1}}]),vertexShader:Y.shadow_vert,fragmentShader:Y.shadow_frag}};cb.physical={uniforms:xg([cb.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new W},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new W},clearcoatNormalScale:{value:new H(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new W},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new W},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new W},sheen:{value:0},sheenColor:{value:new K(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new W},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new W},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new W},transmissionSamplerSize:{value:new H},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new W},attenuationDistance:{value:0},attenuationColor:{value:new K(0)},specularColor:{value:new K(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new W},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new W},anisotropyVector:{value:new H},anisotropyMap:{value:null},anisotropyMapTransform:{value:new W}}]),vertexShader:Y.meshphysical_vert,fragmentShader:Y.meshphysical_frag};var lb={r:0,b:0,g:0},ub=new G,db=new W;db.set(-1,0,0,0,1,0,0,0,1);function fb(e,t,n,r,i,a){let o=new K(0),s=i===!0?0:1,c,l,u=null,d=0,f=null;function p(e){let n=e.isScene===!0?e.background:null;if(n&&n.isTexture){let r=e.backgroundBlurriness>0;n=t.get(n,r)}return n}function m(t){let r=!1,i=p(t);i===null?g(o,s):i&&i.isColor&&(g(i,1),r=!0);let c=e.xr.getEnvironmentBlendMode();c===`additive`?n.buffers.color.setClear(0,0,0,1,a):c===`alpha-blend`&&n.buffers.color.setClear(0,0,0,0,a),(e.autoClear||r)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))}function h(t,n){let i=p(n);i&&(i.isCubeTexture||i.mapping===306)?(l===void 0&&(l=new Jf(new km(1,1,1),new Og({name:`BackgroundCubeMaterial`,uniforms:bg(cb.backgroundCube.uniforms),vertexShader:cb.backgroundCube.vertexShader,fragmentShader:cb.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute(`normal`),l.geometry.deleteAttribute(`uv`),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=i,l.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.uniforms.backgroundRotation.value.setFromMatrix4(ub.makeRotationFromEuler(n.backgroundRotation)).transpose(),i.isCubeTexture&&i.isRenderTargetTexture===!1&&l.material.uniforms.backgroundRotation.value.premultiply(db),l.material.toneMapped=Ql.getTransfer(i.colorSpace)!==Pc,(u!==i||d!==i.version||f!==e.toneMapping)&&(l.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null)):i&&i.isTexture&&(c===void 0&&(c=new Jf(new sg(2,2),new Og({name:`BackgroundMaterial`,uniforms:bg(cb.background.uniforms),vertexShader:cb.background.vertexShader,fragmentShader:cb.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute(`normal`),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(c)),c.material.uniforms.t2D.value=i,c.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,c.material.toneMapped=Ql.getTransfer(i.colorSpace)!==Pc,i.matrixAutoUpdate===!0&&i.updateMatrix(),c.material.uniforms.uvTransform.value.copy(i.matrix),(u!==i||d!==i.version||f!==e.toneMapping)&&(c.material.needsUpdate=!0,u=i,d=i.version,f=e.toneMapping),c.layers.enableAll(),t.unshift(c,c.geometry,c.material,0,0,null))}function g(t,r){t.getRGB(lb,wg(e)),n.buffers.color.setClear(lb.r,lb.g,lb.b,r,a)}function _(){l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),s=t,g(o,s)},getClearAlpha:function(){return s},setClearAlpha:function(e){s=e,g(o,s)},render:m,addToRenderList:h,dispose:_}}function pb(e,t){let n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=f(null),a=i,o=!1;function s(n,r,i,s,c){let u=!1,f=d(n,s,i,r);a!==f&&(a=f,l(a.object)),u=p(n,s,i,c),u&&m(n,s,i,c),c!==null&&t.update(c,e.ELEMENT_ARRAY_BUFFER),(u||o)&&(o=!1,b(n,r,i,s),c!==null&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(c).buffer))}function c(){return e.createVertexArray()}function l(t){return e.bindVertexArray(t)}function u(t){return e.deleteVertexArray(t)}function d(e,t,n,i){let a=i.wireframe===!0,o=r[t.id];o===void 0&&(o={},r[t.id]=o);let s=e.isInstancedMesh===!0?e.id:0,l=o[s];l===void 0&&(l={},o[s]=l);let u=l[n.id];u===void 0&&(u={},l[n.id]=u);let d=u[a];return d===void 0&&(d=f(c()),u[a]=d),d}function f(e){let t=[],r=[],i=[];for(let e=0;e=0){let n=i[t],r=o[t];if(r===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(r=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(r=e.instanceColor)),n===void 0||n.attribute!==r||r&&n.data!==r.data)return!0;s++}return a.attributesNum!==s||a.index!==r}function m(e,t,n,r){let i={},o=t.attributes,s=0,c=n.getAttributes();for(let t in c)if(c[t].location>=0){let n=o[t];n===void 0&&(t===`instanceMatrix`&&e.instanceMatrix&&(n=e.instanceMatrix),t===`instanceColor`&&e.instanceColor&&(n=e.instanceColor));let r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,s++}a.attributes=i,a.attributesNum=s,a.index=r}function h(){let e=a.newAttributes;for(let t=0,n=e.length;t=0){let s=o[r];if(s===void 0&&(r===`instanceMatrix`&&n.instanceMatrix&&(s=n.instanceMatrix),r===`instanceColor`&&n.instanceColor&&(s=n.instanceColor)),s!==void 0){let r=s.normalized,o=s.itemSize,c=t.get(s);if(c===void 0)continue;let l=c.buffer,u=c.type,d=c.bytesPerElement,f=u===e.INT||u===e.UNSIGNED_INT||s.gpuType===1013;if(s.isInterleavedBufferAttribute){let t=s.data,c=t.stride,p=s.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return`highp`;t=`mediump`}return t===`mediump`&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?`mediump`:`lowp`}let l=n.precision===void 0?`highp`:n.precision,u=c(l);u!==l&&(R(`WebGLRenderer:`,l,`not supported, using`,u,`instead.`),l=u);let d=n.logarithmicDepthBuffer===!0,f=n.reversedDepthBuffer===!0&&t.has(`EXT_clip_control`);n.reversedDepthBuffer===!0&&f===!1&&R(`WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.`);let p=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),m=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),g=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),_=e.getParameter(e.MAX_VERTEX_ATTRIBS),v=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),y=e.getParameter(e.MAX_VARYING_VECTORS),b=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),x=e.getParameter(e.MAX_SAMPLES),S=e.getParameter(e.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:c,textureFormatReadable:o,textureTypeReadable:s,precision:l,logarithmicDepthBuffer:d,reversedDepthBuffer:f,maxTextures:p,maxVertexTextures:m,maxTextureSize:h,maxCubemapSize:g,maxAttributes:_,maxVertexUniforms:v,maxVaryings:y,maxFragmentUniforms:b,maxSamples:x,samples:S}}function gb(e){let t=this,n=null,r=0,i=!1,a=!1,o=new wp,s=new W,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){let n=e.length!==0||t||r!==0||i;return i=t,r=e.length,n},this.beginShadows=function(){a=!0,u(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(t,o,s){let d=t.clippingPlanes,f=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!i||d===null||d.length===0||a&&!p)a?u(null):l();else{let e=a?0:r,t=e*4,i=m.clippingState||null;c.value=i,i=u(d,o,t,s);for(let e=0;e!==t;++e)i[e]=n[e];m.clippingState=i,this.numIntersection=f?this.numPlanes:0,this.numPlanes+=e}};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){let a=e===null?0:e.length,l=null;if(a!==0){if(l=c.value,i!==!0||l===null){let t=r+a*4,i=n.matrixWorldInverse;s.getNormalMatrix(i),(l===null||l.length0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Fb(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Pb(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=2**this._lodMax}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?l:0,l,l),c.setRenderTarget(r),p&&c.render(d,a),c.render(e,a)}c.toneMapping=u,c.autoClear=l,e.background=m}_textureToCubeUV(e,t){let n=this._renderer,r=e.mapping===301||e.mapping===302;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Fb()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Pb());let i=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=i;let o=i.uniforms;o.envMap.value=e;let s=this._cubeSize;jb(t,0,0,3*s,2*s),n.setRenderTarget(t),n.render(a,xb)}_applyPMREM(e){let t=this._renderer,n=t.autoClear;t.autoClear=!1;let r=this._lodMeshes.length;for(let t=1;td-_b?n-d+_b:0),m=4*(this._cubeSize-f);s.envMap.value=e.texture,s.roughness.value=u,s.mipInt.value=d-t,jb(i,p,m,3*f,2*f),r.setRenderTarget(i),r.render(o,xb),s.envMap.value=i.texture,s.roughness.value=0,s.mipInt.value=d-n,jb(e,p,m,3*f,2*f),r.setRenderTarget(e),r.render(o,xb)}_blur(e,t,n,r,i){let a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,`latitudinal`,i),this._halfBlur(a,e,n,n,r,`longitudinal`,i)}_halfBlur(e,t,n,r,i,a,o){let s=this._renderer,c=this._blurMaterial;a!==`latitudinal`&&a!==`longitudinal`&&z(`blur direction must be either latitudinal or longitudinal!`);let l=this._lodMeshes[r];l.material=c;let u=c.uniforms,d=this._sizeLods[n]-1,f=isFinite(i)?Math.PI/(2*d):2*Math.PI/(2*yb-1),p=i/f,m=isFinite(i)?1+Math.floor(3*p):yb;m>yb&&R(`sigmaRadians, ${i}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${yb}`);let h=[],g=0;for(let e=0;e_-_b?r-_+_b:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(t),s.render(l,xb)}};function kb(e){let t=[],n=[],r=[],i=e,a=e-_b+1+vb.length;for(let o=0;oe-_b?s=vb[o-e+_b-1]:o===0&&(s=0),n.push(s);let c=1/(a-2),l=-c,u=1+c,d=[l,l,u,l,u,u,l,l,u,u,l,u],f=new Float32Array(108),p=new Float32Array(72),m=new Float32Array(36);for(let e=0;e<6;e++){let t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];f.set(r,18*e),p.set(d,12*e);let i=[e,e,e,e,e,e];m.set(i,6*e)}let h=new J;h.setAttribute(`position`,new Ld(f,3)),h.setAttribute(`uv`,new Ld(p,2)),h.setAttribute(`faceIndex`,new Ld(m,1)),r.push(new Jf(h,null)),i>_b&&i--}return{lodMeshes:r,sizeLods:t,sigmas:n}}function Ab(e,t,n){let r=new du(e,t,n);return r.texture.mapping=306,r.texture.name=`PMREM.cubeUv`,r.scissorTest=!0,r}function jb(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Mb(e,t,n){return new Og({name:`PMREMGGXConvolution`,defines:{GGX_SAMPLES:bb,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:Ib(),fragmentShader:` + + precision highp float; + precision highp int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform float roughness; + uniform float mipInt; + + #define ENVMAP_TYPE_CUBE_UV + #include + + #define PI 3.14159265359 + + // Van der Corput radical inverse + float radicalInverse_VdC(uint bits) { + bits = (bits << 16u) | (bits >> 16u); + bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); + bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); + bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); + bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); + return float(bits) * 2.3283064365386963e-10; // / 0x100000000 + } + + // Hammersley sequence + vec2 hammersley(uint i, uint N) { + return vec2(float(i) / float(N), radicalInverse_VdC(i)); + } + + // GGX VNDF importance sampling (Eric Heitz 2018) + // "Sampling the GGX Distribution of Visible Normals" + // https://jcgt.org/published/0007/04/01/ + vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { + float alpha = roughness * roughness; + + // Section 4.1: Orthonormal basis + vec3 T1 = vec3(1.0, 0.0, 0.0); + vec3 T2 = cross(V, T1); + + // Section 4.2: Parameterization of projected area + float r = sqrt(Xi.x); + float phi = 2.0 * PI * Xi.y; + float t1 = r * cos(phi); + float t2 = r * sin(phi); + float s = 0.5 * (1.0 + V.z); + t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; + + // Section 4.3: Reprojection onto hemisphere + vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; + + // Section 3.4: Transform back to ellipsoid configuration + return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); + } + + void main() { + vec3 N = normalize(vOutputDirection); + vec3 V = N; // Assume view direction equals normal for pre-filtering + + vec3 prefilteredColor = vec3(0.0); + float totalWeight = 0.0; + + // For very low roughness, just sample the environment directly + if (roughness < 0.001) { + gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); + return; + } + + // Tangent space basis for VNDF sampling + vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 tangent = normalize(cross(up, N)); + vec3 bitangent = cross(N, tangent); + + for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { + vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); + + // For PMREM, V = N, so in tangent space V is always (0, 0, 1) + vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); + + // Transform H back to world space + vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); + vec3 L = normalize(2.0 * dot(V, H) * H - V); + + float NdotL = max(dot(N, L), 0.0); + + if(NdotL > 0.0) { + // Sample environment at fixed mip level + // VNDF importance sampling handles the distribution filtering + vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); + + // Weight by NdotL for the split-sum approximation + // VNDF PDF naturally accounts for the visible microfacet distribution + prefilteredColor += sampleColor * NdotL; + totalWeight += NdotL; + } + } + + if (totalWeight > 0.0) { + prefilteredColor = prefilteredColor / totalWeight; + } + + gl_FragColor = vec4(prefilteredColor, 1.0); + } + `,blending:0,depthTest:!1,depthWrite:!1})}function Nb(e,t,n){let r=new Float32Array(yb),i=new U(0,1,0);return new Og({name:`SphericalGaussianBlur`,defines:{n:yb,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Ib(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function Pb(){return new Og({name:`EquirectangularToCubeUV`,uniforms:{envMap:{value:null}},vertexShader:Ib(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function Fb(){return new Og({name:`CubemapToCubeUV`,uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ib(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:0,depthTest:!1,depthWrite:!1})}function Ib(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}var Lb=class extends du{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;let n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new Cm(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},r=new km(5,5,5),i=new Og({name:`CubemapFromEquirect`,uniforms:bg(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;let a=new Jf(r,i),o=t.minFilter;return t.minFilter===1008&&(t.minFilter=is),new gv(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){let i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}};function Rb(e){let t=new WeakMap,n=new WeakMap,r=null;function i(e,t=!1){return e==null?null:t?o(e):a(e)}function a(n){if(n&&n.isTexture){let r=n.mapping;if(r===303||r===304)if(t.has(n)){let e=t.get(n).texture;return s(e,n.mapping)}else{let r=n.image;if(r&&r.height>0){let i=new Lb(r.height);return i.fromEquirectangularTexture(e,n),t.set(n,i),n.addEventListener(`dispose`,l),s(i.texture,n.mapping)}else return null}}return n}function o(t){if(t&&t.isTexture){let i=t.mapping,a=i===303||i===304,o=i===301||i===302;if(a||o){let i=n.get(t),s=i===void 0?0:i.texture.pmremVersion;if(t.isRenderTargetTexture&&t.pmremVersion!==s)return r===null&&(r=new Ob(e)),i=a?r.fromEquirectangular(t,i):r.fromCubemap(t,i),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),i.texture;if(i!==void 0)return i.texture;{let s=t.image;return a&&s&&s.height>0||o&&s&&c(s)?(r===null&&(r=new Ob(e)),i=a?r.fromEquirectangular(t):r.fromCubemap(t),i.texture.pmremVersion=t.pmremVersion,n.set(t,i),t.addEventListener(`dispose`,u),i.texture):null}}}return t}function s(e,t){return t===303?e.mapping=301:t===304&&(e.mapping=302),e}function c(e){let t=0;for(let n=0;n<6;n++)e[n]!==void 0&&t++;return t===6}function l(e){let n=e.target;n.removeEventListener(`dispose`,l);let r=t.get(n);r!==void 0&&(t.delete(n),r.dispose())}function u(e){let t=e.target;t.removeEventListener(`dispose`,u);let r=n.get(t);r!==void 0&&(n.delete(t),r.dispose())}function d(){t=new WeakMap,n=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:i,dispose:d}}function zb(e){let t={};function n(n){if(t[n]!==void 0)return t[n];let r=e.getExtension(n);return t[n]=r,r}return{has:function(e){return n(e)!==null},init:function(){n(`EXT_color_buffer_float`),n(`WEBGL_clip_cull_distance`),n(`OES_texture_float_linear`),n(`EXT_color_buffer_half_float`),n(`WEBGL_multisampled_render_to_texture`),n(`WEBGL_render_shared_exponent`)},get:function(e){let t=n(e);return t===null&&gl(`WebGLRenderer: `+e+` extension not supported.`),t}}}function Bb(e,t,n,r){let i={},a=new WeakMap;function o(e){let s=e.target;s.index!==null&&t.remove(s.index);for(let e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener(`dispose`,o),delete i[s.id];let c=a.get(s);c&&(t.remove(c),a.delete(s)),r.releaseStatesOfGeometry(s),s.isInstancedBufferGeometry===!0&&delete s._maxInstanceCount,n.memory.geometries--}function s(e,t){return i[t.id]===!0?t:(t.addEventListener(`dispose`,o),i[t.id]=!0,n.memory.geometries++,t)}function c(n){let r=n.attributes;for(let n in r)t.update(r[n],e.ARRAY_BUFFER)}function l(e){let n=[],r=e.index,i=e.attributes.position,o=0;if(i===void 0)return;if(r!==null){let e=r.array;o=r.version;for(let t=0,r=e.length;t=65535?Wd:Hd)(n,1);s.version=o;let c=a.get(e);c&&t.remove(c),a.set(e,s)}function u(e){let t=a.get(e);if(t){let n=e.index;n!==null&&t.versiont.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);let h=new Float32Array(p*m*4*u),g=new fu(h,p,m,u);g.type=hs,g.needsUpdate=!0;let _=f*4;for(let t=0;t + #include + + void main() { + gl_FragColor = texture2D( tDiffuse, vUv ); + + #ifdef LINEAR_TONE_MAPPING + gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); + #elif defined( REINHARD_TONE_MAPPING ) + gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); + #elif defined( CINEON_TONE_MAPPING ) + gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); + #elif defined( ACES_FILMIC_TONE_MAPPING ) + gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); + #elif defined( AGX_TONE_MAPPING ) + gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); + #elif defined( NEUTRAL_TONE_MAPPING ) + gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); + #elif defined( CUSTOM_TONE_MAPPING ) + gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); + #endif + + #ifdef SRGB_TRANSFER + gl_FragColor = sRGBTransferOETF( gl_FragColor ); + #endif + }`,depthTest:!1,depthWrite:!1}),u=new Jf(c,l),d=new H_(-1,1,1,-1,0,1),f=null,p=null,m=!1,h,g=null,_=[],v=!1;this.setSize=function(e,t){o.setSize(e,t),s.setSize(e,t);for(let n=0;n<_.length;n++){let r=_[n];r.setSize&&r.setSize(e,t)}},this.setEffects=function(e){_=e,v=_.length>0&&_[0].isRenderPass===!0;let t=o.width,n=o.height;for(let e=0;e<_.length;e++){let r=_[e];r.setSize&&r.setSize(t,n)}},this.begin=function(e,t){if(m||e.toneMapping===0&&_.length===0)return!1;if(g=t,t!==null){let e=t.width,n=t.height;(o.width!==e||o.height!==n)&&this.setSize(e,n)}return v===!1&&e.setRenderTarget(o),h=e.toneMapping,e.toneMapping=0,!0},this.hasRenderPass=function(){return v},this.end=function(e,t){e.toneMapping=h,m=!0;let n=o,r=s;for(let i=0;i<_.length;i++){let a=_[i];if(a.enabled!==!1&&(a.render(e,r,n,t),a.needsSwap!==!1)){let e=n;n=r,r=e}}if(f!==e.outputColorSpace||p!==e.toneMapping){f=e.outputColorSpace,p=e.toneMapping,l.defines={},Ql.getTransfer(f)===`srgb`&&(l.defines.SRGB_TRANSFER=``);let t=Gb[p];t&&(l.defines[t]=``),l.needsUpdate=!0}l.uniforms.tDiffuse.value=n.texture,e.setRenderTarget(g),e.render(u,d),g=null,m=!1},this.isCompositing=function(){return m},this.dispose=function(){o.depthTexture&&o.depthTexture.dispose(),o.dispose(),s.dispose(),c.dispose(),l.dispose()}}var qb=new cu,Jb=new Em(1,1),Yb=new fu,Xb=new mu,Zb=new Cm,Qb=[],$b=[],ex=new Float32Array(16),tx=new Float32Array(9),nx=new Float32Array(4);function rx(e,t,n){let r=e[0];if(r<=0||r>0)return e;let i=t*n,a=Qb[i];if(a===void 0&&(a=new Float32Array(i),Qb[i]=a),t!==0){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function ix(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n0&&(this.seq=r.concat(i))}setValue(e,t,n,r){let i=this.map[t];i!==void 0&&i.setValue(e,n,r)}setOptional(e,t,n){let r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,a=t.length;i!==a;++i){let a=t[i],o=n[a.id];o.needsUpdate!==!1&&a.setValue(e,o.value,r)}}static seqWithValue(e,t){let n=[];for(let r=0,i=e.length;r!==i;++r){let i=e[r];i.id in t&&n.push(i)}return n}};function eS(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}var tS=37297,nS=0;function rS(e,t){let n=e.split(` +`),r=[],i=Math.max(t-6,0),a=Math.min(t+6,n.length);for(let e=i;e`:` `} ${i}: ${n[e]}`)}return r.join(` +`)}var iS=new W;function aS(e){Ql._getMatrix(iS,Ql.workingColorSpace,e);let t=`mat3( ${iS.elements.map(e=>e.toFixed(4))} )`;switch(Ql.getTransfer(e)){case Nc:return[t,`LinearTransferOETF`];case Pc:return[t,`sRGBTransferOETF`];default:return R(`WebGLProgram: Unsupported color space: `,e),[t,`LinearTransferOETF`]}}function oS(e,t,n){let r=e.getShaderParameter(t,e.COMPILE_STATUS),i=(e.getShaderInfoLog(t)||``).trim();if(r&&i===``)return``;let a=/ERROR: 0:(\d+)/.exec(i);if(a){let r=parseInt(a[1]);return n.toUpperCase()+` + +`+i+` + +`+rS(e.getShaderSource(t),r)}else return i}function sS(e,t){let n=aS(t);return[`vec4 ${e}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,`}`].join(` +`)}var cS={1:`Linear`,2:`Reinhard`,3:`Cineon`,4:`ACESFilmic`,6:`AgX`,7:`Neutral`,5:`Custom`};function lS(e,t){let n=cS[t];return n===void 0?(R(`WebGLProgram: Unsupported toneMapping:`,t),`vec3 `+e+`( vec3 color ) { return LinearToneMapping( color ); }`):`vec3 `+e+`( vec3 color ) { return `+n+`ToneMapping( color ); }`}var uS=new U;function dS(){return Ql.getLuminanceCoefficients(uS),[`float luminance( const in vec3 rgb ) {`,` const vec3 weights = vec3( ${uS.x.toFixed(4)}, ${uS.y.toFixed(4)}, ${uS.z.toFixed(4)} );`,` return dot( weights, rgb );`,`}`].join(` +`)}function fS(e){return[e.extensionClipCullDistance?`#extension GL_ANGLE_clip_cull_distance : require`:``,e.extensionMultiDraw?`#extension GL_ANGLE_multi_draw : require`:``].filter(hS).join(` +`)}function pS(e){let t=[];for(let n in e){let r=e[n];r!==!1&&t.push(`#define `+n+` `+r)}return t.join(` +`)}function mS(e,t){let n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function yS(e){return e.replace(vS,xS)}var bS=new Map;function xS(e,t){let n=Y[t];if(n===void 0){let e=bS.get(t);if(e!==void 0)n=Y[e],R(`WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.`,t,e);else throw Error(`THREE.WebGLProgram: Can not resolve #include <`+t+`>`)}return yS(n)}var SS=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function CS(e){return e.replace(SS,wS)}function wS(e,t,n,r){let i=``;for(let e=parseInt(t);e0&&(g+=` +`),_=[`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m].filter(hS).join(` +`),_.length>0&&(_+=` +`)):(g=[TS(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.extensionClipCullDistance?`#define USE_CLIP_DISTANCE`:``,n.batching?`#define USE_BATCHING`:``,n.batchingColor?`#define USE_BATCHING_COLOR`:``,n.instancing?`#define USE_INSTANCING`:``,n.instancingColor?`#define USE_INSTANCING_COLOR`:``,n.instancingMorph?`#define USE_INSTANCING_MORPH`:``,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.map?`#define USE_MAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+u:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.displacementMap?`#define USE_DISPLACEMENTMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.mapUv?`#define MAP_UV `+n.mapUv:``,n.alphaMapUv?`#define ALPHAMAP_UV `+n.alphaMapUv:``,n.lightMapUv?`#define LIGHTMAP_UV `+n.lightMapUv:``,n.aoMapUv?`#define AOMAP_UV `+n.aoMapUv:``,n.emissiveMapUv?`#define EMISSIVEMAP_UV `+n.emissiveMapUv:``,n.bumpMapUv?`#define BUMPMAP_UV `+n.bumpMapUv:``,n.normalMapUv?`#define NORMALMAP_UV `+n.normalMapUv:``,n.displacementMapUv?`#define DISPLACEMENTMAP_UV `+n.displacementMapUv:``,n.metalnessMapUv?`#define METALNESSMAP_UV `+n.metalnessMapUv:``,n.roughnessMapUv?`#define ROUGHNESSMAP_UV `+n.roughnessMapUv:``,n.anisotropyMapUv?`#define ANISOTROPYMAP_UV `+n.anisotropyMapUv:``,n.clearcoatMapUv?`#define CLEARCOATMAP_UV `+n.clearcoatMapUv:``,n.clearcoatNormalMapUv?`#define CLEARCOAT_NORMALMAP_UV `+n.clearcoatNormalMapUv:``,n.clearcoatRoughnessMapUv?`#define CLEARCOAT_ROUGHNESSMAP_UV `+n.clearcoatRoughnessMapUv:``,n.iridescenceMapUv?`#define IRIDESCENCEMAP_UV `+n.iridescenceMapUv:``,n.iridescenceThicknessMapUv?`#define IRIDESCENCE_THICKNESSMAP_UV `+n.iridescenceThicknessMapUv:``,n.sheenColorMapUv?`#define SHEEN_COLORMAP_UV `+n.sheenColorMapUv:``,n.sheenRoughnessMapUv?`#define SHEEN_ROUGHNESSMAP_UV `+n.sheenRoughnessMapUv:``,n.specularMapUv?`#define SPECULARMAP_UV `+n.specularMapUv:``,n.specularColorMapUv?`#define SPECULAR_COLORMAP_UV `+n.specularColorMapUv:``,n.specularIntensityMapUv?`#define SPECULAR_INTENSITYMAP_UV `+n.specularIntensityMapUv:``,n.transmissionMapUv?`#define TRANSMISSIONMAP_UV `+n.transmissionMapUv:``,n.thicknessMapUv?`#define THICKNESSMAP_UV `+n.thicknessMapUv:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexNormals?`#define HAS_NORMAL`:``,n.vertexColors?`#define USE_COLOR`:``,n.vertexAlphas?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.flatShading?`#define FLAT_SHADED`:``,n.skinning?`#define USE_SKINNING`:``,n.morphTargets?`#define USE_MORPHTARGETS`:``,n.morphNormals&&n.flatShading===!1?`#define USE_MORPHNORMALS`:``,n.morphColors?`#define USE_MORPHCOLORS`:``,n.morphTargetsCount>0?`#define MORPHTARGETS_TEXTURE_STRIDE `+n.morphTextureStride:``,n.morphTargetsCount>0?`#define MORPHTARGETS_COUNT `+n.morphTargetsCount:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.sizeAttenuation?`#define USE_SIZEATTENUATION`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 modelMatrix;`,`uniform mat4 modelViewMatrix;`,`uniform mat4 projectionMatrix;`,`uniform mat4 viewMatrix;`,`uniform mat3 normalMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,`#ifdef USE_INSTANCING`,` attribute mat4 instanceMatrix;`,`#endif`,`#ifdef USE_INSTANCING_COLOR`,` attribute vec3 instanceColor;`,`#endif`,`#ifdef USE_INSTANCING_MORPH`,` uniform sampler2D morphTexture;`,`#endif`,`attribute vec3 position;`,`attribute vec3 normal;`,`attribute vec2 uv;`,`#ifdef USE_UV1`,` attribute vec2 uv1;`,`#endif`,`#ifdef USE_UV2`,` attribute vec2 uv2;`,`#endif`,`#ifdef USE_UV3`,` attribute vec2 uv3;`,`#endif`,`#ifdef USE_TANGENT`,` attribute vec4 tangent;`,`#endif`,`#if defined( USE_COLOR_ALPHA )`,` attribute vec4 color;`,`#elif defined( USE_COLOR )`,` attribute vec3 color;`,`#endif`,`#ifdef USE_SKINNING`,` attribute vec4 skinIndex;`,` attribute vec4 skinWeight;`,`#endif`,` +`].filter(hS).join(` +`),_=[TS(n),`#define SHADER_TYPE `+n.shaderType,`#define SHADER_NAME `+n.shaderName,m,n.useFog&&n.fog?`#define USE_FOG`:``,n.useFog&&n.fogExp2?`#define FOG_EXP2`:``,n.alphaToCoverage?`#define ALPHA_TO_COVERAGE`:``,n.map?`#define USE_MAP`:``,n.matcap?`#define USE_MATCAP`:``,n.envMap?`#define USE_ENVMAP`:``,n.envMap?`#define `+l:``,n.envMap?`#define `+u:``,n.envMap?`#define `+d:``,f?`#define CUBEUV_TEXEL_WIDTH `+f.texelWidth:``,f?`#define CUBEUV_TEXEL_HEIGHT `+f.texelHeight:``,f?`#define CUBEUV_MAX_MIP `+f.maxMip+`.0`:``,n.lightMap?`#define USE_LIGHTMAP`:``,n.aoMap?`#define USE_AOMAP`:``,n.bumpMap?`#define USE_BUMPMAP`:``,n.normalMap?`#define USE_NORMALMAP`:``,n.normalMapObjectSpace?`#define USE_NORMALMAP_OBJECTSPACE`:``,n.normalMapTangentSpace?`#define USE_NORMALMAP_TANGENTSPACE`:``,n.packedNormalMap?`#define USE_PACKED_NORMALMAP`:``,n.emissiveMap?`#define USE_EMISSIVEMAP`:``,n.anisotropy?`#define USE_ANISOTROPY`:``,n.anisotropyMap?`#define USE_ANISOTROPYMAP`:``,n.clearcoat?`#define USE_CLEARCOAT`:``,n.clearcoatMap?`#define USE_CLEARCOATMAP`:``,n.clearcoatRoughnessMap?`#define USE_CLEARCOAT_ROUGHNESSMAP`:``,n.clearcoatNormalMap?`#define USE_CLEARCOAT_NORMALMAP`:``,n.dispersion?`#define USE_DISPERSION`:``,n.iridescence?`#define USE_IRIDESCENCE`:``,n.iridescenceMap?`#define USE_IRIDESCENCEMAP`:``,n.iridescenceThicknessMap?`#define USE_IRIDESCENCE_THICKNESSMAP`:``,n.specularMap?`#define USE_SPECULARMAP`:``,n.specularColorMap?`#define USE_SPECULAR_COLORMAP`:``,n.specularIntensityMap?`#define USE_SPECULAR_INTENSITYMAP`:``,n.roughnessMap?`#define USE_ROUGHNESSMAP`:``,n.metalnessMap?`#define USE_METALNESSMAP`:``,n.alphaMap?`#define USE_ALPHAMAP`:``,n.alphaTest?`#define USE_ALPHATEST`:``,n.alphaHash?`#define USE_ALPHAHASH`:``,n.sheen?`#define USE_SHEEN`:``,n.sheenColorMap?`#define USE_SHEEN_COLORMAP`:``,n.sheenRoughnessMap?`#define USE_SHEEN_ROUGHNESSMAP`:``,n.transmission?`#define USE_TRANSMISSION`:``,n.transmissionMap?`#define USE_TRANSMISSIONMAP`:``,n.thicknessMap?`#define USE_THICKNESSMAP`:``,n.vertexTangents&&n.flatShading===!1?`#define USE_TANGENT`:``,n.vertexColors||n.instancingColor?`#define USE_COLOR`:``,n.vertexAlphas||n.batchingColor?`#define USE_COLOR_ALPHA`:``,n.vertexUv1s?`#define USE_UV1`:``,n.vertexUv2s?`#define USE_UV2`:``,n.vertexUv3s?`#define USE_UV3`:``,n.pointsUvs?`#define USE_POINTS_UV`:``,n.gradientMap?`#define USE_GRADIENTMAP`:``,n.flatShading?`#define FLAT_SHADED`:``,n.doubleSided?`#define DOUBLE_SIDED`:``,n.flipSided?`#define FLIP_SIDED`:``,n.shadowMapEnabled?`#define USE_SHADOWMAP`:``,n.shadowMapEnabled?`#define `+c:``,n.premultipliedAlpha?`#define PREMULTIPLIED_ALPHA`:``,n.numLightProbes>0?`#define USE_LIGHT_PROBES`:``,n.numLightProbeGrids>0?`#define USE_LIGHT_PROBES_GRID`:``,n.decodeVideoTexture?`#define DECODE_VIDEO_TEXTURE`:``,n.decodeVideoTextureEmissive?`#define DECODE_VIDEO_TEXTURE_EMISSIVE`:``,n.logarithmicDepthBuffer?`#define USE_LOGARITHMIC_DEPTH_BUFFER`:``,n.reversedDepthBuffer?`#define USE_REVERSED_DEPTH_BUFFER`:``,`uniform mat4 viewMatrix;`,`uniform vec3 cameraPosition;`,`uniform bool isOrthographic;`,n.toneMapping===0?``:`#define TONE_MAPPING`,n.toneMapping===0?``:Y.tonemapping_pars_fragment,n.toneMapping===0?``:lS(`toneMapping`,n.toneMapping),n.dithering?`#define DITHERING`:``,n.opaque?`#define OPAQUE`:``,Y.colorspace_pars_fragment,sS(`linearToOutputTexel`,n.outputColorSpace),dS(),n.useDepthPacking?`#define DEPTH_PACKING `+n.depthPacking:``,` +`].filter(hS).join(` +`)),o=yS(o),o=gS(o,n),o=_S(o,n),s=yS(s),s=gS(s,n),s=_S(s,n),o=CS(o),s=CS(s),n.isRawShaderMaterial!==!0&&(v=`#version 300 es +`,g=[p,`#define attribute in`,`#define varying out`,`#define texture2D texture`].join(` +`)+` +`+g,_=[`#define varying in`,n.glslVersion===`300 es`?``:`layout(location = 0) out highp vec4 pc_fragColor;`,n.glslVersion===`300 es`?``:`#define gl_FragColor pc_fragColor`,`#define gl_FragDepthEXT gl_FragDepth`,`#define texture2D texture`,`#define textureCube texture`,`#define texture2DProj textureProj`,`#define texture2DLodEXT textureLod`,`#define texture2DProjLodEXT textureProjLod`,`#define textureCubeLodEXT textureLod`,`#define texture2DGradEXT textureGrad`,`#define texture2DProjGradEXT textureProjGrad`,`#define textureCubeGradEXT textureGrad`].join(` +`)+` +`+_);let y=v+g+o,b=v+_+s,x=eS(i,i.VERTEX_SHADER,y),S=eS(i,i.FRAGMENT_SHADER,b);i.attachShader(h,x),i.attachShader(h,S),n.index0AttributeName===void 0?n.hasPositionAttribute===!0&&i.bindAttribLocation(h,0,`position`):i.bindAttribLocation(h,0,n.index0AttributeName),i.linkProgram(h);function C(t){if(e.debug.checkShaderErrors){let n=i.getProgramInfoLog(h)||``,r=i.getShaderInfoLog(x)||``,a=i.getShaderInfoLog(S)||``,o=n.trim(),s=r.trim(),c=a.trim(),l=!0,u=!0;if(i.getProgramParameter(h,i.LINK_STATUS)===!1)if(l=!1,typeof e.debug.onShaderError==`function`)e.debug.onShaderError(i,h,x,S);else{let e=oS(i,x,`vertex`),n=oS(i,S,`fragment`);z(`WebGLProgram: Shader Error `+i.getError()+` - VALIDATE_STATUS `+i.getProgramParameter(h,i.VALIDATE_STATUS)+` + +Material Name: `+t.name+` +Material Type: `+t.type+` + +Program Info Log: `+o+` +`+e+` +`+n)}else o===``?(s===``||c===``)&&(u=!1):R(`WebGLProgram: Program Info Log:`,o);u&&(t.diagnostics={runnable:l,programLog:o,vertexShader:{log:s,prefix:g},fragmentShader:{log:c,prefix:_}})}i.deleteShader(x),i.deleteShader(S),w=new $x(i,h),T=mS(i,h)}let w;this.getUniforms=function(){return w===void 0&&C(this),w};let T;this.getAttributes=function(){return T===void 0&&C(this),T};let E=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return E===!1&&(E=i.getProgramParameter(h,tS)),E},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(h),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=nS++,this.cacheKey=t,this.usedTimes=1,this.program=h,this.vertexShader=x,this.fragmentShader=S,this}var IS=0,LS=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e,t,n){let r=this._getShaderCacheForMaterial(e);return r.has(t)===!1&&(r.add(t),t.usedTimes++),r.has(n)===!1&&(r.add(n),n.usedTimes++),this}remove(e){let t=this.materialCache.get(e);for(let e of t)e.usedTimes--,e.usedTimes===0&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderStage(e){return this._getShaderStage(e.vertexShader)}getFragmentShaderStage(e){return this._getShaderStage(e.fragmentShader)}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){let t=this.materialCache,n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){let t=this.shaderCache,n=t.get(e);return n===void 0&&(n=new RS(e),t.set(e,n)),n}},RS=class{constructor(e){this.id=IS++,this.code=e,this.usedTimes=0}};function zS(e){return e===1030||e===37490||e===36285}function BS(e,t,n,r,i,a){let o=new Eu,s=new LS,c=new Set,l=[],u=new Map,d=r.logarithmicDepthBuffer,f=r.precision,p={MeshDepthMaterial:`depth`,MeshDistanceMaterial:`distance`,MeshNormalMaterial:`normal`,MeshBasicMaterial:`basic`,MeshLambertMaterial:`lambert`,MeshPhongMaterial:`phong`,MeshToonMaterial:`toon`,MeshStandardMaterial:`physical`,MeshPhysicalMaterial:`physical`,MeshMatcapMaterial:`matcap`,LineBasicMaterial:`basic`,LineDashedMaterial:`dashed`,PointsMaterial:`points`,ShadowMaterial:`shadow`,SpriteMaterial:`sprite`};function m(e){return c.add(e),e===0?`uv`:`uv${e}`}function h(i,o,l,u,h,g){let _=u.fog,v=h.geometry,y=i.isMeshStandardMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial?u.environment:null,b=i.isMeshStandardMaterial||i.isMeshLambertMaterial&&!i.envMap||i.isMeshPhongMaterial&&!i.envMap,x=t.get(i.envMap||y,b),S=x&&x.mapping===306?x.image.height:null,C=p[i.type];i.precision!==null&&(f=r.getMaxPrecision(i.precision),f!==i.precision&&R(`WebGLProgram.getParameters:`,i.precision,`not supported, using`,f,`instead.`));let w=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,T=w===void 0?0:w.length,E=0;v.morphAttributes.position!==void 0&&(E=1),v.morphAttributes.normal!==void 0&&(E=2),v.morphAttributes.color!==void 0&&(E=3);let D,O,k,A;if(C){let e=cb[C];D=e.vertexShader,O=e.fragmentShader}else{D=i.vertexShader,O=i.fragmentShader;let e=s.getVertexShaderStage(i),t=s.getFragmentShaderStage(i);s.update(i,e,t),k=e.id,A=t.id}let j=e.getRenderTarget(),ee=e.state.buffers.depth.getReversed(),M=h.isInstancedMesh===!0,te=h.isBatchedMesh===!0,N=!!i.map,P=!!i.matcap,ne=!!x,re=!!i.aoMap,ie=!!i.lightMap,ae=!!i.bumpMap&&i.wireframe===!1,oe=!!i.normalMap,se=!!i.displacementMap,ce=!!i.emissiveMap,le=!!i.metalnessMap,ue=!!i.roughnessMap,de=i.anisotropy>0,fe=i.clearcoat>0,pe=i.dispersion>0,me=i.iridescence>0,he=i.sheen>0,ge=i.transmission>0,_e=de&&!!i.anisotropyMap,ve=fe&&!!i.clearcoatMap,ye=fe&&!!i.clearcoatNormalMap,be=fe&&!!i.clearcoatRoughnessMap,xe=me&&!!i.iridescenceMap,Se=me&&!!i.iridescenceThicknessMap,F=he&&!!i.sheenColorMap,Ce=he&&!!i.sheenRoughnessMap,we=!!i.specularMap,Te=!!i.specularColorMap,I=!!i.specularIntensityMap,Ee=ge&&!!i.transmissionMap,L=ge&&!!i.thicknessMap,De=!!i.gradientMap,Oe=!!i.alphaMap,ke=i.alphaTest>0,Ae=!!i.alphaHash,je=!!i.extensions,Me=0;i.toneMapped&&(j===null||j.isXRRenderTarget===!0)&&(Me=e.toneMapping);let Ne={shaderID:C,shaderType:i.type,shaderName:i.name,vertexShader:D,fragmentShader:O,defines:i.defines,customVertexShaderID:k,customFragmentShaderID:A,isRawShaderMaterial:i.isRawShaderMaterial===!0,glslVersion:i.glslVersion,precision:f,batching:te,batchingColor:te&&h._colorsTexture!==null,instancing:M,instancingColor:M&&h.instanceColor!==null,instancingMorph:M&&h.morphTexture!==null,outputColorSpace:j===null?e.outputColorSpace:j.isXRRenderTarget===!0?j.texture.colorSpace:Ql.workingColorSpace,alphaToCoverage:!!i.alphaToCoverage,map:N,matcap:P,envMap:ne,envMapMode:ne&&x.mapping,envMapCubeUVHeight:S,aoMap:re,lightMap:ie,bumpMap:ae,normalMap:oe,displacementMap:se,emissiveMap:ce,normalMapObjectSpace:oe&&i.normalMapType===1,normalMapTangentSpace:oe&&i.normalMapType===0,packedNormalMap:oe&&i.normalMapType===0&&zS(i.normalMap.format),metalnessMap:le,roughnessMap:ue,anisotropy:de,anisotropyMap:_e,clearcoat:fe,clearcoatMap:ve,clearcoatNormalMap:ye,clearcoatRoughnessMap:be,dispersion:pe,iridescence:me,iridescenceMap:xe,iridescenceThicknessMap:Se,sheen:he,sheenColorMap:F,sheenRoughnessMap:Ce,specularMap:we,specularColorMap:Te,specularIntensityMap:I,transmission:ge,transmissionMap:Ee,thicknessMap:L,gradientMap:De,opaque:i.transparent===!1&&i.blending===1&&i.alphaToCoverage===!1,alphaMap:Oe,alphaTest:ke,alphaHash:Ae,combine:i.combine,mapUv:N&&m(i.map.channel),aoMapUv:re&&m(i.aoMap.channel),lightMapUv:ie&&m(i.lightMap.channel),bumpMapUv:ae&&m(i.bumpMap.channel),normalMapUv:oe&&m(i.normalMap.channel),displacementMapUv:se&&m(i.displacementMap.channel),emissiveMapUv:ce&&m(i.emissiveMap.channel),metalnessMapUv:le&&m(i.metalnessMap.channel),roughnessMapUv:ue&&m(i.roughnessMap.channel),anisotropyMapUv:_e&&m(i.anisotropyMap.channel),clearcoatMapUv:ve&&m(i.clearcoatMap.channel),clearcoatNormalMapUv:ye&&m(i.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:be&&m(i.clearcoatRoughnessMap.channel),iridescenceMapUv:xe&&m(i.iridescenceMap.channel),iridescenceThicknessMapUv:Se&&m(i.iridescenceThicknessMap.channel),sheenColorMapUv:F&&m(i.sheenColorMap.channel),sheenRoughnessMapUv:Ce&&m(i.sheenRoughnessMap.channel),specularMapUv:we&&m(i.specularMap.channel),specularColorMapUv:Te&&m(i.specularColorMap.channel),specularIntensityMapUv:I&&m(i.specularIntensityMap.channel),transmissionMapUv:Ee&&m(i.transmissionMap.channel),thicknessMapUv:L&&m(i.thicknessMap.channel),alphaMapUv:Oe&&m(i.alphaMap.channel),vertexTangents:!!v.attributes.tangent&&(oe||de),vertexNormals:!!v.attributes.normal,vertexColors:i.vertexColors,vertexAlphas:i.vertexColors===!0&&!!v.attributes.color&&v.attributes.color.itemSize===4,pointsUvs:h.isPoints===!0&&!!v.attributes.uv&&(N||Oe),fog:!!_,useFog:i.fog===!0,fogExp2:!!_&&_.isFogExp2,flatShading:i.wireframe===!1&&(i.flatShading===!0||v.attributes.normal===void 0&&oe===!1&&(i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshPhysicalMaterial)),sizeAttenuation:i.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:ee,skinning:h.isSkinnedMesh===!0,hasPositionAttribute:v.attributes.position!==void 0,morphTargets:v.morphAttributes.position!==void 0,morphNormals:v.morphAttributes.normal!==void 0,morphColors:v.morphAttributes.color!==void 0,morphTargetsCount:T,morphTextureStride:E,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numLightProbeGrids:g.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:Me,decodeVideoTexture:N&&i.map.isVideoTexture===!0&&Ql.getTransfer(i.map.colorSpace)===`srgb`,decodeVideoTextureEmissive:ce&&i.emissiveMap.isVideoTexture===!0&&Ql.getTransfer(i.emissiveMap.colorSpace)===`srgb`,premultipliedAlpha:i.premultipliedAlpha,doubleSided:i.side===2,flipSided:i.side===1,useDepthPacking:i.depthPacking>=0,depthPacking:i.depthPacking||0,index0AttributeName:i.index0AttributeName,extensionClipCullDistance:je&&i.extensions.clipCullDistance===!0&&n.has(`WEBGL_clip_cull_distance`),extensionMultiDraw:(je&&i.extensions.multiDraw===!0||te)&&n.has(`WEBGL_multi_draw`),rendererExtensionParallelShaderCompile:n.has(`KHR_parallel_shader_compile`),customProgramCacheKey:i.customProgramCacheKey()};return Ne.vertexUv1s=c.has(1),Ne.vertexUv2s=c.has(2),Ne.vertexUv3s=c.has(3),c.clear(),Ne}function g(t){let n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),t.defines!==void 0)for(let e in t.defines)n.push(e),n.push(t.defines[e]);return t.isRawShaderMaterial===!1&&(_(n,t),v(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()}function _(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}function v(e,t){o.disableAll(),t.instancing&&o.enable(0),t.instancingColor&&o.enable(1),t.instancingMorph&&o.enable(2),t.matcap&&o.enable(3),t.envMap&&o.enable(4),t.normalMapObjectSpace&&o.enable(5),t.normalMapTangentSpace&&o.enable(6),t.clearcoat&&o.enable(7),t.iridescence&&o.enable(8),t.alphaTest&&o.enable(9),t.vertexColors&&o.enable(10),t.vertexAlphas&&o.enable(11),t.vertexUv1s&&o.enable(12),t.vertexUv2s&&o.enable(13),t.vertexUv3s&&o.enable(14),t.vertexTangents&&o.enable(15),t.anisotropy&&o.enable(16),t.alphaHash&&o.enable(17),t.batching&&o.enable(18),t.dispersion&&o.enable(19),t.batchingColor&&o.enable(20),t.gradientMap&&o.enable(21),t.packedNormalMap&&o.enable(22),t.vertexNormals&&o.enable(23),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reversedDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),t.numLightProbeGrids>0&&o.enable(22),t.hasPositionAttribute&&o.enable(23),e.push(o.mask)}function y(e){let t=p[e.type],n;if(t){let e=cb[t];n=Tg.clone(e.uniforms)}else n=e.uniforms;return n}function b(t,n){let r=u.get(n);return r===void 0?(r=new FS(e,n,t,i),l.push(r),u.set(n,r)):++r.usedTimes,r}function x(e){if(--e.usedTimes===0){let t=l.indexOf(e);l[t]=l[l.length-1],l.pop(),u.delete(e.cacheKey),e.destroy()}}function S(e){s.remove(e)}function C(){s.dispose()}return{getParameters:h,getProgramCacheKey:g,getUniforms:y,acquireProgram:b,releaseProgram:x,releaseShaderCache:S,programs:l,dispose:C}}function VS(){let e=new WeakMap;function t(t){return e.has(t)}function n(t){let n=e.get(t);return n===void 0&&(n={},e.set(t,n)),n}function r(t){e.delete(t)}function i(t,n,r){e.get(t)[n]=r}function a(){e=new WeakMap}return{has:t,get:n,remove:r,update:i,dispose:a}}function HS(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.material.id===t.material.id?e.materialVariant===t.materialVariant?e.z===t.z?e.id-t.id:e.z-t.z:e.materialVariant-t.materialVariant:e.material.id-t.material.id:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function US(e,t){return e.groupOrder===t.groupOrder?e.renderOrder===t.renderOrder?e.z===t.z?e.id-t.id:t.z-e.z:e.renderOrder-t.renderOrder:e.groupOrder-t.groupOrder}function WS(){let e=[],t=0,n=[],r=[],i=[];function a(){t=0,n.length=0,r.length=0,i.length=0}function o(e){let t=0;return e.isInstancedMesh&&(t+=2),e.isSkinnedMesh&&(t+=1),t}function s(n,r,i,a,s,c){let l=e[t];return l===void 0?(l={id:n.id,object:n,geometry:r,material:i,materialVariant:o(n),groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.materialVariant=o(n),l.groupOrder=a,l.renderOrder=n.renderOrder,l.z=s,l.group=c),t++,l}function c(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.push(u):a.transparent===!0?i.push(u):n.push(u)}function l(e,t,a,o,c,l){let u=s(e,t,a,o,c,l);a.transmission>0?r.unshift(u):a.transparent===!0?i.unshift(u):n.unshift(u)}function u(e,t,a){n.length>1&&n.sort(e||HS),r.length>1&&r.sort(t||US),i.length>1&&i.sort(t||US),a&&(n.reverse(),r.reverse(),i.reverse())}function d(){for(let n=t,r=e.length;n=r.length?(i=new WS,r.push(i)):i=r[n],i}function n(){e=new WeakMap}return{get:t,dispose:n}}function KS(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={direction:new U,color:new K};break;case`SpotLight`:n={position:new U,direction:new U,color:new K,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case`PointLight`:n={position:new U,color:new K,distance:0,decay:0};break;case`HemisphereLight`:n={direction:new U,skyColor:new K,groundColor:new K};break;case`RectAreaLight`:n={color:new K,position:new U,halfWidth:new U,halfHeight:new U};break}return e[t.id]=n,n}}}function qS(){let e={};return{get:function(t){if(e[t.id]!==void 0)return e[t.id];let n;switch(t.type){case`DirectionalLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H};break;case`SpotLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H};break;case`PointLight`:n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new H,shadowCameraNear:1,shadowCameraFar:1e3};break}return e[t.id]=n,n}}}var JS=0;function YS(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+ +!!t.map-!!e.map}function XS(e){let t=new KS,n=qS(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new U);let i=new U,a=new G,o=new G;function s(i){let a=0,o=0,s=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0,_=0,v=0;i.sort(YS);for(let e=0,y=i.length;e0&&(e.has(`OES_texture_float_linear`)===!0?(r.rectAreaLTC1=X.LTC_FLOAT_1,r.rectAreaLTC2=X.LTC_FLOAT_2):(r.rectAreaLTC1=X.LTC_HALF_1,r.rectAreaLTC2=X.LTC_HALF_2)),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=s;let y=r.hash;(y.directionalLength!==c||y.pointLength!==l||y.spotLength!==u||y.rectAreaLength!==d||y.hemiLength!==f||y.numDirectionalShadows!==p||y.numPointShadows!==m||y.numSpotShadows!==h||y.numSpotMaps!==g||y.numLightProbes!==v)&&(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=l,r.hemi.length=f,r.directionalShadow.length=p,r.directionalShadowMap.length=p,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=h,r.spotShadowMap.length=h,r.directionalShadowMatrix.length=p,r.pointShadowMatrix.length=m,r.spotLightMatrix.length=h+g-_,r.spotLightMap.length=g,r.numSpotLightShadowsWithMaps=_,r.numLightProbes=v,y.directionalLength=c,y.pointLength=l,y.spotLength=u,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=h,y.numSpotMaps=g,y.numLightProbes=v,r.version=JS++)}function c(e,t){let n=0,s=0,c=0,l=0,u=0,d=t.matrixWorldInverse;for(let t=0,f=e.length;t=i.length?(a=new ZS(e),i.push(a)):a=i[r],a}function r(){t=new WeakMap}return{get:n,dispose:r}}var $S=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,eC=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); + gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); +}`,tC=[new U(1,0,0),new U(-1,0,0),new U(0,1,0),new U(0,-1,0),new U(0,0,1),new U(0,0,-1)],nC=[new U(0,-1,0),new U(0,-1,0),new U(0,0,1),new U(0,0,-1),new U(0,-1,0),new U(0,-1,0)],rC=new G,iC=new U,aC=new U;function oC(e,t,n){let r=new Op,i=new H,a=new H,o=new lu,s=new Ig,c=new Lg,l={},u=n.maxTextureSize,d={0:1,1:0,2:2},f=new Og({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new H},radius:{value:4}},vertexShader:$S,fragmentShader:eC}),p=f.clone();p.defines.HORIZONTAL_PASS=1;let m=new J;m.setAttribute(`position`,new Ld(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let h=new Jf(m,f),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let _=this.type;this.render=function(t,n,s){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||t.length===0)return;this.type===2&&(R(`WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead.`),this.type=1);let c=e.getRenderTarget(),l=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),f=e.state;f.setBlending(0),f.buffers.depth.getReversed()===!0?f.buffers.color.setClear(0,0,0,0):f.buffers.color.setClear(1,1,1,1),f.buffers.depth.setTest(!0),f.setScissorTest(!1);let p=_!==this.type;p&&n.traverse(function(e){e.material&&(Array.isArray(e.material)?e.material.forEach(e=>e.needsUpdate=!0):e.material.needsUpdate=!0)});for(let c=0,l=t.length;cu||i.y>u)&&(i.x>u&&(a.x=Math.floor(u/m.x),i.x=a.x*m.x,d.mapSize.x=a.x),i.y>u&&(a.y=Math.floor(u/m.y),i.y=a.y*m.y,d.mapSize.y=a.y));let h=e.state.buffers.depth.getReversed();if(d.camera._reversedDepth=h,d.map===null||p===!0){if(d.map!==null&&(d.map.depthTexture!==null&&(d.map.depthTexture.dispose(),d.map.depthTexture=null),d.map.dispose()),this.type===3){if(l.isPointLight){R(`WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.`);continue}d.map=new du(i.x,i.y,{format:ks,type:gs,minFilter:is,magFilter:is,generateMipmaps:!1}),d.map.texture.name=l.name+`.shadowMap`,d.map.depthTexture=new Em(i.x,i.y,hs),d.map.depthTexture.name=l.name+`.shadowMapDepth`,d.map.depthTexture.format=Ts,d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=$o,d.map.depthTexture.magFilter=$o}else l.isPointLight?(d.map=new Lb(i.x),d.map.depthTexture=new Dm(i.x,ms)):(d.map=new du(i.x,i.y),d.map.depthTexture=new Em(i.x,i.y,ms)),d.map.depthTexture.name=l.name+`.shadowMap`,d.map.depthTexture.format=Ts,this.type===1?(d.map.depthTexture.compareFunction=h?518:515,d.map.depthTexture.minFilter=is,d.map.depthTexture.magFilter=is):(d.map.depthTexture.compareFunction=null,d.map.depthTexture.minFilter=$o,d.map.depthTexture.magFilter=$o);d.camera.updateProjectionMatrix()}let g=d.map.isWebGLCubeRenderTarget?6:1;for(let t=0;t0||n.map&&n.alphaTest>0||n.alphaToCoverage===!0){let e=a.uuid,t=n.uuid,r=l[e];r===void 0&&(r={},l[e]=r);let i=r[t];i===void 0&&(i=a.clone(),r[t]=i,n.addEventListener(`dispose`,x)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,i===3?a.side=n.shadowSide===null?n.side:n.shadowSide:a.side=n.shadowSide===null?d[n.side]:n.shadowSide,a.alphaMap=n.alphaMap,a.alphaTest=n.alphaToCoverage===!0?.5:n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r.isPointLight===!0&&a.isMeshDistanceMaterial===!0){let t=e.properties.get(a);t.light=r}return a}function b(n,i,a,o,s){if(n.visible===!1)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===3)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);let r=t.update(n),c=n.material;if(Array.isArray(c)){let t=r.groups;for(let l=0,u=t.length;l=2):(te=parseFloat(/^WebGL (\d)/.exec(N)[1]),M=te>=1);let P=null,ne={},re=e.getParameter(e.SCISSOR_BOX),ie=e.getParameter(e.VIEWPORT),ae=new lu().fromArray(re),oe=new lu().fromArray(ie);function se(t,n,r,i){let a=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let o=0;o`u`?!1:/OculusBrowser/g.test(navigator.userAgent),l=new H,u=new WeakMap,d=new Set,f,p=new WeakMap,m=!1;try{m=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)!==null}catch{}function h(e,t){return m?new OffscreenCanvas(e,t):cl(`canvas`)}function g(e,t,n){let r=1,i=Te(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1)if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap||typeof VideoFrame<`u`&&e instanceof VideoFrame){let n=Math.floor(r*i.width),a=Math.floor(r*i.height);f===void 0&&(f=h(n,a));let o=t?h(n,a):f;return o.width=n,o.height=a,o.getContext(`2d`).drawImage(e,0,0,n,a),R(`WebGLRenderer: Texture has been resized from (`+i.width+`x`+i.height+`) to (`+n+`x`+a+`).`),o}else return`data`in e&&R(`WebGLRenderer: Image in DataTexture is too big (`+i.width+`x`+i.height+`).`),e;return e}function _(e){return e.generateMipmaps}function v(t){e.generateMipmap(t)}function y(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function b(n,r,i,a,o,s=!1){if(n!==null){if(e[n]!==void 0)return e[n];R(`WebGLRenderer: Attempt to use non-existing WebGL internal format '`+n+`'`)}let c;a&&(c=t.get(`EXT_texture_norm16`),c||R(`WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension`));let l=r;if(r===e.RED&&(i===e.FLOAT&&(l=e.R32F),i===e.HALF_FLOAT&&(l=e.R16F),i===e.UNSIGNED_BYTE&&(l=e.R8),i===e.UNSIGNED_SHORT&&c&&(l=c.R16_EXT),i===e.SHORT&&c&&(l=c.R16_SNORM_EXT)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.R8UI),i===e.UNSIGNED_SHORT&&(l=e.R16UI),i===e.UNSIGNED_INT&&(l=e.R32UI),i===e.BYTE&&(l=e.R8I),i===e.SHORT&&(l=e.R16I),i===e.INT&&(l=e.R32I)),r===e.RG&&(i===e.FLOAT&&(l=e.RG32F),i===e.HALF_FLOAT&&(l=e.RG16F),i===e.UNSIGNED_BYTE&&(l=e.RG8),i===e.UNSIGNED_SHORT&&c&&(l=c.RG16_EXT),i===e.SHORT&&c&&(l=c.RG16_SNORM_EXT)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RG8UI),i===e.UNSIGNED_SHORT&&(l=e.RG16UI),i===e.UNSIGNED_INT&&(l=e.RG32UI),i===e.BYTE&&(l=e.RG8I),i===e.SHORT&&(l=e.RG16I),i===e.INT&&(l=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGB8UI),i===e.UNSIGNED_SHORT&&(l=e.RGB16UI),i===e.UNSIGNED_INT&&(l=e.RGB32UI),i===e.BYTE&&(l=e.RGB8I),i===e.SHORT&&(l=e.RGB16I),i===e.INT&&(l=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(l=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(l=e.RGBA16UI),i===e.UNSIGNED_INT&&(l=e.RGBA32UI),i===e.BYTE&&(l=e.RGBA8I),i===e.SHORT&&(l=e.RGBA16I),i===e.INT&&(l=e.RGBA32I)),r===e.RGB&&(i===e.UNSIGNED_SHORT&&c&&(l=c.RGB16_EXT),i===e.SHORT&&c&&(l=c.RGB16_SNORM_EXT),i===e.UNSIGNED_INT_5_9_9_9_REV&&(l=e.RGB9_E5),i===e.UNSIGNED_INT_10F_11F_11F_REV&&(l=e.R11F_G11F_B10F)),r===e.RGBA){let t=s?Nc:Ql.getTransfer(o);i===e.FLOAT&&(l=e.RGBA32F),i===e.HALF_FLOAT&&(l=e.RGBA16F),i===e.UNSIGNED_BYTE&&(l=t===`srgb`?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT&&c&&(l=c.RGBA16_EXT),i===e.SHORT&&c&&(l=c.RGBA16_SNORM_EXT),i===e.UNSIGNED_SHORT_4_4_4_4&&(l=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(l=e.RGB5_A1)}return(l===e.R16F||l===e.R32F||l===e.RG16F||l===e.RG32F||l===e.RGBA16F||l===e.RGBA32F)&&t.get(`EXT_color_buffer_float`),l}function x(t,n){let r;return t?n===null||n===1014||n===1020?r=e.DEPTH24_STENCIL8:n===1015?r=e.DEPTH32F_STENCIL8:n===1012&&(r=e.DEPTH24_STENCIL8,R(`DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.`)):n===null||n===1014||n===1020?r=e.DEPTH_COMPONENT24:n===1015?r=e.DEPTH_COMPONENT32F:n===1012&&(r=e.DEPTH_COMPONENT16),r}function S(e,t){return _(e)===!0||e.isFramebufferTexture&&e.minFilter!==1003&&e.minFilter!==1006?Math.log2(Math.max(t.width,t.height))+1:e.mipmaps!==void 0&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function C(e){let t=e.target;t.removeEventListener(`dispose`,C),T(t),t.isVideoTexture&&u.delete(t),t.isHTMLTexture&&d.delete(t)}function w(e){let t=e.target;t.removeEventListener(`dispose`,w),D(t)}function T(e){let t=r.get(e);if(t.__webglInit===void 0)return;let n=e.source,i=p.get(n);if(i){let r=i[t.__cacheKey];r.usedTimes--,r.usedTimes===0&&E(e),Object.keys(i).length===0&&p.delete(n)}r.remove(e)}function E(t){let n=r.get(t);e.deleteTexture(n.__webglTexture);let i=t.source,a=p.get(i);delete a[n.__cacheKey],o.memory.textures--}function D(t){let n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r=i.maxTextures&&R(`WebGLTextures: Trying to use `+e+` texture units while this GPU supports only `+i.maxTextures),O+=1,e}function M(e){let t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}function te(t,i){let a=r.get(t);if(t.isVideoTexture&&Ce(t),t.isRenderTargetTexture===!1&&t.isExternalTexture!==!0&&t.version>0&&a.__version!==t.version){let e=t.image;if(e===null)R(`WebGLRenderer: Texture marked for update but no image data found.`);else if(e.complete===!1)R(`WebGLRenderer: Texture marked for update but image is incomplete`);else{ue(a,t,i);return}}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D,a.__webglTexture,e.TEXTURE0+i)}function N(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ue(a,t,i);return}else t.isExternalTexture&&(a.__webglTexture=t.sourceTexture?t.sourceTexture:null);n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture,e.TEXTURE0+i)}function P(t,i){let a=r.get(t);if(t.isRenderTargetTexture===!1&&t.version>0&&a.__version!==t.version){ue(a,t,i);return}n.bindTexture(e.TEXTURE_3D,a.__webglTexture,e.TEXTURE0+i)}function ne(t,i){let a=r.get(t);if(t.isCubeDepthTexture!==!0&&t.version>0&&a.__version!==t.version){de(a,t,i);return}n.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture,e.TEXTURE0+i)}let re={[Xo]:e.REPEAT,[Zo]:e.CLAMP_TO_EDGE,[Qo]:e.MIRRORED_REPEAT},ie={[$o]:e.NEAREST,[es]:e.NEAREST_MIPMAP_NEAREST,[ns]:e.NEAREST_MIPMAP_LINEAR,[is]:e.LINEAR,[as]:e.LINEAR_MIPMAP_NEAREST,[ss]:e.LINEAR_MIPMAP_LINEAR},ae={512:e.NEVER,519:e.ALWAYS,513:e.LESS,515:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function oe(n,a){if(a.type===1015&&t.has(`OES_texture_float_linear`)===!1&&(a.magFilter===1006||a.magFilter===1007||a.magFilter===1005||a.magFilter===1008||a.minFilter===1006||a.minFilter===1007||a.minFilter===1005||a.minFilter===1008)&&R(`WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.`),e.texParameteri(n,e.TEXTURE_WRAP_S,re[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,re[a.wrapT]),(n===e.TEXTURE_3D||n===e.TEXTURE_2D_ARRAY)&&e.texParameteri(n,e.TEXTURE_WRAP_R,re[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,ie[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,ie[a.minFilter]),a.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,ae[a.compareFunction])),t.has(`EXT_texture_filter_anisotropic`)===!0){if(a.magFilter===1003||a.minFilter!==1005&&a.minFilter!==1008||a.type===1015&&t.has(`OES_texture_float_linear`)===!1)return;if(a.anisotropy>1||r.get(a).__currentAnisotropy){let o=t.get(`EXT_texture_filter_anisotropic`);e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy}}}function se(t,n){let r=!1;t.__webglInit===void 0&&(t.__webglInit=!0,n.addEventListener(`dispose`,C));let i=n.source,a=p.get(i);a===void 0&&(a={},p.set(i,a));let s=M(n);if(s!==t.__cacheKey){a[s]===void 0&&(a[s]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;let i=a[t.__cacheKey];i!==void 0&&(a[t.__cacheKey].usedTimes--,i.usedTimes===0&&E(n)),t.__cacheKey=s,t.__webglTexture=a[s].texture}return r}function ce(e,t,n){return Math.floor(Math.floor(e/n)/t)}function le(t,r,i,a){let o=t.updateRanges;if(o.length===0)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,a,r.data);else{o.sort((e,t)=>e.start-t.start);let s=0;for(let e=1;e0){C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t0){let t=nb(h.width,h.height,o.format,o.type);for(let a of o.layerUpdates){let o=h.data.subarray(a*t/h.data.BYTES_PER_ELEMENT,(a+1)*t/h.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,a,h.width,h.height,1,r,o)}o.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,h.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,h.data,0,0);else R(`WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()`);else C?T&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,i,0,0,0,h.width,h.height,t.depth,r,p,h.data):n.texImage3D(e.TEXTURE_2D_ARRAY,i,m,h.width,h.height,t.depth,0,r,p,h.data)}else{C&&w&&n.texStorage2D(e.TEXTURE_2D,E,m,y[0].width,y[0].height);for(let t=0,i=y.length;t0){let i=nb(t.width,t.height,o.format,o.type);for(let a of o.layerUpdates){let o=t.data.subarray(a*i/t.data.BYTES_PER_ELEMENT,(a+1)*i/t.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,a,t.width,t.height,1,r,p,o)}o.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isData3DTexture)C?(w&&n.texStorage3D(e.TEXTURE_3D,E,m,t.width,t.height,t.depth),T&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,t.width,t.height,t.depth,r,p,t.data)):n.texImage3D(e.TEXTURE_3D,0,m,t.width,t.height,t.depth,0,r,p,t.data);else if(o.isFramebufferTexture){if(w)if(C)n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height);else{let i=t.width,a=t.height;for(let t=0;t>=1,a>>=1}}else if(o.isHTMLTexture){if(`texElementImage2D`in e){let n=e.canvas;if(n.hasAttribute(`layoutsubtree`)||n.setAttribute(`layoutsubtree`,`true`),t.parentNode!==n){n.appendChild(t),d.add(o),n.onpaint=e=>{let t=e.changedElements;for(let e of d)t.includes(e.image)&&(e.needsUpdate=!0)},n.requestPaint();return}if(e.texElementImage2D.length===3)e.texElementImage2D(e.TEXTURE_2D,e.RGBA8,t);else{let n=e.RGBA,r=e.RGBA,i=e.UNSIGNED_BYTE;e.texElementImage2D(e.TEXTURE_2D,0,n,r,i,t)}e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}}else if(y.length>0){if(C&&w){let t=Te(y[0]);n.texStorage2D(e.TEXTURE_2D,E,m,t.width,t.height)}for(let t=0,i=y.length;t0&&D++;let t=Te(m[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,D,C,t.width,t.height)}for(let t=0;t<6;t++)if(p){w?E&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m[t].width,m[t].height,y,x,m[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,C,m[t].width,m[t].height,0,y,x,m[t].data);for(let r=0;r>u),r=Math.max(1,i.height>>u);l===e.TEXTURE_3D||l===e.TEXTURE_2D_ARRAY?n.texImage3D(l,u,p,t,r,i.depth,0,d,f,null):n.texImage2D(l,u,p,t,r,0,d,f,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),F(i)?s.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,c,l,h.__webglTexture,0,Se(i)):(l===e.TEXTURE_2D||l>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,c,l,h.__webglTexture,u),n.bindFramebuffer(e.FRAMEBUFFER,null)}function pe(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){let i=n.depthTexture,a=i&&i.isDepthTexture?i.type:null,o=x(n.stencilBuffer,a),c=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;F(n)?s.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,Se(n),o,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,Se(n),o,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,c,e.RENDERBUFFER,t)}else{let t=n.textures;for(let i=0;i{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener(`dispose`,t)};e.addEventListener(`dispose`,t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer)if(a)for(let e=0;e<6;e++)me(i.__webglFramebuffer[e],t,e);else{let e=t.texture.mipmaps;e&&e.length>0?me(i.__webglFramebuffer[0],t,0):me(i.__webglFramebuffer,t,0)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]===void 0)i.__webglDepthbuffer[r]=e.createRenderbuffer(),pe(i.__webglDepthbuffer[r],t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,a=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,a),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,a)}}else{let r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer===void 0)i.__webglDepthbuffer=e.createRenderbuffer(),pe(i.__webglDepthbuffer,t,!1);else{let n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}function ge(t,n,i){let a=r.get(t);n!==void 0&&fe(a.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),i!==void 0&&he(t)}function _e(t){let i=t.texture,s=r.get(t),c=r.get(i);t.addEventListener(`dispose`,w);let l=t.textures,u=t.isWebGLCubeRenderTarget===!0,d=l.length>1;if(d||(c.__webglTexture===void 0&&(c.__webglTexture=e.createTexture()),c.__version=i.version,o.memory.textures++),u){s.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){s.__webglFramebuffer[t]=[];for(let n=0;n0){s.__webglFramebuffer=[];for(let t=0;t0&&F(t)===!1){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer);for(let n=0;n0)for(let r=0;r0)for(let n=0;n0){if(F(t)===!1){let i=t.textures,a=t.width,o=t.height,s=e.COLOR_BUFFER_BIT,l=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=r.get(t),d=i.length>1;if(d)for(let t=0;t0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n0&&t.has(`WEBGL_multisampled_render_to_texture`)===!0&&n.__useRenderToTexture!==!1}function Ce(e){let t=o.render.frame;u.get(e)!==t&&(u.set(e,t),e.update())}function we(e,t){let n=e.colorSpace,r=e.format,i=e.type;return e.isCompressedTexture===!0||e.isVideoTexture===!0||n!==`srgb-linear`&&n!==``&&(Ql.getTransfer(n)===`srgb`?(r!==1023||i!==1009)&&R(`WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.`):z(`WebGLTextures: Unsupported texture color space:`,n)),t}function Te(e){return typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement?(l.width=e.naturalWidth||e.width,l.height=e.naturalHeight||e.height):typeof VideoFrame<`u`&&e instanceof VideoFrame?(l.width=e.displayWidth,l.height=e.displayHeight):(l.width=e.width,l.height=e.height),l}this.allocateTextureUnit=ee,this.resetTextureUnits=k,this.getTextureUnits=A,this.setTextureUnits=j,this.setTexture2D=te,this.setTexture2DArray=N,this.setTexture3D=P,this.setTextureCube=ne,this.rebindTextures=ge,this.setupRenderTarget=_e,this.updateRenderTargetMipmap=ve,this.updateMultisampleRenderTarget=xe,this.setupDepthRenderbuffer=he,this.setupFrameBufferTexture=fe,this.useMultisampledRTT=F,this.isReversedDepthBuffer=function(){return n.buffers.depth.getReversed()}}function lC(e,t){function n(n,r=``){let i,a=Ql.getTransfer(r);if(n===1009)return e.UNSIGNED_BYTE;if(n===1017)return e.UNSIGNED_SHORT_4_4_4_4;if(n===1018)return e.UNSIGNED_SHORT_5_5_5_1;if(n===35902)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===35899)return e.UNSIGNED_INT_10F_11F_11F_REV;if(n===1010)return e.BYTE;if(n===1011)return e.SHORT;if(n===1012)return e.UNSIGNED_SHORT;if(n===1013)return e.INT;if(n===1014)return e.UNSIGNED_INT;if(n===1015)return e.FLOAT;if(n===1016)return e.HALF_FLOAT;if(n===1021)return e.ALPHA;if(n===1022)return e.RGB;if(n===1023)return e.RGBA;if(n===1026)return e.DEPTH_COMPONENT;if(n===1027)return e.DEPTH_STENCIL;if(n===1028)return e.RED;if(n===1029)return e.RED_INTEGER;if(n===1030)return e.RG;if(n===1031)return e.RG_INTEGER;if(n===1033)return e.RGBA_INTEGER;if(n===33776||n===33777||n===33778||n===33779)if(a===`srgb`)if(i=t.get(`WEBGL_compressed_texture_s3tc_srgb`),i!==null){if(n===33776)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(i=t.get(`WEBGL_compressed_texture_s3tc`),i!==null){if(n===33776)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===33777)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===33778)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===33779)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===35840||n===35841||n===35842||n===35843)if(i=t.get(`WEBGL_compressed_texture_pvrtc`),i!==null){if(n===35840)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===35841)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===35842)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===35843)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===36196||n===37492||n===37496||n===37488||n===37489||n===37490||n===37491)if(i=t.get(`WEBGL_compressed_texture_etc`),i!==null){if(n===36196||n===37492)return a===`srgb`?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===37496)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC;if(n===37488)return i.COMPRESSED_R11_EAC;if(n===37489)return i.COMPRESSED_SIGNED_R11_EAC;if(n===37490)return i.COMPRESSED_RG11_EAC;if(n===37491)return i.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===37808||n===37809||n===37810||n===37811||n===37812||n===37813||n===37814||n===37815||n===37816||n===37817||n===37818||n===37819||n===37820||n===37821)if(i=t.get(`WEBGL_compressed_texture_astc`),i!==null){if(n===37808)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===37809)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===37810)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===37811)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===37812)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===37813)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===37814)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===37815)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===37816)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===37817)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===37818)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===37819)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===37820)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===37821)return a===`srgb`?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===36492||n===36494||n===36495)if(i=t.get(`EXT_texture_compression_bptc`),i!==null){if(n===36492)return a===`srgb`?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===36494)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===36495)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===36283||n===36284||n===36285||n===36286)if(i=t.get(`EXT_texture_compression_rgtc`),i!==null){if(n===36283)return i.COMPRESSED_RED_RGTC1_EXT;if(n===36284)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===36285)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===36286)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===1020?e.UNSIGNED_INT_24_8:e[n]===void 0?null:e[n]}return{convert:n}}var uC=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,dC=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`,fC=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){let n=new Om(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){let t=e.cameras[0].viewport,n=new Og({vertexShader:uC,fragmentShader:dC,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Jf(new sg(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},pC=class extends yl{constructor(e,t){super();let n=this,r=null,i=1,a=null,o=`local-floor`,s=1,c=null,l=null,u=null,d=null,f=null,p=null,m=typeof XRWebGLBinding<`u`,h=new fC,g={},_=t.getContextAttributes(),v=null,y=null,b=[],x=[],S=new H,C=null,w=new L_;w.viewport=new lu;let T=new L_;T.viewport=new lu;let E=[w,T],D=new _v,O=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=b[e];return t===void 0&&(t=new Gu,b[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=b[e];return t===void 0&&(t=new Gu,b[e]=t),t.getGripSpace()},this.getHand=function(e){let t=b[e];return t===void 0&&(t=new Gu,b[e]=t),t.getHandSpace()};function A(e){let t=x.indexOf(e.inputSource);if(t===-1)return;let n=b[t];n!==void 0&&(n.update(e.inputSource,e.frame,c||a),n.dispatchEvent({type:e.type,data:e.inputSource}))}function j(){r.removeEventListener(`select`,A),r.removeEventListener(`selectstart`,A),r.removeEventListener(`selectend`,A),r.removeEventListener(`squeeze`,A),r.removeEventListener(`squeezestart`,A),r.removeEventListener(`squeezeend`,A),r.removeEventListener(`end`,j),r.removeEventListener(`inputsourceschange`,ee);for(let e=0;e=0&&(x[r]=null,b[r].disconnect(n))}for(let t=0;t=x.length){x.push(n),r=e;break}else if(x[e]===null){x[e]=n,r=e;break}if(r===-1)break}let i=b[r];i&&i.connect(n)}}let M=new U,te=new U;function N(e,t,n){M.setFromMatrixPosition(t.matrixWorld),te.setFromMatrixPosition(n.matrixWorld);let r=M.distanceTo(te),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],d=(a[8]+1)/a[0],f=o*u,p=o*d,m=r/(-u+d),h=m*-u;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(h),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),i[10]===-1)e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{let t=o+m,n=s+m,i=f-h,a=p+(r-h),u=c*s/n*t,d=l*s/n*t;e.projectionMatrix.makePerspective(i,a,u,d,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}function P(e,t){t===null?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(r===null)return;let t=e.near,n=e.far;h.texture!==null&&(h.depthNear>0&&(t=h.depthNear),h.depthFar>0&&(n=h.depthFar)),D.near=T.near=w.near=t,D.far=T.far=w.far=n,(O!==D.near||k!==D.far)&&(r.updateRenderState({depthNear:D.near,depthFar:D.far}),O=D.near,k=D.far),D.layers.mask=e.layers.mask|6,w.layers.mask=D.layers.mask&-5,T.layers.mask=D.layers.mask&-3;let i=e.parent,a=D.cameras;P(D,i);for(let e=0;e0&&(e.alphaTest.value=r.alphaTest);let i=t.get(r),a=i.envMap,o=i.envMapRotation;a&&(e.envMap.value=a,e.envMapRotation.value.setFromMatrix4(mC.makeRotationFromEuler(o)).transpose(),a.isCubeTexture&&a.isRenderTargetTexture===!1&&e.envMapRotation.value.premultiply(hC),e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}function o(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}function s(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function c(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=i*.5,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function l(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}function u(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}function d(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function f(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function p(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),t.side===1&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}function m(e,t){t.matcap&&(e.matcap.value=t.matcap)}function h(e,n){let r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function _C(e,t,n,r){let i={},a={},o=[],s=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function c(e,t){let n=t.program;r.uniformBlockBinding(e,n)}function l(e,n){let o=i[e.id];o===void 0&&(g(e),o=u(e),i[e.id]=o,e.addEventListener(`dispose`,v));let s=n.program;r.updateUBOMapping(e,s);let c=t.render.frame;a[e.id]!==c&&(f(e),a[e.id]=c)}function u(t){let n=d();t.__bindingPointIndex=n;let r=e.createBuffer(),i=t.__size,a=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,a),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}function d(){for(let e=0;e0&&(n+=16-r),e.__size=n,e.__cache={},this}function _(e){let t={boundary:0,storage:0};return typeof e==`number`||typeof e==`boolean`?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture?R(`WebGLRenderer: Texture samplers can not be part of an uniforms group.`):ArrayBuffer.isView(e)?(t.boundary=16,t.storage=e.byteLength):R(`WebGLRenderer: Unsupported uniform value type.`,e),t}function v(t){let n=t.target;n.removeEventListener(`dispose`,v);let r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}function y(){for(let t in i)e.deleteBuffer(i[t]);o=[],i={},a={}}return{bind:c,update:l,dispose:y}}var vC=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]),yC=null;function bC(){return yC===null&&(yC=new cp(vC,16,16,ks,gs),yC.name=`DFG_LUT`,yC.minFilter=is,yC.magFilter=is,yC.wrapS=Zo,yC.wrapT=Zo,yC.generateMipmaps=!1,yC.needsUpdate=!0),yC}var xC=class{constructor(e={}){let{canvas:t=ll(),context:n=null,depth:r=!0,stencil:i=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:s=!0,preserveDrawingBuffer:c=!1,powerPreference:l=`default`,failIfMajorPerformanceCaveat:u=!1,reversedDepthBuffer:d=!1,outputBufferType:f=ls}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<`u`&&n instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);p=n.getContextAttributes().alpha}else p=a;let m=f,h=new Set([Ms,As,Os]),g=new Set([ls,ms,fs,ys,_s,vs]),_=new Uint32Array(4),v=new Int32Array(4),y=new U,b=null,x=null,S=[],C=[],w=null;this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let T=this,E=!1,D=null,O=null,k=null,A=null;this._outputColorSpace=jc;let j=0,ee=0,M=null,te=-1,N=null,P=new lu,ne=new lu,re=null,ie=new K(0),ae=0,oe=t.width,se=t.height,ce=1,le=null,ue=null,de=new lu(0,0,oe,se),fe=new lu(0,0,oe,se),pe=!1,me=new Op,he=!1,ge=!1,_e=new G,ve=new U,ye=new lu,be={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},xe=!1;function Se(){return M===null?ce:1}let F=n;function Ce(e,n){return t.getContext(e,n)}try{let e={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(`setAttribute`in t&&t.setAttribute(`data-engine`,`three.js r185`),t.addEventListener(`webglcontextlost`,qe,!1),t.addEventListener(`webglcontextrestored`,Je,!1),t.addEventListener(`webglcontextcreationerror`,Ye,!1),F===null){let t=`webgl2`;if(F=Ce(t,e),F===null)throw Ce(t)?Error(`THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.`):Error(`THREE.WebGLRenderer: Error creating WebGL context.`)}}catch(e){throw z(`WebGLRenderer: `+e.message),e}let we,Te,I,Ee,L,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We;function Ge(){we=new zb(F),we.init(),He=new lC(F,we),Te=new hb(F,we,e,He),I=new sC(F,we),Te.reversedDepthBuffer&&d&&I.buffers.depth.setReversed(!0),O=F.createFramebuffer(),k=F.createFramebuffer(),A=F.createFramebuffer(),Ee=new Hb(F),L=new VS,De=new cC(F,we,I,L,Te,He,Ee),Oe=new Rb(T),ke=new sb(F),Ue=new pb(F,ke),Ae=new Bb(F,ke,Ee,Ue),je=new Wb(F,Ae,ke,Ue,Ee),ze=new Ub(F,Te,De),Ie=new gb(L),Me=new BS(T,Oe,we,Te,Ue,Ie),Ne=new gC(T,L),Pe=new GS,Fe=new QS(we),Re=new fb(T,Oe,I,je,p,s),Le=new oC(T,je,Te),We=new _C(F,Ee,Te,I),Be=new mb(F,we,Ee),Ve=new Vb(F,we,Ee),Ee.programs=Me.programs,T.capabilities=Te,T.extensions=we,T.properties=L,T.renderLists=Pe,T.shadowMap=Le,T.state=I,T.info=Ee}Ge(),m!==1009&&(w=new Kb(m,t.width,t.height,o,r,i));let Ke=new pC(T,F);this.xr=Ke,this.getContext=function(){return F},this.getContextAttributes=function(){return F.getContextAttributes()},this.forceContextLoss=function(){let e=we.get(`WEBGL_lose_context`);e&&e.loseContext()},this.forceContextRestore=function(){let e=we.get(`WEBGL_lose_context`);e&&e.restoreContext()},this.getPixelRatio=function(){return ce},this.setPixelRatio=function(e){e!==void 0&&(ce=e,this.setSize(oe,se,!1))},this.getSize=function(e){return e.set(oe,se)},this.setSize=function(e,n,r=!0){if(Ke.isPresenting){R(`WebGLRenderer: Can't change size while VR device is presenting.`);return}oe=e,se=n,t.width=Math.floor(e*ce),t.height=Math.floor(n*ce),r===!0&&(t.style.width=e+`px`,t.style.height=n+`px`),w!==null&&w.setSize(t.width,t.height),this.setViewport(0,0,e,n)},this.getDrawingBufferSize=function(e){return e.set(oe*ce,se*ce).floor()},this.setDrawingBufferSize=function(e,n,r){oe=e,se=n,ce=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.setEffects=function(e){if(m===1009){z(`WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.`);return}if(e){for(let t=0;t{function n(){if(r.forEach(function(e){L.get(e).currentProgram.isReady()&&r.delete(e)}),r.size===0){t(e);return}setTimeout(n,10)}we.get(`KHR_parallel_shader_compile`)===null?setTimeout(n,10):n()})};let et=null;function tt(e){et&&et(e)}function nt(){it.stop()}function rt(){it.start()}let it=new ob;it.setAnimationLoop(tt),typeof self<`u`&&it.setContext(self),this.setAnimationLoop=function(e){et=e,Ke.setAnimationLoop(e),e===null?it.stop():it.start()},Ke.addEventListener(`sessionstart`,nt),Ke.addEventListener(`sessionend`,rt),this.render=function(e,t){if(t!==void 0&&t.isCamera!==!0){z(`WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(E===!0)return;D!==null&&D.renderStart(e,t);let n=Ke.enabled===!0&&Ke.isPresenting===!0,r=w!==null&&(M===null||n)&&w.begin(T,M);if(e.matrixWorldAutoUpdate===!0&&e.updateMatrixWorld(),t.parent===null&&t.matrixWorldAutoUpdate===!0&&t.updateMatrixWorld(),Ke.enabled===!0&&Ke.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(Ke.cameraAutoUpdate===!0&&Ke.updateCamera(t),t=Ke.getCamera()),e.isScene===!0&&e.onBeforeRender(T,e,t,M),x=Fe.get(e,C.length),x.init(t),x.state.textureUnits=De.getTextureUnits(),C.push(x),_e.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),me.setFromProjectionMatrix(_e,Qc,t.reversedDepth),ge=this.localClippingEnabled,he=Ie.init(this.clippingPlanes,ge),b=Pe.get(e,S.length),b.init(),S.push(b),Ke.enabled===!0&&Ke.isPresenting===!0){let e=T.xr.getDepthSensingMesh();e!==null&&at(e,t,-1/0,T.sortObjects)}at(e,t,0,T.sortObjects),b.finish(),T.sortObjects===!0&&b.sort(le,ue,t.reversedDepth),xe=Ke.enabled===!1||Ke.isPresenting===!1||Ke.hasDepthSensing()===!1,xe&&Re.addToRenderList(b,e),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),he===!0&&Ie.beginShadows();let i=x.state.shadowsArray;if(Le.render(i,e,t),he===!0&&Ie.endShadows(),(r&&w.hasRenderPass())===!1){let n=b.opaque,r=b.transmissive;if(x.setupLights(),t.isArrayCamera){let i=t.cameras;if(r.length>0)for(let t=0,a=i.length;t0&&st(n,r,e,t),xe&&Re.render(e),ot(b,e,t)}M!==null&&ee===0&&(De.updateMultisampleRenderTarget(M),De.updateRenderTargetMipmap(M)),r&&w.end(T),e.isScene===!0&&e.onAfterRender(T,e,t),Ue.resetDefaultState(),te=-1,N=null,C.pop(),C.length>0?(x=C[C.length-1],De.setTextureUnits(x.state.textureUnits),he===!0&&Ie.setGlobalState(T.clippingPlanes,x.state.camera)):x=null,S.pop(),b=S.length>0?S[S.length-1]:null,D!==null&&D.renderEnd()};function at(e,t,n,r){if(e.visible===!1)return;if(e.layers.test(t.layers)){if(e.isGroup)n=e.renderOrder;else if(e.isLOD)e.autoUpdate===!0&&e.update(t);else if(e.isLightProbeGrid)x.pushLightProbeGrid(e);else if(e.isLight)x.pushLight(e),e.castShadow&&x.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||me.intersectsSprite(e)){r&&ye.setFromMatrixPosition(e.matrixWorld).applyMatrix4(_e);let t=je.update(e),i=e.material;i.visible&&b.push(e,t,i,n,ye.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||me.intersectsObject(e))){let t=je.update(e),i=e.material;if(r&&(e.boundingSphere===void 0?(t.boundingSphere===null&&t.computeBoundingSphere(),ye.copy(t.boundingSphere.center)):(e.boundingSphere===null&&e.computeBoundingSphere(),ye.copy(e.boundingSphere.center)),ye.applyMatrix4(e.matrixWorld).applyMatrix4(_e)),Array.isArray(i)){let r=t.groups;for(let a=0,o=r.length;a0&&ct(i,t,n),a.length>0&&ct(a,t,n),o.length>0&&ct(o,t,n),I.buffers.depth.setTest(!0),I.buffers.depth.setMask(!0),I.buffers.color.setMask(!0),I.setPolygonOffset(!1)}function st(e,t,n,r){if((n.isScene===!0?n.overrideMaterial:null)!==null)return;if(x.state.transmissionRenderTarget[r.id]===void 0){let e=we.has(`EXT_color_buffer_half_float`)||we.has(`EXT_color_buffer_float`);x.state.transmissionRenderTarget[r.id]=new du(1,1,{generateMipmaps:!0,type:e?gs:ls,minFilter:ss,samples:Math.max(4,Te.samples),stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Ql.workingColorSpace})}let a=x.state.transmissionRenderTarget[r.id],o=r.viewport||P;a.setSize(o.z*T.transmissionResolutionScale,o.w*T.transmissionResolutionScale);let s=T.getRenderTarget(),c=T.getActiveCubeFace(),l=T.getActiveMipmapLevel();T.setRenderTarget(a),T.getClearColor(ie),ae=T.getClearAlpha(),ae<1&&T.setClearColor(16777215,.5),T.clear(),xe&&Re.render(n);let u=T.toneMapping;T.toneMapping=0;let d=r.viewport;if(r.viewport!==void 0&&(r.viewport=void 0),x.setupLightsView(r),he===!0&&Ie.setGlobalState(T.clippingPlanes,r),ct(e,n,r),De.updateMultisampleRenderTarget(a),De.updateRenderTargetMipmap(a),we.has(`WEBGL_multisampled_render_to_texture`)===!1){let e=!1;for(let i=0,a=t.length;i0,r.currentProgram=d,r.uniformsList=null,d}function dt(e){if(e.uniformsList===null){let t=e.currentProgram.getUniforms();e.uniformsList=$x.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function ft(e,t){let n=L.get(e);n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function pt(e,t){if(e.length===0)return null;if(e.length===1)return e[0].texture===null?null:e[0];y.setFromMatrixPosition(t.matrixWorld);for(let t=0,n=e.length;t0),f=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,h=0;r.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(h=T.toneMapping);let g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,_=g===void 0?0:g.length,v=L.get(r),y=x.state.lights;if(he===!0&&(ge===!0||e!==N)){let t=e===N&&r.id===te;Ie.setState(r,e,t)}let b=!1;r.version===v.__version?v.needsLights&&v.lightsStateVersion!==y.state.version?b=!0:v.outputColorSpace===s?i.isBatchedMesh&&v.batching===!1||!i.isBatchedMesh&&v.batching===!0||i.isBatchedMesh&&v.batchingColor===!0&&i.colorTexture===null||i.isBatchedMesh&&v.batchingColor===!1&&i.colorTexture!==null||i.isInstancedMesh&&v.instancing===!1||!i.isInstancedMesh&&v.instancing===!0||i.isSkinnedMesh&&v.skinning===!1||!i.isSkinnedMesh&&v.skinning===!0||i.isInstancedMesh&&v.instancingColor===!0&&i.instanceColor===null||i.isInstancedMesh&&v.instancingColor===!1&&i.instanceColor!==null||i.isInstancedMesh&&v.instancingMorph===!0&&i.morphTexture===null||i.isInstancedMesh&&v.instancingMorph===!1&&i.morphTexture!==null?b=!0:v.envMap===l?r.fog===!0&&v.fog!==a||v.numClippingPlanes!==void 0&&(v.numClippingPlanes!==Ie.numPlanes||v.numIntersection!==Ie.numIntersection)?b=!0:v.vertexAlphas===u&&v.vertexTangents===d&&v.morphTargets===f&&v.morphNormals===p&&v.morphColors===m&&v.toneMapping===h&&v.morphTargetsCount===_?!!v.lightProbeGrid!=x.state.lightProbeGridArray.length>0&&(b=!0):b=!0:b=!0:b=!0:(b=!0,v.__version=r.version);let S=v.currentProgram;b===!0&&(S=ut(r,t,i),D&&r.isNodeMaterial&&D.onUpdateProgram(r,S,v));let C=!1,w=!1,E=!1,O=S.getUniforms(),k=v.uniforms;if(I.useProgram(S.program)&&(C=!0,w=!0,E=!0),r.id!==te&&(te=r.id,w=!0),v.needsLights){let e=pt(x.state.lightProbeGridArray,i);v.lightProbeGrid!==e&&(v.lightProbeGrid=e,w=!0)}if(C||N!==e){I.buffers.depth.getReversed()&&e.reversedDepth!==!0&&(e._reversedDepth=!0,e.updateProjectionMatrix()),O.setValue(F,`projectionMatrix`,e.projectionMatrix),O.setValue(F,`viewMatrix`,e.matrixWorldInverse);let t=O.map.cameraPosition;t!==void 0&&t.setValue(F,ve.setFromMatrixPosition(e.matrixWorld)),Te.logarithmicDepthBuffer&&O.setValue(F,`logDepthBufFC`,2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&O.setValue(F,`isOrthographic`,e.isOrthographicCamera===!0),N!==e&&(N=e,w=!0,E=!0)}if(v.needsLights&&(y.state.directionalShadowMap.length>0&&O.setValue(F,`directionalShadowMap`,y.state.directionalShadowMap,De),y.state.spotShadowMap.length>0&&O.setValue(F,`spotShadowMap`,y.state.spotShadowMap,De),y.state.pointShadowMap.length>0&&O.setValue(F,`pointShadowMap`,y.state.pointShadowMap,De)),i.isSkinnedMesh){O.setOptional(F,i,`bindMatrix`),O.setOptional(F,i,`bindMatrixInverse`);let e=i.skeleton;e&&(e.boneTexture===null&&e.computeBoneTexture(),O.setValue(F,`boneTexture`,e.boneTexture,De))}i.isBatchedMesh&&(O.setOptional(F,i,`batchingTexture`),O.setValue(F,`batchingTexture`,i._matricesTexture,De),O.setOptional(F,i,`batchingIdTexture`),O.setValue(F,`batchingIdTexture`,i._indirectTexture,De),O.setOptional(F,i,`batchingColorTexture`),i._colorsTexture!==null&&O.setValue(F,`batchingColorTexture`,i._colorsTexture,De));let A=n.morphAttributes;if((A.position!==void 0||A.normal!==void 0||A.color!==void 0)&&ze.update(i,n,S),(w||v.receiveShadow!==i.receiveShadow)&&(v.receiveShadow=i.receiveShadow,O.setValue(F,`receiveShadow`,i.receiveShadow)),(r.isMeshStandardMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial)&&r.envMap===null&&t.environment!==null&&(k.envMapIntensity.value=t.environmentIntensity),k.dfgLUT!==void 0&&(k.dfgLUT.value=bC()),w){if(O.setValue(F,`toneMappingExposure`,T.toneMappingExposure),v.needsLights&&ht(k,E),a&&r.fog===!0&&Ne.refreshFogUniforms(k,a),Ne.refreshMaterialUniforms(k,r,ce,se,x.state.transmissionRenderTarget[e.id]),v.needsLights&&v.lightProbeGrid){let e=v.lightProbeGrid;k.probesSH.value=e.texture,k.probesMin.value.copy(e.boundingBox.min),k.probesMax.value.copy(e.boundingBox.max),k.probesResolution.value.copy(e.resolution)}$x.upload(F,dt(v),k,De)}if(r.isShaderMaterial&&r.uniformsNeedUpdate===!0&&($x.upload(F,dt(v),k,De),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&O.setValue(F,`center`,i.center),O.setValue(F,`modelViewMatrix`,i.modelViewMatrix),O.setValue(F,`normalMatrix`,i.normalMatrix),O.setValue(F,`modelMatrix`,i.matrixWorld),r.uniformsGroups!==void 0){let e=r.uniformsGroups;for(let t=0,n=e.length;t0&&De.useMultisampledRTT(e)===!1?L.get(e).__webglMultisampledFramebuffer:Array.isArray(c)?c[n]:c,P.copy(e.viewport),ne.copy(e.scissor),re=e.scissorTest}else P.copy(de).multiplyScalar(ce).floor(),ne.copy(fe).multiplyScalar(ce).floor(),re=pe;if(n!==0&&(r=O),I.bindFramebuffer(F.FRAMEBUFFER,r)&&I.drawBuffers(e,r),I.viewport(P),I.scissor(ne),I.setScissorTest(re),i){let r=L.get(e.texture);F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){let r=t;for(let t=0;t1&&F.readBuffer(F.COLOR_ATTACHMENT0+s),!Te.textureFormatReadable(c)){z(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!Te.textureTypeReadable(l)){z(`WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&F.readPixels(t,n,r,i,He.convert(c),He.convert(l),a)}finally{let e=M===null?null:L.get(M).__webglFramebuffer;I.bindFramebuffer(F.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,a,o,s=0){if(!(e&&e.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let c=L.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&o!==void 0&&(c=c[o]),c)if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){I.bindFramebuffer(F.FRAMEBUFFER,c);let o=e.textures[s],l=o.format,u=o.type;if(e.textures.length>1&&F.readBuffer(F.COLOR_ATTACHMENT0+s),!Te.textureFormatReadable(l))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!Te.textureTypeReadable(u))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let d=F.createBuffer();F.bindBuffer(F.PIXEL_PACK_BUFFER,d),F.bufferData(F.PIXEL_PACK_BUFFER,a.byteLength,F.STREAM_READ),F.readPixels(t,n,r,i,He.convert(l),He.convert(u),0);let f=M===null?null:L.get(M).__webglFramebuffer;I.bindFramebuffer(F.FRAMEBUFFER,f);let p=F.fenceSync(F.SYNC_GPU_COMMANDS_COMPLETE,0);return F.flush(),await _l(F,p,4),F.bindBuffer(F.PIXEL_PACK_BUFFER,d),F.getBufferSubData(F.PIXEL_PACK_BUFFER,0,a),F.deleteBuffer(d),F.deleteSync(p),a}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(e,t=null,n=0){let r=2**-n,i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r),o=t===null?0:t.x,s=t===null?0:t.y;De.setTexture2D(e,0),F.copyTexSubImage2D(F.TEXTURE_2D,n,0,0,o,s,i,a),I.unbindTexture()},this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,a=0){let o,s,c,l,u,d,f,p,m,h=e.isCompressedTexture?e.mipmaps[a]:e.image;if(n!==null)o=n.max.x-n.min.x,s=n.max.y-n.min.y,c=n.isBox3?n.max.z-n.min.z:1,l=n.min.x,u=n.min.y,d=n.isBox3?n.min.z:0;else{let t=2**-i;o=Math.floor(h.width*t),s=Math.floor(h.height*t),c=e.isDataArrayTexture?h.depth:e.isData3DTexture?Math.floor(h.depth*t):1,l=0,u=0,d=0}r===null?(f=0,p=0,m=0):(f=r.x,p=r.y,m=r.z);let g=He.convert(t.format),_=He.convert(t.type),v;t.isData3DTexture?(De.setTexture3D(t,0),v=F.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(De.setTexture2DArray(t,0),v=F.TEXTURE_2D_ARRAY):(De.setTexture2D(t,0),v=F.TEXTURE_2D),I.activeTexture(F.TEXTURE0),I.pixelStorei(F.UNPACK_FLIP_Y_WEBGL,t.flipY),I.pixelStorei(F.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),I.pixelStorei(F.UNPACK_ALIGNMENT,t.unpackAlignment);let y=I.getParameter(F.UNPACK_ROW_LENGTH),b=I.getParameter(F.UNPACK_IMAGE_HEIGHT),x=I.getParameter(F.UNPACK_SKIP_PIXELS),S=I.getParameter(F.UNPACK_SKIP_ROWS),C=I.getParameter(F.UNPACK_SKIP_IMAGES);I.pixelStorei(F.UNPACK_ROW_LENGTH,h.width),I.pixelStorei(F.UNPACK_IMAGE_HEIGHT,h.height),I.pixelStorei(F.UNPACK_SKIP_PIXELS,l),I.pixelStorei(F.UNPACK_SKIP_ROWS,u),I.pixelStorei(F.UNPACK_SKIP_IMAGES,d);let w=e.isDataArrayTexture||e.isData3DTexture,T=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){let n=L.get(e),r=L.get(t),h=L.get(n.__renderTarget),g=L.get(r.__renderTarget);I.bindFramebuffer(F.READ_FRAMEBUFFER,h.__webglFramebuffer),I.bindFramebuffer(F.DRAW_FRAMEBUFFER,g.__webglFramebuffer);for(let n=0;n{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return SC(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}var wC=new WeakMap,TC=(...e)=>{let t=e[0],n=Na()?.proxy??Se();if(n==null&&!In())throw Error(`injectLocal must be called in setup`);return n&&wC.has(n)&&t in wC.get(n)?wC.get(n)[t]:Fn(...e)};function EC(e,t){let n=Na()?.proxy??Se();if(n==null)throw Error(`provideLocal must be called in setup`);wC.has(n)||wC.set(n,Object.create(null));let r=wC.get(n);return r[e]=t,Pn(e,t)}function DC(e,t){let n=t?.injectionKey||Symbol(e.name||`InjectionState`),r=t?.defaultValue;return[(...t)=>{let r=e(...t);return EC(n,r),r},()=>TC(n,r)]}var OC=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var kC=Object.prototype.toString,AC=e=>kC.call(e)===`[object Object]`,jC=()=>{};function MC(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function NC(e,t={}){let n,r,i=jC,a=e=>{clearTimeout(e),i(),i=jC},o;return s=>{let c=Zt(e),l=Zt(t.maxWait);return n&&a(n),c<=0||l!==void 0&&l<=0?(r&&=(a(r),void 0),Promise.resolve(s())):new Promise((e,u)=>{i=t.rejectOnCancel?u:e,o=s,l&&!r&&(r=setTimeout(()=>{n&&a(n),r=void 0,e(o())},l)),n=setTimeout(()=>{r&&a(r),r=void 0,e(s())},c)})}}function PC(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{t?setTimeout(i,e,n):setTimeout(r,e)})}function FC(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function IC(e){return Array.isArray(e)?e:[e]}function LC(e){return e||Na()}function RC(e,t=200,n={}){return MC(NC(t,n),e)}function zC(e,t=200,n={}){let r=Kt(Zt(e)),i=RC(()=>{r.value=e.value},t,n);return Bn(e,()=>i()),Ft(r)}function BC(e,t=!0,n){LC(n)?lr(e,n):t?e():bn(e)}function VC(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=Bn(e,e=>{n(e)!==t&&(s?s():bn(()=>s?.()),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(PC(a,o).then(()=>Zt(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!Gt(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=Bn([e,r],([e,r])=>{t!==(e===r)&&(l?l():bn(()=>l?.()),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(PC(s,c).then(()=>Zt(e)).finally(()=>(l?.(),Zt(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(Zt(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(Zt(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return VC(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return VC(e,!t)}}}function HC(e){return VC(e)}function UC(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,o=qt(!1);function s(){a&&=(clearInterval(a),null)}function c(){o.value=!1,s()}function l(){let n=Zt(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}return r&&OC&&l(),(Gt(t)||typeof t==`function`)&&SC(Bn(t,()=>{o.value&&OC&&l()})),SC(c),{isActive:Ft(o),pause:c,resume:l}}function WC(e,t,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=qt(!1),o;function s(){o&&=(clearTimeout(o),void 0)}function c(){a.value=!1,s()}function l(...n){i&&e(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=void 0,e(...n)},Zt(t))}return r&&(a.value=!0,OC&&l()),SC(c),{isPending:Ft(a),start:l,stop:c}}function GC(e=1e3,t={}){let{controls:n=!1,callback:r}=t,i=WC(r??jC,e,t),a=Za(()=>!i.isPending.value);return n?{ready:a,...i}:a}function KC(e,t,n){return Bn(e,t,{...n,immediate:!0})}function qC(e,t,n){let r=Bn(e,(e,i,a)=>{e&&(n?.once&&bn(()=>r()),t(e,i,a))},{...n,once:!1});return r}var JC=OC?window:void 0;OC&&window.document,OC&&window.navigator,OC&&window.location;function YC(e){let t=Zt(e);return t?.$el??t}function XC(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=Za(()=>{let t=IC(Zt(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return KC(()=>[n.value?.map(e=>YC(e))??[JC].filter(e=>e!=null),IC(Zt(n.value?e[1]:e[0])),IC(Xt(n.value?e[2]:e[1])),Zt(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=AC(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function ZC(){let e=qt(!1),t=Na();return t&&lr(()=>{e.value=!0},t),e}function QC(e){let t=ZC();return Za(()=>(t.value,!!e()))}function $C(e,t={}){let{immediate:n=!0,fpsLimit:r=null,window:i=JC,once:a=!1}=t,o=qt(!1),s=Za(()=>{let e=Zt(r);return e?1e3/e:null}),c=0,l=null;function u(t){if(!o.value||!i)return;c||=t;let n=t-c;if(s.value&&n0&&await PC(n);let c=typeof e==`function`?e(...r):e;try{let e=await c;return i===m&&(u.value=e,d.value=!0),o(e),e}catch(e){if(i===m&&(p.value=e),a(e),l)throw e}finally{i===m&&(f.value=!1)}}r&&h(i);let g={state:u,isReady:d,isLoading:f,error:p,execute:h,executeImmediate:(...e)=>h(0,...e)};function _(){return new Promise((e,t)=>{HC(f).toBe(!1).then(()=>e(g)).catch(t)})}return{...g,then(e,t){return _().then(e,t)}}}var tw=Symbol(`vueuse-ssr-width`);function nw(){let e=In()?TC(tw,null):null;return typeof e==`number`?e:void 0}function rw(e,t={}){let{window:n=JC,ssrWidth:r=nw()}=t,i=QC(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=qt(typeof r==`number`),o=qt(),s=qt(!1);return zn(()=>{if(a.value){a.value=!i.value,s.value=Zt(e).split(`,`).some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=FC(n[1])),i&&a&&(a=r<=FC(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(Zt(e)),s.value=o.value.matches)}),XC(o,`change`,e=>{s.value=e.matches},{passive:!0}),Za(()=>s.value)}function iw(e={}){let{window:t=JC}=e,n=qt(1),r=rw(()=>`(resolution: ${n.value}dppx)`,e),i=jC;return t&&(i=KC(r,()=>n.value=t.devicePixelRatio)),{pixelRatio:Ft(n),stop:i}}function aw(e,t,n={}){let{window:r=JC,...i}=n,a,o=QC(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=Bn(Za(()=>{let t=Zt(e);return Array.isArray(t)?t.map(e=>YC(e)):[YC(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return SC(l),{isSupported:o,stop:l}}function ow(e,t={width:0,height:0},n={}){let{window:r=JC,box:i=`content-box`}=n,a=Za(()=>{var t;return(t=YC(e))==null||(t=t.namespaceURI)==null?void 0:t.includes(`svg`)}),o=qt(t.width),s=qt(t.height),{stop:c}=aw(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=YC(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=IC(n);o.value=e.reduce((e,{inlineSize:t})=>e+t,0),s.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,s.value=t.contentRect.height},n);BC(()=>{let n=YC(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=Bn(()=>YC(e),e=>{o.value=e?t.width:0,s.value=e?t.height:0});function u(){c(),l()}return{width:o,height:s,stop:u}}function sw(e){let t=qt(0);if(typeof performance>`u`)return t;let n=e?.every??10,r=performance.now(),i=0;return $C(()=>{if(i+=1,i>=n){let e=performance.now(),n=e-r;t.value=Math.round(1e3/(n/i)),r=e,i=0}}),t}function cw(e){if(`interval`in e||`immediate`in e||`immediateCallback`in e){let{interval:t=1e3,immediate:n,immediateCallback:r}=e;return e=>UC(e,t,{immediate:n,immediateCallback:r})}return UC}function lw(e={}){let t=qt(),n=QC(()=>typeof performance<`u`&&`memory`in performance);if(n.value){let{scheduler:n=cw}=e;n(()=>{t.value=performance.memory})}return{isSupported:n,memory:t}}function uw(e={}){let{window:t=JC,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=qt(n),c=qt(r),l=()=>{if(t)if(o===`outer`)s.value=t.outerWidth,c.value=t.outerHeight;else if(o===`visual`&&t.visualViewport){let{width:e,height:n,scale:r}=t.visualViewport;s.value=Math.round(e*r),c.value=Math.round(n*r)}else a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight)};l(),BC(l);let u={passive:!0};return XC(`resize`,l,u),t&&o===`visual`&&t.visualViewport&&XC(t.visualViewport,`resize`,l,u),i&&Bn(rw(`(orientation: portrait)`),()=>l()),{width:s,height:c}}function dw(e){let t=(e?.replace(/([A-Z])+/g,fw))?.split(/(?=[A-Z])|[\.\-\s_]/).map(e=>e.toLowerCase())??[];return t.length===0?``:t.length===1?t[0]:t.reduce((e,t)=>`${e}${t.charAt(0).toUpperCase()}${t.slice(1)}`)}function fw(e){if(!e||e.length===0)return``;let t=e.toLowerCase();return t.substring(0,1).toUpperCase()+t.substring(1,t.length)}new Map(Object.entries({Æ:`Ae`,Ð:`D`,Ø:`O`,Þ:`Th`,ß:`ss`,æ:`ae`,ð:`d`,ø:`o`,þ:`th`,Đ:`D`,đ:`d`,Ħ:`H`,ħ:`h`,ı:`i`,IJ:`IJ`,ij:`ij`,ĸ:`k`,Ŀ:`L`,ŀ:`l`,Ł:`L`,ł:`l`,ʼn:`'n`,Ŋ:`N`,ŋ:`n`,Œ:`Oe`,œ:`oe`,Ŧ:`T`,ŧ:`t`,ſ:`s`}));function pw(e,t){if(Object.is(e,t))return!0;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);if(n.length!==r.length)return!1;for(let r=0;r0){let r=e.retarget(t),i=n.length;for(let e=0;en(e,t,r);let r,i;return`deny`in n?(i=!0,r=n.deny):(i=!1,r=n.allow),Array.isArray(r)?e=>Pw(r.includes(e.type),i):e=>Pw(r===e.type,i)}function Pw(e,t){return t?!e:e}function Fw(e,t,n,r=!1,i,a,o){let s=r||Iw(e,t),c=t.pointerEvents??i,l=c??t.defaultPointerEvents??`listener`,u=t.pointerEventsType??a??`all`,d=t.pointerEventsOrder??o??0,f=Nw(s,l,u),p=n.length;if(p===1)(f===!0||typeof f==`function`&&f(n[0]))&&Lw(n[0],t,l,u,d);else if(f===!0)for(let e=0;e0&&(e===`wheel`&&t.__r3f.handlers.onWheel!=null||e===`pointer`&&Object.keys(t.__r3f.handlers).some(e=>e!=`onWheel`)))return!0;if(t._listeners==null)return!1;if(e===`wheel`){let e=t._listeners.wheel;return e!=null&&e.length>0}let n=Object.entries(t._listeners),r=n.length;for(let e=0;e0)return!0}return!1}function Lw({intersector:e,options:t},n,r,i,a){t.filter?.(n,r,i,a)!==!1&&e.executeIntersection(n,a)}function Rw(e,t,{customSort:n=zw}={},r){let i,a,o,s=e.length;for(let c=0;c0;)e.push(t),--n}var Uw=Symbol(`buttonsDownTime`),Ww=Symbol(`buttonsClickTime`);globalThis.pointerEventspointerMap??=new Map,Hu.prototype.setPointerCapture=function(e){Gw(e)?.setCapture(this)},Hu.prototype.releasePointerCapture=function(e){let t=Gw(e);t==null||!t.hasCaptured(this)||t.setCapture(void 0)},Hu.prototype.hasPointerCapture=function(e){return Gw(e)?.hasCaptured(this)??!1};function Gw(e){return globalThis.pointerEventspointerMap?.get(e)}var Kw=class{id;type;state;intersector;getCamera;onMoveCommited;parentSetPointerCapture;parentReleasePointerCapture;options;prevIntersection;intersection;prevEnabled=!0;enabled=!0;wheelIntersection;pointerEntered=[];pointerEnteredHelper=[];pointerCapture;buttonsDownTime=new Map;buttonsDown=new Set;wasMoved=!1;onFirstMove=[];constructor(e,t,n,r,i,a,o,s,c={}){this.id=e,this.type=t,this.state=n,this.intersector=r,this.getCamera=i,this.onMoveCommited=a,this.parentSetPointerCapture=o,this.parentReleasePointerCapture=s,this.options=c,globalThis.pointerEventspointerMap?.set(e,this)}getPointerCapture(){return this.pointerCapture}hasCaptured(e){return this.pointerCapture?.object===e}setCapture(e){this.pointerCapture?.object!==e&&(this.clearPointerCapture(),e!=null&&this.intersection!=null&&(this.pointerCapture={object:e,intersection:this.intersection},this.parentSetPointerCapture?.()))}getButtonsDown(){return this.buttonsDown}getIntersection(){return this.intersection}getEnabled(){return this.enabled}setEnabled(e,t,n=!0){this.enabled!==e&&(!e&&this.pointerCapture!=null&&this.clearPointerCapture(),this.enabled=e,n&&this.commit(t,!1))}computeIntersection(e,t,n){return this.pointerCapture==null?(this.intersector.startIntersection(n),Fw(e,t,[this]),this.intersector.finalizeIntersection(t)):this.intersector.intersectPointerCapture(this.pointerCapture,n)}setIntersection(e){this.intersection=e}commit(e,t){let n=this.getCamera(),r=this.prevEnabled?this.prevIntersection:void 0,i=this.enabled?this.intersection:void 0;r!=null&&r.object!=i?.object&&ww(new Sw(`pointerout`,!0,e,this,r,n));let a=this.pointerEntered;this.pointerEntered=[],this.pointerEnteredHelper.length=0,qw(i?.object,this.pointerEntered,a,this.pointerEnteredHelper);let o=a.length;for(let t=0;t=0;t--){let r=this.pointerEnteredHelper[t];ww(new Sw(`pointerenter`,!1,e,this,i,n,r))}if(t&&i!=null&&ww(new Sw(`pointermove`,!0,e,this,i,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved&&this.intersector.isReady()){this.wasMoved=!0;let e=this.onFirstMove.length;for(let t=0;tr){c.set(e.button,e.timeStamp);return}ww(new Sw(`dblclick`,!0,e,this,this.intersection,o)),c.delete(e.button)}cancel(e){this.buttonsDown.clear(),this.buttonsDownTime.clear(),this.clearPointerCapture(),this.onFirstMove.length=0,!(!this.enabled||!this.wasMoved||this.intersection==null)&&ww(new Sw(`pointercancel`,!0,e,this,this.intersection,this.getCamera()))}wheel(e,t,n=!1){if(!this.enabled)return;if(!this.wasMoved&&n){this.onFirstMove.push(this.wheel.bind(this,e,t,n));return}n||(this.wheelIntersection=this.computeIntersection(`wheel`,e,t));let r=n?this.intersection:this.wheelIntersection;r!=null&&ww(new Cw(t,this,r,this.getCamera()))}emitWheel(e,t=!1){if(!this.enabled)return;if(!this.wasMoved&&t){this.onFirstMove.push(this.emitWheel.bind(this,e,t));return}let n=t?this.intersection:this.wheelIntersection;n!=null&&ww(new Cw(e,this,n,this.getCamera()))}exit(e){(this.buttonsDown.size>0||this.pointerCapture!=null)&&this.cancel(e),this.wasMoved&&(this.intersection=void 0,this.commit(e,!1)),this.onFirstMove.length=0,this.wasMoved=!1}clearPointerCapture(){this.pointerCapture!=null&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0)}};function qw(e,t,n,r){if(e==null)return;let i=n.indexOf(e);i==-1?r.push(e):n.splice(i,1),t.push(e),qw(e.parent,t,n,r)}function Jw(e,t,n,r,i){if(t==null)return!1;let a=t.get(n);return!(a==null||r-a>i||a!=e.get(n))}var Yw=new pd,Xw=new pd,Zw=new H,Qw=new H,$w=new H,eT=new U,tT=new G,nT=new U;function rT(e,t,n){nT.copy(t).applyMatrix4(tT.copy(n.matrixWorld).invert());let r=n.geometry.attributes.uv;if(r==null||!(r instanceof Ld))return!1;let i;return iT(n,(e,t,a)=>{n.getVertexPosition(e,Yw.a),n.getVertexPosition(t,Yw.b),n.getVertexPosition(a,Yw.c);let o=Yw.closestPointToPoint(nT,eT).distanceTo(nT);i!=null&&o>=i||(i=o,Xw.copy(Yw),Zw.fromBufferAttribute(r,e),Qw.fromBufferAttribute(r,t),$w.fromBufferAttribute(r,a))}),i==null?!1:(Xw.closestPointToPoint(nT,eT),Xw.getInterpolation(eT,Zw,Qw,$w,e),!0)}function iT(e,t){let n=e.geometry.drawRange;if(e.geometry.index!=null){let r=e.geometry.index,i=Math.max(0,n.start),a=Math.min(r.count,n.start+n.count);for(let e=i;e({type:`screen-ray`,distanceViewPlane:t,screenPoint:this.coords.clone(),direction:r}),t,n):(a.object.updateWorldMatrix(!0,!1),aT.copy(a.object.matrixWorld).invert(),Object.assign(a,{details:{type:`screen-ray`,distanceViewPlane:this.viewPlane.distanceToPoint(a.point),screenPoint:this.coords.clone(),direction:r},pointOnFace:a.point,pointerPosition:t,pointerQuaternion:n,localPoint:a.point.clone().applyMatrix4(aT)}))}};new U,new H,new G,new U,new Gl,new wp,new Yd,new U,new U,new U,new U(1e-4,1e-4,1e-4),new G;var uT=23412;function dT(){return uT++}function fT(e,t,n){if(!(t instanceof globalThis.MouseEvent))return n.set(0,0);let{width:r,height:i,top:a,left:o}=e.getBoundingClientRect(),s=t.clientX-o,c=t.clientY-a;return n.set(s/r*2-1,-(c/i)*2+1)}function pT(e,t,n,r){return mT(e,typeof t==`function`?t:()=>t,n,fT.bind(null,e),e.setPointerCapture.bind(e),t=>{e.hasPointerCapture(t)&&e.releasePointerCapture(t)},{pointerTypePrefix:`screen-`,...r})}function mT(e,t,n,r,i,a,o={}){let s=o?.forwardPointerCapture??!0,c=new Map,l=o.pointerTypePrefix??`forward-`,u=(e,u)=>{let d=c.get(e.pointerId);return d??(d=new Kw(dT(),`${l}${e.pointerType}`,e.pointerState,new lT((e,n)=>(r(e,n),t()),o),t,void 0,s?i.bind(null,e.pointerId):void 0,s?a.bind(null,e.pointerId):void 0,o),u!=`move`&&u!=`wheel`&&(d.setIntersection(d.computeIntersection(`pointer`,n,e)),d.commit(e,!1)),c.set(e.pointerId,d),d)},d=new Map,f=new Map,p=[],m=[],h=(e,t,r)=>{switch(e){case`move`:r.move(n,t);return;case`over`:r.move(n,t);return;case`wheel`:r.wheel(n,t);return;case`cancel`:r.cancel(t);return;case`down`:if(!hT(t))return;r.down(t);return;case`up`:if(!hT(t))return;r.up(t);return;case`exit`:f.delete(r),d.delete(r),r.exit(t);return}},g=(e,t)=>{let n=u(t,e);e===`move`&&f.set(n,t),e===`wheel`&&d.set(n,t),o.batchEvents??!0?m.push({type:e,event:t}):h(e,t,n)},_=g.bind(null,`move`),v=g.bind(null,`over`),y=g.bind(null,`cancel`),b=g.bind(null,`down`),x=g.bind(null,`up`),S=g.bind(null,`wheel`),C=g.bind(null,`exit`);return e.addEventListener(`pointermove`,_),e.addEventListener(`pointerover`,v),e.addEventListener(`pointercancel`,y),e.addEventListener(`pointerdown`,b),e.addEventListener(`pointerup`,x),e.addEventListener(`wheel`,S),e.addEventListener(`pointerleave`,C),{destroy(){e.removeEventListener(`pointermove`,_),e.removeEventListener(`pointerover`,v),e.removeEventListener(`pointercancel`,y),e.removeEventListener(`pointerdown`,b),e.removeEventListener(`pointerup`,x),e.removeEventListener(`wheel`,S),e.removeEventListener(`pointerleave`,C),f.clear(),d.clear()},update(){let e=m.length;for(let t=0;t()=>(t||e((t={exports:{}}).exports,t),t.exports),CT=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=yT(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=vT(t,s))||r.enumerable});return e},wT=(e,t,n)=>(n=e==null?{}:gT(bT(e)),CT(t||!e||!e.__esModule?_T(n,`default`,{value:e,enumerable:!0}):n,e)),TT=typeof navigator<`u`,Z=typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof global<`u`?global:{};Z.chrome!==void 0&&Z.chrome.devtools,TT&&(Z.self,Z.top),typeof navigator<`u`&&navigator.userAgent?.toLowerCase().includes(`electron`),typeof window<`u`&&window.__NUXT__;var ET=wT(ST(((e,t)=>{t.exports=r;function n(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function r(e){if(e||={},e.circles)return i(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(a(Array.from(e),t))),t.set(Set,(e,t)=>new Set(a(Array.from(e),t))),e.constructorHandlers)for(let n of e.constructorHandlers)t.set(n[0],n[1]);let r=null;return e.proto?s:o;function a(e,i){let a=Object.keys(e),o=Array(a.length);for(let s=0;snew Date(e)),i.set(Map,(e,t)=>new Map(o(Array.from(e),t))),i.set(Set,(e,t)=>new Set(o(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)i.set(t[0],t[1]);let a=null;return e.proto?c:s;function o(e,o){let s=Object.keys(e),c=Array(s.length);for(let l=0;l(o=PT(e,t,r),o.finally(()=>{if(o=null,n.trailing&&s&&!i){let e=c(t,s);return s=null,e}}),o),l=function(...e){return n.trailing&&(s=e),o||new Promise(o=>{let l=!i&&n.leading;clearTimeout(i),i=setTimeout(()=>{i=null;let t=n.leading?r:c(this,e);s=null;for(let e of a)e(t);a=[]},t),l?(r=c(this,e),o(r)):a.push(o)})},u=e=>{e&&(clearTimeout(e),i=null)};return l.isPending=()=>!!i,l.cancel=()=>{u(i),a=[],s=null},l.flush=()=>{if(u(i),!s||o)return;let e=s;return s=null,c(this,e)},l}async function PT(e,t,n){return await e.apply(t,n)}function FT(e,t={},n){for(let r in e){let i=e[r],a=n?`${n}:${r}`:r;typeof i==`object`&&i?FT(i,t,a):typeof i==`function`&&(t[a]=i)}return t}var IT={run:e=>e()},LT=console.createTask===void 0?()=>IT:console.createTask;function RT(e,t){let n=LT(t.shift());return e.reduce((e,r)=>e.then(()=>n.run(()=>r(...t))),Promise.resolve())}function zT(e,t){let n=LT(t.shift());return Promise.all(e.map(e=>n.run(()=>e(...t))))}function BT(e,t){for(let n of[...e])n(t)}var VT=class{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,n={}){if(!e||typeof t!=`function`)return()=>{};let r=e,i;for(;this._deprecatedHooks[e];)i=this._deprecatedHooks[e],e=i.to;if(i&&!n.allowDeprecated){let e=i.message;e||=`${r} hook has been deprecated`+(i.to?`, please use ${i.to}`:``),this._deprecatedMessages||=new Set,this._deprecatedMessages.has(e)||(console.warn(e),this._deprecatedMessages.add(e))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>`_`+e.replace(/\W+/g,`_`)+`_hook_cb`,configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&=(this.removeHook(e,t),void 0)}}hookOnce(e,t){let n,r=(...e)=>(typeof n==`function`&&n(),n=void 0,r=void 0,t(...e));return n=this.hook(e,r),n}removeHook(e,t){if(this._hooks[e]){let n=this._hooks[e].indexOf(t);n!==-1&&this._hooks[e].splice(n,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t==`string`?{to:t}:t;let n=this._hooks[e]||[];delete this._hooks[e];for(let t of n)this.hook(e,t)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(let t in e)this.deprecateHook(t,e[t])}addHooks(e){let t=FT(e),n=Object.keys(t).map(e=>this.hook(e,t[e]));return()=>{for(let e of n.splice(0,n.length))e()}}removeHooks(e){let t=FT(e);for(let e in t)this.removeHook(e,t[e])}removeAllHooks(){for(let e in this._hooks)delete this._hooks[e]}callHook(e,...t){return t.unshift(e),this.callHookWith(RT,e,...t)}callHookParallel(e,...t){return t.unshift(e),this.callHookWith(zT,e,...t)}callHookWith(e,t,...n){let r=this._before||this._after?{name:t,args:n,context:{}}:void 0;this._before&&BT(this._before,r);let i=e(t in this._hooks?[...this._hooks[t]]:[],n);return i instanceof Promise?i.finally(()=>{this._after&&r&&BT(this._after,r)}):(this._after&&r&&BT(this._after,r),i)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){let t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){let t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}};function HT(){return new VT}var UT=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);function WT(e){if(typeof e==`function`)return e.displayName||e.name||e.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||``;let t=e.name||e._componentTag||e.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||e.__name;return t===`index`&&e.__file?.endsWith(`index.vue`)?``:t}function GT(e){let t=e.__file;if(t)return kT(AT(t,`.vue`))}function KT(e,t){return e.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=t,t}function qT(e){if(e.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(e.root)return e.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function JT(e){let t=e.subTree?.type,n=qT(e);return n?n?.types?.Fragment===t:!1}function YT(e){let t=WT(e?.type||{});if(t)return t;if(e?.root===e)return`Root`;for(let t in e.parent?.type?.components)if(e.parent.type.components[t]===e?.type)return KT(e,t);for(let t in e.appContext?.components)if(e.appContext.components[t]===e?.type)return KT(e,t);return GT(e?.type||{})||`Anonymous Component`}function XT(e){return`${e?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__??0}:${e===e?.root?`root`:e.uid}`}function ZT(e,t){return t||=`${e.id}:root`,e.instanceMap.get(t)||e.instanceMap.get(`:root`)}function QT(){let e={top:0,bottom:0,left:0,right:0,get width(){return e.right-e.left},get height(){return e.bottom-e.top}};return e}var $T;function eE(e){return $T||=document.createRange(),$T.selectNode(e),$T.getBoundingClientRect()}function tE(e){let t=QT();if(!e.children)return t;for(let n=0,r=e.children.length;ne.bottom)&&(e.bottom=t.bottom),(!e.left||t.lefte.right)&&(e.right=t.right),e}var rE={top:0,left:0,right:0,bottom:0,width:0,height:0};function iE(e){let t=e.subTree.el;return typeof window>`u`?rE:JT(e)?tE(e.subTree):t?.nodeType===1?t?.getBoundingClientRect():e.subTree.component?iE(e.subTree.component):rE}function aE(e){return JT(e)?oE(e.subTree):e.subTree?[e.subTree.el]:[]}function oE(e){if(!e.children)return[];let t=[];return e.children.forEach(e=>{e.component?t.push(...aE(e.component)):e?.el&&t.push(e.el)}),t}var sE=`__vue-devtools-component-inspector__`,cE=`__vue-devtools-component-inspector__card__`,lE=`__vue-devtools-component-inspector__name__`,uE=`__vue-devtools-component-inspector__indicator__`,dE={display:`block`,zIndex:2147483640,position:`fixed`,backgroundColor:`#42b88325`,border:`1px solid #42b88350`,borderRadius:`5px`,transition:`all 0.1s ease-in`,pointerEvents:`none`},fE={fontFamily:`Arial, Helvetica, sans-serif`,padding:`5px 8px`,borderRadius:`4px`,textAlign:`left`,position:`absolute`,left:0,color:`#e9e9e9`,fontSize:`14px`,fontWeight:600,lineHeight:`24px`,backgroundColor:`#42b883`,boxShadow:`0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)`},pE={display:`inline-block`,fontWeight:400,fontStyle:`normal`,fontSize:`12px`,opacity:.7};function mE(){return document.getElementById(sE)}function hE(){return document.getElementById(cE)}function gE(){return document.getElementById(uE)}function _E(){return document.getElementById(lE)}function vE(e){return{left:`${Math.round(e.left*100)/100}px`,top:`${Math.round(e.top*100)/100}px`,width:`${Math.round(e.width*100)/100}px`,height:`${Math.round(e.height*100)/100}px`}}function yE(e){let t=document.createElement(`div`);t.id=e.elementId??sE,Object.assign(t.style,{...dE,...vE(e.bounds),...e.style});let n=document.createElement(`span`);n.id=cE,Object.assign(n.style,{...fE,top:e.bounds.top<35?0:`-35px`});let r=document.createElement(`span`);r.id=lE,r.innerHTML=`<${e.name}>  `;let i=document.createElement(`i`);return i.id=uE,i.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`,Object.assign(i.style,pE),n.appendChild(r),n.appendChild(i),t.appendChild(n),document.body.appendChild(t),t}function bE(e){let t=mE(),n=hE(),r=_E(),i=gE();t&&(Object.assign(t.style,{...dE,...vE(e.bounds)}),Object.assign(n.style,{top:e.bounds.top<35?0:`-35px`}),r.innerHTML=`<${e.name}>  `,i.innerHTML=`${Math.round(e.bounds.width*100)/100} x ${Math.round(e.bounds.height*100)/100}`)}function xE(e){let t=iE(e);if(!t.width&&!t.height)return;let n=YT(e);mE()?bE({bounds:t,name:n}):yE({bounds:t,name:n})}function SE(){let e=mE();e&&(e.style.display=`none`)}var CE=null;function wE(e){let t=e.target;if(t){let e=t.__vueParentComponent;if(e&&(CE=e,e.vnode.el)){let t=iE(e),n=YT(e);mE()?bE({bounds:t,name:n}):yE({bounds:t,name:n})}}}function TE(e,t){e.preventDefault(),e.stopPropagation(),CE&&t(XT(CE))}var EE=null;function DE(){SE(),window.removeEventListener(`mouseover`,wE),window.removeEventListener(`click`,EE,!0),EE=null}function OE(){return window.addEventListener(`mouseover`,wE),new Promise(e=>{function t(n){n.preventDefault(),n.stopPropagation(),TE(n,n=>{window.removeEventListener(`click`,t,!0),EE=null,window.removeEventListener(`mouseover`,wE);let r=mE();r&&(r.style.display=`none`),e(JSON.stringify({id:n}))})}EE=t,window.addEventListener(`click`,t,!0)})}function kE(e){let t=ZT(rD.value,e.id);if(t){let[n]=aE(t);if(typeof n.scrollIntoView==`function`)n.scrollIntoView({behavior:`smooth`});else{let e=iE(t),n=document.createElement(`div`),r={...vE(e),position:`absolute`};Object.assign(n.style,r),document.body.appendChild(n),n.scrollIntoView({behavior:`smooth`}),setTimeout(()=>{document.body.removeChild(n)},2e3)}setTimeout(()=>{let n=iE(t);if(n.width||n.height){let r=YT(t),i=mE();i?bE({...e,name:r,bounds:n}):yE({...e,name:r,bounds:n}),setTimeout(()=>{i&&(i.style.display=`none`)},1500)}},1200)}}Z.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__??=!0;function AE(e){let t=0,n=setInterval(()=>{Z.__VUE_INSPECTOR__&&(clearInterval(n),t+=30,e()),t>=5e3&&clearInterval(n)},30)}function jE(){let e=Z.__VUE_INSPECTOR__,t=e.openInEditor;e.openInEditor=async(...n)=>{e.disable(),t(...n)}}function ME(){return new Promise(e=>{function t(){jE(),e(Z.__VUE_INSPECTOR__)}Z.__VUE_INSPECTOR__?t():AE(()=>{t()})})}var NE=function(e){return e.SKIP=`__v_skip`,e.IS_REACTIVE=`__v_isReactive`,e.IS_READONLY=`__v_isReadonly`,e.IS_SHALLOW=`__v_isShallow`,e.RAW=`__v_raw`,e}({});function PE(e){return!!(e&&e[NE.IS_READONLY])}function FE(e){return PE(e)?FE(e[NE.RAW]):!!(e&&e[NE.IS_REACTIVE])}function IE(e){return!!(e&&e.__v_isRef===!0)}function LE(e){let t=e&&e[NE.RAW];return t?LE(t):e}var RE=class{constructor(){this.refEditor=new zE}set(e,t,n,r){let i=Array.isArray(t)?t:t.split(`.`);for(;i.length>1;){let t=i.shift();e=e instanceof Map?e.get(t):e instanceof Set?Array.from(e.values())[t]:e[t],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}let a=i[0],o=this.refEditor.get(e)[a];r?r(e,a,n):this.refEditor.isRef(o)?this.refEditor.set(o,n):e[a]=n}get(e,t){let n=Array.isArray(t)?t:t.split(`.`);for(let t=0;ti;){let t=r.shift();e=e[t],this.refEditor.isRef(e)&&(e=this.refEditor.get(e))}return e!=null&&Object.prototype.hasOwnProperty.call(e,r[0])}createDefaultSetCallback(e){return(t,n,r)=>{if((e.remove||e.newKey)&&(Array.isArray(t)?t.splice(n,1):LE(t)instanceof Map?t.delete(n):LE(t)instanceof Set?t.delete(Array.from(t.values())[n]):Reflect.deleteProperty(t,n)),!e.remove){let i=t[e.newKey||n];this.refEditor.isRef(i)?this.refEditor.set(i,r):LE(t)instanceof Map?t.set(e.newKey||n,r):LE(t)instanceof Set?t.add(r):t[e.newKey||n]=r}}}},zE=class{set(e,t){if(IE(e))e.value=t;else{if(e instanceof Set&&Array.isArray(t)){e.clear(),t.forEach(t=>e.add(t));return}let n=Object.keys(t);if(e instanceof Map){let r=new Set(e.keys());n.forEach(n=>{e.set(n,Reflect.get(t,n)),r.delete(n)}),r.forEach(t=>e.delete(t));return}let r=new Set(Object.keys(e));n.forEach(n=>{Reflect.set(e,n,Reflect.get(t,n)),r.delete(n)}),r.forEach(t=>Reflect.deleteProperty(e,t))}}get(e){return IE(e)?e.value:e}isRef(e){return IE(e)||FE(e)}};new RE;var BE=`__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__`;function VE(){if(typeof window>`u`||!TT||typeof localStorage>`u`||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:``};let e=localStorage.getItem===void 0?null:localStorage.getItem(BE);return e?JSON.parse(e):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:``}}Z.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS??=[];var HE=new Proxy(Z.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(e,t,n){return Reflect.get(e,t,n)}});function UE(e,t){sD.timelineLayersState[t.id]=!1,HE.push({...e,descriptorId:t.id,appRecord:qT(t.app)})}Z.__VUE_DEVTOOLS_KIT_INSPECTOR__??=[];var WE=new Proxy(Z.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(e,t,n){return Reflect.get(e,t,n)}}),GE=NT(()=>{FD.hooks.callHook(ZE.SEND_INSPECTOR_TO_CLIENT,qE())});function KE(e,t){WE.push({options:e,descriptor:t,treeFilterPlaceholder:e.treeFilterPlaceholder??`Search tree...`,stateFilterPlaceholder:e.stateFilterPlaceholder??`Search state...`,treeFilter:``,selectedNodeId:``,appRecord:qT(t.app)}),GE()}function qE(){return WE.filter(e=>e.descriptor.app===rD.value.app).filter(e=>e.descriptor.id!==`components`).map(e=>{let t=e.descriptor,n=e.options;return{id:n.id,label:n.label,logo:t.logo,icon:`custom-ic-baseline-${n?.icon?.replace(/_/g,`-`)}`,packageName:t.packageName,homepage:t.homepage,pluginId:t.id}})}function JE(e,t){return WE.find(n=>n.options.id===e&&(!t||n.descriptor.app===t))}var YE=function(e){return e.VISIT_COMPONENT_TREE=`visitComponentTree`,e.INSPECT_COMPONENT=`inspectComponent`,e.EDIT_COMPONENT_STATE=`editComponentState`,e.GET_INSPECTOR_TREE=`getInspectorTree`,e.GET_INSPECTOR_STATE=`getInspectorState`,e.EDIT_INSPECTOR_STATE=`editInspectorState`,e.INSPECT_TIMELINE_EVENT=`inspectTimelineEvent`,e.TIMELINE_CLEARED=`timelineCleared`,e.SET_PLUGIN_SETTINGS=`setPluginSettings`,e}({}),XE=function(e){return e.ADD_INSPECTOR=`addInspector`,e.SEND_INSPECTOR_TREE=`sendInspectorTree`,e.SEND_INSPECTOR_STATE=`sendInspectorState`,e.CUSTOM_INSPECTOR_SELECT_NODE=`customInspectorSelectNode`,e.TIMELINE_LAYER_ADDED=`timelineLayerAdded`,e.TIMELINE_EVENT_ADDED=`timelineEventAdded`,e.GET_COMPONENT_INSTANCES=`getComponentInstances`,e.GET_COMPONENT_BOUNDS=`getComponentBounds`,e.GET_COMPONENT_NAME=`getComponentName`,e.COMPONENT_HIGHLIGHT=`componentHighlight`,e.COMPONENT_UNHIGHLIGHT=`componentUnhighlight`,e}({}),ZE=function(e){return e.SEND_INSPECTOR_TREE_TO_CLIENT=`sendInspectorTreeToClient`,e.SEND_INSPECTOR_STATE_TO_CLIENT=`sendInspectorStateToClient`,e.SEND_TIMELINE_EVENT_TO_CLIENT=`sendTimelineEventToClient`,e.SEND_INSPECTOR_TO_CLIENT=`sendInspectorToClient`,e.SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT=`sendActiveAppUpdatedToClient`,e.DEVTOOLS_STATE_UPDATED=`devtoolsStateUpdated`,e.DEVTOOLS_CONNECTED_UPDATED=`devtoolsConnectedUpdated`,e.ROUTER_INFO_UPDATED=`routerInfoUpdated`,e}({});function QE(){let e=HT();e.hook(XE.ADD_INSPECTOR,({inspector:e,plugin:t})=>{KE(e,t.descriptor)});let t=NT(async({inspectorId:t,plugin:n})=>{if(!t||!n?.descriptor?.app||sD.highPerfModeEnabled)return;let r=JE(t,n.descriptor.app),i={app:n.descriptor.app,inspectorId:t,filter:r?.treeFilter||``,rootNodes:[]};await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(i))),t()},YE.GET_INSPECTOR_TREE)}),e.callHookWith(async e=>{await Promise.all(e.map(e=>e({inspectorId:t,rootNodes:i.rootNodes})))},ZE.SEND_INSPECTOR_TREE_TO_CLIENT)},120);e.hook(XE.SEND_INSPECTOR_TREE,t);let n=NT(async({inspectorId:t,plugin:n})=>{if(!t||!n?.descriptor?.app||sD.highPerfModeEnabled)return;let r=JE(t,n.descriptor.app),i={app:n.descriptor.app,inspectorId:t,nodeId:r?.selectedNodeId||``,state:null},a={currentTab:`custom-inspector:${t}`};i.nodeId&&await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(i,a))),t()},YE.GET_INSPECTOR_STATE)}),e.callHookWith(async e=>{await Promise.all(e.map(e=>e({inspectorId:t,nodeId:i.nodeId,state:i.state})))},ZE.SEND_INSPECTOR_STATE_TO_CLIENT)},120);return e.hook(XE.SEND_INSPECTOR_STATE,n),e.hook(XE.CUSTOM_INSPECTOR_SELECT_NODE,({inspectorId:e,nodeId:t,plugin:n})=>{let r=JE(e,n.descriptor.app);r&&(r.selectedNodeId=t)}),e.hook(XE.TIMELINE_LAYER_ADDED,({options:e,plugin:t})=>{UE(e,t.descriptor)}),e.hook(XE.TIMELINE_EVENT_ADDED,({options:t,plugin:n})=>{sD.highPerfModeEnabled||!sD.timelineLayersState?.[n.descriptor.id]&&![`performance`,`component-event`,`keyboard`,`mouse`].includes(t.layerId)||e.callHookWith(async e=>{await Promise.all(e.map(e=>e(t)))},ZE.SEND_TIMELINE_EVENT_TO_CLIENT)}),e.hook(XE.GET_COMPONENT_INSTANCES,async({app:e})=>{let t=e.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!t)return null;let n=t.id.toString();return[...t.instanceMap].filter(([e])=>e.split(`:`)[0]===n).map(([,e])=>e)}),e.hook(XE.GET_COMPONENT_BOUNDS,async({instance:e})=>iE(e)),e.hook(XE.GET_COMPONENT_NAME,({instance:e})=>YT(e)),e.hook(XE.COMPONENT_HIGHLIGHT,({uid:e})=>{let t=rD.value.instanceMap.get(e);t&&xE(t)}),e.hook(XE.COMPONENT_UNHIGHLIGHT,()=>{SE()}),e}Z.__VUE_DEVTOOLS_KIT_APP_RECORDS__??=[],Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__??={},Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__??=``,Z.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__??=[],Z.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__??=[];var $E=`__VUE_DEVTOOLS_KIT_GLOBAL_STATE__`;function eD(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:``,tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:VE()}}Z[$E]??=eD();var tD=NT(e=>{FD.hooks.callHook(ZE.DEVTOOLS_STATE_UPDATED,{state:e})});NT((e,t)=>{FD.hooks.callHook(ZE.DEVTOOLS_CONNECTED_UPDATED,{state:e,oldState:t})});var nD=new Proxy(Z.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(e,t,n){return t===`value`?Z.__VUE_DEVTOOLS_KIT_APP_RECORDS__:Z.__VUE_DEVTOOLS_KIT_APP_RECORDS__[t]}}),rD=new Proxy(Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(e,t,n){return t===`value`?Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:t===`id`?Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[t]}});function iD(){tD({...Z[$E],appRecords:nD.value,activeAppRecordId:rD.id,tabs:Z.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:Z.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function aD(e){Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=e,iD()}function oD(e){Z.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=e,iD()}var sD=new Proxy(Z[$E],{get(e,t){return t===`appRecords`?nD:t===`activeAppRecordId`?rD.id:t===`tabs`?Z.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:t===`commands`?Z.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:Z[$E][t]},deleteProperty(e,t){return delete e[t],!0},set(e,t,n){return e[t]=n,Z[$E][t]=n,!0}});function cD(e={}){let{file:t,host:n,baseUrl:r=window.location.origin,line:i=0,column:a=0}=e;if(t){if(n===`chrome-extension`){let e=t.replace(/\\/g,`\\\\`),n=window.VUE_DEVTOOLS_CONFIG?.openInEditorHost??`/`;fetch(`${n}__open-in-editor?file=${encodeURI(t)}`).then(t=>{if(!t.ok){let t=`Opening component ${e} failed`;console.log(`%c${t}`,`color:red`)}})}else if(sD.vitePluginDetected){let e=Z.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__??r;Z.__VUE_INSPECTOR__.openInEditor(e,t,i,a)}}}Z.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__??=[];var lD=new Proxy(Z.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(e,t,n){return Reflect.get(e,t,n)}});function uD(e){let t={};return Object.keys(e).forEach(n=>{t[n]=e[n].defaultValue}),t}function dD(e){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${e}__`}function fD(e){return(lD.find(t=>t[0].id===e&&!!t[0]?.settings)?.[0]??null)?.settings??null}function pD(e,t){let n=dD(e);if(n){let e=localStorage.getItem(n);if(e)return JSON.parse(e)}return uD(e?(lD.find(t=>t[0].id===e)?.[0]??null)?.settings??{}:t)}function mD(e,t){let n=dD(e);localStorage.getItem(n)||localStorage.setItem(n,JSON.stringify(uD(t)))}function hD(e,t,n){let r=dD(e),i=localStorage.getItem(r),a=JSON.parse(i||`{}`),o={...a,[t]:n};localStorage.setItem(r,JSON.stringify(o)),FD.hooks.callHookWith(r=>{r.forEach(r=>r({pluginId:e,key:t,oldValue:a[t],newValue:n,settings:o}))},YE.SET_PLUGIN_SETTINGS)}var gD=function(e){return e.APP_INIT=`app:init`,e.APP_UNMOUNT=`app:unmount`,e.COMPONENT_UPDATED=`component:updated`,e.COMPONENT_ADDED=`component:added`,e.COMPONENT_REMOVED=`component:removed`,e.COMPONENT_EMIT=`component:emit`,e.PERFORMANCE_START=`perf:start`,e.PERFORMANCE_END=`perf:end`,e.ADD_ROUTE=`router:add-route`,e.REMOVE_ROUTE=`router:remove-route`,e.RENDER_TRACKED=`render:tracked`,e.RENDER_TRIGGERED=`render:triggered`,e.APP_CONNECTED=`app:connected`,e.SETUP_DEVTOOLS_PLUGIN=`devtools-plugin:setup`,e}({}),_D=Z.__VUE_DEVTOOLS_HOOK??=HT(),vD={on:{vueAppInit(e){_D.hook(gD.APP_INIT,e)},vueAppUnmount(e){_D.hook(gD.APP_UNMOUNT,e)},vueAppConnected(e){_D.hook(gD.APP_CONNECTED,e)},componentAdded(e){return _D.hook(gD.COMPONENT_ADDED,e)},componentEmit(e){return _D.hook(gD.COMPONENT_EMIT,e)},componentUpdated(e){return _D.hook(gD.COMPONENT_UPDATED,e)},componentRemoved(e){return _D.hook(gD.COMPONENT_REMOVED,e)},setupDevtoolsPlugin(e){_D.hook(gD.SETUP_DEVTOOLS_PLUGIN,e)},perfStart(e){return _D.hook(gD.PERFORMANCE_START,e)},perfEnd(e){return _D.hook(gD.PERFORMANCE_END,e)}},setupDevToolsPlugin(e,t){return _D.callHook(gD.SETUP_DEVTOOLS_PLUGIN,e,t)}},yD=class{constructor({plugin:e,ctx:t}){this.hooks=t.hooks,this.plugin=e}get on(){return{visitComponentTree:e=>{this.hooks.hook(YE.VISIT_COMPONENT_TREE,e)},inspectComponent:e=>{this.hooks.hook(YE.INSPECT_COMPONENT,e)},editComponentState:e=>{this.hooks.hook(YE.EDIT_COMPONENT_STATE,e)},getInspectorTree:e=>{this.hooks.hook(YE.GET_INSPECTOR_TREE,e)},getInspectorState:e=>{this.hooks.hook(YE.GET_INSPECTOR_STATE,e)},editInspectorState:e=>{this.hooks.hook(YE.EDIT_INSPECTOR_STATE,e)},inspectTimelineEvent:e=>{this.hooks.hook(YE.INSPECT_TIMELINE_EVENT,e)},timelineCleared:e=>{this.hooks.hook(YE.TIMELINE_CLEARED,e)},setPluginSettings:e=>{this.hooks.hook(YE.SET_PLUGIN_SETTINGS,e)}}}notifyComponentUpdate(e){if(sD.highPerfModeEnabled)return;let t=qE().find(e=>e.packageName===this.plugin.descriptor.packageName);if(t?.id){if(e){let t=[e.appContext.app,e.uid,e.parent?.uid,e];_D.callHook(gD.COMPONENT_UPDATED,...t)}else _D.callHook(gD.COMPONENT_UPDATED);this.hooks.callHook(XE.SEND_INSPECTOR_STATE,{inspectorId:t.id,plugin:this.plugin})}}addInspector(e){this.hooks.callHook(XE.ADD_INSPECTOR,{inspector:e,plugin:this.plugin}),this.plugin.descriptor.settings&&mD(e.id,this.plugin.descriptor.settings)}sendInspectorTree(e){sD.highPerfModeEnabled||this.hooks.callHook(XE.SEND_INSPECTOR_TREE,{inspectorId:e,plugin:this.plugin})}sendInspectorState(e){sD.highPerfModeEnabled||this.hooks.callHook(XE.SEND_INSPECTOR_STATE,{inspectorId:e,plugin:this.plugin})}selectInspectorNode(e,t){this.hooks.callHook(XE.CUSTOM_INSPECTOR_SELECT_NODE,{inspectorId:e,nodeId:t,plugin:this.plugin})}visitComponentTree(e){return this.hooks.callHook(YE.VISIT_COMPONENT_TREE,e)}now(){return sD.highPerfModeEnabled?0:Date.now()}addTimelineLayer(e){this.hooks.callHook(XE.TIMELINE_LAYER_ADDED,{options:e,plugin:this.plugin})}addTimelineEvent(e){sD.highPerfModeEnabled||this.hooks.callHook(XE.TIMELINE_EVENT_ADDED,{options:e,plugin:this.plugin})}getSettings(e){return pD(e??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(e){return this.hooks.callHook(XE.GET_COMPONENT_INSTANCES,{app:e})}getComponentBounds(e){return this.hooks.callHook(XE.GET_COMPONENT_BOUNDS,{instance:e})}getComponentName(e){return this.hooks.callHook(XE.GET_COMPONENT_NAME,{instance:e})}highlightElement(e){let t=e.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook(XE.COMPONENT_HIGHLIGHT,{uid:t})}unhighlightElement(){return this.hooks.callHook(XE.COMPONENT_UNHIGHLIGHT)}},bD=`__vue_devtool_undefined__`,xD=`__vue_devtool_infinity__`,SD=`__vue_devtool_negative_infinity__`,CD=`__vue_devtool_nan__`;Object.entries({[bD]:`undefined`,[CD]:`NaN`,[xD]:`Infinity`,[SD]:`-Infinity`}).reduce((e,[t,n])=>(e[n]=t,e),{}),Z.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__??=new Set;function wD(e,t){return vD.setupDevToolsPlugin(e,t)}function TD(e,t){let[n,r]=e;if(n.app!==t)return;let i=new yD({plugin:{setupFn:r,descriptor:n},ctx:FD});n.packageName===`vuex`&&i.on.editInspectorState(e=>{i.sendInspectorState(e.inspectorId)}),r(i)}function ED(e,t){Z.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(e)||sD.highPerfModeEnabled&&!t?.inspectingComponent||(Z.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(e),lD.forEach(t=>{TD(t,e)}))}var DD=`__VUE_DEVTOOLS_ROUTER__`,OD=`__VUE_DEVTOOLS_ROUTER_INFO__`;Z[OD]??={currentRoute:null,routes:[]},Z[DD]??={},new Proxy(Z[OD],{get(e,t){return Z[OD][t]}}),new Proxy(Z[DD],{get(e,t){if(t===`value`)return Z[DD]}});function kD(e){let t=new Map;return(e?.getRoutes()||[]).filter(e=>!t.has(e.path)&&t.set(e.path,1))}function AD(e){return e.map(e=>{let{path:t,name:n,children:r,meta:i}=e;return r?.length&&(r=AD(r)),{path:t,name:n,children:r,meta:i}})}function jD(e){if(e){let{fullPath:t,hash:n,href:r,path:i,name:a,matched:o,params:s,query:c}=e;return{fullPath:t,hash:n,href:r,path:i,name:a,params:s,query:c,matched:AD(o)}}return e}function MD(e,t){function n(){let t=e.app?.config.globalProperties.$router,n=jD(t?.currentRoute.value),r=AD(kD(t)),i=console.warn;console.warn=()=>{},Z[OD]={currentRoute:n?jT(n):{},routes:jT(r)},Z[DD]=t,console.warn=i}n(),vD.on.componentUpdated(NT(()=>{t.value?.app===e.app&&(n(),!sD.highPerfModeEnabled&&FD.hooks.callHook(ZE.ROUTER_INFO_UPDATED,{state:Z[OD]}))},200))}function ND(e){return{async getInspectorTree(t){let n={...t,app:rD.value.app,rootNodes:[]};return await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(n))),t()},YE.GET_INSPECTOR_TREE)}),n.rootNodes},async getInspectorState(t){let n={...t,app:rD.value.app,state:null},r={currentTab:`custom-inspector:${t.inspectorId}`};return await new Promise(t=>{e.callHookWith(async e=>{await Promise.all(e.map(e=>e(n,r))),t()},YE.GET_INSPECTOR_STATE)}),n.state},editInspectorState(t){let n=new RE,r={...t,app:rD.value.app,set:(e,r=t.path,i=t.state.value,a)=>{n.set(e,r,i,a||n.createDefaultSetCallback(t.state))}};e.callHookWith(e=>{e.forEach(e=>e(r))},YE.EDIT_INSPECTOR_STATE)},sendInspectorState(t){let n=JE(t);e.callHook(XE.SEND_INSPECTOR_STATE,{inspectorId:t,plugin:{descriptor:n.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return OE()},cancelInspectComponentInspector(){return DE()},getComponentRenderCode(e){let t=ZT(rD.value,e);if(t)return typeof t?.type==`function`?t.type.toString():t.render.toString()},scrollToComponent(e){return kE({id:e})},openInEditor:cD,getVueInspector:ME,toggleApp(e,t){let n=nD.value.find(t=>t.id===e);n&&(oD(e),aD(n),MD(n,rD),GE(),ED(n.app,t))},inspectDOM(e){let t=ZT(rD.value,e);if(t){let[e]=aE(t);e&&(Z.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=e)}},updatePluginSettings(e,t,n){hD(e,t,n)},getPluginSettings(e){return{options:fD(e),values:pD(e)}}}}Z.__VUE_DEVTOOLS_ENV__??={vitePluginDetected:!1};var PD=QE();Z.__VUE_DEVTOOLS_KIT_CONTEXT__??={hooks:PD,get state(){return{...sD,activeAppRecordId:rD.id,activeAppRecord:rD.value,appRecords:nD.value}},api:ND(PD)};var FD=Z.__VUE_DEVTOOLS_KIT_CONTEXT__,ID=UT(((e,t)=>{(function(e){var n={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`Ae`,Å:`A`,Æ:`AE`,Ç:`C`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,Ð:`D`,Ñ:`N`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`Oe`,Ő:`O`,Ø:`O`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`Ue`,Ű:`U`,Ý:`Y`,Þ:`TH`,ß:`ss`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`ae`,å:`a`,æ:`ae`,ç:`c`,è:`e`,é:`e`,ê:`e`,ë:`e`,ì:`i`,í:`i`,î:`i`,ï:`i`,ð:`d`,ñ:`n`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`oe`,ő:`o`,ø:`o`,ù:`u`,ú:`u`,û:`u`,ü:`ue`,ű:`u`,ý:`y`,þ:`th`,ÿ:`y`,ẞ:`SS`,ا:`a`,أ:`a`,إ:`i`,آ:`aa`,ؤ:`u`,ئ:`e`,ء:`a`,ب:`b`,ت:`t`,ث:`th`,ج:`j`,ح:`h`,خ:`kh`,د:`d`,ذ:`th`,ر:`r`,ز:`z`,س:`s`,ش:`sh`,ص:`s`,ض:`dh`,ط:`t`,ظ:`z`,ع:`a`,غ:`gh`,ف:`f`,ق:`q`,ك:`k`,ل:`l`,م:`m`,ن:`n`,ه:`h`,و:`w`,ي:`y`,ى:`a`,ة:`h`,ﻻ:`la`,ﻷ:`laa`,ﻹ:`lai`,ﻵ:`laa`,گ:`g`,چ:`ch`,پ:`p`,ژ:`zh`,ک:`k`,ی:`y`,"َ":`a`,"ً":`an`,"ِ":`e`,"ٍ":`en`,"ُ":`u`,"ٌ":`on`,"ْ":``,"٠":`0`,"١":`1`,"٢":`2`,"٣":`3`,"٤":`4`,"٥":`5`,"٦":`6`,"٧":`7`,"٨":`8`,"٩":`9`,"۰":`0`,"۱":`1`,"۲":`2`,"۳":`3`,"۴":`4`,"۵":`5`,"۶":`6`,"۷":`7`,"۸":`8`,"۹":`9`,က:`k`,ခ:`kh`,ဂ:`g`,ဃ:`ga`,င:`ng`,စ:`s`,ဆ:`sa`,ဇ:`z`,စျ:`za`,ည:`ny`,ဋ:`t`,ဌ:`ta`,ဍ:`d`,ဎ:`da`,ဏ:`na`,တ:`t`,ထ:`ta`,ဒ:`d`,ဓ:`da`,န:`n`,ပ:`p`,ဖ:`pa`,ဗ:`b`,ဘ:`ba`,မ:`m`,ယ:`y`,ရ:`ya`,လ:`l`,ဝ:`w`,သ:`th`,ဟ:`h`,ဠ:`la`,အ:`a`,"ြ":`y`,"ျ":`ya`,"ွ":`w`,"ြွ":`yw`,"ျွ":`ywa`,"ှ":`h`,ဧ:`e`,"၏":`-e`,ဣ:`i`,ဤ:`-i`,ဉ:`u`,ဦ:`-u`,ဩ:`aw`,သြော:`aw`,ဪ:`aw`,"၀":`0`,"၁":`1`,"၂":`2`,"၃":`3`,"၄":`4`,"၅":`5`,"၆":`6`,"၇":`7`,"၈":`8`,"၉":`9`,"္":``,"့":``,"း":``,č:`c`,ď:`d`,ě:`e`,ň:`n`,ř:`r`,š:`s`,ť:`t`,ů:`u`,ž:`z`,Č:`C`,Ď:`D`,Ě:`E`,Ň:`N`,Ř:`R`,Š:`S`,Ť:`T`,Ů:`U`,Ž:`Z`,ހ:`h`,ށ:`sh`,ނ:`n`,ރ:`r`,ބ:`b`,ޅ:`lh`,ކ:`k`,އ:`a`,ވ:`v`,މ:`m`,ފ:`f`,ދ:`dh`,ތ:`th`,ލ:`l`,ގ:`g`,ޏ:`gn`,ސ:`s`,ޑ:`d`,ޒ:`z`,ޓ:`t`,ޔ:`y`,ޕ:`p`,ޖ:`j`,ޗ:`ch`,ޘ:`tt`,ޙ:`hh`,ޚ:`kh`,ޛ:`th`,ޜ:`z`,ޝ:`sh`,ޞ:`s`,ޟ:`d`,ޠ:`t`,ޡ:`z`,ޢ:`a`,ޣ:`gh`,ޤ:`q`,ޥ:`w`,"ަ":`a`,"ާ":`aa`,"ި":`i`,"ީ":`ee`,"ު":`u`,"ޫ":`oo`,"ެ":`e`,"ޭ":`ey`,"ޮ":`o`,"ޯ":`oa`,"ް":``,ა:`a`,ბ:`b`,გ:`g`,დ:`d`,ე:`e`,ვ:`v`,ზ:`z`,თ:`t`,ი:`i`,კ:`k`,ლ:`l`,მ:`m`,ნ:`n`,ო:`o`,პ:`p`,ჟ:`zh`,რ:`r`,ს:`s`,ტ:`t`,უ:`u`,ფ:`p`,ქ:`k`,ღ:`gh`,ყ:`q`,შ:`sh`,ჩ:`ch`,ც:`ts`,ძ:`dz`,წ:`ts`,ჭ:`ch`,ხ:`kh`,ჯ:`j`,ჰ:`h`,α:`a`,β:`v`,γ:`g`,δ:`d`,ε:`e`,ζ:`z`,η:`i`,θ:`th`,ι:`i`,κ:`k`,λ:`l`,μ:`m`,ν:`n`,ξ:`ks`,ο:`o`,π:`p`,ρ:`r`,σ:`s`,τ:`t`,υ:`y`,φ:`f`,χ:`x`,ψ:`ps`,ω:`o`,ά:`a`,έ:`e`,ί:`i`,ό:`o`,ύ:`y`,ή:`i`,ώ:`o`,ς:`s`,ϊ:`i`,ΰ:`y`,ϋ:`y`,ΐ:`i`,Α:`A`,Β:`B`,Γ:`G`,Δ:`D`,Ε:`E`,Ζ:`Z`,Η:`I`,Θ:`TH`,Ι:`I`,Κ:`K`,Λ:`L`,Μ:`M`,Ν:`N`,Ξ:`KS`,Ο:`O`,Π:`P`,Ρ:`R`,Σ:`S`,Τ:`T`,Υ:`Y`,Φ:`F`,Χ:`X`,Ψ:`PS`,Ω:`O`,Ά:`A`,Έ:`E`,Ί:`I`,Ό:`O`,Ύ:`Y`,Ή:`I`,Ώ:`O`,Ϊ:`I`,Ϋ:`Y`,ā:`a`,ē:`e`,ģ:`g`,ī:`i`,ķ:`k`,ļ:`l`,ņ:`n`,ū:`u`,Ā:`A`,Ē:`E`,Ģ:`G`,Ī:`I`,Ķ:`k`,Ļ:`L`,Ņ:`N`,Ū:`U`,Ќ:`Kj`,ќ:`kj`,Љ:`Lj`,љ:`lj`,Њ:`Nj`,њ:`nj`,Тс:`Ts`,тс:`ts`,ą:`a`,ć:`c`,ę:`e`,ł:`l`,ń:`n`,ś:`s`,ź:`z`,ż:`z`,Ą:`A`,Ć:`C`,Ę:`E`,Ł:`L`,Ń:`N`,Ś:`S`,Ź:`Z`,Ż:`Z`,Є:`Ye`,І:`I`,Ї:`Yi`,Ґ:`G`,є:`ye`,і:`i`,ї:`yi`,ґ:`g`,ă:`a`,Ă:`A`,ș:`s`,Ș:`S`,ț:`t`,Ț:`T`,ţ:`t`,Ţ:`T`,а:`a`,б:`b`,в:`v`,г:`g`,д:`d`,е:`e`,ё:`yo`,ж:`zh`,з:`z`,и:`i`,й:`i`,к:`k`,л:`l`,м:`m`,н:`n`,о:`o`,п:`p`,р:`r`,с:`s`,т:`t`,у:`u`,ф:`f`,х:`kh`,ц:`c`,ч:`ch`,ш:`sh`,щ:`sh`,ъ:``,ы:`y`,ь:``,э:`e`,ю:`yu`,я:`ya`,А:`A`,Б:`B`,В:`V`,Г:`G`,Д:`D`,Е:`E`,Ё:`Yo`,Ж:`Zh`,З:`Z`,И:`I`,Й:`I`,К:`K`,Л:`L`,М:`M`,Н:`N`,О:`O`,П:`P`,Р:`R`,С:`S`,Т:`T`,У:`U`,Ф:`F`,Х:`Kh`,Ц:`C`,Ч:`Ch`,Ш:`Sh`,Щ:`Sh`,Ъ:``,Ы:`Y`,Ь:``,Э:`E`,Ю:`Yu`,Я:`Ya`,ђ:`dj`,ј:`j`,ћ:`c`,џ:`dz`,Ђ:`Dj`,Ј:`j`,Ћ:`C`,Џ:`Dz`,ľ:`l`,ĺ:`l`,ŕ:`r`,Ľ:`L`,Ĺ:`L`,Ŕ:`R`,ş:`s`,Ş:`S`,ı:`i`,İ:`I`,ğ:`g`,Ğ:`G`,ả:`a`,Ả:`A`,ẳ:`a`,Ẳ:`A`,ẩ:`a`,Ẩ:`A`,đ:`d`,Đ:`D`,ẹ:`e`,Ẹ:`E`,ẽ:`e`,Ẽ:`E`,ẻ:`e`,Ẻ:`E`,ế:`e`,Ế:`E`,ề:`e`,Ề:`E`,ệ:`e`,Ệ:`E`,ễ:`e`,Ễ:`E`,ể:`e`,Ể:`E`,ỏ:`o`,ọ:`o`,Ọ:`o`,ố:`o`,Ố:`O`,ồ:`o`,Ồ:`O`,ổ:`o`,Ổ:`O`,ộ:`o`,Ộ:`O`,ỗ:`o`,Ỗ:`O`,ơ:`o`,Ơ:`O`,ớ:`o`,Ớ:`O`,ờ:`o`,Ờ:`O`,ợ:`o`,Ợ:`O`,ỡ:`o`,Ỡ:`O`,Ở:`o`,ở:`o`,ị:`i`,Ị:`I`,ĩ:`i`,Ĩ:`I`,ỉ:`i`,Ỉ:`i`,ủ:`u`,Ủ:`U`,ụ:`u`,Ụ:`U`,ũ:`u`,Ũ:`U`,ư:`u`,Ư:`U`,ứ:`u`,Ứ:`U`,ừ:`u`,Ừ:`U`,ự:`u`,Ự:`U`,ữ:`u`,Ữ:`U`,ử:`u`,Ử:`ư`,ỷ:`y`,Ỷ:`y`,ỳ:`y`,Ỳ:`Y`,ỵ:`y`,Ỵ:`Y`,ỹ:`y`,Ỹ:`Y`,ạ:`a`,Ạ:`A`,ấ:`a`,Ấ:`A`,ầ:`a`,Ầ:`A`,ậ:`a`,Ậ:`A`,ẫ:`a`,Ẫ:`A`,ắ:`a`,Ắ:`A`,ằ:`a`,Ằ:`A`,ặ:`a`,Ặ:`A`,ẵ:`a`,Ẵ:`A`,"⓪":`0`,"①":`1`,"②":`2`,"③":`3`,"④":`4`,"⑤":`5`,"⑥":`6`,"⑦":`7`,"⑧":`8`,"⑨":`9`,"⑩":`10`,"⑪":`11`,"⑫":`12`,"⑬":`13`,"⑭":`14`,"⑮":`15`,"⑯":`16`,"⑰":`17`,"⑱":`18`,"⑲":`18`,"⑳":`18`,"⓵":`1`,"⓶":`2`,"⓷":`3`,"⓸":`4`,"⓹":`5`,"⓺":`6`,"⓻":`7`,"⓼":`8`,"⓽":`9`,"⓾":`10`,"⓿":`0`,"⓫":`11`,"⓬":`12`,"⓭":`13`,"⓮":`14`,"⓯":`15`,"⓰":`16`,"⓱":`17`,"⓲":`18`,"⓳":`19`,"⓴":`20`,"Ⓐ":`A`,"Ⓑ":`B`,"Ⓒ":`C`,"Ⓓ":`D`,"Ⓔ":`E`,"Ⓕ":`F`,"Ⓖ":`G`,"Ⓗ":`H`,"Ⓘ":`I`,"Ⓙ":`J`,"Ⓚ":`K`,"Ⓛ":`L`,"Ⓜ":`M`,"Ⓝ":`N`,"Ⓞ":`O`,"Ⓟ":`P`,"Ⓠ":`Q`,"Ⓡ":`R`,"Ⓢ":`S`,"Ⓣ":`T`,"Ⓤ":`U`,"Ⓥ":`V`,"Ⓦ":`W`,"Ⓧ":`X`,"Ⓨ":`Y`,"Ⓩ":`Z`,"ⓐ":`a`,"ⓑ":`b`,"ⓒ":`c`,"ⓓ":`d`,"ⓔ":`e`,"ⓕ":`f`,"ⓖ":`g`,"ⓗ":`h`,"ⓘ":`i`,"ⓙ":`j`,"ⓚ":`k`,"ⓛ":`l`,"ⓜ":`m`,"ⓝ":`n`,"ⓞ":`o`,"ⓟ":`p`,"ⓠ":`q`,"ⓡ":`r`,"ⓢ":`s`,"ⓣ":`t`,"ⓤ":`u`,"ⓦ":`v`,"ⓥ":`w`,"ⓧ":`x`,"ⓨ":`y`,"ⓩ":`z`,"“":`"`,"”":`"`,"‘":`'`,"’":`'`,"∂":`d`,ƒ:`f`,"™":`(TM)`,"©":`(C)`,œ:`oe`,Œ:`OE`,"®":`(R)`,"†":`+`,"℠":`(SM)`,"…":`...`,"˚":`o`,º:`o`,ª:`a`,"•":`*`,"၊":`,`,"။":`.`,$:`USD`,"€":`EUR`,"₢":`BRN`,"₣":`FRF`,"£":`GBP`,"₤":`ITL`,"₦":`NGN`,"₧":`ESP`,"₩":`KRW`,"₪":`ILS`,"₫":`VND`,"₭":`LAK`,"₮":`MNT`,"₯":`GRD`,"₱":`ARS`,"₲":`PYG`,"₳":`ARA`,"₴":`UAH`,"₵":`GHS`,"¢":`cent`,"¥":`CNY`,元:`CNY`,円:`YEN`,"﷼":`IRR`,"₠":`EWE`,"฿":`THB`,"₨":`INR`,"₹":`INR`,"₰":`PF`,"₺":`TRY`,"؋":`AFN`,"₼":`AZN`,лв:`BGN`,"៛":`KHR`,"₡":`CRC`,"₸":`KZT`,ден:`MKD`,zł:`PLN`,"₽":`RUB`,"₾":`GEL`},r=[`်`,`ް`],i={"ာ":`a`,"ါ":`a`,"ေ":`e`,"ဲ":`e`,"ိ":`i`,"ီ":`i`,"ို":`o`,"ု":`u`,"ူ":`u`,"ေါင်":`aung`,"ော":`aw`,"ော်":`aw`,"ေါ":`aw`,"ေါ်":`aw`,"်":`်`,က်:`et`,"ိုက်":`aik`,"ောက်":`auk`,င်:`in`,"ိုင်":`aing`,"ောင်":`aung`,စ်:`it`,ည်:`i`,တ်:`at`,"ိတ်":`eik`,"ုတ်":`ok`,"ွတ်":`ut`,"ေတ်":`it`,ဒ်:`d`,"ိုဒ်":`ok`,"ုဒ်":`ait`,န်:`an`,"ာန်":`an`,"ိန်":`ein`,"ုန်":`on`,"ွန်":`un`,ပ်:`at`,"ိပ်":`eik`,"ုပ်":`ok`,"ွပ်":`ut`,န်ုပ်:`nub`,မ်:`an`,"ိမ်":`ein`,"ုမ်":`on`,"ွမ်":`un`,ယ်:`e`,"ိုလ်":`ol`,ဉ်:`in`,"ံ":`an`,"ိံ":`ein`,"ုံ":`on`,"ައް":`ah`,"ަށް":`ah`},a={en:{},az:{ç:`c`,ə:`e`,ğ:`g`,ı:`i`,ö:`o`,ş:`s`,ü:`u`,Ç:`C`,Ə:`E`,Ğ:`G`,İ:`I`,Ö:`O`,Ş:`S`,Ü:`U`},cs:{č:`c`,ď:`d`,ě:`e`,ň:`n`,ř:`r`,š:`s`,ť:`t`,ů:`u`,ž:`z`,Č:`C`,Ď:`D`,Ě:`E`,Ň:`N`,Ř:`R`,Š:`S`,Ť:`T`,Ů:`U`,Ž:`Z`},fi:{ä:`a`,Ä:`A`,ö:`o`,Ö:`O`},hu:{ä:`a`,Ä:`A`,ö:`o`,Ö:`O`,ü:`u`,Ü:`U`,ű:`u`,Ű:`U`},lt:{ą:`a`,č:`c`,ę:`e`,ė:`e`,į:`i`,š:`s`,ų:`u`,ū:`u`,ž:`z`,Ą:`A`,Č:`C`,Ę:`E`,Ė:`E`,Į:`I`,Š:`S`,Ų:`U`,Ū:`U`},lv:{ā:`a`,č:`c`,ē:`e`,ģ:`g`,ī:`i`,ķ:`k`,ļ:`l`,ņ:`n`,š:`s`,ū:`u`,ž:`z`,Ā:`A`,Č:`C`,Ē:`E`,Ģ:`G`,Ī:`i`,Ķ:`k`,Ļ:`L`,Ņ:`N`,Š:`S`,Ū:`u`,Ž:`Z`},pl:{ą:`a`,ć:`c`,ę:`e`,ł:`l`,ń:`n`,ó:`o`,ś:`s`,ź:`z`,ż:`z`,Ą:`A`,Ć:`C`,Ę:`e`,Ł:`L`,Ń:`N`,Ó:`O`,Ś:`S`,Ź:`Z`,Ż:`Z`},sv:{ä:`a`,Ä:`A`,ö:`o`,Ö:`O`},sk:{ä:`a`,Ä:`A`},sr:{љ:`lj`,њ:`nj`,Љ:`Lj`,Њ:`Nj`,đ:`dj`,Đ:`Dj`},tr:{Ü:`U`,Ö:`O`,ü:`u`,ö:`o`}},o={ar:{"∆":`delta`,"∞":`la-nihaya`,"♥":`hob`,"&":`wa`,"|":`aw`,"<":`aqal-men`,">":`akbar-men`,"∑":`majmou`,"¤":`omla`},az:{},ca:{"∆":`delta`,"∞":`infinit`,"♥":`amor`,"&":`i`,"|":`o`,"<":`menys que`,">":`mes que`,"∑":`suma dels`,"¤":`moneda`},cs:{"∆":`delta`,"∞":`nekonecno`,"♥":`laska`,"&":`a`,"|":`nebo`,"<":`mensi nez`,">":`vetsi nez`,"∑":`soucet`,"¤":`mena`},de:{"∆":`delta`,"∞":`unendlich`,"♥":`Liebe`,"&":`und`,"|":`oder`,"<":`kleiner als`,">":`groesser als`,"∑":`Summe von`,"¤":`Waehrung`},dv:{"∆":`delta`,"∞":`kolunulaa`,"♥":`loabi`,"&":`aai`,"|":`noonee`,"<":`ah vure kuda`,">":`ah vure bodu`,"∑":`jumula`,"¤":`faisaa`},en:{"∆":`delta`,"∞":`infinity`,"♥":`love`,"&":`and`,"|":`or`,"<":`less than`,">":`greater than`,"∑":`sum`,"¤":`currency`},es:{"∆":`delta`,"∞":`infinito`,"♥":`amor`,"&":`y`,"|":`u`,"<":`menos que`,">":`mas que`,"∑":`suma de los`,"¤":`moneda`},fa:{"∆":`delta`,"∞":`bi-nahayat`,"♥":`eshgh`,"&":`va`,"|":`ya`,"<":`kamtar-az`,">":`bishtar-az`,"∑":`majmooe`,"¤":`vahed`},fi:{"∆":`delta`,"∞":`aarettomyys`,"♥":`rakkaus`,"&":`ja`,"|":`tai`,"<":`pienempi kuin`,">":`suurempi kuin`,"∑":`summa`,"¤":`valuutta`},fr:{"∆":`delta`,"∞":`infiniment`,"♥":`Amour`,"&":`et`,"|":`ou`,"<":`moins que`,">":`superieure a`,"∑":`somme des`,"¤":`monnaie`},ge:{"∆":`delta`,"∞":`usasruloba`,"♥":`siqvaruli`,"&":`da`,"|":`an`,"<":`naklebi`,">":`meti`,"∑":`jami`,"¤":`valuta`},gr:{},hu:{"∆":`delta`,"∞":`vegtelen`,"♥":`szerelem`,"&":`es`,"|":`vagy`,"<":`kisebb mint`,">":`nagyobb mint`,"∑":`szumma`,"¤":`penznem`},it:{"∆":`delta`,"∞":`infinito`,"♥":`amore`,"&":`e`,"|":`o`,"<":`minore di`,">":`maggiore di`,"∑":`somma`,"¤":`moneta`},lt:{"∆":`delta`,"∞":`begalybe`,"♥":`meile`,"&":`ir`,"|":`ar`,"<":`maziau nei`,">":`daugiau nei`,"∑":`suma`,"¤":`valiuta`},lv:{"∆":`delta`,"∞":`bezgaliba`,"♥":`milestiba`,"&":`un`,"|":`vai`,"<":`mazak neka`,">":`lielaks neka`,"∑":`summa`,"¤":`valuta`},my:{"∆":`kwahkhyaet`,"∞":`asaonasme`,"♥":`akhyait`,"&":`nhin`,"|":`tho`,"<":`ngethaw`,">":`kyithaw`,"∑":`paungld`,"¤":`ngwekye`},mk:{},nl:{"∆":`delta`,"∞":`oneindig`,"♥":`liefde`,"&":`en`,"|":`of`,"<":`kleiner dan`,">":`groter dan`,"∑":`som`,"¤":`valuta`},pl:{"∆":`delta`,"∞":`nieskonczonosc`,"♥":`milosc`,"&":`i`,"|":`lub`,"<":`mniejsze niz`,">":`wieksze niz`,"∑":`suma`,"¤":`waluta`},pt:{"∆":`delta`,"∞":`infinito`,"♥":`amor`,"&":`e`,"|":`ou`,"<":`menor que`,">":`maior que`,"∑":`soma`,"¤":`moeda`},ro:{"∆":`delta`,"∞":`infinit`,"♥":`dragoste`,"&":`si`,"|":`sau`,"<":`mai mic ca`,">":`mai mare ca`,"∑":`suma`,"¤":`valuta`},ru:{"∆":`delta`,"∞":`beskonechno`,"♥":`lubov`,"&":`i`,"|":`ili`,"<":`menshe`,">":`bolshe`,"∑":`summa`,"¤":`valjuta`},sk:{"∆":`delta`,"∞":`nekonecno`,"♥":`laska`,"&":`a`,"|":`alebo`,"<":`menej ako`,">":`viac ako`,"∑":`sucet`,"¤":`mena`},sr:{},tr:{"∆":`delta`,"∞":`sonsuzluk`,"♥":`ask`,"&":`ve`,"|":`veya`,"<":`kucuktur`,">":`buyuktur`,"∑":`toplam`,"¤":`para birimi`},uk:{"∆":`delta`,"∞":`bezkinechnist`,"♥":`lubov`,"&":`i`,"|":`abo`,"<":`menshe`,">":`bilshe`,"∑":`suma`,"¤":`valjuta`},vn:{"∆":`delta`,"∞":`vo cuc`,"♥":`yeu`,"&":`va`,"|":`hoac`,"<":`nho hon`,">":`lon hon`,"∑":`tong`,"¤":`tien te`}},s=[`;`,`?`,`:`,`@`,`&`,`=`,`+`,`$`,`,`,`/`].join(``),c=[`;`,`?`,`:`,`@`,`&`,`=`,`+`,`$`,`,`].join(``),l=[`.`,`!`,`~`,`*`,`'`,`(`,`)`].join(``),u=function(e,t){var u=`-`,d=``,m=``,h=!0,g={},_,v,y,b,x,S,C,w,T,E,D,O,k,A,j=``;if(typeof e!=`string`)return``;if(typeof t==`string`&&(u=t),C=o.en,w=a.en,typeof t==`object`)for(D in _=t.maintainCase||!1,g=t.custom&&typeof t.custom==`object`?t.custom:g,y=+t.truncate>1&&t.truncate||!1,b=t.uric||!1,x=t.uricNoSlash||!1,S=t.mark||!1,h=!(t.symbols===!1||t.lang===!1),u=t.separator||u,b&&(j+=s),x&&(j+=c),S&&(j+=l),C=t.lang&&o[t.lang]&&h?o[t.lang]:h?o.en:{},w=t.lang&&a[t.lang]?a[t.lang]:t.lang===!1||t.lang===!0?{}:a.en,t.titleCase&&typeof t.titleCase.length==`number`&&Array.prototype.toString.call(t.titleCase)?(t.titleCase.forEach(function(e){g[e+``]=e+``}),v=!0):v=!!t.titleCase,t.custom&&typeof t.custom.length==`number`&&Array.prototype.toString.call(t.custom)&&t.custom.forEach(function(e){g[e+``]=e+``}),Object.keys(g).forEach(function(t){var n=t.length>1?RegExp(`\\b`+f(t)+`\\b`,`gi`):new RegExp(f(t),`gi`);e=e.replace(n,g[t])}),g)j+=D;for(j+=u,j=f(j),e=e.replace(/(^\s+|\s+$)/g,``),k=!1,A=!1,E=0,O=e.length;E=0?(m+=D,D=``):A===!0?(D=i[m]+n[D],m=``):D=k&&n[D].match(/[A-Za-z0-9]/)?` `+n[D]:n[D],k=!1,A=!1):D in i?(m+=D,D=``,E===O-1&&(D=i[m]),A=!0):C[D]&&!(b&&s.indexOf(D)!==-1)&&!(x&&c.indexOf(D)!==-1)?(D=k||d.substr(-1).match(/[A-Za-z0-9]/)?u+C[D]:C[D],D+=e[E+1]!==void 0&&e[E+1].match(/[A-Za-z0-9]/)?u:``,k=!0):(A===!0?(D=i[m]+D,m=``,A=!1):k&&(/[A-Za-z0-9]/.test(D)||d.substr(-1).match(/A-Za-z0-9]/))&&(D=` `+D),k=!1),d+=D.replace(RegExp(`[^\\w\\s`+j+`_-]`,`g`),u);return v&&(d=d.replace(/(\w)(\S*)/g,function(e,t,n){var r=t.toUpperCase()+(n===null?``:n);return Object.keys(g).indexOf(r.toLowerCase())<0?r:r.toLowerCase()})),d=d.replace(/\s+/g,u).replace(RegExp(`\\`+u+`+`,`g`),u).replace(RegExp(`(^\\`+u+`+|\\`+u+`+$)`,`g`),``),y&&d.length>y&&(T=d.charAt(y)===u,d=d.slice(0,y),T||(d=d.slice(0,d.lastIndexOf(u)))),!_&&!v&&(d=d.toLowerCase()),d},d=function(e){return function(t){return u(t,e)}},f=function(e){return e.replace(/[-\\^$*+?.()|[\]{}\/]/g,`\\$&`)},p=function(e,t){for(var n in t)if(t[n]===e)return!0};if(t!==void 0&&t.exports)t.exports=u,t.exports.createSlug=d;else if(typeof define<`u`&&define.amd)define([],function(){return u});else try{if(e.getSlug||e.createSlug)throw`speakingurl: globals exists /(getSlug|createSlug)/`;e.getSlug=u,e.createSlug=d}catch{}})(e)}));UT(((e,t)=>{t.exports=ID()}))(),Z.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__??={id:0,appIds:new Set};function LD(e){sD.highPerfModeEnabled=e??!sD.highPerfModeEnabled,!e&&rD.value&&ED(rD.value.app)}function RD(e){sD.devtoolsClientDetected={...sD.devtoolsClientDetected,...e},LD(!Object.values(sD.devtoolsClientDetected).some(Boolean))}Z.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__??=RD;var zD=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},BD=class{constructor(e){this.generateIdentifier=e,this.kv=new zD}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},VD=class extends BD{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function HD(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function UD(e,t){let n=HD(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;et(n,e))}function GD(e,t){return e.indexOf(t)!==-1}function KD(e,t){for(let n=0;nt.isApplicable(e))}findByName(e){return this.transfomers[e]}},JD=e=>Object.prototype.toString.call(e).slice(8,-1),YD=e=>e===void 0,XD=e=>e===null,ZD=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null||Object.getPrototypeOf(e)===Object.prototype,QD=e=>ZD(e)&&Object.keys(e).length===0,$D=e=>Array.isArray(e),eO=e=>typeof e==`string`,tO=e=>typeof e==`number`&&!isNaN(e),nO=e=>typeof e==`boolean`,rO=e=>e instanceof RegExp,iO=e=>e instanceof Map,aO=e=>e instanceof Set,oO=e=>JD(e)===`Symbol`,sO=e=>e instanceof Date&&!isNaN(e.valueOf()),cO=e=>e instanceof Error,lO=e=>typeof e==`number`&&isNaN(e),uO=e=>nO(e)||XD(e)||YD(e)||tO(e)||eO(e)||oO(e),dO=e=>typeof e==`bigint`,fO=e=>e===1/0||e===-1/0,pO=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),mO=e=>e instanceof URL,hO=e=>e.replace(/\./g,`\\.`),gO=e=>e.map(String).map(hO).join(`.`),_O=e=>{let t=[],n=``;for(let r=0;rnull,()=>void 0),vO(dO,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),vO(sO,`Date`,e=>e.toISOString(),e=>new Date(e)),vO(cO,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),vO(rO,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),vO(aO,`set`,e=>[...e.values()],e=>new Set(e)),vO(iO,`map`,e=>[...e.entries()],e=>new Map(e)),vO(e=>lO(e)||fO(e),`number`,e=>lO(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),vO(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),vO(mO,`URL`,e=>e.toString(),e=>new URL(e))];function bO(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var xO=bO((e,t)=>oO(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),SO=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),CO=bO(pO,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=SO[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function wO(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var TO=bO(wO,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),EO=bO((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),DO=[TO,xO,EO,CO],OO=(e,t)=>{let n=KD(DO,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=KD(yO,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},kO={};yO.forEach(e=>{kO[e.annotation]=e});var AO=(e,t,n)=>{if($D(t))switch(t[0]){case`symbol`:return xO.untransform(e,t,n);case`class`:return TO.untransform(e,t,n);case`custom`:return EO.untransform(e,t,n);case`typed-array`:return CO.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=kO[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},jO=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function MO(e){if(GD(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(GD(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(GD(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var NO=(e,t)=>{MO(t);for(let n=0;n{if(MO(t),t.length===0)return n(e);let r=e;for(let e=0;eFO(e,t,[...n,..._O(r)]));return}let[r,i]=e;i&&WD(i,(e,r)=>{FO(e,t,[...n,..._O(r)])}),t(r,n)}function IO(e,t,n){return FO(t,(t,r)=>{e=PO(e,r,e=>AO(e,t,n))}),e}function LO(e,t){function n(t,n){let r=NO(e,_O(n));t.map(_O).forEach(t=>{e=PO(e,t,()=>r)})}if($D(t)){let[r,i]=t;r.forEach(t=>{e=PO(e,_O(t),()=>e)}),i&&WD(i,n)}else WD(t,n);return e}var RO=(e,t)=>ZD(e)||$D(e)||iO(e)||aO(e)||wO(e,t);function zO(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function BO(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...a]=e;i.length===0?r=a.map(gO):n[gO(i)]=a.map(gO)}),r?QD(n)?[r]:[r,n]:QD(n)?void 0:n}var VO=(e,t,n,r,i=[],a=[],o=new Map)=>{let s=uO(e);if(!s){zO(e,i,t);let n=o.get(e);if(n)return r?{transformedValue:null}:n}if(!RO(e,n)){let t=OO(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return s||o.set(e,r),r}if(GD(a,e))return{transformedValue:null};let c=OO(e,n),l=c?.value??e,u=$D(l)?[]:{},d={};WD(l,(s,c)=>{if(c===`__proto__`||c===`constructor`||c===`prototype`)throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);let l=VO(s,t,n,r,[...i,c],[...a,e],o);u[c]=l.transformedValue,$D(l.annotations)?d[c]=l.annotations:ZD(l.annotations)&&WD(l.annotations,(e,t)=>{d[hO(c)+`.`+t]=e})});let f=QD(d)?{transformedValue:u,annotations:c?[c.type]:void 0}:{transformedValue:u,annotations:c?[c.type,d]:d};return s||o.set(e,f),f};function HO(e){return Object.prototype.toString.call(e).slice(8,-1)}function UO(e){return HO(e)===`Array`}function WO(e){if(HO(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function GO(e,t,n,r,i){let a={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;a===`enumerable`&&(e[t]=n),i&&a===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function KO(e,t={}){if(UO(e))return e.map(e=>KO(e,t));if(!WO(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(UO(t.props)&&!t.props.includes(r))return n;let i=e[r];return GO(n,r,KO(i,t),e,t.nonenumerable),n},{})}var qO=class{constructor({dedupe:e=!1}={}){this.classRegistry=new VD,this.symbolRegistry=new BD(e=>e.description??``),this.customTransformerRegistry=new qD,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=VO(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let i=BO(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r}deserialize(e){let{json:t,meta:n}=e,r=KO(t);return n?.values&&(r=IO(r,n.values,this)),n?.referentialEqualities&&(r=LO(r,n.referentialEqualities)),r}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e))}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};qO.defaultInstance=new qO,qO.serialize=qO.defaultInstance.serialize.bind(qO.defaultInstance),qO.deserialize=qO.defaultInstance.deserialize.bind(qO.defaultInstance),qO.stringify=qO.defaultInstance.stringify.bind(qO.defaultInstance),qO.parse=qO.defaultInstance.parse.bind(qO.defaultInstance),qO.registerClass=qO.defaultInstance.registerClass.bind(qO.defaultInstance),qO.registerSymbol=qO.defaultInstance.registerSymbol.bind(qO.defaultInstance),qO.registerCustom=qO.defaultInstance.registerCustom.bind(qO.defaultInstance),qO.allowErrorProps=qO.defaultInstance.allowErrorProps.bind(qO.defaultInstance),qO.serialize,qO.deserialize,qO.stringify,qO.parse,qO.registerClass,qO.registerCustom,qO.registerSymbol,qO.allowErrorProps,Z.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__??=[],Z.__VUE_DEVTOOLS_KIT_RPC_CLIENT__??=null,Z.__VUE_DEVTOOLS_KIT_RPC_SERVER__??=null,Z.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__??=null,Z.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__??=null,Z.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__??=null;var JO=`5.8.3`;function YO(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var XO=YO(`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`),ZO=e=>t=>gw(t)&&e in t&&!!t[e],QO=ZO(`isObject3D`),$O=ZO(`isMesh`),ek=ZO(`isCamera`),tk=ZO(`isOrthographicCamera`),nk=ZO(`isPerspectiveCamera`),rk=ZO(`isColor`),ik=e=>_w(e)||hw(e)||rk(e),ak=e=>e instanceof Eu,ok=ZO(`isBufferGeometry`),sk=ZO(`isMaterial`),ck=ZO(`isLight`),lk=ZO(`isFog`),uk=ZO(`isScene`),dk=e=>typeof e==`object`&&!!e&&`set`in e&&typeof e.set==`function`,fk=e=>dk(e)&&`copy`in e&&typeof e.copy==`function`,pk=e=>!!e?.constructor,mk=e=>ek(e)||tk(e)||nk(e),hk=e=>QO(e)||ok(e)||sk(e)||lk(e),gk=ZO(`isPrimitive`),_k=e=>hk(e)&&`__tres`in e,vk=(e,t)=>{let n=0;for(let r=0;r`map`in e&&!!e.map)(e)&&e.map.dispose(),e.dispose()}function Ck(e){if(e.parent&&e.removeFromParent?.(),delete e.__tres,[...e.children].forEach(e=>Ck(e)),!(e instanceof $u)){let t=e;e&&e.dispose?.(),t.geometry&&t.geometry.dispose(),Array.isArray(t.material)?t.material.forEach(e=>Sk(e)):t.material&&Sk(t.material)}}function wk(e,t){let n=e;if(t.includes(`-`)){let e=t.split(`-`),r=e.shift();for(;n&&e.length;)r in n?(n=n[r],r=e.shift()):r=Tk(r,e.shift());return{target:n,key:Tk(r,...e)}}else return{target:n,key:t}}function Tk(...e){return e.map((e,t)=>t===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join(``)}function Ek(e,t,n){let r=/-\d+$/;if(_w(n)){if(r.test(n)){let{target:t,key:i}=wk(e,n.replace(r,``));if(!Array.isArray(t[i])){let e=t[i],n=[];n.__tresDetach=()=>{n.every(e=>yw(e))&&(t[i]=e)},t[i]=n}}let{target:i,key:a}=wk(e,n);t.__tres.previousAttach=i[a],i[a]=jk(t)}else t.__tres.previousAttach=n(e,t)}function Dk(e,t,n){if(_w(n)){let{target:r,key:i}=wk(e,n),a=t.__tres.previousAttach;a===void 0?delete r[i]:r[i]=a,`__tresDetach`in r&&r.__tresDetach()}else t.__tres?.previousAttach?.(e,t);delete t.__tres?.previousAttach}function Ok(e,t,n){let r=e;return r.__tres={type:`unknown`,root:n,memoizedProps:{},objects:[],parent:null,previousAttach:null,...t},r.__tres.attach||(sk(r)?r.__tres.attach=`material`:ok(r)?r.__tres.attach=`geometry`:lk(r)&&(r.__tres.attach=`fog`)),r}function kk(e){let t=e?.__tres?.root;t?.renderer&&t.renderer.canBeInvalidated.value&&t.renderer.invalidate()}function Ak(e,t,n,r,i){let a=[...t.__tres.objects],o=jk(t);if(e=jk(e),o===e)return!0;let s=Ok(e,t.__tres??{},i),c=t.parent??t.__tres.parent??null,l={...t.__tres.memoizedProps};delete l.object;for(let e of a)Mk(e,i),Nk(e,i);o.__tres.objects=[],r.remove(t);for(let[e,t]of Object.entries(l))r.patchProp(s,e,s[e],t);n(e),r.insert(t,c);for(let e of a)r.insert(e,t);return!0}function jk(e){if(gk(e)){let t=e;return t.object.__tres=t.__tres,t.object}else return e}function Mk(e,t){let n=e.__tres?.parent||t.scene.value;e.__tres&&(e.__tres.parent=null),n&&n.__tres&&`objects`in n.__tres&&vk(n.__tres.objects,t=>t!==e),e.__tres?.attach?Dk(n,e,e.__tres.attach):(e.parent?.remove?.(jk(e)),e.parent=null)}function Nk(e,t){e.traverse?.(e=>{mk(e)&&t.camera.deregisterCamera(e)}),mk(e)&&t.camera.deregisterCamera(e),kk(e)}function Pk(e,t,n){let r=new e(n?.manager),i=Mt({loaded:0,total:0,percentage:0});n?.extensions&&n.extensions(r);let a=Zt(t),o=ew(e=>new Promise((t,n)=>{let o=e||a||``;r.load(o,e=>{t(e)},e=>{i.loaded=e.loaded,i.total=e.total,i.percentage=i.loaded/i.total*100},e=>{n(e)})}),n?.initialValue??null,{...n?.asyncOptions,immediate:n?.asyncOptions?.immediate??!0}),s=Bn(()=>Zt(t),e=>{if(e){let t=o.state.value;t&&typeof t==`object`&&`scene`in t&&t.scene&&Ck(t.scene),o.execute(0,e)}});return pr(()=>{s();let e=o.state.value;e&&typeof e==`object`&&`scene`in e&&e.scene&&Ck(e.scene)}),{...o,load:e=>{o.execute(0,e)},progress:i}}var Fk=({sizes:e})=>{let t=Kt([]),n=Za(()=>t.value[0]),r=e=>{let n=ek(e)?e:t.value.find(t=>t.uuid===e);n&&(t.value=[n,...t.value.filter(({uuid:e})=>e!==n.uuid)])};return zn(()=>{e.aspectRatio.value&&t.value.forEach(t=>{nk(t)&&(t.aspect=e.aspectRatio.value,t.updateProjectionMatrix())})}),{activeCamera:n,cameras:t,registerCamera:(e,n=!1)=>{t.value.some(({uuid:t})=>t===e.uuid)||(t.value.push(e),n&&r(e.uuid))},deregisterCamera:e=>{t.value=t.value.filter(({uuid:t})=>t!==e.uuid)},setActiveCamera:r}};function Ik(){let e=new Map,t=new Set,n=0,r=!1,i=()=>{let n=Array.from(e.entries()).sort((e,t)=>{let n=e[1].priority-t[1].priority;return n===0?e[1].addI-t[1].addI:n});t.clear(),n.forEach(e=>t.add(e[0]))},a=n=>{e.delete(n),t.delete(n)};return{on:(t,i=0)=>{e.set(t,{priority:i,addI:n++});let o=()=>a(t);return SC(o),r=!0,{off:o}},off:a,trigger:(...e)=>(r&&=(i(),!1),Promise.all(Array.from(t).map(t=>t(...e)))),dispose:()=>{e.clear(),t.clear()},get count(){return e.size}}}var Lk=Kt({}),Rk=e=>Object.assign(Lk.value,e),zk=(e,t,n)=>{if(!mw(e.setPixelRatio))return;let r=0;if(n&&Array.isArray(n)&&n.length>=2){let[e,i]=n;r=Wl.clamp(t,e,i)}else r=hw(n)?n:t;r!==e.getPixelRatio?.()&&e.setPixelRatio(r)},Bk=Number.parseInt(`185`),Vk=179;function Hk(){if(Bk>=Vk){let e=new vv;return{getDelta:()=>e.getDelta(),getElapsed:()=>e.getElapsed(),update:()=>e.update(),start:()=>{typeof document<`u`&&e.connect(document)},stop:()=>e.disconnect()}}else{let e=new oy;return{getDelta:()=>e.getDelta(),getElapsed:()=>e.elapsedTime,update:()=>{},start:()=>e.start(),stop:()=>e.stop()}}}var Uk=(e,{fpsLimit:t}={})=>{let n=Hk(),r={before:CC(),after:CC()},{pause:i,resume:a,isActive:o}=$C(()=>{n.update();let t={delta:n.getDelta(),elapsed:n.getElapsed()};r.before.trigger(t),e(),r.after.trigger(t)},{immediate:!1,fpsLimit:t});return{start:()=>{n.start(),a()},stop:()=>{n.stop(),i()},isActive:o,onBeforeLoop:r.before.on,onLoop:r.after.on}},Wk=class extends Error{name=`TresRendererError`;constructor(e,t,n){super(e,n),this.code=t}};function Gk({scene:e,canvas:t,options:n,fpsLimit:r,contextParts:{sizes:i,camera:a}}){let o=mw(n.renderer)?n.renderer({sizes:i,scene:e,camera:a,canvas:t}):new xC({...n,canvas:YC(t)}),s=Kt(Zt(n.renderMode)===`manual`?0:1),c=Za(()=>Zt(n.renderMode)===`on-demand`&&s.value===0),l=()=>e.value.traverse(e=>{e instanceof Jf&&e.material instanceof cf&&(e.material.needsUpdate=!0)}),u=(e=1)=>{c.value&&(s.value=Math.min(60,s.value+e))},d=()=>{if(Zt(n.renderMode)!==`manual`)throw Error(`advance can only be called in manual render mode.`);s.value=1},f=()=>{Zt(n.renderMode)===`on-demand`&&u()},p=Za(()=>Zt(n.renderMode)===`always`),m=e=>gw(e)&&`isRenderer`in e&&!!e.isRenderer,h=CC(),g=CC(),_=!1,v=Kt(!1),y=Kt(null),b=async()=>{try{m(o)&&await o.init(),v.value=!0}catch(e){let t=new Wk(e instanceof Error?e.message:`Unknown error`,`INITIALIZATION_FAILED`,{cause:e instanceof Error?e:void 0});y.value=t,console.error(`[TresJS] Renderer initialization failed. This may occur if: + - WebGPU is not supported by your browser + - GPU is not available or lacks required features + - GPU drivers are outdated +Error details: ${t.message}`,t),g.trigger(t)}},x=CC(),S=()=>{s.value=p.value?1:Math.max(0,s.value-1),x.trigger(o)},C=t=>{a.activeCamera.value&&(o.render(e.value,a.activeCamera.value),t())},w=e=>{C=e},T=Uk(()=>{s.value&&C(S)},{fpsLimit:r});h.on(()=>{v.value&&T.start()}),Bn([i.width,i.height,v],()=>{v.value&&(o.setSize(i.width.value,i.height.value),!_&&o.domElement.width&&o.domElement.height&&(_=!0,bn(()=>{h.trigger(o)})),f())},{immediate:!0}),zn(()=>{v.value&&zk(o,i.pixelRatio.value,Zt(n.dpr))}),b(),Zt(n.renderMode)===`on-demand`&&u(),Zt(n.renderMode)===`manual`&&GC(100,{callback:d});let E=Za(()=>{let e=Zt(n.clearColor),t=Zt(n.clearAlpha),r=typeof e==`string`&&e.length===9&&e.startsWith(`#`);return r&&t!==void 0&&xk(`clearColor with alpha (e.g. ${e}) and clearAlpha cannot both be set, using clearColor as source of truth`),r?{alpha:Number.parseInt(e.slice(7,9),16)/255,color:e.slice(0,7)}:{alpha:t,color:e}});return zn(()=>{if(!v.value)return;let e=E.value;e.color===void 0||e.alpha===void 0||o.setClearColor(e.color,e.alpha)}),zn(()=>{if(!v.value)return;let e=n.toneMapping;e&&(o.toneMapping=e)}),zn(()=>{if(!v.value)return;let e=n.toneMappingExposure;e&&(o.toneMappingExposure=e)}),zn(()=>{if(!v.value)return;let e=n.outputColorSpace;e&&(o.outputColorSpace=e)}),zn(()=>{if(!v.value)return;let e=n.shadows;e!==void 0&&(o.shadowMap.enabled=e,l())}),zn(()=>{if(!v.value)return;let e=n.shadowMapType;e!==void 0&&(o.shadowMap.type=e,l())}),pr(()=>{o.dispose(),`forceContextLoss`in o&&o.forceContextLoss()}),{loop:T,instance:o,advance:d,onReady:h.on,onRender:x.on,onError:g.on,invalidate:u,canBeInvalidated:c,mode:Zt(n.renderMode),replaceRenderFunction:w,isInitialized:v,error:y}}function Kk(e,t,n=10){let{pixelRatio:r}=iw(),i=Zt(e)?uw():ow(Za(()=>Zt(t).parentElement)),a=Pt(zC(i.width,n)),o=Pt(zC(i.height,n));return{width:a,height:o,pixelRatio:r,aspectRatio:Za(()=>a.value/o.value)}}function qk({canvas:e,contextParts:{scene:t,camera:n,renderer:r}}){let{update:i,destroy:a}=pT(Zt(e),()=>Zt(n.activeCamera),t.value),{off:o}=r.loop.onLoop(i);pr(a),pr(o);let s=jw(t.value),c=CC();return s.addEventListener(`click`,c.trigger),{onPointerMissed:c.on}}var Jk=`useTres`,[Yk,Xk]=DC(({scene:e,canvas:t,fpsLimit:n,windowSize:r,rendererOptions:i})=>{let a=qt(e),o=Kk(r,t),s=Fk({sizes:o}),c=Gk({scene:a,canvas:t,options:i,fpsLimit:n,contextParts:{sizes:o,camera:s}}),l=qk({canvas:t,contextParts:{scene:a,camera:s,renderer:c}}),u={sizes:o,scene:a,camera:s,renderer:c,controls:Kt(null),extend:Rk,events:l};return u.scene.value.__tres={root:u,objects:[],isUnmounting:!1},u},{injectionKey:`useTres`}),Zk=()=>{let e=Xk();if(!e)throw Error(`useTresContext must be used together with useTresContextProvider. + You probably tried to use it above or on the same level as a TresCanvas component. + It should be used in child components of a TresCanvas instance.`);return e};function Qk(){let{scene:e,renderer:t,camera:n,sizes:r,controls:i,extend:a,events:o}=Zk();return{scene:e,renderer:t.instance,camera:n.activeCamera,sizes:r,controls:i,extend:a,events:o,invalidate:t.invalidate,advance:t.advance}}var $k=()=>{let e=Qk(),{renderer:t}=Zk(),n=Ik(),r=Ik();t.loop.onBeforeLoop(t=>{n.trigger({...e,...t})}),t.loop.onLoop(t=>{r.trigger({...e,...t})});let i=t.replaceRenderFunction;return{stop:t.loop.stop,start:t.loop.start,isActive:t.loop.isActive,onBeforeRender:n.on,onRender:r.on,render:i}};function eA(e,t={},n={}){let r=e,i=e=>{r=e},a=new Proxy({},{});return a=new Proxy({},{has(e,n){return n in t||n in r},get(e,n,i){return n in t?t[n](r):r[n]},set(e,t,o){return n[t]?n[t](o,r,a,i):r[t]=o,!0}}),a}var tA=[`onClick`,`onContextmenu`,`onPointermove`,`onPointerenter`,`onPointerleave`,`onPointerover`,`onPointerout`,`onDblclick`,`onPointerdown`,`onPointerup`,`onPointercancel`,`onLostpointercapture`,`onWheel`],nA={onClick:`click`,onContextmenu:`contextmenu`,onPointermove:`pointermove`,onPointerenter:`pointerenter`,onPointerleave:`pointerleave`,onPointerover:`pointerover`,onPointerout:`pointerout`,onDblclick:`dblclick`,onPointerdown:`pointerdown`,onPointerup:`pointerup`,onPointercancel:`pointercancel`,onLostpointercapture:`lostpointercapture`,onWheel:`wheel`},rA=e=>tA.includes(e),iA=Symbol(`tresTextNode`),aA=Symbol(`tresComment`),oA=({context:e,options:t={primitivePrefix:``}})=>{let n=e.scene.value,r=()=>{if(!n?.__tres?.isUnmounting)return{[iA]:!0,__tres:{parent:null}}},i=()=>({[aA]:!0,__tres:{parent:null}}),a=e=>!!e&&typeof e==`object`&&iA in e,o=e=>!!e&&typeof e==`object`&&aA in e;function s(n,r,i,a){if(a||={},a.args||=[],XO(n))return null;n.includes(`-`)&&(n=n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()).replace(/^[a-z]/,e=>e.toUpperCase()));let o=n.replace(`Tres`,``),s;if(n===`${t?.primitivePrefix??``}primitive`){(!gw(a.object)||Gt(a.object))&&bk(`Tres primitives need an 'object' prop, whose value is an object or shallowRef`),o=a.object.type;let t={};s=eA(a.object,{object:e=>e,isPrimitive:()=>!0,__tres:()=>t},{object:(t,n,r,i)=>{Ak(t,r,i,{patchProp:u,remove:l,insert:c},e)},__tres:e=>{Object.assign(t,e)}})}else{let e=Lk.value[o];e||bk(`${o} is not defined on the THREE namespace. Use extend to add it to the catalog.`),s=new e(...a.args)}return s?(mk(s)&&(a?.position||s.position.set(3,3,3),a?.lookAt||s.lookAt(0,0,0)),s=Ok(s,{..._k(s)?s.__tres:{},type:o,memoizedProps:a,primitive:n===`primitive`,attach:a.attach},e),s):null}function c(t,r,i){if(!t)return;if(r||=n,a(t)||o(t)){let n=r.__tres?r:Ok(r,{},e);if(t.__tres.parent=n,n.__tres.objects){let e=i?n.__tres.objects.findIndex(e=>e===i):-1;e>=0?n.__tres.objects.splice(e,0,t):n.__tres.objects.push(t)}return}let s=t.__tres?t:Ok(t,{},e),c=r.__tres?r:Ok(r,{},e);if(t=jk(s),r=jk(c),mk(t)&&e.camera?.registerCamera(t),s.__tres.attach?Ek(c,s,s.__tres.attach):QO(t)&&QO(c)&&(c.add(t),t.dispatchEvent({type:`added`})),s.__tres.parent=c,c.__tres.objects&&!c.__tres.objects.includes(s)){let e=i?c.__tres.objects.findIndex(e=>e===i):-1;~e?c.__tres.objects.splice(e,0,s):c.__tres.objects.push(s)}}function l(t,n){if(!t)return;if(a(t)||o(t)){let e=t.__tres.parent;e?.__tres?.objects&&vk(e.__tres.objects,e=>e!==t),t.__tres.parent=null;return}n=yw(n)?`default`:n;let r=t.__tres?.dispose;yw(r)||(n=r!==null&&r);let i=t.__tres?.primitive,s=n==="default"?!i:!!n;if(t.__tres&&`objects`in t.__tres&&[...t.__tres.objects].forEach(e=>l(e,n)),s&&t.children&&[...t.children].forEach(e=>l(e,n)),Mk(t,e),Nk(t,e),s&&!uk(t)){if(mw(n))n(t);else if(mw(t.dispose))try{t.dispose()}catch{}}`__tres`in t&&delete t.__tres}function u(t,n,r,i){if(!t)return;let a=t,o=n;if(t.__tres&&(t.__tres.memoizedProps[n]=i),n===`attach`){let n=t.__tres?.parent||t.parent;l(t),Ok(t,{attach:i},e),n&&c(t,n);return}if(n===`dispose`){t.__tres||(t=Ok(t,{},e)),t.__tres.dispose=i;return}rA(n)&&mw(i)&&t.addEventListener(nA[n],i);let s=dw(o),u=a?.[s];if(o===`args`){let e=t,n=r??[],o=i??[],s=t.__tres?.type||t.type;if(s&&n.length&&!pw(n,o)){let t=new Lk.value[s](...i),n=Object.getOwnPropertyDescriptors(t);Object.entries(n).forEach(([n,r])=>{if(!(!r.writable&&!r.set)&&n in e)try{e[n]=t[n]}catch(e){console.warn(`Could not set property ${n} on ${s}:`,e)}}),a=e}return}if(a.type===`BufferGeometry`){if(o===`args`)return;a.setAttribute(dw(o),new Ld(...i));return}if(o.includes(`-`)&&u===void 0){let e=wk(a,o);if(u=e.target,a=e.target,s=e.key,u&&s){u[s]=i,mk(t)&&t.updateProjectionMatrix(),kk(t);return}}let d=i;if(d===``&&(d=!0),mw(u)){rA(n)||(Array.isArray(d)?t[s](...d):t[s](d)),s.startsWith(`on`)&&mw(d)&&(a[s]=d);return}ak(u)&&ak(d)?u.mask=d.mask:rk(u)&&ik(d)?u.set(d):fk(u)&&pk(d)&&u.constructor===d.constructor?u.copy(d):dk(u)&&Array.isArray(d)?`fromArray`in u&&typeof u.fromArray==`function`?u.fromArray(d):u.set(...d):dk(u)&&typeof d==`number`?`setScalar`in u&&typeof u.setScalar==`function`?u.setScalar(d):u.set(d):a[s]=d,mk(t)&&t.updateProjectionMatrix(),kk(t)}function d(e){return e?.__tres?.parent||null}function f(e){if(!e||!(`__tres`in e))return null;let t=d(e)?.__tres?.objects||[],n=t.findIndex(t=>t===e);return n<0||n>=t.length-1?null:t[n+1]}let p=()=>{};return{insert:c,remove:l,createElement:s,patchProp:u,parentNode:d,createText:r,createComment:i,setText:p,setElementText:p,nextSibling:f,querySelector:p,setScopeId:p,cloneNode:p,insertStaticContent:p}},sA=new Map,cA=e=>sA.get(e),lA=(e,t)=>{sA.set(e,t)},uA=e=>sA.delete(e),dA=[`asset-load`],fA=class{subscribers=new Set;messageQueue=[];maxQueueSize=100;send(e,t){let n={type:e,data:t,timestamp:Date.now()};this.subscribers.size>0?this.subscribers.forEach(e=>e(n)):dA.includes(e)&&this.queueMessage(n)}queueMessage(e){this.messageQueue.push(e),this.messageQueue.length>this.maxQueueSize&&this.messageQueue.shift()}flushQueue(){this.messageQueue.length===0||this.subscribers.size===0||(this.messageQueue.forEach(e=>{this.subscribers.forEach(t=>t(e))}),this.messageQueue=[])}subscribe(e){return this.subscribers.add(e),this.flushQueue(),()=>{this.subscribers.delete(e)}}get hasSubscribers(){return this.subscribers.size>0}get queueSize(){return this.messageQueue.length}clearQueue(){this.messageQueue=[]}};function pA(e,t){let n=`▲ ■ ●${e}`;typeof mA==`function`?mA(n,t):t===`error`?console.error(n):t===`warn`?console.warn(n):console.log(n)}function mA(e,t){throw Error(e+t)}function hA(e){let t=0;return e.traverse(e=>{if($O(e)&&e.type!==`HightlightMesh`){let n=e.geometry,r=n.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,i=n.index?n.index.count*Uint32Array.BYTES_PER_ELEMENT:0,a=n.attributes.normal?n.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,o=n.attributes.uv?n.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,s=r+i+a+o;t+=s}}),t}function gA(e,t,n){e.push(t),e.length>n&&e.shift()}function _A(e){return(e/1024).toFixed(2)}function vA(e){if(!e)return;typeof window<`u`&&!window.__TRES__DEVTOOLS__&&(window.__TRES__DEVTOOLS__=new fA);let t={maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},n=sw({every:100}),{isSupported:r,memory:i}=lw({interval:100}),a=performance.now(),o=0,s=({timestamp:o})=>{e.scene.value&&(t.memory.allocatedMem=hA(e.scene.value)),o-a>=100&&(a=o,gA(t.fps.accumulator,n.value,160),t.fps.value=n.value,r.value&&i.value?.usedJSHeapSize&&(gA(t.memory.accumulator,i.value.usedJSHeapSize/1024/1024,160),t.memory.accumulator.length>0&&(t.memory.currentMem=t.memory.accumulator.reduce((e,t)=>e+t,0)/t.memory.accumulator.length)))},{pause:c}=$C(({delta:n})=>{window.__TRES__DEVTOOLS__&&(s({timestamp:performance.now()}),o+=n,o>=1&&(window.__TRES__DEVTOOLS__.send(`context`,e),window.__TRES__DEVTOOLS__.send(`performance`,t),o=0))},{immediate:!0});pr(()=>{c()})}var yA=(e,t)=>{if(e.uuid===t)return e;for(let n of e.children){let e=yA(n,t);if(e)return e}},bA=class extends Jf{type=`HightlightMesh`;createTime;constructor(...e){super(...e),this.createTime=Date.now()}onBeforeRender(){let e=(Date.now()-this.createTime)/1e3,t=1+.07*Math.sin(2.5*e);this.scale.set(t,t,t)}},xA=e=>{let t={id:`scene-${e.uuid}`,label:e.type,children:[],tags:[]};e.name!==``&&t.tags.push({label:e.name,textColor:5750629,backgroundColor:15793395});let n=hA(e);return n>0&&t.tags.push({label:`${_A(n)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:`Memory usage`}),e.type.includes(`Light`)&&(ck(e)&&t.tags.push({label:`${e.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:`Intensity`}),t.tags.push({label:`#${new K(e.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:`Color`})),e.type.includes(`Camera`)&&(t.tags.push({label:`${e.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:`Field of view`}),t.tags.push({label:`x: ${Math.round(e.position.x)} y: ${Math.round(e.position.y)} z: ${Math.round(e.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:`Position`})),t};function SA(e,t,n=``){return{id:`context-${t}-${n?`${n}.${e}`:e}`,label:e,children:[],tags:[]}}function CA(e,t,n=``){e.children.forEach(e=>{if(e.type===`HightlightMesh`||n&&!e.type.includes(n)&&!e.name.includes(n))return;let r=xA(e);t.children.push(r),CA(e,r,n)})}function wA(e,t,n=new WeakSet,r=0,i=4,a,o=``){if(r>=i||!e||n.has(e))return;let s=r===0?e?.scene?.value?.uuid||Math.random().toString(36).slice(2,11):a;n.add(e),Object.entries(e).forEach(([e,a])=>{if(e.startsWith(`_`)||typeof a==`function`)return;let c=o?`${o}.${e}`:e,l=SA(e,s,o);e!==`scene`&&(Gt(a)?(l.tags.push({label:`Ref<${typeof a.value}>`,textColor:4372611,backgroundColor:15793395}),a.value&&typeof a.value==`object`?wA(a.value,l,n,r+1,i,s,c):l.label=`${e}: ${JSON.stringify(a.value)}`):a&&typeof a==`object`&&!Array.isArray(a)?Object.keys(a).length>0?n.has(a)?l.tags.push({label:`Circular`,textColor:16711680,backgroundColor:16773360}):wA(a,l,n,r+1,i,s,c):l.label=`${e}: {}`:Array.isArray(a)?(l.label=`${e}: Array(${a.length})`,l.tags.push({label:`length: ${a.length}`,textColor:9738662,backgroundColor:16316922})):l.label=`${e}: ${JSON.stringify(a)}`,t.children.push(l))})}var TA=e=>t=>{if(t.inspectorId===kA){let n=xA(e.scene.value);CA(e.scene.value,n,t.filter);let r={id:`context-root`,label:`Context`,children:[],tags:[]};wA(e,r),t.rootNodes=[n,r]}},EA=(e,{highlightMesh:t,prevInstance:n})=>r=>{if(r.inspectorId!==kA)return;let i=new If({color:11003607,transparent:!0,opacity:.2,depthTest:!1,side:2});if(r.nodeId.includes(`scene`)){let a=r.nodeId.match(/^scene-(.+)$/),o=a?a[1]:null;if(!o)return;let[s]=e.scene.value.getObjectsByProperty(`uuid`,o);if(!s)return;if(n&&t&&t.parent&&n.remove(t),$O(s)){let e=new bA(s.geometry.clone(),i);s.add(e),t=e,n=s}if(r.state={object:Object.entries(s).map(([e,t])=>e===`children`?{key:e,value:t.filter(e=>e.type!==`HightlightMesh`)}:{key:e,value:t,editable:!0}).filter(({key:e})=>e!==`parent`)},uk(s)){let t={...r.state,state:[{key:`Scene Info`,value:{objects:s.children.length,memory:hA(s),calls:e.renderer.instance.info.render.calls,triangles:e.renderer.instance.info.render.triangles,points:e.renderer.instance.info.render.points,lines:e.renderer.instance.info.render.lines}}]};`programs`in e.renderer.instance.info&&t.state.push({key:`Programs`,value:e.renderer.instance.info.programs?.map(e=>({...e,programName:e.name}))}),r.state=t}}else if(r.nodeId.includes(`context`)){let t=r.nodeId.match(/^context-([^-]+(?:-[^-]+)*)-(.+)$/),n=t?t[2]:`context`;if(!n||n===`context`){r.state={object:Object.entries(e).filter(([e])=>!e.startsWith(`_`)&&e!==`parent`).map(([e,t])=>({key:e,value:Gt(t)?t.value:t,editable:!1}))};return}let i=n.split(`.`),a=e;for(let e of i){if(!a||typeof a!=`object`)break;a=Gt(a[e])?a[e].value:a[e]}a!==void 0&&(r.state={object:Object.entries(a).filter(([e])=>!e.startsWith(`_`)&&e!==`parent`).map(([e,t])=>Gt(t)?{key:e,value:t.value,editable:!1}:typeof t==`function`?{key:e,value:`ƒ()`,editable:!1}:t&&typeof t==`object`?{key:e,value:Array.isArray(t)?`Array(${t.length})`:`Object`,editable:!1}:{key:e,value:t,editable:!1})})}},DA=(e,t,n,r)=>{let i=yA(e,t);if(!i){console.warn(`Object with UUID not found in the scene.`);return}let a=i;for(let e=0;et=>{if(t.inspectorId===kA&&t.nodeId.includes(`scene`)){let n=t.nodeId.match(/^scene-(.+)$/),r=n?n[1]:null;if(!r)return;DA(e.scene.value,r,t.path,t.state.value)}},kA=`tres:inspector`;function AA(e,t){let n={id:`dev.esm.tres`,label:`TresJS 🪐`,logo:`https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg`,packageName:`tresjs`,homepage:`https://docs.tresjs.org`,app:e};vA(t),wD(n,e=>{typeof e.now!=`function`&&pA(`You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.`),e.addInspector({id:kA,label:`TresJS 🪐`,icon:`account_tree`,treeFilterPlaceholder:`Search instances`}),setInterval(()=>{e.sendInspectorTree(kA)},1e3),setInterval(()=>{e.notifyComponentUpdate()},5e3),e.on.getInspectorTree(TA(t)),e.on.getInspectorState(EA(t,{highlightMesh:null,prevInstance:null})),e.on.editInspectorState(OA(t))})}var jA=Jn({__name:`Context`,props:{camera:{type:null,required:!1},windowSize:{type:Boolean,required:!1},fpsLimit:{type:Number,required:!1},enableProvideBridge:{type:Boolean,required:!1},customRendererOptions:{type:Object,required:!1},antialias:{type:Boolean,required:!1},stencil:{type:Boolean,required:!1},depth:{type:Boolean,required:!1},precision:{type:String,required:!1},logarithmicDepthBuffer:{type:Boolean,required:!1},preserveDrawingBuffer:{type:Boolean,required:!1},powerPreference:{type:null,required:!1},alpha:{type:Boolean,required:!1},premultipliedAlpha:{type:Boolean,required:!1},failIfMajorPerformanceCaveat:{type:Boolean,required:!1},clearColor:{type:[Object,String,Number],required:!1},clearAlpha:{type:Number,required:!1},shadows:{type:Boolean,required:!1},toneMapping:{type:null,required:!1},shadowMapType:{type:null,required:!1},useLegacyLights:{type:Boolean,required:!1},outputColorSpace:{type:null,required:!1},toneMappingExposure:{type:Number,required:!1},renderMode:{type:String,required:!1},dpr:{type:[Number,Array],required:!1},renderer:{type:Function,required:!1},canvas:{type:null,required:!0}},emits:[`ready`,`error`,`pointermissed`,`render`,`beforeLoop`,`loop`,`click`,`contextmenu`,`pointermove`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`,`dblclick`,`pointerdown`,`pointerup`,`pointercancel`,`lostpointercapture`,`wheel`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=kr(),o=qt(new $u),s=Na();Rk(ab);let c=(e,t)=>Jn({setup(){let n=Na()?.appContext;n&&(n.app=s?.appContext.app);let i={};function o(e){e&&(e.parent&&o(e.parent),e.provides&&Object.assign(i,e.provides))}return s?.parent&&r.enableProvideBridge&&(o(s.parent),Reflect.ownKeys(i).forEach(e=>{Pn(e,i[e])})),Pn(Jk,e),Pn(`extend`,Rk),typeof window<`u`&&n?.app&&AA(n?.app,e),()=>(t.value,Qa(ea,null,a.default?.()??[]))}}),l=e=>{let t=r.canvas;if(cA(t))return;let n=Kt(0),i=c(e,n),a=ji(oA({context:e,options:r.customRendererOptions}));a.render(Qa(i),o.value),lA(t,{renderer:a,internalComponent:i,hmrTick:n,context:e})},u=(e,t=!1)=>{Ck(e.scene.value),t&&(e.renderer.instance.dispose(),e.renderer.instance instanceof xC&&(e.renderer.instance.renderLists.dispose(),e.renderer.instance.forceContextLoss())),o.value.__tres={root:e,objects:[],isUnmounting:!0}},d=qt(Yk({scene:o.value,canvas:r.canvas,fpsLimit:()=>r.fpsLimit??1/0,windowSize:r.windowSize??!1,rendererOptions:r}));t({context:d,dispose:()=>u(d.value,!0)});let f=()=>{let e=cA(r.canvas);e&&((e=>uk(e)&&`__tres`in e)(o.value)&&(o.value.__tres.isUnmounting=!0),e.renderer.render(null,o.value),u(d.value),uA(r.canvas))},{camera:p,renderer:m}=d.value,{registerCamera:h,cameras:g,activeCamera:_,deregisterCamera:v}=p,y=()=>{let e=new L_(45,window.innerWidth/window.innerHeight,.1,1e3);e.position.set(3,3,3),e.lookAt(0,0,0),h(e);let t=zn(()=>{g.value.length>=2&&(e.removeFromParent(),v(e),t?.())})};return d.value.events.onPointerMissed(e=>{i(`pointermissed`,e)}),Bn(()=>r.camera,(e,t)=>{e&&h(Zt(e),!0),t&&(Zt(t).removeFromParent(),v(Zt(t)))},{immediate:!0}),m.onRender(()=>{d.value&&i(`render`,d.value)}),m.loop.onLoop(e=>{d.value&&i(`loop`,{...d.value,...e})}),m.loop.onBeforeLoop(e=>{d.value&&i(`beforeLoop`,{...d.value,...e})}),m.onReady(()=>{l(d.value),i(`ready`,d.value),_.value||y()}),m.onError(e=>{i(`error`,e)}),lr(async()=>{await PC(3e3),(!d.value.sizes.width||!d.value.sizes.height.value)&&console.warn(`TresCanvas: The canvas has no area, so nothing can be rendered. Set it manually on the parent element or use the prop windowSize.`)}),pr(f),()=>{}}}),MA=[`data-scene`,`data-tres`],NA=Jn({__name:`TresCanvas`,props:{camera:{type:null,required:!1},windowSize:{type:Boolean,required:!1,default:void 0},fpsLimit:{type:Number,required:!1},enableProvideBridge:{type:Boolean,required:!1,default:!0},customRendererOptions:{type:Object,required:!1},antialias:{type:Boolean,required:!1,default:!0},stencil:{type:Boolean,required:!1,default:void 0},depth:{type:Boolean,required:!1,default:void 0},precision:{type:String,required:!1},logarithmicDepthBuffer:{type:Boolean,required:!1,default:void 0},preserveDrawingBuffer:{type:Boolean,required:!1,default:void 0},powerPreference:{type:null,required:!1},alpha:{type:Boolean,required:!1,default:void 0},premultipliedAlpha:{type:Boolean,required:!1},failIfMajorPerformanceCaveat:{type:Boolean,required:!1,default:void 0},clearColor:{type:[Object,String,Number],required:!1,default:`#000000`},clearAlpha:{type:Number,required:!1,default:1},shadows:{type:Boolean,required:!1,default:void 0},toneMapping:{type:null,required:!1,default:4},shadowMapType:{type:null,required:!1,default:2},useLegacyLights:{type:Boolean,required:!1,default:void 0},outputColorSpace:{type:null,required:!1},toneMappingExposure:{type:Number,required:!1},renderMode:{type:String,required:!1,default:`always`},dpr:{type:[Number,Array],required:!1},renderer:{type:Function,required:!1}},emits:[`ready`,`error`,`pointermissed`,`render`,`beforeLoop`,`loop`,`click`,`contextmenu`,`pointermove`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`,`dblclick`,`pointerdown`,`pointerup`,`pointercancel`,`lostpointercapture`,`wheel`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=Kt(),o=qt();return t({get context(){return o.value?.context},dispose:()=>o.value?.dispose()}),(t,n)=>(oa(),da(`canvas`,{ref_key:`canvasRef`,ref:a,"data-scene":o.value?.context?.scene.value.uuid,class:pe(t.$attrs.class),"data-tres":`tresjs ${Xt(JO)}`,style:ce({display:`block`,width:`100%`,height:`100%`,position:e.windowSize?`fixed`:`relative`,top:0,left:0,pointerEvents:`auto`,touchAction:`none`,...t.$attrs.style})},[a.value?(oa(),fa(jA,Da({key:0,ref_key:`contextRef`,ref:o,canvas:a.value},r,{onReady:n[0]||=e=>i(`ready`,e),onError:n[1]||=e=>i(`error`,e),onPointermissed:n[2]||=e=>i(`pointermissed`,e),onRender:n[3]||=e=>i(`render`,e),onBeforeLoop:n[4]||=e=>i(`beforeLoop`,e),onLoop:n[5]||=e=>i(`loop`,e),onClick:n[6]||=e=>i(`click`,e),onContextmenu:n[7]||=e=>i(`contextmenu`,e),onPointermove:n[8]||=e=>i(`pointermove`,e),onPointerenter:n[9]||=e=>i(`pointerenter`,e),onPointerleave:n[10]||=e=>i(`pointerleave`,e),onPointerover:n[11]||=e=>i(`pointerover`,e),onPointerout:n[12]||=e=>i(`pointerout`,e),onDblclick:n[13]||=e=>i(`dblclick`,e),onPointerdown:n[14]||=e=>i(`pointerdown`,e),onPointerup:n[15]||=e=>i(`pointerup`,e),onPointercancel:n[16]||=e=>i(`pointercancel`,e),onLostpointercapture:n[17]||=e=>i(`lostpointercapture`,e),onWheel:n[18]||=e=>i(`wheel`,e)}),{default:Mn(()=>[Cr(t.$slots,`default`)]),_:3},16,[`canvas`])):Ca(`v-if`,!0)],14,MA))}}),PA=parseInt(`185`.replace(/\D+/g,``)),FA=Object.defineProperty,IA=(e,t,n)=>t in e?FA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LA=(e,t,n)=>(IA(e,typeof t==`symbol`?t:t+``,n),n),RA=(()=>{let e=class extends Jf{constructor(t,n={}){super(t),this.isReflector=!0,this.type=`Reflector`,this.camera=new L_;let r=this,i=n.color===void 0?new K(8355711):new K(n.color),a=n.textureWidth||512,o=n.textureHeight||512,s=n.clipBias||0,c=n.shader||e.ReflectorShader,l=n.multisample===void 0?4:n.multisample,u=new wp,d=new U,f=new U,p=new U,m=new G,h=new U(0,0,-1),g=new lu,_=new U,v=new U,y=new lu,b=new G,x=this.camera,S=new du(a,o,{samples:l,type:gs}),C=new Og({uniforms:Tg.clone(c.uniforms),fragmentShader:c.fragmentShader,vertexShader:c.vertexShader});C.uniforms.tDiffuse.value=S.texture,C.uniforms.color.value=i,C.uniforms.textureMatrix.value=b,this.material=C,this.onBeforeRender=function(e,t,n){if(f.setFromMatrixPosition(r.matrixWorld),p.setFromMatrixPosition(n.matrixWorld),m.extractRotation(r.matrixWorld),d.set(0,0,1),d.applyMatrix4(m),_.subVectors(f,p),_.dot(d)>0)return;_.reflect(d).negate(),_.add(f),m.extractRotation(n.matrixWorld),h.set(0,0,-1),h.applyMatrix4(m),h.add(p),v.subVectors(f,h),v.reflect(d).negate(),v.add(f),x.position.copy(_),x.up.set(0,1,0),x.up.applyMatrix4(m),x.up.reflect(d),x.lookAt(v),x.far=n.far,x.updateMatrixWorld(),x.projectionMatrix.copy(n.projectionMatrix),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(x.projectionMatrix),b.multiply(x.matrixWorldInverse),b.multiply(r.matrixWorld),u.setFromNormalAndCoplanarPoint(d,f),u.applyMatrix4(x.matrixWorldInverse),g.set(u.normal.x,u.normal.y,u.normal.z,u.constant);let i=x.projectionMatrix;y.x=(Math.sign(g.x)+i.elements[8])/i.elements[0],y.y=(Math.sign(g.y)+i.elements[9])/i.elements[5],y.z=-1,y.w=(1+i.elements[10])/i.elements[14],g.multiplyScalar(2/g.dot(y)),i.elements[2]=g.x,i.elements[6]=g.y,i.elements[10]=g.z+1-s,i.elements[14]=g.w,r.visible=!1;let a=e.getRenderTarget(),o=e.xr.enabled,c=e.shadowMap.autoUpdate,l=e.toneMapping,C=!1;C=`outputColorSpace`in e?e.outputColorSpace===`srgb`:e.outputEncoding===3001,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,`outputColorSpace`in e?e.outputColorSpace=`srgb-linear`:e.outputEncoding=3e3,e.toneMapping=0,e.setRenderTarget(S),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,x),e.xr.enabled=o,e.shadowMap.autoUpdate=c,e.toneMapping=l,`outputColorSpace`in e?e.outputColorSpace=C?`srgb`:`srgb-linear`:e.outputEncoding=C?3001:3e3,e.setRenderTarget(a);let w=n.viewport;w!==void 0&&e.state.viewport(w),r.visible=!0},this.getRenderTarget=function(){return S},this.dispose=function(){S.dispose(),r.material.dispose()}}},t=e;return LA(t,`ReflectorShader`,{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + uniform mat4 textureMatrix; + varying vec4 vUv; + + #include + #include + + void main() { + + vUv = textureMatrix * vec4( position, 1.0 ); + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + #include + + }`,fragmentShader:` + uniform vec3 color; + uniform sampler2D tDiffuse; + varying vec4 vUv; + + #include + + float blendOverlay( float base, float blend ) { + + return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) ); + + } + + vec3 blendOverlay( vec3 base, vec3 blend ) { + + return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) ); + + } + + void main() { + + #include + + vec4 base = texture2DProj( tDiffuse, vUv ); + gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 ); + + #include + #include <${PA>=154?`colorspace_fragment`:`encodings_fragment`}> + + }`}),t})(),zA=Object.defineProperty,BA=(e,t,n)=>t in e?zA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VA=(e,t,n)=>(BA(e,typeof t==`symbol`?t:t+``,n),n),HA=class{constructor(){VA(this,`_listeners`)}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let n=this._listeners[e];if(n!==void 0){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let t=this._listeners[e.type];if(t!==void 0){e.target=this;let n=t.slice(0);for(let t=0,r=n.length;tt in e?UA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(WA(e,typeof t==`symbol`?t:t+``,n),n),GA=new Ff,KA=new wp,qA=Math.cos(Math.PI/180*70),JA=(e,t)=>(e%t+t)%t,YA=class extends HA{constructor(e,t){super(),Q(this,`object`),Q(this,`domElement`),Q(this,`enabled`,!0),Q(this,`target`,new U),Q(this,`minDistance`,0),Q(this,`maxDistance`,1/0),Q(this,`minZoom`,0),Q(this,`maxZoom`,1/0),Q(this,`minPolarAngle`,0),Q(this,`maxPolarAngle`,Math.PI),Q(this,`minAzimuthAngle`,-1/0),Q(this,`maxAzimuthAngle`,1/0),Q(this,`enableDamping`,!1),Q(this,`dampingFactor`,.05),Q(this,`enableZoom`,!0),Q(this,`zoomSpeed`,1),Q(this,`enableRotate`,!0),Q(this,`rotateSpeed`,1),Q(this,`enablePan`,!0),Q(this,`panSpeed`,1),Q(this,`screenSpacePanning`,!0),Q(this,`keyPanSpeed`,7),Q(this,`zoomToCursor`,!1),Q(this,`autoRotate`,!1),Q(this,`autoRotateSpeed`,2),Q(this,`reverseOrbit`,!1),Q(this,`reverseHorizontalOrbit`,!1),Q(this,`reverseVerticalOrbit`,!1),Q(this,`keys`,{LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`}),Q(this,`mouseButtons`,{LEFT:Ko.ROTATE,MIDDLE:Ko.DOLLY,RIGHT:Ko.PAN}),Q(this,`touches`,{ONE:qo.ROTATE,TWO:qo.DOLLY_PAN}),Q(this,`target0`),Q(this,`position0`),Q(this,`zoom0`),Q(this,`_domElementKeyEvents`,null),Q(this,`getPolarAngle`),Q(this,`getAzimuthalAngle`),Q(this,`setPolarAngle`),Q(this,`setAzimuthalAngle`),Q(this,`getDistance`),Q(this,`getZoomScale`),Q(this,`listenToKeyEvents`),Q(this,`stopListenToKeyEvents`),Q(this,`saveState`),Q(this,`reset`),Q(this,`update`),Q(this,`connect`),Q(this,`dispose`),Q(this,`dollyIn`),Q(this,`dollyOut`),Q(this,`getScale`),Q(this,`setScale`),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>l.phi,this.getAzimuthalAngle=()=>l.theta,this.setPolarAngle=e=>{let t=JA(e,2*Math.PI),r=l.phi;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i{let t=JA(e,2*Math.PI),r=l.theta;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-in.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener(`keydown`,Ee),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener(`keydown`,Ee),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=o.NONE},this.update=(()=>{let t=new U,i=new U(0,1,0),a=new Gl().setFromUnitVectors(e.up,i),p=a.clone().invert(),m=new U,h=new Gl,g=2*Math.PI;return function(){let _=n.object.position;a.setFromUnitVectors(e.up,i),p.copy(a).invert(),t.copy(_).sub(n.target),t.applyQuaternion(a),l.setFromVector3(t),n.autoRotate&&s===o.NONE&&k(D()),n.enableDamping?(l.theta+=u.theta*n.dampingFactor,l.phi+=u.phi*n.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi);let v=n.minAzimuthAngle,y=n.maxAzimuthAngle;isFinite(v)&&isFinite(y)&&(v<-Math.PI?v+=g:v>Math.PI&&(v-=g),y<-Math.PI?y+=g:y>Math.PI&&(y-=g),v<=y?l.theta=Math.max(v,Math.min(y,l.theta)):l.theta=l.theta>(v+y)/2?Math.max(v,l.theta):Math.min(y,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(f,n.dampingFactor):n.target.add(f),n.zoomToCursor&&w||n.object.isOrthographicCamera?l.radius=re(l.radius):l.radius=re(l.radius*d),t.setFromSpherical(l),t.applyQuaternion(p),_.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,f.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),f.set(0,0,0));let b=!1;if(n.zoomToCursor&&w){let r=null;if(n.object instanceof L_&&n.object.isPerspectiveCamera){let e=t.length();r=re(e*d);let i=e-r;n.object.position.addScaledVector(S,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new U(C.x,C.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),b=!0;let i=new U(C.x,C.y,0);i.unproject(n.object),n.object.position.sub(i).add(e),n.object.updateMatrixWorld(),r=t.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),n.zoomToCursor=!1;r!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(GA.origin.copy(n.object.position),GA.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(GA.direction))c||8*(1-h.dot(n.object.quaternion))>c?(n.dispatchEvent(r),m.copy(n.object.position),h.copy(n.object.quaternion),b=!1,!0):!1}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction=`none`,n.domElement.addEventListener(`contextmenu`,Oe),n.domElement.addEventListener(`pointerdown`,Se),n.domElement.addEventListener(`pointercancel`,Ce),n.domElement.addEventListener(`wheel`,I)},this.dispose=()=>{var e,t,r,i,a,o;n.domElement&&(n.domElement.style.touchAction=`auto`),(e=n.domElement)==null||e.removeEventListener(`contextmenu`,Oe),(t=n.domElement)==null||t.removeEventListener(`pointerdown`,Se),(r=n.domElement)==null||r.removeEventListener(`pointercancel`,Ce),(i=n.domElement)==null||i.removeEventListener(`wheel`,I),(a=n.domElement)==null||a.ownerDocument.removeEventListener(`pointermove`,F),(o=n.domElement)==null||o.ownerDocument.removeEventListener(`pointerup`,Ce),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener(`keydown`,Ee)};let n=this,r={type:`change`},i={type:`start`},a={type:`end`},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},s=o.NONE,c=1e-6,l=new sy,u=new sy,d=1,f=new U,p=new H,m=new H,h=new H,g=new H,_=new H,v=new H,y=new H,b=new H,x=new H,S=new U,C=new H,w=!1,T=[],E={};function D(){return 2*Math.PI/60/60*n.autoRotateSpeed}function O(){return .95**n.zoomSpeed}function k(e){n.reverseOrbit||n.reverseHorizontalOrbit?u.theta+=e:u.theta-=e}function A(e){n.reverseOrbit||n.reverseVerticalOrbit?u.phi+=e:u.phi-=e}let j=(()=>{let e=new U;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),f.add(e)}})(),ee=(()=>{let e=new U;return function(t,r){n.screenSpacePanning===!0?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),f.add(e)}})(),M=(()=>{let e=new U;return function(t,r){let i=n.domElement;if(i&&n.object instanceof L_&&n.object.isPerspectiveCamera){let a=n.object.position;e.copy(a).sub(n.target);let o=e.length();o*=Math.tan(n.object.fov/2*Math.PI/180),j(2*t*o/i.clientHeight,n.object.matrix),ee(2*r*o/i.clientHeight,n.object.matrix)}else i&&n.object instanceof H_&&n.object.isOrthographicCamera?(j(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),ee(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),n.enablePan=!1)}})();function te(e){n.object instanceof L_&&n.object.isPerspectiveCamera||n.object instanceof H_&&n.object.isOrthographicCamera?d=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),n.enableZoom=!1)}function N(e){te(d/e)}function P(e){te(d*e)}function ne(e){if(!n.zoomToCursor||!n.domElement)return;w=!0;let t=n.domElement.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,a=t.width,o=t.height;C.x=r/a*2-1,C.y=-(i/o)*2+1,S.set(C.x,C.y,1).unproject(n.object).sub(n.object.position).normalize()}function re(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function ie(e){p.set(e.clientX,e.clientY)}function ae(e){ne(e),y.set(e.clientX,e.clientY)}function oe(e){g.set(e.clientX,e.clientY)}function se(e){m.set(e.clientX,e.clientY),h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m),n.update()}function ce(e){b.set(e.clientX,e.clientY),x.subVectors(b,y),x.y>0?N(O()):x.y<0&&P(O()),y.copy(b),n.update()}function le(e){_.set(e.clientX,e.clientY),v.subVectors(_,g).multiplyScalar(n.panSpeed),M(v.x,v.y),g.copy(_),n.update()}function ue(e){ne(e),e.deltaY<0?P(O()):e.deltaY>0&&N(O()),n.update()}function de(e){let t=!1;switch(e.code){case n.keys.UP:M(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:M(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:M(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:M(-n.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),n.update())}function fe(){if(T.length==1)p.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);p.set(e,t)}}function pe(){if(T.length==1)g.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);g.set(e,t)}}function me(){let e=T[0].pageX-T[1].pageX,t=T[0].pageY-T[1].pageY,n=Math.sqrt(e*e+t*t);y.set(0,n)}function he(){n.enableZoom&&me(),n.enablePan&&pe()}function ge(){n.enableZoom&&me(),n.enableRotate&&fe()}function _e(e){if(T.length==1)m.set(e.pageX,e.pageY);else{let t=Me(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);m.set(n,r)}h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m)}function ve(e){if(T.length==1)_.set(e.pageX,e.pageY);else{let t=Me(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);_.set(n,r)}v.subVectors(_,g).multiplyScalar(n.panSpeed),M(v.x,v.y),g.copy(_)}function ye(e){let t=Me(e),r=e.pageX-t.x,i=e.pageY-t.y,a=Math.sqrt(r*r+i*i);b.set(0,a),x.set(0,(b.y/y.y)**+n.zoomSpeed),N(x.y),y.copy(b)}function be(e){n.enableZoom&&ye(e),n.enablePan&&ve(e)}function xe(e){n.enableZoom&&ye(e),n.enableRotate&&_e(e)}function Se(e){var t,r;n.enabled!==!1&&(T.length===0&&((t=n.domElement)==null||t.ownerDocument.addEventListener(`pointermove`,F),(r=n.domElement)==null||r.ownerDocument.addEventListener(`pointerup`,Ce)),ke(e),e.pointerType===`touch`?L(e):we(e))}function F(e){n.enabled!==!1&&(e.pointerType===`touch`?De(e):Te(e))}function Ce(e){var t,r,i;Ae(e),T.length===0&&((t=n.domElement)==null||t.releasePointerCapture(e.pointerId),(r=n.domElement)==null||r.ownerDocument.removeEventListener(`pointermove`,F),(i=n.domElement)==null||i.ownerDocument.removeEventListener(`pointerup`,Ce)),n.dispatchEvent(a),s=o.NONE}function we(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Ko.DOLLY:if(n.enableZoom===!1)return;ae(e),s=o.DOLLY;break;case Ko.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enablePan===!1)return;oe(e),s=o.PAN}else{if(n.enableRotate===!1)return;ie(e),s=o.ROTATE}break;case Ko.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enableRotate===!1)return;ie(e),s=o.ROTATE}else{if(n.enablePan===!1)return;oe(e),s=o.PAN}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function Te(e){if(n.enabled!==!1)switch(s){case o.ROTATE:if(n.enableRotate===!1)return;se(e);break;case o.DOLLY:if(n.enableZoom===!1)return;ce(e);break;case o.PAN:if(n.enablePan===!1)return;le(e);break}}function I(e){n.enabled===!1||n.enableZoom===!1||s!==o.NONE&&s!==o.ROTATE||(e.preventDefault(),n.dispatchEvent(i),ue(e),n.dispatchEvent(a))}function Ee(e){n.enabled===!1||n.enablePan===!1||de(e)}function L(e){switch(je(e),T.length){case 1:switch(n.touches.ONE){case qo.ROTATE:if(n.enableRotate===!1)return;fe(),s=o.TOUCH_ROTATE;break;case qo.PAN:if(n.enablePan===!1)return;pe(),s=o.TOUCH_PAN;break;default:s=o.NONE}break;case 2:switch(n.touches.TWO){case qo.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;he(),s=o.TOUCH_DOLLY_PAN;break;case qo.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ge(),s=o.TOUCH_DOLLY_ROTATE;break;default:s=o.NONE}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function De(e){switch(je(e),s){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;_e(e),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;ve(e),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;be(e),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;xe(e),n.update();break;default:s=o.NONE}}function Oe(e){n.enabled!==!1&&e.preventDefault()}function ke(e){T.push(e)}function Ae(e){delete E[e.pointerId];for(let t=0;t{P(e),n.update()},this.dollyOut=(e=O())=>{N(e),n.update()},this.getScale=()=>d,this.setScale=e=>{te(e),n.update()},this.getZoomScale=()=>O(),t!==void 0&&this.connect(t),this.update()}};Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),Math.PI*2,Math.PI/2,Math.PI/180,/Mac/.test(globalThis?.navigator?.platform),t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Stats=r()})(e,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;to+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})}))();var XA=class{constructor({trackGPU:e=!1,trackCPT:t=!1,trackHz:n=!1,trackFPS:r=!0,logsPerSecond:i=4,graphsPerSecond:a=30,samplesLog:o=40,samplesGraph:s=10,precision:c=2,maxTimestampPairs:l=2048}={}){this.gl=null,this.ext=null,this.gpuDevice=null,this.gpuBackend=null,this.renderer=null,this.activeQuery=null,this.gpuQueries=[],this.threeRendererPatched=!1,this.maxTimestampPairs=2048,this.webgpuNative=!1,this.gpuQuerySet=null,this.gpuResolveBuffer=null,this.gpuTimestampBufferSize=0,this.frameCursor=0,this.slotTypes=[],this.readBufferPool=[],this.inFlightFrames=[],this.poolWarnThreshold=8,this.warnedMapError=!1,this.warnedSlotOverflow=!1,this.warnedPoolGrowth=!1,this.frameTimes=[],this.frameTimesHead=0,this.renderCount=0,this.cpuStartTime=0,this.isRunningCPUProfiling=!1,this.totalCpuDuration=0,this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.averageFps={logs:[],graph:[]},this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.averageGpuCompute={logs:[],graph:[]},this.trackGPU=e,this.trackCPT=t,this.trackHz=n,this.trackFPS=r,this.samplesLog=o,this.samplesGraph=s,this.precision=c,this.logsPerSecond=i,this.graphsPerSecond=a,this.maxTimestampPairs=Math.max(1,l);let u=performance.now();this.prevGraphTime=u,this.beginTime=u,this.prevTextTime=u,this.prevCpuTime=u}async init(e){if(!e){console.error(`Stats: The "canvas" parameter is undefined.`);return}if(!this.handleThreeRenderer(e)&&!await this.handleWebGPURenderer(e)&&!this.handleNativeWebGPU(e))if(this.initializeWebGL(e)){this.trackGPU&&this.initializeGPUTracking();return}else console.error(`Stats-gl: Failed to initialize WebGL context`)}handleNativeWebGPU(e){return e&&typeof e.createCommandEncoder==`function`&&typeof e.createQuerySet==`function`&&e.queue?(this.gpuDevice=e,this.webgpuNative=!0,this.trackGPU&&e.features?.has(`timestamp-query`)&&(this.initializeWebGPUTiming(),this.onWebGPUTimestampSupported()),!0):!1}initializeWebGPUTiming(){if(!this.gpuDevice)return;let e=this.maxTimestampPairs*2;this.gpuTimestampBufferSize=e*8,this.gpuQuerySet=this.gpuDevice.createQuerySet({type:`timestamp`,count:e}),this.gpuResolveBuffer=this.gpuDevice.createBuffer({size:this.gpuTimestampBufferSize,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC})}acquireReadBuffer(){if(!this.gpuDevice)return null;let e=this.readBufferPool.pop();if(e)return e;let t=this.inFlightFrames.length+this.readBufferPool.length+1;return t>this.poolWarnThreshold&&!this.warnedPoolGrowth&&(console.warn(`stats-gl: WebGPU timestamp readback pool grew to ${t} buffers — is update() being called every frame after queue.submit?`),this.warnedPoolGrowth=!0),this.gpuDevice.createBuffer({size:this.gpuTimestampBufferSize,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})}handleThreeRenderer(e){return e.isWebGLRenderer&&!this.threeRendererPatched?(this.patchThreeRenderer(e),this.gl=e.getContext(),this.trackGPU&&this.initializeGPUTracking(),!0):!1}async handleWebGPURenderer(e){return e.isWebGPURenderer?(this.renderer=e,(this.trackGPU||this.trackCPT)&&(e.backend.trackTimestamp=!0,e._initialized||await e.init(),e.hasFeature(`timestamp-query`)&&this.onWebGPUTimestampSupported()),this.info=e.info,this.gpuBackend=e.backend,this.gpuDevice=e.backend?.device||null,this.patchThreeWebGPU(e),!0):!1}onWebGPUTimestampSupported(){}initializeWebGL(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext(`webgl2`),!this.gl)return console.error(`Stats: Unable to obtain WebGL2 context.`),!1}else return console.error(`Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas.`),!1;return!0}initializeGPUTracking(){this.gl&&(this.ext=this.gl.getExtension(`EXT_disjoint_timer_query_webgl2`),this.ext&&this.onGPUTrackingInitialized())}onGPUTrackingInitialized(){}getTimestampWrites(e=`render`){if(!this.webgpuNative||!this.gpuQuerySet)return;if(this.frameCursor>=this.maxTimestampPairs){this.warnedSlotOverflow||=(console.warn(`stats-gl: WebGPU timestamp pair budget exhausted (maxTimestampPairs=${this.maxTimestampPairs}). Increase maxTimestampPairs in StatsOptions to instrument more passes.`),!0);return}let t=this.frameCursor++;return this.slotTypes[t]=e,{querySet:this.gpuQuerySet,beginningOfPassWriteIndex:t*2,endOfPassWriteIndex:t*2+1}}begin(e){if(this.beginProfiling(),this.webgpuNative){this.frameCursor=0,this.slotTypes.length=0;return}!this.gl||!this.ext||(this.activeQuery&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.activeQuery=this.gl.createQuery(),this.activeQuery&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.activeQuery))}end(e){if(this.renderCount++,this.webgpuNative&&e&&this.gpuQuerySet&&this.gpuResolveBuffer){let t=this.frameCursor;if(t>0){let n=t*2,r=n*8;e.resolveQuerySet(this.gpuQuerySet,0,n,this.gpuResolveBuffer,0);let i=this.acquireReadBuffer();i&&(e.copyBufferToBuffer(this.gpuResolveBuffer,0,i,0,r),this.inFlightFrames.push({buffer:i,pairCount:t,slotTypes:this.slotTypes.slice(0,t),mapPromise:null,ready:!1,error:null}))}this.endProfiling();return}this.gl&&this.ext&&this.activeQuery&&(this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.gpuQueries.push({query:this.activeQuery}),this.activeQuery=null),this.endProfiling()}async resolveTimestampsAsync(){if(!this.webgpuNative)return this.totalGpuDuration;for(let e of this.inFlightFrames)e.mapPromise===null&&(e.mapPromise=e.buffer.mapAsync(GPUMapMode.READ).then(()=>{e.ready=!0},t=>{e.error=t,e.ready=!0}));for(;this.inFlightFrames.length>0&&this.inFlightFrames[0].ready;){let e=this.inFlightFrames.shift();if(e.error){this.warnedMapError||=(console.warn(`stats-gl: WebGPU timestamp mapAsync failed`,e.error),!0),this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.readBufferPool.push(e.buffer);continue}let t=new BigUint64Array(e.buffer.getMappedRange()),n=0,r=0;for(let i=0;i=a?Number(o-a):0;e.slotTypes[i]===`compute`?r+=s:n+=s}e.buffer.unmap(),this.readBufferPool.push(e.buffer),this.totalGpuDuration=n/1e6,this.totalGpuDurationCompute=r/1e6}return this.totalGpuDuration}processGpuQueries(){if(!(!this.gl||!this.ext)){this.totalGpuDuration=0;for(let e=this.gpuQueries.length-1;e>=0;e--){let t=this.gpuQueries[e],n=this.gl.getQueryParameter(t.query,this.gl.QUERY_RESULT_AVAILABLE),r=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);if(n&&!r){let n=this.gl.getQueryParameter(t.query,this.gl.QUERY_RESULT)*1e-6;this.totalGpuDuration+=n,this.gl.deleteQuery(t.query),this.gpuQueries.splice(e,1)}}}}processWebGPUTimestamps(){this.totalGpuDuration=this.info.render.timestamp,this.totalGpuDurationCompute=this.info.compute.timestamp}beginProfiling(){this.cpuStartTime=performance.now(),this.isRunningCPUProfiling=!0}endProfiling(){this.isRunningCPUProfiling&&=(this.totalCpuDuration+=performance.now()-this.cpuStartTime,!1)}calculateFps(){let e=performance.now(),t=e-1e3;for(this.frameTimes.push(e);this.frameTimesHead128&&(this.frameTimes=this.frameTimes.slice(this.frameTimesHead),this.frameTimesHead=0),Math.round(this.frameTimes.length-this.frameTimesHead)}updateAverages(){this.addToAverage(this.totalCpuDuration,this.averageCpu),this.addToAverage(this.totalGpuDuration,this.averageGpu),(this.info||this.webgpuNative)&&this.totalGpuDurationCompute!==void 0&&this.addToAverage(this.totalGpuDurationCompute,this.averageGpuCompute)}addToAverage(e,t){for(t.logs.push(e);t.logs.length>this.samplesLog;)t.logs.shift();for(t.graph.push(e);t.graph.length>this.samplesGraph;)t.graph.shift()}resetCounters(){this.renderCount=0,this.totalCpuDuration=0,this.beginTime=performance.now()}getData(){let e=this.averageFps.logs,t=this.averageCpu.logs,n=this.averageGpu.logs,r=this.averageGpuCompute.logs;return{fps:e.length>0?e[e.length-1]:0,cpu:t.length>0?t[t.length-1]:0,gpu:n.length>0?n[n.length-1]:0,gpuCompute:r.length>0?r[r.length-1]:0}}patchThreeWebGPU(e){let t=e.info.reset,n=this;e.info.reset=function(){n.beginProfiling(),t.call(this)}}patchThreeRenderer(e){let t=e.render,n=this;e.render=function(e,r){n.begin(),t.call(this,e,r),n.end()},this.threeRendererPatched=!0}dispose(){if(this.gl){if(this.activeQuery&&this.ext){try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT)}catch{}this.gl.deleteQuery(this.activeQuery),this.activeQuery=null}for(let e of this.gpuQueries)this.gl.deleteQuery(e.query);this.gpuQueries.length=0}this.gpuQuerySet&&=(this.gpuQuerySet.destroy(),null),this.gpuResolveBuffer&&=(this.gpuResolveBuffer.destroy(),null);for(let e of this.inFlightFrames){try{e.buffer.mapState===`mapped`&&e.buffer.unmap()}catch{}e.buffer.destroy()}this.inFlightFrames.length=0;for(let e of this.readBufferPool)e.destroy();this.readBufferPool.length=0,this.frameCursor=0,this.slotTypes.length=0,this.gpuTimestampBufferSize=0,this.warnedMapError=!1,this.warnedSlotOverflow=!1,this.warnedPoolGrowth=!1,this.webgpuNative=!1,this.gl=null,this.ext=null,this.info=void 0,this.gpuDevice=null,this.gpuBackend=null,this.renderer=null,this.frameTimes.length=0,this.frameTimesHead=0,this.averageFps.logs.length=0,this.averageFps.graph.length=0,this.averageCpu.logs.length=0,this.averageCpu.graph.length=0,this.averageGpu.logs.length=0,this.averageGpu.graph.length=0,this.averageGpuCompute.logs.length=0,this.averageGpuCompute.graph.length=0}},ZA=class{constructor(e,t,n){this.id=0,this.name=e,this.fg=t,this.bg=n,this.gradient=null,this.PR=Math.round(typeof window<`u`&&window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(this.WIDTH,this.HEIGHT),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width=`90px`,this.canvas.style.height=`48px`,this.canvas.style.position=`absolute`,this.canvas.style.cssText=`width:90px;height:48px;background-color: transparent !important;`,this.context=this.canvas.getContext(`2d`),this.initializeCanvas()}createGradient(){if(!this.context)throw Error(`No context`);let e=this.context.createLinearGradient(0,this.GRAPH_Y,0,this.GRAPH_Y+this.GRAPH_HEIGHT),t,n=this.fg;switch(this.fg.toLowerCase()){case`#0ff`:t=`#006666`;break;case`#0f0`:t=`#006600`;break;case`#ff0`:t=`#666600`;break;case`#e1e1e1`:t=`#666666`;break;default:t=this.bg;break}return e.addColorStop(0,t),e.addColorStop(1,n),e}initializeCanvas(){this.context&&(this.context.imageSmoothingEnabled=!1,this.context.font=`bold `+9*this.PR+`px Helvetica,Arial,sans-serif`,this.context.textBaseline=`top`,this.gradient=this.createGradient(),this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(e,t,n=0,r=``){if(!this.context||!this.gradient)return;let i=Math.min(1/0,e),a=Math.max(t,e);this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y);let o=`${e.toFixed(n)} ${this.name}`;this.context.fillStyle=this.fg,this.context.fillText(o,this.TEXT_X,this.TEXT_Y);let s=this.TEXT_X+this.context.measureText(o).width;r&&(this.context.fillStyle=`#f90`,this.context.fillText(r,s,this.TEXT_Y),s+=this.context.measureText(r).width),this.context.fillStyle=this.fg,this.context.fillText(` (${i.toFixed(n)}-${parseFloat(a.toFixed(n))})`,s,this.TEXT_Y)}updateGraph(e,t){if(!this.context||!this.gradient)return;e===0&&t===0&&(t=1),t=Math.max(t,e,.1),e=Math.max(e,0);let n=Math.round(this.GRAPH_X),r=Math.round(this.GRAPH_Y),i=Math.round(this.GRAPH_WIDTH),a=Math.round(this.GRAPH_HEIGHT),o=Math.round(this.PR);this.context.drawImage(this.canvas,n+o,r,i-o,a,n,r,i-o,a),this.context.fillStyle=this.bg,this.context.fillRect(n+i-o,r,o,a);let s=Math.min(a,Math.round(e/t*a));s>0&&(this.context.globalAlpha=.9,this.context.fillStyle=this.gradient,this.context.fillRect(n+i-o,r+(a-s),o,s)),this.context.globalAlpha=1}},QA=class extends ZA{constructor(e,t,n){super(e,t,n),this.vsyncValue=0,this.SMALL_HEIGHT=9*this.PR,this.HEIGHT=this.SMALL_HEIGHT,this.WIDTH=35*this.PR,this.TEXT_Y=0*this.PR,this.canvas.height=this.HEIGHT,this.canvas.width=this.WIDTH,this.canvas.style.height=`9px`,this.canvas.style.width=`35px`,this.canvas.style.cssText=` + width: 35px; + height: 9px; + position: absolute; + top: 0; + left: 0; + background-color: transparent !important; + pointer-events: none; + `,this.initializeCanvas()}initializeCanvas(){this.context&&(this.context.imageSmoothingEnabled=!1,this.context.font=`bold `+9*this.PR+`px Helvetica,Arial,sans-serif`,this.context.textBaseline=`top`,this.context.globalAlpha=1)}update(e,t,n=0){this.context&&(this.vsyncValue=e,this.context.clearRect(0,0,this.WIDTH,this.HEIGHT),this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillText(`${e.toFixed(0)}Hz`,this.TEXT_X,this.TEXT_Y))}updateGraph(e,t){}setOffset(e,t){this.canvas.style.transform=`translate(${e}px, ${t}px)`}},$A=class extends ZA{constructor(e){super(e,`#fff`,`#111`),this.currentBitmap=null,this.sourceAspect=1,this.initializeCanvas()}initializeCanvas(){this.context&&(this.context.imageSmoothingEnabled=!0,this.context.font=`bold `+9*this.PR+`px Helvetica,Arial,sans-serif`,this.context.textBaseline=`top`,this.context.fillStyle=`#000`,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.drawLabelOverlay())}drawLabelOverlay(){this.context&&(this.context.fillStyle=`rgba(0, 0, 0, 0.5)`,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y))}setSourceSize(e,t){this.sourceAspect=e/t}updateTexture(e){if(!this.context)return;this.currentBitmap&&this.currentBitmap.close(),this.currentBitmap=e,this.context.fillStyle=`#000`,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT);let t=this.WIDTH/this.HEIGHT,n,r,i,a;this.sourceAspect>t?(n=this.WIDTH,r=this.WIDTH/this.sourceAspect,i=0,a=(this.HEIGHT-r)/2):(r=this.HEIGHT,n=this.HEIGHT*this.sourceAspect,i=(this.WIDTH-n)/2,a=0),this.context.drawImage(e,i,a,n,r),this.drawLabelOverlay()}setLabel(e){this.name=e,this.drawLabelOverlay()}update(e,t,n=0,r=``){}updateGraph(e,t){}dispose(){this.currentBitmap&&=(this.currentBitmap.close(),null)}},ej=class{constructor(e,t=90,n=48){this.previewFbo=null,this.previewTexture=null,this.gl=e,this.previewWidth=t,this.previewHeight=n,this.pixels=new Uint8Array(t*n*4),this.flippedPixels=new Uint8Array(t*n*4),this.initResources()}resize(e,t){e===this.previewWidth&&t===this.previewHeight||(this.previewWidth=e,this.previewHeight=t,this.pixels=new Uint8Array(e*t*4),this.flippedPixels=new Uint8Array(e*t*4),this.dispose(),this.initResources())}initResources(){let e=this.gl;this.previewTexture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.previewTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA8,this.previewWidth,this.previewHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),this.previewFbo=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,this.previewFbo),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.previewTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null)}async capture(e,t,n,r=`default`){let i=this.gl,a=i.getParameter(i.READ_FRAMEBUFFER_BINDING),o=i.getParameter(i.DRAW_FRAMEBUFFER_BINDING);i.bindFramebuffer(i.READ_FRAMEBUFFER,e),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,this.previewFbo),i.blitFramebuffer(0,0,t,n,0,0,this.previewWidth,this.previewHeight,i.COLOR_BUFFER_BIT,i.LINEAR),i.bindFramebuffer(i.READ_FRAMEBUFFER,this.previewFbo),i.readPixels(0,0,this.previewWidth,this.previewHeight,i.RGBA,i.UNSIGNED_BYTE,this.pixels),i.bindFramebuffer(i.READ_FRAMEBUFFER,a),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,o);let s=this.flipY(this.pixels,this.previewWidth,this.previewHeight),c=new ImageData(new Uint8ClampedArray(s),this.previewWidth,this.previewHeight);return createImageBitmap(c)}flipY(e,t,n){let r=t*4;for(let t=0;t; + + struct VertexOutput { + @builtin(position) position: vec4f, + @location(0) uv: vec2f + } + + @vertex + fn vertexMain(@builtin(vertex_index) vertexIndex: u32) -> VertexOutput { + var positions = array( + vec2f(-1.0, -1.0), + vec2f(3.0, -1.0), + vec2f(-1.0, 3.0) + ); + var uvs = array( + vec2f(0.0, 1.0), + vec2f(2.0, 1.0), + vec2f(0.0, -1.0) + ); + + var output: VertexOutput; + output.position = vec4f(positions[vertexIndex], 0.0, 1.0); + output.uv = uvs[vertexIndex]; + return output; + } + + @fragment + fn fragmentMain(@location(0) uv: vec2f) -> @location(0) vec4f { + return textureSample(texInput, texSampler, uv); + } + `});this.bindGroupLayout=e.createBindGroupLayout({entries:[{binding:0,visibility:GPUShaderStage.FRAGMENT,sampler:{type:`filtering`}},{binding:1,visibility:GPUShaderStage.FRAGMENT,texture:{sampleType:`float`}}]}),this.blitPipeline=e.createRenderPipeline({layout:e.createPipelineLayout({bindGroupLayouts:[this.bindGroupLayout]}),vertex:{module:t,entryPoint:`vertexMain`},fragment:{module:t,entryPoint:`fragmentMain`,targets:[{format:`rgba8unorm`}]},primitive:{topology:`triangle-list`}}),this.initialized=!0}async capture(e){if(await this.initResources(),!this.previewTexture||!this.stagingBuffer||!this.blitPipeline||!this.sampler||!this.bindGroupLayout)return null;let t=this.device,n=t.createBindGroup({layout:this.bindGroupLayout,entries:[{binding:0,resource:this.sampler},{binding:1,resource:e.createView()}]}),r=t.createCommandEncoder(),i=r.beginRenderPass({colorAttachments:[{view:this.previewTexture.createView(),loadOp:`clear`,storeOp:`store`,clearValue:{r:0,g:0,b:0,a:1}}]});i.setPipeline(this.blitPipeline),i.setBindGroup(0,n),i.draw(3),i.end();let a=Math.ceil(this.previewWidth*4/256)*256;r.copyTextureToBuffer({texture:this.previewTexture},{buffer:this.stagingBuffer,bytesPerRow:a},{width:this.previewWidth,height:this.previewHeight}),t.queue.submit([r.finish()]),await this.stagingBuffer.mapAsync(GPUMapMode.READ);let o=new Uint8Array(this.stagingBuffer.getMappedRange());for(let e=0;e{e.preventDefault(),this.showPanel(++this.mode%this.dom.children.length)},this.handleResize=()=>{this.fpsPanel&&this.resizePanel(this.fpsPanel),this.msPanel&&this.resizePanel(this.msPanel),this.workerCpuPanel&&this.resizePanel(this.workerCpuPanel),this.gpuPanel&&this.resizePanel(this.gpuPanel),this.gpuPanelCompute&&this.resizePanel(this.gpuPanelCompute)},this.mode=f,this.horizontal=d,this.minimal=u,this.dom=document.createElement(`div`),this.initializeDOM(),this._panelId=0,this.trackFPS&&(this.fpsPanel=this.addPanel(new e.Panel(`FPS`,`#0ff`,`#002`)),this.msPanel=this.addPanel(new e.Panel(`CPU`,`#0f0`,`#020`))),this.trackGPU&&(this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`))),this.trackCPT&&(this.gpuPanelCompute=this.addPanel(new e.Panel(`CPT`,`#e1e1e1`,`#212121`))),this.trackHz===!0&&(this.vsyncPanel=new QA(``,`#f0f`,`#202`),this.dom.appendChild(this.vsyncPanel.canvas),this.vsyncPanel.setOffset(56,35)),this.setupEventListeners()}initializeDOM(){this.dom.style.cssText=` + position: fixed; + top: 0; + left: 0; + opacity: 0.9; + z-index: 10000; + ${this.minimal?`cursor: pointer;`:``} + `}setupEventListeners(){this.minimal?(this.dom.addEventListener(`click`,this.handleClick),this.showPanel(this.mode)):window.addEventListener(`resize`,this.handleResize)}updateTexturePreviewDimensions(){if(!this.renderer)return;let e=this.renderer.domElement?.width||0,t=this.renderer.domElement?.height||0;if(e===this.lastRendererWidth&&t===this.lastRendererHeight||e===0||t===0)return;this.lastRendererWidth=e,this.lastRendererHeight=t;let n=e/t,r,i;if(n>1.875?(r=90,i=Math.round(90/n)):(i=48,r=Math.round(48*n)),r=Math.max(r,16),i=Math.max(i,16),r!==this.texturePreviewWidth||i!==this.texturePreviewHeight){this.texturePreviewWidth=r,this.texturePreviewHeight=i,this.textureCaptureWebGL&&this.textureCaptureWebGL.resize(r,i),this.textureCaptureWebGPU&&this.textureCaptureWebGPU.resize(r,i);for(let n of this.texturePanels.values())n.setSourceSize(e,t)}}onWebGPUTimestampSupported(){}onGPUTrackingInitialized(){}setData(t){if(this.externalData=t,this.hasNewExternalData=!0,!this.isWorker&&this.msPanel){this.isWorker=!0,this.workerCpuPanel=new e.Panel(`WRK`,`#f90`,`#220`);let t=this.msPanel.id+1;this.workerCpuPanel.id=t,this.gpuPanel&&this.gpuPanel.id>=t&&(this.gpuPanel.id++,this.resizePanel(this.gpuPanel)),this.gpuPanelCompute&&this.gpuPanelCompute.id>=t&&(this.gpuPanelCompute.id++,this.resizePanel(this.gpuPanelCompute));let n=this.msPanel.canvas;n.nextSibling?this.dom.insertBefore(this.workerCpuPanel.canvas,n.nextSibling):this.dom.appendChild(this.workerCpuPanel.canvas),this.resizePanel(this.workerCpuPanel),this._panelId++}}update(){this.externalData?this.updateFromExternalData():this.updateFromInternalData()}updateFromExternalData(){let e=this.externalData;this.endProfiling(),this.addToAverage(this.totalCpuDuration,this.averageCpu),this.totalCpuDuration=0,this.hasNewExternalData&&=(this.addToAverage(e.cpu,this.averageWorkerCpu),this.addToAverage(e.fps,this.averageFps),this.addToAverage(e.gpu,this.averageGpu),this.addToAverage(e.gpuCompute,this.averageGpuCompute),!1),this.renderPanels()}updateFromInternalData(){this.endProfiling(),this.webgpuNative?this.resolveTimestampsAsync():this.info?this.processWebGPUTimestamps():this.processGpuQueries(),this.updateAverages(),this.resetCounters(),this.renderPanels()}renderPanels(){let e=performance.now();if(!this.isWorker){for(this.frameTimes.push(e);this.frameTimes.length>0&&this.frameTimes[0]<=e-1e3;)this.frameTimes.shift();let t=Math.round(this.frameTimes.length);this.addToAverage(t,this.averageFps)}let t=e>=this.prevTextTime+1e3/this.logsPerSecond,n=e>=this.prevGraphTime+1e3/this.graphsPerSecond,r=this.isWorker?` ⛭`:``;if(this.updatePanelComponents(this.fpsPanel,this.averageFps,0,t,n,r),this.updatePanelComponents(this.msPanel,this.averageCpu,this.precision,t,n,``),this.workerCpuPanel&&this.isWorker&&this.updatePanelComponents(this.workerCpuPanel,this.averageWorkerCpu,this.precision,t,n,` ⛭`),this.gpuPanel&&this.updatePanelComponents(this.gpuPanel,this.averageGpu,this.precision,t,n,r),this.trackCPT&&this.gpuPanelCompute&&this.updatePanelComponents(this.gpuPanelCompute,this.averageGpuCompute,this.precision,t,n,r),t&&(this.prevTextTime=e),n&&(this.prevGraphTime=e,this.texturePanels.size>0&&!this.textureUpdatePending&&(this.textureUpdatePending=!0,this.updateTexturePanels().finally(()=>{this.textureUpdatePending=!1})),this.captureStatsGLNodes()),this.vsyncPanel!==null){this.detectVSync(e);let n=this.detectedVSync?.refreshRate||0;t&&n>0&&this.vsyncPanel.update(n,n)}}resetCounters(){this.renderCount=0,this.totalCpuDuration=0,this.beginTime=performance.now()}resizePanel(e){e.canvas.style.position=`absolute`,this.minimal?e.canvas.style.display=`none`:(e.canvas.style.display=`block`,this.horizontal?(e.canvas.style.top=`0px`,e.canvas.style.left=e.id*e.WIDTH/e.PR+`px`):(e.canvas.style.left=`0px`,e.canvas.style.top=e.id*e.HEIGHT/e.PR+`px`))}addPanel(e){return e.canvas&&(this.dom.appendChild(e.canvas),e.id=this._panelId,this.resizePanel(e),this._panelId++),e}showPanel(e){for(let t=0;tthis.HISTORY_SIZE&&this.frameTimeHistory.shift(),this.frameTimeHistory.length<60)return;let n=this.frameTimeHistory.reduce((e,t)=>e+t)/this.frameTimeHistory.length,r=this.frameTimeHistory.reduce((e,t)=>e+(t-n)**2,0)/this.frameTimeHistory.length;if(Math.sqrt(r)>2){this.detectedVSync=null;return}let i=null,a=1/0;for(let e of this.VSYNC_RATES){let t=Math.abs(n-e.frameTime);t=this.prevCpuTime+1e3/this.logsPerSecond&&e.update(this.lastValue[e.name],i,this.lastMax[e.name],o,n),r>=this.prevGraphTime+1e3/this.graphsPerSecond&&(e.updateGraph(i,o),this.prevGraphTime=r))}get domElement(){return this.dom}dispose(){this.minimal?this.dom.removeEventListener(`click`,this.handleClick):window.removeEventListener(`resize`,this.handleResize),this.textureCaptureWebGL&&=(this.textureCaptureWebGL.dispose(),null),this.textureCaptureWebGPU&&=(this.textureCaptureWebGPU.dispose(),null);for(let e of this.texturePanels.values())e.dispose();this.texturePanels.clear(),this.textureSourcesWebGL.clear(),this.textureSourcesWebGPU.clear();let e=this._statsGLCaptures;if(e){for(let t of e.values())t.dispose&&t.dispose();e.clear()}this.texturePanelRow&&=(this.texturePanelRow.remove(),null),this.dom.remove(),this.fpsPanel=null,this.msPanel=null,this.gpuPanel=null,this.gpuPanelCompute=null,this.vsyncPanel=null,this.workerCpuPanel=null,this.frameTimeHistory.length=0,this.averageWorkerCpu.logs.length=0,this.averageWorkerCpu.graph.length=0,super.dispose()}};ij.Panel=ZA,ij.PanelTexture=$A;var $={diffuse:`csm_DiffuseColor`,roughness:`csm_Roughness`,metalness:`csm_Metalness`,emissive:`csm_Emissive`,ao:`csm_AO`,fragNormal:`csm_FragNormal`,clearcoat:`csm_Clearcoat`,clearcoatRoughness:`csm_ClearcoatRoughness`,clearcoatNormal:`csm_ClearcoatNormal`,transmission:`csm_Transmission`,thickness:`csm_Thickness`,iridescence:`csm_Iridescence`,pointSize:`csm_PointSize`,fragColor:`csm_FragColor`,depthAlpha:`csm_DepthAlpha`,unlitFac:`csm_UnlitFac`,position:`csm_Position`,positionRaw:`csm_PositionRaw`,normal:`csm_Normal`};`${$.position}`,`${$.positionRaw}`,`${$.normal}`,`${$.depthAlpha}`,`${$.pointSize}`,`${$.diffuse}`,`${$.fragColor}`,`${$.fragNormal}`,`${$.unlitFac}`,`${$.emissive}`,`${$.roughness}`,`${$.metalness}`,`${$.iridescence}`,`${$.ao}`,`${$.clearcoat}`,`${$.clearcoatRoughness}`,`${$.clearcoatNormal}`,`${$.transmission}`,`${$.thickness}`,Y.lights_physical_fragment,Y.transmission_fragment,`${$.normal}`,`${$.normal}`,`${$.position}`,`${$.position}`,`${$.positionRaw}`,`${$.positionRaw}`,`${$.pointSize}`,`${$.pointSize}`,`${$.diffuse}`,`${$.diffuse}`,`${$.fragColor}`,`${$.fragColor}${$.unlitFac}`,`${$.emissive}`,`${$.emissive}`,`${$.roughness}`,`${$.roughness}`,`${$.metalness}`,`${$.metalness}`,`${$.ao}`,`${$.ao}`,`${$.fragNormal}`,`${$.fragNormal}`,`${$.depthAlpha}`,`${$.depthAlpha}`,`${$.depthAlpha}`,`${$.depthAlpha}`,`${$.clearcoat}`,`${$.clearcoat}`,`${$.clearcoatRoughness}`,`${$.clearcoatRoughness}`,`${$.clearcoatNormal}`,`${$.transmission}`,`${$.transmission}`,`${$.thickness}`,`${$.thickness}`,`${$.iridescence}`,`${$.iridescence}`,$.clearcoat,$.clearcoatNormal,$.clearcoatRoughness,$.transmission,$.iridescence,new G,new U,new U,new G,new md,Array.from({length:8},()=>new U),new U,new U,new U,new U,new U,new U,Object.freeze(new U(0,0,1)),(()=>{let e=new Jf;return e.matrixAutoUpdate=!1,e.matrixWorldAutoUpdate=!1,e})(),new K(`black`),new H(1,1),new U,new U,new U;var aj={makeDefault:!1,autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,enablePan:!0,keyPanSpeed:7,maxAzimuthAngle:1/0,minAzimuthAngle:-1/0,maxPolarAngle:Math.PI,minPolarAngle:0,minDistance:0,maxDistance:1/0,minZoom:0,maxZoom:1/0,enableZoom:!0,zoomSpeed:1,enableRotate:!0,rotateSpeed:1,target:()=>[0,0,0]};function oj(e,t,n){let{controls:r,invalidate:i}=Qk();Bn(t,()=>{i()}),qC(e,a=>{a.addEventListener(`change`,()=>{i(),a&&n(`change`,e.value)}),a.addEventListener(`start`,()=>{e.value&&n(`start`,e.value)}),a.addEventListener(`end`,()=>{e.value&&n(`end`,e.value)}),t.makeDefault?r.value=a:r.value=null},{once:!0});let{onBeforeRender:a}=$k();a(()=>{e.value&&e.value.enabled&&(t.enableDamping||t.autoRotate)&&e.value.update()}),pr(()=>{e.value&&e.value.dispose()})}({...aj});var sj=[`args`,`target`,`auto-rotate`,`auto-rotate-speed`,`enable-damping`,`damping-factor`,`enable-pan`,`key-pan-speed`,`keys`,`max-azimuth-angle`,`min-azimuth-angle`,`max-polar-angle`,`min-polar-angle`,`min-distance`,`max-distance`,`min-zoom`,`max-zoom`,`touches`,`enable-zoom`,`zoom-speed`,`enable-rotate`,`rotate-speed`,`mouse-buttons`,`screen-space-panning`],cj=Jn({__name:`OrbitControls`,props:Mr({mouseButtons:{type:Object,required:!1},makeDefault:{type:Boolean,required:!1},camera:{type:Object,required:!1},domElement:{type:null,required:!1},target:{type:null,required:!1},enableDamping:{type:Boolean,required:!1},dampingFactor:{type:Number,required:!1},autoRotate:{type:Boolean,required:!1},autoRotateSpeed:{type:Number,required:!1},enablePan:{type:Boolean,required:!1},keyPanSpeed:{type:Number,required:!1},keys:{type:Object,required:!1},maxAzimuthAngle:{type:Number,required:!1},minAzimuthAngle:{type:Number,required:!1},maxPolarAngle:{type:Number,required:!1},minPolarAngle:{type:Number,required:!1},minDistance:{type:Number,required:!1},maxDistance:{type:Number,required:!1},minZoom:{type:Number,required:!1},maxZoom:{type:Number,required:!1},touches:{type:Object,required:!1},enableZoom:{type:Boolean,required:!1},zoomSpeed:{type:Number,required:!1},enableRotate:{type:Boolean,required:!1},rotateSpeed:{type:Number,required:!1},screenSpacePanning:{type:Boolean,required:!1}},{...aj,touches:()=>({ONE:qo.ROTATE,TWO:qo.DOLLY_PAN}),mouseButtons:()=>({LEFT:Ko.ROTATE,MIDDLE:Ko.DOLLY,RIGHT:Ko.PAN}),screenSpacePanning:!0}),emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{camera:a,renderer:o,extend:s}=Qk(),c=qt(null);return s({OrbitControls:YA}),oj(c,r,i),t({instance:c}),(t,n)=>(e.camera||Xt(a))&&(e.domElement||Xt(o).domElement)?(oa(),da(`TresOrbitControls`,{ref_key:`controlsRef`,ref:c,key:(e.camera||Xt(a))?.uuid,args:[e.camera||Xt(a),e.domElement||Xt(o).domElement],target:e.target,"auto-rotate":e.autoRotate,"auto-rotate-speed":e.autoRotateSpeed,"enable-damping":e.enableDamping,"damping-factor":e.dampingFactor,"enable-pan":e.enablePan,"key-pan-speed":e.keyPanSpeed,keys:e.keys,"max-azimuth-angle":e.maxAzimuthAngle,"min-azimuth-angle":e.minAzimuthAngle,"max-polar-angle":e.maxPolarAngle,"min-polar-angle":e.minPolarAngle,"min-distance":e.minDistance,"max-distance":e.maxDistance,"min-zoom":e.minZoom,"max-zoom":e.maxZoom,touches:e.touches,"enable-zoom":e.enableZoom,"zoom-speed":e.zoomSpeed,"enable-rotate":e.enableRotate,"rotate-speed":e.rotateSpeed,"mouse-buttons":e.mouseButtons,"screen-space-panning":e.screenSpacePanning},null,8,sj)):Ca(`v-if`,!0)}});new K;var lj=class e extends Jf{static Geometry;isLensflare=!0;type=`Lensflare`;addElement(e){}dispose(){}constructor(){super(e.Geometry,new If({opacity:0,transparent:!0})),this.frustumCulled=!1,this.renderOrder=1/0;let t=new U,n=new U,r=new ym(16,16),i=new ym(16,16),a=ls,o=e.Geometry,s=new kg({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + + void main() { + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + void main() { + + gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); + + }`,depthTest:!0,depthWrite:!1,transparent:!1}),c=new kg({uniforms:{map:{value:r},scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + attribute vec2 uv; + + varying vec2 vUV; + + void main() { + + vUV = uv; + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + uniform sampler2D map; + + varying vec2 vUV; + + void main() { + + gl_FragColor = texture2D( map, vUV ); + + }`,depthTest:!1,depthWrite:!1,transparent:!1}),l=new Jf(o,s),u=[],d=uj.Shader,f=new kg({name:d.name,uniforms:{map:{value:null},occlusionMap:{value:i},color:{value:new K(16777215)},scale:{value:new H},screenPosition:{value:new U}},vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:2,transparent:!0,depthWrite:!1}),p=new Jf(o,f);this.addElement=function(e){u.push(e)};let m=new H,h=new H,g=new dy,_=new lu;this.onBeforeRender=function(e,d,v){e.getCurrentViewport(_);let y=e.getRenderTarget(),b=y===null?ls:y.texture.type;a!==b&&(r.dispose(),i.dispose(),r.type=i.type=b,a=b);let x=_.w/_.z,S=_.z/2,C=_.w/2,w=16/_.w;if(m.set(w*x,w),g.min.set(_.x,_.y),g.max.set(_.x+(_.z-16),_.y+(_.w-16)),n.setFromMatrixPosition(this.matrixWorld),n.applyMatrix4(v.matrixWorldInverse),!(n.z>0)&&(t.copy(n).applyMatrix4(v.projectionMatrix),h.x=_.x+t.x*S+S-8,h.y=_.y+t.y*C+C-8,g.containsPoint(h))){e.copyFramebufferToTexture(r,h);let n=s.uniforms;n.scale.value=m,n.screenPosition.value=t,e.renderBufferDirect(v,null,o,s,l,null),e.copyFramebufferToTexture(i,h),n=c.uniforms,n.scale.value=m,n.screenPosition.value=t,e.renderBufferDirect(v,null,o,c,l,null);let a=-t.x*2,d=-t.y*2;for(let n=0,r=u.length;n{let r=yr(`TresOrthographicCamera`),i=yr(`TresAmbientLight`),a=yr(`TresPointLight`);return oa(),da(`div`,pj,[va(Xt(NA),me(ba({powerPreference:`high-performance`,alpha:!0,...e.options})),{default:Mn(()=>[va(r,{args:[1/-2,1/2,1/2,1/-2,.001,5e3],position:[0,0,1e3]}),va(i),va(a),e.controls?(oa(),fa(Xt(cj),{key:0})):Ca(``,!0),Cr(t.$slots,`default`)]),_:3},16)])}}},hj=`#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif + +varying vec2 v_uv; + +uniform float u_time; +uniform vec2 u_resolution; +uniform float u_grid_size; +uniform sampler2D u_texture; +uniform vec2 u_texture_resolution; +uniform vec2 u_mouse; + +vec2 fitImage(vec2 st, vec2 imageResolution, vec2 frameResolution, int fit) { + float imageAspect = imageResolution.x / imageResolution.y; + float frameAspect = frameResolution.x / frameResolution.y; + float imageFrameRatio = imageAspect / frameAspect; + + float scaleX = 1., scaleY = 1.; + + + if(fit == 0) { + + if(imageAspect < frameAspect) { + scaleY = imageFrameRatio; + } + + else if(imageAspect > frameAspect) { + scaleX = 1. / imageFrameRatio; + } + } + + else if(fit == 1) { + if(imageAspect < frameAspect) { + scaleX = 1. / imageFrameRatio; + } + + else if(imageAspect > frameAspect) { + scaleY = imageFrameRatio; + } + } + + vec2 imageScale = vec2(scaleX, scaleY); + vec2 coordinates = imageScale * (st - 0.5) + 0.5; + + if(coordinates.x < 0. || coordinates.x > 1. || coordinates.y < 0. || coordinates.y > 1.) { + discard; + } + + return coordinates; +} + +float rand(vec2 co) { + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); +} + +float greyScale(in vec3 col) { + return dot(col, vec3(0.2126, 0.7152, 0.0722)); +} + +void main() { + float aspectRatio = u_resolution.x / u_resolution.y; + vec2 st = vec2(v_uv.x * aspectRatio, v_uv.y); + vec2 st_mouse = vec2(u_mouse.x * aspectRatio, u_mouse.y); + + + float distance = max(0.6, distance(st, st_mouse) * 10.); + + float gridValue = rand(st + u_time); + + vec3 grainColor = vec3(1.); + if(gridValue < 0.5) { + grainColor = vec3(0.); + } + + vec2 texCoordinates = fitImage(v_uv, u_texture_resolution, u_resolution, 0); + vec3 texColor = texture2D(u_texture, texCoordinates).rgb; + texColor = vec3(greyScale(texColor)); + texColor *= rand(st + u_time) / distance; + + vec3 finalTexColor = vec3(0.); + if(texColor.r > 0.5) { + finalTexColor = vec3(1.); + } + + gl_FragColor = vec4(mix(finalTexColor, grainColor, 0.2), 1.); +}`,gj=`varying vec2 v_uv; + +void main() { + v_uv = uv; + + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); +}`;function _j(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function vj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var yj={autoSleep:120,force3D:`auto`,nullTargetWarn:1,units:{lineHeight:``}},bj={duration:.5,overwrite:!1,delay:0},xj,Sj,Cj,wj=1e8,Tj=1/wj,Ej=Math.PI*2,Dj=Ej/4,Oj=0,kj=Math.sqrt,Aj=Math.cos,jj=Math.sin,Mj=function(e){return typeof e==`string`},Nj=function(e){return typeof e==`function`},Pj=function(e){return typeof e==`number`},Fj=function(e){return e===void 0},Ij=function(e){return typeof e==`object`},Lj=function(e){return e!==!1},Rj=function(){return typeof window<`u`},zj=function(e){return Nj(e)||Mj(e)},Bj=typeof ArrayBuffer==`function`&&ArrayBuffer.isView||function(){},Vj=Array.isArray,Hj=/random\([^)]+\)/g,Uj=/,\s*/g,Wj=/(?:-?\.?\d|\.)+/gi,Gj=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Kj=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,qj=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Jj=/[+-]=-?[.\d]+/,Yj=/[^,'"\[\]\s]+/gi,Xj=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Zj,Qj,$j,eM,tM={},nM={},rM,iM=function(e){return(nM=IM(e,tM))&&tF},aM=function(e,t){return console.warn(`Invalid property`,e,`set to`,t,`Missing plugin? gsap.registerPlugin()`)},oM=function(e,t){return!t&&console.warn(e)},sM=function(e,t){return e&&(tM[e]=t)&&nM&&(nM[e]=t)||tM},cM=function(){return 0},lM={suppressEvents:!0,isStart:!0,kill:!1},uM={suppressEvents:!0,kill:!1},dM={suppressEvents:!0},fM={},pM=[],mM={},hM,gM={},_M={},vM=30,yM=[],bM=``,xM=function(e){var t=e[0],n,r;if(Ij(t)||Nj(t)||(e=[e]),!(n=(t._gsap||{}).harness)){for(r=yM.length;r--&&!yM[r].targetTest(t););n=yM[r]}for(r=e.length;r--;)e[r]&&(e[r]._gsap||(e[r]._gsap=new dP(e[r],n)))||e.splice(r,1);return e},SM=function(e){return e._gsap||xM(yN(e))[0]._gsap},CM=function(e,t,n){return(n=e[t])&&Nj(n)?e[t]():Fj(n)&&e.getAttribute&&e.getAttribute(t)||n},wM=function(e,t){return(e=e.split(`,`)).forEach(t)||e},TM=function(e){return Math.round(e*1e5)/1e5||0},EM=function(e){return Math.round(e*1e7)/1e7||0},DM=function(e,t){var n=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),n===`+`?e+r:n===`-`?e-r:n===`*`?e*r:e/r},OM=function(e,t){for(var n=t.length,r=0;e.indexOf(t[r])<0&&++ro;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=t._dp=e,t},HM=function(e,t,n,r){n===void 0&&(n=`_first`),r===void 0&&(r=`_last`);var i=t._prev,a=t._next;i?i._next=a:e[n]===t&&(e[n]=a),a?a._prev=i:e[r]===t&&(e[r]=i),t._next=t._prev=t.parent=null},UM=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},WM=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},GM=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},KM=function(e,t,n,r){return e._startAt&&(Sj?e._startAt.revert(uM):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},qM=function e(t){return!t||t._ts&&e(t.parent)},JM=function(e){return e._repeat?YM(e._tTime,e=e.duration()+e._rDelay)*e:0},YM=function(e,t){var n=Math.floor(e=EM(e/t));return e&&n===e?n-1:n},XM=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},ZM=function(e){return e._end=EM(e._start+(e._tDur/Math.abs(e._ts||e._rts||Tj)||0))},QM=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=EM(n._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),ZM(e),n._dirty||WM(n,e)),e},$M=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._startTj)&&t.render(n,!0)),WM(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-Tj}},eN=function(e,t,n,r){return t.parent&&UM(t),t._start=EM((Pj(n)?n:n||e!==Zj?uN(e,n,t):e._time)+t._delay),t._end=EM(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),VM(e,t,`_first`,`_last`,e._sort?`_start`:0),iN(t)||(e._recent=t),r||$M(e,t),e._ts<0&&QM(e,e._tTime),e},tN=function(e,t){return(tM.ScrollTrigger||aM(`scrollTrigger`,t))&&tM.ScrollTrigger.create(t,e)},nN=function(e,t,n,r,i){if(bP(e,t,i),!e._initted)return 1;if(!n&&e._pt&&!Sj&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&hM!==ZN.frame)return pM.push(e),e._lazy=[i,r],1},rN=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||e(n))},iN=function(e){var t=e.data;return t===`isFromStart`||t===`isStart`},aN=function(e,t,n,r){var i=e.ratio,a=t<0||!t&&(!e._start&&rN(e)&&!(!e._initted&&iN(e))||(e._ts<0||e._dp._ts<0)&&!iN(e))?0:1,o=e._rDelay,s=0,c,l,u;if(o&&e._repeat&&(s=pN(0,e._tDur,t),l=YM(s,o),e._yoyo&&l&1&&(a=1-a),l!==YM(e._tTime,o)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||Sj||r||e._zTime===Tj||!t&&e._zTime){if(!e._initted&&nN(e,t,r,n,s))return;for(u=e._zTime,e._zTime=t||(n?Tj:0),n||=t&&!u,e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=s,c=e._pt;c;)c.r(a,c.d),c=c._next;t<0&&KM(e,t,n,!0),e._onUpdate&&!n&&IN(e,`onUpdate`),s&&e._repeat&&!n&&e.parent&&IN(e,`onRepeat`),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&UM(e,1),!n&&!Sj&&(IN(e,a?`onComplete`:`onReverseComplete`,!0),e._prom&&e._prom()))}else e._zTime||=t},oN=function(e,t,n){var r;if(n>t)for(r=e._first;r&&r._start<=n;){if(r.data===`isPause`&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if(r.data===`isPause`&&r._start0&&!r&&QM(e,e._tTime=e._tDur*o),e.parent&&ZM(e),n||WM(e.parent,e),e},cN=function(e){return e instanceof pP?WM(e):sN(e,e._dur)},lN={_start:0,endTime:cM,totalDuration:cM},uN=function e(t,n,r){var i=t.labels,a=t._recent||lN,o=t.duration()>=wj?a.endTime(!1):t._dur,s,c,l;return Mj(n)&&(isNaN(n)||n in i)?(c=n.charAt(0),l=n.substr(-1)===`%`,s=n.indexOf(`=`),c===`<`||c===`>`?(s>=0&&(n=n.replace(/=/,``)),(c===`<`?a._start:a.endTime(a._repeat>=0))+(parseFloat(n.substr(1))||0)*(l?(s<0?a:r).totalDuration()/100:1)):s<0?(n in i||(i[n]=o),i[n]):(c=parseFloat(n.charAt(s-1)+n.substr(s+1)),l&&r&&(c=c/100*(Vj(r)?r[0]:r).totalDuration()),s>1?e(t,n.substr(0,s-1),r)+c:o+c)):n==null?o:+n},dN=function(e,t,n){var r=Pj(t[1]),i=(r?2:1)+(e<2?0:1),a=t[i],o,s;if(r&&(a.duration=t[1]),a.parent=n,e){for(o=a,s=n;s&&!(`immediateRender`in o);)o=s.vars.defaults||{},s=Lj(s.vars.inherit)&&s.parent;a.immediateRender=Lj(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[i-1]}return new DP(t[0],a,t[i+1])},fN=function(e,t){return e||e===0?t(e):t},pN=function(e,t,n){return nt?t:n},mN=function(e,t){return!Mj(e)||!(t=Xj.exec(e))?``:t[1]},hN=function(e,t,n){return fN(n,function(n){return pN(e,t,n)})},gN=[].slice,_N=function(e,t){return e&&Ij(e)&&`length`in e&&(!t&&!e.length||e.length-1 in e&&Ij(e[0]))&&!e.nodeType&&e!==Qj},vN=function(e,t,n){return n===void 0&&(n=[]),e.forEach(function(e){var r;return Mj(e)&&!t||_N(e,1)?(r=n).push.apply(r,yN(e)):n.push(e)})||n},yN=function(e,t,n){return Cj&&!t&&Cj.selector?Cj.selector(e):Mj(e)&&!n&&($j||!QN())?gN.call((t||eM).querySelectorAll(e),0):Vj(e)?vN(e,n):_N(e)?gN.call(e,0):e?[e]:[]},bN=function(e){return e=yN(e)[0]||oM(`Invalid scope`)||{},function(t){var n=e.current||e.nativeElement||e;return yN(t,n.querySelectorAll?n:n===e?oM(`Invalid scope`)||eM.createElement(`div`):e)}},xN=function(e){return e.sort(function(){return .5-Math.random()})},SN=function(e){if(Nj(e))return e;var t=Ij(e)?e:{each:e},n=oP(t.ease),r=t.from||0,i=parseFloat(t.base)||0,a={},o=r>0&&r<1,s=isNaN(r)||o,c=t.axis,l=r,u=r;return Mj(r)?l=u={center:.5,edges:.5,end:1}[r]||0:!o&&s&&(l=r[0],u=r[1]),function(e,o,d){var f=(d||t).length,p=a[f],m,h,g,_,v,y,b,x,S;if(!p){if(S=t.grid===`auto`?0:(t.grid||[1,wj])[1],!S){for(b=-wj;b<(b=d[S++].getBoundingClientRect().left)&&Sb&&(b=v),vf?f-1:c?c===`y`?f/S:S:Math.max(S,f/S))||0)*(r===`edges`?-1:1),p.b=f<0?i-f:i,p.u=mN(t.amount||t.each)||0,n=n&&f<0?aP(n):n}return f=(p[e]-p.min)/p.max||0,EM(p.b+(n?n(f):f)*p.v)+p.u}},CN=function(e){var t=10**((e+``).split(`.`)[1]||``).length;return function(n){var r=EM(Math.round(parseFloat(n)/e)*e*t);return(r-r%1)/t+(Pj(n)?0:mN(n))}},wN=function(e,t){var n=Vj(e),r,i;return!n&&Ij(e)&&(r=n=e.radius||wj,e.values?(e=yN(e.values),(i=!Pj(e[0]))&&(r*=r)):e=CN(e.increment)),fN(t,n?Nj(e)?function(t){return i=e(t),Math.abs(i-t)<=r?i:t}:function(t){for(var n=parseFloat(i?t.x:t),a=parseFloat(i?t.y:0),o=wj,s=0,c=e.length,l,u;c--;)i?(l=e[c].x-n,u=e[c].y-a,l=l*l+u*u):l=Math.abs(e[c]-n),li?a-e:e)})},MN=function(e){return e.replace(Hj,function(e){var t=e.indexOf(`[`)+1,n=e.substring(t||7,t?e.indexOf(`]`):e.length-1).split(Uj);return TN(t?n:+n[0],t?0:+n[1],+n[2]||1e-5)})},NN=function(e,t,n,r,i){var a=t-e,o=r-n;return fN(i,function(t){return n+((t-e)/a*o||0)})},PN=function e(t,n,r,i){var a=isNaN(t+n)?0:function(e){return(1-e)*t+e*n};if(!a){var o=Mj(t),s={},c,l,u,d,f;if(r===!0&&(i=1)&&(r=null),o)t={p:t},n={p:n};else if(Vj(t)&&!Vj(n)){for(u=[],d=t.length,f=d-2,l=1;l(o=Math.abs(o))&&(s=a,i=o);return s},IN=function(e,t,n){var r=e.vars,i=r[t],a=Cj,o=e._ctx,s,c,l;if(i)return s=r[t+`Params`],c=r.callbackScope||e,n&&pM.length&&kM(),o&&(Cj=o),l=s?i.apply(c,s):i.call(c),Cj=a,l},LN=function(e){return UM(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Sj),e.progress()<1&&IN(e,`onInterrupt`),e},RN,zN=[],BN=function(e){if(e)if(e=!e.name&&e.default||e,Rj()||e.headless){var t=e.name,n=Nj(e),r=t&&!n&&e.init?function(){this._props=[]}:e,i={init:cM,render:IP,add:hP,kill:RP,modifier:LP,rawVars:0},a={targetTest:0,get:0,getSetter:MP,aliases:{},register:0};if(QN(),e!==r){if(gM[t])return;PM(r,PM(RM(e,i),a)),IM(r.prototype,IM(i,RM(e,a))),gM[r.prop=t]=r,e.targetTest&&(yM.push(r),fM[t]=1),t=(t===`css`?`CSS`:t.charAt(0).toUpperCase()+t.substr(1))+`Plugin`}sM(t,r),e.register&&e.register(tF,r,VP)}else zN.push(e)},VN=255,HN={aqua:[0,VN,VN],lime:[0,VN,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,VN],navy:[0,0,128],white:[VN,VN,VN],olive:[128,128,0],yellow:[VN,VN,0],orange:[VN,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[VN,0,0],pink:[VN,192,203],cyan:[0,VN,VN],transparent:[VN,VN,VN,0]},UN=function(e,t,n){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(n-t)*e*6:e<.5?n:e*3<2?t+(n-t)*(2/3-e)*6:t)*VN+.5|0},WN=function(e,t,n){var r=e?Pj(e)?[e>>16,e>>8&VN,e&VN]:0:HN.black,i,a,o,s,c,l,u,d,f,p;if(!r){if(e.substr(-1)===`,`&&(e=e.substr(0,e.length-1)),HN[e])r=HN[e];else if(e.charAt(0)===`#`){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e=`#`+i+i+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):``)),e.length===9)return r=parseInt(e.substr(1,6),16),[r>>16,r>>8&VN,r&VN,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),r=[e>>16,e>>8&VN,e&VN]}else if(e.substr(0,3)===`hsl`){if(r=p=e.match(Wj),!t)s=r[0]%360/360,c=r[1]/100,l=r[2]/100,a=l<=.5?l*(c+1):l+c-l*c,i=l*2-a,r.length>3&&(r[3]*=1),r[0]=UN(s+1/3,i,a),r[1]=UN(s,i,a),r[2]=UN(s-1/3,i,a);else if(~e.indexOf(`=`))return r=e.match(Gj),n&&r.length<4&&(r[3]=1),r}else r=e.match(Wj)||HN.transparent;r=r.map(Number)}return t&&!p&&(i=r[0]/VN,a=r[1]/VN,o=r[2]/VN,u=Math.max(i,a,o),d=Math.min(i,a,o),l=(u+d)/2,u===d?s=c=0:(f=u-d,c=l>.5?f/(2-u-d):f/(u+d),s=u===i?(a-o)/f+(at||h<0)&&(r+=h-n),i+=h,y=i-r,_=y-o,(_>0||g)&&(b=++d.frame,f=y-d.time*1e3,d.time=y/=1e3,o+=_+(_>=a?4:a-_),v=1),g||(c=l(u)),v)for(p=0;p=t&&p--},_listeners:s},d}(),QN=function(){return!XN&&ZN.wake()},$N={},eP=/^[\d.\-M][\d.\-,\s]/,tP=/["']/g,nP=function(e){for(var t={},n=e.substr(1,e.length-3).split(`:`),r=n[0],i=1,a=n.length,o,s,c;i1&&n.config?n.config.apply(null,~e.indexOf(`{`)?[nP(t[1])]:rP(e).split(`,`).map(MM)):$N._CE&&eP.test(e)?$N._CE(``,e):n},aP=function(e){return function(t){return 1-e(1-t)}},oP=function(e,t){return e&&(Nj(e)?e:$N[e]||iP(e))||t},sP=function(e,t,n,r){n===void 0&&(n=function(e){return 1-t(1-e)}),r===void 0&&(r=function(e){return e<.5?t(e*2)/2:1-t((1-e)*2)/2});var i={easeIn:t,easeOut:n,easeInOut:r},a;return wM(e,function(e){for(var t in $N[e]=tM[e]=i,$N[a=e.toLowerCase()]=n,i)$N[a+(t===`easeIn`?`.in`:t===`easeOut`?`.out`:`.inOut`)]=$N[e+`.`+t]=i[t]}),i},cP=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},lP=function e(t,n,r){var i=n>=1?n:1,a=(r||(t?.3:.45))/(n<1?n:1),o=a/Ej*(Math.asin(1/i)||0),s=function(e){return e===1?1:i*2**(-10*e)*jj((e-o)*a)+1},c=t===`out`?s:t===`in`?function(e){return 1-s(1-e)}:cP(s);return a=Ej/a,c.config=function(n,r){return e(t,n,r)},c},uP=function e(t,n){n===void 0&&(n=1.70158);var r=function(e){return e?--e*e*((n+1)*e+n)+1:0},i=t===`out`?r:t===`in`?function(e){return 1-r(1-e)}:cP(r);return i.config=function(n){return e(t,n)},i};wM(`Linear,Quad,Cubic,Quart,Quint,Strong`,function(e,t){var n=t<5?t+1:t;sP(e+`,Power`+(n-1),t?function(e){return e**+n}:function(e){return e},function(e){return 1-(1-e)**n},function(e){return e<.5?(e*2)**n/2:1-((1-e)*2)**n/2})}),$N.Linear.easeNone=$N.none=$N.Linear.easeIn,sP(`Elastic`,lP(`in`),lP(`out`),lP()),(function(e,t){var n=1/t,r=2*n,i=2.5*n,a=function(a){return a0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,sN(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(QN(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(QM(this,e),!n._dp||n.parent||$M(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:(n.totalDuration()-n._tTime)/-n._ts)&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e0||!this._tDur&&!e)&&eN(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&Math.abs(this._zTime)===Tj||!this._initted&&this._dur&&e||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),jM(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+JM(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-e:e)+JM(this),t):this.duration()?Math.min(1,this._time/this._dur):+(this.rawTime()>0)},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?YM(this._tTime,n)+1:1},t.timeScale=function(e,t){if(!arguments.length)return this._rts===-Tj?0:this._rts;if(this._rts===e)return this;var n=this.parent&&this._ts?XM(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||e===-Tj?0:this._rts,this.totalTime(pN(-Math.abs(this._delay),this.totalDuration(),n),t!==!1),ZM(this),GM(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(QN(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Tj&&(this._tTime-=Tj)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=EM(e);var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&eN(t,this,this._start-this._delay),this}return this._start},t.endTime=function(e){return this._start+(Lj(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?XM(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){e===void 0&&(e=dM);var t=Sj;return Sj=e,AM(this)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),this.data!==`nested`&&e.kill!==!1&&this.kill(),Sj=t,this},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,cN(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,cN(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(uN(this,e),Lj(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,Lj(t)),this._dur||(this._zTime=-Tj),this},t.play=function(e,t){return e!=null&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return e!=null&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return e!=null&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-Tj:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Tj,this},t.isActive=function(){var e=this.parent||this._dp,t=this._start,n;return!!(!e||this._ts&&this._initted&&e.isActive()&&(n=e.rawTime(!0))>=t&&n1?(t?(r[e]=t,n&&(r[e+`Params`]=n),e===`onUpdate`&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this,n=t._prom;return new Promise(function(r){var i=Nj(e)?e:NM,a=function(){var e=t.then;t.then=null,n&&n(),Nj(i)&&(i=i(t))&&(i.then||i===t)&&(t.then=e),r(i),t.then=e};t._initted&&t.totalProgress()===1&&t._ts>=0||!t._tTime&&t._ts<0?a():t._prom=a})},t.kill=function(){LN(this)},e}();PM(fP.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Tj,_prom:0,_ps:!1,_rts:1});var pP=function(e){vj(t,e);function t(t,n){var r;return t===void 0&&(t={}),r=e.call(this,t)||this,r.labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=Lj(t.sortChildren),Zj&&eN(t.parent||Zj,_j(r),n),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&tN(_j(r),t.scrollTrigger),r}var n=t.prototype;return n.to=function(e,t,n){return dN(0,arguments,this),this},n.from=function(e,t,n){return dN(1,arguments,this),this},n.fromTo=function(e,t,n,r){return dN(2,arguments,this),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,zM(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new DP(e,t,uN(this,n),1),this},n.call=function(e,t,n){return eN(this,DP.delayedCall(0,e,t),n)},n.staggerTo=function(e,t,n,r,i,a,o){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=a,n.onCompleteParams=o,n.parent=this,new DP(e,n,uN(this,i)),this},n.staggerFrom=function(e,t,n,r,i,a,o){return n.runBackwards=1,zM(n).immediateRender=Lj(n.immediateRender),this.staggerTo(e,t,n,r,i,a,o)},n.staggerFromTo=function(e,t,n,r,i,a,o,s){return r.startAt=n,zM(r).immediateRender=Lj(r.immediateRender),this.staggerTo(e,t,r,i,a,o,s)},n.render=function(e,t,n){var r=this._time,i=this._dirty?this.totalDuration():this._tDur,a=this._dur,o=e<=0?0:EM(e),s=this._zTime<0!=e<0&&(this._initted||!a),c,l,u,d,f,p,m,h,g,_,v,y;if(this!==Zj&&o>i&&e>=0&&(o=i),o!==this._tTime||n||s){if(r!==this._time&&a&&(o+=this._time-r,e+=this._time-r),c=o,g=this._start,h=this._ts,p=!h,s&&(a||(r=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(v=this._yoyo,f=a+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(f*100+e,t,n);if(c=EM(o%f),o===i?(d=this._repeat,c=a):(_=EM(o/f),d=~~_,d&&d===_&&(c=a,d--),c>a&&(c=a)),_=YM(this._tTime,f),!r&&this._tTime&&_!==d&&this._tTime-_*f-this._dur<=0&&(_=d),v&&d&1&&(c=a-c,y=1),d!==_&&!this._lock){var b=v&&_&1,x=b===(v&&d&1);if(d<_&&(b=!b),r=b?0:o%a?a:o,this._lock=1,this.render(r||(y?0:EM(d*f)),t,!a)._lock=0,this._tTime=o,!t&&this.parent&&IN(this,`onRepeat`),this.vars.repeatRefresh&&!y&&(this.invalidate()._lock=1,_=d),r&&r!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act||(a=this._dur,i=this._tDur,x&&(this._lock=2,r=b?a:-1e-4,this.render(r,!0),this.vars.repeatRefresh&&!y&&this.invalidate()),this._lock=0,!this._ts&&!p))return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(m=oN(this,EM(r),EM(c)),m&&(o-=c-(c=m._start))),this._tTime=o,this._time=c,this._act=!!h,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,r=0),!r&&o&&a&&!t&&!_&&(IN(this,`onStart`),this._tTime!==o))return this;if(c>=r&&e>=0)for(l=this._first;l;){if(u=l._next,(l._act||c>=l._start)&&l._ts&&m!==l){if(l.parent!==this)return this.render(e,t,n);if(l.render(l._ts>0?(c-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(c-l._start)*l._ts,t,n),c!==this._time||!this._ts&&!p){m=0,u&&(o+=this._zTime=-Tj);break}}l=u}else{l=this._last;for(var S=e<0?e:c;l;){if(u=l._prev,(l._act||S<=l._end)&&l._ts&&m!==l){if(l.parent!==this)return this.render(e,t,n);if(l.render(l._ts>0?(S-l._start)*l._ts:(l._dirty?l.totalDuration():l._tDur)+(S-l._start)*l._ts,t,n||Sj&&AM(l)),c!==this._time||!this._ts&&!p){m=0,u&&(o+=this._zTime=S?-Tj:Tj);break}}l=u}}if(m&&!t&&(this.pause(),m.render(c>=r?0:-Tj)._zTime=c>=r?1:-1,this._ts))return this._start=g,ZM(this),this.render(e,t,n);this._onUpdate&&!t&&IN(this,`onUpdate`,!0),(o===i&&this._tTime>=this.totalDuration()||!o&&r)&&(g===this._start||Math.abs(h)!==Math.abs(this._ts))&&(this._lock||((e||!a)&&(o===i&&this._ts>0||!o&&this._ts<0)&&UM(this,1),!t&&!(e<0&&!r)&&(o||r||!i)&&(IN(this,o===i&&e>=0?`onComplete`:`onReverseComplete`,!0),this._prom&&!(o0)&&this._prom())))}return this},n.add=function(e,t){var n=this;if(Pj(t)||(t=uN(this,t,e)),!(e instanceof fP)){if(Vj(e))return e.forEach(function(e){return n.add(e,t)}),this;if(Mj(e))return this.addLabel(e,t);if(Nj(e))e=DP.delayedCall(0,e);else return this}return this===e?this:eN(this,e,t)},n.getChildren=function(e,t,n,r){e===void 0&&(e=!0),t===void 0&&(t=!0),n===void 0&&(n=!0),r===void 0&&(r=-wj);for(var i=[],a=this._first;a;)a._start>=r&&(a instanceof DP?t&&i.push(a):(n&&i.push(a),e&&i.push.apply(i,a.getChildren(!0,t,n)))),a=a._next;return i},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return Mj(e)?this.removeLabel(e):Nj(e)?this.killTweensOf(e):(e.parent===this&&HM(this,e),e===this._recent&&(this._recent=this._last),WM(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=EM(ZN.time-(this._ts>0?t/this._ts:(this.totalDuration()-t)/-this._ts))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=uN(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var r=DP.delayedCall(0,t||cM,n);return r.data=`isPause`,this._hasPause=1,eN(this,r,uN(this,e))},n.removePause=function(e){var t=this._first;for(e=uN(this,e);t;)t._start===e&&t.data===`isPause`&&UM(t),t=t._next},n.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)vP!==r[i]&&r[i].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n=[],r=yN(e),i=this._first,a=Pj(t),o;i;)i instanceof DP?OM(i._targets,r)&&(a?(!vP||i._initted&&i._ts)&&i.globalTime(0)<=t&&i.globalTime(i.totalDuration())>t:!t||i.isActive())&&n.push(i):(o=i.getTweensOf(r,t)).length&&n.push.apply(n,o),i=i._next;return n},n.tweenTo=function(e,t){t||={};var n=this,r=uN(n,e),i=t,a=i.startAt,o=i.onStart,s=i.onStartParams,c=i.immediateRender,l,u=DP.to(n,PM({ease:t.ease||`none`,lazy:!1,immediateRender:!1,time:r,overwrite:`auto`,duration:t.duration||Math.abs((r-(a&&`time`in a?a.time:n._time))/n.timeScale())||Tj,onStart:function(){if(n.pause(),!l){var e=t.duration||Math.abs((r-(a&&`time`in a?a.time:n._time))/n.timeScale());u._dur!==e&&sN(u,e,0,1).render(u._time,!0,!0),l=1}o&&o.apply(u,s||[])}},t));return c?u.render(0):u},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,PM({startAt:{time:uN(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return e===void 0&&(e=this._time),FN(this,uN(this,e))},n.previousLabel=function(e){return e===void 0&&(e=this._time),FN(this,uN(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+Tj)},n.shiftChildren=function(e,t,n){n===void 0&&(n=0);var r=this._first,i=this.labels,a;for(e=EM(e);r;)r._start>=n&&(r._start+=e,r._end+=e),r=r._next;if(t)for(a in i)i[a]>=n&&(i[a]+=e);return WM(this)},n.invalidate=function(t){var n=this._first;for(this._lock=0;n;)n.invalidate(t),n=n._next;return e.prototype.invalidate.call(this,t)},n.clear=function(e){e===void 0&&(e=!0);for(var t=this._first,n;t;)n=t._next,this.remove(t),t=n;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),WM(this)},n.totalDuration=function(e){var t=0,n=this,r=n._last,i=wj,a,o,s;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-e:e));if(n._dirty){for(s=n.parent;r;)a=r._prev,r._dirty&&r.totalDuration(),o=r._start,o>i&&n._sort&&r._ts&&!n._lock?(n._lock=1,eN(n,r,o-r._delay,1)._lock=0):i=o,o<0&&r._ts&&(t-=o,(!s&&!n._dp||s&&s.smoothChildTiming)&&(n._start+=EM(o/n._ts),n._time-=o,n._tTime-=o),n.shiftChildren(-o,!1,-1/0),i=0),r._end>t&&r._ts&&(t=r._end),r=a;sN(n,n===Zj&&n._time>t?n._time:t,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(e){if(Zj._ts&&(jM(Zj,XM(e,Zj)),hM=ZN.frame),ZN.frame>=vM){vM+=yj.autoSleep||120;var t=Zj._first;if((!t||!t._ts)&&yj.autoSleep&&ZN._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||ZN.sleep()}}},t}(fP);PM(pP.prototype,{_lock:0,_hasPause:0,_forcing:0});var mP=function(e,t,n,r,i,a,o){var s=new VP(this._pt,e,t,0,1,FP,null,i),c=0,l=0,u,d,f,p,m,h,g,_;for(s.b=n,s.e=r,n+=``,r+=``,(g=~r.indexOf(`random(`))&&(r=MN(r)),a&&(_=[n,r],a(_,e,t),n=_[0],r=_[1]),d=n.match(qj)||[];u=qj.exec(r);)p=u[0],m=r.substring(c,u.index),f?f=(f+1)%5:m.substr(-5)===`rgba(`&&(f=1),p!==d[l++]&&(h=parseFloat(d[l-1])||0,s._pt={_next:s._pt,p:m||l===1?m:`,`,s:h,c:p.charAt(1)===`=`?DM(h,p)-h:parseFloat(p)-h,m:f&&f<4?Math.round:0},c=qj.lastIndex);return s.c=c`)}),_.duration();else{for(x in y={},f)x===`ease`||x===`easeEach`||CP(x,f[x],y,f.easeEach);for(x in y)for(D=y[x].sort(function(e,t){return e.t-t.t}),E=0,v=0;vi-Tj&&!o?i:ea&&(c=a)),p=this._yoyo&&u&1,p&&(c=a-c),f=YM(this._tTime,d),c===r&&!n&&this._initted&&u===f)return this._tTime=s,this;u!==f&&this.vars.repeatRefresh&&!p&&!this._lock&&c!==d&&this._initted&&(this._lock=n=1,this.render(EM(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(nN(this,o?e:c,n,t,s))return this._tTime=0,this;if(r!==this._time&&!(n&&this.vars.repeatRefresh&&u!==f))return this;if(a!==this._dur)return this.render(e,t,n)}if(this._rEase){var g=c0||!s&&this._ts<0)&&UM(this,1),!t&&!(o&&!r)&&(s||r||p)&&(IN(this,s===i?`onComplete`:`onReverseComplete`,!0),this._prom&&!(s0)&&this._prom()))}return this},n.targets=function(){return this._targets},n.invalidate=function(t){return(!t||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},n.resetTo=function(e,t,n,r,i){XN||ZN.wake(),this._ts||this.play();var a=Math.min(this._dur,(this._dp._time-this._start)*this._ts),o;return this._initted||bP(this,a),o=this._ease(a/this._dur),xP(this,e,t,n,r,o,a,i)?this.resetTo(e,t,n,r,1):(QM(this,0),this.parent||VM(this._dp,this,`_first`,`_last`,this._dp._sort?`_start`:0),this.render(0))},n.kill=function(e,t){if(t===void 0&&(t=`all`),!e&&(!t||t===`all`))return this._lazy=this._pt=0,this.parent?LN(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Sj),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,vP&&vP.vars.overwrite!==!0)._first||LN(this),this.parent&&n!==this.timeline.totalDuration()&&sN(this,this._dur*this.timeline._tDur/n,0,1),this}var r=this._targets,i=e?yN(e):r,a=this._ptLookup,o=this._pt,s,c,l,u,d,f,p;if((!t||t===`all`)&&BM(r,i))return t===`all`&&(this._pt=0),LN(this);for(s=this._op=this._op||[],t!==`all`&&(Mj(t)&&(d={},wM(t,function(e){return d[e]=1}),t=d),t=SP(r,t)),p=r.length;p--;)if(~i.indexOf(r[p]))for(d in c=a[p],t===`all`?(s[p]=t,u=c,l={}):(l=s[p]=s[p]||{},u=t),u)f=c&&c[d],f&&((!(`kill`in f.d)||f.d.kill(d)===!0)&&HM(this,f,`_pt`),delete c[d]),l!==`all`&&(l[d]=1);return this._initted&&!this._pt&&o&&LN(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,t){return dN(1,arguments)},t.delayedCall=function(e,n,r,i){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},t.fromTo=function(e,t,n){return dN(2,arguments)},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return Zj.killTweensOf(e,t,n)},t}(fP);PM(DP.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),wM(`staggerTo,staggerFrom,staggerFromTo`,function(e){DP[e]=function(){var t=new pP,n=gN.call(arguments,0);return n.splice(e===`staggerFromTo`?5:4,0,0),t[e].apply(t,n)}});var OP=function(e,t,n){return e[t]=n},kP=function(e,t,n){return e[t](n)},AP=function(e,t,n,r){return e[t](r.fp,n)},jP=function(e,t,n){return e.setAttribute(t,n)},MP=function(e,t){return Nj(e[t])?kP:Fj(e[t])&&e.setAttribute?jP:OP},NP=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},PP=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},FP=function(e,t){var n=t._pt,r=``;if(!e&&t.b)r=t.b;else if(e===1&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},IP=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},LP=function(e,t,n,r){for(var i=this._pt,a;i;)a=i._next,i.p===r&&i.modifier(e,t,n),i=a},RP=function(e){for(var t=this._pt,n,r;t;)r=t._next,t.p===e&&!t.op||t.op===e?HM(this,t,`_pt`):t.dep||(n=1),t=r;return!n},zP=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},BP=function(e){for(var t=e._pt,n,r,i,a;t;){for(n=t._next,r=i;r&&r.pr>t.pr;)r=r._next;(t._prev=r?r._prev:a)?t._prev._next=t:i=t,(t._next=r)?r._prev=t:a=t,t=n}e._pt=i},VP=function(){function e(e,t,n,r,i,a,o,s,c){this.t=t,this.s=r,this.c=i,this.p=n,this.r=a||NP,this.d=o||this,this.set=s||OP,this.pr=c||0,this._next=e,e&&(e._prev=this)}var t=e.prototype;return t.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=zP,this.m=e,this.mt=n,this.tween=t},e}();wM(bM+`parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse`,function(e){return fM[e]=1}),tM.TweenMax=tM.TweenLite=DP,tM.TimelineLite=tM.TimelineMax=pP,Zj=new pP({sortChildren:!1,defaults:bj,autoRemoveChildren:!0,id:`root`,smoothChildTiming:!0}),yj.stringFilter=YN;var HP=[],UP={},WP=[],GP=0,KP=0,qP=function(e){return(UP[e]||WP).map(function(e){return e()})},JP=function(){var e=Date.now(),t=[];e-GP>2&&(qP(`matchMediaInit`),HP.forEach(function(e){var n=e.queries,r=e.conditions,i,a,o,s;for(a in n)i=Qj.matchMedia(n[a]).matches,i&&(o=1),i!==r[a]&&(r[a]=i,s=1);s&&(e.revert(),o&&t.push(e))}),qP(`matchMediaRevert`),t.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),GP=e,qP(`matchMedia`))},YP=function(){function e(e,t){this.selector=t&&bN(t),this.data=[],this._r=[],this.isReverted=!1,this.id=KP++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,n){Nj(e)&&(n=t,t=e,e=Nj);var r=this,i=function(){var e=Cj,i=r.selector,a;return e&&e!==r&&e.data.push(r),n&&(r.selector=bN(n)),Cj=r,a=t.apply(r,arguments),Nj(a)&&r._r.push(a),Cj=e,r.selector=i,r.isReverted=!1,a};return r.last=i,e===Nj?i(r,function(e){return r.add(null,e)}):e?r[e]=i:i},t.ignore=function(e){var t=Cj;Cj=null,e(this),Cj=t},t.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof e?t.push.apply(t,n.getTweens()):n instanceof DP&&!(n.parent&&n.parent.data===`nested`)&&t.push(n)}),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var n=this;if(e?(function(){for(var t=n.getTweens(),r=n.data.length,i;r--;)i=n.data[r],i.data===`isFlip`&&(i.revert(),i.getChildren(!0,!0,!1).forEach(function(e){return t.splice(t.indexOf(e),1)}));for(t.map(function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}}).sort(function(e,t){return t.g-e.g||-1/0}).forEach(function(t){return t.t.revert(e)}),r=n.data.length;r--;)i=n.data[r],i instanceof pP?i.data!==`nested`&&(i.scrollTrigger&&i.scrollTrigger.revert(),i.kill()):!(i instanceof DP)&&i.revert&&i.revert(e);n._r.forEach(function(t){return t(e,n)}),n.isReverted=!0})():this.data.forEach(function(e){return e.kill&&e.kill()}),this.clear(),t)for(var r=HP.length;r--;)HP[r].id===this.id&&HP.splice(r,1)},t.revert=function(e){this.kill(e||{})},e}(),XP=function(){function e(e){this.contexts=[],this.scope=e,Cj&&Cj.data.push(this)}var t=e.prototype;return t.add=function(e,t,n){Ij(e)||(e={matches:e});var r=new YP(0,n||this.scope),i=r.conditions={},a,o,s;for(o in Cj&&!r.selector&&(r.selector=Cj.selector),this.contexts.push(r),t=r.add(`onMatch`,t),r.queries=e,e)o===`all`?s=1:(a=Qj.matchMedia(e[o]),a&&(HP.indexOf(r)<0&&HP.push(r),(i[o]=a.matches)&&(s=1),a.addListener?a.addListener(JP):a.addEventListener(`change`,JP)));return s&&t(r,function(e){return r.add(null,e)}),this},t.revert=function(e){this.kill(e||{})},t.kill=function(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},e}(),ZP={registerPlugin:function(){[...arguments].forEach(function(e){return BN(e)})},timeline:function(e){return new pP(e)},getTweensOf:function(e,t){return Zj.getTweensOf(e,t)},getProperty:function(e,t,n,r){Mj(e)&&(e=yN(e)[0]);var i=SM(e||{}).get,a=n?NM:MM;return n===`native`&&(n=``),e&&(t?a((gM[t]&&gM[t].get||i)(e,t,n,r)):function(t,n,r){return a((gM[t]&&gM[t].get||i)(e,t,n,r))})},quickSetter:function(e,t,n){if(e=yN(e),e.length>1){var r=e.map(function(e){return tF.quickSetter(e,t,n)}),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var a=gM[t],o=SM(e),s=o.harness&&(o.harness.aliases||{})[t]||t,c=a?function(t){var r=new a;RN._pt=0,r.init(e,n?t+n:t,RN,0,[e]),r.render(1,r),RN._pt&&IP(1,RN)}:o.set(e,s);return a?c:function(t){return c(e,s,n?t+n:t,o,1)}},quickTo:function(e,t,n){var r,i=tF.to(e,PM((r={},r[t]=`+=0.1`,r.paused=!0,r.stagger=0,r),n||{})),a=function(e,n,r){return i.resetTo(t,e,n,r)};return a.tween=i,a},isTweening:function(e){return Zj.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=oP(e.ease,bj.ease)),LM(bj,e||{})},config:function(e){return LM(yj,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,a=e.extendTimeline;(r||``).split(`,`).forEach(function(e){return e&&!gM[e]&&!tM[e]&&oM(t+` effect requires `+e+` plugin.`)}),_M[t]=function(e,t,r){return n(yN(e),PM(t||{},i),r)},a&&(pP.prototype[t]=function(e,n,r){return this.add(_M[t](e,Ij(n)?n:(r=n)&&{},this),r)})},registerEase:function(e,t){$N[e]=oP(t)},parseEase:function(e,t){return arguments.length?oP(e,t):$N},getById:function(e){return Zj.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var n=new pP(e),r,i;for(n.smoothChildTiming=Lj(e.smoothChildTiming),Zj.remove(n),n._dp=0,n._time=n._tTime=Zj._time,r=Zj._first;r;)i=r._next,(t||!(!r._dur&&r instanceof DP&&r.vars.onComplete===r._targets[0]))&&eN(n,r,r._start-r._delay),r=i;return eN(Zj,n,0),n},context:function(e,t){return e?new YP(e,t):Cj},matchMedia:function(e){return new XP(e)},matchMediaRefresh:function(){return HP.forEach(function(e){var t=e.conditions,n,r;for(r in t)t[r]&&(t[r]=!1,n=1);n&&e.revert()})||JP()},addEventListener:function(e,t){var n=UP[e]||(UP[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=UP[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},utils:{wrap:AN,wrapYoyo:jN,distribute:SN,random:TN,snap:wN,normalize:ON,getUnit:mN,clamp:hN,splitColor:WN,toArray:yN,selector:bN,mapRange:NN,pipe:EN,unitize:DN,interpolate:PN,shuffle:xN},install:iM,effects:_M,ticker:ZN,updateRoot:pP.updateRoot,plugins:gM,globalTimeline:Zj,core:{PropTween:VP,globals:sM,Tween:DP,Timeline:pP,Animation:fP,getCache:SM,_removeLinkedListItem:HM,reverting:function(){return Sj},context:function(e){return e&&Cj&&(Cj.data.push(e),e._ctx=Cj),Cj},suppressOverwrites:function(e){return xj=e}}};wM(`to,from,fromTo,delayedCall,set,killTweensOf`,function(e){return ZP[e]=DP[e]}),ZN.add(pP.updateRoot),RN=ZP.to({},{duration:0});var QP=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},$P=function(e,t){var n=e._targets,r,i,a;for(r in t)for(i=n.length;i--;)a=e._ptLookup[i][r],(a&&=a.d)&&(a._pt&&(a=QP(a,r)),a&&a.modifier&&a.modifier(t[r],e,n[i],r))},eF=function(e,t){return{name:e,headless:1,rawVars:1,init:function(e,n,r){r._onInit=function(e){var r,i;if(Mj(n)&&(r={},wM(n,function(e){return r[e]=1}),n=r),t){for(i in r={},n)r[i]=t(n[i]);n=r}$P(e,n)}}}},tF=ZP.registerPlugin({name:`attr`,init:function(e,t,n,r,i){var a,o,s;for(a in this.tween=n,t)s=e.getAttribute(a)||``,o=this.add(e,`setAttribute`,(s||0)+``,t[a],r,i,0,0,a),o.op=a,o.b=s,this._props.push(a)},render:function(e,t){for(var n=t._pt;n;)Sj?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:`endArray`,headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},eF(`roundProps`,CN),eF(`modifiers`),eF(`snap`,wN))||ZP;DP.version=pP.version=tF.version=`3.15.0`,rM=1,Rj()&&QN(),$N.Power0,$N.Power1,$N.Power2,$N.Power3,$N.Power4,$N.Linear,$N.Quad,$N.Cubic,$N.Quart,$N.Quint,$N.Strong,$N.Elastic,$N.Back,$N.SteppedEase,$N.Bounce,$N.Sine,$N.Expo,$N.Circ;var nF,rF,iF,aF,oF,sF,cF,lF=function(){return typeof window<`u`},uF={},dF=180/Math.PI,fF=Math.PI/180,pF=Math.atan2,mF=1e8,hF=/([A-Z])/g,gF=/(left|right|width|margin|padding|x)/i,_F=/[\s,\(]\S/,vF={autoAlpha:`opacity,visibility`,scale:`scaleX,scaleY`,alpha:`opacity`},yF=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},bF=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},xF=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},SF=function(e,t){return t.set(t.t,t.p,e===1?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},CF=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},wF=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},TF=function(e,t){return t.set(t.t,t.p,e===1?t.e:t.b,t)},EF=function(e,t,n){return e.style[t]=n},DF=function(e,t,n){return e.style.setProperty(t,n)},OF=function(e,t,n){return e._gsap[t]=n},kF=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},AF=function(e,t,n,r,i){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(i,a)},jF=function(e,t,n,r,i){var a=e._gsap;a[t]=n,a.renderTransform(i,a)},MF=`transform`,NF=MF+`Origin`,PF=function e(t,n){var r=this,i=this.target,a=i.style,o=i._gsap;if(t in uF&&a){if(this.tfm=this.tfm||{},t!==`transform`)t=vF[t]||t,~t.indexOf(`,`)?t.split(`,`).forEach(function(e){return r.tfm[e]=$F(i,e)}):this.tfm[t]=o.x?o[t]:$F(i,t),t===NF&&(this.tfm.zOrigin=o.zOrigin);else return vF.transform.split(`,`).forEach(function(t){return e.call(r,t,n)});if(this.props.indexOf(MF)>=0)return;o.svg&&(this.svgo=i.getAttribute(`data-svg-origin`),this.props.push(NF,n,``)),t=MF}(a||n)&&this.props.push(t,n,a[t])},FF=function(e){e.translate&&(e.removeProperty(`translate`),e.removeProperty(`scale`),e.removeProperty(`rotate`))},IF=function(){var e=this.props,t=this.target,n=t.style,r=t._gsap,i,a;for(i=0;i=0?VF[i]:``)+e},UF=function(){lF()&&window.document&&(nF=window,rF=nF.document,iF=rF.documentElement,oF=zF(`div`)||{style:{}},zF(`div`),MF=HF(MF),NF=MF+`Origin`,oF.style.cssText=`border-width:0;line-height:0;position:absolute;padding:0`,RF=!!HF(`perspective`),cF=tF.core.reverting,aF=1)},WF=function(e){var t=e.ownerSVGElement,n=zF(`svg`,t&&t.getAttribute(`xmlns`)||`http://www.w3.org/2000/svg`),r=e.cloneNode(!0),i;r.style.display=`block`,n.appendChild(r),iF.appendChild(n);try{i=r.getBBox()}catch{}return n.removeChild(r),iF.removeChild(n),i},GF=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},KF=function(e){var t,n;try{t=e.getBBox()}catch{t=WF(e),n=1}return t&&(t.width||t.height)||n||(t=WF(e)),t&&!t.width&&!t.x&&!t.y?{x:+GF(e,[`x`,`cx`,`x1`])||0,y:+GF(e,[`y`,`cy`,`y1`])||0,width:0,height:0}:t},qF=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&KF(e))},JF=function(e,t){if(t){var n=e.style,r;t in uF&&t!==NF&&(t=MF),n.removeProperty?(r=t.substr(0,2),(r===`ms`||t.substr(0,6)===`webkit`)&&(t=`-`+t),n.removeProperty(r===`--`?t:t.replace(hF,`-$1`).toLowerCase())):n.removeAttribute(t)}},YF=function(e,t,n,r,i,a){var o=new VP(e._pt,t,n,0,1,a?TF:wF);return e._pt=o,o.b=r,o.e=i,e._props.push(n),o},XF={deg:1,rad:1,turn:1},ZF={grid:1,flex:1},QF=function e(t,n,r,i){var a=parseFloat(r)||0,o=(r+``).trim().substr((a+``).length)||`px`,s=oF.style,c=gF.test(n),l=t.tagName.toLowerCase()===`svg`,u=(l?`client`:`offset`)+(c?`Width`:`Height`),d=100,f=i===`px`,p=i===`%`,m,h,g,_;if(i===o||!a||XF[i]||XF[o])return a;if(o!==`px`&&!f&&(a=e(t,n,r,`px`)),_=t.getCTM&&qF(t),(p||o===`%`)&&(uF[n]||~n.indexOf(`adius`)))return m=_?t.getBBox()[c?`width`:`height`]:t[u],TM(p?a/m*d:a/100*m);if(s[c?`width`:`height`]=d+(f?o:i),h=i!==`rem`&&~n.indexOf(`adius`)||i===`em`&&t.appendChild&&!l?t:t.parentNode,_&&(h=(t.ownerSVGElement||{}).parentNode),(!h||h===rF||!h.appendChild)&&(h=rF.body),g=h._gsap,g&&p&&g.width&&c&&g.time===ZN.time&&!g.uncache)return TM(a/g.width*d);if(p&&(n===`height`||n===`width`)){var v=t.style[n];t.style[n]=d+i,m=t[u],v?t.style[n]=v:JF(t,n)}else(p||o===`%`)&&!ZF[BF(h,`display`)]&&(s.position=BF(t,`position`)),h===t&&(s.position=`static`),h.appendChild(oF),m=oF[u],h.removeChild(oF),s.position=`absolute`;return c&&p&&(g=SM(h),g.time=ZN.time,g.width=h[u]),TM(f?m*a/d:m&&a?d/m*a:0)},$F=function(e,t,n,r){var i;return aF||UF(),t in vF&&t!==`transform`&&(t=vF[t],~t.indexOf(`,`)&&(t=t.split(`,`)[0])),uF[t]&&t!==`transform`?(i=dI(e,r),i=t===`transformOrigin`?i.svg?i.origin:fI(BF(e,NF))+` `+i.zOrigin+`px`:i[t]):(i=e.style[t],(!i||i===`auto`||r||~(i+``).indexOf(`calc(`))&&(i=iI[t]&&iI[t](e,t,n)||BF(e,t)||CM(e,t)||+(t===`opacity`))),n&&!~(i+``).trim().indexOf(` `)?QF(e,t,i,n)+n:i},eI=function(e,t,n,r){if(!n||n===`none`){var i=HF(t,e,1),a=i&&BF(e,i,1);a&&a!==n?(t=i,n=a):t===`borderColor`&&(n=BF(e,`borderTopColor`))}var o=new VP(this._pt,e.style,t,0,1,FP),s=0,c=0,l,u,d,f,p,m,h,g,_,v,y,b;if(o.b=n,o.e=r,n+=``,r+=``,r.substring(0,6)===`var(--`&&(r=BF(e,r.substring(4,r.indexOf(`)`)))),r===`auto`&&(m=e.style[t],e.style[t]=r,r=BF(e,t)||r,m?e.style[t]=m:JF(e,t)),l=[n,r],YN(l),n=l[0],r=l[1],d=n.match(Kj)||[],b=r.match(Kj)||[],b.length){for(;u=Kj.exec(r);)h=u[0],_=r.substring(s,u.index),p?p=(p+1)%5:(_.substr(-5)===`rgba(`||_.substr(-5)===`hsla(`)&&(p=1),h!==(m=d[c++]||``)&&(f=parseFloat(m)||0,y=m.substr((f+``).length),h.charAt(1)===`=`&&(h=DM(f,h)+y),g=parseFloat(h),v=h.substr((g+``).length),s=Kj.lastIndex-v.length,v||(v=v||yj.units[t]||y,s===r.length&&(r+=v,o.e+=v)),y!==v&&(f=QF(e,t,m,v)||0),o._pt={_next:o._pt,p:_||c===1?_:`,`,s:f,c:g-f,m:p&&p<4||t===`zIndex`?Math.round:0});o.c=s-1;)o=i[c],uF[o]&&(s=1,o=o===`transformOrigin`?NF:MF),JF(n,o);s&&(JF(n,MF),a&&(a.svg&&n.removeAttribute(`transform`),r.scale=r.rotate=r.translate=`none`,dI(n,1),a.uncache=1,FF(r)))}},iI={clearProps:function(e,t,n,r,i){if(i.data!==`isFromStart`){var a=e._pt=new VP(e._pt,t,n,0,0,rI);return a.u=r,a.pr=-10,a.tween=i,e._props.push(n),1}}},aI=[1,0,0,1,0,0],oI={},sI=function(e){return e===`matrix(1, 0, 0, 1, 0, 0)`||e===`none`||!e},cI=function(e){var t=BF(e,MF);return sI(t)?aI:t.substr(7).match(Gj).map(TM)},lI=function(e,t){var n=e._gsap||SM(e),r=e.style,i=cI(e),a,o,s,c;return n.svg&&e.getAttribute(`transform`)?(s=e.transform.baseVal.consolidate().matrix,i=[s.a,s.b,s.c,s.d,s.e,s.f],i.join(`,`)===`1,0,0,1,0,0`?aI:i):(i===aI&&!e.offsetParent&&e!==iF&&!n.svg&&(s=r.display,r.display=`block`,a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(c=1,o=e.nextElementSibling,iF.appendChild(e)),i=cI(e),s?r.display=s:JF(e,`display`),c&&(o?a.insertBefore(e,o):a?a.appendChild(e):iF.removeChild(e))),t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},uI=function(e,t,n,r,i,a){var o=e._gsap,s=i||lI(e,!0),c=o.xOrigin||0,l=o.yOrigin||0,u=o.xOffset||0,d=o.yOffset||0,f=s[0],p=s[1],m=s[2],h=s[3],g=s[4],_=s[5],v=t.split(` `),y=parseFloat(v[0])||0,b=parseFloat(v[1])||0,x,S,C,w;n?s!==aI&&(S=f*h-p*m)&&(C=h/S*y+b*(-m/S)+(m*_-h*g)/S,w=y*(-p/S)+f/S*b-(f*_-p*g)/S,y=C,b=w):(x=KF(e),y=x.x+(~v[0].indexOf(`%`)?y/100*x.width:y),b=x.y+(~(v[1]||v[0]).indexOf(`%`)?b/100*x.height:b)),r||r!==!1&&o.smooth?(g=y-c,_=b-l,o.xOffset=u+(g*f+_*m)-g,o.yOffset=d+(g*p+_*h)-_):o.xOffset=o.yOffset=0,o.xOrigin=y,o.yOrigin=b,o.smooth=!!r,o.origin=t,o.originIsAbsolute=!!n,e.style[NF]=`0px 0px`,a&&(YF(a,o,`xOrigin`,c,y),YF(a,o,`yOrigin`,l,b),YF(a,o,`xOffset`,u,o.xOffset),YF(a,o,`yOffset`,d,o.yOffset)),e.setAttribute(`data-svg-origin`,y+` `+b)},dI=function(e,t){var n=e._gsap||new dP(e);if(`x`in n&&!t&&!n.uncache)return n;var r=e.style,i=n.scaleX<0,a=`px`,o=`deg`,s=getComputedStyle(e),c=BF(e,NF)||`0`,l=u=d=m=h=g=_=v=y=0,u,d,f=p=1,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,ee,M,te,N,P,ne,re,ie,ae;return n.svg=!!(e.getCTM&&qF(e)),s.translate&&((s.translate!==`none`||s.scale!==`none`||s.rotate!==`none`)&&(r[MF]=(s.translate===`none`?``:`translate3d(`+(s.translate+` 0 0`).split(` `).slice(0,3).join(`, `)+`) `)+(s.rotate===`none`?``:`rotate(`+s.rotate+`) `)+(s.scale===`none`?``:`scale(`+s.scale.split(` `).join(`,`)+`) `)+(s[MF]===`none`?``:s[MF])),r.scale=r.rotate=r.translate=`none`),S=lI(e,n.svg),n.svg&&(n.uncache?(M=e.getBBox(),c=n.xOrigin-M.x+`px `+(n.yOrigin-M.y)+`px`,ee=``):ee=!t&&e.getAttribute(`data-svg-origin`),uI(e,ee||c,!!ee||n.originIsAbsolute,n.smooth!==!1,S)),b=n.xOrigin||0,x=n.yOrigin||0,S!==aI&&(E=S[0],D=S[1],O=S[2],k=S[3],l=A=S[4],u=j=S[5],S.length===6?(f=Math.sqrt(E*E+D*D),p=Math.sqrt(k*k+O*O),m=E||D?pF(D,E)*dF:0,_=O||k?pF(O,k)*dF+m:0,_&&(p*=Math.abs(Math.cos(_*fF))),n.svg&&(l-=b-(b*E+x*O),u-=x-(b*D+x*k))):(ae=S[6],re=S[7],N=S[8],P=S[9],ne=S[10],ie=S[11],l=S[12],u=S[13],d=S[14],C=pF(ae,ne),h=C*dF,C&&(w=Math.cos(-C),T=Math.sin(-C),ee=A*w+N*T,M=j*w+P*T,te=ae*w+ne*T,N=A*-T+N*w,P=j*-T+P*w,ne=ae*-T+ne*w,ie=re*-T+ie*w,A=ee,j=M,ae=te),C=pF(-O,ne),g=C*dF,C&&(w=Math.cos(-C),T=Math.sin(-C),ee=E*w-N*T,M=D*w-P*T,te=O*w-ne*T,ie=k*T+ie*w,E=ee,D=M,O=te),C=pF(D,E),m=C*dF,C&&(w=Math.cos(C),T=Math.sin(C),ee=E*w+D*T,M=A*w+j*T,D=D*w-E*T,j=j*w-A*T,E=ee,A=M),h&&Math.abs(h)+Math.abs(m)>359.9&&(h=m=0,g=180-g),f=TM(Math.sqrt(E*E+D*D+O*O)),p=TM(Math.sqrt(j*j+ae*ae)),C=pF(A,j),_=Math.abs(C)>2e-4?C*dF:0,y=ie?1/(ie<0?-ie:ie):0),n.svg&&(ee=e.getAttribute(`transform`),n.forceCSS=e.setAttribute(`transform`,``)||!sI(BF(e,MF)),ee&&e.setAttribute(`transform`,ee))),Math.abs(_)>90&&Math.abs(_)<270&&(i?(f*=-1,_+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,_+=_<=0?180:-180)),t||=n.uncache,n.x=l-((n.xPercent=l&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-l)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+a,n.y=u-((n.yPercent=u&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-u)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+a,n.z=d+a,n.scaleX=TM(f),n.scaleY=TM(p),n.rotation=TM(m)+o,n.rotationX=TM(h)+o,n.rotationY=TM(g)+o,n.skewX=_+o,n.skewY=v+o,n.transformPerspective=y+a,(n.zOrigin=parseFloat(c.split(` `)[2])||!t&&n.zOrigin||0)&&(r[NF]=fI(c)),n.xOffset=n.yOffset=0,n.force3D=yj.force3D,n.renderTransform=n.svg?yI:RF?vI:mI,n.uncache=0,n},fI=function(e){return(e=e.split(` `))[0]+` `+e[1]},pI=function(e,t,n){var r=mN(t);return TM(parseFloat(t)+parseFloat(QF(e,`x`,n+`px`,r)))+r},mI=function(e,t){t.z=`0px`,t.rotationY=t.rotationX=`0deg`,t.force3D=0,vI(e,t)},hI=`0deg`,gI=`0px`,_I=`) `,vI=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,a=n.x,o=n.y,s=n.z,c=n.rotation,l=n.rotationY,u=n.rotationX,d=n.skewX,f=n.skewY,p=n.scaleX,m=n.scaleY,h=n.transformPerspective,g=n.force3D,_=n.target,v=n.zOrigin,y=``,b=g===`auto`&&e&&e!==1||g===!0;if(v&&(u!==hI||l!==hI)){var x=parseFloat(l)*fF,S=Math.sin(x),C=Math.cos(x),w;x=parseFloat(u)*fF,w=Math.cos(x),a=pI(_,a,S*w*-v),o=pI(_,o,-Math.sin(x)*-v),s=pI(_,s,C*w*-v+v)}h!==gI&&(y+=`perspective(`+h+_I),(r||i)&&(y+=`translate(`+r+`%, `+i+`%) `),(b||a!==gI||o!==gI||s!==gI)&&(y+=s!==gI||b?`translate3d(`+a+`, `+o+`, `+s+`) `:`translate(`+a+`, `+o+_I),c!==hI&&(y+=`rotate(`+c+_I),l!==hI&&(y+=`rotateY(`+l+_I),u!==hI&&(y+=`rotateX(`+u+_I),(d!==hI||f!==hI)&&(y+=`skew(`+d+`, `+f+_I),(p!==1||m!==1)&&(y+=`scale(`+p+`, `+m+_I),_.style[MF]=y||`translate(0, 0)`},yI=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,a=n.x,o=n.y,s=n.rotation,c=n.skewX,l=n.skewY,u=n.scaleX,d=n.scaleY,f=n.target,p=n.xOrigin,m=n.yOrigin,h=n.xOffset,g=n.yOffset,_=n.forceCSS,v=parseFloat(a),y=parseFloat(o),b,x,S,C,w;s=parseFloat(s),c=parseFloat(c),l=parseFloat(l),l&&(l=parseFloat(l),c+=l,s+=l),s||c?(s*=fF,c*=fF,b=Math.cos(s)*u,x=Math.sin(s)*u,S=Math.sin(s-c)*-d,C=Math.cos(s-c)*d,c&&(l*=fF,w=Math.tan(c-l),w=Math.sqrt(1+w*w),S*=w,C*=w,l&&(w=Math.tan(l),w=Math.sqrt(1+w*w),b*=w,x*=w)),b=TM(b),x=TM(x),S=TM(S),C=TM(C)):(b=u,C=d,x=S=0),(v&&!~(a+``).indexOf(`px`)||y&&!~(o+``).indexOf(`px`))&&(v=QF(f,`x`,a,`px`),y=QF(f,`y`,o,`px`)),(p||m||h||g)&&(v=TM(v+p-(p*b+m*S)+h),y=TM(y+m-(p*x+m*C)+g)),(r||i)&&(w=f.getBBox(),v=TM(v+r/100*w.width),y=TM(y+i/100*w.height)),w=`matrix(`+b+`,`+x+`,`+S+`,`+C+`,`+v+`,`+y+`)`,f.setAttribute(`transform`,w),_&&(f.style[MF]=w)},bI=function(e,t,n,r,i){var a=360,o=Mj(i),s=parseFloat(i)*(o&&~i.indexOf(`rad`)?dF:1)-r,c=r+s+`deg`,l,u;return o&&(l=i.split(`_`)[1],l===`short`&&(s%=a,s!==s%(a/2)&&(s+=s<0?a:-a)),l===`cw`&&s<0?s=(s+a*mF)%a-~~(s/a)*a:l===`ccw`&&s>0&&(s=(s-a*mF)%a-~~(s/a)*a)),e._pt=u=new VP(e._pt,t,n,r,s,bF),u.e=c,u.u=`deg`,e._props.push(n),u},xI=function(e,t){for(var n in t)e[n]=t[n];return e},SI=function(e,t,n){var r=xI({},n._gsap),i=`perspective,force3D,transformOrigin,svgOrigin`,a=n.style,o,s,c,l,u,d,f,p;for(s in r.svg?(c=n.getAttribute(`transform`),n.setAttribute(`transform`,``),a[MF]=t,o=dI(n,1),JF(n,MF),n.setAttribute(`transform`,c)):(c=getComputedStyle(n)[MF],a[MF]=t,o=dI(n,1),a[MF]=c),uF)c=r[s],l=o[s],c!==l&&i.indexOf(s)<0&&(f=mN(c),p=mN(l),u=f===p?parseFloat(c):QF(n,s,c,p),d=parseFloat(l),e._pt=new VP(e._pt,o,s,u,d-u,yF),e._pt.u=p||0,e._props.push(s));xI(o,r)};wM(`padding,margin,Width,Radius`,function(e,t){var n=`Top`,r=`Right`,i=`Bottom`,a=`Left`,o=(t<3?[n,r,i,a]:[n+a,n+r,i+r,i+a]).map(function(n){return t<2?e+n:`border`+n+e});iI[t>1?`border`+e:e]=function(e,t,n,r,i){var a,s;if(arguments.length<4)return a=o.map(function(t){return $F(e,t,n)}),s=a.join(` `),s.split(a[0]).length===5?a[0]:s;a=(r+``).split(` `),s={},o.forEach(function(e,t){return s[e]=a[t]=a[t]||a[(t-1)/2|0]}),e.init(t,s,i)}});var CI={name:`css`,register:UF,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,i){var a=this._props,o=e.style,s=n.vars.startAt,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;for(m in aF||UF(),this.styles=this.styles||LF(e),C=this.styles.props,this.tween=n,t)if(m!==`autoRound`&&(l=t[m],!(gM[m]&&_P(m,t,n,r,e,i)))){if(f=typeof l,p=iI[m],f===`function`&&(l=l.call(n,r,e,i),f=typeof l),f===`string`&&~l.indexOf(`random(`)&&(l=MN(l)),p)p(this,e,m,l,n)&&(S=1);else if(m.substr(0,2)===`--`)c=(getComputedStyle(e).getPropertyValue(m)+``).trim(),l+=``,qN.lastIndex=0,qN.test(c)||(h=mN(c),g=mN(l),g?h!==g&&(c=QF(e,m,c,g)+g):h&&(l+=h)),this.add(o,`setProperty`,c,l,r,i,0,0,m),a.push(m),C.push(m,0,o[m]);else if(f!==`undefined`){if(s&&m in s?(c=typeof s[m]==`function`?s[m].call(n,r,e,i):s[m],Mj(c)&&~c.indexOf(`random(`)&&(c=MN(c)),mN(c+``)||c===`auto`||(c+=yj.units[m]||mN($F(e,m))||``),(c+``).charAt(1)===`=`&&(c=$F(e,m))):c=$F(e,m),d=parseFloat(c),_=f===`string`&&l.charAt(1)===`=`&&l.substr(0,2),_&&(l=l.substr(2)),u=parseFloat(l),m in vF&&(m===`autoAlpha`&&(d===1&&$F(e,`visibility`)===`hidden`&&u&&(d=0),C.push(`visibility`,0,o.visibility),YF(this,o,`visibility`,d?`inherit`:`hidden`,u?`inherit`:`hidden`,!u)),m!==`scale`&&m!==`transform`&&(m=vF[m],~m.indexOf(`,`)&&(m=m.split(`,`)[0]))),v=m in uF,v){if(this.styles.save(m),w=l,f===`string`&&l.substring(0,6)===`var(--`){if(l=BF(e,l.substring(4,l.indexOf(`)`))),l.substring(0,5)===`calc(`){var T=e.style.perspective;e.style.perspective=l,l=BF(e,`perspective`),T?e.style.perspective=T:JF(e,`perspective`)}u=parseFloat(l)}if(y||(b=e._gsap,b.renderTransform&&!t.parseTransform||dI(e,t.parseTransform),x=t.smoothOrigin!==!1&&b.smooth,y=this._pt=new VP(this._pt,o,MF,0,1,b.renderTransform,b,0,-1),y.dep=1),m===`scale`)this._pt=new VP(this._pt,b,`scaleY`,b.scaleY,(_?DM(b.scaleY,_+u):u)-b.scaleY||0,yF),this._pt.u=0,a.push(`scaleY`,m),m+=`X`;else if(m===`transformOrigin`){C.push(NF,0,o[NF]),l=nI(l),b.svg?uI(e,l,0,x,0,this):(g=parseFloat(l.split(` `)[2])||0,g!==b.zOrigin&&YF(this,b,`zOrigin`,b.zOrigin,g),YF(this,o,m,fI(c),fI(l)));continue}else if(m===`svgOrigin`){uI(e,l,1,x,0,this);continue}else if(m in oI){bI(this,b,m,d,_?DM(d,_+l):l);continue}else if(m===`smoothOrigin`){YF(this,b,`smooth`,b.smooth,l);continue}else if(m===`force3D`){b[m]=l;continue}else if(m===`transform`){SI(this,l,e);continue}}else m in o||(m=HF(m)||m);if(v||(u||u===0)&&(d||d===0)&&!_F.test(l)&&m in o)h=(c+``).substr((d+``).length),u||=0,g=mN(l)||(m in yj.units?yj.units[m]:h),h!==g&&(d=QF(e,m,c,g)),this._pt=new VP(this._pt,v?b:o,m,d,(_?DM(d,_+u):u)-d,!v&&(g===`px`||m===`zIndex`)&&t.autoRound!==!1?CF:yF),this._pt.u=g||0,v&&w!==l?(this._pt.b=c,this._pt.e=w,this._pt.r=SF):h!==g&&g!==`%`&&(this._pt.b=c,this._pt.r=xF);else if(m in o)eI.call(this,e,m,c,_?_+l:l);else if(m in e)this.add(e,m,c||e[m],_?_+l:l,r,i);else if(m!==`parseTransform`){aM(m,l);continue}v||(m in o?C.push(m,0,o[m]):typeof e[m]==`function`?C.push(m,2,e[m]()):C.push(m,1,c||e[m])),a.push(m)}}S&&BP(this)},render:function(e,t){if(t.tween._time||!cF())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:$F,aliases:vF,getSetter:function(e,t,n){var r=vF[t];return r&&r.indexOf(`,`)<0&&(t=r),t in uF&&t!==NF&&(e._gsap.x||$F(e,`x`))?n&&sF===n?t===`scale`?kF:OF:(sF=n||{})&&(t===`scale`?AF:jF):e.style&&!Fj(e.style[t])?EF:~t.indexOf(`-`)?DF:MP(e,t)},core:{_removeProperty:JF,_getMatrix:lI}};tF.utils.checkPrefix=HF,tF.core.getStyleSaver=LF,(function(e,t,n,r){var i=wM(e+`,`+t+`,`+n,function(e){uF[e]=1});wM(t,function(e){yj.units[e]=`deg`,oI[e]=1}),vF[i[13]]=e+`,`+t,wM(r,function(e){var t=e.split(`:`);vF[t[1]]=i[t[0]]})})(`x,y,z,scale,scaleX,scaleY,xPercent,yPercent`,`rotation,rotationX,rotationY,skewX,skewY`,`transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective`,`0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY`),wM(`x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective`,function(e){yj.units[e]=`px`}),tF.registerPlugin(CI);var wI=tF.registerPlugin(CI)||tF;wI.core.Tween;var TI={x:Kt(0),y:Kt(0),initialized:!1,cleanup:null},EI=()=>{TI.initialized||(TI.initialized=!0,TI.cleanup=XC(window,`mousemove`,e=>{TI.x.value=e.clientX,TI.y.value=e.clientY}))},DI=e=>{let t=e?.smoothFactor??.1,n=e?.normalize??!1,r=e?.onUpdate,{width:i,height:a}=uw(),o=Kt(0),s=Kt(0);EI();let c=()=>n?TI.x.value/i.value:TI.x.value,l=()=>n?TI.y.value/a.value:TI.y.value,u;return lr(()=>{u&&u.kill,u=wI.to({x:o.value,y:s.value},{duration:1,ease:`linear`,repeat:-1,onUpdate:()=>{let e=wI.utils.interpolate(o.value,c(),t),n=wI.utils.interpolate(s.value,l(),t);o.value=e,s.value=n,r?.({sx:o.value,sy:s.value})}})}),fr(()=>{u?.kill(),TI.cleanup(),TI.initialized=!1}),{sx:o,sy:s,rawX:TI.x,rawY:TI.y}},OI={__name:`Webgl`,async setup(e){let t,n,{width:r,height:i}=uw();DI({normalize:!0,onUpdate:({sx:e,sy:t})=>{a.value.material.uniforms.u_mouse.value=[e,1-t]}});let a=qt(),{state:o}=([t,n]=Nr(()=>fj([`/drops/noise-shader/fill-1.jpg`])),t=await t,n(),t),s=Za(()=>[o.value.source?.data.naturalWidth,o.value.source?.data.naturalHeight]),c={fragmentShader:hj,vertexShader:gj,uniforms:{u_time:{value:0},u_resolution:{value:[r.value,i.value]},u_grid_size:{value:120},u_texture:{value:o.value},u_texture_resolution:{value:s.value},u_mouse:{value:[0,0]}}},{onRender:l}=$k();return l(({elapsed:e})=>{a.value.material.uniforms.u_time.value=e/1e3,a.value.material.uniforms.u_resolution.value=[r.value,i.value],a.value.material.uniforms.u_texture_resolution.value=s.value}),(e,t)=>{let n=yr(`TresPlaneGeometry`),r=yr(`TresShaderMaterial`),i=yr(`TresMesh`);return oa(),fa(i,{ref_key:`plane`,ref:a},{default:Mn(()=>[va(n,{args:[1,1]}),va(r,me(ba(c)),null,16)]),_:1},512)}}},kI={class:`noise-shader`},AI={__name:`NoiseShader`,setup(e){return(e,t)=>(oa(),da(`div`,kI,[va(mj,null,{default:Mn(()=>[(oa(),fa(Ui,null,{default:Mn(()=>[va(OI)]),_:1}))]),_:1})]))}},jI={class:`drop theme-light`};Uo({__name:`App`,setup(e){return(e,t)=>(oa(),da(`main`,jI,[va(AI)]))}}).mount(`#app`); \ No newline at end of file diff --git a/app/public/drops/noise-shader/assets/index-B21avM17.css b/app/public/drops/noise-shader/assets/index-B21avM17.css new file mode 100644 index 0000000..79113d9 --- /dev/null +++ b/app/public/drops/noise-shader/assets/index-B21avM17.css @@ -0,0 +1 @@ +:root{--ivory:#fefdfc;--ivory-shade:#ecebea;--sand:#f7f4ef;--sand-shade:#b9b7b3;--charcoal:#181818;--charcoal-shade:#2a2a2a;--forest:#053f0a;--forest-shade:#f6fff6;--clay:#fa3812;--clay-shade:#ffefec;--sea:#1253fa;--sea-shade:#f0f8ff;--grey-700:#565656;--grey-600:#747474;--grey-500:#a3a3a3;--grey-400:#d1d1d1}:root .theme-light{--theme-bg:#fefdfc;--theme-fg:#181818;--theme-layout:#f7f4ef;--theme-grey:#747474;--theme-shade:#ecebea;--theme-contrast:#fa3812}:root .theme-dark{--theme-bg:#181818;--theme-fg:#fefdfc;--theme-layout:#f7f4ef;--theme-grey:#a3a3a3;--theme-shade:#2a2a2a;--theme-contrast:#fa3812}:root{--ease-in-quad:cubic-bezier(.55, .085, .68, .53);--ease-in-cubic:cubic-bezier(.55, .055, .675, .19);--ease-in-quart:cubic-bezier(.895, .03, .685, .22);--ease-in-quint:cubic-bezier(.755, .05, .855, .06);--ease-in-expo:cubic-bezier(.95, .05, .795, .035);--ease-in-circ:cubic-bezier(.6, .04, .98, .335);--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-cubic:cubic-bezier(.215, .61, .355, 1);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-quint:cubic-bezier(.23, 1, .32, 1);--ease-out-expo:cubic-bezier(.19, 1, .22, 1);--ease-out-circ:cubic-bezier(.075, .82, .165, 1);--ease-in-out-quad:cubic-bezier(.455, .03, .515, .955);--ease-in-out-cubic:cubic-bezier(.645, .045, .355, 1);--ease-in-out-quart:cubic-bezier(.77, 0, .175, 1);--ease-in-out-quint:cubic-bezier(.86, 0, .07, 1);--ease-in-out-expo:cubic-bezier(1, 0, 0, 1);--ease-in-out-circ:cubic-bezier(.785, .135, .15, .86)}:where(:not(html,iframe,canvas,img,svg,video,audio):not(svg *,symbol *)){all:unset;display:revert}*,:before,:after{box-sizing:border-box}a,button{cursor:revert}img{max-block-size:100%;max-inline-size:100%}table{border-collapse:collapse}input,textarea{-webkit-user-select:auto}textarea{white-space:revert}meter{appearance:revert}:where(pre){all:revert}::placeholder{color:unset}::marker{content:initial}:where([hidden]){display:none}:where([contenteditable]:not([contenteditable=false])){-moz-user-modify:read-write;-webkit-user-modify:read-write;overflow-wrap:break-word;-webkit-line-break:after-white-space;-webkit-user-select:auto}:where([draggable=true]){-webkit-user-drag:element}:where(dialog:modal){all:revert}@font-face{font-family:Instrument Serif;font-style:italic;font-weight:400;src:url(/drops/noise-shader/assets/instrument-serif-italic-Cnq-0GR0.woff2)format("woff2"),url(/drops/noise-shader/assets/instrument-serif-italic-CpREEq8K.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:400;src:url(/drops/noise-shader/assets/hanken-grotesk-BB3emo1n.woff2)format("woff2"),url(/drops/noise-shader/assets/hanken-grotesk-NweiADIQ.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:italic;font-weight:400;src:url(/drops/noise-shader/assets/hanken-grotesk-italic-jl8TIPSn.woff2)format("woff2"),url(/drops/noise-shader/assets/hanken-grotesk-italic-C_HjJa0S.woff)format("woff")}@font-face{font-family:Hanken Grotesk;font-style:normal;font-weight:600;src:url(/drops/noise-shader/assets/hanken-grotesk-semibold-TK-BXOrb.woff2)format("woff2"),url(/drops/noise-shader/assets/hanken-grotesk-semibold-vPR5A_Tb.woff)format("woff")}@font-face{font-family:Iosevka Charon Mono;font-style:normal;font-weight:700;src:url(/drops/noise-shader/assets/iosevka-charon-mono-bold-1nweGISG.woff2)format("woff2"),url(/drops/noise-shader/assets/iosevka-charon-mono-bold-DN5oOlAE.woff)format("woff")}:root{--font-serif:"Instrument Serif", serif;--font-sans:"Hanken Grotesk", sans-serif;--font-mono:"Iosevka Charon Mono", monospace;--layout-column-count:12;--layout-column-gap:20px;--layout-margin:20px;--layout-width:calc(100vw - (2 * var(--layout-margin)));--layout-column-width:calc(( var(--layout-width) - ((var(--layout-column-count) - 1) * var(--layout-column-gap)) ) / var(--layout-column-count))}.layout-block,.layout-grid{padding-left:var(--layout-margin);padding-right:var(--layout-margin);width:100%}.layout-grid{grid-template-columns:repeat(var(--layout-column-count), minmax(0, 1fr));grid-gap:var(--layout-column-gap);display:grid}html,html *{scrollbar-width:none!important;-ms-overflow-style:none!important}html::-webkit-scrollbar{width:0!important;height:0!important}html ::-webkit-scrollbar{width:0!important;height:0!important}:root{font-family:var(--font-sans), Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;background:var(--ivory);font-synthesis:none;text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{min-height:100vh;margin:0}.h1,h1{font-family:var(--font-serif);font-size:max(8vw,128px);font-style:italic;font-weight:400;line-height:1}.h2,h2{font-family:var(--font-serif);font-size:max(4vw,64px);font-style:italic;font-weight:400;line-height:1}.h3,h3{font-family:var(--font-serif);font-size:max(3vw,48px);font-style:italic;font-weight:400;line-height:1}.h4,h4{font-family:var(--font-serif);font-size:max(2vw,32px);font-style:italic;font-weight:400;line-height:1}.p,p,a,li{font-family:var(--font-sans);font-size:max(1vw,16px);font-weight:400;line-height:1.25}.label,label,button,pre{font-family:var(--font-mono);text-transform:uppercase;font-size:max(.875vw,14px);font-weight:700;line-height:1}.bold{font-weight:700}#app{min-height:100vh}button{cursor:pointer}::selection{color:var(--theme-bg);background:var(--theme-fg)}::selection{color:var(--theme-bg);background:var(--theme-fg)}.webgl-canvas{position:absolute;inset:0}.webgl-canvas:not(.controls){pointer-events:none}.webgl-canvas:not(.controls) .sticky canvas{pointer-events:none!important}.noise-shader{height:100%}main.drop{background:var(--theme-bg);color:var(--theme-fg);height:100vh} diff --git a/app/public/drops/noise-shader/assets/instrument-serif-italic-Cnq-0GR0.woff2 b/app/public/drops/noise-shader/assets/instrument-serif-italic-Cnq-0GR0.woff2 new file mode 100644 index 0000000..aef8321 Binary files /dev/null and b/app/public/drops/noise-shader/assets/instrument-serif-italic-Cnq-0GR0.woff2 differ diff --git a/app/public/drops/noise-shader/assets/instrument-serif-italic-CpREEq8K.woff b/app/public/drops/noise-shader/assets/instrument-serif-italic-CpREEq8K.woff new file mode 100644 index 0000000..4dc470f Binary files /dev/null and b/app/public/drops/noise-shader/assets/instrument-serif-italic-CpREEq8K.woff differ diff --git a/app/public/drops/noise-shader/assets/iosevka-charon-mono-bold-1nweGISG.woff2 b/app/public/drops/noise-shader/assets/iosevka-charon-mono-bold-1nweGISG.woff2 new file mode 100644 index 0000000..eb7f237 Binary files /dev/null and b/app/public/drops/noise-shader/assets/iosevka-charon-mono-bold-1nweGISG.woff2 differ diff --git a/app/public/drops/noise-shader/assets/iosevka-charon-mono-bold-DN5oOlAE.woff b/app/public/drops/noise-shader/assets/iosevka-charon-mono-bold-DN5oOlAE.woff new file mode 100644 index 0000000..f2fe83d Binary files /dev/null and b/app/public/drops/noise-shader/assets/iosevka-charon-mono-bold-DN5oOlAE.woff differ diff --git a/app/public/drops/noise-shader/favicon.png b/app/public/drops/noise-shader/favicon.png new file mode 100644 index 0000000..792433d Binary files /dev/null and b/app/public/drops/noise-shader/favicon.png differ diff --git a/app/public/drops/noise-shader/fill-1.jpg b/app/public/drops/noise-shader/fill-1.jpg new file mode 100644 index 0000000..7ee955a Binary files /dev/null and b/app/public/drops/noise-shader/fill-1.jpg differ diff --git a/app/public/drops/noise-shader/index.html b/app/public/drops/noise-shader/index.html new file mode 100644 index 0000000..e59fc82 --- /dev/null +++ b/app/public/drops/noise-shader/index.html @@ -0,0 +1,14 @@ + + + + + + + Noise Shader + + + + +
+ + diff --git a/app/public/drops/noise-shader/meta.json b/app/public/drops/noise-shader/meta.json new file mode 100644 index 0000000..64d571d --- /dev/null +++ b/app/public/drops/noise-shader/meta.json @@ -0,0 +1,25 @@ +{ + "name": "noise-shader", + "title": "Noise Shader", + "date": "2026-07-20", + "tags": [ + "tag1", + "tag2", + "tag3" + ], + "description": { + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "I was messing around with a shader to add noise to a texture, and ended up getting this cool effect when I divided the noise value by the distance to the user's mouse." + } + ] + } + ] + }, + "published": true +} \ No newline at end of file diff --git a/app/public/manifest.json b/app/public/manifest.json index 3d10630..f3541b1 100644 --- a/app/public/manifest.json +++ b/app/public/manifest.json @@ -1,4 +1,6 @@ [ "endless-journal", + "image-melody", + "noise-shader", "flowmap" ] \ No newline at end of file diff --git a/app/src/components/Panel.vue b/app/src/components/Panel.vue index 167ef91..fca3404 100644 --- a/app/src/components/Panel.vue +++ b/app/src/components/Panel.vue @@ -87,6 +87,8 @@ const formattedDate = computed(() => { } .description { text-align: left; + max-width: rs(400px); + margin: 0 auto; a { word-break: break-word; diff --git a/drops/endless-journal/public/meta.json b/drops/endless-journal/public/meta.json index d2fa288..663e717 100644 --- a/drops/endless-journal/public/meta.json +++ b/drops/endless-journal/public/meta.json @@ -13,7 +13,7 @@ "content": [ { "type": "text", - "text": " Creativity is following the thread of intuition and seeing where it goes. It's about being in the moment and not looking back." + "text": "Creativity is following the thread of intuition and seeing where it goes. It's about being in the moment and not looking back." } ] }, @@ -121,4 +121,4 @@ ] }, "published": true -} \ No newline at end of file +} diff --git a/drops/image-melody/index.html b/drops/image-melody/index.html new file mode 100644 index 0000000..91dcc94 --- /dev/null +++ b/drops/image-melody/index.html @@ -0,0 +1,13 @@ + + + + + + + Image Melody + + +
+ + + diff --git a/drops/image-melody/package.json b/drops/image-melody/package.json new file mode 100644 index 0000000..b23c34e --- /dev/null +++ b/drops/image-melody/package.json @@ -0,0 +1,23 @@ +{ + "name": "image-melody", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "@vueuse/core": "^14.3.0", + "intrinsic-scale": "^5.0.0", + "sass": "^1.98.0", + "sass-embedded": "^1.98.0", + "tone": "^15.1.22", + "vue": "^3.5.30" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.5", + "vite": "^8.0.0" + } +} diff --git a/drops/image-melody/prettier.config.js b/drops/image-melody/prettier.config.js new file mode 100644 index 0000000..9811303 --- /dev/null +++ b/drops/image-melody/prettier.config.js @@ -0,0 +1,5 @@ +export default { + tabWidth: 4, + semi: false, + singleQuote: true, +} diff --git a/drops/image-melody/public/favicon.png b/drops/image-melody/public/favicon.png new file mode 100644 index 0000000..792433d Binary files /dev/null and b/drops/image-melody/public/favicon.png differ diff --git a/drops/image-melody/public/meta.json b/drops/image-melody/public/meta.json new file mode 100644 index 0000000..efc2955 --- /dev/null +++ b/drops/image-melody/public/meta.json @@ -0,0 +1,25 @@ +{ + "name": "image-melody", + "title": "Image Melody", + "date": "2026-07-20", + "tags": [ + "tag1", + "tag2", + "tag3" + ], + "description": { + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "My friend Patrick wanted to try generating music from an image. I made this simple experiment which plays notes in a scale based on some of the color values in a pixelated version of the image." + } + ] + } + ] + }, + "published": true +} \ No newline at end of file diff --git a/drops/image-melody/src/App.vue b/drops/image-melody/src/App.vue new file mode 100644 index 0000000..e061a01 --- /dev/null +++ b/drops/image-melody/src/App.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/drops/image-melody/src/components/ImageMelody.vue b/drops/image-melody/src/components/ImageMelody.vue new file mode 100644 index 0000000..0c48a96 --- /dev/null +++ b/drops/image-melody/src/components/ImageMelody.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/drops/image-melody/src/libs/math.js b/drops/image-melody/src/libs/math.js new file mode 100644 index 0000000..62183bd --- /dev/null +++ b/drops/image-melody/src/libs/math.js @@ -0,0 +1,20 @@ +export function clamp(min, input, max) { + return Math.max(min, Math.min(input, max)); +} + +export function mapRange(in_min, in_max, input, out_min, out_max) { + return ((input - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min; +} + +export function lerp(start, end, amt) { + return (1 - amt) * start + amt * end; +} + +export function truncate(value, decimals) { + return parseFloat(value.toFixed(decimals)); +} + +export function wrapValue(value, lowBound, highBound) { + const range = highBound - lowBound; + return ((((value - lowBound) % range) + range) % range) + lowBound; +} diff --git a/drops/image-melody/src/main.js b/drops/image-melody/src/main.js new file mode 100644 index 0000000..91e76b3 --- /dev/null +++ b/drops/image-melody/src/main.js @@ -0,0 +1,6 @@ +import '@shared/styles/shared.scss' +import './styles/main.scss' +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/drops/image-melody/src/styles/main.scss b/drops/image-melody/src/styles/main.scss new file mode 100644 index 0000000..7089c0f --- /dev/null +++ b/drops/image-melody/src/styles/main.scss @@ -0,0 +1 @@ +/* Drop specific styles */ diff --git a/drops/image-melody/vite.config.js b/drops/image-melody/vite.config.js new file mode 100644 index 0000000..69ba799 --- /dev/null +++ b/drops/image-melody/vite.config.js @@ -0,0 +1,21 @@ +import { fileURLToPath, URL } from 'node:url' +import { defineConfig, mergeConfig } from 'vite' +import sharedConfig from '../../shared/vite.config.js' + +export default defineConfig( + mergeConfig(sharedConfig, { + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + '@shared': fileURLToPath( + new URL('../../shared', import.meta.url), + ), + }, + }, + base: '/drops/image-melody/', + build: { + outDir: '../../app/public/drops/image-melody', + emptyOutDir: true, + }, + }), +) diff --git a/drops/noise-shader/index.html b/drops/noise-shader/index.html new file mode 100644 index 0000000..2ab8745 --- /dev/null +++ b/drops/noise-shader/index.html @@ -0,0 +1,13 @@ + + + + + + + Noise Shader + + +
+ + + diff --git a/drops/noise-shader/package.json b/drops/noise-shader/package.json new file mode 100644 index 0000000..29065e3 --- /dev/null +++ b/drops/noise-shader/package.json @@ -0,0 +1,25 @@ +{ + "name": "noise-shader", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "@tresjs/cientos": "^5.8.1", + "@tresjs/core": "^5.8.3", + "@vueuse/core": "^14.3.0", + "gsap": "^3.15.0", + "sass": "^1.98.0", + "sass-embedded": "^1.98.0", + "vite-plugin-glsl": "^1.6.0", + "vue": "^3.5.30" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.5", + "vite": "^8.0.0" + } +} diff --git a/drops/noise-shader/prettier.config.js b/drops/noise-shader/prettier.config.js new file mode 100644 index 0000000..9811303 --- /dev/null +++ b/drops/noise-shader/prettier.config.js @@ -0,0 +1,5 @@ +export default { + tabWidth: 4, + semi: false, + singleQuote: true, +} diff --git a/drops/noise-shader/public/favicon.png b/drops/noise-shader/public/favicon.png new file mode 100644 index 0000000..792433d Binary files /dev/null and b/drops/noise-shader/public/favicon.png differ diff --git a/drops/noise-shader/public/fill-1.jpg b/drops/noise-shader/public/fill-1.jpg new file mode 100644 index 0000000..7ee955a Binary files /dev/null and b/drops/noise-shader/public/fill-1.jpg differ diff --git a/drops/noise-shader/public/meta.json b/drops/noise-shader/public/meta.json new file mode 100644 index 0000000..64d571d --- /dev/null +++ b/drops/noise-shader/public/meta.json @@ -0,0 +1,25 @@ +{ + "name": "noise-shader", + "title": "Noise Shader", + "date": "2026-07-20", + "tags": [ + "tag1", + "tag2", + "tag3" + ], + "description": { + "type": "doc", + "content": [ + { + "type": "paragraph", + "content": [ + { + "type": "text", + "text": "I was messing around with a shader to add noise to a texture, and ended up getting this cool effect when I divided the noise value by the distance to the user's mouse." + } + ] + } + ] + }, + "published": true +} \ No newline at end of file diff --git a/drops/noise-shader/src/App.vue b/drops/noise-shader/src/App.vue new file mode 100644 index 0000000..d6e3cce --- /dev/null +++ b/drops/noise-shader/src/App.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/drops/noise-shader/src/components/NoiseShader.vue b/drops/noise-shader/src/components/NoiseShader.vue new file mode 100644 index 0000000..65be78d --- /dev/null +++ b/drops/noise-shader/src/components/NoiseShader.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/drops/noise-shader/src/components/Webgl.vue b/drops/noise-shader/src/components/Webgl.vue new file mode 100644 index 0000000..0cb3945 --- /dev/null +++ b/drops/noise-shader/src/components/Webgl.vue @@ -0,0 +1,58 @@ + + + diff --git a/drops/noise-shader/src/components/WebglCanvas.vue b/drops/noise-shader/src/components/WebglCanvas.vue new file mode 100644 index 0000000..4756715 --- /dev/null +++ b/drops/noise-shader/src/components/WebglCanvas.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/drops/noise-shader/src/composables/useSmoothMouse.js b/drops/noise-shader/src/composables/useSmoothMouse.js new file mode 100644 index 0000000..6a6606e --- /dev/null +++ b/drops/noise-shader/src/composables/useSmoothMouse.js @@ -0,0 +1,89 @@ +import gsap from 'gsap' +import { ref, onMounted, onBeforeUnmount } from 'vue' +import { useWindowSize, useEventListener } from '@vueuse/core' + +/** + * Shared global raw mouse state (only set up once) + */ +const rawMouse = { + x: ref(0), + y: ref(0), + initialized: false, + cleanup: null, +} + +const useGlobalMouseListener = () => { + if (!rawMouse.initialized && !import.meta.env.SSR) { + rawMouse.initialized = true + rawMouse.cleanup = useEventListener(window, 'mousemove', (e) => { + rawMouse.x.value = e.clientX + rawMouse.y.value = e.clientY + }) + } +} + +/** + * Composable for smoothed mouse position with customizable smoothing and normalization. + */ +export default (options) => { + const smoothFactor = options?.smoothFactor ?? 0.1 + const normalize = options?.normalize ?? false + const callback = options?.onUpdate + + const { width: wWidth, height: wHeight } = useWindowSize() + + const sx = ref(0) + const sy = ref(0) + + useGlobalMouseListener() + + const getTargetX = () => + normalize ? rawMouse.x.value / wWidth.value : rawMouse.x.value + const getTargetY = () => + normalize ? rawMouse.y.value / wHeight.value : rawMouse.y.value + + let tween + onMounted(() => { + if (tween) tween.kill + + // Start smoothing tween + tween = gsap.to( + { x: sx.value, y: sy.value }, + { + duration: 1, + ease: 'linear', + repeat: -1, + onUpdate: () => { + const newX = gsap.utils.interpolate( + sx.value, + getTargetX(), + smoothFactor, + ) + const newY = gsap.utils.interpolate( + sy.value, + getTargetY(), + smoothFactor, + ) + + sx.value = newX + sy.value = newY + + callback?.({ sx: sx.value, sy: sy.value }) + }, + }, + ) + }) + + onBeforeUnmount(() => { + tween?.kill() + rawMouse.cleanup() + rawMouse.initialized = false + }) + + return { + sx, + sy, + rawX: rawMouse.x, + rawY: rawMouse.y, + } +} diff --git a/drops/noise-shader/src/libs/glsl/noise-image/frag.glsl b/drops/noise-shader/src/libs/glsl/noise-image/frag.glsl new file mode 100644 index 0000000..67aff8a --- /dev/null +++ b/drops/noise-shader/src/libs/glsl/noise-image/frag.glsl @@ -0,0 +1,53 @@ +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif + +varying vec2 v_uv; + +uniform float u_time; +uniform vec2 u_resolution; +uniform float u_grid_size; +uniform sampler2D u_texture; +uniform vec2 u_texture_resolution; +uniform vec2 u_mouse; + +#include ../utils/fitImage.frag; + +float rand(vec2 co) { + return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); +} + +float greyScale(in vec3 col) { + return dot(col, vec3(0.2126, 0.7152, 0.0722)); +} + +void main() { + float aspectRatio = u_resolution.x / u_resolution.y; + vec2 st = vec2(v_uv.x * aspectRatio, v_uv.y); + vec2 st_mouse = vec2(u_mouse.x * aspectRatio, u_mouse.y); + // vec2 st_mouse = vec2(0.5,0.5); + + + float distance = max(0.6, distance(st, st_mouse) * 10.); + + float gridValue = rand(st + u_time); + + vec3 grainColor = vec3(1.); + if(gridValue < 0.5) { + grainColor = vec3(0.); + } + + vec2 texCoordinates = fitImage(v_uv, u_texture_resolution, u_resolution, 0); + vec3 texColor = texture2D(u_texture, texCoordinates).rgb; + texColor = vec3(greyScale(texColor)); + texColor *= rand(st + u_time) / distance; + + vec3 finalTexColor = vec3(0.); + if(texColor.r > 0.5) { + finalTexColor = vec3(1.); + } + + gl_FragColor = vec4(mix(finalTexColor, grainColor, 0.2), 1.); +} diff --git a/drops/noise-shader/src/libs/glsl/noise-image/vert.glsl b/drops/noise-shader/src/libs/glsl/noise-image/vert.glsl new file mode 100644 index 0000000..4e30e5b --- /dev/null +++ b/drops/noise-shader/src/libs/glsl/noise-image/vert.glsl @@ -0,0 +1,7 @@ +varying vec2 v_uv; + +void main() { + v_uv = uv; + + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); +} \ No newline at end of file diff --git a/drops/noise-shader/src/libs/glsl/utils/fitImage.frag b/drops/noise-shader/src/libs/glsl/utils/fitImage.frag new file mode 100644 index 0000000..50f7380 --- /dev/null +++ b/drops/noise-shader/src/libs/glsl/utils/fitImage.frag @@ -0,0 +1,38 @@ +vec2 fitImage(vec2 st, vec2 imageResolution, vec2 frameResolution, int fit) { + float imageAspect = imageResolution.x / imageResolution.y; + float frameAspect = frameResolution.x / frameResolution.y; + float imageFrameRatio = imageAspect / frameAspect; + + float scaleX = 1., scaleY = 1.; + + // Cover + if(fit == 0) { + // Portrait + if(imageAspect < frameAspect) { + scaleY = imageFrameRatio; + } + // Landscape + else if(imageAspect > frameAspect) { + scaleX = 1. / imageFrameRatio; + } + } + // Contain + else if(fit == 1) { + if(imageAspect < frameAspect) { + scaleX = 1. / imageFrameRatio; + } + // Landscape + else if(imageAspect > frameAspect) { + scaleY = imageFrameRatio; + } + } + + vec2 imageScale = vec2(scaleX, scaleY); + vec2 coordinates = imageScale * (st - 0.5) + 0.5; + + if(coordinates.x < 0. || coordinates.x > 1. || coordinates.y < 0. || coordinates.y > 1.) { + discard; + } + + return coordinates; +} \ No newline at end of file diff --git a/drops/noise-shader/src/libs/math.js b/drops/noise-shader/src/libs/math.js new file mode 100644 index 0000000..62183bd --- /dev/null +++ b/drops/noise-shader/src/libs/math.js @@ -0,0 +1,20 @@ +export function clamp(min, input, max) { + return Math.max(min, Math.min(input, max)); +} + +export function mapRange(in_min, in_max, input, out_min, out_max) { + return ((input - in_min) * (out_max - out_min)) / (in_max - in_min) + out_min; +} + +export function lerp(start, end, amt) { + return (1 - amt) * start + amt * end; +} + +export function truncate(value, decimals) { + return parseFloat(value.toFixed(decimals)); +} + +export function wrapValue(value, lowBound, highBound) { + const range = highBound - lowBound; + return ((((value - lowBound) % range) + range) % range) + lowBound; +} diff --git a/drops/noise-shader/src/main.js b/drops/noise-shader/src/main.js new file mode 100644 index 0000000..91e76b3 --- /dev/null +++ b/drops/noise-shader/src/main.js @@ -0,0 +1,6 @@ +import '@shared/styles/shared.scss' +import './styles/main.scss' +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/drops/noise-shader/src/styles/main.scss b/drops/noise-shader/src/styles/main.scss new file mode 100644 index 0000000..7089c0f --- /dev/null +++ b/drops/noise-shader/src/styles/main.scss @@ -0,0 +1 @@ +/* Drop specific styles */ diff --git a/drops/noise-shader/vite.config.js b/drops/noise-shader/vite.config.js new file mode 100644 index 0000000..68049d8 --- /dev/null +++ b/drops/noise-shader/vite.config.js @@ -0,0 +1,25 @@ +import { fileURLToPath, URL } from 'node:url' +import { defineConfig, mergeConfig } from 'vite' +import sharedConfig from '../../shared/vite.config.js' +import glsl from 'vite-plugin-glsl' + +export default defineConfig( + mergeConfig(sharedConfig, { + plugins: [ + glsl(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + '@shared': fileURLToPath( + new URL('../../shared', import.meta.url), + ), + }, + }, + base: '/drops/noise-shader/', + build: { + outDir: '../../app/public/drops/noise-shader', + emptyOutDir: true, + }, + }), +) diff --git a/package-lock.json b/package-lock.json index c1cb7d6..f2ffb44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -82,6 +82,38 @@ "vite": "^8.0.0" } }, + "drops/image-melody": { + "version": "0.0.0", + "dependencies": { + "@vueuse/core": "^14.3.0", + "intrinsic-scale": "^5.0.0", + "sass": "^1.98.0", + "sass-embedded": "^1.98.0", + "tone": "^15.1.22", + "vue": "^3.5.30" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.5", + "vite": "^8.0.0" + } + }, + "drops/noise-shader": { + "version": "0.0.0", + "dependencies": { + "@tresjs/cientos": "^5.8.1", + "@tresjs/core": "^5.8.3", + "@vueuse/core": "^14.3.0", + "gsap": "^3.15.0", + "sass": "^1.98.0", + "sass-embedded": "^1.98.0", + "vite-plugin-glsl": "^1.6.0", + "vue": "^3.5.30" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^6.0.5", + "vite": "^8.0.0" + } + }, "drops/testing": { "version": "0.0.0", "dependencies": { @@ -191,6 +223,15 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/types": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", @@ -1684,6 +1725,19 @@ "url": "https://github.com/sponsors/sxzz" } }, + "node_modules/automation-events": { + "version": "7.1.19", + "resolved": "https://registry.npmjs.org/automation-events/-/automation-events-7.1.19.tgz", + "integrity": "sha512-cD+TLhJTI0q4AI3ktd353lrGZiVa9AchowSDzQzzGjSoYe22js4vlS32VUtWuaulghi1Yq0KYNWKk9wWuGymPA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.2", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18.2.0" + } + }, "node_modules/birpc": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/birpc/-/birpc-2.9.0.tgz", @@ -1896,6 +1950,12 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/gsap": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/gsap/-/gsap-3.15.0.tgz", + "integrity": "sha512-dMW4CWBTUK1AEEDeZc1g4xpPGIrSf9fJF960qbTZmN/QwZIWY5wgliS6JWl9/25fpTGJrMRtSjGtOmPnfjZB+A==", + "license": "Standard 'no charge' license: https://gsap.com/standard-license." + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1911,12 +1971,28 @@ "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", "license": "MIT" }, + "node_modules/image-melody": { + "resolved": "drops/image-melody", + "link": true + }, "node_modules/immutable": { "version": "5.1.9", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.9.tgz", "integrity": "sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==", "license": "MIT" }, + "node_modules/intrinsic-scale": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/intrinsic-scale/-/intrinsic-scale-5.0.0.tgz", + "integrity": "sha512-NJY7170uG8gYkaGGV0ddakq5VAWSvM2FKhARgXj8OQwod1hQFRBWCXn7dk35bGd+vsRYYnJQw/Qpebk8MWp4dg==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/fregante" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2338,6 +2414,10 @@ "license": "MIT", "optional": true }, + "node_modules/noise-shader": { + "resolved": "drops/noise-shader", + "link": true + }, "node_modules/nostics": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/nostics/-/nostics-1.2.0.tgz", @@ -3076,6 +3156,17 @@ "node": ">=0.10.0" } }, + "node_modules/standardized-audio-context": { + "version": "25.3.77", + "resolved": "https://registry.npmjs.org/standardized-audio-context/-/standardized-audio-context-25.3.77.tgz", + "integrity": "sha512-Ki9zNz6pKcC5Pi+QPjPyVsD9GwJIJWgryji0XL9cAJXMGyn+dPOf6Qik1AHei0+UNVcc4BOCa0hWLBzlwqsW/A==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.6", + "automation-events": "^7.0.9", + "tslib": "^2.7.0" + } + }, "node_modules/stats-gl": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/stats-gl/-/stats-gl-4.2.3.tgz", @@ -3212,6 +3303,16 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tone": { + "version": "15.1.22", + "resolved": "https://registry.npmjs.org/tone/-/tone-15.1.22.tgz", + "integrity": "sha512-TCScAGD4sLsama5DjvTUXlLDXSqPealhL64nsdV1hhr6frPWve0DeSo63AKnSJwgfg55fhvxj0iPPRwPN5o0ag==", + "license": "MIT", + "dependencies": { + "standardized-audio-context": "^25.3.70", + "tslib": "^2.3.1" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",