From 3766ae98ba768bf1e03c65ed85d03c555aa99764 Mon Sep 17 00:00:00 2001 From: LinqLover Date: Fri, 6 Oct 2023 00:31:20 +0000 Subject: [PATCH] deploy: e3a6e52cd369f3e2f1b1f7e97a3ca74c82c8446f --- app.html | 178 ++ assets/_commonjsHelpers-a1841df3.js | 1 + assets/app-5a6fc9b6.css | 5 + assets/app-8c8b13b6.js | 3610 +++++++++++++++++++++++++++ assets/main-6242c730.js | 5 + index.html | 3 +- 6 files changed, 3801 insertions(+), 1 deletion(-) create mode 100644 app.html create mode 100644 assets/_commonjsHelpers-a1841df3.js create mode 100644 assets/app-5a6fc9b6.css create mode 100644 assets/app-8c8b13b6.js create mode 100644 assets/main-6242c730.js diff --git a/app.html b/app.html new file mode 100644 index 0000000..202234a --- /dev/null +++ b/app.html @@ -0,0 +1,178 @@ + + + + + Trace4D + + + + + + + + + + + + + +
+
+
+
+
+ + +
+
+
+
+
+
+
+ + diff --git a/assets/_commonjsHelpers-a1841df3.js b/assets/_commonjsHelpers-a1841df3.js new file mode 100644 index 0000000..ad443dd --- /dev/null +++ b/assets/_commonjsHelpers-a1841df3.js @@ -0,0 +1 @@ +(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const n of t.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&i(n)}).observe(document,{childList:!0,subtree:!0});function s(e){const 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 i(e){if(e.ep)return;e.ep=!0;const t=s(e);fetch(e.href,t)}})();var l=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function f(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}export{l as c,f as g}; diff --git a/assets/app-5a6fc9b6.css b/assets/app-5a6fc9b6.css new file mode 100644 index 0000000..2eb58f8 --- /dev/null +++ b/assets/app-5a6fc9b6.css @@ -0,0 +1,5 @@ +/*! + * Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2023 Fonticons, Inc. + */.fa{font-family:var(--fa-style-family, "Font Awesome 6 Free");font-weight:var(--fa-style, 900)}.fa,.fa-classic,.fa-sharp,.fas,.fa-solid,.far,.fa-regular,.fab,.fa-brands{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:var(--fa-display, inline-block);font-style:normal;font-variant:normal;line-height:1;text-rendering:auto}.fas,.fa-classic,.fa-solid,.far,.fa-regular{font-family:"Font Awesome 6 Free"}.fab,.fa-brands{font-family:"Font Awesome 6 Brands"}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin, 2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width, 2em) * -1);position:absolute;text-align:center;width:var(--fa-li-width, 2em);line-height:inherit}.fa-border{border-color:var(--fa-border-color, #eee);border-radius:var(--fa-border-radius, .1em);border-style:var(--fa-border-style, solid);border-width:var(--fa-border-width, .08em);padding:var(--fa-border-padding, .2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin, .3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin, .3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay, 0s);animation-delay:var(--fa-animation-delay, 0s);-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 1s);animation-duration:var(--fa-animation-duration, 1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, ease-in-out);animation-timing-function:var(--fa-animation-timing, ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay, 0s);animation-delay:var(--fa-animation-delay, 0s);-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 1s);animation-duration:var(--fa-animation-duration, 1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, cubic-bezier(.28, .84, .42, 1));animation-timing-function:var(--fa-animation-timing, cubic-bezier(.28, .84, .42, 1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-delay:var(--fa-animation-delay, 0s);animation-delay:var(--fa-animation-delay, 0s);-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 1s);animation-duration:var(--fa-animation-duration, 1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, cubic-bezier(.4, 0, .6, 1));animation-timing-function:var(--fa-animation-timing, cubic-bezier(.4, 0, .6, 1))}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-delay:var(--fa-animation-delay, 0s);animation-delay:var(--fa-animation-delay, 0s);-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 1s);animation-duration:var(--fa-animation-duration, 1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, cubic-bezier(.4, 0, .6, 1));animation-timing-function:var(--fa-animation-timing, cubic-bezier(.4, 0, .6, 1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay, 0s);animation-delay:var(--fa-animation-delay, 0s);-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 1s);animation-duration:var(--fa-animation-duration, 1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, ease-in-out);animation-timing-function:var(--fa-animation-timing, ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-delay:var(--fa-animation-delay, 0s);animation-delay:var(--fa-animation-delay, 0s);-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 1s);animation-duration:var(--fa-animation-duration, 1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, linear);animation-timing-function:var(--fa-animation-timing, linear)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-delay:var(--fa-animation-delay, 0s);animation-delay:var(--fa-animation-delay, 0s);-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 2s);animation-duration:var(--fa-animation-duration, 2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, linear);animation-timing-function:var(--fa-animation-timing, linear)}.fa-spin-reverse{--fa-animation-direction: reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction, normal);animation-direction:var(--fa-animation-direction, normal);-webkit-animation-duration:var(--fa-animation-duration, 1s);animation-duration:var(--fa-animation-duration, 1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count, infinite);animation-iteration-count:var(--fa-animation-iteration-count, infinite);-webkit-animation-timing-function:var(--fa-animation-timing, steps(8));animation-timing-function:var(--fa-animation-timing, steps(8))}@media (prefers-reduced-motion: reduce){.fa-beat,.fa-bounce,.fa-fade,.fa-beat-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale, 1.25));transform:scale(var(--fa-beat-scale, 1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale, 1.25));transform:scale(var(--fa-beat-scale, 1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x, 1.1),var(--fa-bounce-start-scale-y, .9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x, 1.1),var(--fa-bounce-start-scale-y, .9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x, .9),var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -.5em));transform:scale(var(--fa-bounce-jump-scale-x, .9),var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x, 1.05),var(--fa-bounce-land-scale-y, .95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x, 1.05),var(--fa-bounce-land-scale-y, .95)) translateY(0)}57%{-webkit-transform:scale(1,1) translateY(var(--fa-bounce-rebound, -.125em));transform:scale(1) translateY(var(--fa-bounce-rebound, -.125em))}64%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1,1) translateY(0);transform:scale(1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x, 1.1),var(--fa-bounce-start-scale-y, .9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x, 1.1),var(--fa-bounce-start-scale-y, .9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x, .9),var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -.5em));transform:scale(var(--fa-bounce-jump-scale-x, .9),var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x, 1.05),var(--fa-bounce-land-scale-y, .95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x, 1.05),var(--fa-bounce-land-scale-y, .95)) translateY(0)}57%{-webkit-transform:scale(1,1) translateY(var(--fa-bounce-rebound, -.125em));transform:scale(1) translateY(var(--fa-bounce-rebound, -.125em))}64%{-webkit-transform:scale(1,1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1,1) translateY(0);transform:scale(1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity, .4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity, .4)}}@-webkit-keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity, .4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale, 1.125));transform:scale(var(--fa-beat-fade-scale, 1.125))}}@keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity, .4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale, 1.125));transform:scale(var(--fa-beat-fade-scale, 1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x, 0),var(--fa-flip-y, 1),var(--fa-flip-z, 0),var(--fa-flip-angle, -180deg));transform:rotate3d(var(--fa-flip-x, 0),var(--fa-flip-y, 1),var(--fa-flip-z, 0),var(--fa-flip-angle, -180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x, 0),var(--fa-flip-y, 1),var(--fa-flip-z, 0),var(--fa-flip-angle, -180deg));transform:rotate3d(var(--fa-flip-x, 0),var(--fa-flip-y, 1),var(--fa-flip-z, 0),var(--fa-flip-angle, -180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0)}}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle, none));transform:rotate(var(--fa-rotate-angle, none))}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%;z-index:var(--fa-stack-z-index, auto)}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:var(--fa-inverse, #fff)}.fa-0:before{content:"0"}.fa-1:before{content:"1"}.fa-2:before{content:"2"}.fa-3:before{content:"3"}.fa-4:before{content:"4"}.fa-5:before{content:"5"}.fa-6:before{content:"6"}.fa-7:before{content:"7"}.fa-8:before{content:"8"}.fa-9:before{content:"9"}.fa-fill-drip:before{content:""}.fa-arrows-to-circle:before{content:""}.fa-circle-chevron-right:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-at:before{content:"@"}.fa-trash-can:before{content:""}.fa-trash-alt:before{content:""}.fa-text-height:before{content:""}.fa-user-xmark:before{content:""}.fa-user-times:before{content:""}.fa-stethoscope:before{content:""}.fa-message:before{content:""}.fa-comment-alt:before{content:""}.fa-info:before{content:""}.fa-down-left-and-up-right-to-center:before{content:""}.fa-compress-alt:before{content:""}.fa-explosion:before{content:""}.fa-file-lines:before{content:""}.fa-file-alt:before{content:""}.fa-file-text:before{content:""}.fa-wave-square:before{content:""}.fa-ring:before{content:""}.fa-building-un:before{content:""}.fa-dice-three:before{content:""}.fa-calendar-days:before{content:""}.fa-calendar-alt:before{content:""}.fa-anchor-circle-check:before{content:""}.fa-building-circle-arrow-right:before{content:""}.fa-volleyball:before{content:""}.fa-volleyball-ball:before{content:""}.fa-arrows-up-to-line:before{content:""}.fa-sort-down:before{content:""}.fa-sort-desc:before{content:""}.fa-circle-minus:before{content:""}.fa-minus-circle:before{content:""}.fa-door-open:before{content:""}.fa-right-from-bracket:before{content:""}.fa-sign-out-alt:before{content:""}.fa-atom:before{content:""}.fa-soap:before{content:""}.fa-icons:before{content:""}.fa-heart-music-camera-bolt:before{content:""}.fa-microphone-lines-slash:before{content:""}.fa-microphone-alt-slash:before{content:""}.fa-bridge-circle-check:before{content:""}.fa-pump-medical:before{content:""}.fa-fingerprint:before{content:""}.fa-hand-point-right:before{content:""}.fa-magnifying-glass-location:before{content:""}.fa-search-location:before{content:""}.fa-forward-step:before{content:""}.fa-step-forward:before{content:""}.fa-face-smile-beam:before{content:""}.fa-smile-beam:before{content:""}.fa-flag-checkered:before{content:""}.fa-football:before{content:""}.fa-football-ball:before{content:""}.fa-school-circle-exclamation:before{content:""}.fa-crop:before{content:""}.fa-angles-down:before{content:""}.fa-angle-double-down:before{content:""}.fa-users-rectangle:before{content:""}.fa-people-roof:before{content:""}.fa-people-line:before{content:""}.fa-beer-mug-empty:before{content:""}.fa-beer:before{content:""}.fa-diagram-predecessor:before{content:""}.fa-arrow-up-long:before{content:""}.fa-long-arrow-up:before{content:""}.fa-fire-flame-simple:before{content:""}.fa-burn:before{content:""}.fa-person:before{content:""}.fa-male:before{content:""}.fa-laptop:before{content:""}.fa-file-csv:before{content:""}.fa-menorah:before{content:""}.fa-truck-plane:before{content:""}.fa-record-vinyl:before{content:""}.fa-face-grin-stars:before{content:""}.fa-grin-stars:before{content:""}.fa-bong:before{content:""}.fa-spaghetti-monster-flying:before{content:""}.fa-pastafarianism:before{content:""}.fa-arrow-down-up-across-line:before{content:""}.fa-spoon:before{content:""}.fa-utensil-spoon:before{content:""}.fa-jar-wheat:before{content:""}.fa-envelopes-bulk:before{content:""}.fa-mail-bulk:before{content:""}.fa-file-circle-exclamation:before{content:""}.fa-circle-h:before{content:""}.fa-hospital-symbol:before{content:""}.fa-pager:before{content:""}.fa-address-book:before{content:""}.fa-contact-book:before{content:""}.fa-strikethrough:before{content:""}.fa-k:before{content:"K"}.fa-landmark-flag:before{content:""}.fa-pencil:before{content:""}.fa-pencil-alt:before{content:""}.fa-backward:before{content:""}.fa-caret-right:before{content:""}.fa-comments:before{content:""}.fa-paste:before{content:""}.fa-file-clipboard:before{content:""}.fa-code-pull-request:before{content:""}.fa-clipboard-list:before{content:""}.fa-truck-ramp-box:before{content:""}.fa-truck-loading:before{content:""}.fa-user-check:before{content:""}.fa-vial-virus:before{content:""}.fa-sheet-plastic:before{content:""}.fa-blog:before{content:""}.fa-user-ninja:before{content:""}.fa-person-arrow-up-from-line:before{content:""}.fa-scroll-torah:before{content:""}.fa-torah:before{content:""}.fa-broom-ball:before{content:""}.fa-quidditch:before{content:""}.fa-quidditch-broom-ball:before{content:""}.fa-toggle-off:before{content:""}.fa-box-archive:before{content:""}.fa-archive:before{content:""}.fa-person-drowning:before{content:""}.fa-arrow-down-9-1:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-sort-numeric-down-alt:before{content:""}.fa-face-grin-tongue-squint:before{content:""}.fa-grin-tongue-squint:before{content:""}.fa-spray-can:before{content:""}.fa-truck-monster:before{content:""}.fa-w:before{content:"W"}.fa-earth-africa:before{content:""}.fa-globe-africa:before{content:""}.fa-rainbow:before{content:""}.fa-circle-notch:before{content:""}.fa-tablet-screen-button:before{content:""}.fa-tablet-alt:before{content:""}.fa-paw:before{content:""}.fa-cloud:before{content:""}.fa-trowel-bricks:before{content:""}.fa-face-flushed:before{content:""}.fa-flushed:before{content:""}.fa-hospital-user:before{content:""}.fa-tent-arrow-left-right:before{content:""}.fa-gavel:before{content:""}.fa-legal:before{content:""}.fa-binoculars:before{content:""}.fa-microphone-slash:before{content:""}.fa-box-tissue:before{content:""}.fa-motorcycle:before{content:""}.fa-bell-concierge:before{content:""}.fa-concierge-bell:before{content:""}.fa-pen-ruler:before{content:""}.fa-pencil-ruler:before{content:""}.fa-people-arrows:before{content:""}.fa-people-arrows-left-right:before{content:""}.fa-mars-and-venus-burst:before{content:""}.fa-square-caret-right:before{content:""}.fa-caret-square-right:before{content:""}.fa-scissors:before{content:""}.fa-cut:before{content:""}.fa-sun-plant-wilt:before{content:""}.fa-toilets-portable:before{content:""}.fa-hockey-puck:before{content:""}.fa-table:before{content:""}.fa-magnifying-glass-arrow-right:before{content:""}.fa-tachograph-digital:before{content:""}.fa-digital-tachograph:before{content:""}.fa-users-slash:before{content:""}.fa-clover:before{content:""}.fa-reply:before{content:""}.fa-mail-reply:before{content:""}.fa-star-and-crescent:before{content:""}.fa-house-fire:before{content:""}.fa-square-minus:before{content:""}.fa-minus-square:before{content:""}.fa-helicopter:before{content:""}.fa-compass:before{content:""}.fa-square-caret-down:before{content:""}.fa-caret-square-down:before{content:""}.fa-file-circle-question:before{content:""}.fa-laptop-code:before{content:""}.fa-swatchbook:before{content:""}.fa-prescription-bottle:before{content:""}.fa-bars:before{content:""}.fa-navicon:before{content:""}.fa-people-group:before{content:""}.fa-hourglass-end:before{content:""}.fa-hourglass-3:before{content:""}.fa-heart-crack:before{content:""}.fa-heart-broken:before{content:""}.fa-square-up-right:before{content:""}.fa-external-link-square-alt:before{content:""}.fa-face-kiss-beam:before{content:""}.fa-kiss-beam:before{content:""}.fa-film:before{content:""}.fa-ruler-horizontal:before{content:""}.fa-people-robbery:before{content:""}.fa-lightbulb:before{content:""}.fa-caret-left:before{content:""}.fa-circle-exclamation:before{content:""}.fa-exclamation-circle:before{content:""}.fa-school-circle-xmark:before{content:""}.fa-arrow-right-from-bracket:before{content:""}.fa-sign-out:before{content:""}.fa-circle-chevron-down:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-unlock-keyhole:before{content:""}.fa-unlock-alt:before{content:""}.fa-cloud-showers-heavy:before{content:""}.fa-headphones-simple:before{content:""}.fa-headphones-alt:before{content:""}.fa-sitemap:before{content:""}.fa-circle-dollar-to-slot:before{content:""}.fa-donate:before{content:""}.fa-memory:before{content:""}.fa-road-spikes:before{content:""}.fa-fire-burner:before{content:""}.fa-flag:before{content:""}.fa-hanukiah:before{content:""}.fa-feather:before{content:""}.fa-volume-low:before{content:""}.fa-volume-down:before{content:""}.fa-comment-slash:before{content:""}.fa-cloud-sun-rain:before{content:""}.fa-compress:before{content:""}.fa-wheat-awn:before{content:""}.fa-wheat-alt:before{content:""}.fa-ankh:before{content:""}.fa-hands-holding-child:before{content:""}.fa-asterisk:before{content:"*"}.fa-square-check:before{content:""}.fa-check-square:before{content:""}.fa-peseta-sign:before{content:""}.fa-heading:before{content:""}.fa-header:before{content:""}.fa-ghost:before{content:""}.fa-list:before{content:""}.fa-list-squares:before{content:""}.fa-square-phone-flip:before{content:""}.fa-phone-square-alt:before{content:""}.fa-cart-plus:before{content:""}.fa-gamepad:before{content:""}.fa-circle-dot:before{content:""}.fa-dot-circle:before{content:""}.fa-face-dizzy:before{content:""}.fa-dizzy:before{content:""}.fa-egg:before{content:""}.fa-house-medical-circle-xmark:before{content:""}.fa-campground:before{content:""}.fa-folder-plus:before{content:""}.fa-futbol:before{content:""}.fa-futbol-ball:before{content:""}.fa-soccer-ball:before{content:""}.fa-paintbrush:before{content:""}.fa-paint-brush:before{content:""}.fa-lock:before{content:""}.fa-gas-pump:before{content:""}.fa-hot-tub-person:before{content:""}.fa-hot-tub:before{content:""}.fa-map-location:before{content:""}.fa-map-marked:before{content:""}.fa-house-flood-water:before{content:""}.fa-tree:before{content:""}.fa-bridge-lock:before{content:""}.fa-sack-dollar:before{content:""}.fa-pen-to-square:before{content:""}.fa-edit:before{content:""}.fa-car-side:before{content:""}.fa-share-nodes:before{content:""}.fa-share-alt:before{content:""}.fa-heart-circle-minus:before{content:""}.fa-hourglass-half:before{content:""}.fa-hourglass-2:before{content:""}.fa-microscope:before{content:""}.fa-sink:before{content:""}.fa-bag-shopping:before{content:""}.fa-shopping-bag:before{content:""}.fa-arrow-down-z-a:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-alpha-down-alt:before{content:""}.fa-mitten:before{content:""}.fa-person-rays:before{content:""}.fa-users:before{content:""}.fa-eye-slash:before{content:""}.fa-flask-vial:before{content:""}.fa-hand:before{content:""}.fa-hand-paper:before{content:""}.fa-om:before{content:""}.fa-worm:before{content:""}.fa-house-circle-xmark:before{content:""}.fa-plug:before{content:""}.fa-chevron-up:before{content:""}.fa-hand-spock:before{content:""}.fa-stopwatch:before{content:""}.fa-face-kiss:before{content:""}.fa-kiss:before{content:""}.fa-bridge-circle-xmark:before{content:""}.fa-face-grin-tongue:before{content:""}.fa-grin-tongue:before{content:""}.fa-chess-bishop:before{content:""}.fa-face-grin-wink:before{content:""}.fa-grin-wink:before{content:""}.fa-ear-deaf:before{content:""}.fa-deaf:before{content:""}.fa-deafness:before{content:""}.fa-hard-of-hearing:before{content:""}.fa-road-circle-check:before{content:""}.fa-dice-five:before{content:""}.fa-square-rss:before{content:""}.fa-rss-square:before{content:""}.fa-land-mine-on:before{content:""}.fa-i-cursor:before{content:""}.fa-stamp:before{content:""}.fa-stairs:before{content:""}.fa-i:before{content:"I"}.fa-hryvnia-sign:before{content:""}.fa-hryvnia:before{content:""}.fa-pills:before{content:""}.fa-face-grin-wide:before{content:""}.fa-grin-alt:before{content:""}.fa-tooth:before{content:""}.fa-v:before{content:"V"}.fa-bangladeshi-taka-sign:before{content:""}.fa-bicycle:before{content:""}.fa-staff-snake:before{content:""}.fa-rod-asclepius:before{content:""}.fa-rod-snake:before{content:""}.fa-staff-aesculapius:before{content:""}.fa-head-side-cough-slash:before{content:""}.fa-truck-medical:before{content:""}.fa-ambulance:before{content:""}.fa-wheat-awn-circle-exclamation:before{content:""}.fa-snowman:before{content:""}.fa-mortar-pestle:before{content:""}.fa-road-barrier:before{content:""}.fa-school:before{content:""}.fa-igloo:before{content:""}.fa-joint:before{content:""}.fa-angle-right:before{content:""}.fa-horse:before{content:""}.fa-q:before{content:"Q"}.fa-g:before{content:"G"}.fa-notes-medical:before{content:""}.fa-temperature-half:before{content:""}.fa-temperature-2:before{content:""}.fa-thermometer-2:before{content:""}.fa-thermometer-half:before{content:""}.fa-dong-sign:before{content:""}.fa-capsules:before{content:""}.fa-poo-storm:before{content:""}.fa-poo-bolt:before{content:""}.fa-face-frown-open:before{content:""}.fa-frown-open:before{content:""}.fa-hand-point-up:before{content:""}.fa-money-bill:before{content:""}.fa-bookmark:before{content:""}.fa-align-justify:before{content:""}.fa-umbrella-beach:before{content:""}.fa-helmet-un:before{content:""}.fa-bullseye:before{content:""}.fa-bacon:before{content:""}.fa-hand-point-down:before{content:""}.fa-arrow-up-from-bracket:before{content:""}.fa-folder:before{content:""}.fa-folder-blank:before{content:""}.fa-file-waveform:before{content:""}.fa-file-medical-alt:before{content:""}.fa-radiation:before{content:""}.fa-chart-simple:before{content:""}.fa-mars-stroke:before{content:""}.fa-vial:before{content:""}.fa-gauge:before{content:""}.fa-dashboard:before{content:""}.fa-gauge-med:before{content:""}.fa-tachometer-alt-average:before{content:""}.fa-wand-magic-sparkles:before{content:""}.fa-magic-wand-sparkles:before{content:""}.fa-e:before{content:"E"}.fa-pen-clip:before{content:""}.fa-pen-alt:before{content:""}.fa-bridge-circle-exclamation:before{content:""}.fa-user:before{content:""}.fa-school-circle-check:before{content:""}.fa-dumpster:before{content:""}.fa-van-shuttle:before{content:""}.fa-shuttle-van:before{content:""}.fa-building-user:before{content:""}.fa-square-caret-left:before{content:""}.fa-caret-square-left:before{content:""}.fa-highlighter:before{content:""}.fa-key:before{content:""}.fa-bullhorn:before{content:""}.fa-globe:before{content:""}.fa-synagogue:before{content:""}.fa-person-half-dress:before{content:""}.fa-road-bridge:before{content:""}.fa-location-arrow:before{content:""}.fa-c:before{content:"C"}.fa-tablet-button:before{content:""}.fa-building-lock:before{content:""}.fa-pizza-slice:before{content:""}.fa-money-bill-wave:before{content:""}.fa-chart-area:before{content:""}.fa-area-chart:before{content:""}.fa-house-flag:before{content:""}.fa-person-circle-minus:before{content:""}.fa-ban:before{content:""}.fa-cancel:before{content:""}.fa-camera-rotate:before{content:""}.fa-spray-can-sparkles:before{content:""}.fa-air-freshener:before{content:""}.fa-star:before{content:""}.fa-repeat:before{content:""}.fa-cross:before{content:""}.fa-box:before{content:""}.fa-venus-mars:before{content:""}.fa-arrow-pointer:before{content:""}.fa-mouse-pointer:before{content:""}.fa-maximize:before{content:""}.fa-expand-arrows-alt:before{content:""}.fa-charging-station:before{content:""}.fa-shapes:before{content:""}.fa-triangle-circle-square:before{content:""}.fa-shuffle:before{content:""}.fa-random:before{content:""}.fa-person-running:before{content:""}.fa-running:before{content:""}.fa-mobile-retro:before{content:""}.fa-grip-lines-vertical:before{content:""}.fa-spider:before{content:""}.fa-hands-bound:before{content:""}.fa-file-invoice-dollar:before{content:""}.fa-plane-circle-exclamation:before{content:""}.fa-x-ray:before{content:""}.fa-spell-check:before{content:""}.fa-slash:before{content:""}.fa-computer-mouse:before{content:""}.fa-mouse:before{content:""}.fa-arrow-right-to-bracket:before{content:""}.fa-sign-in:before{content:""}.fa-shop-slash:before{content:""}.fa-store-alt-slash:before{content:""}.fa-server:before{content:""}.fa-virus-covid-slash:before{content:""}.fa-shop-lock:before{content:""}.fa-hourglass-start:before{content:""}.fa-hourglass-1:before{content:""}.fa-blender-phone:before{content:""}.fa-building-wheat:before{content:""}.fa-person-breastfeeding:before{content:""}.fa-right-to-bracket:before{content:""}.fa-sign-in-alt:before{content:""}.fa-venus:before{content:""}.fa-passport:before{content:""}.fa-heart-pulse:before{content:""}.fa-heartbeat:before{content:""}.fa-people-carry-box:before{content:""}.fa-people-carry:before{content:""}.fa-temperature-high:before{content:""}.fa-microchip:before{content:""}.fa-crown:before{content:""}.fa-weight-hanging:before{content:""}.fa-xmarks-lines:before{content:""}.fa-file-prescription:before{content:""}.fa-weight-scale:before{content:""}.fa-weight:before{content:""}.fa-user-group:before{content:""}.fa-user-friends:before{content:""}.fa-arrow-up-a-z:before{content:""}.fa-sort-alpha-up:before{content:""}.fa-chess-knight:before{content:""}.fa-face-laugh-squint:before{content:""}.fa-laugh-squint:before{content:""}.fa-wheelchair:before{content:""}.fa-circle-arrow-up:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-toggle-on:before{content:""}.fa-person-walking:before{content:""}.fa-walking:before{content:""}.fa-l:before{content:"L"}.fa-fire:before{content:""}.fa-bed-pulse:before{content:""}.fa-procedures:before{content:""}.fa-shuttle-space:before{content:""}.fa-space-shuttle:before{content:""}.fa-face-laugh:before{content:""}.fa-laugh:before{content:""}.fa-folder-open:before{content:""}.fa-heart-circle-plus:before{content:""}.fa-code-fork:before{content:""}.fa-city:before{content:""}.fa-microphone-lines:before{content:""}.fa-microphone-alt:before{content:""}.fa-pepper-hot:before{content:""}.fa-unlock:before{content:""}.fa-colon-sign:before{content:""}.fa-headset:before{content:""}.fa-store-slash:before{content:""}.fa-road-circle-xmark:before{content:""}.fa-user-minus:before{content:""}.fa-mars-stroke-up:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-champagne-glasses:before{content:""}.fa-glass-cheers:before{content:""}.fa-clipboard:before{content:""}.fa-house-circle-exclamation:before{content:""}.fa-file-arrow-up:before{content:""}.fa-file-upload:before{content:""}.fa-wifi:before{content:""}.fa-wifi-3:before{content:""}.fa-wifi-strong:before{content:""}.fa-bath:before{content:""}.fa-bathtub:before{content:""}.fa-underline:before{content:""}.fa-user-pen:before{content:""}.fa-user-edit:before{content:""}.fa-signature:before{content:""}.fa-stroopwafel:before{content:""}.fa-bold:before{content:""}.fa-anchor-lock:before{content:""}.fa-building-ngo:before{content:""}.fa-manat-sign:before{content:""}.fa-not-equal:before{content:""}.fa-border-top-left:before{content:""}.fa-border-style:before{content:""}.fa-map-location-dot:before{content:""}.fa-map-marked-alt:before{content:""}.fa-jedi:before{content:""}.fa-square-poll-vertical:before{content:""}.fa-poll:before{content:""}.fa-mug-hot:before{content:""}.fa-car-battery:before{content:""}.fa-battery-car:before{content:""}.fa-gift:before{content:""}.fa-dice-two:before{content:""}.fa-chess-queen:before{content:""}.fa-glasses:before{content:""}.fa-chess-board:before{content:""}.fa-building-circle-check:before{content:""}.fa-person-chalkboard:before{content:""}.fa-mars-stroke-right:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-hand-back-fist:before{content:""}.fa-hand-rock:before{content:""}.fa-square-caret-up:before{content:""}.fa-caret-square-up:before{content:""}.fa-cloud-showers-water:before{content:""}.fa-chart-bar:before{content:""}.fa-bar-chart:before{content:""}.fa-hands-bubbles:before{content:""}.fa-hands-wash:before{content:""}.fa-less-than-equal:before{content:""}.fa-train:before{content:""}.fa-eye-low-vision:before{content:""}.fa-low-vision:before{content:""}.fa-crow:before{content:""}.fa-sailboat:before{content:""}.fa-window-restore:before{content:""}.fa-square-plus:before{content:""}.fa-plus-square:before{content:""}.fa-torii-gate:before{content:""}.fa-frog:before{content:""}.fa-bucket:before{content:""}.fa-image:before{content:""}.fa-microphone:before{content:""}.fa-cow:before{content:""}.fa-caret-up:before{content:""}.fa-screwdriver:before{content:""}.fa-folder-closed:before{content:""}.fa-house-tsunami:before{content:""}.fa-square-nfi:before{content:""}.fa-arrow-up-from-ground-water:before{content:""}.fa-martini-glass:before{content:""}.fa-glass-martini-alt:before{content:""}.fa-rotate-left:before{content:""}.fa-rotate-back:before{content:""}.fa-rotate-backward:before{content:""}.fa-undo-alt:before{content:""}.fa-table-columns:before{content:""}.fa-columns:before{content:""}.fa-lemon:before{content:""}.fa-head-side-mask:before{content:""}.fa-handshake:before{content:""}.fa-gem:before{content:""}.fa-dolly:before{content:""}.fa-dolly-box:before{content:""}.fa-smoking:before{content:""}.fa-minimize:before{content:""}.fa-compress-arrows-alt:before{content:""}.fa-monument:before{content:""}.fa-snowplow:before{content:""}.fa-angles-right:before{content:""}.fa-angle-double-right:before{content:""}.fa-cannabis:before{content:""}.fa-circle-play:before{content:""}.fa-play-circle:before{content:""}.fa-tablets:before{content:""}.fa-ethernet:before{content:""}.fa-euro-sign:before{content:""}.fa-eur:before{content:""}.fa-euro:before{content:""}.fa-chair:before{content:""}.fa-circle-check:before{content:""}.fa-check-circle:before{content:""}.fa-circle-stop:before{content:""}.fa-stop-circle:before{content:""}.fa-compass-drafting:before{content:""}.fa-drafting-compass:before{content:""}.fa-plate-wheat:before{content:""}.fa-icicles:before{content:""}.fa-person-shelter:before{content:""}.fa-neuter:before{content:""}.fa-id-badge:before{content:""}.fa-marker:before{content:""}.fa-face-laugh-beam:before{content:""}.fa-laugh-beam:before{content:""}.fa-helicopter-symbol:before{content:""}.fa-universal-access:before{content:""}.fa-circle-chevron-up:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-lari-sign:before{content:""}.fa-volcano:before{content:""}.fa-person-walking-dashed-line-arrow-right:before{content:""}.fa-sterling-sign:before{content:""}.fa-gbp:before{content:""}.fa-pound-sign:before{content:""}.fa-viruses:before{content:""}.fa-square-person-confined:before{content:""}.fa-user-tie:before{content:""}.fa-arrow-down-long:before{content:""}.fa-long-arrow-down:before{content:""}.fa-tent-arrow-down-to-line:before{content:""}.fa-certificate:before{content:""}.fa-reply-all:before{content:""}.fa-mail-reply-all:before{content:""}.fa-suitcase:before{content:""}.fa-person-skating:before{content:""}.fa-skating:before{content:""}.fa-filter-circle-dollar:before{content:""}.fa-funnel-dollar:before{content:""}.fa-camera-retro:before{content:""}.fa-circle-arrow-down:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-file-import:before{content:""}.fa-arrow-right-to-file:before{content:""}.fa-square-arrow-up-right:before{content:""}.fa-external-link-square:before{content:""}.fa-box-open:before{content:""}.fa-scroll:before{content:""}.fa-spa:before{content:""}.fa-location-pin-lock:before{content:""}.fa-pause:before{content:""}.fa-hill-avalanche:before{content:""}.fa-temperature-empty:before{content:""}.fa-temperature-0:before{content:""}.fa-thermometer-0:before{content:""}.fa-thermometer-empty:before{content:""}.fa-bomb:before{content:""}.fa-registered:before{content:""}.fa-address-card:before{content:""}.fa-contact-card:before{content:""}.fa-vcard:before{content:""}.fa-scale-unbalanced-flip:before{content:""}.fa-balance-scale-right:before{content:""}.fa-subscript:before{content:""}.fa-diamond-turn-right:before{content:""}.fa-directions:before{content:""}.fa-burst:before{content:""}.fa-house-laptop:before{content:""}.fa-laptop-house:before{content:""}.fa-face-tired:before{content:""}.fa-tired:before{content:""}.fa-money-bills:before{content:""}.fa-smog:before{content:""}.fa-crutch:before{content:""}.fa-cloud-arrow-up:before{content:""}.fa-cloud-upload:before{content:""}.fa-cloud-upload-alt:before{content:""}.fa-palette:before{content:""}.fa-arrows-turn-right:before{content:""}.fa-vest:before{content:""}.fa-ferry:before{content:""}.fa-arrows-down-to-people:before{content:""}.fa-seedling:before{content:""}.fa-sprout:before{content:""}.fa-left-right:before{content:""}.fa-arrows-alt-h:before{content:""}.fa-boxes-packing:before{content:""}.fa-circle-arrow-left:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-group-arrows-rotate:before{content:""}.fa-bowl-food:before{content:""}.fa-candy-cane:before{content:""}.fa-arrow-down-wide-short:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-down:before{content:""}.fa-cloud-bolt:before{content:""}.fa-thunderstorm:before{content:""}.fa-text-slash:before{content:""}.fa-remove-format:before{content:""}.fa-face-smile-wink:before{content:""}.fa-smile-wink:before{content:""}.fa-file-word:before{content:""}.fa-file-powerpoint:before{content:""}.fa-arrows-left-right:before{content:""}.fa-arrows-h:before{content:""}.fa-house-lock:before{content:""}.fa-cloud-arrow-down:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-download-alt:before{content:""}.fa-children:before{content:""}.fa-chalkboard:before{content:""}.fa-blackboard:before{content:""}.fa-user-large-slash:before{content:""}.fa-user-alt-slash:before{content:""}.fa-envelope-open:before{content:""}.fa-handshake-simple-slash:before{content:""}.fa-handshake-alt-slash:before{content:""}.fa-mattress-pillow:before{content:""}.fa-guarani-sign:before{content:""}.fa-arrows-rotate:before{content:""}.fa-refresh:before{content:""}.fa-sync:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-cruzeiro-sign:before{content:""}.fa-greater-than-equal:before{content:""}.fa-shield-halved:before{content:""}.fa-shield-alt:before{content:""}.fa-book-atlas:before{content:""}.fa-atlas:before{content:""}.fa-virus:before{content:""}.fa-envelope-circle-check:before{content:""}.fa-layer-group:before{content:""}.fa-arrows-to-dot:before{content:""}.fa-archway:before{content:""}.fa-heart-circle-check:before{content:""}.fa-house-chimney-crack:before{content:""}.fa-house-damage:before{content:""}.fa-file-zipper:before{content:""}.fa-file-archive:before{content:""}.fa-square:before{content:""}.fa-martini-glass-empty:before{content:""}.fa-glass-martini:before{content:""}.fa-couch:before{content:""}.fa-cedi-sign:before{content:""}.fa-italic:before{content:""}.fa-church:before{content:""}.fa-comments-dollar:before{content:""}.fa-democrat:before{content:""}.fa-z:before{content:"Z"}.fa-person-skiing:before{content:""}.fa-skiing:before{content:""}.fa-road-lock:before{content:""}.fa-a:before{content:"A"}.fa-temperature-arrow-down:before{content:""}.fa-temperature-down:before{content:""}.fa-feather-pointed:before{content:""}.fa-feather-alt:before{content:""}.fa-p:before{content:"P"}.fa-snowflake:before{content:""}.fa-newspaper:before{content:""}.fa-rectangle-ad:before{content:""}.fa-ad:before{content:""}.fa-circle-arrow-right:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-filter-circle-xmark:before{content:""}.fa-locust:before{content:""}.fa-sort:before{content:""}.fa-unsorted:before{content:""}.fa-list-ol:before{content:""}.fa-list-1-2:before{content:""}.fa-list-numeric:before{content:""}.fa-person-dress-burst:before{content:""}.fa-money-check-dollar:before{content:""}.fa-money-check-alt:before{content:""}.fa-vector-square:before{content:""}.fa-bread-slice:before{content:""}.fa-language:before{content:""}.fa-face-kiss-wink-heart:before{content:""}.fa-kiss-wink-heart:before{content:""}.fa-filter:before{content:""}.fa-question:before{content:"?"}.fa-file-signature:before{content:""}.fa-up-down-left-right:before{content:""}.fa-arrows-alt:before{content:""}.fa-house-chimney-user:before{content:""}.fa-hand-holding-heart:before{content:""}.fa-puzzle-piece:before{content:""}.fa-money-check:before{content:""}.fa-star-half-stroke:before{content:""}.fa-star-half-alt:before{content:""}.fa-code:before{content:""}.fa-whiskey-glass:before{content:""}.fa-glass-whiskey:before{content:""}.fa-building-circle-exclamation:before{content:""}.fa-magnifying-glass-chart:before{content:""}.fa-arrow-up-right-from-square:before{content:""}.fa-external-link:before{content:""}.fa-cubes-stacked:before{content:""}.fa-won-sign:before{content:""}.fa-krw:before{content:""}.fa-won:before{content:""}.fa-virus-covid:before{content:""}.fa-austral-sign:before{content:""}.fa-f:before{content:"F"}.fa-leaf:before{content:""}.fa-road:before{content:""}.fa-taxi:before{content:""}.fa-cab:before{content:""}.fa-person-circle-plus:before{content:""}.fa-chart-pie:before{content:""}.fa-pie-chart:before{content:""}.fa-bolt-lightning:before{content:""}.fa-sack-xmark:before{content:""}.fa-file-excel:before{content:""}.fa-file-contract:before{content:""}.fa-fish-fins:before{content:""}.fa-building-flag:before{content:""}.fa-face-grin-beam:before{content:""}.fa-grin-beam:before{content:""}.fa-object-ungroup:before{content:""}.fa-poop:before{content:""}.fa-location-pin:before{content:""}.fa-map-marker:before{content:""}.fa-kaaba:before{content:""}.fa-toilet-paper:before{content:""}.fa-helmet-safety:before{content:""}.fa-hard-hat:before{content:""}.fa-hat-hard:before{content:""}.fa-eject:before{content:""}.fa-circle-right:before{content:""}.fa-arrow-alt-circle-right:before{content:""}.fa-plane-circle-check:before{content:""}.fa-face-rolling-eyes:before{content:""}.fa-meh-rolling-eyes:before{content:""}.fa-object-group:before{content:""}.fa-chart-line:before{content:""}.fa-line-chart:before{content:""}.fa-mask-ventilator:before{content:""}.fa-arrow-right:before{content:""}.fa-signs-post:before{content:""}.fa-map-signs:before{content:""}.fa-cash-register:before{content:""}.fa-person-circle-question:before{content:""}.fa-h:before{content:"H"}.fa-tarp:before{content:""}.fa-screwdriver-wrench:before{content:""}.fa-tools:before{content:""}.fa-arrows-to-eye:before{content:""}.fa-plug-circle-bolt:before{content:""}.fa-heart:before{content:""}.fa-mars-and-venus:before{content:""}.fa-house-user:before{content:""}.fa-home-user:before{content:""}.fa-dumpster-fire:before{content:""}.fa-house-crack:before{content:""}.fa-martini-glass-citrus:before{content:""}.fa-cocktail:before{content:""}.fa-face-surprise:before{content:""}.fa-surprise:before{content:""}.fa-bottle-water:before{content:""}.fa-circle-pause:before{content:""}.fa-pause-circle:before{content:""}.fa-toilet-paper-slash:before{content:""}.fa-apple-whole:before{content:""}.fa-apple-alt:before{content:""}.fa-kitchen-set:before{content:""}.fa-r:before{content:"R"}.fa-temperature-quarter:before{content:""}.fa-temperature-1:before{content:""}.fa-thermometer-1:before{content:""}.fa-thermometer-quarter:before{content:""}.fa-cube:before{content:""}.fa-bitcoin-sign:before{content:""}.fa-shield-dog:before{content:""}.fa-solar-panel:before{content:""}.fa-lock-open:before{content:""}.fa-elevator:before{content:""}.fa-money-bill-transfer:before{content:""}.fa-money-bill-trend-up:before{content:""}.fa-house-flood-water-circle-arrow-right:before{content:""}.fa-square-poll-horizontal:before{content:""}.fa-poll-h:before{content:""}.fa-circle:before{content:""}.fa-backward-fast:before{content:""}.fa-fast-backward:before{content:""}.fa-recycle:before{content:""}.fa-user-astronaut:before{content:""}.fa-plane-slash:before{content:""}.fa-trademark:before{content:""}.fa-basketball:before{content:""}.fa-basketball-ball:before{content:""}.fa-satellite-dish:before{content:""}.fa-circle-up:before{content:""}.fa-arrow-alt-circle-up:before{content:""}.fa-mobile-screen-button:before{content:""}.fa-mobile-alt:before{content:""}.fa-volume-high:before{content:""}.fa-volume-up:before{content:""}.fa-users-rays:before{content:""}.fa-wallet:before{content:""}.fa-clipboard-check:before{content:""}.fa-file-audio:before{content:""}.fa-burger:before{content:""}.fa-hamburger:before{content:""}.fa-wrench:before{content:""}.fa-bugs:before{content:""}.fa-rupee-sign:before{content:""}.fa-rupee:before{content:""}.fa-file-image:before{content:""}.fa-circle-question:before{content:""}.fa-question-circle:before{content:""}.fa-plane-departure:before{content:""}.fa-handshake-slash:before{content:""}.fa-book-bookmark:before{content:""}.fa-code-branch:before{content:""}.fa-hat-cowboy:before{content:""}.fa-bridge:before{content:""}.fa-phone-flip:before{content:""}.fa-phone-alt:before{content:""}.fa-truck-front:before{content:""}.fa-cat:before{content:""}.fa-anchor-circle-exclamation:before{content:""}.fa-truck-field:before{content:""}.fa-route:before{content:""}.fa-clipboard-question:before{content:""}.fa-panorama:before{content:""}.fa-comment-medical:before{content:""}.fa-teeth-open:before{content:""}.fa-file-circle-minus:before{content:""}.fa-tags:before{content:""}.fa-wine-glass:before{content:""}.fa-forward-fast:before{content:""}.fa-fast-forward:before{content:""}.fa-face-meh-blank:before{content:""}.fa-meh-blank:before{content:""}.fa-square-parking:before{content:""}.fa-parking:before{content:""}.fa-house-signal:before{content:""}.fa-bars-progress:before{content:""}.fa-tasks-alt:before{content:""}.fa-faucet-drip:before{content:""}.fa-cart-flatbed:before{content:""}.fa-dolly-flatbed:before{content:""}.fa-ban-smoking:before{content:""}.fa-smoking-ban:before{content:""}.fa-terminal:before{content:""}.fa-mobile-button:before{content:""}.fa-house-medical-flag:before{content:""}.fa-basket-shopping:before{content:""}.fa-shopping-basket:before{content:""}.fa-tape:before{content:""}.fa-bus-simple:before{content:""}.fa-bus-alt:before{content:""}.fa-eye:before{content:""}.fa-face-sad-cry:before{content:""}.fa-sad-cry:before{content:""}.fa-audio-description:before{content:""}.fa-person-military-to-person:before{content:""}.fa-file-shield:before{content:""}.fa-user-slash:before{content:""}.fa-pen:before{content:""}.fa-tower-observation:before{content:""}.fa-file-code:before{content:""}.fa-signal:before{content:""}.fa-signal-5:before{content:""}.fa-signal-perfect:before{content:""}.fa-bus:before{content:""}.fa-heart-circle-xmark:before{content:""}.fa-house-chimney:before{content:""}.fa-home-lg:before{content:""}.fa-window-maximize:before{content:""}.fa-face-frown:before{content:""}.fa-frown:before{content:""}.fa-prescription:before{content:""}.fa-shop:before{content:""}.fa-store-alt:before{content:""}.fa-floppy-disk:before{content:""}.fa-save:before{content:""}.fa-vihara:before{content:""}.fa-scale-unbalanced:before{content:""}.fa-balance-scale-left:before{content:""}.fa-sort-up:before{content:""}.fa-sort-asc:before{content:""}.fa-comment-dots:before{content:""}.fa-commenting:before{content:""}.fa-plant-wilt:before{content:""}.fa-diamond:before{content:""}.fa-face-grin-squint:before{content:""}.fa-grin-squint:before{content:""}.fa-hand-holding-dollar:before{content:""}.fa-hand-holding-usd:before{content:""}.fa-bacterium:before{content:""}.fa-hand-pointer:before{content:""}.fa-drum-steelpan:before{content:""}.fa-hand-scissors:before{content:""}.fa-hands-praying:before{content:""}.fa-praying-hands:before{content:""}.fa-arrow-rotate-right:before{content:""}.fa-arrow-right-rotate:before{content:""}.fa-arrow-rotate-forward:before{content:""}.fa-redo:before{content:""}.fa-biohazard:before{content:""}.fa-location-crosshairs:before{content:""}.fa-location:before{content:""}.fa-mars-double:before{content:""}.fa-child-dress:before{content:""}.fa-users-between-lines:before{content:""}.fa-lungs-virus:before{content:""}.fa-face-grin-tears:before{content:""}.fa-grin-tears:before{content:""}.fa-phone:before{content:""}.fa-calendar-xmark:before{content:""}.fa-calendar-times:before{content:""}.fa-child-reaching:before{content:""}.fa-head-side-virus:before{content:""}.fa-user-gear:before{content:""}.fa-user-cog:before{content:""}.fa-arrow-up-1-9:before{content:""}.fa-sort-numeric-up:before{content:""}.fa-door-closed:before{content:""}.fa-shield-virus:before{content:""}.fa-dice-six:before{content:""}.fa-mosquito-net:before{content:""}.fa-bridge-water:before{content:""}.fa-person-booth:before{content:""}.fa-text-width:before{content:""}.fa-hat-wizard:before{content:""}.fa-pen-fancy:before{content:""}.fa-person-digging:before{content:""}.fa-digging:before{content:""}.fa-trash:before{content:""}.fa-gauge-simple:before{content:""}.fa-gauge-simple-med:before{content:""}.fa-tachometer-average:before{content:""}.fa-book-medical:before{content:""}.fa-poo:before{content:""}.fa-quote-right:before{content:""}.fa-quote-right-alt:before{content:""}.fa-shirt:before{content:""}.fa-t-shirt:before{content:""}.fa-tshirt:before{content:""}.fa-cubes:before{content:""}.fa-divide:before{content:""}.fa-tenge-sign:before{content:""}.fa-tenge:before{content:""}.fa-headphones:before{content:""}.fa-hands-holding:before{content:""}.fa-hands-clapping:before{content:""}.fa-republican:before{content:""}.fa-arrow-left:before{content:""}.fa-person-circle-xmark:before{content:""}.fa-ruler:before{content:""}.fa-align-left:before{content:""}.fa-dice-d6:before{content:""}.fa-restroom:before{content:""}.fa-j:before{content:"J"}.fa-users-viewfinder:before{content:""}.fa-file-video:before{content:""}.fa-up-right-from-square:before{content:""}.fa-external-link-alt:before{content:""}.fa-table-cells:before{content:""}.fa-th:before{content:""}.fa-file-pdf:before{content:""}.fa-book-bible:before{content:""}.fa-bible:before{content:""}.fa-o:before{content:"O"}.fa-suitcase-medical:before{content:""}.fa-medkit:before{content:""}.fa-user-secret:before{content:""}.fa-otter:before{content:""}.fa-person-dress:before{content:""}.fa-female:before{content:""}.fa-comment-dollar:before{content:""}.fa-business-time:before{content:""}.fa-briefcase-clock:before{content:""}.fa-table-cells-large:before{content:""}.fa-th-large:before{content:""}.fa-book-tanakh:before{content:""}.fa-tanakh:before{content:""}.fa-phone-volume:before{content:""}.fa-volume-control-phone:before{content:""}.fa-hat-cowboy-side:before{content:""}.fa-clipboard-user:before{content:""}.fa-child:before{content:""}.fa-lira-sign:before{content:""}.fa-satellite:before{content:""}.fa-plane-lock:before{content:""}.fa-tag:before{content:""}.fa-comment:before{content:""}.fa-cake-candles:before{content:""}.fa-birthday-cake:before{content:""}.fa-cake:before{content:""}.fa-envelope:before{content:""}.fa-angles-up:before{content:""}.fa-angle-double-up:before{content:""}.fa-paperclip:before{content:""}.fa-arrow-right-to-city:before{content:""}.fa-ribbon:before{content:""}.fa-lungs:before{content:""}.fa-arrow-up-9-1:before{content:""}.fa-sort-numeric-up-alt:before{content:""}.fa-litecoin-sign:before{content:""}.fa-border-none:before{content:""}.fa-circle-nodes:before{content:""}.fa-parachute-box:before{content:""}.fa-indent:before{content:""}.fa-truck-field-un:before{content:""}.fa-hourglass:before{content:""}.fa-hourglass-empty:before{content:""}.fa-mountain:before{content:""}.fa-user-doctor:before{content:""}.fa-user-md:before{content:""}.fa-circle-info:before{content:""}.fa-info-circle:before{content:""}.fa-cloud-meatball:before{content:""}.fa-camera:before{content:""}.fa-camera-alt:before{content:""}.fa-square-virus:before{content:""}.fa-meteor:before{content:""}.fa-car-on:before{content:""}.fa-sleigh:before{content:""}.fa-arrow-down-1-9:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-down:before{content:""}.fa-hand-holding-droplet:before{content:""}.fa-hand-holding-water:before{content:""}.fa-water:before{content:""}.fa-calendar-check:before{content:""}.fa-braille:before{content:""}.fa-prescription-bottle-medical:before{content:""}.fa-prescription-bottle-alt:before{content:""}.fa-landmark:before{content:""}.fa-truck:before{content:""}.fa-crosshairs:before{content:""}.fa-person-cane:before{content:""}.fa-tent:before{content:""}.fa-vest-patches:before{content:""}.fa-check-double:before{content:""}.fa-arrow-down-a-z:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-down:before{content:""}.fa-money-bill-wheat:before{content:""}.fa-cookie:before{content:""}.fa-arrow-rotate-left:before{content:""}.fa-arrow-left-rotate:before{content:""}.fa-arrow-rotate-back:before{content:""}.fa-arrow-rotate-backward:before{content:""}.fa-undo:before{content:""}.fa-hard-drive:before{content:""}.fa-hdd:before{content:""}.fa-face-grin-squint-tears:before{content:""}.fa-grin-squint-tears:before{content:""}.fa-dumbbell:before{content:""}.fa-rectangle-list:before{content:""}.fa-list-alt:before{content:""}.fa-tarp-droplet:before{content:""}.fa-house-medical-circle-check:before{content:""}.fa-person-skiing-nordic:before{content:""}.fa-skiing-nordic:before{content:""}.fa-calendar-plus:before{content:""}.fa-plane-arrival:before{content:""}.fa-circle-left:before{content:""}.fa-arrow-alt-circle-left:before{content:""}.fa-train-subway:before{content:""}.fa-subway:before{content:""}.fa-chart-gantt:before{content:""}.fa-indian-rupee-sign:before{content:""}.fa-indian-rupee:before{content:""}.fa-inr:before{content:""}.fa-crop-simple:before{content:""}.fa-crop-alt:before{content:""}.fa-money-bill-1:before{content:""}.fa-money-bill-alt:before{content:""}.fa-left-long:before{content:""}.fa-long-arrow-alt-left:before{content:""}.fa-dna:before{content:""}.fa-virus-slash:before{content:""}.fa-minus:before{content:""}.fa-subtract:before{content:""}.fa-chess:before{content:""}.fa-arrow-left-long:before{content:""}.fa-long-arrow-left:before{content:""}.fa-plug-circle-check:before{content:""}.fa-street-view:before{content:""}.fa-franc-sign:before{content:""}.fa-volume-off:before{content:""}.fa-hands-asl-interpreting:before{content:""}.fa-american-sign-language-interpreting:before{content:""}.fa-asl-interpreting:before{content:""}.fa-hands-american-sign-language-interpreting:before{content:""}.fa-gear:before{content:""}.fa-cog:before{content:""}.fa-droplet-slash:before{content:""}.fa-tint-slash:before{content:""}.fa-mosque:before{content:""}.fa-mosquito:before{content:""}.fa-star-of-david:before{content:""}.fa-person-military-rifle:before{content:""}.fa-cart-shopping:before{content:""}.fa-shopping-cart:before{content:""}.fa-vials:before{content:""}.fa-plug-circle-plus:before{content:""}.fa-place-of-worship:before{content:""}.fa-grip-vertical:before{content:""}.fa-arrow-turn-up:before{content:""}.fa-level-up:before{content:""}.fa-u:before{content:"U"}.fa-square-root-variable:before{content:""}.fa-square-root-alt:before{content:""}.fa-clock:before{content:""}.fa-clock-four:before{content:""}.fa-backward-step:before{content:""}.fa-step-backward:before{content:""}.fa-pallet:before{content:""}.fa-faucet:before{content:""}.fa-baseball-bat-ball:before{content:""}.fa-s:before{content:"S"}.fa-timeline:before{content:""}.fa-keyboard:before{content:""}.fa-caret-down:before{content:""}.fa-house-chimney-medical:before{content:""}.fa-clinic-medical:before{content:""}.fa-temperature-three-quarters:before{content:""}.fa-temperature-3:before{content:""}.fa-thermometer-3:before{content:""}.fa-thermometer-three-quarters:before{content:""}.fa-mobile-screen:before{content:""}.fa-mobile-android-alt:before{content:""}.fa-plane-up:before{content:""}.fa-piggy-bank:before{content:""}.fa-battery-half:before{content:""}.fa-battery-3:before{content:""}.fa-mountain-city:before{content:""}.fa-coins:before{content:""}.fa-khanda:before{content:""}.fa-sliders:before{content:""}.fa-sliders-h:before{content:""}.fa-folder-tree:before{content:""}.fa-network-wired:before{content:""}.fa-map-pin:before{content:""}.fa-hamsa:before{content:""}.fa-cent-sign:before{content:""}.fa-flask:before{content:""}.fa-person-pregnant:before{content:""}.fa-wand-sparkles:before{content:""}.fa-ellipsis-vertical:before{content:""}.fa-ellipsis-v:before{content:""}.fa-ticket:before{content:""}.fa-power-off:before{content:""}.fa-right-long:before{content:""}.fa-long-arrow-alt-right:before{content:""}.fa-flag-usa:before{content:""}.fa-laptop-file:before{content:""}.fa-tty:before{content:""}.fa-teletype:before{content:""}.fa-diagram-next:before{content:""}.fa-person-rifle:before{content:""}.fa-house-medical-circle-exclamation:before{content:""}.fa-closed-captioning:before{content:""}.fa-person-hiking:before{content:""}.fa-hiking:before{content:""}.fa-venus-double:before{content:""}.fa-images:before{content:""}.fa-calculator:before{content:""}.fa-people-pulling:before{content:""}.fa-n:before{content:"N"}.fa-cable-car:before{content:""}.fa-tram:before{content:""}.fa-cloud-rain:before{content:""}.fa-building-circle-xmark:before{content:""}.fa-ship:before{content:""}.fa-arrows-down-to-line:before{content:""}.fa-download:before{content:""}.fa-face-grin:before{content:""}.fa-grin:before{content:""}.fa-delete-left:before{content:""}.fa-backspace:before{content:""}.fa-eye-dropper:before{content:""}.fa-eye-dropper-empty:before{content:""}.fa-eyedropper:before{content:""}.fa-file-circle-check:before{content:""}.fa-forward:before{content:""}.fa-mobile:before{content:""}.fa-mobile-android:before{content:""}.fa-mobile-phone:before{content:""}.fa-face-meh:before{content:""}.fa-meh:before{content:""}.fa-align-center:before{content:""}.fa-book-skull:before{content:""}.fa-book-dead:before{content:""}.fa-id-card:before{content:""}.fa-drivers-license:before{content:""}.fa-outdent:before{content:""}.fa-dedent:before{content:""}.fa-heart-circle-exclamation:before{content:""}.fa-house:before{content:""}.fa-home:before{content:""}.fa-home-alt:before{content:""}.fa-home-lg-alt:before{content:""}.fa-calendar-week:before{content:""}.fa-laptop-medical:before{content:""}.fa-b:before{content:"B"}.fa-file-medical:before{content:""}.fa-dice-one:before{content:""}.fa-kiwi-bird:before{content:""}.fa-arrow-right-arrow-left:before{content:""}.fa-exchange:before{content:""}.fa-rotate-right:before{content:""}.fa-redo-alt:before{content:""}.fa-rotate-forward:before{content:""}.fa-utensils:before{content:""}.fa-cutlery:before{content:""}.fa-arrow-up-wide-short:before{content:""}.fa-sort-amount-up:before{content:""}.fa-mill-sign:before{content:""}.fa-bowl-rice:before{content:""}.fa-skull:before{content:""}.fa-tower-broadcast:before{content:""}.fa-broadcast-tower:before{content:""}.fa-truck-pickup:before{content:""}.fa-up-long:before{content:""}.fa-long-arrow-alt-up:before{content:""}.fa-stop:before{content:""}.fa-code-merge:before{content:""}.fa-upload:before{content:""}.fa-hurricane:before{content:""}.fa-mound:before{content:""}.fa-toilet-portable:before{content:""}.fa-compact-disc:before{content:""}.fa-file-arrow-down:before{content:""}.fa-file-download:before{content:""}.fa-caravan:before{content:""}.fa-shield-cat:before{content:""}.fa-bolt:before{content:""}.fa-zap:before{content:""}.fa-glass-water:before{content:""}.fa-oil-well:before{content:""}.fa-vault:before{content:""}.fa-mars:before{content:""}.fa-toilet:before{content:""}.fa-plane-circle-xmark:before{content:""}.fa-yen-sign:before{content:""}.fa-cny:before{content:""}.fa-jpy:before{content:""}.fa-rmb:before{content:""}.fa-yen:before{content:""}.fa-ruble-sign:before{content:""}.fa-rouble:before{content:""}.fa-rub:before{content:""}.fa-ruble:before{content:""}.fa-sun:before{content:""}.fa-guitar:before{content:""}.fa-face-laugh-wink:before{content:""}.fa-laugh-wink:before{content:""}.fa-horse-head:before{content:""}.fa-bore-hole:before{content:""}.fa-industry:before{content:""}.fa-circle-down:before{content:""}.fa-arrow-alt-circle-down:before{content:""}.fa-arrows-turn-to-dots:before{content:""}.fa-florin-sign:before{content:""}.fa-arrow-down-short-wide:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-amount-down-alt:before{content:""}.fa-less-than:before{content:"<"}.fa-angle-down:before{content:""}.fa-car-tunnel:before{content:""}.fa-head-side-cough:before{content:""}.fa-grip-lines:before{content:""}.fa-thumbs-down:before{content:""}.fa-user-lock:before{content:""}.fa-arrow-right-long:before{content:""}.fa-long-arrow-right:before{content:""}.fa-anchor-circle-xmark:before{content:""}.fa-ellipsis:before{content:""}.fa-ellipsis-h:before{content:""}.fa-chess-pawn:before{content:""}.fa-kit-medical:before{content:""}.fa-first-aid:before{content:""}.fa-person-through-window:before{content:""}.fa-toolbox:before{content:""}.fa-hands-holding-circle:before{content:""}.fa-bug:before{content:""}.fa-credit-card:before{content:""}.fa-credit-card-alt:before{content:""}.fa-car:before{content:""}.fa-automobile:before{content:""}.fa-hand-holding-hand:before{content:""}.fa-book-open-reader:before{content:""}.fa-book-reader:before{content:""}.fa-mountain-sun:before{content:""}.fa-arrows-left-right-to-line:before{content:""}.fa-dice-d20:before{content:""}.fa-truck-droplet:before{content:""}.fa-file-circle-xmark:before{content:""}.fa-temperature-arrow-up:before{content:""}.fa-temperature-up:before{content:""}.fa-medal:before{content:""}.fa-bed:before{content:""}.fa-square-h:before{content:""}.fa-h-square:before{content:""}.fa-podcast:before{content:""}.fa-temperature-full:before{content:""}.fa-temperature-4:before{content:""}.fa-thermometer-4:before{content:""}.fa-thermometer-full:before{content:""}.fa-bell:before{content:""}.fa-superscript:before{content:""}.fa-plug-circle-xmark:before{content:""}.fa-star-of-life:before{content:""}.fa-phone-slash:before{content:""}.fa-paint-roller:before{content:""}.fa-handshake-angle:before{content:""}.fa-hands-helping:before{content:""}.fa-location-dot:before{content:""}.fa-map-marker-alt:before{content:""}.fa-file:before{content:""}.fa-greater-than:before{content:">"}.fa-person-swimming:before{content:""}.fa-swimmer:before{content:""}.fa-arrow-down:before{content:""}.fa-droplet:before{content:""}.fa-tint:before{content:""}.fa-eraser:before{content:""}.fa-earth-americas:before{content:""}.fa-earth:before{content:""}.fa-earth-america:before{content:""}.fa-globe-americas:before{content:""}.fa-person-burst:before{content:""}.fa-dove:before{content:""}.fa-battery-empty:before{content:""}.fa-battery-0:before{content:""}.fa-socks:before{content:""}.fa-inbox:before{content:""}.fa-section:before{content:""}.fa-gauge-high:before{content:""}.fa-tachometer-alt:before{content:""}.fa-tachometer-alt-fast:before{content:""}.fa-envelope-open-text:before{content:""}.fa-hospital:before{content:""}.fa-hospital-alt:before{content:""}.fa-hospital-wide:before{content:""}.fa-wine-bottle:before{content:""}.fa-chess-rook:before{content:""}.fa-bars-staggered:before{content:""}.fa-reorder:before{content:""}.fa-stream:before{content:""}.fa-dharmachakra:before{content:""}.fa-hotdog:before{content:""}.fa-person-walking-with-cane:before{content:""}.fa-blind:before{content:""}.fa-drum:before{content:""}.fa-ice-cream:before{content:""}.fa-heart-circle-bolt:before{content:""}.fa-fax:before{content:""}.fa-paragraph:before{content:""}.fa-check-to-slot:before{content:""}.fa-vote-yea:before{content:""}.fa-star-half:before{content:""}.fa-boxes-stacked:before{content:""}.fa-boxes:before{content:""}.fa-boxes-alt:before{content:""}.fa-link:before{content:""}.fa-chain:before{content:""}.fa-ear-listen:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-tree-city:before{content:""}.fa-play:before{content:""}.fa-font:before{content:""}.fa-rupiah-sign:before{content:""}.fa-magnifying-glass:before{content:""}.fa-search:before{content:""}.fa-table-tennis-paddle-ball:before{content:""}.fa-ping-pong-paddle-ball:before{content:""}.fa-table-tennis:before{content:""}.fa-person-dots-from-line:before{content:""}.fa-diagnoses:before{content:""}.fa-trash-can-arrow-up:before{content:""}.fa-trash-restore-alt:before{content:""}.fa-naira-sign:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-walkie-talkie:before{content:""}.fa-file-pen:before{content:""}.fa-file-edit:before{content:""}.fa-receipt:before{content:""}.fa-square-pen:before{content:""}.fa-pen-square:before{content:""}.fa-pencil-square:before{content:""}.fa-suitcase-rolling:before{content:""}.fa-person-circle-exclamation:before{content:""}.fa-chevron-down:before{content:""}.fa-battery-full:before{content:""}.fa-battery:before{content:""}.fa-battery-5:before{content:""}.fa-skull-crossbones:before{content:""}.fa-code-compare:before{content:""}.fa-list-ul:before{content:""}.fa-list-dots:before{content:""}.fa-school-lock:before{content:""}.fa-tower-cell:before{content:""}.fa-down-long:before{content:""}.fa-long-arrow-alt-down:before{content:""}.fa-ranking-star:before{content:""}.fa-chess-king:before{content:""}.fa-person-harassing:before{content:""}.fa-brazilian-real-sign:before{content:""}.fa-landmark-dome:before{content:""}.fa-landmark-alt:before{content:""}.fa-arrow-up:before{content:""}.fa-tv:before{content:""}.fa-television:before{content:""}.fa-tv-alt:before{content:""}.fa-shrimp:before{content:""}.fa-list-check:before{content:""}.fa-tasks:before{content:""}.fa-jug-detergent:before{content:""}.fa-circle-user:before{content:""}.fa-user-circle:before{content:""}.fa-user-shield:before{content:""}.fa-wind:before{content:""}.fa-car-burst:before{content:""}.fa-car-crash:before{content:""}.fa-y:before{content:"Y"}.fa-person-snowboarding:before{content:""}.fa-snowboarding:before{content:""}.fa-truck-fast:before{content:""}.fa-shipping-fast:before{content:""}.fa-fish:before{content:""}.fa-user-graduate:before{content:""}.fa-circle-half-stroke:before{content:""}.fa-adjust:before{content:""}.fa-clapperboard:before{content:""}.fa-circle-radiation:before{content:""}.fa-radiation-alt:before{content:""}.fa-baseball:before{content:""}.fa-baseball-ball:before{content:""}.fa-jet-fighter-up:before{content:""}.fa-diagram-project:before{content:""}.fa-project-diagram:before{content:""}.fa-copy:before{content:""}.fa-volume-xmark:before{content:""}.fa-volume-mute:before{content:""}.fa-volume-times:before{content:""}.fa-hand-sparkles:before{content:""}.fa-grip:before{content:""}.fa-grip-horizontal:before{content:""}.fa-share-from-square:before{content:""}.fa-share-square:before{content:""}.fa-child-combatant:before{content:""}.fa-child-rifle:before{content:""}.fa-gun:before{content:""}.fa-square-phone:before{content:""}.fa-phone-square:before{content:""}.fa-plus:before{content:"+"}.fa-add:before{content:"+"}.fa-expand:before{content:""}.fa-computer:before{content:""}.fa-xmark:before{content:""}.fa-close:before{content:""}.fa-multiply:before{content:""}.fa-remove:before{content:""}.fa-times:before{content:""}.fa-arrows-up-down-left-right:before{content:""}.fa-arrows:before{content:""}.fa-chalkboard-user:before{content:""}.fa-chalkboard-teacher:before{content:""}.fa-peso-sign:before{content:""}.fa-building-shield:before{content:""}.fa-baby:before{content:""}.fa-users-line:before{content:""}.fa-quote-left:before{content:""}.fa-quote-left-alt:before{content:""}.fa-tractor:before{content:""}.fa-trash-arrow-up:before{content:""}.fa-trash-restore:before{content:""}.fa-arrow-down-up-lock:before{content:""}.fa-lines-leaning:before{content:""}.fa-ruler-combined:before{content:""}.fa-copyright:before{content:""}.fa-equals:before{content:"="}.fa-blender:before{content:""}.fa-teeth:before{content:""}.fa-shekel-sign:before{content:""}.fa-ils:before{content:""}.fa-shekel:before{content:""}.fa-sheqel:before{content:""}.fa-sheqel-sign:before{content:""}.fa-map:before{content:""}.fa-rocket:before{content:""}.fa-photo-film:before{content:""}.fa-photo-video:before{content:""}.fa-folder-minus:before{content:""}.fa-store:before{content:""}.fa-arrow-trend-up:before{content:""}.fa-plug-circle-minus:before{content:""}.fa-sign-hanging:before{content:""}.fa-sign:before{content:""}.fa-bezier-curve:before{content:""}.fa-bell-slash:before{content:""}.fa-tablet:before{content:""}.fa-tablet-android:before{content:""}.fa-school-flag:before{content:""}.fa-fill:before{content:""}.fa-angle-up:before{content:""}.fa-drumstick-bite:before{content:""}.fa-holly-berry:before{content:""}.fa-chevron-left:before{content:""}.fa-bacteria:before{content:""}.fa-hand-lizard:before{content:""}.fa-notdef:before{content:""}.fa-disease:before{content:""}.fa-briefcase-medical:before{content:""}.fa-genderless:before{content:""}.fa-chevron-right:before{content:""}.fa-retweet:before{content:""}.fa-car-rear:before{content:""}.fa-car-alt:before{content:""}.fa-pump-soap:before{content:""}.fa-video-slash:before{content:""}.fa-battery-quarter:before{content:""}.fa-battery-2:before{content:""}.fa-radio:before{content:""}.fa-baby-carriage:before{content:""}.fa-carriage-baby:before{content:""}.fa-traffic-light:before{content:""}.fa-thermometer:before{content:""}.fa-vr-cardboard:before{content:""}.fa-hand-middle-finger:before{content:""}.fa-percent:before{content:"%"}.fa-percentage:before{content:"%"}.fa-truck-moving:before{content:""}.fa-glass-water-droplet:before{content:""}.fa-display:before{content:""}.fa-face-smile:before{content:""}.fa-smile:before{content:""}.fa-thumbtack:before{content:""}.fa-thumb-tack:before{content:""}.fa-trophy:before{content:""}.fa-person-praying:before{content:""}.fa-pray:before{content:""}.fa-hammer:before{content:""}.fa-hand-peace:before{content:""}.fa-rotate:before{content:""}.fa-sync-alt:before{content:""}.fa-spinner:before{content:""}.fa-robot:before{content:""}.fa-peace:before{content:""}.fa-gears:before{content:""}.fa-cogs:before{content:""}.fa-warehouse:before{content:""}.fa-arrow-up-right-dots:before{content:""}.fa-splotch:before{content:""}.fa-face-grin-hearts:before{content:""}.fa-grin-hearts:before{content:""}.fa-dice-four:before{content:""}.fa-sim-card:before{content:""}.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-mercury:before{content:""}.fa-arrow-turn-down:before{content:""}.fa-level-down:before{content:""}.fa-person-falling-burst:before{content:""}.fa-award:before{content:""}.fa-ticket-simple:before{content:""}.fa-ticket-alt:before{content:""}.fa-building:before{content:""}.fa-angles-left:before{content:""}.fa-angle-double-left:before{content:""}.fa-qrcode:before{content:""}.fa-clock-rotate-left:before{content:""}.fa-history:before{content:""}.fa-face-grin-beam-sweat:before{content:""}.fa-grin-beam-sweat:before{content:""}.fa-file-export:before{content:""}.fa-arrow-right-from-file:before{content:""}.fa-shield:before{content:""}.fa-shield-blank:before{content:""}.fa-arrow-up-short-wide:before{content:""}.fa-sort-amount-up-alt:before{content:""}.fa-house-medical:before{content:""}.fa-golf-ball-tee:before{content:""}.fa-golf-ball:before{content:""}.fa-circle-chevron-left:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-house-chimney-window:before{content:""}.fa-pen-nib:before{content:""}.fa-tent-arrow-turn-left:before{content:""}.fa-tents:before{content:""}.fa-wand-magic:before{content:""}.fa-magic:before{content:""}.fa-dog:before{content:""}.fa-carrot:before{content:""}.fa-moon:before{content:""}.fa-wine-glass-empty:before{content:""}.fa-wine-glass-alt:before{content:""}.fa-cheese:before{content:""}.fa-yin-yang:before{content:""}.fa-music:before{content:""}.fa-code-commit:before{content:""}.fa-temperature-low:before{content:""}.fa-person-biking:before{content:""}.fa-biking:before{content:""}.fa-broom:before{content:""}.fa-shield-heart:before{content:""}.fa-gopuram:before{content:""}.fa-earth-oceania:before{content:""}.fa-globe-oceania:before{content:""}.fa-square-xmark:before{content:""}.fa-times-square:before{content:""}.fa-xmark-square:before{content:""}.fa-hashtag:before{content:"#"}.fa-up-right-and-down-left-from-center:before{content:""}.fa-expand-alt:before{content:""}.fa-oil-can:before{content:""}.fa-t:before{content:"T"}.fa-hippo:before{content:""}.fa-chart-column:before{content:""}.fa-infinity:before{content:""}.fa-vial-circle-check:before{content:""}.fa-person-arrow-down-to-line:before{content:""}.fa-voicemail:before{content:""}.fa-fan:before{content:""}.fa-person-walking-luggage:before{content:""}.fa-up-down:before{content:""}.fa-arrows-alt-v:before{content:""}.fa-cloud-moon-rain:before{content:""}.fa-calendar:before{content:""}.fa-trailer:before{content:""}.fa-bahai:before{content:""}.fa-haykal:before{content:""}.fa-sd-card:before{content:""}.fa-dragon:before{content:""}.fa-shoe-prints:before{content:""}.fa-circle-plus:before{content:""}.fa-plus-circle:before{content:""}.fa-face-grin-tongue-wink:before{content:""}.fa-grin-tongue-wink:before{content:""}.fa-hand-holding:before{content:""}.fa-plug-circle-exclamation:before{content:""}.fa-link-slash:before{content:""}.fa-chain-broken:before{content:""}.fa-chain-slash:before{content:""}.fa-unlink:before{content:""}.fa-clone:before{content:""}.fa-person-walking-arrow-loop-left:before{content:""}.fa-arrow-up-z-a:before{content:""}.fa-sort-alpha-up-alt:before{content:""}.fa-fire-flame-curved:before{content:""}.fa-fire-alt:before{content:""}.fa-tornado:before{content:""}.fa-file-circle-plus:before{content:""}.fa-book-quran:before{content:""}.fa-quran:before{content:""}.fa-anchor:before{content:""}.fa-border-all:before{content:""}.fa-face-angry:before{content:""}.fa-angry:before{content:""}.fa-cookie-bite:before{content:""}.fa-arrow-trend-down:before{content:""}.fa-rss:before{content:""}.fa-feed:before{content:""}.fa-draw-polygon:before{content:""}.fa-scale-balanced:before{content:""}.fa-balance-scale:before{content:""}.fa-gauge-simple-high:before{content:""}.fa-tachometer:before{content:""}.fa-tachometer-fast:before{content:""}.fa-shower:before{content:""}.fa-desktop:before{content:""}.fa-desktop-alt:before{content:""}.fa-m:before{content:"M"}.fa-table-list:before{content:""}.fa-th-list:before{content:""}.fa-comment-sms:before{content:""}.fa-sms:before{content:""}.fa-book:before{content:""}.fa-user-plus:before{content:""}.fa-check:before{content:""}.fa-battery-three-quarters:before{content:""}.fa-battery-4:before{content:""}.fa-house-circle-check:before{content:""}.fa-angle-left:before{content:""}.fa-diagram-successor:before{content:""}.fa-truck-arrow-right:before{content:""}.fa-arrows-split-up-and-left:before{content:""}.fa-hand-fist:before{content:""}.fa-fist-raised:before{content:""}.fa-cloud-moon:before{content:""}.fa-briefcase:before{content:""}.fa-person-falling:before{content:""}.fa-image-portrait:before{content:""}.fa-portrait:before{content:""}.fa-user-tag:before{content:""}.fa-rug:before{content:""}.fa-earth-europe:before{content:""}.fa-globe-europe:before{content:""}.fa-cart-flatbed-suitcase:before{content:""}.fa-luggage-cart:before{content:""}.fa-rectangle-xmark:before{content:""}.fa-rectangle-times:before{content:""}.fa-times-rectangle:before{content:""}.fa-window-close:before{content:""}.fa-baht-sign:before{content:""}.fa-book-open:before{content:""}.fa-book-journal-whills:before{content:""}.fa-journal-whills:before{content:""}.fa-handcuffs:before{content:""}.fa-triangle-exclamation:before{content:""}.fa-exclamation-triangle:before{content:""}.fa-warning:before{content:""}.fa-database:before{content:""}.fa-share:before{content:""}.fa-arrow-turn-right:before{content:""}.fa-mail-forward:before{content:""}.fa-bottle-droplet:before{content:""}.fa-mask-face:before{content:""}.fa-hill-rockslide:before{content:""}.fa-right-left:before{content:""}.fa-exchange-alt:before{content:""}.fa-paper-plane:before{content:""}.fa-road-circle-exclamation:before{content:""}.fa-dungeon:before{content:""}.fa-align-right:before{content:""}.fa-money-bill-1-wave:before{content:""}.fa-money-bill-wave-alt:before{content:""}.fa-life-ring:before{content:""}.fa-hands:before{content:""}.fa-sign-language:before{content:""}.fa-signing:before{content:""}.fa-calendar-day:before{content:""}.fa-water-ladder:before{content:""}.fa-ladder-water:before{content:""}.fa-swimming-pool:before{content:""}.fa-arrows-up-down:before{content:""}.fa-arrows-v:before{content:""}.fa-face-grimace:before{content:""}.fa-grimace:before{content:""}.fa-wheelchair-move:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-turn-down:before{content:""}.fa-level-down-alt:before{content:""}.fa-person-walking-arrow-right:before{content:""}.fa-square-envelope:before{content:""}.fa-envelope-square:before{content:""}.fa-dice:before{content:""}.fa-bowling-ball:before{content:""}.fa-brain:before{content:""}.fa-bandage:before{content:""}.fa-band-aid:before{content:""}.fa-calendar-minus:before{content:""}.fa-circle-xmark:before{content:""}.fa-times-circle:before{content:""}.fa-xmark-circle:before{content:""}.fa-gifts:before{content:""}.fa-hotel:before{content:""}.fa-earth-asia:before{content:""}.fa-globe-asia:before{content:""}.fa-id-card-clip:before{content:""}.fa-id-card-alt:before{content:""}.fa-magnifying-glass-plus:before{content:""}.fa-search-plus:before{content:""}.fa-thumbs-up:before{content:""}.fa-user-clock:before{content:""}.fa-hand-dots:before{content:""}.fa-allergies:before{content:""}.fa-file-invoice:before{content:""}.fa-window-minimize:before{content:""}.fa-mug-saucer:before{content:""}.fa-coffee:before{content:""}.fa-brush:before{content:""}.fa-mask:before{content:""}.fa-magnifying-glass-minus:before{content:""}.fa-search-minus:before{content:""}.fa-ruler-vertical:before{content:""}.fa-user-large:before{content:""}.fa-user-alt:before{content:""}.fa-train-tram:before{content:""}.fa-user-nurse:before{content:""}.fa-syringe:before{content:""}.fa-cloud-sun:before{content:""}.fa-stopwatch-20:before{content:""}.fa-square-full:before{content:""}.fa-magnet:before{content:""}.fa-jar:before{content:""}.fa-note-sticky:before{content:""}.fa-sticky-note:before{content:""}.fa-bug-slash:before{content:""}.fa-arrow-up-from-water-pump:before{content:""}.fa-bone:before{content:""}.fa-user-injured:before{content:""}.fa-face-sad-tear:before{content:""}.fa-sad-tear:before{content:""}.fa-plane:before{content:""}.fa-tent-arrows-down:before{content:""}.fa-exclamation:before{content:"!"}.fa-arrows-spin:before{content:""}.fa-print:before{content:""}.fa-turkish-lira-sign:before{content:""}.fa-try:before{content:""}.fa-turkish-lira:before{content:""}.fa-dollar-sign:before{content:"$"}.fa-dollar:before{content:"$"}.fa-usd:before{content:"$"}.fa-x:before{content:"X"}.fa-magnifying-glass-dollar:before{content:""}.fa-search-dollar:before{content:""}.fa-users-gear:before{content:""}.fa-users-cog:before{content:""}.fa-person-military-pointing:before{content:""}.fa-building-columns:before{content:""}.fa-bank:before{content:""}.fa-institution:before{content:""}.fa-museum:before{content:""}.fa-university:before{content:""}.fa-umbrella:before{content:""}.fa-trowel:before{content:""}.fa-d:before{content:"D"}.fa-stapler:before{content:""}.fa-masks-theater:before{content:""}.fa-theater-masks:before{content:""}.fa-kip-sign:before{content:""}.fa-hand-point-left:before{content:""}.fa-handshake-simple:before{content:""}.fa-handshake-alt:before{content:""}.fa-jet-fighter:before{content:""}.fa-fighter-jet:before{content:""}.fa-square-share-nodes:before{content:""}.fa-share-alt-square:before{content:""}.fa-barcode:before{content:""}.fa-plus-minus:before{content:""}.fa-video:before{content:""}.fa-video-camera:before{content:""}.fa-graduation-cap:before{content:""}.fa-mortar-board:before{content:""}.fa-hand-holding-medical:before{content:""}.fa-person-circle-check:before{content:""}.fa-turn-up:before{content:""}.fa-level-up-alt:before{content:""}.sr-only,.fa-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.sr-only-focusable:not(:focus),.fa-sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:root,:host{--fa-style-family-brands: "Font Awesome 6 Brands";--fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"}@font-face{font-family:"Font Awesome 6 Brands";font-style:normal;font-weight:400;font-display:block;src:url(./fa-brands-400-faae6fc0.woff2) format("woff2"),url(./fa-brands-400-003f1154.ttf) format("truetype")}.fab,.fa-brands{font-weight:400}.fa-monero:before{content:""}.fa-hooli:before{content:""}.fa-yelp:before{content:""}.fa-cc-visa:before{content:""}.fa-lastfm:before{content:""}.fa-shopware:before{content:""}.fa-creative-commons-nc:before{content:""}.fa-aws:before{content:""}.fa-redhat:before{content:""}.fa-yoast:before{content:""}.fa-cloudflare:before{content:""}.fa-ups:before{content:""}.fa-wpexplorer:before{content:""}.fa-dyalog:before{content:""}.fa-bity:before{content:""}.fa-stackpath:before{content:""}.fa-buysellads:before{content:""}.fa-first-order:before{content:""}.fa-modx:before{content:""}.fa-guilded:before{content:""}.fa-vnv:before{content:""}.fa-square-js:before{content:""}.fa-js-square:before{content:""}.fa-microsoft:before{content:""}.fa-qq:before{content:""}.fa-orcid:before{content:""}.fa-java:before{content:""}.fa-invision:before{content:""}.fa-creative-commons-pd-alt:before{content:""}.fa-centercode:before{content:""}.fa-glide-g:before{content:""}.fa-drupal:before{content:""}.fa-hire-a-helper:before{content:""}.fa-creative-commons-by:before{content:""}.fa-unity:before{content:""}.fa-whmcs:before{content:""}.fa-rocketchat:before{content:""}.fa-vk:before{content:""}.fa-untappd:before{content:""}.fa-mailchimp:before{content:""}.fa-css3-alt:before{content:""}.fa-square-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-vimeo-v:before{content:""}.fa-contao:before{content:""}.fa-square-font-awesome:before{content:""}.fa-deskpro:before{content:""}.fa-sistrix:before{content:""}.fa-square-instagram:before{content:""}.fa-instagram-square:before{content:""}.fa-battle-net:before{content:""}.fa-the-red-yeti:before{content:""}.fa-square-hacker-news:before{content:""}.fa-hacker-news-square:before{content:""}.fa-edge:before{content:""}.fa-threads:before{content:""}.fa-napster:before{content:""}.fa-square-snapchat:before{content:""}.fa-snapchat-square:before{content:""}.fa-google-plus-g:before{content:""}.fa-artstation:before{content:""}.fa-markdown:before{content:""}.fa-sourcetree:before{content:""}.fa-google-plus:before{content:""}.fa-diaspora:before{content:""}.fa-foursquare:before{content:""}.fa-stack-overflow:before{content:""}.fa-github-alt:before{content:""}.fa-phoenix-squadron:before{content:""}.fa-pagelines:before{content:""}.fa-algolia:before{content:""}.fa-red-river:before{content:""}.fa-creative-commons-sa:before{content:""}.fa-safari:before{content:""}.fa-google:before{content:""}.fa-square-font-awesome-stroke:before{content:""}.fa-font-awesome-alt:before{content:""}.fa-atlassian:before{content:""}.fa-linkedin-in:before{content:""}.fa-digital-ocean:before{content:""}.fa-nimblr:before{content:""}.fa-chromecast:before{content:""}.fa-evernote:before{content:""}.fa-hacker-news:before{content:""}.fa-creative-commons-sampling:before{content:""}.fa-adversal:before{content:""}.fa-creative-commons:before{content:""}.fa-watchman-monitoring:before{content:""}.fa-fonticons:before{content:""}.fa-weixin:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-codepen:before{content:""}.fa-git-alt:before{content:""}.fa-lyft:before{content:""}.fa-rev:before{content:""}.fa-windows:before{content:""}.fa-wizards-of-the-coast:before{content:""}.fa-square-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-meetup:before{content:""}.fa-centos:before{content:""}.fa-adn:before{content:""}.fa-cloudsmith:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-square-dribbble:before{content:""}.fa-dribbble-square:before{content:""}.fa-codiepie:before{content:""}.fa-node:before{content:""}.fa-mix:before{content:""}.fa-steam:before{content:""}.fa-cc-apple-pay:before{content:""}.fa-scribd:before{content:""}.fa-debian:before{content:""}.fa-openid:before{content:""}.fa-instalod:before{content:""}.fa-expeditedssl:before{content:""}.fa-sellcast:before{content:""}.fa-square-twitter:before{content:""}.fa-twitter-square:before{content:""}.fa-r-project:before{content:""}.fa-delicious:before{content:""}.fa-freebsd:before{content:""}.fa-vuejs:before{content:""}.fa-accusoft:before{content:""}.fa-ioxhost:before{content:""}.fa-fonticons-fi:before{content:""}.fa-app-store:before{content:""}.fa-cc-mastercard:before{content:""}.fa-itunes-note:before{content:""}.fa-golang:before{content:""}.fa-kickstarter:before{content:""}.fa-grav:before{content:""}.fa-weibo:before{content:""}.fa-uncharted:before{content:""}.fa-firstdraft:before{content:""}.fa-square-youtube:before{content:""}.fa-youtube-square:before{content:""}.fa-wikipedia-w:before{content:""}.fa-wpressr:before{content:""}.fa-rendact:before{content:""}.fa-angellist:before{content:""}.fa-galactic-republic:before{content:""}.fa-nfc-directional:before{content:""}.fa-skype:before{content:""}.fa-joget:before{content:""}.fa-fedora:before{content:""}.fa-stripe-s:before{content:""}.fa-meta:before{content:""}.fa-laravel:before{content:""}.fa-hotjar:before{content:""}.fa-bluetooth-b:before{content:""}.fa-sticker-mule:before{content:""}.fa-creative-commons-zero:before{content:""}.fa-hips:before{content:""}.fa-behance:before{content:""}.fa-reddit:before{content:""}.fa-discord:before{content:""}.fa-chrome:before{content:""}.fa-app-store-ios:before{content:""}.fa-cc-discover:before{content:""}.fa-wpbeginner:before{content:""}.fa-confluence:before{content:""}.fa-mdb:before{content:""}.fa-dochub:before{content:""}.fa-accessible-icon:before{content:""}.fa-ebay:before{content:""}.fa-amazon:before{content:""}.fa-unsplash:before{content:""}.fa-yarn:before{content:""}.fa-square-steam:before{content:""}.fa-steam-square:before{content:""}.fa-500px:before{content:""}.fa-square-vimeo:before{content:""}.fa-vimeo-square:before{content:""}.fa-asymmetrik:before{content:""}.fa-font-awesome:before{content:""}.fa-font-awesome-flag:before{content:""}.fa-font-awesome-logo-full:before{content:""}.fa-gratipay:before{content:""}.fa-apple:before{content:""}.fa-hive:before{content:""}.fa-gitkraken:before{content:""}.fa-keybase:before{content:""}.fa-apple-pay:before{content:""}.fa-padlet:before{content:""}.fa-amazon-pay:before{content:""}.fa-square-github:before{content:""}.fa-github-square:before{content:""}.fa-stumbleupon:before{content:""}.fa-fedex:before{content:""}.fa-phoenix-framework:before{content:""}.fa-shopify:before{content:""}.fa-neos:before{content:""}.fa-square-threads:before{content:""}.fa-hackerrank:before{content:""}.fa-researchgate:before{content:""}.fa-swift:before{content:""}.fa-angular:before{content:""}.fa-speakap:before{content:""}.fa-angrycreative:before{content:""}.fa-y-combinator:before{content:""}.fa-empire:before{content:""}.fa-envira:before{content:""}.fa-square-gitlab:before{content:""}.fa-gitlab-square:before{content:""}.fa-studiovinari:before{content:""}.fa-pied-piper:before{content:""}.fa-wordpress:before{content:""}.fa-product-hunt:before{content:""}.fa-firefox:before{content:""}.fa-linode:before{content:""}.fa-goodreads:before{content:""}.fa-square-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-jsfiddle:before{content:""}.fa-sith:before{content:""}.fa-themeisle:before{content:""}.fa-page4:before{content:""}.fa-hashnode:before{content:""}.fa-react:before{content:""}.fa-cc-paypal:before{content:""}.fa-squarespace:before{content:""}.fa-cc-stripe:before{content:""}.fa-creative-commons-share:before{content:""}.fa-bitcoin:before{content:""}.fa-keycdn:before{content:""}.fa-opera:before{content:""}.fa-itch-io:before{content:""}.fa-umbraco:before{content:""}.fa-galactic-senate:before{content:""}.fa-ubuntu:before{content:""}.fa-draft2digital:before{content:""}.fa-stripe:before{content:""}.fa-houzz:before{content:""}.fa-gg:before{content:""}.fa-dhl:before{content:""}.fa-square-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-xing:before{content:""}.fa-blackberry:before{content:""}.fa-creative-commons-pd:before{content:""}.fa-playstation:before{content:""}.fa-quinscape:before{content:""}.fa-less:before{content:""}.fa-blogger-b:before{content:""}.fa-opencart:before{content:""}.fa-vine:before{content:""}.fa-paypal:before{content:""}.fa-gitlab:before{content:""}.fa-typo3:before{content:""}.fa-reddit-alien:before{content:""}.fa-yahoo:before{content:""}.fa-dailymotion:before{content:""}.fa-affiliatetheme:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-bootstrap:before{content:""}.fa-odnoklassniki:before{content:""}.fa-nfc-symbol:before{content:""}.fa-ethereum:before{content:""}.fa-speaker-deck:before{content:""}.fa-creative-commons-nc-eu:before{content:""}.fa-patreon:before{content:""}.fa-avianex:before{content:""}.fa-ello:before{content:""}.fa-gofore:before{content:""}.fa-bimobject:before{content:""}.fa-facebook-f:before{content:""}.fa-square-google-plus:before{content:""}.fa-google-plus-square:before{content:""}.fa-mandalorian:before{content:""}.fa-first-order-alt:before{content:""}.fa-osi:before{content:""}.fa-google-wallet:before{content:""}.fa-d-and-d-beyond:before{content:""}.fa-periscope:before{content:""}.fa-fulcrum:before{content:""}.fa-cloudscale:before{content:""}.fa-forumbee:before{content:""}.fa-mizuni:before{content:""}.fa-schlix:before{content:""}.fa-square-xing:before{content:""}.fa-xing-square:before{content:""}.fa-bandcamp:before{content:""}.fa-wpforms:before{content:""}.fa-cloudversify:before{content:""}.fa-usps:before{content:""}.fa-megaport:before{content:""}.fa-magento:before{content:""}.fa-spotify:before{content:""}.fa-optin-monster:before{content:""}.fa-fly:before{content:""}.fa-aviato:before{content:""}.fa-itunes:before{content:""}.fa-cuttlefish:before{content:""}.fa-blogger:before{content:""}.fa-flickr:before{content:""}.fa-viber:before{content:""}.fa-soundcloud:before{content:""}.fa-digg:before{content:""}.fa-tencent-weibo:before{content:""}.fa-symfony:before{content:""}.fa-maxcdn:before{content:""}.fa-etsy:before{content:""}.fa-facebook-messenger:before{content:""}.fa-audible:before{content:""}.fa-think-peaks:before{content:""}.fa-bilibili:before{content:""}.fa-erlang:before{content:""}.fa-x-twitter:before{content:""}.fa-cotton-bureau:before{content:""}.fa-dashcube:before{content:""}.fa-42-group:before{content:""}.fa-innosoft:before{content:""}.fa-stack-exchange:before{content:""}.fa-elementor:before{content:""}.fa-square-pied-piper:before{content:""}.fa-pied-piper-square:before{content:""}.fa-creative-commons-nd:before{content:""}.fa-palfed:before{content:""}.fa-superpowers:before{content:""}.fa-resolving:before{content:""}.fa-xbox:before{content:""}.fa-searchengin:before{content:""}.fa-tiktok:before{content:""}.fa-square-facebook:before{content:""}.fa-facebook-square:before{content:""}.fa-renren:before{content:""}.fa-linux:before{content:""}.fa-glide:before{content:""}.fa-linkedin:before{content:""}.fa-hubspot:before{content:""}.fa-deploydog:before{content:""}.fa-twitch:before{content:""}.fa-ravelry:before{content:""}.fa-mixer:before{content:""}.fa-square-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-vimeo:before{content:""}.fa-mendeley:before{content:""}.fa-uniregistry:before{content:""}.fa-figma:before{content:""}.fa-creative-commons-remix:before{content:""}.fa-cc-amazon-pay:before{content:""}.fa-dropbox:before{content:""}.fa-instagram:before{content:""}.fa-cmplid:before{content:""}.fa-facebook:before{content:""}.fa-gripfire:before{content:""}.fa-jedi-order:before{content:""}.fa-uikit:before{content:""}.fa-fort-awesome-alt:before{content:""}.fa-phabricator:before{content:""}.fa-ussunnah:before{content:""}.fa-earlybirds:before{content:""}.fa-trade-federation:before{content:""}.fa-autoprefixer:before{content:""}.fa-whatsapp:before{content:""}.fa-slideshare:before{content:""}.fa-google-play:before{content:""}.fa-viadeo:before{content:""}.fa-line:before{content:""}.fa-google-drive:before{content:""}.fa-servicestack:before{content:""}.fa-simplybuilt:before{content:""}.fa-bitbucket:before{content:""}.fa-imdb:before{content:""}.fa-deezer:before{content:""}.fa-raspberry-pi:before{content:""}.fa-jira:before{content:""}.fa-docker:before{content:""}.fa-screenpal:before{content:""}.fa-bluetooth:before{content:""}.fa-gitter:before{content:""}.fa-d-and-d:before{content:""}.fa-microblog:before{content:""}.fa-cc-diners-club:before{content:""}.fa-gg-circle:before{content:""}.fa-pied-piper-hat:before{content:""}.fa-kickstarter-k:before{content:""}.fa-yandex:before{content:""}.fa-readme:before{content:""}.fa-html5:before{content:""}.fa-sellsy:before{content:""}.fa-sass:before{content:""}.fa-wirsindhandwerk:before{content:""}.fa-wsh:before{content:""}.fa-buromobelexperte:before{content:""}.fa-salesforce:before{content:""}.fa-octopus-deploy:before{content:""}.fa-medapps:before{content:""}.fa-ns8:before{content:""}.fa-pinterest-p:before{content:""}.fa-apper:before{content:""}.fa-fort-awesome:before{content:""}.fa-waze:before{content:""}.fa-cc-jcb:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-fantasy-flight-games:before{content:""}.fa-rust:before{content:""}.fa-wix:before{content:""}.fa-square-behance:before{content:""}.fa-behance-square:before{content:""}.fa-supple:before{content:""}.fa-rebel:before{content:""}.fa-css3:before{content:""}.fa-staylinked:before{content:""}.fa-kaggle:before{content:""}.fa-space-awesome:before{content:""}.fa-deviantart:before{content:""}.fa-cpanel:before{content:""}.fa-goodreads-g:before{content:""}.fa-square-git:before{content:""}.fa-git-square:before{content:""}.fa-square-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-trello:before{content:""}.fa-creative-commons-nc-jp:before{content:""}.fa-get-pocket:before{content:""}.fa-perbyte:before{content:""}.fa-grunt:before{content:""}.fa-weebly:before{content:""}.fa-connectdevelop:before{content:""}.fa-leanpub:before{content:""}.fa-black-tie:before{content:""}.fa-themeco:before{content:""}.fa-python:before{content:""}.fa-android:before{content:""}.fa-bots:before{content:""}.fa-free-code-camp:before{content:""}.fa-hornbill:before{content:""}.fa-js:before{content:""}.fa-ideal:before{content:""}.fa-git:before{content:""}.fa-dev:before{content:""}.fa-sketch:before{content:""}.fa-yandex-international:before{content:""}.fa-cc-amex:before{content:""}.fa-uber:before{content:""}.fa-github:before{content:""}.fa-php:before{content:""}.fa-alipay:before{content:""}.fa-youtube:before{content:""}.fa-skyatlas:before{content:""}.fa-firefox-browser:before{content:""}.fa-replyd:before{content:""}.fa-suse:before{content:""}.fa-jenkins:before{content:""}.fa-twitter:before{content:""}.fa-rockrms:before{content:""}.fa-pinterest:before{content:""}.fa-buffer:before{content:""}.fa-npm:before{content:""}.fa-yammer:before{content:""}.fa-btc:before{content:""}.fa-dribbble:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-internet-explorer:before{content:""}.fa-stubber:before{content:""}.fa-telegram:before{content:""}.fa-telegram-plane:before{content:""}.fa-old-republic:before{content:""}.fa-odysee:before{content:""}.fa-square-whatsapp:before{content:""}.fa-whatsapp-square:before{content:""}.fa-node-js:before{content:""}.fa-edge-legacy:before{content:""}.fa-slack:before{content:""}.fa-slack-hash:before{content:""}.fa-medrt:before{content:""}.fa-usb:before{content:""}.fa-tumblr:before{content:""}.fa-vaadin:before{content:""}.fa-quora:before{content:""}.fa-square-x-twitter:before{content:""}.fa-reacteurope:before{content:""}.fa-medium:before{content:""}.fa-medium-m:before{content:""}.fa-amilia:before{content:""}.fa-mixcloud:before{content:""}.fa-flipboard:before{content:""}.fa-viacoin:before{content:""}.fa-critical-role:before{content:""}.fa-sitrox:before{content:""}.fa-discourse:before{content:""}.fa-joomla:before{content:""}.fa-mastodon:before{content:""}.fa-airbnb:before{content:""}.fa-wolf-pack-battalion:before{content:""}.fa-buy-n-large:before{content:""}.fa-gulp:before{content:""}.fa-creative-commons-sampling-plus:before{content:""}.fa-strava:before{content:""}.fa-ember:before{content:""}.fa-canadian-maple-leaf:before{content:""}.fa-teamspeak:before{content:""}.fa-pushed:before{content:""}.fa-wordpress-simple:before{content:""}.fa-nutritionix:before{content:""}.fa-wodu:before{content:""}.fa-google-pay:before{content:""}.fa-intercom:before{content:""}.fa-zhihu:before{content:""}.fa-korvue:before{content:""}.fa-pix:before{content:""}.fa-steam-symbol:before{content:""}:root,:host{--fa-style-family-classic: "Font Awesome 6 Free";--fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:400;font-display:block;src:url(./fa-regular-400-9169d8be.woff2) format("woff2"),url(./fa-regular-400-7d81a1a7.ttf) format("truetype")}.far,.fa-regular{font-weight:400}:root,:host{--fa-style-family-classic: "Font Awesome 6 Free";--fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"}@font-face{font-family:"Font Awesome 6 Free";font-style:normal;font-weight:900;font-display:block;src:url(./fa-solid-900-886c8611.woff2) format("woff2"),url(./fa-solid-900-cea79b34.ttf) format("truetype")}.fas,.fa-solid{font-weight:900}@font-face{font-family:"Font Awesome 5 Brands";font-display:block;font-weight:400;src:url(./fa-brands-400-faae6fc0.woff2) format("woff2"),url(./fa-brands-400-003f1154.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:900;src:url(./fa-solid-900-886c8611.woff2) format("woff2"),url(./fa-solid-900-cea79b34.ttf) format("truetype")}@font-face{font-family:"Font Awesome 5 Free";font-display:block;font-weight:400;src:url(./fa-regular-400-9169d8be.woff2) format("woff2"),url(./fa-regular-400-7d81a1a7.ttf) format("truetype")}@font-face{font-family:FontAwesome;font-display:block;src:url(./fa-solid-900-886c8611.woff2) format("woff2"),url(./fa-solid-900-cea79b34.ttf) format("truetype")}@font-face{font-family:FontAwesome;font-display:block;src:url(./fa-brands-400-faae6fc0.woff2) format("woff2"),url(./fa-brands-400-003f1154.ttf) format("truetype")}@font-face{font-family:FontAwesome;font-display:block;src:url(./fa-regular-400-9169d8be.woff2) format("woff2"),url(./fa-regular-400-7d81a1a7.ttf) format("truetype");unicode-range:U+F003,U+F006,U+F014,U+F016-F017,U+F01A-F01B,U+F01D,U+F022,U+F03E,U+F044,U+F046,U+F05C-F05D,U+F06E,U+F070,U+F087-F088,U+F08A,U+F094,U+F096-F097,U+F09D,U+F0A0,U+F0A2,U+F0A4-F0A7,U+F0C5,U+F0C7,U+F0E5-F0E6,U+F0EB,U+F0F6-F0F8,U+F10C,U+F114-F115,U+F118-F11A,U+F11C-F11D,U+F133,U+F147,U+F14E,U+F150-F152,U+F185-F186,U+F18E,U+F190-F192,U+F196,U+F1C1-F1C9,U+F1D9,U+F1DB,U+F1E3,U+F1EA,U+F1F7,U+F1F9,U+F20A,U+F247-F248,U+F24A,U+F24D,U+F255-F25B,U+F25D,U+F271-F274,U+F278,U+F27B,U+F28C,U+F28E,U+F29C,U+F2B5,U+F2B7,U+F2BA,U+F2BC,U+F2BE,U+F2C0-F2C1,U+F2C3,U+F2D0,U+F2D2,U+F2D4,U+F2DC}@font-face{font-family:FontAwesome;font-display:block;src:url(./fa-v4compatibility-335fd7d9.woff2) format("woff2"),url(./fa-v4compatibility-455e8e72.ttf) format("truetype");unicode-range:U+F041,U+F047,U+F065-F066,U+F07D-F07E,U+F080,U+F08B,U+F08E,U+F090,U+F09A,U+F0AC,U+F0AE,U+F0B2,U+F0D0,U+F0D6,U+F0E4,U+F0EC,U+F10A-F10B,U+F123,U+F13E,U+F148-F149,U+F14C,U+F156,U+F15E,U+F160-F161,U+F163,U+F175-F178,U+F195,U+F1F8,U+F219,U+F27A} diff --git a/assets/app-8c8b13b6.js b/assets/app-8c8b13b6.js new file mode 100644 index 0000000..e778726 --- /dev/null +++ b/assets/app-8c8b13b6.js @@ -0,0 +1,3610 @@ +var N0=Object.defineProperty;var I0=(n,t,e)=>t in n?N0(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Wt=(n,t,e)=>(I0(n,typeof t!="symbol"?t+"":t,e),e);import{g as Fl,c as U0}from"./_commonjsHelpers-a1841df3.js";document.addEventListener("DOMContentLoaded",()=>{const n=t=>{const e=t.parentElement,i=t.getAttribute("data-direction")||"horizontal",r=t.getAttribute("data-edge")||{horizontal:"left",vertical:"top"}[i],s={horizontal:"pageX",vertical:"pageY"}[i],a={horizontal:"width",vertical:"height"}[i];let o,l=0,u;const h=g=>{o=g[s],l=e.getBoundingClientRect()[a],document.addEventListener("mousemove",p),document.addEventListener("mouseup",m)},p=g=>{if(g.isT4dSimulated)return;const w=(g[s]-o)*{left:1,top:1,right:-1,bottom:-1}[r],M=(l+w)*100/e.parentElement.getBoundingClientRect()[a];e.style[a]=`${M}%`;const _={horizontal:"ew-resize",vertical:"ns-resize"}[i];t.style.cursor=_,document.body.style.cursor=_,u||(u=new Map,[...e.children].forEach(v=>{if(v===t)return;const T={};["userSelect","pointerEvents"].forEach(b=>{T[b]=e.style[b],v.style[b]="none"}),u.set(v,T)}))},m=()=>{t.style.removeProperty("cursor"),document.body.style.removeProperty("cursor"),u==null||u.forEach((g,w)=>{Object.entries(g).forEach(([M,_])=>{w.style[M]=_})}),u=null,document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",m)};t.addEventListener("mousedown",h)};document.querySelectorAll(".resizer").forEach(t=>n(t))});class O0{static isWebGLAvailable(){try{const t=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl")))}catch{return!1}}static isWebGL2Available(){try{const t=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&t.getContext("webgl2"))}catch{return!1}}static getWebGLErrorMessage(){return this.getErrorMessage(1)}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(t){const e={1:"WebGL",2:"WebGL 2"},i={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let r='Your $0 does not seem to support $1';const s=document.createElement("div");return s.id="webglmessage",s.style.fontFamily="monospace",s.style.fontSize="13px",s.style.fontWeight="normal",s.style.textAlign="center",s.style.background="#fff",s.style.color="#000",s.style.padding="1.5em",s.style.width="400px",s.style.margin="5em auto 0",i[t]?r=r.replace("$0","graphics card"):r=r.replace("$0","browser"),r=r.replace("$1",e[t]),s.innerHTML=r,s}}const df=O0;var Ip={exports:{}},F0=function(){var t=this,e=-1;return{next:function(){return e+=1,{value:t.items[e],done:e>=t.items.length}}}},B0=function(){return this.items};function Hu(n){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(n)}var Xe={isArray:function(t){return Array.isArray(t)},isObject:function(t){return Hu(t)==="object"&&Array.isArray(t)===!1&&t!==null},isFunction:function(t){return typeof t=="function"}},z0=Xe,H0=z0.isFunction,Up=function(t){return t===void 0?this.sum()/this.items.length:H0(t)?new this.constructor(this.items).sum(t)/this.items.length:new this.constructor(this.items).pluck(t).sum()/this.items.length},G0=Up,k0=G0;function Gu(n){"@babel/helpers - typeof";return Gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gu(n)}var V0=function(t){var e=this,i=[],r=0;if(Array.isArray(this.items))do{var s=this.items.slice(r,r+t),a=new this.constructor(s);i.push(a),r+=t}while(rn.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);e0:this.items[t]!==void 0&&this.items[t]===e;if(x_(t))return this.items.filter(function(r,s){return t(r,s)}).length>0;if(Array.isArray(this.items))return this.items.indexOf(t)!==-1;var i=v_(this.items);return i.push.apply(i,d_(Object.keys(this.items))),i.indexOf(t)!==-1},w_=function(){return this.count()===1},M_=function(){var t=0;return Array.isArray(this.items)&&(t=this.items.length),Math.max(Object.keys(this.items).length,t)},S_=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return new this.constructor(this.items).groupBy(t).map(function(e){return e.count()})},b_=function(){function t(s,a,o){var l=o[0];l instanceof a&&(l=l.all());for(var u=o.slice(1),h=!u.length,p=[],m=0;mn.length)&&(t=n.length);for(var e=0,i=new Array(t);e0;)s(r);return new this.constructor(r)},ev=function(){var t=this,e={};return Array.isArray(this.items)?Object.keys(this.items).forEach(function(i){e[t.items[i]]=Number(i)}):Object.keys(this.items).forEach(function(i){e[t.items[i]]=i}),new this.constructor(e)},nv=function(t,e){var i=this,r={};return Array.isArray(this.items)?r=this.items.slice(t*e-e,t*e):Object.keys(this.items).slice(t*e-e,t*e).forEach(function(s){r[s]=i.items[s]}),new this.constructor(r)},iv=function(t){return Array.isArray(this.items)?this.items.splice(t,1):delete this.items[t],this},rv=Xe,sv=rv.isFunction,ov=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.items[t]!==void 0?this.items[t]:sv(e)?e():e!==null?e:null},Rr=function(t,e){try{return e.split(".").reduce(function(i,r){return i[r]},t)}catch{return t}},eu=Rr,av=Xe,lv=av.isFunction,cv=function(t){var e=this,i={};return this.items.forEach(function(r,s){var a;lv(t)?a=t(r,s):eu(r,t)||eu(r,t)===0?a=eu(r,t):a="",i[a]===void 0&&(i[a]=new e.constructor([])),i[a].push(r)}),new this.constructor(i)},uv=Bl,hv=function(){for(var t=this,e=arguments.length,i=new Array(e),r=0;r0&&arguments[0]!==void 0?arguments[0]:[];return new this.constructor(t)},Tv=function(t){var e=this;if(Array.isArray(this.items))return new this.constructor(this.items.map(t));var i={};return Object.keys(this.items).forEach(function(r){i[r]=t(e.items[r],r)}),new this.constructor(i)};function Cv(n){return Dv(n)||Lv(n)||Pv(n)||Rv()}function Rv(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pv(n,t){if(n){if(typeof n=="string")return ju(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ju(n,t)}}function Lv(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Dv(n){if(Array.isArray(n))return ju(n)}function ju(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);en.length)&&(t=n.length);for(var e=0,i=new Array(t);ei&&(i=a)}}),e.filter(function(r){return r.count===i}).map(function(r){return r.key})):null},dy=Ci,py=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=dy(this.items),r=i.slice(e).filter(function(s,a){return a%t===0});return new this.constructor(r)},my=Bl,gy=function(){for(var t=this,e=arguments.length,i=new Array(e),r=0;r1?e-1:0),r=1;r0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(Ay(this.items))return e===1?this.items.pop():new this.constructor(this.items.splice(-e));if(Ty(this.items)){var i=Object.keys(this.items);if(e===1){var r=i[i.length-1],s=this.items[r];return Ef(this.items,r),s}var a=i.slice(-e),o=a.reduce(function(l,u){return l[u]=t.items[u],l},{});return Ef(this.items,a),new this.constructor(o)}return null},Ry=function(t,e){return e!==void 0?this.put(e,t):(this.items.unshift(t),this)},Py=Xe,Ly=Py.isFunction,Dy=function(t,e){var i=this.items[t]||null;return!i&&e!==void 0&&(Ly(e)?i=e():i=e),delete this.items[t],i},Ny=function(){var t;return(t=this.items).push.apply(t,arguments),this},Iy=function(t,e){return this.items[t]=e,this},Uy=Ci,Oy=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=Uy(this.items),i=new this.constructor(e).shuffle();return t!==parseInt(t,10)?i.first():i.take(t)},Fy=function(t,e){var i=this,r=null;return e!==void 0&&(r=e),Array.isArray(this.items)?this.items.forEach(function(s){r=t(r,s)}):Object.keys(this.items).forEach(function(s){r=t(r,i.items[s],s)}),r},By=function(t){return new this.constructor(this.items).filter(function(e){return!t(e)})};function Af(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),e.push.apply(e,i)}return e}function Ga(n){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(jy(this.items))return e===1?this.items.shift():new this.constructor(this.items.splice(0,e));if(Yy(this.items)){if(e===1){var i=Object.keys(this.items)[0],r=this.items[i];return delete this.items[i],r}var s=Object.keys(this.items),a=s.slice(0,e),o=a.reduce(function(l,u){return l[u]=t.items[u],l},{});return Ky(this.items,a),new this.constructor(o)}return null},Jy=Ci,Qy=function(){var t=Jy(this.items),e,i,r;for(r=t.length;r;r-=1)e=Math.floor(Math.random()*r),i=t[r-1],t[r-1]=t[e],t[e]=i;return this.items=t,this},tx=Xe,ex=tx.isObject,nx=function(t){var e=this;return ex(this.items)?new this.constructor(Object.keys(this.items).reduce(function(i,r,s){return s+1>t&&(i[r]=e.items[r]),i},{})):new this.constructor(this.items.slice(t))},yh=Xe,ix=yh.isArray,rx=yh.isObject,sx=yh.isFunction,ox=function(t){var e=this,i=null,r,s=function(o){return o===t};return sx(t)&&(s=t),ix(this.items)&&(r=this.items.filter(function(a){return i!==!0&&(i=s(a)),i})),rx(this.items)&&(r=Object.keys(this.items).reduce(function(a,o){return i!==!0&&(i=s(e.items[o])),i!==!1&&(a[o]=e.items[o]),a},{})),new this.constructor(r)},xh=Xe,ax=xh.isArray,lx=xh.isObject,cx=xh.isFunction,ux=function(t){var e=this,i=null,r,s=function(o){return o===t};return cx(t)&&(s=t),ax(this.items)&&(r=this.items.filter(function(a){return i!==!0&&(i=!s(a)),i})),lx(this.items)&&(r=Object.keys(this.items).reduce(function(a,o){return i!==!0&&(i=!s(e.items[o])),i!==!1&&(a[o]=e.items[o]),a},{})),new this.constructor(r)},hx=function(t,e){var i=this.items.slice(t);return e!==void 0&&(i=i.slice(0,e)),new this.constructor(i)},fx=Xe,dx=fx.isFunction,px=function(t,e,i){var r;if(dx(t)?r=this.filter(t):r=this.where(t,e,i),r.isEmpty())throw new Error("Item not found.");if(r.count()>1)throw new Error("Multiple items found.");return r.first()},mx=Fp,gx=mx,_x=function(t){var e=[].concat(this.items);return t===void 0?this.every(function(i){return typeof i=="number"})?e.sort(function(i,r){return i-r}):e.sort():e.sort(t),new this.constructor(e)},vx=function(){return this.sort().reverse()},yx=Rr,xx=Xe,wx=xx.isFunction,Mx=function(t){var e=[].concat(this.items),i=function(s){return wx(t)?t(s):yx(s,t)};return e.sort(function(r,s){var a=i(r),o=i(s);return a==null?1:o==null||ao?1:0}),new this.constructor(e)},Sx=function(t){return this.sortBy(t).reverse()},bx=function(){var t=this,e={};return Object.keys(this.items).sort().forEach(function(i){e[i]=t.items[i]}),new this.constructor(e)},Ex=function(){var t=this,e={};return Object.keys(this.items).sort().reverse().forEach(function(i){e[i]=t.items[i]}),new this.constructor(e)},Ax=function(t,e,i){var r=this.slice(t,e);if(this.items=this.diff(r.all()).all(),Array.isArray(i))for(var s=0,a=i.length;s":return Kn(l,t)!==Number(s)&&Kn(l,t)!==s.toString();case"!==":return Kn(l,t)!==s;case"<":return Kn(l,t)":return Kn(l,t)>s;case">=":return Kn(l,t)>=s}});return new this.constructor(o)},sw=function(t,e){return this.where(t,">=",e[0]).where(t,"<=",e[e.length-1])},ow=Ci,aw=Rr,lw=function(t,e){var i=ow(e),r=this.items.filter(function(s){return i.indexOf(aw(s,t))!==-1});return new this.constructor(r)},cw=function(t){return this.filter(function(e){return e instanceof t})},Df=Rr,uw=function(t,e){return this.filter(function(i){return Df(i,t)e[e.length-1]})},hw=Ci,fw=Rr,dw=function(t,e){var i=hw(e),r=this.items.filter(function(s){return i.indexOf(fw(s,t))===-1});return new this.constructor(r)},pw=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"===",null)},mw=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(t,"!==",null)};function Qu(n){"@babel/helpers - typeof";return Qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(n)}var gw=function(t){return t instanceof this.constructor?t:Qu(t)==="object"?new this.constructor(t):new this.constructor([t])},_w=function(t){var e=this,i=t;i instanceof this.constructor&&(i=i.all());var r=this.items.map(function(s,a){return new e.constructor([s,i[a]])});return new this.constructor(r)};(function(n){function t(s){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},t(s)}function e(s){s!==void 0&&!Array.isArray(s)&&t(s)!=="object"?this.items=[s]:s instanceof this.constructor?this.items=s.all():this.items=s||[]}var i=F0;typeof Symbol<"u"&&(e.prototype[Symbol.iterator]=i),e.prototype.toJSON=function(){return this.items},e.prototype.all=B0,e.prototype.average=Up,e.prototype.avg=k0,e.prototype.chunk=V0,e.prototype.collapse=Y0,e.prototype.combine=e_,e.prototype.concat=l_,e.prototype.contains=Fp,e.prototype.containsOneItem=w_,e.prototype.count=M_,e.prototype.countBy=S_,e.prototype.crossJoin=b_,e.prototype.dd=E_,e.prototype.diff=A_,e.prototype.diffAssoc=T_,e.prototype.diffKeys=C_,e.prototype.diffUsing=R_,e.prototype.doesntContain=P_,e.prototype.dump=L_,e.prototype.duplicates=D_,e.prototype.each=N_,e.prototype.eachSpread=z_,e.prototype.every=G_,e.prototype.except=V_,e.prototype.filter=$_,e.prototype.first=j_,e.prototype.firstOrFail=Z_,e.prototype.firstWhere=J_,e.prototype.flatMap=Q_,e.prototype.flatten=tv,e.prototype.flip=ev,e.prototype.forPage=nv,e.prototype.forget=iv,e.prototype.get=ov,e.prototype.groupBy=cv,e.prototype.has=hv,e.prototype.implode=fv,e.prototype.intersect=dv,e.prototype.intersectByKeys=pv,e.prototype.isEmpty=mv,e.prototype.isNotEmpty=gv,e.prototype.join=_v,e.prototype.keyBy=wv,e.prototype.keys=Mv,e.prototype.last=bv,e.prototype.macro=Ev,e.prototype.make=Av,e.prototype.map=Tv,e.prototype.mapSpread=Nv,e.prototype.mapToDictionary=zv,e.prototype.mapInto=Hv,e.prototype.mapToGroups=$v,e.prototype.mapWithKeys=Zv,e.prototype.max=ny,e.prototype.median=iy,e.prototype.merge=ry,e.prototype.mergeRecursive=oy,e.prototype.min=hy,e.prototype.mode=fy,e.prototype.nth=py,e.prototype.only=gy,e.prototype.pad=vy,e.prototype.partition=yy,e.prototype.pipe=xy,e.prototype.pluck=by,e.prototype.pop=Cy,e.prototype.prepend=Ry,e.prototype.pull=Dy,e.prototype.push=Ny,e.prototype.put=Iy,e.prototype.random=Oy,e.prototype.reduce=Fy,e.prototype.reject=By,e.prototype.replace=Hy,e.prototype.replaceRecursive=ky,e.prototype.reverse=Vy,e.prototype.search=qy,e.prototype.shift=Zy,e.prototype.shuffle=Qy,e.prototype.skip=nx,e.prototype.skipUntil=ox,e.prototype.skipWhile=ux,e.prototype.slice=hx,e.prototype.sole=px,e.prototype.some=gx,e.prototype.sort=_x,e.prototype.sortDesc=vx,e.prototype.sortBy=Mx,e.prototype.sortByDesc=Sx,e.prototype.sortKeys=bx,e.prototype.sortKeysDesc=Ex,e.prototype.splice=Ax,e.prototype.split=Tx,e.prototype.sum=Lx,e.prototype.take=Dx,e.prototype.takeUntil=Ox,e.prototype.takeWhile=Hx,e.prototype.tap=Gx,e.prototype.times=kx,e.prototype.toArray=Vx,e.prototype.toJson=Wx,e.prototype.transform=Xx,e.prototype.undot=qx,e.prototype.unless=jx,e.prototype.unlessEmpty=Pf,e.prototype.unlessNotEmpty=Lf,e.prototype.union=Yx,e.prototype.unique=Jx,e.prototype.unwrap=Qx,e.prototype.values=ew,e.prototype.when=nw,e.prototype.whenEmpty=Lf,e.prototype.whenNotEmpty=Pf,e.prototype.where=rw,e.prototype.whereBetween=sw,e.prototype.whereIn=lw,e.prototype.whereInstanceOf=cw,e.prototype.whereNotBetween=uw,e.prototype.whereNotIn=dw,e.prototype.whereNull=pw,e.prototype.whereNotNull=mw,e.prototype.wrap=gw,e.prototype.zip=_w;var r=function(a){return new e(a)};n.exports=r,n.exports.collect=r,n.exports.default=r,n.exports.Collection=e})(Ip);var vw=Ip.exports;const Ne=Fl(vw);/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const Sh="156",qi={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},gr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},yw=0,Nf=1,xw=2,Wp=1,Xp=2,$i=3,Tr=0,In=1,bi=2,Sr=0,Qs=1,If=2,Uf=3,Of=4,ww=5,Ks=100,Mw=101,Sw=102,Ff=103,Bf=104,bw=200,Ew=201,Aw=202,Tw=203,$p=204,qp=205,Cw=206,Rw=207,Pw=208,Lw=209,Dw=210,Nw=0,Iw=1,Uw=2,th=3,Ow=4,Fw=5,Bw=6,zw=7,jp=0,Hw=1,Gw=2,br=0,kw=1,Vw=2,Ww=3,Xw=4,$w=5,Yp=300,no=301,io=302,eh=303,nh=304,zl=306,ih=1e3,pi=1001,rh=1002,En=1003,zf=1004,nu=1005,Qn=1006,qw=1007,oa=1008,Er=1009,jw=1010,Yw=1011,bh=1012,Kp=1013,yr=1014,xr=1015,aa=1016,Zp=1017,Jp=1018,is=1020,Kw=1021,mi=1023,Zw=1024,Jw=1025,rs=1026,ro=1027,Qw=1028,Qp=1029,tM=1030,tm=1031,em=1033,iu=33776,ru=33777,su=33778,ou=33779,Hf=35840,Gf=35841,kf=35842,Vf=35843,eM=36196,Wf=37492,Xf=37496,$f=37808,qf=37809,jf=37810,Yf=37811,Kf=37812,Zf=37813,Jf=37814,Qf=37815,td=37816,ed=37817,nd=37818,id=37819,rd=37820,sd=37821,au=36492,od=36494,ad=36495,nM=36283,ld=36284,cd=36285,ud=36286,nm=3e3,ss=3001,iM=3200,rM=3201,im=0,sM=1,os="",Ve="srgb",Ti="srgb-linear",Hl="display-p3",lu=7680,oM=519,aM=512,lM=513,cM=514,uM=515,hM=516,fM=517,dM=518,pM=519,hd=35044,fd="300 es",sh=1035,Yi=2e3,Al=2001;class Pr{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[t]===void 0&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;const i=this._listeners;return i[t]!==void 0&&i[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;const r=this._listeners[t];if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const i=this._listeners[t.type];if(i!==void 0){t.target=this;const r=i.slice(0);for(let s=0,a=r.length;s>8&255]+yn[n>>16&255]+yn[n>>24&255]+"-"+yn[t&255]+yn[t>>8&255]+"-"+yn[t>>16&15|64]+yn[t>>24&255]+"-"+yn[e&63|128]+yn[e>>8&255]+"-"+yn[e>>16&255]+yn[e>>24&255]+yn[i&255]+yn[i>>8&255]+yn[i>>16&255]+yn[i>>24&255]).toLowerCase()}function ln(n,t,e){return Math.max(t,Math.min(e,n))}function Eh(n,t){return(n%t+t)%t}function mM(n,t,e,i,r){return i+(n-t)*(r-i)/(e-t)}function gM(n,t,e){return n!==t?(e-n)/(t-n):0}function ea(n,t,e){return(1-e)*n+e*t}function _M(n,t,e,i){return ea(n,t,1-Math.exp(-e*i))}function vM(n,t=1){return t-Math.abs(Eh(n,t*2)-t)}function yM(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*(3-2*n))}function xM(n,t,e){return n<=t?0:n>=e?1:(n=(n-t)/(e-t),n*n*n*(n*(n*6-15)+10))}function wM(n,t){return n+Math.floor(Math.random()*(t-n+1))}function MM(n,t){return n+Math.random()*(t-n)}function SM(n){return n*(.5-Math.random())}function bM(n){n!==void 0&&(dd=n);let t=dd+=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 EM(n){return n*ta}function AM(n){return n*la}function oh(n){return(n&n-1)===0&&n!==0}function TM(n){return Math.pow(2,Math.ceil(Math.log(n)/Math.LN2))}function Tl(n){return Math.pow(2,Math.floor(Math.log(n)/Math.LN2))}function CM(n,t,e,i,r){const s=Math.cos,a=Math.sin,o=s(e/2),l=a(e/2),u=s((t+i)/2),h=a((t+i)/2),p=s((t-i)/2),m=a((t-i)/2),g=s((i-t)/2),w=a((i-t)/2);switch(r){case"XYX":n.set(o*h,l*p,l*m,o*u);break;case"YZY":n.set(l*m,o*h,l*p,o*u);break;case"ZXZ":n.set(l*p,l*m,o*h,o*u);break;case"XZX":n.set(o*h,l*w,l*g,o*u);break;case"YXY":n.set(l*g,o*h,l*w,o*u);break;case"ZYZ":n.set(l*w,l*g,o*h,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function Zs(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Sn(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}const RM={DEG2RAD:ta,RAD2DEG:la,generateUUID:co,clamp:ln,euclideanModulo:Eh,mapLinear:mM,inverseLerp:gM,lerp:ea,damp:_M,pingpong:vM,smoothstep:yM,smootherstep:xM,randInt:wM,randFloat:MM,randFloatSpread:SM,seededRandom:bM,degToRad:EM,radToDeg:AM,isPowerOfTwo:oh,ceilPowerOfTwo:TM,floorPowerOfTwo:Tl,setQuaternionFromProperEuler:CM,normalize:Sn,denormalize:Zs};class Yt{constructor(t=0,e=0){Yt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ln(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,a=this.y-t.y;return this.x=s*i-a*r+t.x,this.y=s*r+a*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ye{constructor(t,e,i,r,s,a,o,l,u){ye.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,u)}set(t,e,i,r,s,a,o,l,u){const h=this.elements;return h[0]=t,h[1]=r,h[2]=o,h[3]=e,h[4]=s,h[5]=l,h[6]=i,h[7]=a,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[3],l=i[6],u=i[1],h=i[4],p=i[7],m=i[2],g=i[5],w=i[8],M=r[0],_=r[3],v=r[6],T=r[1],b=r[4],P=r[7],I=r[2],H=r[5],B=r[8];return s[0]=a*M+o*T+l*I,s[3]=a*_+o*b+l*H,s[6]=a*v+o*P+l*B,s[1]=u*M+h*T+p*I,s[4]=u*_+h*b+p*H,s[7]=u*v+h*P+p*B,s[2]=m*M+g*T+w*I,s[5]=m*_+g*b+w*H,s[8]=m*v+g*P+w*B,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],u=t[7],h=t[8];return e*a*h-e*o*u-i*s*h+i*o*l+r*s*u-r*a*l}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],u=t[7],h=t[8],p=h*a-o*u,m=o*l-h*s,g=u*s-a*l,w=e*p+i*m+r*g;if(w===0)return this.set(0,0,0,0,0,0,0,0,0);const M=1/w;return t[0]=p*M,t[1]=(r*u-h*i)*M,t[2]=(o*i-r*a)*M,t[3]=m*M,t[4]=(h*e-r*l)*M,t[5]=(r*s-o*e)*M,t[6]=g*M,t[7]=(i*l-u*e)*M,t[8]=(a*e-i*s)*M,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,r,s,a,o){const l=Math.cos(s),u=Math.sin(s);return this.set(i*l,i*u,-i*(l*a+u*o)+a+t,-r*u,r*l,-r*(-u*a+l*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(cu.makeScale(t,e)),this}rotate(t){return this.premultiply(cu.makeRotation(-t)),this}translate(t,e){return this.premultiply(cu.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<9;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const cu=new ye;function rm(n){for(let t=n.length-1;t>=0;--t)if(n[t]>=65535)return!0;return!1}function Cl(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function PM(){const n=Cl("canvas");return n.style.display="block",n}const pd={};function na(n){n in pd||(pd[n]=!0,console.warn(n))}function to(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function uu(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const LM=new ye().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),DM=new ye().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function NM(n){return n.convertSRGBToLinear().applyMatrix3(DM)}function IM(n){return n.applyMatrix3(LM).convertLinearToSRGB()}const UM={[Ti]:n=>n,[Ve]:n=>n.convertSRGBToLinear(),[Hl]:NM},OM={[Ti]:n=>n,[Ve]:n=>n.convertLinearToSRGB(),[Hl]:IM},ci={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(n){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!n},get workingColorSpace(){return Ti},set workingColorSpace(n){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(n,t,e){if(this.enabled===!1||t===e||!t||!e)return n;const i=UM[t],r=OM[e];if(i===void 0||r===void 0)throw new Error(`Unsupported color space conversion, "${t}" to "${e}".`);return r(i(n))},fromWorkingColorSpace:function(n,t){return this.convert(n,this.workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this.workingColorSpace)}};let Ns;class sm{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Ns===void 0&&(Ns=Cl("canvas")),Ns.width=t.width,Ns.height=t.height;const i=Ns.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Ns}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const e=Cl("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let a=0;a0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==Yp)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ih:t.x=t.x-Math.floor(t.x);break;case pi:t.x=t.x<0?0:1;break;case rh:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case ih:t.y=t.y-Math.floor(t.y);break;case pi:t.y=t.y<0?0:1;break;case rh:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return na("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Ve?ss:nm}set encoding(t){na("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===ss?Ve:os}}Un.DEFAULT_IMAGE=null;Un.DEFAULT_MAPPING=Yp;Un.DEFAULT_ANISOTROPY=1;class cn{constructor(t=0,e=0,i=0,r=1){cn.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*r+a[12]*s,this.y=a[1]*e+a[5]*i+a[9]*r+a[13]*s,this.z=a[2]*e+a[6]*i+a[10]*r+a[14]*s,this.w=a[3]*e+a[7]*i+a[11]*r+a[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,r,s;const l=t.elements,u=l[0],h=l[4],p=l[8],m=l[1],g=l[5],w=l[9],M=l[2],_=l[6],v=l[10];if(Math.abs(h-m)<.01&&Math.abs(p-M)<.01&&Math.abs(w-_)<.01){if(Math.abs(h+m)<.1&&Math.abs(p+M)<.1&&Math.abs(w+_)<.1&&Math.abs(u+g+v-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(u+1)/2,P=(g+1)/2,I=(v+1)/2,H=(h+m)/4,B=(p+M)/4,K=(w+_)/4;return b>P&&b>I?b<.01?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(b),r=H/i,s=B/i):P>I?P<.01?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(P),i=H/r,s=K/r):I<.01?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(I),i=B/s,r=K/s),this.set(i,r,s,e),this}let T=Math.sqrt((_-w)*(_-w)+(p-M)*(p-M)+(m-h)*(m-h));return Math.abs(T)<.001&&(T=1),this.x=(_-w)/T,this.y=(p-M)/T,this.z=(m-h)/T,this.w=Math.acos((u+g+v-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class zM extends Pr{constructor(t=1,e=1,i={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new cn(0,0,t,e),this.scissorTest=!1,this.viewport=new cn(0,0,t,e);const r={width:t,height:e,depth:1};i.encoding!==void 0&&(na("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===ss?Ve:os),this.texture=new Un(r,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.internalFormat=i.internalFormat!==void 0?i.internalFormat:null,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Qn,this.depthBuffer=i.depthBuffer!==void 0?i.depthBuffer:!0,this.stencilBuffer=i.stencilBuffer!==void 0?i.stencilBuffer:!1,this.depthTexture=i.depthTexture!==void 0?i.depthTexture:null,this.samples=i.samples!==void 0?i.samples:0}setSize(t,e,i=1){(this.width!==t||this.height!==e||this.depth!==i)&&(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new om(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ls extends zM{constructor(t=1,e=1,i={}){super(t,e,i),this.isWebGLRenderTarget=!0}}class am extends Un{constructor(t=null,e=1,i=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:i,depth:r},this.magFilter=En,this.minFilter=En,this.wrapR=pi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class HM extends Un{constructor(t=null,e=1,i=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:i,depth:r},this.magFilter=En,this.minFilter=En,this.wrapR=pi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class cs{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,a,o){let l=i[r+0],u=i[r+1],h=i[r+2],p=i[r+3];const m=s[a+0],g=s[a+1],w=s[a+2],M=s[a+3];if(o===0){t[e+0]=l,t[e+1]=u,t[e+2]=h,t[e+3]=p;return}if(o===1){t[e+0]=m,t[e+1]=g,t[e+2]=w,t[e+3]=M;return}if(p!==M||l!==m||u!==g||h!==w){let _=1-o;const v=l*m+u*g+h*w+p*M,T=v>=0?1:-1,b=1-v*v;if(b>Number.EPSILON){const I=Math.sqrt(b),H=Math.atan2(I,v*T);_=Math.sin(_*H)/I,o=Math.sin(o*H)/I}const P=o*T;if(l=l*_+m*P,u=u*_+g*P,h=h*_+w*P,p=p*_+M*P,_===1-o){const I=1/Math.sqrt(l*l+u*u+h*h+p*p);l*=I,u*=I,h*=I,p*=I}}t[e]=l,t[e+1]=u,t[e+2]=h,t[e+3]=p}static multiplyQuaternionsFlat(t,e,i,r,s,a){const o=i[r],l=i[r+1],u=i[r+2],h=i[r+3],p=s[a],m=s[a+1],g=s[a+2],w=s[a+3];return t[e]=o*w+h*p+l*g-u*m,t[e+1]=l*w+h*m+u*p-o*g,t[e+2]=u*w+h*g+o*m-l*p,t[e+3]=h*w-o*p-l*m-u*g,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){const i=t._x,r=t._y,s=t._z,a=t._order,o=Math.cos,l=Math.sin,u=o(i/2),h=o(r/2),p=o(s/2),m=l(i/2),g=l(r/2),w=l(s/2);switch(a){case"XYZ":this._x=m*h*p+u*g*w,this._y=u*g*p-m*h*w,this._z=u*h*w+m*g*p,this._w=u*h*p-m*g*w;break;case"YXZ":this._x=m*h*p+u*g*w,this._y=u*g*p-m*h*w,this._z=u*h*w-m*g*p,this._w=u*h*p+m*g*w;break;case"ZXY":this._x=m*h*p-u*g*w,this._y=u*g*p+m*h*w,this._z=u*h*w+m*g*p,this._w=u*h*p-m*g*w;break;case"ZYX":this._x=m*h*p-u*g*w,this._y=u*g*p+m*h*w,this._z=u*h*w-m*g*p,this._w=u*h*p+m*g*w;break;case"YZX":this._x=m*h*p+u*g*w,this._y=u*g*p+m*h*w,this._z=u*h*w-m*g*p,this._w=u*h*p-m*g*w;break;case"XZY":this._x=m*h*p-u*g*w,this._y=u*g*p-m*h*w,this._z=u*h*w+m*g*p,this._w=u*h*p+m*g*w;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],a=e[1],o=e[5],l=e[9],u=e[2],h=e[6],p=e[10],m=i+o+p;if(m>0){const g=.5/Math.sqrt(m+1);this._w=.25/g,this._x=(h-l)*g,this._y=(s-u)*g,this._z=(a-r)*g}else if(i>o&&i>p){const g=2*Math.sqrt(1+i-o-p);this._w=(h-l)/g,this._x=.25*g,this._y=(r+a)/g,this._z=(s+u)/g}else if(o>p){const g=2*Math.sqrt(1+o-i-p);this._w=(s-u)/g,this._x=(r+a)/g,this._y=.25*g,this._z=(l+h)/g}else{const g=2*Math.sqrt(1+p-i-o);this._w=(a-r)/g,this._x=(s+u)/g,this._y=(l+h)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return iMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ln(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(i===0)return this;const r=Math.min(1,e/i);return this.slerp(t,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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,r=t._y,s=t._z,a=t._w,o=e._x,l=e._y,u=e._z,h=e._w;return this._x=i*h+a*o+r*u-s*l,this._y=r*h+a*l+s*o-i*u,this._z=s*h+a*u+i*l-r*o,this._w=a*h-i*o-r*l-s*u,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const i=this._x,r=this._y,s=this._z,a=this._w;let o=a*t._w+i*t._x+r*t._y+s*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=r,this._z=s,this;const l=1-o*o;if(l<=Number.EPSILON){const g=1-e;return this._w=g*a+e*this._w,this._x=g*i+e*this._x,this._y=g*r+e*this._y,this._z=g*s+e*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),h=Math.atan2(u,o),p=Math.sin((1-e)*h)/u,m=Math.sin(e*h)/u;return this._w=a*p+this._w*m,this._x=i*p+this._x*m,this._y=r*p+this._y*m,this._z=s*p+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),r=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(e*Math.cos(r),i*Math.sin(s),i*Math.cos(s),e*Math.sin(r))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class X{constructor(t=0,e=0,i=0){X.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return i===void 0&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(md.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(md.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,a=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*a,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*a,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*a,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,a=t.y,o=t.z,l=t.w,u=l*e+a*r-o*i,h=l*i+o*e-s*r,p=l*r+s*i-a*e,m=-s*e-a*i-o*r;return this.x=u*l+m*-s+h*-o-p*-a,this.y=h*l+m*-a+p*-s-u*-o,this.z=p*l+m*-o+u*-a-h*-s,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,r=t.y,s=t.z,a=e.x,o=e.y,l=e.z;return this.x=r*l-s*o,this.y=s*a-i*l,this.z=i*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return fu.copy(this).projectOnVector(t),this.sub(fu)}reflect(t){return this.sub(fu.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(ln(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const fu=new X,md=new cs;class Ki{constructor(t=new X(1/0,1/0,1/0),e=new X(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Hi),Hi.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Wo),ka.subVectors(this.max,Wo),Us.subVectors(t.a,Wo),Os.subVectors(t.b,Wo),Fs.subVectors(t.c,Wo),hr.subVectors(Os,Us),fr.subVectors(Fs,Os),jr.subVectors(Us,Fs);let e=[0,-hr.z,hr.y,0,-fr.z,fr.y,0,-jr.z,jr.y,hr.z,0,-hr.x,fr.z,0,-fr.x,jr.z,0,-jr.x,-hr.y,hr.x,0,-fr.y,fr.x,0,-jr.y,jr.x,0];return!du(e,Us,Os,Fs,ka)||(e=[1,0,0,0,1,0,0,0,1],!du(e,Us,Os,Fs,ka))?!1:(Va.crossVectors(hr,fr),e=[Va.x,Va.y,Va.z],du(e,Us,Os,Fs,ka))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Hi).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Hi).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(zi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),zi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),zi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),zi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),zi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),zi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),zi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),zi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(zi),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const zi=[new X,new X,new X,new X,new X,new X,new X,new X],Hi=new X,Is=new Ki,Us=new X,Os=new X,Fs=new X,hr=new X,fr=new X,jr=new X,Wo=new X,ka=new X,Va=new X,Yr=new X;function du(n,t,e,i,r){for(let s=0,a=n.length-3;s<=a;s+=3){Yr.fromArray(n,s);const o=r.x*Math.abs(Yr.x)+r.y*Math.abs(Yr.y)+r.z*Math.abs(Yr.z),l=t.dot(Yr),u=e.dot(Yr),h=i.dot(Yr);if(Math.max(-Math.max(l,u,h),Math.min(l,u,h))>o)return!1}return!0}const GM=new Ki,Xo=new X,pu=new X;class Gl{constructor(t=new X,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;e!==void 0?i.copy(e):GM.setFromPoints(t).getCenter(i);let r=0;for(let s=0,a=t.length;sthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Xo.subVectors(t,this.center);const e=Xo.lengthSq();if(e>this.radius*this.radius){const i=Math.sqrt(e),r=(i-this.radius)*.5;this.center.addScaledVector(Xo,r/i),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(pu.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Xo.copy(t.center).add(pu)),this.expandByPoint(Xo.copy(t.center).sub(pu))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Gi=new X,mu=new X,Wa=new X,dr=new X,gu=new X,Xa=new X,_u=new X;class kl{constructor(t=new X,e=new X(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Gi)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Gi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Gi.copy(this.origin).addScaledVector(this.direction,e),Gi.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){mu.copy(t).add(e).multiplyScalar(.5),Wa.copy(e).sub(t).normalize(),dr.copy(this.origin).sub(mu);const s=t.distanceTo(e)*.5,a=-this.direction.dot(Wa),o=dr.dot(this.direction),l=-dr.dot(Wa),u=dr.lengthSq(),h=Math.abs(1-a*a);let p,m,g,w;if(h>0)if(p=a*l-o,m=a*o-l,w=s*h,p>=0)if(m>=-w)if(m<=w){const M=1/h;p*=M,m*=M,g=p*(p+a*m+2*o)+m*(a*p+m+2*l)+u}else m=s,p=Math.max(0,-(a*m+o)),g=-p*p+m*(m+2*l)+u;else m=-s,p=Math.max(0,-(a*m+o)),g=-p*p+m*(m+2*l)+u;else m<=-w?(p=Math.max(0,-(-a*s+o)),m=p>0?-s:Math.min(Math.max(-s,-l),s),g=-p*p+m*(m+2*l)+u):m<=w?(p=0,m=Math.min(Math.max(-s,-l),s),g=m*(m+2*l)+u):(p=Math.max(0,-(a*s+o)),m=p>0?s:Math.min(Math.max(-s,-l),s),g=-p*p+m*(m+2*l)+u);else m=a>0?-s:s,p=Math.max(0,-(a*m+o)),g=-p*p+m*(m+2*l)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,p),r&&r.copy(mu).addScaledVector(Wa,m),g}intersectSphere(t,e){Gi.subVectors(t.center,this.origin);const i=Gi.dot(this.direction),r=Gi.dot(Gi)-i*i,s=t.radius*t.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=i-a,l=i+a;return l<0?null:o<0?this.at(l,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return i===null?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,s,a,o,l;const u=1/this.direction.x,h=1/this.direction.y,p=1/this.direction.z,m=this.origin;return u>=0?(i=(t.min.x-m.x)*u,r=(t.max.x-m.x)*u):(i=(t.max.x-m.x)*u,r=(t.min.x-m.x)*u),h>=0?(s=(t.min.y-m.y)*h,a=(t.max.y-m.y)*h):(s=(t.max.y-m.y)*h,a=(t.min.y-m.y)*h),i>a||s>r||((s>i||isNaN(i))&&(i=s),(a=0?(o=(t.min.z-m.z)*p,l=(t.max.z-m.z)*p):(o=(t.max.z-m.z)*p,l=(t.min.z-m.z)*p),i>l||o>r)||((o>i||i!==i)&&(i=o),(l=0?i:r,e)}intersectsBox(t){return this.intersectBox(t,Gi)!==null}intersectTriangle(t,e,i,r,s){gu.subVectors(e,t),Xa.subVectors(i,t),_u.crossVectors(gu,Xa);let a=this.direction.dot(_u),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;dr.subVectors(this.origin,t);const l=o*this.direction.dot(Xa.crossVectors(dr,Xa));if(l<0)return null;const u=o*this.direction.dot(gu.cross(dr));if(u<0||l+u>a)return null;const h=-o*dr.dot(_u);return h<0?null:this.at(h/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class qe{constructor(t,e,i,r,s,a,o,l,u,h,p,m,g,w,M,_){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,i,r,s,a,o,l,u,h,p,m,g,w,M,_)}set(t,e,i,r,s,a,o,l,u,h,p,m,g,w,M,_){const v=this.elements;return v[0]=t,v[4]=e,v[8]=i,v[12]=r,v[1]=s,v[5]=a,v[9]=o,v[13]=l,v[2]=u,v[6]=h,v[10]=p,v[14]=m,v[3]=g,v[7]=w,v[11]=M,v[15]=_,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new qe().fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,r=1/Bs.setFromMatrixColumn(t,0).length(),s=1/Bs.setFromMatrixColumn(t,1).length(),a=1/Bs.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*a,e[9]=i[9]*a,e[10]=i[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,a=Math.cos(i),o=Math.sin(i),l=Math.cos(r),u=Math.sin(r),h=Math.cos(s),p=Math.sin(s);if(t.order==="XYZ"){const m=a*h,g=a*p,w=o*h,M=o*p;e[0]=l*h,e[4]=-l*p,e[8]=u,e[1]=g+w*u,e[5]=m-M*u,e[9]=-o*l,e[2]=M-m*u,e[6]=w+g*u,e[10]=a*l}else if(t.order==="YXZ"){const m=l*h,g=l*p,w=u*h,M=u*p;e[0]=m+M*o,e[4]=w*o-g,e[8]=a*u,e[1]=a*p,e[5]=a*h,e[9]=-o,e[2]=g*o-w,e[6]=M+m*o,e[10]=a*l}else if(t.order==="ZXY"){const m=l*h,g=l*p,w=u*h,M=u*p;e[0]=m-M*o,e[4]=-a*p,e[8]=w+g*o,e[1]=g+w*o,e[5]=a*h,e[9]=M-m*o,e[2]=-a*u,e[6]=o,e[10]=a*l}else if(t.order==="ZYX"){const m=a*h,g=a*p,w=o*h,M=o*p;e[0]=l*h,e[4]=w*u-g,e[8]=m*u+M,e[1]=l*p,e[5]=M*u+m,e[9]=g*u-w,e[2]=-u,e[6]=o*l,e[10]=a*l}else if(t.order==="YZX"){const m=a*l,g=a*u,w=o*l,M=o*u;e[0]=l*h,e[4]=M-m*p,e[8]=w*p+g,e[1]=p,e[5]=a*h,e[9]=-o*h,e[2]=-u*h,e[6]=g*p+w,e[10]=m-M*p}else if(t.order==="XZY"){const m=a*l,g=a*u,w=o*l,M=o*u;e[0]=l*h,e[4]=-p,e[8]=u*h,e[1]=m*p+M,e[5]=a*h,e[9]=g*p-w,e[2]=w*p-g,e[6]=o*h,e[10]=M*p+m}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(kM,t,VM)}lookAt(t,e,i){const r=this.elements;return Hn.subVectors(t,e),Hn.lengthSq()===0&&(Hn.z=1),Hn.normalize(),pr.crossVectors(i,Hn),pr.lengthSq()===0&&(Math.abs(i.z)===1?Hn.x+=1e-4:Hn.z+=1e-4,Hn.normalize(),pr.crossVectors(i,Hn)),pr.normalize(),$a.crossVectors(Hn,pr),r[0]=pr.x,r[4]=$a.x,r[8]=Hn.x,r[1]=pr.y,r[5]=$a.y,r[9]=Hn.y,r[2]=pr.z,r[6]=$a.z,r[10]=Hn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,a=i[0],o=i[4],l=i[8],u=i[12],h=i[1],p=i[5],m=i[9],g=i[13],w=i[2],M=i[6],_=i[10],v=i[14],T=i[3],b=i[7],P=i[11],I=i[15],H=r[0],B=r[4],K=r[8],C=r[12],O=r[1],W=r[5],ct=r[9],Y=r[13],Q=r[2],nt=r[6],_t=r[10],ht=r[14],gt=r[3],wt=r[7],St=r[11],st=r[15];return s[0]=a*H+o*O+l*Q+u*gt,s[4]=a*B+o*W+l*nt+u*wt,s[8]=a*K+o*ct+l*_t+u*St,s[12]=a*C+o*Y+l*ht+u*st,s[1]=h*H+p*O+m*Q+g*gt,s[5]=h*B+p*W+m*nt+g*wt,s[9]=h*K+p*ct+m*_t+g*St,s[13]=h*C+p*Y+m*ht+g*st,s[2]=w*H+M*O+_*Q+v*gt,s[6]=w*B+M*W+_*nt+v*wt,s[10]=w*K+M*ct+_*_t+v*St,s[14]=w*C+M*Y+_*ht+v*st,s[3]=T*H+b*O+P*Q+I*gt,s[7]=T*B+b*W+P*nt+I*wt,s[11]=T*K+b*ct+P*_t+I*St,s[15]=T*C+b*Y+P*ht+I*st,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],a=t[1],o=t[5],l=t[9],u=t[13],h=t[2],p=t[6],m=t[10],g=t[14],w=t[3],M=t[7],_=t[11],v=t[15];return w*(+s*l*p-r*u*p-s*o*m+i*u*m+r*o*g-i*l*g)+M*(+e*l*g-e*u*m+s*a*m-r*a*g+r*u*h-s*l*h)+_*(+e*u*p-e*o*g-s*a*p+i*a*g+s*o*h-i*u*h)+v*(-r*o*h-e*l*p+e*o*m+r*a*p-i*a*m+i*l*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],a=t[4],o=t[5],l=t[6],u=t[7],h=t[8],p=t[9],m=t[10],g=t[11],w=t[12],M=t[13],_=t[14],v=t[15],T=p*_*u-M*m*u+M*l*g-o*_*g-p*l*v+o*m*v,b=w*m*u-h*_*u-w*l*g+a*_*g+h*l*v-a*m*v,P=h*M*u-w*p*u+w*o*g-a*M*g-h*o*v+a*p*v,I=w*p*l-h*M*l-w*o*m+a*M*m+h*o*_-a*p*_,H=e*T+i*b+r*P+s*I;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const B=1/H;return t[0]=T*B,t[1]=(M*m*s-p*_*s-M*r*g+i*_*g+p*r*v-i*m*v)*B,t[2]=(o*_*s-M*l*s+M*r*u-i*_*u-o*r*v+i*l*v)*B,t[3]=(p*l*s-o*m*s-p*r*u+i*m*u+o*r*g-i*l*g)*B,t[4]=b*B,t[5]=(h*_*s-w*m*s+w*r*g-e*_*g-h*r*v+e*m*v)*B,t[6]=(w*l*s-a*_*s-w*r*u+e*_*u+a*r*v-e*l*v)*B,t[7]=(a*m*s-h*l*s+h*r*u-e*m*u-a*r*g+e*l*g)*B,t[8]=P*B,t[9]=(w*p*s-h*M*s-w*i*g+e*M*g+h*i*v-e*p*v)*B,t[10]=(a*M*s-w*o*s+w*i*u-e*M*u-a*i*v+e*o*v)*B,t[11]=(h*o*s-a*p*s-h*i*u+e*p*u+a*i*g-e*o*g)*B,t[12]=I*B,t[13]=(h*M*r-w*p*r+w*i*m-e*M*m-h*i*_+e*p*_)*B,t[14]=(w*o*r-a*M*r-w*i*l+e*M*l+a*i*_-e*o*_)*B,t[15]=(a*p*r-h*o*r+h*i*l-e*p*l-a*i*m+e*o*m)*B,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),r=Math.sin(e),s=1-i,a=t.x,o=t.y,l=t.z,u=s*a,h=s*o;return this.set(u*a+i,u*o-r*l,u*l+r*o,0,u*o+r*l,h*o+i,h*l-r*a,0,u*l-r*o,h*l+r*a,s*l*l+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,s,a){return this.set(1,i,s,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,a=e._y,o=e._z,l=e._w,u=s+s,h=a+a,p=o+o,m=s*u,g=s*h,w=s*p,M=a*h,_=a*p,v=o*p,T=l*u,b=l*h,P=l*p,I=i.x,H=i.y,B=i.z;return r[0]=(1-(M+v))*I,r[1]=(g+P)*I,r[2]=(w-b)*I,r[3]=0,r[4]=(g-P)*H,r[5]=(1-(m+v))*H,r[6]=(_+T)*H,r[7]=0,r[8]=(w+b)*B,r[9]=(_-T)*B,r[10]=(1-(m+M))*B,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let s=Bs.set(r[0],r[1],r[2]).length();const a=Bs.set(r[4],r[5],r[6]).length(),o=Bs.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],ui.copy(this);const u=1/s,h=1/a,p=1/o;return ui.elements[0]*=u,ui.elements[1]*=u,ui.elements[2]*=u,ui.elements[4]*=h,ui.elements[5]*=h,ui.elements[6]*=h,ui.elements[8]*=p,ui.elements[9]*=p,ui.elements[10]*=p,e.setFromRotationMatrix(ui),i.x=s,i.y=a,i.z=o,this}makePerspective(t,e,i,r,s,a,o=Yi){const l=this.elements,u=2*s/(e-t),h=2*s/(i-r),p=(e+t)/(e-t),m=(i+r)/(i-r);let g,w;if(o===Yi)g=-(a+s)/(a-s),w=-2*a*s/(a-s);else if(o===Al)g=-a/(a-s),w=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=u,l[4]=0,l[8]=p,l[12]=0,l[1]=0,l[5]=h,l[9]=m,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=w,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,i,r,s,a,o=Yi){const l=this.elements,u=1/(e-t),h=1/(i-r),p=1/(a-s),m=(e+t)*u,g=(i+r)*h;let w,M;if(o===Yi)w=(a+s)*p,M=-2*p;else if(o===Al)w=s*p,M=-1*p;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-m,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-g,l[2]=0,l[6]=0,l[10]=M,l[14]=-w,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let r=0;r<16;r++)if(e[r]!==i[r])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const Bs=new X,ui=new qe,kM=new X(0,0,0),VM=new X(1,1,1),pr=new X,$a=new X,Hn=new X,gd=new qe,_d=new cs;class Vl{constructor(t=0,e=0,i=0,r=Vl.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],u=r[5],h=r[9],p=r[2],m=r[6],g=r[10];switch(e){case"XYZ":this._y=Math.asin(ln(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,g),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(m,u),this._z=0);break;case"YXZ":this._x=Math.asin(-ln(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,g),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-p,s),this._z=0);break;case"ZXY":this._x=Math.asin(ln(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(-p,g),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-ln(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(m,g),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(ln(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-p,s)):(this._x=0,this._y=Math.atan2(o,g));break;case"XZY":this._z=Math.asin(-ln(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(m,u),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,i===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return gd.makeRotationFromQuaternion(t),this.setFromRotationMatrix(gd,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return _d.setFromEuler(this),this.setFromQuaternion(_d,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Vl.DEFAULT_ORDER="XYZ";class Ah{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let e=0;e1){for(let i=0;i0&&(i=i.concat(a))}return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose($o,t,XM),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose($o,$M,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,r=e.length;i0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let u=0,h=l.length;u0){r.children=[];for(let o=0;o0){r.animations=[];for(let o=0;o0&&(i.geometries=o),l.length>0&&(i.materials=l),u.length>0&&(i.textures=u),h.length>0&&(i.images=h),p.length>0&&(i.shapes=p),m.length>0&&(i.skeletons=m),g.length>0&&(i.animations=g),w.length>0&&(i.nodes=w)}return i.object=r,i;function a(o){const l=[];for(const u in o){const h=o[u];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(let i=0;i0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){hi.subVectors(r,e),Vi.subVectors(i,e),vu.subVectors(t,e);const a=hi.dot(hi),o=hi.dot(Vi),l=hi.dot(vu),u=Vi.dot(Vi),h=Vi.dot(vu),p=a*u-o*o;if(p===0)return s.set(-2,-1,-1);const m=1/p,g=(u*l-o*h)*m,w=(a*h-o*l)*m;return s.set(1-g-w,w,g)}static containsPoint(t,e,i,r){return this.getBarycoord(t,e,i,r,Wi),Wi.x>=0&&Wi.y>=0&&Wi.x+Wi.y<=1}static getUV(t,e,i,r,s,a,o,l){return ja===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ja=!0),this.getInterpolation(t,e,i,r,s,a,o,l)}static getInterpolation(t,e,i,r,s,a,o,l){return this.getBarycoord(t,e,i,r,Wi),l.setScalar(0),l.addScaledVector(s,Wi.x),l.addScaledVector(a,Wi.y),l.addScaledVector(o,Wi.z),l}static isFrontFacing(t,e,i,r){return hi.subVectors(i,e),Vi.subVectors(t,e),hi.cross(Vi).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return hi.subVectors(this.c,this.b),Vi.subVectors(this.a,this.b),hi.cross(Vi).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return di.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return di.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,r,s){return ja===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),ja=!0),di.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}getInterpolation(t,e,i,r,s){return di.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return di.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return di.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,s=this.c;let a,o;Hs.subVectors(r,i),Gs.subVectors(s,i),yu.subVectors(t,i);const l=Hs.dot(yu),u=Gs.dot(yu);if(l<=0&&u<=0)return e.copy(i);xu.subVectors(t,r);const h=Hs.dot(xu),p=Gs.dot(xu);if(h>=0&&p<=h)return e.copy(r);const m=l*p-h*u;if(m<=0&&l>=0&&h<=0)return a=l/(l-h),e.copy(i).addScaledVector(Hs,a);wu.subVectors(t,s);const g=Hs.dot(wu),w=Gs.dot(wu);if(w>=0&&g<=w)return e.copy(s);const M=g*u-l*w;if(M<=0&&u>=0&&w<=0)return o=u/(u-w),e.copy(i).addScaledVector(Gs,o);const _=h*w-g*p;if(_<=0&&p-h>=0&&g-w>=0)return Md.subVectors(s,r),o=(p-h)/(p-h+(g-w)),e.copy(r).addScaledVector(Md,o);const v=1/(_+M+m);return a=M*v,o=m*v,e.copy(i).addScaledVector(Hs,a).addScaledVector(Gs,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let YM=0;class uo extends Pr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:YM++}),this.uuid=co(),this.name="",this.type="Material",this.blending=Qs,this.side=Tr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=$p,this.blendDst=qp,this.blendEquation=Ks,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=th,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=oM,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=lu,this.stencilZFail=lu,this.stencilZPass=lu,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const e in t){const i=t[e];if(i===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i}}toJSON(t){const e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Qs&&(i.blending=this.blending),this.side!==Tr&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=this.alphaHash),this.alphaToCoverage===!0&&(i.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(i.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=this.flatShading),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(e){const s=r(t.textures),a=r(t.images);s.length>0&&(i.textures=s),a.length>0&&(i.images=a)}return i}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(e!==null){const r=e.length;i=new Array(r);for(let s=0;s!==r;++s)i[s]=e[s].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}const lm={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},fi={h:0,s:0,l:0},Ya={h:0,s:0,l:0};function Mu(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*6*(2/3-e):n}let Ee=class{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(e===void 0&&i===void 0){const r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Ve){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,ci.toWorkingColorSpace(this,e),this}setRGB(t,e,i,r=ci.workingColorSpace){return this.r=t,this.g=e,this.b=i,ci.toWorkingColorSpace(this,r),this}setHSL(t,e,i,r=ci.workingColorSpace){if(t=Eh(t,1),e=ln(e,0,1),i=ln(i,0,1),e===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+e):i+e-i*e,a=2*i-s;this.r=Mu(a,s,t+1/3),this.g=Mu(a,s,t),this.b=Mu(a,s,t-1/3)}return ci.toWorkingColorSpace(this,r),this}setStyle(t,e=Ve){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(s,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Ve){const i=lm[t.toLowerCase()];return i!==void 0?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=to(t.r),this.g=to(t.g),this.b=to(t.b),this}copyLinearToSRGB(t){return this.r=uu(t.r),this.g=uu(t.g),this.b=uu(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Ve){return ci.fromWorkingColorSpace(xn.copy(this),t),Math.round(ln(xn.r*255,0,255))*65536+Math.round(ln(xn.g*255,0,255))*256+Math.round(ln(xn.b*255,0,255))}getHexString(t=Ve){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=ci.workingColorSpace){ci.fromWorkingColorSpace(xn.copy(this),e);const i=xn.r,r=xn.g,s=xn.b,a=Math.max(i,r,s),o=Math.min(i,r,s);let l,u;const h=(o+a)/2;if(o===a)l=0,u=0;else{const p=a-o;switch(u=h<=.5?p/(a+o):p/(2-a-o),a){case i:l=(r-s)/p+(r0&&(t.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(t[u]=l[u]);return t}t.data={attributes:{}};const e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const l in i){const u=i[l];t.data.attributes[l]=u.toJSON(t.data)}const r={};let s=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],h=[];for(let p=0,m=u.length;p0&&(r[l]=h,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;i!==null&&this.setIndex(i.clone(e));const r=t.attributes;for(const u in r){const h=r[u];this.setAttribute(u,h.clone(e))}const s=t.morphAttributes;for(const u in s){const h=[],p=s[u];for(let m=0,g=p.length;m0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s(t.far-t.near)**2))&&(Sd.copy(s).invert(),Kr.copy(t.ray).applyMatrix4(Sd),!(i.boundingBox!==null&&Kr.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(t,e,Kr)))}_computeIntersections(t,e,i){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,u=s.attributes.uv,h=s.attributes.uv1,p=s.attributes.normal,m=s.groups,g=s.drawRange;if(o!==null)if(Array.isArray(a))for(let w=0,M=m.length;we.far?null:{distance:u,point:il.clone(),object:n}}function rl(n,t,e,i,r,s,a,o,l,u){n.getVertexPosition(o,Vs),n.getVertexPosition(l,Ws),n.getVertexPosition(u,Xs);const h=ZM(n,t,e,i,Vs,Ws,Xs,nl);if(h){r&&(Qa.fromBufferAttribute(r,o),tl.fromBufferAttribute(r,l),el.fromBufferAttribute(r,u),h.uv=di.getInterpolation(nl,Vs,Ws,Xs,Qa,tl,el,new Yt)),s&&(Qa.fromBufferAttribute(s,o),tl.fromBufferAttribute(s,l),el.fromBufferAttribute(s,u),h.uv1=di.getInterpolation(nl,Vs,Ws,Xs,Qa,tl,el,new Yt),h.uv2=h.uv1),a&&(Ed.fromBufferAttribute(a,o),Ad.fromBufferAttribute(a,l),Td.fromBufferAttribute(a,u),h.normal=di.getInterpolation(nl,Vs,Ws,Xs,Ed,Ad,Td,new X),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:l,c:u,normal:new X,materialIndex:0};di.getNormal(Vs,Ws,Xs,p.normal),h.face=p}return h}class Ji extends Wn{constructor(t=1,e=1,i=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],u=[],h=[],p=[];let m=0,g=0;w("z","y","x",-1,-1,i,e,t,a,s,0),w("z","y","x",1,-1,i,e,-t,a,s,1),w("x","z","y",1,1,t,i,e,r,a,2),w("x","z","y",1,-1,t,i,-e,r,a,3),w("x","y","z",1,-1,t,e,i,r,s,4),w("x","y","z",-1,-1,t,e,-i,r,s,5),this.setIndex(l),this.setAttribute("position",new dn(u,3)),this.setAttribute("normal",new dn(h,3)),this.setAttribute("uv",new dn(p,2));function w(M,_,v,T,b,P,I,H,B,K,C){const O=P/B,W=I/K,ct=P/2,Y=I/2,Q=H/2,nt=B+1,_t=K+1;let ht=0,gt=0;const wt=new X;for(let St=0;St<_t;St++){const st=St*W-Y;for(let mt=0;mt0?1:-1,h.push(wt.x,wt.y,wt.z),p.push(mt/B),p.push(1-St/K),ht+=1}}for(let St=0;St0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const r in this.extensions)this.extensions[r]===!0&&(i[r]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class fm extends un{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qe,this.projectionMatrix=new qe,this.projectionMatrixInverse=new qe,this.coordinateSystem=Yi}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class ti extends fm{constructor(t=50,e=1,i=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=la*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(ta*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return la*2*Math.atan(Math.tan(ta*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,e,i,r,s,a){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(ta*.5*this.fov)/this.zoom,i=2*e,r=this.aspect*i,s=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,u=a.fullHeight;s+=a.offsetX*r/l,e-=a.offsetY*i/u,r*=a.width/l,i*=a.height/u}const o=this.filmOffset;o!==0&&(s+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,e,e-i,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const $s=-90,qs=1;class nS extends un{constructor(t,e,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null;const r=new ti($s,qs,t,e);r.layers=this.layers,this.add(r);const s=new ti($s,qs,t,e);s.layers=this.layers,this.add(s);const a=new ti($s,qs,t,e);a.layers=this.layers,this.add(a);const o=new ti($s,qs,t,e);o.layers=this.layers,this.add(o);const l=new ti($s,qs,t,e);l.layers=this.layers,this.add(l);const u=new ti($s,qs,t,e);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[i,r,s,a,o,l]=e;for(const u of e)this.remove(u);if(t===Yi)i.up.set(0,1,0),i.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.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),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Al)i.up.set(0,-1,0),i.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.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),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const u of e)this.add(u),u.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();const i=this.renderTarget;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[r,s,a,o,l,u]=this.children,h=t.getRenderTarget(),p=t.xr.enabled;t.xr.enabled=!1;const m=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,r),t.setRenderTarget(i,1),t.render(e,s),t.setRenderTarget(i,2),t.render(e,a),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,l),i.texture.generateMipmaps=m,t.setRenderTarget(i,5),t.render(e,u),t.setRenderTarget(h),t.xr.enabled=p,i.texture.needsPMREMUpdate=!0}}class dm extends Un{constructor(t,e,i,r,s,a,o,l,u,h){t=t!==void 0?t:[],e=e!==void 0?e:no,super(t,e,i,r,s,a,o,l,u,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class iS extends ls{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const i={width:t,height:t,depth:1},r=[i,i,i,i,i,i];e.encoding!==void 0&&(na("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===ss?Ve:os),this.texture=new dm(r,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:Qn}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={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 Ji(5,5,5),s=new Cr({name:"CubemapFromEquirect",uniforms:so(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:In,blending:Sr});s.uniforms.tEquirect.value=e;const a=new Dn(r,s),o=e.minFilter;return e.minFilter===oa&&(e.minFilter=Qn),new nS(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,i,r){const s=t.getRenderTarget();for(let a=0;a<6;a++)t.setRenderTarget(this,a),t.clear(e,i,r);t.setRenderTarget(s)}}const Eu=new X,rS=new X,sS=new ye;class ji{constructor(t=new X(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const r=Eu.subVectors(i,e).cross(rS.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const i=t.delta(Eu),r=this.normal.dot(i);if(r===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;const s=-(t.start.dot(this.normal)+this.constant)/r;return s<0||s>1?null:e.copy(t.start).addScaledVector(i,s)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||sS.getNormalMatrix(t),r=this.coplanarPoint(Eu).applyMatrix4(t),s=this.normal.applyMatrix3(i).normalize();return this.constant=-r.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Zr=new Gl,sl=new X;class Ch{constructor(t=new ji,e=new ji,i=new ji,r=new ji,s=new ji,a=new ji){this.planes=[t,e,i,r,s,a]}set(t,e,i,r,s,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t,e=Yi){const i=this.planes,r=t.elements,s=r[0],a=r[1],o=r[2],l=r[3],u=r[4],h=r[5],p=r[6],m=r[7],g=r[8],w=r[9],M=r[10],_=r[11],v=r[12],T=r[13],b=r[14],P=r[15];if(i[0].setComponents(l-s,m-u,_-g,P-v).normalize(),i[1].setComponents(l+s,m+u,_+g,P+v).normalize(),i[2].setComponents(l+a,m+h,_+w,P+T).normalize(),i[3].setComponents(l-a,m-h,_-w,P-T).normalize(),i[4].setComponents(l-o,m-p,_-M,P-b).normalize(),e===Yi)i[5].setComponents(l+o,m+p,_+M,P+b).normalize();else if(e===Al)i[5].setComponents(o,p,M,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Zr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Zr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Zr)}intersectsSprite(t){return Zr.center.set(0,0,0),Zr.radius=.7071067811865476,Zr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Zr)}intersectsSphere(t){const e=this.planes,i=t.center,r=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(i)0?t.max.x:t.min.x,sl.y=r.normal.y>0?t.max.y:t.min.y,sl.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(sl)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function pm(){let n=null,t=!1,e=null,i=null;function r(s,a){e(s,a),i=n.requestAnimationFrame(r)}return{start:function(){t!==!0&&e!==null&&(i=n.requestAnimationFrame(r),t=!0)},stop:function(){n.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){n=s}}}function oS(n,t){const e=t.isWebGL2,i=new WeakMap;function r(u,h){const p=u.array,m=u.usage,g=n.createBuffer();n.bindBuffer(h,g),n.bufferData(h,p,m),u.onUploadCallback();let w;if(p instanceof Float32Array)w=n.FLOAT;else if(p instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(e)w=n.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else w=n.UNSIGNED_SHORT;else if(p instanceof Int16Array)w=n.SHORT;else if(p instanceof Uint32Array)w=n.UNSIGNED_INT;else if(p instanceof Int32Array)w=n.INT;else if(p instanceof Int8Array)w=n.BYTE;else if(p instanceof Uint8Array)w=n.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)w=n.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:g,type:w,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version}}function s(u,h,p){const m=h.array,g=h.updateRange;n.bindBuffer(p,u),g.count===-1?n.bufferSubData(p,0,m):(e?n.bufferSubData(p,g.offset*m.BYTES_PER_ELEMENT,m,g.offset,g.count):n.bufferSubData(p,g.offset*m.BYTES_PER_ELEMENT,m.subarray(g.offset,g.offset+g.count)),g.count=-1),h.onUploadCallback()}function a(u){return u.isInterleavedBufferAttribute&&(u=u.data),i.get(u)}function o(u){u.isInterleavedBufferAttribute&&(u=u.data);const h=i.get(u);h&&(n.deleteBuffer(h.buffer),i.delete(u))}function l(u,h){if(u.isGLBufferAttribute){const m=i.get(u);(!m||m.version 0 + vec4 plane; + #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`,wS=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,MS=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,SS=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,bS=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,ES=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,AS=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,TS=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,CS=`#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; +}; +struct GeometricContext { + vec3 position; + vec3 normal; + vec3 viewDir; +#ifdef USE_CLEARCOAT + vec3 clearcoatNormal; +#endif +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +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`,RS=`#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_v0 0.339 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_v1 0.276 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_v4 0.046 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_v5 0.016 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_v6 0.0038 + #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`,PS=`vec3 transformedNormal = objectNormal; +#ifdef USE_INSTANCING + mat3 m = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); + transformedNormal = m * transformedNormal; +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,LS=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,DS=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,NS=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,IS=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,US="gl_FragColor = linearToOutputTexel( gl_FragColor );",OS=`vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( 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 ); +}`,FS=`#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 = inverseTransformDirection( 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #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`,BS=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,zS=`#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`,HS=`#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`,GS=`#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 = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,kS=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,VS=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,WS=`#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`,XS=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,$S=`#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 +}`,qS=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,jS=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,YS=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,KS=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, 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`,ZS=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +uniform vec3 lightProbe[ 9 ]; +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 = inverseTransformDirection( 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 ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +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, const in GeometricContext geometry, 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 GeometricContext geometry, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometry.position; + 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 GeometricContext geometry, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometry.position; + 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`,JS=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, 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, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, 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`,QS=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,tb=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, 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`,eb=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,nb=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, 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`,ib=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); +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 = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), 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_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.07, 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 ); + 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`,rb=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #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; + #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 clearcoatSpecular = vec3( 0.0 ); +vec3 sheenSpecular = 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 ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + 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.specularColor; + 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 * transposeMat3( 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 a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + 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 + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #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; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometry.normal; + vec3 viewDir = geometry.viewDir; + vec3 position = geometry.position; + 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.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#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 ); +}`,sb=` +GeometricContext geometry; +geometry.position = - vViewPosition; +geometry.normal = normal; +geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +#ifdef USE_CLEARCOAT + geometry.clearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometry.viewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + 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, geometry, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometry, 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, geometry, 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.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometry, 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, geometry, 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.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometry, 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, geometry, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,ob=`#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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometry.normal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,ab=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); +#endif`,lb=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,cb=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,ub=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,hb=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,fb=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,db=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,pb=`#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`,mb=`#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`,gb=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,_b=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,vb=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + 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`,yb=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,xb=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + 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 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,wb=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,Mb=`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 + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + 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 + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 geometryNormal = normal;`,Sb=`#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; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,bb=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Eb=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,Ab=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,Tb=`#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`,Cb=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = geometryNormal; +#endif`,Rb=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,Pb=`#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`,Lb=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,Db=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,Nb=`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 vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( 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( 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 ) { + return depth * ( near - far ) - near; +} +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 ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,Ib=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Ub=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,Ob=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,Fb=`#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`,Bb=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,zb=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,Hb=`#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 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, 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 ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,Gb=`#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 shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + 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 shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,kb=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + 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`,Vb=`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.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.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + 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.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,Wb=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,Xb=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + uniform int boneTextureSize; + mat4 getBoneMatrix( const in float i ) { + float j = i * 4.0; + float x = mod( j, float( boneTextureSize ) ); + float y = floor( j / float( boneTextureSize ) ); + float dx = 1.0 / float( boneTextureSize ); + float dy = 1.0 / float( boneTextureSize ); + y = dy * ( y + 0.5 ); + vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); + vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); + vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); + vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); + mat4 bone = mat4( v1, v2, v3, v4 ); + return bone; + } +#endif`,$b=`#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`,qb=`#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`,jb=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,Yb=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,Kb=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,Zb=`#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 OptimizedCineonToneMapping( 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 ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,Jb=`#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 = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, 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`,Qb=`#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 ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + 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; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + 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`,tE=`#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`,eE=`#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`,nE=`#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`,iE=`#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_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const rE=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,sE=`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 +}`,oE=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,aE=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,lE=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,cE=`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 +}`,uE=`#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,hE=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + vec4 diffuseColor = vec4( 1.0 ); + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,fE=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,dE=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + #include + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,pE=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,mE=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,gE=`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 +}`,_E=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,vE=`#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #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 +}`,yE=`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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #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 +}`,xE=`#define LAMBERT +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,wE=`#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 +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,ME=`#define MATCAP +varying vec3 vViewPosition; +#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 + vViewPosition = - mvPosition.xyz; +}`,SE=`#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() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #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 +}`,bE=`#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 +void main() { + #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 +}`,EE=`#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 +#include +void main() { + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,AE=`#define PHONG +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,TE=`#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 +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,CE=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,RE=`#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_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 +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,PE=`#define TOON +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 + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,LE=`#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 +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + 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 +}`,DE=`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 + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,NE=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,IE=`#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,UE=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,OE=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #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 +}`,FE=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,_e={alphahash_fragment:aS,alphahash_pars_fragment:lS,alphamap_fragment:cS,alphamap_pars_fragment:uS,alphatest_fragment:hS,alphatest_pars_fragment:fS,aomap_fragment:dS,aomap_pars_fragment:pS,begin_vertex:mS,beginnormal_vertex:gS,bsdfs:_S,iridescence_fragment:vS,bumpmap_pars_fragment:yS,clipping_planes_fragment:xS,clipping_planes_pars_fragment:wS,clipping_planes_pars_vertex:MS,clipping_planes_vertex:SS,color_fragment:bS,color_pars_fragment:ES,color_pars_vertex:AS,color_vertex:TS,common:CS,cube_uv_reflection_fragment:RS,defaultnormal_vertex:PS,displacementmap_pars_vertex:LS,displacementmap_vertex:DS,emissivemap_fragment:NS,emissivemap_pars_fragment:IS,colorspace_fragment:US,colorspace_pars_fragment:OS,envmap_fragment:FS,envmap_common_pars_fragment:BS,envmap_pars_fragment:zS,envmap_pars_vertex:HS,envmap_physical_pars_fragment:JS,envmap_vertex:GS,fog_vertex:kS,fog_pars_vertex:VS,fog_fragment:WS,fog_pars_fragment:XS,gradientmap_pars_fragment:$S,lightmap_fragment:qS,lightmap_pars_fragment:jS,lights_lambert_fragment:YS,lights_lambert_pars_fragment:KS,lights_pars_begin:ZS,lights_toon_fragment:QS,lights_toon_pars_fragment:tb,lights_phong_fragment:eb,lights_phong_pars_fragment:nb,lights_physical_fragment:ib,lights_physical_pars_fragment:rb,lights_fragment_begin:sb,lights_fragment_maps:ob,lights_fragment_end:ab,logdepthbuf_fragment:lb,logdepthbuf_pars_fragment:cb,logdepthbuf_pars_vertex:ub,logdepthbuf_vertex:hb,map_fragment:fb,map_pars_fragment:db,map_particle_fragment:pb,map_particle_pars_fragment:mb,metalnessmap_fragment:gb,metalnessmap_pars_fragment:_b,morphcolor_vertex:vb,morphnormal_vertex:yb,morphtarget_pars_vertex:xb,morphtarget_vertex:wb,normal_fragment_begin:Mb,normal_fragment_maps:Sb,normal_pars_fragment:bb,normal_pars_vertex:Eb,normal_vertex:Ab,normalmap_pars_fragment:Tb,clearcoat_normal_fragment_begin:Cb,clearcoat_normal_fragment_maps:Rb,clearcoat_pars_fragment:Pb,iridescence_pars_fragment:Lb,opaque_fragment:Db,packing:Nb,premultiplied_alpha_fragment:Ib,project_vertex:Ub,dithering_fragment:Ob,dithering_pars_fragment:Fb,roughnessmap_fragment:Bb,roughnessmap_pars_fragment:zb,shadowmap_pars_fragment:Hb,shadowmap_pars_vertex:Gb,shadowmap_vertex:kb,shadowmask_pars_fragment:Vb,skinbase_vertex:Wb,skinning_pars_vertex:Xb,skinning_vertex:$b,skinnormal_vertex:qb,specularmap_fragment:jb,specularmap_pars_fragment:Yb,tonemapping_fragment:Kb,tonemapping_pars_fragment:Zb,transmission_fragment:Jb,transmission_pars_fragment:Qb,uv_pars_fragment:tE,uv_pars_vertex:eE,uv_vertex:nE,worldpos_vertex:iE,background_vert:rE,background_frag:sE,backgroundCube_vert:oE,backgroundCube_frag:aE,cube_vert:lE,cube_frag:cE,depth_vert:uE,depth_frag:hE,distanceRGBA_vert:fE,distanceRGBA_frag:dE,equirect_vert:pE,equirect_frag:mE,linedashed_vert:gE,linedashed_frag:_E,meshbasic_vert:vE,meshbasic_frag:yE,meshlambert_vert:xE,meshlambert_frag:wE,meshmatcap_vert:ME,meshmatcap_frag:SE,meshnormal_vert:bE,meshnormal_frag:EE,meshphong_vert:AE,meshphong_frag:TE,meshphysical_vert:CE,meshphysical_frag:RE,meshtoon_vert:PE,meshtoon_frag:LE,points_vert:DE,points_frag:NE,shadow_vert:IE,shadow_frag:UE,sprite_vert:OE,sprite_frag:FE},Ht={common:{diffuse:{value:new Ee(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ye},alphaMap:{value:null},alphaMapTransform:{value:new ye},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ye}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ye}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ye}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ye},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ye},normalScale:{value:new Yt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ye},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ye}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ye}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ye}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ee(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ee(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ye},alphaTest:{value:0},uvTransform:{value:new ye}},sprite:{diffuse:{value:new Ee(16777215)},opacity:{value:1},center:{value:new Yt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ye},alphaMap:{value:null},alphaMapTransform:{value:new ye},alphaTest:{value:0}}},Si={basic:{uniforms:bn([Ht.common,Ht.specularmap,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.fog]),vertexShader:_e.meshbasic_vert,fragmentShader:_e.meshbasic_frag},lambert:{uniforms:bn([Ht.common,Ht.specularmap,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.emissivemap,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.fog,Ht.lights,{emissive:{value:new Ee(0)}}]),vertexShader:_e.meshlambert_vert,fragmentShader:_e.meshlambert_frag},phong:{uniforms:bn([Ht.common,Ht.specularmap,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.emissivemap,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.fog,Ht.lights,{emissive:{value:new Ee(0)},specular:{value:new Ee(1118481)},shininess:{value:30}}]),vertexShader:_e.meshphong_vert,fragmentShader:_e.meshphong_frag},standard:{uniforms:bn([Ht.common,Ht.envmap,Ht.aomap,Ht.lightmap,Ht.emissivemap,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.roughnessmap,Ht.metalnessmap,Ht.fog,Ht.lights,{emissive:{value:new Ee(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_e.meshphysical_vert,fragmentShader:_e.meshphysical_frag},toon:{uniforms:bn([Ht.common,Ht.aomap,Ht.lightmap,Ht.emissivemap,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.gradientmap,Ht.fog,Ht.lights,{emissive:{value:new Ee(0)}}]),vertexShader:_e.meshtoon_vert,fragmentShader:_e.meshtoon_frag},matcap:{uniforms:bn([Ht.common,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,Ht.fog,{matcap:{value:null}}]),vertexShader:_e.meshmatcap_vert,fragmentShader:_e.meshmatcap_frag},points:{uniforms:bn([Ht.points,Ht.fog]),vertexShader:_e.points_vert,fragmentShader:_e.points_frag},dashed:{uniforms:bn([Ht.common,Ht.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_e.linedashed_vert,fragmentShader:_e.linedashed_frag},depth:{uniforms:bn([Ht.common,Ht.displacementmap]),vertexShader:_e.depth_vert,fragmentShader:_e.depth_frag},normal:{uniforms:bn([Ht.common,Ht.bumpmap,Ht.normalmap,Ht.displacementmap,{opacity:{value:1}}]),vertexShader:_e.meshnormal_vert,fragmentShader:_e.meshnormal_frag},sprite:{uniforms:bn([Ht.sprite,Ht.fog]),vertexShader:_e.sprite_vert,fragmentShader:_e.sprite_frag},background:{uniforms:{uvTransform:{value:new ye},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_e.background_vert,fragmentShader:_e.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_e.backgroundCube_vert,fragmentShader:_e.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_e.cube_vert,fragmentShader:_e.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_e.equirect_vert,fragmentShader:_e.equirect_frag},distanceRGBA:{uniforms:bn([Ht.common,Ht.displacementmap,{referencePosition:{value:new X},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_e.distanceRGBA_vert,fragmentShader:_e.distanceRGBA_frag},shadow:{uniforms:bn([Ht.lights,Ht.fog,{color:{value:new Ee(0)},opacity:{value:1}}]),vertexShader:_e.shadow_vert,fragmentShader:_e.shadow_frag}};Si.physical={uniforms:bn([Si.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ye},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ye},clearcoatNormalScale:{value:new Yt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ye},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ye},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ye},sheen:{value:0},sheenColor:{value:new Ee(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ye},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ye},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ye},transmissionSamplerSize:{value:new Yt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ye},attenuationDistance:{value:0},attenuationColor:{value:new Ee(0)},specularColor:{value:new Ee(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ye},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ye},anisotropyVector:{value:new Yt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ye}}]),vertexShader:_e.meshphysical_vert,fragmentShader:_e.meshphysical_frag};const ol={r:0,b:0,g:0};function BE(n,t,e,i,r,s,a){const o=new Ee(0);let l=s===!0?0:1,u,h,p=null,m=0,g=null;function w(_,v){let T=!1,b=v.isScene===!0?v.background:null;b&&b.isTexture&&(b=(v.backgroundBlurriness>0?e:t).get(b)),b===null?M(o,l):b&&b.isColor&&(M(b,1),T=!0);const P=n.xr.getEnvironmentBlendMode();P==="additive"?i.buffers.color.setClear(0,0,0,1,a):P==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,a),(n.autoClear||T)&&n.clear(n.autoClearColor,n.autoClearDepth,n.autoClearStencil),b&&(b.isCubeTexture||b.mapping===zl)?(h===void 0&&(h=new Dn(new Ji(1,1,1),new Cr({name:"BackgroundCubeMaterial",uniforms:so(Si.backgroundCube.uniforms),vertexShader:Si.backgroundCube.vertexShader,fragmentShader:Si.backgroundCube.fragmentShader,side:In,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(I,H,B){this.matrixWorld.copyPosition(B.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(h)),h.material.uniforms.envMap.value=b,h.material.uniforms.flipEnvMap.value=b.isCubeTexture&&b.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.toneMapped=b.colorSpace!==Ve,(p!==b||m!==b.version||g!==n.toneMapping)&&(h.material.needsUpdate=!0,p=b,m=b.version,g=n.toneMapping),h.layers.enableAll(),_.unshift(h,h.geometry,h.material,0,0,null)):b&&b.isTexture&&(u===void 0&&(u=new Dn(new ca(2,2),new Cr({name:"BackgroundMaterial",uniforms:so(Si.background.uniforms),vertexShader:Si.background.vertexShader,fragmentShader:Si.background.fragmentShader,side:Tr,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(u)),u.material.uniforms.t2D.value=b,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=b.colorSpace!==Ve,b.matrixAutoUpdate===!0&&b.updateMatrix(),u.material.uniforms.uvTransform.value.copy(b.matrix),(p!==b||m!==b.version||g!==n.toneMapping)&&(u.material.needsUpdate=!0,p=b,m=b.version,g=n.toneMapping),u.layers.enableAll(),_.unshift(u,u.geometry,u.material,0,0,null))}function M(_,v){_.getRGB(ol,hm(n)),i.buffers.color.setClear(ol.r,ol.g,ol.b,v,a)}return{getClearColor:function(){return o},setClearColor:function(_,v=1){o.set(_),l=v,M(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(_){l=_,M(o,l)},render:w}}function zE(n,t,e,i){const r=n.getParameter(n.MAX_VERTEX_ATTRIBS),s=i.isWebGL2?null:t.get("OES_vertex_array_object"),a=i.isWebGL2||s!==null,o={},l=_(null);let u=l,h=!1;function p(Q,nt,_t,ht,gt){let wt=!1;if(a){const St=M(ht,_t,nt);u!==St&&(u=St,g(u.object)),wt=v(Q,ht,_t,gt),wt&&T(Q,ht,_t,gt)}else{const St=nt.wireframe===!0;(u.geometry!==ht.id||u.program!==_t.id||u.wireframe!==St)&&(u.geometry=ht.id,u.program=_t.id,u.wireframe=St,wt=!0)}gt!==null&&e.update(gt,n.ELEMENT_ARRAY_BUFFER),(wt||h)&&(h=!1,K(Q,nt,_t,ht),gt!==null&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e.get(gt).buffer))}function m(){return i.isWebGL2?n.createVertexArray():s.createVertexArrayOES()}function g(Q){return i.isWebGL2?n.bindVertexArray(Q):s.bindVertexArrayOES(Q)}function w(Q){return i.isWebGL2?n.deleteVertexArray(Q):s.deleteVertexArrayOES(Q)}function M(Q,nt,_t){const ht=_t.wireframe===!0;let gt=o[Q.id];gt===void 0&&(gt={},o[Q.id]=gt);let wt=gt[nt.id];wt===void 0&&(wt={},gt[nt.id]=wt);let St=wt[ht];return St===void 0&&(St=_(m()),wt[ht]=St),St}function _(Q){const nt=[],_t=[],ht=[];for(let gt=0;gt=0){const Ot=gt[mt];let Gt=wt[mt];if(Gt===void 0&&(mt==="instanceMatrix"&&Q.instanceMatrix&&(Gt=Q.instanceMatrix),mt==="instanceColor"&&Q.instanceColor&&(Gt=Q.instanceColor)),Ot===void 0||Ot.attribute!==Gt||Gt&&Ot.data!==Gt.data)return!0;St++}return u.attributesNum!==St||u.index!==ht}function T(Q,nt,_t,ht){const gt={},wt=nt.attributes;let St=0;const st=_t.getAttributes();for(const mt in st)if(st[mt].location>=0){let Ot=wt[mt];Ot===void 0&&(mt==="instanceMatrix"&&Q.instanceMatrix&&(Ot=Q.instanceMatrix),mt==="instanceColor"&&Q.instanceColor&&(Ot=Q.instanceColor));const Gt={};Gt.attribute=Ot,Ot&&Ot.data&&(Gt.data=Ot.data),gt[mt]=Gt,St++}u.attributes=gt,u.attributesNum=St,u.index=ht}function b(){const Q=u.newAttributes;for(let nt=0,_t=Q.length;nt<_t;nt++)Q[nt]=0}function P(Q){I(Q,0)}function I(Q,nt){const _t=u.newAttributes,ht=u.enabledAttributes,gt=u.attributeDivisors;_t[Q]=1,ht[Q]===0&&(n.enableVertexAttribArray(Q),ht[Q]=1),gt[Q]!==nt&&((i.isWebGL2?n:t.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](Q,nt),gt[Q]=nt)}function H(){const Q=u.newAttributes,nt=u.enabledAttributes;for(let _t=0,ht=nt.length;_t=0){let It=gt[st];if(It===void 0&&(st==="instanceMatrix"&&Q.instanceMatrix&&(It=Q.instanceMatrix),st==="instanceColor"&&Q.instanceColor&&(It=Q.instanceColor)),It!==void 0){const Ot=It.normalized,Gt=It.itemSize,Jt=e.get(It);if(Jt===void 0)continue;const se=Jt.buffer,Kt=Jt.type,pe=Jt.bytesPerElement,Pe=i.isWebGL2===!0&&(Kt===n.INT||Kt===n.UNSIGNED_INT||It.gpuType===Kp);if(It.isInterleavedBufferAttribute){const he=It.data,tt=he.stride,Oe=It.offset;if(he.isInstancedInterleavedBuffer){for(let Zt=0;Zt0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision>0)return"highp";B="mediump"}return B==="mediump"&&n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT).precision>0&&n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&n.constructor.name==="WebGL2RenderingContext";let o=e.precision!==void 0?e.precision:"highp";const l=s(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const u=a||t.has("WEBGL_draw_buffers"),h=e.logarithmicDepthBuffer===!0,p=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),m=n.getParameter(n.MAX_VERTEX_TEXTURE_IMAGE_UNITS),g=n.getParameter(n.MAX_TEXTURE_SIZE),w=n.getParameter(n.MAX_CUBE_MAP_TEXTURE_SIZE),M=n.getParameter(n.MAX_VERTEX_ATTRIBS),_=n.getParameter(n.MAX_VERTEX_UNIFORM_VECTORS),v=n.getParameter(n.MAX_VARYING_VECTORS),T=n.getParameter(n.MAX_FRAGMENT_UNIFORM_VECTORS),b=m>0,P=a||t.has("OES_texture_float"),I=b&&P,H=a?n.getParameter(n.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:u,getMaxAnisotropy:r,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:p,maxVertexTextures:m,maxTextureSize:g,maxCubemapSize:w,maxAttributes:M,maxVertexUniforms:_,maxVaryings:v,maxFragmentUniforms:T,vertexTextures:b,floatFragmentTextures:P,floatVertexTextures:I,maxSamples:H}}function kE(n){const t=this;let e=null,i=0,r=!1,s=!1;const a=new ji,o=new ye,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(p,m){const g=p.length!==0||m||i!==0||r;return r=m,i=p.length,g},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(p,m){e=h(p,m,0)},this.setState=function(p,m,g){const w=p.clippingPlanes,M=p.clipIntersection,_=p.clipShadows,v=n.get(p);if(!r||w===null||w.length===0||s&&!_)s?h(null):u();else{const T=s?0:i,b=T*4;let P=v.clippingState||null;l.value=P,P=h(w,m,b,g);for(let I=0;I!==b;++I)P[I]=e[I];v.clippingState=P,this.numIntersection=M?this.numPlanes:0,this.numPlanes+=T}};function u(){l.value!==e&&(l.value=e,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function h(p,m,g,w){const M=p!==null?p.length:0;let _=null;if(M!==0){if(_=l.value,w!==!0||_===null){const v=g+M*4,T=m.matrixWorldInverse;o.getNormalMatrix(T),(_===null||_.length0){const u=new iS(l.height/2);return u.fromEquirectangularTexture(n,a),t.set(a,u),a.addEventListener("dispose",r),e(u.texture,a.mapping)}else return null}}return a}function r(a){const o=a.target;o.removeEventListener("dispose",r);const l=t.get(o);l!==void 0&&(t.delete(o),l.dispose())}function s(){t=new WeakMap}return{get:i,dispose:s}}class mm extends fm{constructor(t=-1,e=1,i=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,i,r,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-t,a=i+t,o=r+e,l=r-e;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,a=s+u*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}}const Js=4,Cd=[.125,.215,.35,.446,.526,.582],es=20,Au=new mm,Rd=new Ee;let Tu=null;const Qr=(1+Math.sqrt(5))/2,js=1/Qr,Pd=[new X(1,1,1),new X(-1,1,1),new X(1,1,-1),new X(-1,1,-1),new X(0,Qr,js),new X(0,Qr,-js),new X(js,0,Qr),new X(-js,0,Qr),new X(Qr,js,0),new X(-Qr,js,0)];class Ld{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,r=100){Tu=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,i,r,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Id(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Nd(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?b:0,b,b),h.setRenderTarget(r),M&&h.render(w,o),h.render(t,o)}w.geometry.dispose(),w.material.dispose(),h.toneMapping=m,h.autoClear=p,t.background=_}_textureToCubeUV(t,e){const i=this._renderer,r=t.mapping===no||t.mapping===io;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Id()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Nd());const s=r?this._cubemapMaterial:this._equirectMaterial,a=new Dn(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=t;const l=this._cubeSize;al(e,0,0,3*l,2*l),i.setRenderTarget(e),i.render(a,Au)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let r=1;res&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${es}`);const v=[];let T=0;for(let B=0;Bb-Js?r-b+Js:0),H=4*(this._cubeSize-P);al(e,I,H,3*P,2*P),l.setRenderTarget(e),l.render(p,Au)}}function WE(n){const t=[],e=[],i=[];let r=n;const s=n-Js+1+Cd.length;for(let a=0;an-Js?l=Cd[a-n+Js-1]:a===0&&(l=0),i.push(l);const u=1/(o-2),h=-u,p=1+u,m=[h,h,p,h,p,p,h,h,p,p,h,p],g=6,w=6,M=3,_=2,v=1,T=new Float32Array(M*w*g),b=new Float32Array(_*w*g),P=new Float32Array(v*w*g);for(let H=0;H2?0:-1,C=[B,K,0,B+2/3,K,0,B+2/3,K+1,0,B,K,0,B+2/3,K+1,0,B,K+1,0];T.set(C,M*w*H),b.set(m,_*w*H);const O=[H,H,H,H,H,H];P.set(O,v*w*H)}const I=new Wn;I.setAttribute("position",new Ei(T,M)),I.setAttribute("uv",new Ei(b,_)),I.setAttribute("faceIndex",new Ei(P,v)),t.push(I),r>Js&&r--}return{lodPlanes:t,sizeLods:e,sigmas:i}}function Dd(n,t,e){const i=new ls(n,t,e);return i.texture.mapping=zl,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function al(n,t,e,i,r){n.viewport.set(t,e,i,r),n.scissor.set(t,e,i,r)}function XE(n,t,e){const i=new Float32Array(es),r=new X(0,1,0);return new Cr({name:"SphericalGaussianBlur",defines:{n:es,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${n}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Rh(),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:Sr,depthTest:!1,depthWrite:!1})}function Nd(){return new Cr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Rh(),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:Sr,depthTest:!1,depthWrite:!1})}function Id(){return new Cr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Rh(),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:Sr,depthTest:!1,depthWrite:!1})}function Rh(){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 ); + + } + `}function $E(n){let t=new WeakMap,e=null;function i(o){if(o&&o.isTexture){const l=o.mapping,u=l===eh||l===nh,h=l===no||l===io;if(u||h)if(o.isRenderTargetTexture&&o.needsPMREMUpdate===!0){o.needsPMREMUpdate=!1;let p=t.get(o);return e===null&&(e=new Ld(n)),p=u?e.fromEquirectangular(o,p):e.fromCubemap(o,p),t.set(o,p),p.texture}else{if(t.has(o))return t.get(o).texture;{const p=o.image;if(u&&p&&p.height>0||h&&p&&r(p)){e===null&&(e=new Ld(n));const m=u?e.fromEquirectangular(o):e.fromCubemap(o);return t.set(o,m),o.addEventListener("dispose",s),m.texture}else return null}}}return o}function r(o){let l=0;const u=6;for(let h=0;ht.maxTextureSize&&(O=Math.ceil(C/t.maxTextureSize),C=t.maxTextureSize);const W=new Float32Array(C*O*4*w),ct=new am(W,C,O,w);ct.type=xr,ct.needsUpdate=!0;const Y=K*4;for(let nt=0;nt0)return n;const r=t*e;let s=Ud[r];if(s===void 0&&(s=new Float32Array(r),Ud[r]=s),t!==0){i.toArray(s,0);for(let a=1,o=0;a!==t;++a)o+=e,n[a].toArray(s,o)}return s}function nn(n,t){if(n.length!==t.length)return!1;for(let e=0,i=n.length;e":" "} ${o}: ${e[a]}`)}return i.join(` +`)}function qA(n){switch(n){case Ti:return["Linear","( value )"];case Ve:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",n),["Linear","( value )"]}}function kd(n,t,e){const i=n.getShaderParameter(t,n.COMPILE_STATUS),r=n.getShaderInfoLog(t).trim();if(i&&r==="")return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const a=parseInt(s[1]);return e.toUpperCase()+` + +`+r+` + +`+$A(n.getShaderSource(t),a)}else return r}function jA(n,t){const e=qA(t);return"vec4 "+n+"( vec4 value ) { return LinearTo"+e[0]+e[1]+"; }"}function YA(n,t){let e;switch(t){case kw:e="Linear";break;case Vw:e="Reinhard";break;case Ww:e="OptimizedCineon";break;case Xw:e="ACESFilmic";break;case $w:e="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),e="Linear"}return"vec3 "+n+"( vec3 color ) { return "+e+"ToneMapping( color ); }"}function KA(n){return[n.extensionDerivatives||n.envMapCubeUVHeight||n.bumpMap||n.normalMapTangentSpace||n.clearcoatNormalMap||n.flatShading||n.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap||n.transmission)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ko).join(` +`)}function ZA(n){const t=[];for(const e in n){const i=n[e];i!==!1&&t.push("#define "+e+" "+i)}return t.join(` +`)}function JA(n,t){const e={},i=n.getProgramParameter(t,n.ACTIVE_ATTRIBUTES);for(let r=0;r/gm;function ah(n){return n.replace(QA,eT)}const tT=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function eT(n,t){let e=_e[t];if(e===void 0){const i=tT.get(t);if(i!==void 0)e=_e[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,i);else throw new Error("Can not resolve #include <"+t+">")}return ah(e)}const nT=/#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 Xd(n){return n.replace(nT,iT)}function iT(n,t,e,i){let r="";for(let s=parseInt(t);s0&&(_+=` +`),v=[g,"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,w].filter(Ko).join(` +`),v.length>0&&(v+=` +`)):(_=[$d(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,w,e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors&&e.isWebGL2?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0&&e.isWebGL2?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","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","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","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(Ko).join(` +`),v=[g,$d(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,w,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+u:"",e.envMap?"#define "+h:"",e.envMap?"#define "+p:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",e.logarithmicDepthBuffer&&e.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==br?"#define TONE_MAPPING":"",e.toneMapping!==br?_e.tonemapping_pars_fragment:"",e.toneMapping!==br?YA("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",_e.colorspace_pars_fragment,jA("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",` +`].filter(Ko).join(` +`)),a=ah(a),a=Vd(a,e),a=Wd(a,e),o=ah(o),o=Vd(o,e),o=Wd(o,e),a=Xd(a),o=Xd(o),e.isWebGL2&&e.isRawShaderMaterial!==!0&&(T=`#version 300 es +`,_=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+_,v=["#define varying in",e.glslVersion===fd?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===fd?"":"#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(` +`)+` +`+v);const b=T+_+a,P=T+v+o,I=Gd(r,r.VERTEX_SHADER,b),H=Gd(r,r.FRAGMENT_SHADER,P);if(r.attachShader(M,I),r.attachShader(M,H),e.index0AttributeName!==void 0?r.bindAttribLocation(M,0,e.index0AttributeName):e.morphTargets===!0&&r.bindAttribLocation(M,0,"position"),r.linkProgram(M),n.debug.checkShaderErrors){const C=r.getProgramInfoLog(M).trim(),O=r.getShaderInfoLog(I).trim(),W=r.getShaderInfoLog(H).trim();let ct=!0,Y=!0;if(r.getProgramParameter(M,r.LINK_STATUS)===!1)if(ct=!1,typeof n.debug.onShaderError=="function")n.debug.onShaderError(r,M,I,H);else{const Q=kd(r,I,"vertex"),nt=kd(r,H,"fragment");console.error("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(M,r.VALIDATE_STATUS)+` + +Program Info Log: `+C+` +`+Q+` +`+nt)}else C!==""?console.warn("THREE.WebGLProgram: Program Info Log:",C):(O===""||W==="")&&(Y=!1);Y&&(this.diagnostics={runnable:ct,programLog:C,vertexShader:{log:O,prefix:_},fragmentShader:{log:W,prefix:v}})}r.deleteShader(I),r.deleteShader(H);let B;this.getUniforms=function(){return B===void 0&&(B=new gl(r,M)),B};let K;return this.getAttributes=function(){return K===void 0&&(K=JA(r,M)),K},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(M),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=XA++,this.cacheKey=t,this.usedTimes=1,this.program=M,this.vertexShader=I,this.fragmentShader=H,this}let uT=0;class hT{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,r=this._getShaderStage(e),s=this._getShaderStage(i),a=this._getShaderCacheForMaterial(t);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.add(s),s.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const i of e)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let i=e.get(t);return i===void 0&&(i=new Set,e.set(t,i)),i}_getShaderStage(t){const e=this.shaderCache;let i=e.get(t);return i===void 0&&(i=new fT(t),e.set(t,i)),i}}class fT{constructor(t){this.id=uT++,this.code=t,this.usedTimes=0}}function dT(n,t,e,i,r,s,a){const o=new Ah,l=new hT,u=[],h=r.isWebGL2,p=r.logarithmicDepthBuffer,m=r.vertexTextures;let g=r.precision;const w={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",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(C){return C===0?"uv":`uv${C}`}function _(C,O,W,ct,Y){const Q=ct.fog,nt=Y.geometry,_t=C.isMeshStandardMaterial?ct.environment:null,ht=(C.isMeshStandardMaterial?e:t).get(C.envMap||_t),gt=ht&&ht.mapping===zl?ht.image.height:null,wt=w[C.type];C.precision!==null&&(g=r.getMaxPrecision(C.precision),g!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",g,"instead."));const St=nt.morphAttributes.position||nt.morphAttributes.normal||nt.morphAttributes.color,st=St!==void 0?St.length:0;let mt=0;nt.morphAttributes.position!==void 0&&(mt=1),nt.morphAttributes.normal!==void 0&&(mt=2),nt.morphAttributes.color!==void 0&&(mt=3);let It,Ot,Gt,Jt;if(wt){const De=Si[wt];It=De.vertexShader,Ot=De.fragmentShader}else It=C.vertexShader,Ot=C.fragmentShader,l.update(C),Gt=l.getVertexShaderID(C),Jt=l.getFragmentShaderID(C);const se=n.getRenderTarget(),Kt=Y.isInstancedMesh===!0,pe=!!C.map,Pe=!!C.matcap,he=!!ht,tt=!!C.aoMap,Oe=!!C.lightMap,Zt=!!C.bumpMap,oe=!!C.normalMap,ie=!!C.displacementMap,Te=!!C.emissiveMap,fe=!!C.metalnessMap,Pt=!!C.roughnessMap,Qt=C.anisotropy>0,we=C.clearcoat>0,Me=C.iridescence>0,N=C.sheen>0,R=C.transmission>0,rt=Qt&&!!C.anisotropyMap,At=we&&!!C.clearcoatMap,bt=we&&!!C.clearcoatNormalMap,Tt=we&&!!C.clearcoatRoughnessMap,kt=Me&&!!C.iridescenceMap,Ct=Me&&!!C.iridescenceThicknessMap,at=N&&!!C.sheenColorMap,k=N&&!!C.sheenRoughnessMap,xt=!!C.specularMap,Bt=!!C.specularColorMap,Nt=!!C.specularIntensityMap,Ft=R&&!!C.transmissionMap,ce=R&&!!C.thicknessMap,ve=!!C.gradientMap,$=!!C.alphaMap,Ut=C.alphaTest>0,lt=!!C.alphaHash,Et=!!C.extensions,Lt=!!nt.attributes.uv1,me=!!nt.attributes.uv2,Ae=!!nt.attributes.uv3;let Le=br;return C.toneMapped&&(se===null||se.isXRRenderTarget===!0)&&(Le=n.toneMapping),{isWebGL2:h,shaderID:wt,shaderType:C.type,shaderName:C.name,vertexShader:It,fragmentShader:Ot,defines:C.defines,customVertexShaderID:Gt,customFragmentShaderID:Jt,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:g,instancing:Kt,instancingColor:Kt&&Y.instanceColor!==null,supportsVertexTextures:m,outputColorSpace:se===null?n.outputColorSpace:se.isXRRenderTarget===!0?se.texture.colorSpace:Ti,map:pe,matcap:Pe,envMap:he,envMapMode:he&&ht.mapping,envMapCubeUVHeight:gt,aoMap:tt,lightMap:Oe,bumpMap:Zt,normalMap:oe,displacementMap:m&&ie,emissiveMap:Te,normalMapObjectSpace:oe&&C.normalMapType===sM,normalMapTangentSpace:oe&&C.normalMapType===im,metalnessMap:fe,roughnessMap:Pt,anisotropy:Qt,anisotropyMap:rt,clearcoat:we,clearcoatMap:At,clearcoatNormalMap:bt,clearcoatRoughnessMap:Tt,iridescence:Me,iridescenceMap:kt,iridescenceThicknessMap:Ct,sheen:N,sheenColorMap:at,sheenRoughnessMap:k,specularMap:xt,specularColorMap:Bt,specularIntensityMap:Nt,transmission:R,transmissionMap:Ft,thicknessMap:ce,gradientMap:ve,opaque:C.transparent===!1&&C.blending===Qs,alphaMap:$,alphaTest:Ut,alphaHash:lt,combine:C.combine,mapUv:pe&&M(C.map.channel),aoMapUv:tt&&M(C.aoMap.channel),lightMapUv:Oe&&M(C.lightMap.channel),bumpMapUv:Zt&&M(C.bumpMap.channel),normalMapUv:oe&&M(C.normalMap.channel),displacementMapUv:ie&&M(C.displacementMap.channel),emissiveMapUv:Te&&M(C.emissiveMap.channel),metalnessMapUv:fe&&M(C.metalnessMap.channel),roughnessMapUv:Pt&&M(C.roughnessMap.channel),anisotropyMapUv:rt&&M(C.anisotropyMap.channel),clearcoatMapUv:At&&M(C.clearcoatMap.channel),clearcoatNormalMapUv:bt&&M(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Tt&&M(C.clearcoatRoughnessMap.channel),iridescenceMapUv:kt&&M(C.iridescenceMap.channel),iridescenceThicknessMapUv:Ct&&M(C.iridescenceThicknessMap.channel),sheenColorMapUv:at&&M(C.sheenColorMap.channel),sheenRoughnessMapUv:k&&M(C.sheenRoughnessMap.channel),specularMapUv:xt&&M(C.specularMap.channel),specularColorMapUv:Bt&&M(C.specularColorMap.channel),specularIntensityMapUv:Nt&&M(C.specularIntensityMap.channel),transmissionMapUv:Ft&&M(C.transmissionMap.channel),thicknessMapUv:ce&&M(C.thicknessMap.channel),alphaMapUv:$&&M(C.alphaMap.channel),vertexTangents:!!nt.attributes.tangent&&(oe||Qt),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!nt.attributes.color&&nt.attributes.color.itemSize===4,vertexUv1s:Lt,vertexUv2s:me,vertexUv3s:Ae,pointsUvs:Y.isPoints===!0&&!!nt.attributes.uv&&(pe||$),fog:!!Q,useFog:C.fog===!0,fogExp2:Q&&Q.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:p,skinning:Y.isSkinnedMesh===!0,morphTargets:nt.morphAttributes.position!==void 0,morphNormals:nt.morphAttributes.normal!==void 0,morphColors:nt.morphAttributes.color!==void 0,morphTargetsCount:st,morphTextureStride:mt,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,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:C.dithering,shadowMapEnabled:n.shadowMap.enabled&&W.length>0,shadowMapType:n.shadowMap.type,toneMapping:Le,useLegacyLights:n._useLegacyLights,decodeVideoTexture:pe&&C.map.isVideoTexture===!0&&C.map.colorSpace===Ve,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===bi,flipSided:C.side===In,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:Et&&C.extensions.derivatives===!0,extensionFragDepth:Et&&C.extensions.fragDepth===!0,extensionDrawBuffers:Et&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:Et&&C.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:C.customProgramCacheKey()}}function v(C){const O=[];if(C.shaderID?O.push(C.shaderID):(O.push(C.customVertexShaderID),O.push(C.customFragmentShaderID)),C.defines!==void 0)for(const W in C.defines)O.push(W),O.push(C.defines[W]);return C.isRawShaderMaterial===!1&&(T(O,C),b(O,C),O.push(n.outputColorSpace)),O.push(C.customProgramCacheKey),O.join()}function T(C,O){C.push(O.precision),C.push(O.outputColorSpace),C.push(O.envMapMode),C.push(O.envMapCubeUVHeight),C.push(O.mapUv),C.push(O.alphaMapUv),C.push(O.lightMapUv),C.push(O.aoMapUv),C.push(O.bumpMapUv),C.push(O.normalMapUv),C.push(O.displacementMapUv),C.push(O.emissiveMapUv),C.push(O.metalnessMapUv),C.push(O.roughnessMapUv),C.push(O.anisotropyMapUv),C.push(O.clearcoatMapUv),C.push(O.clearcoatNormalMapUv),C.push(O.clearcoatRoughnessMapUv),C.push(O.iridescenceMapUv),C.push(O.iridescenceThicknessMapUv),C.push(O.sheenColorMapUv),C.push(O.sheenRoughnessMapUv),C.push(O.specularMapUv),C.push(O.specularColorMapUv),C.push(O.specularIntensityMapUv),C.push(O.transmissionMapUv),C.push(O.thicknessMapUv),C.push(O.combine),C.push(O.fogExp2),C.push(O.sizeAttenuation),C.push(O.morphTargetsCount),C.push(O.morphAttributeCount),C.push(O.numDirLights),C.push(O.numPointLights),C.push(O.numSpotLights),C.push(O.numSpotLightMaps),C.push(O.numHemiLights),C.push(O.numRectAreaLights),C.push(O.numDirLightShadows),C.push(O.numPointLightShadows),C.push(O.numSpotLightShadows),C.push(O.numSpotLightShadowsWithMaps),C.push(O.shadowMapType),C.push(O.toneMapping),C.push(O.numClippingPlanes),C.push(O.numClipIntersection),C.push(O.depthPacking)}function b(C,O){o.disableAll(),O.isWebGL2&&o.enable(0),O.supportsVertexTextures&&o.enable(1),O.instancing&&o.enable(2),O.instancingColor&&o.enable(3),O.matcap&&o.enable(4),O.envMap&&o.enable(5),O.normalMapObjectSpace&&o.enable(6),O.normalMapTangentSpace&&o.enable(7),O.clearcoat&&o.enable(8),O.iridescence&&o.enable(9),O.alphaTest&&o.enable(10),O.vertexColors&&o.enable(11),O.vertexAlphas&&o.enable(12),O.vertexUv1s&&o.enable(13),O.vertexUv2s&&o.enable(14),O.vertexUv3s&&o.enable(15),O.vertexTangents&&o.enable(16),O.anisotropy&&o.enable(17),C.push(o.mask),o.disableAll(),O.fog&&o.enable(0),O.useFog&&o.enable(1),O.flatShading&&o.enable(2),O.logarithmicDepthBuffer&&o.enable(3),O.skinning&&o.enable(4),O.morphTargets&&o.enable(5),O.morphNormals&&o.enable(6),O.morphColors&&o.enable(7),O.premultipliedAlpha&&o.enable(8),O.shadowMapEnabled&&o.enable(9),O.useLegacyLights&&o.enable(10),O.doubleSided&&o.enable(11),O.flipSided&&o.enable(12),O.useDepthPacking&&o.enable(13),O.dithering&&o.enable(14),O.transmission&&o.enable(15),O.sheen&&o.enable(16),O.opaque&&o.enable(17),O.pointsUvs&&o.enable(18),O.decodeVideoTexture&&o.enable(19),C.push(o.mask)}function P(C){const O=w[C.type];let W;if(O){const ct=Si[O];W=QM.clone(ct.uniforms)}else W=C.uniforms;return W}function I(C,O){let W;for(let ct=0,Y=u.length;ct0?i.push(v):g.transparent===!0?r.push(v):e.push(v)}function l(p,m,g,w,M,_){const v=a(p,m,g,w,M,_);g.transmission>0?i.unshift(v):g.transparent===!0?r.unshift(v):e.unshift(v)}function u(p,m){e.length>1&&e.sort(p||mT),i.length>1&&i.sort(m||qd),r.length>1&&r.sort(m||qd)}function h(){for(let p=t,m=n.length;p=s.length?(a=new jd,s.push(a)):a=s[r],a}function e(){n=new WeakMap}return{get:t,dispose:e}}function _T(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new X,color:new Ee};break;case"SpotLight":e={position:new X,direction:new X,color:new Ee,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new X,color:new Ee,distance:0,decay:0};break;case"HemisphereLight":e={direction:new X,skyColor:new Ee,groundColor:new Ee};break;case"RectAreaLight":e={color:new Ee,position:new X,halfWidth:new X,halfHeight:new X};break}return n[t.id]=e,e}}}function vT(){const n={};return{get:function(t){if(n[t.id]!==void 0)return n[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Yt};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Yt};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Yt,shadowCameraNear:1,shadowCameraFar:1e3};break}return n[t.id]=e,e}}}let yT=0;function xT(n,t){return(t.castShadow?2:0)-(n.castShadow?2:0)+(t.map?1:0)-(n.map?1:0)}function wT(n,t){const e=new _T,i=vT(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let h=0;h<9;h++)r.probe.push(new X);const s=new X,a=new qe,o=new qe;function l(h,p){let m=0,g=0,w=0;for(let W=0;W<9;W++)r.probe[W].set(0,0,0);let M=0,_=0,v=0,T=0,b=0,P=0,I=0,H=0,B=0,K=0;h.sort(xT);const C=p===!0?Math.PI:1;for(let W=0,ct=h.length;W0&&(t.isWebGL2||n.has("OES_texture_float_linear")===!0?(r.rectAreaLTC1=Ht.LTC_FLOAT_1,r.rectAreaLTC2=Ht.LTC_FLOAT_2):n.has("OES_texture_half_float_linear")===!0?(r.rectAreaLTC1=Ht.LTC_HALF_1,r.rectAreaLTC2=Ht.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=m,r.ambient[1]=g,r.ambient[2]=w;const O=r.hash;(O.directionalLength!==M||O.pointLength!==_||O.spotLength!==v||O.rectAreaLength!==T||O.hemiLength!==b||O.numDirectionalShadows!==P||O.numPointShadows!==I||O.numSpotShadows!==H||O.numSpotMaps!==B)&&(r.directional.length=M,r.spot.length=v,r.rectArea.length=T,r.point.length=_,r.hemi.length=b,r.directionalShadow.length=P,r.directionalShadowMap.length=P,r.pointShadow.length=I,r.pointShadowMap.length=I,r.spotShadow.length=H,r.spotShadowMap.length=H,r.directionalShadowMatrix.length=P,r.pointShadowMatrix.length=I,r.spotLightMatrix.length=H+B-K,r.spotLightMap.length=B,r.numSpotLightShadowsWithMaps=K,O.directionalLength=M,O.pointLength=_,O.spotLength=v,O.rectAreaLength=T,O.hemiLength=b,O.numDirectionalShadows=P,O.numPointShadows=I,O.numSpotShadows=H,O.numSpotMaps=B,r.version=yT++)}function u(h,p){let m=0,g=0,w=0,M=0,_=0;const v=p.matrixWorldInverse;for(let T=0,b=h.length;T=o.length?(l=new Yd(n,t),o.push(l)):l=o[a],l}function r(){e=new WeakMap}return{get:i,dispose:r}}class ST extends uo{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=iM,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class bT extends uo{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const ET=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,AT=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +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 = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function TT(n,t,e){let i=new Ch;const r=new Yt,s=new Yt,a=new cn,o=new ST({depthPacking:rM}),l=new bT,u={},h=e.maxTextureSize,p={[Tr]:In,[In]:Tr,[bi]:bi},m=new Cr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Yt},radius:{value:4}},vertexShader:ET,fragmentShader:AT}),g=m.clone();g.defines.HORIZONTAL_PASS=1;const w=new Wn;w.setAttribute("position",new Ei(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const M=new Dn(w,m),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Wp;let v=this.type;this.render=function(I,H,B){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||I.length===0)return;const K=n.getRenderTarget(),C=n.getActiveCubeFace(),O=n.getActiveMipmapLevel(),W=n.state;W.setBlending(Sr),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const ct=v!==$i&&this.type===$i,Y=v===$i&&this.type!==$i;for(let Q=0,nt=I.length;Qh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/gt.x),r.x=s.x*gt.x,ht.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/gt.y),r.y=s.y*gt.y,ht.mapSize.y=s.y)),ht.map===null||ct===!0||Y===!0){const St=this.type!==$i?{minFilter:En,magFilter:En}:{};ht.map!==null&&ht.map.dispose(),ht.map=new ls(r.x,r.y,St),ht.map.texture.name=_t.name+".shadowMap",ht.camera.updateProjectionMatrix()}n.setRenderTarget(ht.map),n.clear();const wt=ht.getViewportCount();for(let St=0;St0||H.map&&H.alphaTest>0){const W=C.uuid,ct=H.uuid;let Y=u[W];Y===void 0&&(Y={},u[W]=Y);let Q=Y[ct];Q===void 0&&(Q=C.clone(),Y[ct]=Q),C=Q}if(C.visible=H.visible,C.wireframe=H.wireframe,K===$i?C.side=H.shadowSide!==null?H.shadowSide:H.side:C.side=H.shadowSide!==null?H.shadowSide:p[H.side],C.alphaMap=H.alphaMap,C.alphaTest=H.alphaTest,C.map=H.map,C.clipShadows=H.clipShadows,C.clippingPlanes=H.clippingPlanes,C.clipIntersection=H.clipIntersection,C.displacementMap=H.displacementMap,C.displacementScale=H.displacementScale,C.displacementBias=H.displacementBias,C.wireframeLinewidth=H.wireframeLinewidth,C.linewidth=H.linewidth,B.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const W=n.properties.get(C);W.light=B}return C}function P(I,H,B,K,C){if(I.visible===!1)return;if(I.layers.test(H.layers)&&(I.isMesh||I.isLine||I.isPoints)&&(I.castShadow||I.receiveShadow&&C===$i)&&(!I.frustumCulled||i.intersectsObject(I))){I.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,I.matrixWorld);const ct=t.update(I),Y=I.material;if(Array.isArray(Y)){const Q=ct.groups;for(let nt=0,_t=Q.length;nt<_t;nt++){const ht=Q[nt],gt=Y[ht.materialIndex];if(gt&>.visible){const wt=b(I,gt,K,C);n.renderBufferDirect(B,null,ct,wt,I,ht)}}}else if(Y.visible){const Q=b(I,Y,K,C);n.renderBufferDirect(B,null,ct,Q,I,null)}}const W=I.children;for(let ct=0,Y=W.length;ct=1):gt.indexOf("OpenGL ES")!==-1&&(ht=parseFloat(/^OpenGL ES (\d)/.exec(gt)[1]),_t=ht>=2);let wt=null,St={};const st=n.getParameter(n.SCISSOR_BOX),mt=n.getParameter(n.VIEWPORT),It=new cn().fromArray(st),Ot=new cn().fromArray(mt);function Gt($,Ut,lt,Et){const Lt=new Uint8Array(4),me=n.createTexture();n.bindTexture($,me),n.texParameteri($,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri($,n.TEXTURE_MAG_FILTER,n.NEAREST);for(let Ae=0;Ae"u"?!1:/OculusBrowser/g.test(navigator.userAgent),w=new WeakMap;let M;const _=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function T(N,R){return v?new OffscreenCanvas(N,R):Cl("canvas")}function b(N,R,rt,At){let bt=1;if((N.width>At||N.height>At)&&(bt=At/Math.max(N.width,N.height)),bt<1||R===!0)if(typeof HTMLImageElement<"u"&&N instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&N instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&N instanceof ImageBitmap){const Tt=R?Tl:Math.floor,kt=Tt(bt*N.width),Ct=Tt(bt*N.height);M===void 0&&(M=T(kt,Ct));const at=rt?T(kt,Ct):M;return at.width=kt,at.height=Ct,at.getContext("2d").drawImage(N,0,0,kt,Ct),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+N.width+"x"+N.height+") to ("+kt+"x"+Ct+")."),at}else return"data"in N&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+N.width+"x"+N.height+")."),N;return N}function P(N){return oh(N.width)&&oh(N.height)}function I(N){return o?!1:N.wrapS!==pi||N.wrapT!==pi||N.minFilter!==En&&N.minFilter!==Qn}function H(N,R){return N.generateMipmaps&&R&&N.minFilter!==En&&N.minFilter!==Qn}function B(N){n.generateMipmap(N)}function K(N,R,rt,At,bt=!1){if(o===!1)return R;if(N!==null){if(n[N]!==void 0)return n[N];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+N+"'")}let Tt=R;return R===n.RED&&(rt===n.FLOAT&&(Tt=n.R32F),rt===n.HALF_FLOAT&&(Tt=n.R16F),rt===n.UNSIGNED_BYTE&&(Tt=n.R8)),R===n.RED_INTEGER&&(rt===n.UNSIGNED_BYTE&&(Tt=n.R8UI),rt===n.UNSIGNED_SHORT&&(Tt=n.R16UI),rt===n.UNSIGNED_INT&&(Tt=n.R32UI),rt===n.BYTE&&(Tt=n.R8I),rt===n.SHORT&&(Tt=n.R16I),rt===n.INT&&(Tt=n.R32I)),R===n.RG&&(rt===n.FLOAT&&(Tt=n.RG32F),rt===n.HALF_FLOAT&&(Tt=n.RG16F),rt===n.UNSIGNED_BYTE&&(Tt=n.RG8)),R===n.RGBA&&(rt===n.FLOAT&&(Tt=n.RGBA32F),rt===n.HALF_FLOAT&&(Tt=n.RGBA16F),rt===n.UNSIGNED_BYTE&&(Tt=At===Ve&&bt===!1?n.SRGB8_ALPHA8:n.RGBA8),rt===n.UNSIGNED_SHORT_4_4_4_4&&(Tt=n.RGBA4),rt===n.UNSIGNED_SHORT_5_5_5_1&&(Tt=n.RGB5_A1)),(Tt===n.R16F||Tt===n.R32F||Tt===n.RG16F||Tt===n.RG32F||Tt===n.RGBA16F||Tt===n.RGBA32F)&&t.get("EXT_color_buffer_float"),Tt}function C(N,R,rt){return H(N,rt)===!0||N.isFramebufferTexture&&N.minFilter!==En&&N.minFilter!==Qn?Math.log2(Math.max(R.width,R.height))+1:N.mipmaps!==void 0&&N.mipmaps.length>0?N.mipmaps.length:N.isCompressedTexture&&Array.isArray(N.image)?R.mipmaps.length:1}function O(N){return N===En||N===zf||N===nu?n.NEAREST:n.LINEAR}function W(N){const R=N.target;R.removeEventListener("dispose",W),Y(R),R.isVideoTexture&&w.delete(R)}function ct(N){const R=N.target;R.removeEventListener("dispose",ct),nt(R)}function Y(N){const R=i.get(N);if(R.__webglInit===void 0)return;const rt=N.source,At=_.get(rt);if(At){const bt=At[R.__cacheKey];bt.usedTimes--,bt.usedTimes===0&&Q(N),Object.keys(At).length===0&&_.delete(rt)}i.remove(N)}function Q(N){const R=i.get(N);n.deleteTexture(R.__webglTexture);const rt=N.source,At=_.get(rt);delete At[R.__cacheKey],a.memory.textures--}function nt(N){const R=N.texture,rt=i.get(N),At=i.get(R);if(At.__webglTexture!==void 0&&(n.deleteTexture(At.__webglTexture),a.memory.textures--),N.depthTexture&&N.depthTexture.dispose(),N.isWebGLCubeRenderTarget)for(let bt=0;bt<6;bt++){if(Array.isArray(rt.__webglFramebuffer[bt]))for(let Tt=0;Tt=l&&console.warn("THREE.WebGLTextures: Trying to use "+N+" texture units while this GPU supports only "+l),_t+=1,N}function wt(N){const R=[];return R.push(N.wrapS),R.push(N.wrapT),R.push(N.wrapR||0),R.push(N.magFilter),R.push(N.minFilter),R.push(N.anisotropy),R.push(N.internalFormat),R.push(N.format),R.push(N.type),R.push(N.generateMipmaps),R.push(N.premultiplyAlpha),R.push(N.flipY),R.push(N.unpackAlignment),R.push(N.colorSpace),R.join()}function St(N,R){const rt=i.get(N);if(N.isVideoTexture&&we(N),N.isRenderTargetTexture===!1&&N.version>0&&rt.__version!==N.version){const At=N.image;if(At===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(At.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{pe(rt,N,R);return}}e.bindTexture(n.TEXTURE_2D,rt.__webglTexture,n.TEXTURE0+R)}function st(N,R){const rt=i.get(N);if(N.version>0&&rt.__version!==N.version){pe(rt,N,R);return}e.bindTexture(n.TEXTURE_2D_ARRAY,rt.__webglTexture,n.TEXTURE0+R)}function mt(N,R){const rt=i.get(N);if(N.version>0&&rt.__version!==N.version){pe(rt,N,R);return}e.bindTexture(n.TEXTURE_3D,rt.__webglTexture,n.TEXTURE0+R)}function It(N,R){const rt=i.get(N);if(N.version>0&&rt.__version!==N.version){Pe(rt,N,R);return}e.bindTexture(n.TEXTURE_CUBE_MAP,rt.__webglTexture,n.TEXTURE0+R)}const Ot={[ih]:n.REPEAT,[pi]:n.CLAMP_TO_EDGE,[rh]:n.MIRRORED_REPEAT},Gt={[En]:n.NEAREST,[zf]:n.NEAREST_MIPMAP_NEAREST,[nu]:n.NEAREST_MIPMAP_LINEAR,[Qn]:n.LINEAR,[qw]:n.LINEAR_MIPMAP_NEAREST,[oa]:n.LINEAR_MIPMAP_LINEAR},Jt={[aM]:n.NEVER,[pM]:n.ALWAYS,[lM]:n.LESS,[uM]:n.LEQUAL,[cM]:n.EQUAL,[dM]:n.GEQUAL,[hM]:n.GREATER,[fM]:n.NOTEQUAL};function se(N,R,rt){if(rt?(n.texParameteri(N,n.TEXTURE_WRAP_S,Ot[R.wrapS]),n.texParameteri(N,n.TEXTURE_WRAP_T,Ot[R.wrapT]),(N===n.TEXTURE_3D||N===n.TEXTURE_2D_ARRAY)&&n.texParameteri(N,n.TEXTURE_WRAP_R,Ot[R.wrapR]),n.texParameteri(N,n.TEXTURE_MAG_FILTER,Gt[R.magFilter]),n.texParameteri(N,n.TEXTURE_MIN_FILTER,Gt[R.minFilter])):(n.texParameteri(N,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(N,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),(N===n.TEXTURE_3D||N===n.TEXTURE_2D_ARRAY)&&n.texParameteri(N,n.TEXTURE_WRAP_R,n.CLAMP_TO_EDGE),(R.wrapS!==pi||R.wrapT!==pi)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(N,n.TEXTURE_MAG_FILTER,O(R.magFilter)),n.texParameteri(N,n.TEXTURE_MIN_FILTER,O(R.minFilter)),R.minFilter!==En&&R.minFilter!==Qn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),R.compareFunction&&(n.texParameteri(N,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(N,n.TEXTURE_COMPARE_FUNC,Jt[R.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){const At=t.get("EXT_texture_filter_anisotropic");if(R.magFilter===En||R.minFilter!==nu&&R.minFilter!==oa||R.type===xr&&t.has("OES_texture_float_linear")===!1||o===!1&&R.type===aa&&t.has("OES_texture_half_float_linear")===!1)return;(R.anisotropy>1||i.get(R).__currentAnisotropy)&&(n.texParameterf(N,At.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(R.anisotropy,r.getMaxAnisotropy())),i.get(R).__currentAnisotropy=R.anisotropy)}}function Kt(N,R){let rt=!1;N.__webglInit===void 0&&(N.__webglInit=!0,R.addEventListener("dispose",W));const At=R.source;let bt=_.get(At);bt===void 0&&(bt={},_.set(At,bt));const Tt=wt(R);if(Tt!==N.__cacheKey){bt[Tt]===void 0&&(bt[Tt]={texture:n.createTexture(),usedTimes:0},a.memory.textures++,rt=!0),bt[Tt].usedTimes++;const kt=bt[N.__cacheKey];kt!==void 0&&(bt[N.__cacheKey].usedTimes--,kt.usedTimes===0&&Q(R)),N.__cacheKey=Tt,N.__webglTexture=bt[Tt].texture}return rt}function pe(N,R,rt){let At=n.TEXTURE_2D;(R.isDataArrayTexture||R.isCompressedArrayTexture)&&(At=n.TEXTURE_2D_ARRAY),R.isData3DTexture&&(At=n.TEXTURE_3D);const bt=Kt(N,R),Tt=R.source;e.bindTexture(At,N.__webglTexture,n.TEXTURE0+rt);const kt=i.get(Tt);if(Tt.version!==kt.__version||bt===!0){e.activeTexture(n.TEXTURE0+rt),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,R.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,R.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,R.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE);const Ct=I(R)&&P(R.image)===!1;let at=b(R.image,Ct,!1,h);at=Me(R,at);const k=P(at)||o,xt=s.convert(R.format,R.colorSpace);let Bt=s.convert(R.type),Nt=K(R.internalFormat,xt,Bt,R.colorSpace,R.isVideoTexture);se(At,R,k);let Ft;const ce=R.mipmaps,ve=o&&R.isVideoTexture!==!0,$=kt.__version===void 0||bt===!0,Ut=C(R,at,k);if(R.isDepthTexture)Nt=n.DEPTH_COMPONENT,o?R.type===xr?Nt=n.DEPTH_COMPONENT32F:R.type===yr?Nt=n.DEPTH_COMPONENT24:R.type===is?Nt=n.DEPTH24_STENCIL8:Nt=n.DEPTH_COMPONENT16:R.type===xr&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),R.format===rs&&Nt===n.DEPTH_COMPONENT&&R.type!==bh&&R.type!==yr&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),R.type=yr,Bt=s.convert(R.type)),R.format===ro&&Nt===n.DEPTH_COMPONENT&&(Nt=n.DEPTH_STENCIL,R.type!==is&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),R.type=is,Bt=s.convert(R.type))),$&&(ve?e.texStorage2D(n.TEXTURE_2D,1,Nt,at.width,at.height):e.texImage2D(n.TEXTURE_2D,0,Nt,at.width,at.height,0,xt,Bt,null));else if(R.isDataTexture)if(ce.length>0&&k){ve&&$&&e.texStorage2D(n.TEXTURE_2D,Ut,Nt,ce[0].width,ce[0].height);for(let lt=0,Et=ce.length;lt>=1,Et>>=1}}else if(ce.length>0&&k){ve&&$&&e.texStorage2D(n.TEXTURE_2D,Ut,Nt,ce[0].width,ce[0].height);for(let lt=0,Et=ce.length;lt0&&$++,e.texStorage2D(n.TEXTURE_CUBE_MAP,$,Ft,at[0].width,at[0].height));for(let lt=0;lt<6;lt++)if(Ct){ce?e.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,0,0,at[lt].width,at[lt].height,Bt,Nt,at[lt].data):e.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+lt,0,Ft,at[lt].width,at[lt].height,0,Bt,Nt,at[lt].data);for(let Et=0;Et>Tt),Bt=Math.max(1,R.height>>Tt);bt===n.TEXTURE_3D||bt===n.TEXTURE_2D_ARRAY?e.texImage3D(bt,Tt,at,xt,Bt,R.depth,0,kt,Ct,null):e.texImage2D(bt,Tt,at,xt,Bt,0,kt,Ct,null)}e.bindFramebuffer(n.FRAMEBUFFER,N),Qt(R)?m.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER,At,bt,i.get(rt).__webglTexture,0,Pt(R)):(bt===n.TEXTURE_2D||bt>=n.TEXTURE_CUBE_MAP_POSITIVE_X&&bt<=n.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&n.framebufferTexture2D(n.FRAMEBUFFER,At,bt,i.get(rt).__webglTexture,Tt),e.bindFramebuffer(n.FRAMEBUFFER,null)}function tt(N,R,rt){if(n.bindRenderbuffer(n.RENDERBUFFER,N),R.depthBuffer&&!R.stencilBuffer){let At=n.DEPTH_COMPONENT16;if(rt||Qt(R)){const bt=R.depthTexture;bt&&bt.isDepthTexture&&(bt.type===xr?At=n.DEPTH_COMPONENT32F:bt.type===yr&&(At=n.DEPTH_COMPONENT24));const Tt=Pt(R);Qt(R)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,Tt,At,R.width,R.height):n.renderbufferStorageMultisample(n.RENDERBUFFER,Tt,At,R.width,R.height)}else n.renderbufferStorage(n.RENDERBUFFER,At,R.width,R.height);n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,N)}else if(R.depthBuffer&&R.stencilBuffer){const At=Pt(R);rt&&Qt(R)===!1?n.renderbufferStorageMultisample(n.RENDERBUFFER,At,n.DEPTH24_STENCIL8,R.width,R.height):Qt(R)?m.renderbufferStorageMultisampleEXT(n.RENDERBUFFER,At,n.DEPTH24_STENCIL8,R.width,R.height):n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,R.width,R.height),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,N)}else{const At=R.isWebGLMultipleRenderTargets===!0?R.texture:[R.texture];for(let bt=0;bt0){rt.__webglFramebuffer[Ct]=[];for(let at=0;at0){rt.__webglFramebuffer=[];for(let Ct=0;Ct0&&Qt(N)===!1){const Ct=Tt?R:[R];rt.__webglMultisampledFramebuffer=n.createFramebuffer(),rt.__webglColorRenderbuffer=[],e.bindFramebuffer(n.FRAMEBUFFER,rt.__webglMultisampledFramebuffer);for(let at=0;at0)for(let at=0;at0)for(let at=0;at0&&Qt(N)===!1){const R=N.isWebGLMultipleRenderTargets?N.texture:[N.texture],rt=N.width,At=N.height;let bt=n.COLOR_BUFFER_BIT;const Tt=[],kt=N.stencilBuffer?n.DEPTH_STENCIL_ATTACHMENT:n.DEPTH_ATTACHMENT,Ct=i.get(N),at=N.isWebGLMultipleRenderTargets===!0;if(at)for(let k=0;k0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&R.__useRenderToTexture!==!1}function we(N){const R=a.render.frame;w.get(N)!==R&&(w.set(N,R),N.update())}function Me(N,R){const rt=N.colorSpace,At=N.format,bt=N.type;return N.isCompressedTexture===!0||N.isVideoTexture===!0||N.format===sh||rt!==Ti&&rt!==os&&(rt===Ve||rt===Hl?o===!1?t.has("EXT_sRGB")===!0&&At===mi?(N.format=sh,N.minFilter=Qn,N.generateMipmaps=!1):R=sm.sRGBToLinear(R):(At!==mi||bt!==Er)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",rt)),R}this.allocateTextureUnit=gt,this.resetTextureUnits=ht,this.setTexture2D=St,this.setTexture2DArray=st,this.setTexture3D=mt,this.setTextureCube=It,this.rebindTextures=oe,this.setupRenderTarget=ie,this.updateRenderTargetMipmap=Te,this.updateMultisampleRenderTarget=fe,this.setupDepthRenderbuffer=Zt,this.setupFrameBufferTexture=he,this.useMultisampledRTT=Qt}const PT=0,tn=1;function LT(n,t,e){const i=e.isWebGL2;function r(s,a=os){let o;const l=a===Ve||a===Hl?tn:PT;if(s===Er)return n.UNSIGNED_BYTE;if(s===Zp)return n.UNSIGNED_SHORT_4_4_4_4;if(s===Jp)return n.UNSIGNED_SHORT_5_5_5_1;if(s===jw)return n.BYTE;if(s===Yw)return n.SHORT;if(s===bh)return n.UNSIGNED_SHORT;if(s===Kp)return n.INT;if(s===yr)return n.UNSIGNED_INT;if(s===xr)return n.FLOAT;if(s===aa)return i?n.HALF_FLOAT:(o=t.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===Kw)return n.ALPHA;if(s===mi)return n.RGBA;if(s===Zw)return n.LUMINANCE;if(s===Jw)return n.LUMINANCE_ALPHA;if(s===rs)return n.DEPTH_COMPONENT;if(s===ro)return n.DEPTH_STENCIL;if(s===sh)return o=t.get("EXT_sRGB"),o!==null?o.SRGB_ALPHA_EXT:null;if(s===Qw)return n.RED;if(s===Qp)return n.RED_INTEGER;if(s===tM)return n.RG;if(s===tm)return n.RG_INTEGER;if(s===em)return n.RGBA_INTEGER;if(s===iu||s===ru||s===su||s===ou)if(l===tn)if(o=t.get("WEBGL_compressed_texture_s3tc_srgb"),o!==null){if(s===iu)return o.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===ru)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===su)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===ou)return o.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(o=t.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===iu)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===ru)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===su)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===ou)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===Hf||s===Gf||s===kf||s===Vf)if(o=t.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===Hf)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===Gf)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===kf)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===Vf)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===eM)return o=t.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===Wf||s===Xf)if(o=t.get("WEBGL_compressed_texture_etc"),o!==null){if(s===Wf)return l===tn?o.COMPRESSED_SRGB8_ETC2:o.COMPRESSED_RGB8_ETC2;if(s===Xf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:o.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===$f||s===qf||s===jf||s===Yf||s===Kf||s===Zf||s===Jf||s===Qf||s===td||s===ed||s===nd||s===id||s===rd||s===sd)if(o=t.get("WEBGL_compressed_texture_astc"),o!==null){if(s===$f)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:o.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===qf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:o.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===jf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:o.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===Yf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:o.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Kf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:o.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===Zf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:o.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Jf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:o.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===Qf)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:o.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===td)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:o.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===ed)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:o.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===nd)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:o.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===id)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:o.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===rd)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:o.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===sd)return l===tn?o.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:o.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===au||s===od||s===ad)if(o=t.get("EXT_texture_compression_bptc"),o!==null){if(s===au)return l===tn?o.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:o.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===od)return o.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===ad)return o.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===nM||s===ld||s===cd||s===ud)if(o=t.get("EXT_texture_compression_rgtc"),o!==null){if(s===au)return o.COMPRESSED_RED_RGTC1_EXT;if(s===ld)return o.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===cd)return o.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===ud)return o.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===is?i?n.UNSIGNED_INT_24_8:(o=t.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null):n[s]!==void 0?n[s]:null}return{convert:r}}class DT extends ti{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class ll extends un{constructor(){super(),this.isGroup=!0,this.type="Group"}}const NT={type:"move"};class Ru{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ll,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ll,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new X,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new X),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ll,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new X,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new X),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const i of t.hand.values())this._getHandJoint(e,i)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,i){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,u=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(u&&t.hand){a=!0;for(const M of t.hand.values()){const _=e.getJointPose(M,i),v=this._getHandJoint(u,M);_!==null&&(v.matrix.fromArray(_.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=_.radius),v.visible=_!==null}const h=u.joints["index-finger-tip"],p=u.joints["thumb-tip"],m=h.position.distanceTo(p.position),g=.02,w=.005;u.inputState.pinching&&m>g+w?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!u.inputState.pinching&&m<=g-w&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,i),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(r=e.getPose(t.targetRaySpace,i),r===null&&s!==null&&(r=s),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(NT)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),u!==null&&(u.visible=a!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){const i=new ll;i.matrixAutoUpdate=!1,i.visible=!1,t.joints[e.jointName]=i,t.add(i)}return t.joints[e.jointName]}}class IT extends Un{constructor(t,e,i,r,s,a,o,l,u,h){if(h=h!==void 0?h:rs,h!==rs&&h!==ro)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&h===rs&&(i=yr),i===void 0&&h===ro&&(i=is),super(null,r,s,a,o,l,h,i,u),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=o!==void 0?o:En,this.minFilter=l!==void 0?l:En,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}}class UT extends Pr{constructor(t,e){super();const i=this;let r=null,s=1,a=null,o="local-floor",l=1,u=null,h=null,p=null,m=null,g=null,w=null;const M=e.getContextAttributes();let _=null,v=null;const T=[],b=[],P=new ti;P.layers.enable(1),P.viewport=new cn;const I=new ti;I.layers.enable(2),I.viewport=new cn;const H=[P,I],B=new DT;B.layers.enable(1),B.layers.enable(2);let K=null,C=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(st){let mt=T[st];return mt===void 0&&(mt=new Ru,T[st]=mt),mt.getTargetRaySpace()},this.getControllerGrip=function(st){let mt=T[st];return mt===void 0&&(mt=new Ru,T[st]=mt),mt.getGripSpace()},this.getHand=function(st){let mt=T[st];return mt===void 0&&(mt=new Ru,T[st]=mt),mt.getHandSpace()};function O(st){const mt=b.indexOf(st.inputSource);if(mt===-1)return;const It=T[mt];It!==void 0&&(It.update(st.inputSource,st.frame,u||a),It.dispatchEvent({type:st.type,data:st.inputSource}))}function W(){r.removeEventListener("select",O),r.removeEventListener("selectstart",O),r.removeEventListener("selectend",O),r.removeEventListener("squeeze",O),r.removeEventListener("squeezestart",O),r.removeEventListener("squeezeend",O),r.removeEventListener("end",W),r.removeEventListener("inputsourceschange",ct);for(let st=0;st=0&&(b[Ot]=null,T[Ot].disconnect(It))}for(let mt=0;mt=b.length){b.push(It),Ot=Jt;break}else if(b[Jt]===null){b[Jt]=It,Ot=Jt;break}if(Ot===-1)break}const Gt=T[Ot];Gt&&Gt.connect(It)}}const Y=new X,Q=new X;function nt(st,mt,It){Y.setFromMatrixPosition(mt.matrixWorld),Q.setFromMatrixPosition(It.matrixWorld);const Ot=Y.distanceTo(Q),Gt=mt.projectionMatrix.elements,Jt=It.projectionMatrix.elements,se=Gt[14]/(Gt[10]-1),Kt=Gt[14]/(Gt[10]+1),pe=(Gt[9]+1)/Gt[5],Pe=(Gt[9]-1)/Gt[5],he=(Gt[8]-1)/Gt[0],tt=(Jt[8]+1)/Jt[0],Oe=se*he,Zt=se*tt,oe=Ot/(-he+tt),ie=oe*-he;mt.matrixWorld.decompose(st.position,st.quaternion,st.scale),st.translateX(ie),st.translateZ(oe),st.matrixWorld.compose(st.position,st.quaternion,st.scale),st.matrixWorldInverse.copy(st.matrixWorld).invert();const Te=se+oe,fe=Kt+oe,Pt=Oe-ie,Qt=Zt+(Ot-ie),we=pe*Kt/fe*Te,Me=Pe*Kt/fe*Te;st.projectionMatrix.makePerspective(Pt,Qt,we,Me,Te,fe),st.projectionMatrixInverse.copy(st.projectionMatrix).invert()}function _t(st,mt){mt===null?st.matrixWorld.copy(st.matrix):st.matrixWorld.multiplyMatrices(mt.matrixWorld,st.matrix),st.matrixWorldInverse.copy(st.matrixWorld).invert()}this.updateCamera=function(st){if(r===null)return;B.near=I.near=P.near=st.near,B.far=I.far=P.far=st.far,(K!==B.near||C!==B.far)&&(r.updateRenderState({depthNear:B.near,depthFar:B.far}),K=B.near,C=B.far);const mt=st.parent,It=B.cameras;_t(B,mt);for(let Ot=0;Ot0&&(_.alphaTest.value=v.alphaTest);const T=t.get(v).envMap;if(T&&(_.envMap.value=T,_.flipEnvMap.value=T.isCubeTexture&&T.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=v.reflectivity,_.ior.value=v.ior,_.refractionRatio.value=v.refractionRatio),v.lightMap){_.lightMap.value=v.lightMap;const b=n._useLegacyLights===!0?Math.PI:1;_.lightMapIntensity.value=v.lightMapIntensity*b,e(v.lightMap,_.lightMapTransform)}v.aoMap&&(_.aoMap.value=v.aoMap,_.aoMapIntensity.value=v.aoMapIntensity,e(v.aoMap,_.aoMapTransform))}function a(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,v.map&&(_.map.value=v.map,e(v.map,_.mapTransform))}function o(_,v){_.dashSize.value=v.dashSize,_.totalSize.value=v.dashSize+v.gapSize,_.scale.value=v.scale}function l(_,v,T,b){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.size.value=v.size*T,_.scale.value=b*.5,v.map&&(_.map.value=v.map,e(v.map,_.uvTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,e(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function u(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.rotation.value=v.rotation,v.map&&(_.map.value=v.map,e(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,e(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function h(_,v){_.specular.value.copy(v.specular),_.shininess.value=Math.max(v.shininess,1e-4)}function p(_,v){v.gradientMap&&(_.gradientMap.value=v.gradientMap)}function m(_,v){_.metalness.value=v.metalness,v.metalnessMap&&(_.metalnessMap.value=v.metalnessMap,e(v.metalnessMap,_.metalnessMapTransform)),_.roughness.value=v.roughness,v.roughnessMap&&(_.roughnessMap.value=v.roughnessMap,e(v.roughnessMap,_.roughnessMapTransform)),t.get(v).envMap&&(_.envMapIntensity.value=v.envMapIntensity)}function g(_,v,T){_.ior.value=v.ior,v.sheen>0&&(_.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),_.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(_.sheenColorMap.value=v.sheenColorMap,e(v.sheenColorMap,_.sheenColorMapTransform)),v.sheenRoughnessMap&&(_.sheenRoughnessMap.value=v.sheenRoughnessMap,e(v.sheenRoughnessMap,_.sheenRoughnessMapTransform))),v.clearcoat>0&&(_.clearcoat.value=v.clearcoat,_.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(_.clearcoatMap.value=v.clearcoatMap,e(v.clearcoatMap,_.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,e(v.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(_.clearcoatNormalMap.value=v.clearcoatNormalMap,e(v.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===In&&_.clearcoatNormalScale.value.negate())),v.iridescence>0&&(_.iridescence.value=v.iridescence,_.iridescenceIOR.value=v.iridescenceIOR,_.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(_.iridescenceMap.value=v.iridescenceMap,e(v.iridescenceMap,_.iridescenceMapTransform)),v.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=v.iridescenceThicknessMap,e(v.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),v.transmission>0&&(_.transmission.value=v.transmission,_.transmissionSamplerMap.value=T.texture,_.transmissionSamplerSize.value.set(T.width,T.height),v.transmissionMap&&(_.transmissionMap.value=v.transmissionMap,e(v.transmissionMap,_.transmissionMapTransform)),_.thickness.value=v.thickness,v.thicknessMap&&(_.thicknessMap.value=v.thicknessMap,e(v.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=v.attenuationDistance,_.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(_.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(_.anisotropyMap.value=v.anisotropyMap,e(v.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=v.specularIntensity,_.specularColor.value.copy(v.specularColor),v.specularColorMap&&(_.specularColorMap.value=v.specularColorMap,e(v.specularColorMap,_.specularColorMapTransform)),v.specularIntensityMap&&(_.specularIntensityMap.value=v.specularIntensityMap,e(v.specularIntensityMap,_.specularIntensityMapTransform))}function w(_,v){v.matcap&&(_.matcap.value=v.matcap)}function M(_,v){const T=t.get(v).light;_.referencePosition.value.setFromMatrixPosition(T.matrixWorld),_.nearDistance.value=T.shadow.camera.near,_.farDistance.value=T.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:r}}function FT(n,t,e,i){let r={},s={},a=[];const o=e.isWebGL2?n.getParameter(n.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(T,b){const P=b.program;i.uniformBlockBinding(T,P)}function u(T,b){let P=r[T.id];P===void 0&&(w(T),P=h(T),r[T.id]=P,T.addEventListener("dispose",_));const I=b.program;i.updateUBOMapping(T,I);const H=t.render.frame;s[T.id]!==H&&(m(T),s[T.id]=H)}function h(T){const b=p();T.__bindingPointIndex=b;const P=n.createBuffer(),I=T.__size,H=T.usage;return n.bindBuffer(n.UNIFORM_BUFFER,P),n.bufferData(n.UNIFORM_BUFFER,I,H),n.bindBuffer(n.UNIFORM_BUFFER,null),n.bindBufferBase(n.UNIFORM_BUFFER,b,P),P}function p(){for(let T=0;T0){H=P%I;const ct=I-H;H!==0&&ct-O.boundary<0&&(P+=I-H,C.__offset=P)}P+=O.storage}return H=P%I,H>0&&(P+=I-H),T.__size=P,T.__cache={},this}function M(T){const b={boundary:0,storage:0};return typeof T=="number"?(b.boundary=4,b.storage=4):T.isVector2?(b.boundary=8,b.storage=8):T.isVector3||T.isColor?(b.boundary=16,b.storage=12):T.isVector4?(b.boundary=16,b.storage=16):T.isMatrix3?(b.boundary=48,b.storage=48):T.isMatrix4?(b.boundary=64,b.storage=64):T.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",T),b}function _(T){const b=T.target;b.removeEventListener("dispose",_);const P=a.indexOf(b.__bindingPointIndex);a.splice(P,1),n.deleteBuffer(r[b.id]),delete r[b.id],delete s[b.id]}function v(){for(const T in r)n.deleteBuffer(r[T]);a=[],r={},s={}}return{bind:l,update:u,dispose:v}}class xm{constructor(t={}){const{canvas:e=PM(),context:i=null,depth:r=!0,stencil:s=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:p=!1}=t;this.isWebGLRenderer=!0;let m;i!==null?m=i.getContextAttributes().alpha:m=a;const g=new Uint32Array(4),w=new Int32Array(4);let M=null,_=null;const v=[],T=[];this.domElement=e,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.outputColorSpace=Ve,this._useLegacyLights=!1,this.toneMapping=br,this.toneMappingExposure=1;const b=this;let P=!1,I=0,H=0,B=null,K=-1,C=null;const O=new cn,W=new cn;let ct=null;const Y=new Ee(0);let Q=0,nt=e.width,_t=e.height,ht=1,gt=null,wt=null;const St=new cn(0,0,nt,_t),st=new cn(0,0,nt,_t);let mt=!1;const It=new Ch;let Ot=!1,Gt=!1,Jt=null;const se=new qe,Kt=new Yt,pe=new X,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function he(){return B===null?ht:1}let tt=i;function Oe(F,et){for(let ft=0;ft0?_=T[T.length-1]:_=null,v.pop(),v.length>0?M=v[v.length-1]:M=null};function tr(F,et,ft,it){if(F.visible===!1)return;if(F.layers.test(et.layers)){if(F.isGroup)ft=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(et);else if(F.isLight)_.pushLight(F),F.castShadow&&_.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||It.intersectsSprite(F)){it&&pe.setFromMatrixPosition(F.matrixWorld).applyMatrix4(se);const ee=R.update(F),ae=F.material;ae.visible&&M.push(F,ee,ae,ft,pe.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||It.intersectsObject(F))){const ee=R.update(F),ae=F.material;if(it&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),pe.copy(F.boundingSphere.center)):(ee.boundingSphere===null&&ee.computeBoundingSphere(),pe.copy(ee.boundingSphere.center)),pe.applyMatrix4(F.matrixWorld).applyMatrix4(se)),Array.isArray(ae)){const le=ee.groups;for(let ge=0,re=le.length;ge0&&po(dt,Xt,et,ft),it&&ie.viewport(O.copy(it)),dt.length>0&&er(dt,et,ft),Xt.length>0&&er(Xt,et,ft),ee.length>0&&er(ee,et,ft),ie.buffers.depth.setTest(!0),ie.buffers.depth.setMask(!0),ie.buffers.color.setMask(!0),ie.setPolygonOffset(!1)}function po(F,et,ft,it){const dt=oe.isWebGL2;Jt===null&&(Jt=new ls(1,1,{generateMipmaps:!0,type:Zt.has("EXT_color_buffer_half_float")?aa:Er,minFilter:oa,samples:dt?4:0})),b.getDrawingBufferSize(Kt),dt?Jt.setSize(Kt.x,Kt.y):Jt.setSize(Tl(Kt.x),Tl(Kt.y));const Xt=b.getRenderTarget();b.setRenderTarget(Jt),b.getClearColor(Y),Q=b.getClearAlpha(),Q<1&&b.setClearColor(16777215,.5),b.clear();const ee=b.toneMapping;b.toneMapping=br,er(F,ft,it),Pt.updateMultisampleRenderTarget(Jt),Pt.updateRenderTargetMipmap(Jt);let ae=!1;for(let le=0,ge=et.length;le0),$t=!!ft.morphAttributes.position,Ie=!!ft.morphAttributes.normal,Fe=!!ft.morphAttributes.color;let $e=br;it.toneMapped&&(B===null||B.isXRRenderTarget===!0)&&($e=b.toneMapping);const mn=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color,Ge=mn!==void 0?mn.length:0,de=fe.get(it),wn=_.state.lights;if(Ot===!0&&(Gt===!0||F!==C)){const je=F===C&&it.id===K;kt.setState(it,F,je)}let ke=!1;it.version===de.__version?(de.needsLights&&de.lightsStateVersion!==wn.state.version||de.outputColorSpace!==ae||dt.isInstancedMesh&&de.instancing===!1||!dt.isInstancedMesh&&de.instancing===!0||dt.isSkinnedMesh&&de.skinning===!1||!dt.isSkinnedMesh&&de.skinning===!0||dt.isInstancedMesh&&de.instancingColor===!0&&dt.instanceColor===null||dt.isInstancedMesh&&de.instancingColor===!1&&dt.instanceColor!==null||de.envMap!==le||it.fog===!0&&de.fog!==Xt||de.numClippingPlanes!==void 0&&(de.numClippingPlanes!==kt.numPlanes||de.numIntersection!==kt.numIntersection)||de.vertexAlphas!==ge||de.vertexTangents!==re||de.morphTargets!==$t||de.morphNormals!==Ie||de.morphColors!==Fe||de.toneMapping!==$e||oe.isWebGL2===!0&&de.morphTargetsCount!==Ge)&&(ke=!0):(ke=!0,de.__version=it.version);let ei=de.currentProgram;ke===!0&&(ei=nr(it,et,dt));let Lr=!1,Xn=!1,Rn=!1;const We=ei.getUniforms(),gn=de.uniforms;if(ie.useProgram(ei.program)&&(Lr=!0,Xn=!0,Rn=!0),it.id!==K&&(K=it.id,Xn=!0),Lr||C!==F){We.setValue(tt,"projectionMatrix",F.projectionMatrix),We.setValue(tt,"viewMatrix",F.matrixWorldInverse);const je=We.map.cameraPosition;je!==void 0&&je.setValue(tt,pe.setFromMatrixPosition(F.matrixWorld)),oe.logarithmicDepthBuffer&&We.setValue(tt,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(it.isMeshPhongMaterial||it.isMeshToonMaterial||it.isMeshLambertMaterial||it.isMeshBasicMaterial||it.isMeshStandardMaterial||it.isShaderMaterial)&&We.setValue(tt,"isOrthographic",F.isOrthographicCamera===!0),C!==F&&(C=F,Xn=!0,Rn=!0)}if(dt.isSkinnedMesh){We.setOptional(tt,dt,"bindMatrix"),We.setOptional(tt,dt,"bindMatrixInverse");const je=dt.skeleton;je&&(oe.floatVertexTextures?(je.boneTexture===null&&je.computeBoneTexture(),We.setValue(tt,"boneTexture",je.boneTexture,Pt),We.setValue(tt,"boneTextureSize",je.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const ir=ft.morphAttributes;if((ir.position!==void 0||ir.normal!==void 0||ir.color!==void 0&&oe.isWebGL2===!0)&&k.update(dt,ft,ei),(Xn||de.receiveShadow!==dt.receiveShadow)&&(de.receiveShadow=dt.receiveShadow,We.setValue(tt,"receiveShadow",dt.receiveShadow)),it.isMeshGouraudMaterial&&it.envMap!==null&&(gn.envMap.value=le,gn.flipEnvMap.value=le.isCubeTexture&&le.isRenderTargetTexture===!1?-1:1),Xn&&(We.setValue(tt,"toneMappingExposure",b.toneMappingExposure),de.needsLights&&go(gn,Rn),Xt&&it.fog===!0&&At.refreshFogUniforms(gn,Xt),At.refreshMaterialUniforms(gn,it,ht,_t,Jt),gl.upload(tt,de.uniformsList,gn,Pt)),it.isShaderMaterial&&it.uniformsNeedUpdate===!0&&(gl.upload(tt,de.uniformsList,gn,Pt),it.uniformsNeedUpdate=!1),it.isSpriteMaterial&&We.setValue(tt,"center",dt.center),We.setValue(tt,"modelViewMatrix",dt.modelViewMatrix),We.setValue(tt,"normalMatrix",dt.normalMatrix),We.setValue(tt,"modelMatrix",dt.matrixWorld),it.isShaderMaterial||it.isRawShaderMaterial){const je=it.uniformsGroups;for(let $n=0,Pi=je.length;$n0&&Pt.useMultisampledRTT(F)===!1?dt=fe.get(F).__webglMultisampledFramebuffer:Array.isArray(re)?dt=re[ft]:dt=re,O.copy(F.viewport),W.copy(F.scissor),ct=F.scissorTest}else O.copy(St).multiplyScalar(ht).floor(),W.copy(st).multiplyScalar(ht).floor(),ct=mt;if(ie.bindFramebuffer(tt.FRAMEBUFFER,dt)&&oe.drawBuffers&&it&&ie.drawBuffers(F,dt),ie.viewport(O),ie.scissor(W),ie.setScissorTest(ct),Xt){const le=fe.get(F.texture);tt.framebufferTexture2D(tt.FRAMEBUFFER,tt.COLOR_ATTACHMENT0,tt.TEXTURE_CUBE_MAP_POSITIVE_X+et,le.__webglTexture,ft)}else if(ee){const le=fe.get(F.texture),ge=et||0;tt.framebufferTextureLayer(tt.FRAMEBUFFER,tt.COLOR_ATTACHMENT0,le.__webglTexture,ft||0,ge)}K=-1},this.readRenderTargetPixels=function(F,et,ft,it,dt,Xt,ee){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ae=fe.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&ee!==void 0&&(ae=ae[ee]),ae){ie.bindFramebuffer(tt.FRAMEBUFFER,ae);try{const le=F.texture,ge=le.format,re=le.type;if(ge!==mi&&Nt.convert(ge)!==tt.getParameter(tt.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const $t=re===aa&&(Zt.has("EXT_color_buffer_half_float")||oe.isWebGL2&&Zt.has("EXT_color_buffer_float"));if(re!==Er&&Nt.convert(re)!==tt.getParameter(tt.IMPLEMENTATION_COLOR_READ_TYPE)&&!(re===xr&&(oe.isWebGL2||Zt.has("OES_texture_float")||Zt.has("WEBGL_color_buffer_float")))&&!$t){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}et>=0&&et<=F.width-it&&ft>=0&&ft<=F.height-dt&&tt.readPixels(et,ft,it,dt,Nt.convert(ge),Nt.convert(re),Xt)}finally{const le=B!==null?fe.get(B).__webglFramebuffer:null;ie.bindFramebuffer(tt.FRAMEBUFFER,le)}}},this.copyFramebufferToTexture=function(F,et,ft=0){const it=Math.pow(2,-ft),dt=Math.floor(et.image.width*it),Xt=Math.floor(et.image.height*it);Pt.setTexture2D(et,0),tt.copyTexSubImage2D(tt.TEXTURE_2D,ft,0,0,F.x,F.y,dt,Xt),ie.unbindTexture()},this.copyTextureToTexture=function(F,et,ft,it=0){const dt=et.image.width,Xt=et.image.height,ee=Nt.convert(ft.format),ae=Nt.convert(ft.type);Pt.setTexture2D(ft,0),tt.pixelStorei(tt.UNPACK_FLIP_Y_WEBGL,ft.flipY),tt.pixelStorei(tt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ft.premultiplyAlpha),tt.pixelStorei(tt.UNPACK_ALIGNMENT,ft.unpackAlignment),et.isDataTexture?tt.texSubImage2D(tt.TEXTURE_2D,it,F.x,F.y,dt,Xt,ee,ae,et.image.data):et.isCompressedTexture?tt.compressedTexSubImage2D(tt.TEXTURE_2D,it,F.x,F.y,et.mipmaps[0].width,et.mipmaps[0].height,ee,et.mipmaps[0].data):tt.texSubImage2D(tt.TEXTURE_2D,it,F.x,F.y,ee,ae,et.image),it===0&&ft.generateMipmaps&&tt.generateMipmap(tt.TEXTURE_2D),ie.unbindTexture()},this.copyTextureToTexture3D=function(F,et,ft,it,dt=0){if(b.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Xt=F.max.x-F.min.x+1,ee=F.max.y-F.min.y+1,ae=F.max.z-F.min.z+1,le=Nt.convert(it.format),ge=Nt.convert(it.type);let re;if(it.isData3DTexture)Pt.setTexture3D(it,0),re=tt.TEXTURE_3D;else if(it.isDataArrayTexture)Pt.setTexture2DArray(it,0),re=tt.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}tt.pixelStorei(tt.UNPACK_FLIP_Y_WEBGL,it.flipY),tt.pixelStorei(tt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,it.premultiplyAlpha),tt.pixelStorei(tt.UNPACK_ALIGNMENT,it.unpackAlignment);const $t=tt.getParameter(tt.UNPACK_ROW_LENGTH),Ie=tt.getParameter(tt.UNPACK_IMAGE_HEIGHT),Fe=tt.getParameter(tt.UNPACK_SKIP_PIXELS),$e=tt.getParameter(tt.UNPACK_SKIP_ROWS),mn=tt.getParameter(tt.UNPACK_SKIP_IMAGES),Ge=ft.isCompressedTexture?ft.mipmaps[0]:ft.image;tt.pixelStorei(tt.UNPACK_ROW_LENGTH,Ge.width),tt.pixelStorei(tt.UNPACK_IMAGE_HEIGHT,Ge.height),tt.pixelStorei(tt.UNPACK_SKIP_PIXELS,F.min.x),tt.pixelStorei(tt.UNPACK_SKIP_ROWS,F.min.y),tt.pixelStorei(tt.UNPACK_SKIP_IMAGES,F.min.z),ft.isDataTexture||ft.isData3DTexture?tt.texSubImage3D(re,dt,et.x,et.y,et.z,Xt,ee,ae,le,ge,Ge.data):ft.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),tt.compressedTexSubImage3D(re,dt,et.x,et.y,et.z,Xt,ee,ae,le,Ge.data)):tt.texSubImage3D(re,dt,et.x,et.y,et.z,Xt,ee,ae,le,ge,Ge),tt.pixelStorei(tt.UNPACK_ROW_LENGTH,$t),tt.pixelStorei(tt.UNPACK_IMAGE_HEIGHT,Ie),tt.pixelStorei(tt.UNPACK_SKIP_PIXELS,Fe),tt.pixelStorei(tt.UNPACK_SKIP_ROWS,$e),tt.pixelStorei(tt.UNPACK_SKIP_IMAGES,mn),dt===0&&it.generateMipmaps&&tt.generateMipmap(re),ie.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?Pt.setTextureCube(F,0):F.isData3DTexture?Pt.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?Pt.setTexture2DArray(F,0):Pt.setTexture2D(F,0),ie.unbindTexture()},this.resetState=function(){I=0,H=0,B=null,ie.reset(),Ft.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Yi}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(t){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!t}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Ve?ss:nm}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===ss?Ve:Ti}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class BT extends xm{}BT.prototype.isWebGL1Renderer=!0;class zT extends un{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e}}class wm extends uo{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ee(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const Kd=new X,Zd=new X,Jd=new qe,Pu=new kl,cl=new Gl;class Mm extends un{constructor(t=new Wn,e=new wm){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.index===null){const e=t.attributes.position,i=[0];for(let r=1,s=e.count;rl)continue;m.applyMatrix4(this.matrixWorld);const K=t.ray.origin.distanceTo(m);Kt.far||e.push({distance:K,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,a.start),T=Math.min(_.count,a.start+a.count);for(let b=v,P=T-1;bl)continue;m.applyMatrix4(this.matrixWorld);const H=t.ray.origin.distanceTo(m);Ht.far||e.push({distance:H,point:p.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,i=Object.keys(e);if(i.length>0){const r=e[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s0)l=r-1;else{l=r;break}if(r=l,i[r]===a)return r/(s-1);const h=i[r],m=i[r+1]-h,g=(a-h)/m;return(r+g)/(s-1)}getTangent(t,e){let r=t-1e-4,s=t+1e-4;r<0&&(r=0),s>1&&(s=1);const a=this.getPoint(r),o=this.getPoint(s),l=e||(a.isVector2?new Yt:new X);return l.copy(o).sub(a).normalize(),l}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new X,r=[],s=[],a=[],o=new X,l=new qe;for(let g=0;g<=t;g++){const w=g/t;r[g]=this.getTangentAt(w,new X)}s[0]=new X,a[0]=new X;let u=Number.MAX_VALUE;const h=Math.abs(r[0].x),p=Math.abs(r[0].y),m=Math.abs(r[0].z);h<=u&&(u=h,i.set(1,0,0)),p<=u&&(u=p,i.set(0,1,0)),m<=u&&i.set(0,0,1),o.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],o),a[0].crossVectors(r[0],s[0]);for(let g=1;g<=t;g++){if(s[g]=s[g-1].clone(),a[g]=a[g-1].clone(),o.crossVectors(r[g-1],r[g]),o.length()>Number.EPSILON){o.normalize();const w=Math.acos(ln(r[g-1].dot(r[g]),-1,1));s[g].applyMatrix4(l.makeRotationAxis(o,w))}a[g].crossVectors(r[g],s[g])}if(e===!0){let g=Math.acos(ln(s[0].dot(s[t]),-1,1));g/=t,r[0].dot(o.crossVectors(s[0],s[t]))>0&&(g=-g);for(let w=1;w<=t;w++)s[w].applyMatrix4(l.makeRotationAxis(r[w],g*w)),a[w].crossVectors(r[w],s[w])}return{tangents:r,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Sm extends Qi{constructor(t=0,e=0,i=1,r=1,s=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(t,e){const i=e||new Yt,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)r;)s-=r;s0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let u,h;this.closed||o>0?u=r[(o-1)%s]:(ul.subVectors(r[0],r[1]).add(r[0]),u=ul);const p=r[o%s],m=r[(o+1)%s];if(this.closed||o+2r.length-2?r.length-1:a+1],p=r[a>r.length-3?r.length-1:a+2];return i.set(Qd(o,l.x,u.x,h.x,p.x),Qd(o,l.y,u.y,h.y,p.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e0&&b(!0),e>0&&b(!1)),this.setIndex(h),this.setAttribute("position",new dn(p,3)),this.setAttribute("normal",new dn(m,3)),this.setAttribute("uv",new dn(g,2));function T(){const P=new X,I=new X;let H=0;const B=(e-t)/i;for(let K=0;K<=s;K++){const C=[],O=K/s,W=O*(e-t)+t;for(let ct=0;ct<=r;ct++){const Y=ct/r,Q=Y*l+o,nt=Math.sin(Q),_t=Math.cos(Q);I.x=W*nt,I.y=-O*i+_,I.z=W*_t,p.push(I.x,I.y,I.z),P.set(nt,B,_t).normalize(),m.push(P.x,P.y,P.z),g.push(Y,1-O),C.push(w++)}M.push(C)}for(let K=0;K0){const T=a[0].object;Ys.setFromNormalAndCoplanarPoint(e.getWorldDirection(Ys.normal),Uu.setFromMatrixPosition(T.matrixWorld)),s!==T&&s!==null&&(o.dispatchEvent({type:"hoveroff",object:s}),i.style.cursor="auto",s=null),s!==T&&(o.dispatchEvent({type:"hoveron",object:T}),i.style.cursor="pointer",s=T)}else s!==null&&(o.dispatchEvent({type:"hoveroff",object:s}),i.style.cursor="auto",s=null)}}function w(v){o.enabled!==!1&&(_(v),a.length=0,mr.setFromCamera(jo,e),mr.intersectObjects(t,!0,a),a.length>0&&(r=o.transformGroup===!0?t[0]:a[0].object,Ys.setFromNormalAndCoplanarPoint(e.getWorldDirection(Ys.normal),Uu.setFromMatrixPosition(r.matrixWorld)),mr.ray.intersectPlane(Ys,hl)&&(sp.copy(r.parent.matrixWorld).invert(),rp.copy(hl).sub(Uu.setFromMatrixPosition(r.matrixWorld))),i.style.cursor="move",o.dispatchEvent({type:"dragstart",object:r})))}function M(){o.enabled!==!1&&(r&&(o.dispatchEvent({type:"dragend",object:r}),r=null),i.style.cursor=s?"pointer":"auto")}function _(v){const T=i.getBoundingClientRect();jo.x=(v.clientX-T.left)/T.width*2-1,jo.y=-(v.clientY-T.top)/T.height*2+1}l(),this.enabled=!0,this.transformGroup=!1,this.activate=l,this.deactivate=u,this.dispose=h,this.getObjects=p,this.getRaycaster=m}}const op={type:"change"},Ou={type:"start"},ap={type:"end"},fl=new kl,lp=new ji,a1=Math.cos(70*RM.DEG2RAD);class l1 extends Pr{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new X,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:qi.ROTATE,MIDDLE:qi.DOLLY,RIGHT:qi.PAN},this.touches={ONE:gr.ROTATE,TWO:gr.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(k){k.addEventListener("keydown",R),this._domElementKeyEvents=k},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",R),this._domElementKeyEvents=null},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(op),i.update(),s=r.NONE},this.update=function(){const k=new X,xt=new cs().setFromUnitVectors(t.up,new X(0,1,0)),Bt=xt.clone().invert(),Nt=new X,Ft=new cs,ce=new X,ve=2*Math.PI;return function(Ut=null){const lt=i.object.position;k.copy(lt).sub(i.target),k.applyQuaternion(xt),o.setFromVector3(k),i.autoRotate&&s===r.NONE&&W(C(Ut)),i.enableDamping?(o.theta+=l.theta*i.dampingFactor,o.phi+=l.phi*i.dampingFactor):(o.theta+=l.theta,o.phi+=l.phi);let Et=i.minAzimuthAngle,Lt=i.maxAzimuthAngle;isFinite(Et)&&isFinite(Lt)&&(Et<-Math.PI?Et+=ve:Et>Math.PI&&(Et-=ve),Lt<-Math.PI?Lt+=ve:Lt>Math.PI&&(Lt-=ve),Et<=Lt?o.theta=Math.max(Et,Math.min(Lt,o.theta)):o.theta=o.theta>(Et+Lt)/2?Math.max(Et,o.theta):Math.min(Lt,o.theta)),o.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,o.phi)),o.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(h,i.dampingFactor):i.target.add(h),i.zoomToCursor&&H||i.object.isOrthographicCamera?o.radius=wt(o.radius):o.radius=wt(o.radius*u),k.setFromSpherical(o),k.applyQuaternion(Bt),lt.copy(i.target).add(k),i.object.lookAt(i.target),i.enableDamping===!0?(l.theta*=1-i.dampingFactor,l.phi*=1-i.dampingFactor,h.multiplyScalar(1-i.dampingFactor)):(l.set(0,0,0),h.set(0,0,0));let me=!1;if(i.zoomToCursor&&H){let Ae=null;if(i.object.isPerspectiveCamera){const Le=k.length();Ae=wt(Le*u);const hn=Le-Ae;i.object.position.addScaledVector(P,hn),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const Le=new X(I.x,I.y,0);Le.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/u)),i.object.updateProjectionMatrix(),me=!0;const hn=new X(I.x,I.y,0);hn.unproject(i.object),i.object.position.sub(hn).add(Le),i.object.updateMatrixWorld(),Ae=k.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Ae!==null&&(this.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Ae).add(i.object.position):(fl.origin.copy(i.object.position),fl.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(fl.direction))a||8*(1-Ft.dot(i.object.quaternion))>a||ce.distanceToSquared(i.target)>0?(i.dispatchEvent(op),Nt.copy(i.object.position),Ft.copy(i.object.quaternion),ce.copy(i.target),me=!1,!0):!1}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",bt),i.domElement.removeEventListener("pointerdown",fe),i.domElement.removeEventListener("pointercancel",Qt),i.domElement.removeEventListener("wheel",N),i.domElement.removeEventListener("pointermove",Pt),i.domElement.removeEventListener("pointerup",Qt),i._domElementKeyEvents!==null&&(i._domElementKeyEvents.removeEventListener("keydown",R),i._domElementKeyEvents=null)};const i=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=r.NONE;const a=1e-6,o=new ip,l=new ip;let u=1;const h=new X,p=new Yt,m=new Yt,g=new Yt,w=new Yt,M=new Yt,_=new Yt,v=new Yt,T=new Yt,b=new Yt,P=new X,I=new Yt;let H=!1;const B=[],K={};function C(k){return k!==null?2*Math.PI/60*i.autoRotateSpeed*k:2*Math.PI/60/60*i.autoRotateSpeed}function O(){return Math.pow(.95,i.zoomSpeed)}function W(k){l.theta-=k}function ct(k){l.phi-=k}const Y=function(){const k=new X;return function(Bt,Nt){k.setFromMatrixColumn(Nt,0),k.multiplyScalar(-Bt),h.add(k)}}(),Q=function(){const k=new X;return function(Bt,Nt){i.screenSpacePanning===!0?k.setFromMatrixColumn(Nt,1):(k.setFromMatrixColumn(Nt,0),k.crossVectors(i.object.up,k)),k.multiplyScalar(Bt),h.add(k)}}(),nt=function(){const k=new X;return function(Bt,Nt){const Ft=i.domElement;if(i.object.isPerspectiveCamera){const ce=i.object.position;k.copy(ce).sub(i.target);let ve=k.length();ve*=Math.tan(i.object.fov/2*Math.PI/180),Y(2*Bt*ve/Ft.clientHeight,i.object.matrix),Q(2*Nt*ve/Ft.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(Y(Bt*(i.object.right-i.object.left)/i.object.zoom/Ft.clientWidth,i.object.matrix),Q(Nt*(i.object.top-i.object.bottom)/i.object.zoom/Ft.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function _t(k){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?u/=k:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ht(k){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?u*=k:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function gt(k){if(!i.zoomToCursor)return;H=!0;const xt=i.domElement.getBoundingClientRect(),Bt=k.clientX-xt.left,Nt=k.clientY-xt.top,Ft=xt.width,ce=xt.height;I.x=Bt/Ft*2-1,I.y=-(Nt/ce)*2+1,P.set(I.x,I.y,1).unproject(i.object).sub(i.object.position).normalize()}function wt(k){return Math.max(i.minDistance,Math.min(i.maxDistance,k))}function St(k){p.set(k.clientX,k.clientY)}function st(k){gt(k),v.set(k.clientX,k.clientY)}function mt(k){w.set(k.clientX,k.clientY)}function It(k){m.set(k.clientX,k.clientY),g.subVectors(m,p).multiplyScalar(i.rotateSpeed);const xt=i.domElement;W(2*Math.PI*g.x/xt.clientHeight),ct(2*Math.PI*g.y/xt.clientHeight),p.copy(m),i.update()}function Ot(k){T.set(k.clientX,k.clientY),b.subVectors(T,v),b.y>0?_t(O()):b.y<0&&ht(O()),v.copy(T),i.update()}function Gt(k){M.set(k.clientX,k.clientY),_.subVectors(M,w).multiplyScalar(i.panSpeed),nt(_.x,_.y),w.copy(M),i.update()}function Jt(k){gt(k),k.deltaY<0?ht(O()):k.deltaY>0&&_t(O()),i.update()}function se(k){let xt=!1;switch(k.code){case i.keys.UP:k.ctrlKey||k.metaKey||k.shiftKey?ct(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):nt(0,i.keyPanSpeed),xt=!0;break;case i.keys.BOTTOM:k.ctrlKey||k.metaKey||k.shiftKey?ct(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):nt(0,-i.keyPanSpeed),xt=!0;break;case i.keys.LEFT:k.ctrlKey||k.metaKey||k.shiftKey?W(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):nt(i.keyPanSpeed,0),xt=!0;break;case i.keys.RIGHT:k.ctrlKey||k.metaKey||k.shiftKey?W(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):nt(-i.keyPanSpeed,0),xt=!0;break}xt&&(k.preventDefault(),i.update())}function Kt(){if(B.length===1)p.set(B[0].pageX,B[0].pageY);else{const k=.5*(B[0].pageX+B[1].pageX),xt=.5*(B[0].pageY+B[1].pageY);p.set(k,xt)}}function pe(){if(B.length===1)w.set(B[0].pageX,B[0].pageY);else{const k=.5*(B[0].pageX+B[1].pageX),xt=.5*(B[0].pageY+B[1].pageY);w.set(k,xt)}}function Pe(){const k=B[0].pageX-B[1].pageX,xt=B[0].pageY-B[1].pageY,Bt=Math.sqrt(k*k+xt*xt);v.set(0,Bt)}function he(){i.enableZoom&&Pe(),i.enablePan&&pe()}function tt(){i.enableZoom&&Pe(),i.enableRotate&&Kt()}function Oe(k){if(B.length==1)m.set(k.pageX,k.pageY);else{const Bt=at(k),Nt=.5*(k.pageX+Bt.x),Ft=.5*(k.pageY+Bt.y);m.set(Nt,Ft)}g.subVectors(m,p).multiplyScalar(i.rotateSpeed);const xt=i.domElement;W(2*Math.PI*g.x/xt.clientHeight),ct(2*Math.PI*g.y/xt.clientHeight),p.copy(m)}function Zt(k){if(B.length===1)M.set(k.pageX,k.pageY);else{const xt=at(k),Bt=.5*(k.pageX+xt.x),Nt=.5*(k.pageY+xt.y);M.set(Bt,Nt)}_.subVectors(M,w).multiplyScalar(i.panSpeed),nt(_.x,_.y),w.copy(M)}function oe(k){const xt=at(k),Bt=k.pageX-xt.x,Nt=k.pageY-xt.y,Ft=Math.sqrt(Bt*Bt+Nt*Nt);T.set(0,Ft),b.set(0,Math.pow(T.y/v.y,i.zoomSpeed)),_t(b.y),v.copy(T)}function ie(k){i.enableZoom&&oe(k),i.enablePan&&Zt(k)}function Te(k){i.enableZoom&&oe(k),i.enableRotate&&Oe(k)}function fe(k){i.enabled!==!1&&(B.length===0&&(i.domElement.setPointerCapture(k.pointerId),i.domElement.addEventListener("pointermove",Pt),i.domElement.addEventListener("pointerup",Qt)),Tt(k),k.pointerType==="touch"?rt(k):we(k))}function Pt(k){i.enabled!==!1&&(k.pointerType==="touch"?At(k):Me(k))}function Qt(k){kt(k),B.length===0&&(i.domElement.releasePointerCapture(k.pointerId),i.domElement.removeEventListener("pointermove",Pt),i.domElement.removeEventListener("pointerup",Qt)),i.dispatchEvent(ap),s=r.NONE}function we(k){let xt;switch(k.button){case 0:xt=i.mouseButtons.LEFT;break;case 1:xt=i.mouseButtons.MIDDLE;break;case 2:xt=i.mouseButtons.RIGHT;break;default:xt=-1}switch(xt){case qi.DOLLY:if(i.enableZoom===!1)return;st(k),s=r.DOLLY;break;case qi.ROTATE:if(k.ctrlKey||k.metaKey||k.shiftKey){if(i.enablePan===!1)return;mt(k),s=r.PAN}else{if(i.enableRotate===!1)return;St(k),s=r.ROTATE}break;case qi.PAN:if(k.ctrlKey||k.metaKey||k.shiftKey){if(i.enableRotate===!1)return;St(k),s=r.ROTATE}else{if(i.enablePan===!1)return;mt(k),s=r.PAN}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(Ou)}function Me(k){switch(s){case r.ROTATE:if(i.enableRotate===!1)return;It(k);break;case r.DOLLY:if(i.enableZoom===!1)return;Ot(k);break;case r.PAN:if(i.enablePan===!1)return;Gt(k);break}}function N(k){i.enabled===!1||i.enableZoom===!1||s!==r.NONE||(k.preventDefault(),i.dispatchEvent(Ou),Jt(k),i.dispatchEvent(ap))}function R(k){i.enabled===!1||i.enablePan===!1||se(k)}function rt(k){switch(Ct(k),B.length){case 1:switch(i.touches.ONE){case gr.ROTATE:if(i.enableRotate===!1)return;Kt(),s=r.TOUCH_ROTATE;break;case gr.PAN:if(i.enablePan===!1)return;pe(),s=r.TOUCH_PAN;break;default:s=r.NONE}break;case 2:switch(i.touches.TWO){case gr.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;he(),s=r.TOUCH_DOLLY_PAN;break;case gr.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;tt(),s=r.TOUCH_DOLLY_ROTATE;break;default:s=r.NONE}break;default:s=r.NONE}s!==r.NONE&&i.dispatchEvent(Ou)}function At(k){switch(Ct(k),s){case r.TOUCH_ROTATE:if(i.enableRotate===!1)return;Oe(k),i.update();break;case r.TOUCH_PAN:if(i.enablePan===!1)return;Zt(k),i.update();break;case r.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ie(k),i.update();break;case r.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Te(k),i.update();break;default:s=r.NONE}}function bt(k){i.enabled!==!1&&k.preventDefault()}function Tt(k){B.push(k)}function kt(k){delete K[k.pointerId];for(let xt=0;xtl+1e3&&(h.update(1e3*u/(g-l),100),l=g,u=0,m)){var w=performance.memory;m.update(w.usedJSHeapSize/1048576,w.jsHeapSizeLimit/1048576)}return g},update:function(){o=this.end()},domElement:a,setMode:r}};return e.Panel=function(i,r,s){var a=1/0,o=0,l=Math.round,u=l(window.devicePixelRatio||1),h=80*u,p=48*u,m=3*u,g=2*u,w=3*u,M=15*u,_=74*u,v=30*u,T=document.createElement("canvas");T.width=h,T.height=p,T.style.cssText="width:80px;height:48px";var b=T.getContext("2d");return b.font="bold "+9*u+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=s,b.fillRect(0,0,h,p),b.fillStyle=r,b.fillText(i,m,g),b.fillRect(w,M,_,v),b.fillStyle=s,b.globalAlpha=.9,b.fillRect(w,M,_,v),{dom:T,update:function(P,I){a=Math.min(a,P),o=Math.max(o,P),b.fillStyle=s,b.globalAlpha=1,b.fillRect(0,0,h,M),b.fillStyle=r,b.fillText(l(P)+" "+i+" ("+l(a)+"-"+l(o)+")",m,g),b.drawImage(T,w+u,M,_-u,v,w,M,_-u,v),b.fillRect(w+_-u,M,u,v),b.fillStyle=s,b.globalAlpha=.9,b.fillRect(w+_-u,M,u,l((1-P/I)*v))}}},e})})(Tm);var u1=Tm.exports;const Oh=Fl(u1);let wr;function h1(n){if(n===void 0)return wr!==void 0;n?wr??(wr={}):wr=void 0}function f1(){return wr}const d1=Oh.Panel;Oh.Panel=function(n,t,e){const i=d1.call(this,n,t,e);if(wr!==void 0){const r=i.update;i.update=(s,a)=>{(wr[n]??(wr[n]=[])).push(s),r.call(i,s,a)}}return i};function p1(n,t){var e,i=1;n==null&&(n=0),t==null&&(t=0);function r(){var s,a=e.length,o,l=0,u=0;for(s=0;s=(p=(o+u)/2))?o=p:u=p,(_=e>=(m=(l+h)/2))?l=m:h=m,r=s,!(s=s[v=_<<1|M]))return r[v]=a,n;if(g=+n._x.call(null,s.data),w=+n._y.call(null,s.data),t===g&&e===w)return a.next=s,r?r[v]=a:n._root=a,n;do r=r?r[v]=new Array(4):n._root=new Array(4),(M=t>=(p=(o+u)/2))?o=p:u=p,(_=e>=(m=(l+h)/2))?l=m:h=m;while((v=_<<1|M)===(T=(w>=m)<<1|g>=p));return r[T]=s,r[v]=a,n}function g1(n){var t,e,i=n.length,r,s,a=new Array(i),o=new Array(i),l=1/0,u=1/0,h=-1/0,p=-1/0;for(e=0;eh&&(h=r),sp&&(p=s));if(l>h||u>p)return this;for(this.cover(l,u).cover(h,p),e=0;en||n>=r||i>t||t>=s;)switch(u=(th||(o=w.y0)>p||(l=w.x1)=v)<<1|n>=_)&&(w=m[m.length-1],m[m.length-1]=m[m.length-1-M],m[m.length-1-M]=w)}else{var T=n-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),P=T*T+b*b;if(P=(m=(a+l)/2))?a=m:l=m,(M=p>=(g=(o+u)/2))?o=g:u=g,t=e,!(e=e[_=M<<1|w]))return this;if(!e.length)break;(t[_+1&3]||t[_+2&3]||t[_+3&3])&&(i=t,v=_)}for(;e.data!==n;)if(r=e,!(e=e.next))return this;return(s=e.next)&&delete e.next,r?(s?r.next=s:delete r.next,this):t?(s?t[_]=s:delete t[_],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(i?i[v]=e:this._root=e),this):(this._root=s,this)}function M1(n){for(var t=0,e=n.length;tm.index){var W=g-K.x-K.vx,ct=w-K.y-K.vy,Y=W*W+ct*ct;Yg+O||Hw+O||Bu.r&&(u.r=u[h].r)}function l(){if(t){var u,h=t.length,p;for(e=new Array(h),u=0;u[t(I,H,a),I])),P;for(_=0,o=new Array(v);_{}};function zh(){for(var n=0,t=arguments.length,e={},i;n=0&&(i=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}_l.prototype=zh.prototype={constructor:_l,on:function(n,t){var e=this._,i=F1(n+"",e),r,s=-1,a=i.length;if(arguments.length<2){for(;++s0)for(var e=new Array(r),i=0,r,s;i=0&&n._call.call(void 0,t),n=n._next;--oo}function fp(){us=(Pl=ua.now())+Xl,oo=Zo=0;try{H1()}finally{oo=0,k1(),us=0}}function G1(){var n=ua.now(),t=n-Pl;t>Rm&&(Xl-=t,Pl=n)}function k1(){for(var n,t=Rl,e,i=1/0;t;)t._call?(i>t._time&&(i=t._time),n=t,t=t._next):(e=t._next,t._next=null,t=n?n._next=e:Rl=e);Jo=n,ch(i)}function ch(n){if(!oo){Zo&&(Zo=clearTimeout(Zo));var t=n-us;t>24?(n<1/0&&(Zo=setTimeout(fp,n-ua.now()-Xl)),Yo&&(Yo=clearInterval(Yo))):(Yo||(Pl=ua.now(),Yo=setInterval(G1,Rm)),oo=1,Pm(fp))}}function dp(n,t,e){var i=new Ll;return t=t==null?0:+t,i.restart(r=>{i.stop(),n(r+t)},t,e),i}const V1=1664525,W1=1013904223,pp=4294967296;function X1(){let n=1;return()=>(n=(V1*n+W1)%pp)/pp}function $1(n){return n.x}function q1(n){return n.y}var j1=10,Y1=Math.PI*(3-Math.sqrt(5));function K1(n){var t,e=1,i=.001,r=1-Math.pow(i,1/300),s=0,a=.6,o=new Map,l=Gh(p),u=zh("tick","end"),h=X1();n==null&&(n=[]);function p(){m(),u.call("tick",t),e1?(_==null?o.delete(M):o.set(M,w(_)),t):o.get(M)},find:function(M,_,v){var T=0,b=n.length,P,I,H,B,K;for(v==null?v=1/0:v*=v,T=0;T1?(u.on(M,_),t):u.on(M)}}}function Z1(){var n,t,e,i,r=en(-30),s,a=1,o=1/0,l=.81;function u(g){var w,M=n.length,_=Fh(n,$1,q1).visitAfter(p);for(i=g,w=0;w=o)return;(g.data!==t||g.next)&&(v===0&&(v=Mr(e),P+=v*v),T===0&&(T=Mr(e),P+=T*T),P1);return i+r*o*Math.sqrt(-2*Math.log(a)/a)}}return e.source=n,e}(pn),rC=function n(t){var e=kh.source(t);function i(){var r=e.apply(this,arguments);return function(){return Math.exp(r())}}return i.source=n,i}(pn),Lm=function n(t){function e(i){return(i=+i)<=0?()=>0:function(){for(var r=0,s=i;s>1;--s)r+=t();return r+s*t()}}return e.source=n,e}(pn),sC=function n(t){var e=Lm.source(t);function i(r){if((r=+r)==0)return t;var s=e(r);return function(){return s()/r}}return i.source=n,i}(pn),oC=function n(t){function e(i){return function(){return-Math.log1p(-t())/i}}return e.source=n,e}(pn),aC=function n(t){function e(i){if((i=+i)<0)throw new RangeError("invalid alpha");return i=1/-i,function(){return Math.pow(1-t(),i)}}return e.source=n,e}(pn),lC=function n(t){function e(i){if((i=+i)<0||i>1)throw new RangeError("invalid p");return function(){return Math.floor(t()+i)}}return e.source=n,e}(pn),Dm=function n(t){function e(i){if((i=+i)<0||i>1)throw new RangeError("invalid p");return i===0?()=>1/0:i===1?()=>1:(i=Math.log1p(-i),function(){return 1+Math.floor(Math.log1p(-t())/i)})}return e.source=n,e}(pn),Vh=function n(t){var e=kh.source(t)();function i(r,s){if((r=+r)<0)throw new RangeError("invalid k");if(r===0)return()=>0;if(s=s==null?1:+s,r===1)return()=>-Math.log1p(-t())*s;var a=(r<1?r+1:r)-1/3,o=1/(3*Math.sqrt(a)),l=r<1?()=>Math.pow(t(),1/r):()=>1;return function(){do{do var u=e(),h=1+o*u;while(h<=0);h*=h*h;var p=1-t()}while(p>=1-.0331*u*u*u*u&&Math.log(p)>=.5*u*u+a*(1-h+Math.log(h)));return a*h*l()*s}}return i.source=n,i}(pn),Nm=function n(t){var e=Vh.source(t);function i(r,s){var a=e(r),o=e(s);return function(){var l=a();return l===0?0:l/(l+o())}}return i.source=n,i}(pn),Im=function n(t){var e=Dm.source(t),i=Nm.source(t);function r(s,a){return s=+s,(a=+a)>=1?()=>s:a<=0?()=>0:function(){for(var o=0,l=s,u=a;l*u>16&&l*(1-u)>16;){var h=Math.floor((l+1)*u),p=i(h,l-h+1)();p<=u?(o+=h,l-=h,u=(u-p)/(1-p)):(l=h-1,u/=p)}for(var m=u<.5,g=m?u:1-u,w=e(g),M=w(),_=0;M<=l;++_)M+=w();return o+(m?_:l-_)}}return r.source=n,r}(pn),cC=function n(t){function e(i,r,s){var a;return(i=+i)==0?a=o=>-Math.log(o):(i=1/i,a=o=>Math.pow(o,i)),r=r==null?0:+r,s=s==null?1:+s,function(){return r+s*a(-Math.log1p(-t()))}}return e.source=n,e}(pn),uC=function n(t){function e(i,r){return i=i==null?0:+i,r=r==null?1:+r,function(){return i+r*Math.tan(Math.PI*t())}}return e.source=n,e}(pn),hC=function n(t){function e(i,r){return i=i==null?0:+i,r=r==null?1:+r,function(){var s=t();return i+r*Math.log(s/(1-s))}}return e.source=n,e}(pn),fC=function n(t){var e=Vh.source(t),i=Im.source(t);function r(s){return function(){for(var a=0,o=s;o>16;){var l=Math.floor(.875*o),u=e(l)();if(u>o)return a+i(l-1,o/u)();a+=l,o-=u}for(var h=-Math.log1p(-t()),p=0;h<=o;++p)h-=Math.log1p(-t());return a+p}}return r.source=n,r}(pn),dC=1664525,pC=1013904223,mp=1/4294967296;function mC(n=Math.random()){let t=(0<=n&&n<1?n/mp:Math.abs(n))|0;return()=>(t=dC*t+pC|0,mp*(t>>>0))}const gC=Object.freeze(Object.defineProperty({__proto__:null,randomBates:sC,randomBernoulli:lC,randomBeta:Nm,randomBinomial:Im,randomCauchy:uC,randomExponential:oC,randomGamma:Vh,randomGeometric:Dm,randomInt:iC,randomIrwinHall:Lm,randomLcg:mC,randomLogNormal:rC,randomLogistic:hC,randomNormal:kh,randomPareto:aC,randomPoisson:fC,randomUniform:nC,randomWeibull:cC},Symbol.toStringTag,{value:"Module"}));var Um={exports:{}};(function(n){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(l,u,h){this.fn=l,this.context=u,this.once=h||!1}function s(l,u,h,p,m){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new r(h,p||l,m),w=e?e+u:u;return l._events[w]?l._events[w].fn?l._events[w]=[l._events[w],g]:l._events[w].push(g):(l._events[w]=g,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new i:delete l._events[u]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],h,p;if(this._eventsCount===0)return u;for(p in h=this._events)t.call(h,p)&&u.push(e?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(h)):u},o.prototype.listeners=function(u){var h=e?e+u:u,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var m=0,g=p.length,w=new Array(g);m(n||(n=new Ki),e?n.setFromObject(t):(n.makeEmpty(),ha.expandByObject(n,t,e)));ha.expandByObject=(n,t)=>{const e=new Ki;t.updateWorldMatrix(!1,!1);const i=t.geometry;return i!==void 0&&(i.boundingBox===null&&i.computeBoundingBox(),e.copy(i.boundingBox),e.applyMatrix4(t.matrixWorld),n.union(e)),n};class sa{}sa.copyWith=(n,t,e,i)=>{const r=n.groups,s=new Ji(t,e,i);return s.groups=r,s};class vC{constructor(){Wt(this,"_events",null)}get enabled(){return this._events!==null}bundle(t){this._events=new Map;try{const e=t();return this._events.forEach(({listener:i,args:r})=>i(...r)),e}finally{this._events=null}}on(t,e,i){t.on(e,this._getListener(e,i))}off(t,e,i){t.off(e,this._getListener(e,i))}_getListener(t,e){var r;let i=(r=this._listeners)==null?void 0:r.get([t,e]);return i||(i=(...s)=>{this.enabled?this._events.set(this._getEventKey(e,s),{listener:e,args:s}):e(...s)},(this._listeners??(this._listeners=new WeakMap)).set([t,e],i),i)}_getEventKey(t,e){return e!=null&&e.length?[t,e]:t}}class yC{constructor(t,e,i){this.objects=t,this.classes=e,this.rootFrame=i}createCursor(){return new EC(this)}maxStackDepth(){let t=0;return this.createCursor().stepAll({visitFrame:(e,i)=>t=Math.max(t,i.currentStack.length)}),t}}class ao{constructor(){Wt(this,"name");Wt(this,"class");Wt(this,"fields");Wt(this,"fieldHistories")}static valueToString(t){return t instanceof ao?t.name:t.toString()}}class xC{constructor(){Wt(this,"name");Wt(this,"category")}}class wC{constructor(t,e){this.name=t,this.package=e}}class MC{constructor(t){this.name=t}}class SC{constructor(t,e){this.times=t,this.values=e}}class bC{constructor(t,e,i,r,s,a,o){this.receiver=t,this.message=e,this.arguments=i,this.answer=r,this.startTime=s,this.endTime=a,this.children=o}allFrames(){return[this,...this.children.flatMap(t=>t.allFrames())]}get name(){var t;return`${(t=this.receiver.class)==null?void 0:t.name}>>${this.message}`}toString(){return this.name}}class gp{constructor(t){Wt(this,"objects",{});Wt(this,"classes",{});Wt(this,"classCategories",{});Wt(this,"packages",{});this.traceData=t}static readTrace(t){return new this(t).getTrace()}static async readTraceFromServerFile(t){const e=await fetch(t);if(!e.ok)throw new Error(`Failed to load trace: ${e.status} ${e.statusText}`);const i=await e.json();return this.readTrace(i)}static async readTraceFromString(t){const e=JSON.parse(t);return this.readTrace(e)}getTrace(){const t=this.getObjects(this.traceData.objects),e=this.getClasses(this.traceData.classes),i=this.getFrame(this.traceData.trace);return new yC(t,e,i)}getObjects(t){return Ne(t).reject(e=>e==null).map((e,i)=>this.getObject(i,e)).values().all()}getObject(t,e=void 0){let i=this.objects[t];return i==null&&(i=new ao,this.objects[t]=i),e===void 0||(i.name=e.name,i.class=this.getClass(e.class),i.fields=Ne(e.fields).map(r=>this.getStringOrObject(r)).all(),i.fieldHistories=this.getFieldHistories(e.historicFields)),i}getClass(t,e=void 0){let i=this.classes[t];return i==null&&(i=new xC,this.classes[t]=i),e===void 0||(i.name=t,i.category=this.getClassCategory(e.category,e.package)),i}getClassCategory(t,e){let i=this.classCategories[t];if(i!=null)return i;const r=this.getPackage(e);return i=new wC(t,r),this.classCategories[t]=i,i}getPackage(t){let e=this.packages[t];return e!=null||(e=new MC(t),this.packages[t]=e),e}getClasses(t){return Ne(t).map((e,i)=>this.getClass(i,e)).all()}getFieldHistories(t){return Ne(t).map((e,i)=>this.getFieldHistory(e)).all()}getFieldHistory(t){if(t==null)return null;const e=t.times,i=t.values.map(r=>this.getStringOrObject(r));return new SC(e,i)}getStringOrObject(t){return t[0]!=="@"?t[0]==="\\"?t.substring(1):t:this.getObject(t)}getFrame(t){const e=this.getObject(t.receiver),i=t.message,r=t.arguments.map(u=>this.getStringOrObject(u)),s=t.answer!=null?this.getStringOrObject(t.answer):null,a=t.startTime,o=t.endTime,l=t.children.map(u=>this.getFrame(u));return new bC(e,i,r,s,a,o,l)}}class EC{constructor(t){Wt(this,"trace");Wt(this,"currentTime");Wt(this,"currentStack");this.trace=t,this.reset()}get currentFrame(){return this.currentStack[this.currentStack.length-1]}get startTime(){return this.trace.rootFrame.startTime}get endTime(){return this.trace.rootFrame.endTime+1}reset(){this.currentTime=this.startTime,this.currentStack=[this.trace.rootFrame]}step(t,e={}){return console.assert(t===Math.floor(t)),t>0?(t=Math.min(t,this.endTime-this.currentTime),this.stepForward(t,e)):t<0&&(t=Math.max(t,this.startTime-this.currentTime),this.stepBackward(-t,e)),this}stepAll(t={}){return this.stepTo(this.endTime,t)}stepTo(t,e={}){return this.step(t-this.currentTime,e)}stepForward(t,e={}){const{activateFrame:i,visitFrame:r}=e;if(t<=0)return;let s=t,a=!1;for(this.currentTime===this.startTime&&(i==null||i(this.currentFrame,this));;){const o=this.currentFrame,l=o&&o.children.find(p=>p.startTime>this.currentTime),u=o&&(l?l.startTime:o.endTime+1),h=o&&u-this.currentTime;if(a&&h>0&&(i==null||i(o,this)),s<=0)break;if(o==null)throw new Error(`Ran out of frames after ${t-s} steps`);h>0&&(r==null||r(o,this)),h>s?(this.currentTime+=s,s=0,a=!1):(this.currentTime+=h,s-=h,l!=null?this._stepInto(l):this._stepOut(),a=!0)}}stepBackward(t,e={}){const{activateFrame:i,visitFrame:r}=e;if(t<=0)return;let s=t,a=!1;for(this.currentTime===this.endTime&&(this.currentTime-=1,this._stepInto(this.trace.rootFrame),s-=1,a=!0);;){const o=this.currentFrame,l=o&&o.children.slice().reverse().find(p=>p.endTime0&&(i==null||i(o,this)),s<=0)break;if(o==null)throw new Error(`Ran out of frames after ${t-s} steps`);h>0&&(r==null||r(o,this)),h>s?(this.currentTime-=s,s=0,a=!1):(this.currentTime-=h,s-=h,l!=null?this._stepInto(l):this._stepOut(),a=!0)}}canStepForward(t=1){return this.currentTime+t<=this.endTime}canStepBackward(t=1){return this.currentTime-t>=this.startTime}_stepInto(t){this.currentStack.push(t)}_stepOut(){this.currentStack.pop()}}const _r={...eC,...gC},fa=new vC;class Xh extends Wh{constructor(){super(...arguments);Wt(this,"parent",null);Wt(this,"focusStates",[]);Wt(this,"connections",[]);Wt(this,"hoveredEntities",[])}get object3d(){return this.cuboid}get path(){var e;return(((e=this.parent)==null?void 0:e.path)??[]).concat([this])}get root(){var e;return((e=this.parent)==null?void 0:e.root)??this}get width(){return this.object3d.geometry.parameters.width}get depth(){return this.object3d.geometry.parameters.depth}get height(){return this.object3d.geometry.parameters.height}get description(){return`${this.name}`}sortAllChildren(){}allEntities(e=null){return e==null||e(this)?[this]:[]}allObjectEntities(){return this.allEntities(e=>e instanceof Mi)}build(e,i={}){return this.buildObject3d(e,i),this.cuboid.entity=this,(i.deferLabels??!1)||this.buildAllLabels(),this.wantsDrag()&&e.registerDraggable(this.cuboid),this.cuboid}buildAllLabels(){this.buildLabel(),this.updateDisplayState()}buildObject3d(e,i={}){this.traceMap=e;const r=this.buildCuboidGeometry(e);this.cuboid=new Dn(r),this.cuboid.castShadow=!0,this.cuboid.receiveShadow=!0,this.baseMaterial=new Ar({roughness:.75,metalness:0,flatShading:!0,transparent:!0}),this.topMaterial=new Ar({roughness:.75,metalness:0,flatShading:!0,transparent:!0}),this.sideMaterial=new Ar({roughness:.75,metalness:0,flatShading:!0,transparent:!0}),this.cuboid.material=[this.baseMaterial,this.topMaterial,this.sideMaterial],r.clearGroups(),r.addGroup(0,1/0,0),r.addGroup(0,6,2),r.addGroup(6,6,2),r.addGroup(12,6,1),r.addGroup(24,6,2),r.addGroup(30,6,2)}buildCuboidGeometry(e){return new Ji(30,30,10)}buildLabel(){var r,s;const i=((r=this.name)==null?void 0:r.length)>24?((s=this.name)==null?void 0:s.substring(0,23))+"…":this.name;this.topMaterial.map=this.buildLabelTexture(i,{allSides:!0,align:"center"}),this.topMaterial.needsUpdate=!0,this.sideMaterial.map=this.buildLabelTexture(i,{allSides:!1,align:"center",ratioOrientation:"side"}),this.sideMaterial.needsUpdate=!0}buildLabelTexture(e,i={}){const r=i.resolution??128,a=(i.ratioOrientation??"top")==="top"?this.object3d.geometry.parameters.width/this.object3d.geometry.parameters.depth:this.object3d.geometry.parameters.width/this.object3d.geometry.parameters.height,o=r*a,l=r,u=document.createElement("canvas");u.width=o*2,u.height=l*2;const h=u.getContext("2d"),p=i.color??"transparent";if(h.fillStyle=typeof p=="number"?`#${p.toString(16).padStart(6,"0")}`:p,h.fillRect(0,0,u.width,u.height),e){const g=i.textColor??"#000000",w=i.fontScale??1,M=i.allSides??!1,_=i.align??"left",v=i.margin??0;h.fillStyle=g;const T=360*w*r/1024;h.font=`bolder ${T}px Arial, sans-serif`;const b=h.measureText(e).width;let P=u.height*v;P+=.75*T;let I=u.width*v;M&&(I=P);let H=u.width;H-=I*2;let B=u.height;B-=P*2;const K=Math.min(b,H),C=Math.min(b,B);h.translate(I,0);const O=M?4:1;for(let W=0;Wa.name===e);return s.length||(s=this),this.parent.addChildConnection(s,i,r)}moveTo(e,i,r){this.object3d.position.set(e,i,r),this.moved()}setFocusState(e,i=!0){if(!i)return this.unsetFocusState(e);this.focusStates.includes(e)||(this.focusStates.push(e),this.updateDisplayState())}unsetFocusState(e){this.focusStates.includes(e)&&(this.focusStates.splice(this.focusStates.indexOf(e),1),this.updateDisplayState())}setGlowState(e,i=1){var r;if(!i)return this.unsetGlowState(e);((r=this.glowFractions)==null?void 0:r[e])!==i&&(this.glowFractions??(this.glowFractions={}),this.glowFractions[e]=i,this.updateDisplayState())}unsetGlowState(e){var i,r;(i=this.glowFractions)!=null&&i[e]&&((r=this.glowFractions)==null||delete r[e],this.updateDisplayState())}getGlowFraction(e){var i;return((i=this.glowFractions)==null?void 0:i[e])??0}getDisplayColor(e=!0){let i=this.constructor.colors[Ne(this.focusStates).intersect(this.constructor.allFocusStates).first()??"default"],r=null;return e&&this.glowFractions&&Ne(this.glowFractions).each((s,a)=>{let o=this.constructor.glowColors[a];if(!o)return;const l={h:o.dh,s:o.ds,l:o.dl};i?r||(r=new Ee().setHSL(i.h,i.s,i.l)):i=r.getHSL({}),o={...i,...o},o={...o,...Ne(l).reject(h=>h==null).map((h,p)=>h(o[p])).all()},r=new Ee().setHSL(o.h,o.s,o.l).lerp(r,1-s),i=null}),i?r||(r=new Ee().setHSL(i.h,i.s,i.l)):i=r.getHSL({}),[i,r]}updateDisplayState(){if(this.baseMaterial){let[e,i]=this.getDisplayColor();this.baseMaterial.color=i,this.baseMaterial.needsUpdate=!0}this.traceMap.updateScene(),this.connections.forEach(e=>{e.setFocusState("hoverEntity",Ne(this.focusStates).intersect(this.constructor.allFocusStates).isNotEmpty())})}addHoveredEntity(e){this.hoveredEntities.push(e),this.hoveredEntities.length&&this.setFocusState("hover")}removeHoveredEntity(e){const i=this.hoveredEntities.indexOf(e);i!==-1&&(this.hoveredEntities.splice(i,1),this.hoveredEntities.length||this.unsetFocusState("hover"))}wantsClick(e){return!0}wantsDrag(e){return!0}wantsMouse(e){return!0}onHoverStart(e){this.addHoveredEntity(this)}onHoverEnd(e){this.removeHoveredEntity(this)}onClick(e){if(e.ctrlKey){this.unpinD3Node();return}window.selectedEntity=this,console.log(this.object??this.organization??this),alert(this.description)}onDragStart(e){this.object3d.positionBeforeDrag=this.object3d.position.clone()}onDragEnd(e){this.unsetFocusState("drag"),delete this.object3d.positionBeforeDrag}onDrag(e){var i,r;this.setFocusState("drag"),(r=(i=this.root).onChildStartDrag)==null||r.call(i,this),this.constrainDrag(e)&&(this.moved(),this.d3Node&&(this.d3Node.x=this.object3d.position.x,this.d3Node.y=this.object3d.position.z,this.pinD3Node()))}constrainDrag(e){if(!this.wantsDrag(e))return this.object3d.position.copy(this.object3d.positionBeforeDrag),!1;if(!this.object3d.positionBeforeDrag)return console.warn("no positionBeforeDrag",this),!1;this.object3d.position.y=this.object3d.positionBeforeDrag.y;const i=e.target.getObjects().filter(u=>u!==e.object),r=.1,s=ha.setFromObject(null,this.object3d,!1).expandByScalar(-r);if(i.some(u=>{const h=ha.setFromObject(null,u,!1).expandByScalar(-r);return s.intersectsBox(h)}))return this.object3d.position.copy(this.object3d.positionBeforeDrag),!1;const o=(this.parent.width-this.width)/2,l=(this.parent.depth-this.depth)/2;return this.object3d.position.x=Math.max(-o,Math.min(o,this.object3d.position.x)),this.object3d.position.z=Math.max(-l,Math.min(l,this.object3d.position.z)),this.object3d.positionBeforeDrag=this.object3d.position.clone(),!0}moved(){this.emit("moved")}pinD3Node(){this.d3Node.fx=this.d3Node.x,this.d3Node.fy=this.d3Node.y}unpinD3Node(){delete this.d3Node.fx,delete this.d3Node.fy}}Wt(Xh,"allFocusStates",["hover","drag"]);class fo extends Xh{constructor(e){super();Wt(this,"children",[]);Wt(this,"childConnections",[]);this.organization=e}get name(){return this.organization.name}addChild(e){this.children.push(e),e.parent=this}removeChild(e){this.children.splice(this.children.indexOf(e),1),e.parent=null}sortAllChildren(){this.children.forEach(e=>e.sortAllChildren()),this.children.sort((e,i)=>e.name.localeCompare(i.name))}allEntities(e=null){const i=[];return(e==null||e(this))&&i.push(this),this.children.forEach(r=>{i.push(...r.allEntities(e))}),i}build(e,i={}){return this.buildObject3d(e,i),this.cuboid.entity=this,this.buildChildren(e,{deferLabels:!0,...i}),this.layoutChildren(),(i.deferLabels??!1)||this.buildAllLabels(),this.buildChildConnections(e),this.wantsDrag()&&e.registerDraggable(this.cuboid),this.cuboid}buildAllLabels(){super.buildAllLabels(),this.children.forEach(e=>{e.buildAllLabels()})}buildChildren(e,i={}){const r=this.children.map(s=>s.build(e,i));r.length!=0&&this.object3d.add(...r)}buildChildConnections(e){this.childConnections.forEach(i=>{this.object3d.add(i.build())})}addChildConnection(e,i,r){const s=new yl(e,i,r);return(Array.isArray(e)?e:[e]).forEach(a=>{a.connections.push(s)}),i.connections.push(s),this.childConnections.push(s),s}get height(){return 10}adoptSize(e,i){this.cuboid.geometry=sa.copyWith(this.cuboid.geometry,e,this.height,i)}layoutChildren(){this.layoutChildrenOnGrid({resizeMode:"shrinkWrap",offset:10*.5**(this.path.length-1),margin:{absolute:10}})}layoutChildrenOnGrid(e={}){var se,Kt,pe,Pe,he,tt,Oe,Zt,oe,ie,Te,fe;const i=e.childObjects??this.object3d.children;if(i.length==0)return;const r=e.groupBy;if(r!=null){const{groupBy:Pt,groupExtract:Qt,...we}=e;return Ne(i).groupBy(Me=>{var N;return(N=Me.entity)==null?void 0:N[r]}).map((Me,N)=>this.layoutChildrenOnGrid({childObjects:Me.all(),...Qt?{[Qt]:N}:{},...we})).all()}const s=e.resizeMode??"spaceFill",a=e.side??"top",o=e.idealCellRatio??1,l=e.childExtentW,u=e.query??null,h=e.dryRun??!1,p=typeof e.offset=="number"?e.offset:0,m=((se=e.offset)==null?void 0:se.u)??p,g=((Kt=e.offset)==null?void 0:Kt.v)??p,w=((pe=e.offset)==null?void 0:pe.left)??m,M=((Pe=e.offset)==null?void 0:Pe.top)??g,_=((he=e.offset)==null?void 0:he.right)??m,v=((tt=e.offset)==null?void 0:tt.bottom)??g,T=((Oe=e.margin)==null?void 0:Oe.absolute)??0,b=((Zt=e.margin)==null?void 0:Zt.absoluteU)??T,P=((oe=e.margin)==null?void 0:oe.absoluteV)??T,I=((ie=e.margin)==null?void 0:ie.relative)??0,H=((Te=e.margin)==null?void 0:Te.relativeU)??I,B=((fe=e.margin)==null?void 0:fe.relativeV)??I,K=this.object3d,C=Math.ceil(Math.sqrt(i.length)/o),O=Math.ceil(i.length/C);if(u==="gridCountU")return C;if(u==="gridCountV")return O;let W=new X(w,0,M),ct=new X(_,0,v),Y=new X(1,1,1);Jt(null,Y),W.divide(Y),ct.divide(Y);const Q=W.x,nt=W.z,_t=ct.x,ht=ct.z,wt=(this[Ot("w")]??Gt(this.object3d,"w"))/2,{marginU:St,marginV:st,cellExtentU:mt,cellExtentV:It}={shrinkWrap:()=>{const Pt=Ne(i).map(N=>Gt(N,"u")).max(),Qt=Ne(i).map(N=>Gt(N,"v")).max(),we=b+Pt*H,Me=P+Qt*B;return{marginU:we,marginV:Me,cellExtentU:Pt,cellExtentV:Qt}},spaceFill:()=>{const Pt=b,Qt=P,we=this[Ot("u")]??Gt(this.object3d,"u"),Me=this[Ot("v")]??Gt(this.object3d,"v"),N=we-Q-_t,R=Me-nt-ht,rt=(N-Pt*(C-1))/C,At=(R-Qt*(O-1))/O;return{marginU:Pt,marginV:Qt,cellExtentU:rt,cellExtentV:At,originOffsetU:Q,originOffsetV:nt,cornerOffsetU:_t,cornerOffsetV:ht}}}[s]();if(h)return;i.forEach((Pt,Qt)=>{var Ct;const we=Qt%C,Me=Math.floor(Qt/C),N=Q/2+(we-(C/2-.5))*(mt+St),R=nt/2+(Me-(O/2-.5))*(It+st),rt=wt+(l??Gt(Pt,"w"))/2,[At,bt,Tt]=[N,rt,R];if(Pt.position.set(At,bt,Tt),s==="spaceFill"&&((Ct=Pt.entity)==null||Ct.adoptSize(mt,It)),a==="top")return;const kt=Pt.position.clone();Pt.translateX(-kt.x),Pt.translateY(-kt.y),Pt.translateZ(-kt.z),Jt(Pt,kt),Pt.translateX(kt.x),Pt.translateY(kt.y),Pt.translateZ(kt.z)}),s==="shrinkWrap"&&this.adoptSize(mt*C+St*(C-1)+Q+_t,It*O+st*(O-1)+nt+ht);function Ot(Pt){return["width","depth","height"]["uvw".indexOf(Pt)]}function Gt(Pt,Qt){return Pt.geometry.parameters[Ot(Qt)]}function Jt(Pt,Qt){if(Pt==null||Pt.rotateX(Math.PI*({top:0,bottom:1}[a]??.5)),a==="top"||a==="bottom")return;const we=K.geometry,Me=we.parameters.height/we.parameters.depth;if(Qt.y/=Me,Qt.z*=Me,Pt!=null&&(Pt.geometry=sa.copyWith(Pt.geometry,Pt.geometry.parameters.width,Pt.geometry.parameters.height,Pt.geometry.parameters.depth*Me),Pt.rotateZ(Math.PI*({back:1,right:.5,left:-.5}[a]??0))),!(a==="left"||a==="right"))return;const N=we.parameters.depth/we.parameters.width;Qt.x*=N,Qt.y/=N,Pt!=null&&(Pt.geometry=sa.copyWith(Pt.geometry,Pt.geometry.parameters.width*N,Pt.geometry.parameters.height,Pt.geometry.parameters.depth))}}layoutChildrenOnGridQuery(e,i={}){return this.layoutChildrenOnGrid({query:e,dryRun:!0,...i})}layoutFDG(e,i,r={}){const l=this.children.map((M,_)=>M.d3Node={index:_,entity:M,x:M.object3d.position.x,y:M.object3d.position.z,radius:new Ki().setFromObject(M.object3d).getSize(new X).setY(0).length()/2}),u=[];i(this.children,(M,_,v)=>{u.push({source:M.d3Node,target:_.d3Node,strength:v*.1})});const h=()=>{fa.bundle(()=>{const M=this.height/2;this.children.forEach(_=>{_.moveTo(_.d3Node.x,M+_.object3d.geometry.parameters.height/2,_.d3Node.y)})})};this.simulation=_r.forceSimulation(l),this.simulation.force("x",_r.forceX().strength(.001)).force("y",_r.forceY().strength(.001)).force("link",_r.forceLink(u).id(M=>M.index).strength(M=>M.strength)).force("charge",_r.forceManyBody().strength(-(r.repulsion??.2))),this.simulation.alpha(1).alphaDecay(0),this.simulation.force("collide",_r.forceCollide().strength(1).radius(M=>M.radius).iterations(10)),this.simulation.alpha(1).alphaDecay(1e-4).on("tick",()=>{const _=r.maxDuration??100,v=performance.now();for(let H=0;H<100&&(this.simulation.tick(),!(performance.now()-v>_));H++);h();function T(H,B){B.isT4dSimulated=!0;try{H.dispatchEvent(B)}finally{delete B.isT4dSimulated}}e.lastMouseMoveEvent!=null&&Promise.resolve().then(()=>{T(e.renderer.domElement,e.lastMouseMoveEvent)}),e.lastPointerMoveEvent!=null&&Promise.resolve().then(()=>{T(e.renderer.domElement,e.lastPointerMoveEvent)});const b=r.offset??20,P=l.length?Math.max(Ne(l).map(H=>H.x).max(),-Ne(l).map(H=>H.x).min())*2:1,I=l.length?Math.max(Ne(l).map(H=>H.y).max(),-Ne(l).map(H=>H.y).min())*2:1;this.adoptSize(P+b,I+b),e.updateScene()}).restart();const p=(Ne(l).map(M=>M.x).min()+Ne(l).map(M=>M.x).max())/2,m=(Ne(l).map(M=>M.y).min()+Ne(l).map(M=>M.y).max())/2;l.forEach(M=>{M.x-=p,M.y-=m}),h();const g=new Ki().setFromObject(this.object3d).getSize(new X),w=10;this.adoptSize(g.x+w,g.z+w)}stopForceSimulation(){var e;(e=this.simulation)==null||e.stop()}onChildStartDrag(){this.simulation&&(this.simulation.alpha(1),this.simulation.restart())}moved(){super.moved(),this.children.forEach(e=>{e.moved()})}}Wt(fo,"colors",{default:{h:.333,s:1,l:.25},hover:{h:.333,s:1,l:.5}});class $h extends fo{constructor(e){super(e);Wt(this,"trail",new AC)}get object3d(){return this.plane}get depth(){return this.plane.geometry.parameters.height}build(e,i={}){this.traceMap=e;const r=new ca(100,100);return r.rotateX(-Math.PI/2),this.plane=new Dn(r,this.constructor.planeMaterial),this.plane.entity=this,this.plane.receiveShadow=!0,this.buildChildren(e,{deferLabels:!0,...i}),this.layoutChildren(),(i.deferLabels??!1)||this.buildAllLabels(),this.buildChildConnections(e),this.buildTrail(e),this.plane}buildLabel(){}buildTrail(e){if(!this.trail)return;const i=this.trail.build(e);this.object3d.add(i)}get height(){return 0}adoptSize(e,i){this.plane.geometry=new ca(e,i).rotateX(-Math.PI/2)}updateDisplayState(){}wantsClick(e){return!1}wantsDrag(e){return!1}onHoverStart(e){}onHoverEnd(e){}}Wt($h,"planeMaterial",new Ar({color:7829367}));class Om extends fo{constructor(t){super(t)}}Wt(Om,"colors",{default:{h:0,s:1,l:.13},hover:{h:0,s:1,l:.16},drag:{h:0,s:1,l:.19}});class Fm extends fo{constructor(t){super(t)}}Wt(Fm,"colors",{default:{h:.083,s:1,l:.13},hover:{h:.083,s:1,l:.16},drag:{h:.083,s:1,l:.19}});class Bm extends fo{constructor(t){super(t)}}Wt(Bm,"colors",{default:{h:.167,s:1,l:.13},hover:{h:.167,s:1,l:.16},drag:{h:.167,s:1,l:.19}});const ef=class extends fo{constructor(t){super(t)}get object(){return this.organization}get description(){let t=super.description;return this.object&&(t+=` +${this.object.class.category.name}`,this.object.fields&&(t+=` +`,t+=` +${Ne(this.object.fields).map((e,i)=>`${i}: ${ao.valueToString(e)}`).join(` +`)}`)),t}get height(){function t(i,r=null){if(i.isEmpty())return r;if(i.count()!==1)throw new Error("collection does not contain exactly one element");return i.first()}const e=t(Ne(this.layoutChildrenOnGridQuery("gridCountV",{childObjects:Ne(this.object.fields).keys().all(),...this.constructor.gridLayoutOptions})).values().unique(),0);return this.constructor.headerHeight+this.constructor.fieldHeight*e}buildCuboidGeometry(t){return new Ji(10,this.height,10)}get connectionSourceAbsoluteY(){return this.object3d.position.y+this.height/2-this.constructor.headerHeight/2}get connectionTargetAbsoluteY(){return this.object3d.position.y+this.height/2-this.constructor.headerHeight/2}layoutChildren(){this.layoutChildrenOnGrid(this.constructor.gridLayoutOptions)}};let Mi=ef;Wt(Mi,"colors",{default:{h:.056,s:0,l:.97-.2},hover:{h:.056,s:0,l:.97-.2-.4},drag:{h:.056,s:0,l:.97-.2-.6}}),Wt(Mi,"glowColors",{active:{h:-.006,s:.79,dl:t=>(t+.2)/2-.2}}),Wt(Mi,"headerHeight",3.5),Wt(Mi,"fieldHeight",3),Wt(Mi,"gridLayoutOptions",{resizeMode:"spaceFill",groupBy:"side",groupExtract:"side",margin:{absolute:0},offset:{top:ef.headerHeight},idealCellRatio:2});class vl extends Xh{constructor(e,i){super();Wt(this,"primary",null);Wt(this,"twins",[]);this.name=e,this.value=i}get description(){return`${this.name}: ${ao.valueToString(this.value)}`}buildObject3d(e,i={}){this.traceMap=e;const r=new Ji(10,.1,2.5);if(this.cuboid=new Dn(r),this.cuboid.renderOrder=1,this.primary)this.cuboid.material=this.primary.cuboid.material;else{if((i.deferLabels??!1)||this.buildAllLabels(),this.baseMaterial=new Ar({roughness:.75,metalness:0,flatShading:!0,transparent:!0,opacity:this.constructor.opacity}),this.topMaterial=new Ar({roughness:.75,metalness:0,flatShading:!0,transparent:!0}),this.constructor.sideMaterial===void 0){this.constructor.sideMaterial=new Ar({roughness:.75,metalness:0,flatShading:!0,transparent:!0});const s=this.buildLabelTexture(null);this.constructor.sideMaterial.map=s,this.constructor.sideMaterial.needsUpdate=!0}this.cuboid.material=[this.baseMaterial,this.topMaterial,this.constructor.sideMaterial]}r.clearGroups(),r.addGroup(0,1/0,0),r.addGroup(0,6,2),r.addGroup(6,6,2),r.addGroup(12,6,1),r.addGroup(24,6,2),r.addGroup(30,6,2),this.cuboid.castShadow=!1,this.cuboid.receiveShadow=!0}buildLabel(){if(this.primary)return;const e=24,i=`${this.name}: ${ao.valueToString(this.value)}`,r=i.length>e?i.substring(0,e-1)+"…":i;this.topMaterial.map=this.buildLabelTexture(r,{align:"left",fontScale:2.5,margin:.01,ratioOrientation:"top"}),this.topMaterial.needsUpdate=!0}adoptSize(e,i){this.cuboid.geometry=sa.copyWith(this.cuboid.geometry,e,this.height,i)}setFocusState(e,i){return this.primary?this.primary.setFocusState(e,i):super.setFocusState(e,i)}unsetFocusState(e){return this.primary?this.primary.unsetFocusState(e):super.unsetFocusState(e)}setGlowState(e,i){return this.primary?this.primary.setGlowState(e,i):super.setGlowState(e,i)}unsetGlowState(e){return this.primary?this.primary.unsetGlowState(e):super.unsetGlowState(e)}getGlowFraction(e){return this.primary?this.primary.getGlowFraction(e):super.getGlowFraction(e)}wantsDrag(e){return!1}onHoverStart(e){var i;super.onHoverStart(e),(i=this.parent)==null||i.addHoveredEntity(this),this.twins.forEach(r=>r.addHoveredEntity(r))}onHoverEnd(e){var i;super.onHoverEnd(e),(i=this.parent)==null||i.removeHoveredEntity(this),this.twins.forEach(r=>r.removeHoveredEntity(r))}}Wt(vl,"colors",{default:{h:0,s:0,l:.8},hover:{h:0,s:0,l:.4},drag:{h:0,s:0,l:.2}}),Wt(vl,"opacity",.5),Wt(vl,"sideMaterials");class yl{constructor(t,e,i){Wt(this,"focusStates",[]);this.source=t,this.target=e,this.strength=i;const r=()=>this.updatePosition();(Array.isArray(this.source)?this.source:[this.source]).forEach(s=>fa.on(s,"moved",r)),fa.on(this.target,"moved",r)}build(){const t=Array.isArray(this.source)?this.source[0]:this.source,e=new Wn().setFromPoints([t.object3d.position,this.target.object3d.position]),i=new wm({color:this.constructor.color,transparent:!0,linewidth:this.strength});this.line=new Mm(e,i),this.line.entity=this,this.line.castShadow=!0,this.line.receiveShadow=!0;const r=new Nh(this.strength,2);r.rotateX(Math.PI/2);const s=new Th({transparent:!0,color:this.constructor.color});this.chevronCones=[];const a=10;for(let o=0;othis.line.worldToLocal(p.object3d.getWorldPosition(new X)).distanceTo(this.target.object3d.position)).first():this.source;let i=this.line.worldToLocal(e.object3d.getWorldPosition(new X));t.set(i,this.target.object3d.position.clone().sub(i).normalize()),i=((u=t.intersectObject(e.object3d)[0])==null?void 0:u.point)??i,e.connectionSourceAbsoluteY!=null&&(i.y=e.connectionSourceAbsoluteY);let r=this.target.object3d.position;t.set(r,i.clone().sub(r).normalize()),r=((h=t.intersectObject(this.target.object3d)[0])==null?void 0:h.point)??this.target.object3d.position,this.target.connectionTargetAbsoluteY!=null&&(r=r.clone(),r.y=this.target.connectionTargetAbsoluteY);const s=this.line.geometry;s.attributes.position.array[0]=i.x,s.attributes.position.array[1]=i.y,s.attributes.position.array[2]=i.z,s.attributes.position.array[3]=r.x,s.attributes.position.array[4]=r.y,s.attributes.position.array[5]=r.z,s.attributes.position.needsUpdate=!0;const a=r.distanceTo(i),o=Math.min(a/8,this.chevronCones.length);this.chevronCones.forEach((p,m)=>{p.visible=mt.material.opacity=this.constructor.hoverOpacity)):(this.line.material.opacity=this.constructor.opacity,this.chevronCones.forEach(t=>t.material.opacity=this.constructor.opacity))}wantsMouse(t){return!1}}Wt(yl,"color",2105376),Wt(yl,"opacity",.5),Wt(yl,"hoverOpacity",1);class AC{constructor(){Wt(this,"entities",[]);Wt(this,"length",15);Wt(this,"headIndex",0);Wt(this,"hopHeight",30);Wt(this,"divisionsPerPoint",3);Wt(this,"color",184606173);Wt(this,"useTube",!0);Wt(this,"needsUpdate",!1);Wt(this,"deferUpdates",!1)}build(t){this.traceMap=t;const e=new Wn,i=new Cr({vertexColors:!0,side:bi,transparent:!0,depthWrite:!1,uniforms:{color:{value:new Ee(this.color)},arraySize:{value:0},headPoint:{value:0},tailPoint:{value:0}},vertexShader:` + uniform float arraySize; + uniform float headPoint; + uniform float tailPoint; + varying float vAlpha; + + void main() { + // alpha: generally 0, but 1 for head, .5 for middle, 0 for tail + vAlpha = (clamp(float(gl_VertexID), tailPoint, headPoint) - tailPoint) + / (headPoint - tailPoint) + - (1.0 - step(float(gl_VertexID), headPoint)); + gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + } + `,fragmentShader:` + varying float vAlpha; + varying float vDebugP; + uniform vec3 color; + + void main() { + gl_FragColor = vec4(color, vAlpha); + } + `});return this.useTube?(this.line=new Dn(e,i),this.divisionsPerPoint*=8):this.line=new Mm(e,i),this.line.entity=this,this.line.castShadow=!1,this.line.receiveShadow=!1,this.line.renderOrder=2,this.line}setEntities(t){const e=this._listener??(this._listener=()=>this.updateEntities());this.entities.forEach(i=>fa.off(i,"moved",e)),this.entities=t,this.entities.forEach(i=>fa.on(i,"moved",e)),this.updateEntities()}updateEntities(){if(this.deferUpdates){this.needsUpdate=!0;return}const t=this.entities.map((i,r)=>{const s=i.object3d.position.clone();s.y+=i.object3d.geometry.parameters.height/2,s.y+=.5;const a=this._offsetForEntity(i,r);return s.x+=a.x,s.z+=a.z,s.entity=i,s}),e=t.flatMap((i,r)=>{const s=t[r-1];if(!s)return[i];const a=s.clone().lerp(i,.5);return i.entity!=s.entity&&(a.y=this.hopHeight),[a,i]});if(e.length<2)this.line.visible=!1;else{this.line.visible=!0;const i=new bm(e);this.useTube&&(this.line.geometry=new Ih(i,(i.points.length-1)*this.divisionsPerPoint,.2,8,!1),this.line.needsUpdate=!0),this.line.geometry.setFromPoints(i.getPoints((i.points.length-1)*this.divisionsPerPoint)),this.line.material.uniforms.arraySize.value=this.line.geometry.attributes.position.count}this.needsUpdate=!1,this.updatePosition()}updatePosition(){if(this.needsUpdate){this.updateEntities();return}const t=this.headIndex*2*this.divisionsPerPoint,e=(this.headIndex-this.length)*2*this.divisionsPerPoint;this.line.material.uniforms.headPoint.value===t&&this.line.material.uniforms.tailPoint.value===e||(this.line.material.uniforms.headPoint.value=t,this.line.material.uniforms.tailPoint.value=e,this.line.material.uniformsNeedUpdate=!0,this.traceMap.updateScene())}_offsetForEntity(t,e){var o,l;let i=(l=(o=this._offsets)==null?void 0:o.get(t))==null?void 0:l[e];if(i)return i;const{width:r,depth:s}=t.object3d.geometry.parameters;i={x:Math.max(-r/2,Math.min(r/2,_r.randomNormal(0,r/8)())),z:Math.max(-s/2,Math.min(s/2,_r.randomNormal(0,s/8)()))};let a=(this._offsets??(this._offsets=new WeakMap)).get(t);return a||(a=Array(this.entities.length),this._offsets.set(t,a)),a[e]=i,i}wantsMouse(t){return!1}}var uh="http://www.w3.org/1999/xhtml";const _p={svg:"http://www.w3.org/2000/svg",xhtml:uh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $l(n){var t=n+="",e=t.indexOf(":");return e>=0&&(t=n.slice(0,e))!=="xmlns"&&(n=n.slice(e+1)),_p.hasOwnProperty(t)?{space:_p[t],local:n}:n}function TC(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===uh&&t.documentElement.namespaceURI===uh?t.createElement(n):t.createElementNS(e,n)}}function CC(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function zm(n){var t=$l(n);return(t.local?CC:TC)(t)}function RC(){}function qh(n){return n==null?RC:function(){return this.querySelector(n)}}function PC(n){typeof n!="function"&&(n=qh(n));for(var t=this._groups,e=t.length,i=new Array(e),r=0;r=b&&(b=T+1);!(I=_[b])&&++b=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function eR(n){n||(n=nR);function t(p,m){return p&&m?n(p.__data__,m.__data__):!p-!m}for(var e=this._groups,i=e.length,r=new Array(i),s=0;st?1:n>=t?0:NaN}function iR(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function rR(){return Array.from(this)}function sR(){for(var n=this._groups,t=0,e=n.length;t1?this.each((t==null?gR:typeof t=="function"?vR:_R)(n,t,e??"")):lo(this.node(),n)}function lo(n,t){return n.style.getPropertyValue(t)||Wm(n).getComputedStyle(n,null).getPropertyValue(t)}function xR(n){return function(){delete this[n]}}function wR(n,t){return function(){this[n]=t}}function MR(n,t){return function(){var e=t.apply(this,arguments);e==null?delete this[n]:this[n]=e}}function SR(n,t){return arguments.length>1?this.each((t==null?xR:typeof t=="function"?MR:wR)(n,t)):this.node()[n]}function Xm(n){return n.trim().split(/^|\s+/)}function jh(n){return n.classList||new $m(n)}function $m(n){this._node=n,this._names=Xm(n.getAttribute("class")||"")}$m.prototype={add:function(n){var t=this._names.indexOf(n);t<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function qm(n,t){for(var e=jh(n),i=-1,r=t.length;++i=0&&(e=t.slice(i+1),t=t.slice(0,i)),{type:t,name:e}})}function ZR(n){return function(){var t=this.__on;if(t){for(var e=0,i=-1,r=t.length,s;e>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?dl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?dl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=o2.exec(n))?new Nn(t[1],t[2],t[3],1):(t=a2.exec(n))?new Nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=l2.exec(n))?dl(t[1],t[2],t[3],t[4]):(t=c2.exec(n))?dl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=u2.exec(n))?bp(t[1],t[2]/100,t[3]/100,1):(t=h2.exec(n))?bp(t[1],t[2]/100,t[3]/100,t[4]):vp.hasOwnProperty(n)?wp(vp[n]):n==="transparent"?new Nn(NaN,NaN,NaN,0):null}function wp(n){return new Nn(n>>16&255,n>>8&255,n&255,1)}function dl(n,t,e,i){return i<=0&&(n=t=e=NaN),new Nn(n,t,e,i)}function p2(n){return n instanceof _a||(n=ma(n)),n?(n=n.rgb(),new Nn(n.r,n.g,n.b,n.opacity)):new Nn}function hh(n,t,e,i){return arguments.length===1?p2(n):new Nn(n,t,e,i??1)}function Nn(n,t,e,i){this.r=+n,this.g=+t,this.b=+e,this.opacity=+i}Yh(Nn,hh,Zm(_a,{brighter(n){return n=n==null?Nl:Math.pow(Nl,n),new Nn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?da:Math.pow(da,n),new Nn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Nn(as(this.r),as(this.g),as(this.b),Il(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Mp,formatHex:Mp,formatHex8:m2,formatRgb:Sp,toString:Sp}));function Mp(){return`#${ns(this.r)}${ns(this.g)}${ns(this.b)}`}function m2(){return`#${ns(this.r)}${ns(this.g)}${ns(this.b)}${ns((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sp(){const n=Il(this.opacity);return`${n===1?"rgb(":"rgba("}${as(this.r)}, ${as(this.g)}, ${as(this.b)}${n===1?")":`, ${n})`}`}function Il(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function as(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function ns(n){return n=as(n),(n<16?"0":"")+n.toString(16)}function bp(n,t,e,i){return i<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new gi(n,t,e,i)}function Jm(n){if(n instanceof gi)return new gi(n.h,n.s,n.l,n.opacity);if(n instanceof _a||(n=ma(n)),!n)return new gi;if(n instanceof gi)return n;n=n.rgb();var t=n.r/255,e=n.g/255,i=n.b/255,r=Math.min(t,e,i),s=Math.max(t,e,i),a=NaN,o=s-r,l=(s+r)/2;return o?(t===s?a=(e-i)/o+(e0&&l<1?0:a,new gi(a,o,l,n.opacity)}function g2(n,t,e,i){return arguments.length===1?Jm(n):new gi(n,t,e,i??1)}function gi(n,t,e,i){this.h=+n,this.s=+t,this.l=+e,this.opacity=+i}Yh(gi,g2,Zm(_a,{brighter(n){return n=n==null?Nl:Math.pow(Nl,n),new gi(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?da:Math.pow(da,n),new gi(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,r=2*e-i;return new Nn(Bu(n>=240?n-240:n+120,r,i),Bu(n,r,i),Bu(n<120?n+240:n-120,r,i),this.opacity)},clamp(){return new gi(Ep(this.h),pl(this.s),pl(this.l),Il(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=Il(this.opacity);return`${n===1?"hsl(":"hsla("}${Ep(this.h)}, ${pl(this.s)*100}%, ${pl(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Ep(n){return n=(n||0)%360,n<0?n+360:n}function pl(n){return Math.max(0,Math.min(1,n||0))}function Bu(n,t,e){return(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)*255}const Qm=n=>()=>n;function _2(n,t){return function(e){return n+e*t}}function v2(n,t,e){return n=Math.pow(n,e),t=Math.pow(t,e)-n,e=1/e,function(i){return Math.pow(n+i*t,e)}}function y2(n){return(n=+n)==1?tg:function(t,e){return e-t?v2(t,e,n):Qm(isNaN(t)?e:t)}}function tg(n,t){var e=t-n;return e?_2(n,e):Qm(isNaN(n)?t:n)}const Ap=function n(t){var e=y2(t);function i(r,s){var a=e((r=hh(r)).r,(s=hh(s)).r),o=e(r.g,s.g),l=e(r.b,s.b),u=tg(r.opacity,s.opacity);return function(h){return r.r=a(h),r.g=o(h),r.b=l(h),r.opacity=u(h),r+""}}return i.gamma=n,i}(1);function vr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}var fh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zu=new RegExp(fh.source,"g");function x2(n){return function(){return n}}function w2(n){return function(t){return n(t)+""}}function M2(n,t){var e=fh.lastIndex=zu.lastIndex=0,i,r,s,a=-1,o=[],l=[];for(n=n+"",t=t+"";(i=fh.exec(n))&&(r=zu.exec(t));)(s=r.index)>e&&(s=t.slice(e,s),o[a]?o[a]+=s:o[++a]=s),(i=i[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:vr(i,r)})),e=zu.lastIndex;return e180?h+=360:h-u>180&&(u+=360),m.push({i:p.push(r(p)+"rotate(",null,i)-2,x:vr(u,h)})):h&&p.push(r(p)+"rotate("+h+i)}function o(u,h,p,m){u!==h?m.push({i:p.push(r(p)+"skewX(",null,i)-2,x:vr(u,h)}):h&&p.push(r(p)+"skewX("+h+i)}function l(u,h,p,m,g,w){if(u!==p||h!==m){var M=g.push(r(g)+"scale(",null,",",null,")");w.push({i:M-4,x:vr(u,p)},{i:M-2,x:vr(h,m)})}else(p!==1||m!==1)&&g.push(r(g)+"scale("+p+","+m+")")}return function(u,h){var p=[],m=[];return u=n(u),h=n(h),s(u.translateX,u.translateY,h.translateX,h.translateY,p,m),a(u.rotate,h.rotate,p,m),o(u.skewX,h.skewX,p,m),l(u.scaleX,u.scaleY,h.scaleX,h.scaleY,p,m),u=h=null,function(g){for(var w=-1,M=m.length,_;++wig)throw new Error("too late; already scheduled");return e}function Ri(n,t){var e=_i(n,t);if(e.state>xl)throw new Error("too late; already running");return e}function _i(n,t){var e=n.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function R2(n,t,e){var i=n.__transition,r;i[t]=e,e.timer=Gh(s,0,e.time);function s(u){e.state=Cp,e.timer.restart(a,e.delay,e.time),e.delay<=u&&a(u-e.delay)}function a(u){var h,p,m,g;if(e.state!==Cp)return l();for(h in i)if(g=i[h],g.name===e.name){if(g.state===xl)return dp(a);g.state===Rp?(g.state=wl,g.timer.stop(),g.on.call("interrupt",n,n.__data__,g.index,g.group),delete i[h]):+hph&&i.state=0&&(t=t.slice(0,e)),!t||t==="start"})}function oP(n,t,e){var i,r,s=sP(t)?Kh:Ri;return function(){var a=s(this,n),o=a.on;o!==i&&(r=(i=o).copy()).on(t,e),a.on=r}}function aP(n,t){var e=this._id;return arguments.length<2?_i(this.node(),e).on.on(n):this.each(oP(e,n,t))}function lP(n){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==n)return;t&&t.removeChild(this)}}function cP(){return this.on("end.remove",lP(this._id))}function uP(n){var t=this._name,e=this._id;typeof n!="function"&&(n=qh(n));for(var i=this._groups,r=i.length,s=new Array(r),a=0;a{var e={};e.d=(c,f)=>{for(var y in f)e.o(f,y)&&!e.o(c,y)&&Object.defineProperty(c,y,{enumerable:!0,get:f[y]})},e.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f);var i={};e.d(i,{default:()=>b0});function r(){}function s(c){return c==null?r:function(){return this.querySelector(c)}}function a(c){typeof c!="function"&&(c=s(c));for(var f=this._groups,y=f.length,S=new Array(y),A=0;A=vn&&(vn=_n+1);!(ze=sn[vn])&&++vn=0;)(D=S[A])&&(U&&D.compareDocumentPosition(U)^4&&U.parentNode.insertBefore(D,U),U=D);return this}function St(c){c||(c=st);function f(yt,Rt){return yt&&Rt?c(yt.__data__,Rt.__data__):!yt-!Rt}for(var y=this._groups,S=y.length,A=new Array(S),U=0;Uf?1:c>=f?0:NaN}function mt(){var c=arguments[0];return arguments[0]=this,c.apply(null,arguments),this}function It(){return Array.from(this)}function Ot(){for(var c=this._groups,f=0,y=c.length;f=0&&(f=c.slice(0,y))!=="xmlns"&&(c=c.slice(y+1)),pe.hasOwnProperty(f)?{space:pe[f],local:c}:c}function he(c){return function(){this.removeAttribute(c)}}function tt(c){return function(){this.removeAttributeNS(c.space,c.local)}}function Oe(c,f){return function(){this.setAttribute(c,f)}}function Zt(c,f){return function(){this.setAttributeNS(c.space,c.local,f)}}function oe(c,f){return function(){var y=f.apply(this,arguments);y==null?this.removeAttribute(c):this.setAttribute(c,y)}}function ie(c,f){return function(){var y=f.apply(this,arguments);y==null?this.removeAttributeNS(c.space,c.local):this.setAttributeNS(c.space,c.local,y)}}function Te(c,f){var y=Pe(c);if(arguments.length<2){var S=this.node();return y.local?S.getAttributeNS(y.space,y.local):S.getAttribute(y)}return this.each((f==null?y.local?tt:he:typeof f=="function"?y.local?ie:oe:y.local?Zt:Oe)(y,f))}function fe(c){return c.ownerDocument&&c.ownerDocument.defaultView||c.document&&c||c.defaultView}function Pt(c){return function(){this.style.removeProperty(c)}}function Qt(c,f,y){return function(){this.style.setProperty(c,f,y)}}function we(c,f,y){return function(){var S=f.apply(this,arguments);S==null?this.style.removeProperty(c):this.style.setProperty(c,S,y)}}function Me(c,f,y){return arguments.length>1?this.each((f==null?Pt:typeof f=="function"?we:Qt)(c,f,y??"")):N(this.node(),c)}function N(c,f){return c.style.getPropertyValue(f)||fe(c).getComputedStyle(c,null).getPropertyValue(f)}function R(c){return function(){delete this[c]}}function rt(c,f){return function(){this[c]=f}}function At(c,f){return function(){var y=f.apply(this,arguments);y==null?delete this[c]:this[c]=y}}function bt(c,f){return arguments.length>1?this.each((f==null?R:typeof f=="function"?At:rt)(c,f)):this.node()[c]}function Tt(c){return c.trim().split(/^|\s+/)}function kt(c){return c.classList||new Ct(c)}function Ct(c){this._node=c,this._names=Tt(c.getAttribute("class")||"")}Ct.prototype={add:function(c){var f=this._names.indexOf(c);f<0&&(this._names.push(c),this._node.setAttribute("class",this._names.join(" ")))},remove:function(c){var f=this._names.indexOf(c);f>=0&&(this._names.splice(f,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(c){return this._names.indexOf(c)>=0}};function at(c,f){for(var y=kt(c),S=-1,A=f.length;++S=0&&(y=f.slice(S+1),f=f.slice(0,S)),{type:f,name:y}})}function ft(c){return function(){var f=this.__on;if(f){for(var y=0,S=-1,A=f.length,U;y=1e21?c.toLocaleString("en").replace(/,/g,""):c.toString(10)}function de(c,f){if((y=(c=f?c.toExponential(f-1):c.toExponential()).indexOf("e"))<0)return null;var y,S=c.slice(0,y);return[S.length>1?S[0]+S.slice(2):S,+c.slice(y+1)]}function wn(c){return c=de(Math.abs(c)),c?c[1]:NaN}function ke(c,f){return function(y,S){for(var A=y.length,U=[],D=0,G=c[0],q=0;A>0&&G>0&&(q+G+1>S&&(G=Math.max(1,S-q)),U.push(y.substring(A-=G,A+G)),!((q+=G+1)>S));)G=c[D=(D+1)%c.length];return U.reverse().join(f)}}function ei(c){return function(f){return f.replace(/[0-9]/g,function(y){return c[+y]})}}var Lr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xn(c){if(!(f=Lr.exec(c)))throw new Error("invalid format: "+c);var f;return new Rn({fill:f[1],align:f[2],sign:f[3],symbol:f[4],zero:f[5],width:f[6],comma:f[7],precision:f[8]&&f[8].slice(1),trim:f[9],type:f[10]})}Xn.prototype=Rn.prototype;function Rn(c){this.fill=c.fill===void 0?" ":c.fill+"",this.align=c.align===void 0?">":c.align+"",this.sign=c.sign===void 0?"-":c.sign+"",this.symbol=c.symbol===void 0?"":c.symbol+"",this.zero=!!c.zero,this.width=c.width===void 0?void 0:+c.width,this.comma=!!c.comma,this.precision=c.precision===void 0?void 0:+c.precision,this.trim=!!c.trim,this.type=c.type===void 0?"":c.type+""}Rn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function We(c){t:for(var f=c.length,y=1,S=-1,A;y0&&(S=0);break}return S>0?c.slice(0,S)+c.slice(A+1):c}var gn;function ir(c,f){var y=de(c,f);if(!y)return c+"";var S=y[0],A=y[1],U=A-(gn=Math.max(-8,Math.min(8,Math.floor(A/3)))*3)+1,D=S.length;return U===D?S:U>D?S+new Array(U-D+1).join("0"):U>0?S.slice(0,U)+"."+S.slice(U):"0."+new Array(1-U).join("0")+de(c,Math.max(0,f+U-1))[0]}function je(c,f){var y=de(c,f);if(!y)return c+"";var S=y[0],A=y[1];return A<0?"0."+new Array(-A).join("0")+S:S.length>A+1?S.slice(0,A+1)+"."+S.slice(A+1):S+new Array(A-S.length+2).join("0")}const $n={"%":(c,f)=>(c*100).toFixed(f),b:c=>Math.round(c).toString(2),c:c=>c+"",d:Ge,e:(c,f)=>c.toExponential(f),f:(c,f)=>c.toFixed(f),g:(c,f)=>c.toPrecision(f),o:c=>Math.round(c).toString(8),p:(c,f)=>je(c*100,f),r:je,s:ir,X:c=>Math.round(c).toString(16).toUpperCase(),x:c=>Math.round(c).toString(16)};function Pi(c){return c}var On=Array.prototype.map,Dr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nr(c){var f=c.grouping===void 0||c.thousands===void 0?Pi:ke(On.call(c.grouping,Number),c.thousands+""),y=c.currency===void 0?"":c.currency[0]+"",S=c.currency===void 0?"":c.currency[1]+"",A=c.decimal===void 0?".":c.decimal+"",U=c.numerals===void 0?Pi:ei(On.call(c.numerals,String)),D=c.percent===void 0?"%":c.percent+"",G=c.minus===void 0?"−":c.minus+"",q=c.nan===void 0?"NaN":c.nan+"";function J(yt){yt=Xn(yt);var Rt=yt.fill,qt=yt.align,Se=yt.sign,Be=yt.symbol,sn=yt.zero,oi=yt.width,_n=yt.comma,vn=yt.precision,xi=yt.trim,ze=yt.type;ze==="n"?(_n=!0,ze="g"):$n[ze]||(vn===void 0&&(vn=12),xi=!0,ze="g"),(sn||Rt==="0"&&qt==="=")&&(sn=!0,Rt="0",qt="=");var ur=Be==="$"?y:Be==="#"&&/[boxX]/.test(ze)?"0"+ze.toLowerCase():"",wi=Be==="$"?S:/[%p]/.test(ze)?D:"",Ps=$n[ze],ko=/[defgprs%]/.test(ze);vn=vn===void 0?6:/[gprs]/.test(ze)?Math.max(1,Math.min(21,vn)):Math.max(0,Math.min(20,vn));function Xr(be){var Yn=ur,Pn=wi,Ln,za,Oi;if(ze==="c")Pn=Ps(be)+Pn,be="";else{be=+be;var Fi=be<0||1/be<0;if(be=isNaN(be)?q:Ps(Math.abs(be),vn),xi&&(be=We(be)),Fi&&+be==0&&Se!=="+"&&(Fi=!1),Yn=(Fi?Se==="("?Se:G:Se==="-"||Se==="("?"":Se)+Yn,Pn=(ze==="s"?Dr[8+gn/3]:"")+Pn+(Fi&&Se==="("?")":""),ko){for(Ln=-1,za=be.length;++LnOi||Oi>57){Pn=(Oi===46?A+be.slice(Ln+1):be.slice(Ln))+Pn,be=be.slice(0,Ln);break}}}_n&&!sn&&(be=f(be,1/0));var $r=Yn.length+be.length+Pn.length,ai=$r>1)+Yn+be+Pn+ai.slice($r);break;default:be=ai+Yn+be+Pn;break}return U(be)}return Xr.toString=function(){return yt+""},Xr}function ut(yt,Rt){var qt=J((yt=Xn(yt),yt.type="f",yt)),Se=Math.max(-8,Math.min(8,Math.floor(wn(Rt)/3)))*3,Be=Math.pow(10,-Se),sn=Dr[8+Se/3];return function(oi){return qt(Be*oi)+sn}}return{format:J,formatPrefix:ut}}var Ir,rr,va;ps({thousands:",",grouping:[3],currency:["$",""]});function ps(c){return Ir=Nr(c),rr=Ir.format,va=Ir.formatPrefix,Ir}function Ur(c,f){return c==null||f==null?NaN:cf?1:c>=f?0:NaN}function jl(c){c.x0=Math.round(c.x0),c.y0=Math.round(c.y0),c.x1=Math.round(c.x1),c.y1=Math.round(c.y1)}function ya(c,f,y,S,A){for(var U=c.children,D,G=-1,q=U.length,J=c.value&&(S-f)/c.value;++G=0;)f+=y[S].value;c.value=f}function vo(){return this.eachAfter(Kl)}function xa(c,f){let y=-1;for(const S of this)c.call(f,S,++y,this);return this}function Zl(c,f){for(var y=this,S=[y],A,U,D=-1;y=S.pop();)if(c.call(f,y,++D,this),A=y.children)for(U=A.length-1;U>=0;--U)S.push(A[U]);return this}function Jl(c,f){for(var y=this,S=[y],A=[],U,D,G,q=-1;y=S.pop();)if(A.push(y),U=y.children)for(D=0,G=U.length;D=0;)y+=S[A].value;f.value=y})}function yo(c){return this.eachBefore(function(f){f.children&&f.children.sort(c)})}function ms(c){for(var f=this,y=Sa(f,c),S=[f];f!==y;)f=f.parent,S.push(f);for(var A=S.length;c!==y;)S.splice(A,0,c),c=c.parent;return S}function Sa(c,f){if(c===f)return c;var y=c.ancestors(),S=f.ancestors(),A=null;for(c=y.pop(),f=S.pop();c===f;)A=c,c=y.pop(),f=S.pop();return A}function xo(){for(var c=this,f=[c];c=c.parent;)f.push(c);return f}function gs(){return Array.from(this)}function _s(){var c=[];return this.eachBefore(function(f){f.children||c.push(f)}),c}function wo(){var c=this,f=[];return c.each(function(y){y!==c&&f.push({source:y.parent,target:y})}),f}function*qn(){var c=this,f,y=[c],S,A,U;do for(f=y.reverse(),y=[];c=f.pop();)if(yield c,S=c.children)for(A=0,U=S.length;A=0;--G)A.push(U=D[G]=new sr(D[G])),U.parent=S,U.depth=S.depth+1;return y.eachBefore(ba)}function Ql(){return Mn(this).eachBefore(vi)}function tc(c){return c.children}function ec(c){return Array.isArray(c)?c[1]:null}function vi(c){c.data.value!==void 0&&(c.value=c.data.value),c.data=c.data.data}function ba(c){var f=0;do c.height=f;while((c=c.parent)&&c.height<++f)}function sr(c){this.data=c,this.depth=this.height=0,this.parent=null}sr.prototype=Mn.prototype={constructor:sr,count:vo,each:xa,eachAfter:Jl,eachBefore:Zl,find:wa,sum:Ma,sort:yo,path:ms,ancestors:xo,descendants:gs,leaves:_s,links:wo,copy:Ql,[Symbol.iterator]:qn};var vs=Math.sqrt(50),or=Math.sqrt(10),Mo=Math.sqrt(2);function nc(c,f,y){var S,A=-1,U,D,G;if(f=+f,c=+c,y=+y,c===f&&y>0)return[c];if((S=f0){let q=Math.round(c/G),J=Math.round(f/G);for(q*Gf&&--J,D=new Array(U=J-q+1);++Af&&--J,D=new Array(U=J-q+1);++A=0?(U>=vs?10:U>=or?5:U>=Mo?2:1)*Math.pow(10,A):-Math.pow(10,-A)/(U>=vs?10:U>=or?5:U>=Mo?2:1)}function ic(c,f,y){var S=Math.abs(f-c)/Math.max(0,y),A=Math.pow(10,Math.floor(Math.log(S)/Math.LN10)),U=S/A;return U>=vs?A*=10:U>=or?A*=5:U>=Mo&&(A*=2),fc(G)-q,y=Ur,S=(G,q)=>Ur(c(G),q));function A(G,q,J=0,ut=G.length){if(J>>1;S(G[yt],q)<0?J=yt+1:ut=yt}while(J>>1;S(G[yt],q)<=0?J=yt+1:ut=yt}while(JJ&&f(G[yt-1],q)>-f(G[yt],q)?yt-1:yt}return{left:A,center:D,right:U}}function rc(c){return c===null?NaN:+c}const sc=Ea(Ur).right;Ea(rc).center;const bo=sc;function Or(c,f,y){c.prototype=f.prototype=y,y.constructor=c}function Eo(c,f){var y=Object.create(c.prototype);for(var S in f)y[S]=f[S];return y}function ni(){}var ii=.7,Li=1/ii,Fn="\\s*([+-]?\\d+)\\s*",ri="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ye="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oc=/^#([0-9a-f]{3,8})$/,ac=new RegExp("^rgb\\("+[Fn,Fn,Fn]+"\\)$"),lc=new RegExp("^rgb\\("+[Ye,Ye,Ye]+"\\)$"),cc=new RegExp("^rgba\\("+[Fn,Fn,Fn,ri]+"\\)$"),uc=new RegExp("^rgba\\("+[Ye,Ye,Ye,ri]+"\\)$"),hc=new RegExp("^hsl\\("+[ri,Ye,Ye]+"\\)$"),fc=new RegExp("^hsla\\("+[ri,Ye,Ye,ri]+"\\)$"),Ao={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};Or(ni,Bn,{copy:function(c){return Object.assign(new this.constructor,this,c)},displayable:function(){return this.rgb().displayable()},hex:To,formatHex:To,formatHsl:dc,formatRgb:Co,toString:Co});function To(){return this.rgb().formatHex()}function dc(){return No(this).formatHsl()}function Co(){return this.rgb().formatRgb()}function Bn(c){var f,y;return c=(c+"").trim().toLowerCase(),(f=oc.exec(c))?(y=f[1].length,f=parseInt(f[1],16),y===6?Ro(f):y===3?new Ue(f>>8&15|f>>4&240,f>>4&15|f&240,(f&15)<<4|f&15,1):y===8?Di(f>>24&255,f>>16&255,f>>8&255,(f&255)/255):y===4?Di(f>>12&15|f>>8&240,f>>8&15|f>>4&240,f>>4&15|f&240,((f&15)<<4|f&15)/255):null):(f=ac.exec(c))?new Ue(f[1],f[2],f[3],1):(f=lc.exec(c))?new Ue(f[1]*255/100,f[2]*255/100,f[3]*255/100,1):(f=cc.exec(c))?Di(f[1],f[2],f[3],f[4]):(f=uc.exec(c))?Di(f[1]*255/100,f[2]*255/100,f[3]*255/100,f[4]):(f=hc.exec(c))?Do(f[1],f[2]/100,f[3]/100,1):(f=fc.exec(c))?Do(f[1],f[2]/100,f[3]/100,f[4]):Ao.hasOwnProperty(c)?Ro(Ao[c]):c==="transparent"?new Ue(NaN,NaN,NaN,0):null}function Ro(c){return new Ue(c>>16&255,c>>8&255,c&255,1)}function Di(c,f,y,S){return S<=0&&(c=f=y=NaN),new Ue(c,f,y,S)}function pc(c){return c instanceof ni||(c=Bn(c)),c?(c=c.rgb(),new Ue(c.r,c.g,c.b,c.opacity)):new Ue}function Fr(c,f,y,S){return arguments.length===1?pc(c):new Ue(c,f,y,S??1)}function Ue(c,f,y,S){this.r=+c,this.g=+f,this.b=+y,this.opacity=+S}Or(Ue,Fr,Eo(ni,{brighter:function(c){return c=c==null?Li:Math.pow(Li,c),new Ue(this.r*c,this.g*c,this.b*c,this.opacity)},darker:function(c){return c=c==null?ii:Math.pow(ii,c),new Ue(this.r*c,this.g*c,this.b*c,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Po,formatHex:Po,formatRgb:Lo,toString:Lo}));function Po(){return"#"+Br(this.r)+Br(this.g)+Br(this.b)}function Lo(){var c=this.opacity;return c=isNaN(c)?1:Math.max(0,Math.min(1,c)),(c===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(c===1?")":", "+c+")")}function Br(c){return c=Math.max(0,Math.min(255,Math.round(c)||0)),(c<16?"0":"")+c.toString(16)}function Do(c,f,y,S){return S<=0?c=f=y=NaN:y<=0||y>=1?c=f=NaN:f<=0&&(c=NaN),new Ke(c,f,y,S)}function No(c){if(c instanceof Ke)return new Ke(c.h,c.s,c.l,c.opacity);if(c instanceof ni||(c=Bn(c)),!c)return new Ke;if(c instanceof Ke)return c;c=c.rgb();var f=c.r/255,y=c.g/255,S=c.b/255,A=Math.min(f,y,S),U=Math.max(f,y,S),D=NaN,G=U-A,q=(U+A)/2;return G?(f===U?D=(y-S)/G+(y0&&q<1?0:D,new Ke(D,G,q,c.opacity)}function mc(c,f,y,S){return arguments.length===1?No(c):new Ke(c,f,y,S??1)}function Ke(c,f,y,S){this.h=+c,this.s=+f,this.l=+y,this.opacity=+S}Or(Ke,mc,Eo(ni,{brighter:function(c){return c=c==null?Li:Math.pow(Li,c),new Ke(this.h,this.s,this.l*c,this.opacity)},darker:function(c){return c=c==null?ii:Math.pow(ii,c),new Ke(this.h,this.s,this.l*c,this.opacity)},rgb:function(){var c=this.h%360+(this.h<0)*360,f=isNaN(c)||isNaN(this.s)?0:this.s,y=this.l,S=y+(y<.5?y:1-y)*f,A=2*y-S;return new Ue(zr(c>=240?c-240:c+120,A,S),zr(c,A,S),zr(c<120?c+240:c-120,A,S),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var c=this.opacity;return c=isNaN(c)?1:Math.max(0,Math.min(1,c)),(c===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(c===1?")":", "+c+")")}}));function zr(c,f,y){return(c<60?f+(y-f)*c/60:c<180?y:c<240?f+(y-f)*(240-c)/60:f)*255}const ys=c=>()=>c;function gc(c,f){return function(y){return c+y*f}}function _c(c,f,y){return c=Math.pow(c,y),f=Math.pow(f,y)-c,y=1/y,function(S){return Math.pow(c+S*f,y)}}function vc(c){return(c=+c)==1?Io:function(f,y){return y-f?_c(f,y,c):ys(isNaN(f)?y:f)}}function Io(c,f){var y=f-c;return y?gc(c,y):ys(isNaN(c)?f:c)}const Hr=function c(f){var y=vc(f);function S(A,U){var D=y((A=Fr(A)).r,(U=Fr(U)).r),G=y(A.g,U.g),q=y(A.b,U.b),J=Io(A.opacity,U.opacity);return function(ut){return A.r=D(ut),A.g=G(ut),A.b=q(ut),A.opacity=J(ut),A+""}}return S.gamma=c,S}(1);function Uo(c,f){var y=f?f.length:0,S=c?Math.min(y,c.length):0,A=new Array(S),U=new Array(y),D;for(D=0;Dy&&(U=f.slice(y,U),G[D]?G[D]+=U:G[++D]=U),(S=S[0])===(A=A[0])?G[D]?G[D]+=A:G[++D]=A:(G[++D]=null,q.push({i:D,x:zn(S,A)})),y=xs.lastIndex;return yf&&(y=c,c=f,f=y),function(S){return Math.max(c,Math.min(f,S))}}function Cc(c,f,y){var S=c[0],A=c[1],U=f[0],D=f[1];return A2?Rc:Cc,q=J=null,yt}function yt(Rt){return Rt==null||isNaN(Rt=+Rt)?U:(q||(q=G(c.map(S),f,y)))(S(D(Rt)))}return yt.invert=function(Rt){return D(A((J||(J=G(f,c.map(S),zn)))(Rt)))},yt.domain=function(Rt){return arguments.length?(c=Array.from(Rt,Ac),ut()):c.slice()},yt.range=function(Rt){return arguments.length?(f=Array.from(Rt),ut()):f.slice()},yt.rangeRound=function(Rt){return f=Array.from(Rt),y=bc,ut()},yt.clamp=function(Rt){return arguments.length?(D=Rt?!0:ar,ut()):D!==ar},yt.interpolate=function(Rt){return arguments.length?(y=Rt,ut()):y},yt.unknown=function(Rt){return arguments.length?(U=Rt,yt):U},function(Rt,qt){return S=Rt,A=qt,ut()}}function Dc(){return Lc()(ar,ar)}function Nc(c,f){switch(arguments.length){case 0:break;case 1:this.range(c);break;default:this.range(f).domain(c);break}return this}function Ic(c,f){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(wn(f)/3)))*3-wn(Math.abs(c)))}function Uc(c,f){return c=Math.abs(c),f=Math.abs(f)-c,Math.max(0,wn(f)-wn(c))+1}function Oc(c){return Math.max(0,-wn(Math.abs(c)))}function Fc(c,f,y,S){var A=ic(c,f,y),U;switch(S=Xn(S??",f"),S.type){case"s":{var D=Math.max(Math.abs(c),Math.abs(f));return S.precision==null&&!isNaN(U=Ic(A,D))&&(S.precision=U),va(S,D)}case"":case"e":case"g":case"p":case"r":{S.precision==null&&!isNaN(U=Uc(A,Math.max(Math.abs(c),Math.abs(f))))&&(S.precision=U-(S.type==="e"));break}case"f":case"%":{S.precision==null&&!isNaN(U=Oc(A))&&(S.precision=U-(S.type==="%")*2);break}}return rr(S)}function Bc(c){var f=c.domain;return c.ticks=function(y){var S=f();return nc(S[0],S[S.length-1],y??10)},c.tickFormat=function(y,S){var A=f();return Fc(A[0],A[A.length-1],y??10,S)},c.nice=function(y){y==null&&(y=10);var S=f(),A=0,U=S.length-1,D=S[A],G=S[U],q,J,ut=10;for(G0;){if(J=So(D,G,y),J===q)return S[A]=D,S[U]=G,f(S);if(J>0)D=Math.floor(D/J)*J,G=Math.ceil(G/J)*J;else if(J<0)D=Math.ceil(D*J)/J,G=Math.floor(G*J)/J;else break;q=J}return c},c}function Ho(){var c=Dc();return c.copy=function(){return Pc(c,Ho())},Nc.apply(c,arguments),Bc(c)}function Ca(c){return((c*=2)<=1?c*c*c:(c-=2)*c*c+2)/2}var zc={value:()=>{}};function Ra(){for(var c=0,f=arguments.length,y={},S;c=0&&(S=y.slice(A+1),y=y.slice(0,A)),y&&!f.hasOwnProperty(y))throw new Error("unknown type: "+y);return{type:y,name:S}})}ws.prototype=Ra.prototype={constructor:ws,on:function(c,f){var y=this._,S=Hc(c+"",y),A,U=-1,D=S.length;if(arguments.length<2){for(;++U0)for(var y=new Array(A),S=0,A,U;S=0&&c._call.call(void 0,f),c=c._next;--lr}function Ia(){Ni=(Ss=Vr.now())+bs,lr=cr=0;try{Wc()}finally{lr=0,si(),Ni=0}}function Xc(){var c=Vr.now(),f=c-Ss;f>La&&(bs-=f,Ss=c)}function si(){for(var c,f=Ms,y,S=1/0;f;)f._call?(S>f._time&&(S=f._time),c=f,f=f._next):(y=f._next,f._next=null,f=c?c._next=y:Ms=y);kr=c,As(S)}function As(c){if(!lr){cr&&(cr=clearTimeout(cr));var f=c-Ni;f>24?(c<1/0&&(cr=setTimeout(Ia,c-Vr.now()-bs)),Gr&&(Gr=clearInterval(Gr))):(Gr||(Ss=Vr.now(),Gr=setInterval(Xc,La)),lr=1,Da(Ia))}}function jn(c,f,y){var S=new Es;return f=f==null?0:+f,S.restart(A=>{S.stop(),c(A+f)},f,y),S}var $c=kc("start","end","cancel","interrupt"),qc=[],Ua=0,Oa=1,Ts=2,Cs=3,d=4,x=5,E=6;function L(c,f,y,S,A,U){var D=c.__transition;if(!D)c.__transition={};else if(y in D)return;ot(c,y,{name:f,index:S,group:A,on:$c,tween:qc,time:U.time,delay:U.delay,duration:U.duration,ease:U.ease,timer:null,state:Ua})}function z(c,f){var y=j(c,f);if(y.state>Ua)throw new Error("too late; already scheduled");return y}function V(c,f){var y=j(c,f);if(y.state>Cs)throw new Error("too late; already running");return y}function j(c,f){var y=c.__transition;if(!y||!(y=y[f]))throw new Error("transition not found");return y}function ot(c,f,y){var S=c.__transition,A;S[f]=y,y.timer=Na(U,0,y.time);function U(J){y.state=Oa,y.timer.restart(D,y.delay,y.time),y.delay<=J&&D(J-y.delay)}function D(J){var ut,yt,Rt,qt;if(y.state!==Oa)return q();for(ut in S)if(qt=S[ut],qt.name===y.name){if(qt.state===Cs)return jn(D);qt.state===d?(qt.state=E,qt.timer.stop(),qt.on.call("interrupt",c,c.__data__,qt.index,qt.group),delete S[ut]):+utTs&&S.state180?ut+=360:ut-J>180&&(J+=360),Rt.push({i:yt.push(A(yt)+"rotate(",null,S)-2,x:zn(J,ut)})):ut&&yt.push(A(yt)+"rotate("+ut+S)}function G(J,ut,yt,Rt){J!==ut?Rt.push({i:yt.push(A(yt)+"skewX(",null,S)-2,x:zn(J,ut)}):ut&&yt.push(A(yt)+"skewX("+ut+S)}function q(J,ut,yt,Rt,qt,Se){if(J!==yt||ut!==Rt){var Be=qt.push(A(qt)+"scale(",null,",",null,")");Se.push({i:Be-4,x:zn(J,yt)},{i:Be-2,x:zn(ut,Rt)})}else(yt!==1||Rt!==1)&&qt.push(A(qt)+"scale("+yt+","+Rt+")")}return function(J,ut){var yt=[],Rt=[];return J=c(J),ut=c(ut),U(J.translateX,J.translateY,ut.translateX,ut.translateY,yt,Rt),D(J.rotate,ut.rotate,yt,Rt),G(J.skewX,ut.skewX,yt,Rt),q(J.scaleX,J.scaleY,ut.scaleX,ut.scaleY,yt,Rt),J=ut=null,function(qt){for(var Se=-1,Be=Rt.length,sn;++Se=0&&(f=f.slice(0,y)),!f||f==="start"})}function qg(c,f,y){var S,A,U=$g(f)?z:V;return function(){var D=U(this,c),G=D.on;G!==S&&(A=(S=G).copy()).on(f,y),D.on=A}}function jg(c,f){var y=this._id;return arguments.length<2?j(this.node(),y).on.on(c):this.each(qg(y,c,f))}function Yg(c){return function(){var f=this.parentNode;for(var y in this.__transition)if(+y!==c)return;f&&f.removeChild(this)}}function Kg(){return this.on("end.remove",Yg(this._id))}function Zg(c){var f=this._name,y=this._id;typeof c!="function"&&(c=s(c));for(var S=this._groups,A=S.length,U=new Array(A),D=0;D6);D++)y+=A*(c.charCodeAt(D)%U),S+=A*(U-1),A*=.7;S>0&&(y=y/S)}return y}function M0(c){let f=0;if(c){const y=c.split("`");y.length>1&&(c=y[y.length-1]),c=c.split("(")[0],f=w0(c)}return f}function S0(c,f){let y,S,A;return c==="red"?(y=200+Math.round(55*f),S=50+Math.round(80*f),A=S):c==="orange"?(y=190+Math.round(65*f),S=90+Math.round(65*f),A=0):c==="yellow"?(y=175+Math.round(55*f),S=y,A=50+Math.round(20*f)):c==="green"?(y=50+Math.round(60*f),S=200+Math.round(55*f),A=y):c==="pastelgreen"?(y=163+Math.round(75*f),S=195+Math.round(49*f),A=72+Math.round(149*f)):c==="blue"?(y=91+Math.round(126*f),S=156+Math.round(76*f),A=221+Math.round(26*f)):c==="aqua"?(y=50+Math.round(60*f),S=165+Math.round(55*f),A=S):c==="cold"?(y=0+Math.round(55*(1-f)),S=0+Math.round(230*(1-f)),A=200+Math.round(55*f)):(y=200+Math.round(55*f),S=0+Math.round(230*(1-f)),A=0+Math.round(55*(1-f))),"rgb("+y+","+S+","+A+")"}function b0(){let c=960,f=null,y=18,S=null,A=null,U="",D=750,G=Ca,q=!1,J=!1,ut=null,yt=null,Rt=0,qt=null,Se=null,Be=!1,sn=!1,oi=!1,_n=null,vn=!1,xi=null,ze=function(Z){return Z.data.n||Z.data.name},ur=function(Z){return"v"in Z?Z.v:Z.value},wi=function(Z){return Z.c||Z.children},Ps=function(Z){return Z.data.l||Z.data.libtype},ko=function(Z){return"d"in Z.data?Z.data.d:Z.data.delta},Xr=function(Z,Vt,zt){Se=()=>{qt&&(qt.textContent="search: "+Vt+" of "+zt+" total samples ( "+rr(".3f")(100*(Vt/zt),3)+"%)")},Se()};const be=Xr;let Yn=(Z,Vt,zt=!1)=>{if(!Vt)return!1;let ue=ze(Z);zt&&(Vt=Vt.toLowerCase(),ue=ue.toLowerCase());const xe=new RegExp(Vt);return typeof ue<"u"&&ue&&ue.match(xe)};const Pn=Yn;let Ln=function(Z){qt&&(Z?qt.textContent=Z:typeof Se=="function"?Se():qt.textContent="")};const za=Ln;let Oi=function(Z){return ze(Z)+" ("+rr(".3f")(100*(Z.x1-Z.x0),3)+"%, "+ur(Z)+" samples)"},Fi=function(Z){return Z.highlight?"#E600E6":ai(ze(Z),Ps(Z))};const $r=Fi;function ai(Z,Vt){let zt=xi||"warm";!xi&&!(typeof Vt>"u"||Vt==="")&&(zt="red",typeof Z<"u"&&Z&&Z.match(/::/)&&(zt="yellow"),Vt==="kernel"?zt="orange":Vt==="jit"?zt="green":Vt==="inlined"&&(zt="aqua"));const ue=M0(Z);return S0(zt,ue)}function af(Z){Z.data.fade=!1,Z.data.hide=!1,Z.children&&Z.children.forEach(af)}function E0(Z){let Vt=Z,zt=Vt.parent,ue,xe,Ce;for(;zt;){for(ue=zt.children,xe=ue.length;xe--;)Ce=ue[xe],Ce!==Vt&&(Ce.data.hide=!0);Vt=zt,zt=Vt.parent}}function lf(Z){Z.parent&&(Z.parent.data.fade=!0,lf(Z.parent))}function Kc(Z){if(A&&A.hide(),E0(Z),af(Z),lf(Z),Ls(),oi){const Vt=mn(this).select("svg")._groups[0][0].parentNode.offsetTop,zt=(window.innerHeight-Vt)/y,ue=(Z.height-zt+10)*y;window.scrollTo({top:Vt+ue,left:0,behavior:"smooth"})}typeof ut=="function"&&ut(Z)}function A0(Z,Vt){const zt=[];let ue=0;function xe(Ce,on){let He=!1;Yn(Ce,Vt)?(Ce.highlight=!0,He=!0,on||(ue+=ur(Ce)),zt.push(Ce)):Ce.highlight=!1,wi(Ce)&&wi(Ce).forEach(function(Bi){xe(Bi,on||He)})}return xe(Z,!1),[zt,ue]}function cf(Z,Vt){if(Z.id===Vt)return Z;{const zt=wi(Z);if(zt)for(let ue=0;ue0){const zt=c/(Z.x1-Z.x0);Vt=Vt.filter(function(ue){return(ue.x1-ue.x0)*zt>Rt})}return Vt}function Ls(){S.each(function(Z){const Vt=Ho().range([0,c]),zt=Ho().range([0,y]);ff(Z),q&&Z.sort(T0),C0(Z);const ue=c/(Z.x1-Z.x0);function xe(Re){return(Re.x1-Re.x0)*ue}const Ce=R0(Z),on=mn(this).select("svg");on.attr("width",c);let He=on.selectAll("g").data(Ce,function(Re){return Re.id});(!f||sn)&&(f=(Math.max.apply(null,Ce.map(function(li){return li.depth}))+3)*y,f<_n&&(f=_n),on.attr("height",f)),He.transition().duration(D).ease(G).attr("transform",function(Re){return"translate("+Vt(Re.x0)+","+(J?zt(Re.depth):f-zt(Re.depth)-y)+")"}),He.select("rect").transition().duration(D).ease(G).attr("width",xe);const Bi=He.enter().append("svg:g").attr("transform",function(Re){return"translate("+Vt(Re.x0)+","+(J?zt(Re.depth):f-zt(Re.depth)-y)+")"});Bi.append("svg:rect").transition().delay(D/2).attr("width",xe),A||Bi.append("svg:title"),Bi.append("foreignObject").append("xhtml:div"),He=on.selectAll("g").data(Ce,function(Re){return Re.id}),He.attr("width",xe).attr("height",function(Re){return y}).attr("name",function(Re){return ze(Re)}).attr("class",function(Re){return Re.data.fade?"frame fade":"frame"}),He.select("rect").attr("height",function(Re){return y}).attr("fill",function(Re){return Fi(Re)}),A||He.select("title").text(Oi),He.select("foreignObject").attr("width",xe).attr("height",function(Re){return y}).select("div").attr("class","d3-flame-graph-label").style("display",function(Re){return xe(Re)<35?"none":"block"}).transition().delay(D).text(ze),He.on("click",(Re,li)=>{Kc(li)}),He.exit().remove(),He.on("mouseover",function(Re,li){A&&A.show(li,this),Ln(Oi(li)),typeof yt=="function"&&yt(li)}).on("mouseout",function(){A&&A.hide(),Ln(null)})})}function hf(Z,Vt){Vt.forEach(function(zt){const ue=Z.find(function(xe){return xe.name===zt.name});ue?(ue.value+=zt.value,zt.children&&(ue.children||(ue.children=[]),hf(ue.children,zt.children))):Z.push(zt)})}function P0(Z,Vt){Vt(Z);let zt=Z.children;if(zt){const ue=[zt];let xe,Ce,on;for(;ue.length;)for(zt=ue.pop(),xe=zt.length;xe--;)Ce=zt[xe],Vt(Ce),on=Ce.children,on&&ue.push(on)}}function L0(Z){let Vt=0;P0(Z,function(zt){zt.id=Vt++})}function ff(Z){let Vt,zt,ue,xe,Ce,on,He,Bi;const Re=[],li=[],Vo=[],D0=!Be;let qr=Z.data;for(qr.hide?(Z.value=0,zt=Z.children,zt&&Vo.push(zt)):(Z.value=qr.fade?0:ur(qr),Re.push(Z));Vt=Re.pop();)if(zt=Vt.children,zt&&(Ce=zt.length)){for(xe=0;Ce--;){if(He=zt[Ce],qr=He.data,qr.hide){He.value=0,ue=He.children,ue&&Vo.push(ue);continue}qr.fade?He.value=0:(Bi=ur(qr),He.value=Bi,xe+=Bi),Re.push(He)}D0&&Vt.value&&(Vt.value-=xe),li.push(zt)}for(Ce=li.length;Ce--;){for(zt=li[Ce],xe=0,on=zt.length;on--;)xe+=zt[on].value;zt[0].parent.value+=xe}for(;Vo.length;)for(zt=Vo.pop(),on=zt.length;on--;)He=zt[on],He.value=0,ue=He.children,ue&&Vo.push(ue)}function Zc(){S.datum(Z=>{if(Z.constructor.name!=="Node"){const Vt=Mn(Z,wi);return L0(Vt),ff(Vt),Vt.originalValue=Vt.value,vn&&Vt.eachAfter(zt=>{let ue=ko(zt);const xe=zt.children;let Ce=xe&&xe.length;for(;--Ce>=0;)ue+=xe[Ce].delta;zt.delta=ue}),Vt}})}function Dt(Z){if(!arguments.length)return Dt;S=Z,Zc(),S.each(function(Vt){if(mn(this).select("svg").size()===0){const zt=mn(this).append("svg:svg").attr("width",c).attr("class","partition d3-flame-graph");f&&(f<_n&&(f=_n),zt.attr("height",f)),zt.append("svg:text").attr("class","title").attr("text-anchor","middle").attr("y","25").attr("x",c/2).attr("fill","#808080").text(U),A&&zt.call(A)}}),Ls()}return Dt.height=function(Z){return arguments.length?(f=Z,Dt):f},Dt.minHeight=function(Z){return arguments.length?(_n=Z,Dt):_n},Dt.width=function(Z){return arguments.length?(c=Z,Dt):c},Dt.cellHeight=function(Z){return arguments.length?(y=Z,Dt):y},Dt.tooltip=function(Z){return arguments.length?(typeof Z=="function"&&(A=Z),Dt):A},Dt.title=function(Z){return arguments.length?(U=Z,Dt):U},Dt.transitionDuration=function(Z){return arguments.length?(D=Z,Dt):D},Dt.transitionEase=function(Z){return arguments.length?(G=Z,Dt):G},Dt.sort=function(Z){return arguments.length?(q=Z,Dt):q},Dt.inverted=function(Z){return arguments.length?(J=Z,Dt):J},Dt.computeDelta=function(Z){return arguments.length?(vn=Z,Dt):vn},Dt.setLabelHandler=function(Z){return arguments.length?(Oi=Z,Dt):Oi},Dt.label=Dt.setLabelHandler,Dt.search=function(Z){const Vt=[];let zt=0,ue=0;S.each(function(xe){const Ce=A0(xe,Z);Vt.push(...Ce[0]),zt+=Ce[1],ue+=xe.originalValue}),Xr(Vt,zt,ue),Ls()},Dt.findById=function(Z){if(typeof Z>"u"||Z===null)return null;let Vt=null;return S.each(function(zt){Vt===null&&(Vt=cf(zt,Z))}),Vt},Dt.clear=function(){Ln(null),S.each(function(Z){uf(Z),Ls()})},Dt.zoomTo=function(Z){Kc(Z)},Dt.resetZoom=function(){S.each(function(Z){Kc(Z)})},Dt.onClick=function(Z){return arguments.length?(ut=Z,Dt):ut},Dt.onHover=function(Z){return arguments.length?(yt=Z,Dt):yt},Dt.merge=function(Z){return S&&(this.resetZoom(),Se=null,Ln(null),S.datum(Vt=>(hf([Vt.data],[Z]),Vt.data)),Zc(),Ls()),Dt},Dt.update=function(Z){return S&&(Z&&(S.datum(Z),Zc()),Ls()),Dt},Dt.destroy=function(){return S&&(A&&(A.hide(),typeof A.destroy=="function"&&A.destroy()),S.selectAll("svg").remove()),Dt},Dt.setColorMapper=function(Z){return arguments.length?(Fi=Vt=>{const zt=$r(Vt);return Z(Vt,zt)},Dt):(Fi=$r,Dt)},Dt.color=Dt.setColorMapper,Dt.setColorHue=function(Z){return arguments.length?(xi=Z,Dt):(xi=null,Dt)},Dt.minFrameSize=function(Z){return arguments.length?(Rt=Z,Dt):Rt},Dt.setDetailsElement=function(Z){return arguments.length?(qt=Z,Dt):qt},Dt.details=Dt.setDetailsElement,Dt.selfValue=function(Z){return arguments.length?(Be=Z,Dt):Be},Dt.resetHeightOnZoom=function(Z){return arguments.length?(sn=Z,Dt):sn},Dt.scrollOnZoom=function(Z){return arguments.length?(oi=Z,Dt):oi},Dt.getName=function(Z){return arguments.length?(ze=Z,Dt):ze},Dt.getValue=function(Z){return arguments.length?(ur=Z,Dt):ur},Dt.getChildren=function(Z){return arguments.length?(wi=Z,Dt):wi},Dt.getLibtype=function(Z){return arguments.length?(Ps=Z,Dt):Ps},Dt.getDelta=function(Z){return arguments.length?(ko=Z,Dt):ko},Dt.setSearchHandler=function(Z){return arguments.length?(Xr=Z,Dt):(Xr=be,Dt)},Dt.setDetailsHandler=function(Z){return arguments.length?(Ln=Z,Dt):(Ln=za,Dt)},Dt.setSearchMatch=function(Z){return arguments.length?(Yn=Z,Dt):(Yn=Pn,Dt)},Dt}return i=i.default,i})()})})(ag);var UP=ag.exports;const OP=Fl(UP);var FP={exports:{}};(function(n,t){(function(i,r){n.exports=r()})(self,function(){return(()=>{var e={};e.d=(p,m)=>{for(var g in m)e.o(m,g)&&!e.o(p,g)&&Object.defineProperty(p,g,{enumerable:!0,get:m[g]})},e.o=(p,m)=>Object.prototype.hasOwnProperty.call(p,m),e.r=p=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})};var i={};e.r(i),e.d(i,{allocationColorMapper:()=>o,differentialColorMapper:()=>h,nodeJsColorMapper:()=>u,offCpuColorMapper:()=>l});function r(p){let g=0,w=0,M=1;const _=10;if(p){for(let v=0;v6);v++)g+=M*(p.charCodeAt(v)%_),w+=M*(_-1),M*=.7;w>0&&(g=g/w)}return g}function s(p){let m=0;if(p){const g=p.split("`");g.length>1&&(p=g[g.length-1]),p=p.split("(")[0],m=r(p)}return m}function a(p,m,g){const w=g,M=1-w;return[Math.round(p[0]*w+m[0]*M),Math.round(p[1]*w+m[1]*M),Math.round(p[2]*w+m[2]*M)]}function o(p,m){if(p.highlight)return m;const g=p.data.value,w=p.value;return`rgb(${a([0,255,40],[196,245,233],g/w).join()})`}function l(p,m){if(p.highlight)return m;const g=p.data.n||p.data.name,w=s(g),M=0+Math.round(55*(1-w)),_=0+Math.round(230*(1-w)),v=200+Math.round(55*w);return"rgb("+M+","+_+","+v+")"}function u(p,m){let g=m;const{v8_jit:w,javascript:M,optimized:_}=p.data.extras||{};if(w&&!M&&(g="#dadada"),M){let v=(_||0)/p.value,T=255,b=0,P=0;v<.4?(v=v*2.5,T=240-v*200):v<.9?(v=(v-.4)*2,T=0,P=200-200*v,b=100*v):(v=(v-.9)*10,T=0,P=0,b=100+150*v),g=`rgb(${T} , ${b}, ${P})`}return g}function h(p,m){if(p.highlight)return m;let g=220,w=220,M=220;const _=p.delta||p.data.d||p.data.delta,v=Math.abs(_);let T=p.value||p.data.v||p.data.value;T<=v&&(T=v);const b=v/T;return _===T?(g=255,w=190,M=90):_>0?(M=Math.round(235*(1-b)),w=M):_<0&&(g=Math.round(235*(1-b)),w=g),"rgb("+g+","+w+","+M+")"}return i})()})})(FP);var BP={exports:{}};(function(n,t){(function(i,r){n.exports=r()})(self,function(){return(()=>{var e={};e.d=(d,x)=>{for(var E in x)e.o(x,E)&&!e.o(d,E)&&Object.defineProperty(d,E,{enumerable:!0,get:x[E]})},e.o=(d,x)=>Object.prototype.hasOwnProperty.call(d,x),e.r=d=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})};var i={};e.r(i),e.d(i,{defaultFlamegraphTooltip:()=>Cs});function r(){}function s(d){return d==null?r:function(){return this.querySelector(d)}}function a(d){typeof d!="function"&&(d=s(d));for(var x=this._groups,E=x.length,L=new Array(E),z=0;z=Rs&&(Rs=Wr+1);!(Ba=yi[Rs])&&++Rs=0;)(j=L[z])&&(V&&j.compareDocumentPosition(V)^4&&V.parentNode.insertBefore(j,V),V=j);return this}function St(d){d||(d=st);function x(jt,te){return jt&&te?d(jt.__data__,te.__data__):!jt-!te}for(var E=this._groups,L=E.length,z=new Array(L),V=0;Vx?1:d>=x?0:NaN}function mt(){var d=arguments[0];return arguments[0]=this,d.apply(null,arguments),this}function It(){return Array.from(this)}function Ot(){for(var d=this._groups,x=0,E=d.length;x=0&&(x=d.slice(0,E))!=="xmlns"&&(d=d.slice(E+1)),pe.hasOwnProperty(x)?{space:pe[x],local:d}:d}function he(d){return function(){this.removeAttribute(d)}}function tt(d){return function(){this.removeAttributeNS(d.space,d.local)}}function Oe(d,x){return function(){this.setAttribute(d,x)}}function Zt(d,x){return function(){this.setAttributeNS(d.space,d.local,x)}}function oe(d,x){return function(){var E=x.apply(this,arguments);E==null?this.removeAttribute(d):this.setAttribute(d,E)}}function ie(d,x){return function(){var E=x.apply(this,arguments);E==null?this.removeAttributeNS(d.space,d.local):this.setAttributeNS(d.space,d.local,E)}}function Te(d,x){var E=Pe(d);if(arguments.length<2){var L=this.node();return E.local?L.getAttributeNS(E.space,E.local):L.getAttribute(E)}return this.each((x==null?E.local?tt:he:typeof x=="function"?E.local?ie:oe:E.local?Zt:Oe)(E,x))}function fe(d){return d.ownerDocument&&d.ownerDocument.defaultView||d.document&&d||d.defaultView}function Pt(d){return function(){this.style.removeProperty(d)}}function Qt(d,x,E){return function(){this.style.setProperty(d,x,E)}}function we(d,x,E){return function(){var L=x.apply(this,arguments);L==null?this.style.removeProperty(d):this.style.setProperty(d,L,E)}}function Me(d,x,E){return arguments.length>1?this.each((x==null?Pt:typeof x=="function"?we:Qt)(d,x,E??"")):N(this.node(),d)}function N(d,x){return d.style.getPropertyValue(x)||fe(d).getComputedStyle(d,null).getPropertyValue(x)}function R(d){return function(){delete this[d]}}function rt(d,x){return function(){this[d]=x}}function At(d,x){return function(){var E=x.apply(this,arguments);E==null?delete this[d]:this[d]=E}}function bt(d,x){return arguments.length>1?this.each((x==null?R:typeof x=="function"?At:rt)(d,x)):this.node()[d]}function Tt(d){return d.trim().split(/^|\s+/)}function kt(d){return d.classList||new Ct(d)}function Ct(d){this._node=d,this._names=Tt(d.getAttribute("class")||"")}Ct.prototype={add:function(d){var x=this._names.indexOf(d);x<0&&(this._names.push(d),this._node.setAttribute("class",this._names.join(" ")))},remove:function(d){var x=this._names.indexOf(d);x>=0&&(this._names.splice(x,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(d){return this._names.indexOf(d)>=0}};function at(d,x){for(var E=kt(d),L=-1,z=x.length;++L=0&&(E=x.slice(L+1),x=x.slice(0,L)),{type:x,name:E}})}function ft(d){return function(){var x=this.__on;if(x){for(var E=0,L=-1,z=x.length,V;E{}};function de(){for(var d=0,x=arguments.length,E={},L;d=0&&(L=E.slice(z+1),E=E.slice(0,z)),E&&!x.hasOwnProperty(E))throw new Error("unknown type: "+E);return{type:E,name:L}})}wn.prototype=de.prototype={constructor:wn,on:function(d,x){var E=this._,L=ke(d+"",E),z,V=-1,j=L.length;if(arguments.length<2){for(;++V0)for(var E=new Array(z),L=0,z,V;L=0&&d._call.call(void 0,x),d=d._next;--Rn}function ya(){On=(Pi=Nr.now())+Dr,Rn=We=0;try{jl()}finally{Rn=0,Kl(),On=0}}function Yl(){var d=Nr.now(),x=d-Pi;x>ir&&(Dr-=x,Pi=d)}function Kl(){for(var d,x=je,E,L=1/0;x;)x._call?(L>x._time&&(L=x._time),d=x,x=x._next):(E=x._next,x._next=null,x=d?d._next=E:je=E);$n=d,vo(L)}function vo(d){if(!Rn){We&&(We=clearTimeout(We));var x=d-On;x>24?(d<1/0&&(We=setTimeout(ya,d-Nr.now()-Dr)),gn&&(gn=clearInterval(gn))):(gn||(Pi=Nr.now(),gn=setInterval(Yl,ir)),Rn=1,Ir(ya))}}function xa(d,x,E){var L=new ps;return x=x==null?0:+x,L.restart(z=>{L.stop(),d(z+x)},x,E),L}var Zl=Xn("start","end","cancel","interrupt"),Jl=[],wa=0,Ma=1,yo=2,ms=3,Sa=4,xo=5,gs=6;function _s(d,x,E,L,z,V){var j=d.__transition;if(!j)d.__transition={};else if(E in j)return;Ql(d,E,{name:x,index:L,group:z,on:Zl,tween:Jl,time:V.time,delay:V.delay,duration:V.duration,ease:V.ease,timer:null,state:wa})}function wo(d,x){var E=Mn(d,x);if(E.state>wa)throw new Error("too late; already scheduled");return E}function qn(d,x){var E=Mn(d,x);if(E.state>ms)throw new Error("too late; already running");return E}function Mn(d,x){var E=d.__transition;if(!E||!(E=E[x]))throw new Error("transition not found");return E}function Ql(d,x,E){var L=d.__transition,z;L[x]=E,E.timer=Ur(V,0,E.time);function V(vt){E.state=Ma,E.timer.restart(j,E.delay,E.time),E.delay<=vt&&j(vt-E.delay)}function j(vt){var Mt,jt,te,ne;if(E.state!==Ma)return pt();for(Mt in L)if(ne=L[Mt],ne.name===E.name){if(ne.state===ms)return xa(j);ne.state===Sa?(ne.state=gs,ne.timer.stop(),ne.on.call("interrupt",d,d.__data__,ne.index,ne.group),delete L[Mt]):+Mtyo&&L.state180?Mt+=360:Mt-vt>180&&(vt+=360),te.push({i:jt.push(z(jt)+"rotate(",null,L)-2,x:vi(vt,Mt)})):Mt&&jt.push(z(jt)+"rotate("+Mt+L)}function ot(vt,Mt,jt,te){vt!==Mt?te.push({i:jt.push(z(jt)+"skewX(",null,L)-2,x:vi(vt,Mt)}):Mt&&jt.push(z(jt)+"skewX("+Mt+L)}function pt(vt,Mt,jt,te,ne,Ze){if(vt!==jt||Mt!==te){var fn=ne.push(z(ne)+"scale(",null,",",null,")");Ze.push({i:fn-4,x:vi(vt,jt)},{i:fn-2,x:vi(Mt,te)})}else(jt!==1||te!==1)&&ne.push(z(ne)+"scale("+jt+","+te+")")}return function(vt,Mt){var jt=[],te=[];return vt=d(vt),Mt=d(Mt),V(vt.translateX,vt.translateY,Mt.translateX,Mt.translateY,jt,te),j(vt.rotate,Mt.rotate,jt,te),ot(vt.skewX,Mt.skewX,jt,te),pt(vt.scaleX,vt.scaleY,Mt.scaleX,Mt.scaleY,jt,te),vt=Mt=null,function(ne){for(var Ze=-1,fn=te.length,yi;++Ze>8&15|x>>4&240,x>>4&15|x&240,(x&15)<<4|x&15,1):E===8?Di(x>>24&255,x>>16&255,x>>8&255,(x&255)/255):E===4?Di(x>>12&15|x>>8&240,x>>8&15|x>>4&240,x>>4&15|x&240,((x&15)<<4|x&15)/255):null):(x=ac.exec(d))?new Ue(x[1],x[2],x[3],1):(x=lc.exec(d))?new Ue(x[1]*255/100,x[2]*255/100,x[3]*255/100,1):(x=cc.exec(d))?Di(x[1],x[2],x[3],x[4]):(x=uc.exec(d))?Di(x[1]*255/100,x[2]*255/100,x[3]*255/100,x[4]):(x=hc.exec(d))?Do(x[1],x[2]/100,x[3]/100,1):(x=fc.exec(d))?Do(x[1],x[2]/100,x[3]/100,x[4]):Ao.hasOwnProperty(d)?Ro(Ao[d]):d==="transparent"?new Ue(NaN,NaN,NaN,0):null}function Ro(d){return new Ue(d>>16&255,d>>8&255,d&255,1)}function Di(d,x,E,L){return L<=0&&(d=x=E=NaN),new Ue(d,x,E,L)}function pc(d){return d instanceof ni||(d=Bn(d)),d?(d=d.rgb(),new Ue(d.r,d.g,d.b,d.opacity)):new Ue}function Fr(d,x,E,L){return arguments.length===1?pc(d):new Ue(d,x,E,L??1)}function Ue(d,x,E,L){this.r=+d,this.g=+x,this.b=+E,this.opacity=+L}Or(Ue,Fr,Eo(ni,{brighter:function(d){return d=d==null?Li:Math.pow(Li,d),new Ue(this.r*d,this.g*d,this.b*d,this.opacity)},darker:function(d){return d=d==null?ii:Math.pow(ii,d),new Ue(this.r*d,this.g*d,this.b*d,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Po,formatHex:Po,formatRgb:Lo,toString:Lo}));function Po(){return"#"+Br(this.r)+Br(this.g)+Br(this.b)}function Lo(){var d=this.opacity;return d=isNaN(d)?1:Math.max(0,Math.min(1,d)),(d===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(d===1?")":", "+d+")")}function Br(d){return d=Math.max(0,Math.min(255,Math.round(d)||0)),(d<16?"0":"")+d.toString(16)}function Do(d,x,E,L){return L<=0?d=x=E=NaN:E<=0||E>=1?d=x=NaN:x<=0&&(d=NaN),new Ke(d,x,E,L)}function No(d){if(d instanceof Ke)return new Ke(d.h,d.s,d.l,d.opacity);if(d instanceof ni||(d=Bn(d)),!d)return new Ke;if(d instanceof Ke)return d;d=d.rgb();var x=d.r/255,E=d.g/255,L=d.b/255,z=Math.min(x,E,L),V=Math.max(x,E,L),j=NaN,ot=V-z,pt=(V+z)/2;return ot?(x===V?j=(E-L)/ot+(E0&&pt<1?0:j,new Ke(j,ot,pt,d.opacity)}function mc(d,x,E,L){return arguments.length===1?No(d):new Ke(d,x,E,L??1)}function Ke(d,x,E,L){this.h=+d,this.s=+x,this.l=+E,this.opacity=+L}Or(Ke,mc,Eo(ni,{brighter:function(d){return d=d==null?Li:Math.pow(Li,d),new Ke(this.h,this.s,this.l*d,this.opacity)},darker:function(d){return d=d==null?ii:Math.pow(ii,d),new Ke(this.h,this.s,this.l*d,this.opacity)},rgb:function(){var d=this.h%360+(this.h<0)*360,x=isNaN(d)||isNaN(this.s)?0:this.s,E=this.l,L=E+(E<.5?E:1-E)*x,z=2*E-L;return new Ue(zr(d>=240?d-240:d+120,z,L),zr(d,z,L),zr(d<120?d+240:d-120,z,L),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var d=this.opacity;return d=isNaN(d)?1:Math.max(0,Math.min(1,d)),(d===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(d===1?")":", "+d+")")}}));function zr(d,x,E){return(d<60?x+(E-x)*d/60:d<180?E:d<240?x+(E-x)*(240-d)/60:x)*255}const ys=d=>()=>d;function gc(d,x){return function(E){return d+E*x}}function _c(d,x,E){return d=Math.pow(d,E),x=Math.pow(x,E)-d,E=1/E,function(L){return Math.pow(d+L*x,E)}}function vc(d){return(d=+d)==1?Io:function(x,E){return E-x?_c(x,E,d):ys(isNaN(x)?E:x)}}function Io(d,x){var E=x-d;return E?gc(d,E):ys(isNaN(d)?x:d)}const Hr=function d(x){var E=vc(x);function L(z,V){var j=E((z=Fr(z)).r,(V=Fr(V)).r),ot=E(z.g,V.g),pt=E(z.b,V.b),vt=Io(z.opacity,V.opacity);return function(Mt){return z.r=j(Mt),z.g=ot(Mt),z.b=pt(Mt),z.opacity=vt(Mt),z+""}}return L.gamma=d,L}(1);var Uo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Oo=new RegExp(Uo.source,"g");function zn(d){return function(){return d}}function yc(d){return function(x){return d(x)+""}}function Fo(d,x){var E=Uo.lastIndex=Oo.lastIndex=0,L,z,V,j=-1,ot=[],pt=[];for(d=d+"",x=x+"";(L=Uo.exec(d))&&(z=Oo.exec(x));)(V=z.index)>E&&(V=x.slice(E,V),ot[j]?ot[j]+=V:ot[++j]=V),(L=L[0])===(z=z[0])?ot[j]?ot[j]+=z:ot[++j]=z:(ot[++j]=null,pt.push({i:j,x:vi(L,z)})),E=Oo.lastIndex;return E=0&&(x=x.slice(0,E)),!x||x==="start"})}function Ca(d,x,E){var L,z,V=Ho(x)?wo:qn;return function(){var j=V(this,d),ot=j.on;ot!==L&&(z=(L=ot).copy()).on(x,E),j.on=z}}function zc(d,x){var E=this._id;return arguments.length<2?Mn(this.node(),E).on.on(d):this.each(Ca(E,d,x))}function Ra(d){return function(){var x=this.parentNode;for(var E in this.__transition)if(+E!==d)return;x&&x.removeChild(this)}}function ws(){return this.on("end.remove",Ra(this._id))}function Hc(d){var x=this._name,E=this._id;typeof d!="function"&&(d=s(d));for(var L=this._groups,z=L.length,V=new Array(z),j=0;j=0&&(t=n.slice(0,e))!=="xmlns"&&(n=n.slice(e+1)),Lp.hasOwnProperty(t)?{space:Lp[t],local:n}:n}function zP(n){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===gh&&t.documentElement.namespaceURI===gh?t.createElement(n):t.createElementNS(e,n)}}function HP(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function cg(n){var t=lg(n);return(t.local?HP:zP)(t)}function GP(){}function ug(n){return n==null?GP:function(){return this.querySelector(n)}}function kP(n){typeof n!="function"&&(n=ug(n));for(var t=this._groups,e=t.length,i=new Array(e),r=0;r=b&&(b=T+1);!(I=_[b])&&++b=0;)(a=i[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function iL(n){n||(n=rL);function t(p,m){return p&&m?n(p.__data__,m.__data__):!p-!m}for(var e=this._groups,i=e.length,r=new Array(i),s=0;st?1:n>=t?0:NaN}function sL(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function oL(){var n=new Array(this.size()),t=-1;return this.each(function(){n[++t]=this}),n}function aL(){for(var n=this._groups,t=0,e=n.length;t1?this.each((t==null?vL:typeof t=="function"?xL:yL)(n,t,e??"")):ML(this.node(),n)}function ML(n,t){return n.style.getPropertyValue(t)||fg(n).getComputedStyle(n,null).getPropertyValue(t)}function SL(n){return function(){delete this[n]}}function bL(n,t){return function(){this[n]=t}}function EL(n,t){return function(){var e=t.apply(this,arguments);e==null?delete this[n]:this[n]=e}}function AL(n,t){return arguments.length>1?this.each((t==null?SL:typeof t=="function"?EL:bL)(n,t)):this.node()[n]}function dg(n){return n.trim().split(/^|\s+/)}function Qh(n){return n.classList||new pg(n)}function pg(n){this._node=n,this._names=dg(n.getAttribute("class")||"")}pg.prototype={add:function(n){var t=this._names.indexOf(n);t<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var t=this._names.indexOf(n);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function mg(n,t){for(var e=Qh(n),i=-1,r=t.length;++i=0&&(e=t.slice(i+1),t=t.slice(0,i)),{type:t,name:e}})}function eD(n){return function(){var t=this.__on;if(t){for(var e=0,i=-1,r=t.length,s;ethis.start()),this.pauseButton.addEventListener("click",()=>this.pause()),this.on("isPlaying",e=>this.domElement.classList.toggle("playing",e))}initFlamegraph(){const e=this.domElement.querySelector("#flamegraph");this.flamegraph=new cD(e)}startTicking(){setTimeout(()=>this.tick(),0)}setToTrace(e,i){var r;this.cursor=e.createCursor(),this.traceEntity=i,this.updateEntities(),(r=this.flamegraph)==null||r.setToPlayer(this,e)}get currentTime(){return this.cursor.currentTime}set currentTime(e){this._tick(e-this.currentTime)}get playButton(){return this.domElement.querySelector("#player-play")}get pauseButton(){return this.domElement.querySelector("#player-pause")}start(){this.canStepForward()||this.reset(),this.resume()}stop(){this.pause(),this.reset()}restart(){this.stop(),this.start()}resume(){this.isPlaying=!0,this.emit("isPlaying",!0)}pause(){this.isPlaying=!1,this.emit("isPlaying",!1)}togglePlaying(){this.isPlaying?this.pause():this.resume()}reset(){this.resetSteps()}tick(){setTimeout(()=>this.tick(),1e3/this.ticksPerSecond),this.isPlaying?this._tick():this._tick(0)}_tick(e=void 0){if(!this.cursor)return;const i=Date.now(),r=(i-this.lastTick)/1e3;let s,a;e===void 0?(a=r*this.stepsPerSecond,a+=this.stepsRoundingError||0,s=Math.floor(a),this.stepsRoundingError=a-s):(s=Math.floor(e),delete this.stepsRoundingError,a=e),this.doSteps(s,r,a),this.lastTick=i,e===void 0&&!this.canStepForward()&&this.pause()}doSteps(e,i,r=e){var a;const s=new Set;if(e)this.cursor.step(e,{activateFrame:o=>{console.log(o.toString()),s.add(o.receiver),this.getObjectEntity(o.receiver)&&(this.objectIndex+=Math.sign(e))}});else{const o=this.cursor.currentFrame;o&&s.add(o.receiver)}this.objectEntities.forEach(o=>{o.setGlowState("active",s.has(o.object)?1:Math.max(0,o.getGlowFraction("active")-i/this.glowTime))}),this.trail&&(this.trail.headIndex=this.objectIndex<0?0:this.cursor.currentFrame?this.objectIndex+Math.min(1,Math.max(0,this.objectIndex+1{this.getObjectEntity(i.receiver)&&(e.push(i.receiver),this.objectTimes.push(r.currentTime))}}),this.cursor.reset(),this.trail&&this.trail.setEntities(e.map(i=>this.getObjectEntity(i)))}getObjectEntity(e){return this.objectEntities.find(i=>i.object==e)}}class cD{constructor(t){Wt(this,"filteredObjectColor","#777");Wt(this,"minEffectiveCellHeightForLabel",6);this.domElement=t,this.init()}init(){this.domElement.innerHTML="",this.initFlamegraph()}initFlamegraph(){this.flamegraph=OP(),this.initFlamegraphGeometry(),this.initFlamegraphFrames(),this.initFlamegraphEvents(),this.buildFlamegraph()}initFlamegraphGeometry(){this.setFlamegraphGeometry(1)}initFlamegraphFrames(){this.initFlamegraphFrameLabels();const t=aD();t.direction("s").offset([8,0]).attr("class","d3-flame-graph-tip").html(e=>{if(!e.data.frame){t.style("display","none");return}return t.style("display","block"),e.data.name}),this.flamegraph.tooltip(t),this.flamegraph.setColorMapper(e=>e.data.frame?e.data.color??this.filteredObjectColor:"transparent")}initFlamegraphFrameLabels(){this.flamegraph.getName(t=>t.data.name),new ResizeObserver(()=>{this.updateShowLabels()}).observe(this.domElement)}initFlamegraphEvents(){this.flamegraph.onClick(e=>{e.parent&&this.flamegraph.resetZoom()}).transitionDuration(0);const t=[];this.flamegraph.onHover(e=>{var r;const i=(r=e==null?void 0:e.data)==null?void 0:r.frame;i&&(t.push(i),this.onHoverFrame(i,e))}).setDetailsHandler(e=>{var i;((i=e==null?void 0:e.data)==null?void 0:i.frame)==null&&(t.forEach(r=>this.onUnhoverFrame(r)),t.length=0)})}buildFlamegraph(){Fu(this.domElement).datum({}).call(this.flamegraph),this.svg=this.domElement.querySelector("svg"),this.updateFlamegraphGeometry()}setToPlayer(t,e){this.player=t,this.maxStackDepth=e.maxStackDepth();const i=e.rootFrame,r=this.toFlamegraphData(i);this.setFlamegraphGeometry(this.maxStackDepth),this.updateFlamegraphNodes(r)}toFlamegraphData(t){const e={frame:t,get name(){return t.name},value:t.endTime-t.startTime+1};if(e.children=[],t.children.length){let i=t.startTime;t.children.forEach(r=>{e.children.push({value:r.startTime-i,children:[]}),e.children.push(this.toFlamegraphData(r)),i=r.endTime+1}),e.children.push({value:t.endTime-i+1,children:[]})}return e}setFlamegraphGeometry(t){const s=16*t+0;this.flamegraph.width(1e3).height(s).cellHeight(16),this.svg&&this.updateFlamegraphGeometry()}updateFlamegraphGeometry(){this.svg.setAttribute("viewBox",`0 0 ${this.flamegraph.width()} ${this.flamegraph.height()}`),this.svg.setAttribute("preserveAspectRatio","none")}updateFlamegraphNodes(t){this.flamegraph.update(t),this.updateShowLabels(),this.updateColors()}updateColors(t=void 0){Fu(this.svg).selectAll("g").selectAll("rect").attr("fill",e=>{const i=e.data.frame;return i?((!t||t==e)&&(e.data.color=this.getColor(i)),e.data.color):"transparent"})}updateShowLabels(){let t;const e=this.minEffectiveCellHeightForLabel*this.maxStackDepth;{const r=e*.25;t=Math.max(0,Math.min(1,(this.domElement.clientHeight-e+r)/r))}if(t==this._lastShowLabels)return;Fu(this.svg).selectAll("g").selectAll(".d3-flame-graph-label").style("opacity",t),this._lastShowLabels=t}getColor(t){const e=this.getObjectEntity(t.receiver),[i,r]=(e==null?void 0:e.getDisplayColor(t==this.player.cursor.currentFrame))??[];return r?`#${r.getHexString()}`:this.filteredObjectColor}onHoverFrame(t){const e=this.getObjectEntity(t.receiver);e==null||e.addHoveredEntity(this)}onUnhoverFrame(t){const e=this.getObjectEntity(t.receiver);e==null||e.removeHoveredEntity(this)}getObjectEntity(t){return this.player.getObjectEntity(t)}}class uD extends Wh{constructor(e){super();Wt(this,"minTime");Wt(this,"maxTime");this.domElement=e,this.init()}init(){this.cursor=this.domElement.querySelector("#cursor"),this.domElement.addEventListener("pointerdown",this._boundEventHandler("onPointerDown")),this.domElementClientWidth=this.domElement.clientWidth,this.cursorClientWidth=this.cursor.clientWidth,new ResizeObserver(()=>{this.domElementClientWidth=this.domElement.clientWidth}).observe(this.domElement),new ResizeObserver(()=>{this.cursorClientWidth=this.cursor.clientWidth}).observe(this.cursor)}get time(){return this.minTime+this._cursorX/(this.domElementClientWidth-this.cursorClientWidth)*(this.maxTime-this.minTime)}set time(e){this._cursorX=(e-this.minTime)/(this.maxTime-this.minTime)*(this.domElementClientWidth-this.cursorClientWidth)}get _cursorX(){return new DOMMatrixReadOnly(getComputedStyle(this.cursor).transform).m41}set _cursorX(e){this.cursor.style.transform=`translateX(${e}px)`}onPointerDown(e){this.dragging=!0,this.setCursorFromPointer(e);const i=this.domElement.ownerDocument;i.addEventListener("pointermove",this._boundEventHandler("onPointerMove"),!0),i.addEventListener("pointerup",this._boundEventHandler("onPointerUp"),!0),this.emit("startDrag")}onPointerMove(e){e.isT4dSimulated||this.dragging&&this.setCursorFromPointer(e)}onPointerUp(e){if(e.isT4dSimulated)return;this.setCursorFromPointer(e),this.dragging=!1;const i=this.domElement.ownerDocument;i.removeEventListener("pointermove",this._boundEventHandler("onPointerMove"),!0),i.removeEventListener("pointerup",this._boundEventHandler("onPointerUp"),!0),this.emit("endDrag")}setCursorFromPointer(e){let i=e.pageX-this.domElement.getBoundingClientRect().left;i=Math.max(this.cursor.clientWidth/2,Math.min(this.domElement.clientWidth-this.cursor.clientWidth/2,i)),i-=this.cursor.clientWidth/2,this._cursorX=i,this.emit("time")}_boundEventHandler(e){var i;return(i=this._boundEventHandlers??(this._boundEventHandlers={}))[e]??(i[e]=this[e].bind(this))}}const hD={LEFT:1,MIDDLE:2,RIGHT:4,BACK:8,FORWARD:16};class tf{static forStyle(t=void 0){if(t==null)return this.forStyle("flatFDG");switch(t){case"hierarchical":return fD;case"flatFDG":return wg}throw new Error(`Unknown style: ${t}`)}static newForStyle(t,e=void 0){return new(this.forStyle(t))(e)}constructor(t){this.trace=t}buildAllFieldEntities(t,e){let i=Ne(t.fields);const r=20;return i=i.take(r),i.map((s,a)=>this.buildFieldEntities(a,s,e))}buildFieldEntities(t,e,i){let r=null;const s=["front","left","back","right"].map(a=>{const o=new vl(t,e);return o.side=a,r===null?r=o:o.primary=r,i.addChild(o),o});return s.forEach(a=>{a.twins=s.filter(o=>o!==a)}),s}}class fD extends tf{constructor(){super(...arguments);Wt(this,"allFieldEntities",new Map);Wt(this,"objectEntities",new Map);Wt(this,"classEntities",new Map);Wt(this,"classCategoryEntities",new Map);Wt(this,"packageEntities",new Map);Wt(this,"traceEntity",null)}build(e){Ne(this.trace.classes).each(r=>{this.getClassEntity(r)}),Ne(this.trace.objects).each(r=>{this.getObjectEntity(r);const s=20;Ne(r.fields).take(s).each((a,o)=>{this.getFieldEntities(o,a,r)})});const i=this.getTraceEntity();return i.sortAllChildren(),i.build(e)}getFieldEntities(e,i,r){let s=this.allFieldEntities.get(i);if(s)return s;const a=this.getObjectEntity(r);return this.buildFieldEntities(e,i,a),this.allFieldEntities.set(i,s),s}getObjectEntity(e){let i=this.objectEntities.get(e);return i||(i=new Mi(e),this.getClassEntity(e.class).addChild(i),this.objectEntities.set(e,i),i)}getClassEntity(e){let i=this.classEntities.get(e);return i||(i=new Bm(e),this.getClassCategoryEntity(e.category).addChild(i),this.classEntities.set(e,i),i)}getClassCategoryEntity(e){let i=this.classCategoryEntities.get(e);return i||(i=new Fm(e),this.getPackageEntity(e.package).addChild(i),this.classCategoryEntities.set(e,i),i)}getPackageEntity(e){let i=this.packageEntities.get(e);return i||(i=new Om(e),this.getTraceEntity().addChild(i),this.packageEntities.set(e,i),i)}getTraceEntity(){return this.traceEntity?this.traceEntity:(this.traceEntity=new $h(this.trace),this.traceEntity)}}class wg extends tf{constructor(){super(...arguments);Wt(this,"excludedObjectNames",[]);Wt(this,"excludedClassNames",["Boolean","True","False","UndefinedObject","SmallInteger","LargePositiveInteger","LargeNegativeInteger","SmallFloat64","FullBlockClosure","CompiledBlock","CompiledMethod","CompiledMethodTrailer","Array","OrderedCollection","Bitmap","Point","Rectangle","ByteSymbol","Process","ProcessorScheduler","Mutex","Association","DependentsArray","Heap","IdentityDictionary","IdentitySet","Interval","SparseLargeTable","WeakArray","WeakIdentityKeyDictionary","WeakKeyAssociation","WeakSet","WeakValueAssociation","Environment"]);Wt(this,"excludeClasses",!0);Wt(this,"forceWeights",{references:1,organization:{force:.005,sameClass:2,sameHierarchy:1,sameCategory:.01,samePackage:.001},communication:1e-4,globalFactor:1,repulsion:.2})}build(e){const i=this.trace.objects.filter(a=>this.shouldShowObject(a)).map(a=>this.buildObjectEntity(a)),r=new $h(this.trace);i.forEach(a=>r.addChild(a)),r.sortAllChildren(),this.addConnections(i);const s=r.build(e);return r.layoutFDG(e,this.computeForces.bind(this)),s}shouldShowObject(e){return!(this.excludedClassNames.includes(e.class.name)||this.excludedObjectNames.includes(e.name)||this.excludeClasses&&e.class.name.endsWith(" class"))}buildObjectEntity(e){const i=new Mi(e);return this.buildAllFieldEntities(e,i),i}addConnections(e){e.forEach(i=>{e.forEach(r=>{Ne(i.object.fields).each((s,a)=>{s===r.object&&i.addConnection(a,r,1)})})})}computeForces(e,i){const r=(s,a)=>s===void 0?r(a):s instanceof Function?o=>s(o??1)*(this.forceWeights.globalFactor??1):o=>(o??1)*s*(this.forceWeights.globalFactor??1);if(this.forceWeights.references){const s=r(this.forceWeights.references);e.forEach(a=>{const o=a.object;e.forEach(l=>{const u=l.object,h=Ne(o.fields).filter(p=>p===u).count();h>0&&i(a,l,s(h))})})}if(this.forceWeights.organization){const s=r(this.forceWeights.organization.force,1),a=r(this.forceWeights.organization.sameClass),o=r(this.forceWeights.organization.sameHierarchy),l=r(this.forceWeights.organization.sameCategory),u=r(this.forceWeights.organization.samePackage);e.forEach(h=>{const p=h.object;e.forEach(m=>{const g=m.object;let w=0;if(a&&p.class===g.class&&(w+=a()),l&&p.class.category===g.class.category&&(w+=l()),o&&p.class.category===g.class.category){const M=/^Rxs[A-Z]/.test(p.class.name),_=/^Rxs[A-Z]/.test(g.class.name);M&&_&&(w+=o());const v=/^Rxm[A-Z]/.test(p.class.name),T=/^Rxm[A-Z]/.test(g.class.name);v&&T&&(w+=o())}u&&p.class.category.package===g.class.category.package&&(w+=u()),w>0&&i(h,m,s(w))})})}if(this.forceWeights.communication){const s=r(this.forceWeights.communication),a=o=>{const l=e.find(u=>u.object===o.receiver);o.children.forEach(u=>{const h=e.find(p=>p.object===u.receiver);l!=null&&h!=null&&i(l,h,s()),a(u)})};a(this.trace.rootFrame)}}}class dD{constructor(t={}){Wt(this,"defaultStyle","flatFDG");this.options=t}buildMap(t){this.scene=new zT,this.camera=new ti,this.camera.position.set(0,50,100),this.camera.far=1e4,this.renderer=new xm,this.window=t.ownerDocument.defaultView||t.ownerDocument.parentWindow,this.window.traceMap=this;const e=t.querySelector("#three");e.appendChild(this.renderer.domElement),new ResizeObserver(()=>this.updateViewport()).observe(e),this.buildConsoleInterface(),this.buildControls(),this.buildScene();const i=t.querySelector("#player");this.buildPlayer(i),this.renderer.setAnimationLoop(()=>this.render())}buildConsoleInterface(){[wg].forEach(t=>{this.window[t.name]=t}),console.log("%ctrace4d","color: #0000ff; font-size: larger; font-weight: bold"),console.log("%cAdjust the map like this:","color: #0000ff"),console.log(` +traceMap.entityBuilder.forceWeights.references = 0.5 +traceMap.entityBuilder.forceWeights.organization.sameClass = 0.1 +traceMap.entityBuilder.forceWeights.globalFactor = 0.5 +traceMap.entityBuilder.forceWeights.repulsion = 0.3 +traceMap.entityBuilder.excludedObjectNames.push("'an Object'") +traceMap.entityBuilder.excludedClassNames.push('ByteString') +traceMap.entityBuilder.excludeClasses = false +traceMap.reloadTrace() + +traceMap.player.stepsPerSecond = 100 +`)}buildControls(){(this.options.countFPS??!1)!==!1&&this.buildFPSCounter(),this.buildMapControls(),this.buildDragControls(),this.buildMouseHandler(),this.buildKeyboardHandler()}buildFPSCounter(){h1((this.options.measureFPS??!1)!==!1),this.stats=new Oh,this.stats.showPanel(0),this.window.document.body.appendChild(this.stats.dom),this.stats.logs=f1}buildMapControls(){this.mapControls=new c1(this.camera,this.renderer.domElement),this.mapControls.enableDamping=!1,this.mapControls.enablePan=!0,this.mapControls.minDistance=20,this.mapControls.enableRotate=!0,this.mapControls.maxPolarAngle=Math.PI/2-.1,this.mapControls.zoomToCursor=!0,this.mapControls.addEventListener("change",()=>this.updateScene()),this.mapControls.keyPanSpeed=20,this.mapControls.listenToKeyEvents(this.window.document)}buildDragControls(){this.dragControls=new o1([],this.camera,this.renderer.domElement),this.dragControls.addEventListener("hoveron",t=>{var e,i;(i=(e=t.object.entity)==null?void 0:e.onDragStart)==null||i.call(e,t)}),this.dragControls.addEventListener("hoveroff",t=>{var e,i;this.dragEntity=null,(i=(e=t.object.entity)==null?void 0:e.onDragEnd)==null||i.call(e,t)}),this.dragControls.addEventListener("drag",t=>{var e,i;this.dragEntity=t.object.entity,this.lastDragEvent=t,(i=(e=t.object.entity)==null?void 0:e.onDrag)==null||i.call(e,t),this.updateScene()}),this.dragControls.enabled=!1}registerDraggable(t){this.dragControls.getObjects().push(t)}unregisterDraggable(t){const e=this.dragControls.getObjects().indexOf(t);e>=0&&this.dragControls.getObjects().splice(e,1)}buildMouseHandler(){const t=new Uh,e=new Yt;this.mouseOverEntities=[],this.focusEntity=null,this.renderer.domElement.addEventListener("pointermove",s=>{var u,h,p,m,g;this.lastPointerMoveEvent=s,e.x=s.clientX/this.window.innerWidth*2-1,e.y=-(s.clientY/this.window.innerHeight)*2+1,t.setFromCamera(e,this.camera);const a=t.intersectObjects(this.hoverableObject3ds??[],!1),o=this.focusEntity,l=this.mouseOverEntities.slice();this.mouseOverEntities=a.slice().reverse().map(w=>w.object.entity).filter(w=>{var M;return(M=w==null?void 0:w.wantsMouse)==null?void 0:M.call(w,s)}),l.forEach(w=>{var M;this.mouseOverEntities.includes(w)||(M=w.onMouseLeave)==null||M.call(w,s)}),this.mouseOverEntities.forEach(w=>{var M;l.includes(w)||(M=w.onMouseEnter)==null||M.call(w,s)}),this.focusEntity=this.mouseOverEntities[this.mouseOverEntities.length-1],this.focusEntity!==o&&((u=o==null?void 0:o.onHoverEnd)==null||u.call(o,s),s.buttons&hD.LEFT||(p=(h=this.focusEntity)==null?void 0:h.onHoverStart)==null||p.call(h,s)),a.some(w=>{var M,_;(_=(M=w.object.entity)==null?void 0:M.onHover)==null||_.call(M,s)}),this.dragControls.enabled&&!this.dragEntity&&(this.dragEntity=this.focusEntity,(g=(m=this.dragEntity)==null?void 0:m.onDragStart)==null||g.call(m,s)),this.updateCursor()},{capture:!0}),this.renderer.domElement.parentElement.addEventListener("mousemove",s=>{this.lastMouseMoveEvent=s},{capture:!0});let i=null,r=null;this.renderer.domElement.addEventListener("mousedown",s=>{i=e.clone(),r=!0},!1),this.renderer.domElement.addEventListener("mousemove",s=>{r=r&&i.distanceTo(e)<.01},!1),this.renderer.domElement.addEventListener("click",s=>{var a,o,l,u;r&&(r=null,i=null,!this.dragEntity&&((o=(a=this.focusEntity)==null?void 0:a.wantsClick)!=null&&o.call(a,s))&&((u=(l=this.focusEntity).onClick)==null||u.call(l,s)))},!1),this.window.addEventListener("keydown",s=>{var a,o,l,u;if(s.key==="Shift"){if(this.mapControls.enabled=!1,this.dragControls.enabled=!0,this.dragEntity!==null||!((o=(a=this.focusEntity)==null?void 0:a.wantsDrag)!=null&&o.call(a,s)))return;this.dragEntity=this.focusEntity,(u=(l=this.dragEntity)==null?void 0:l.onDragStart)==null||u.call(l,s),this.updateCursor(s)}},!1),this.window.addEventListener("keyup",s=>{var a,o;s.key==="Shift"&&(this.mapControls.enabled=!0,this.dragControls.enabled=!1,(o=(a=this.dragEntity)==null?void 0:a.onDragEnd)==null||o.call(a,s),this.dragEntity=null,this.updateCursor(s))},!1)}buildKeyboardHandler(){this.window.addEventListener("keydown",t=>{const e={" ":()=>this.togglePlaying(),Escape:()=>this.stopForceSimulation(),Home:()=>this.resetPlayer()}[t.key];e&&(t.preventDefault(),e())},!1)}buildScene(){const t=new s1(16777198,4);t.position.set(250,300,200),t.castShadow=!0,t.shadow.camera.left=-400,t.shadow.camera.right=400,t.shadow.camera.top=400,t.shadow.camera.bottom=-400,t.shadow.mapSize.width=4096,t.shadow.mapSize.height=4096,this.scene.add(t);const e=8900331,i=15395578,r=12246694,s=12237498,a=new n1(i,s,2.2);this.scene.add(a);const o=new Dn(new Lh(1e5,64),new Ar({color:r,roughness:1,metalness:0,flatShading:!0}));o.rotation.x=-Math.PI/2,o.position.y=-10,this.scene.add(o),this.renderer.setClearColor(e),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=Xp,this.updateScene()}buildPlayer(t){this.player=new lD(t);const e=t.querySelector("#timeline");this.timeline=new uD(e),this.player.on("step",()=>this.timeline.time=this.player.cursor.currentTime);{let i=!1;this.timeline.on("startDrag",()=>{i=this.player.isPlaying,this.player.pause()}),this.timeline.on("endDrag",()=>{i&&this.player.resume()})}this.timeline.on("time",()=>this.player.currentTime=this.timeline.time)}buildTrace(t){this.traceEntity&&(this.stopForceSimulation(),this.scene.remove(this.traceEntity.object3d),this.player.off("isPlaying",this.traceEntity.mapSyncTrailToPlayer)),this.traceEntity=t.entity,this.scene.add(t),this.player.trail=this.traceEntity.trail,this.player.on("isPlaying",this.traceEntity.mapSyncTrailToPlayer=e=>{this.traceEntity.trail.deferUpdates=!1}),this.initHoverableObjects(),this.updateScene()}initHoverableObjects(){const t=[...this.scene.children];for(this.hoverableObject3ds=[];t.length>0;){const e=t.pop();e.visible!==!1&&e.entity&&(e.entity.wantsMouse&&!e.entity.wantsMouse()||(this.hoverableObject3ds.push(e),t.push(...e.children)))}}async loadTraceFromServerFile(t,e){return await this.loadTrace(gp.readTraceFromServerFile(t),e)}async loadTraceFromString(t,e){return await this.loadTrace(gp.readTraceFromString(t),e)}loadTrace(t,e=void 0){return this.beBusyDuring(async()=>{this.trace=await t,e??(e=this.defaultStyle),this.entityBuilder=tf.newForStyle(e,this.trace),await this.reloadTrace()})}reloadTrace(){return this.beBusyDuring(async()=>{this.player&&this.player.reset();const t=this.entityBuilder.build(this);this.buildTrace(t),this.reloadPlayer(),this.traceEntity.trail.deferUpdates=!0,(this.options.autoStart??!1)&&setTimeout(()=>this.player.start(),3e3)})}reloadPlayer(){this.player.setToTrace(this.trace,this.traceEntity),this.timeline.minTime=this.player.cursor.startTime,this.timeline.maxTime=this.player.cursor.endTime}async beBusyDuring(t){if(this.mouseCursor==="wait")return await t();const e=this.mouseCursor;this.mouseCursor="wait";const i=this.renderer.domElement.style.cursor;this.renderer.domElement.style.cursor=this.mouseCursor;try{return await t()}finally{this.mouseCursor==="wait"&&(this.mouseCursor="progress",this.renderer.domElement.style.cursor=this.mouseCursor,setTimeout(()=>{this.mouseCursor==="progress"&&(this.mouseCursor=e,this.renderer.domElement.style.cursor=i)},0))}}stopForceSimulation(){this.traceEntity.stopForceSimulation()}resetPlayer(){this.player.reset()}togglePlaying(){this.player.togglePlaying()}updateScene(){this.renderRequired=!0}render(){var t,e;this.renderRequired&&(this.renderer.render(this.scene,this.camera),this.renderRequired=!1,this.renderedNow()),(t=this.mapControls)==null||t.update(),(e=this.stats)==null||e.update()}renderedNow(){var t;if((this.options.measureStartTime??!1)!==!1&&window.loadStartTime&&((t=this.player)!=null&&t.trail)){const e=window.loadStartTime;delete window.loadStartTime,setTimeout(()=>{const i=performance.now()-e;alert("time to load: "+i)},0)}}updateCursor(t){if(this.mouseCursor)return this.mouseCursor;let e="auto";this.dragControls.enabled?this.mouseOverEntities.forEach(i=>{if(this.dragControls.getObjects().some(r=>r===i.object3d)){e="move";return}}):this.mouseOverEntities.forEach(i=>{if(i.wantsClick(t)){e="pointer";return}}),this.renderer.domElement.style.cursor=e}updateViewport(){this.renderer.setSize(this.renderer.domElement.parentElement.clientWidth,this.renderer.domElement.parentElement.clientHeight),this.camera.aspect=this.renderer.domElement.clientWidth/this.renderer.domElement.clientHeight,this.camera.updateProjectionMatrix(),this.updateScene()}}if(!df.isWebGLAvailable()){const n=df.getWebGLErrorMessage();throw document.getElementById("container").appendChild(n),new Error("WebGL is not available")}async function pD(){const n=new dD,t="traces/regexParse.json",e="flatFDG",i=new URLSearchParams(window.location.search),r=i.get("trace")??t,s=i.get("style")??e,a=Object.fromEntries(i.entries());delete a.trace,delete a.style,Object.assign(n.options,a),n.buildMap(document.querySelector("#container"));const o=sessionStorage.getItem("trace");o?await n.loadTraceFromString(o,s):await n.loadTraceFromServerFile(r,s)}await pD(); diff --git a/assets/main-6242c730.js b/assets/main-6242c730.js new file mode 100644 index 0000000..ecf892a --- /dev/null +++ b/assets/main-6242c730.js @@ -0,0 +1,5 @@ +import{c as Or}from"./_commonjsHelpers-a1841df3.js";var xr={exports:{}};/*! + * Bootstrap v5.3.2 (https://getbootstrap.com/) + * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */(function(Be,hi){(function(j,ze){Be.exports=ze()})(Or,function(){const j=new Map,ze={set(i,e,t){j.has(i)||j.set(i,new Map);const n=j.get(i);n.has(e)||n.size===0?n.set(e,t):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(i,e)=>j.has(i)&&j.get(i).get(e)||null,remove(i,e){if(!j.has(i))return;const t=j.get(i);t.delete(e),t.size===0&&j.delete(i)}},At="transitionend",ui=i=>(i&&window.CSS&&window.CSS.escape&&(i=i.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),i),di=i=>{i.dispatchEvent(new Event(At))},ie=i=>!(!i||typeof i!="object")&&(i.jquery!==void 0&&(i=i[0]),i.nodeType!==void 0),ae=i=>ie(i)?i.jquery?i[0]:i:typeof i=="string"&&i.length>0?document.querySelector(ui(i)):null,Te=i=>{if(!ie(i)||i.getClientRects().length===0)return!1;const e=getComputedStyle(i).getPropertyValue("visibility")==="visible",t=i.closest("details:not([open])");if(!t)return e;if(t!==i){const n=i.closest("summary");if(n&&n.parentNode!==t||n===null)return!1}return e},le=i=>!i||i.nodeType!==Node.ELEMENT_NODE||!!i.classList.contains("disabled")||(i.disabled!==void 0?i.disabled:i.hasAttribute("disabled")&&i.getAttribute("disabled")!=="false"),fi=i=>{if(!document.documentElement.attachShadow)return null;if(typeof i.getRootNode=="function"){const e=i.getRootNode();return e instanceof ShadowRoot?e:null}return i instanceof ShadowRoot?i:i.parentNode?fi(i.parentNode):null},tt=()=>{},Re=i=>{i.offsetHeight},pi=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Tt=[],z=()=>document.documentElement.dir==="rtl",R=i=>{var e;e=()=>{const t=pi();if(t){const n=i.NAME,s=t.fn[n];t.fn[n]=i.jQueryInterface,t.fn[n].Constructor=i,t.fn[n].noConflict=()=>(t.fn[n]=s,i.jQueryInterface)}},document.readyState==="loading"?(Tt.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of Tt)t()}),Tt.push(e)):e()},M=(i,e=[],t=i)=>typeof i=="function"?i(...e):t,mi=(i,e,t=!0)=>{if(!t)return void M(i);const n=(r=>{if(!r)return 0;let{transitionDuration:a,transitionDelay:c}=window.getComputedStyle(r);const u=Number.parseFloat(a),d=Number.parseFloat(c);return u||d?(a=a.split(",")[0],c=c.split(",")[0],1e3*(Number.parseFloat(a)+Number.parseFloat(c))):0})(e)+5;let s=!1;const o=({target:r})=>{r===e&&(s=!0,e.removeEventListener(At,o),M(i))};e.addEventListener(At,o),setTimeout(()=>{s||di(e)},n)},Ct=(i,e,t,n)=>{const s=i.length;let o=i.indexOf(e);return o===-1?!t&&n?i[s-1]:i[0]:(o+=t?1:-1,n&&(o=(o+s)%s),i[Math.max(0,Math.min(o,s-1))])},os=/[^.]*(?=\..*)\.|.*/,rs=/\..*/,as=/::\d+$/,Ot={};let gi=1;const _i={mouseenter:"mouseover",mouseleave:"mouseout"},ls=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function bi(i,e){return e&&`${e}::${gi++}`||i.uidEvent||gi++}function vi(i){const e=bi(i);return i.uidEvent=e,Ot[e]=Ot[e]||{},Ot[e]}function yi(i,e,t=null){return Object.values(i).find(n=>n.callable===e&&n.delegationSelector===t)}function wi(i,e,t){const n=typeof e=="string",s=n?t:e||t;let o=Ai(i);return ls.has(o)||(o=i),[n,s,o]}function Ei(i,e,t,n,s){if(typeof e!="string"||!i)return;let[o,r,a]=wi(e,t,n);e in _i&&(r=(g=>function(m){if(!m.relatedTarget||m.relatedTarget!==m.delegateTarget&&!m.delegateTarget.contains(m.relatedTarget))return g.call(this,m)})(r));const c=vi(i),u=c[a]||(c[a]={}),d=yi(u,r,o?t:null);if(d)return void(d.oneOff=d.oneOff&&s);const h=bi(r,e.replace(os,"")),b=o?function(p,g,m){return function _(C){const k=p.querySelectorAll(g);for(let{target:y}=C;y&&y!==this;y=y.parentNode)for(const E of k)if(E===y)return kt(C,{delegateTarget:y}),_.oneOff&&l.off(p,C.type,g,m),m.apply(y,[C])}}(i,t,r):function(p,g){return function m(_){return kt(_,{delegateTarget:p}),m.oneOff&&l.off(p,_.type,g),g.apply(p,[_])}}(i,r);b.delegationSelector=o?t:null,b.callable=r,b.oneOff=s,b.uidEvent=h,u[h]=b,i.addEventListener(a,b,o)}function xt(i,e,t,n,s){const o=yi(e[t],n,s);o&&(i.removeEventListener(t,o,!!s),delete e[t][o.uidEvent])}function cs(i,e,t,n){const s=e[t]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&xt(i,e,t,r.callable,r.delegationSelector)}function Ai(i){return i=i.replace(rs,""),_i[i]||i}const l={on(i,e,t,n){Ei(i,e,t,n,!1)},one(i,e,t,n){Ei(i,e,t,n,!0)},off(i,e,t,n){if(typeof e!="string"||!i)return;const[s,o,r]=wi(e,t,n),a=r!==e,c=vi(i),u=c[r]||{},d=e.startsWith(".");if(o===void 0){if(d)for(const h of Object.keys(c))cs(i,c,h,e.slice(1));for(const[h,b]of Object.entries(u)){const p=h.replace(as,"");a&&!e.includes(p)||xt(i,c,r,b.callable,b.delegationSelector)}}else{if(!Object.keys(u).length)return;xt(i,c,r,o,s?t:null)}},trigger(i,e,t){if(typeof e!="string"||!i)return null;const n=pi();let s=null,o=!0,r=!0,a=!1;e!==Ai(e)&&n&&(s=n.Event(e,t),n(i).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const c=kt(new Event(e,{bubbles:o,cancelable:!0}),t);return a&&c.preventDefault(),r&&i.dispatchEvent(c),c.defaultPrevented&&s&&s.preventDefault(),c}};function kt(i,e={}){for(const[t,n]of Object.entries(e))try{i[t]=n}catch{Object.defineProperty(i,t,{configurable:!0,get:()=>n})}return i}function Ti(i){if(i==="true")return!0;if(i==="false")return!1;if(i===Number(i).toString())return Number(i);if(i===""||i==="null")return null;if(typeof i!="string")return i;try{return JSON.parse(decodeURIComponent(i))}catch{return i}}function Lt(i){return i.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const ne={setDataAttribute(i,e,t){i.setAttribute(`data-bs-${Lt(e)}`,t)},removeDataAttribute(i,e){i.removeAttribute(`data-bs-${Lt(e)}`)},getDataAttributes(i){if(!i)return{};const e={},t=Object.keys(i.dataset).filter(n=>n.startsWith("bs")&&!n.startsWith("bsConfig"));for(const n of t){let s=n.replace(/^bs/,"");s=s.charAt(0).toLowerCase()+s.slice(1,s.length),e[s]=Ti(i.dataset[n])}return e},getDataAttribute:(i,e)=>Ti(i.getAttribute(`data-bs-${Lt(e)}`))};class qe{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=ie(t)?ne.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof n=="object"?n:{},...ie(t)?ne.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[s,o]of Object.entries(t)){const r=e[s],a=ie(r)?"element":(n=r)==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${s}" provided type "${a}" but expected type "${o}".`)}var n}}class Y extends qe{constructor(e,t){super(),(e=ae(e))&&(this._element=e,this._config=this._getConfig(t),ze.set(this._element,this.constructor.DATA_KEY,this))}dispose(){ze.remove(this._element,this.constructor.DATA_KEY),l.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){mi(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return ze.get(ae(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return"5.3.2"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const St=i=>{let e=i.getAttribute("data-bs-target");if(!e||e==="#"){let t=i.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?ui(t.trim()):null}return e},f={find:(i,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,i)),findOne:(i,e=document.documentElement)=>Element.prototype.querySelector.call(e,i),children:(i,e)=>[].concat(...i.children).filter(t=>t.matches(e)),parents(i,e){const t=[];let n=i.parentNode.closest(e);for(;n;)t.push(n),n=n.parentNode.closest(e);return t},prev(i,e){let t=i.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(i,e){let t=i.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(i){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,i).filter(t=>!le(t)&&Te(t))},getSelectorFromElement(i){const e=St(i);return e&&f.findOne(e)?e:null},getElementFromSelector(i){const e=St(i);return e?f.findOne(e):null},getMultipleElementsFromSelector(i){const e=St(i);return e?f.find(e):[]}},it=(i,e="hide")=>{const t=`click.dismiss${i.EVENT_KEY}`,n=i.NAME;l.on(document,t,`[data-bs-dismiss="${n}"]`,function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),le(this))return;const o=f.getElementFromSelector(this)||this.closest(`.${n}`);i.getOrCreateInstance(o)[e]()})},Ci=".bs.alert",hs=`close${Ci}`,us=`closed${Ci}`;class Ve extends Y{static get NAME(){return"alert"}close(){if(l.trigger(this._element,hs).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),l.trigger(this._element,us),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Ve.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}it(Ve,"close"),R(Ve);const Oi='[data-bs-toggle="button"]';class Ue extends Y{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Ue.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}l.on(document,"click.bs.button.data-api",Oi,i=>{i.preventDefault();const e=i.target.closest(Oi);Ue.getOrCreateInstance(e).toggle()}),R(Ue);const Ce=".bs.swipe",ds=`touchstart${Ce}`,fs=`touchmove${Ce}`,ps=`touchend${Ce}`,ms=`pointerdown${Ce}`,gs=`pointerup${Ce}`,_s={endCallback:null,leftCallback:null,rightCallback:null},bs={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class nt extends qe{constructor(e,t){super(),this._element=e,e&&nt.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return _s}static get DefaultType(){return bs}static get NAME(){return"swipe"}dispose(){l.off(this._element,Ce)}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),M(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&M(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(l.on(this._element,ms,e=>this._start(e)),l.on(this._element,gs,e=>this._end(e)),this._element.classList.add("pointer-event")):(l.on(this._element,ds,e=>this._start(e)),l.on(this._element,fs,e=>this._move(e)),l.on(this._element,ps,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType==="pen"||e.pointerType==="touch")}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const ce=".bs.carousel",xi=".data-api",Ke="next",Oe="prev",xe="left",st="right",vs=`slide${ce}`,Dt=`slid${ce}`,ys=`keydown${ce}`,ws=`mouseenter${ce}`,Es=`mouseleave${ce}`,As=`dragstart${ce}`,Ts=`load${ce}${xi}`,Cs=`click${ce}${xi}`,ki="carousel",ot="active",Li=".active",Si=".carousel-item",Os=Li+Si,xs={ArrowLeft:st,ArrowRight:xe},ks={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Ls={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class ke extends Y{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=f.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===ki&&this.cycle()}static get Default(){return ks}static get DefaultType(){return Ls}static get NAME(){return"carousel"}next(){this._slide(Ke)}nextWhenVisible(){!document.hidden&&Te(this._element)&&this.next()}prev(){this._slide(Oe)}pause(){this._isSliding&&di(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?l.one(this._element,Dt,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void l.one(this._element,Dt,()=>this.to(e));const n=this._getItemIndex(this._getActive());if(n===e)return;const s=e>n?Ke:Oe;this._slide(s,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&l.on(this._element,ys,e=>this._keydown(e)),this._config.pause==="hover"&&(l.on(this._element,ws,()=>this.pause()),l.on(this._element,Es,()=>this._maybeEnableCycle())),this._config.touch&&nt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of f.find(".carousel-item img",this._element))l.on(t,As,n=>n.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(xe)),rightCallback:()=>this._slide(this._directionToOrder(st)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new nt(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=xs[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=f.findOne(Li,this._indicatorsElement);t.classList.remove(ot),t.removeAttribute("aria-current");const n=f.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add(ot),n.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const n=this._getActive(),s=e===Ke,o=t||Ct(this._getItems(),n,s,this._config.wrap);if(o===n)return;const r=this._getItemIndex(o),a=h=>l.trigger(this._element,h,{relatedTarget:o,direction:this._orderToDirection(e),from:this._getItemIndex(n),to:r});if(a(vs).defaultPrevented||!n||!o)return;const c=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(r),this._activeElement=o;const u=s?"carousel-item-start":"carousel-item-end",d=s?"carousel-item-next":"carousel-item-prev";o.classList.add(d),Re(o),n.classList.add(u),o.classList.add(u),this._queueCallback(()=>{o.classList.remove(u,d),o.classList.add(ot),n.classList.remove(ot,d,u),this._isSliding=!1,a(Dt)},n,this._isAnimated()),c&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return f.findOne(Os,this._element)}_getItems(){return f.find(Si,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return z()?e===xe?Oe:Ke:e===xe?Ke:Oe}_orderToDirection(e){return z()?e===Oe?xe:st:e===Oe?st:xe}static jQueryInterface(e){return this.each(function(){const t=ke.getOrCreateInstance(this,e);if(typeof e!="number"){if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}l.on(document,Cs,"[data-bs-slide], [data-bs-slide-to]",function(i){const e=f.getElementFromSelector(this);if(!e||!e.classList.contains(ki))return;i.preventDefault();const t=ke.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(t.to(n),void t._maybeEnableCycle()):ne.getDataAttribute(this,"slide")==="next"?(t.next(),void t._maybeEnableCycle()):(t.prev(),void t._maybeEnableCycle())}),l.on(window,Ts,()=>{const i=f.find('[data-bs-ride="carousel"]');for(const e of i)ke.getOrCreateInstance(e)}),R(ke);const Xe=".bs.collapse",Ss=`show${Xe}`,Ds=`shown${Xe}`,$s=`hide${Xe}`,Is=`hidden${Xe}`,Ns=`click${Xe}.data-api`,$t="show",Le="collapse",rt="collapsing",Ps=`:scope .${Le} .${Le}`,It='[data-bs-toggle="collapse"]',js={parent:null,toggle:!0},Ms={parent:"(null|element)",toggle:"boolean"};class Se extends Y{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=f.find(It);for(const s of n){const o=f.getSelectorFromElement(s),r=f.find(o).filter(a=>a===this._element);o!==null&&r.length&&this._triggerArray.push(s)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return js}static get DefaultType(){return Ms}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(s=>s!==this._element).map(s=>Se.getOrCreateInstance(s,{toggle:!1}))),e.length&&e[0]._isTransitioning||l.trigger(this._element,Ss).defaultPrevented)return;for(const s of e)s.hide();const t=this._getDimension();this._element.classList.remove(Le),this._element.classList.add(rt),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(rt),this._element.classList.add(Le,$t),this._element.style[t]="",l.trigger(this._element,Ds)},this._element,!0),this._element.style[t]=`${this._element[n]}px`}hide(){if(this._isTransitioning||!this._isShown()||l.trigger(this._element,$s).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,Re(this._element),this._element.classList.add(rt),this._element.classList.remove(Le,$t);for(const t of this._triggerArray){const n=f.getElementFromSelector(t);n&&!this._isShown(n)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(rt),this._element.classList.add(Le),l.trigger(this._element,Is)},this._element,!0)}_isShown(e=this._element){return e.classList.contains($t)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=ae(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(It);for(const t of e){const n=f.getElementFromSelector(t);n&&this._addAriaAndCollapsedClass([t],this._isShown(n))}}_getFirstLevelChildren(e){const t=f.find(Ps,this._config.parent);return f.find(e,this._config.parent).filter(n=>!t.includes(n))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const n of e)n.classList.toggle("collapsed",!t),n.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const n=Se.getOrCreateInstance(this,t);if(typeof e=="string"){if(n[e]===void 0)throw new TypeError(`No method named "${e}"`);n[e]()}})}}l.on(document,Ns,It,function(i){(i.target.tagName==="A"||i.delegateTarget&&i.delegateTarget.tagName==="A")&&i.preventDefault();for(const e of f.getMultipleElementsFromSelector(this))Se.getOrCreateInstance(e,{toggle:!1}).toggle()}),R(Se);var $="top",F="bottom",H="right",I="left",at="auto",De=[$,F,H,I],fe="start",$e="end",Di="clippingParents",Nt="viewport",Ie="popper",$i="reference",Pt=De.reduce(function(i,e){return i.concat([e+"-"+fe,e+"-"+$e])},[]),jt=[].concat(De,[at]).reduce(function(i,e){return i.concat([e,e+"-"+fe,e+"-"+$e])},[]),Ii="beforeRead",Ni="read",Pi="afterRead",ji="beforeMain",Mi="main",Fi="afterMain",Hi="beforeWrite",Wi="write",Bi="afterWrite",zi=[Ii,Ni,Pi,ji,Mi,Fi,Hi,Wi,Bi];function Z(i){return i?(i.nodeName||"").toLowerCase():null}function W(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function pe(i){return i instanceof W(i).Element||i instanceof Element}function q(i){return i instanceof W(i).HTMLElement||i instanceof HTMLElement}function Mt(i){return typeof ShadowRoot<"u"&&(i instanceof W(i).ShadowRoot||i instanceof ShadowRoot)}const Ft={name:"applyStyles",enabled:!0,phase:"write",fn:function(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},s=e.attributes[t]||{},o=e.elements[t];q(o)&&Z(o)&&(Object.assign(o.style,n),Object.keys(s).forEach(function(r){var a=s[r];a===!1?o.removeAttribute(r):o.setAttribute(r,a===!0?"":a)}))})},effect:function(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var s=e.elements[n],o=e.attributes[n]||{},r=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]).reduce(function(a,c){return a[c]="",a},{});q(s)&&Z(s)&&(Object.assign(s.style,r),Object.keys(o).forEach(function(a){s.removeAttribute(a)}))})}},requires:["computeStyles"]};function J(i){return i.split("-")[0]}var me=Math.max,lt=Math.min,Ne=Math.round;function Ht(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ri(){return!/^((?!chrome|android).)*safari/i.test(Ht())}function Pe(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=i.getBoundingClientRect(),s=1,o=1;e&&q(i)&&(s=i.offsetWidth>0&&Ne(n.width)/i.offsetWidth||1,o=i.offsetHeight>0&&Ne(n.height)/i.offsetHeight||1);var r=(pe(i)?W(i):window).visualViewport,a=!Ri()&&t,c=(n.left+(a&&r?r.offsetLeft:0))/s,u=(n.top+(a&&r?r.offsetTop:0))/o,d=n.width/s,h=n.height/o;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function Wt(i){var e=Pe(i),t=i.offsetWidth,n=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:n}}function qi(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&Mt(t)){var n=e;do{if(n&&i.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function se(i){return W(i).getComputedStyle(i)}function Fs(i){return["table","td","th"].indexOf(Z(i))>=0}function he(i){return((pe(i)?i.ownerDocument:i.document)||window.document).documentElement}function ct(i){return Z(i)==="html"?i:i.assignedSlot||i.parentNode||(Mt(i)?i.host:null)||he(i)}function Vi(i){return q(i)&&se(i).position!=="fixed"?i.offsetParent:null}function Ye(i){for(var e=W(i),t=Vi(i);t&&Fs(t)&&se(t).position==="static";)t=Vi(t);return t&&(Z(t)==="html"||Z(t)==="body"&&se(t).position==="static")?e:t||function(n){var s=/firefox/i.test(Ht());if(/Trident/i.test(Ht())&&q(n)&&se(n).position==="fixed")return null;var o=ct(n);for(Mt(o)&&(o=o.host);q(o)&&["html","body"].indexOf(Z(o))<0;){var r=se(o);if(r.transform!=="none"||r.perspective!=="none"||r.contain==="paint"||["transform","perspective"].indexOf(r.willChange)!==-1||s&&r.willChange==="filter"||s&&r.filter&&r.filter!=="none")return o;o=o.parentNode}return null}(i)||e}function Bt(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Qe(i,e,t){return me(i,lt(e,t))}function Ui(i){return Object.assign({},{top:0,right:0,bottom:0,left:0},i)}function Ki(i,e){return e.reduce(function(t,n){return t[n]=i,t},{})}const Xi={name:"arrow",enabled:!0,phase:"main",fn:function(i){var e,t=i.state,n=i.name,s=i.options,o=t.elements.arrow,r=t.modifiersData.popperOffsets,a=J(t.placement),c=Bt(a),u=[I,H].indexOf(a)>=0?"height":"width";if(o&&r){var d=function(O,T){return Ui(typeof(O=typeof O=="function"?O(Object.assign({},T.rects,{placement:T.placement})):O)!="number"?O:Ki(O,De))}(s.padding,t),h=Wt(o),b=c==="y"?$:I,p=c==="y"?F:H,g=t.rects.reference[u]+t.rects.reference[c]-r[c]-t.rects.popper[u],m=r[c]-t.rects.reference[c],_=Ye(o),C=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,k=g/2-m/2,y=d[b],E=C-h[u]-d[p],v=C/2-h[u]/2+k,w=Qe(y,v,E),A=c;t.modifiersData[n]=((e={})[A]=w,e.centerOffset=w-v,e)}},effect:function(i){var e=i.state,t=i.options.element,n=t===void 0?"[data-popper-arrow]":t;n!=null&&(typeof n!="string"||(n=e.elements.popper.querySelector(n)))&&qi(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function je(i){return i.split("-")[1]}var Hs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Yi(i){var e,t=i.popper,n=i.popperRect,s=i.placement,o=i.variation,r=i.offsets,a=i.position,c=i.gpuAcceleration,u=i.adaptive,d=i.roundOffsets,h=i.isFixed,b=r.x,p=b===void 0?0:b,g=r.y,m=g===void 0?0:g,_=typeof d=="function"?d({x:p,y:m}):{x:p,y:m};p=_.x,m=_.y;var C=r.hasOwnProperty("x"),k=r.hasOwnProperty("y"),y=I,E=$,v=window;if(u){var w=Ye(t),A="clientHeight",O="clientWidth";w===W(t)&&se(w=he(t)).position!=="static"&&a==="absolute"&&(A="scrollHeight",O="scrollWidth"),(s===$||(s===I||s===H)&&o===$e)&&(E=F,m-=(h&&w===v&&v.visualViewport?v.visualViewport.height:w[A])-n.height,m*=c?1:-1),s!==I&&(s!==$&&s!==F||o!==$e)||(y=H,p-=(h&&w===v&&v.visualViewport?v.visualViewport.width:w[O])-n.width,p*=c?1:-1)}var T,S=Object.assign({position:a},u&&Hs),B=d===!0?function(G,N){var U=G.x,K=G.y,L=N.devicePixelRatio||1;return{x:Ne(U*L)/L||0,y:Ne(K*L)/L||0}}({x:p,y:m},W(t)):{x:p,y:m};return p=B.x,m=B.y,c?Object.assign({},S,((T={})[E]=k?"0":"",T[y]=C?"0":"",T.transform=(v.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",T)):Object.assign({},S,((e={})[E]=k?m+"px":"",e[y]=C?p+"px":"",e.transform="",e))}const zt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(i){var e=i.state,t=i.options,n=t.gpuAcceleration,s=n===void 0||n,o=t.adaptive,r=o===void 0||o,a=t.roundOffsets,c=a===void 0||a,u={placement:J(e.placement),variation:je(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Yi(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Yi(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var ht={passive:!0};const Rt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(i){var e=i.state,t=i.instance,n=i.options,s=n.scroll,o=s===void 0||s,r=n.resize,a=r===void 0||r,c=W(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",t.update,ht)}),a&&c.addEventListener("resize",t.update,ht),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",t.update,ht)}),a&&c.removeEventListener("resize",t.update,ht)}},data:{}};var Ws={left:"right",right:"left",bottom:"top",top:"bottom"};function ut(i){return i.replace(/left|right|bottom|top/g,function(e){return Ws[e]})}var Bs={start:"end",end:"start"};function Qi(i){return i.replace(/start|end/g,function(e){return Bs[e]})}function qt(i){var e=W(i);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Vt(i){return Pe(he(i)).left+qt(i).scrollLeft}function Ut(i){var e=se(i),t=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+n)}function Gi(i){return["html","body","#document"].indexOf(Z(i))>=0?i.ownerDocument.body:q(i)&&Ut(i)?i:Gi(ct(i))}function Ge(i,e){var t;e===void 0&&(e=[]);var n=Gi(i),s=n===((t=i.ownerDocument)==null?void 0:t.body),o=W(n),r=s?[o].concat(o.visualViewport||[],Ut(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(Ge(ct(r)))}function Kt(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function Zi(i,e,t){return e===Nt?Kt(function(n,s){var o=W(n),r=he(n),a=o.visualViewport,c=r.clientWidth,u=r.clientHeight,d=0,h=0;if(a){c=a.width,u=a.height;var b=Ri();(b||!b&&s==="fixed")&&(d=a.offsetLeft,h=a.offsetTop)}return{width:c,height:u,x:d+Vt(n),y:h}}(i,t)):pe(e)?function(n,s){var o=Pe(n,!1,s==="fixed");return o.top=o.top+n.clientTop,o.left=o.left+n.clientLeft,o.bottom=o.top+n.clientHeight,o.right=o.left+n.clientWidth,o.width=n.clientWidth,o.height=n.clientHeight,o.x=o.left,o.y=o.top,o}(e,t):Kt(function(n){var s,o=he(n),r=qt(n),a=(s=n.ownerDocument)==null?void 0:s.body,c=me(o.scrollWidth,o.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),u=me(o.scrollHeight,o.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),d=-r.scrollLeft+Vt(n),h=-r.scrollTop;return se(a||o).direction==="rtl"&&(d+=me(o.clientWidth,a?a.clientWidth:0)-c),{width:c,height:u,x:d,y:h}}(he(i)))}function Ji(i){var e,t=i.reference,n=i.element,s=i.placement,o=s?J(s):null,r=s?je(s):null,a=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2;switch(o){case $:e={x:a,y:t.y-n.height};break;case F:e={x:a,y:t.y+t.height};break;case H:e={x:t.x+t.width,y:c};break;case I:e={x:t.x-n.width,y:c};break;default:e={x:t.x,y:t.y}}var u=o?Bt(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(r){case fe:e[u]=e[u]-(t[d]/2-n[d]/2);break;case $e:e[u]=e[u]+(t[d]/2-n[d]/2)}}return e}function Me(i,e){e===void 0&&(e={});var t=e,n=t.placement,s=n===void 0?i.placement:n,o=t.strategy,r=o===void 0?i.strategy:o,a=t.boundary,c=a===void 0?Di:a,u=t.rootBoundary,d=u===void 0?Nt:u,h=t.elementContext,b=h===void 0?Ie:h,p=t.altBoundary,g=p!==void 0&&p,m=t.padding,_=m===void 0?0:m,C=Ui(typeof _!="number"?_:Ki(_,De)),k=b===Ie?$i:Ie,y=i.rects.popper,E=i.elements[g?k:b],v=function(N,U,K,L){var ee=U==="clippingParents"?function(x){var P=Ge(ct(x)),X=["absolute","fixed"].indexOf(se(x).position)>=0&&q(x)?Ye(x):x;return pe(X)?P.filter(function(de){return pe(de)&&qi(de,X)&&Z(de)!=="body"}):[]}(N):[].concat(U),te=[].concat(ee,[K]),We=te[0],D=te.reduce(function(x,P){var X=Zi(N,P,L);return x.top=me(X.top,x.top),x.right=lt(X.right,x.right),x.bottom=lt(X.bottom,x.bottom),x.left=me(X.left,x.left),x},Zi(N,We,L));return D.width=D.right-D.left,D.height=D.bottom-D.top,D.x=D.left,D.y=D.top,D}(pe(E)?E:E.contextElement||he(i.elements.popper),c,d,r),w=Pe(i.elements.reference),A=Ji({reference:w,element:y,strategy:"absolute",placement:s}),O=Kt(Object.assign({},y,A)),T=b===Ie?O:w,S={top:v.top-T.top+C.top,bottom:T.bottom-v.bottom+C.bottom,left:v.left-T.left+C.left,right:T.right-v.right+C.right},B=i.modifiersData.offset;if(b===Ie&&B){var G=B[s];Object.keys(S).forEach(function(N){var U=[H,F].indexOf(N)>=0?1:-1,K=[$,F].indexOf(N)>=0?"y":"x";S[N]+=G[K]*U})}return S}function zs(i,e){e===void 0&&(e={});var t=e,n=t.placement,s=t.boundary,o=t.rootBoundary,r=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,u=c===void 0?jt:c,d=je(n),h=d?a?Pt:Pt.filter(function(g){return je(g)===d}):De,b=h.filter(function(g){return u.indexOf(g)>=0});b.length===0&&(b=h);var p=b.reduce(function(g,m){return g[m]=Me(i,{placement:m,boundary:s,rootBoundary:o,padding:r})[J(m)],g},{});return Object.keys(p).sort(function(g,m){return p[g]-p[m]})}const en={name:"flip",enabled:!0,phase:"main",fn:function(i){var e=i.state,t=i.options,n=i.name;if(!e.modifiersData[n]._skip){for(var s=t.mainAxis,o=s===void 0||s,r=t.altAxis,a=r===void 0||r,c=t.fallbackPlacements,u=t.padding,d=t.boundary,h=t.rootBoundary,b=t.altBoundary,p=t.flipVariations,g=p===void 0||p,m=t.allowedAutoPlacements,_=e.options.placement,C=J(_),k=c||(C!==_&&g?function(x){if(J(x)===at)return[];var P=ut(x);return[Qi(x),P,Qi(P)]}(_):[ut(_)]),y=[_].concat(k).reduce(function(x,P){return x.concat(J(P)===at?zs(e,{placement:P,boundary:d,rootBoundary:h,padding:u,flipVariations:g,allowedAutoPlacements:m}):P)},[]),E=e.rects.reference,v=e.rects.popper,w=new Map,A=!0,O=y[0],T=0;T=0,U=N?"width":"height",K=Me(e,{placement:S,boundary:d,rootBoundary:h,altBoundary:b,padding:u}),L=N?G?H:I:G?F:$;E[U]>v[U]&&(L=ut(L));var ee=ut(L),te=[];if(o&&te.push(K[B]<=0),a&&te.push(K[L]<=0,K[ee]<=0),te.every(function(x){return x})){O=S,A=!1;break}w.set(S,te)}if(A)for(var We=function(x){var P=y.find(function(X){var de=w.get(X);if(de)return de.slice(0,x).every(function(yt){return yt})});if(P)return O=P,"break"},D=g?3:1;D>0&&We(D)!=="break";D--);e.placement!==O&&(e.modifiersData[n]._skip=!0,e.placement=O,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function tn(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function nn(i){return[$,H,F,I].some(function(e){return i[e]>=0})}const sn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(i){var e=i.state,t=i.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=Me(e,{elementContext:"reference"}),a=Me(e,{altBoundary:!0}),c=tn(r,n),u=tn(a,s,o),d=nn(c),h=nn(u);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}},on={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(i){var e=i.state,t=i.options,n=i.name,s=t.offset,o=s===void 0?[0,0]:s,r=jt.reduce(function(d,h){return d[h]=function(b,p,g){var m=J(b),_=[I,$].indexOf(m)>=0?-1:1,C=typeof g=="function"?g(Object.assign({},p,{placement:b})):g,k=C[0],y=C[1];return k=k||0,y=(y||0)*_,[I,H].indexOf(m)>=0?{x:y,y:k}:{x:k,y}}(h,e.rects,o),d},{}),a=r[e.placement],c=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=r}},Xt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(i){var e=i.state,t=i.name;e.modifiersData[t]=Ji({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},rn={name:"preventOverflow",enabled:!0,phase:"main",fn:function(i){var e=i.state,t=i.options,n=i.name,s=t.mainAxis,o=s===void 0||s,r=t.altAxis,a=r!==void 0&&r,c=t.boundary,u=t.rootBoundary,d=t.altBoundary,h=t.padding,b=t.tether,p=b===void 0||b,g=t.tetherOffset,m=g===void 0?0:g,_=Me(e,{boundary:c,rootBoundary:u,padding:h,altBoundary:d}),C=J(e.placement),k=je(e.placement),y=!k,E=Bt(C),v=E==="x"?"y":"x",w=e.modifiersData.popperOffsets,A=e.rects.reference,O=e.rects.popper,T=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,S=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),B=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,G={x:0,y:0};if(w){if(o){var N,U=E==="y"?$:I,K=E==="y"?F:H,L=E==="y"?"height":"width",ee=w[E],te=ee+_[U],We=ee-_[K],D=p?-O[L]/2:0,x=k===fe?A[L]:O[L],P=k===fe?-O[L]:-A[L],X=e.elements.arrow,de=p&&X?Wt(X):{width:0,height:0},yt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Un=yt[U],Kn=yt[K],wt=Qe(0,A[L],de[L]),br=y?A[L]/2-D-wt-Un-S.mainAxis:x-wt-Un-S.mainAxis,vr=y?-A[L]/2+D+wt+Kn+S.mainAxis:P+wt+Kn+S.mainAxis,ai=e.elements.arrow&&Ye(e.elements.arrow),yr=ai?E==="y"?ai.clientTop||0:ai.clientLeft||0:0,Xn=(N=B==null?void 0:B[E])!=null?N:0,wr=ee+vr-Xn,Yn=Qe(p?lt(te,ee+br-Xn-yr):te,ee,p?me(We,wr):We);w[E]=Yn,G[E]=Yn-ee}if(a){var Qn,Er=E==="x"?$:I,Ar=E==="x"?F:H,Ae=w[v],Et=v==="y"?"height":"width",Gn=Ae+_[Er],Zn=Ae-_[Ar],li=[$,I].indexOf(C)!==-1,Jn=(Qn=B==null?void 0:B[v])!=null?Qn:0,es=li?Gn:Ae-A[Et]-O[Et]-Jn+S.altAxis,ts=li?Ae+A[Et]+O[Et]-Jn-S.altAxis:Zn,is=p&&li?function(Tr,Cr,ci){var ns=Qe(Tr,Cr,ci);return ns>ci?ci:ns}(es,Ae,ts):Qe(p?es:Gn,Ae,p?ts:Zn);w[v]=is,G[v]=is-Ae}e.modifiersData[n]=G}},requiresIfExists:["offset"]};function Rs(i,e,t){t===void 0&&(t=!1);var n,s,o=q(e),r=q(e)&&function(h){var b=h.getBoundingClientRect(),p=Ne(b.width)/h.offsetWidth||1,g=Ne(b.height)/h.offsetHeight||1;return p!==1||g!==1}(e),a=he(e),c=Pe(i,r,t),u={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(o||!o&&!t)&&((Z(e)!=="body"||Ut(a))&&(u=(n=e)!==W(n)&&q(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:qt(n)),q(e)?((d=Pe(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=Vt(a))),{x:c.left+u.scrollLeft-d.x,y:c.top+u.scrollTop-d.y,width:c.width,height:c.height}}function qs(i){var e=new Map,t=new Set,n=[];function s(o){t.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach(function(r){if(!t.has(r)){var a=e.get(r);a&&s(a)}}),n.push(o)}return i.forEach(function(o){e.set(o.name,o)}),i.forEach(function(o){t.has(o.name)||s(o)}),n}var an={placement:"bottom",modifiers:[],strategy:"absolute"};function ln(){for(var i=arguments.length,e=new Array(i),t=0;tNumber.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(ne.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...M(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const n=f.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(s=>Te(s));n.length&&Ct(n,t,e===un,!n.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Q.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0)throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===2||e.type==="keyup"&&e.key!=="Tab")return;const t=f.find(Js);for(const n of t){const s=Q.getInstance(n);if(!s||s._config.autoClose===!1)continue;const o=e.composedPath(),r=o.includes(s._menu);if(o.includes(s._element)||s._config.autoClose==="inside"&&!r||s._config.autoClose==="outside"&&r||s._menu.contains(e.target)&&(e.type==="keyup"&&e.key==="Tab"||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const a={relatedTarget:s._element};e.type==="click"&&(a.clickEvent=e),s._completeHide(a)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),n=e.key==="Escape",s=[Ks,un].includes(e.key);if(!s&&!n||t&&!n)return;e.preventDefault();const o=this.matches(_e)?this:f.prev(this,_e)[0]||f.next(this,_e)[0]||f.findOne(_e,e.delegateTarget.parentNode),r=Q.getOrCreateInstance(o);if(s)return e.stopPropagation(),r.show(),void r._selectMenuItem(e);r._isShown()&&(e.stopPropagation(),r.hide(),o.focus())}}l.on(document,fn,_e,Q.dataApiKeydownHandler),l.on(document,fn,ft,Q.dataApiKeydownHandler),l.on(document,dn,Q.clearMenus),l.on(document,Zs,Q.clearMenus),l.on(document,dn,_e,function(i){i.preventDefault(),Q.getOrCreateInstance(this).toggle()}),R(Q);const pn="backdrop",mn="show",gn=`mousedown.bs.${pn}`,lo={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},co={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class _n extends qe{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return lo}static get DefaultType(){return co}static get NAME(){return pn}show(e){if(!this._config.isVisible)return void M(e);this._append();const t=this._getElement();this._config.isAnimated&&Re(t),t.classList.add(mn),this._emulateAnimation(()=>{M(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(mn),this._emulateAnimation(()=>{this.dispose(),M(e)})):M(e)}dispose(){this._isAppended&&(l.off(this._element,gn),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=ae(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),l.on(e,gn,()=>{M(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){mi(e,this._getElement(),this._config.isAnimated)}}const pt=".bs.focustrap",ho=`focusin${pt}`,uo=`keydown.tab${pt}`,bn="backward",fo={autofocus:!0,trapElement:null},po={autofocus:"boolean",trapElement:"element"};class vn extends qe{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return fo}static get DefaultType(){return po}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),l.off(document,pt),l.on(document,ho,e=>this._handleFocusin(e)),l.on(document,uo,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,l.off(document,pt))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=f.focusableChildren(t);n.length===0?t.focus():this._lastTabNavDirection===bn?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){e.key==="Tab"&&(this._lastTabNavDirection=e.shiftKey?bn:"forward")}}const yn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",wn=".sticky-top",mt="padding-right",En="margin-right";class Gt{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,mt,t=>t+e),this._setElementAttributes(yn,mt,t=>t+e),this._setElementAttributes(wn,En,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,mt),this._resetElementAttributes(yn,mt),this._resetElementAttributes(wn,En)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const s=this.getWidth();this._applyManipulationCallback(e,o=>{if(o!==this._element&&window.innerWidth>o.clientWidth+s)return;this._saveInitialAttribute(o,t);const r=window.getComputedStyle(o).getPropertyValue(t);o.style.setProperty(t,`${n(Number.parseFloat(r))}px`)})}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&ne.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,n=>{const s=ne.getDataAttribute(n,t);s!==null?(ne.removeDataAttribute(n,t),n.style.setProperty(t,s)):n.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(ie(e))t(e);else for(const n of f.find(e,this._element))t(n)}}const V=".bs.modal",mo=`hide${V}`,go=`hidePrevented${V}`,An=`hidden${V}`,Tn=`show${V}`,_o=`shown${V}`,bo=`resize${V}`,vo=`click.dismiss${V}`,yo=`mousedown.dismiss${V}`,wo=`keydown.dismiss${V}`,Eo=`click${V}.data-api`,Cn="modal-open",On="show",Zt="modal-static",Ao={backdrop:!0,focus:!0,keyboard:!0},To={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class be extends Y{constructor(e,t){super(e,t),this._dialog=f.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Gt,this._addEventListeners()}static get Default(){return Ao}static get DefaultType(){return To}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||l.trigger(this._element,Tn,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Cn),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&(l.trigger(this._element,mo).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(On),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){l.off(window,V),l.off(this._dialog,V),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new _n({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new vn({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=f.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),Re(this._element),this._element.classList.add(On),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,l.trigger(this._element,_o,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){l.on(this._element,wo,e=>{e.key==="Escape"&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),l.on(window,bo,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),l.on(this._element,yo,e=>{l.one(this._element,vo,t=>{this._element===e.target&&this._element===t.target&&(this._config.backdrop!=="static"?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Cn),this._resetAdjustments(),this._scrollBar.reset(),l.trigger(this._element,An)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(l.trigger(this._element,go).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;t==="hidden"||this._element.classList.contains(Zt)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Zt),this._queueCallback(()=>{this._element.classList.remove(Zt),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const s=z()?"paddingLeft":"paddingRight";this._element.style[s]=`${t}px`}if(!n&&e){const s=z()?"paddingRight":"paddingLeft";this._element.style[s]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const n=be.getOrCreateInstance(this,e);if(typeof e=="string"){if(n[e]===void 0)throw new TypeError(`No method named "${e}"`);n[e](t)}})}}l.on(document,Eo,'[data-bs-toggle="modal"]',function(i){const e=f.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&i.preventDefault(),l.one(e,Tn,n=>{n.defaultPrevented||l.one(e,An,()=>{Te(this)&&this.focus()})});const t=f.findOne(".modal.show");t&&be.getInstance(t).hide(),be.getOrCreateInstance(e).toggle(this)}),it(be),R(be);const oe=".bs.offcanvas",xn=".data-api",Co=`load${oe}${xn}`,kn="show",Ln="showing",Sn="hiding",Dn=".offcanvas.show",Oo=`show${oe}`,xo=`shown${oe}`,ko=`hide${oe}`,$n=`hidePrevented${oe}`,In=`hidden${oe}`,Lo=`resize${oe}`,So=`click${oe}${xn}`,Do=`keydown.dismiss${oe}`,$o={backdrop:!0,keyboard:!0,scroll:!1},Io={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class re extends Y{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return $o}static get DefaultType(){return Io}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||l.trigger(this._element,Oo,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new Gt().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Ln),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(kn),this._element.classList.remove(Ln),l.trigger(this._element,xo,{relatedTarget:e})},this._element,!0))}hide(){this._isShown&&(l.trigger(this._element,ko).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Sn),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(kn,Sn),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new Gt().reset(),l.trigger(this._element,In)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=!!this._config.backdrop;return new _n({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{this._config.backdrop!=="static"?this.hide():l.trigger(this._element,$n)}:null})}_initializeFocusTrap(){return new vn({trapElement:this._element})}_addEventListeners(){l.on(this._element,Do,e=>{e.key==="Escape"&&(this._config.keyboard?this.hide():l.trigger(this._element,$n))})}static jQueryInterface(e){return this.each(function(){const t=re.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}l.on(document,So,'[data-bs-toggle="offcanvas"]',function(i){const e=f.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),le(this))return;l.one(e,In,()=>{Te(this)&&this.focus()});const t=f.findOne(Dn);t&&t!==e&&re.getInstance(t).hide(),re.getOrCreateInstance(e).toggle(this)}),l.on(window,Co,()=>{for(const i of f.find(Dn))re.getOrCreateInstance(i).show()}),l.on(window,Lo,()=>{for(const i of f.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(i).position!=="fixed"&&re.getOrCreateInstance(i).hide()}),it(re),R(re);const Nn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},No=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Po=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,jo=(i,e)=>{const t=i.nodeName.toLowerCase();return e.includes(t)?!No.has(t)||!!Po.test(i.nodeValue):e.filter(n=>n instanceof RegExp).some(n=>n.test(t))},Mo={allowList:Nn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Fo={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Ho={entry:"(string|element|function|null)",selector:"(string|element)"};class Wo extends qe{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Mo}static get DefaultType(){return Fo}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[s,o]of Object.entries(this._config.content))this._setContent(e,o,s);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},Ho)}_setContent(e,t,n){const s=f.findOne(n,e);s&&((t=this._resolvePossibleFunction(t))?ie(t)?this._putElementInTemplate(ae(t),s):this._config.html?s.innerHTML=this._maybeSanitize(t):s.textContent=t:s.remove())}_maybeSanitize(e){return this._config.sanitize?function(t,n,s){if(!t.length)return t;if(s&&typeof s=="function")return s(t);const o=new window.DOMParser().parseFromString(t,"text/html"),r=[].concat(...o.body.querySelectorAll("*"));for(const a of r){const c=a.nodeName.toLowerCase();if(!Object.keys(n).includes(c)){a.remove();continue}const u=[].concat(...a.attributes),d=[].concat(n["*"]||[],n[c]||[]);for(const h of u)jo(h,d)||a.removeAttribute(h.nodeName)}return o.body.innerHTML}(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return M(e,[this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const Bo=new Set(["sanitize","allowList","sanitizeFn"]),Jt="fade",gt="show",Pn=".modal",jn="hide.bs.modal",Ze="hover",ei="focus",zo={AUTO:"auto",TOP:"top",RIGHT:z()?"left":"right",BOTTOM:"bottom",LEFT:z()?"right":"left"},Ro={allowList:Nn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},qo={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class ve extends Y{constructor(e,t){if(cn===void 0)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Ro}static get DefaultType(){return qo}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),l.off(this._element.closest(Pn),jn,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=l.trigger(this._element,this.constructor.eventName("show")),t=(fi(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:s}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(s.append(n),l.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(n),n.classList.add(gt),"ontouchstart"in document.documentElement)for(const o of[].concat(...document.body.children))l.on(o,"mouseover",tt);this._queueCallback(()=>{l.trigger(this._element,this.constructor.eventName("shown")),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!l.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(gt),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))l.off(e,"mouseover",tt);this._activeTrigger.click=!1,this._activeTrigger[ei]=!1,this._activeTrigger[Ze]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),l.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Jt,gt),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=(s=>{do s+=Math.floor(1e6*Math.random());while(document.getElementById(s));return s})(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(Jt),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Wo({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Jt)}_isShown(){return this.tip&&this.tip.classList.contains(gt)}_createPopper(e){const t=M(this._config.placement,[this,e,this._element]),n=zo[t.toUpperCase()];return Yt(this._element,e,this._getPopperConfig(n))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return M(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:n=>{this._getTipElement().setAttribute("data-popper-placement",n.state.placement)}}]};return{...t,...M(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")l.on(this._element,this.constructor.eventName("click"),this._config.selector,n=>{this._initializeOnDelegatedTarget(n).toggle()});else if(t!=="manual"){const n=t===Ze?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),s=t===Ze?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");l.on(this._element,n,this._config.selector,o=>{const r=this._initializeOnDelegatedTarget(o);r._activeTrigger[o.type==="focusin"?ei:Ze]=!0,r._enter()}),l.on(this._element,s,this._config.selector,o=>{const r=this._initializeOnDelegatedTarget(o);r._activeTrigger[o.type==="focusout"?ei:Ze]=r._element.contains(o.relatedTarget),r._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},l.on(this._element.closest(Pn),jn,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=ne.getDataAttributes(this._element);for(const n of Object.keys(t))Bo.has(n)&&delete t[n];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:ae(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=ve.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0)throw new TypeError(`No method named "${e}"`);t[e]()}})}}R(ve);const Vo={...ve.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Uo={...ve.DefaultType,content:"(null|string|element|function)"};class _t extends ve{static get Default(){return Vo}static get DefaultType(){return Uo}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=_t.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0)throw new TypeError(`No method named "${e}"`);t[e]()}})}}R(_t);const ti=".bs.scrollspy",Ko=`activate${ti}`,Mn=`click${ti}`,Xo=`load${ti}.data-api`,He="active",ii="[href]",Fn=".nav-link",Yo=`${Fn}, .nav-item > ${Fn}, .list-group-item`,Qo={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Go={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Je extends Y{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Qo}static get DefaultType(){return Go}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=ae(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(l.off(this._config.target,Mn),l.on(this._config.target,Mn,ii,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const n=this._rootElement||window,s=t.offsetTop-this._element.offsetTop;if(n.scrollTo)return void n.scrollTo({top:s,behavior:"smooth"});n.scrollTop=s}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=r=>this._targetLinks.get(`#${r.target.id}`),n=r=>{this._previousScrollData.visibleEntryTop=r.target.offsetTop,this._process(t(r))},s=(this._rootElement||document.documentElement).scrollTop,o=s>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=s;for(const r of e){if(!r.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(r));continue}const a=r.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(n(r),!s)return}else o||a||n(r)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=f.find(ii,this._config.target);for(const t of e){if(!t.hash||le(t))continue;const n=f.findOne(decodeURI(t.hash),this._element);Te(n)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,n))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(He),this._activateParents(e),l.trigger(this._element,Ko,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))f.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(He);else for(const t of f.parents(e,".nav, .list-group"))for(const n of f.prev(t,Yo))n.classList.add(He)}_clearActiveClass(e){e.classList.remove(He);const t=f.find(`${ii}.${He}`,e);for(const n of t)n.classList.remove(He)}static jQueryInterface(e){return this.each(function(){const t=Je.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}l.on(window,Xo,()=>{for(const i of f.find('[data-bs-spy="scroll"]'))Je.getOrCreateInstance(i)}),R(Je);const ye=".bs.tab",Zo=`hide${ye}`,Jo=`hidden${ye}`,er=`show${ye}`,tr=`shown${ye}`,ir=`click${ye}`,nr=`keydown${ye}`,sr=`load${ye}`,or="ArrowLeft",Hn="ArrowRight",rr="ArrowUp",Wn="ArrowDown",ni="Home",Bn="End",we="active",zn="fade",si="show",Rn=".dropdown-toggle",oi=`:not(${Rn})`,qn='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',ri=`.nav-link${oi}, .list-group-item${oi}, [role="tab"]${oi}, ${qn}`,ar=`.${we}[data-bs-toggle="tab"], .${we}[data-bs-toggle="pill"], .${we}[data-bs-toggle="list"]`;class Ee extends Y{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),l.on(this._element,nr,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?l.trigger(t,Zo,{relatedTarget:e}):null;l.trigger(e,er,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(we),this._activate(f.getElementFromSelector(e)),this._queueCallback(()=>{e.getAttribute("role")==="tab"?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),l.trigger(e,tr,{relatedTarget:t})):e.classList.add(si)},e,e.classList.contains(zn)))}_deactivate(e,t){e&&(e.classList.remove(we),e.blur(),this._deactivate(f.getElementFromSelector(e)),this._queueCallback(()=>{e.getAttribute("role")==="tab"?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),l.trigger(e,Jo,{relatedTarget:t})):e.classList.remove(si)},e,e.classList.contains(zn)))}_keydown(e){if(![or,Hn,rr,Wn,ni,Bn].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(s=>!le(s));let n;if([ni,Bn].includes(e.key))n=t[e.key===ni?0:t.length-1];else{const s=[Hn,Wn].includes(e.key);n=Ct(t,e.target,s,!0)}n&&(n.focus({preventScroll:!0}),Ee.getOrCreateInstance(n).show())}_getChildren(){return f.find(ri,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const n of t)this._setInitialAttributesOnChild(n)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=f.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const n=this._getOuterElement(e);if(!n.classList.contains("dropdown"))return;const s=(o,r)=>{const a=f.findOne(o,n);a&&a.classList.toggle(r,t)};s(Rn,we),s(".dropdown-menu",si),n.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains(we)}_getInnerElement(e){return e.matches(ri)?e:f.findOne(ri,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=Ee.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}l.on(document,ir,qn,function(i){["A","AREA"].includes(this.tagName)&&i.preventDefault(),le(this)||Ee.getOrCreateInstance(this).show()}),l.on(window,sr,()=>{for(const i of f.find(ar))Ee.getOrCreateInstance(i)}),R(Ee);const ue=".bs.toast",lr=`mouseover${ue}`,cr=`mouseout${ue}`,hr=`focusin${ue}`,ur=`focusout${ue}`,dr=`hide${ue}`,fr=`hidden${ue}`,pr=`show${ue}`,mr=`shown${ue}`,Vn="hide",bt="show",vt="showing",gr={animation:"boolean",autohide:"boolean",delay:"number"},_r={animation:!0,autohide:!0,delay:5e3};class et extends Y{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return _r}static get DefaultType(){return gr}static get NAME(){return"toast"}show(){l.trigger(this._element,pr).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Vn),Re(this._element),this._element.classList.add(bt,vt),this._queueCallback(()=>{this._element.classList.remove(vt),l.trigger(this._element,mr),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(l.trigger(this._element,dr).defaultPrevented||(this._element.classList.add(vt),this._queueCallback(()=>{this._element.classList.add(Vn),this._element.classList.remove(vt,bt),l.trigger(this._element,fr)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(bt),super.dispose()}isShown(){return this._element.classList.contains(bt)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){l.on(this._element,lr,e=>this._onInteraction(e,!0)),l.on(this._element,cr,e=>this._onInteraction(e,!1)),l.on(this._element,hr,e=>this._onInteraction(e,!0)),l.on(this._element,ur,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=et.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}return it(et),R(et),{Alert:Ve,Button:Ue,Carousel:ke,Collapse:Se,Dropdown:Q,Modal:be,Offcanvas:re,Popover:_t,ScrollSpy:Je,Tab:Ee,Toast:et,Tooltip:ve}})})(xr);const ss=document.querySelector('[t4d-template="trace"]'),kr=ss.parentElement,Lr=[{label:"Regular expression construction",name:"regexParse.json"},{label:"Regular expression matching",name:"regexMatch.json"},{label:"Morphic UI framework: Event handling",name:"mouseDown.json"},{label:"Morphic UI framework: Layout engine",name:"fullBoundsTextView.json"},{label:"Inspector tool initialization",name:"inspectorResetFields.json"},{label:"HTML parser",name:"asTextFromHtml.json"}];Lr.forEach(Be=>{const hi=`app.html?trace=traces/${Be.name}`,j=ss.cloneNode(!0);j.style.display="block",j.innerHTML=j.innerHTML.replace("t4d-template-href",hi).replace("t4d-template-label",Be.label).replace("t4d-template-name",Be.name),kr.appendChild(j)}); diff --git a/index.html b/index.html index 9c3ae09..463d9fc 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,8 @@ - + +