gridviz 1.2.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -204
- package/README.md +309 -0
- package/build/gridviz.min.js +1 -1
- package/package.json +71 -65
- package/readme.md +0 -246
package/build/gridviz.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gridviz=e():t.gridviz=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="build",n(n.s=13)}([,,,,function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var i=(a=r,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),o=r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([i]).join("\n")}var a,s,c;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var o=0;o<this.length;o++){var a=this[o][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var c=[].concat(t[s]);r&&i[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),e.push(c))}},e}},,,,,,,,,function(t,e,n){t.exports=n(26)},function(t,e,n){var r=n(15),i=n(16);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);t.exports=i.locals||{}},function(t,e,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function c(t,e){for(var n={},r=[],i=0;i<t.length;i++){var o=t[i],c=e.base?o[0]+e.base:o[0],l=n[c]||0,u="".concat(c," ").concat(l);n[c]=l+1;var h=s(u),d={css:o[1],media:o[2],sourceMap:o[3]};-1!==h?(a[h].references++,a[h].updater(d)):a.push({identifier:u,updater:g(d,e),references:1}),r.push(u)}return r}function l(t){var e=document.createElement("style"),r=t.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(t){e.setAttribute(t,r[t])})),"function"==typeof t.insert)t.insert(e);else{var a=o(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,h=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function d(t,e,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(t.styleSheet)t.styleSheet.cssText=h(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function f(t,e,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleSheet)t.styleSheet.cssText=r;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(r))}}var p=null,m=0;function g(t,e){var n,r,i;if(e.singleton){var o=m++;n=p||(p=l(e)),r=d.bind(null,n,o,!1),i=d.bind(null,n,o,!0)}else n=l(e),r=f.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=c(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var r=0;r<n.length;r++){var i=s(n[r]);a[i].references--}for(var o=c(t,e),l=0;l<n.length;l++){var u=s(n[l]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=o}}}},function(t,e,n){var r=n(4),i=n(17),o=n(18),a=n(19),s=n(24),c=n(25);(e=r(!1)).i(i),e.i(o),e.i(a),e.i(s),e.i(c),e.push([t.i,'.gridviz-plugin, .gridviz-icon-button, #gridviz-tooltip {\r\n opacity:0.9;\r\n}\r\n\r\n.gridviz-container {\r\n /* height:auto; */\r\n overflow:hidden;\r\n position: relative;\r\n margin: 0px; \r\n font-family: sans-serif;\r\n}\r\n.gridviz-headings-container {\r\n z-index:999999;\r\n position:absolute;\r\n top:10px;\r\n left:10px;\r\n padding:15px;\r\n}\r\n.gridviz-title {\r\n font-size: 1.2rem;\r\n font-weight:bold;\r\n}\r\n.gridviz-subtitle {\r\n font-size: 0.8rem;\r\n color: grey;\r\n font-weight:normal;\r\n margin-top:5px;\r\n}\r\n.gridviz-cellcount {\r\n font-size: 0.8rem;\r\n font-weight:normal;\r\n color: grey;\r\n margin-top:10px;\r\n}\r\n.gridviz-sources {\r\n position:absolute; \r\n bottom:1%;\r\n right:1%;\r\n font-size: 0.8rem;\r\n font-weight:bold;\r\n color:white;\r\n}\r\n.gridviz-sources a{\r\n color:white;\r\n}\r\n.gridviz-sources a:hover{\r\n color:lightblue !important;\r\n cursor:pointer;\r\n}\r\n\r\n\r\n.gridviz-plugin {\r\n background-color: #fff;\r\n border-radius: .25rem;\r\n color: black;\r\n fill: black;\r\n -webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);;\r\n-moz-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);;\r\nbox-shadow: 0 2px 5px 0 rgba(0,0,0,0.16), 0 2px 10px 0 rgba(0,0,0,0.12);;\r\n}\r\n.gridviz-select{\r\n width:100%;\r\n}\r\n\r\n\r\n\r\n/* Placenames */\r\n.gridviz-placename {\r\n z-index: 9;\r\n color: #fff;\r\n font-family: sans-serif;\r\n padding: 2px;\r\n background: rgba(0, 0, 0, 0.6);\r\n}\r\n\r\n\r\n\r\n\r\n/* PROGRESS BAR */\r\n#gridviz-progress-bar {\r\n position: absolute;\r\n top: 47%;\r\n left: 35%;\r\n width: 30%;\r\n background-color: grey;\r\n}\r\n#gridviz-progress-bar-bar {\r\n width: 1%;\r\n height: 30px;\r\n background-color: green;\r\n}\r\n\r\n/* loading text */\r\n#gridviz-loading-text {\r\ncolor:white;\r\n/* font-weight: bold; */\r\nfont-style: italic;\r\ntext-align: center;\r\nwidth:100%;\r\nposition: absolute;\r\ntop: 58%;\r\nleft: 0px;\r\n}\r\n/* LOADING SPINNER */\r\n#gridviz-loading-spinner {\r\n position: absolute;\r\n top: 47%;\r\n left: 48%; \r\n\r\n}\r\n.lds-ring {\r\n display: inline-block;\r\n position: relative;\r\n width: 60px;\r\n height: 60px;\r\n}\r\n.lds-ring div {\r\n box-sizing: border-box;\r\n display: block;\r\n position: absolute;\r\n width: 44px;\r\n height: 44px;\r\n margin: 1px;\r\n border: 1px solid #fff;\r\n border-radius: 50%;\r\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\r\n border-color: #fff transparent transparent transparent;\r\n}\r\n.lds-ring div:nth-child(1) {\r\n animation-delay: -0.45s;\r\n}\r\n.lds-ring div:nth-child(2) {\r\n animation-delay: -0.3s;\r\n}\r\n.lds-ring div:nth-child(3) {\r\n animation-delay: -0.15s;\r\n}\r\n@keyframes lds-ring {\r\n 0% {\r\n transform: rotate(0deg);\r\n }\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}\r\n\r\n/* loading spinners */\r\n.lds-ripple {\r\n display: inline-block;\r\n position: absolute;\r\n width: 80px;\r\n height: 80px;\r\n top: 45%;\r\n left: 42.5%;\r\n}\r\n.lds-ripple.hide {\r\n display:none;\r\n}\r\n.lds-ripple div {\r\n position: absolute;\r\n border: 4px solid #ffffff;\r\n opacity: 1;\r\n border-radius: 50%;\r\n animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;\r\n}\r\n.lds-ripple div:nth-child(2) {\r\n animation-delay: -0.5s;\r\n}\r\n@keyframes lds-ripple {\r\n 0% {\r\n top: 36px;\r\n left: 36px;\r\n width: 0;\r\n height: 0;\r\n opacity: 1;\r\n }\r\n 100% {\r\n top: 0px;\r\n left: 0px;\r\n width: 72px;\r\n height: 72px;\r\n opacity: 0;\r\n }\r\n}\r\n.lds-ellipsis {\r\n display: inline-block;\r\n position: relative;\r\n width: 80px;\r\n height: 80px;\r\n}\r\n.lds-ellipsis div {\r\n position: absolute;\r\n top: 33px;\r\n width: 13px;\r\n height: 13px;\r\n border-radius: 50%;\r\n background: #fff;\r\n animation-timing-function: cubic-bezier(0, 1, 1, 0);\r\n}\r\n.lds-ellipsis div:nth-child(1) {\r\n left: 8px;\r\n animation: lds-ellipsis1 0.6s infinite;\r\n}\r\n.lds-ellipsis div:nth-child(2) {\r\n left: 8px;\r\n animation: lds-ellipsis2 0.6s infinite;\r\n}\r\n.lds-ellipsis div:nth-child(3) {\r\n left: 32px;\r\n animation: lds-ellipsis2 0.6s infinite;\r\n}\r\n.lds-ellipsis div:nth-child(4) {\r\n left: 56px;\r\n animation: lds-ellipsis3 0.6s infinite;\r\n}\r\n@keyframes lds-ellipsis1 {\r\n 0% {\r\n transform: scale(0);\r\n }\r\n 100% {\r\n transform: scale(1);\r\n }\r\n}\r\n@keyframes lds-ellipsis3 {\r\n 0% {\r\n transform: scale(1);\r\n }\r\n 100% {\r\n transform: scale(0);\r\n }\r\n}\r\n@keyframes lds-ellipsis2 {\r\n 0% {\r\n transform: translate(0, 0);\r\n }\r\n 100% {\r\n transform: translate(24px, 0);\r\n }\r\n}\r\n.lds-roller {\r\n display: inline-block;\r\n position: relative;\r\n width: 80px;\r\n height: 80px;\r\n}\r\n.lds-roller div {\r\n animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\r\n transform-origin: 40px 40px;\r\n}\r\n.lds-roller div:after {\r\n content: " ";\r\n display: block;\r\n position: absolute;\r\n width: 7px;\r\n height: 7px;\r\n border-radius: 50%;\r\n background: #fff;\r\n margin: -4px 0 0 -4px;\r\n}\r\n.lds-roller div:nth-child(1) {\r\n animation-delay: -0.036s;\r\n}\r\n.lds-roller div:nth-child(1):after {\r\n top: 63px;\r\n left: 63px;\r\n}\r\n.lds-roller div:nth-child(2) {\r\n animation-delay: -0.072s;\r\n}\r\n.lds-roller div:nth-child(2):after {\r\n top: 68px;\r\n left: 56px;\r\n}\r\n.lds-roller div:nth-child(3) {\r\n animation-delay: -0.108s;\r\n}\r\n.lds-roller div:nth-child(3):after {\r\n top: 71px;\r\n left: 48px;\r\n}\r\n.lds-roller div:nth-child(4) {\r\n animation-delay: -0.144s;\r\n}\r\n.lds-roller div:nth-child(4):after {\r\n top: 72px;\r\n left: 40px;\r\n}\r\n.lds-roller div:nth-child(5) {\r\n animation-delay: -0.18s;\r\n}\r\n.lds-roller div:nth-child(5):after {\r\n top: 71px;\r\n left: 32px;\r\n}\r\n.lds-roller div:nth-child(6) {\r\n animation-delay: -0.216s;\r\n}\r\n.lds-roller div:nth-child(6):after {\r\n top: 68px;\r\n left: 24px;\r\n}\r\n.lds-roller div:nth-child(7) {\r\n animation-delay: -0.252s;\r\n}\r\n.lds-roller div:nth-child(7):after {\r\n top: 63px;\r\n left: 17px;\r\n}\r\n.lds-roller div:nth-child(8) {\r\n animation-delay: -0.288s;\r\n}\r\n.lds-roller div:nth-child(8):after {\r\n top: 56px;\r\n left: 12px;\r\n}\r\n@keyframes lds-roller {\r\n 0% {\r\n transform: rotate(0deg);\r\n }\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}\r\n\r\n',""]),t.exports=e},function(t,e,n){(e=n(4)(!1)).push([t.i,"\r\n\r\n\r\n/* Tooltip container */\r\n#gridviz-tooltip {\r\n display: none; \r\n position: absolute; \r\n pointer-events: none; \r\n z-index:999; \r\n border-radius:5px; \r\n box-shadow: 0 1px 5px rgba(0,0,0,0.65); \r\n font-size: 0.8rem; \r\n text-align: left; \r\n line-height: 1; \r\n padding: 6px; \r\n background: white; \r\n font-family: sans-serif;\r\n }\r\n #gridviz-labeltip {\r\n color:black;\r\n padding: 4px; \r\n margin-bottom: 4px;\r\n }\r\n #gridviz-pointtip {\r\n padding: 4px; \r\n margin-bottom: 4px;\r\n }\r\n \r\n /* Show the tooltip text when you mouse over the tooltip container */\r\n #gridviz-tooltip:hover {\r\n display: block;\r\n }\r\n\r\n\r\n /* table */\r\n #gridviz-labeltip > table{\r\n border-spacing: 0px;\r\n }\r\n#gridviz-labeltip > table >tbody>tr> th {\r\n border-bottom: 1px solid lightgrey;\r\n padding-bottom: 2px;\r\n padding-top: 2px;\r\n}",""]),t.exports=e},function(t,e,n){(e=n(4)(!1)).push([t.i,"/* LEGEND */\r\n#gridviz-legend {\r\n z-index: 9999;\r\n position: absolute;\r\n bottom: 1%; \r\n left: 1%;\r\n \r\n padding-left: 15px;\r\n padding-right: 15px;\r\n padding-top: 5px;\r\n padding-bottom: 5px;\r\n }\r\n \r\n /* continuous */\r\n .gridviz-legend-svg{\r\n font-size:0.8rem;\r\n margin-top: 5px;\r\n }\r\n .gridviz-continuous-legend-title{\r\n font-size:0.8rem;\r\n font-weight:bold;\r\n margin-bottom:10px;\r\n }\r\n .legend-tick text {\r\n /* font-size:1rem */\r\n }\r\n .gridviz-legend-axis .domain{\r\n visibility:hidden;\r\n }\r\n \r\n .gridviz-legend-horizontal {\r\n height: 65px;\r\n width: 441px;\r\n padding-top: 5px;\r\n }\r\n .gridviz-legend-vertical {\r\n height: 321px;\r\n width: 140px;\r\n padding-top: 5px;\r\n }\r\n /* legend cells */\r\n rect.swatch {\r\n stroke: white;\r\n stroke-width: 0.5px;\r\n }\r\n .legendTitle {\r\n font-weight:bold;\r\n }",""]),t.exports=e},function(t,e,n){var r=n(4),i=n(20),o=n(21),a=n(22),s=n(23);e=r(!1);var c=i(o),l=i(a),u=i(s);e.push([t.i,'.gridviz-icon-button{\r\n position:absolute;\r\n height: 21px;\r\n width:21px;\r\n padding:3px;\r\n border-radius:4px;\r\n border:1px grey;\r\n background: #fff;\r\n color:"black";\r\n cursor: pointer;\r\n }\r\n .gridviz-icon-button:hover{\r\n opacity:0.5;\r\n /* background: lightgrey */\r\n }\r\n .gridviz-icon-button span.icon {\r\n float: left;\r\n width: 100%;\r\n height: 100%;\r\n }\r\n #gridviz-home-btn span.icon {\r\n background: url('+c+") no-repeat;\r\n }\r\n #gridviz-zoomin-btn span.icon {\r\n background: url("+l+") no-repeat;\r\n }\r\n #gridviz-zoomout-btn span.icon {\r\n background: url("+u+") no-repeat;\r\n }\r\n /* #gridviz-home-btn {\r\n top:100px;\r\n left:10px;\r\n } */\r\n /* #gridviz-zoomin-btn{\r\n top:150px;\r\n left:10px;\r\n }\r\n #gridviz-zoomout-btn{\r\n top:185px;\r\n left:10px;\r\n } */",""]),t.exports=e},function(t,e,n){"use strict";t.exports=function(t,e){return e||(e={}),"string"!=typeof(t=t&&t.__esModule?t.default:t)?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t)}},function(t,e,n){"use strict";n.r(e),e.default="data:image/svg+xml;base64,PHN2ZyBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgZGF0YS1wcmVmaXg9ImZhcyIgZGF0YS1pY29uPSJob21lIiBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtaG9tZSBmYS13LTE4IiByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDU3NiA1MTIiPjxwYXRoIGZpbGw9ImN1cnJlbnRDb2xvciIgZD0iTTI4MC4zNyAxNDguMjZMOTYgMzAwLjExVjQ2NGExNiAxNiAwIDAgMCAxNiAxNmwxMTIuMDYtLjI5YTE2IDE2IDAgMCAwIDE1LjkyLTE2VjM2OGExNiAxNiAwIDAgMSAxNi0xNmg2NGExNiAxNiAwIDAgMSAxNiAxNnY5NS42NGExNiAxNiAwIDAgMCAxNiAxNi4wNUw0NjQgNDgwYTE2IDE2IDAgMCAwIDE2LTE2VjMwMEwyOTUuNjcgMTQ4LjI2YTEyLjE5IDEyLjE5IDAgMCAwLTE1LjMgMHpNNTcxLjYgMjUxLjQ3TDQ4OCAxODIuNTZWNDQuMDVhMTIgMTIgMCAwIDAtMTItMTJoLTU2YTEyIDEyIDAgMCAwLTEyIDEydjcyLjYxTDMxOC40NyA0M2E0OCA0OCAwIDAgMC02MSAwTDQuMzQgMjUxLjQ3YTEyIDEyIDAgMCAwLTEuNiAxNi45bDI1LjUgMzFBMTIgMTIgMCAwIDAgNDUuMTUgMzAxbDIzNS4yMi0xOTMuNzRhMTIuMTkgMTIuMTkgMCAwIDEgMTUuMyAwTDUzMC45IDMwMWExMiAxMiAwIDAgMCAxNi45LTEuNmwyNS41LTMxYTEyIDEyIDAgMCAwLTEuNy0xNi45M3oiPjwvcGF0aD48L3N2Zz4="},function(t,e,n){"use strict";n.r(e),e.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICAgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItcGx1cyI+PGxpbmUgeDE9IjEyIiB5MT0iNSIgeDI9IjEyIiB5Mj0iMTkiPjwvbGluZT48bGluZSB4MT0iNSIgeTE9IjEyIiB4Mj0iMTkiIHkyPSIxMiI+PC9saW5lPjwvc3ZnPg=="},function(t,e,n){"use strict";n.r(e),e.default="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICAgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItbWludXMiPjxsaW5lIHgxPSI1IiB5MT0iMTIiIHgyPSIxOSIgeTI9IjEyIj48L2xpbmU+PC9zdmc+"},function(t,e,n){(e=n(4)(!1)).push([t.i,"/* dropdowns */\r\n.gridviz-selectors {\r\n width: 15%;\r\n font-size:1rem;\r\n z-index: 9999;\r\n position: absolute;\r\n top: 10px;\r\n right: 10px;\r\n padding: 8px;\r\n }\r\n .gridviz-dropdown {\r\n padding:8px;\r\n color: black;\r\n }\r\n .gridviz-dropdown select {\r\n direction: rtl;\r\n }\r\n .gridviz-dropdown option{\r\n direction: ltr;\r\n }\r\n .gridviz-dropdown-label {\r\n z-index: 9999;\r\n margin-right: 10px;\r\n }",""]),t.exports=e},function(t,e,n){(e=n(4)(!1)).push([t.i,"/* mobile styles & overrides */\r\n@media only screen and (max-width: 600px) {\r\n #gridviz-legend {\r\n z-index: 999999;\r\n position: absolute;\r\n bottom: 0px!important;\r\n left: 0px!important;\r\n }\r\n .gridviz-headings-container {\r\n z-index:999999;\r\n position:absolute;\r\n top:0px!important;\r\n left:0px!important;\r\n width: 98%!important;\r\n \r\n }\r\n .gridviz-headings-container, #gridviz-legend {\r\n border-radius: 0px !important;\r\n background-color:#ffffff !important;\r\n max-width: 100% !important;\r\n }\r\n .gridviz-cellcount{\r\n margin-top:1px!important;\r\n }\r\n #gridviz-loading-spinner {\r\n top: 45% !important;\r\n left: 44% !important;\r\n }\r\n #gridviz-loading-text {\r\n top: 55% !important;\r\n left: 0px;\r\n }\r\n /* #gridviz-home-btn{\r\n left:3px!important;\r\n top: 75px!important;\r\n }\r\n #gridviz-zoomin-btn{\r\n left:3px!important;\r\n top: 115px!important;\r\n }\r\n #gridviz-zoomout-btn{\r\n left:3px!important;\r\n top: 147px!important;\r\n } */\r\n }",""]),t.exports=e},function(t,e,n){"use strict";n.r(e),n.d(e,"viewer",(function(){return US}));var r={};n.r(r),n.d(r,"schemeCategory10",(function(){return Vn})),n.d(r,"schemeAccent",(function(){return qn})),n.d(r,"schemeDark2",(function(){return Yn})),n.d(r,"schemePaired",(function(){return Xn})),n.d(r,"schemePastel1",(function(){return Zn})),n.d(r,"schemePastel2",(function(){return Jn})),n.d(r,"schemeSet1",(function(){return Qn})),n.d(r,"schemeSet2",(function(){return $n})),n.d(r,"schemeSet3",(function(){return Kn})),n.d(r,"schemeTableau10",(function(){return tr})),n.d(r,"interpolateBrBG",(function(){return rr})),n.d(r,"schemeBrBG",(function(){return nr})),n.d(r,"interpolatePRGn",(function(){return or})),n.d(r,"schemePRGn",(function(){return ir})),n.d(r,"interpolatePiYG",(function(){return sr})),n.d(r,"schemePiYG",(function(){return ar})),n.d(r,"interpolatePuOr",(function(){return lr})),n.d(r,"schemePuOr",(function(){return cr})),n.d(r,"interpolateRdBu",(function(){return hr})),n.d(r,"schemeRdBu",(function(){return ur})),n.d(r,"interpolateRdGy",(function(){return fr})),n.d(r,"schemeRdGy",(function(){return dr})),n.d(r,"interpolateRdYlBu",(function(){return mr})),n.d(r,"schemeRdYlBu",(function(){return pr})),n.d(r,"interpolateRdYlGn",(function(){return vr})),n.d(r,"schemeRdYlGn",(function(){return gr})),n.d(r,"interpolateSpectral",(function(){return br})),n.d(r,"schemeSpectral",(function(){return yr})),n.d(r,"interpolateBuGn",(function(){return _r})),n.d(r,"schemeBuGn",(function(){return xr})),n.d(r,"interpolateBuPu",(function(){return Mr})),n.d(r,"schemeBuPu",(function(){return wr})),n.d(r,"interpolateGnBu",(function(){return Tr})),n.d(r,"schemeGnBu",(function(){return Sr})),n.d(r,"interpolateOrRd",(function(){return Ar})),n.d(r,"schemeOrRd",(function(){return Er})),n.d(r,"interpolatePuBuGn",(function(){return Cr})),n.d(r,"schemePuBuGn",(function(){return Lr})),n.d(r,"interpolatePuBu",(function(){return Pr})),n.d(r,"schemePuBu",(function(){return Rr})),n.d(r,"interpolatePuRd",(function(){return zr})),n.d(r,"schemePuRd",(function(){return Nr})),n.d(r,"interpolateRdPu",(function(){return Ir})),n.d(r,"schemeRdPu",(function(){return Dr})),n.d(r,"interpolateYlGnBu",(function(){return Fr})),n.d(r,"schemeYlGnBu",(function(){return Or})),n.d(r,"interpolateYlGn",(function(){return Br})),n.d(r,"schemeYlGn",(function(){return Ur})),n.d(r,"interpolateYlOrBr",(function(){return kr})),n.d(r,"schemeYlOrBr",(function(){return Hr})),n.d(r,"interpolateYlOrRd",(function(){return jr})),n.d(r,"schemeYlOrRd",(function(){return Gr})),n.d(r,"interpolateBlues",(function(){return Vr})),n.d(r,"schemeBlues",(function(){return Wr})),n.d(r,"interpolateGreens",(function(){return Yr})),n.d(r,"schemeGreens",(function(){return qr})),n.d(r,"interpolateGreys",(function(){return Zr})),n.d(r,"schemeGreys",(function(){return Xr})),n.d(r,"interpolatePurples",(function(){return Qr})),n.d(r,"schemePurples",(function(){return Jr})),n.d(r,"interpolateReds",(function(){return Kr})),n.d(r,"schemeReds",(function(){return $r})),n.d(r,"interpolateOranges",(function(){return ei})),n.d(r,"schemeOranges",(function(){return ti})),n.d(r,"interpolateCividis",(function(){return ni})),n.d(r,"interpolateCubehelixDefault",(function(){return yi})),n.d(r,"interpolateRainbow",(function(){return wi})),n.d(r,"interpolateWarm",(function(){return bi})),n.d(r,"interpolateCool",(function(){return xi})),n.d(r,"interpolateSinebow",(function(){return Ei})),n.d(r,"interpolateTurbo",(function(){return Ai})),n.d(r,"interpolateViridis",(function(){return Ci})),n.d(r,"interpolateMagma",(function(){return Ri})),n.d(r,"interpolateInferno",(function(){return Pi})),n.d(r,"interpolatePlasma",(function(){return Ni}));var i={};n.r(i),n.d(i,"scaleBand",(function(){return Ro})),n.d(i,"scalePoint",(function(){return No})),n.d(i,"scaleIdentity",(function(){return zo})),n.d(i,"scaleLinear",(function(){return To})),n.d(i,"scaleLog",(function(){return Go})),n.d(i,"scaleSymlog",(function(){return qo})),n.d(i,"scaleOrdinal",(function(){return Co})),n.d(i,"scaleImplicit",(function(){return Lo})),n.d(i,"scalePow",(function(){return Qo})),n.d(i,"scaleSqrt",(function(){return $o})),n.d(i,"scaleRadial",(function(){return ea})),n.d(i,"scaleQuantile",(function(){return sa})),n.d(i,"scaleQuantize",(function(){return ca})),n.d(i,"scaleThreshold",(function(){return Eo})),n.d(i,"scaleTime",(function(){return yc})),n.d(i,"scaleUtc",(function(){return Tc})),n.d(i,"scaleSequential",(function(){return Lc})),n.d(i,"scaleSequentialLog",(function(){return Cc})),n.d(i,"scaleSequentialPow",(function(){return Pc})),n.d(i,"scaleSequentialSqrt",(function(){return Nc})),n.d(i,"scaleSequentialSymlog",(function(){return Rc})),n.d(i,"scaleSequentialQuantile",(function(){return zc})),n.d(i,"scaleDiverging",(function(){return Oc})),n.d(i,"scaleDivergingLog",(function(){return Fc})),n.d(i,"scaleDivergingPow",(function(){return Bc})),n.d(i,"scaleDivergingSqrt",(function(){return Hc})),n.d(i,"scaleDivergingSymlog",(function(){return Uc})),n.d(i,"tickFormat",(function(){return Mo}));var o={};n.r(o),n.d(o,"addPointsToScene",(function(){return IS})),n.d(o,"updatePointsSizes",(function(){return OS})),n.d(o,"updatePointsColors",(function(){return FS}));n(14);var a={value:function(){}};function s(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new c(r)}function c(t){this._=t}function l(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function u(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function h(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=a,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}c.prototype=s.prototype={constructor:c,on:function(t,e){var n,r=this._,i=l(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=h(r[n],t.name,e);else if(null==e)for(n in r)r[n]=h(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=u(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new c(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var d=s;function f(){}var p=function(t){return null==t?f:function(){return this.querySelector(t)}},m=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)};function g(){return[]}var v=function(t){return null==t?g:function(){return this.querySelectorAll(t)}};var y=function(t){return function(){return this.matches(t)}};function b(t){return function(e){return e.matches(t)}}var x=Array.prototype.find;function _(){return this.firstElementChild}var w=Array.prototype.filter;function M(){return this.children}var S=function(t){return new Array(t.length)};function T(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}T.prototype={constructor:T,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var E=function(t){return function(){return t}};function A(t,e,n,r,i,o){for(var a,s=0,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new T(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function L(t,e,n,r,i,o,a){var s,c,l,u=new Map,h=e.length,d=o.length,f=new Array(h);for(s=0;s<h;++s)(c=e[s])&&(f[s]=l=a.call(c,c.__data__,s,e)+"",u.has(l)?i[s]=c:u.set(l,c));for(s=0;s<d;++s)l=a.call(t,o[s],s,o)+"",(c=u.get(l))?(r[s]=c,c.__data__=o[s],u.delete(l)):n[s]=new T(t,o[s]);for(s=0;s<h;++s)(c=e[s])&&u.get(f[s])===c&&(i[s]=c)}function C(t){return t.__data__}function R(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var P="http://www.w3.org/1999/xhtml",N={svg:"http://www.w3.org/2000/svg",xhtml:P,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},z=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),N.hasOwnProperty(e)?{space:N[e],local:t}:t};function D(t){return function(){this.removeAttribute(t)}}function I(t){return function(){this.removeAttributeNS(t.space,t.local)}}function O(t,e){return function(){this.setAttribute(t,e)}}function F(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function U(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function B(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var H=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function k(t){return function(){this.style.removeProperty(t)}}function G(t,e,n){return function(){this.style.setProperty(t,e,n)}}function j(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function W(t,e){return t.style.getPropertyValue(e)||H(t).getComputedStyle(t,null).getPropertyValue(e)}function V(t){return function(){delete this[t]}}function q(t,e){return function(){this[t]=e}}function Y(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function X(t){return t.trim().split(/^|\s+/)}function Z(t){return t.classList||new J(t)}function J(t){this._node=t,this._names=X(t.getAttribute("class")||"")}function Q(t,e){for(var n=Z(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function $(t,e){for(var n=Z(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function K(t){return function(){Q(this,t)}}function tt(t){return function(){$(this,t)}}function et(t,e){return function(){(e.apply(this,arguments)?Q:$)(this,t)}}J.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function nt(){this.textContent=""}function rt(t){return function(){this.textContent=t}}function it(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ot(){this.innerHTML=""}function at(t){return function(){this.innerHTML=t}}function st(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ct(){this.nextSibling&&this.parentNode.appendChild(this)}function lt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ut(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===P&&e.documentElement.namespaceURI===P?e.createElement(t):e.createElementNS(n,t)}}function ht(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var dt=function(t){var e=z(t);return(e.local?ht:ut)(e)};function ft(){return null}function pt(){var t=this.parentNode;t&&t.removeChild(this)}function mt(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function gt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function vt(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function yt(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function bt(t,e,n){return function(){var r,i=this.__on,o=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(i)for(var a=0,s=i.length;a<s;++a)if((r=i[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),void(r.value=e);this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}function xt(t,e,n){var r=H(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function _t(t,e){return function(){return xt(this,t,e)}}function wt(t,e){return function(){return xt(this,t,e.apply(this,arguments))}}var Mt=[null];function St(t,e){this._groups=t,this._parents=e}function Tt(){return new St([[document.documentElement]],Mt)}St.prototype=Tt.prototype={constructor:St,select:function(t){"function"!=typeof t&&(t=p(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a,s=e[i],c=s.length,l=r[i]=new Array(c),u=0;u<c;++u)(o=s[u])&&(a=t.call(o,o.__data__,u,s))&&("__data__"in o&&(a.__data__=o.__data__),l[u]=a);return new St(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);return null==e?[]:m(e)}}(t):v(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a,s=e[o],c=s.length,l=0;l<c;++l)(a=s[l])&&(r.push(t.call(a,a.__data__,l,s)),i.push(a));return new St(r,i)},selectChild:function(t){return this.select(null==t?_:function(t){return function(){return x.call(this.children,t)}}("function"==typeof t?t:b(t)))},selectChildren:function(t){return this.selectAll(null==t?M:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:b(t)))},filter:function(t){"function"!=typeof t&&(t=y(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,c=r[i]=[],l=0;l<s;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&c.push(o);return new St(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,C);var n=e?L:A,r=this._parents,i=this._groups;"function"!=typeof t&&(t=E(t));for(var o=i.length,a=new Array(o),s=new Array(o),c=new Array(o),l=0;l<o;++l){var u=r[l],h=i[l],d=h.length,f=m(t.call(u,u&&u.__data__,l,r)),p=f.length,g=s[l]=new Array(p),v=a[l]=new Array(p),y=c[l]=new Array(d);n(u,h,g,v,y,f,e);for(var b,x,_=0,w=0;_<p;++_)if(b=g[_]){for(_>=w&&(w=_+1);!(x=v[w])&&++w<p;);b._next=x||null}}return(a=new St(a,r))._enter=s,a._exit=c,a},enter:function(){return new St(this._enter||this._groups.map(S),this._parents)},exit:function(){return new St(this._exit||this._groups.map(S),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof St))throw new Error("invalid merge");for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var c,l=e[s],u=n[s],h=l.length,d=a[s]=new Array(h),f=0;f<h;++f)(c=l[f]||u[f])&&(d[f]=c);for(;s<r;++s)a[s]=e[s];return new St(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=R);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],c=s.length,l=i[o]=new Array(c),u=0;u<c;++u)(a=s[u])&&(l[u]=a);l.sort(e)}return new St(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=z(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?I:D:"function"==typeof e?n.local?B:U:n.local?F:O)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?k:"function"==typeof e?j:G)(t,e,null==n?"":n)):W(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?V:"function"==typeof e?Y:q)(t,e)):this.node()[t]},classed:function(t,e){var n=X(t+"");if(arguments.length<2){for(var r=Z(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?et:e?K:tt)(n,e))},text:function(t){return arguments.length?this.each(null==t?nt:("function"==typeof t?it:rt)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ot:("function"==typeof t?st:at)(t)):this.node().innerHTML},raise:function(){return this.each(ct)},lower:function(){return this.each(lt)},append:function(t){var e="function"==typeof t?t:dt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:dt(t),r=null==e?ft:"function"==typeof e?e:p(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(pt)},clone:function(t){return this.select(t?gt:mt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=vt(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?bt:yt,r=0;r<a;++r)this.each(s(o[r],e,n));return this}var s=this.node().__on;if(s)for(var c,l=0,u=s.length;l<u;++l)for(r=0,c=s[l];r<a;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?wt:_t)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var Et=Tt,At=function(t){return"string"==typeof t?new St([[document.querySelector(t)]],[document.documentElement]):new St([[t]],Mt)};var Lt=function(t){t.preventDefault(),t.stopImmediatePropagation()},Ct=function(t){var e=t.document.documentElement,n=At(t).on("dragstart.drag",Lt,!0);"onselectstart"in e?n.on("selectstart.drag",Lt,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function Rt(t,e){var n=t.document.documentElement,r=At(t).on("dragstart.drag",null);e&&(r.on("click.drag",Lt,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function Pt(t){return((t=Math.exp(t))+1/t)/2}var Nt,zt,Dt=function t(e,n,r){function i(t,i){var o,a,s=t[0],c=t[1],l=t[2],u=i[0],h=i[1],d=i[2],f=u-s,p=h-c,m=f*f+p*p;if(m<1e-12)a=Math.log(d/l)/e,o=function(t){return[s+t*f,c+t*p,l*Math.exp(e*t*a)]};else{var g=Math.sqrt(m),v=(d*d-l*l+r*m)/(2*l*n*g),y=(d*d-l*l-r*m)/(2*d*n*g),b=Math.log(Math.sqrt(v*v+1)-v),x=Math.log(Math.sqrt(y*y+1)-y);a=(x-b)/e,o=function(t){var r,i=t*a,o=Pt(b),u=l/(n*g)*(o*(r=e*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+u*f,c+u*p,l*o/Pt(e*i+b)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4),It=function(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]},Ot=0,Ft=0,Ut=0,Bt=0,Ht=0,kt=0,Gt="object"==typeof performance&&performance.now?performance:Date,jt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Wt(){return Ht||(jt(Vt),Ht=Gt.now()+kt)}function Vt(){Ht=0}function qt(){this._call=this._time=this._next=null}function Yt(t,e,n){var r=new qt;return r.restart(t,e,n),r}function Xt(){Ht=(Bt=Gt.now())+kt,Ot=Ft=0;try{!function(){Wt(),++Ot;for(var t,e=Nt;e;)(t=Ht-e._time)>=0&&e._call.call(null,t),e=e._next;--Ot}()}finally{Ot=0,function(){var t,e,n=Nt,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Nt=e);zt=t,Jt(r)}(),Ht=0}}function Zt(){var t=Gt.now(),e=t-Bt;e>1e3&&(kt-=e,Bt=t)}function Jt(t){Ot||(Ft&&(Ft=clearTimeout(Ft)),t-Ht>24?(t<1/0&&(Ft=setTimeout(Xt,t-Gt.now()-kt)),Ut&&(Ut=clearInterval(Ut))):(Ut||(Bt=Gt.now(),Ut=setInterval(Zt,1e3)),Ot=1,jt(Xt)))}qt.prototype=Yt.prototype={constructor:qt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Wt():+n)+(null==e?0:+e),this._next||zt===this||(zt?zt._next=this:Nt=this,zt=this),this._call=t,this._time=n,Jt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jt())}};var Qt=function(t,e,n){var r=new qt;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},$t=d("start","end","cancel","interrupt"),Kt=[],te=function(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(c){var l,u,h,d;if(1!==n.state)return s();for(l in i)if((d=i[l]).name===n.name){if(3===d.state)return Qt(o);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[l]):+l<e&&(d.state=6,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete i[l])}if(Qt((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(c))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(h=n.tween.length),l=0,u=-1;l<h;++l)(d=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++u]=d);r.length=u+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Yt((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:$t,tween:Kt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})};function ee(t,e){var n=re(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function ne(t,e){var n=re(t,e);if(n.state>3)throw new Error("too late; already running");return n}function re(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var ie,oe=function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}},ae=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},se=180/Math.PI,ce={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},le=function(t,e,n,r,i,o){var a,s,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),t*r<e*n&&(t=-t,e=-e,c=-c,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*se,skewX:Math.atan(c)*se,scaleX:a,scaleY:s}};function ue(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],c=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var c=a.push("translate(",null,e,null,n);s.push({i:c-4,x:ae(t,i)},{i:c-2,x:ae(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,c),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:ae(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:ae(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,c),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:ae(t,n)},{i:s-2,x:ae(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,c),o=a=null,function(t){for(var e,n=-1,r=c.length;++n<r;)s[(e=c[n]).i]=e.x(t);return s.join("")}}}var he=ue((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ce:le(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),de=ue((function(t){return null==t?ce:(ie||(ie=document.createElementNS("http://www.w3.org/2000/svg","g")),ie.setAttribute("transform",t),(t=ie.transform.baseVal.consolidate())?(t=t.matrix,le(t.a,t.b,t.c,t.d,t.e,t.f)):ce)}),", ",")",")");function fe(t,e){var n,r;return function(){var i=ne(this,t),o=i.tween;if(o!==n)for(var a=0,s=(r=n=o).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}i.tween=r}}function pe(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=ne(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===e){i[c]=s;break}c===l&&i.push(s)}o.tween=i}}function me(t,e,n){var r=t._id;return t.each((function(){var t=ne(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return re(t,r).value[e]}}var ge=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ye(){}var be="\\s*([+-]?\\d+)\\s*",xe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",_e="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",we=/^#([0-9a-f]{3,8})$/,Me=new RegExp("^rgb\\("+[be,be,be]+"\\)$"),Se=new RegExp("^rgb\\("+[_e,_e,_e]+"\\)$"),Te=new RegExp("^rgba\\("+[be,be,be,xe]+"\\)$"),Ee=new RegExp("^rgba\\("+[_e,_e,_e,xe]+"\\)$"),Ae=new RegExp("^hsl\\("+[xe,_e,_e]+"\\)$"),Le=new RegExp("^hsla\\("+[xe,_e,_e,xe]+"\\)$"),Ce={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};function Re(){return this.rgb().formatHex()}function Pe(){return this.rgb().formatRgb()}function Ne(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=we.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ze(e):3===n?new Fe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?De(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?De(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Me.exec(t))?new Fe(e[1],e[2],e[3],1):(e=Se.exec(t))?new Fe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Te.exec(t))?De(e[1],e[2],e[3],e[4]):(e=Ee.exec(t))?De(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ae.exec(t))?ke(e[1],e[2]/100,e[3]/100,1):(e=Le.exec(t))?ke(e[1],e[2]/100,e[3]/100,e[4]):Ce.hasOwnProperty(t)?ze(Ce[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function ze(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function De(t,e,n,r){return r<=0&&(t=e=n=NaN),new Fe(t,e,n,r)}function Ie(t){return t instanceof ye||(t=Ne(t)),t?new Fe((t=t.rgb()).r,t.g,t.b,t.opacity):new Fe}function Oe(t,e,n,r){return 1===arguments.length?Ie(t):new Fe(t,e,n,null==r?1:r)}function Fe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ue(){return"#"+He(this.r)+He(this.g)+He(this.b)}function Be(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"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))+(1===t?")":", "+t+")")}function He(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function ke(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new je(t,e,n,r)}function Ge(t){if(t instanceof je)return new je(t.h,t.s,t.l,t.opacity);if(t instanceof ye||(t=Ne(t)),!t)return new je;if(t instanceof je)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new je(a,s,c,t.opacity)}function je(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function We(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Ve(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}ge(ye,Ne,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHsl:function(){return Ge(this).formatHsl()},formatRgb:Pe,toString:Pe}),ge(Fe,Oe,ve(ye,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Fe(this.r*t,this.g*t,this.b*t,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:Ue,formatHex:Ue,formatRgb:Be,toString:Be})),ge(je,(function(t,e,n,r){return 1===arguments.length?Ge(t):new je(t,e,n,null==r?1:r)}),ve(ye,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new je(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new je(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Fe(We(t>=240?t-240:t+120,i,r),We(t,i,r),We(t<120?t+240:t-120,i,r),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 t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var qe=t=>()=>t;function Ye(t,e){return function(n){return t+n*e}}function Xe(t){return 1==(t=+t)?Ze:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):qe(isNaN(e)?n:e)}}function Ze(t,e){var n=e-t;return n?Ye(t,n):qe(isNaN(t)?e:t)}var Je=function t(e){var n=Xe(e);function r(t,e){var r=n((t=Oe(t)).r,(e=Oe(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ze(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Qe(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=Oe(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}var $e=Qe((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Ve((n-r/e)*e,a,i,o,s)}})),Ke=(Qe((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Ve((n-r/e)*e,i,o,a,s)}})),/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g),tn=new RegExp(Ke.source,"g");var en=function(t,e){var n,r,i,o=Ke.lastIndex=tn.lastIndex=0,a=-1,s=[],c=[];for(t+="",e+="";(n=Ke.exec(t))&&(r=tn.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,c.push({i:a,x:ae(n,r)})),o=tn.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var n,r=0;r<e;++r)s[(n=c[r]).i]=n.x(t);return s.join("")})},nn=function(t,e){var n;return("number"==typeof e?ae:e instanceof Ne?Je:(n=Ne(e))?(e=n,Je):en)(t,e)};function rn(t){return function(){this.removeAttribute(t)}}function on(t){return function(){this.removeAttributeNS(t.space,t.local)}}function an(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}}function sn(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}function cn(t,e,n){var r,i,o;return function(){var a,s,c=n(this);if(null!=c)return(a=this.getAttribute(t))===(s=c+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,c));this.removeAttribute(t)}}function ln(t,e,n){var r,i,o;return function(){var a,s,c=n(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(s=c+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,c));this.removeAttributeNS(t.space,t.local)}}function un(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function hn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function dn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&hn(t,i)),n}return i._value=e,i}function fn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&un(t,i)),n}return i._value=e,i}function pn(t,e){return function(){ee(this,t).delay=+e.apply(this,arguments)}}function mn(t,e){return e=+e,function(){ee(this,t).delay=e}}function gn(t,e){return function(){ne(this,t).duration=+e.apply(this,arguments)}}function vn(t,e){return e=+e,function(){ne(this,t).duration=e}}function yn(t,e){if("function"!=typeof e)throw new Error;return function(){ne(this,t).ease=e}}function bn(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?ee:ne;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}var xn=Et.prototype.constructor;function _n(t){return function(){this.style.removeProperty(t)}}function wn(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Mn(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&wn(t,o,n)),r}return o._value=e,o}function Sn(t){return function(e){this.textContent=t.call(this,e)}}function Tn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Sn(r)),e}return r._value=t,r}var En=0;function An(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Ln(){return++En}var Cn=Et.prototype;An.prototype=function(t){return Et().transition(t)}.prototype={constructor:An,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=p(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s,c,l=r[a],u=l.length,h=o[a]=new Array(u),d=0;d<u;++d)(s=l[d])&&(c=t.call(s,s.__data__,d,l))&&("__data__"in s&&(c.__data__=s.__data__),h[d]=c,te(h[d],e,n,d,h,re(s,n)));return new An(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=v(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var c,l=r[s],u=l.length,h=0;h<u;++h)if(c=l[h]){for(var d,f=t.call(c,c.__data__,h,l),p=re(c,n),m=0,g=f.length;m<g;++m)(d=f[m])&&te(d,e,n,m,f,p);o.push(f),a.push(c)}return new An(o,a,e,n)},filter:function(t){"function"!=typeof t&&(t=y(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,c=r[i]=[],l=0;l<s;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&c.push(o);return new An(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var c,l=e[s],u=n[s],h=l.length,d=a[s]=new Array(h),f=0;f<h;++f)(c=l[f]||u[f])&&(d[f]=c);for(;s<r;++s)a[s]=e[s];return new An(a,this._parents,this._name,this._id)},selection:function(){return new xn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Ln(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],c=s.length,l=0;l<c;++l)if(a=s[l]){var u=re(a,e);te(a,t,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new An(r,this._parents,t,n)},call:Cn.call,nodes:Cn.nodes,node:Cn.node,size:Cn.size,empty:Cn.empty,each:Cn.each,on:function(t,e){var n=this._id;return arguments.length<2?re(this.node(),n).on.on(t):this.each(bn(n,t,e))},attr:function(t,e){var n=z(t),r="transform"===n?de:nn;return this.attrTween(t,"function"==typeof e?(n.local?ln:cn)(n,r,me(this,"attr."+t,e)):null==e?(n.local?on:rn)(n):(n.local?sn:an)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=z(t);return this.tween(n,(r.local?dn:fn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?he:nn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=W(this,t),a=(this.style.removeProperty(t),W(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,_n(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=W(this,t),s=n(this),c=s+"";return null==s&&(this.style.removeProperty(t),c=s=W(this,t)),a===c?null:a===r&&c===i?o:(i=c,o=e(r=a,s))}}(t,r,me(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var c=ne(this,t),l=c.on,u=null==c.value[a]?o||(o=_n(e)):void 0;l===n&&i===u||(r=(n=l).copy()).on(s,i=u),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=W(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,Mn(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(me(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,Tn(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=re(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?fe:pe)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?pn:mn)(e,t)):re(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?gn:vn)(e,t)):re(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(yn(e,t)):re(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;ne(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(o,a){var s={value:a},c={value:function(){0==--i&&o()}};n.each((function(){var n=ne(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(c)),n.on=e})),0===i&&o()}))},[Symbol.iterator]:Cn[Symbol.iterator]};var Rn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Pn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}Et.prototype.interrupt=function(t){return this.each((function(){oe(this,t)}))},Et.prototype.transition=function(t){var e,n;t instanceof An?(e=t._id,t=t._name):(e=Ln(),(n=Rn).time=Wt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],c=s.length,l=0;l<c;++l)(a=s[l])&&te(a,t,e,l,s,n||Pn(a,e));return new An(r,this._parents,t,e)};var Nn=t=>()=>t;function zn(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Dn(t,e,n){this.k=t,this.x=e,this.y=n}Dn.prototype={constructor:Dn,scale:function(t){return 1===t?this:new Dn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Dn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var In=new Dn(1,0,0);function On(t){t.stopImmediatePropagation()}Dn.prototype;var Fn=function(t){t.preventDefault(),t.stopImmediatePropagation()};function Un(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Bn(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Hn(){return this.__zoom||In}function kn(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Gn(){return navigator.maxTouchPoints||"ontouchstart"in this}function jn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var Wn=function(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n},Vn=Wn("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),qn=Wn("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Yn=Wn("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Xn=Wn("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Zn=Wn("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Jn=Wn("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Qn=Wn("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),$n=Wn("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Kn=Wn("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),tr=Wn("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),er=t=>$e(t[t.length-1]),nr=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Wn),rr=er(nr),ir=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Wn),or=er(ir),ar=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Wn),sr=er(ar),cr=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Wn),lr=er(cr),ur=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Wn),hr=er(ur),dr=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Wn),fr=er(dr),pr=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Wn),mr=er(pr),gr=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Wn),vr=er(gr),yr=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Wn),br=er(yr),xr=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Wn),_r=er(xr),wr=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Wn),Mr=er(wr),Sr=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Wn),Tr=er(Sr),Er=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Wn),Ar=er(Er),Lr=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Wn),Cr=er(Lr),Rr=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Wn),Pr=er(Rr),Nr=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Wn),zr=er(Nr),Dr=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Wn),Ir=er(Dr),Or=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Wn),Fr=er(Or),Ur=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Wn),Br=er(Ur),Hr=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Wn),kr=er(Hr),Gr=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Wn),jr=er(Gr),Wr=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Wn),Vr=er(Wr),qr=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Wn),Yr=er(qr),Xr=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Wn),Zr=er(Xr),Jr=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Wn),Qr=er(Jr),$r=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Wn),Kr=er($r),ti=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Wn),ei=er(ti),ni=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"};const ri=Math.PI/180,ii=180/Math.PI;var oi=-.14861,ai=1.78277,si=-.29227,ci=-.90649,li=1.97294,ui=li*ci,hi=li*ai,di=ai*si-ci*oi;function fi(t){if(t instanceof mi)return new mi(t.h,t.s,t.l,t.opacity);t instanceof Fe||(t=Ie(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(di*r+ui*e-hi*n)/(di+ui-hi),o=r-i,a=(li*(n-i)-si*o)/ci,s=Math.sqrt(a*a+o*o)/(li*i*(1-i)),c=s?Math.atan2(a,o)*ii-120:NaN;return new mi(c<0?c+360:c,s,i,t.opacity)}function pi(t,e,n,r){return 1===arguments.length?fi(t):new mi(t,e,n,null==r?1:r)}function mi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function gi(t){return function e(n){function r(e,r){var i=t((e=pi(e)).h,(r=pi(r)).h),o=Ze(e.s,r.s),a=Ze(e.l,r.l),s=Ze(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}ge(mi,pi,ve(ye,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new mi(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new mi(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*ri,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new Fe(255*(e+n*(oi*r+ai*i)),255*(e+n*(si*r+ci*i)),255*(e+n*(li*r)),this.opacity)}}));gi((function(t,e){var n=e-t;return n?Ye(t,n>180||n<-180?n-360*Math.round(n/360):n):qe(isNaN(t)?e:t)}));var vi=gi(Ze),yi=vi(pi(300,.5,0),pi(-240,.5,1)),bi=vi(pi(-100,.75,.35),pi(80,1.5,.8)),xi=vi(pi(260,.75,.35),pi(80,1.5,.8)),_i=pi(),wi=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return _i.h=360*t-100,_i.s=1.5-1.5*e,_i.l=.8-.9*e,_i+""},Mi=Oe(),Si=Math.PI/3,Ti=2*Math.PI/3,Ei=function(t){var e;return t=(.5-t)*Math.PI,Mi.r=255*(e=Math.sin(t))*e,Mi.g=255*(e=Math.sin(t+Si))*e,Mi.b=255*(e=Math.sin(t+Ti))*e,Mi+""},Ai=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function Li(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var Ci=Li(Wn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),Ri=Li(Wn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Pi=Li(Wn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Ni=Li(Wn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),zi=Math.sqrt(50),Di=Math.sqrt(10),Ii=Math.sqrt(2),Oi=function(t,e,n){var r,i,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e<t)&&(i=t,t=e,e=i),0===(a=Fi(t,e,n))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)*a;else for(a=-a,t=Math.ceil(t*a),e=Math.floor(e*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(t+s)/a;return r&&o.reverse(),o};function Fi(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=zi?10:o>=Di?5:o>=Ii?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=zi?10:o>=Di?5:o>=Ii?2:1)}function Ui(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=zi?i*=10:o>=Di?i*=5:o>=Ii&&(i*=2),e<t?-i:i}var Bi=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Hi=function(t){let e=t,n=t;function r(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=(e,n)=>t(e)-n,n=function(t){return(e,n)=>Bi(t(e),n)}(t)),{left:r,center:function(t,n,i,o){null==i&&(i=0),null==o&&(o=t.length);const a=r(t,n,i,o-1);return a>i&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){const o=r+i>>>1;n(t[o],e)>0?i=o:r=o+1}return r}}};var ki=function(t){return null===t?NaN:+t};const Gi=Hi(Bi),ji=Gi.right;Gi.left,Hi(ki).center;var Wi=ji,Vi=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function qi(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Yi(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Ji(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var Xi=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},Zi=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Ji(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Ji=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?qe(e):("number"===r?ae:"string"===r?(n=Ne(e))?(e=n,Je):en:e instanceof Ne?Je:e instanceof Date?Xi:qi(e)?Vi:Array.isArray(e)?Yi:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Zi:ae)(t,e)},Qi=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function $i(t){return+t}var Ki=[0,1];function to(t){return t}function eo(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function no(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=eo(i,r),o=n(a,o)):(r=eo(r,i),o=n(o,a)),function(t){return o(r(t))}}function ro(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=eo(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=Wi(t,e,1,r)-1;return o[n](i[n](e))}}function io(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function oo(){var t,e,n,r,i,o,a=Ki,s=Ki,c=Ji,l=to;function u(){var t,e,n,c=Math.min(a.length,s.length);return l!==to&&(t=a[0],e=a[c-1],t>e&&(n=t,t=e,e=n),l=function(n){return Math.max(t,Math.min(e,n))}),r=c>2?ro:no,i=o=null,h}function h(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),s,c)))(t(l(e)))}return h.invert=function(n){return l(e((o||(o=r(s,a.map(t),ae)))(n)))},h.domain=function(t){return arguments.length?(a=Array.from(t,$i),u()):a.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),c=Qi,u()},h.clamp=function(t){return arguments.length?(l=!!t||to,u()):l!==to},h.interpolate=function(t){return arguments.length?(c=t,u()):c},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,u()}}function ao(){return oo()(to,to)}function so(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function co(t,e){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof e?this.interpolator(e):this.range(e)}return this}var lo=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]},uo=function(t){return(t=lo(Math.abs(t)))?t[1]:NaN},ho=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fo(t){return new po(t)}function po(t){if(!(e=ho.exec(t)))throw new Error("invalid format: "+t);var e;this.fill=e[1]||" ",this.align=e[2]||">",this.sign=e[3]||"-",this.symbol=e[4]||"",this.zero=!!e[5],this.width=e[6]&&+e[6],this.comma=!!e[7],this.precision=e[8]&&+e[8].slice(1),this.trim=!!e[9],this.type=e[10]||""}fo.prototype=po.prototype,po.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var mo,go,vo,yo,bo=function(t,e){var n=lo(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},xo={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return bo(100*t,e)},r:bo,s:function(t,e){var n=lo(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(mo=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+lo(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},_o=function(t){return t},wo=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];go=function(t){var e,n,r=t.grouping&&t.thousands?(e=t.grouping,n=t.thousands,function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}):_o,i=t.currency,o=t.decimal,a=t.numerals?function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(t.numerals):_o,s=t.percent||"%";function c(t){var e=(t=fo(t)).fill,n=t.align,c=t.sign,l=t.symbol,u=t.zero,h=t.width,d=t.comma,f=t.precision,p=t.trim,m=t.type;"n"===m?(d=!0,m="g"):xo[m]||(null==f&&(f=12),p=!0,m="g"),(u||"0"===e&&"="===n)&&(u=!0,e="0",n="=");var g="$"===l?i[0]:"#"===l&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",v="$"===l?i[1]:/[%p]/.test(m)?s:"",y=xo[m],b=/[defgprs%]/.test(m);function x(t){var i,s,l,x=g,_=v;if("c"===m)_=y(t)+_,t="";else{var w=(t=+t)<0;if(t=y(Math.abs(t),f),p&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(i>0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),w&&0==+t&&(w=!1),x=(w?"("===c?c:"-":"-"===c||"("===c?"":c)+x,_=("s"===m?wo[8+mo/3]:"")+_+(w&&"("===c?")":""),b)for(i=-1,s=t.length;++i<s;)if(48>(l=t.charCodeAt(i))||l>57){_=(46===l?o+t.slice(i+1):t.slice(i))+_,t=t.slice(0,i);break}}d&&!u&&(t=r(t,1/0));var M=x.length+t.length+_.length,S=M<h?new Array(h-M+1).join(e):"";switch(d&&u&&(t=r(S+t,S.length?h-_.length:1/0),S=""),n){case"<":t=x+t+_+S;break;case"=":t=x+S+t+_;break;case"^":t=S.slice(0,M=S.length>>1)+x+t+_+S.slice(M);break;default:t=S+x+t+_}return a(t)}return f=null==f?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),x.toString=function(){return t+""},x}return{format:c,formatPrefix:function(t,e){var n=c(((t=fo(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(uo(e)/3))),i=Math.pow(10,-r),o=wo[8+r/3];return function(t){return n(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),vo=go.format,yo=go.formatPrefix;function Mo(t,e,n,r){var i,o=Ui(t,e,n);switch((r=fo(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(uo(e)/3)))-uo(Math.abs(t)))}(o,a))||(r.precision=i),yo(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,uo(e)-uo(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-uo(Math.abs(t)))}(o))||(r.precision=i-2*("%"===r.type))}return vo(r)}function So(t){var e=t.domain;return t.ticks=function(t){var n=e();return Oi(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return Mo(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,s=o.length-1,c=o[a],l=o[s],u=10;for(l<c&&(i=c,c=l,l=i,i=a,a=s,s=i);u-- >0;){if((i=Fi(c,l,n))===r)return o[a]=c,o[s]=l,e(o);if(i>0)c=Math.floor(c/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;c=Math.ceil(c*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function To(){var t=ao();return t.copy=function(){return io(t,To())},so.apply(t,arguments),So(t)}function Eo(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[Wi(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return Eo().domain(e).range(n).unknown(t)},so.apply(i,arguments)}var Ao=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o};const Lo=Symbol("implicit");function Co(){var t=new Map,e=[],n=[],r=Lo;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==Lo)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;for(const r of n){const n=r+"";t.has(n)||t.set(n,e.push(r))}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Co(e,n).unknown(r)},so.apply(i,arguments),i}function Ro(){var t,e,n=Co().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,c=0,l=0,u=.5;function h(){var n=r().length,h=a<o,d=h?a:o,f=h?o:a;t=(f-d)/Math.max(1,n-c+2*l),s&&(t=Math.floor(t)),d+=(f-d-t*(n-c))*u,e=t*(1-c),s&&(d=Math.round(d),e=Math.round(e));var p=Ao(n).map((function(e){return d+t*e}));return i(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(r(t),h()):r()},n.range=function(t){return arguments.length?([o,a]=t,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(t){return[o,a]=t,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(s=!!t,h()):s},n.padding=function(t){return arguments.length?(c=Math.min(1,l=+t),h()):c},n.paddingInner=function(t){return arguments.length?(c=Math.min(1,t),h()):c},n.paddingOuter=function(t){return arguments.length?(l=+t,h()):l},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return Ro(r(),[o,a]).round(s).paddingInner(c).paddingOuter(l).align(u)},so.apply(h(),arguments)}function Po(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Po(e())},t}function No(){return Po(Ro.apply(null,arguments).paddingInner(1))}function zo(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,$i),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return zo(t).unknown(e)},t=arguments.length?Array.from(t,$i):[0,1],So(n)}function Do(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function Io(t){return Math.log(t)}function Oo(t){return Math.exp(t)}function Fo(t){return-Math.log(-t)}function Uo(t){return-Math.exp(-t)}function Bo(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Ho(t){return function(e){return-t(-e)}}function ko(t){var e,n,r=t(Io,Oo),i=r.domain,o=10;function a(){return e=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(e){return Math.log(e)/t})}(o),n=function(t){return 10===t?Bo:t===Math.E?Math.exp:function(e){return Math.pow(t,e)}}(o),i()[0]<0?(e=Ho(e),n=Ho(n),t(Fo,Uo)):t(Io,Oo),r}return r.base=function(t){return arguments.length?(o=+t,a()):o},r.domain=function(t){return arguments.length?(i(t),a()):i()},r.ticks=function(t){var r,a=i(),s=a[0],c=a[a.length-1];(r=c<s)&&(d=s,s=c,c=d);var l,u,h,d=e(s),f=e(c),p=null==t?10:+t,m=[];if(!(o%1)&&f-d<p){if(d=Math.floor(d),f=Math.ceil(f),s>0){for(;d<=f;++d)for(u=1,l=n(d);u<o;++u)if(!((h=l*u)<s)){if(h>c)break;m.push(h)}}else for(;d<=f;++d)for(u=o-1,l=n(d);u>=1;--u)if(!((h=l*u)<s)){if(h>c)break;m.push(h)}2*m.length<p&&(m=Oi(s,c,p))}else m=Oi(d,f,Math.min(f-d,p)).map(n);return r?m.reverse():m},r.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=vo(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/r.ticks().length);return function(t){var r=t/n(Math.round(e(t)));return r*o<o-.5&&(r*=o),r<=a?i(t):""}},r.nice=function(){return i(Do(i(),{floor:function(t){return n(Math.floor(e(t)))},ceil:function(t){return n(Math.ceil(e(t)))}}))},r}function Go(){var t=ko(oo()).domain([1,10]);return t.copy=function(){return io(t,Go()).base(t.base())},so.apply(t,arguments),t}function jo(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Wo(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Vo(t){var e=1,n=t(jo(e),Wo(e));return n.constant=function(n){return arguments.length?t(jo(e=+n),Wo(e)):e},So(n)}function qo(){var t=Vo(oo());return t.copy=function(){return io(t,qo()).constant(t.constant())},so.apply(t,arguments)}function Yo(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Xo(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Zo(t){return t<0?-t*t:t*t}function Jo(t){var e=t(to,to),n=1;function r(){return 1===n?t(to,to):.5===n?t(Xo,Zo):t(Yo(n),Yo(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},So(e)}function Qo(){var t=Jo(oo());return t.copy=function(){return io(t,Qo()).exponent(t.exponent())},so.apply(t,arguments),t}function $o(){return Qo.apply(null,arguments).exponent(.5)}function Ko(t){return Math.sign(t)*t*t}function ta(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function ea(){var t,e=ao(),n=[0,1],r=!1;function i(n){var i=ta(e(n));return isNaN(i)?t:r?Math.round(i):i}return i.invert=function(t){return e.invert(Ko(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(t){return arguments.length?(e.range((n=Array.from(t,$i)).map(Ko)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(r=!!t,i):r},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return ea(e.domain(),n).round(r).clamp(e.clamp()).unknown(t)},so.apply(i,arguments),So(i)}function na(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function ra(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function ia(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function oa(t,e,n){if(r=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n))).length){if((e=+e)<=0||r<2)return ra(t);if(e>=1)return na(t);var r,i=(r-1)*e,o=Math.floor(i),a=na(function t(e,n,r=0,i=e.length-1,o=Bi){for(;i>r;){if(i-r>600){const a=i-r+1,s=n-r+1,c=Math.log(a),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*l/a+u)),Math.min(i,Math.floor(n+(a-s)*l/a+u)),o)}const a=e[n];let s=r,c=i;for(ia(e,r,n),o(e[i],a)>0&&ia(e,r,i);s<c;){for(ia(e,s,c),++s,--c;o(e[s],a)<0;)++s;for(;o(e[c],a)>0;)--c}0===o(e[r],a)?ia(e,r,c):(++c,ia(e,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}return e}(t,o).subarray(0,o+1));return a+(ra(t.subarray(o+1))-a)*(i-o)}}function aa(t,e,n=ki){if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function sa(){var t,e=[],n=[],r=[];function i(){var t=0,i=Math.max(1,n.length);for(r=new Array(i-1);++t<i;)r[t-1]=aa(e,t/i);return o}function o(e){return isNaN(e=+e)?t:n[Wi(r,e)]}return o.invertExtent=function(t){var i=n.indexOf(t);return i<0?[NaN,NaN]:[i>0?r[i-1]:e[0],i<r.length?r[i]:e[e.length-1]]},o.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Bi),i()},o.range=function(t){return arguments.length?(n=Array.from(t),i()):n.slice()},o.unknown=function(e){return arguments.length?(t=e,o):t},o.quantiles=function(){return r.slice()},o.copy=function(){return sa().domain(e).range(n).unknown(t)},so.apply(o,arguments)}function ca(){var t,e=0,n=1,r=1,i=[.5],o=[0,1];function a(e){return e<=e?o[Wi(i,e,0,r)]:t}function s(){var t=-1;for(i=new Array(r);++t<r;)i[t]=((t+1)*n-(t-r)*e)/(r+1);return a}return a.domain=function(t){return arguments.length?([e,n]=t,e=+e,n=+n,s()):[e,n]},a.range=function(t){return arguments.length?(r=(o=Array.from(t)).length-1,s()):o.slice()},a.invertExtent=function(t){var a=o.indexOf(t);return a<0?[NaN,NaN]:a<1?[e,i[0]]:a>=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return ca().domain([e,n]).range(o).unknown(t)},so.apply(So(a),arguments)}var la=new Date,ua=new Date;function ha(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return s},i.filter=function(n){return ha((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return la.setTime(+e),ua.setTime(+r),t(la),t(ua),Math.floor(n(la,ua))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var da=ha((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));da.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ha((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var fa=da,pa=(da.range,ha((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),ma=pa;pa.range;function ga(t){return ha((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var va=ga(0),ya=ga(1),ba=ga(2),xa=ga(3),_a=ga(4),wa=ga(5),Ma=ga(6),Sa=(va.range,ya.range,ba.range,xa.range,_a.range,wa.range,Ma.range,ha(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5,t=>t.getDate()-1)),Ta=Sa,Ea=(Sa.range,ha((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),Aa=Ea,La=(Ea.range,ha((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}))),Ca=La,Ra=(La.range,ha((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),Pa=Ra,Na=(Ra.range,ha((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));Na.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?ha((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):Na:null};var za=Na;Na.range;function Da(t){return ha((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var Ia=Da(0),Oa=Da(1),Fa=Da(2),Ua=Da(3),Ba=Da(4),Ha=Da(5),ka=Da(6),Ga=(Ia.range,Oa.range,Fa.range,Ua.range,Ba.range,Ha.range,ka.range,ha((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),ja=Ga,Wa=(Ga.range,ha((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));Wa.every=function(t){return isFinite(t=Math.floor(t))&&t>0?ha((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Va=Wa;Wa.range;function qa(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function Ya(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Xa(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var Za,Ja,Qa,$a={"-":"",_:" ",0:"0"},Ka=/^\s*\d+/,ts=/^%/,es=/[\\^$*+?|[\]().{}]/g;function ns(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function rs(t){return t.replace(es,"\\$&")}function is(t){return new RegExp("^(?:"+t.map(rs).join("|")+")","i")}function os(t){return new Map(t.map((t,e)=>[t.toLowerCase(),e]))}function as(t,e,n){var r=Ka.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function ss(t,e,n){var r=Ka.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function cs(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function ls(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function us(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function hs(t,e,n){var r=Ka.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function ds(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fs(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ps(t,e,n){var r=Ka.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function ms(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function gs(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function vs(t,e,n){var r=Ka.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function ys(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function bs(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function xs(t,e,n){var r=Ka.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function _s(t,e,n){var r=Ka.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ws(t,e,n){var r=Ka.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ms(t,e,n){var r=ts.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Ss(t,e,n){var r=Ka.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function Ts(t,e,n){var r=Ka.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Es(t,e){return ns(t.getDate(),e,2)}function As(t,e){return ns(t.getHours(),e,2)}function Ls(t,e){return ns(t.getHours()%12||12,e,2)}function Cs(t,e){return ns(1+Ta.count(fa(t),t),e,3)}function Rs(t,e){return ns(t.getMilliseconds(),e,3)}function Ps(t,e){return Rs(t,e)+"000"}function Ns(t,e){return ns(t.getMonth()+1,e,2)}function zs(t,e){return ns(t.getMinutes(),e,2)}function Ds(t,e){return ns(t.getSeconds(),e,2)}function Is(t){var e=t.getDay();return 0===e?7:e}function Os(t,e){return ns(va.count(fa(t)-1,t),e,2)}function Fs(t){var e=t.getDay();return e>=4||0===e?_a(t):_a.ceil(t)}function Us(t,e){return t=Fs(t),ns(_a.count(fa(t),t)+(4===fa(t).getDay()),e,2)}function Bs(t){return t.getDay()}function Hs(t,e){return ns(ya.count(fa(t)-1,t),e,2)}function ks(t,e){return ns(t.getFullYear()%100,e,2)}function Gs(t,e){return ns((t=Fs(t)).getFullYear()%100,e,2)}function js(t,e){return ns(t.getFullYear()%1e4,e,4)}function Ws(t,e){var n=t.getDay();return ns((t=n>=4||0===n?_a(t):_a.ceil(t)).getFullYear()%1e4,e,4)}function Vs(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+ns(e/60|0,"0",2)+ns(e%60,"0",2)}function qs(t,e){return ns(t.getUTCDate(),e,2)}function Ys(t,e){return ns(t.getUTCHours(),e,2)}function Xs(t,e){return ns(t.getUTCHours()%12||12,e,2)}function Zs(t,e){return ns(1+ja.count(Va(t),t),e,3)}function Js(t,e){return ns(t.getUTCMilliseconds(),e,3)}function Qs(t,e){return Js(t,e)+"000"}function $s(t,e){return ns(t.getUTCMonth()+1,e,2)}function Ks(t,e){return ns(t.getUTCMinutes(),e,2)}function tc(t,e){return ns(t.getUTCSeconds(),e,2)}function ec(t){var e=t.getUTCDay();return 0===e?7:e}function nc(t,e){return ns(Ia.count(Va(t)-1,t),e,2)}function rc(t){var e=t.getUTCDay();return e>=4||0===e?Ba(t):Ba.ceil(t)}function ic(t,e){return t=rc(t),ns(Ba.count(Va(t),t)+(4===Va(t).getUTCDay()),e,2)}function oc(t){return t.getUTCDay()}function ac(t,e){return ns(Oa.count(Va(t)-1,t),e,2)}function sc(t,e){return ns(t.getUTCFullYear()%100,e,2)}function cc(t,e){return ns((t=rc(t)).getUTCFullYear()%100,e,2)}function lc(t,e){return ns(t.getUTCFullYear()%1e4,e,4)}function uc(t,e){var n=t.getUTCDay();return ns((t=n>=4||0===n?Ba(t):Ba.ceil(t)).getUTCFullYear()%1e4,e,4)}function hc(){return"+0000"}function dc(){return"%"}function fc(t){return+t}function pc(t){return Math.floor(+t/1e3)}!function(t){Za=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,c=t.shortMonths,l=is(i),u=os(i),h=is(o),d=os(o),f=is(a),p=os(a),m=is(s),g=os(s),v=is(c),y=os(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Es,e:Es,f:Ps,g:Gs,G:Ws,H:As,I:Ls,j:Cs,L:Rs,m:Ns,M:zs,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:fc,s:pc,S:Ds,u:Is,U:Os,V:Us,w:Bs,W:Hs,x:null,X:null,y:ks,Y:js,Z:Vs,"%":dc},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:qs,e:qs,f:Qs,g:cc,G:uc,H:Ys,I:Xs,j:Zs,L:Js,m:$s,M:Ks,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:fc,s:pc,S:tc,u:ec,U:nc,V:ic,w:oc,W:ac,x:null,X:null,y:sc,Y:lc,Z:hc,"%":dc},_={a:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return S(t,e,n,r)},d:gs,e:gs,f:ws,g:ds,G:hs,H:ys,I:ys,j:vs,L:_s,m:ms,M:bs,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:ps,Q:Ss,s:Ts,S:xs,u:ss,U:cs,V:ls,w:as,W:us,x:function(t,e,r){return S(t,n,e,r)},X:function(t,e,n){return S(t,r,e,n)},y:ds,Y:hs,Z:fs,"%":Ms};function w(t,e){return function(n){var r,i,o,a=[],s=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(c,s)),null!=(i=$a[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),c=s+1);return a.push(t.slice(c,s)),a.join("")}}function M(t,e){return function(n){var r,i,o=Xa(1900,void 0,1);if(S(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Ya(Xa(o.y,0,1))).getUTCDay(),r=i>4||0===i?Oa.ceil(r):Oa(r),r=ja.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=qa(Xa(o.y,0,1))).getDay(),r=i>4||0===i?ya.ceil(r):ya(r),r=Ta.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Ya(Xa(o.y,0,1)).getUTCDay():qa(Xa(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Ya(o)):qa(o)}}function S(t,e,n,r){for(var i,o,a=0,s=e.length,c=n.length;a<s;){if(r>=c)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=_[i in $a?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}}}(t),Ja=Za.format,Za.parse,Qa=Za.utcFormat,Za.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function mc(t){return new Date(t)}function gc(t){return t instanceof Date?+t:+new Date(+t)}function vc(t,e,n,r,i,o,a,s,c){var l=ao(),u=l.invert,h=l.domain,d=c(".%L"),f=c(":%S"),p=c("%I:%M"),m=c("%I %p"),g=c("%a %d"),v=c("%b %d"),y=c("%B"),b=c("%Y"),x=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,864e5],[r,2,1728e5],[n,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function _(s){return(a(s)<s?d:o(s)<s?f:i(s)<s?p:r(s)<s?m:e(s)<s?n(s)<s?g:v:t(s)<s?y:b)(s)}function w(e,n,r){if(null==e&&(e=10),"number"==typeof e){var i,o=Math.abs(r-n)/e,a=Hi((function(t){return t[2]})).right(x,o);return a===x.length?(i=Ui(n/31536e6,r/31536e6,e),e=t):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],e=a[0]):(i=Math.max(Ui(n,r,e),1),e=s),e.every(i)}return e}return l.invert=function(t){return new Date(u(t))},l.domain=function(t){return arguments.length?h(Array.from(t,gc)):h().map(mc)},l.ticks=function(t){var e,n=h(),r=n[0],i=n[n.length-1],o=i<r;return o&&(e=r,r=i,i=e),e=(e=w(t,r,i))?e.range(r,i+1):[],o?e.reverse():e},l.tickFormat=function(t,e){return null==e?_:c(e)},l.nice=function(t){var e=h();return(t=w(t,e[0],e[e.length-1]))?h(Do(e,t)):l},l.copy=function(){return io(l,vc(t,e,n,r,i,o,a,s,c))},l}function yc(){return so.apply(vc(fa,ma,va,Ta,Aa,Ca,Pa,za,Ja).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}var bc=ha((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),xc=bc,_c=(bc.range,ha((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))),wc=_c,Mc=(_c.range,ha((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()}))),Sc=Mc;Mc.range;function Tc(){return so.apply(vc(Va,xc,Ia,ja,wc,Sc,Pa,za,Qa).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Ec(){var t,e,n,r,i,o=0,a=1,s=to,c=!1;function l(e){return isNaN(e=+e)?i:s(0===n?.5:(e=(r(e)-t)*n,c?Math.max(0,Math.min(1,e)):e))}function u(t){return function(e){var n,r;return arguments.length?([n,r]=e,s=t(n,r),l):[s(0),s(1)]}}return l.domain=function(i){return arguments.length?([o,a]=i,t=r(o=+o),e=r(a=+a),n=t===e?0:1/(e-t),l):[o,a]},l.clamp=function(t){return arguments.length?(c=!!t,l):c},l.interpolator=function(t){return arguments.length?(s=t,l):s},l.range=u(Ji),l.rangeRound=u(Qi),l.unknown=function(t){return arguments.length?(i=t,l):i},function(i){return r=i,t=i(o),e=i(a),n=t===e?0:1/(e-t),l}}function Ac(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Lc(){var t=So(Ec()(to));return t.copy=function(){return Ac(t,Lc())},co.apply(t,arguments)}function Cc(){var t=ko(Ec()).domain([1,10]);return t.copy=function(){return Ac(t,Cc()).base(t.base())},co.apply(t,arguments)}function Rc(){var t=Vo(Ec());return t.copy=function(){return Ac(t,Rc()).constant(t.constant())},co.apply(t,arguments)}function Pc(){var t=Jo(Ec());return t.copy=function(){return Ac(t,Pc()).exponent(t.exponent())},co.apply(t,arguments)}function Nc(){return Pc.apply(null,arguments).exponent(.5)}function zc(){var t=[],e=to;function n(n){if(!isNaN(n=+n))return e((Wi(t,n,1)-1)/(t.length-1))}return n.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let n of e)null==n||isNaN(n=+n)||t.push(n);return t.sort(Bi),n},n.interpolator=function(t){return arguments.length?(e=t,n):e},n.range=function(){return t.map((n,r)=>e(r/(t.length-1)))},n.quantiles=function(e){return Array.from({length:e+1},(n,r)=>oa(t,r/e))},n.copy=function(){return zc(e).domain(t)},co.apply(n,arguments)}function Dc(t,e){void 0===e&&(e=t,t=Ji);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n<r;)o[n]=t(i,i=e[++n]);return function(t){var e=Math.max(0,Math.min(r-1,Math.floor(t*=r)));return o[e](t-e)}}function Ic(){var t,e,n,r,i,o,a,s=0,c=.5,l=1,u=1,h=to,d=!1;function f(t){return isNaN(t=+t)?a:(t=.5+((t=+o(t))-e)*(u*t<u*e?r:i),h(d?Math.max(0,Math.min(1,t)):t))}function p(t){return function(e){var n,r,i;return arguments.length?([n,r,i]=e,h=Dc(t,[n,r,i]),f):[h(0),h(.5),h(1)]}}return f.domain=function(a){return arguments.length?([s,c,l]=a,t=o(s=+s),e=o(c=+c),n=o(l=+l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),u=e<t?-1:1,f):[s,c,l]},f.clamp=function(t){return arguments.length?(d=!!t,f):d},f.interpolator=function(t){return arguments.length?(h=t,f):h},f.range=p(Ji),f.rangeRound=p(Qi),f.unknown=function(t){return arguments.length?(a=t,f):a},function(a){return o=a,t=a(s),e=a(c),n=a(l),r=t===e?0:.5/(e-t),i=e===n?0:.5/(n-e),u=e<t?-1:1,f}}function Oc(){var t=So(Ic()(to));return t.copy=function(){return Ac(t,Oc())},co.apply(t,arguments)}function Fc(){var t=ko(Ic()).domain([.1,1,10]);return t.copy=function(){return Ac(t,Fc()).base(t.base())},co.apply(t,arguments)}function Uc(){var t=Vo(Ic());return t.copy=function(){return Ac(t,Uc()).constant(t.constant())},co.apply(t,arguments)}function Bc(){var t=Jo(Ic());return t.copy=function(){return Ac(t,Bc()).exponent(t.exponent())},co.apply(t,arguments)}function Hc(){return Bc.apply(null,arguments).exponent(.5)}var kc={},Gc={};function jc(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Wc(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function Vc(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function qc(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Vc(-e,6):e>9999?"+"+Vc(e,6):Vc(e,4))+"-"+Vc(t.getUTCMonth()+1,2)+"-"+Vc(t.getUTCDate(),2)+(o?"T"+Vc(n,2)+":"+Vc(r,2)+":"+Vc(i,2)+"."+Vc(o,3)+"Z":i?"T"+Vc(n,2)+":"+Vc(r,2)+":"+Vc(i,2)+"Z":r||n?"T"+Vc(n,2)+":"+Vc(r,2)+"Z":"")}var Yc=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return Gc;if(l)return l=!1,kc;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=u())!==Gc;){for(var h=[];r!==kc&&r!==Gc;)h.push(r),r=u();e&&null==(h=e(h,s++))||i.push(h)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?qc(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=jc(t);return function(r,i){return e(n(r),i,t)}}(t,e):jc(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=Wc(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Wc(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}},Xc=Yc(","),Zc=Xc.parse,Jc=(Xc.parseRows,Xc.format,Xc.formatBody,Xc.formatRows,Xc.formatRow,Xc.formatValue,Yc("\t")),Qc=Jc.parse;Jc.parseRows,Jc.format,Jc.formatBody,Jc.formatRows,Jc.formatRow,Jc.formatValue;function $c(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var Kc=function(t,e){return fetch(t,e).then($c)};function tl(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),Kc(e,n).then((function(e){return t(e,r)}))}}var el=tl(Zc);tl(Qc);function nl(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}var rl=function(t,e){return fetch(t,e).then(nl)},il=function(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(void 0===n?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]};function ol(){}Object.assign(ol.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,r=n.length;e<r;e++)n[e].call(this,t)}}});const al=[];for(let t=0;t<256;t++)al[t]=(t<16?"0":"")+t.toString(16);let sl=1234567;const cl={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(al[255&t]+al[t>>8&255]+al[t>>16&255]+al[t>>24&255]+"-"+al[255&e]+al[e>>8&255]+"-"+al[e>>16&15|64]+al[e>>24&255]+"-"+al[63&n|128]+al[n>>8&255]+"-"+al[n>>16&255]+al[n>>24&255]+al[255&r]+al[r>>8&255]+al[r>>16&255]+al[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},damp:function(t,e,n,r){return cl.lerp(t,e,1-Math.exp(-n*r))},pingpong:function(t,e=1){return e-Math.abs(cl.euclideanModulo(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(sl=t%2147483647),sl=16807*sl%2147483647,(sl-1)/2147483646},degToRad:function(t){return t*cl.DEG2RAD},radToDeg:function(t){return t*cl.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),c=a(n/2),l=o((e+r)/2),u=a((e+r)/2),h=o((e-r)/2),d=a((e-r)/2),f=o((r-e)/2),p=a((r-e)/2);switch(i){case"XYX":t.set(s*u,c*h,c*d,s*l);break;case"YZY":t.set(c*d,s*u,c*h,s*l);break;case"ZXZ":t.set(c*h,c*d,s*u,s*l);break;case"XZX":t.set(s*u,c*p,c*f,s*l);break;case"YXY":t.set(c*f,s*u,c*p,s*l);break;case"ZYZ":t.set(c*p,c*f,s*u,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};class ll{constructor(t=0,e=0){Object.defineProperty(this,"isVector2",{value:!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,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}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}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,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,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class ul{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,i,o,a,s,c){const l=this.elements;return l[0]=t,l[1]=r,l[2]=a,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.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 n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],f=n[8],p=r[0],m=r[3],g=r[6],v=r[1],y=r[4],b=r[7],x=r[2],_=r[5],w=r[8];return i[0]=o*p+a*v+s*x,i[3]=o*m+a*y+s*_,i[6]=o*g+a*b+s*w,i[1]=c*p+l*v+u*x,i[4]=c*m+l*y+u*_,i[7]=c*g+l*b+u*w,i[2]=h*p+d*v+f*x,i[5]=h*m+d*y+f*_,i[8]=h*g+d*b+f*w,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],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-n*i*l+n*a*s+r*i*c-r*o*s}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=l*o-a*c,h=a*s-l*i,d=c*i-o*s,f=e*u+n*h+r*d;if(0===f)return this.set(0,0,0,0,0,0,0,0,0);const p=1/f;return t[0]=u*p,t[1]=(r*c-l*n)*p,t[2]=(a*n-r*o)*p,t[3]=h*p,t[4]=(l*e-r*s)*p,t[5]=(r*i-a*e)*p,t[6]=d*p,t[7]=(n*s-c*e)*p,t[8]=(o*e-n*i)*p,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).copy(this).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,n,r,i,o,a){const s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*o+c*a)+o+t,-r*c,r*s,-r*(-c*o+s*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],c=r[4],l=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*c,r[6]=e*a+n*l,r[1]=-n*i+e*s,r[4]=-n*o+e*c,r[7]=-n*a+e*l,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}}let hl;const dl={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===hl&&(hl=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),hl.width=t.width,hl.height=t.height;const n=hl.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=hl}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};let fl=0;function pl(t=pl.DEFAULT_IMAGE,e=pl.DEFAULT_MAPPING,n=1001,r=1001,i=1006,o=1008,a=1023,s=1009,c=1,l=3e3){Object.defineProperty(this,"id",{value:fl++}),this.uuid=cl.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=s,this.offset=new ll(0,0),this.repeat=new ll(1,1),this.center=new ll(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ul,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l,this.version=0,this.onUpdate=null}function ml(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?dl.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}pl.DEFAULT_IMAGE=void 0,pl.DEFAULT_MAPPING=300,pl.prototype=Object.assign(Object.create(ol.prototype),{constructor:pl,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=cl.generateUUID()),!e&&void 0===t.images[r.uuid]){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(ml(r[t].image)):e.push(ml(r[t]))}else e=ml(r);t.images[r.uuid]={uuid:r.uuid,url:e}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(pl.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});class gl{constructor(t=0,e=0,n=0,r=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=e,this.z=n,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,n,r){return this.x=t,this.y=e,this.z=n,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=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,n=this.y,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,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,n,r,i;const o=t.elements,a=o[0],s=o[4],c=o[8],l=o[1],u=o[5],h=o[9],d=o[2],f=o[6],p=o[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-f)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+f)<.1&&Math.abs(a+u+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(a+1)/2,o=(u+1)/2,m=(p+1)/2,g=(s+l)/4,v=(c+d)/4,y=(h+f)/4;return t>o&&t>m?t<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(t),r=g/n,i=v/n):o>m?o<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=g/r,i=y/r):m<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(m),n=v/i,r=y/i),this.set(n,r,i,e),this}let m=Math.sqrt((f-h)*(f-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(m)<.001&&(m=1),this.x=(f-h)/m,this.y=(c-d)/m,this.z=(l-s)/m,this.w=Math.acos((a+u+p-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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,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,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),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}}class vl extends ol{constructor(t,e,n){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=t,this.height=e,this.scissor=new gl(0,0,t,e),this.scissorTest=!1,this.viewport=new gl(0,0,t,e),n=n||{},this.texture=new pl(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setSize(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,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){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class yl{constructor(t=0,e=0,n=0,r=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=e,this._z=n,this._w=r}static slerp(t,e,n,r){return n.copy(t).slerp(e,r)}static slerpFlat(t,e,n,r,i,o,a){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3];const h=i[o+0],d=i[o+1],f=i[o+2],p=i[o+3];if(u!==p||s!==h||c!==d||l!==f){let t=1-a;const e=s*h+c*d+l*f+u*p,n=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,e*n);t=Math.sin(t*o)/i,a=Math.sin(a*o)/i}const i=a*n;if(s=s*t+h*i,c=c*t+d*i,l=l*t+f*i,u=u*t+p*i,t===1-a){const t=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=t,c*=t,l*=t,u*=t}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,r,i,o){const a=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[o],h=i[o+1],d=i[o+2],f=i[o+3];return t[e]=a*f+l*u+s*d-c*h,t[e+1]=s*f+l*h+c*u-a*d,t[e+2]=c*f+l*d+a*h-s*u,t[e+3]=l*f-a*u-s*h-c*d,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,n,r){return this._x=t,this._y=e,this._z=n,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){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,r=t._y,i=t._z,o=t._order,a=Math.cos,s=Math.sin,c=a(n/2),l=a(r/2),u=a(i/2),h=s(n/2),d=s(r/2),f=s(i/2);switch(o){case"XYZ":this._x=h*l*u+c*d*f,this._y=c*d*u-h*l*f,this._z=c*l*f+h*d*u,this._w=c*l*u-h*d*f;break;case"YXZ":this._x=h*l*u+c*d*f,this._y=c*d*u-h*l*f,this._z=c*l*f-h*d*u,this._w=c*l*u+h*d*f;break;case"ZXY":this._x=h*l*u-c*d*f,this._y=c*d*u+h*l*f,this._z=c*l*f+h*d*u,this._w=c*l*u-h*d*f;break;case"ZYX":this._x=h*l*u-c*d*f,this._y=c*d*u+h*l*f,this._z=c*l*f-h*d*u,this._w=c*l*u+h*d*f;break;case"YZX":this._x=h*l*u+c*d*f,this._y=c*d*u+h*l*f,this._z=c*l*f-h*d*u,this._w=c*l*u-h*d*f;break;case"XZY":this._x=h*l*u-c*d*f,this._y=c*d*u-h*l*f,this._z=c*l*f+h*d*u,this._w=c*l*u+h*d*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],i=e[8],o=e[1],a=e[5],s=e[9],c=e[2],l=e[6],u=e[10],h=n+a+u;if(h>0){const t=.5/Math.sqrt(h+1);this._w=.25/t,this._x=(l-s)*t,this._y=(i-c)*t,this._z=(o-r)*t}else if(n>a&&n>u){const t=2*Math.sqrt(1+n-a-u);this._w=(l-s)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(i+c)/t}else if(a>u){const t=2*Math.sqrt(1+a-n-u);this._w=(i-c)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(s+l)/t}else{const t=2*Math.sqrt(1+u-n-a);this._w=(o-r)/t,this._x=(i+c)/t,this._y=(s+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(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=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(cl.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const r=Math.min(1,e/n);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 0===t?(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,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+o*a+r*c-i*s,this._y=r*l+o*s+i*a-n*c,this._z=i*l+o*c+n*s-r*a,this._w=o*l-n*a-r*s-i*c,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,r=this._y,i=this._z,o=this._w;let a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;const s=1-a*a;if(s<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*n+e*this._x,this._y=t*r+e*this._y,this._z=t*i+e*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(s),l=Math.atan2(c,a),u=Math.sin((1-e)*l)/c,h=Math.sin(e*l)/c;return this._w=o*u+this._w*h,this._x=n*u+this._x*h,this._y=r*u+this._y*h,this._z=i*u+this._z*h,this._onChangeCallback(),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._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}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}class bl{constructor(t=0,e=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,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,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(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,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(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 t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(_l.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(_l.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*r-a*n,l=s*n+a*e-i*r,u=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=c*s+h*-i+l*-a-u*-o,this.y=l*s+h*-o+u*-i-c*-a,this.z=u*s+h*-a+c*-o-l*-i,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,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return xl.copy(this).projectOnVector(t),this.sub(xl)}reflect(t){return this.sub(xl.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(cl.clamp(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+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,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,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(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}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,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),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}}const xl=new bl,_l=new yl;class wl{constructor(t,e){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new bl(1/0,1/0,1/0),this.max=void 0!==e?e:new bl(-1/0,-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,c=t.length;s<c;s+=3){const c=t[s],l=t[s+1],u=t[s+2];c<e&&(e=c),l<n&&(n=l),u<r&&(r=u),c>i&&(i=c),l>o&&(o=l),u>a&&(a=u)}return this.min.set(e,n,r),this.max.set(i,o,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,c=t.count;s<c;s++){const c=t.getX(s),l=t.getY(s),u=t.getZ(s);c<e&&(e=c),l<n&&(n=l),u<r&&(r=u),c>i&&(i=c),l>o&&(o=l),u>a&&(a=u)}return this.min.set(e,n,r),this.max.set(i,o,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=Tl.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new bl),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new bl),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),El.copy(e.boundingBox),El.applyMatrix4(t.matrixWorld),this.union(El));const n=t.children;for(let t=0,e=n.length;t<e;t++)this.expandByObject(n[t]);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.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 void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new bl),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.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Tl),Tl.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(zl),Dl.subVectors(this.max,zl),Al.subVectors(t.a,zl),Ll.subVectors(t.b,zl),Cl.subVectors(t.c,zl),Rl.subVectors(Ll,Al),Pl.subVectors(Cl,Ll),Nl.subVectors(Al,Cl);let e=[0,-Rl.z,Rl.y,0,-Pl.z,Pl.y,0,-Nl.z,Nl.y,Rl.z,0,-Rl.x,Pl.z,0,-Pl.x,Nl.z,0,-Nl.x,-Rl.y,Rl.x,0,-Pl.y,Pl.x,0,-Nl.y,Nl.x,0];return!!Ml(e,Al,Ll,Cl,Dl)&&(e=[1,0,0,0,1,0,0,0,1],!!Ml(e,Al,Ll,Cl,Dl)&&(Il.crossVectors(Rl,Pl),e=[Il.x,Il.y,Il.z],Ml(e,Al,Ll,Cl,Dl)))}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new bl),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Tl.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(Tl).length(),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()||(Sl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Sl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Sl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Sl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Sl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Sl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Sl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Sl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Sl)),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)}}function Ml(t,e,n,r,i){for(let o=0,a=t.length-3;o<=a;o+=3){Ol.fromArray(t,o);const a=i.x*Math.abs(Ol.x)+i.y*Math.abs(Ol.y)+i.z*Math.abs(Ol.z),s=e.dot(Ol),c=n.dot(Ol),l=r.dot(Ol);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>a)return!1}return!0}const Sl=[new bl,new bl,new bl,new bl,new bl,new bl,new bl,new bl],Tl=new bl,El=new wl,Al=new bl,Ll=new bl,Cl=new bl,Rl=new bl,Pl=new bl,Nl=new bl,zl=new bl,Dl=new bl,Il=new bl,Ol=new bl,Fl=new wl;class Ul{constructor(t,e){this.center=void 0!==t?t:new bl,this.radius=void 0!==e?e:-1}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Fl.setFromPoints(t).getCenter(n);let r=0;for(let e=0,i=t.length;e<i;e++)r=Math.max(r,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new bl),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new wl),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}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}}const Bl=new bl,Hl=new bl,kl=new bl,Gl=new bl,jl=new bl,Wl=new bl,Vl=new bl;class ql{constructor(t,e){this.origin=void 0!==t?t:new bl,this.direction=void 0!==e?e:new bl(0,0,-1)}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new bl),e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Bl)),this}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new bl),e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Bl.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Bl.copy(this.direction).multiplyScalar(e).add(this.origin),Bl.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){Hl.copy(t).add(e).multiplyScalar(.5),kl.copy(e).sub(t).normalize(),Gl.copy(this.origin).sub(Hl);const i=.5*t.distanceTo(e),o=-this.direction.dot(kl),a=Gl.dot(this.direction),s=-Gl.dot(kl),c=Gl.lengthSq(),l=Math.abs(1-o*o);let u,h,d,f;if(l>0)if(u=o*s-a,h=o*a-s,f=i*l,u>=0)if(h>=-f)if(h<=f){const t=1/l;u*=t,h*=t,d=u*(u+o*h+2*a)+h*(o*u+h+2*s)+c}else h=i,u=Math.max(0,-(o*h+a)),d=-u*u+h*(h+2*s)+c;else h=-i,u=Math.max(0,-(o*h+a)),d=-u*u+h*(h+2*s)+c;else h<=-f?(u=Math.max(0,-(-o*i+a)),h=u>0?-i:Math.min(Math.max(-i,-s),i),d=-u*u+h*(h+2*s)+c):h<=f?(u=0,h=Math.min(Math.max(-i,-s),i),d=h*(h+2*s)+c):(u=Math.max(0,-(o*i+a)),h=u>0?i:Math.min(Math.max(-i,-s),i),d=-u*u+h*(h+2*s)+c);else h=o>0?-i:i,u=Math.max(0,-(o*h+a)),d=-u*u+h*(h+2*s)+c;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(kl).multiplyScalar(h).add(Hl),d}intersectSphere(t,e){Bl.subVectors(t.center,this.origin);const n=Bl.dot(this.direction),r=Bl.dot(Bl)-n*n,i=t.radius*t.radius;if(r>i)return null;const o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,i,o,a,s;const c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,r=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,r=(t.min.x-h.x)*c),l>=0?(i=(t.min.y-h.y)*l,o=(t.max.y-h.y)*l):(i=(t.max.y-h.y)*l,o=(t.min.y-h.y)*l),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),u>=0?(a=(t.min.z-h.z)*u,s=(t.max.z-h.z)*u):(a=(t.max.z-h.z)*u,s=(t.min.z-h.z)*u),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,Bl)}intersectTriangle(t,e,n,r,i){jl.subVectors(e,t),Wl.subVectors(n,t),Vl.crossVectors(jl,Wl);let o,a=this.direction.dot(Vl);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Gl.subVectors(this.origin,t);const s=o*this.direction.dot(Wl.crossVectors(Gl,Wl));if(s<0)return null;const c=o*this.direction.dot(jl.cross(Gl));if(c<0)return null;if(s+c>a)return null;const l=-o*Gl.dot(Vl);return l<0?null:this.at(l/a,i)}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)}}class Yl{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,r,i,o,a,s,c,l,u,h,d,f,p,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,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 Yl).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[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,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Xl.setFromMatrixColumn(t,0).length(),i=1/Xl.setFromMatrixColumn(t,1).length(),o=1/Xl.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if("XYZ"===t.order){const t=o*l,n=o*u,r=a*l,i=a*u;e[0]=s*l,e[4]=-s*u,e[8]=c,e[1]=n+r*c,e[5]=t-i*c,e[9]=-a*s,e[2]=i-t*c,e[6]=r+n*c,e[10]=o*s}else if("YXZ"===t.order){const t=s*l,n=s*u,r=c*l,i=c*u;e[0]=t+i*a,e[4]=r*a-n,e[8]=o*c,e[1]=o*u,e[5]=o*l,e[9]=-a,e[2]=n*a-r,e[6]=i+t*a,e[10]=o*s}else if("ZXY"===t.order){const t=s*l,n=s*u,r=c*l,i=c*u;e[0]=t-i*a,e[4]=-o*u,e[8]=r+n*a,e[1]=n+r*a,e[5]=o*l,e[9]=i-t*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){const t=o*l,n=o*u,r=a*l,i=a*u;e[0]=s*l,e[4]=r*c-n,e[8]=t*c+i,e[1]=s*u,e[5]=i*c+t,e[9]=n*c-r,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){const t=o*s,n=o*c,r=a*s,i=a*c;e[0]=s*l,e[4]=i-t*u,e[8]=r*u+n,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=n*u+r,e[10]=t-i*u}else if("XZY"===t.order){const t=o*s,n=o*c,r=a*s,i=a*c;e[0]=s*l,e[4]=-u,e[8]=c*l,e[1]=t*u+i,e[5]=o*l,e[9]=n*u-r,e[2]=r*u-n,e[6]=a*l,e[10]=i*u+t}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(Jl,t,Ql)}lookAt(t,e,n){const r=this.elements;return tu.subVectors(t,e),0===tu.lengthSq()&&(tu.z=1),tu.normalize(),$l.crossVectors(n,tu),0===$l.lengthSq()&&(1===Math.abs(n.z)?tu.x+=1e-4:tu.z+=1e-4,tu.normalize(),$l.crossVectors(n,tu)),$l.normalize(),Kl.crossVectors(tu,$l),r[0]=$l.x,r[4]=Kl.x,r[8]=tu.x,r[1]=$l.y,r[5]=Kl.y,r[9]=tu.y,r[2]=$l.z,r[6]=Kl.z,r[10]=tu.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],f=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],b=n[11],x=n[15],_=r[0],w=r[4],M=r[8],S=r[12],T=r[1],E=r[5],A=r[9],L=r[13],C=r[2],R=r[6],P=r[10],N=r[14],z=r[3],D=r[7],I=r[11],O=r[15];return i[0]=o*_+a*T+s*C+c*z,i[4]=o*w+a*E+s*R+c*D,i[8]=o*M+a*A+s*P+c*I,i[12]=o*S+a*L+s*N+c*O,i[1]=l*_+u*T+h*C+d*z,i[5]=l*w+u*E+h*R+d*D,i[9]=l*M+u*A+h*P+d*I,i[13]=l*S+u*L+h*N+d*O,i[2]=f*_+p*T+m*C+g*z,i[6]=f*w+p*E+m*R+g*D,i[10]=f*M+p*A+m*P+g*I,i[14]=f*S+p*L+m*N+g*O,i[3]=v*_+y*T+b*C+x*z,i[7]=v*w+y*E+b*R+x*D,i[11]=v*M+y*A+b*P+x*I,i[15]=v*S+y*L+b*N+x*O,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],n=t[4],r=t[8],i=t[12],o=t[1],a=t[5],s=t[9],c=t[13],l=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(+i*s*u-r*c*u-i*a*h+n*c*h+r*a*d-n*s*d)+t[7]*(+e*s*d-e*c*h+i*o*h-r*o*d+r*c*l-i*s*l)+t[11]*(+e*c*u-e*a*d-i*o*u+n*o*d+i*a*l-n*c*l)+t[15]*(-r*a*l-e*s*u+e*a*h+r*o*u-n*o*h+n*s*l)}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,n){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]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],h=t[10],d=t[11],f=t[12],p=t[13],m=t[14],g=t[15],v=u*m*c-p*h*c+p*s*d-a*m*d-u*s*g+a*h*g,y=f*h*c-l*m*c-f*s*d+o*m*d+l*s*g-o*h*g,b=l*p*c-f*u*c+f*a*d-o*p*d-l*a*g+o*u*g,x=f*u*s-l*p*s-f*a*h+o*p*h+l*a*m-o*u*m,_=e*v+n*y+r*b+i*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/_;return t[0]=v*w,t[1]=(p*h*i-u*m*i-p*r*d+n*m*d+u*r*g-n*h*g)*w,t[2]=(a*m*i-p*s*i+p*r*c-n*m*c-a*r*g+n*s*g)*w,t[3]=(u*s*i-a*h*i-u*r*c+n*h*c+a*r*d-n*s*d)*w,t[4]=y*w,t[5]=(l*m*i-f*h*i+f*r*d-e*m*d-l*r*g+e*h*g)*w,t[6]=(f*s*i-o*m*i-f*r*c+e*m*c+o*r*g-e*s*g)*w,t[7]=(o*h*i-l*s*i+l*r*c-e*h*c-o*r*d+e*s*d)*w,t[8]=b*w,t[9]=(f*u*i-l*p*i-f*n*d+e*p*d+l*n*g-e*u*g)*w,t[10]=(o*p*i-f*a*i+f*n*c-e*p*c-o*n*g+e*a*g)*w,t[11]=(l*a*i-o*u*i-l*n*c+e*u*c+o*n*d-e*a*d)*w,t[12]=x*w,t[13]=(l*p*r-f*u*r+f*n*h-e*p*h-l*n*m+e*u*m)*w,t[14]=(f*a*r-o*p*r-f*n*s+e*p*s+o*n*m-e*a*m)*w,t[15]=(o*u*r-l*a*r+l*n*s-e*u*s-o*n*h+e*a*h)*w,this}scale(t){const e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=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,n,r))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,a=t.y,s=t.z,c=i*o,l=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,l*a+n,l*s-r*o,0,c*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,c=i+i,l=o+o,u=a+a,h=i*c,d=i*l,f=i*u,p=o*l,m=o*u,g=a*u,v=s*c,y=s*l,b=s*u,x=n.x,_=n.y,w=n.z;return r[0]=(1-(p+g))*x,r[1]=(d+b)*x,r[2]=(f-y)*x,r[3]=0,r[4]=(d-b)*_,r[5]=(1-(h+g))*_,r[6]=(m+v)*_,r[7]=0,r[8]=(f+y)*w,r[9]=(m-v)*w,r[10]=(1-(h+p))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let i=Xl.set(r[0],r[1],r[2]).length();const o=Xl.set(r[4],r[5],r[6]).length(),a=Xl.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],Zl.copy(this);const s=1/i,c=1/o,l=1/a;return Zl.elements[0]*=s,Zl.elements[1]*=s,Zl.elements[2]*=s,Zl.elements[4]*=c,Zl.elements[5]*=c,Zl.elements[6]*=c,Zl.elements[8]*=l,Zl.elements[9]*=l,Zl.elements[10]*=l,e.setFromRotationMatrix(Zl),n.x=i,n.y=o,n.z=a,this}makePerspective(t,e,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,s=2*i/(e-t),c=2*i/(n-r),l=(e+t)/(e-t),u=(n+r)/(n-r),h=-(o+i)/(o-i),d=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,r,i,o){const a=this.elements,s=1/(e-t),c=1/(n-r),l=1/(o-i),u=(e+t)*s,h=(n+r)*c,d=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Xl=new bl,Zl=new Yl,Jl=new bl(0,0,0),Ql=new bl(1,1,1),$l=new bl,Kl=new bl,tu=new bl;class eu{constructor(t=0,e=0,n=0,r=eu.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=e,this._z=n,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,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,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,n){const r=cl.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],d=i[6],f=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,o));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,l));break;case"YZX":this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,f));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return nu.makeRotationFromQuaternion(t),this.setFromRotationMatrix(nu,e,n)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this._order)}reorder(t){return ru.setFromEuler(this),this.setFromQuaternion(ru,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],void 0!==t[3]&&(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}toVector3(t){return t?t.set(this._x,this._y,this._z):new bl(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}eu.DefaultOrder="XYZ",eu.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const nu=new Yl,ru=new yl;class iu{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}}let ou=0;const au=new bl,su=new yl,cu=new Yl,lu=new bl,uu=new bl,hu=new bl,du=new yl,fu=new bl(1,0,0),pu=new bl(0,1,0),mu=new bl(0,0,1),gu={type:"added"},vu={type:"removed"};function yu(){Object.defineProperty(this,"id",{value:ou++}),this.uuid=cl.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=yu.DefaultUp.clone();const t=new bl,e=new eu,n=new yl,r=new bl(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new Yl},normalMatrix:{value:new ul}}),this.matrix=new Yl,this.matrixWorld=new Yl,this.matrixAutoUpdate=yu.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new iu,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}yu.DefaultUp=new bl(0,1,0),yu.DefaultMatrixAutoUpdate=!0,yu.prototype=Object.assign(Object.create(ol.prototype),{constructor:yu,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return su.setFromAxisAngle(t,e),this.quaternion.multiply(su),this},rotateOnWorldAxis:function(t,e){return su.setFromAxisAngle(t,e),this.quaternion.premultiply(su),this},rotateX:function(t){return this.rotateOnAxis(fu,t)},rotateY:function(t){return this.rotateOnAxis(pu,t)},rotateZ:function(t){return this.rotateOnAxis(mu,t)},translateOnAxis:function(t,e){return au.copy(t).applyQuaternion(this.quaternion),this.position.add(au.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(fu,t)},translateY:function(t){return this.translateOnAxis(pu,t)},translateZ:function(t){return this.translateOnAxis(mu,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(cu.copy(this.matrixWorld).invert())},lookAt:function(t,e,n){t.isVector3?lu.copy(t):lu.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),uu.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?cu.lookAt(uu,lu,this.up):cu.lookAt(lu,uu,this.up),this.quaternion.setFromRotationMatrix(cu),r&&(cu.extractRotation(r.matrixWorld),su.setFromRotationMatrix(cu),this.quaternion.premultiply(su.invert()))},add:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(gu)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(vu)),this},clear:function(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(vu)}return this.children.length=0,this},attach:function(t){return this.updateWorldMatrix(!0,!1),cu.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),cu.multiply(t.parent.matrixWorld)),t.applyMatrix4(cu),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new bl),this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new yl),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(uu,t,hu),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new bl),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(uu,du,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new bl),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)},traverseAncestors:function(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++)t[e].updateWorldMatrix(!1,!0)}},toJSON:function(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){const r=n[e];i(t.shapes,r)}else i(t.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,r=this.material.length;n<r;n++)e.push(i(t.materials,this.material[n]));r.material=e}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];r.animations.push(i(t.animations,n))}}if(e){const e=o(t.geometries),r=o(t.materials),i=o(t.textures),a=o(t.images),s=o(t.shapes),c=o(t.skeletons),l=o(t.animations);e.length>0&&(n.geometries=e),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l)}return n.object=r,n;function o(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(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.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.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}});const bu=new bl,xu=new bl,_u=new ul;class wu{constructor(t,e){Object.defineProperty(this,"isPlane",{value:!0}),this.normal=void 0!==t?t:new bl(1,0,0),this.constant=void 0!==e?e:0}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=bu.subVectors(n,e).cross(xu.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}clone(){return(new this.constructor).copy(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 void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new bl),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new bl);const n=t.delta(bu),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;const i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||i>1?void 0:e.copy(n).multiplyScalar(i).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new bl),t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||_u.getNormalMatrix(t),r=this.coplanarPoint(bu).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}const Mu=new bl,Su=new bl,Tu=new bl,Eu=new bl,Au=new bl,Lu=new bl,Cu=new bl,Ru=new bl,Pu=new bl,Nu=new bl;class zu{constructor(t,e,n){this.a=void 0!==t?t:new bl,this.b=void 0!==e?e:new bl,this.c=void 0!==n?n:new bl}static getNormal(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new bl),r.subVectors(n,e),Mu.subVectors(t,e),r.cross(Mu);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(t,e,n,r,i){Mu.subVectors(r,e),Su.subVectors(n,e),Tu.subVectors(t,e);const o=Mu.dot(Mu),a=Mu.dot(Su),s=Mu.dot(Tu),c=Su.dot(Su),l=Su.dot(Tu),u=o*c-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new bl),0===u)return i.set(-2,-1,-1);const h=1/u,d=(c*s-a*l)*h,f=(o*l-a*s)*h;return i.set(1-d-f,f,d)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Eu),Eu.x>=0&&Eu.y>=0&&Eu.x+Eu.y<=1}static getUV(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,Eu),s.set(0,0),s.addScaledVector(i,Eu.x),s.addScaledVector(o,Eu.y),s.addScaledVector(a,Eu.z),s}static isFrontFacing(t,e,n,r){return Mu.subVectors(n,e),Su.subVectors(t,e),Mu.cross(Su).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(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 Mu.subVectors(this.c,this.b),Su.subVectors(this.a,this.b),.5*Mu.cross(Su).length()}getMidpoint(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new bl),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return zu.getNormal(this.a,this.b,this.c,t)}getPlane(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new wu),t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return zu.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,r,i){return zu.getUV(t,this.a,this.b,this.c,e,n,r,i)}containsPoint(t){return zu.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return zu.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new bl);const n=this.a,r=this.b,i=this.c;let o,a;Au.subVectors(r,n),Lu.subVectors(i,n),Ru.subVectors(t,n);const s=Au.dot(Ru),c=Lu.dot(Ru);if(s<=0&&c<=0)return e.copy(n);Pu.subVectors(t,r);const l=Au.dot(Pu),u=Lu.dot(Pu);if(l>=0&&u<=l)return e.copy(r);const h=s*u-l*c;if(h<=0&&s>=0&&l<=0)return o=s/(s-l),e.copy(n).addScaledVector(Au,o);Nu.subVectors(t,i);const d=Au.dot(Nu),f=Lu.dot(Nu);if(f>=0&&d<=f)return e.copy(i);const p=d*c-s*f;if(p<=0&&c>=0&&f<=0)return a=c/(c-f),e.copy(n).addScaledVector(Lu,a);const m=l*f-d*u;if(m<=0&&u-l>=0&&d-f>=0)return Cu.subVectors(i,r),a=(u-l)/(u-l+(d-f)),e.copy(r).addScaledVector(Cu,a);const g=1/(m+p+h);return o=p*g,a=h*g,e.copy(n).addScaledVector(Au,o).addScaledVector(Lu,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Du={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},Iu={h:0,s:0,l:0},Ou={h:0,s:0,l:0};function Fu(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Uu(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Bu(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Hu{constructor(t,e,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=cl.euclideanModulo(t,1),e=cl.clamp(e,0,1),n=cl.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=Fu(i,r,t+1/3),this.g=Fu(i,r,t),this.b=Fu(i,r,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(t[1])/360,r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Du[t];return void 0!==e?this.setHex(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}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Uu(t.r),this.g=Uu(t.g),this.b=Uu(t.b),this}copyLinearToSRGB(t){return this.r=Bu(t.r),this.g=Bu(t.g),this.b=Bu(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,n=this.g,r=this.b,i=Math.max(e,n,r),o=Math.min(e,n,r);let a,s;const c=(o+i)/2;if(o===i)a=0,s=0;else{const t=i-o;switch(s=c<=.5?t/(i+o):t/(2-i-o),i){case e:a=(n-r)/t+(n<r?6:0);break;case n:a=(r-e)/t+2;break;case r:a=(e-n)/t+4}a/=6}return t.h=a,t.s=s,t.l=c,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,n){return this.getHSL(Iu),Iu.h+=t,Iu.s+=e,Iu.l+=n,this.setHSL(Iu.h,Iu.s,Iu.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Iu),t.getHSL(Ou);const n=cl.lerp(Iu.h,Ou.h,e),r=cl.lerp(Iu.s,Ou.s,e),i=cl.lerp(Iu.l,Ou.l,e);return this.setHSL(n,r,i),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}Hu.NAMES=Du,Hu.prototype.r=1,Hu.prototype.g=1,Hu.prototype.b=1;class ku{constructor(t,e,n,r,i,o=0){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new bl,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new Hu,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=o}clone(){return(new this.constructor).copy(this)}copy(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(let e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}let Gu=0;function ju(){Object.defineProperty(this,"id",{value:Gu++}),this.uuid=cl.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,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.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function Wu(t){ju.call(this),this.type="MeshBasicMaterial",this.color=new Hu(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}ju.prototype=Object.assign(Object.create(ol.prototype),{constructor:ju,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}},toJSON:function(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){const e=r(t.textures),i=r(t.images);e.length>0&&(n.textures=e),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,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 n=null;if(null!==e){const t=e.length;n=new Array(t);for(let r=0;r!==t;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,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.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ju.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Wu.prototype=Object.create(ju.prototype),Wu.prototype.constructor=Wu,Wu.prototype.isMeshBasicMaterial=!0,Wu.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};const Vu=new bl,qu=new ll;function Yu(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Xu(t,e,n){Yu.call(this,new Int8Array(t),e,n)}function Zu(t,e,n){Yu.call(this,new Uint8Array(t),e,n)}function Ju(t,e,n){Yu.call(this,new Uint8ClampedArray(t),e,n)}function Qu(t,e,n){Yu.call(this,new Int16Array(t),e,n)}function $u(t,e,n){Yu.call(this,new Uint16Array(t),e,n)}function Ku(t,e,n){Yu.call(this,new Int32Array(t),e,n)}function th(t,e,n){Yu.call(this,new Uint32Array(t),e,n)}function eh(t,e,n){Yu.call(this,new Uint16Array(t),e,n)}function nh(t,e,n){Yu.call(this,new Float32Array(t),e,n)}function rh(t,e,n){Yu.call(this,new Float64Array(t),e,n)}function ih(t){if(0===t.length)return-1/0;let e=t[0];for(let n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(Yu.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Yu.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),i=new Hu),e[n++]=i.r,e[n++]=i.g,e[n++]=i.b}return this},copyVector2sArray:function(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),i=new ll),e[n++]=i.x,e[n++]=i.y}return this},copyVector3sArray:function(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new bl),e[n++]=i.x,e[n++]=i.y,e[n++]=i.z}return this},copyVector4sArray:function(t){const e=this.array;let n=0;for(let r=0,i=t.length;r<i;r++){let i=t[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),i=new gl),e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n++]=i.w}return this},applyMatrix3:function(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)qu.fromBufferAttribute(this,e),qu.applyMatrix3(t),this.setXY(e,qu.x,qu.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Vu.fromBufferAttribute(this,e),Vu.applyMatrix3(t),this.setXYZ(e,Vu.x,Vu.y,Vu.z);return this},applyMatrix4:function(t){for(let e=0,n=this.count;e<n;e++)Vu.x=this.getX(e),Vu.y=this.getY(e),Vu.z=this.getZ(e),Vu.applyMatrix4(t),this.setXYZ(e,Vu.x,Vu.y,Vu.z);return this},applyNormalMatrix:function(t){for(let e=0,n=this.count;e<n;e++)Vu.x=this.getX(e),Vu.y=this.getY(e),Vu.z=this.getZ(e),Vu.applyNormalMatrix(t),this.setXYZ(e,Vu.x,Vu.y,Vu.z);return this},transformDirection:function(t){for(let e=0,n=this.count;e<n;e++)Vu.x=this.getX(e),Vu.y=this.getY(e),Vu.z=this.getZ(e),Vu.transformDirection(t),this.setXYZ(e,Vu.x,Vu.y,Vu.z);return this},set:function(t,e=0){return this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Xu.prototype=Object.create(Yu.prototype),Xu.prototype.constructor=Xu,Zu.prototype=Object.create(Yu.prototype),Zu.prototype.constructor=Zu,Ju.prototype=Object.create(Yu.prototype),Ju.prototype.constructor=Ju,Qu.prototype=Object.create(Yu.prototype),Qu.prototype.constructor=Qu,$u.prototype=Object.create(Yu.prototype),$u.prototype.constructor=$u,Ku.prototype=Object.create(Yu.prototype),Ku.prototype.constructor=Ku,th.prototype=Object.create(Yu.prototype),th.prototype.constructor=th,eh.prototype=Object.create(Yu.prototype),eh.prototype.constructor=eh,eh.prototype.isFloat16BufferAttribute=!0,nh.prototype=Object.create(Yu.prototype),nh.prototype.constructor=nh,rh.prototype=Object.create(Yu.prototype),rh.prototype.constructor=rh;const oh={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function ah(t,e){return new oh[t](e)}let sh=0;const ch=new Yl,lh=new yu,uh=new bl,hh=new wl,dh=new wl,fh=new bl;function ph(){Object.defineProperty(this,"id",{value:sh++}),this.uuid=cl.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}ph.prototype=Object.assign(Object.create(ol.prototype),{constructor:ph,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){return Array.isArray(t)?this.index=new(ih(t)>65535?th:$u)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new ul).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return ch.makeRotationX(t),this.applyMatrix4(ch),this},rotateY:function(t){return ch.makeRotationY(t),this.applyMatrix4(ch),this},rotateZ:function(t){return ch.makeRotationZ(t),this.applyMatrix4(ch),this},translate:function(t,e,n){return ch.makeTranslation(t,e,n),this.applyMatrix4(ch),this},scale:function(t,e,n){return ch.makeScale(t,e,n),this.applyMatrix4(ch),this},lookAt:function(t){return lh.lookAt(t),lh.updateMatrix(),this.applyMatrix4(lh.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(uh).negate(),this.translate(uh.x,uh.y,uh.z),this},setFromPoints:function(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new nh(e,3)),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new wl);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new bl(-1/0,-1/0,-1/0),new bl(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];hh.setFromBufferAttribute(n),this.morphTargetsRelative?(fh.addVectors(this.boundingBox.min,hh.min),this.boundingBox.expandByPoint(fh),fh.addVectors(this.boundingBox.max,hh.max),this.boundingBox.expandByPoint(fh)):(this.boundingBox.expandByPoint(hh.min),this.boundingBox.expandByPoint(hh.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Ul);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new bl,1/0);if(t){const n=this.boundingSphere.center;if(hh.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];dh.setFromBufferAttribute(n),this.morphTargetsRelative?(fh.addVectors(hh.min,dh.min),hh.expandByPoint(fh),fh.addVectors(hh.max,dh.max),hh.expandByPoint(fh)):(hh.expandByPoint(dh.min),hh.expandByPoint(dh.max))}hh.getCenter(n);let r=0;for(let e=0,i=t.count;e<i;e++)fh.fromBufferAttribute(t,e),r=Math.max(r,n.distanceToSquared(fh));if(e)for(let i=0,o=e.length;i<o;i++){const o=e[i],a=this.morphTargetsRelative;for(let e=0,i=o.count;e<i;e++)fh.fromBufferAttribute(o,e),a&&(uh.fromBufferAttribute(t,e),fh.add(uh)),r=Math.max(r,n.distanceToSquared(fh))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeTangents:function(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,r=e.position.array,i=e.normal.array,o=e.uv.array,a=r.length/3;void 0===e.tangent&&this.setAttribute("tangent",new Yu(new Float32Array(4*a),4));const s=e.tangent.array,c=[],l=[];for(let t=0;t<a;t++)c[t]=new bl,l[t]=new bl;const u=new bl,h=new bl,d=new bl,f=new ll,p=new ll,m=new ll,g=new bl,v=new bl;function y(t,e,n){u.fromArray(r,3*t),h.fromArray(r,3*e),d.fromArray(r,3*n),f.fromArray(o,2*t),p.fromArray(o,2*e),m.fromArray(o,2*n),h.sub(u),d.sub(u),p.sub(f),m.sub(f);const i=1/(p.x*m.y-m.x*p.y);isFinite(i)&&(g.copy(h).multiplyScalar(m.y).addScaledVector(d,-p.y).multiplyScalar(i),v.copy(d).multiplyScalar(p.x).addScaledVector(h,-m.x).multiplyScalar(i),c[t].add(g),c[e].add(g),c[n].add(g),l[t].add(v),l[e].add(v),l[n].add(v))}let b=this.groups;0===b.length&&(b=[{start:0,count:n.length}]);for(let t=0,e=b.length;t<e;++t){const e=b[t],r=e.start;for(let t=r,i=r+e.count;t<i;t+=3)y(n[t+0],n[t+1],n[t+2])}const x=new bl,_=new bl,w=new bl,M=new bl;function S(t){w.fromArray(i,3*t),M.copy(w);const e=c[t];x.copy(e),x.sub(w.multiplyScalar(w.dot(e))).normalize(),_.crossVectors(M,e);const n=_.dot(l[t])<0?-1:1;s[4*t]=x.x,s[4*t+1]=x.y,s[4*t+2]=x.z,s[4*t+3]=n}for(let t=0,e=b.length;t<e;++t){const e=b[t],r=e.start;for(let t=r,i=r+e.count;t<i;t+=3)S(n[t+0]),S(n[t+1]),S(n[t+2])}},computeVertexNormals:function(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Yu(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const r=new bl,i=new bl,o=new bl,a=new bl,s=new bl,c=new bl,l=new bl,u=new bl;if(t)for(let h=0,d=t.count;h<d;h+=3){const d=t.getX(h+0),f=t.getX(h+1),p=t.getX(h+2);r.fromBufferAttribute(e,d),i.fromBufferAttribute(e,f),o.fromBufferAttribute(e,p),l.subVectors(o,i),u.subVectors(r,i),l.cross(u),a.fromBufferAttribute(n,d),s.fromBufferAttribute(n,f),c.fromBufferAttribute(n,p),a.add(l),s.add(l),c.add(l),n.setXYZ(d,a.x,a.y,a.z),n.setXYZ(f,s.x,s.y,s.z),n.setXYZ(p,c.x,c.y,c.z)}else for(let t=0,a=e.count;t<a;t+=3)r.fromBufferAttribute(e,t+0),i.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),l.subVectors(o,i),u.subVectors(r,i),l.cross(u),n.setXYZ(t+0,l.x,l.y,l.z),n.setXYZ(t+1,l.x,l.y,l.z),n.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(void 0===t.attributes[r])continue;const i=n[r].array,o=t.attributes[r],a=o.array,s=o.itemSize*e,c=Math.min(a.length,i.length-s);for(let t=0,e=s;t<c;t++,e++)i[e]=a[t]}return this},normalizeNormals:function(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)fh.fromBufferAttribute(t,e),fh.normalize(),t.setXYZ(e,fh.x,fh.y,fh.z)},toNonIndexed:function(){function t(t,e){const n=t.array,r=t.itemSize,i=t.normalized,o=new n.constructor(e.length*r);let a=0,s=0;for(let t=0,i=e.length;t<i;t++){a=e[t]*r;for(let t=0;t<r;t++)o[s++]=n[a++]}return new Yu(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new ph,n=this.index.array,r=this.attributes;for(const i in r){const o=t(r[i],n);e.setAttribute(i,o)}const i=this.morphAttributes;for(const r in i){const o=[],a=i[r];for(let e=0,r=a.length;e<r;e++){const r=t(a[e],n);o.push(r)}e.morphAttributes[r]=o}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let t=0,n=o.length;t<n;t++){const n=o[t];e.addGroup(n.start,n.count,n.materialIndex)}return e},toJSON:function(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const r=n[e],i=r.toJSON(t.data);""!==r.name&&(i.name=r.name),t.data.attributes[e]=i}const r={};let i=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],o=[];for(let e=0,r=n.length;e<r;e++){const r=n[e],i=r.toJSON(t.data);""!==r.name&&(i.name=r.name),o.push(i)}o.length>0&&(r[e]=o,i=!0)}i&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t},clone:function(){return(new ph).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const r=t.attributes;for(const t in r){const n=r[t];this.setAttribute(t,n.clone(e))}const i=t.morphAttributes;for(const t in i){const n=[],r=i[t];for(let t=0,i=r.length;t<i;t++)n.push(r[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let t=0,e=o.length;t<e;t++){const e=o[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});const mh=new Yl,gh=new ql,vh=new Ul,yh=new bl,bh=new bl,xh=new bl,_h=new bl,wh=new bl,Mh=new bl,Sh=new bl,Th=new bl,Eh=new bl,Ah=new ll,Lh=new ll,Ch=new ll,Rh=new bl,Ph=new bl;function Nh(t=new ph,e=new Wu){yu.call(this),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}function zh(t,e,n,r,i,o,a,s,c,l,u,h){yh.fromBufferAttribute(i,l),bh.fromBufferAttribute(i,u),xh.fromBufferAttribute(i,h);const d=t.morphTargetInfluences;if(e.morphTargets&&o&&d){Sh.set(0,0,0),Th.set(0,0,0),Eh.set(0,0,0);for(let t=0,e=o.length;t<e;t++){const e=d[t],n=o[t];0!==e&&(_h.fromBufferAttribute(n,l),wh.fromBufferAttribute(n,u),Mh.fromBufferAttribute(n,h),a?(Sh.addScaledVector(_h,e),Th.addScaledVector(wh,e),Eh.addScaledVector(Mh,e)):(Sh.addScaledVector(_h.sub(yh),e),Th.addScaledVector(wh.sub(bh),e),Eh.addScaledVector(Mh.sub(xh),e)))}yh.add(Sh),bh.add(Th),xh.add(Eh)}t.isSkinnedMesh&&(t.boneTransform(l,yh),t.boneTransform(u,bh),t.boneTransform(h,xh));const f=function(t,e,n,r,i,o,a,s){let c;if(c=1===e.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,2!==e.side,s),null===c)return null;Ph.copy(s),Ph.applyMatrix4(t.matrixWorld);const l=n.ray.origin.distanceTo(Ph);return l<n.near||l>n.far?null:{distance:l,point:Ph.clone(),object:t}}(t,e,n,r,yh,bh,xh,Rh);if(f){s&&(Ah.fromBufferAttribute(s,l),Lh.fromBufferAttribute(s,u),Ch.fromBufferAttribute(s,h),f.uv=zu.getUV(Rh,yh,bh,xh,Ah,Lh,Ch,new ll)),c&&(Ah.fromBufferAttribute(c,l),Lh.fromBufferAttribute(c,u),Ch.fromBufferAttribute(c,h),f.uv2=zu.getUV(Rh,yh,bh,xh,Ah,Lh,Ch,new ll));const t=new ku(l,u,h);zu.getNormal(yh,bh,xh,t.normal),f.face=t}return f}Nh.prototype=Object.assign(Object.create(yu.prototype),{constructor:Nh,isMesh:!0,copy:function(t){return yu.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),vh.copy(n.boundingSphere),vh.applyMatrix4(i),!1===t.ray.intersectsSphere(vh))return;if(mh.copy(i).invert(),gh.copy(t.ray).applyMatrix4(mh),null!==n.boundingBox&&!1===gh.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position,s=n.morphAttributes.position,c=n.morphTargetsRelative,l=n.attributes.uv,u=n.attributes.uv2,h=n.groups,d=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,f=h.length;n<f;n++){const f=h[n],p=r[f.materialIndex];for(let n=Math.max(f.start,d.start),r=Math.min(f.start+f.count,d.start+d.count);n<r;n+=3){const r=i.getX(n),h=i.getX(n+1),d=i.getX(n+2);o=zh(this,p,t,gh,a,s,c,l,u,r,h,d),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=f.materialIndex,e.push(o))}}else{for(let n=Math.max(0,d.start),h=Math.min(i.count,d.start+d.count);n<h;n+=3){const h=i.getX(n),d=i.getX(n+1),f=i.getX(n+2);o=zh(this,r,t,gh,a,s,c,l,u,h,d,f),o&&(o.faceIndex=Math.floor(n/3),e.push(o))}}else if(void 0!==a)if(Array.isArray(r))for(let n=0,i=h.length;n<i;n++){const i=h[n],f=r[i.materialIndex];for(let n=Math.max(i.start,d.start),r=Math.min(i.start+i.count,d.start+d.count);n<r;n+=3){o=zh(this,f,t,gh,a,s,c,l,u,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=i.materialIndex,e.push(o))}}else{for(let n=Math.max(0,d.start),i=Math.min(a.count,d.start+d.count);n<i;n+=3){o=zh(this,r,t,gh,a,s,c,l,u,n,n+1,n+2),o&&(o.faceIndex=Math.floor(n/3),e.push(o))}}}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}});class Dh extends ph{constructor(t=1,e=1,n=1,r=1,i=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const s=[],c=[],l=[],u=[];let h=0,d=0;function f(t,e,n,r,i,o,f,p,m,g,v){const y=o/m,b=f/g,x=o/2,_=f/2,w=p/2,M=m+1,S=g+1;let T=0,E=0;const A=new bl;for(let o=0;o<S;o++){const a=o*b-_;for(let s=0;s<M;s++){const h=s*y-x;A[t]=h*r,A[e]=a*i,A[n]=w,c.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=p>0?1:-1,l.push(A.x,A.y,A.z),u.push(s/m),u.push(1-o/g),T+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const n=h+e+M*t,r=h+e+M*(t+1),i=h+(e+1)+M*(t+1),o=h+(e+1)+M*t;s.push(n,r,o),s.push(r,i,o),E+=6}a.addGroup(d,E,v),d+=E,h+=T}f("z","y","x",-1,-1,n,e,t,o,i,0),f("z","y","x",1,-1,n,e,-t,o,i,1),f("x","z","y",1,1,t,n,e,r,o,2),f("x","z","y",1,-1,t,n,-e,r,o,3),f("x","y","z",1,-1,t,e,n,r,i,4),f("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new nh(c,3)),this.setAttribute("normal",new nh(l,3)),this.setAttribute("uv",new nh(u,2))}}function Ih(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function Oh(t){const e={};for(let n=0;n<t.length;n++){const r=Ih(t[n]);for(const t in r)e[t]=r[t]}return e}const Fh={clone:Ih,merge:Oh};function Uh(t){ju.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Bh(){yu.call(this),this.type="Camera",this.matrixWorldInverse=new Yl,this.projectionMatrix=new Yl,this.projectionMatrixInverse=new Yl}function Hh(t=50,e=1,n=.1,r=2e3){Bh.call(this),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Uh.prototype=Object.create(ju.prototype),Uh.prototype.constructor=Uh,Uh.prototype.isShaderMaterial=!0,Uh.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ih(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this},Uh.prototype.toJSON=function(t){const e=ju.prototype.toJSON.call(this,t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e},Bh.prototype=Object.assign(Object.create(yu.prototype),{constructor:Bh,isCamera:!0,copy:function(t,e){return yu.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new bl),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){yu.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){yu.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Hh.prototype=Object.assign(Object.create(Bh.prototype),{constructor:Hh,isPerspectiveCamera:!0,copy:function(t,e){return Bh.prototype.copy.call(this,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=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*cl.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*cl.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*cl.RAD2DEG*Math.atan(Math.tan(.5*cl.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=this.near;let e=t*Math.tan(.5*cl.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,a=o.fullHeight;i+=o.offsetX*r/t,e-=o.offsetY*n/a,r*=o.width/t,n*=o.height/a}const a=this.filmOffset;0!==a&&(i+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=yu.prototype.toJSON.call(this,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,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function kh(t,e,n){if(yu.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new Hh(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new bl(1,0,0)),this.add(r);const i=new Hh(90,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new bl(-1,0,0)),this.add(i);const o=new Hh(90,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new bl(0,1,0)),this.add(o);const a=new Hh(90,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new bl(0,-1,0)),this.add(a);const s=new Hh(90,1,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new bl(0,0,1)),this.add(s);const c=new Hh(90,1,t,e);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new bl(0,0,-1)),this.add(c),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const l=t.xr.enabled,u=t.getRenderTarget();t.xr.enabled=!1;const h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,i),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=h,t.setRenderTarget(n,5),t.render(e,c),t.setRenderTarget(u),t.xr.enabled=l}}function Gh(t,e,n,r,i,o,a,s,c,l){t=void 0!==t?t:[],e=void 0!==e?e:301,a=void 0!==a?a:1022,pl.call(this,t,e,n,r,i,o,a,s,c,l),this.flipY=!1,this._needsFlipEnvMap=!0}kh.prototype=Object.create(yu.prototype),kh.prototype.constructor=kh,Gh.prototype=Object.create(pl.prototype),Gh.prototype.constructor=Gh,Gh.prototype.isCubeTexture=!0,Object.defineProperty(Gh.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});class jh extends vl{constructor(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),super(t,t,e),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),e=e||{},this.texture=new Gh(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=1023,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new Dh(5,5,5),i=new Uh({name:"CubemapFromEquirect",uniforms:Ih(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;const o=new Nh(r,i),a=e.minFilter;1008===e.minFilter&&(e.minFilter=1006);return new kh(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,r){const i=t.getRenderTarget();for(let i=0;i<6;i++)t.setRenderTarget(this,i),t.clear(e,n,r);t.setRenderTarget(i)}}function Wh(t,e,n,r,i,o,a,s,c,l,u,h){pl.call(this,null,o,a,s,c,l,r,i,u,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==l?l:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Wh.prototype=Object.create(pl.prototype),Wh.prototype.constructor=Wh,Wh.prototype.isDataTexture=!0;const Vh=new Ul,qh=new bl;class Yh{constructor(t,e,n,r,i,o){this.planes=[void 0!==t?t:new wu,void 0!==e?e:new wu,void 0!==n?n:new wu,void 0!==r?r:new wu,void 0!==i?i:new wu,void 0!==o?o:new wu]}set(t,e,n,r,i,o){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this}clone(){return(new this.constructor).copy(this)}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],f=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-r,u-s,p-h,y-m).normalize(),e[1].setComponents(a+r,u+s,p+h,y+m).normalize(),e[2].setComponents(a+i,u+c,p+d,y+g).normalize(),e[3].setComponents(a-i,u-c,p-d,y-g).normalize(),e[4].setComponents(a-o,u-l,p-f,y-v).normalize(),e[5].setComponents(a+o,u+l,p+f,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Vh.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Vh)}intersectsSprite(t){return Vh.center.set(0,0,0),Vh.radius=.7071067811865476,Vh.applyMatrix4(t.matrixWorld),this.intersectsSphere(Vh)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<r)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const r=e[n];if(qh.x=r.normal.x>0?t.max.x:t.min.x,qh.y=r.normal.y>0?t.max.y:t.min.y,qh.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(qh)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}}function Xh(){let t=null,e=!1,n=null,r=null;function i(e,o){n(e,o),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Zh(t,e){const n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const o=r.get(e);void 0===o?r.set(e,function(e,r){const i=e.array,o=e.usage,a=t.createBuffer();t.bindBuffer(r,a),t.bufferData(r,i,o),e.onUploadCallback();let s=5126;return i instanceof Float32Array?s=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?e.isFloat16BufferAttribute?n?s=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):s=5123:i instanceof Int16Array?s=5122:i instanceof Uint32Array?s=5125:i instanceof Int32Array?s=5124:i instanceof Int8Array?s=5120:i instanceof Uint8Array&&(s=5121),{buffer:a,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,i)):o.version<e.version&&(!function(e,r,i){const o=r.array,a=r.updateRange;t.bindBuffer(i,e),-1===a.count?t.bufferSubData(i,0,o):(n?t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(o.buffer,e,i),o.version=e.version)}}}class Jh extends ph{constructor(t=1,e=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};const i=t/2,o=e/2,a=Math.floor(n),s=Math.floor(r),c=a+1,l=s+1,u=t/a,h=e/s,d=[],f=[],p=[],m=[];for(let t=0;t<l;t++){const e=t*h-o;for(let n=0;n<c;n++){const r=n*u-i;f.push(r,-e,0),p.push(0,0,1),m.push(n/a),m.push(1-t/s)}}for(let t=0;t<s;t++)for(let e=0;e<a;e++){const n=e+c*t,r=e+c*(t+1),i=e+1+c*(t+1),o=e+1+c*t;d.push(n,r,o),d.push(r,i,o)}this.setIndex(d),this.setAttribute("position",new nh(f,3)),this.setAttribute("normal",new nh(p,3)),this.setAttribute("uv",new nh(m,2))}}const Qh={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn 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 );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid 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) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <transmissionmap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},$h={common:{diffuse:{value:new Hu(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ul},uv2Transform:{value:new ul},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new ll(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Hu(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:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{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 Hu(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ul}},sprite:{diffuse:{value:new Hu(15658734)},opacity:{value:1},center:{value:new ll(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ul}}},Kh={basic:{uniforms:Oh([$h.common,$h.specularmap,$h.envmap,$h.aomap,$h.lightmap,$h.fog]),vertexShader:Qh.meshbasic_vert,fragmentShader:Qh.meshbasic_frag},lambert:{uniforms:Oh([$h.common,$h.specularmap,$h.envmap,$h.aomap,$h.lightmap,$h.emissivemap,$h.fog,$h.lights,{emissive:{value:new Hu(0)}}]),vertexShader:Qh.meshlambert_vert,fragmentShader:Qh.meshlambert_frag},phong:{uniforms:Oh([$h.common,$h.specularmap,$h.envmap,$h.aomap,$h.lightmap,$h.emissivemap,$h.bumpmap,$h.normalmap,$h.displacementmap,$h.fog,$h.lights,{emissive:{value:new Hu(0)},specular:{value:new Hu(1118481)},shininess:{value:30}}]),vertexShader:Qh.meshphong_vert,fragmentShader:Qh.meshphong_frag},standard:{uniforms:Oh([$h.common,$h.envmap,$h.aomap,$h.lightmap,$h.emissivemap,$h.bumpmap,$h.normalmap,$h.displacementmap,$h.roughnessmap,$h.metalnessmap,$h.fog,$h.lights,{emissive:{value:new Hu(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qh.meshphysical_vert,fragmentShader:Qh.meshphysical_frag},toon:{uniforms:Oh([$h.common,$h.aomap,$h.lightmap,$h.emissivemap,$h.bumpmap,$h.normalmap,$h.displacementmap,$h.gradientmap,$h.fog,$h.lights,{emissive:{value:new Hu(0)}}]),vertexShader:Qh.meshtoon_vert,fragmentShader:Qh.meshtoon_frag},matcap:{uniforms:Oh([$h.common,$h.bumpmap,$h.normalmap,$h.displacementmap,$h.fog,{matcap:{value:null}}]),vertexShader:Qh.meshmatcap_vert,fragmentShader:Qh.meshmatcap_frag},points:{uniforms:Oh([$h.points,$h.fog]),vertexShader:Qh.points_vert,fragmentShader:Qh.points_frag},dashed:{uniforms:Oh([$h.common,$h.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qh.linedashed_vert,fragmentShader:Qh.linedashed_frag},depth:{uniforms:Oh([$h.common,$h.displacementmap]),vertexShader:Qh.depth_vert,fragmentShader:Qh.depth_frag},normal:{uniforms:Oh([$h.common,$h.bumpmap,$h.normalmap,$h.displacementmap,{opacity:{value:1}}]),vertexShader:Qh.normal_vert,fragmentShader:Qh.normal_frag},sprite:{uniforms:Oh([$h.sprite,$h.fog]),vertexShader:Qh.sprite_vert,fragmentShader:Qh.sprite_frag},background:{uniforms:{uvTransform:{value:new ul},t2D:{value:null}},vertexShader:Qh.background_vert,fragmentShader:Qh.background_frag},cube:{uniforms:Oh([$h.envmap,{opacity:{value:1}}]),vertexShader:Qh.cube_vert,fragmentShader:Qh.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qh.equirect_vert,fragmentShader:Qh.equirect_frag},distanceRGBA:{uniforms:Oh([$h.common,$h.displacementmap,{referencePosition:{value:new bl},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qh.distanceRGBA_vert,fragmentShader:Qh.distanceRGBA_frag},shadow:{uniforms:Oh([$h.lights,$h.fog,{color:{value:new Hu(0)},opacity:{value:1}}]),vertexShader:Qh.shadow_vert,fragmentShader:Qh.shadow_frag}};function td(t,e,n,r,i){const o=new Hu(0);let a,s,c=0,l=null,u=0,h=null;function d(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),c=e,d(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,d(o,c)},render:function(n,i,f,p){let m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=e.get(m));const g=t.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?d(o,c):m&&m.isColor&&(d(m,1),p=!0),(t.autoClear||p)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||306===m.mapping)?(void 0===s&&(s=new Nh(new Dh(1,1,1),new Uh({name:"BackgroundCubeMaterial",uniforms:Ih(Kh.cube.uniforms),vertexShader:Kh.cube.vertexShader,fragmentShader:Kh.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(s)),m.isWebGLCubeRenderTarget&&(m=m.texture),s.material.uniforms.envMap.value=m,s.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,l===m&&u===m.version&&h===t.toneMapping||(s.material.needsUpdate=!0,l=m,u=m.version,h=t.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null)):m&&m.isTexture&&(void 0===a&&(a=new Nh(new Jh(2,2),new Uh({name:"BackgroundMaterial",uniforms:Ih(Kh.background.uniforms),vertexShader:Kh.background.vertexShader,fragmentShader:Kh.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(a)),a.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),a.material.uniforms.uvTransform.value.copy(m.matrix),l===m&&u===m.version&&h===t.toneMapping||(a.material.needsUpdate=!0,l=m,u=m.version,h=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function ed(t,e,n,r){const i=t.getParameter(34921),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},c=d(null);let l=c;function u(e){return r.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function d(t){const e=[],n=[],r=[];for(let t=0;t<i;t++)e[t]=0,n[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:r,object:t,attributes:{},index:null}}function f(){const t=l.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function p(t){m(t,0)}function m(n,i){const o=l.newAttributes,a=l.enabledAttributes,s=l.attributeDivisors;if(o[n]=1,0===a[n]&&(t.enableVertexAttribArray(n),a[n]=1),s[n]!==i){(r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i}}function g(){const e=l.newAttributes,n=l.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0)}function v(e,n,i,o,a,s){!0!==r.isWebGL2||5124!==i&&5125!==i?t.vertexAttribPointer(e,n,i,o,a,s):t.vertexAttribIPointer(e,n,i,a,s)}function y(){b(),l!==c&&(l=c,u(l.object))}function b(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:function(i,c,h,y,b){let x=!1;if(a){const e=function(e,n,i){const a=!0===i.wireframe;let c=s[e.id];void 0===c&&(c={},s[e.id]=c);let l=c[n.id];void 0===l&&(l={},c[n.id]=l);let u=l[a];void 0===u&&(u=d(r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),l[a]=u);return u}(y,h,c);l!==e&&(l=e,u(l.object)),x=function(t,e){const n=l.attributes,r=t.attributes;let i=0;for(const t in r){const e=n[t],o=r[t];if(void 0===e)return!0;if(e.attribute!==o)return!0;if(e.data!==o.data)return!0;i++}return l.attributesNum!==i||l.index!==e}(y,b),x&&function(t,e){const n={},r=t.attributes;let i=0;for(const t in r){const e=r[t],o={};o.attribute=e,e.data&&(o.data=e.data),n[t]=o,i++}l.attributes=n,l.attributesNum=i,l.index=e}(y,b)}else{const t=!0===c.wireframe;l.geometry===y.id&&l.program===h.id&&l.wireframe===t||(l.geometry=y.id,l.program=h.id,l.wireframe=t,x=!0)}!0===i.isInstancedMesh&&(x=!0),null!==b&&n.update(b,34963),x&&(!function(i,o,a,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const c=s.attributes,l=a.getAttributes(),u=o.defaultAttributeValues;for(const e in l){const r=l[e];if(r>=0){const o=c[e];if(void 0!==o){const e=o.normalized,i=o.itemSize,a=n.get(o);if(void 0===a)continue;const c=a.buffer,l=a.type,u=a.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,a=n.stride,h=o.offset;n&&n.isInstancedInterleavedBuffer?(m(r,n.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)):p(r),t.bindBuffer(34962,c),v(r,i,l,e,a*u,h*u)}else o.isInstancedBufferAttribute?(m(r,o.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)):p(r),t.bindBuffer(34962,c),v(r,i,l,e,0,0)}else if("instanceMatrix"===e){const e=n.get(i.instanceMatrix);if(void 0===e)continue;const o=e.buffer,a=e.type;m(r+0,1),m(r+1,1),m(r+2,1),m(r+3,1),t.bindBuffer(34962,o),t.vertexAttribPointer(r+0,4,a,!1,64,0),t.vertexAttribPointer(r+1,4,a,!1,64,16),t.vertexAttribPointer(r+2,4,a,!1,64,32),t.vertexAttribPointer(r+3,4,a,!1,64,48)}else if("instanceColor"===e){const e=n.get(i.instanceColor);if(void 0===e)continue;const o=e.buffer,a=e.type;m(r,1),t.bindBuffer(34962,o),t.vertexAttribPointer(r,3,a,!1,12,0)}else if(void 0!==u){const n=u[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(r,n);break;case 3:t.vertexAttrib3fv(r,n);break;case 4:t.vertexAttrib4fv(r,n);break;default:t.vertexAttrib1fv(r,n)}}}}g()}(i,c,h,y),null!==b&&t.bindBuffer(34963,n.get(b).buffer))},reset:y,resetDefaultState:b,dispose:function(){y();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0===s[t.id])return;const e=s[t.id];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t.id]},releaseStatesOfProgram:function(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)h(r[t].object),delete r[t];delete n[t.id]}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:g}}function nd(t,e,n,r){const i=r.isWebGL2;let o;this.setMode=function(t){o=t},this.render=function(e,r){t.drawArrays(o,e,r),n.update(r,o,1)},this.renderInstances=function(r,a,s){if(0===s)return;let c,l;if(i)c=t,l="drawArraysInstanced";else if(c=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===c)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[l](o,r,a,s),n.update(a,o,s)}}function rd(t,e,n){let r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);const c=!0===n.logarithmicDepthBuffer,l=t.getParameter(34930),u=t.getParameter(35660),h=t.getParameter(3379),d=t.getParameter(34076),f=t.getParameter(34921),p=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=u>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;const n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?t.getParameter(36183):0}}function id(t){const e=this;let n=null,r=0,i=!1,o=!1;const a=new wu,s=new ul,c={value:null,needsUpdate:!1};function l(){c.value!==n&&(c.value=n,c.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function u(t,n,r,i){const o=null!==t?t.length:0;let l=null;if(0!==o){if(l=c.value,!0!==i||null===l){const e=r+4*o,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===l||l.length<e)&&(l=new Float32Array(e));for(let e=0,n=r;e!==o;++e,n+=4)a.copy(t[e]).applyMatrix4(i,s),a.normal.toArray(l,n),l[n+3]=a.constant}c.value=l,c.needsUpdate=!0}return e.numPlanes=o,e.numIntersection=0,l}this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,o){const a=0!==t.length||e||0!==r||i;return i=e,n=u(t,o,0),r=t.length,a},this.beginShadows=function(){o=!0,u(null)},this.endShadows=function(){o=!1,l()},this.setState=function(e,a,s){const h=e.clippingPlanes,d=e.clipIntersection,f=e.clipShadows,p=t.get(e);if(!i||null===h||0===h.length||o&&!f)o?u(null):l();else{const t=o?0:r,e=4*t;let i=p.clippingState||null;c.value=i,i=u(h,a,e,s);for(let t=0;t!==e;++t)i[t]=n[t];p.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function od(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=301:304===e&&(t.mapping=302),t}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping;if(303===o||304===o){if(e.has(i)){return n(e.get(i).texture,i.mapping)}{const o=i.image;if(o&&o.height>0){const a=t.getRenderList(),s=t.getRenderTarget(),c=new jh(o.height/2);return c.fromEquirectangularTexture(t,i),e.set(i,c),t.setRenderTarget(s),t.setRenderList(a),i.addEventListener("dispose",r),n(c.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}function ad(t){const e={};function n(n){if(void 0!==e[n])return e[n];let r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,r}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function sd(t,e,n,r){const i={},o=new WeakMap;function a(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const t in s.attributes)e.remove(s.attributes[t]);s.removeEventListener("dispose",a),delete i[s.id];const c=o.get(s);c&&(e.remove(c),o.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){const n=[],r=t.index,i=t.attributes.position;let a=0;if(null!==r){const t=r.array;a=r.version;for(let e=0,r=t.length;e<r;e+=3){const r=t[e+0],i=t[e+1],o=t[e+2];n.push(r,i,i,o,o,r)}}else{const t=i.array;a=i.version;for(let e=0,r=t.length/3-1;e<r;e+=3){const t=e+0,r=e+1,i=e+2;n.push(t,r,r,i,i,t)}}const s=new(ih(n)>65535?th:$u)(n,1);s.version=a;const c=o.get(t);c&&e.remove(c),o.set(t,s)}return{get:function(t,e){return!0===i[e.id]||(e.addEventListener("dispose",a),i[e.id]=!0,n.memory.geometries++),e},update:function(t){const n=t.attributes;for(const t in n)e.update(n[t],34962);const r=t.morphAttributes;for(const t in r){const n=r[t];for(let t=0,r=n.length;t<r;t++)e.update(n[t],34962)}},getWireframeAttribute:function(t){const e=o.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&s(t)}else s(t);return o.get(t)}}}function cd(t,e,n,r){const i=r.isWebGL2;let o,a,s;this.setMode=function(t){o=t},this.setIndex=function(t){a=t.type,s=t.bytesPerElement},this.render=function(e,r){t.drawElements(o,r,a,e*s),n.update(r,o,1)},this.renderInstances=function(r,c,l){if(0===l)return;let u,h;if(i)u=t,h="drawElementsInstanced";else if(u=e.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[h](o,c,a,r*s,l),n.update(c,o,l)}}function ld(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,r){switch(e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function ud(t,e){return t[0]-e[0]}function hd(t,e){return Math.abs(e[1])-Math.abs(t[1])}function dd(t){const e={},n=new Float32Array(8),r=[];for(let t=0;t<8;t++)r[t]=[t,0];return{update:function(i,o,a,s){const c=i.morphTargetInfluences,l=void 0===c?0:c.length;let u=e[o.id];if(void 0===u){u=[];for(let t=0;t<l;t++)u[t]=[t,0];e[o.id]=u}for(let t=0;t<l;t++){const e=u[t];e[0]=t,e[1]=c[t]}u.sort(hd);for(let t=0;t<8;t++)t<l&&u[t][1]?(r[t][0]=u[t][0],r[t][1]=u[t][1]):(r[t][0]=Number.MAX_SAFE_INTEGER,r[t][1]=0);r.sort(ud);const h=a.morphTargets&&o.morphAttributes.position,d=a.morphNormals&&o.morphAttributes.normal;let f=0;for(let t=0;t<8;t++){const e=r[t],i=e[0],a=e[1];i!==Number.MAX_SAFE_INTEGER&&a?(h&&o.getAttribute("morphTarget"+t)!==h[i]&&o.setAttribute("morphTarget"+t,h[i]),d&&o.getAttribute("morphNormal"+t)!==d[i]&&o.setAttribute("morphNormal"+t,d[i]),n[t]=a,f+=a):(h&&!0===o.hasAttribute("morphTarget"+t)&&o.deleteAttribute("morphTarget"+t),d&&!0===o.hasAttribute("morphNormal"+t)&&o.deleteAttribute("morphNormal"+t),n[t]=0)}const p=o.morphTargetsRelative?1:1-f;s.getUniforms().setValue(t,"morphTargetBaseInfluence",p),s.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function fd(t,e,n,r){let i=new WeakMap;function o(t){const e=t.target;e.removeEventListener("dispose",o),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(t){const a=r.render.frame,s=t.geometry,c=e.get(t,s);return i.get(c)!==a&&(e.update(c),i.set(c,a)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",o)&&t.addEventListener("dispose",o),n.update(t.instanceMatrix,34962),null!==t.instanceColor&&n.update(t.instanceColor,34962)),c},dispose:function(){i=new WeakMap}}}function pd(t=null,e=1,n=1,r=1){pl.call(this,null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function md(t=null,e=1,n=1,r=1){pl.call(this,null),this.image={data:t,width:e,height:n,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Kh.physical={uniforms:Oh([Kh.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new ll(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Hu(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:Qh.meshphysical_vert,fragmentShader:Qh.meshphysical_frag},pd.prototype=Object.create(pl.prototype),pd.prototype.constructor=pd,pd.prototype.isDataTexture2DArray=!0,md.prototype=Object.create(pl.prototype),md.prototype.constructor=md,md.prototype.isDataTexture3D=!0;const gd=new pl,vd=new pd,yd=new md,bd=new Gh,xd=[],_d=[],wd=new Float32Array(16),Md=new Float32Array(9),Sd=new Float32Array(4);function Td(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let o=xd[i];if(void 0===o&&(o=new Float32Array(i),xd[i]=o),0!==e){r.toArray(o,0);for(let r=1,i=0;r!==e;++r)i+=n,t[r].toArray(o,i)}return o}function Ed(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Ad(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function Ld(t,e){let n=_d[e];void 0===n&&(n=new Int32Array(e),_d[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Cd(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Rd(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Ed(n,e))return;t.uniform2fv(this.addr,e),Ad(n,e)}}function Pd(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Ed(n,e))return;t.uniform3fv(this.addr,e),Ad(n,e)}}function Nd(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Ed(n,e))return;t.uniform4fv(this.addr,e),Ad(n,e)}}function zd(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Ed(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ad(n,e)}else{if(Ed(n,r))return;Sd.set(r),t.uniformMatrix2fv(this.addr,!1,Sd),Ad(n,r)}}function Dd(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Ed(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ad(n,e)}else{if(Ed(n,r))return;Md.set(r),t.uniformMatrix3fv(this.addr,!1,Md),Ad(n,r)}}function Id(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Ed(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ad(n,e)}else{if(Ed(n,r))return;wd.set(r),t.uniformMatrix4fv(this.addr,!1,wd),Ad(n,r)}}function Od(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||gd,i)}function Fd(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||vd,i)}function Ud(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||yd,i)}function Bd(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(e||bd,i)}function Hd(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function kd(t,e){const n=this.cache;Ed(n,e)||(t.uniform2iv(this.addr,e),Ad(n,e))}function Gd(t,e){const n=this.cache;Ed(n,e)||(t.uniform3iv(this.addr,e),Ad(n,e))}function jd(t,e){const n=this.cache;Ed(n,e)||(t.uniform4iv(this.addr,e),Ad(n,e))}function Wd(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Vd(t,e){t.uniform1fv(this.addr,e)}function qd(t,e){t.uniform1iv(this.addr,e)}function Yd(t,e){t.uniform2iv(this.addr,e)}function Xd(t,e){t.uniform3iv(this.addr,e)}function Zd(t,e){t.uniform4iv(this.addr,e)}function Jd(t,e){const n=Td(e,this.size,2);t.uniform2fv(this.addr,n)}function Qd(t,e){const n=Td(e,this.size,3);t.uniform3fv(this.addr,n)}function $d(t,e){const n=Td(e,this.size,4);t.uniform4fv(this.addr,n)}function Kd(t,e){const n=Td(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function tf(t,e){const n=Td(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ef(t,e){const n=Td(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function nf(t,e,n){const r=e.length,i=Ld(n,r);t.uniform1iv(this.addr,i);for(let t=0;t!==r;++t)n.safeSetTexture2D(e[t]||gd,i[t])}function rf(t,e,n){const r=e.length,i=Ld(n,r);t.uniform1iv(this.addr,i);for(let t=0;t!==r;++t)n.safeSetTextureCube(e[t]||bd,i[t])}function of(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Cd;case 35664:return Rd;case 35665:return Pd;case 35666:return Nd;case 35674:return zd;case 35675:return Dd;case 35676:return Id;case 5124:case 35670:return Hd;case 35667:case 35671:return kd;case 35668:case 35672:return Gd;case 35669:case 35673:return jd;case 5125:return Wd;case 35678:case 36198:case 36298:case 36306:case 35682:return Od;case 35679:case 36299:case 36307:return Ud;case 35680:case 36300:case 36308:case 36293:return Bd;case 36289:case 36303:case 36311:case 36292:return Fd}}(e.type)}function af(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Vd;case 35664:return Jd;case 35665:return Qd;case 35666:return $d;case 35674:return Kd;case 35675:return tf;case 35676:return ef;case 5124:case 35670:return qd;case 35667:case 35671:return Yd;case 35668:case 35672:return Xd;case 35669:case 35673:return Zd;case 35678:case 36198:case 36298:case 36306:case 35682:return nf;case 35680:case 36300:case 36308:case 36293:return rf}}(e.type)}function sf(t){this.id=t,this.seq=[],this.map={}}af.prototype.updateCache=function(t){const e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Ad(e,t)},sf.prototype.setValue=function(t,e,n){const r=this.seq;for(let i=0,o=r.length;i!==o;++i){const o=r[i];o.setValue(t,e[o.id],n)}};const cf=/(\w+)(\])?(\[|\.)?/g;function lf(t,e){t.seq.push(e),t.map[e.id]=e}function uf(t,e,n){const r=t.name,i=r.length;for(cf.lastIndex=0;;){const o=cf.exec(r),a=cf.lastIndex;let s=o[1];const c="]"===o[2],l=o[3];if(c&&(s|=0),void 0===l||"["===l&&a+2===i){lf(n,void 0===l?new of(s,t,e):new af(s,t,e));break}{let t=n.map[s];void 0===t&&(t=new sf(s),lf(n,t)),n=t}}}function hf(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,35718);for(let r=0;r<n;++r){const n=t.getActiveUniform(e,r);uf(n,t.getUniformLocation(e,n.name),this)}}function df(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}hf.prototype.setValue=function(t,e,n,r){const i=this.map[e];void 0!==i&&i.setValue(t,n,r)},hf.prototype.setOptional=function(t,e,n){const r=e[n];void 0!==r&&this.setValue(t,n,r)},hf.upload=function(t,e,n,r){for(let i=0,o=e.length;i!==o;++i){const o=e[i],a=n[o.id];!1!==a.needsUpdate&&o.setValue(t,a.value,r)}},hf.seqWithValue=function(t,e){const n=[];for(let r=0,i=t.length;r!==i;++r){const i=t[r];i.id in e&&n.push(i)}return n};let ff=0;function pf(t){switch(t){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function mf(t,e,n){const r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();if(r&&""===i)return"";return"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(t){const e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}(t.getShaderSource(e))}function gf(t,e){const n=pf(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function vf(t,e){const n=pf(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function yf(t,e){let n;switch(e){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function bf(t){return""!==t}function xf(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function _f(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const wf=/^[ \t]*#include +<([\w\d./]+)>/gm;function Mf(t){return t.replace(wf,Sf)}function Sf(t,e){const n=Qh[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Mf(n)}const Tf=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ef=/#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 Af(t){return t.replace(Ef,Cf).replace(Tf,Lf)}function Lf(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Cf(t,e,n,r)}function Cf(t,e,n,r){let i="";for(let t=parseInt(e);t<parseInt(n);t++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return i}function Rf(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Pf(t,e,n,r){const i=t.getContext(),o=n.defines;let a=n.vertexShader,s=n.fragmentShader;const c=function(t){let e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:case 307:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),u=function(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 307:e="ENVMAP_MODE_REFRACTION"}return e}(n),h=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),d=t.gammaFactor>0?t.gammaFactor:1,f=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(bf).join("\n")}(n),p=function(t){const e=[];for(const n in t){const r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(o),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[p].filter(bf).join("\n"),g.length>0&&(g+="\n"),v=[f,p].filter(bf).join("\n"),v.length>0&&(v+="\n")):(g=[Rf(n),"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.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","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(bf).join("\n"),v=[f,Rf(n),"#define SHADER_NAME "+n.shaderName,p,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Qh.tonemapping_pars_fragment:"",0!==n.toneMapping?yf("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Qh.encodings_pars_fragment,n.map?gf("mapTexelToLinear",n.mapEncoding):"",n.matcap?gf("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?gf("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?gf("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?gf("lightMapTexelToLinear",n.lightMapEncoding):"",vf("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(bf).join("\n")),a=Mf(a),a=xf(a,n),a=_f(a,n),s=Mf(s),s=xf(s,n),s=_f(s,n),a=Af(a),s=Af(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#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("\n")+"\n"+v);const b=y+v+s,x=df(i,35633,y+g+a),_=df(i,35632,b);if(i.attachShader(m,x),i.attachShader(m,_),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),t.debug.checkShaderErrors){const t=i.getProgramInfoLog(m).trim(),e=i.getShaderInfoLog(x).trim(),n=i.getShaderInfoLog(_).trim();let r=!0,o=!0;if(!1===i.getProgramParameter(m,35714)){r=!1;const e=mf(i,x,"vertex"),n=mf(i,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",t,e,n)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==n||(o=!1);o&&(this.diagnostics={runnable:r,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:n,prefix:v}})}let w,M;return i.deleteShader(x),i.deleteShader(_),this.getUniforms=function(){return void 0===w&&(w=new hf(i,m)),w},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const n={},r=t.getProgramParameter(e,35721);for(let i=0;i<r;i++){const r=t.getActiveAttrib(e,i).name;n[r]=t.getAttribLocation(e,r)}return n}(i,m)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=ff++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=x,this.fragmentShader=_,this}function Nf(t,e,n,r,i,o){const a=[],s=r.isWebGL2,c=r.logarithmicDepthBuffer,l=r.floatVertexTextures,u=r.maxVertexUniforms,h=r.vertexTextures;let d=r.precision;const f={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"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];function m(t){let e;return t&&t.isTexture?e=t.encoding:t&&t.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=3e3,e}return{getParameters:function(i,a,p,g,v){const y=g.fog,b=i.isMeshStandardMaterial?g.environment:null,x=e.get(i.envMap||b),_=f[i.type],w=v.isSkinnedMesh?function(t){const e=t.skeleton.bones;if(l)return 1024;{const t=u,n=Math.floor((t-20)/4),r=Math.min(n,e.length);return r<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+r+"."),0):r}}(v):0;let M,S;if(null!==i.precision&&(d=r.getMaxPrecision(i.precision),d!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",d,"instead.")),_){const t=Kh[_];M=t.vertexShader,S=t.fragmentShader}else M=i.vertexShader,S=i.fragmentShader;const T=t.getRenderTarget();return{isWebGL2:s,shaderID:_,shaderName:i.type,vertexShader:M,fragmentShader:S,defines:i.defines,isRawShaderMaterial:!0===i.isRawShaderMaterial,glslVersion:i.glslVersion,precision:d,instancing:!0===v.isInstancedMesh,instancingColor:!0===v.isInstancedMesh&&null!==v.instanceColor,supportsVertexTextures:h,outputEncoding:null!==T?m(T.texture):t.outputEncoding,map:!!i.map,mapEncoding:m(i.map),matcap:!!i.matcap,matcapEncoding:m(i.matcap),envMap:!!x,envMapMode:x&&x.mapping,envMapEncoding:m(x),envMapCubeUV:!!x&&(306===x.mapping||307===x.mapping),lightMap:!!i.lightMap,lightMapEncoding:m(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:m(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:1===i.normalMapType,tangentSpaceNormalMap:0===i.normalMapType,clearcoatMap:!!i.clearcoatMap,clearcoatRoughnessMap:!!i.clearcoatRoughnessMap,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,transmissionMap:!!i.transmissionMap,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexUvs:!!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatMap||i.clearcoatRoughnessMap||i.clearcoatNormalMap||i.displacementMap||i.transmissionMap),uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||i.transmissionMap||!i.displacementMap),fog:!!y,useFog:i.fog,fogExp2:y&&y.isFogExp2,flatShading:i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:c,skinning:i.skinning&&w>0,maxBones:w,useVertexTexture:l,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:i.dithering,shadowMapEnabled:t.shadowMap.enabled&&p.length>0,shadowMapType:t.shadowMap.type,toneMapping:i.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t<p.length;t++)n.push(e[p[t]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=f[t.type];let n;if(e){const t=Kh[e];n=Fh.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let r;for(let t=0,e=a.length;t<e;t++){const e=a[t];if(e.cacheKey===n){r=e,++r.usedTimes;break}}return void 0===r&&(r=new Pf(t,n,e,i),a.push(r)),r},releaseProgram:function(t){if(0==--t.usedTimes){const e=a.indexOf(t);a[e]=a[a.length-1],a.pop(),t.destroy()}},programs:a}}function zf(){let t=new WeakMap;return{get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}}function Df(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function If(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Of(t){const e=[];let n=0;const r=[],i=[],o={id:-1};function a(r,i,a,s,c,l){let u=e[n];const h=t.get(a);return void 0===u?(u={id:r.id,object:r,geometry:i,material:a,program:h.program||o,groupOrder:s,renderOrder:r.renderOrder,z:c,group:l},e[n]=u):(u.id=r.id,u.object=r,u.geometry=i,u.material=a,u.program=h.program||o,u.groupOrder=s,u.renderOrder=r.renderOrder,u.z=c,u.group=l),n++,u}return{opaque:r,transparent:i,init:function(){n=0,r.length=0,i.length=0},push:function(t,e,n,o,s,c){const l=a(t,e,n,o,s,c);(!0===n.transparent?i:r).push(l)},unshift:function(t,e,n,o,s,c){const l=a(t,e,n,o,s,c);(!0===n.transparent?i:r).unshift(l)},finish:function(){for(let t=n,r=e.length;t<r;t++){const n=e[t];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}},sort:function(t,e){r.length>1&&r.sort(t||Df),i.length>1&&i.sort(e||If)}}}function Ff(t){let e=new WeakMap;return{get:function(n,r){const i=e.get(n);let o;return void 0===i?(o=new Of(t),e.set(n,new WeakMap),e.get(n).set(r,o)):(o=i.get(r),void 0===o&&(o=new Of(t),i.set(r,o))),o},dispose:function(){e=new WeakMap}}}function Uf(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new bl,color:new Hu};break;case"SpotLight":n={position:new bl,direction:new bl,color:new Hu,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new bl,color:new Hu,distance:0,decay:0};break;case"HemisphereLight":n={direction:new bl,skyColor:new Hu,groundColor:new Hu};break;case"RectAreaLight":n={color:new Hu,position:new bl,halfWidth:new bl,halfHeight:new bl}}return t[e.id]=n,n}}}let Bf=0;function Hf(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function kf(t,e){const n=new Uf,r=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ll};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ll,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)i.probe.push(new bl);const o=new bl,a=new Yl,s=new Yl;return{setup:function(o){let a=0,s=0,c=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let l=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0;o.sort(Hf);for(let t=0,e=o.length;t<e;t++){const e=o[t],v=e.color,y=e.intensity,b=e.distance,x=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)a+=v.r*y,s+=v.g*y,c+=v.b*y;else if(e.isLightProbe)for(let t=0;t<9;t++)i.probe[t].addScaledVector(e.sh.coefficients[t],y);else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity),e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.directionalShadow[l]=n,i.directionalShadowMap[l]=x,i.directionalShadowMatrix[l]=e.shadow.matrix,p++}i.directional[l]=t,l++}else if(e.isSpotLight){const t=n.get(e);if(t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(v).multiplyScalar(y),t.distance=b,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.spotShadow[h]=n,i.spotShadowMap[h]=x,i.spotShadowMatrix[h]=e.shadow.matrix,g++}i.spot[h]=t,h++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(v).multiplyScalar(y),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),i.rectArea[d]=t,d++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=x,i.pointShadowMatrix[u]=e.shadow.matrix,m++}i.point[u]=t,u++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(y),t.groundColor.copy(e.groundColor).multiplyScalar(y),i.hemi[f]=t,f++}}d>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=$h.LTC_FLOAT_1,i.rectAreaLTC2=$h.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=$h.LTC_HALF_1,i.rectAreaLTC2=$h.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=s,i.ambient[2]=c;const v=i.hash;v.directionalLength===l&&v.pointLength===u&&v.spotLength===h&&v.rectAreaLength===d&&v.hemiLength===f&&v.numDirectionalShadows===p&&v.numPointShadows===m&&v.numSpotShadows===g||(i.directional.length=l,i.spot.length=h,i.rectArea.length=d,i.point.length=u,i.hemi.length=f,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,v.directionalLength=l,v.pointLength=u,v.spotLength=h,v.rectAreaLength=d,v.hemiLength=f,v.numDirectionalShadows=p,v.numPointShadows=m,v.numSpotShadows=g,i.version=Bf++)},setupView:function(t,e){let n=0,r=0,c=0,l=0,u=0;const h=e.matrixWorldInverse;for(let e=0,d=t.length;e<d;e++){const d=t[e];if(d.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(h),n++}else if(d.isSpotLight){const t=i.spot[c];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),t.direction.setFromMatrixPosition(d.matrixWorld),o.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(o),t.direction.transformDirection(h),c++}else if(d.isRectAreaLight){const t=i.rectArea[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),s.identity(),a.copy(d.matrixWorld),a.premultiply(h),s.extractRotation(a),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),l++}else if(d.isPointLight){const t=i.point[r];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(h),r++}else if(d.isHemisphereLight){const t=i.hemi[u];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(h),t.direction.normalize(),u++}}},state:i}}function Gf(t,e){const n=new kf(t,e),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(){n.setup(r)},setupLightsView:function(t){n.setupView(r,t)},pushLight:function(t){r.push(t)},pushShadow:function(t){i.push(t)}}}function jf(t,e){let n=new WeakMap;return{get:function(r,i=0){let o;return!1===n.has(r)?(o=new Gf(t,e),n.set(r,[]),n.get(r).push(o)):i>=n.get(r).length?(o=new Gf(t,e),n.get(r).push(o)):o=n.get(r)[i],o},dispose:function(){n=new WeakMap}}}function Wf(t){ju.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Vf(t){ju.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new bl,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Wf.prototype=Object.create(ju.prototype),Wf.prototype.constructor=Wf,Wf.prototype.isMeshDepthMaterial=!0,Wf.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,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},Vf.prototype=Object.create(ju.prototype),Vf.prototype.constructor=Vf,Vf.prototype.isMeshDistanceMaterial=!0,Vf.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};function qf(t,e,n){let r=new Yh;const i=new ll,o=new ll,a=new gl,s=[],c=[],l={},u={0:1,1:0,2:2},h=new Uh({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new ll},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const f=new ph;f.setAttribute("position",new Yu(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const p=new Nh(f,h),m=this;function g(n,r){const i=e.update(p);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,h,p,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,d,p,null)}function v(t,e,n){const r=t<<0|e<<1|n<<2;let i=s[r];return void 0===i&&(i=new Wf({depthPacking:3201,morphTargets:t,skinning:e}),s[r]=i),i}function y(t,e,n){const r=t<<0|e<<1|n<<2;let i=c[r];return void 0===i&&(i=new Vf({morphTargets:t,skinning:e}),c[r]=i),i}function b(e,n,r,i,o,a,s){let c=null,h=v,d=e.customDepthMaterial;if(!0===i.isPointLight&&(h=y,d=e.customDistanceMaterial),void 0===d){let t=!1;!0===r.morphTargets&&(t=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let i=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?i=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));c=h(t,i,!0===e.isInstancedMesh)}else c=d;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){const t=c.uuid,e=r.uuid;let n=l[t];void 0===n&&(n={},l[t]=n);let i=n[e];void 0===i&&(i=c.clone(),n[e]=i),c=i}return c.visible=r.visible,c.wireframe=r.wireframe,c.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:u[r.side],c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=o,c.farDistance=a),c}function x(n,i,o,a,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const r=e.update(n),i=n.material;if(Array.isArray(i)){const e=r.groups;for(let c=0,l=e.length;c<l;c++){const l=e[c],u=i[l.materialIndex];if(u&&u.visible){const e=b(n,r,u,a,o.near,o.far,s);t.renderBufferDirect(o,null,r,e,n,l)}}}else if(i.visible){const e=b(n,r,i,a,o.near,o.far,s);t.renderBufferDirect(o,null,r,e,n,null)}}const c=n.children;for(let t=0,e=c.length;t<e;t++)x(c[t],i,o,a,s)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,s,c){if(!1===m.enabled)return;if(!1===m.autoUpdate&&!1===m.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),u=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),d=t.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,u=e.length;l<u;l++){const u=e[l],h=u.shadow;if(void 0===h){console.warn("THREE.WebGLShadowMap:",u,"has no shadow.");continue}if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;i.copy(h.mapSize);const f=h.getFrameExtents();if(i.multiply(f),o.copy(h.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/f.x),i.x=o.x*f.x,h.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/f.y),i.y=o.y*f.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&3===this.type){const t={minFilter:1006,magFilter:1006,format:1023};h.map=new vl(i.x,i.y,t),h.map.texture.name=u.name+".shadowMap",h.mapPass=new vl(i.x,i.y,t),h.camera.updateProjectionMatrix()}if(null===h.map){const t={minFilter:1003,magFilter:1003,format:1023};h.map=new vl(i.x,i.y,t),h.map.texture.name=u.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const p=h.getViewportCount();for(let t=0;t<p;t++){const e=h.getViewport(t);a.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),d.viewport(a),h.updateMatrices(u,t),r=h.getFrustum(),x(s,c,h.camera,u,this.type)}h.isPointLightShadow||3!==this.type||g(h,c),h.needsUpdate=!1}m.needsUpdate=!1,t.setRenderTarget(l,u,h)}}function Yf(t,e,n){const r=n.isWebGL2;const i=new function(){let e=!1;const n=new gl;let r=null;const i=new gl(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,o,a,s){!0===s&&(e*=a,r*=a,o*=a),n.set(e,r,o,a),!1===i.equals(n)&&(t.clearColor(e,r,o,a),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},o=new function(){let e=!1,n=null,r=null,i=null;return{setTest:function(t){t?z(2929):D(2929)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},a=new function(){let e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,l=null;return{setTest:function(t){e||(t?z(2960):D(2960))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&c===r||(t.stencilOp(e,n,r),a=e,s=n,c=r)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,l=null}}};let s={},c=null,l=null,u=null,h=null,d=null,f=null,p=null,m=null,g=null,v=!1,y=null,b=null,x=null,_=null,w=null;const M=t.getParameter(35661);let S=!1,T=0;const E=t.getParameter(7938);-1!==E.indexOf("WebGL")?(T=parseFloat(/^WebGL (\d)/.exec(E)[1]),S=T>=1):-1!==E.indexOf("OpenGL ES")&&(T=parseFloat(/^OpenGL ES (\d)/.exec(E)[1]),S=T>=2);let A=null,L={};const C=new gl,R=new gl;function P(e,n,r){const i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;e<r;e++)t.texImage2D(n+e,0,6408,1,1,0,6408,5121,i);return o}const N={};function z(e){!0!==s[e]&&(t.enable(e),s[e]=!0)}function D(e){!1!==s[e]&&(t.disable(e),s[e]=!1)}N[3553]=P(3553,3553,1),N[34067]=P(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),a.setClear(0),z(2929),o.setFunc(3),U(!1),B(1),z(2884),F(0);const I={100:32774,101:32778,102:32779};if(r)I[103]=32775,I[104]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(I[103]=t.MIN_EXT,I[104]=t.MAX_EXT)}const O={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function F(e,n,r,i,o,a,s,c){if(0!==e){if(l||(z(3042),l=!0),5===e)o=o||n,a=a||r,s=s||i,n===h&&o===p||(t.blendEquationSeparate(I[n],I[o]),h=n,p=o),r===d&&i===f&&a===m&&s===g||(t.blendFuncSeparate(O[r],O[i],O[a],O[s]),d=r,f=i,m=a,g=s),u=e,v=null;else if(e!==u||c!==v){if(100===h&&100===p||(t.blendEquation(32774),h=100,p=100),c)switch(e){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}d=null,f=null,m=null,g=null,u=e,v=c}}else l&&(D(3042),l=!1)}function U(e){y!==e&&(e?t.frontFace(2304):t.frontFace(2305),y=e)}function B(e){0!==e?(z(2884),e!==b&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):D(2884),b=e}function H(e,n,r){e?(z(32823),_===n&&w===r||(t.polygonOffset(n,r),_=n,w=r)):D(32823)}function k(e){void 0===e&&(e=33984+M-1),A!==e&&(t.activeTexture(e),A=e)}return{buffers:{color:i,depth:o,stencil:a},enable:z,disable:D,useProgram:function(e){return c!==e&&(t.useProgram(e),c=e,!0)},setBlending:F,setMaterial:function(t,e){2===t.side?D(2884):z(2884);let n=1===t.side;e&&(n=!n),U(n),1===t.blending&&!1===t.transparent?F(0):F(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),i.setMask(t.colorWrite);const r=t.stencilWrite;a.setTest(r),r&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),H(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:U,setCullFace:B,setLineWidth:function(e){e!==x&&(S&&t.lineWidth(e),x=e)},setPolygonOffset:H,setScissorTest:function(t){t?z(3089):D(3089)},activeTexture:k,bindTexture:function(e,n){null===A&&k();let r=L[A];void 0===r&&(r={type:void 0,texture:void 0},L[A]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||N[e]),r.type=e,r.texture=n)},unbindTexture:function(){const e=L[A];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===C.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),C.copy(e))},viewport:function(e){!1===R.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),R.copy(e))},reset:function(){s={},A=null,L={},c=null,l=null,u=null,h=null,d=null,f=null,p=null,m=null,g=null,v=!1,y=null,b=null,x=null,_=null,w=null,i.reset(),o.reset(),a.reset()}}}function Xf(t,e,n,r,i,o,a){const s=i.isWebGL2,c=i.maxTextures,l=i.maxCubemapSize,u=i.maxTextureSize,h=i.maxSamples,d=new WeakMap;let f,p=!1;try{p="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function m(t,e){return p?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(t,e,n,r){let i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const r=e?cl.floorPowerOfTwo:Math.floor,o=r(i*t.width),a=r(i*t.height);void 0===f&&(f=m(o,a));const s=n?m(o,a):f;s.width=o,s.height=a;return s.getContext("2d").drawImage(t,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+a+")."),s}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function v(t){return cl.isPowerOfTwo(t.width)&&cl.isPowerOfTwo(t.height)}function y(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function b(e,n,i,o){t.generateMipmap(e);r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function x(n,r,i){if(!1===s)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function _(t){return 1003===t||1004===t||1005===t?9728:9729}function w(e){const n=e.target;n.removeEventListener("dispose",w),function(e){const n=r.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),r.remove(e)}(n),n.isVideoTexture&&d.delete(n),a.memory.textures--}function M(e){const n=e.target;n.removeEventListener("dispose",M),function(e){const n=r.get(e),i=r.get(e.texture);if(!e)return;void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(e.texture),r.remove(e)}(n),a.memory.textures--}let S=0;function T(t,e){const i=r.get(t);if(t.isVideoTexture&&function(t){const e=a.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){const n=t.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void P(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}function E(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?function(e,r,i){if(6!==r.image.length)return;R(e,r),n.activeTexture(33984+i),n.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);const a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),c=r.image[0]&&r.image[0].isDataTexture,u=[];for(let t=0;t<6;t++)u[t]=a||c?c?r.image[t].image:r.image[t]:g(r.image[t],!1,!0,l);const h=u[0],d=v(h)||s,f=o.convert(r.format),p=o.convert(r.type),m=x(r.internalFormat,f,p);let _;if(C(34067,r,d),a){for(let t=0;t<6;t++){_=u[t].mipmaps;for(let e=0;e<_.length;e++){const i=_[e];1023!==r.format&&1022!==r.format?null!==f?n.compressedTexImage2D(34069+t,e,m,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+t,e,m,i.width,i.height,0,f,p,i.data)}}e.__maxMipLevel=_.length-1}else{_=r.mipmaps;for(let t=0;t<6;t++)if(c){n.texImage2D(34069+t,0,m,u[t].width,u[t].height,0,f,p,u[t].data);for(let e=0;e<_.length;e++){const r=_[e].image[t].image;n.texImage2D(34069+t,e+1,m,r.width,r.height,0,f,p,r.data)}}else{n.texImage2D(34069+t,0,m,f,p,u[t]);for(let e=0;e<_.length;e++){const r=_[e];n.texImage2D(34069+t,e+1,m,f,p,r.image[t])}}e.__maxMipLevel=_.length}y(r,d)&&b(34067,r,h.width,h.height);e.__version=r.version,r.onUpdate&&r.onUpdate(r)}(a,e,i):(n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture))}const A={1e3:10497,1001:33071,1002:33648},L={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function C(n,o,a){a?(t.texParameteri(n,10242,A[o.wrapS]),t.texParameteri(n,10243,A[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,A[o.wrapR]),t.texParameteri(n,10240,L[o.magFilter]),t.texParameteri(n,10241,L[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),1001===o.wrapS&&1001===o.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,_(o.magFilter)),t.texParameteri(n,10241,_(o.minFilter)),1003!==o.minFilter&&1006!==o.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));const c=e.get("EXT_texture_filter_anisotropic");if(c){if(1015===o.type&&null===e.get("OES_texture_float_linear"))return;if(1016===o.type&&null===(s||e.get("OES_texture_half_float_linear")))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function R(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w),e.__webglTexture=t.createTexture(),a.memory.textures++)}function P(e,r,i){let a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),R(e,r),n.activeTexture(33984+i),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);const c=function(t){return!s&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(r)&&!1===v(r.image),l=g(r.image,c,!1,u),h=v(l)||s,d=o.convert(r.format);let f,p=o.convert(r.type),m=x(r.internalFormat,d,p);C(a,r,h);const _=r.mipmaps;if(r.isDepthTexture)m=6402,s?m=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===m&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,p=o.convert(r.type)),1027===r.format&&6402===m&&(m=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,p=o.convert(r.type))),n.texImage2D(3553,0,m,l.width,l.height,0,d,p,null);else if(r.isDataTexture)if(_.length>0&&h){for(let t=0,e=_.length;t<e;t++)f=_[t],n.texImage2D(3553,t,m,f.width,f.height,0,d,p,f.data);r.generateMipmaps=!1,e.__maxMipLevel=_.length-1}else n.texImage2D(3553,0,m,l.width,l.height,0,d,p,l.data),e.__maxMipLevel=0;else if(r.isCompressedTexture){for(let t=0,e=_.length;t<e;t++)f=_[t],1023!==r.format&&1022!==r.format?null!==d?n.compressedTexImage2D(3553,t,m,f.width,f.height,0,f.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,t,m,f.width,f.height,0,d,p,f.data);e.__maxMipLevel=_.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,m,l.width,l.height,l.depth,0,d,p,l.data),e.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,m,l.width,l.height,l.depth,0,d,p,l.data),e.__maxMipLevel=0;else if(_.length>0&&h){for(let t=0,e=_.length;t<e;t++)f=_[t],n.texImage2D(3553,t,m,d,p,f);r.generateMipmaps=!1,e.__maxMipLevel=_.length-1}else n.texImage2D(3553,0,m,d,p,l),e.__maxMipLevel=0;y(r,h)&&b(a,r,l.width,l.height),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function N(e,i,a,s){const c=o.convert(i.texture.format),l=o.convert(i.texture.type),u=x(i.texture.internalFormat,c,l);n.texImage2D(s,0,u,i.width,i.height,0,c,l,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function z(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){let i=33189;if(r){const e=n.depthTexture;e&&e.isDepthTexture&&(1015===e.type?i=36012:1014===e.type&&(i=33190));const r=I(n);t.renderbufferStorageMultisample(36161,r,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){if(r){const e=I(n);t.renderbufferStorageMultisample(36161,e,35056,n.width,n.height)}else t.renderbufferStorage(36161,34041,n.width,n.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=o.convert(n.texture.format),i=o.convert(n.texture.type),a=x(n.texture.internalFormat,e,i);if(r){const e=I(n);t.renderbufferStorageMultisample(36161,e,a,n.width,n.height)}else t.renderbufferStorage(36161,a,n.width,n.height)}t.bindRenderbuffer(36161,null)}function D(e){const n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),T(n.depthTexture,0);const i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(let r=0;r<6;r++)t.bindFramebuffer(36160,n.__webglFramebuffer[r]),n.__webglDepthbuffer[r]=t.createRenderbuffer(),z(n.__webglDepthbuffer[r],e,!1)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),z(n.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function I(t){return s&&t.isWebGLMultisampleRenderTarget?Math.min(h,t.samples):0}let O=!1,F=!1;this.allocateTextureUnit=function(){const t=S;return t>=c&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+c),S+=1,t},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(t,e){const i=r.get(t);t.version>0&&i.__version!==t.version?P(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){const i=r.get(t);t.version>0&&i.__version!==t.version?P(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=E,this.setupRenderTarget=function(e){const i=r.get(e),c=r.get(e.texture);e.addEventListener("dispose",M),c.__webglTexture=t.createTexture(),a.memory.textures++;const l=!0===e.isWebGLCubeRenderTarget,u=!0===e.isWebGLMultisampleRenderTarget,h=v(e)||s;if(!s||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),l){i.__webglFramebuffer=[];for(let e=0;e<6;e++)i.__webglFramebuffer[e]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),u)if(s){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);const n=o.convert(e.texture.format),r=o.convert(e.texture.type),a=x(e.texture.internalFormat,n,r),s=I(e);t.renderbufferStorageMultisample(36161,s,a,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),z(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){n.bindTexture(34067,c.__webglTexture),C(34067,e.texture,h);for(let t=0;t<6;t++)N(i.__webglFramebuffer[t],e,36064,34069+t);y(e.texture,h)&&b(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,c.__webglTexture),C(3553,e.texture,h),N(i.__webglFramebuffer,e,36064,3553),y(e.texture,h)&&b(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&D(e)},this.updateRenderTargetMipmap=function(t){const e=t.texture;if(y(e,v(t)||s)){const i=t.isWebGLCubeRenderTarget?34067:3553,o=r.get(e).__webglTexture;n.bindTexture(i,o),b(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(s){const n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);const i=e.width,o=e.height;let a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===O&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),O=!0),t=t.texture),T(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),E(t,e)}}function Zf(t,e,n){const r=n.isWebGL2;return{convert:function(t){let n;if(1009===t)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return r?5131:(n=e.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(n=e.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(n=e.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return n=e.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&(n=e.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?(n=e.get("WEBGL_compressed_texture_astc"),null!==n?t:null):36492===t?(n=e.get("EXT_texture_compression_bptc"),null!==n?t:null):1020===t?r?34042:(n=e.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Jf(t=[]){Hh.call(this),this.cameras=t}function Qf(){yu.call(this),this.type="Group"}function $f(){this._targetRay=null,this._grip=null,this._hand=null}function Kf(t,e){const n=this;let r=null,i=1,o=null,a="local-floor",s=null;const c=[],l=new Map,u=new Hh;u.layers.enable(1),u.viewport=new gl;const h=new Hh;h.layers.enable(2),h.viewport=new gl;const d=[u,h],f=new Jf;f.layers.enable(1),f.layers.enable(2);let p=null,m=null;function g(t){const e=l.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function v(){l.forEach((function(t,e){t.disconnect(e)})),l.clear(),p=null,m=null,t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),M.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(t){const e=r.inputSources;for(let t=0;t<c.length;t++)l.set(e[t],c[t]);for(let e=0;e<t.removed.length;e++){const n=t.removed[e],r=l.get(n);r&&(r.dispatchEvent({type:"disconnected",data:n}),l.delete(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e],r=l.get(n);r&&r.dispatchEvent({type:"connected",data:n})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=c[t];return void 0===e&&(e=new $f,c[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=c[t];return void 0===e&&(e=new $f,c[t]=e),e.getGripSpace()},this.getHand=function(t){let e=c[t];return void 0===e&&(e=new $f,c[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getSession=function(){return r},this.setSession=async function(t){if(r=t,null!==r){r.addEventListener("select",g),r.addEventListener("selectstart",g),r.addEventListener("selectend",g),r.addEventListener("squeeze",g),r.addEventListener("squeezestart",g),r.addEventListener("squeezeend",g),r.addEventListener("end",v),r.addEventListener("inputsourceschange",y);const t=e.getContextAttributes();!0!==t.xrCompatible&&await e.makeXRCompatible();const s={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:i},c=new XRWebGLLayer(r,e,s);r.updateRenderState({baseLayer:c}),o=await r.requestReferenceSpace(a),M.setContext(r),M.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const b=new bl,x=new bl;function _(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.getCamera=function(t){f.near=h.near=u.near=t.near,f.far=h.far=u.far=t.far,p===f.near&&m===f.far||(r.updateRenderState({depthNear:f.near,depthFar:f.far}),p=f.near,m=f.far);const e=t.parent,n=f.cameras;_(f,e);for(let t=0;t<n.length;t++)_(n[t],e);t.matrixWorld.copy(f.matrixWorld),t.matrix.copy(f.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale);const i=t.children;for(let t=0,e=i.length;t<e;t++)i[t].updateMatrixWorld(!0);return 2===n.length?function(t,e,n){b.setFromMatrixPosition(e.matrixWorld),x.setFromMatrixPosition(n.matrixWorld);const r=b.distanceTo(x),i=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(o[8]+1)/o[0],d=a*u,f=a*h,p=r/(-u+h),m=p*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(p),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=a+p,v=s+p,y=d-m,_=f+(r-m),w=c*s/v*g,M=l*s/v*g;t.projectionMatrix.makePerspective(y,_,w,M,g,v)}(f,u,h):f.projectionMatrix.copy(u.projectionMatrix),f};let w=null;const M=new Xh;M.setAnimationLoop((function(e,n){if(s=n.getViewerPose(o),null!==s){const e=s.views,n=r.renderState.baseLayer;t.setFramebuffer(n.framebuffer);let i=!1;e.length!==f.cameras.length&&(f.cameras.length=0,i=!0);for(let t=0;t<e.length;t++){const r=e[t],o=n.getViewport(r),a=d[t];a.matrix.fromArray(r.transform.matrix),a.projectionMatrix.fromArray(r.projectionMatrix),a.viewport.set(o.x,o.y,o.width,o.height),0===t&&f.matrix.copy(a.matrix),!0===i&&f.cameras.push(a)}}const i=r.inputSources;for(let t=0;t<c.length;t++){const e=c[t],r=i[t];e.update(r,n,o)}w&&w(e,n)})),this.setAnimationLoop=function(t){w=t},this.dispose=function(){}}function tp(t){function e(e,n){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);const r=t.get(n).envMap;if(r){e.envMap.value=r,e.flipEnvMap.value=r.isCubeTexture&&r._needsFlipEnvMap?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio;const i=t.get(r).__maxMipLevel;void 0!==i&&(e.maxMipLevel.value=i)}let i,o;n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap?i=n.emissiveMap:n.clearcoatMap?i=n.clearcoatMap:n.clearcoatNormalMap?i=n.clearcoatNormalMap:n.clearcoatRoughnessMap&&(i=n.clearcoatRoughnessMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uv2Transform.value.copy(o.matrix))}function n(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(e.emissiveMap.value=n.emissiveMap),n.bumpMap&&(e.bumpMap.value=n.bumpMap,e.bumpScale.value=n.bumpScale,1===n.side&&(e.bumpScale.value*=-1)),n.normalMap&&(e.normalMap.value=n.normalMap,e.normalScale.value.copy(n.normalScale),1===n.side&&e.normalScale.value.negate()),n.displacementMap&&(e.displacementMap.value=n.displacementMap,e.displacementScale.value=n.displacementScale,e.displacementBias.value=n.displacementBias);t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,r,i,o){r.isMeshBasicMaterial?e(t,r):r.isMeshLambertMaterial?(e(t,r),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,r)):r.isMeshToonMaterial?(e(t,r),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshPhongMaterial?(e(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshStandardMaterial?(e(t,r),r.isMeshPhysicalMaterial?function(t,e){n(t,e),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap);e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate());t.transmission.value=e.transmission,e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap)}(t,r):n(t,r)):r.isMeshMatcapMaterial?(e(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDepthMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDistanceMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,r)):r.isMeshNormalMaterial?(e(t,r),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,n,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*r,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,r,i,o):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);let n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function ep(t){const e=void 0!==(t=t||{}).canvas?t.canvas:function(){const t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return t.style.display="block",t}(),n=void 0!==t.context?t.context:null,r=void 0!==t.alpha&&t.alpha,i=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,l=void 0!==t.powerPreference?t.powerPreference:"default",u=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let h=null,d=null;const f=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;const p=this;let m=!1,g=null,v=0,y=0,b=null,x=null,_=-1,w=null;const M=new gl,S=new gl;let T=null,E=e.width,A=e.height,L=1,C=null,R=null;const P=new gl(0,0,E,A),N=new gl(0,0,E,A);let z=!1;const D=new Yh;let I=!1,O=!1;const F=new Yl,U=new bl,B={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function H(){return null===b?L:1}let k,G,j,W,V,q,Y,X,Z,J,Q,$,K,tt,et,nt,rt,it,ot,at,st,ct=n;function lt(t,n){for(let r=0;r<t.length;r++){const i=t[r],o=e.getContext(i,n);if(null!==o)return o}return null}try{const t={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:u};if(e.addEventListener("webglcontextlost",ft,!1),e.addEventListener("webglcontextrestored",pt,!1),null===ct){const e=["webgl2","webgl","experimental-webgl"];if(!0===p.isWebGL1Renderer&&e.shift(),ct=lt(e,t),null===ct)throw lt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ct.getShaderPrecisionFormat&&(ct.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ut(){k=new ad(ct),G=new rd(ct,k,t),k.init(G),at=new Zf(ct,k,G),j=new Yf(ct,k,G),j.scissor(S.copy(N).multiplyScalar(L).floor()),j.viewport(M.copy(P).multiplyScalar(L).floor()),W=new ld(ct),V=new zf,q=new Xf(ct,k,j,V,G,at,W),Y=new od(p),X=new Zh(ct,G),st=new ed(ct,k,X,G),Z=new sd(ct,X,W,st),J=new fd(ct,Z,X,W),rt=new dd(ct),et=new id(V),Q=new Nf(p,Y,k,G,st,et),$=new tp(V),K=new Ff(V),tt=new jf(k,G),nt=new td(p,Y,j,J,s),it=new nd(ct,k,W,G),ot=new cd(ct,k,W,G),W.programs=Q.programs,p.capabilities=G,p.extensions=k,p.properties=V,p.renderLists=K,p.state=j,p.info=W}ut();const ht=new Kf(p,ct);this.xr=ht;const dt=new qf(p,J,G.maxTextureSize);function ft(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function pt(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1,ut()}function mt(t){const e=t.target;e.removeEventListener("dispose",mt),function(t){gt(t),V.remove(t)}(e)}function gt(t){const e=V.get(t).program;void 0!==e&&Q.releaseProgram(e)}this.shadowMap=dt,this.getContext=function(){return ct},this.getContextAttributes=function(){return ct.getContextAttributes()},this.forceContextLoss=function(){const t=k.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=k.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(t){void 0!==t&&(L=t,this.setSize(E,A,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new ll),t.set(E,A)},this.setSize=function(t,n,r){ht.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(E=t,A=n,e.width=Math.floor(t*L),e.height=Math.floor(n*L),!1!==r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new ll),t.set(E*L,A*L).floor()},this.setDrawingBufferSize=function(t,n,r){E=t,A=n,L=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new gl),t.copy(M)},this.getViewport=function(t){return t.copy(P)},this.setViewport=function(t,e,n,r){t.isVector4?P.set(t.x,t.y,t.z,t.w):P.set(t,e,n,r),j.viewport(M.copy(P).multiplyScalar(L).floor())},this.getScissor=function(t){return t.copy(N)},this.setScissor=function(t,e,n,r){t.isVector4?N.set(t.x,t.y,t.z,t.w):N.set(t,e,n,r),j.scissor(S.copy(N).multiplyScalar(L).floor())},this.getScissorTest=function(){return z},this.setScissorTest=function(t){j.setScissorTest(z=t)},this.setOpaqueSort=function(t){C=t},this.setTransparentSort=function(t){R=t},this.getClearColor=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getClearColor() now requires a Color as an argument"),t=new Hu),t.copy(nt.getClearColor())},this.setClearColor=function(){nt.setClearColor.apply(nt,arguments)},this.getClearAlpha=function(){return nt.getClearAlpha()},this.setClearAlpha=function(){nt.setClearAlpha.apply(nt,arguments)},this.clear=function(t,e,n){let r=0;(void 0===t||t)&&(r|=16384),(void 0===e||e)&&(r|=256),(void 0===n||n)&&(r|=1024),ct.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",ft,!1),e.removeEventListener("webglcontextrestored",pt,!1),K.dispose(),tt.dispose(),V.dispose(),Y.dispose(),J.dispose(),st.dispose(),ht.dispose(),yt.stop()},this.renderBufferImmediate=function(t,e){st.initAttributes();const n=V.get(t);t.hasPositions&&!n.position&&(n.position=ct.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=ct.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=ct.createBuffer()),t.hasColors&&!n.color&&(n.color=ct.createBuffer());const r=e.getAttributes();t.hasPositions&&(ct.bindBuffer(34962,n.position),ct.bufferData(34962,t.positionArray,35048),st.enableAttribute(r.position),ct.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(ct.bindBuffer(34962,n.normal),ct.bufferData(34962,t.normalArray,35048),st.enableAttribute(r.normal),ct.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(ct.bindBuffer(34962,n.uv),ct.bufferData(34962,t.uvArray,35048),st.enableAttribute(r.uv),ct.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(ct.bindBuffer(34962,n.color),ct.bufferData(34962,t.colorArray,35048),st.enableAttribute(r.color),ct.vertexAttribPointer(r.color,3,5126,!1,0,0)),st.disableUnusedAttributes(),ct.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,r,i,o){null===e&&(e=B);const a=i.isMesh&&i.matrixWorld.determinant()<0,s=Mt(t,e,r,i);j.setMaterial(r,a);let c=n.index;const l=n.attributes.position;if(null===c){if(void 0===l||0===l.count)return}else if(0===c.count)return;let u,h=1;!0===r.wireframe&&(c=Z.getWireframeAttribute(n),h=2),(r.morphTargets||r.morphNormals)&&rt.update(i,n,r,s),st.setup(i,r,s,n,c);let d=it;null!==c&&(u=X.get(c),d=ot,d.setIndex(u));const f=null!==c?c.count:l.count,p=n.drawRange.start*h,m=n.drawRange.count*h,g=null!==o?o.start*h:0,v=null!==o?o.count*h:1/0,y=Math.max(p,g),b=Math.min(f,p+m,g+v)-1,x=Math.max(0,b-y+1);if(0!==x){if(i.isMesh)!0===r.wireframe?(j.setLineWidth(r.wireframeLinewidth*H()),d.setMode(1)):d.setMode(4);else if(i.isLine){let t=r.linewidth;void 0===t&&(t=1),j.setLineWidth(t*H()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);if(i.isInstancedMesh)d.renderInstances(y,x,i.count);else if(n.isInstancedBufferGeometry){const t=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(y,x,t)}else d.render(y,x)}},this.compile=function(t,e){d=tt.get(t),d.init(),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights();const n=new WeakMap;t.traverse((function(e){const r=e.material;if(r)if(Array.isArray(r))for(let i=0;i<r.length;i++){const o=r[i];!1===n.has(o)&&(wt(o,t,e),n.set(o))}else!1===n.has(r)&&(wt(r,t,e),n.set(r))}))};let vt=null;const yt=new Xh;function bt(t,e,n,r){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||D.intersectsSprite(t)){r&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);const e=J.update(t),i=t.material;i.visible&&h.push(t,e,i,n,U.z,null)}}else if(t.isImmediateRenderObject)r&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F),h.push(t,null,t.material,n,U.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==W.render.frame&&(t.skeleton.update(),t.skeleton.frame=W.render.frame),!t.frustumCulled||D.intersectsObject(t))){r&&U.setFromMatrixPosition(t.matrixWorld).applyMatrix4(F);const e=J.update(t),i=t.material;if(Array.isArray(i)){const r=e.groups;for(let o=0,a=r.length;o<a;o++){const a=r[o],s=i[a.materialIndex];s&&s.visible&&h.push(t,e,s,n,U.z,a)}}else i.visible&&h.push(t,e,i,n,U.z,null)}const i=t.children;for(let t=0,o=i.length;t<o;t++)bt(i[t],e,n,r)}function xt(t,e,n){const r=!0===e.isScene?e.overrideMaterial:null;for(let i=0,o=t.length;i<o;i++){const o=t[i],a=o.object,s=o.geometry,c=null===r?o.material:r,l=o.group;if(n.isArrayCamera){const t=n.cameras;for(let n=0,r=t.length;n<r;n++){const r=t[n];a.layers.test(r.layers)&&(j.viewport(M.copy(r.viewport)),d.setupLightsView(r),_t(a,e,r,s,c,l))}}else _t(a,e,n,s,c,l)}}function _t(t,e,n,r,i,o){if(t.onBeforeRender(p,e,n,r,i,o),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){const r=Mt(n,e,i,t);j.setMaterial(i),st.reset(),function(t,e){t.render((function(t){p.renderBufferImmediate(t,e)}))}(t,r)}else p.renderBufferDirect(n,e,r,i,t,o);t.onAfterRender(p,e,n,r,i,o)}function wt(t,e,n){!0!==e.isScene&&(e=B);const r=V.get(t),i=d.state.lights,o=d.state.shadowsArray,a=i.state.version,s=Q.getParameters(t,i.state,o,e,n),c=Q.getProgramCacheKey(s);let l=r.program,u=!0;if(r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=Y.get(t.envMap||r.environment),void 0===l)t.addEventListener("dispose",mt);else if(l.cacheKey!==c)gt(t);else if(r.lightsStateVersion!==a)u=!1;else{if(void 0!==s.shaderID)return;u=!1}u&&(s.uniforms=Q.getUniforms(t),t.onBeforeCompile(s,p),l=Q.acquireProgram(s,c),r.program=l,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding);const h=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=et.numPlanes,r.numIntersection=et.numIntersection,h.clippingPlanes=et.uniform),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=a,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotShadowMatrix.value=i.state.spotShadowMatrix,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix);const f=r.program.getUniforms(),m=hf.seqWithValue(f.seq,h);r.uniformsList=m}function Mt(t,e,n,r){!0!==e.isScene&&(e=B),q.resetTextureUnits();const i=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=null===b?p.outputEncoding:b.texture.encoding,s=Y.get(n.envMap||o),c=V.get(n),l=d.state.lights;if(!0===I&&(!0===O||t!==w)){const e=t===w&&n.id===_;et.setState(n,t,e)}n.version===c.__version?n.fog&&c.fog!==i||c.environment!==o||c.needsLights&&c.lightsStateVersion!==l.state.version?wt(n,e,r):void 0===c.numClippingPlanes||c.numClippingPlanes===et.numPlanes&&c.numIntersection===et.numIntersection?(c.outputEncoding!==a||c.envMap!==s)&&wt(n,e,r):wt(n,e,r):(wt(n,e,r),c.__version=n.version);let u=!1,h=!1,f=!1;const m=c.program,g=m.getUniforms(),v=c.uniforms;if(j.useProgram(m.program)&&(u=!0,h=!0,f=!0),n.id!==_&&(_=n.id,h=!0),u||w!==t){if(g.setValue(ct,"projectionMatrix",t.projectionMatrix),G.logarithmicDepthBuffer&&g.setValue(ct,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),w!==t&&(w=t,h=!0,f=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const e=g.map.cameraPosition;void 0!==e&&e.setValue(ct,U.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&g.setValue(ct,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&g.setValue(ct,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){g.setOptional(ct,r,"bindMatrix"),g.setOptional(ct,r,"bindMatrixInverse");const t=r.skeleton;if(t){const e=t.bones;if(G.floatVertexTextures){if(null===t.boneTexture){let n=Math.sqrt(4*e.length);n=cl.ceilPowerOfTwo(n),n=Math.max(n,4);const r=new Float32Array(n*n*4);r.set(t.boneMatrices);const i=new Wh(r,n,n,1023,1015);t.boneMatrices=r,t.boneTexture=i,t.boneTextureSize=n}g.setValue(ct,"boneTexture",t.boneTexture,q),g.setValue(ct,"boneTextureSize",t.boneTextureSize)}else g.setOptional(ct,t,"boneMatrices")}}var y,x;return(h||c.receiveShadow!==r.receiveShadow)&&(c.receiveShadow=r.receiveShadow,g.setValue(ct,"receiveShadow",r.receiveShadow)),h&&(g.setValue(ct,"toneMappingExposure",p.toneMappingExposure),c.needsLights&&(x=f,(y=v).ambientLightColor.needsUpdate=x,y.lightProbe.needsUpdate=x,y.directionalLights.needsUpdate=x,y.directionalLightShadows.needsUpdate=x,y.pointLights.needsUpdate=x,y.pointLightShadows.needsUpdate=x,y.spotLights.needsUpdate=x,y.spotLightShadows.needsUpdate=x,y.rectAreaLights.needsUpdate=x,y.hemisphereLights.needsUpdate=x),i&&n.fog&&$.refreshFogUniforms(v,i),$.refreshMaterialUniforms(v,n,L,A),hf.upload(ct,c.uniformsList,v,q)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(hf.upload(ct,c.uniformsList,v,q),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&g.setValue(ct,"center",r.center),g.setValue(ct,"modelViewMatrix",r.modelViewMatrix),g.setValue(ct,"normalMatrix",r.normalMatrix),g.setValue(ct,"modelMatrix",r.matrixWorld),m}yt.setAnimationLoop((function(t){ht.isPresenting||vt&&vt(t)})),"undefined"!=typeof window&&yt.setContext(window),this.setAnimationLoop=function(t){vt=t,ht.setAnimationLoop(t),null===t?yt.stop():yt.start()},this.render=function(t,e){let n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===m)return;st.resetDefaultState(),_=-1,w=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===ht.enabled&&!0===ht.isPresenting&&(e=ht.getCamera(e)),!0===t.isScene&&t.onBeforeRender(p,t,e,n||b),d=tt.get(t,f.length),d.init(),f.push(d),F.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),D.setFromProjectionMatrix(F),O=this.localClippingEnabled,I=et.init(this.clippingPlanes,O,e),h=K.get(t,e),h.init(),bt(t,e,0,p.sortObjects),h.finish(),!0===p.sortObjects&&h.sort(C,R),!0===I&&et.beginShadows();const i=d.state.shadowsArray;dt.render(i,t,e),d.setupLights(),d.setupLightsView(e),!0===I&&et.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),nt.render(h,t,e,r);const o=h.opaque,a=h.transparent;o.length>0&&xt(o,t,e),a.length>0&&xt(a,t,e),!0===t.isScene&&t.onAfterRender(p,t,e),null!==b&&(q.updateRenderTargetMipmap(b),q.updateMultisampleRenderTarget(b)),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),f.pop(),d=f.length>0?f[f.length-1]:null,h=null},this.setFramebuffer=function(t){g!==t&&null===b&&ct.bindFramebuffer(36160,t),g=t},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderList=function(){return h},this.setRenderList=function(t){h=t},this.getRenderTarget=function(){return b},this.setRenderTarget=function(t,e=0,n=0){b=t,v=e,y=n,t&&void 0===V.get(t).__webglFramebuffer&&q.setupRenderTarget(t);let r=g,i=!1;if(t){const n=V.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=n[e],i=!0):r=t.isWebGLMultisampleRenderTarget?V.get(t).__webglMultisampledFramebuffer:n,M.copy(t.viewport),S.copy(t.scissor),T=t.scissorTest}else M.copy(P).multiplyScalar(L).floor(),S.copy(N).multiplyScalar(L).floor(),T=z;if(x!==r&&(ct.bindFramebuffer(36160,r),x=r),j.viewport(M),j.scissor(S),j.setScissorTest(T),i){const r=V.get(t.texture);ct.framebufferTexture2D(36160,36064,34069+e,r.__webglTexture,n)}},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=V.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){let a=!1;s!==x&&(ct.bindFramebuffer(36160,s),a=!0);try{const s=t.texture,c=s.format,l=s.type;if(1023!==c&&at.convert(c)!==ct.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=1016===l&&(k.has("EXT_color_buffer_half_float")||G.isWebGL2&&k.has("EXT_color_buffer_float"));if(!(1009===l||at.convert(l)===ct.getParameter(35738)||1015===l&&(G.isWebGL2||k.has("OES_texture_float")||k.has("WEBGL_color_buffer_float"))||u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ct.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&ct.readPixels(e,n,r,i,at.convert(c),at.convert(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{a&&ct.bindFramebuffer(36160,x)}}},this.copyFramebufferToTexture=function(t,e,n=0){const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),a=at.convert(e.format);q.setTexture2D(e,0),ct.copyTexImage2D(3553,n,a,t.x,t.y,i,o,0),j.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r=0){const i=e.image.width,o=e.image.height,a=at.convert(n.format),s=at.convert(n.type);q.setTexture2D(n,0),ct.pixelStorei(37440,n.flipY),ct.pixelStorei(37441,n.premultiplyAlpha),ct.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?ct.texSubImage2D(3553,r,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?ct.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):ct.texSubImage2D(3553,r,t.x,t.y,a,s,e.image),0===r&&n.generateMipmaps&&ct.generateMipmap(3553),j.unbindTexture()},this.initTexture=function(t){q.setTexture2D(t,0),j.unbindTexture()},this.resetState=function(){j.reset(),st.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function np(t){ep.call(this,t)}Jf.prototype=Object.assign(Object.create(Hh.prototype),{constructor:Jf,isArrayCamera:!0}),Qf.prototype=Object.assign(Object.create(yu.prototype),{constructor:Qf,isGroup:!0}),Object.assign($f.prototype,{constructor:$f,getHandSpace:function(){return null===this._hand&&(this._hand=new Qf,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Qf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Qf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){let r=null,i=null,o=null;const a=this._targetRay,s=this._grip,c=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(c&&t.hand){o=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,n);if(void 0===c.joints[r.jointName]){const t=new Qf;t.matrixAutoUpdate=!1,t.visible=!1,c.joints[r.jointName]=t,c.add(t)}const i=c.joints[r.jointName];null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=t.radius),i.visible=null!==t}const r=c.joints["index-finger-tip"],i=c.joints["thumb-tip"],a=r.position.distanceTo(i.position),s=.02,l=.005;c.inputState.pinching&&a>s+l?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&a<=s-l&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&(r=e.getPose(t.targetRaySpace,n),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==s&&t.gripSpace&&(i=e.getPose(t.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==c&&(c.visible=null!==o),this}}),Object.assign(Kf.prototype,ol.prototype),np.prototype=Object.assign(Object.create(ep.prototype),{constructor:np,isWebGL1Renderer:!0});class rp extends yu{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}function ip(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=cl.generateUUID()}Object.defineProperty(ip.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ip.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this},set:function(t,e=0){return this.array.set(t,e),this},clone:function(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=cl.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new ip(new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),this.stride);return e.setUsage(this.usage),e},onUpload:function(t){return this.onUploadCallback=t,this},toJSON:function(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=cl.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});const op=new bl;function ap(t,e,n,r){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function sp(t){ju.call(this),this.type="SpriteMaterial",this.color=new Hu(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}let cp;Object.defineProperties(ap.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(t){this.data.needsUpdate=t}}}),Object.assign(ap.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(let e=0,n=this.data.count;e<n;e++)op.x=this.getX(e),op.y=this.getY(e),op.z=this.getZ(e),op.applyMatrix4(t),this.setXYZ(e,op.x,op.y,op.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this},setXYZW:function(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this},clone:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new Yu(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new ap(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}),sp.prototype=Object.create(ju.prototype),sp.prototype.constructor=sp,sp.prototype.isSpriteMaterial=!0,sp.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};const lp=new bl,up=new bl,hp=new bl,dp=new ll,fp=new ll,pp=new Yl,mp=new bl,gp=new bl,vp=new bl,yp=new ll,bp=new ll,xp=new ll;function _p(t){if(yu.call(this),this.type="Sprite",void 0===cp){cp=new ph;const t=new ip(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);cp.setIndex([0,1,2,0,2,3]),cp.setAttribute("position",new ap(t,3,0,!1)),cp.setAttribute("uv",new ap(t,2,3,!1))}this.geometry=cp,this.material=void 0!==t?t:new sp,this.center=new ll(.5,.5)}function wp(t,e,n,r,i,o){dp.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(fp.x=o*dp.x-i*dp.y,fp.y=i*dp.x+o*dp.y):fp.copy(dp),t.copy(e),t.x+=fp.x,t.y+=fp.y,t.applyMatrix4(pp)}_p.prototype=Object.assign(Object.create(yu.prototype),{constructor:_p,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),up.setFromMatrixScale(this.matrixWorld),pp.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),hp.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&up.multiplyScalar(-hp.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const o=this.center;wp(mp.set(-.5,-.5,0),hp,o,up,r,i),wp(gp.set(.5,-.5,0),hp,o,up,r,i),wp(vp.set(.5,.5,0),hp,o,up,r,i),yp.set(0,0),bp.set(1,0),xp.set(1,1);let a=t.ray.intersectTriangle(mp,gp,vp,!1,lp);if(null===a&&(wp(gp.set(-.5,.5,0),hp,o,up,r,i),bp.set(0,1),a=t.ray.intersectTriangle(mp,vp,gp,!1,lp),null===a))return;const s=t.ray.origin.distanceTo(lp);s<t.near||s>t.far||e.push({distance:s,point:lp.clone(),uv:zu.getUV(lp,mp,gp,vp,yp,bp,xp,new ll),face:null,object:this})},copy:function(t){return yu.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const Mp=new bl,Sp=new bl;function Tp(){yu.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Tp.prototype=Object.assign(Object.create(yu.prototype),{constructor:Tp,isLOD:!0,copy:function(t){yu.prototype.copy.call(this,t,!1);const e=t.levels;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e=0){e=Math.abs(e);const n=this.levels;let r;for(r=0;r<n.length&&!(e<n[r].distance);r++);return n.splice(r,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){const e=this.levels;if(e.length>0){let n,r;for(n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(this.levels.length>0){Mp.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(Mp);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){Mp.setFromMatrixPosition(t.matrixWorld),Sp.setFromMatrixPosition(this.matrixWorld);const n=Mp.distanceTo(Sp)/t.zoom;let r,i;for(e[0].object.visible=!0,r=1,i=e.length;r<i&&n>=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)e[r].object.visible=!1}},toJSON:function(t){const e=yu.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const n=this.levels;for(let t=0,r=n.length;t<r;t++){const r=n[t];e.object.levels.push({object:r.object.uuid,distance:r.distance})}return e}});const Ep=new bl,Ap=new gl,Lp=new gl,Cp=new bl,Rp=new Yl;function Pp(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Nh.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Yl,this.bindMatrixInverse=new Yl}function Np(){yu.call(this),this.type="Bone"}Pp.prototype=Object.assign(Object.create(Nh.prototype),{constructor:Pp,isSkinnedMesh:!0,copy:function(t){return Nh.prototype.copy.call(this,t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){const t=new gl,e=this.geometry.attributes.skinWeight;for(let n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);const r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Nh.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(t,e){const n=this.skeleton,r=this.geometry;Ap.fromBufferAttribute(r.attributes.skinIndex,t),Lp.fromBufferAttribute(r.attributes.skinWeight,t),Ep.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const r=Lp.getComponent(t);if(0!==r){const i=Ap.getComponent(t);Rp.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),e.addScaledVector(Cp.copy(Ep).applyMatrix4(Rp),r)}}return e.applyMatrix4(this.bindMatrixInverse)}}),Np.prototype=Object.assign(Object.create(yu.prototype),{constructor:Np,isBone:!0});const zp=new Yl,Dp=new Yl;function Ip(t=[],e=[]){this.uuid=cl.generateUUID(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}Object.assign(Ip.prototype,{init:function(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new Yl)}},calculateInverses:function(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new Yl;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}},pose:function(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}},update:function(){const t=this.bones,e=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=t.length;r<i;r++){const i=t[r]?t[r].matrixWorld:Dp;zp.multiplyMatrices(i,e[r]),zp.toArray(n,16*r)}null!==r&&(r.needsUpdate=!0)},clone:function(){return new Ip(this.bones,this.boneInverses)},getBoneByName:function(t){for(let e=0,n=this.bones.length;e<n;e++){const n=this.bones[e];if(n.name===t)return n}},dispose:function(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)},fromJSON:function(t,e){this.uuid=t.uuid;for(let n=0,r=t.bones.length;n<r;n++){const r=t.bones[n];let i=e[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new Np),this.bones.push(i),this.boneInverses.push((new Yl).fromArray(t.boneInverses[n]))}return this.init(),this},toJSON:function(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,n=this.boneInverses;for(let r=0,i=e.length;r<i;r++){const i=e[r];t.bones.push(i.uuid);const o=n[r];t.boneInverses.push(o.toArray())}return t}});const Op=new Yl,Fp=new Yl,Up=[],Bp=new Nh;function Hp(t,e,n){Nh.call(this,t,e),this.instanceMatrix=new Yu(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}function kp(t){ju.call(this),this.type="LineBasicMaterial",this.color=new Hu(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}Hp.prototype=Object.assign(Object.create(Nh.prototype),{constructor:Hp,isInstancedMesh:!0,copy:function(t){return Nh.prototype.copy.call(this,t),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this},getColorAt:function(t,e){e.fromArray(this.instanceColor.array,3*t)},getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){const n=this.matrixWorld,r=this.count;if(Bp.geometry=this.geometry,Bp.material=this.material,void 0!==Bp.material)for(let i=0;i<r;i++){this.getMatrixAt(i,Op),Fp.multiplyMatrices(n,Op),Bp.matrixWorld=Fp,Bp.raycast(t,Up);for(let t=0,n=Up.length;t<n;t++){const n=Up[t];n.instanceId=i,n.object=this,e.push(n)}Up.length=0}},setColorAt:function(t,e){null===this.instanceColor&&(this.instanceColor=new Yu(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){},dispose:function(){this.dispatchEvent({type:"dispose"})}}),kp.prototype=Object.create(ju.prototype),kp.prototype.constructor=kp,kp.prototype.isLineBasicMaterial=!0,kp.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};const Gp=new bl,jp=new bl,Wp=new Yl,Vp=new ql,qp=new Ul;function Yp(t=new ph,e=new kp){yu.call(this),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}Yp.prototype=Object.assign(Object.create(yu.prototype),{constructor:Yp,isLine:!0,copy:function(t){return yu.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,r=e.count;t<r;t++)Gp.fromBufferAttribute(e,t-1),jp.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=Gp.distanceTo(jp);t.setAttribute("lineDistance",new nh(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this},raycast:function(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),qp.copy(n.boundingSphere),qp.applyMatrix4(r),qp.radius+=i,!1===t.ray.intersectsSphere(qp))return;Wp.copy(r).invert(),Vp.copy(t.ray).applyMatrix4(Wp);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,s=new bl,c=new bl,l=new bl,u=new bl,h=this.isLineSegments?2:1;if(n.isBufferGeometry){const r=n.index,i=n.attributes.position;if(null!==r){const n=r.array;for(let r=0,o=n.length-1;r<o;r+=h){const o=n[r],h=n[r+1];s.fromBufferAttribute(i,o),c.fromBufferAttribute(i,h);if(Vp.distanceSqToSegment(s,c,u,l)>a)continue;u.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(u);d<t.near||d>t.far||e.push({distance:d,point:l.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else for(let n=0,r=i.count-1;n<r;n+=h){s.fromBufferAttribute(i,n),c.fromBufferAttribute(i,n+1);if(Vp.distanceSqToSegment(s,c,u,l)>a)continue;u.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(u);r<t.near||r>t.far||e.push({distance:r,point:l.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Xp=new bl,Zp=new bl;function Jp(t,e){Yp.call(this,t,e),this.type="LineSegments"}function Qp(t,e){Yp.call(this,t,e),this.type="LineLoop"}function $p(t){ju.call(this),this.type="PointsMaterial",this.color=new Hu(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Jp.prototype=Object.assign(Object.create(Yp.prototype),{constructor:Jp,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,r=e.count;t<r;t+=2)Xp.fromBufferAttribute(e,t),Zp.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+Xp.distanceTo(Zp);t.setAttribute("lineDistance",new nh(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}),Qp.prototype=Object.assign(Object.create(Yp.prototype),{constructor:Qp,isLineLoop:!0}),$p.prototype=Object.create(ju.prototype),$p.prototype.constructor=$p,$p.prototype.isPointsMaterial=!0,$p.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};const Kp=new Yl,tm=new ql,em=new Ul,nm=new bl;function rm(t=new ph,e=new $p){yu.call(this),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}function im(t,e,n,r,i,o,a){const s=tm.distanceSqToPoint(t);if(s<n){const n=new bl;tm.closestPointToPoint(t,n),n.applyMatrix4(r);const c=i.ray.origin.distanceTo(n);if(c<i.near||c>i.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:n,index:e,face:null,object:a})}}function om(t,e,n,r,i,o,a,s,c){pl.call(this,t,e,n,r,i,o,a,s,c),this.format=void 0!==a?a:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){l.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}function am(t,e,n,r,i,o,a,s,c,l,u,h){pl.call(this,null,o,a,s,c,l,r,i,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function sm(t,e,n,r,i,o,a,s,c){pl.call(this,t,e,n,r,i,o,a,s,c),this.needsUpdate=!0}function cm(t,e,n,r,i,o,a,s,c,l){if(1026!==(l=void 0!==l?l:1026)&&1027!==l)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===l&&(n=1012),void 0===n&&1027===l&&(n=1020),pl.call(this,null,r,i,o,a,s,l,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}rm.prototype=Object.assign(Object.create(yu.prototype),{constructor:rm,isPoints:!0,copy:function(t){return yu.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),em.copy(n.boundingSphere),em.applyMatrix4(r),em.radius+=i,!1===t.ray.intersectsSphere(em))return;Kp.copy(r).invert(),tm.copy(t.ray).applyMatrix4(Kp);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position;if(null!==i){const n=i.array;for(let i=0,s=n.length;i<s;i++){const s=n[i];nm.fromBufferAttribute(o,s),im(nm,s,a,r,t,e,this)}}else for(let n=0,i=o.count;n<i;n++)nm.fromBufferAttribute(o,n),im(nm,n,a,r,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),om.prototype=Object.assign(Object.create(pl.prototype),{constructor:om,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),am.prototype=Object.create(pl.prototype),am.prototype.constructor=am,am.prototype.isCompressedTexture=!0,sm.prototype=Object.create(pl.prototype),sm.prototype.constructor=sm,sm.prototype.isCanvasTexture=!0,cm.prototype=Object.create(pl.prototype),cm.prototype.constructor=cm,cm.prototype.isDepthTexture=!0;new bl,new bl,new bl,new zu;const lm=function(t,e,n){n=n||2;const r=e&&e.length,i=r?e[0]*n:t.length;let o=um(t,0,i,n,!0);const a=[];if(!o||o.next===o.prev)return a;let s,c,l,u,h,d,f;if(r&&(o=function(t,e,n,r){const i=[];let o,a,s,c,l;for(o=0,a=e.length;o<a;o++)s=e[o]*r,c=o<a-1?e[o+1]*r:t.length,l=um(t,s,c,r,!1),l===l.next&&(l.steiner=!0),i.push(_m(l));for(i.sort(vm),o=0;o<i.length;o++)ym(i[o],n),n=hm(n,n.next);return n}(t,e,o,n)),t.length>80*n){s=l=t[0],c=u=t[1];for(let e=n;e<i;e+=n)h=t[e],d=t[e+1],h<s&&(s=h),d<c&&(c=d),h>l&&(l=h),d>u&&(u=d);f=Math.max(l-s,u-c),f=0!==f?1/f:0}return dm(o,a,n,s,c,f),a};function um(t,e,n,r,i){let o,a;if(i===function(t,e,n,r){let i=0;for(let o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}(t,e,n,r)>0)for(o=e;o<n;o+=r)a=Pm(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=Pm(o,t[o],t[o+1],a);return a&&Tm(a,a.next)&&(Nm(a),a=a.next),a}function hm(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Tm(r,r.next)&&0!==Sm(r.prev,r,r.next))r=r.next;else{if(Nm(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function dm(t,e,n,r,i,o,a){if(!t)return;!a&&o&&function(t,e,n,r){let i=t;do{null===i.z&&(i.z=xm(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n,r,i,o,a,s,c,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ,r);e++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,o);let s,c,l=t;for(;t.prev!==t.next;)if(s=t.prev,c=t.next,o?pm(t,r,i,o):fm(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),Nm(t),t=c.next,l=c.next;else if((t=c)===l){a?1===a?dm(t=mm(hm(t),e,n),e,n,r,i,o,2):2===a&&gm(t,e,n,r,i,o):dm(hm(t),e,n,r,i,o,1);break}}function fm(t){const e=t.prev,n=t,r=t.next;if(Sm(e,n,r)>=0)return!1;let i=t.next.next;for(;i!==t.prev;){if(wm(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Sm(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function pm(t,e,n,r){const i=t.prev,o=t,a=t.next;if(Sm(i,o,a)>=0)return!1;const s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,c=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=xm(s,c,e,n,r),d=xm(l,u,e,n,r);let f=t.prevZ,p=t.nextZ;for(;f&&f.z>=h&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&wm(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Sm(f.prev,f,f.next)>=0)return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&wm(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Sm(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;f&&f.z>=h;){if(f!==t.prev&&f!==t.next&&wm(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Sm(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&wm(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Sm(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function mm(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!Tm(i,o)&&Em(i,r,r.next,o)&&Cm(i,o)&&Cm(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Nm(r),Nm(r.next),r=t=o),r=r.next}while(r!==t);return hm(r)}function gm(t,e,n,r,i,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&Mm(a,t)){let s=Rm(a,t);return a=hm(a,a.next),s=hm(s,s.next),dm(a,e,n,r,i,o),void dm(s,e,n,r,i,o)}t=t.next}a=a.next}while(a!==t)}function vm(t,e){return t.x-e.x}function ym(t,e){if(e=function(t,e){let n=e;const r=t.x,i=t.y;let o,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>a){if(a=t,t===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!o)return null;if(r===a)return o;const s=o,c=o.x,l=o.y;let u,h=1/0;n=o;do{r>=n.x&&n.x>=c&&r!==n.x&&wm(i<l?r:a,i,c,l,i<l?a:r,i,n.x,n.y)&&(u=Math.abs(i-n.y)/(r-n.x),Cm(n,t)&&(u<h||u===h&&(n.x>o.x||n.x===o.x&&bm(o,n)))&&(o=n,h=u)),n=n.next}while(n!==s);return o}(t,e)){const n=Rm(e,t);hm(e,e.next),hm(n,n.next)}}function bm(t,e){return Sm(t.prev,t,e.prev)<0&&Sm(e.next,t,t.next)<0}function xm(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function _m(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function wm(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Mm(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Em(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Cm(t,e)&&Cm(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(Sm(t.prev,t,e.prev)||Sm(t,e.prev,e))||Tm(t,e)&&Sm(t.prev,t,t.next)>0&&Sm(e.prev,e,e.next)>0)}function Sm(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Tm(t,e){return t.x===e.x&&t.y===e.y}function Em(t,e,n,r){const i=Lm(Sm(t,e,n)),o=Lm(Sm(t,e,r)),a=Lm(Sm(n,r,t)),s=Lm(Sm(n,r,e));return i!==o&&a!==s||(!(0!==i||!Am(t,n,e))||(!(0!==o||!Am(t,r,e))||(!(0!==a||!Am(n,t,r))||!(0!==s||!Am(n,e,r)))))}function Am(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Lm(t){return t>0?1:t<0?-1:0}function Cm(t,e){return Sm(t.prev,t,t.next)<0?Sm(t,e,t.next)>=0&&Sm(t,t.prev,e)>=0:Sm(t,e,t.prev)<0||Sm(t,t.next,e)<0}function Rm(t,e){const n=new zm(t.i,t.x,t.y),r=new zm(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Pm(t,e,n,r){const i=new zm(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Nm(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function zm(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const Dm={area:function(t){const e=t.length;let n=0;for(let r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return Dm.area(t)<0},triangulateShape:function(t,e){const n=[],r=[],i=[];Im(t),Om(n,t);let o=t.length;e.forEach(Im);for(let t=0;t<e.length;t++)r.push(o),o+=e[t].length,Om(n,e[t]);const a=lm(n,r);for(let t=0;t<a.length;t+=3)i.push(a.slice(t,t+3));return i}};function Im(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Om(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Fm extends ph{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],i=[];for(let e=0,n=t.length;e<n;e++){o(t[e])}function o(t){const o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1;let c=void 0!==e.depth?e.depth:100,l=void 0===e.bevelEnabled||e.bevelEnabled,u=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:u-2,d=void 0!==e.bevelOffset?e.bevelOffset:0,f=void 0!==e.bevelSegments?e.bevelSegments:3;const p=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Um;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=e.amount);let g,v,y,b,x,_=!1;p&&(g=p.getSpacedPoints(s),_=!0,l=!1,v=p.computeFrenetFrames(s,!1),y=new bl,b=new bl,x=new bl),l||(f=0,u=0,h=0,d=0);const w=t.extractPoints(a);let M=w.shape;const S=w.holes;if(!Dm.isClockWise(M)){M=M.reverse();for(let t=0,e=S.length;t<e;t++){const e=S[t];Dm.isClockWise(e)&&(S[t]=e.reverse())}}const T=Dm.triangulateShape(M,S),E=M;for(let t=0,e=S.length;t<e;t++){const e=S[t];M=M.concat(e)}function A(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}const L=M.length,C=T.length;function R(t,e,n){let r,i,o;const a=t.x-e.x,s=t.y-e.y,c=n.x-t.x,l=n.y-t.y,u=a*a+s*s,h=a*l-s*c;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(u),d=Math.sqrt(c*c+l*l),f=e.x-s/h,p=e.y+a/h,m=((n.x-l/d-f)*l-(n.y+c/d-p)*c)/(a*l-s*c);r=f+a*m-t.x,i=p+s*m-t.y;const g=r*r+i*i;if(g<=2)return new ll(r,i);o=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?c>Number.EPSILON&&(t=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(t=!0):Math.sign(s)===Math.sign(l)&&(t=!0),t?(r=-s,i=a,o=Math.sqrt(u)):(r=a,i=s,o=Math.sqrt(u/2))}return new ll(r/o,i/o)}const P=[];for(let t=0,e=E.length,n=e-1,r=t+1;t<e;t++,n++,r++)n===e&&(n=0),r===e&&(r=0),P[t]=R(E[t],E[n],E[r]);const N=[];let z,D=P.concat();for(let t=0,e=S.length;t<e;t++){const e=S[t];z=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),z[t]=R(e[t],e[r],e[i]);N.push(z),D=D.concat(z)}for(let t=0;t<f;t++){const e=t/f,n=u*Math.cos(e*Math.PI/2),r=h*Math.sin(e*Math.PI/2)+d;for(let t=0,e=E.length;t<e;t++){const e=A(E[t],P[t],r);F(e.x,e.y,-n)}for(let t=0,e=S.length;t<e;t++){const e=S[t];z=N[t];for(let t=0,i=e.length;t<i;t++){const i=A(e[t],z[t],r);F(i.x,i.y,-n)}}}const I=h+d;for(let t=0;t<L;t++){const e=l?A(M[t],D[t],I):M[t];_?(b.copy(v.normals[0]).multiplyScalar(e.x),y.copy(v.binormals[0]).multiplyScalar(e.y),x.copy(g[0]).add(b).add(y),F(x.x,x.y,x.z)):F(e.x,e.y,0)}for(let t=1;t<=s;t++)for(let e=0;e<L;e++){const n=l?A(M[e],D[e],I):M[e];_?(b.copy(v.normals[t]).multiplyScalar(n.x),y.copy(v.binormals[t]).multiplyScalar(n.y),x.copy(g[t]).add(b).add(y),F(x.x,x.y,x.z)):F(n.x,n.y,c/s*t)}for(let t=f-1;t>=0;t--){const e=t/f,n=u*Math.cos(e*Math.PI/2),r=h*Math.sin(e*Math.PI/2)+d;for(let t=0,e=E.length;t<e;t++){const e=A(E[t],P[t],r);F(e.x,e.y,c+n)}for(let t=0,e=S.length;t<e;t++){const e=S[t];z=N[t];for(let t=0,i=e.length;t<i;t++){const i=A(e[t],z[t],r);_?F(i.x,i.y+g[s-1].y,g[s-1].x+n):F(i.x,i.y,c+n)}}}function O(t,e){let n=t.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=t.length-1);for(let t=0,n=s+2*f;t<n;t++){const n=L*t,o=L*(t+1);B(e+r+n,e+i+n,e+i+o,e+r+o)}}}function F(t,e,n){o.push(t),o.push(e),o.push(n)}function U(t,e,i){H(t),H(e),H(i);const o=r.length/3,a=m.generateTopUV(n,r,o-3,o-2,o-1);k(a[0]),k(a[1]),k(a[2])}function B(t,e,i,o){H(t),H(e),H(o),H(e),H(i),H(o);const a=r.length/3,s=m.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);k(s[0]),k(s[1]),k(s[3]),k(s[1]),k(s[2]),k(s[3])}function H(t){r.push(o[3*t+0]),r.push(o[3*t+1]),r.push(o[3*t+2])}function k(t){i.push(t.x),i.push(t.y)}!function(){const t=r.length/3;if(l){let t=0,e=L*t;for(let t=0;t<C;t++){const n=T[t];U(n[2]+e,n[1]+e,n[0]+e)}t=s+2*f,e=L*t;for(let t=0;t<C;t++){const n=T[t];U(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<C;t++){const e=T[t];U(e[2],e[1],e[0])}for(let t=0;t<C;t++){const e=T[t];U(e[0]+L*s,e[1]+L*s,e[2]+L*s)}}n.addGroup(t,r.length/3-t,0)}(),function(){const t=r.length/3;let e=0;O(E,e),e+=E.length;for(let t=0,n=S.length;t<n;t++){const n=S[t];O(n,e),e+=n.length}n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new nh(r,3)),this.setAttribute("uv",new nh(i,2)),this.computeVertexNormals()}toJSON(){const t=ph.prototype.toJSON.call(this);return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){const r=t[e];n.shapes.push(r.uuid)}else n.shapes.push(t.uuid);void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}}const Um={generateTopUV:function(t,e,n,r,i){const o=e[3*n],a=e[3*n+1],s=e[3*r],c=e[3*r+1],l=e[3*i],u=e[3*i+1];return[new ll(o,a),new ll(s,c),new ll(l,u)]},generateSideWallUV:function(t,e,n,r,i,o){const a=e[3*n],s=e[3*n+1],c=e[3*n+2],l=e[3*r],u=e[3*r+1],h=e[3*r+2],d=e[3*i],f=e[3*i+1],p=e[3*i+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(s-u)<.01?[new ll(a,1-c),new ll(l,1-h),new ll(d,1-p),new ll(m,1-v)]:[new ll(s,1-c),new ll(u,1-h),new ll(f,1-p),new ll(g,1-v)]}};function Bm(t,e,n){ph.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n};const r=[],i=[],o=[],a=[],s=1e-5,c=new bl,l=new bl,u=new bl,h=new bl,d=new bl;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const f=e+1;for(let r=0;r<=n;r++){const f=r/n;for(let n=0;n<=e;n++){const r=n/e;t(r,f,l),i.push(l.x,l.y,l.z),r-s>=0?(t(r-s,f,u),h.subVectors(l,u)):(t(r+s,f,u),h.subVectors(u,l)),f-s>=0?(t(r,f-s,u),d.subVectors(l,u)):(t(r,f+s,u),d.subVectors(u,l)),c.crossVectors(h,d).normalize(),o.push(c.x,c.y,c.z),a.push(r,f)}}for(let t=0;t<n;t++)for(let n=0;n<e;n++){const e=t*f+n,i=t*f+n+1,o=(t+1)*f+n+1,a=(t+1)*f+n;r.push(e,i,a),r.push(i,o,a)}this.setIndex(r),this.setAttribute("position",new nh(i,3)),this.setAttribute("normal",new nh(o,3)),this.setAttribute("uv",new nh(a,2))}Bm.prototype=Object.create(ph.prototype),Bm.prototype.constructor=Bm;class Hm extends ph{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const n=[],r=[],i=[],o=[];let a=0,s=0;if(!1===Array.isArray(t))c(t);else for(let e=0;e<t.length;e++)c(t[e]),this.addGroup(a,s,e),a+=s,s=0;function c(t){const a=r.length/3,c=t.extractPoints(e);let l=c.shape;const u=c.holes;!1===Dm.isClockWise(l)&&(l=l.reverse());for(let t=0,e=u.length;t<e;t++){const e=u[t];!0===Dm.isClockWise(e)&&(u[t]=e.reverse())}const h=Dm.triangulateShape(l,u);for(let t=0,e=u.length;t<e;t++){const e=u[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){const e=l[t];r.push(e.x,e.y,0),i.push(0,0,1),o.push(e.x,e.y)}for(let t=0,e=h.length;t<e;t++){const e=h[t],r=e[0]+a,i=e[1]+a,o=e[2]+a;n.push(r,i,o),s+=3}}this.setIndex(n),this.setAttribute("position",new nh(r,3)),this.setAttribute("normal",new nh(i,3)),this.setAttribute("uv",new nh(o,2))}toJSON(){const t=ph.prototype.toJSON.call(this);return function(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,r=t.length;n<r;n++){const r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}}class km extends ph{constructor(t){if(super(),this.type="WireframeGeometry",!0===t.isGeometry)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const e=[],n=[0,0],r={},i=new bl;if(null!==t.index){const o=t.attributes.position,a=t.index;let s=t.groups;0===s.length&&(s=[{start:0,count:a.count,materialIndex:0}]);for(let t=0,e=s.length;t<e;++t){const e=s[t],i=e.start;for(let t=i,o=i+e.count;t<o;t+=3)for(let e=0;e<3;e++){const i=a.getX(t+e),o=a.getX(t+(e+1)%3);n[0]=Math.min(i,o),n[1]=Math.max(i,o);const s=n[0]+","+n[1];void 0===r[s]&&(r[s]={index1:n[0],index2:n[1]})}}for(const t in r){const n=r[t];i.fromBufferAttribute(o,n.index1),e.push(i.x,i.y,i.z),i.fromBufferAttribute(o,n.index2),e.push(i.x,i.y,i.z)}}else{const n=t.attributes.position;for(let t=0,r=n.count/3;t<r;t++)for(let r=0;r<3;r++){const o=3*t+r;i.fromBufferAttribute(n,o),e.push(i.x,i.y,i.z);const a=3*t+(r+1)%3;i.fromBufferAttribute(n,a),e.push(i.x,i.y,i.z)}}this.setAttribute("position",new nh(e,3))}}function Gm(t){ju.call(this),this.type="ShadowMaterial",this.color=new Hu(0),this.transparent=!0,this.setValues(t)}function jm(t){Uh.call(this,t),this.type="RawShaderMaterial"}function Wm(t){ju.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Hu(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Hu(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ll(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function Vm(t){Wm.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new ll(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=cl.clamp(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(t)}function qm(t){ju.call(this),this.type="MeshPhongMaterial",this.color=new Hu(16777215),this.specular=new Hu(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Hu(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ll(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ym(t){ju.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Hu(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Hu(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ll(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Xm(t){ju.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ll(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Zm(t){ju.call(this),this.type="MeshLambertMaterial",this.color=new Hu(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Hu(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Jm(t){ju.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Hu(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new ll(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Qm(t){kp.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Gm.prototype=Object.create(ju.prototype),Gm.prototype.constructor=Gm,Gm.prototype.isShadowMaterial=!0,Gm.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this},jm.prototype=Object.create(Uh.prototype),jm.prototype.constructor=jm,jm.prototype.isRawShaderMaterial=!0,Wm.prototype=Object.create(ju.prototype),Wm.prototype.constructor=Wm,Wm.prototype.isMeshStandardMaterial=!0,Wm.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},Vm.prototype=Object.create(Wm.prototype),Vm.prototype.constructor=Vm,Vm.prototype.isMeshPhysicalMaterial=!0,Vm.prototype.copy=function(t){return Wm.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new Hu).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this},qm.prototype=Object.create(ju.prototype),qm.prototype.constructor=qm,qm.prototype.isMeshPhongMaterial=!0,qm.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ym.prototype=Object.create(ju.prototype),Ym.prototype.constructor=Ym,Ym.prototype.isMeshToonMaterial=!0,Ym.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Xm.prototype=Object.create(ju.prototype),Xm.prototype.constructor=Xm,Xm.prototype.isMeshNormalMaterial=!0,Xm.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Zm.prototype=Object.create(ju.prototype),Zm.prototype.constructor=Zm,Zm.prototype.isMeshLambertMaterial=!0,Zm.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Jm.prototype=Object.create(ju.prototype),Jm.prototype.constructor=Jm,Jm.prototype.isMeshMatcapMaterial=!0,Jm.prototype.copy=function(t){return ju.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Qm.prototype=Object.create(kp.prototype),Qm.prototype.constructor=Qm,Qm.prototype.isLineDashedMaterial=!0,Qm.prototype.copy=function(t){return kp.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var $m=Object.freeze({__proto__:null,ShadowMaterial:Gm,SpriteMaterial:sp,RawShaderMaterial:jm,ShaderMaterial:Uh,PointsMaterial:$p,MeshPhysicalMaterial:Vm,MeshStandardMaterial:Wm,MeshPhongMaterial:qm,MeshToonMaterial:Ym,MeshNormalMaterial:Xm,MeshLambertMaterial:Zm,MeshDepthMaterial:Wf,MeshDistanceMaterial:Vf,MeshBasicMaterial:Wu,MeshMatcapMaterial:Jm,LineDashedMaterial:Qm,LineBasicMaterial:kp,Material:ju});const Km={arraySlice:function(t,e,n){return Km.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,n=new Array(e);for(let t=0;t!==e;++t)n[t]=t;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,a=0;a!==r;++o){const r=n[o]*e;for(let n=0;n!==e;++n)i[a++]=t[r+n]}return i},flattenJSON:function(t,e,n,r){let i=1,o=t[0];for(;void 0!==o&&void 0===o[r];)o=t[i++];if(void 0===o)return;let a=o[r];if(void 0!==a)if(Array.isArray(a))do{a=o[r],void 0!==a&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{a=o[r],void 0!==a&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{a=o[r],void 0!==a&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)},subclip:function(t,e,n,r,i=30){const o=t.clone();o.name=e;const a=[];for(let t=0;t<o.tracks.length;++t){const e=o.tracks[t],s=e.getValueSize(),c=[],l=[];for(let t=0;t<e.times.length;++t){const o=e.times[t]*i;if(!(o<n||o>=r)){c.push(e.times[t]);for(let n=0;n<s;++n)l.push(e.values[t*s+n])}}0!==c.length&&(e.times=Km.convertArray(c,e.times.constructor),e.values=Km.convertArray(l,e.values.constructor),a.push(e))}o.tracks=a;let s=1/0;for(let t=0;t<o.tracks.length;++t)s>o.tracks[t].times[0]&&(s=o.tracks[t].times[0]);for(let t=0;t<o.tracks.length;++t)o.tracks[t].shift(-1*s);return o.resetDuration(),o},makeClipAdditive:function(t,e=0,n=t,r=30){r<=0&&(r=30);const i=n.tracks.length,o=e/r;for(let e=0;e<i;++e){const r=n.tracks[e],i=r.ValueTypeName;if("bool"===i||"string"===i)continue;const a=t.tracks.find((function(t){return t.name===r.name&&t.ValueTypeName===i}));if(void 0===a)continue;let s=0;const c=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(s=c/3);let l=0;const u=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=u/3);const h=r.times.length-1;let d;if(o<=r.times[0]){const t=s,e=c-s;d=Km.arraySlice(r.values,t,e)}else if(o>=r.times[h]){const t=h*c+s,e=t+c-s;d=Km.arraySlice(r.values,t,e)}else{const t=r.createInterpolant(),e=s,n=c-s;t.evaluate(o),d=Km.arraySlice(t.resultBuffer,e,n)}if("quaternion"===i){(new yl).fromArray(d).normalize().conjugate().toArray(d)}const f=a.times.length;for(let t=0;t<f;++t){const e=t*u+l;if("quaternion"===i)yl.multiplyQuaternionsFlat(a.values,e,d,0,a.values,e);else{const t=u-2*l;for(let n=0;n<t;++n)a.values[e+n]-=d[n]}}}return t.blendMode=2501,t}};function tg(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function eg(t,e,n,r){tg.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ng(t,e,n,r){tg.call(this,t,e,n,r)}function rg(t,e,n,r){tg.call(this,t,e,n,r)}function ig(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Km.convertArray(e,this.TimeBufferType),this.values=Km.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function og(t,e,n){ig.call(this,t,e,n)}function ag(t,e,n,r){ig.call(this,t,e,n,r)}function sg(t,e,n,r){ig.call(this,t,e,n,r)}function cg(t,e,n,r){tg.call(this,t,e,n,r)}function lg(t,e,n,r){ig.call(this,t,e,n,r)}function ug(t,e,n,r){ig.call(this,t,e,n,r)}function hg(t,e,n,r){ig.call(this,t,e,n,r)}function dg(t,e=-1,n,r=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=r,this.uuid=cl.generateUUID(),this.duration<0&&this.resetDuration()}function fg(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return sg;case"vector":case"vector2":case"vector3":case"vector4":return hg;case"color":return ag;case"quaternion":return lg;case"bool":case"boolean":return og;case"string":return ug}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],n=[];Km.flattenJSON(t.keys,e,n,"value"),t.times=e,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(tg.prototype,{evaluate:function(t){const e=this.parameterPositions;let n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{let o;n:{r:if(!(t<r)){for(let o=n+2;;){if(void 0===r){if(t<i)break r;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,i)}if(n===o)break;if(i=r,r=e[++n],t<r)break e}o=e.length;break n}if(t>=i)break t;{const a=e[1];t<a&&(n=2,i=a);for(let o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===o)break;if(r=i,i=e[--n-1],t>=i)break e}o=n,n=0}}for(;n<o;){const r=n+o>>>1;t<e[r]?o=r:n=r+1}if(r=e[n],i=e[n-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,i,t)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){const e=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=t*r;for(let t=0;t!==r;++t)e[t]=n[i+t];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(tg.prototype,{beforeStart_:tg.prototype.copySampleValue_,afterEnd_:tg.prototype.copySampleValue_}),eg.prototype=Object.assign(Object.create(tg.prototype),{constructor:eg,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,e,n){const r=this.parameterPositions;let i=t-2,o=t+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:i=t,a=2*e-n;break;case 2402:i=r.length-2,a=e+r[i]-r[i+1];break;default:i=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:o=t,s=2*n-e;break;case 2402:o=1,s=n+r[1]-r[0];break;default:o=t-1,s=e}const c=.5*(n-e),l=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=o*l},interpolate_:function(t,e,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(n-e)/(r-e),p=f*f,m=p*f,g=-h*m+2*h*p-h*f,v=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,y=(-1-d)*m+(1.5+d)*p+.5*f,b=d*m-d*p;for(let t=0;t!==a;++t)i[t]=g*o[l+t]+v*o[c+t]+y*o[s+t]+b*o[u+t];return i}}),ng.prototype=Object.assign(Object.create(tg.prototype),{constructor:ng,interpolate_:function(t,e,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,l=(n-e)/(r-e),u=1-l;for(let t=0;t!==a;++t)i[t]=o[c+t]*u+o[s+t]*l;return i}}),rg.prototype=Object.assign(Object.create(tg.prototype),{constructor:rg,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(ig,{toJSON:function(t){const e=t.constructor;let n;if(void 0!==e.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Km.convertArray(t.times,Array),values:Km.convertArray(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(n.interpolation=e)}return n.type=t.ValueTypeName,n}}),Object.assign(ig.prototype,{constructor:ig,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new rg(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new ng(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new eg(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]+=t}return this},scale:function(t){if(1!==t){const e=this.times;for(let n=0,r=e.length;n!==r;++n)e[n]*=t}return this},trim:function(t,e){const n=this.times,r=n.length;let i=0,o=r-1;for(;i!==r&&n[i]<t;)++i;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==i||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const t=this.getValueSize();this.times=Km.arraySlice(n,i,o),this.values=Km.arraySlice(this.values,i*t,o*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let e=0;e!==i;e++){const r=n[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==o&&o>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,o),t=!1;break}o=r}if(void 0!==r&&Km.isTypedArray(r))for(let e=0,n=r.length;e!==n;++e){const n=r[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t},optimize:function(){const t=Km.arraySlice(this.times),e=Km.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=t.length-1;let o=1;for(let a=1;a<i;++a){let i=!1;const s=t[a];if(s!==t[a+1]&&(1!==a||s!==t[0]))if(r)i=!0;else{const t=a*n,r=t-n,o=t+n;for(let a=0;a!==n;++a){const n=e[t+a];if(n!==e[r+a]||n!==e[o+a]){i=!0;break}}}if(i){if(a!==o){t[o]=t[a];const r=a*n,i=o*n;for(let t=0;t!==n;++t)e[i+t]=e[r+t]}++o}}if(i>0){t[o]=t[i];for(let t=i*n,r=o*n,a=0;a!==n;++a)e[r+a]=e[t+a];++o}return o!==t.length?(this.times=Km.arraySlice(t,0,o),this.values=Km.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this},clone:function(){const t=Km.arraySlice(this.times,0),e=Km.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),og.prototype=Object.assign(Object.create(ig.prototype),{constructor:og,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ag.prototype=Object.assign(Object.create(ig.prototype),{constructor:ag,ValueTypeName:"color"}),sg.prototype=Object.assign(Object.create(ig.prototype),{constructor:sg,ValueTypeName:"number"}),cg.prototype=Object.assign(Object.create(tg.prototype),{constructor:cg,interpolate_:function(t,e,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-e)/(r-e);let c=t*a;for(let t=c+a;c!==t;c+=4)yl.slerpFlat(i,0,o,c-a,o,c,s);return i}}),lg.prototype=Object.assign(Object.create(ig.prototype),{constructor:lg,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new cg(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),ug.prototype=Object.assign(Object.create(ig.prototype),{constructor:ug,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),hg.prototype=Object.assign(Object.create(ig.prototype),{constructor:hg,ValueTypeName:"vector"}),Object.assign(dg,{parse:function(t){const e=[],n=t.tracks,r=1/(t.fps||1);for(let t=0,i=n.length;t!==i;++t)e.push(fg(n[t]).scale(r));const i=new dg(t.name,t.duration,e,t.blendMode);return i.uuid=t.uuid,i},toJSON:function(t){const e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,r=n.length;t!==r;++t)e.push(ig.toJSON(n[t]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){const i=e.length,o=[];for(let t=0;t<i;t++){let a=[],s=[];a.push((t+i-1)%i,t,(t+1)%i),s.push(0,1,0);const c=Km.getKeyframeOrder(a);a=Km.sortedArray(a,1,c),s=Km.sortedArray(s,1,c),r||0!==a[0]||(a.push(i),s.push(s[0])),o.push(new sg(".morphTargetInfluences["+e[t].name+"]",a,s).scale(1/n))}return new dg(t,-1,o)},findByName:function(t,e){let n=t;if(!Array.isArray(t)){const e=t;n=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<n.length;t++)if(n[t].name===e)return n[t];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let e=0,n=t.length;e<n;e++){const n=t[e],o=n.name.match(i);if(o&&o.length>1){const t=o[1];let e=r[t];e||(r[t]=e=[]),e.push(n)}}const o=[];for(const t in r)o.push(dg.CreateFromMorphTargetSequence(t,r[t],e,n));return o},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,r,i){if(0!==n.length){const o=[],a=[];Km.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.fps||30,a=t.blendMode;let s=t.length||-1;const c=t.hierarchy||[];for(let t=0;t<c.length;t++){const i=c[t].keys;if(i&&0!==i.length)if(i[0].morphTargets){const t={};let e;for(e=0;e<i.length;e++)if(i[e].morphTargets)for(let n=0;n<i[e].morphTargets.length;n++)t[i[e].morphTargets[n]]=-1;for(const n in t){const t=[],o=[];for(let r=0;r!==i[e].morphTargets.length;++r){const r=i[e];t.push(r.time),o.push(r.morphTarget===n?1:0)}r.push(new sg(".morphTargetInfluence["+n+"]",t,o))}s=t.length*(o||1)}else{const o=".bones["+e[t].name+"]";n(hg,o+".position",i,"pos",r),n(lg,o+".quaternion",i,"rot",r),n(hg,o+".scale",i,"scl",r)}}if(0===r.length)return null;return new dg(i,s,r,a)}}),Object.assign(dg.prototype,{resetDuration:function(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this},trim:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new dg(this.name,this.duration,t,this.blendMode)},toJSON:function(){return dg.toJSON(this)}});const pg={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function mg(t,e,n){const r=this;let i=!1,o=0,a=0,s=void 0;const c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===i&&void 0!==r.onStart&&r.onStart(t,o,a),i=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,a),o===a&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){const e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=c.length;e<n;e+=2){const n=c[e],r=c[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}const gg=new mg;function vg(t){this.manager=void 0!==t?t:gg,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(vg.prototype,{load:function(){},loadAsync:function(t,e){const n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});const yg={};function bg(t){vg.call(this,t)}function xg(t){vg.call(this,t)}function _g(t){vg.call(this,t)}function wg(t){vg.call(this,t)}function Mg(t){vg.call(this,t)}function Sg(t){vg.call(this,t)}function Tg(t){vg.call(this,t)}function Eg(){this.type="Curve",this.arcLengthDivisions=200}function Ag(t,e,n,r,i,o,a,s){Eg.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function Lg(t,e,n,r,i,o){Ag.call(this,t,e,n,n,r,i,o),this.type="ArcCurve"}function Cg(){let t=0,e=0,n=0,r=0;function i(i,o,a,s){t=i,e=a,n=-3*i+3*o-2*a-s,r=2*i-2*o+a+s}return{initCatmullRom:function(t,e,n,r,o){i(e,n,o*(n-t),o*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,o,a,s){let c=(e-t)/o-(n-t)/(o+a)+(n-e)/a,l=(n-e)/a-(r-e)/(a+s)+(r-n)/s;c*=a,l*=a,i(e,n,c,l)},calc:function(i){const o=i*i;return t+e*i+n*o+r*(o*i)}}}bg.prototype=Object.assign(Object.create(vg.prototype),{constructor:bg,load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,o=pg.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;if(void 0!==yg[t])return void yg[t].push({onLoad:e,onProgress:n,onError:r});const a=t.match(/^data:(.*?)(;base64)?,(.*)$/);let s;if(a){const n=a[1],o=!!a[2];let s=a[3];s=decodeURIComponent(s),o&&(s=atob(s));try{let r;const o=(this.responseType||"").toLowerCase();switch(o){case"arraybuffer":case"blob":const t=new Uint8Array(s.length);for(let e=0;e<s.length;e++)t[e]=s.charCodeAt(e);r="blob"===o?new Blob([t.buffer],{type:n}):t.buffer;break;case"document":const e=new DOMParser;r=e.parseFromString(s,n);break;case"json":r=JSON.parse(s);break;default:r=s}setTimeout((function(){e&&e(r),i.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),0)}}else{yg[t]=[],yg[t].push({onLoad:e,onProgress:n,onError:r}),s=new XMLHttpRequest,s.open("GET",t,!0),s.addEventListener("load",(function(e){const n=this.response,r=yg[t];if(delete yg[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),pg.add(t,n);for(let t=0,e=r.length;t<e;t++){const e=r[t];e.onLoad&&e.onLoad(n)}i.manager.itemEnd(t)}else{for(let t=0,n=r.length;t<n;t++){const n=r[t];n.onError&&n.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}}),!1),s.addEventListener("progress",(function(e){const n=yg[t];for(let t=0,r=n.length;t<r;t++){const r=n[t];r.onProgress&&r.onProgress(e)}}),!1),s.addEventListener("error",(function(e){const n=yg[t];delete yg[t];for(let t=0,r=n.length;t<r;t++){const r=n[t];r.onError&&r.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}),!1),s.addEventListener("abort",(function(e){const n=yg[t];delete yg[t];for(let t=0,r=n.length;t<r;t++){const r=n[t];r.onError&&r.onError(e)}i.manager.itemError(t),i.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(s.responseType=this.responseType),void 0!==this.withCredentials&&(s.withCredentials=this.withCredentials),s.overrideMimeType&&s.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(const t in this.requestHeader)s.setRequestHeader(t,this.requestHeader[t]);s.send(null)}return i.manager.itemStart(t),s},setResponseType:function(t){return this.responseType=t,this},setMimeType:function(t){return this.mimeType=t,this}}),xg.prototype=Object.assign(Object.create(vg.prototype),{constructor:xg,load:function(t,e,n,r){const i=this,o=new bg(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){const e=[];for(let n=0;n<t.length;n++){const r=dg.parse(t[n]);e.push(r)}return e}}),_g.prototype=Object.assign(Object.create(vg.prototype),{constructor:_g,load:function(t,e,n,r){const i=this,o=[],a=new am,s=new bg(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(i.withCredentials);let c=0;function l(l){s.load(t[l],(function(t){const n=i.parse(t,!0);o[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},c+=1,6===c&&(1===n.mipmapCount&&(a.minFilter=1006),a.image=o,a.format=n.format,a.needsUpdate=!0,e&&e(a))}),n,r)}if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)l(e);else s.load(t,(function(t){const n=i.parse(t,!0);if(n.isCubemap){const t=n.mipmaps.length/n.mipmapCount;for(let e=0;e<t;e++){o[e]={mipmaps:[]};for(let t=0;t<n.mipmapCount;t++)o[e].mipmaps.push(n.mipmaps[e*n.mipmapCount+t]),o[e].format=n.format,o[e].width=n.width,o[e].height=n.height}a.image=o}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=1006),a.format=n.format,a.needsUpdate=!0,e&&e(a)}),n,r);return a}}),wg.prototype=Object.assign(Object.create(vg.prototype),{constructor:wg,load:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,o=pg.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;const a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),pg.add(t,this),e&&e(this),i.manager.itemEnd(t)}function c(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",c,!1),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",c,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(t),a.src=t,a}}),Mg.prototype=Object.assign(Object.create(vg.prototype),{constructor:Mg,load:function(t,e,n,r){const i=new Gh,o=new wg(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function s(n){o.load(t[n],(function(t){i.images[n]=t,a++,6===a&&(i.needsUpdate=!0,e&&e(i))}),void 0,r)}for(let e=0;e<t.length;++e)s(e);return i}}),Sg.prototype=Object.assign(Object.create(vg.prototype),{constructor:Sg,load:function(t,e,n,r){const i=this,o=new Wh,a=new bg(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(i.withCredentials),a.load(t,(function(t){const n=i.parse(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:1001,o.wrapT=void 0!==n.wrapT?n.wrapT:1001,o.magFilter=void 0!==n.magFilter?n.magFilter:1006,o.minFilter=void 0!==n.minFilter?n.minFilter:1006,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(o.encoding=n.encoding),void 0!==n.flipY&&(o.flipY=n.flipY),void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=1008),1===n.mipmapCount&&(o.minFilter=1006),o.needsUpdate=!0,e&&e(o,n))}),n,r),o}}),Tg.prototype=Object.assign(Object.create(vg.prototype),{constructor:Tg,load:function(t,e,n,r){const i=new pl,o=new wg(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){i.image=n;const r=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}),Object.assign(Eg.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),i=0;e.push(0);for(let o=1;o<=t;o++)n=this.getPoint(o/t),i+=n.distanceTo(r),e.push(i),r=n;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const n=this.getLengths();let r=0;const i=n.length;let o;o=e||t*n[i-1];let a,s=0,c=i-1;for(;s<=c;)if(r=Math.floor(s+(c-s)/2),a=n[r]-o,a<0)s=r+1;else{if(!(a>0)){c=r;break}c=r-1}if(r=c,n[r]===o)return r/(i-1);const l=n[r];return(r+(o-l)/(n[r+1]-l))/(i-1)},getTangent:function(t,e){let n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);const i=this.getPoint(n),o=this.getPoint(r),a=e||(i.isVector2?new ll:new bl);return a.copy(o).sub(i).normalize(),a},getTangentAt:function(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){const n=new bl,r=[],i=[],o=[],a=new bl,s=new Yl;for(let e=0;e<=t;e++){const n=e/t;r[e]=this.getTangentAt(n,new bl),r[e].normalize()}i[0]=new bl,o[0]=new bl;let c=Number.MAX_VALUE;const l=Math.abs(r[0].x),u=Math.abs(r[0].y),h=Math.abs(r[0].z);l<=c&&(c=l,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),h<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(let e=1;e<=t;e++){if(i[e]=i[e-1].clone(),o[e]=o[e-1].clone(),a.crossVectors(r[e-1],r[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(cl.clamp(r[e-1].dot(r[e]),-1,1));i[e].applyMatrix4(s.makeRotationAxis(a,t))}o[e].crossVectors(r[e],i[e])}if(!0===e){let e=Math.acos(cl.clamp(i[0].dot(i[t]),-1,1));e/=t,r[0].dot(a.crossVectors(i[0],i[t]))>0&&(e=-e);for(let n=1;n<=t;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],e*n)),o[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Ag.prototype=Object.create(Eg.prototype),Ag.prototype.constructor=Ag,Ag.prototype.isEllipseCurve=!0,Ag.prototype.getPoint=function(t,e){const n=e||new ll,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=o?0:r),!0!==this.aClockwise||o||(i===r?i=-r:i-=r);const a=this.aStartAngle+t*i;let s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=s-this.aX,r=c-this.aY;s=n*t-r*e+this.aX,c=n*e+r*t+this.aY}return n.set(s,c)},Ag.prototype.copy=function(t){return Eg.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Ag.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Ag.prototype.fromJSON=function(t){return Eg.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Lg.prototype=Object.create(Ag.prototype),Lg.prototype.constructor=Lg,Lg.prototype.isArcCurve=!0;const Rg=new bl,Pg=new Cg,Ng=new Cg,zg=new Cg;function Dg(t=[],e=!1,n="centripetal",r=.5){Eg.call(this),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}function Ig(t,e,n,r,i){const o=.5*(r-e),a=.5*(i-n),s=t*t;return(2*n-2*r+o+a)*(t*s)+(-3*n+3*r-2*o-a)*s+o*t+n}function Og(t,e,n,r){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function Fg(t,e,n,r,i){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}function Ug(t=new ll,e=new ll,n=new ll,r=new ll){Eg.call(this),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}function Bg(t=new bl,e=new bl,n=new bl,r=new bl){Eg.call(this),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}function Hg(t=new ll,e=new ll){Eg.call(this),this.type="LineCurve",this.v1=t,this.v2=e}function kg(t=new bl,e=new bl){Eg.call(this),this.type="LineCurve3",this.v1=t,this.v2=e}function Gg(t=new ll,e=new ll,n=new ll){Eg.call(this),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}function jg(t=new bl,e=new bl,n=new bl){Eg.call(this),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}function Wg(t=[]){Eg.call(this),this.type="SplineCurve",this.points=t}Dg.prototype=Object.create(Eg.prototype),Dg.prototype.constructor=Dg,Dg.prototype.isCatmullRomCurve3=!0,Dg.prototype.getPoint=function(t,e=new bl){const n=e,r=this.points,i=r.length,o=(i-(this.closed?0:1))*t;let a,s,c=Math.floor(o),l=o-c;this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/i)+1)*i:0===l&&c===i-1&&(c=i-2,l=1),this.closed||c>0?a=r[(c-1)%i]:(Rg.subVectors(r[0],r[1]).add(r[0]),a=Rg);const u=r[c%i],h=r[(c+1)%i];if(this.closed||c+2<i?s=r[(c+2)%i]:(Rg.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=Rg),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(a.distanceToSquared(u),t),n=Math.pow(u.distanceToSquared(h),t),r=Math.pow(h.distanceToSquared(s),t);n<1e-4&&(n=1),e<1e-4&&(e=n),r<1e-4&&(r=n),Pg.initNonuniformCatmullRom(a.x,u.x,h.x,s.x,e,n,r),Ng.initNonuniformCatmullRom(a.y,u.y,h.y,s.y,e,n,r),zg.initNonuniformCatmullRom(a.z,u.z,h.z,s.z,e,n,r)}else"catmullrom"===this.curveType&&(Pg.initCatmullRom(a.x,u.x,h.x,s.x,this.tension),Ng.initCatmullRom(a.y,u.y,h.y,s.y,this.tension),zg.initCatmullRom(a.z,u.z,h.z,s.z,this.tension));return n.set(Pg.calc(l),Ng.calc(l),zg.calc(l)),n},Dg.prototype.copy=function(t){Eg.prototype.copy.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Dg.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Dg.prototype.fromJSON=function(t){Eg.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new bl).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ug.prototype=Object.create(Eg.prototype),Ug.prototype.constructor=Ug,Ug.prototype.isCubicBezierCurve=!0,Ug.prototype.getPoint=function(t,e=new ll){const n=e,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Fg(t,r.x,i.x,o.x,a.x),Fg(t,r.y,i.y,o.y,a.y)),n},Ug.prototype.copy=function(t){return Eg.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ug.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ug.prototype.fromJSON=function(t){return Eg.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Bg.prototype=Object.create(Eg.prototype),Bg.prototype.constructor=Bg,Bg.prototype.isCubicBezierCurve3=!0,Bg.prototype.getPoint=function(t,e=new bl){const n=e,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Fg(t,r.x,i.x,o.x,a.x),Fg(t,r.y,i.y,o.y,a.y),Fg(t,r.z,i.z,o.z,a.z)),n},Bg.prototype.copy=function(t){return Eg.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Bg.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Bg.prototype.fromJSON=function(t){return Eg.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Hg.prototype=Object.create(Eg.prototype),Hg.prototype.constructor=Hg,Hg.prototype.isLineCurve=!0,Hg.prototype.getPoint=function(t,e=new ll){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Hg.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Hg.prototype.getTangent=function(t,e){const n=e||new ll;return n.copy(this.v2).sub(this.v1).normalize(),n},Hg.prototype.copy=function(t){return Eg.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Hg.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Hg.prototype.fromJSON=function(t){return Eg.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},kg.prototype=Object.create(Eg.prototype),kg.prototype.constructor=kg,kg.prototype.isLineCurve3=!0,kg.prototype.getPoint=function(t,e=new bl){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},kg.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},kg.prototype.copy=function(t){return Eg.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},kg.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},kg.prototype.fromJSON=function(t){return Eg.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Gg.prototype=Object.create(Eg.prototype),Gg.prototype.constructor=Gg,Gg.prototype.isQuadraticBezierCurve=!0,Gg.prototype.getPoint=function(t,e=new ll){const n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(Og(t,r.x,i.x,o.x),Og(t,r.y,i.y,o.y)),n},Gg.prototype.copy=function(t){return Eg.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Gg.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Gg.prototype.fromJSON=function(t){return Eg.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},jg.prototype=Object.create(Eg.prototype),jg.prototype.constructor=jg,jg.prototype.isQuadraticBezierCurve3=!0,jg.prototype.getPoint=function(t,e=new bl){const n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(Og(t,r.x,i.x,o.x),Og(t,r.y,i.y,o.y),Og(t,r.z,i.z,o.z)),n},jg.prototype.copy=function(t){return Eg.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},jg.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},jg.prototype.fromJSON=function(t){return Eg.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Wg.prototype=Object.create(Eg.prototype),Wg.prototype.constructor=Wg,Wg.prototype.isSplineCurve=!0,Wg.prototype.getPoint=function(t,e=new ll){const n=e,r=this.points,i=(r.length-1)*t,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],c=r[o],l=r[o>r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(Ig(a,s.x,c.x,l.x,u.x),Ig(a,s.y,c.y,l.y,u.y)),n},Wg.prototype.copy=function(t){Eg.prototype.copy.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this},Wg.prototype.toJSON=function(){const t=Eg.prototype.toJSON.call(this);t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t},Wg.prototype.fromJSON=function(t){Eg.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new ll).fromArray(n))}return this};var Vg=Object.freeze({__proto__:null,ArcCurve:Lg,CatmullRomCurve3:Dg,CubicBezierCurve:Ug,CubicBezierCurve3:Bg,EllipseCurve:Ag,LineCurve:Hg,LineCurve3:kg,QuadraticBezierCurve:Gg,QuadraticBezierCurve3:jg,SplineCurve:Wg});function qg(){Eg.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Yg(t){qg.call(this),this.type="Path",this.currentPoint=new ll,t&&this.setFromPoints(t)}function Xg(t){Yg.call(this,t),this.uuid=cl.generateUUID(),this.type="Shape",this.holes=[]}function Zg(t,e=1){yu.call(this),this.type="Light",this.color=new Hu(t),this.intensity=e}function Jg(t,e,n){Zg.call(this,t,n),this.type="HemisphereLight",this.position.copy(yu.DefaultUp),this.updateMatrix(),this.groundColor=new Hu(e)}function Qg(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new ll(512,512),this.map=null,this.mapPass=null,this.matrix=new Yl,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Yh,this._frameExtents=new ll(1,1),this._viewportCount=1,this._viewports=[new gl(0,0,1,1)]}function $g(){Qg.call(this,new Hh(50,1,.5,500)),this.focus=1}function Kg(t,e,n,r,i,o){Zg.call(this,t,e),this.type="SpotLight",this.position.copy(yu.DefaultUp),this.updateMatrix(),this.target=new yu,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new $g}function tv(){Qg.call(this,new Hh(90,1,.5,500)),this._frameExtents=new ll(4,2),this._viewportCount=6,this._viewports=[new gl(2,1,1,1),new gl(0,1,1,1),new gl(3,1,1,1),new gl(1,1,1,1),new gl(3,0,1,1),new gl(1,0,1,1)],this._cubeDirections=[new bl(1,0,0),new bl(-1,0,0),new bl(0,0,1),new bl(0,0,-1),new bl(0,1,0),new bl(0,-1,0)],this._cubeUps=[new bl(0,1,0),new bl(0,1,0),new bl(0,1,0),new bl(0,1,0),new bl(0,0,1),new bl(0,0,-1)]}function ev(t,e,n,r){Zg.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new tv}function nv(t=-1,e=1,n=1,r=-1,i=.1,o=2e3){Bh.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=i,this.far=o,this.updateProjectionMatrix()}function rv(){Qg.call(this,new nv(-5,5,5,-5,.5,500))}function iv(t,e){Zg.call(this,t,e),this.type="DirectionalLight",this.position.copy(yu.DefaultUp),this.updateMatrix(),this.target=new yu,this.shadow=new rv}function ov(t,e){Zg.call(this,t,e),this.type="AmbientLight"}function av(t,e,n,r){Zg.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}qg.prototype=Object.assign(Object.create(Eg.prototype),{constructor:qg,add:function(t){this.curves.push(t)},closePath:function(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Hg(e,t))},getPoint:function(t){const e=t*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=e){const t=n[r]-e,i=this.curves[r],o=i.getLength(),a=0===o?0:1-t/o;return i.getPointAt(a)}r++}return null},getLength:function(){const t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t=12){const e=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const o=i[r],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a);for(let t=0;t<s.length;t++){const r=s[t];n&&n.equals(r)||(e.push(r),n=r)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Eg.prototype.copy.call(this,t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){const t=Eg.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t},fromJSON:function(t){Eg.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Vg[n.type]).fromJSON(n))}return this}}),Yg.prototype=Object.assign(Object.create(qg.prototype),{constructor:Yg,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){const n=new Hg(this.currentPoint.clone(),new ll(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,r){const i=new Gg(this.currentPoint.clone(),new ll(t,e),new ll(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(t,e,n,r,i,o){const a=new Ug(this.currentPoint.clone(),new ll(t,e),new ll(n,r),new ll(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this},splineThru:function(t){const e=new Wg([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,r,i,o){const a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+a,e+s,n,r,i,o),this},absarc:function(t,e,n,r,i,o){return this.absellipse(t,e,n,n,r,i,o),this},ellipse:function(t,e,n,r,i,o,a,s){const c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+c,e+l,n,r,i,o,a,s),this},absellipse:function(t,e,n,r,i,o,a,s){const c=new Ag(t,e,n,r,i,o,a,s);if(this.curves.length>0){const t=c.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(c);const l=c.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return qg.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=qg.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return qg.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Xg.prototype=Object.assign(Object.create(Yg.prototype),{constructor:Xg,getPointsHoles:function(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Yg.prototype.copy.call(this,t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this},toJSON:function(){const t=Yg.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t},fromJSON:function(t){Yg.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new Yg).fromJSON(n))}return this}}),Zg.prototype=Object.assign(Object.create(yu.prototype),{constructor:Zg,isLight:!0,copy:function(t){return yu.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){const e=yu.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Jg.prototype=Object.assign(Object.create(Zg.prototype),{constructor:Jg,isHemisphereLight:!0,copy:function(t){return Zg.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Qg.prototype,{_projScreenMatrix:new Yl,_lightPositionWorld:new bl,_lookTarget:new bl,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){const e=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,o=this._lightPositionWorld;o.setFromMatrixPosition(t.matrixWorld),e.position.copy(o),i.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(i),e.updateMatrixWorld(),r.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),$g.prototype=Object.assign(Object.create(Qg.prototype),{constructor:$g,isSpotLightShadow:!0,updateMatrices:function(t){const e=this.camera,n=2*cl.RAD2DEG*t.angle*this.focus,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix()),Qg.prototype.updateMatrices.call(this,t)}}),Kg.prototype=Object.assign(Object.create(Zg.prototype),{constructor:Kg,isSpotLight:!0,copy:function(t){return Zg.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),tv.prototype=Object.assign(Object.create(Qg.prototype),{constructor:tv,isPointLightShadow:!0,updateMatrices:function(t,e=0){const n=this.camera,r=this.matrix,i=this._lightPositionWorld,o=this._lookTarget,a=this._projScreenMatrix;i.setFromMatrixPosition(t.matrixWorld),n.position.copy(i),o.copy(n.position),o.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(o),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),a.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(a)}}),ev.prototype=Object.assign(Object.create(Zg.prototype),{constructor:ev,isPointLight:!0,copy:function(t){return Zg.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),nv.prototype=Object.assign(Object.create(Bh.prototype),{constructor:nv,isOrthographicCamera:!0,copy:function(t,e){return Bh.prototype.copy.call(this,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=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,r,i,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-t,o=n+t,a=r+e,s=r-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=t*this.view.offsetX,o=i+t*this.view.width,a-=e*this.view.offsetY,s=a-e*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=yu.prototype.toJSON.call(this,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,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),rv.prototype=Object.assign(Object.create(Qg.prototype),{constructor:rv,isDirectionalLightShadow:!0,updateMatrices:function(t){Qg.prototype.updateMatrices.call(this,t)}}),iv.prototype=Object.assign(Object.create(Zg.prototype),{constructor:iv,isDirectionalLight:!0,copy:function(t){return Zg.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),ov.prototype=Object.assign(Object.create(Zg.prototype),{constructor:ov,isAmbientLight:!0}),av.prototype=Object.assign(Object.create(Zg.prototype),{constructor:av,isRectAreaLight:!0,copy:function(t){return Zg.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){const e=Zg.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});class sv{constructor(){Object.defineProperty(this,"isSphericalHarmonics3",{value:!0}),this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new bl)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*r),e.addScaledVector(o[2],.488603*i),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*r*1.092548),e.addScaledVector(o[5],r*i*1.092548),e.addScaledVector(o[6],.315392*(3*i*i-1)),e.addScaledVector(o[7],n*i*1.092548),e.addScaledVector(o[8],.546274*(n*n-r*r)),e}getIrradianceAt(t,e){const n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*r),e.addScaledVector(o[2],1.023328*i),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*r),e.addScaledVector(o[5],.858086*r*i),e.addScaledVector(o[6],.743125*i*i-.247708),e.addScaledVector(o[7],.858086*n*i),e.addScaledVector(o[8],.429043*(n*n-r*r)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this}toArray(t=[],e=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}static getBasisAt(t,e){const n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)}}function cv(t,e){Zg.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new sv}function lv(t){vg.call(this,t),this.textures={}}cv.prototype=Object.assign(Object.create(Zg.prototype),{constructor:cv,isLightProbe:!0,copy:function(t){return Zg.prototype.copy.call(this,t),this.sh.copy(t.sh),this},fromJSON:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},toJSON:function(t){const e=Zg.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),lv.prototype=Object.assign(Object.create(vg.prototype),{constructor:lv,load:function(t,e,n,r){const i=this,o=new bg(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){const e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const r=new $m[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&void 0!==r.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.sheen&&(r.sheen=(new Hu).setHex(t.sheen)),void 0!==t.emissive&&void 0!==r.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==r.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearcoat&&(r.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(r.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const i=t.uniforms[e];switch(r.uniforms[e]={},i.type){case"t":r.uniforms[e].value=n(i.value);break;case"c":r.uniforms[e].value=(new Hu).setHex(i.value);break;case"v2":r.uniforms[e].value=(new ll).fromArray(i.value);break;case"v3":r.uniforms[e].value=(new bl).fromArray(i.value);break;case"v4":r.uniforms[e].value=(new gl).fromArray(i.value);break;case"m3":r.uniforms[e].value=(new ul).fromArray(i.value);break;case"m4":r.uniforms[e].value=(new Yl).fromArray(i.value);break;default:r.uniforms[e].value=i.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const e in t.extensions)r.extensions[e]=t.extensions[e];if(void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=n(t.map)),void 0!==t.matcap&&(r.matcap=n(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(r.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),r.normalScale=(new ll).fromArray(e)}return void 0!==t.displacementMap&&(r.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=n(t.specularMap)),void 0!==t.envMap&&(r.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(r.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(r.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(r.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new ll).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(r.transmission=t.transmission),void 0!==t.transmissionMap&&(r.transmissionMap=n(t.transmissionMap)),r},setTextures:function(t){return this.textures=t,this}});const uv=function(t){const e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)};function hv(){ph.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function dv(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Yu.call(this,t,e,n),this.meshPerAttribute=r||1}function fv(t){vg.call(this,t)}hv.prototype=Object.assign(Object.create(ph.prototype),{constructor:hv,isInstancedBufferGeometry:!0,copy:function(t){return ph.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const t=ph.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),dv.prototype=Object.assign(Object.create(Yu.prototype),{constructor:dv,isInstancedBufferAttribute:!0,copy:function(t){return Yu.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){const t=Yu.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),fv.prototype=Object.assign(Object.create(vg.prototype),{constructor:fv,load:function(t,e,n,r){const i=this,o=new bg(i.manager);o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){const e={},n={};function r(t,r){if(void 0!==e[r])return e[r];const i=t.interleavedBuffers[r],o=function(t,e){if(void 0!==n[e])return n[e];const r=t.arrayBuffers[e],i=new Uint32Array(r).buffer;return n[e]=i,i}(t,i.buffer),a=new ip(ah(i.type,o),i.stride);return a.uuid=i.uuid,e[r]=a,a}const i=t.isInstancedBufferGeometry?new hv:new ph,o=t.data.index;if(void 0!==o){const t=ah(o.type,o.array);i.setIndex(new Yu(t,1))}const a=t.data.attributes;for(const e in a){const n=a[e];let o;if(n.isInterleavedBufferAttribute){o=new ap(r(t.data,n.data),n.itemSize,n.offset,n.normalized)}else{const t=ah(n.type,n.array);o=new(n.isInstancedBufferAttribute?dv:Yu)(t,n.itemSize,n.normalized)}void 0!==n.name&&(o.name=n.name),i.setAttribute(e,o)}const s=t.data.morphAttributes;if(s)for(const e in s){const n=s[e],o=[];for(let e=0,i=n.length;e<i;e++){const i=n[e];let a;if(i.isInterleavedBufferAttribute){a=new ap(r(t.data,i.data),i.itemSize,i.offset,i.normalized)}else{a=new Yu(ah(i.type,i.array),i.itemSize,i.normalized)}void 0!==i.name&&(a.name=i.name),o.push(a)}i.morphAttributes[e]=o}t.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const c=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==c)for(let t=0,e=c.length;t!==e;++t){const e=c[t];i.addGroup(e.start,e.count,e.materialIndex)}const l=t.data.boundingSphere;if(void 0!==l){const t=new bl;void 0!==l.center&&t.fromArray(l.center),i.boundingSphere=new Ul(t,l.radius)}return t.name&&(i.name=t.name),t.userData&&(i.userData=t.userData),i}});function pv(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),vg.call(this,t),this.options={premultiplyAlpha:"none"}}function mv(){this.type="ShapePath",this.color=new Hu,this.subPaths=[],this.currentPath=null}pv.prototype=Object.assign(Object.create(vg.prototype),{constructor:pv,isImageBitmapLoader:!0,setOptions:function(t){return this.options=t,this},load:function(t,e,n,r){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,o=pg.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;const a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",fetch(t,a).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,i.options)})).then((function(n){pg.add(t,n),e&&e(n),i.manager.itemEnd(t)})).catch((function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)})),i.manager.itemStart(t)}}),Object.assign(mv.prototype,{moveTo:function(t,e){return this.currentPath=new Yg,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this},bezierCurveTo:function(t,e,n,r,i,o){return this.currentPath.bezierCurveTo(t,e,n,r,i,o),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n],i=new Xg;i.curves=r.curves,e.push(i)}return e}function r(t,e){const n=e.length;let r=!1;for(let i=n-1,o=0;o<n;i=o++){let n=e[i],a=e[o],s=a.x-n.x,c=a.y-n.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(n=e[o],s=-s,a=e[i],c=-c),t.y<n.y||t.y>a.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=c*(t.x-n.x)-s*(t.y-n.y);if(0===e)return!0;if(e<0)continue;r=!r}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return r}const i=Dm.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);let a,s,c;const l=[];if(1===o.length)return s=o[0],c=new Xg,c.curves=s.curves,l.push(c),l;let u=!i(o[0].getPoints());u=t?!u:u;const h=[],d=[];let f,p,m=[],g=0;d[g]=void 0,m[g]=[];for(let e=0,n=o.length;e<n;e++)s=o[e],f=s.getPoints(),a=i(f),a=t?!a:a,a?(!u&&d[g]&&g++,d[g]={s:new Xg,p:f},d[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:f[0]});if(!d[0])return n(o);if(d.length>1){let t=!1;const e=[];for(let t=0,e=d.length;t<e;t++)h[t]=[];for(let n=0,i=d.length;n<i;n++){const i=m[n];for(let o=0;o<i.length;o++){const a=i[o];let s=!0;for(let i=0;i<d.length;i++)r(a.p,d[i].p)&&(n!==i&&e.push({froms:n,tos:i,hole:o}),s?(s=!1,h[i].push(a)):t=!0);s&&h[n].push(a)}}e.length>0&&(t||(m=h))}for(let t=0,e=d.length;t<e;t++){c=d[t].s,l.push(c),p=m[t];for(let t=0,e=p.length;t<e;t++)c.holes.push(p[t].h)}return l}});class gv{constructor(t){Object.defineProperty(this,"isFont",{value:!0}),this.type="Font",this.data=t}generateShapes(t,e=100){const n=[],r=function(t,e,n){const r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[];let s=0,c=0;for(let t=0;t<r.length;t++){const e=r[t];if("\n"===e)s=0,c-=o;else{const t=vv(e,i,s,c,n);s+=t.offsetX,a.push(t.path)}}return a}(t,e,this.data);for(let t=0,e=r.length;t<e;t++)Array.prototype.push.apply(n,r[t].toShapes());return n}}function vv(t,e,n,r,i){const o=i.glyphs[t]||i.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");const a=new mv;let s,c,l,u,h,d,f,p;if(o.o){const t=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let i=0,o=t.length;i<o;){switch(t[i++]){case"m":s=t[i++]*e+n,c=t[i++]*e+r,a.moveTo(s,c);break;case"l":s=t[i++]*e+n,c=t[i++]*e+r,a.lineTo(s,c);break;case"q":l=t[i++]*e+n,u=t[i++]*e+r,h=t[i++]*e+n,d=t[i++]*e+r,a.quadraticCurveTo(h,d,l,u);break;case"b":l=t[i++]*e+n,u=t[i++]*e+r,h=t[i++]*e+n,d=t[i++]*e+r,f=t[i++]*e+n,p=t[i++]*e+r,a.bezierCurveTo(h,d,f,p,l,u)}}}return{offsetX:o.ha*e,path:a}}function yv(t){vg.call(this,t)}let bv;yv.prototype=Object.assign(Object.create(vg.prototype),{constructor:yv,load:function(t,e,n,r){const i=this,o=new bg(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(i.withCredentials),o.load(t,(function(t){let n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}const r=i.parse(n);e&&e(r)}),n,r)},parse:function(t){return new gv(t)}});const xv=function(){return void 0===bv&&(bv=new(window.AudioContext||window.webkitAudioContext)),bv};function _v(t){vg.call(this,t)}function wv(t,e,n){cv.call(this,void 0,n);const r=(new Hu).set(t),i=(new Hu).set(e),o=new bl(r.r,r.g,r.b),a=new bl(i.r,i.g,i.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}function Mv(t,e){cv.call(this,void 0,e);const n=(new Hu).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}_v.prototype=Object.assign(Object.create(vg.prototype),{constructor:_v,load:function(t,e,n,r){const i=this,o=new bg(i.manager);o.setResponseType("arraybuffer"),o.setPath(i.path),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(t,(function(n){try{const t=n.slice(0);xv().decodeAudioData(t,(function(t){e(t)}))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)}}),wv.prototype=Object.assign(Object.create(cv.prototype),{constructor:wv,isHemisphereLightProbe:!0,copy:function(t){return cv.prototype.copy.call(this,t),this},toJSON:function(t){return cv.prototype.toJSON.call(this,t)}}),Mv.prototype=Object.assign(Object.create(cv.prototype),{constructor:Mv,isAmbientLightProbe:!0,copy:function(t){return cv.prototype.copy.call(this,t),this},toJSON:function(t){return cv.prototype.toJSON.call(this,t)}});const Sv=new Yl,Tv=new Yl;Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Hh,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Hh,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}.prototype,{update:function(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;const n=t.projectionMatrix.clone(),r=e.eyeSep/2,i=r*e.near/e.focus,o=e.near*Math.tan(cl.DEG2RAD*e.fov*.5)/e.zoom;let a,s;Tv.elements[12]=-r,Sv.elements[12]=r,a=-o*e.aspect+i,s=o*e.aspect+i,n.elements[0]=2*e.near/(s-a),n.elements[8]=(s+a)/(s-a),this.cameraL.projectionMatrix.copy(n),a=-o*e.aspect-i,s=o*e.aspect-i,n.elements[0]=2*e.near/(s-a),n.elements[8]=(s+a)/(s-a),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Tv),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Sv)}});class Ev extends yu{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}function Av(t,e,n){let r,i,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Object.assign(Av.prototype,{accumulate:function(t,e){const n=this.buffer,r=this.valueSize,i=t*r+r;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==r;++t)n[i+t]=n[t];o=e}else{o+=e;const t=e/o;this._mixBufferRegion(n,i,0,t,r)}this.cumulativeWeight=o},accumulateAdditive:function(t){const e=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t},apply:function(t){const e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const t=e*this._origIndex;this._mixBufferRegion(n,r,t,1-i,e)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(let t=e,i=e+e;t!==i;++t)if(n[t]!==n[t+e]){a.setValue(n,r);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(let t=n,i=r;t!==i;++t)e[t]=e[r+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1},_setAdditiveIdentityOther:function(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]},_select:function(t,e,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)t[e+r]=t[n+r]},_slerp:function(t,e,n,r){yl.slerpFlat(t,e,t,e,t,n,r)},_slerpAdditive:function(t,e,n,r,i){const o=this._workIndex*i;yl.multiplyQuaternionsFlat(t,o,t,e,t,n),yl.slerpFlat(t,e,t,e,t,o,r)},_lerp:function(t,e,n,r,i){const o=1-r;for(let a=0;a!==i;++a){const i=e+a;t[i]=t[i]*o+t[n+a]*r}},_lerpAdditive:function(t,e,n,r,i){for(let o=0;o!==i;++o){const i=e+o;t[i]=t[i]+t[n+o]*r}}});const Lv=new RegExp("[\\[\\]\\.:\\/]","g"),Cv="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Rv=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Pv=/(WCOD+)?/.source.replace("WCOD",Cv),Nv=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),zv=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Dv=new RegExp("^"+Rv+Pv+Nv+zv+"$"),Iv=["material","materials","bones"];function Ov(t,e,n){const r=n||Fv.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function Fv(t,e,n){this.path=e,this.parsedPath=n||Fv.parseTrackName(e),this.node=Fv.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(Ov.prototype,{getValue:function(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Fv,{Composite:Ov,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Fv.Composite(t,e,n):new Fv(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Lv,"")},parseTrackName:function(t){const e=Dv.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const t=n.nodeName.substring(r+1);-1!==Iv.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.name===e||i.uuid===e)return i;const o=n(i.children);if(o)return o}return null},r=n(t.children);if(r)return r}return null}}),Object.assign(Fv.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){let t=this.node;const e=this.parsedPath,n=e.objectName,r=e.propertyName;let i=e.propertyIndex;if(t||(t=Fv.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===r){r=e;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==r){if(void 0===t[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[r]}}const o=t[r];if(void 0===o){const n=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let s=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[i]&&(i=t.morphTargetDictionary[i])}s=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=i}else void 0!==o.fromArray&&void 0!==o.toArray?(s=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(s=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[s],this.setValue=this.SetterByBindingTypeAndVersioning[s][a]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Fv.prototype,{_getValue_unbound:Fv.prototype.getValue,_setValue_unbound:Fv.prototype.setValue}),Object.assign(function(){this.uuid=cl.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){const t=this._objects,e=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,o=i.length;let a=void 0,s=t.length,c=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){const u=arguments[l],h=u.uuid;let d=e[h];if(void 0===d){d=s++,e[h]=d,t.push(u);for(let t=0,e=o;t!==e;++t)i[t].push(new Fv(u,n[t],r[t]))}else if(d<c){a=t[d];const s=--c,l=t[s];e[l.uuid]=d,t[d]=l,e[h]=s,t[s]=u;for(let t=0,e=o;t!==e;++t){const e=i[t],o=e[s];let a=e[d];e[d]=o,void 0===a&&(a=new Fv(u,n[t],r[t])),e[s]=a}}else t[d]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c},remove:function(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o],s=a.uuid,c=e[s];if(void 0!==c&&c>=i){const o=i++,l=t[o];e[l.uuid]=c,t[c]=l,e[s]=o,t[o]=a;for(let t=0,e=r;t!==e;++t){const e=n[t],r=e[o],i=e[c];e[c]=r,e[o]=i}}}this.nCachedObjects_=i},uncache:function(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,o=t.length;for(let a=0,s=arguments.length;a!==s;++a){const s=arguments[a].uuid,c=e[s];if(void 0!==c)if(delete e[s],c<i){const a=--i,s=t[a],l=--o,u=t[l];e[s.uuid]=c,t[c]=s,e[u.uuid]=a,t[a]=u,t.pop();for(let t=0,e=r;t!==e;++t){const e=n[t],r=e[a],i=e[l];e[c]=r,e[a]=i,e.pop()}}else{const i=--o,a=t[i];i>0&&(e[a.uuid]=c),t[c]=a,t.pop();for(let t=0,e=r;t!==e;++t){const e=n[t];e[c]=e[i],e.pop()}}}this.nCachedObjects_=i},subscribe_:function(t,e){const n=this._bindingsIndicesByPath;let r=n[t];const i=this._bindings;if(void 0!==r)return i[r];const o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=new Array(c);r=i.length,n[t]=r,o.push(t),a.push(e),i.push(u);for(let n=l,r=s.length;n!==r;++n){const r=s[n];u[n]=new Fv(r,t,e)}return u},unsubscribe_:function(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}});class Uv{constructor(t,e,n=null,r=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=r;const i=e.tracks,o=i.length,a=new Array(o),s={endingStart:2400,endingEnd:2400};for(let t=0;t!==o;++t){const e=i[t].createInterpolant(null);a[t]=e,e.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,r=t._clip.duration,i=r/n,o=n/r;t.warp(1,i,e),this.warp(o,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const r=this._mixer,i=r.time,o=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);const s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=t/o,c[1]=e/o,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,r){if(!this.enabled)return void this._updateWeight(t);const i=this._startTime;if(null!==i){const r=(t-i)*n;if(r<0||0===n)return;this._startTime=null,e=n*r}e*=this._updateTimeScale(t);const o=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(o),e[n].accumulateAdditive(a);break;case 2500:default:for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(o),e[n].accumulate(r,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let r=this.time+t,i=this._loopCount;const o=2202===n;if(0===t)return-1===i?r:o&&1==(1&i)?e-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(r>=e)r=e;else{if(!(r<0)){this.time=r;break t}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),r>=e||r<0){const n=Math.floor(r/e);r-=e*n,i+=Math.abs(n);const a=this.repetitions-i;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=t>0?e:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(o&&1==(1&i))return e-r}return r}_setEndings(t,e,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,n){const r=this._mixer,i=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}function Bv(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Bv.prototype=Object.assign(Object.create(ol.prototype),{constructor:Bv,_bindAction:function(t,e){const n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName;let l=c[s];void 0===l&&(l={},c[s]=l);for(let t=0;t!==i;++t){const i=r[t],c=i.name;let u=l[c];if(void 0!==u)o[t]=u;else{if(u=o[t],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,s,c));continue}const r=e&&e._propertyBindings[t].binding.parsedPath;u=new Av(Fv.create(n,c,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,c),o[t]=u}a[t].resultBuffer=u.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){const r=this._actions,i=this._actionsByClip;let o=i[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){const e=this._actions,n=e[e.length-1],r=t._cacheIndex;n._cacheIndex=r,e[r]=n,e.pop(),t._cacheIndex=null;const i=t._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,c=s[s.length-1],l=t._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),t._byClipCacheIndex=null;delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(t){const e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackAction:function(t){const e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_addInactiveBinding:function(t,e,n){const r=this._bindingsByRootAndName,i=this._bindings;let o=r[e];void 0===o&&(o={},r[e]=o),o[n]=t,t._cacheIndex=i.length,i.push(t)},_removeInactiveBinding:function(t){const e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]},_lendBinding:function(t){const e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackBinding:function(t){const e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_lendControlInterpolant:function(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let n=t[e];return void 0===n&&(n=new ng(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){const e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];t.__cacheIndex=r,e[r]=t,i.__cacheIndex=n,e[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e,n){const r=e||this._root,i=r.uuid;let o="string"==typeof t?dg.findByName(r,t):t;const a=null!==o?o.uuid:t,s=this._actionsByClip[a];let c=null;if(void 0===n&&(n=null!==o?o.blendMode:2500),void 0!==s){const t=s.actionByRoot[i];if(void 0!==t&&t.blendMode===n)return t;c=s.knownActions[0],null===o&&(o=c._clip)}if(null===o)return null;const l=new Uv(this,o,e,n);return this._bindAction(l,c),this._addInactiveAction(l,a,i),l},existingAction:function(t,e){const n=e||this._root,r=n.uuid,i="string"==typeof t?dg.findByName(n,t):t,o=i?i.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null},stopAllAction:function(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(r,t,i,o)}const a=this._bindings,s=this._nActiveBindings;for(let t=0;t!==s;++t)a[t].apply(o);return this},setTime:function(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){const e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const t=i.knownActions;for(let n=0,r=t.length;n!==r;++n){const r=t[n];this._deactivateAction(r);const i=r._cacheIndex,o=e[e.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,o._cacheIndex=i,e[i]=o,e.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}},uncacheRoot:function(t){const e=t.uuid,n=this._actionsByClip;for(const t in n){const r=n[t].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}const r=this._bindingsByRootAndName[e];if(void 0!==r)for(const t in r){const e=r[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}},uncacheAction:function(t,e){const n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}});class Hv{constructor(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}clone(){return new Hv(void 0===this.value.clone?this.value:this.value.clone())}}function kv(t,e,n){ip.call(this,t,e),this.meshPerAttribute=n||1}function Gv(t,e,n,r,i){this.buffer=t,this.type=e,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}function jv(t,e,n,r){this.ray=new ql(t,e),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new iu,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Wv(t,e){return t.distance-e.distance}function Vv(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r){const r=t.children;for(let t=0,i=r.length;t<i;t++)Vv(r[t],e,n,!0)}}kv.prototype=Object.assign(Object.create(ip.prototype),{constructor:kv,isInstancedInterleavedBuffer:!0,copy:function(t){return ip.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},clone:function(t){const e=ip.prototype.clone.call(this,t);return e.meshPerAttribute=this.meshPerAttribute,e},toJSON:function(t){const e=ip.prototype.toJSON.call(this,t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}),Object.defineProperty(Gv.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Gv.prototype,{isGLBufferAttribute:!0,setBuffer:function(t){return this.buffer=t,this},setType:function(t,e){return this.type=t,this.elementSize=e,this},setItemSize:function(t){return this.itemSize=t,this},setCount:function(t){return this.count=t,this}}),Object.assign(jv.prototype,{set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)},intersectObject:function(t,e,n){const r=n||[];return Vv(t,this,r,e),r.sort(Wv),r},intersectObjects:function(t,e,n){const r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(let n=0,i=t.length;n<i;n++)Vv(t[n],this,r,e);return r.sort(Wv),r}});const qv=new ll;const Yv=new bl,Xv=new bl;class Zv{constructor(t,e){this.start=void 0!==t?t:new bl,this.end=void 0!==e?e:new bl}set(t,e){return this.start.copy(t),this.end.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new bl),t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new bl),t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new bl),this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Yv.subVectors(t,this.start),Xv.subVectors(this.end,this.start);const n=Xv.dot(Xv);let r=Xv.dot(Yv)/n;return e&&(r=cl.clamp(r,0,1)),r}closestPointToPoint(t,e,n){const r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new bl),this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}function Jv(t){yu.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Jv.prototype=Object.create(yu.prototype),Jv.prototype.constructor=Jv,Jv.prototype.isImmediateRenderObject=!0;const Qv=new bl,$v=new Yl,Kv=new Yl;const ty=new Float32Array(1),ey=(new Int32Array(ty.buffer),Math.pow(2,8),[.125,.215,.35,.446,.526,.582]),ny=5+ey.length,ry=new Wu({side:1,depthWrite:!1,depthTest:!1}),{_lodPlanes:iy,_sizeLods:oy,_sigmas:ay}=(new Nh(new Dh,ry),sy());Math.sqrt(5);function sy(){const t=[],e=[],n=[];let r=8;for(let i=0;i<ny;i++){const o=Math.pow(2,r);e.push(o);let a=1/o;i>4?a=ey[i-8+4-1]:0==i&&(a=0),n.push(a);const s=1/(o-1),c=-s/2,l=1+s/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],h=6,d=6,f=3,p=2,m=1,g=new Float32Array(f*d*h),v=new Float32Array(p*d*h),y=new Float32Array(m*d*h);for(let t=0;t<h;t++){const e=t%3*2/3-1,n=t>2?0:-1,r=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(r,f*d*t),v.set(u,p*d*t);const i=[t,t,t,t,t,t];y.set(i,m*d*t)}const b=new ph;b.setAttribute("position",new Yu(g,f)),b.setAttribute("uv",new Yu(v,p)),b.setAttribute("faceIndex",new Yu(y,m)),t.push(b),r>4&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}function cy(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Dg.call(this,t),this.type="catmullrom"}Eg.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Eg.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Yg.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Object.create(Dg.prototype),Object.create(Dg.prototype),cy.prototype=Object.create(Dg.prototype),Object.assign(cy.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),class extends Jp{constructor(t=10,e=10,n=4473924,r=8947848){n=new Hu(n),r=new Hu(r);const i=e/2,o=t/e,a=t/2,s=[],c=[];for(let t=0,l=0,u=-a;t<=e;t++,u+=o){s.push(-a,0,u,a,0,u),s.push(u,0,-a,u,0,a);const e=t===i?n:r;e.toArray(c,l),l+=3,e.toArray(c,l),l+=3,e.toArray(c,l),l+=3,e.toArray(c,l),l+=3}const l=new ph;l.setAttribute("position",new nh(s,3)),l.setAttribute("color",new nh(c,3));super(l,new kp({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Jp{constructor(t){const e=function t(e){const n=[];e&&e.isBone&&n.push(e);for(let r=0;r<e.children.length;r++)n.push.apply(n,t(e.children[r]));return n}(t),n=new ph,r=[],i=[],o=new Hu(0,0,1),a=new Hu(0,1,0);for(let t=0;t<e.length;t++){const n=e[t];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new nh(r,3)),n.setAttribute("color",new nh(i,3));super(n,new kp({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,n=this.geometry,r=n.getAttribute("position");Kv.copy(this.root.matrixWorld).invert();for(let t=0,n=0;t<e.length;t++){const i=e[t];i.parent&&i.parent.isBone&&($v.multiplyMatrices(Kv,i.matrixWorld),Qv.setFromMatrixPosition($v),r.setXYZ(n,Qv.x,Qv.y,Qv.z),$v.multiplyMatrices(Kv,i.parent.matrixWorld),Qv.setFromMatrixPosition($v),r.setXYZ(n+1,Qv.x,Qv.y,Qv.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}}.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(vg.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),uv(t)}}),vg.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(class{constructor(t,e){Object.defineProperty(this,"isBox2",{value:!0}),this.min=void 0!==t?t:new ll(1/0,1/0),this.max=void 0!==e?e:new ll(-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=qv.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new ll),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new ll),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}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}getParameter(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new ll),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new ll),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return qv.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),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)}}.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(wl.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Ul.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Yh.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Zv.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(cl,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),cl.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),cl.ceilPowerOfTwo(t)}}),Object.assign(ul.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),Object.assign(Yl.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new bl).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)},getInverse:function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),wu.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Object.assign(yl.prototype,{multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(ql.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(zu.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(zu,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),zu.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),zu.getNormal(t,e,n,r)}}),Object.assign(Xg.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Fm(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Hm(this,t)}}),Object.assign(ll.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(bl.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(gl.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(yu.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(yu.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Nh.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Nh.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Tp.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Ip.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Pp.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Eg.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Hh.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Zg.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Yu.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Yu.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(ph.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Yu(arguments[1],arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(ph.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(hv.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(jv.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(ip.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(ip.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Fm.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(rp.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Hv.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(ju.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Hu}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(qm.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Vm.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(Uh.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(ep.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ep.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(qf.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(vl.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Ev.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new _v).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}}.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},kh.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},kh.prototype.clear=function(t,e,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,n,r)};dl.crossOrigin=void 0,dl.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new Tg;i.setCrossOrigin(this.crossOrigin);const o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},dl.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new Mg;i.setCrossOrigin(this.crossOrigin);const o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},dl.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},dl.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"125dev"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="125dev");class ly{static isWebGLAvailable(){try{const t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}static isWebGL2Available(){try{const t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}}static getWebGLErrorMessage(){return this.getErrorMessage(1)}static getWebGL2ErrorMessage(){return this.getErrorMessage(2)}static getErrorMessage(t){const e={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext};let n='Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>';const r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="13px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",n=e[t]?n.replace("$0","graphics card"):n.replace("$0","browser"),n=n.replace("$1",{1:"WebGL",2:"WebGL 2"}[t]),r.innerHTML=n,r}}var uy=function(t){yu.call(this),this.element=t,this.element.style.position="absolute",this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))};(uy.prototype=Object.create(yu.prototype)).constructor=uy;var hy=function(){var t,e,n,r,i=this,o=new bl,a=new Yl,s=new Yl,c={objects:new WeakMap},l=document.createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",this.domElement=l,this.getSize=function(){return{width:t,height:e}},this.setSize=function(i,o){n=(t=i)/2,r=(e=o)/2,l.style.width=i+"px",l.style.height=o+"px"};var u,h,d=function(t,e,a){if(t instanceof uy){t.onBeforeRender(i,e,a),o.setFromMatrixPosition(t.matrixWorld),o.applyMatrix4(s);var u=t.element,h="translate(-50%,-50%) translate("+(o.x*n+n)+"px,"+(-o.y*r+r)+"px)";u.style.WebkitTransform=h,u.style.MozTransform=h,u.style.oTransform=h,u.style.transform=h,u.style.display=t.visible&&o.z>=-1&&o.z<=1?"":"none";var p={distanceToCameraSquared:f(a,t)};c.objects.set(t,p),u.parentNode!==l&&l.appendChild(u),t.onAfterRender(i,e,a)}for(var m=0,g=t.children.length;m<g;m++)d(t.children[m],e,a)},f=(u=new bl,h=new bl,function(t,e){return u.setFromMatrixPosition(t.matrixWorld),h.setFromMatrixPosition(e.matrixWorld),u.distanceToSquared(h)}),p=function(t){for(var e=function(t){var e=[];return t.traverse((function(t){t instanceof uy&&e.push(t)})),e}(t).sort((function(t,e){return c.objects.get(t).distanceToCameraSquared-c.objects.get(e).distanceToCameraSquared})),n=e.length,r=0,i=e.length;r<i;r++)e[r].element.style.zIndex=n-r};this.render=function(t,e){!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),a.copy(e.matrixWorldInverse),s.multiplyMatrices(e.projectionMatrix,a),d(t,t,e),p(t)}},dy=function(t){return t},fy=function(t){if(null==t)return dy;var e,n,r=t.scale[0],i=t.scale[1],o=t.translate[0],a=t.translate[1];return function(t,s){s||(e=n=0);var c=2,l=t.length,u=new Array(l);for(u[0]=(e+=t[0])*r+o,u[1]=(n+=t[1])*i+a;c<l;)u[c]=t[c],++c;return u}},py=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map((function(e){return my(t,e)}))}:my(t,e)};function my(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=gy(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function gy(t,e){var n=fy(t.transform),r=t.arcs;function i(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,a=i.length;o<a;++o)e.push(n(i[o],o));t<0&&function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n}(e,a)}function o(t){return n(t)}function a(t){for(var e=[],n=0,r=t.length;n<r;++n)i(t[n],e);return e.length<2&&e.push(e[0]),e}function s(t){for(var e=a(t);e.length<4;)e.push(e[0]);return e}function c(t){return t.map(s)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=o(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(o);break;case"LineString":n=a(e.arcs);break;case"MultiLineString":n=e.arcs.map(a);break;case"Polygon":n=c(e.arcs);break;case"MultiPolygon":n=e.arcs.map(c);break;default:return null}return{type:r,coordinates:n}}(e)}var vy=new ArrayBuffer(16);new Float64Array(vy),new Uint32Array(vy);Math.PI,Math.abs,Math.atan2,Math.cos,Math.sin;const yy="https://ec.europa.eu/eurostat/statistical-atlas/gis/arcgis/rest/services/Basemaps/StatAtlas_Cities_Labels_2014/MapServer/0/query?",by="CNTR_CODE",xy="STTL_NAME",_y="POPL_SIZE";let wy,My;function Sy(t,[e,n]){var r=new bl,i=new bl;r.set(e/window.innerWidth*2-1,-n/window.innerHeight*2+1,.5),r.unproject(t.camera),r.sub(t.camera.position).normalize();var o=-t.camera.position.z/r.z;if(i.copy(t.camera.position).add(r.multiplyScalar(o)),t._mobile){if(!t.mobileCoordScaleX||!t.mobileCoordScaleY)return!1;i.x=Math.round(t.mobileCoordScaleX.invert(i.x)),i.y=Math.round(t.mobileCoordScaleY.invert(i.y))}return i}function Ty(){wy.style.display="none",My.style.display="none"}function Ey(t,e,n){let r=Ly(e/2);return t/(2*(Math.tan(r)*n))}function Ay(t,e,n){let r=Ly(e/2);return t/n/(2*Math.tan(r))}function Ly(t){return t*(Math.PI/180)}var Cy,Ry,Py=function(){hv.call(this),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new nh([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new nh([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))};Py.prototype=Object.assign(Object.create(hv.prototype),{constructor:Py,isLineSegmentsGeometry:!0,applyMatrix4:function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},setPositions:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new kv(e,6,1);return this.setAttribute("instanceStart",new ap(n,3,0)),this.setAttribute("instanceEnd",new ap(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},setColors:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new kv(e,6,1);return this.setAttribute("instanceColorStart",new ap(n,3,0)),this.setAttribute("instanceColorEnd",new ap(n,3,3)),this},fromWireframeGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromEdgesGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromMesh:function(t){return this.fromWireframeGeometry(new km(t.geometry)),this},fromLineSegements:function(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this},computeBoundingBox:(Ry=new wl,function(){null===this.boundingBox&&(this.boundingBox=new wl);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),Ry.setFromBufferAttribute(e),this.boundingBox.union(Ry))}),computeBoundingSphere:(Cy=new bl,function(){null===this.boundingSphere&&(this.boundingSphere=new Ul),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var r=0,i=0,o=t.count;i<o;i++)Cy.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(Cy)),Cy.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(Cy));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}),toJSON:function(){},applyMatrix:function(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}),$h.line={linewidth:{value:1},resolution:{value:new ll(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Kh.line={uniforms:Fh.merge([$h.common,$h.fog,$h.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\t\tvarying vec2 vUv;\n\t\t#ifdef USE_DASH\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\t\t#endif\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\t\t}\n\t\tvoid main() {\n\t\t\t#ifdef USE_COLOR\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\t\t\t#endif\n\t\t\t#ifdef USE_DASH\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t#endif\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\t\t\tvUv = uv;\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\t\t\tif ( perspective ) {\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\t\t\t\t\ttrimSegment( start, end );\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\t\t\t\t\ttrimSegment( end, start );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\t\t\t\toffset += - dir;\n\t\t\t} else if ( position.y > 1.0 ) {\n\t\t\t\toffset += dir;\n\t\t\t}\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\t\t\tclip.xy += offset;\n\t\t\tgl_Position = clip;\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\t#ifdef USE_DASH\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\t\t#endif\n\t\tvarying float vLineDistance;\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\t\tvarying vec2 vUv;\n\t\tvoid main() {\n\t\t\t#include <clipping_planes_fragment>\n\t\t\t#ifdef USE_DASH\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\t\t\t#endif\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\t\t\t}\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t}\n\t\t"};var Ny=function(t){Uh.call(this,{type:"LineMaterial",uniforms:Fh.clone(Kh.line.uniforms),vertexShader:Kh.line.vertexShader,fragmentShader:Kh.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),this.setValues(t)};(Ny.prototype=Object.create(Uh.prototype)).constructor=Ny,Ny.prototype.isLineMaterial=!0;for(var zy=[],Dy=0;Dy<256;Dy++)zy[Dy]=(Dy<16?"0":"")+Dy.toString(16);var Iy,Oy,Fy={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(zy[255&t]+zy[t>>8&255]+zy[t>>16&255]+zy[t>>24&255]+"-"+zy[255&e]+zy[e>>8&255]+"-"+zy[e>>16&15|64]+zy[e>>24&255]+"-"+zy[63&n|128]+zy[n>>8&255]+"-"+zy[n>>16&255]+zy[n>>24&255]+zy[255&r]+zy[r>>8&255]+zy[r>>16&255]+zy[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Fy.DEG2RAD},radToDeg:function(t){return t*Fy.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),c=a(n/2),l=o((e+r)/2),u=a((e+r)/2),h=o((e-r)/2),d=a((e-r)/2),f=o((r-e)/2),p=a((r-e)/2);"XYX"===i?t.set(s*u,c*h,c*d,s*l):"YZY"===i?t.set(c*d,s*u,c*h,s*l):"ZXZ"===i?t.set(c*h,c*d,s*u,s*l):"XZX"===i?t.set(s*u,c*p,c*f,s*l):"YXY"===i?t.set(c*f,s*u,c*p,s*l):"ZYZ"===i?t.set(c*p,c*f,s*u,s*l):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}},Uy=function(t,e){Nh.call(this),this.type="LineSegments2",this.geometry=void 0!==t?t:new Py,this.material=void 0!==e?e:new Ny({color:16777215*Math.random()})};Uy.prototype=Object.assign(Object.create(Nh.prototype),{constructor:Uy,isLineSegments2:!0,computeLineDistances:(Iy=new bl,Oy=new bl,function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,r=new Float32Array(2*e.data.count),i=0,o=0,a=e.data.count;i<a;i++,o+=2)Iy.fromBufferAttribute(e,i),Oy.fromBufferAttribute(n,i),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+Iy.distanceTo(Oy);var s=new kv(r,2,1);return t.setAttribute("instanceDistanceStart",new ap(s,1,0)),t.setAttribute("instanceDistanceEnd",new ap(s,1,1)),this}),raycast:function(){var t=new gl,e=new gl,n=new gl,r=new bl,i=new Yl,o=new Zv,a=new bl;return function(s,c){null===s.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var l=s.ray,u=s.camera,h=u.projectionMatrix,d=this.geometry,f=this.material,p=f.resolution,m=f.linewidth,g=d.attributes.instanceStart,v=d.attributes.instanceEnd;l.at(1,n),n.w=1,n.applyMatrix4(u.matrixWorldInverse),n.applyMatrix4(h),n.multiplyScalar(1/n.w),n.x*=p.x/2,n.y*=p.y/2,n.z=0,r.copy(n);var y=this.matrixWorld;i.multiplyMatrices(u.matrixWorldInverse,y);for(var b=0,x=g.count;b<x;b++){t.fromBufferAttribute(g,b),e.fromBufferAttribute(v,b),t.w=1,e.w=1,t.applyMatrix4(i),e.applyMatrix4(i),t.applyMatrix4(h),e.applyMatrix4(h),t.multiplyScalar(1/t.w),e.multiplyScalar(1/e.w);var _=t.z<-1&&e.z<-1,w=t.z>1&&e.z>1;if(!_&&!w){t.x*=p.x/2,t.y*=p.y/2,e.x*=p.x/2,e.y*=p.y/2,o.start.copy(t),o.start.z=0,o.end.copy(e),o.end.z=0;var M=o.closestPointToPointParameter(r,!0);o.at(M,a);var S=Fy.lerp(t.z,e.z,M),T=S>=-1&&S<=1,E=r.distanceTo(a)<.5*m;if(T&&E){o.start.fromBufferAttribute(g,b),o.end.fromBufferAttribute(v,b),o.start.applyMatrix4(y),o.end.applyMatrix4(y);var A=new bl,L=new bl;l.distanceSqToSegment(o.start,o.end,L,A),c.push({point:L,pointOnLine:A,distance:l.origin.distanceTo(L),object:this,face:null,faceIndex:b,uv:null,uv2:null})}}}}}()});var By=function(){Py.call(this),this.type="LineGeometry"};By.prototype=Object.assign(Object.create(Py.prototype),{constructor:By,isLineGeometry:!0,setPositions:function(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return Py.prototype.setPositions.call(this,n),this},setColors:function(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return Py.prototype.setColors.call(this,n),this},fromLine:function(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this},copy:function(){return this}});var Hy=function(t,e){Uy.call(this),this.type="Line2",this.geometry=void 0!==t?t:new By,this.material=void 0!==e?e:new Ny({color:16777215*Math.random()})};Hy.prototype=Object.assign(Object.create(Uy.prototype),{constructor:Hy,isLine2:!0});let ky,Gy,jy,Wy,Vy,qy,Yy,Xy=1001e-7;function Zy(t,e){Xy+=.002;let n=new Qf;n.renderOrder=999;for(let r=0;r<t.length;r++){let i=t[r],o=[];for(let t=0;t<i.geometry.coordinates.length;t++)if("Polygon"==i.geometry.type){let r=[];for(let n=0;n<i.geometry.coordinates[t].length;n++){let o;if(e.zerosRemoved_){let r=Number("1E"+e.zerosRemoved_);o={x:i.geometry.coordinates[t][n][0]/r,y:i.geometry.coordinates[t][n][1]/r,z:Xy}}else o={x:i.geometry.coordinates[t][n][0],y:i.geometry.coordinates[t][n][1],z:Xy};r.push(o)}r.length>0&&n.add(Jy(r,e.lineColor_,e.lineWidth_))}else if("MultiPolygon"==i.geometry.type)for(let r=0;r<i.geometry.coordinates[t].length;r++){let o=[];for(let n=0;n<i.geometry.coordinates[t][r].length;n++){let a;if(e.zerosRemoved_){let o=Number("1E"+e.zerosRemoved_);a={x:i.geometry.coordinates[t][r][n][0]/o,y:i.geometry.coordinates[t][r][n][1]/o,z:Xy}}else a={x:i.geometry.coordinates[t][r][n][0],y:i.geometry.coordinates[t][r][n][1],z:Xy};o.push(a)}o.length>0&&n.add(Jy(o,e.lineColor_,e.lineWidth_))}else if("LineString"==i.geometry.type){let n;if(e.zerosRemoved_){let r=Number("1E"+e.zerosRemoved_);n={x:i.geometry.coordinates[t][0]/r,y:i.geometry.coordinates[t][1]/r,z:Xy}}else n={x:i.geometry.coordinates[t][0],y:i.geometry.coordinates[t][1],z:Xy};o.push(n)}(i.geometry.type="LineString")&&o.length>0&&n.add(Jy(o,e.lineColor_,e.lineWidth_))}e.scene.add(n)}function Jy(t,e,n){let r=new By,i=[],o=[],a=new Hu(e);for(var s=0;s<t.length;s++)i.push(t[s].x,t[s].y,Xy),o.push(a.r,a.g,a.b);return r.setPositions(i),r.setColors(o),ky||(ky=new Ny({linewidth:n,vertexColors:!0})),new Hy(r,ky)}let Qy={display:"none"};function $y(t){let e=document.createElement("tr");e.id=t+"tip",Wy.appendChild(e),Vy[t]=e}function Ky(t){Yy.offsetLeft>t.width_-Yy.clientWidth&&(Yy.style.left=Yy.offsetLeft-(Yy.clientWidth+2*t.tooltip_.xOffset)+"px"),Yy.offsetTop+Yy.clientHeight>t.height_&&(Yy.style.top=Yy.offsetTop-(Yy.clientHeight+2*t.tooltip_.yOffset)+"px")}function tb(t,e,n){let r=e[0]+t.tooltip_.xOffset,i=e[1]+t.tooltip_.yOffset;for(const t in n)Qy[t]=n[t];Qy.display="block",Qy.left=r,Qy.top=i,function(t){let e,n;if(t._mobile?(e=Math.round(t.mobileCoordScaleX.invert(Qy.x)),n=Math.round(t.mobileCoordScaleY.invert(Qy.y))):(e=Qy.x,n=Qy.y),t.zerosRemoved_){let r=Number("1E"+t.zerosRemoved_);e=Math.round(e*r),n=Math.round(n*r)}if(Yy.style.display=Qy.display,Yy.style.left=Qy.left+"px",Yy.style.top=Qy.top+"px",qy.style.background=Qy.color,t._cellFields.forEach(t=>{Vy[t].innerHTML=`<th><strong>${t}:</strong> </th>\n <th>${Qy[t]}</th>`}),t.tooltip_.showCoordinates&&(Vy.x.innerHTML=`<th><strong>x:</strong></th>\n <th>${e}</th>`,Vy.y.innerHTML=`<th><strong>y:</strong></th>\n <th>${n}</th>`),t.tooltip_.showEPSG&&(Vy.crstip.innerHTML=`<th><strong>CRS:</strong></th>\n <th>EPSG:${t.EPSG_}</th>`),[4326,4258,3035].includes(t.EPSG_)){let r=`https://gisco-services.ec.europa.eu/id/nuts?x=${e}&y=${n}&proj=${t.EPSG_}&year=2021&level=3`,i=`https://gisco-services.ec.europa.eu/id/lau?x=${e}&y=${n}&proj=${t.EPSG_}&year=2019&level=3`;if(t.tooltip_.showLAU&&t.tooltip_.showNUTS){let e=[rl(r),rl(i)];Promise.all(e).then(e=>{if(e[0]&&e[0].features.length>0){let t=e[0].features[0];(void 0).innerHTML=`\n<th><strong>NUTS3 code:</strong></th>\n<th>${t.properties.nuts_id}</th>\n`}if(e[1]&&e[1].features.length>0){let t=e[1].features[0];(void 0).innerHTML=`\n <th><strong>LAU code:</strong></th>\n <th>${t.properties.lau_id}</th>\n `,(void 0).innerHTML=`\n <th><strong>LAU:</strong></th>\n <th>${t.properties.lau_name}</th>\n `}Ky(t)})}else t.tooltip_.showLAU?rl(r).then(e=>{if(e.features.length>0){let t=e.features[0];(void 0).innerHTML=`\n <th><strong>NUTS3 code:</strong></th>\n <th>${t.properties.nuts_id}</th>\n `}Ky(t)},e=>{console.log("no LAU found"),Ky(t)}):t.tooltip_.showNUTS?rl(i).then(e=>{if(e.features.length>0){let t=e.features[0];(void 0).innerHTML=`\n <th><strong>LAU code:</strong></th>\n <th>${t.properties.lau_id}</th>\n `,(void 0).innerHTML=`\n <th><strong>LAU:</strong></th>\n <th>${t.properties.lau_name}</th>\n `}Ky(t)},e=>{console.log("no NUTS found"),Ky(t)}):Ky(t)}}(t)}function eb(){Yy&&Qy&&(Yy.style.display="none")}function nb(t){let e=function(t){t.camera.position.z,t.resolution_;let e="";t.placenamesCountry_&&(e=e+by+" = '"+t.placenamesCountry_+"' AND ");let n=function(t){let e=t.camera.position.z;if(t._mobile){let n=t.originalResolution/t.resolution_;e*=n}let n=_y;if(t.placenameThresholds_){let r=Object.keys(t.placenameThresholds_).sort((t,e)=>parseInt(t)-parseInt(e)),i=Object.values(t.placenameThresholds_).sort((t,e)=>parseInt(t)-parseInt(e));for(let t=0;t<r.length;t++){let o=r[t],a=i[t];if(!r[t+1])return n+">"+a;if(e<parseInt(r[0]))return n+">"+a;if(e>parseInt(o)&&e<parseInt(r[t+1]))return n+">"+a}}}(t);t.debugPlacenames_&&console.info(n);return e+n}(t),n=function(t){var e=t.renderer.domElement;let n=[e.clientLeft,e.clientHeight],r=[e.clientWidth,e.clientTop],i=Sy(t,n),o=Sy(t,r);if(i&&o){if(t.zerosRemoved_){let e=Number("1E"+t.zerosRemoved_);return{xmin:i.x*e,ymin:i.y*e,xmax:o.x*e,ymax:o.y*e}}return{xmin:i.x,ymin:i.y,xmax:o.x,ymax:o.y}}}(t);if(t.debugPlacenames_&&console.info(n),n&&e){let r=yy+"where="+e+"&outSR="+t.EPSG_+"&inSR="+t.EPSG_+"&geometry="+n.xmin+","+n.ymin+","+n.xmax+","+n.ymax+"&geometryType=esriGeometryEnvelope&f=json&outFields="+xy+","+_y,i=encodeURI(r);rl(i).then(e=>{rb(t),e.features&&e.features.length>0&&function(t,e){if(t.pointsLayer)for(let n=0;n<e.length;n++){let r=ib(t,e[n]);t.pointsLayer.add(r)}}(t,e.features)},t=>{console.error(t)})}}function rb(t){if(t.pointsLayer&&t.pointsLayer.children.length>0)for(var e=t.pointsLayer.children.length-1;e>=0;e--)t.pointsLayer.remove(t.pointsLayer.children[e])}function ib(t,e){var n=document.createElement("div");n.className="gridviz-placename",n.textContent=e.attributes[xy],n.style.marginTop="-1em";var r=new uy(n);if(t._mobile){if(t.zerosRemoved_){let n=Number("1E"+t.zerosRemoved_),i=t.mobileCoordScaleX(e.geometry.x/n),o=t.mobileCoordScaleY(e.geometry.y/n);r.position.set(i,o,.001)}else r.position.set(t.mobileCoordScaleX(e.geometry.x),t.mobileCoordScaleY(e.geometry.y),.001);return r}if(t.zerosRemoved_){let n=Number("1E"+t.zerosRemoved_);r.position.set(e.geometry.x/n,e.geometry.y/n,.001)}else r.position.set(e.geometry.x,e.geometry.y,.001);return r}var ob={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ab=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),ob.hasOwnProperty(e)?{space:ob[e],local:t}:t};function sb(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return"http://www.w3.org/1999/xhtml"===n&&"http://www.w3.org/1999/xhtml"===e.documentElement.namespaceURI?e.createElement(t):e.createElementNS(n,t)}}function cb(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var lb=function(t){var e=ab(t);return(e.local?cb:sb)(e)},ub=0;function hb(){this._="@"+(++ub).toString(36)}hb.prototype=function(){return new hb}.prototype={constructor:hb,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var db=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var fb=document.documentElement;if(!fb.matches){var pb=fb.webkitMatchesSelector||fb.msMatchesSelector||fb.mozMatchesSelector||fb.oMatchesSelector;db=function(t){return function(){return pb.call(this,t)}}}}var mb=db,gb={},vb=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(gb={mouseenter:"mouseover",mouseleave:"mouseout"}));function yb(t,e,n){return t=bb(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function bb(t,e,n){return function(r){var i=vb;vb=r;try{t.call(this,this.__data__,e,n)}finally{vb=i}}}function xb(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function _b(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function wb(t,e,n){var r=gb.hasOwnProperty(t.type)?yb:bb;return function(i,o,a){var s,c=this.__on,l=r(e,o,a);if(c)for(var u=0,h=c.length;u<h;++u)if((s=c[u]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=e);this.addEventListener(t.type,l,n),s={type:t.type,name:t.name,value:e,listener:l,capture:n},c?c.push(s):this.__on=[s]}}function Mb(){}var Sb=function(t){return null==t?Mb:function(){return this.querySelector(t)}};function Tb(){return[]}var Eb=function(t){return new Array(t.length)};function Ab(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ab.prototype={constructor:Ab,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Lb(t,e,n,r,i,o){for(var a,s=0,c=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new Ab(t,o[s]);for(;s<c;++s)(a=e[s])&&(i[s]=a)}function Cb(t,e,n,r,i,o,a){var s,c,l,u={},h=e.length,d=o.length,f=new Array(h);for(s=0;s<h;++s)(c=e[s])&&(f[s]=l="$"+a.call(c,c.__data__,s,e),l in u?i[s]=c:u[l]=c);for(s=0;s<d;++s)(c=u[l="$"+a.call(t,o[s],s,o)])?(r[s]=c,c.__data__=o[s],u[l]=null):n[s]=new Ab(t,o[s]);for(s=0;s<h;++s)(c=e[s])&&u[f[s]]===c&&(i[s]=c)}function Rb(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Pb(t){return function(){this.removeAttribute(t)}}function Nb(t){return function(){this.removeAttributeNS(t.space,t.local)}}function zb(t,e){return function(){this.setAttribute(t,e)}}function Db(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ib(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Ob(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var Fb=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Ub(t){return function(){this.style.removeProperty(t)}}function Bb(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Hb(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function kb(t){return function(){delete this[t]}}function Gb(t,e){return function(){this[t]=e}}function jb(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function Wb(t){return t.trim().split(/^|\s+/)}function Vb(t){return t.classList||new qb(t)}function qb(t){this._node=t,this._names=Wb(t.getAttribute("class")||"")}function Yb(t,e){for(var n=Vb(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Xb(t,e){for(var n=Vb(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Zb(t){return function(){Yb(this,t)}}function Jb(t){return function(){Xb(this,t)}}function Qb(t,e){return function(){(e.apply(this,arguments)?Yb:Xb)(this,t)}}qb.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function $b(){this.textContent=""}function Kb(t){return function(){this.textContent=t}}function tx(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function ex(){this.innerHTML=""}function nx(t){return function(){this.innerHTML=t}}function rx(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function ix(){this.nextSibling&&this.parentNode.appendChild(this)}function ox(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ax(){return null}function sx(){var t=this.parentNode;t&&t.removeChild(this)}function cx(t,e,n){var r=Fb(t),i=r.CustomEvent;i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function lx(t,e){return function(){return cx(this,t,e)}}function ux(t,e){return function(){return cx(this,t,e.apply(this,arguments))}}var hx=[null];function dx(t,e){this._groups=t,this._parents=e}function fx(){return new dx([[document.documentElement]],hx)}dx.prototype=fx.prototype={constructor:dx,select:function(t){"function"!=typeof t&&(t=Sb(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a,s=e[i],c=s.length,l=r[i]=new Array(c),u=0;u<c;++u)(o=s[u])&&(a=t.call(o,o.__data__,u,s))&&("__data__"in o&&(a.__data__=o.__data__),l[u]=a);return new dx(r,this._parents)},selectAll:function(t){var e;"function"!=typeof t&&(t=null==(e=t)?Tb:function(){return this.querySelectorAll(e)});for(var n=this._groups,r=n.length,i=[],o=[],a=0;a<r;++a)for(var s,c=n[a],l=c.length,u=0;u<l;++u)(s=c[u])&&(i.push(t.call(s,s.__data__,u,c)),o.push(s));return new dx(i,o)},filter:function(t){"function"!=typeof t&&(t=mb(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,c=r[i]=[],l=0;l<s;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&c.push(o);return new dx(r,this._parents)},data:function(t,e){if(!t)return p=new Array(this.size()),u=-1,this.each((function(t){p[++u]=t})),p;var n,r=e?Cb:Lb,i=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=o.length,s=new Array(a),c=new Array(a),l=new Array(a),u=0;u<a;++u){var h=i[u],d=o[u],f=d.length,p=t.call(h,h&&h.__data__,u,i),m=p.length,g=c[u]=new Array(m),v=s[u]=new Array(m);r(h,d,g,v,l[u]=new Array(f),p,e);for(var y,b,x=0,_=0;x<m;++x)if(y=g[x]){for(x>=_&&(_=x+1);!(b=v[_])&&++_<m;);y._next=b||null}}return(s=new dx(s,i))._enter=c,s._exit=l,s},enter:function(){return new dx(this._enter||this._groups.map(Eb),this._parents)},exit:function(){return new dx(this._exit||this._groups.map(Eb),this._parents)},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var c,l=e[s],u=n[s],h=l.length,d=a[s]=new Array(h),f=0;f<h;++f)(c=l[f]||u[f])&&(d[f]=c);for(;s<r;++s)a[s]=e[s];return new dx(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=Rb);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],c=s.length,l=i[o]=new Array(c),u=0;u<c;++u)(a=s[u])&&(l[u]=a);l.sort(e)}return new dx(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=ab(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?Nb:Pb:"function"==typeof e?n.local?Ob:Ib:n.local?Db:zb)(n,e))},style:function(t,e,n){var r;return arguments.length>1?this.each((null==e?Ub:"function"==typeof e?Hb:Bb)(t,e,null==n?"":n)):Fb(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},property:function(t,e){return arguments.length>1?this.each((null==e?kb:"function"==typeof e?jb:Gb)(t,e)):this.node()[t]},classed:function(t,e){var n=Wb(t+"");if(arguments.length<2){for(var r=Vb(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?Qb:e?Zb:Jb)(n,e))},text:function(t){return arguments.length?this.each(null==t?$b:("function"==typeof t?tx:Kb)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ex:("function"==typeof t?rx:nx)(t)):this.node().innerHTML},raise:function(){return this.each(ix)},lower:function(){return this.each(ox)},append:function(t){var e="function"==typeof t?t:lb(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:lb(t),r=null==e?ax:"function"==typeof e?e:Sb(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(sx)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=xb(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?wb:_b,null==n&&(n=!1),r=0;r<a;++r)this.each(s(o[r],e,n));return this}var s=this.node().__on;if(s)for(var c,l=0,u=s.length;l<u;++l)for(r=0,c=s[l];r<a;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?ux:lx)(t,e))}};var px,mx=function(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]},gx=function(t){return(t=mx(Math.abs(t)))?t[1]:NaN},vx=function(t,e){var n=mx(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},yx={"":function(t,e){t:for(var n,r=(t=t.toPrecision(e)).length,i=1,o=-1;i<r;++i)switch(t[i]){case".":o=n=i;break;case"0":0===o&&(o=i),n=i;break;case"e":break t;default:o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(n+1):t},"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return vx(100*t,e)},r:vx,s:function(t,e){var n=mx(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(px=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+mx(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},bx=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i,xx=function(t){return new _x(t)};function _x(t){if(!(e=bx.exec(t)))throw new Error("invalid format: "+t);var e,n=e[1]||" ",r=e[2]||">",i=e[3]||"-",o=e[4]||"",a=!!e[5],s=e[6]&&+e[6],c=!!e[7],l=e[8]&&+e[8].slice(1),u=e[9]||"";"n"===u?(c=!0,u="g"):yx[u]||(u=""),(a||"0"===n&&"="===r)&&(a=!0,n="0",r="="),this.fill=n,this.align=r,this.sign=i,this.symbol=o,this.zero=a,this.width=s,this.comma=c,this.precision=l,this.type=u}_x.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var wx=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Mx(t){return t}var Sx,Tx,Ex,Ax=function(t){var e,n,r=t.grouping&&t.thousands?(e=t.grouping,n=t.thousands,function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}):Mx,i=t.currency,o=t.decimal;function a(t){var e=(t=xx(t)).fill,n=t.align,a=t.sign,s=t.symbol,c=t.zero,l=t.width,u=t.comma,h=t.precision,d=t.type,f="$"===s?i[0]:"#"===s&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",p="$"===s?i[1]:/[%p]/.test(d)?"%":"",m=yx[d],g=!d||/[defgprs%]/.test(d);function v(t){var i,s,v,y=f,b=p;if("c"===d)b=m(t)+b,t="";else{var x=((t=+t)<0||1/t<0)&&(t*=-1,!0);if(t=m(t,h),x)for(i=-1,s=t.length,x=!1;++i<s;)if(48<(v=t.charCodeAt(i))&&v<58||"x"===d&&96<v&&v<103||"X"===d&&64<v&&v<71){x=!0;break}if(y=(x?"("===a?a:"-":"-"===a||"("===a?"":a)+y,b=b+("s"===d?wx[8+px/3]:"")+(x&&"("===a?")":""),g)for(i=-1,s=t.length;++i<s;)if(48>(v=t.charCodeAt(i))||v>57){b=(46===v?o+t.slice(i+1):t.slice(i))+b,t=t.slice(0,i);break}}u&&!c&&(t=r(t,1/0));var _=y.length+t.length+b.length,w=_<l?new Array(l-_+1).join(e):"";switch(u&&c&&(t=r(w+t,w.length?l-b.length:1/0),w=""),n){case"<":return y+t+b+w;case"=":return y+w+t+b;case"^":return w.slice(0,_=w.length>>1)+y+t+b+w.slice(_)}return w+y+t+b}return h=null==h?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),v.toString=function(){return t+""},v}return{format:a,formatPrefix:function(t,e){var n=a(((t=xx(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(gx(e)/3))),i=Math.pow(10,-r),o=wx[8+r/3];return function(t){return n(i*t)+o}}}};!function(t){Sx=Ax(t),Tx=Sx.format,Ex=Sx.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Lx=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Cx=function(t){var e;return 1===t.length&&(e=t,t=function(t,n){return Lx(e(t),n)}),{left:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(null==r&&(r=0),null==i&&(i=e.length);r<i;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}};var Rx=Cx(Lx),Px=Rx.right,Nx=(Rx.left,Px),zx=Array.prototype,Dx=(zx.slice,zx.map,function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}),Ix=Math.sqrt(50),Ox=Math.sqrt(10),Fx=Math.sqrt(2),Ux=function(t,e,n){var r=Bx(t,e,n);return Dx(Math.ceil(t/r)*r,Math.floor(e/r)*r+r/2,r)};function Bx(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Ix?i*=10:o>=Ox?i*=5:o>=Fx&&(i*=2),e<t?-i:i}var Hx=function(t,e){var n,r=0,i=t.length,o=-1;if(null==e)for(;++o<i;)(n=+t[o])&&(r+=n);else for(;++o<i;)(n=+e(t[o],o,t))&&(r+=n);return r};function kx(){}function Gx(t,e){var n=new kx;if(t instanceof kx)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==e)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e(r=t[i],i,t),r)}else if(t)for(var a in t)n.set(a,t[a]);return n}kx.prototype=Gx.prototype={constructor:kx,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var jx=Gx;function Wx(){}var Vx=jx.prototype;function qx(t,e){var n=new Wx;if(t instanceof Wx)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}Wx.prototype=qx.prototype={constructor:Wx,has:Vx.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Vx.remove,clear:Vx.clear,values:Vx.keys,size:Vx.size,empty:Vx.empty,each:Vx.each};var Yx=Array.prototype,Xx=Yx.map,Zx=Yx.slice;var Jx=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},Qx=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function $x(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Kx(){}var t_="\\s*([+-]?\\d+)\\s*",e_="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",n_="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",r_=/^#([0-9a-f]{3,8})$/,i_=new RegExp("^rgb\\("+[t_,t_,t_]+"\\)$"),o_=new RegExp("^rgb\\("+[n_,n_,n_]+"\\)$"),a_=new RegExp("^rgba\\("+[t_,t_,t_,e_]+"\\)$"),s_=new RegExp("^rgba\\("+[n_,n_,n_,e_]+"\\)$"),c_=new RegExp("^hsl\\("+[e_,n_,n_]+"\\)$"),l_=new RegExp("^hsla\\("+[e_,n_,n_,e_]+"\\)$"),u_={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};function h_(){return this.rgb().formatHex()}function d_(){return this.rgb().formatRgb()}function f_(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=r_.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?p_(e):3===n?new y_(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?m_(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?m_(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=i_.exec(t))?new y_(e[1],e[2],e[3],1):(e=o_.exec(t))?new y_(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=a_.exec(t))?m_(e[1],e[2],e[3],e[4]):(e=s_.exec(t))?m_(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=c_.exec(t))?w_(e[1],e[2]/100,e[3]/100,1):(e=l_.exec(t))?w_(e[1],e[2]/100,e[3]/100,e[4]):u_.hasOwnProperty(t)?p_(u_[t]):"transparent"===t?new y_(NaN,NaN,NaN,0):null}function p_(t){return new y_(t>>16&255,t>>8&255,255&t,1)}function m_(t,e,n,r){return r<=0&&(t=e=n=NaN),new y_(t,e,n,r)}function g_(t){return t instanceof Kx||(t=f_(t)),t?new y_((t=t.rgb()).r,t.g,t.b,t.opacity):new y_}function v_(t,e,n,r){return 1===arguments.length?g_(t):new y_(t,e,n,null==r?1:r)}function y_(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function b_(){return"#"+__(this.r)+__(this.g)+__(this.b)}function x_(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"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))+(1===t?")":", "+t+")")}function __(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function w_(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new S_(t,e,n,r)}function M_(t){if(t instanceof S_)return new S_(t.h,t.s,t.l,t.opacity);if(t instanceof Kx||(t=f_(t)),!t)return new S_;if(t instanceof S_)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new S_(a,s,c,t.opacity)}function S_(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function T_(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function E_(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Qx(Kx,f_,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:h_,formatHex:h_,formatHsl:function(){return M_(this).formatHsl()},formatRgb:d_,toString:d_}),Qx(y_,v_,$x(Kx,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new y_(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new y_(this.r*t,this.g*t,this.b*t,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:b_,formatHex:b_,formatRgb:x_,toString:x_})),Qx(S_,(function(t,e,n,r){return 1===arguments.length?M_(t):new S_(t,e,n,null==r?1:r)}),$x(Kx,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new S_(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new S_(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new y_(T_(t>=240?t-240:t+120,i,r),T_(t,i,r),T_(t<120?t+240:t-120,i,r),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 t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var A_=function(t){return function(){return t}};function L_(t,e){return function(n){return t+n*e}}function C_(t){return 1==(t=+t)?R_:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):A_(isNaN(e)?n:e)}}function R_(t,e){var n=e-t;return n?L_(t,n):A_(isNaN(t)?e:t)}var P_=function t(e){var n=C_(e);function r(t,e){var r=n((t=v_(t)).r,(e=v_(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=R_(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function N_(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=v_(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}N_((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return E_((n-r/e)*e,a,i,o,s)}})),N_((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return E_((n-r/e)*e,i,o,a,s)}}));var z_=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function D_(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function I_(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=k_(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var O_=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},F_=function(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=k_(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},U_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,B_=new RegExp(U_.source,"g");var H_=function(t,e){var n,r,i,o=U_.lastIndex=B_.lastIndex=0,a=-1,s=[],c=[];for(t+="",e+="";(n=U_.exec(t))&&(r=B_.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,c.push({i:a,x:Jx(n,r)})),o=B_.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var n,r=0;r<e;++r)s[(n=c[r]).i]=n.x(t);return s.join("")})},k_=function(t,e){var n,r=typeof e;return null==e||"boolean"===r?A_(e):("number"===r?Jx:"string"===r?(n=f_(e))?(e=n,P_):H_:e instanceof f_?P_:e instanceof Date?O_:D_(e)?z_:Array.isArray(e)?I_:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?F_:Jx)(t,e)},G_=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}},j_=function(t){return function(){return t}},W_=function(t){return+t},V_=[0,1];function q_(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:j_(e)}function Y_(t,e,n,r){var i=t[0],o=t[1],a=e[0],s=e[1];return o<i?(i=n(o,i),a=r(s,a)):(i=n(i,o),a=r(a,s)),function(t){return a(i(t))}}function X_(t,e,n,r){var i=Math.min(t.length,e.length)-1,o=new Array(i),a=new Array(i),s=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<i;)o[s]=n(t[s],t[s+1]),a[s]=r(e[s],e[s+1]);return function(e){var n=Nx(t,e,1,i)-1;return a[n](o[n](e))}}function Z_(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function J_(t,e){var n,r,i,o=V_,a=V_,s=k_,c=!1;function l(){return n=Math.min(o.length,a.length)>2?X_:Y_,r=i=null,u}function u(e){return(r||(r=n(o,a,c?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=e?0:t>=n?1:r(t)}}}(t):t,s)))(+e)}return u.invert=function(t){return(i||(i=n(a,o,q_,c?function(t){return function(e,n){var r=t(e=+e,n=+n);return function(t){return t<=0?e:t>=1?n:r(t)}}}(e):e)))(+t)},u.domain=function(t){return arguments.length?(o=Xx.call(t,W_),l()):o.slice()},u.range=function(t){return arguments.length?(a=Zx.call(t),l()):a.slice()},u.rangeRound=function(t){return a=Zx.call(t),s=G_,l()},u.clamp=function(t){return arguments.length?(c=!!t,l()):c},u.interpolate=function(t){return arguments.length?(s=t,l()):s},l()}var Q_=function(t,e,n){var r,i=t[0],o=t[t.length-1],a=Bx(i,o,null==e?10:e);switch((n=xx(null==n?",f":n)).type){case"s":var s=Math.max(Math.abs(i),Math.abs(o));return null!=n.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(gx(e)/3)))-gx(Math.abs(t)))}(a,s))||(n.precision=r),Ex(n,s);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,gx(e)-gx(t))+1}(a,Math.max(Math.abs(i),Math.abs(o))))||(n.precision=r-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(r=function(t){return Math.max(0,-gx(Math.abs(t)))}(a))||(n.precision=r-2*("%"===n.type))}return Tx(n)};function $_(t){var e=t.domain;return t.ticks=function(t){var n=e();return Ux(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){return Q_(e(),t,n)},t.nice=function(n){var r=e(),i=r.length-1,o=null==n?10:n,a=r[0],s=r[i],c=Bx(a,s,o);return c&&(c=Bx(Math.floor(a/c)*c,Math.ceil(s/c)*c,o),r[0]=Math.floor(a/c)*c,r[i]=Math.ceil(s/c)*c,e(r)),t},t}function K_(){var t=J_(q_,Jx);return t.copy=function(){return Z_(t,K_())},$_(t)}var tw=new Date,ew=new Date;function nw(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e<n-t?e:n},i.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),e(n,o),t(n)}while(a<n&&n<r);return s},i.filter=function(n){return nw((function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return tw.setTime(+e),ew.setTime(+r),t(tw),t(ew),Math.floor(n(tw,ew))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var rw=nw((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));rw.every=function(t){return isFinite(t=Math.floor(t))&&t>0?nw((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var iw=rw,ow=(rw.range,nw((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})));ow.range;function aw(t){return nw((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var sw=aw(0),cw=aw(1),lw=aw(2),uw=aw(3),hw=aw(4),dw=aw(5),fw=aw(6),pw=(sw.range,cw.range,lw.range,uw.range,hw.range,dw.range,fw.range,nw((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1}))),mw=pw,gw=(pw.range,nw((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),vw=(gw.range,nw((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}))),yw=(vw.range,nw((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),bw=(yw.range,nw((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));bw.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?nw((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):bw:null};bw.range;function xw(t){return nw((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var _w=xw(0),ww=xw(1),Mw=xw(2),Sw=xw(3),Tw=xw(4),Ew=xw(5),Aw=xw(6),Lw=(_w.range,ww.range,Mw.range,Sw.range,Tw.range,Ew.range,Aw.range,nw((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),Cw=Lw,Rw=(Lw.range,nw((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));Rw.every=function(t){return isFinite(t=Math.floor(t))&&t>0?nw((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Pw=Rw;Rw.range;function Nw(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function zw(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Dw(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}var Iw,Ow={"-":"",_:" ",0:"0"},Fw=/^\s*\d+/,Uw=/^%/,Bw=/[\\^$*+?|[\]().{}]/g;function Hw(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(e)+i:i)}function kw(t){return t.replace(Bw,"\\$&")}function Gw(t){return new RegExp("^(?:"+t.map(kw).join("|")+")","i")}function jw(t){for(var e={},n=-1,r=t.length;++n<r;)e[t[n].toLowerCase()]=n;return e}function Ww(t,e,n){var r=Fw.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Vw(t,e,n){var r=Fw.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function qw(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Yw(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Xw(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function Zw(t,e,n){var r=Fw.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Jw(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Qw(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function $w(t,e,n){var r=Fw.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function Kw(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function tM(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function eM(t,e,n){var r=Fw.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function nM(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function rM(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function iM(t,e,n){var r=Fw.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function oM(t,e,n){var r=Fw.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function aM(t,e,n){var r=Fw.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function sM(t,e,n){var r=Uw.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function cM(t,e,n){var r=Fw.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function lM(t,e,n){var r=Fw.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function uM(t,e){return Hw(t.getDate(),e,2)}function hM(t,e){return Hw(t.getHours(),e,2)}function dM(t,e){return Hw(t.getHours()%12||12,e,2)}function fM(t,e){return Hw(1+mw.count(iw(t),t),e,3)}function pM(t,e){return Hw(t.getMilliseconds(),e,3)}function mM(t,e){return pM(t,e)+"000"}function gM(t,e){return Hw(t.getMonth()+1,e,2)}function vM(t,e){return Hw(t.getMinutes(),e,2)}function yM(t,e){return Hw(t.getSeconds(),e,2)}function bM(t){var e=t.getDay();return 0===e?7:e}function xM(t,e){return Hw(sw.count(iw(t)-1,t),e,2)}function _M(t){var e=t.getDay();return e>=4||0===e?hw(t):hw.ceil(t)}function wM(t,e){return t=_M(t),Hw(hw.count(iw(t),t)+(4===iw(t).getDay()),e,2)}function MM(t){return t.getDay()}function SM(t,e){return Hw(cw.count(iw(t)-1,t),e,2)}function TM(t,e){return Hw(t.getFullYear()%100,e,2)}function EM(t,e){return Hw((t=_M(t)).getFullYear()%100,e,2)}function AM(t,e){return Hw(t.getFullYear()%1e4,e,4)}function LM(t,e){var n=t.getDay();return Hw((t=n>=4||0===n?hw(t):hw.ceil(t)).getFullYear()%1e4,e,4)}function CM(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Hw(e/60|0,"0",2)+Hw(e%60,"0",2)}function RM(t,e){return Hw(t.getUTCDate(),e,2)}function PM(t,e){return Hw(t.getUTCHours(),e,2)}function NM(t,e){return Hw(t.getUTCHours()%12||12,e,2)}function zM(t,e){return Hw(1+Cw.count(Pw(t),t),e,3)}function DM(t,e){return Hw(t.getUTCMilliseconds(),e,3)}function IM(t,e){return DM(t,e)+"000"}function OM(t,e){return Hw(t.getUTCMonth()+1,e,2)}function FM(t,e){return Hw(t.getUTCMinutes(),e,2)}function UM(t,e){return Hw(t.getUTCSeconds(),e,2)}function BM(t){var e=t.getUTCDay();return 0===e?7:e}function HM(t,e){return Hw(_w.count(Pw(t)-1,t),e,2)}function kM(t){var e=t.getUTCDay();return e>=4||0===e?Tw(t):Tw.ceil(t)}function GM(t,e){return t=kM(t),Hw(Tw.count(Pw(t),t)+(4===Pw(t).getUTCDay()),e,2)}function jM(t){return t.getUTCDay()}function WM(t,e){return Hw(ww.count(Pw(t)-1,t),e,2)}function VM(t,e){return Hw(t.getUTCFullYear()%100,e,2)}function qM(t,e){return Hw((t=kM(t)).getUTCFullYear()%100,e,2)}function YM(t,e){return Hw(t.getUTCFullYear()%1e4,e,4)}function XM(t,e){var n=t.getUTCDay();return Hw((t=n>=4||0===n?Tw(t):Tw.ceil(t)).getUTCFullYear()%1e4,e,4)}function ZM(){return"+0000"}function JM(){return"%"}function QM(t){return+t}function $M(t){return Math.floor(+t/1e3)}!function(t){Iw=function(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,c=t.shortMonths,l=Gw(i),u=jw(i),h=Gw(o),d=jw(o),f=Gw(a),p=jw(a),m=Gw(s),g=jw(s),v=Gw(c),y=jw(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:uM,e:uM,f:mM,g:EM,G:LM,H:hM,I:dM,j:fM,L:pM,m:gM,M:vM,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:QM,s:$M,S:yM,u:bM,U:xM,V:wM,w:MM,W:SM,x:null,X:null,y:TM,Y:AM,Z:CM,"%":JM},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:RM,e:RM,f:IM,g:qM,G:XM,H:PM,I:NM,j:zM,L:DM,m:OM,M:FM,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:QM,s:$M,S:UM,u:BM,U:HM,V:GM,w:jM,W:WM,x:null,X:null,y:VM,Y:YM,Z:ZM,"%":JM},_={a:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=d[r[0].toLowerCase()],n+r[0].length):-1},b:function(t,e,n){var r=v.exec(e.slice(n));return r?(t.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(t,n,r){return S(t,e,n,r)},d:tM,e:tM,f:aM,g:Jw,G:Zw,H:nM,I:nM,j:eM,L:oM,m:Kw,M:rM,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=u[r[0].toLowerCase()],n+r[0].length):-1},q:$w,Q:cM,s:lM,S:iM,u:Vw,U:qw,V:Yw,w:Ww,W:Xw,x:function(t,e,r){return S(t,n,e,r)},X:function(t,e,n){return S(t,r,e,n)},y:Jw,Y:Zw,Z:Qw,"%":sM};function w(t,e){return function(n){var r,i,o,a=[],s=-1,c=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++s<l;)37===t.charCodeAt(s)&&(a.push(t.slice(c,s)),null!=(i=Ow[r=t.charAt(++s)])?r=t.charAt(++s):i="e"===r?" ":"0",(o=e[r])&&(r=o(n,i)),a.push(r),c=s+1);return a.push(t.slice(c,s)),a.join("")}}function M(t,e){return function(n){var r,i,o=Dw(1900,void 0,1);if(S(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=zw(Dw(o.y,0,1))).getUTCDay(),r=i>4||0===i?ww.ceil(r):ww(r),r=Cw.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Nw(Dw(o.y,0,1))).getDay(),r=i>4||0===i?cw.ceil(r):cw(r),r=mw.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?zw(Dw(o.y,0,1)).getUTCDay():Nw(Dw(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,zw(o)):Nw(o)}}function S(t,e,n,r){for(var i,o,a=0,s=e.length,c=n.length;a<s;){if(r>=c)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=_[i in Ow?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(e,b),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",b);return e.toString=function(){return t},e},parse:function(t){var e=M(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=M(t+="",!0);return e.toString=function(){return t},e}}}(t),Iw.format,Iw.parse,Iw.utcFormat,Iw.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var KM=nw((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),tS=(KM.range,nw((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getUTCHours()}))),eS=(tS.range,nw((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getUTCMinutes()}))),nS=(eS.range,function(t){return t.match(/.{6}/g).map((function(t){return"#"+t}))}),rS=(nS("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),nS("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),nS("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),nS("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),Math.PI/180),iS=180/Math.PI;function oS(t){if(t instanceof sS)return new sS(t.h,t.s,t.l,t.opacity);t instanceof y_||(t=g_(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(-.6557636667999999*r+-1.7884503806*e-3.5172982438*n)/-5.9615122912,o=r-i,a=(1.97294*(n-i)- -.29227*o)/-.90649,s=Math.sqrt(a*a+o*o)/(1.97294*i*(1-i)),c=s?Math.atan2(a,o)*iS-120:NaN;return new sS(c<0?c+360:c,s,i,t.opacity)}function aS(t,e,n,r){return 1===arguments.length?oS(t):new sS(t,e,n,null==r?1:r)}function sS(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function cS(t){return function e(n){function r(e,r){var i=t((e=aS(e)).h,(r=aS(r)).h),o=R_(e.s,r.s),a=R_(e.l,r.l),s=R_(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}Qx(sS,aS,$x(Kx,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new sS(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new sS(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*rS,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new y_(255*(e+n*(-.14861*r+1.78277*i)),255*(e+n*(-.29227*r+-.90649*i)),255*(e+n*(1.97294*r)),this.opacity)}}));cS((function(t,e){var n=e-t;return n?L_(t,n>180||n<-180?n-360*Math.round(n/360):n):A_(isNaN(t)?e:t)}));var lS=cS(R_);lS(aS(300,.5,0),aS(-240,.5,1)),lS(aS(-100,.75,.35),aS(80,1.5,.8)),lS(aS(260,.75,.35),aS(80,1.5,.8)),aS();function uS(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}uS(nS("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),uS(nS("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),uS(nS("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),uS(nS("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));var hS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dS=function(t){return t},fS=function(t){for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[r-n-1];return e},pS=function(t,e){t.each((function(){for(var t,n,r="string"==typeof(n=this)?new dx([[document.querySelector(n)]],[document.documentElement]):new dx([[n]],hx),i=r.text().split(/\s+/).reverse(),o=[],a=(r.attr("y"),parseFloat(r.attr("dy"))||0),s=r.text(null).append("tspan").attr("x",0).attr("dy",a+"em");t=i.pop();)o.push(t),s.text(o.join(" ")),s.node().getComputedTextLength()>e&&o.length>1&&(o.pop(),s.text(o.join(" ")),o=[t],s=r.append("tspan").attr("x",0).attr("dy",1.2+a+"em").text(t))}))},mS={d3_drawShapes:function(t,e,n,r,i,o){"rect"===t?e.attr("height",n).attr("width",r):"circle"===t?e.attr("r",i):"line"===t?e.attr("x1",0).attr("x2",r).attr("y1",0).attr("y2",0):"path"===t&&e.attr("d",o)},d3_addText:function(t,e,n,r,i){e.append("text").attr("class",r+"label");var o=t.selectAll("g."+r+"cell text."+r+"label").data(n).text(dS);return i&&t.selectAll("g."+r+"cell text."+r+"label").call(pS,i),o},d3_calcType:function(t,e,n,r,i,o){var a=t.invertExtent?function(t,e,n){var r=t.range().map((function(r){var i=t.invertExtent(r);return e(i[0])+" "+n+" "+e(i[1])}));return{data:t.range(),labels:r,feature:dS}}(t,i,o):t.ticks?function(t,e,n){var r=[];if(e.length>1)r=e;else for(var i=t.domain(),o=(i[i.length-1]-i[0])/(e-1),a=0;a<e;a++)r.push(i[0]+a*o);var s=r.map(n);return{data:r,labels:s,feature:function(e){return t(e)}}}(t,n,i):function(t){return{data:t.domain(),labels:t.domain(),feature:function(e){return t(e)}}}(t),s=t.range&&t.range()||t.domain();return a.labels=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[4];if("object"===(void 0===e?"undefined":hS(e))){if(0===e.length)return t;for(var o=e.length;o<t.length;o++)e.push(t[o]);return e}if("function"==typeof e){for(var a=[],s=t.length,c=0;c<s;c++)a.push(e({i:c,genLength:s,generatedLabels:t,domain:n,range:r,labelDelimiter:i}));return a}return t}(a.labels,r,t.domain(),s,o),e&&(a.labels=fS(a.labels),a.data=fS(a.data)),a},d3_filterCells:function(t,e){var n=t.data.map((function(e,n){return{data:e,label:t.labels[n]}})).filter(e),r=n.map((function(t){return t.data})),i=n.map((function(t){return t.label}));return t.data=t.data.filter((function(t){return-1!==r.indexOf(t)})),t.labels=t.labels.filter((function(t){return-1!==i.indexOf(t)})),t},d3_placement:function(t,e,n,r,i,o){e.attr("transform",n),r.attr("transform",i),"horizontal"===t&&r.style("text-anchor",o)},d3_addEvents:function(t,e){t.on("mouseover.legend",(function(t){!function(t,e,n){t.call("cellover",n,e)}(e,t,this)})).on("mouseout.legend",(function(t){!function(t,e,n){t.call("cellout",n,e)}(e,t,this)})).on("click.legend",(function(t){!function(t,e,n){t.call("cellclick",n,e)}(e,t,this)}))},d3_title:function(t,e,n,r){if(""!==e){t.selectAll("text."+n+"legendTitle").data([e]).enter().append("text").attr("class",n+"legendTitle"),t.selectAll("text."+n+"legendTitle").text(e),r&&t.selectAll("text."+n+"legendTitle").call(pS,r);var i=t.select("."+n+"legendCells"),o=t.select("."+n+"legendTitle").nodes().map((function(t){return t.getBBox().height}))[0],a=-i.nodes().map((function(t){return t.getBBox().x}))[0];i.attr("transform","translate("+a+","+o+")")}},d3_defaultLocale:{format:Tx,formatPrefix:Ex},d3_defaultFormatSpecifier:".01f",d3_defaultDelimiter:"to"};function gS(){var t=K_(),e="rect",n=15,r=15,i=10,o=2,a=[5],s=void 0,c=[],l="",u=!1,h="",f=mS.d3_defaultLocale,p=mS.d3_defaultFormatSpecifier,m=10,g="middle",v=mS.d3_defaultDelimiter,y=void 0,b="vertical",x=!1,_=void 0,w=void 0,M=d("cellover","cellout","cellclick");function S(d){var S=mS.d3_calcType(t,x,a,c,f.format(p),v);d.selectAll("g").data([t]).enter().append("g").attr("class",l+"legendCells"),s&&mS.d3_filterCells(S,s);var T=d.select("."+l+"legendCells").selectAll("."+l+"cell").data(S.data),E=T.enter().append("g").attr("class",l+"cell");E.append(e).attr("class",l+"swatch");var A=d.selectAll("g."+l+"cell "+e+"."+l+"swatch").data(S.data);mS.d3_addEvents(E,M),T.exit().transition().style("opacity",0).remove(),A.exit().transition().style("opacity",0).remove(),A=A.merge(A),mS.d3_drawShapes(e,A,r,n,i,_);var L=mS.d3_addText(d,E,S.labels,l,y);T=E.merge(T);var C=L.nodes().map((function(t){return t.getBBox()})),R=A.nodes().map((function(t){return t.getBBox()}));u?A.attr("class",(function(t){return l+"swatch "+S.feature(t)})):"line"==e?A.style("stroke",S.feature):A.style("fill",S.feature);var P,N=void 0,z=void 0,D="start"==g?0:"middle"==g?.5:1;"vertical"===b?(P=C.map((function(t,e){return Math.max(t.height,R[e].height)})),N=function(t,e){return"translate(0, "+(Hx(P.slice(0,e))+e*o)+")"},z=function(t,e){return"translate( "+(R[e].width+R[e].x+m)+", "+(R[e].y+R[e].height/2+5)+")"}):"horizontal"===b&&(N=function(t,e){return"translate("+e*(R[e].width+o)+",0)"},z=function(t,e){return"translate("+(R[e].width*D+R[e].x)+",\n "+(R[e].height+R[e].y+m+8)+")"}),mS.d3_placement(b,T,N,L,z,g),mS.d3_title(d,h,l,w),T.transition().style("opacity",1)}return S.scale=function(e){return arguments.length?(t=e,S):t},S.cells=function(t){return arguments.length?((t.length>1||t>=2)&&(a=t),S):a},S.cellFilter=function(t){return arguments.length?(s=t,S):s},S.shape=function(t,n){return arguments.length?(("rect"==t||"circle"==t||"line"==t||"path"==t&&"string"==typeof n)&&(e=t,_=n),S):e},S.shapeWidth=function(t){return arguments.length?(n=+t,S):n},S.shapeHeight=function(t){return arguments.length?(r=+t,S):r},S.shapeRadius=function(t){return arguments.length?(i=+t,S):i},S.shapePadding=function(t){return arguments.length?(o=+t,S):o},S.labels=function(t){return arguments.length?(c=t,S):c},S.labelAlign=function(t){return arguments.length?("start"!=t&&"end"!=t&&"middle"!=t||(g=t),S):g},S.locale=function(t){return arguments.length?(f=Ax(t),S):f},S.labelFormat=function(t){return arguments.length?(p=xx(t),S):S.locale().format(p)},S.labelOffset=function(t){return arguments.length?(m=+t,S):m},S.labelDelimiter=function(t){return arguments.length?(v=t,S):v},S.labelWrap=function(t){return arguments.length?(y=t,S):y},S.useClass=function(t){return arguments.length?(!0!==t&&!1!==t||(u=t),S):u},S.orient=function(t){return arguments.length?("horizontal"!=(t=t.toLowerCase())&&"vertical"!=t||(b=t),S):b},S.ascending=function(t){return arguments.length?(x=!!t,S):x},S.classPrefix=function(t){return arguments.length?(l=t,S):l},S.title=function(t){return arguments.length?(h=t,S):h},S.titleWidth=function(t){return arguments.length?(w=t,S):w},S.textWrap=function(t){return arguments.length?(textWrap=t,S):textWrap},S.on=function(){var t=M.on.apply(M,arguments);return t===M?S:t},S}var vS=function(t){return At(dt(t).call(document.documentElement))},yS=Array.prototype.slice,bS=function(t){return t};function xS(t){return"translate("+(t+.5)+",0)"}function _S(t){return"translate(0,"+(t+.5)+")"}function wS(t){return e=>+t(e)}function MS(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(n){return+t(n)+e}}function SS(){return!this.__axis}function TS(t,e){var n=[],r=null,i=null,o=6,a=6,s=3,c=1===t||4===t?-1:1,l=4===t||2===t?"x":"y",u=1===t||3===t?xS:_S;function h(h){var d=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,f=null==i?e.tickFormat?e.tickFormat.apply(e,n):bS:i,p=Math.max(o,0)+s,m=e.range(),g=+m[0]+.5,v=+m[m.length-1]+.5,y=(e.bandwidth?MS:wS)(e.copy()),b=h.selection?h.selection():h,x=b.selectAll(".domain").data([null]),_=b.selectAll(".tick").data(d,e).order(),w=_.exit(),M=_.enter().append("g").attr("class","tick"),S=_.select("line"),T=_.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),_=_.merge(M),S=S.merge(M.append("line").attr("stroke","currentColor").attr(l+"2",c*o)),T=T.merge(M.append("text").attr("fill","currentColor").attr(l,c*p).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),h!==b&&(x=x.transition(h),_=_.transition(h),S=S.transition(h),T=T.transition(h),w=w.transition(h).attr("opacity",1e-6).attr("transform",(function(t){return isFinite(t=y(t))?u(t):this.getAttribute("transform")})),M.attr("opacity",1e-6).attr("transform",(function(t){var e=this.parentNode.__axis;return u(e&&isFinite(e=e(t))?e:y(t))}))),w.remove(),x.attr("d",4===t||2==t?a?"M"+c*a+","+g+"H0.5V"+v+"H"+c*a:"M0.5,"+g+"V"+v:a?"M"+g+","+c*a+"V0.5H"+v+"V"+c*a:"M"+g+",0.5H"+v),_.attr("opacity",1).attr("transform",(function(t){return u(y(t))})),S.attr(l+"2",c*o),T.attr(l,c*p).text(f),b.filter(SS).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),b.each((function(){this.__axis=y}))}return h.scale=function(t){return arguments.length?(e=t,h):e},h.ticks=function(){return n=yS.call(arguments),h},h.tickArguments=function(t){return arguments.length?(n=null==t?[]:yS.call(t),h):n.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:yS.call(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(s=+t,h):s},h}let ES,AS;function LS(t){ES=t.legend_.title?t.legend_.title:t.colorField_,"cells"==t.legend_.type?function(t){let e;document.getElementById("gridviz-legend")?e=At("#gridviz-legend"):(e=vS("svg").attr("id","gridviz-legend"),t.container_.appendChild(e.node()));"horizontal"==t.legend_.orientation?e.attr("class","gridviz-legend-horizontal gridviz-plugin"):e.attr("class","gridviz-legend-vertical gridviz-plugin");let n=e.append("g").attr("class","gridviz-legend-svg").attr("height",t.legend_.height).attr("width",t.legend_.width).attr("transform","translate(10,15)");t._gridLegend=gS().shapeWidth(t.legend_.shapeWidth).cells(t.legend_.cells).labelFormat(vo(t.legend_.format)).orient(t.legend_.orientation).scale(t.colorScaleFunction_).title(ES).titleWidth(t.legend_.titleWidth),t.thresholds_&&t._gridLegend.labels(CS);n.call(t._gridLegend),t.legend_.height||(t.legend_.height=320);e.style("height",t.legend_.height+"px"),e.style("width",t.legend_.width+"px")}(t):"continuous"==t.legend_.type&&function(t){let e;document.getElementById("gridviz-legend")?e=At("#gridviz-legend"):(e=vS("div").attr("id","gridviz-legend"),e.attr("class","gridviz-plugin"),t.container_.appendChild(e.node()));let n=t.legend_.tickSize||6,r=t.legend_.width||500,i=t.legend_.height||44+n,o=t.legend_.marginBottom||16+n,a=t.legend_.ticks||r/64;t._gridLegend=function({color:t,title:e,tickSize:n,width:r,height:i,marginTop:o,marginRight:a,marginBottom:s,marginLeft:c,ticks:l,tickFormat:u,tickValues:h}={}){const d=vS("svg").attr("class","gridviz-legend-svg").attr("width",r).attr("height",i).attr("viewBox",[0,0,r,i]).style("overflow","visible").style("display","block");let f;if(t.interpolator){if(f=Object.assign(t.copy().interpolator(Qi(c,r-a)),{range:()=>[c,r-a]}),d.append("image").attr("x",c).attr("y",o).attr("width",r-c-a).attr("height",i-o-s).attr("preserveAspectRatio","none").attr("xlink:href",function(t,e=256){const n=document.createElement("CANVAS");n.width=e,n.height=1;const r=n.getContext("2d");for(let n=0;n<e;++n)r.fillStyle=t(n/(e-1)),r.fillRect(n,0,1,1);return n}(t.interpolator()).toDataURL()),!f.ticks){if(void 0===h){const e=Math.round(l+1);h=Ao(e).map(n=>oa(t.domain(),n/(e-1)))}"function"!=typeof u&&(u=vo(void 0===u?",f":u))}}else if(t.invertExtent){const e=t.thresholds?t.thresholds():t.quantiles?t.quantiles():t.domain(),n=void 0===u?t=>t:"string"==typeof u?vo(u):u;f=To().domain([-1,t.range().length-1]).rangeRound([c,r-a]),d.append("g").selectAll("rect").data(t.range()).join("rect").attr("x",(t,e)=>f(e-1)).attr("y",o).attr("width",(t,e)=>f(e)-f(e-1)).attr("height",i-o-s).attr("fill",t=>t),h=Ao(e.length),u=t=>n(e[t],t)}return d.append("g").attr("transform",`translate(0, ${i-s})`).call(function(t){return TS(3,t)}(f).ticks(l,"string"==typeof u?u:void 0).tickFormat("function"==typeof u?u:void 0).tickSize(n).tickValues(h)).call(t=>t.selectAll(".tick line").attr("y1",o+s-i)).call(t=>t.select(".domain").remove()).call(t=>t.append("text").attr("y",o+s-i-10).attr("fill","currentColor").attr("text-anchor","start").attr("font-weight","bold").attr("class","gridviz-continuous-legend-title").text(e)),d.node()}({color:t.colorScaleFunction_,title:ES,tickSize:n,width:r,height:i,marginBottom:o,ticks:a,marginTop:t.legend_.marginRight||18,marginRight:t.legend_.marginRight||0,marginLeft:t.legend_.marginLeft||0,tickFormat:t.legend_.tickFormat||".0f",tickValues:t.thresholds_||void 0}),e.node().appendChild(t._gridLegend)}(t)}function CS({i:t,genLength:e,generatedLabels:n,labelDelimiter:r}){if(0===t){return"Less than "+n[t].split(` ${r} `)[1]}if(t===e-1){return n[t].split(` ${r} `)[0]+" or more"}return n[t]}function RS(t){var e;(e=".gridviz-legend-svg","string"==typeof e?new St([document.querySelectorAll(e)],[document.documentElement]):new St([null==e?[]:m(e)],Mt)).remove();setTimeout(LS(t),1e3)}function PS(t,e,n){AS.position.set(t,e,n),AS.lookAt(new bl(t,e,n))}function NS(t){let e=zS(t);AS.fov=e.fov_,AS.aspect=e.aspect_,AS.near=e.near_,AS.far=e.far_}function zS(t){let e={};return e.near_=function(t){return t._mobile?1e-4:.01}(t),e.far_=function(t){return t._mobile?5:5e4*t.resolution_}(t),e.fov_=50,e.aspect_=t.width_/t.height_,t._mobile?e.initialZ_=e.far_/2-1:e.initialZ_=t.zoom_||e.far_/2-1,e.zoom_=t.zoom_||e.initialZ_,e}function DS(t){let e=Ey(t.height_,t.cameraConfig.fov_,t.cameraConfig.far_),n=Ey(t.height_,t.cameraConfig.fov_,t.cameraConfig.near_);if(t.d3zoom=function(){var t,e,n,r=Un,i=Bn,o=jn,a=kn,s=Gn,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,h=Dt,f=d("start","zoom","end"),p=0,m=10;function g(t){t.property("__zoom",Hn).on("wheel.zoom",M).on("mousedown.zoom",S).on("dblclick.zoom",T).filter(s).on("touchstart.zoom",E).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new Dn(e,t.x,t.y)}function y(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new Dn(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,e,n,r){t.on("start.zoom",(function(){_(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){_(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=_(t,o).event(r),s=i.apply(t,o),c=null==n?b(s):"function"==typeof n?n.apply(t,o):n,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=t.__zoom,d="function"==typeof e?e.apply(t,o):e,f=h(u.invert(c).concat(l/u.k),d.invert(c).concat(l/d.k));return function(t){if(1===t)t=d;else{var e=f(t),n=l/e[2];t=new Dn(n,c[0]-e[0]*n,c[1]-e[1]*n)}a.zoom(null,t)}}))}function _(t,e,n){return!n&&t.__zooming||new w(t,e)}function w(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function M(t,...e){if(r.apply(this,arguments)){var n=_(this,e).event(t),i=this.__zoom,s=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,a.apply(this,arguments)))),u=It(t);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=i.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(i.k===s)return;n.mouse=[u,i.invert(u)],oe(this),n.start()}Fn(t),n.wheel=setTimeout(h,150),n.zoom("mouse",o(y(v(i,s),n.mouse[0],n.mouse[1]),n.extent,l))}function h(){n.wheel=null,n.end()}}function S(t,...e){if(!n&&r.apply(this,arguments)){var i=_(this,e,!0).event(t),a=At(t.view).on("mousemove.zoom",d,!0).on("mouseup.zoom",f,!0),s=It(t,c),c=t.currentTarget,u=t.clientX,h=t.clientY;Ct(t.view),On(t),i.mouse=[s,this.__zoom.invert(s)],oe(this),i.start()}function d(t){if(Fn(t),!i.moved){var e=t.clientX-u,n=t.clientY-h;i.moved=e*e+n*n>p}i.event(t).zoom("mouse",o(y(i.that.__zoom,i.mouse[0]=It(t,c),i.mouse[1]),i.extent,l))}function f(t){a.on("mousemove.zoom mouseup.zoom",null),Rt(t.view,i.moved),Fn(t),i.event(t).end()}}function T(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=It(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),c=n.k*(t.shiftKey?.5:2),h=o(y(v(n,c),a,s),i.apply(this,e),l);Fn(t),u>0?At(this).transition().duration(u).call(x,h,a,t):At(this).call(g.transform,h,a,t)}}function E(n,...i){if(r.apply(this,arguments)){var o,a,s,c,l=n.touches,u=l.length,h=_(this,i,n.changedTouches.length===u).event(n);for(On(n),a=0;a<u;++a)s=l[a],c=[c=It(s,this),this.__zoom.invert(c),s.identifier],h.touch0?h.touch1||h.touch0[2]===c[2]||(h.touch1=c,h.taps=0):(h.touch0=c,o=!0,h.taps=1+!!t);t&&(t=clearTimeout(t)),o&&(h.taps<2&&(e=c[0],t=setTimeout((function(){t=null}),500)),oe(this),h.start())}}function A(t,...e){if(this.__zooming){var n,r,i,a,s=_(this,e).event(t),c=t.changedTouches,u=c.length;for(Fn(t),n=0;n<u;++n)r=c[n],i=It(r,this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=i:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=i);if(r=s.that.__zoom,s.touch1){var h=s.touch0[0],d=s.touch0[1],f=s.touch1[0],p=s.touch1[1],m=(m=f[0]-h[0])*m+(m=f[1]-h[1])*m,g=(g=p[0]-d[0])*g+(g=p[1]-d[1])*g;r=v(r,Math.sqrt(m/g)),i=[(h[0]+f[0])/2,(h[1]+f[1])/2],a=[(d[0]+p[0])/2,(d[1]+p[1])/2]}else{if(!s.touch0)return;i=s.touch0[0],a=s.touch0[1]}s.zoom("touch",o(y(r,i,a),s.extent,l))}}function L(t,...r){if(this.__zooming){var i,o,a=_(this,r).event(t),s=t.changedTouches,c=s.length;for(On(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),i=0;i<c;++i)o=s[i],a.touch0&&a.touch0[2]===o.identifier?delete a.touch0:a.touch1&&a.touch1[2]===o.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(o=It(o,this),Math.hypot(e[0]-o[0],e[1]-o[1])<m)){var l=At(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return g.transform=function(t,e,n,r){var i=t.selection?t.selection():t;i.property("__zoom",Hn),t!==i?x(t,e,n,r):i.interrupt().each((function(){_(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},g.scaleBy=function(t,e,n,r){g.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n,r)},g.scaleTo=function(t,e,n,r){g.transform(t,(function(){var t=i.apply(this,arguments),r=this.__zoom,a=null==n?b(t):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return o(y(v(r,c),a,s),t,l)}),n,r)},g.translateBy=function(t,e,n,r){g.transform(t,(function(){return o(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),i.apply(this,arguments),l)}),null,r)},g.translateTo=function(t,e,n,r,a){g.transform(t,(function(){var t=i.apply(this,arguments),a=this.__zoom,s=null==r?b(t):"function"==typeof r?r.apply(this,arguments):r;return o(In.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,l)}),r,a)},w.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=At(this.that).datum();f.call(t,this.that,new zn(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),e)}},g.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Nn(+t),g):a},g.filter=function(t){return arguments.length?(r="function"==typeof t?t:Nn(!!t),g):r},g.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Nn(!!t),g):s},g.extent=function(t){return arguments.length?(i="function"==typeof t?t:Nn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):i},g.scaleExtent=function(t){return arguments.length?(c[0]=+t[0],c[1]=+t[1],g):[c[0],c[1]]},g.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(t){return arguments.length?(o=t,g):o},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(p=(t=+t)*t,g):Math.sqrt(p)},g.tapDistance=function(t){return arguments.length?(m=+t,g):m},g}().scaleExtent([e,n]).extent([[0,0],[t.width_,t.height_]]).on("zoom",e=>{t._mobile?e&&function(t,e){if(e.sourceEvent){let n=e.transform.k,r=-(e.transform.x-t.width_/2)/n,i=(e.transform.y-t.height_/2)/n,o=Ay(t.height_,t.cameraConfig.fov_,n);PS(r,i,o)}}(t,e):e&&function(t,e){let n=e.transform.k;if(e.sourceEvent){let r=Ay(t.height_,t.cameraConfig.fov_,n);if(r!==t.camera.position.z){const{clientX:n,clientY:i}=e.sourceEvent,o=new bl(n/t.width_*2-1,-i/t.height_*2+1,1);o.unproject(t.camera);const a=o.sub(t.camera.position).normalize(),s=(r-t.camera.position.z)/a.z,c=t.camera.position.clone().add(a.multiplyScalar(s));PS(c.x,c.y,r)}else{const{movementX:n,movementY:r}=e.sourceEvent,i=Ey(t.height_,t.cameraConfig.fov_,t.camera.position.z);PS(t.camera.position.x-n/i,t.camera.position.y+r/i,t.camera.position.z)}}}(t,e)}).on("end",e=>{e&&function(t,e){eb();let n=Ey(t.height_,t.cameraConfig.fov_,e.transform.k);t.debugPlacenames_&&console.info("scale:",n);t.showPlacenames_&&t.pointsLayer&&(n>0&&n<t.cameraConfig.far_?nb(t):rb(t))}(t,e)}),t.view.call(t.d3zoom),t._mobile){let e=Ey(t.height_,t.cameraConfig.fov_,t.cameraConfig.initialZ_);var r=In.translate(t.width_/2,t.height_/2).scale(e);t.d3zoom.transform(t.view,r),PS(0,0,t.cameraConfig.initialZ_)}else{let e=Ey(t.height_,t.cameraConfig.fov_,t.cameraConfig.initialZ_);t.d3zoom.scaleTo(t.view,e),t.d3zoom.translateTo(t.view,parseInt(t.center_[0])+t.width_/2,parseInt(t.center_[1])+t.height_/2),PS(t.center_[0],t.center_[1],t.cameraConfig.initialZ_)}}function IS(t,e){t.pointsGeometry||(t.pointsGeometry=new ph);let n=[],r=[],i=[];for(var o=0;o<e.length;o++){let a=[e[o].x,e[o].y],s=parseFloat(a[0]),c=parseFloat(a[1]),l=1e-4,u=e[o][t.colorField_],h=t.colorScaleFunction_(parseFloat(u));"rgb(NaN, NaN, NaN)"==h&&(h="#000"),e[o].color=h;let d=new Hu(h);if(!isNaN(s)&&!isNaN(c)){if(r.push(s,c,l),isNaN(d.r)||isNaN(d.g)||isNaN(d.b)){let t=new Hu("#000");n.push(t.r,t.g,t.b)}else n.push(d.r,d.g,d.b);t.sizeField_?i.push(t.sizeScaleFunction_(e[o][t.sizeField_])):i.push(t.pointSize)}}t.pointsGeometry.setAttribute("position",new nh(r,3)),t.pointsGeometry.setAttribute("color",new nh(n,3)),t.pointsGeometry.setAttribute("size",new nh(i,1)),t.pointsGeometry.computeBoundingSphere(),t.pointsMaterial?t.pointsMaterial.size=t.pointSize:t.pointsMaterial=new Uh({uniforms:{multiplier:{value:1050+50*window.devicePixelRatio}},fragmentShader:"\n varying vec3 vColor;\n \n void main() {\n gl_FragColor = vec4( vColor.rgb, 1.0 );\n }\n ",vertexShader:"\n uniform float multiplier;\n attribute float size;\n float scale;\n varying vec3 vColor;\n \n void main() {\n vColor = color;\n \n // mvPosition represents the vertex position in view space (model-view-position). It’s usually calculated like so:\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n \n // manual 'point attenuation' attempt because threejs attenuation doesnt coincide with real world cellSize \n // (e.g. 1000 for 1km grid leaves space between cells)...\n // this method works well on mobile & desktop, but not when appending the renderer to a container\n gl_PointSize = size * (multiplier / -mvPosition.z ); \n \n // threejs attenuation (attenuation: true in pointer material)...\n // does this: gl_PointSize *= ( scale / - mvPosition.z );\n // works well in containers & desktop, but not mobile\n // gl_PointSize = size;\n \n //set position:\n gl_Position = projectionMatrix * mvPosition;\n }\n ",vertexColors:!0}),t.pointsLayer?(t.pointsLayer.geometry=t.pointsGeometry,t.pointsLayer.material=t.pointsMaterial):(t.pointsLayer=new rm(t.pointsGeometry,t.pointsMaterial),t.pointsLayer.renderOrder=1,t.scene.add(t.pointsLayer))}function OS(t,e){let n=[];for(var r=0;r<e.length;r++)t.sizeField_&&"null"!==t.sizeField_?n.push(t.sizeScaleFunction_(e[r][t.sizeField_])):n.push(t.pointSize);t.pointsGeometry.setAttribute("size",new nh(n,1)),t.pointsGeometry.computeBoundingSphere(),t.pointsLayer.geometry=t.pointsGeometry}function FS(t,e){let n=[];for(var r=0;r<e.length;r++){let i=t.colorScaleFunction_(e[r][t.colorField_]);"rgb(NaN, NaN, NaN)"==i&&(i="#000"),e[r].color=i;let o=new Hu(i);o&&n.push(o.r,o.g,o.b)}t.pointsGeometry.setAttribute("color",new nh(n,3)),t.pointsGeometry.computeBoundingSphere(),t.pointsLayer.geometry=t.pointsGeometry}function US(t){let e,n={debugPlacenames_:!1};for(var o in n.container_=document.body,n.height_=null,n.width_=null,n.backgroundColor_="#ffffff",n.lineColor_="rgb(0, 0, 0)",n.lineWidth_=.0012,n.highlightColor_="yellow",n.loadingIcon_="ring",n.showLegend_=!0,n.legend_={type:"continuous",width:300,height:null,orientation:"horizontal",title:null,titleWidth:50,format:".0s",cells:5,shapeWidth:30},n._gridLegend,n.tooltip_={eventType:"mousemove",showLAU:!1,showEPSG:!1,showNUTS:!1,showCoordinates:!1,xOffset:15,yOffset:15},n.colorSchemeName_="interpolateBlues",n.reverseColorScheme_=!1,n.sizeScaleName_="scaleSqrt",n.colorScaleName_="scaleSequentialSqrt",n.colorScaleMidpoint_=0,n.colors_=null,n.thresholds_=null,n.colorScaleFunction_=null,n.sizeScaleFunction_=null,n.colorSchemeSelector_=!1,n.colorScaleSelectorLabel_="Colour scale: ",n.colorScaleSelector_=!1,n.colorScaleSelectorDefault_=n.colorScaleName_,n.colorFieldSelectorLabel_="Colour field: ",n.colorFieldSelector_=!1,n.sizeFieldSelector_=!1,n.sizeFieldSelectorLabel_="Size field: ",n.EPSG_=3035,n.showPlacenames_=!1,n.placenamesCountry_=!1,n.placenameThresholds_=null,n.center_=null,n.zerosRemoved_=0,n.colorField_=null,n.sizeField_=null,n.title_=null,n.subtitle_=null,n.cellCount_=null,n.sourcesHTML_=null,n.homeButton_=!1,n.zoomButtons_=!1,n.nuts_=!1,n.nutsCountry_=!1,n.nutsLevel_=0,n.nutsSimplification_="10M",n.resolution_=null,n.zoom_=null,n.mobileCellSize_=null,n)!function(){var t=o;n[t.substring(0,t.length-1)]=function(e){return arguments.length?(n[t]=e,n):n[t]}}();n.legend=function(t){for(let e in t)n.legend_[e]=t[e];return n._gridLegend&&RS(n),n},n.tooltip=function(t){for(let e in t)n.tooltip_[e]=t[e];return n},n.pointsLayer=null,n.scene=null,n.animating=!1,n.cameraConfig={},n.cameraConfig.near_=null,n.cameraConfig.far_=null,n.cameraConfig.fov_=null,n.cameraConfig.aspect_=null;let a={};function s(){(n.title_||n.subtitle_||n.cellCount_)&&function(t){t.headingsNode=document.createElement("div"),t.headingsNode.classList.add("gridviz-headings-container"),t.headingsNode.classList.add("gridviz-plugin"),t.container_.appendChild(t.headingsNode)}(n),n.title_&&function(t){let e=document.createElement("div");e.classList.add("gridviz-title"),e.innerHTML=t.title_,t.headingsNode.appendChild(e)}(n),n.subtitle_&&function(t){let e=document.createElement("div");e.classList.add("gridviz-subtitle"),e.innerHTML=t.subtitle_,t.headingsNode.appendChild(e)}(n),n.cellCount_&&function(t){let e=document.createElement("div");e.classList.add("gridviz-cellcount"),e.innerHTML="Number of cells: "+t.cellCount.toLocaleString("en").replace(/,/gi," "),t.headingsNode.appendChild(e)}(n),n.sourcesHTML_&&function(t){let e=document.createElement("div");e.classList.add("gridviz-sources"),e.innerHTML=t.sourcesHTML_,t.container_.appendChild(e)}(n),n.homeButton_&&function(t){let e,n;if(t._mobile);else{e=10,n=t.title_||t.subtitle_?100:20,t.homeButtonNode=document.createElement("div"),t.homeButtonNode.style.left="10px",t.homeButtonNode.style.top=n+"px",t.homeButtonNode.id="gridviz-home-btn",t.homeButtonNode.classList.add("gridviz-home-button","gridviz-icon-button");let r=document.createElement("span");r.classList.add("icon"),t.homeButtonNode.appendChild(r),t.container_.appendChild(t.homeButtonNode)}}(n),n.zoomButtons_&&function(t){let e,n,r;if(t._mobile);else{e=10,t.title_||t.subtitle_?(n=140,r=170):(n=50,r=80),t.zoominButtonNode=document.createElement("div"),t.zoominButtonNode.id="gridviz-zoomin-btn",t.zoominButtonNode.style.left="10px",t.zoominButtonNode.style.top=n+"px",t.zoominButtonNode.classList.add("gridviz-zoomin-button","gridviz-icon-button");let i=document.createElement("span");i.classList.add("icon"),t.zoominButtonNode.appendChild(i),t.container_.appendChild(t.zoominButtonNode),t.zoomoutButtonNode=document.createElement("div"),t.zoomoutButtonNode.id="gridviz-zoomout-btn",t.zoomoutButtonNode.style.left="10px",t.zoomoutButtonNode.style.top=r+"px",t.zoomoutButtonNode.classList.add("gridviz-zoomout-button","gridviz-icon-button");let o=document.createElement("span");o.classList.add("icon"),t.zoomoutButtonNode.appendChild(o),t.container_.appendChild(t.zoomoutButtonNode)}}(n)}function c(){n.view.on(n.tooltip_.eventType,t=>{let[r,i]=It(t),o=[r,i],s=function(t){let e=function(t,e){return new bl(t/n.width_*2-1,-e/n.height_*2+1,.5)}(...t);n.raycaster.setFromCamera(e,n.camera);let r=n.raycaster.intersectObject(n.pointsLayer);return!!r[0]&&function(t){return t.concat().sort((e="distanceToRay",(t,n)=>t[e]>n[e]?1:n[e]>t[e]?-1:0));var e}(r)[0]}(o);if(s){let t=s.index,r=a[n.resolution_][t];!function(t){let r=t.object.geometry.attributes.color.array;e&&(r[e.colourIndex]=e.color.r,r[e.colourIndex+1]=e.color.g,r[e.colourIndex+2]=e.color.b);let i=3*t.index,o=r[i],a=r[i+1],s=r[i+2];e={colourIndex:i,color:{r:o,g:a,b:s}};let c=new Hu(n.highlightColor_);r[i]=c.r,r[i+1]=c.g,r[i+2]=c.b,t.object.geometry.attributes.color.needsUpdate=!0}(s),tb(n,o,r)}else eb()}),n.colorSchemeSelector_&&l(),n.colorScaleSelector_&&(!function(t){let e=[{value:"scaleSequentialLog",innerText:"Logarithmic"},{value:"scaleSequentialPow",innerText:"Exponential"},{value:"scaleSequentialSqrt",innerText:"Square-root "}],n=document.createElement("div");n.id="gridviz-colorscale-dropdown-container",n.classList.add("gridviz-dropdown"),t.colorScaleSelect=document.createElement("select"),t.colorScaleSelect.classList.add("gridviz-select"),t.colorScaleSelect.id="scales";let r=document.createElement("label");r.for="scales",r.classList.add("gridviz-dropdown-label"),r.innerText=t.colorScaleSelectorLabel_;for(let n=0;n<e.length;n++){let r=e[n],i=document.createElement("option");i.value=r.value,i.innerText=r.innerText,t.colorScaleSelect.appendChild(i)}t.colorScaleSelect.value=t.colorScaleName_,n.appendChild(r),n.appendChild(t.colorScaleSelect),t.selectorsContainer.appendChild(n)}(n),n.colorScaleSelect.addEventListener("change",(function(t){var e;e=t.currentTarget.value,n.colorScaleName_=e,m(),FS(n,a[n.resolution_]),n.legend_&&RS(n)}))),window.addEventListener("resize",()=>{n.width_=n.container_.clientWidth,n.height_=n.container_.clientHeight,n.labelRenderer.setSize(n.width_,n.height_),n.renderer.setSize(n.width_,n.height_),n.camera.aspect=n.width_/n.height_,n.camera.updateProjectionMatrix()}),function(){n.homeButton_&&n.homeButtonNode.addEventListener("click",()=>{!function(){if(n._mobile){let t=Ey(n.height_,n.cameraConfig.fov_,n.cameraConfig.initialZ_);n.d3zoom.scaleTo(n.view,t),n.d3zoom.translateTo(n.view,parseInt(n.center_[0])+n.width_/2,parseInt(n.center_[1])+n.height_/2),PS(n.center_[0],n.center_[1],n.cameraConfig.initialZ_);let e=Ey(n.height_,n.cameraConfig.fov_,n.cameraConfig.far_),r=In.translate(n.width_/2,n.height_/2).scale(e);n.d3zoom.transform(n.view,r)}else{let t=Ey(n.height_,n.cameraConfig.fov_,n.cameraConfig.initialZ_);n.d3zoom.scaleTo(n.view,t),n.d3zoom.translateTo(n.view,parseInt(n.center_[0])+n.width_/2,parseInt(n.center_[1])+n.height_/2),PS(n.center_[0],n.center_[1],n.cameraConfig.initialZ_)}}()});n.zoomButtons_&&(n.zoominButtonNode.addEventListener("click",()=>{n.zoomIn(2)}),n.zoomoutButtonNode.addEventListener("click",()=>{n.zoomOut(.5)}))}()}function l(){n.schemesSelect.addEventListener("change",(function(t){var e;e=t.currentTarget.value,eb(),n.colorSchemeName_=e,m(),FS(n,a[n.resolution_]),n.legend_&&RS(n)}))}function u(){n.colorFieldSelect.addEventListener("change",(function(t){!function(t){n.colorField_=t,n.colorValuesExtent=il(a[n.resolution_],t=>parseFloat(t[n.colorField_])),n.colors_||m();FS(n,a[n.resolution_]),n.legend_&&RS(n)}(t.currentTarget.value)}))}function h(){n.sizeFieldSelect.addEventListener("change",(function(t){var e;e=t.currentTarget.value,n.sizeField_=e,function(){if(n.sizeValuesExtent){let t=n.sizeValuesExtent;n.sizeScaleFunction_=i[n.sizeScaleName_]().domain(t).range([n.resolution_/3,n.resolution_/1.5])}else n.sizeValuesExtent=il(a[n.resolution_],t=>parseFloat(t[n.sizeField_])),n.sizeScaleFunction_=p()}(),OS(n,a[n.resolution_]),n._gridLegend&&RS(n)}))}function d(){return n.resolution_}function f(t){if(wy.style.display="block",My.style.display="block",t.cellSize)(function(t){return el(t.url)})(t).then(e=>{if(e){if(!(e[0].x&&e[0].y&&e[0][n.colorField_])){Ty();let t="Incorrect csv format. Please use coordinate columns with names 'x' and 'y' and check that colorField is defined correctly.";return console.error(t),void alert(t)}if(n.cellCount=e.length,n._cellFields=Object.keys(e[0]).filter(t=>"x"!==t&&"y"!==t),n._mobile&&!n.mobileCellSize_){let r=il(e.map(t=>parseFloat(t.x))),i=il(e.map(t=>parseFloat(t.y))),o=[ra([r,i],t=>ra(t)),na([r,i],t=>na(t))];n.mobileCoordScaleX=To().domain(o).range([-1,1]),n.mobileCoordScaleY=To().domain(o).range([-1,1]),e.sort((function(t,e){return t.x-e.x}));let a,s=e[0].x;e.some((function(t){if(t.x!==s)return a=t.x,!0}));let c=n.mobileCoordScaleX(s),l=n.mobileCoordScaleX(a),u=Math.abs(c-l);u*=2;let h=u;n.originalResolution=n.resolution_,n.resolution_=h,t.cellSize=h,n.pointSize=h,n.raycaster.params.Points.threshold=h,n.center_&&(n.center_[0]=n.mobileCoordScaleX(n.center_[0]),n.center_[1]=n.mobileCoordScaleY(n.center_[1]))}else if(n._mobile&&n.mobileCellSize_){let r=il(e.map(t=>parseFloat(t.x))),i=il(e.map(t=>parseFloat(t.y))),o=[ra([r,i],t=>ra(t)),na([r,i],t=>na(t))];n.mobileCoordScaleX=To().domain(o).range([-1,1]),n.mobileCoordScaleY=To().domain(o).range([-1,1]),n.originalResolution=n.resolution_;let a=n.mobileCellSize_;n.resolution_=a,t.cellSize=a,n.pointSize=a,n.raycaster.params.Points.threshold=a,n.center_&&(n.center_[0]=n.mobileCoordScaleX(n.center_[0]),n.center_[1]=n.mobileCoordScaleY(n.center_[1]))}if(function(t,e){if(t)if(n._mobile)for(let r=0;r<t.length;r++){let i=t[r];i.x=n.mobileCoordScaleX(parseFloat(t[r].x)),i.y=n.mobileCoordScaleY(parseFloat(t[r].y)),a[e]||(a[e]=[]),a[e].push(i)}else a[e]||(a[e]=t)}(e,t.cellSize),s(),c(),n.colorValuesExtent=il(a[n.resolution_],t=>parseFloat(t[n.colorField_])),n.colorScaleFunction_=function(){if(n.colors_&&n.thresholds_)return Eo().domain(n.thresholds_).range(n.colors_);if(n.colorScaleFunction_)return n.colorScaleFunction_;{"scaleSequentialLog"==n.colorScaleName_&&0==n.colorValuesExtent[0]&&(n.colorValuesExtent[0]=.1);let t=n.colorValuesExtent;return n.reverseColorScheme_&&(t=t.reverse()),"scaleSequentialQuantile"==n.colorScaleName_?i[n.colorScaleName_](n.thresholds_,r[n.colorSchemeName_]):i[n.colorScaleName_](t,r[n.colorSchemeName_])}}(),n.sizeField_&&(n.sizeValuesExtent=il(a[n.resolution_],t=>parseFloat(t[n.sizeField_])),n.sizeScaleFunction_=p()),!n.center_){let t=parseInt(a[n.resolution_].length/2),e=a[n.resolution_][t];n._mobile?n.center_=[n.mobileCoordScaleX(parseFloat(e.x)),n.mobileCoordScaleY(parseFloat(e.y))]:n.center_=[parseFloat(e.x),parseFloat(e.y)]}DS(n),function(){IS(n,a[n.resolution_]),n.showLegend_&&n.legend_&&(n._gridLegend?RS(n):LS(n));Ty(),n.animating||g()}(),function(t){Qy={display:"none"},jy=document.createRange().createContextualFragment('<div id="gridviz-tooltip">\n <div id="gridviz-labeltip">\n\n <table>\n <thead></thead>\n <tbody id="tooltipBody">\n\n </tbody>\n </table>\n \n </div>\n<div id="gridviz-pointtip"></div>\n</div>'),t.container_.append(jy),Wy=document.querySelector("#tooltipBody"),Vy={},t._cellFields.forEach(t=>{$y(t)}),$y("x"),$y("y"),$y("launame"),$y("laucode"),$y("nutscode"),$y("crs"),Yy=document.querySelector("#gridviz-tooltip"),qy=document.querySelector("#gridviz-pointtip"),Gy=new yu,t.scene.add(Gy)}(n),n.colorFieldSelector_&&(!function(t,e){let n=document.createElement("div");n.id="gridviz-colorfield-dropdown-container",n.classList.add("gridviz-dropdown"),t.colorFieldSelect=document.createElement("select"),t.colorFieldSelect.classList.add("gridviz-select"),t.colorFieldSelect.id="colorFields";let r=document.createElement("label");r.for="colorFields",r.classList.add("gridviz-dropdown-label"),r.innerText=t.colorFieldSelectorLabel_;let i=Object.keys(e[t.resolution_][0]);for(let e=0;e<i.length;e++){let n=i[e];if("x"!==n.toLowerCase()&&"y"!==n.toLowerCase()&&"color"!==n){let e=document.createElement("option");e.value=n,e.innerText=n,t.colorFieldSelect.appendChild(e)}}t.colorFieldSelect.value=t.colorField_,n.appendChild(r),n.appendChild(t.colorFieldSelect),t.selectorsContainer.appendChild(n)}(n,a),u()),n.sizeFieldSelector_&&(!function(t,e){let n=document.createElement("div");n.id="gridviz-sizefield-dropdown-container",n.classList.add("gridviz-dropdown"),t.sizeFieldSelect=document.createElement("select"),t.sizeFieldSelect.classList.add("gridviz-select"),t.sizeFieldSelect.id="sizeFields";let r=document.createElement("label");r.for="sizeFields",r.classList.add("gridviz-dropdown-label"),r.innerText=t.sizeFieldSelectorLabel_;let i=Object.keys(e[t.resolution_][0]);for(let e=0;e<i.length;e++){let n=i[e];if("x"!==n.toLowerCase()&&"y"!==n.toLowerCase()&&"color"!==n){let e=document.createElement("option");e.value=n,e.innerText=n,t.sizeFieldSelect.appendChild(e)}}let o=document.createElement("option");o.value=null,o.innerText="none",t.sizeFieldSelect.appendChild(o),t.sizeFieldSelect.value=t.sizeField_,n.appendChild(r),n.appendChild(t.sizeFieldSelect),t.selectorsContainer.appendChild(n)}(n,a),h()),n.showPlacenames_&&!n.placenameThresholds_&&function(t){let e=t.resolution_/window.devicePixelRatio;t.placenameThresholds_={[1024*e]:1e6,[512*e]:6e5,[256*e]:5e5,[128*e]:2e5,[64*e]:15e4,[32*e]:1e5,[16*e]:5e4,[8*e]:1e4,[4*e]:5e3,[2*e]:1e3,[e]:10}}(n),n.showPlacenames_&&nb(n)}Ty()},t=>{Ty(),alert(t)});else{Ty();let t="Please specify grid cell size in the units of its coordinate system";console.error(t),alert(t)}}function p(){return n.sizeScaleFunction_?n.sizeScaleFunction_:i[n.sizeScaleName_]().domain(n.colorValuesExtent).range([n.resolution_/3,n.resolution_/1.5])}function m(){!function(){let t;"scaleSequentialLog"==n.colorScaleName_&&0==n.colorValuesExtent[0]&&(n.colorValuesExtent[0]=.1),t="scaleDiverging"==n.colorScaleName_?[n.colorValuesExtent[0],n.colorScaleMidpoint,n.colorValuesExtent[1]]:n.colorValuesExtent,"scaleSequentialQuantile"==n.colorScaleName_?n.colorScaleFunction_=i[n.colorScaleName_](n.thresholds_,r[n.colorSchemeName_]):n.colorScaleFunction_=i[n.colorScaleName_](t,r[n.colorSchemeName_])}()}function g(){n.animating=!0,requestAnimationFrame(g),n.renderer.render(n.scene,n.camera),n.labelRenderer.render(n.scene,n.camera)}return n.gridInfo_=null,n.gridData=function(t){return t&&n.pointsLayer?(n.gridInfo_=t,n.resolution_=t.cellSize,n.raycasterThreshold=d(),n.pointSize=n.resolution_,n.showPlacenames_&&rb(n),NS(n),f(t)):t&&(n.gridInfo_=t,n.pointSize=t.cellSize),n},n.center=function(t){return t&&n.scene?(n.center_=t,NS(n),PS(t[0],t[1],n.camera.position.z)):t&&(n.center_=t),n},n.zoom=function(t){return t&&n.scene?(n.zoom_=t,NS(n),PS(n.camera.position.x,n.camera.position.y,t)):t&&(n.zoom_=t),n},n.build=function(){if(ly.isWebGLAvailable()){if(!n.colors_||!n.thresholds_||n.colors_.length===n.thresholds_.length||(alert("The number of colors and thesholdvalues must be equal"),!1))return n.width_||(n.container_.clientWidth==window.innerWidth?n.width_=n.container_.clientWidth-1:n.width_=n.container_.clientWidth),n.height_||("0"==n.container_.clientHeight?n.height_=window.innerHeight-1:n.height_=n.container_.clientHeight),/Mobi|Android/i.test(navigator.userAgent)&&(n._mobile=!0,n.sourcesHTML_=null,n.sizeFieldSelector_=!1,n.colorFieldSelector_=!1,n.colorScaleSelector_=!1,n.colorSchemeSelector_=!1),function(t,e){wy=document.createElement("div"),wy.id="gridviz-loading-spinner",wy.classList.add("lds-"+e);let n=document.createElement("div");wy.appendChild(n);let r=document.createElement("div");wy.appendChild(r);let i=document.createElement("div");wy.appendChild(i);let o=document.createElement("div");wy.appendChild(o),t.appendChild(wy)}(n.container_,n.loadingIcon_),e=n.container_,My=document.createElement("div"),My.id="gridviz-loading-text",My.innerHTML="Large grids can take a while to load. Please wait.",e.appendChild(My),n.container_.classList.add("gridviz-container"),n.container_.style.width=n.width_,n.container_.style.height=n.height_,n.resolution_||(n.resolution_=n.gridInfo_[0].cellSize),n.scene=new rp,n.scene.background=new Hu(n.backgroundColor_),n.labelRenderer||(n.labelRenderer=new hy,n.labelRenderer.setSize(n.width_,n.height_),n.labelRenderer.domElement.style.position="absolute",n.container_.appendChild(n.labelRenderer.domElement)),n.renderer||function(){n.renderer=new ep;let t=window.devicePixelRatio;n.renderer.setPixelRatio(t);n.renderer.setSize(n.width_,n.height_,!0),n.container_.appendChild(n.renderer.domElement),n.view=At(n.renderer.domElement)}(),function(t){t.cameraConfig=zS(t),t.camera=new Hh(t.cameraConfig.fov_,t.cameraConfig.aspect_,t.cameraConfig.near_,t.cameraConfig.far_),AS=t.camera}(n),n.raycaster=new jv,n.raycaster.params.Points.threshold=d(),(n.colorSchemeSelector_||n.colorScaleSelector_||n.sizeFieldSelector_||n.colorFieldSelector_)&&function(t){t.selectorsContainer=document.createElement("div"),t.selectorsContainer.classList.add("gridviz-selectors"),t.selectorsContainer.classList.add("gridviz-plugin"),t.container_.appendChild(t.selectorsContainer)}(n),n.colorSchemeSelector_&&(!function(t){let e=[{value:"interpolateBrBG",innerText:"Brown-blue-green"},{value:"interpolatePRGn",innerText:"Purple-green"},{value:"interpolatePiYG",innerText:"Pink-green"},{value:"interpolatePuOr",innerText:"Purple-orange"},{value:"interpolateRdBu",innerText:"Red-blue"},{value:"interpolateRdGy",innerText:"Red-grey"},{value:"interpolateRdYlBu",innerText:"Red-yellow-blue"},{value:"interpolateRdYlGn",innerText:"Red-yellow-green"},{value:"interpolateSpectral",innerText:"Spectral"},{value:"interpolateBlues",innerText:"Blues"},{value:"interpolateGreens",innerText:"Greens"},{value:"interpolateGreys",innerText:"Greys"},{value:"interpolateOranges",innerText:"Oranges"},{value:"interpolatePurples",innerText:"Purples"},{value:"interpolateReds",innerText:"Reds"},{value:"interpolateTurbo",innerText:"Turbo"},{value:"interpolateViridis",innerText:"Viridis"},{value:"interpolateInferno",innerText:"Inferno"},{value:"interpolateMagma",innerText:"Magma"},{value:"interpolatePlasma",innerText:"Plasma"},{value:"interpolateCividis",innerText:"Cividis"},{value:"interpolateWarm",innerText:"Warm"},{value:"interpolateCool",innerText:"Cool"},{value:"interpolateCubehelixDefault",innerText:"CubehelixDefault"},{value:"interpolateBuGn",innerText:"Blue-green"},{value:"interpolateBuPu",innerText:"Blue-purple"},{value:"interpolateGnBu",innerText:"Green-blue"},{value:"interpolateOrRd",innerText:"Orange-red"},{value:"interpolatePuBuGn",innerText:"Purple-blue-green"},{value:"interpolatePuBu",innerText:"Purple-blue"},{value:"interpolatePuRd",innerText:"Purple-red"},{value:"interpolateRdPu",innerText:"Red-purple"},{value:"interpolateYlGnBu",innerText:"Yellow-green-blue"},{value:"interpolateYlGn",innerText:"Yellow-green"},{value:"interpolateYlOrBr",innerText:"Yellow-orange-brown"},{value:"interpolateYlOrRd",innerText:"Yellow-orange-red"},{value:"interpolateRainbow",innerText:"Rainbow"},{value:"interpolateSinebow",innerText:"Sinebow"}],n=document.createElement("div");n.id="gridviz-colorscheme-dropdown-container",n.classList.add("gridviz-dropdown"),t.schemesSelect=document.createElement("select"),t.schemesSelect.id="schemes",t.schemesSelect.classList.add("gridviz-select");let r=document.createElement("label");r.for="schemes",r.classList.add("gridviz-dropdown-label"),r.innerText="Colour scheme: ";for(let n=0;n<e.length;n++){let r=e[n],i=document.createElement("option");i.value=r.value,i.innerText=r.innerText,t.schemesSelect.appendChild(i)}t.schemesSelect.value=t.colorSchemeName_,n.appendChild(r),n.appendChild(t.schemesSelect),t.selectorsContainer.appendChild(n)}(n),l()),f(n.gridInfo_[0]),n.nuts_&&(t="https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2/2016/"+n.EPSG_+"/"+n.nutsSimplification_+"/"+n.nutsLevel_+".json",rl(t).then(t=>{let e;e=n.nutsCountry_?t.objects.nutsrg.geometries.filter((t,e)=>-1!==t.properties.id.indexOf(n.nutsCountry_)):t.objects.nutsrg.geometries.filter((t,e)=>"TR"!==t.properties.id),t.objects.nutsbn.geometries=e,function(t){Zy(t,n)}(py(t,t.objects.nutsbn).features)},t=>{console.error(t)})),n;{Ty();let t="invalid inputs";return console.error(t),void alert(t)}}{const t=ly.getWebGLErrorMessage();document.getElementById("container").appendChild(t)}var t,e},n.zoomIn=function(t){!function(t,e){t.view.call(t.d3zoom.scaleBy,e),PS(t.camera.position.x,t.camera.position.y,t.camera.position.z/e)}(n,t)},n.zoomOut=function(t){!function(t,e){t.view.call(t.d3zoom.scaleBy,e),PS(t.camera.position.x,t.camera.position.y,t.camera.position.z/e)}(n,t)},n.addGeoJson=function(t){rl(t).then(t=>{t.features&&t.features.length>0&&Zy(t.features,n)},t=>{console.error(t)})},n}}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gviz=e():t.gviz=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="build/",n(n.s=9)}({10:function(t,e,n){"use strict";function r(){}n.r(e),n.d(e,"App",(function(){return xo})),n.d(e,"Layer",(function(){return vr})),n.d(e,"Dataset",(function(){return cr})),n.d(e,"DatasetComponent",(function(){return rr})),n.d(e,"schemeCategory10",(function(){return _o})),n.d(e,"schemeAccent",(function(){return ko})),n.d(e,"schemeDark2",(function(){return Co})),n.d(e,"schemePaired",(function(){return Oo})),n.d(e,"schemePastel1",(function(){return Po})),n.d(e,"schemePastel2",(function(){return Mo})),n.d(e,"schemeSet1",(function(){return jo})),n.d(e,"schemeSet2",(function(){return Ao})),n.d(e,"schemeSet3",(function(){return Eo})),n.d(e,"schemeTableau10",(function(){return To})),n.d(e,"interpolateBrBG",(function(){return Fo})),n.d(e,"schemeBrBG",(function(){return zo})),n.d(e,"interpolatePRGn",(function(){return No})),n.d(e,"schemePRGn",(function(){return Io})),n.d(e,"interpolatePiYG",(function(){return Bo})),n.d(e,"schemePiYG",(function(){return Lo})),n.d(e,"interpolatePuOr",(function(){return Go})),n.d(e,"schemePuOr",(function(){return Do})),n.d(e,"interpolateRdBu",(function(){return Wo})),n.d(e,"schemeRdBu",(function(){return Zo})),n.d(e,"interpolateRdGy",(function(){return $o})),n.d(e,"schemeRdGy",(function(){return Uo})),n.d(e,"interpolateRdYlBu",(function(){return Vo})),n.d(e,"schemeRdYlBu",(function(){return Yo})),n.d(e,"interpolateRdYlGn",(function(){return Xo})),n.d(e,"schemeRdYlGn",(function(){return Ho})),n.d(e,"interpolateSpectral",(function(){return Ko})),n.d(e,"schemeSpectral",(function(){return qo})),n.d(e,"interpolateBuGn",(function(){return Qo})),n.d(e,"schemeBuGn",(function(){return Jo})),n.d(e,"interpolateBuPu",(function(){return ei})),n.d(e,"schemeBuPu",(function(){return ti})),n.d(e,"interpolateGnBu",(function(){return ri})),n.d(e,"schemeGnBu",(function(){return ni})),n.d(e,"interpolateOrRd",(function(){return ii})),n.d(e,"schemeOrRd",(function(){return oi})),n.d(e,"interpolatePuBuGn",(function(){return fi})),n.d(e,"schemePuBuGn",(function(){return ai})),n.d(e,"interpolatePuBu",(function(){return ui})),n.d(e,"schemePuBu",(function(){return ci})),n.d(e,"interpolatePuRd",(function(){return si})),n.d(e,"schemePuRd",(function(){return li})),n.d(e,"interpolateRdPu",(function(){return di})),n.d(e,"schemeRdPu",(function(){return hi})),n.d(e,"interpolateYlGnBu",(function(){return pi})),n.d(e,"schemeYlGnBu",(function(){return yi})),n.d(e,"interpolateYlGn",(function(){return vi})),n.d(e,"schemeYlGn",(function(){return bi})),n.d(e,"interpolateYlOrBr",(function(){return mi})),n.d(e,"schemeYlOrBr",(function(){return gi})),n.d(e,"interpolateYlOrRd",(function(){return xi})),n.d(e,"schemeYlOrRd",(function(){return wi})),n.d(e,"interpolateBlues",(function(){return _i})),n.d(e,"schemeBlues",(function(){return Si})),n.d(e,"interpolateGreens",(function(){return Ci})),n.d(e,"schemeGreens",(function(){return ki})),n.d(e,"interpolateGreys",(function(){return Pi})),n.d(e,"schemeGreys",(function(){return Oi})),n.d(e,"interpolatePurples",(function(){return ji})),n.d(e,"schemePurples",(function(){return Mi})),n.d(e,"interpolateReds",(function(){return Ei})),n.d(e,"schemeReds",(function(){return Ai})),n.d(e,"interpolateOranges",(function(){return Ri})),n.d(e,"schemeOranges",(function(){return Ti})),n.d(e,"interpolateCividis",(function(){return zi})),n.d(e,"interpolateCubehelixDefault",(function(){return Vi})),n.d(e,"interpolateRainbow",(function(){return Ki})),n.d(e,"interpolateWarm",(function(){return Hi})),n.d(e,"interpolateCool",(function(){return Xi})),n.d(e,"interpolateSinebow",(function(){return ea})),n.d(e,"interpolateTurbo",(function(){return na})),n.d(e,"interpolateViridis",(function(){return oa})),n.d(e,"interpolateMagma",(function(){return ia})),n.d(e,"interpolateInferno",(function(){return aa})),n.d(e,"interpolatePlasma",(function(){return fa})),n.d(e,"TiledGrid",(function(){return co})),n.d(e,"CSVGrid",(function(){return $r})),n.d(e,"ShapeColorSizeStyle",(function(){return ba})),n.d(e,"StrokeStyle",(function(){return Ca})),n.d(e,"JoyPlotStyle",(function(){return za})),n.d(e,"CompositionStyle",(function(){return Ua})),n.d(e,"SegmentStyle",(function(){return Qa})),n.d(e,"TextStyle",(function(){return uf})),n.d(e,"KernelSmoothingStyle",(function(){return gf})),n.d(e,"PillarStyle",(function(){return Pf})),n.d(e,"SideStyle",(function(){return If})),n.d(e,"DotDensityStyle",(function(){return Kf})),n.d(e,"TanakaStyle",(function(){return ac})),n.d(e,"LegoStyle",(function(){return vc})),n.d(e,"SquareColorWGLStyle2",(function(){return oc})),n.d(e,"SquareColorWGLStyle",(function(){return Pc})),n.d(e,"MosaicStyle",(function(){return Ic})),n.d(e,"LabelLayer",(function(){return ho})),n.d(e,"BoundaryLayer",(function(){return vo})),n.d(e,"ColorLegend",(function(){return eu})),n.d(e,"ColorCategoryLegend",(function(){return cu})),n.d(e,"SizeLegend",(function(){return pu})),n.d(e,"SegmentWidthLegend",(function(){return Su})),n.d(e,"goToStraight",(function(){return ku})),n.d(e,"zoomTo",(function(){return _u})),n.d(e,"s",(function(){return Dl})),n.d(e,"getEuronymeLabelLayer",(function(){return Gl})),n.d(e,"getEurostatBoundariesLayer",(function(){return Zl}));var o=function(t){return null==t?r:function(){return this.querySelector(t)}};function i(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function a(){return[]}var f=function(t){return null==t?a:function(){return this.querySelectorAll(t)}};var c=function(t){return function(){return this.matches(t)}};function u(t){return function(e){return e.matches(t)}}var l=Array.prototype.find;function s(){return this.firstElementChild}var h=Array.prototype.filter;function d(){return Array.from(this.children)}var y=function(t){return new Array(t.length)};function p(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}p.prototype={constructor:p,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var b=function(t){return function(){return t}};function v(t,e,n,r,o,i){for(var a,f=0,c=e.length,u=i.length;f<u;++f)(a=e[f])?(a.__data__=i[f],r[f]=a):n[f]=new p(t,i[f]);for(;f<c;++f)(a=e[f])&&(o[f]=a)}function g(t,e,n,r,o,i,a){var f,c,u,l=new Map,s=e.length,h=i.length,d=new Array(s);for(f=0;f<s;++f)(c=e[f])&&(d[f]=u=a.call(c,c.__data__,f,e)+"",l.has(u)?o[f]=c:l.set(u,c));for(f=0;f<h;++f)u=a.call(t,i[f],f,i)+"",(c=l.get(u))?(r[f]=c,c.__data__=i[f],l.delete(u)):n[f]=new p(t,i[f]);for(f=0;f<s;++f)(c=e[f])&&l.get(d[f])===c&&(o[f]=c)}function m(t){return t.__data__}function w(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function x(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var S="http://www.w3.org/1999/xhtml",_={svg:"http://www.w3.org/2000/svg",xhtml:S,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},k=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),_.hasOwnProperty(e)?{space:_[e],local:t}:t};function C(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function P(t,e){return function(){this.setAttribute(t,e)}}function M(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function j(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function A(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var E=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function T(t){return function(){this.style.removeProperty(t)}}function R(t,e,n){return function(){this.style.setProperty(t,e,n)}}function z(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function F(t,e){return t.style.getPropertyValue(e)||E(t).getComputedStyle(t,null).getPropertyValue(e)}function I(t){return function(){delete this[t]}}function N(t,e){return function(){this[t]=e}}function L(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function B(t){return t.trim().split(/^|\s+/)}function D(t){return t.classList||new G(t)}function G(t){this._node=t,this._names=B(t.getAttribute("class")||"")}function Z(t,e){for(var n=D(t),r=-1,o=e.length;++r<o;)n.add(e[r])}function W(t,e){for(var n=D(t),r=-1,o=e.length;++r<o;)n.remove(e[r])}function U(t){return function(){Z(this,t)}}function $(t){return function(){W(this,t)}}function Y(t,e){return function(){(e.apply(this,arguments)?Z:W)(this,t)}}G.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function V(){this.textContent=""}function H(t){return function(){this.textContent=t}}function X(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function q(){this.innerHTML=""}function K(t){return function(){this.innerHTML=t}}function J(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Q(){this.nextSibling&&this.parentNode.appendChild(this)}function tt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function et(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===S&&e.documentElement.namespaceURI===S?e.createElement(t):e.createElementNS(n,t)}}function nt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var rt=function(t){var e=k(t);return(e.local?nt:et)(e)};function ot(){return null}function it(){var t=this.parentNode;t&&t.removeChild(this)}function at(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ft(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function ct(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function ut(t){return function(){var e=this.__on;if(e){for(var n,r=0,o=-1,i=e.length;r<i;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?e.length=o:delete this.__on}}}function lt(t,e,n){return function(){var r,o=this.__on,i=function(t){return function(e){t.call(this,e,this.__data__)}}(e);if(o)for(var a=0,f=o.length;a<f;++a)if((r=o[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=e);this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function st(t,e,n){var r=E(t),o=r.CustomEvent;"function"==typeof o?o=new o(e,n):(o=r.document.createEvent("Event"),n?(o.initEvent(e,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function ht(t,e){return function(){return st(this,t,e)}}function dt(t,e){return function(){return st(this,t,e.apply(this,arguments))}}var yt=[null];function pt(t,e){this._groups=t,this._parents=e}function bt(){return new pt([[document.documentElement]],yt)}pt.prototype=bt.prototype={constructor:pt,select:function(t){"function"!=typeof t&&(t=o(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a,f,c=e[i],u=c.length,l=r[i]=new Array(u),s=0;s<u;++s)(a=c[s])&&(f=t.call(a,a.__data__,s,c))&&("__data__"in a&&(f.__data__=a.__data__),l[s]=f);return new pt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){return i(t.apply(this,arguments))}}(t):f(t);for(var e=this._groups,n=e.length,r=[],o=[],a=0;a<n;++a)for(var c,u=e[a],l=u.length,s=0;s<l;++s)(c=u[s])&&(r.push(t.call(c,c.__data__,s,u)),o.push(c));return new pt(r,o)},selectChild:function(t){return this.select(null==t?s:function(t){return function(){return l.call(this.children,t)}}("function"==typeof t?t:u(t)))},selectChildren:function(t){return this.selectAll(null==t?d:function(t){return function(){return h.call(this.children,t)}}("function"==typeof t?t:u(t)))},filter:function(t){"function"!=typeof t&&(t=c(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],f=a.length,u=r[o]=[],l=0;l<f;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new pt(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,m);var n=e?g:v,r=this._parents,o=this._groups;"function"!=typeof t&&(t=b(t));for(var i=o.length,a=new Array(i),f=new Array(i),c=new Array(i),u=0;u<i;++u){var l=r[u],s=o[u],h=s.length,d=w(t.call(l,l&&l.__data__,u,r)),y=d.length,p=f[u]=new Array(y),x=a[u]=new Array(y),S=c[u]=new Array(h);n(l,s,p,x,S,d,e);for(var _,k,C=0,O=0;C<y;++C)if(_=p[C]){for(C>=O&&(O=C+1);!(k=x[O])&&++O<y;);_._next=k||null}}return(a=new pt(a,r))._enter=f,a._exit=c,a},enter:function(){return new pt(this._enter||this._groups.map(y),this._parents)},exit:function(){return new pt(this._exit||this._groups.map(y),this._parents)},join:function(t,e,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(o=e(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,o=n.length,i=r.length,a=Math.min(o,i),f=new Array(o),c=0;c<a;++c)for(var u,l=n[c],s=r[c],h=l.length,d=f[c]=new Array(h),y=0;y<h;++y)(u=l[y]||s[y])&&(d[y]=u);for(;c<o;++c)f[c]=n[c];return new pt(f,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,o=t[e],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=x);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,f=n[i],c=f.length,u=o[i]=new Array(c),l=0;l<c;++l)(a=f[l])&&(u[l]=a);u.sort(e)}return new pt(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let t=0;for(const e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var o,i=e[n],a=0,f=i.length;a<f;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,e){var n=k(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?O:C:"function"==typeof e?n.local?A:j:n.local?M:P)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?T:"function"==typeof e?z:R)(t,e,null==n?"":n)):F(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?I:"function"==typeof e?L:N)(t,e)):this.node()[t]},classed:function(t,e){var n=B(t+"");if(arguments.length<2){for(var r=D(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof e?Y:e?U:$)(n,e))},text:function(t){return arguments.length?this.each(null==t?V:("function"==typeof t?X:H)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?q:("function"==typeof t?J:K)(t)):this.node().innerHTML},raise:function(){return this.each(Q)},lower:function(){return this.each(tt)},append:function(t){var e="function"==typeof t?t:rt(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:rt(t),r=null==e?ot:"function"==typeof e?e:o(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(it)},clone:function(t){return this.select(t?ft:at)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,o,i=ct(t+""),a=i.length;if(!(arguments.length<2)){for(f=e?lt:ut,r=0;r<a;++r)this.each(f(i[r],e,n));return this}var f=this.node().__on;if(f)for(var c,u=0,l=f.length;u<l;++u)for(r=0,c=f[u];r<a;++r)if((o=i[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(t,e){return this.each(("function"==typeof e?dt:ht)(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,o=t[e],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};var vt=bt,gt=function(t){return"string"==typeof t?new pt([[document.querySelector(t)]],[document.documentElement]):new pt([[t]],yt)},mt={value:()=>{}};function wt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new xt(r)}function xt(t){this._=t}function St(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function _t(t,e){for(var n,r=0,o=t.length;r<o;++r)if((n=t[r]).name===e)return n.value}function kt(t,e,n){for(var r=0,o=t.length;r<o;++r)if(t[r].name===e){t[r]=mt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}xt.prototype=wt.prototype={constructor:xt,on:function(t,e){var n,r=this._,o=St(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++i<a;)if(n=(t=o[i]).type)r[n]=kt(r[n],t.name,e);else if(null==e)for(n in r)r[n]=kt(r[n],t.name,null);return this}for(;++i<a;)if((n=(t=o[i]).type)&&(n=_t(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new xt(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,n=(r=this._[t]).length;i<n;++i)r[i].value.apply(e,o)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(e,n)}};var Ct=wt;const Ot={capture:!0,passive:!1};var Pt=function(t){t.preventDefault(),t.stopImmediatePropagation()},Mt=function(t){var e=t.document.documentElement,n=gt(t).on("dragstart.drag",Pt,Ot);"onselectstart"in e?n.on("selectstart.drag",Pt,Ot):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function jt(t,e){var n=t.document.documentElement,r=gt(t).on("dragstart.drag",null);e&&(r.on("click.drag",Pt,Ot),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function At(t){return((t=Math.exp(t))+1/t)/2}var Et,Tt,Rt=function t(e,n,r){function o(t,o){var i,a,f=t[0],c=t[1],u=t[2],l=o[0],s=o[1],h=o[2],d=l-f,y=s-c,p=d*d+y*y;if(p<1e-12)a=Math.log(h/u)/e,i=function(t){return[f+t*d,c+t*y,u*Math.exp(e*t*a)]};else{var b=Math.sqrt(p),v=(h*h-u*u+r*p)/(2*u*n*b),g=(h*h-u*u-r*p)/(2*h*n*b),m=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(g*g+1)-g);a=(w-m)/e,i=function(t){var r,o=t*a,i=At(m),l=u/(n*b)*(i*(r=e*o+m,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(m));return[f+l*d,c+l*y,u*i/At(e*o+m)]}}return i.duration=1e3*a*e/Math.SQRT2,i}return o.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},o}(Math.SQRT2,2,4),zt=function(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]},Ft=0,It=0,Nt=0,Lt=0,Bt=0,Dt=0,Gt="object"==typeof performance&&performance.now?performance:Date,Zt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Wt(){return Bt||(Zt(Ut),Bt=Gt.now()+Dt)}function Ut(){Bt=0}function $t(){this._call=this._time=this._next=null}function Yt(t,e,n){var r=new $t;return r.restart(t,e,n),r}function Vt(){Bt=(Lt=Gt.now())+Dt,Ft=It=0;try{!function(){Wt(),++Ft;for(var t,e=Et;e;)(t=Bt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ft}()}finally{Ft=0,function(){var t,e,n=Et,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Et=e);Tt=t,Xt(r)}(),Bt=0}}function Ht(){var t=Gt.now(),e=t-Lt;e>1e3&&(Dt-=e,Lt=t)}function Xt(t){Ft||(It&&(It=clearTimeout(It)),t-Bt>24?(t<1/0&&(It=setTimeout(Vt,t-Gt.now()-Dt)),Nt&&(Nt=clearInterval(Nt))):(Nt||(Lt=Gt.now(),Nt=setInterval(Ht,1e3)),Ft=1,Zt(Vt)))}$t.prototype=Yt.prototype={constructor:$t,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Wt():+n)+(null==e?0:+e),this._next||Tt===this||(Tt?Tt._next=this:Et=this,Tt=this),this._call=t,this._time=n,Xt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xt())}};var qt=function(t,e,n){var r=new $t;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r},Kt=Ct("start","end","cancel","interrupt"),Jt=[],Qt=function(t,e,n,r,o,i){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,o=t.__transition;function i(c){var u,l,s,h;if(1!==n.state)return f();for(u in o)if((h=o[u]).name===n.name){if(3===h.state)return qt(i);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[u]):+u<e&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[u])}if(qt((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(c))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(s=n.tween.length),u=0,l=-1;u<s;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++l]=h);r.length=l+1}}function a(e){for(var o=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(f),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),f())}function f(){for(var r in n.state=6,n.timer.stop(),delete o[e],o)return;delete t.__transition}o[e]=n,n.timer=Yt((function(t){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:o,on:Kt,tween:Jt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})};function te(t,e){var n=ne(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function ee(t,e){var n=ne(t,e);if(n.state>3)throw new Error("too late; already running");return n}function ne(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var re,oe=function(t,e){var n,r,o,i=t.__transition,a=!0;if(i){for(o in e=null==e?null:e+"",i)(n=i[o]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete t.__transition}},ie=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},ae=180/Math.PI,fe={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},ce=function(t,e,n,r,o,i){var a,f,c;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(f=Math.sqrt(n*n+r*r))&&(n/=f,r/=f,c/=f),t*r<e*n&&(t=-t,e=-e,c=-c,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(e,t)*ae,skewX:Math.atan(c)*ae,scaleX:a,scaleY:f}};function ue(t,e,n,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var f=[],c=[];return i=t(i),a=t(a),function(t,r,o,i,a,f){if(t!==o||r!==i){var c=a.push("translate(",null,e,null,n);f.push({i:c-4,x:ie(t,o)},{i:c-2,x:ie(r,i)})}else(o||i)&&a.push("translate("+o+e+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,f,c),function(t,e,n,i){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:ie(t,e)})):e&&n.push(o(n)+"rotate("+e+r)}(i.rotate,a.rotate,f,c),function(t,e,n,i){t!==e?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:ie(t,e)}):e&&n.push(o(n)+"skewX("+e+r)}(i.skewX,a.skewX,f,c),function(t,e,n,r,i,a){if(t!==n||e!==r){var f=i.push(o(i)+"scale(",null,",",null,")");a.push({i:f-4,x:ie(t,n)},{i:f-2,x:ie(e,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,f,c),i=a=null,function(t){for(var e,n=-1,r=c.length;++n<r;)f[(e=c[n]).i]=e.x(t);return f.join("")}}}var le=ue((function(t){const e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?fe:ce(e.a,e.b,e.c,e.d,e.e,e.f)}),"px, ","px)","deg)"),se=ue((function(t){return null==t?fe:(re||(re=document.createElementNS("http://www.w3.org/2000/svg","g")),re.setAttribute("transform",t),(t=re.transform.baseVal.consolidate())?(t=t.matrix,ce(t.a,t.b,t.c,t.d,t.e,t.f)):fe)}),", ",")",")");function he(t,e){var n,r;return function(){var o=ee(this,t),i=o.tween;if(i!==n)for(var a=0,f=(r=n=i).length;a<f;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}o.tween=r}}function de(t,e,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=ee(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var f={name:e,value:n},c=0,u=o.length;c<u;++c)if(o[c].name===e){o[c]=f;break}c===u&&o.push(f)}i.tween=o}}function ye(t,e,n){var r=t._id;return t.each((function(){var t=ee(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return ne(t,r).value[e]}}var pe=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function be(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ve(){}var ge="\\s*([+-]?\\d+)\\s*",me="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xe=/^#([0-9a-f]{3,8})$/,Se=new RegExp(`^rgb\\(${ge},${ge},${ge}\\)$`),_e=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),ke=new RegExp(`^rgba\\(${ge},${ge},${ge},${me}\\)$`),Ce=new RegExp(`^rgba\\(${we},${we},${we},${me}\\)$`),Oe=new RegExp(`^hsl\\(${me},${we},${we}\\)$`),Pe=new RegExp(`^hsla\\(${me},${we},${we},${me}\\)$`),Me={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};function je(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Ee(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=xe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Te(e):3===n?new Ie(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Re(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Re(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Se.exec(t))?new Ie(e[1],e[2],e[3],1):(e=_e.exec(t))?new Ie(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ke.exec(t))?Re(e[1],e[2],e[3],e[4]):(e=Ce.exec(t))?Re(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Oe.exec(t))?Ze(e[1],e[2]/100,e[3]/100,1):(e=Pe.exec(t))?Ze(e[1],e[2]/100,e[3]/100,e[4]):Me.hasOwnProperty(t)?Te(Me[t]):"transparent"===t?new Ie(NaN,NaN,NaN,0):null}function Te(t){return new Ie(t>>16&255,t>>8&255,255&t,1)}function Re(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ie(t,e,n,r)}function ze(t){return t instanceof ve||(t=Ee(t)),t?new Ie((t=t.rgb()).r,t.g,t.b,t.opacity):new Ie}function Fe(t,e,n,r){return 1===arguments.length?ze(t):new Ie(t,e,n,null==r?1:r)}function Ie(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ne(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function Le(){const t=Be(this.opacity);return`${1===t?"rgb(":"rgba("}${De(this.r)}, ${De(this.g)}, ${De(this.b)}${1===t?")":`, ${t})`}`}function Be(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function De(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ge(t){return((t=De(t))<16?"0":"")+t.toString(16)}function Ze(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ue(t,e,n,r)}function We(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);if(t instanceof ve||(t=Ee(t)),!t)return new Ue;if(t instanceof Ue)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,o=Math.min(e,n,r),i=Math.max(e,n,r),a=NaN,f=i-o,c=(i+o)/2;return f?(a=e===i?(n-r)/f+6*(n<r):n===i?(r-e)/f+2:(e-n)/f+4,f/=c<.5?i+o:2-i-o,a*=60):f=c>0&&c<1?0:a,new Ue(a,f,c,t.opacity)}function Ue(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function $e(t){return(t=(t||0)%360)<0?t+360:t}function Ye(t){return Math.max(0,Math.min(1,t||0))}function Ve(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function He(t,e,n,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*n+(1+3*t+3*i-3*a)*r+a*o)/6}pe(ve,Ee,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:je,formatHex:je,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return We(this).formatHsl()},formatRgb:Ae,toString:Ae}),pe(Ie,Fe,be(ve,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ie(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Ie(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ie(De(this.r),De(this.g),De(this.b),Be(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:Ne,formatHex:Ne,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Le,toString:Le})),pe(Ue,(function(t,e,n,r){return 1===arguments.length?We(t):new Ue(t,e,n,null==r?1:r)}),be(ve,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ue(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Ue(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,o=2*n-r;return new Ie(Ve(t>=240?t-240:t+120,o,r),Ve(t,o,r),Ve(t<120?t+240:t-120,o,r),this.opacity)},clamp(){return new Ue($e(this.h),Ye(this.s),Ye(this.l),Be(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 t=Be(this.opacity);return`${1===t?"hsl(":"hsla("}${$e(this.h)}, ${100*Ye(this.s)}%, ${100*Ye(this.l)}%${1===t?")":`, ${t})`}`}}));var Xe=t=>()=>t;function qe(t,e){return function(n){return t+n*e}}function Ke(t){return 1==(t=+t)?Je:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Xe(isNaN(e)?n:e)}}function Je(t,e){var n=e-t;return n?qe(t,n):Xe(isNaN(t)?e:t)}var Qe=function t(e){var n=Ke(e);function r(t,e){var r=n((t=Fe(t)).r,(e=Fe(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=Je(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function tn(t){return function(e){var n,r,o=e.length,i=new Array(o),a=new Array(o),f=new Array(o);for(n=0;n<o;++n)r=Fe(e[n]),i[n]=r.r||0,a[n]=r.g||0,f[n]=r.b||0;return i=t(i),a=t(a),f=t(f),r.opacity=1,function(t){return r.r=i(t),r.g=a(t),r.b=f(t),r+""}}}var en=tn((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,f=r<e-1?t[r+2]:2*i-o;return He((n-r/e)*e,a,o,i,f)}})),nn=(tn((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],i=t[r%e],a=t[(r+1)%e],f=t[(r+2)%e];return He((n-r/e)*e,o,i,a,f)}})),/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g),rn=new RegExp(nn.source,"g");var on=function(t,e){var n,r,o,i=nn.lastIndex=rn.lastIndex=0,a=-1,f=[],c=[];for(t+="",e+="";(n=nn.exec(t))&&(r=rn.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),f[a]?f[a]+=o:f[++a]=o),(n=n[0])===(r=r[0])?f[a]?f[a]+=r:f[++a]=r:(f[++a]=null,c.push({i:a,x:ie(n,r)})),i=rn.lastIndex;return i<e.length&&(o=e.slice(i),f[a]?f[a]+=o:f[++a]=o),f.length<2?c[0]?function(t){return function(e){return t(e)+""}}(c[0].x):function(t){return function(){return t}}(e):(e=c.length,function(t){for(var n,r=0;r<e;++r)f[(n=c[r]).i]=n.x(t);return f.join("")})},an=function(t,e){var n;return("number"==typeof e?ie:e instanceof Ee?Qe:(n=Ee(e))?(e=n,Qe):on)(t,e)};function fn(t){return function(){this.removeAttribute(t)}}function cn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function un(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function ln(t,e,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function sn(t,e,n){var r,o,i;return function(){var a,f,c=n(this);if(null!=c)return(a=this.getAttribute(t))===(f=c+"")?null:a===r&&f===o?i:(o=f,i=e(r=a,c));this.removeAttribute(t)}}function hn(t,e,n){var r,o,i;return function(){var a,f,c=n(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(f=c+"")?null:a===r&&f===o?i:(o=f,i=e(r=a,c));this.removeAttributeNS(t.space,t.local)}}function dn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function yn(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function pn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&yn(t,o)),n}return o._value=e,o}function bn(t,e){var n,r;function o(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&dn(t,o)),n}return o._value=e,o}function vn(t,e){return function(){te(this,t).delay=+e.apply(this,arguments)}}function gn(t,e){return e=+e,function(){te(this,t).delay=e}}function mn(t,e){return function(){ee(this,t).duration=+e.apply(this,arguments)}}function wn(t,e){return e=+e,function(){ee(this,t).duration=e}}function xn(t,e){if("function"!=typeof e)throw new Error;return function(){ee(this,t).ease=e}}function Sn(t,e,n){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?te:ee;return function(){var a=i(this,t),f=a.on;f!==r&&(o=(r=f).copy()).on(e,n),a.on=o}}var _n=vt.prototype.constructor;function kn(t){return function(){this.style.removeProperty(t)}}function Cn(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function On(t,e,n){var r,o;function i(){var i=e.apply(this,arguments);return i!==o&&(r=(o=i)&&Cn(t,i,n)),r}return i._value=e,i}function Pn(t){return function(e){this.textContent=t.call(this,e)}}function Mn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Pn(r)),e}return r._value=t,r}var jn=0;function An(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function En(){return++jn}var Tn=vt.prototype;An.prototype=function(t){return vt().transition(t)}.prototype={constructor:An,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=o(t));for(var r=this._groups,i=r.length,a=new Array(i),f=0;f<i;++f)for(var c,u,l=r[f],s=l.length,h=a[f]=new Array(s),d=0;d<s;++d)(c=l[d])&&(u=t.call(c,c.__data__,d,l))&&("__data__"in c&&(u.__data__=c.__data__),h[d]=u,Qt(h[d],e,n,d,h,ne(c,n)));return new An(a,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=f(t));for(var r=this._groups,o=r.length,i=[],a=[],c=0;c<o;++c)for(var u,l=r[c],s=l.length,h=0;h<s;++h)if(u=l[h]){for(var d,y=t.call(u,u.__data__,h,l),p=ne(u,n),b=0,v=y.length;b<v;++b)(d=y[b])&&Qt(d,e,n,b,y,p);i.push(y),a.push(u)}return new An(i,a,e,n)},selectChild:Tn.selectChild,selectChildren:Tn.selectChildren,filter:function(t){"function"!=typeof t&&(t=c(t));for(var e=this._groups,n=e.length,r=new Array(n),o=0;o<n;++o)for(var i,a=e[o],f=a.length,u=r[o]=[],l=0;l<f;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&u.push(i);return new An(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,o=n.length,i=Math.min(r,o),a=new Array(r),f=0;f<i;++f)for(var c,u=e[f],l=n[f],s=u.length,h=a[f]=new Array(s),d=0;d<s;++d)(c=u[d]||l[d])&&(h[d]=c);for(;f<r;++f)a[f]=e[f];return new An(a,this._parents,this._name,this._id)},selection:function(){return new _n(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=En(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,f=r[i],c=f.length,u=0;u<c;++u)if(a=f[u]){var l=ne(a,e);Qt(a,t,n,u,f,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new An(r,this._parents,t,n)},call:Tn.call,nodes:Tn.nodes,node:Tn.node,size:Tn.size,empty:Tn.empty,each:Tn.each,on:function(t,e){var n=this._id;return arguments.length<2?ne(this.node(),n).on.on(t):this.each(Sn(n,t,e))},attr:function(t,e){var n=k(t),r="transform"===n?se:an;return this.attrTween(t,"function"==typeof e?(n.local?hn:sn)(n,r,ye(this,"attr."+t,e)):null==e?(n.local?cn:fn)(n):(n.local?ln:un)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=k(t);return this.tween(n,(r.local?pn:bn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?le:an;return null==e?this.styleTween(t,function(t,e){var n,r,o;return function(){var i=F(this,t),a=(this.style.removeProperty(t),F(this,t));return i===a?null:i===n&&a===r?o:o=e(n=i,r=a)}}(t,r)).on("end.style."+t,kn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,o,i;return function(){var a=F(this,t),f=n(this),c=f+"";return null==f&&(this.style.removeProperty(t),c=f=F(this,t)),a===c?null:a===r&&c===o?i:(o=c,i=e(r=a,f))}}(t,r,ye(this,"style."+t,e))).each(function(t,e){var n,r,o,i,a="style."+e,f="end."+a;return function(){var c=ee(this,t),u=c.on,l=null==c.value[a]?i||(i=kn(e)):void 0;u===n&&o===l||(r=(n=u).copy()).on(f,o=l),c.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,o,i=n+"";return function(){var a=F(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,On(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(ye(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,Mn(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,o=ne(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==e?he:de)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?vn:gn)(e,t)):ne(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?mn:wn)(e,t)):ne(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(xn(e,t)):ne(this.node(),e).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,e){return function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw new Error;ee(this,t).ease=n}}(this._id,t))},end:function(){var t,e,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var f={value:a},c={value:function(){0==--o&&i()}};n.each((function(){var n=ee(this,r),o=n.on;o!==t&&((e=(t=o).copy())._.cancel.push(f),e._.interrupt.push(f),e._.end.push(c)),n.on=e})),0===o&&i()}))},[Symbol.iterator]:Tn[Symbol.iterator]};var Rn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function zn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}vt.prototype.interrupt=function(t){return this.each((function(){oe(this,t)}))},vt.prototype.transition=function(t){var e,n;t instanceof An?(e=t._id,t=t._name):(e=En(),(n=Rn).time=Wt(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,f=r[i],c=f.length,u=0;u<c;++u)(a=f[u])&&Qt(a,t,e,u,f,n||zn(a,e));return new An(r,this._parents,t,e)};var Fn=t=>()=>t;function In(t,{sourceEvent:e,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Nn(t,e,n){this.k=t,this.x=e,this.y=n}Nn.prototype={constructor:Nn,scale:function(t){return 1===t?this:new Nn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Nn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ln=new Nn(1,0,0);function Bn(t){t.stopImmediatePropagation()}Nn.prototype;var Dn=function(t){t.preventDefault(),t.stopImmediatePropagation()};function Gn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Zn(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Wn(){return this.__zoom||Ln}function Un(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function $n(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],o=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}var Vn=function(){var t,e,n,r=Gn,o=Zn,i=Yn,a=Un,f=$n,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,s=Rt,h=Ct("start","zoom","end"),d=0,y=10;function p(t){t.property("__zoom",Wn).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",k).filter(f).on("touchstart.zoom",C).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",P).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(t,e){return(e=Math.max(c[0],Math.min(c[1],e)))===t.k?t:new Nn(e,t.x,t.y)}function v(t,e,n){var r=e[0]-n[0]*t.k,o=e[1]-n[1]*t.k;return r===t.x&&o===t.y?t:new Nn(t.k,r,o)}function g(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function m(t,e,n,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,i=arguments,a=w(t,i).event(r),f=o.apply(t,i),c=null==n?g(f):"function"==typeof n?n.apply(t,i):n,u=Math.max(f[1][0]-f[0][0],f[1][1]-f[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,i):e,d=s(l.invert(c).concat(u/l.k),h.invert(c).concat(u/h.k));return function(t){if(1===t)t=h;else{var e=d(t),n=u/e[2];t=new Nn(n,c[0]-e[0]*n,c[1]-e[1]*n)}a.zoom(null,t)}}))}function w(t,e,n){return!n&&t.__zooming||new x(t,e)}function x(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,e),this.taps=0}function S(t,...e){if(r.apply(this,arguments)){var n=w(this,e).event(t),o=this.__zoom,f=Math.max(c[0],Math.min(c[1],o.k*Math.pow(2,a.apply(this,arguments)))),l=zt(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=o.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(o.k===f)return;n.mouse=[l,o.invert(l)],oe(this),n.start()}Dn(t),n.wheel=setTimeout(s,150),n.zoom("mouse",i(v(b(o,f),n.mouse[0],n.mouse[1]),n.extent,u))}function s(){n.wheel=null,n.end()}}function _(t,...e){if(!n&&r.apply(this,arguments)){var o=t.currentTarget,a=w(this,e,!0).event(t),f=gt(t.view).on("mousemove.zoom",h,!0).on("mouseup.zoom",y,!0),c=zt(t,o),l=t.clientX,s=t.clientY;Mt(t.view),Bn(t),a.mouse=[c,this.__zoom.invert(c)],oe(this),a.start()}function h(t){if(Dn(t),!a.moved){var e=t.clientX-l,n=t.clientY-s;a.moved=e*e+n*n>d}a.event(t).zoom("mouse",i(v(a.that.__zoom,a.mouse[0]=zt(t,o),a.mouse[1]),a.extent,u))}function y(t){f.on("mousemove.zoom mouseup.zoom",null),jt(t.view,a.moved),Dn(t),a.event(t).end()}}function k(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,a=zt(t.changedTouches?t.changedTouches[0]:t,this),f=n.invert(a),c=n.k*(t.shiftKey?.5:2),s=i(v(b(n,c),a,f),o.apply(this,e),u);Dn(t),l>0?gt(this).transition().duration(l).call(m,s,a,t):gt(this).call(p.transform,s,a,t)}}function C(n,...o){if(r.apply(this,arguments)){var i,a,f,c,u=n.touches,l=u.length,s=w(this,o,n.changedTouches.length===l).event(n);for(Bn(n),a=0;a<l;++a)f=u[a],c=[c=zt(f,this),this.__zoom.invert(c),f.identifier],s.touch0?s.touch1||s.touch0[2]===c[2]||(s.touch1=c,s.taps=0):(s.touch0=c,i=!0,s.taps=1+!!t);t&&(t=clearTimeout(t)),i&&(s.taps<2&&(e=c[0],t=setTimeout((function(){t=null}),500)),oe(this),s.start())}}function O(t,...e){if(this.__zooming){var n,r,o,a,f=w(this,e).event(t),c=t.changedTouches,l=c.length;for(Dn(t),n=0;n<l;++n)r=c[n],o=zt(r,this),f.touch0&&f.touch0[2]===r.identifier?f.touch0[0]=o:f.touch1&&f.touch1[2]===r.identifier&&(f.touch1[0]=o);if(r=f.that.__zoom,f.touch1){var s=f.touch0[0],h=f.touch0[1],d=f.touch1[0],y=f.touch1[1],p=(p=d[0]-s[0])*p+(p=d[1]-s[1])*p,g=(g=y[0]-h[0])*g+(g=y[1]-h[1])*g;r=b(r,Math.sqrt(p/g)),o=[(s[0]+d[0])/2,(s[1]+d[1])/2],a=[(h[0]+y[0])/2,(h[1]+y[1])/2]}else{if(!f.touch0)return;o=f.touch0[0],a=f.touch0[1]}f.zoom("touch",i(v(r,o,a),f.extent,u))}}function P(t,...r){if(this.__zooming){var o,i,a=w(this,r).event(t),f=t.changedTouches,c=f.length;for(Bn(t),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),o=0;o<c;++o)i=f[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=zt(i,this),Math.hypot(e[0]-i[0],e[1]-i[1])<y)){var u=gt(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return p.transform=function(t,e,n,r){var o=t.selection?t.selection():t;o.property("__zoom",Wn),t!==o?m(t,e,n,r):o.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},p.scaleBy=function(t,e,n,r){p.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n,r)},p.scaleTo=function(t,e,n,r){p.transform(t,(function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==n?g(t):"function"==typeof n?n.apply(this,arguments):n,f=r.invert(a),c="function"==typeof e?e.apply(this,arguments):e;return i(v(b(r,c),a,f),t,u)}),n,r)},p.translateBy=function(t,e,n,r){p.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),u)}),null,r)},p.translateTo=function(t,e,n,r,a){p.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,f=null==r?g(t):"function"==typeof r?r.apply(this,arguments):r;return i(Ln.translate(f[0],f[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,u)}),r,a)},x.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=gt(this.that).datum();h.call(t,this.that,new In(t,{sourceEvent:this.sourceEvent,target:p,type:t,transform:this.that.__zoom,dispatch:h}),e)}},p.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:Fn(+t),p):a},p.filter=function(t){return arguments.length?(r="function"==typeof t?t:Fn(!!t),p):r},p.touchable=function(t){return arguments.length?(f="function"==typeof t?t:Fn(!!t),p):f},p.extent=function(t){return arguments.length?(o="function"==typeof t?t:Fn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),p):o},p.scaleExtent=function(t){return arguments.length?(c[0]=+t[0],c[1]=+t[1],p):[c[0],c[1]]},p.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],p):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},p.constrain=function(t){return arguments.length?(i=t,p):i},p.duration=function(t){return arguments.length?(l=+t,p):l},p.interpolate=function(t){return arguments.length?(s=t,p):s},p.on=function(){var t=h.on.apply(h,arguments);return t===h?p:t},p.clickDistance=function(t){return arguments.length?(d=(t=+t)*t,p):Math.sqrt(d)},p.tapDistance=function(t){return arguments.length?(y=+t,p):y},p};function Hn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xn(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function Xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Jn=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;qn(this,t),i=i||{},this.canvas=e,this.w=this.canvas.offsetWidth,this.h=this.canvas.offsetHeight,this.canvas.width=this.w,this.canvas.height=this.h;var a=this.canvas.getContext("2d");if(!a)throw"Impossible to create canvas 2D context";this.ctx=a,this.center=r||{x:.5*this.w,y:.5*this.h},this.zf=o,this.backgroundColor=i.backgroundColor||"white",this.onZoomStartFun=i.onZoomStartFun,this.onZoomEndFun=i.onZoomEndFun,this.extGeo={xMin:NaN,xMax:NaN,yMin:NaN,yMax:NaN},this.updateExtentGeo();var f=Ln,c=Vn().wheelDelta((function(t){return-t.deltaY*(1===t.deltaMode?.07:t.deltaMode?1:.004)})).on("zoom",(function(t){var e=t.transform,r=f.k/e.k;if(1==r){var o=f.x-e.x,i=f.y-e.y;n.pan(o*n.getZf(),-i*n.getZf())}else{var a=t.sourceEvent;if(a instanceof WheelEvent)n.zoom(r,n.pixToGeoX(t.sourceEvent.offsetX),n.pixToGeoY(t.sourceEvent.offsetY));else if(a instanceof TouchEvent){var c,u=0,l=0,s=Hn(a.targetTouches);try{for(s.s();!(c=s.n()).done;){var h=c.value;u+=h.clientX,l+=h.clientY}}catch(t){s.e(t)}finally{s.f()}u/=a.targetTouches.length,l/=a.targetTouches.length,n.zoom(r,n.pixToGeoX(u),n.pixToGeoY(l))}}f=e})).on("start",(function(t){n.canvasSave.c=document.createElement("canvas"),n.canvasSave.c.setAttribute("width",""+n.w),n.canvasSave.c.setAttribute("height",""+n.h),n.canvasSave.c.getContext("2d").drawImage(n.canvas,0,0),n.canvasSave.dx=0,n.canvasSave.dy=0,n.canvasSave.f=1,n.onZoomStartFun&&n.onZoomStartFun()})).on("end",(function(t){n.redraw(!0),n.canvasSave={c:null,dx:0,dy:0,f:1},n.onZoomEndFun&&n.onZoomEndFun()}));c(gt(this.canvas)),this.zfExtent=[0,1/0],this.canvasSave={c:null,dx:0,dy:0,f:1}}var e,n,r;return e=t,r=[{key:"getParameterByName",value:function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(location.search);return e?decodeURIComponent(e[1].replace(/\+/g," ")):null}}],(n=[{key:"setCenter",value:function(t){this.center=t}},{key:"getCenter",value:function(){return this.center}},{key:"setZf",value:function(t){this.zf=t,this.slider&&this.slider.attr("value",+this.zf)}},{key:"getZf",value:function(){return this.zf}},{key:"setZfExtent",value:function(t){this.zfExtent=t}},{key:"getZfExtent",value:function(){return this.zfExtent}},{key:"initCanvasTransform",value:function(){this.ctx.setTransform(1,0,0,1,0,0)}},{key:"setCanvasTransform",value:function(){var t=1/this.getZf(),e=-this.center.x/this.getZf()+.5*this.w,n=this.center.y/this.getZf()+.5*this.h;this.ctx.setTransform(t,0,0,-t,e,n)}},{key:"getWebGLTransform",value:function(){var t=2/(this.w*this.getZf()),e=2/(this.h*this.getZf());return[t,0,0,0,e,0,-t*this.center.x,-e*this.center.y,1]}},{key:"redraw",value:function(){throw new Error("Method redraw not implemented.")}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"white";this.ctx&&(this.ctx.fillStyle=t),this.ctx.fillRect(0,0,this.w,this.h)}},{key:"pan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.center.x+=t,this.center.y+=e,this.updateExtentGeo(),this.canvasSave.c&&(this.canvasSave.dx-=t/this.getZf(),this.canvasSave.dy+=e/this.getZf(),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.center.x,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.center.y;if(!(this.zfExtent[0]==this.getZf()&&t<=1||this.zfExtent[1]==this.getZf()&&t>=1)){var r=t*this.getZf();r<this.zfExtent[0]&&(t=this.zfExtent[0]/this.getZf()),r>this.zfExtent[1]&&(t=this.zfExtent[1]/this.getZf()),this.setZf(t*this.getZf());var o=(e-this.center.x)*(1-t);this.center.x+=o;var i=(n-this.center.y)*(1-t);this.center.y+=i,this.updateExtentGeo(),this.canvasSave.c&&(this.clear(this.backgroundColor),this.canvasSave.f/=t,this.canvasSave.dx=this.geoToPixX(e)*(1-this.canvasSave.f),this.canvasSave.dy=this.geoToPixY(n)*(1-this.canvasSave.f),this.clear(this.backgroundColor),this.ctx.drawImage(this.canvasSave.c,this.canvasSave.dx,this.canvasSave.dy,this.canvasSave.f*this.canvasSave.c.width,this.canvasSave.f*this.canvasSave.c.height))}}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.extGeo={xMin:this.pixToGeoX(-t),xMax:this.pixToGeoX(this.w+t),yMin:this.pixToGeoY(this.h+t),yMax:this.pixToGeoY(-t)},this.extGeo}},{key:"toDraw",value:function(t){return!(t.x<this.extGeo.xMin||t.x>this.extGeo.xMax||t.y<this.extGeo.yMin||t.y>this.extGeo.yMax)}},{key:"geoToPixX",value:function(t){return(t-this.center.x)/this.getZf()+.5*this.w}},{key:"geoToPixY",value:function(t){return-(t-this.center.y)/this.getZf()+.5*this.h}},{key:"pixToGeoX",value:function(t){return(t-.5*this.w)*this.getZf()+this.center.x}},{key:"pixToGeoY",value:function(t){return-(t-.5*this.h)*this.getZf()+this.center.y}},{key:"setViewFromURL",value:function(){var e=t.getParameterByName("x"),n=t.getParameterByName("y"),r=t.getParameterByName("z"),o=this.getCenter();null==e||null==e||isNaN(+e)||(o.x=+e),null==n||null==n||isNaN(+n)||(o.y=+n),null==r||null==r||isNaN(+r)||this.setZf(+r)}},{key:"addZoomSlider",value:function(t,e){(e=e||{}).width=e.width||"30px",e.height=e.height||"300px";var n=gt("#"+t);if(n.empty())return console.error("Could not find div element to build zoom slider. Id: "+t),this;var r=this;return this.slider=n.append("input").attr("type","range").attr("min",this.getZfExtent()[0]).attr("max",this.getZfExtent()[1]).attr("value",this.getZf()).on("input",(function(t){if(this&&this.value){var e=+this.value;gt(this).attr("value",e),r.setZf(e),r.redraw()}})).style("width",e.width).style("height",e.height).style("opacity",.7).on("mouseover",(function(t){gt(this).style("opacity",1)})).on("mouseout",(function(t){gt(this).style("opacity",.7)})).style("-webkit-appearance","slider-vertical").style("writing-mode","bt-lr").attr("orient","vertical").style("background","lightgray").style("outline","none").style("-webkit-transition",".2s").style("transition","opacity .2s"),this}}])&&Kn(e.prototype,n),r&&Kn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Qn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return tr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function tr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function er(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var rr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};er(this,t),r=r||{},this.url=e,this.resolution=n,this.preprocess=r.preprocess||function(){},this.cellsViewCache=[]}var e,n,r;return e=t,(n=[{key:"getData",value:function(t,e){throw new Error("Method getData not implemented.")}},{key:"updateViewCache",value:function(t){throw new Error("Method updateViewCache not implemented.")}},{key:"getCellFromPosition",value:function(t,e){var n,r=this.getResolution(),o=r*Math.floor(t.x/r),i=r*Math.floor(t.y/r),a=Qn(e);try{for(a.s();!(n=a.n()).done;){var f=n.value;if(f.x==o&&f.y==i)return f}}catch(t){a.e(t)}finally{a.f()}}},{key:"getResolution",value:function(){return this.resolution}},{key:"getViewCache",value:function(){return this.cellsViewCache}}])&&nr(e.prototype,n),r&&nr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function or(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ir(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ar(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var cr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(ar(this,t),r=r||{},this.datasetComponents=e,this.resolutions=n,this.datasetComponents.length>1&&this.datasetComponents.length!=this.resolutions.length)throw new Error("Uncompatible number of datasets and resolutions: "+this.datasetComponents.length+" "+this.resolutions.length);r.preprocess&&this.setPrepocesses(r.preprocess)}var e,n,r;return e=t,r=[{key:"make",value:function(e,n,r){var o,i=[],a=or(e);try{for(a.s();!(o=a.n()).done;){var f=o.value;i.push(n(f))}}catch(t){a.e(t)}finally{a.f()}return new t(i,e,r)}}],(n=[{key:"setPrepocesses",value:function(t){var e,n=or(this.datasetComponents);try{for(n.s();!(e=n.n()).done;)e.value.preprocess=t}catch(t){n.e(t)}finally{n.f()}return this}}])&&fr(e.prototype,n),r&&fr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ur(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var lr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.id=e.id,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.background=e.background||"none",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"none",this["box-shadow"]=e["box-shadow"]||"none",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.id&&(this.div=gt("#"+this.id)),this.div&&!this.div.empty()||(this.div=gt(document.createElement("div")),this.id&&this.div.attr("id",this.id)),this.div.style("background",this.background).style("padding",this.padding).style("border",this.border).style("border-radius",this["border-radius"]).style("box-shadow",this["box-shadow"]).style("font-family",this["font-family"])}var e,n,r;return e=t,(n=[{key:"update",value:function(t){console.error("Legend update not implemented yet.")}}])&&ur(e.prototype,n),r&&ur(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function sr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return hr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var yr=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.offset=e.offset||function(t,e,n){return{dx:0,dy:0}},this.minZoom=e.minZoom||0,this.maxZoom=e.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.legends=[]}var e,n,r;return e=t,r=[{key:"getStatistics",value:function(t,e,n){if(t&&0!=t.length){var r,o=1/0,i=-1/0,a=sr(t);try{for(a.s();!(r=a.n()).done;){var f=+e(r.value);n&&!f||(f<o&&(o=f),f>i&&(i=f))}}catch(t){a.e(t)}finally{a.f()}return{min:o,max:i}}}}],(n=[{key:"draw",value:function(t,e,n){throw new Error("Method draw not implemented.")}},{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(t){return this.offset=t,this}},{key:"updateLegends",value:function(t){var e,n=sr(this.legends);try{for(n.s();!(e=n.n()).done;)e.value.update(t)}catch(t){n.e(t)}finally{n.f()}return this}}])&&dr(e.prototype,n),r&&dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var vr=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(pr(this,t),r=r||{},this.dataset=e,this.styles=n,this.visible=0!=r.visible,this.minZoom=r.minZoom||0,this.maxZoom=r.maxZoom||1/0,this.minZoom>=this.maxZoom)throw new Error("Unexpected zoom limits for layer. Zoom min should be smaller than zoom max.");this.pixNb=r.pixNb||3,this.cellInfoHTML=r.cellInfoHTML||t.defaultCellInfoHTML}var e,n,r;return e=t,r=[{key:"defaultCellInfoHTML",value:function(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];"x"!==o&&"y"!==o&&e.push("<b>",o,"</b>"," : ",t[o],"<br>")}return e.join("")}}],(n=[{key:"getDatasetComponent",value:function(t){if(!(t<this.minZoom||t>this.maxZoom)){if(1==this.dataset.datasetComponents.length)return this.dataset.datasetComponents[0];for(var e=this.dataset.resolutions,n=0,r=e[n]/this.pixNb;r<t&&n<e.length;)r=e[++n]/this.pixNb;return n==e.length?this.dataset.datasetComponents[e.length-1]:this.dataset.datasetComponents[n]}}}])&&br(e.prototype,n),r&&br(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function gr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var wr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;gr(this,t),e=e||{},this.div=e.div||"tooltip_eurostat",this.maxWidth=e.maxWidth||"20em",this.fontSize=e.fontSize||"1.2em",this.background=e.background||"white",this.padding=e.padding||"5px",this.border=e.border||"0px",this["border-radius"]=e["border-radius"]||"5px",this["box-shadow"]=e["box-shadow"]||"5px 5px 5px grey",this["font-family"]=e["font-family"]||"Helvetica, Arial, sans-serif",this.transitionDuration=e.transitionDuration||100,this.xOffset=e.xOffset||30,this.yOffset=e.yOffset||20,this.tooltip=gt("#"+this.div),this.tooltip.empty()&&(this.tooltip=gt("body").append("div").attr("id",this.div)),this.tooltip.style("max-width",this.maxWidth),this.tooltip.style("overflow","hidden"),this.tooltip.style("font-size",this.fontSize),this.tooltip.style("background",this.background),this.tooltip.style("padding",this.padding),this.tooltip.style("border",this.border),this.tooltip.style("border-radius",this["border-radius"]),this.tooltip.style("box-shadow",this["box-shadow"]),this.tooltip.style("font-family",this["font-family"]),this.tooltip.style("position","absolute"),this.tooltip.style("pointer-events","none"),this.tooltip.style("opacity","0")}var e,n,r;return e=t,(n=[{key:"show",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",1)}},{key:"hide",value:function(){this.tooltip.transition().duration(this.transitionDuration).style("opacity",0)}},{key:"html",value:function(t){this.tooltip.html(t)}},{key:"setPosition",value:function(t){this.tooltip.style("left",t.pageX+this.xOffset+"px").style("top",t.pageY-this.yOffset+"px")}},{key:"style",value:function(t,e){return 1==arguments.length?this.tooltip.style(t):(this.tooltip.style(t,e),this)}},{key:"attr",value:function(t,e){return 1==arguments.length?this.tooltip.attr(t):(this.tooltip.attr(t,e),this)}}])&&mr(e.prototype,n),r&&mr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),xr={},Sr={};function _r(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function kr(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function Cr(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function Or(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),o=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Cr(-e,6):e>9999?"+"+Cr(e,6):Cr(e,4))+"-"+Cr(t.getUTCMonth()+1,2)+"-"+Cr(t.getUTCDate(),2)+(i?"T"+Cr(n,2)+":"+Cr(r,2)+":"+Cr(o,2)+"."+Cr(i,3)+"Z":o?"T"+Cr(n,2)+":"+Cr(r,2)+":"+Cr(o,2)+"Z":r||n?"T"+Cr(n,2)+":"+Cr(r,2)+"Z":"")}var Pr=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,o=[],i=t.length,a=0,f=0,c=i<=0,u=!1;function l(){if(c)return Sr;if(u)return u=!1,xr;var e,r,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=i?c=!0:10===(r=t.charCodeAt(a++))?u=!0:13===r&&(u=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,e-1).replace(/""/g,'"')}for(;a<i;){if(10===(r=t.charCodeAt(e=a++)))u=!0;else if(13===r)u=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(o,e)}return c=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(r=l())!==Sr;){for(var s=[];r!==xr&&r!==Sr;)s.push(r),r=l();e&&null==(s=e(s,f++))||o.push(s)}return o}function o(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function i(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?Or(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,o,i=r(t,(function(t,r){if(n)return n(t,r-1);o=t,n=e?function(t,e){var n=_r(t);return function(r,o){return e(n(r),o,t)}}(t,e):_r(t)}));return i.columns=o||[],i},parseRows:r,format:function(e,n){return null==n&&(n=kr(e)),[n.map(a).join(t)].concat(o(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=kr(t)),o(t,e).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}},Mr=Pr(","),jr=Mr.parse,Ar=(Mr.parseRows,Mr.format,Mr.formatBody,Mr.formatRows,Mr.formatRow,Mr.formatValue,Pr("\t")),Er=Ar.parse;Ar.parseRows,Ar.format,Ar.formatBody,Ar.formatRows,Ar.formatRow,Ar.formatValue;function Tr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}var Rr=function(t,e){return fetch(t,e).then(Tr)};function zr(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=void 0),Rr(e,n).then((function(e){return t(e,r)}))}}var Fr=zr(jr);zr(Er);function Ir(t){return(Ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function Lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Gr(t,e){return(Gr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Zr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ur(t);if(e){var o=Ur(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Wr(this,n)}}function Wr(t,e){if(e&&("object"===Ir(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ur(t){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var $r=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Gr(t,e)}(i,t);var e,n,r,o=Zr(i);function i(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Br(this,i),(n=o.call(this,t,e,r)).cells=[],n.infoLoadingStatus="notLoaded",n}return e=i,(n=[{key:"getData",value:function(t,e){var n=this;return"notLoaded"!=this.infoLoadingStatus||(this.infoLoadingStatus="loading",Fr(this.url).then((function(t){var r,o=Nr(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;i.x=+i.x,i.y=+i.y}}catch(t){o.e(t)}finally{o.f()}if(n.cells=t,n.preprocess){var a,f=Nr(n.cells);try{for(f.s();!(a=f.n()).done;){var c=a.value;n.preprocess(c)}}catch(t){f.e(t)}finally{f.f()}}e&&e(),n.infoLoadingStatus="loaded"})).catch((function(){n.infoLoadingStatus="failed",n.cells=[]}))),this}},{key:"updateViewCache",value:function(t){if(this.cells){this.cellsViewCache=[];var e,n=Nr(this.cells);try{for(n.s();!(e=n.n()).done;){var r=e.value;+r.x+this.resolution<t.xMin||+r.x-this.resolution>t.xMax||+r.y+this.resolution<t.yMin||+r.y-this.resolution>t.yMax||this.cellsViewCache.push(r)}}catch(t){n.e(t)}finally{n.f()}}}}])&&Dr(e.prototype,n),r&&Dr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(rr);function Yr(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}var Vr=function(t,e){return fetch(t,e).then(Yr)};function Hr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xr(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function Xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Kr(t,e,n){return e&&qr(t.prototype,e),n&&qr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var Jr=Kr((function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cells=e,this.x=n,this.y=r;var i=o.resolutionGeo,a=o.tileSizeCell;this.extGeo={xMin:o.originPoint.x+i*a*this.x,xMax:o.originPoint.x+i*a*(this.x+1),yMin:o.originPoint.y+i*a*this.y,yMax:o.originPoint.y+i*a*(this.y+1)};var f,c=Hr(this.cells);try{for(c.s();!(f=c.n()).done;){var u=f.value;u.x=this.extGeo.xMin+u.x*i,u.y=this.extGeo.yMin+u.y*i}}catch(t){c.e(t)}finally{c.f()}}));function Qr(t){return(Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function to(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return eo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eo(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function eo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function no(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ro(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oo(t,e){return(oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function io(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fo(t);if(e){var o=fo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ao(this,n)}}function ao(t,e){if(e&&("object"===Qr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fo(t){return(fo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var co=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oo(t,e)}(i,t);var e,n,r,o=io(i);function i(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return no(this,i),(n=o.call(this,t,0,r)).app=e,n.info=void 0,n.infoLoadingStatus="notLoaded",n.cache={},n}return e=i,(n=[{key:"loadInfo",value:function(t){var e=this;return this.info||"notLoaded"!==this.infoLoadingStatus?!t||"loaded"!==this.infoLoadingStatus&&"failed"!==this.infoLoadingStatus||t():(this.infoLoadingStatus="loading",Vr(this.url+"info.json").then((function(n){e.info=n,e.resolution=n.resolutionGeo,e.infoLoadingStatus="loaded",t&&t()})).catch((function(){e.infoLoadingStatus="failed"}))),this}},{key:"getTilingEnvelope",value:function(t){if(this.info){var e=this.info.originPoint,n=this.info.resolutionGeo,r=this.info.tileSizeCell;return{xMin:Math.floor((t.xMin-e.x)/(n*r)),xMax:Math.floor((t.xMax-e.x)/(n*r)),yMin:Math.floor((t.yMin-e.y)/(n*r)),yMax:Math.floor((t.yMax-e.y)/(n*r))}}this.loadInfo((function(){}))}},{key:"getData",value:function(t,e){var n=this;if(!this.info)return this;var r=this.getTilingEnvelope(t);if(!r)return this;for(var o=this.info.tilingBounds,i=function(t){for(var i=function(r){if(n.cache[t]||(n.cache[t]={}),n.cache[t][r])return"continue";n.cache[t][r]="loading",Fr(n.url+t+"/"+r+".csv").then((function(o){if(n.info){var i=new Jr(o,t,r,n.info);if(n.cache[t][r]=i,n.preprocess){var a,f=to(i.cells);try{for(f.s();!(a=f.n()).done;){var c=a.value;n.preprocess(c)}}catch(t){f.e(t)}finally{f.f()}}if(e){var u,l=!1,s=to(n.app.getActiveLayers());try{for(s.s();!(u=s.n()).done;)if(u.value.getDatasetComponent(n.app.getZoomFactor())==n){l=!0;break}}catch(t){s.e(t)}finally{s.f()}if(l){var h=n.app.updateExtentGeo(),d=i.extGeo;h.xMax<=d.xMin||h.xMin>=d.xMax||h.yMax<=d.yMin||h.yMin>=d.yMax||e()}}}else console.error("Tile info inknown")})).catch((function(){n.cache[t][r]="failed"}))},a=Math.max(r.yMin,o.yMin);a<=Math.min(r.yMax,o.yMax);a++)i(a)},a=Math.max(r.xMin,o.xMin);a<=Math.min(r.xMax,o.xMax);a++)i(a);return this}},{key:"updateViewCache",value:function(t){if(this.cellsViewCache=[],this.info){var e=this.getTilingEnvelope(t);if(e)for(var n=this.info.tilingBounds,r=Math.max(e.xMin,n.xMin);r<=Math.min(e.xMax,n.xMax);r++)if(this.cache[r])for(var o=Math.max(e.yMin,n.yMin);o<=Math.min(e.yMax,n.yMax);o++){var i=this.cache[r][o];if(i&&"string"!=typeof i){var a,f=to(i.cells);try{for(f.s();!(a=f.n()).done;){var c=a.value;+c.x+this.resolution<t.xMin||+c.x-this.resolution>t.xMax||+c.y+this.resolution<t.yMin||+c.y-this.resolution>t.yMax||this.cellsViewCache.push(c)}}catch(t){f.e(t)}finally{f.f()}}}}}}])&&ro(e.prototype,n),r&&ro(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(rr);function uo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return lo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lo(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function lo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function so(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ho=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{},this.url=e.url,this.style=e.style||function(){return"bold 1em Arial"},this.color=e.color||(e.dark?function(){return"#ddd"}:function(){return"#222"}),this.haloColor=e.haloColor||(e.dark?function(){return"#000000BB"}:function(){return"#FFFFFFBB"}),this.haloWidth=e.haloWidth||function(){return 4},this.textAlign=e.textAlign||"start",this.offsetPix=e.offsetPix||[5,5],this.preprocess=e.preprocess,this.labels,this.loadingStatus="notLoaded"}var e,n,r;return e=t,(n=[{key:"draw",value:function(t){if(this.labels){var e=t.getZf();t.ctx.textAlign=this.textAlign||"start",t.initCanvasTransform();var n,r=uo(this.labels);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.style(o,e);if(i&&(t.ctx.font=i,t.toDraw(o))){var a=t.geoToPixX(o.x)+this.offsetPix[0],f=t.geoToPixY(o.y)-this.offsetPix[1];if(this.haloColor&&this.haloWidth){var c=this.haloColor(o,e),u=this.haloWidth(o,e);c&&u&&u>0&&(t.ctx.strokeStyle=c,t.ctx.lineWidth=u,t.ctx.strokeText(o.name,a,f))}if(this.color){var l=this.color(o,e);l&&(t.ctx.fillStyle=l,t.ctx.fillText(o.name,a,f))}}}}catch(t){r.e(t)}finally{r.f()}}else this.load(t.redraw)}},{key:"load",value:function(t){var e=this;if(!this.url)return console.log("Failed loading labels: No URL specified. "+this.url),this.loadingStatus="failed",void(this.labels=[]);"notLoaded"===this.loadingStatus&&(this.loadingStatus="loading",Fr(this.url).then((function(n){if(e.preprocess){var r,o=uo(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;e.preprocess(i)}}catch(t){o.e(t)}finally{o.f()}}e.labels=n,e.loadingStatus="loaded",t&&t()})).catch((function(){console.log("Failed loading labels from "+e.url),e.labels=[],e.loadingStatus="failed"})))}},{key:"getUrl",value:function(){return this.url}},{key:"setUrl",value:function(t){return this.url=t,this}},{key:"getStyle",value:function(){return this.style}},{key:"setStyle",value:function(t){return this.style=t,this}},{key:"getColor",value:function(){return this.color}},{key:"setColor",value:function(t){return this.color=t,this}},{key:"getHaloColor",value:function(){return this.haloColor}},{key:"setHaloColor",value:function(t){return this.haloColor=t,this}},{key:"getHaloWidth",value:function(){return this.haloWidth}},{key:"setHaloWidth",value:function(t){return this.haloWidth=t,this}},{key:"getPreprocess",value:function(){return this.preprocess}},{key:"setPreprocess",value:function(t){return this.preprocess=t,this}}])&&so(e.prototype,n),r&&so(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function yo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return po(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return po(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function po(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function bo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var vo=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.url=e,this.preprocess=n.preprocess,this.color=n.color||function(t,e){return"gray"},this.width=n.width||function(t,e){return 2},this.lineDash=n.lineDash||function(t,e){},this.fs,this.loadingStatus="notLoaded"}var e,n,r;return e=t,(n=[{key:"draw",value:function(t){if(this.fs){var e=t.getZf();t.setCanvasTransform();var n,r=yo(this.fs);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=o.geometry.coordinates;if(!(i.length<2)){var a=this.color(o,e);if(a&&"none"!=a){t.ctx.strokeStyle=a;var f=this.width(o,e);if(f&&!(f<0)){t.ctx.lineWidth=f*e;var c=this.lineDash(o,e);c&&t.ctx.setLineDash(c),t.ctx.beginPath(),t.ctx.moveTo(i[0][0],i[0][1]);for(var u=1;u<i.length;u++)t.ctx.lineTo(i[u][0],i[u][1]);t.ctx.stroke()}}}}}catch(t){r.e(t)}finally{r.f()}t.ctx.setLineDash([])}else this.load(t.redraw)}},{key:"load",value:function(t){var e=this;if(!this.url)return console.log("Failed loading boundaries: No URL specified. "+this.url),this.loadingStatus="failed",void(this.labels=[]);"notLoaded"===this.loadingStatus&&(this.loadingStatus="loading",Vr(this.url).then((function(n){if(n=n.features,e.preprocess){var r,o=yo(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;e.preprocess(i)}}catch(t){o.e(t)}finally{o.f()}}e.fs=n,e.loadingStatus="loaded",t&&t()})).catch((function(){console.log("Failed loading boundaries from "+e.url),e.fs=[],e.loadingStatus="failed"})))}},{key:"getUrl",value:function(){return this.url}},{key:"setUrl",value:function(t){return this.url=t,this}},{key:"getPreprocess",value:function(){return this.preprocess}},{key:"setPreprocess",value:function(t){return this.preprocess=t,this}}])&&bo(e.prototype,n),r&&bo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function go(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return mo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mo(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function mo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var xo=function(){function t(e,n){var r=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=n||{},this.layers=[],e=e||document.getElementById("gridviz")){this.w=n.w||e.offsetWidth,this.h=n.h||e.offsetHeight;var o=document.createElement("canvas");o.setAttribute("width",""+this.w),o.setAttribute("height",""+this.h),e.appendChild(o),this.cg=new Jn(o),this.cg.redraw=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];r.legend&&t&&r.legend.selectAll("*").remove(),r.cg.initCanvasTransform(),r.cg.clear(r.cg.backgroundColor);var e,n=r.getZoomFactor(),o=go(r.layers);try{for(o.s();!(e=o.n()).done;){var i=e.value;if(i.visible&&!(n>i.maxZoom||n<i.minZoom)){var a=i.getDatasetComponent(n);if(a){if(t&&a.getData(r.cg.updateExtentGeo(),(function(){r.cg.redraw()})),t&&a.updateViewCache(r.cg.extGeo),t){var f,c=go(i.styles);try{for(c.s();!(f=c.n()).done;){var u=f.value;n>u.maxZoom||(n<u.minZoom||u.draw(a.getViewCache(),a.getResolution(),r.cg))}}catch(t){c.e(t)}finally{c.f()}}if(r.legend&&t){var l,s=go(i.styles);try{for(s.s();!(l=s.n()).done;){var h=l.value;if(!(n>h.maxZoom)&&!(n<h.minZoom)){var d,y=go(h.legends);try{for(y.s();!(d=y.n()).done;){var p=d.value;r.legend.node().append(p.div.node())}}catch(t){y.e(t)}finally{y.f()}}}}catch(t){s.e(t)}finally{s.f()}}}}}}catch(t){o.e(t)}finally{o.f()}return r.showBoundaries&&r.boundaryLayer&&r.boundaryLayer.draw(r.cg),r.showLabels&&r.labelLayer&&r.labelLayer.draw(r.cg),r.canvasSave=null,r},this.labelLayer=void 0,this.showLabels=!0,this.boundaryLayer=void 0,this.showBoundaries=!0,this.legendDivId=n.legendDivId||"gvizLegend",this.legend=gt("#"+this.legendDivId),this.legend.empty()&&(this.legend=gt("body").append("div").attr("id",this.legendDivId).style("position","absolute").style("width","auto").style("height","auto").style("background","#FFFFFFCC").style("border","0px").style("border-radius","5px").style("box-shadow","5px 5px 5px grey").style("font-family","Helvetica, Arial, sans-serif").style("top","20px").style("right","20px")),this.tooltip=new wr;var i=function(t){var e={x:r.cg.pixToGeoX(t.clientX),y:r.cg.pixToGeoY(t.clientY)},n=r.getCellFocusInfo(e);n?(r.tooltip.setPosition(t),r.tooltip.show(),r.tooltip.html(n.html),r.canvasSave?r.cg.ctx.drawImage(r.canvasSave,0,0):(r.canvasSave=document.createElement("canvas"),r.canvasSave.setAttribute("width",""+r.w),r.canvasSave.setAttribute("height",""+r.h),r.canvasSave.getContext("2d").drawImage(r.cg.canvas,0,0)),r.cg.initCanvasTransform(),r.cg.ctx.strokeStyle=r.selectionRectangleColor,r.cg.ctx.lineWidth=r.selectionRectangleWidthPix,r.cg.ctx.beginPath(),r.cg.ctx.rect(r.cg.geoToPixX(n.cell.x)-r.selectionRectangleWidthPix/2,r.cg.geoToPixY(n.cell.y)+r.selectionRectangleWidthPix/2,n.resolution/r.getZoomFactor()+r.selectionRectangleWidthPix,-n.resolution/r.getZoomFactor()-r.selectionRectangleWidthPix),r.cg.ctx.stroke()):(r.tooltip.hide(),r.canvasSave&&r.cg.ctx.drawImage(r.canvasSave,0,0))};e.addEventListener("mouseover",(function(t){i(t)})),e.addEventListener("mousemove",(function(t){i(t)})),e.addEventListener("mouseout",(function(){r.tooltip.hide()})),this.cg.onZoomStartFun=function(){r.tooltip.hide()},this.canvasSave=null,this.selectionRectangleColor=n.selectionRectangleColor||"red",this.selectionRectangleWidthPix=n.selectionRectangleWidthPix||4}else console.error("Cannot find gridviz container element.")}var e,n,r;return e=t,(n=[{key:"getActiveLayers",value:function(){var t,e=[],n=this.getZoomFactor(),r=go(this.layers);try{for(r.s();!(t=r.n()).done;){var o=t.value;o.visible&&o.getDatasetComponent(n)&&e.push(o)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"hideAllLayers",value:function(){var t,e=go(this.layers);try{for(e.s();!(t=e.n()).done;)t.value.visible=!1}catch(t){e.e(t)}finally{e.f()}return this}},{key:"updateExtentGeo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return this.cg.updateExtentGeo(t)}},{key:"getCellFocusInfo",value:function(t){var e=this.getActiveLayers(),n=e[e.length-1];if(n){var r=n.getDatasetComponent(this.getZoomFactor());if(r){var o=r.getCellFromPosition(t,r.getViewCache());if(o)return{cell:o,html:n.cellInfoHTML(o),resolution:r.getResolution()}}}}},{key:"getGeoCenter",value:function(){return this.cg.getCenter()}},{key:"setGeoCenter",value:function(t){return this.cg.setCenter(t),this}},{key:"getZoomFactor",value:function(){return this.cg.getZf()}},{key:"setZoomFactor",value:function(t){return this.cg.setZf(t),this}},{key:"getZoomFactorExtent",value:function(){return this.cg.getZfExtent()}},{key:"setZoomFactorExtent",value:function(t){return this.cg.setZfExtent(t),this}},{key:"getBackgroundColor",value:function(){return this.cg.backgroundColor}},{key:"setBackgroundColor",value:function(t){return this.cg.backgroundColor=t,this}},{key:"getBoundaryLayer",value:function(){return this.boundaryLayer}},{key:"setBoundaryLayer",value:function(t){return this.boundaryLayer=t,this}},{key:"getLabelLayer",value:function(){return this.labelLayer}},{key:"setLabelLayer",value:function(t){return this.labelLayer=t,this}},{key:"addLayerFromDataset",value:function(t,e,n){var r=new vr(t,e,n);return this.layers.push(r),this}},{key:"makeCSVGridDataset",value:function(t,e,n){var r=this;return new cr([new $r(t,e,n).getData(void 0,(function(){r.cg.redraw()}))],[],n)}},{key:"makeTiledCSVGridDataset",value:function(t,e){var n=this;return new cr([new co(t,this,e).loadInfo((function(){n.cg.redraw()}))],[],e)}},{key:"makeMultiScaleCSVGridDataset",value:function(t,e,n){var r=this;return cr.make(t,(function(t){return new $r(e(t),t,n).getData(void 0,(function(){r.cg.redraw()}))}),n)}},{key:"makeMultiScaleTiledCSVGridDataset",value:function(t,e,n){var r=this;return cr.make(t,(function(t){return new co(e(t),r,n).loadInfo((function(){r.cg.redraw()}))}),n)}},{key:"addCSVGridLayer",value:function(t,e,n,r){var o=this.makeCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addTiledCSVGridLayer",value:function(t,e,n){var r=this.makeTiledCSVGridDataset(t,n);return this.addLayerFromDataset(r,e,n)}},{key:"addMultiScaleCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addMultiScaleTiledCSVGridLayer",value:function(t,e,n,r){var o=this.makeMultiScaleTiledCSVGridDataset(t,e,r);return this.addLayerFromDataset(o,n,r)}},{key:"addZoomSlider",value:function(t,e){return this.cg.addZoomSlider(t,e),this}},{key:"setViewFromURL",value:function(){return this.cg.setViewFromURL(),this}}])&&wo(e.prototype,n),r&&wo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),So=function(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n},_o=So("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ko=So("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Co=So("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),Oo=So("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Po=So("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Mo=So("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),jo=So("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Ao=So("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Eo=So("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),To=So("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),Ro=t=>en(t[t.length-1]),zo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(So),Fo=Ro(zo),Io=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(So),No=Ro(Io),Lo=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(So),Bo=Ro(Lo),Do=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(So),Go=Ro(Do),Zo=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(So),Wo=Ro(Zo),Uo=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(So),$o=Ro(Uo),Yo=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(So),Vo=Ro(Yo),Ho=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(So),Xo=Ro(Ho),qo=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(So),Ko=Ro(qo),Jo=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(So),Qo=Ro(Jo),ti=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(So),ei=Ro(ti),ni=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(So),ri=Ro(ni),oi=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(So),ii=Ro(oi),ai=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(So),fi=Ro(ai),ci=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(So),ui=Ro(ci),li=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(So),si=Ro(li),hi=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(So),di=Ro(hi),yi=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(So),pi=Ro(yi),bi=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(So),vi=Ro(bi),gi=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(So),mi=Ro(gi),wi=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(So),xi=Ro(wi),Si=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(So),_i=Ro(Si),ki=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(So),Ci=Ro(ki),Oi=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(So),Pi=Ro(Oi),Mi=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(So),ji=Ro(Mi),Ai=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(So),Ei=Ro(Ai),Ti=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(So),Ri=Ro(Ti),zi=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"};const Fi=Math.PI/180,Ii=180/Math.PI;var Ni=-.29227,Li=1.97294,Bi=-.90649*Li,Di=1.78277*Li,Gi=-.6557636667999999;function Zi(t){if(t instanceof Ui)return new Ui(t.h,t.s,t.l,t.opacity);t instanceof Ie||(t=ze(t));var e=t.r/255,n=t.g/255,r=t.b/255,o=(Gi*r+Bi*e-Di*n)/(Gi+Bi-Di),i=r-o,a=(Li*(n-o)-Ni*i)/-.90649,f=Math.sqrt(a*a+i*i)/(Li*o*(1-o)),c=f?Math.atan2(a,i)*Ii-120:NaN;return new Ui(c<0?c+360:c,f,o,t.opacity)}function Wi(t,e,n,r){return 1===arguments.length?Zi(t):new Ui(t,e,n,null==r?1:r)}function Ui(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function $i(t){return function e(n){function r(e,r){var o=t((e=Wi(e)).h,(r=Wi(r)).h),i=Je(e.s,r.s),a=Je(e.l,r.l),f=Je(e.opacity,r.opacity);return function(t){return e.h=o(t),e.s=i(t),e.l=a(Math.pow(t,n)),e.opacity=f(t),e+""}}return n=+n,r.gamma=e,r}(1)}pe(Ui,Wi,be(ve,{brighter(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ui(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Ui(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Fi,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),o=Math.sin(t);return new Ie(255*(e+n*(-.14861*r+1.78277*o)),255*(e+n*(Ni*r+-.90649*o)),255*(e+n*(Li*r)),this.opacity)}}));$i((function(t,e){var n=e-t;return n?qe(t,n>180||n<-180?n-360*Math.round(n/360):n):Xe(isNaN(t)?e:t)}));var Yi=$i(Je),Vi=Yi(Wi(300,.5,0),Wi(-240,.5,1)),Hi=Yi(Wi(-100,.75,.35),Wi(80,1.5,.8)),Xi=Yi(Wi(260,.75,.35),Wi(80,1.5,.8)),qi=Wi(),Ki=function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return qi.h=360*t-100,qi.s=1.5-1.5*e,qi.l=.8-.9*e,qi+""},Ji=Fe(),Qi=Math.PI/3,ta=2*Math.PI/3,ea=function(t){var e;return t=(.5-t)*Math.PI,Ji.r=255*(e=Math.sin(t))*e,Ji.g=255*(e=Math.sin(t+Qi))*e,Ji.b=255*(e=Math.sin(t+ta))*e,Ji+""},na=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function ra(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var oa=ra(So("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ia=ra(So("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),aa=ra(So("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),fa=ra(So("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ca(t){return(ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ua(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return la(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return la(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function la(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function sa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ha(t,e){return(ha=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function da(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=pa(t);if(e){var o=pa(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ya(this,n)}}function ya(t,e){if(e&&("object"===ca(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function pa(t){return(pa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var ba=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ha(t,e)}(i,t);var e,n,r,o=da(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.sizeCol=t.sizeCol,e.size=t.size,e.shape=t.shape||function(){return"square"},e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o,i=this,a=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[i.sizeCol]-t[i.sizeCol]})),r=yr.getStatistics(t,(function(t){return t[i.sizeCol]}),!0)),this.colorCol&&(o=yr.getStatistics(t,(function(t){return t[i.colorCol]}),!0)),n.setCanvasTransform();var f,c=ua(t);try{for(c.s();!(f=c.n()).done;){var u=f.value,l=this.color?this.color(u[this.colorCol],e,o):void 0;if(l&&"none"!==l){n.ctx.fillStyle=l;var s=this.shape?this.shape(u):"square";if("none"!==s){var h=(this.size||function(){return e})(u[this.sizeCol],e,r,a),d=this.offset(u,e,a);if("square"===s){var y=e*(1-h/e)*.5;n.ctx.fillRect(u.x+y+d.dx,u.y+y+d.dy,h,h)}else if("circle"===s)n.ctx.beginPath(),n.ctx.arc(u.x+.5*e+d.dx,u.y+.5*e+d.dy,.5*h,0,2*Math.PI,!1),n.ctx.fill();else{if("donut"!==s)throw new Error("Unexpected shape:"+s);var p=u.x+.5*e+d.dx,b=u.y+.5*e+d.dy;n.ctx.beginPath(),n.ctx.moveTo(p,b),n.ctx.arc(p,b,.5*e,0,2*Math.PI),n.ctx.arc(p,b,.5*(1-h/e)*e,0,2*Math.PI,!0),n.ctx.closePath(),n.ctx.fill()}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:a,sSize:r,sColor:o})}},{key:"getColor",value:function(){return this.color}},{key:"setColor",value:function(t){return this.color=t,this}},{key:"getSize",value:function(){return this.size}},{key:"setSize",value:function(t){return this.size=t,this}},{key:"getShape",value:function(){return this.shape}},{key:"setShape",value:function(t){return this.shape=t,this}}])&&sa(e.prototype,n),r&&sa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function va(t){return(va="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ga(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ma(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ma(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function wa(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xa(t,e){return(xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Sa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=ka(t);if(e){var o=ka(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _a(this,n)}}function _a(t,e){if(e&&("object"===va(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ka(t){return(ka=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ca=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xa(t,e)}(i,t);var e,n,r,o=Sa(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.strokeColorCol=t.strokeColorCol,e.strokeColor=t.strokeColor||function(){return"#666"},e.sizeCol=t.sizeCol,e.size=t.size,e.strokeWidthCol=t.strokeWidthCol,e.strokeWidth=t.strokeWidth,e.shape=t.shape||function(){return"square"},e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,f=n.getZf();this.strokeColorCol&&(r=yr.getStatistics(t,(function(t){return t[a.strokeColorCol]}),!0)),this.sizeCol&&(o=yr.getStatistics(t,(function(t){return t[a.sizeCol]}),!0)),this.strokeWidthCol&&(i=yr.getStatistics(t,(function(t){return t[a.strokeWidthCol]}),!0)),n.setCanvasTransform();var c,u=ga(t);try{for(u.s();!(c=u.n()).done;){var l=c.value,s=this.strokeColor?this.strokeColor(l[this.strokeColorCol],e,r):void 0;if(s&&"none"!==s){n.ctx.strokeStyle=s;var h=(this.size||function(){return e})(l[this.sizeCol],e,o,f),d=this.strokeWidth?this.strokeWidth(l[this.strokeWidthCol],e,i,f):1*f;if(d&&!(d<=0)){n.ctx.lineWidth=d;var y=this.shape?this.shape(l):"square";if("none"!==y){var p=this.offset(l,e,f);if("square"===y){var b=e*(1-h/e)*.5;n.ctx.beginPath(),n.ctx.rect(l.x+b+p.dx,l.y+b+p.dy,h,h),n.ctx.stroke()}else if("circle"===y)n.ctx.beginPath(),n.ctx.arc(l.x+.5*e+p.dx,l.y+.5*e+p.dy,.5*h,0,2*Math.PI,!1),n.ctx.stroke();else{if("donut"!==y)throw new Error("Unexpected shape:"+y);console.error("Not implemented")}}}}}}catch(t){u.e(t)}finally{u.f()}}}])&&wa(e.prototype,n),r&&wa(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function Oa(t){return(Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pa(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ma(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ma(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function Ma(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ja(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Aa(t,e){return(Aa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ea(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ra(t);if(e){var o=Ra(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ta(this,n)}}function Ta(t,e){if(e&&("object"===Oa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ra(t){return(Ra=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var za=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Aa(t,e)}(i,t);var e,n,r,o=Ea(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height||function(t){return Math.sqrt(t)},e.lineColor=t.lineColor||"#BBB",e.lineWidth=t.lineWidth||1,e.fillColor=t.fillColor||"#c08c5968",e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf(),a=yr.getStatistics(t,(function(t){return t[o.heightCol]}),!0),f={},c=Pa(t);try{for(c.s();!(r=c.n()).done;){var u=r.value,l=f[u.y];l||(l={},f[u.y]=l),l[u.x]=this.height(u[this.heightCol],e,a,i)}}catch(t){c.e(t)}finally{c.f()}var s=n.extGeo;if(s){var h=Math.floor(s.xMin/e)*e,d=Math.floor(s.xMax/e)*e,y=Math.floor(s.yMin/e)*e,p=Math.floor(s.yMax/e)*e;n.ctx.strokeStyle=this.lineColor,n.ctx.lineWidth=this.lineWidth*i,n.ctx.fillStyle=this.fillColor,n.setCanvasTransform();for(var b=p;b>=y;b-=e){var v=f[b];if(v){n.ctx.beginPath(),n.ctx.moveTo(h-e/2,b);for(var g=void 0,m=h;m<=d;m+=e){var w=v[m];w||(w=0),w||g?n.ctx.lineTo(m+e/2,b+w):n.ctx.moveTo(m+e/2,b),g=w}g&&n.ctx.lineTo(d+e/2,b),this.fillColor&&n.ctx.fill(),this.lineColor&&this.lineWidth>0&&n.ctx.stroke()}}}}},{key:"getHeightCol",value:function(){return this.heightCol}},{key:"setHeightCol",value:function(t){return this.heightCol=t,this}},{key:"getHeight",value:function(){return this.height}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"getLineColor",value:function(){return this.lineColor}},{key:"setLineColor",value:function(t){return this.lineColor=t,this}},{key:"getLineWidth",value:function(){return this.lineWidth}},{key:"setLineWidth",value:function(t){return this.lineWidth=t,this}},{key:"getFillColor",value:function(){return this.fillColor}},{key:"setFillColor",value:function(t){return this.fillColor=t,this}}])&&ja(e.prototype,n),r&&ja(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function Fa(t){return(Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ia(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,f=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){f=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(f)throw o}}return i}(t,e)||Na(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Na(t,e){if(t){if("string"==typeof t)return La(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?La(t,e):void 0}}function La(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ba(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Da(t,e){return(Da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Ga(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Wa(t);if(e){var o=Wa(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Za(this,n)}}function Za(t,e){if(e&&("object"===Fa(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Wa(t){return(Wa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ua=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Da(t,e)}(i,t);var e,n,r,o=Ga(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.color=t.color,e.type=t.type,e.sizeCol=t.sizeCol,e.size=t.size||function(t,e){return e},e.stripesOrientation=t.stripesOrientation||function(){return 0},e.pieChartInternalRadiusFactor=t.pieChartInternalRadiusFactor||0,e.offsetAngle=t.offsetAngle,e.agePyramidHeight=t.agePyramidHeight,e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.sizeCol&&(t.sort((function(t,e){return e[o.sizeCol]-t[o.sizeCol]})),r=yr.getStatistics(t,(function(t){return t[o.sizeCol]}),!0));var a=Object.entries(this.color).length;n.setCanvasTransform();var f,c=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Na(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}(t);try{for(c.s();!(f=c.n()).done;){var u=f.value,l=(this.size||function(){return e})(u[this.sizeCol],e,r,i),s=this.offset(u,e,i),h=this.type?this.type(u):"flag",d=u.x+s.dx+("agepyramid"===h?0:.5*e),y=u.y+s.dy+("agepyramid"===h?0:.5*e);if("agepyramid"===h||"radar"===h||"halftone"===h){for(var p=-1/0,b=0,v=Object.keys(this.color);b<v.length;b++){var g=+u[v[b]];g>p&&(p=g)}var m=0;"agepyramid"===h&&this.agePyramidHeight&&(m=(e-this.agePyramidHeight(e))/2),"radar"!==h&&"halftone"!==h||(m=Math.PI/2+(this.offsetAngle?this.offsetAngle(u,e,i)*Math.PI/180:0));var w="agepyramid"===h?(this.agePyramidHeight?this.agePyramidHeight(e):e)/a:"radar"===h||"halftone"===h?2*Math.PI/a:void 0;if(void 0===w)throw new Error("Unexpected symbol type:"+h);for(var x=0,S=Object.entries(this.color);x<S.length;x++){var _=Ia(S[x],2),k=_[0],C=_[1];if("agepyramid"===h){n.ctx.fillStyle=C;var O=l*u[k]/p;n.ctx.fillRect(d+(e-O)/2,y+m,O,w),m+=w}else if("radar"===h){n.ctx.fillStyle=C;var P=u[k],M=l/2*Math.sqrt(P/p);n.ctx.beginPath(),n.ctx.moveTo(d,y),n.ctx.arc(d,y,M,m-w,m),n.ctx.lineTo(d,y),n.ctx.fill(),m+=w}else{if("halftone"!==h)throw new Error("Unexpected symbol type:"+h);n.ctx.fillStyle=C;var j=u[k],A=.333*l*Math.sqrt(j/p);n.ctx.beginPath(),n.ctx.arc(d+.25*e*Math.cos(m),y+.25*e*Math.sin(m),A,0,2*Math.PI),n.ctx.fill(),m+=w}}}else{for(var E=0,T=0,R=Object.keys(this.color);T<R.length;T++){var z=+u[R[T]];z&&(E+=z)}if(!E||isNaN(E))continue;for(var F=0,I=e*(1-l/e)*.5,N=0,L=Object.entries(this.color);N<L.length;N++){var B=Ia(L[N],2),D=B[0],G=B[1],Z=u[D]/E;if(Z&&!isNaN(Z)){if(n.ctx.fillStyle=G,"flag"===h)0==this.stripesOrientation(u[this.sizeCol],e,i)?n.ctx.fillRect(u.x+I+s.dx,u.y+I+F*l+s.dy,l,Z*l):n.ctx.fillRect(u.x+I+F*l+s.dx,u.y+I+s.dy,Z*l,l);else if("piechart"===h){var W=2*F*Math.PI,U=2*(F+Z)*Math.PI;n.ctx.beginPath(),n.ctx.moveTo(d,y),n.ctx.arc(d,y,.5*l,W,U),this.pieChartInternalRadiusFactor&&n.ctx.arc(d,y,.5*l*this.pieChartInternalRadiusFactor,W,U,!0),n.ctx.closePath(),n.ctx.fill()}else if("ring"===h)n.ctx.beginPath(),n.ctx.arc(d,y,Math.sqrt(1-F)*l*.5,0,2*Math.PI),n.ctx.fill();else{if("segment"!==h)throw new Error("Unexpected symbol type:"+h);var $=l*l/e;0==this.stripesOrientation(u[this.sizeCol],e,i)?n.ctx.fillRect(u.x+s.dx,u.y+(e-$)/2+F*$+s.dy,e,Z*$):n.ctx.fillRect(u.x+F*e+s.dx,u.y+(e-$)/2+s.dy,Z*e,$)}F+=Z}}}}}catch(t){c.e(t)}finally{c.f()}this.updateLegends({style:this,r:e,zf:i,sSize:r})}},{key:"getColor",value:function(){return this.color}},{key:"setColor",value:function(t){return this.color=t,this}},{key:"getType",value:function(){return this.type}},{key:"setType",value:function(t){return this.type=t,this}},{key:"getColSize",value:function(){return this.sizeCol}},{key:"setColSize",value:function(t){return this.sizeCol=t,this}},{key:"getSize",value:function(){return this.size}},{key:"setSize",value:function(t){return this.size=t,this}},{key:"getStripesOrientation",value:function(){return this.stripesOrientation}},{key:"setStripesOrientation",value:function(t){return this.stripesOrientation=t,this}},{key:"getPieChartInternalRadiusFactor",value:function(){return this.pieChartInternalRadiusFactor}},{key:"setPieChartInternalRadiusFactor",value:function(t){return this.pieChartInternalRadiusFactor=t,this}},{key:"getOffsetAngle",value:function(){return this.offsetAngle}},{key:"setOffsetAngle",value:function(t){return this.offsetAngle=t,this}},{key:"getAgePyramidHeight",value:function(){return this.agePyramidHeight}},{key:"sethAgePyramidHeight",value:function(t){return this.agePyramidHeight=t,this}}])&&Ba(e.prototype,n),r&&Ba(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function $a(t){return($a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ya(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Va(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Va(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function Va(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ha(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Xa(t,e){return(Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function qa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ja(t);if(e){var o=Ja(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ka(this,n)}}function Ka(t,e){if(e&&("object"===$a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ja(t){return(Ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Qa=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xa(t,e)}(i,t);var e,n,r,o=qa(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.orientation=t.orientation,e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.lengthCol=t.lengthCol,e.length=t.length,e.widthCol=t.widthCol,e.width=t.width,e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,f=n.getZf();this.colorCol&&(r=yr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.lengthCol&&(t.sort((function(t,e){return e[a.lengthCol]-t[a.lengthCol]})),o=yr.getStatistics(t,(function(t){return t[a.lengthCol]}),!0)),this.widthCol&&(i=yr.getStatistics(t,(function(t){return t[a.widthCol]}),!0)),n.ctx.lineCap="butt";var c=Math.PI/180;n.setCanvasTransform();var u,l=Ya(t);try{for(l.s();!(u=l.n()).done;){var s=u.value,h=this.color?this.color(s[this.colorCol],e,r):void 0;if(h){var d=this.width?this.width(s[this.widthCol],e,i,f):void 0;if(d&&!(d<0)){var y=this.length?this.length(s[this.lengthCol],e,o,f):void 0;if(y&&!(y<0)){var p=this.orientation(s)*c;if(void 0!==p&&!isNaN(p)){var b=this.offset(s,e,f);n.ctx.strokeStyle=h,n.ctx.lineWidth=d;var v=s.x+e/2+b.dx,g=s.y+e/2+b.dy,m=.5*Math.cos(p)*y,w=.5*Math.sin(p)*y;n.ctx.beginPath(),n.ctx.moveTo(v-m,g-w),n.ctx.lineTo(v+m,g+w),n.ctx.stroke()}}}}}}catch(t){l.e(t)}finally{l.f()}this.updateLegends({style:this,r:e,zf:f,sColor:r,sLength:o,sWidth:i})}},{key:"getOrientation",value:function(){return this.orientation}},{key:"setOrientation",value:function(t){return this.orientation=t,this}},{key:"getColor",value:function(){return this.color}},{key:"setColor",value:function(t){return this.color=t,this}},{key:"getLength",value:function(){return this.length}},{key:"setLength",value:function(t){return this.length=t,this}},{key:"getWidth",value:function(){return this.width}},{key:"setWidth",value:function(t){return this.width=t,this}}])&&Ha(e.prototype,n),r&&Ha(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function tf(t){return(tf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ef(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return nf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nf(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function nf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function of(t,e){return(of=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function af(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=cf(t);if(e){var o=cf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ff(this,n)}}function ff(t,e){if(e&&("object"===tf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function cf(t){return(cf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var uf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&of(t,e)}(i,t);var e,n,r,o=af(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.textCol=t.textCol,e.text=t.text||function(t,e,n,r){return"X"},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.fontSizeCol=t.fontSizeCol,e.fontSize=t.fontSize||function(t,e,n,r){return e-2},e.fontFamily=t.fontFamily||"Arial",e.fontWeight=t.fontWeight||"bold",e}return e=i,r=[{key:"getCharLegendFun",value:function(t){var e=t.length;return function(n){return 0==n?"":1==n?t[e-1]:t[Math.floor(n*e)]}}}],(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,f=n.getZf();this.textCol&&(r=yr.getStatistics(t,(function(t){return t[a.textCol]}),!0)),this.colorCol&&(o=yr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.fontSizeCol&&(t.sort((function(t,e){return e[a.fontSizeCol]-t[a.fontSizeCol]})),i=yr.getStatistics(t,(function(t){return t[a.fontSizeCol]}),!0));var c,u=ef(t);try{for(u.s();!(c=u.n()).done;){var l=c.value,s=this.text?this.text(l[this.textCol],e,r):void 0;if(s){var h=this.color?this.color(l[this.colorCol],e,o):void 0;if(h){n.ctx.fillStyle=h;var d=(this.fontSize||function(){return e/f-2})(l[this.fontSizeCol],e,i,f)/f,y=this.fontFamily||"Arial",p=this.fontWeight||"bold";n.ctx.font=p+" "+d+"px "+y;var b=this.offset(l,e,f);n.ctx.textAlign="center";var v=n.geoToPixX(l.x+.5*e+b.dx),g=n.geoToPixY(l.y+.5*e+b.dy)+.5*d;n.ctx.fillText(s,v,g)}}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,r:e,zf:f,sColor:o})}}])&&rf(e.prototype,n),r&&rf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function lf(t){return(lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return hf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hf(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function hf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function df(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function yf(t,e){return(yf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function pf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=vf(t);if(e){var o=vf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return bf(this,n)}}function bf(t,e){if(e&&("object"===lf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function vf(t){return(vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var gf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yf(t,e)}(i,t);var e,n,r,o=pf(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.value=t.value,e.sigma=t.sigma,e.styles=t.styles,e}return e=i,(n=[{key:"getKernelMatrix",value:function(t){for(var e,n,r=Math.floor(3*t),o=2*t*t,i=[],a=0;a<=r;a++){for(var f=[],c=0;c<=r;c++){var u=(e=a,n=c,Math.exp(-(e*e+n*n)/o));f.push({w:u,val:0})}i.push(f)}return i}},{key:"kernelSmoothing",value:function(t,e,n,r){var o,i=Math.floor(e.xMin/n)*n,a=Math.floor(e.xMax/n)*n,f=Math.floor(e.yMin/n)*n,c=Math.floor(e.yMax/n)*n,u=(a-i)/n+1,l=(c-f)/n+1,s=sf(t);try{for(s.s();!(o=s.n()).done;)o.value.ksmval=0}catch(t){s.e(t)}finally{s.f()}var h,d={},y=sf(t);try{for(y.s();!(h=y.n()).done;){var p=h.value,b=Math.floor((p.x-i)/n),v=Math.floor((p.y-f)/n);d[b]||(d[b]={}),d[b][v]=p}}catch(t){y.e(t)}finally{y.f()}for(var g=this.getKernelMatrix(r),m=g.length,w=0,x=Object.keys(d);w<x.length;w++)for(var S=x[w],_=+S,k=0,C=Object.keys(d[S]);k<C.length;k++){var O=+C[k],P=d[_][O];if(!P.notInputCell){var M=this.value(P);if(M){for(var j=0,A=0;A<m;A++)for(var E=0;E<m;E++){var T=g[A][E];T.val=T.w*M,j+=T.w}for(var R=function(t,e){return t>=0&&t<u&&e>=0&&e<l},z=function(t,e,r){var o=d[t]?d[t][e]:void 0;o?o.ksmval?o.ksmval+=r:o.ksmval=r:(d[t]||(d[t]={}),d[t][e]={x:i+t*n,y:f+e*n,ksmval:r,notInputCell:!0})},F=0;F<m;F++)for(var I=0;I<m;I++){var N=g[Math.abs(F)][Math.abs(I)];if(N){var L=N.val;L&&(L/=j)&&(R(_+F,O+I)&&z(_+F,O+I,L),0==F&&0==I||(R(_-F,O+I)&&z(_-F,O+I,L),0!=F&&(R(_+F,O-I)&&z(_+F,O-I,L),R(_-F,O-I)&&z(_-F,O-I,L))))}}}}}for(var B=[],D=0,G=Object.keys(d);D<G.length;D++)for(var Z=G[D],W=0,U=Object.keys(d[Z]);W<U.length;W++){var $=U[W];B.push(d[Z][$])}return B}},{key:"draw",value:function(t,e,n){if(t&&0!=t.length){var r=this.sigma(e,n.zf);t=this.kernelSmoothing(t,n.extGeo,e,r/e);var o,i=sf(this.styles);try{for(i.s();!(o=i.n()).done;)o.value.draw(t,e,n)}catch(t){i.e(t)}finally{i.f()}}}},{key:"getValue",value:function(){return this.value}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"getSigma",value:function(){return this.sigma}},{key:"setSigma",value:function(t){return this.sigma=t,this}},{key:"getStyles",value:function(){return this.styles}},{key:"setStyles",value:function(t){return this.styles=t,this}}])&&df(e.prototype,n),r&&df(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function mf(t){return(mf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return xf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xf(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function xf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Sf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _f(t,e){return(_f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function kf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Of(t);if(e){var o=Of(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cf(this,n)}}function Cf(t,e){if(e&&("object"===mf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Of(t){return(Of=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_f(t,e)}(i,t);var e,n,r,o=kf(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.heightCol=t.heightCol,e.height=t.height,e.colorCol=t.colorCol,e.color=t.color||function(){return"#c08c59"},e.widthCol=t.widthCol,e.width=t.width||function(t,e){return.5*e},e.viewHeightFactor=5,e.shadowDirection=40.3*Math.PI/180,e.shadowFactor=.2,e.shadowColor="#00000033",e.viewSX=-.25,e.viewSY=-1.5,e.outlineCol="#FFFFFF",e.outlineWidthPix=.5,e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o,i,a=this,f=n.getZf();this.heightCol&&(r=yr.getStatistics(t,(function(t){return t[a.heightCol]}),!0)),this.colorCol&&(o=yr.getStatistics(t,(function(t){return t[a.colorCol]}),!0)),this.widthCol&&(i=yr.getStatistics(t,(function(t){return t[a.widthCol]}),!0));var c=n.getCenter().x+this.viewSX*n.w*f,u=n.getCenter().y+this.viewSY*n.h*f,l=this.viewHeightFactor*(n.w+n.h)*.5*f;t.sort((function(t,e){return 1e8*(e.y-t.y)+t.x-e.x})),n.ctx.lineCap="round",n.setCanvasTransform(),n.ctx.strokeStyle=this.shadowColor;var s,h=wf(t);try{for(h.s();!(s=h.n()).done;){var d=s.value,y=this.width?this.width(d[this.widthCol],e,i,f):void 0;if(y&&!(y<0)){var p=this.height?this.height(d[this.heightCol],e,r,f):void 0;if(p&&!(p<0)){this.offset(d,e,f),n.ctx.lineWidth=y;var b=d.x+e/2,v=d.y+e/2,g=p*this.shadowFactor;n.ctx.beginPath(),n.ctx.moveTo(b,v),n.ctx.lineTo(b+g*Math.cos(this.shadowDirection),v+g*Math.sin(this.shadowDirection)),n.ctx.stroke(),n.ctx.fillStyle="gray",n.ctx.beginPath(),n.ctx.arc(b,v,.5*y,0,2*Math.PI,!1),n.ctx.fill()}}}}catch(t){h.e(t)}finally{h.f()}var m,w=wf(t);try{for(w.s();!(m=w.n()).done;){var x=m.value,S=this.color?this.color(x[this.colorCol],e,o):void 0;if(S){var _=this.width?this.width(x[this.widthCol],e,i,f):void 0;if(_&&!(_<0)){var k=this.height?this.height(x[this.heightCol],e,r,f):void 0;if(k&&!(k<0)){this.offset(x,e,f);var C=x.x+e/2,O=x.y+e/2,P=C-c,M=O-u,j=Math.atan2(M,P),A=Math.sqrt(P*P+M*M)*k/(l-k);n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=_+2*this.outlineWidthPix*f,n.ctx.beginPath(),n.ctx.moveTo(C,O),n.ctx.lineTo(C+A*Math.cos(j),O+A*Math.sin(j)),n.ctx.stroke(),n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),n.ctx.moveTo(C,O),n.ctx.lineTo(C+A*Math.cos(j),O+A*Math.sin(j)),n.ctx.stroke(),n.ctx.strokeStyle=this.outlineCol,n.ctx.lineWidth=this.outlineWidthPix*f,n.ctx.beginPath(),n.ctx.arc(C+A*Math.cos(j),O+A*Math.sin(j),.5*_,0,2*Math.PI,!1),n.ctx.stroke()}}}}}catch(t){w.e(t)}finally{w.f()}n.ctx.lineCap="butt",this.updateLegends({style:this,r:e,zf:f,sColor:o})}},{key:"getColor",value:function(){return this.color}},{key:"setColor",value:function(t){return this.color=t,this}},{key:"getHeight",value:function(){return this.height}},{key:"setHeight",value:function(t){return this.height=t,this}},{key:"getWidth",value:function(){return this.width}},{key:"setWidth",value:function(t){return this.width=t,this}}])&&Sf(e.prototype,n),r&&Sf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function Mf(t){return(Mf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Af(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Af(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function Af(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ef(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Tf(t,e){return(Tf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Rf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ff(t);if(e){var o=Ff(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zf(this,n)}}function zf(t,e){if(e&&("object"===Mf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ff(t){return(Ff=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var If=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tf(t,e)}(i,t);var e,n,r,o=Rf(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.valueCol=t.valueCol,e.value=t.value||function(t,e,n,r,o){return 1},e.color=t.color||function(){return"#EA6BAC"},e.width=t.width||function(t,e,n,r){return e*t.value/5},e.orientation=t.orientation,e.fillColor=t.fillColor,e}return e=i,r=[{key:"getSideStatistics",value:function(t,e){if(t&&0!=t.length){var n,r=1/0,o=-1/0,i=jf(t);try{for(i.s();!(n=i.n()).done;){var a=n.value.value;e&&!a||(a<r&&(r=a),a>o&&(o=a))}}catch(t){i.e(t)}finally{i.f()}return{min:r,max:o}}}}],(n=[{key:"draw",value:function(t,e,n){var r,o=this,a=n.getZf();this.valueCol&&(r=yr.getStatistics(t,(function(t){return t[o.valueCol]}),!0));var f=[];t.sort((function(t,e){return e.x==t.x?t.y-e.y:t.x-e.x}));for(var c=t[0],u=1;u<t.length;u++){var l=t[u];c.y+e==l.y&&c.x==l.x?f.push({x:c.x,y:l.y,or:"h",value:this.value(c[this.valueCol],l[this.valueCol],e,r,a)}):(f.push({x:c.x,y:c.y+e,or:"h",value:this.value(c[this.valueCol],void 0,e,r,a)}),f.push({x:l.x,y:l.y,or:"h",value:this.value(void 0,l[this.valueCol],e,r,a)})),c=l}t.sort((function(t,e){return e.y==t.y?t.x-e.x:t.y-e.y})),c=t[0];for(var s=1;s<t.length;s++){var h=t[s];c.x+e==h.x&&c.y==h.y?f.push({x:c.x+e,y:c.y,or:"v",value:this.value(c[this.valueCol],h[this.valueCol],e,r,a)}):(f.push({x:c.x+e,y:c.y,or:"v",value:this.value(c[this.valueCol],void 0,e,r,a)}),f.push({x:h.x,y:h.y,or:"v",value:this.value(void 0,h[this.valueCol],e,r,a)})),c=h}var d=i.getSideStatistics(f,!0);if(n.setCanvasTransform(),this.fillColor){var y,p=jf(t);try{for(p.s();!(y=p.n()).done;){var b=y.value,v=this.fillColor(b);v&&"none"!=v&&(n.ctx.fillStyle=v,n.ctx.fillRect(b.x,b.y,e,e))}}catch(t){p.e(t)}finally{p.f()}}n.ctx.lineCap="butt";for(var g=e/2,m=0,w=f;m<w.length;m++){var x=w[m],S=this.color?this.color(x,e,d):void 0;if(S){var _=this.width?this.width(x,e,d,a):void 0;!_||_<0||(n.ctx.strokeStyle=S,n.ctx.lineWidth=_,n.ctx.beginPath(),90==this.orientation?(n.ctx.moveTo(x.x+g,x.y+g),"h"===x.or?n.ctx.lineTo(x.x+g,x.y-g):n.ctx.lineTo(x.x-g,x.y+g)):(n.ctx.moveTo(x.x,x.y),n.ctx.lineTo(x.x+("h"===x.or?e:0),x.y+("v"===x.or?e:0))),n.ctx.stroke())}}this.updateLegends({style:this,r:e,zf:a})}}])&&Ef(e.prototype,n),r&&Ef(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr),Nf=function t(e){function n(t,n){var r,o;return t=null==t?0:+t,n=null==n?1:+n,function(){var i;if(null!=r)i=r,r=null;else do{r=2*e()-1,i=2*e()-1,o=r*r+i*i}while(!o||o>1);return t+n*i*Math.sqrt(-2*Math.log(o)/o)}}return n.source=t,n}(Math.random);function Lf(t,e){var n=document.createElement("canvas");n.setAttribute("width",t),n.setAttribute("height",e);var r=n.getContext("webgl");if(!r)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");return{canvas:n,gl:r}}function Bf(t){var e=t.createProgram();if(null==e)throw new Error("Cannot create webGL program");for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0,a=r;i<a.length;i++){var f=a[i];t.attachShader(e,f)}if(t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS))return e;throw new Error(t.getProgramInfoLog(e)||"Cannot create webGL program (2)")}function Df(t,e){var n=t.createShader(e);if(null==n)throw new Error("Cannot create webGL shader");for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];if(t.shaderSource(n,o.join("\n")),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;throw new Error(t.getShaderInfoLog(n)||"Cannot create webGL shader (2)")}function Gf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Zf=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gl=e,this.sizePix=n||10,this.program=Bf(e,Df(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n attribute vec4 color;\n varying vec4 vColor;\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vColor = color;\n }\n "),Df(e,e.FRAGMENT_SHADER,"\n precision mediump float;\n varying vec4 vColor;\n void main(void) {\n vec4 vColor_ = vColor / 255.0;\n vColor_[3] = 255.0 * vColor_[3];\n gl_FragColor = vColor_;\n }")),e.useProgram(this.program),this.verticesBuffer=[],this.colorsBuffer=[]}var e,n,r;return e=t,(n=[{key:"addPointData",value:function(t,e,n){var r=Ee(n);r&&(this.verticesBuffer.push(t,e),this.colorsBuffer.push(r.r,r.g,r.b,r.opacity))}},{key:"addPointData2",value:function(t,e,n,r,o,i){this.verticesBuffer.push(t,e),this.colorsBuffer.push(n,r,o,i)}},{key:"draw",value:function(t){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.verticesBuffer),e.STATIC_DRAW);var n=e.getAttribLocation(this.program,"pos");e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,new Float32Array(this.colorsBuffer),e.STATIC_DRAW);var r=e.getAttribLocation(this.program,"color");e.vertexAttribPointer(r,4,e.FLOAT,!1,0,0),e.enableVertexAttribArray(r),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*this.sizePix),e.uniformMatrix3fv(e.getUniformLocation(this.program,"mat"),!1,new Float32Array(t)),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.POINTS,0,this.verticesBuffer.length/2)}}])&&Gf(e.prototype,n),r&&Gf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Wf(t){return(Wf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uf(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return $f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $f(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function $f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Yf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Vf(t,e){return(Vf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Hf(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=qf(t);if(e){var o=qf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Xf(this,n)}}function Xf(t,e){if(e&&("object"===Wf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function qf(t){return(qf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Kf=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vf(t,e)}(i,t);var e,n,r,o=Hf(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.col=t.col,e.nb=t.nb||function(t,e,n,r){return.3*e*e/(r*r)*t/n.max},e.color=t.color||function(){return"#FF5733"},e.dotSize=t.dotSize,e.sigma=t.sigma,e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();if(this.col&&(r=yr.getStatistics(t,(function(t){return t[o.col]}),!0)),r){var a=this.dotSize?this.dotSize(e,i):2*i,f=this.sigma?this.sigma(e):.4*e,c=Nf(0,f);if(function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}()){var u=Lf(n.w+"",n.h+"");if(!u)return void console.error("No webGL");var l,s,h,d,y,p,b,v=new Zf(u.gl,a/i),g=e/2,m=Uf(t);try{for(m.s();!(b=m.n()).done;){var w=b.value;if((l=this.color(w))&&"none"!==l){if(s=this.offset(w,e,i),h=this.nb(w[this.col],e,r,i),d=w.x+s.dx+g,y=w.y+s.dy+g,!(p=Ee(l)))return;for(var x=0;x<=h;x++)v.addPointData2(d+c(),y+c(),p.r,p.g,p.b,p.opacity)}}}catch(t){m.e(t)}finally{m.f()}v.draw(n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(u.canvas,0,0)}else{n.setCanvasTransform();var S,_=Uf(t);try{for(_.s();!(S=_.n()).done;){var k=S.value,C=this.color(k);if(C&&"none"!==C){n.ctx.fillStyle=C;for(var O=this.offset(k,e,i),P=this.nb(k[this.col],e,r,i),M=k.x+O.dx+e/2,j=k.y+O.dy+e/2,A=0;A<=P;A++)n.ctx.fillRect(M+c(),j+c(),a,a)}}}catch(t){_.e(t)}finally{_.f()}}this.updateLegends({style:this,r:e,zf:i})}}}])&&Yf(e.prototype,n),r&&Yf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function Jf(t){return(Jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qf(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function tc(t,e){return(tc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ec(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=rc(t);if(e){var o=rc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nc(this,n)}}function nc(t,e){if(e&&("object"===Jf(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function rc(t){return(rc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var oc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tc(t,e)}(i,t);var e,n,r,o=ec(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.size=t.size,e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.colorCol&&(r=yr.getStatistics(t,(function(t){return t[o.colorCol]}),!0));var a=Lf(n.w+"",n.h+"");if(a){for(var f,c,u=this.size?this.size(e,i):e+.2*i,l=new Zf(a.gl,u/i),s=e/2,h=t.length,d=0;d<h;d++)c=t[d],(f=this.color?this.color(c[this.colorCol],e,r):void 0)&&"none"!==f&&l.addPointData(c.x+s,c.y+s,f);l.draw(n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:i,sColor:r})}else console.error("No webGL")}},{key:"getColor",value:function(){return this.color}},{key:"setColor",value:function(t){return this.color=t,this}}])&&Qf(e.prototype,n),r&&Qf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function ic(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var ac=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,r;return e=t,r=[{key:"get",value:function(t,e){(e=e||{}).colors=e.colors||["#a9bb9e","#c9dcaa","#f0f1af","#fde89f","#f9a579","#eb444b"],e.breaks=e.breaks,e.valueStretch=e.valueStretch,e.colDark=e.colDark||"#111",e.colBright=e.colBright||"#ddd",e.widthFactor=e.widthFactor||.1;var n=function(t){if(e.breaks){for(var n=0;n<e.breaks.length;n++)if(t<e.breaks[n])return n;return e.breaks.length}if(e.valueStretch){for(var r=t,o=e.colors.length,i=0;i<o-1;i++)if(r<=(i+1)/o)return i;return o-1}return NaN};return[new oc({colorCol:t,color:function(t,r,o,i){if(0!=t||!e.valueStretch||!isNaN(e.valueStretch(t,r,o,i)))return e.colors[n(e.valueStretch?e.valueStretch(t,r,o,i):t)]},size:function(t,e){return t+.5*e}}),new If({valueCol:t,value:function(t,r,o,i,a){var f=e.valueStretch?e.valueStretch(t,o,i,a):t,c=e.valueStretch?e.valueStretch(r,o,i,a):r;return f&&!isNaN(f)||c&&!isNaN(c)?!f||isNaN(f)?n(c):!c||isNaN(c)?-n(f):n(c)-n(f):0},color:function(t,n,r,o){if(0!==t.value)return"v"===t.or?t.value>0?e.colBright:e.colDark:t.value>0?e.colDark:e.colBright},width:function(t,n,r,o){return e.widthFactor*n*Math.abs(t.value)*("v"===t.or?.5:1)}})]}}],(n=null)&&ic(e.prototype,n),r&&ic(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fc(t){return(fc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return uc(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uc(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function uc(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function lc(t,e){return(lc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function sc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=dc(t);if(e){var o=dc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return hc(this,n)}}function hc(t,e){if(e&&("object"===fc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function dc(t){return(dc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function yc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bc(t,e,n){return e&&pc(t.prototype,e),n&&pc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var vc=function(){function t(){yc(this,t)}return bc(t,null,[{key:"get",value:function(t,e){(e=e||{}).colors=e.colors||["#afd246","#00852b","#fac80a","#d67923","#bb805a","#cb4e29","#b40000","#720012"],e.breaks=e.breaks,e.valueStretch=e.valueStretch,e.colDark=e.colDark||"#333",e.colBright=e.colBright||"#aaa",e.widthFactor=e.widthFactor||.05;var n=function(t){if(e.breaks){for(var n=0;n<e.breaks.length;n++)if(t<e.breaks[n])return n;return e.breaks.length}if(e.valueStretch){for(var r=t,o=e.colors.length,i=0;i<o-1;i++)if(r<=(i+1)/o)return i;return o-1}return NaN};return[new oc({colorCol:t,color:function(t,r,o,i){if(0!=t||!e.valueStretch||!isNaN(e.valueStretch(t,r,o,i)))return e.colors[n(e.valueStretch?e.valueStretch(t,r,o,i):t)]}}),new If({valueCol:t,value:function(t,r,o,i,a){var f=e.valueStretch?e.valueStretch(t,o,i,a):t,c=e.valueStretch?e.valueStretch(r,o,i,a):r;return f&&!isNaN(f)||c&&!isNaN(c)?!f||isNaN(f)?n(c):!c||isNaN(c)?-n(f):n(c)-n(f):0},color:function(t,n,r,o){return 0===t.value?e.colDark:"v"===t.or?t.value>0?e.colBright:e.colDark:t.value>0?e.colDark:e.colBright},width:function(t,n,r,o){return 0==t.value?.75*o:e.widthFactor*n*Math.abs(t.value)*("v"===t.or?.5:1)}}),new(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lc(t,e)}(r,t);var n=sc(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return yc(this,r),n.call(this,t)}return bc(r,[{key:"draw",value:function(t,n,r){r.ctx.lineWidth=.6*r.getZf(),r.ctx.strokeStyle=e.colDark;var o,i=cc(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;r.ctx.beginPath(),r.ctx.arc(a.x+.5*n,a.y+.5*n,.55*n*.5,Math.PI/4,-Math.PI*(3/4),!0),r.ctx.stroke()}}catch(t){i.e(t)}finally{i.f()}r.ctx.strokeStyle=e.colBright;var f,c=cc(t);try{for(c.s();!(f=c.n()).done;){var u=f.value;r.ctx.beginPath(),r.ctx.arc(u.x+.5*n,u.y+.5*n,.55*n*.5,Math.PI/4,-Math.PI*(3/4),!1),r.ctx.stroke()}}catch(t){c.e(t)}finally{c.f()}}}]),r}(yr))]}}]),t}();function gc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var wc=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;gc(this,t),this.gl=e;var i=Df(e,e.VERTEX_SHADER,"\n attribute vec2 pos;\n uniform float sizePix;\n uniform mat3 mat;\n\n attribute float t;\n varying float vt;\n\n void main() {\n gl_Position = vec4(mat * vec3(pos, 1.0), 1.0);\n gl_PointSize = sizePix;\n vt = t;\n }\n "),a="\n precision mediump float;\n varying float vt;\n uniform float deformationFactor;"+function(){for(var t=[],e=0;e<n.length;e++)t.push("uniform vec4 c"+e+";");return t.join("")}()+"void main(void) {\n float t = pow(vt, deformationFactor);";2==n.length?a+="\n vec4 cI=c0;\n vec4 cF=c1;":3==n.length?a+="\n vec4 cI;\n vec4 cF;\n if(t<0.5) { cI=c0; cF=c1; t=t*2.0; }\n else { cI=c1; cF=c2; t=(t-0.5)*2.0; }":4==n.length?a+="\n vec4 cI;\n vec4 cF;\n if(t<1.0/3.0) { cI=c0; cF=c1; t=t*3.0; }\n else if(t<2.0/3.0) { cI=c1; cF=c2; t=(t-1.0/3.0)*3.0; }\n else { cI=c2; cF=c3; t=(t-2.0/3.0)*3.0; }":5==n.length&&(a+="\n vec4 cI;\n vec4 cF;\n if(t<0.25) { cI=c0; cF=c1; t=t*4.0; }\n else if(t<0.5) { cI=c1; cF=c2; t=(t-0.25)*4.0; }\n else if(t<0.75) { cI=c2; cF=c3; t=(t-0.5)*4.0; }\n else { cI=c3; cF=c4; t=(t-0.75)*4.0; }"),1==n.length?a+="gl_FragColor = vec4(c0[0], c0[1], c0[2], c0[3]);}":n.length<=5&&n.length>1?a+="gl_FragColor = mix(cI, cF, t);}":a+="gl_FragColor = vec4(0.5, 0.5, 0.5, 1.0);}";var f=Df(e,e.FRAGMENT_SHADER,a);this.program=Bf(e,i,f),e.useProgram(this.program),e.uniform1f(e.getUniformLocation(this.program,"sizePix"),1*o),e.uniform1f(e.getUniformLocation(this.program,"deformationFactor"),1*r);for(var c=0;c<n.length;c++){var u=Ee(n[c]);e.uniform4fv(e.getUniformLocation(this.program,"c"+c),[+u.r/255,+u.g/255,+u.b/255,+u.opacity])}}var e,n,r;return e=t,(n=[{key:"draw",value:function(t,e,n){var r=this.gl,o=this.program;r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t),r.STATIC_DRAW);var i=r.getAttribLocation(o,"pos");r.vertexAttribPointer(i,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i),r.bindBuffer(r.ARRAY_BUFFER,r.createBuffer()),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e),r.STATIC_DRAW);var a=r.getAttribLocation(o,"t");r.vertexAttribPointer(a,1,r.FLOAT,!1,0,0),r.enableVertexAttribArray(a),r.uniformMatrix3fv(r.getUniformLocation(o,"mat"),!1,new Float32Array(n)),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.POINTS,0,t.length/2)}}])&&mc(e.prototype,n),r&&mc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function xc(t){return(xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _c(t,e){return(_c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function kc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Oc(t);if(e){var o=Oc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Cc(this,n)}}function Cc(t,e){if(e&&("object"===xc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Oc(t){return(Oc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Pc=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_c(t,e)}(i,t);var e,n,r,o=kc(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.colorCol=t.colorCol,e.tFun=t.tFun||function(t,e,n){return t/n.max},e.deformationFactor=t.deformationFactor||1,e.colors=t.colors||["lightblue","green","yellow","orange","red"],t.color&&(e.colors=[t.color(0),t.color(.25),t.color(.5),t.color(.75),t.color(1)]),e.size=t.size,e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r=this,o=n.getZf(),i=yr.getStatistics(t,(function(t){return t[r.colorCol]}),!0);if(i){var a=Lf(n.w+"",n.h+"");if(a){for(var f,c=e/2,u=t.length,l=[],s=[],h=0;h<u;h++){f=t[h];var d=this.tFun(f[this.colorCol],e,i);null!=d&&null!=d&&(l.push(f.x+c,f.y+c),s.push(d))}var y=this.size?this.size(e,o):e+.2*o;new wc(a.gl,this.colors,this.deformationFactor,y/o).draw(l,s,n.getWebGLTransform()),n.initCanvasTransform(),n.ctx.drawImage(a.canvas,0,0),this.updateLegends({style:this,r:e,zf:o,sColor:i})}else console.error("No webGL")}}}])&&Sc(e.prototype,n),r&&Sc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function Mc(t){return(Mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ac(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ac(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function Ac(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ec(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Tc(t,e){return(Tc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Rc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Fc(t);if(e){var o=Fc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zc(this,n)}}function zc(t,e){if(e&&("object"===Mc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Fc(t){return(Fc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ic=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Tc(t,e)}(i,t);var e,n,r,o=Rc(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.colorCol=t.colorCol,e.color=t.color||function(){return"#EA6BAC"},e.mosaicFactor=t.mosaicFactor||.15,e.shadowFactor=t.shadowFactor||.2,e.shadowColor=t.shadowColor||"#555",e}return e=i,(n=[{key:"draw",value:function(t,e,n){var r,o=this,i=n.getZf();this.colorCol&&(r=yr.getStatistics(t,(function(t){return t[o.colorCol]}),!0)),n.ctx.strokeStyle=this.shadowColor,n.ctx.lineWidth=this.shadowFactor*e,n.ctx.lineJoin="round",n.ctx.lineCap="butt";var a=e*this.mosaicFactor,f=function(){return{x:Math.random()*a,y:Math.random()*a}};n.setCanvasTransform();var c,u=jc(t);try{for(u.s();!(c=u.n()).done;){var l=c.value,s=this.color?this.color(l[this.colorCol],e,r):void 0;if(s&&"none"!==s){n.ctx.fillStyle=s;var h=this.offset(l,e,i),d=f(),y=f(),p=f(),b=f();n.ctx.beginPath(),n.ctx.moveTo(l.x+h.dx+d.x,l.y+h.dy+d.y),n.ctx.lineTo(l.x+h.dx+e-p.x,l.y+h.dy+p.y),n.ctx.lineTo(l.x+h.dx+e-b.x,l.y+h.dy+e-b.y),n.ctx.stroke(),n.ctx.beginPath(),n.ctx.moveTo(l.x+h.dx+d.x,l.y+h.dy+d.y),n.ctx.lineTo(l.x+h.dx+e-p.x,l.y+h.dy+p.y),n.ctx.lineTo(l.x+h.dx+e-b.x,l.y+h.dy+e-b.y),n.ctx.lineTo(l.x+h.dx+y.x,l.y+h.dy+e-y.y),n.ctx.fill()}}}catch(t){u.e(t)}finally{u.f()}this.updateLegends({style:this,r:e,zf:i,sColor:r})}},{key:"getColor",value:function(){return this.color}},{key:"setColor",value:function(t){return this.color=t,this}}])&&Ec(e.prototype,n),r&&Ec(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(yr);function Nc(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var Lc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bc(t){if(!(e=Lc.exec(t)))throw new Error("invalid format: "+t);var e;return new Dc({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Dc(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Bc.prototype=Dc.prototype,Dc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Gc,Zc,Wc,Uc=function(t,e){var n=Nc(t,e);if(!n)return t+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")},$c={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Uc(100*t,e),r:Uc,s:function(t,e){var n=Nc(t,e);if(!n)return t+"";var r=n[0],o=n[1],i=o-(Gc=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Nc(t,Math.max(0,e+i-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)},Yc=function(t){return t},Vc=Array.prototype.map,Hc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Xc(t){return(Xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qc(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Kc(t,e){return(Kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Jc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=tu(t);if(e){var o=tu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Qc(this,n)}}function Qc(t,e){if(e&&("object"===Xc(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function tu(t){return(tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Zc=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Yc:(e=Vc.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,f=e[0],c=0;o>0&&f>0&&(c+f+1>r&&(f=Math.max(1,r-c)),i.push(t.substring(o-=f,o+f)),!((c+=f+1)>r));)f=e[a=(a+1)%e.length];return i.reverse().join(n)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",f=void 0===t.numerals?Yc:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Vc.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function s(t){var e=(t=Bc(t)).fill,n=t.align,s=t.sign,h=t.symbol,d=t.zero,y=t.width,p=t.comma,b=t.precision,v=t.trim,g=t.type;"n"===g?(p=!0,g="g"):$c[g]||(void 0===b&&(b=12),v=!0,g="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var m="$"===h?o:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",w="$"===h?i:/[%p]/.test(g)?c:"",x=$c[g],S=/[defgprs%]/.test(g);function _(t){var o,i,c,h=m,_=w;if("c"===g)_=x(t)+_,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:x(Math.abs(t),b),v&&(t=function(t){t:for(var e,n=t.length,r=1,o=-1;r<n;++r)switch(t[r]){case".":o=e=r;break;case"0":0===o&&(o=r),e=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==s&&(k=!1),h=(k?"("===s?s:u:"-"===s||"("===s?"":s)+h,_=("s"===g?Hc[8+Gc/3]:"")+_+(k&&"("===s?")":""),S)for(o=-1,i=t.length;++o<i;)if(48>(c=t.charCodeAt(o))||c>57){_=(46===c?a+t.slice(o+1):t.slice(o))+_,t=t.slice(0,o);break}}p&&!d&&(t=r(t,1/0));var C=h.length+t.length+_.length,O=C<y?new Array(y-C+1).join(e):"";switch(p&&d&&(t=r(O+t,O.length?y-_.length:1/0),O=""),n){case"<":t=h+t+_+O;break;case"=":t=h+O+t+_;break;case"^":t=O.slice(0,C=O.length>>1)+h+t+_+O.slice(C);break;default:t=O+h+t+_}return f(t)}return b=void 0===b?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),_.toString=function(){return t+""},_}return{format:s,formatPrefix:function(t,e){var n,r=s(((t=Bc(t)).type="f",t)),o=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=Nc(Math.abs(n)))?n[1]:NaN)/3)))),i=Math.pow(10,-o),a=Hc[8+o/3];return function(t){return r(i*t)+a}}}}({thousands:",",grouping:[3],currency:["$",""]}),Wc=Zc.format,Zc.formatPrefix;var eu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kc(t,e)}(i,t);var e,n,r,o=Jc(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.colorRamp=t.colorRamp,e.fun=t.fun,e.title=t.title,e.tickSize=t.tickSize||6,e.width=t.width||300,e.height=t.height||15,e.margin=t.margin||5,e.ticks=t.ticks||Math.floor(e.width/50),e.tickFormat=t.tickFormat||".0f",e.tickUnit=t.tickUnit,e.fontSize=t.fontSize||"0.8em",e.invert=t.invert,e}return e=i,(n=[{key:"update",value:function(t){if(t.sColor){this.div.selectAll("*").remove();var e=this.width+2*this.margin,n=this.height+3*this.margin+12+this.tickSize+10,r=this.div.append("svg").attr("width",e).attr("height",n);r.append("text").attr("x",this.margin).attr("y",this.margin).style("font-size","0.8em").style("font-weight","bold").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none").text(this.title);for(var o=r.append("g").attr("transform","translate("+this.margin+" "+(2*this.margin+12)+")"),i=this.width,a=this.height,f=0;f<i;f+=5){var c=f/(i-1);this.invert&&(c=1-c),o.append("rect").attr("x",f).attr("y",0).attr("width",5).attr("height",a).style("fill",this.colorRamp(c))}for(var u=0;u<this.ticks;u++){var l=u/(this.ticks-1);o.append("line").attr("x1",i*l).attr("y1",0).attr("x2",i*l).attr("y2",a+this.tickSize).style("stroke","black"),o.append("text").attr("id","ticklabel_"+u).attr("x",i*l).attr("y",a+this.tickSize+2).style("font-size",this.fontSize).style("text-anchor",0==u?"start":u==this.ticks-1?"end":"middle").style("alignment-baseline","top").style("dominant-baseline","hanging").style("pointer-events","none")}for(var s=this.tickFormat&&"text"!=this.tickFormat?Wc(this.tickFormat):function(t){return t},h=0;h<this.ticks;h++){var d=h/(this.ticks-1),y=this.fun(d,t.r,t.sColor),p=(y?s(y):"0")+(this.tickUnit?this.tickUnit:"");this.div.select("#ticklabel_"+h).text(p)}}}}])&&qc(e.prototype,n),r&&qc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(lr);function nu(t){return(nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ru(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ou(t,e){return(ou=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function iu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fu(t);if(e){var o=fu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return au(this,n)}}function au(t,e){if(e&&("object"===nu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fu(t){return(fu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var cu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ou(t,e)}(i,t);var e,n,r,o=iu(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.colCat=t.colCat||[["gray","-"]],e.shape=t.shape||"circle",e.dimension=t.dimension||{r:8},e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.title=t.title,e.titleFontSize=t.titleFontSize||"0.8em",e.titleFontWeight=t.titleFontWeight||"bold",e.labelFontSize=t.labelFontSize||"0.8em",e}return e=i,(n=[{key:"update",value:function(t){this.div.selectAll("*").remove(),this.title&&this.div.append("div").style("font-size",this.titleFontSize).style("font-weight",this.titleFontWeight).style("margin-bottom","7px").text(this.title);var e=this.colCat.length;if(0!=e)for(var n=0;n<e;n++){var r=this.colCat[n],o=this.div.append("div"),i=this.strokeWidth;if("square"===this.shape)o.append("svg").attr("width",(this.dimension.w||20)+2*i).attr("height",(this.dimension.h||15)+2*i).append("rect").attr("x",i).attr("y",i).attr("width",(this.dimension.w||20)+2*i).attr("height",(this.dimension.h||15)+2*i).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else{if("circle"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var a=this.dimension.r||8;o.append("svg").attr("width",2*a+2*i).attr("height",2*a+2*i).append("circle").attr("cx",a+i).attr("cy",a+i).attr("r",a).style("fill",r[0]).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}o.append("div").style("float","right").style("padding-left","5px").style("font-size",this.labelFontSize).text(r[1])}}}])&&ru(e.prototype,n),r&&ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(lr);function uu(t){return(uu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function su(t,e){return(su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function hu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=yu(t);if(e){var o=yu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return du(this,n)}}function du(t,e){if(e&&("object"===uu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function yu(t){return(yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&su(t,e)}(i,t);var e,n,r,o=hu(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.8,e.shape=t.shape||"circle",e.fillColor=t.fillColor||"none",e.strokeColor=t.strokeColor||"gray",e.strokeWidth=t.strokeWidth||1,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.labelFormat=t.labelFormat||",.2r",e}return e=i,(n=[{key:"update",value:function(t){if(t.sSize){this.div.selectAll("*").remove();var e=t.sSize.max*this.exaggerationFactor,n=Math.log10(e);n=Math.floor(n);var r=Math.pow(10,n);8*r<=e?r*=8:6*r<=e?r*=6:5*r<=e?r*=5:4*r<=e?r*=4:2.5*r<=e?r*=2.5:2*r<=e&&(r*=2);var o=t.style.getSize()(r,t.r,t.sSize,t.zf)/t.zf,i=this.div.append("svg").attr("width",o+this.strokeWidth+2).attr("height",o+this.strokeWidth+2).style("","inline-block");if("square"===this.shape)i.append("rect").attr("x",0).attr("y",0).attr("width",o).attr("height",o).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth);else if("circle"===this.shape){var a=.5*(o+this.strokeWidth);i.append("circle").attr("cx",a+1).attr("cy",a+1).attr("r",a).style("fill",this.fillColor).style("stroke",this.strokeColor).style("stroke-width",this.strokeWidth)}else if("donut"!==this.shape)throw new Error("Unexpected shape:"+this.shape);var f=Wc(this.labelFormat)(r);this.div.append("div").style("display","inline-block").style("left","4px").style("font-size",this.labelFontSize).text(f+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&lu(e.prototype,n),r&&lu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(lr);function bu(t){return(bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function gu(t,e){return(gu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function mu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=xu(t);if(e){var o=xu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return wu(this,n)}}function wu(t,e){if(e&&("object"===bu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function xu(t){return(xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Su=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gu(t,e)}(i,t);var e,n,r,o=mu(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),t=t||{},e.exaggerationFactor=t.exaggerationFactor||.5,e.color=t.color||"gray",e.orientation=t.orientation||0,e.labelFontSize=t.labelFontSize||"0.8em",e.labelUnitText=t.labelUnitText||"",e.div.style("text-align","center"),e}return e=i,(n=[{key:"update",value:function(t){if(t.sWidth){this.div.selectAll("*").remove();var e=t.sWidth.max*this.exaggerationFactor,n=Math.log10(e);n=Math.floor(n);var r=Math.pow(10,n);8*r<=e?r*=8:6*r<=e?r*=6:5*r<=e?r*=5:4*r<=e?r*=4:2.5*r<=e?r*=2.5:2*r<=e&&(r*=2);var o=t.style.getWidth()(r,t.r,t.sWidth,t.zf)/t.zf,i=1*t.r/t.zf;this.div.append("svg").attr("width",i).attr("height",o).style("","inline-block").append("line").attr("x1",0).attr("y1",o/2).attr("x2",i).attr("y2",o/2).style("stroke",this.color).style("stroke-width",o);var a=Wc(",.2r")(r);this.div.append("div").style("font-size",this.labelFontSize).style("","inline-block").text(a+(this.labelUnitText?" ":"")+this.labelUnitText)}}}])&&vu(e.prototype,n),r&&vu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),i}(lr);function _u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.01,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;(n=n||1.01)<1&&console.error("Unexpected value for factor: "+n+". Set to default value 1.01");var a=t.getZoomFactor();if(e!=a){e<a&&(n=1/n);var f=a,c=setInterval((function(){f=t.getZoomFactor()*n,e>a&&f>e&&(f=e),e<a&&f<e&&(f=e),t.setZoomFactor(f),t.cg.redraw(),f==e&&(clearInterval(c),o&&setTimeout((function(){o()}),i))}),r);return c}}function ku(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:NaN,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:NaN,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6?arguments[6]:void 0,f=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,c=t.getZoomFactor(),u=t.getGeoCenter();e=isNaN(e)?u.x:e,n=isNaN(n)?u.y:n,r=isNaN(r)?c:r;var l=e-u.x,s=n-u.y,h=Math.hypot(l,s),d=o*c*l/h,y=o*c*s/h,p=r/c,b=h/(o*c),v=h>0?Math.pow(p,1/b):Math.pow(p,.1),g=setInterval((function(){if(h>0){var o=t.getGeoCenter(),i=o.x+d,c=o.y+y;i<e&&e<o.x&&(i=e),o.x<e&&e<i&&(i=e),c<n&&n<o.y&&(c=n),o.y<n&&n<c&&(c=n),t.setGeoCenter({x:i,y:c}),i==e&&c==n&&(h=0)}if(1!=p){var u=t.getZoomFactor(),l=v*u;l<r&&r<u&&(l=r),u<r&&r<l&&(l=r),t.setZoomFactor(l),l==r&&(p=1)}t.cg.redraw(),0==h&&1==p&&(console.log("OK !"),clearInterval(g),a&&setTimeout((function(){a()}),f))}),i);return g}var Cu=1e-6,Ou=Math.PI,Pu=Ou/2,Mu=Ou/4,ju=2*Ou,Au=180/Ou,Eu=Ou/180,Tu=Math.abs,Ru=Math.atan,zu=Math.atan2,Fu=Math.cos,Iu=(Math.ceil,Math.exp,Math.floor,Math.hypot,Math.log,Math.pow,Math.sin),Nu=Math.sign||function(t){return t>0?1:t<0?-1:0},Lu=Math.sqrt;Math.tan;function Bu(t){return t>1?Pu:t<-1?-Pu:Math.asin(t)}function Du(){}var Gu=function(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Du,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},Zu=function(t,e){return Tu(t[0]-e[0])<Cu&&Tu(t[1]-e[1])<Cu};function Wu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}var Uu=function(t,e,n,r,o){var i,a,f=[],c=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(Zu(r,a)){if(!r[2]&&!a[2]){for(o.lineStart(),i=0;i<e;++i)o.point((r=t[i])[0],r[1]);return void o.lineEnd()}a[0]+=2*Cu}f.push(n=new Wu(r,t,null,!0)),c.push(n.o=new Wu(r,null,n,!1)),f.push(n=new Wu(a,t,null,!1)),c.push(n.o=new Wu(a,null,n,!0))}})),f.length){for(c.sort(e),$u(f),$u(c),i=0,a=c.length;i<a;++i)c[i].e=n=!n;for(var u,l,s=f[0];;){for(var h=s,d=!0;h.v;)if((h=h.n)===s)return;u=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(i=0,a=u.length;i<a;++i)o.point((l=u[i])[0],l[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(d)for(u=h.p.z,i=u.length-1;i>=0;--i)o.point((l=u[i])[0],l[1]);else r(h.x,h.p.x,-1,o);h=h.p}u=(h=h.o).z,d=!d}while(!h.v);o.lineEnd()}}};function $u(t){if(e=t.length){for(var e,n,r=0,o=t[0];++r<e;)o.n=n=t[r],n.p=o,o=n;o.n=n=t[0],n.p=o}}class Yu{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const o=e[r],i=t+o,a=Math.abs(t)<Math.abs(o)?t-(i-o):o-(i-t);a&&(e[n++]=a),t=i}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,o=this._n,i=0;if(o>0){for(i=t[--o];o>0&&(e=i,n=t[--o],i=e+n,r=n-(i-e),!r););o>0&&(r<0&&t[o-1]<0||r>0&&t[o-1]>0)&&(n=2*r,e=i+n,n==e-i&&(i=e))}return i}}function Vu(t){return[zu(t[1],t[0]),Bu(t[2])]}function Hu(t){var e=t[0],n=t[1],r=Fu(n);return[r*Fu(e),r*Iu(e),Iu(n)]}function Xu(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function qu(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Ku(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Ju(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Qu(t){var e=Lu(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function tl(t){return Tu(t[0])<=Ou?t[0]:Nu(t[0])*((Tu(t[0])+Ou)%ju-Ou)}function el(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}var nl=function(t,e,n,r){return function(o){var i,a,f,c=e(o),u=Gu(),l=e(u),s=!1,h={point:d,lineStart:p,lineEnd:b,polygonStart:function(){h.point=v,h.lineStart=g,h.lineEnd=m,a=[],i=[]},polygonEnd:function(){h.point=d,h.lineStart=p,h.lineEnd=b,a=el(a);var t=function(t,e){var n=tl(e),r=e[1],o=Iu(r),i=[Iu(n),-Fu(n),0],a=0,f=0,c=new Yu;1===o?r=Pu+Cu:-1===o&&(r=-Pu-Cu);for(var u=0,l=t.length;u<l;++u)if(h=(s=t[u]).length)for(var s,h,d=s[h-1],y=tl(d),p=d[1]/2+Mu,b=Iu(p),v=Fu(p),g=0;g<h;++g,y=w,b=S,v=_,d=m){var m=s[g],w=tl(m),x=m[1]/2+Mu,S=Iu(x),_=Fu(x),k=w-y,C=k>=0?1:-1,O=C*k,P=O>Ou,M=b*S;if(c.add(zu(M*C*Iu(O),v*_+M*Fu(O))),a+=P?k+C*ju:k,P^y>=n^w>=n){var j=qu(Hu(d),Hu(m));Qu(j);var A=qu(i,j);Qu(A);var E=(P^k>=0?-1:1)*Bu(A[2]);(r>E||r===E&&(j[0]||j[1]))&&(f+=P^k>=0?1:-1)}}return(a<-Cu||a<Cu&&c<-1e-12)^1&f}(i,r);a.length?(s||(o.polygonStart(),s=!0),Uu(a,ol,t,n,o)):t&&(s||(o.polygonStart(),s=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),s&&(o.polygonEnd(),s=!1),a=i=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(e,n){t(e,n)&&o.point(e,n)}function y(t,e){c.point(t,e)}function p(){h.point=y,c.lineStart()}function b(){h.point=d,c.lineEnd()}function v(t,e){f.push([t,e]),l.point(t,e)}function g(){l.lineStart(),f=[]}function m(){v(f[0][0],f[0][1]),l.lineEnd();var t,e,n,r,c=l.clean(),h=u.result(),d=h.length;if(f.pop(),i.push(f),f=null,d)if(1&c){if((e=(n=h[0]).length-1)>0){for(s||(o.polygonStart(),s=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else d>1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(rl))}return h}};function rl(t){return t.length>1}function ol(t,e){return((t=t.x)[0]<0?t[1]-Pu-Cu:Pu-t[1])-((e=e.x)[0]<0?e[1]-Pu-Cu:Pu-e[1])}var il=nl((function(){return!0}),(function(t){var e,n=NaN,r=NaN,o=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(i,a){var f=i>0?Ou:-Ou,c=Tu(i-n);Tu(c-Ou)<Cu?(t.point(n,r=(r+a)/2>0?Pu:-Pu),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(f,r),t.point(i,r),e=0):o!==f&&c>=Ou&&(Tu(n-o)<Cu&&(n-=o*Cu),Tu(i-f)<Cu&&(i-=f*Cu),r=function(t,e,n,r){var o,i,a=Iu(t-n);return Tu(a)>Cu?Ru((Iu(e)*(i=Fu(r))*Iu(n)-Iu(r)*(o=Fu(e))*Iu(t))/(o*i*a)):(e+r)/2}(n,r,i,a),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(f,r),e=0),t.point(n=i,r=a),o=f},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var o;if(null==t)o=n*Pu,r.point(-Ou,o),r.point(0,o),r.point(Ou,o),r.point(Ou,0),r.point(Ou,-o),r.point(0,-o),r.point(-Ou,-o),r.point(-Ou,0),r.point(-Ou,o);else if(Tu(t[0]-e[0])>Cu){var i=t[0]<e[0]?Ou:-Ou;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}),[-Ou,-Pu]);var al=function(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n};function fl(t,e){return[Tu(t)>Ou?t+Math.round(-t/ju)*ju:t,e]}function cl(t,e,n){return(t%=ju)?e||n?al(ll(t),sl(e,n)):ll(t):e||n?sl(e,n):fl}function ul(t){return function(e,n){return[(e+=t)>Ou?e-ju:e<-Ou?e+ju:e,n]}}function ll(t){var e=ul(t);return e.invert=ul(-t),e}function sl(t,e){var n=Fu(t),r=Iu(t),o=Fu(e),i=Iu(e);function a(t,e){var a=Fu(e),f=Fu(t)*a,c=Iu(t)*a,u=Iu(e),l=u*n+f*r;return[zu(c*o-l*i,f*n-u*r),Bu(l*o+c*i)]}return a.invert=function(t,e){var a=Fu(e),f=Fu(t)*a,c=Iu(t)*a,u=Iu(e),l=u*o-c*i;return[zu(c*o+u*i,f*n+l*r),Bu(l*n-f*r)]},a}fl.invert=fl;function hl(t,e,n,r,o,i){if(n){var a=Fu(e),f=Iu(e),c=r*n;null==o?(o=e+r*ju,i=e-c/2):(o=dl(a,o),i=dl(a,i),(r>0?o<i:o>i)&&(o+=r*ju));for(var u,l=o;r>0?l>i:l<i;l-=c)u=Vu([a,-f*Fu(l),-f*Iu(l)]),t.point(u[0],u[1])}}function dl(t,e){(e=Hu(e))[0]-=t,Qu(e);var n,r=(n=-e[1])>1?0:n<-1?Ou:Math.acos(n);return((-e[2]<0?-r:r)+ju-Cu)%ju}var yl=function(t){var e=Fu(t),n=6*Eu,r=e>0,o=Tu(e)>Cu;function i(t,n){return Fu(t)*Fu(n)>e}function a(t,n,r){var o=[1,0,0],i=qu(Hu(t),Hu(n)),a=Xu(i,i),f=i[0],c=a-f*f;if(!c)return!r&&t;var u=e*a/c,l=-e*f/c,s=qu(o,i),h=Ju(o,u);Ku(h,Ju(i,l));var d=s,y=Xu(h,d),p=Xu(d,d),b=y*y-p*(Xu(h,h)-1);if(!(b<0)){var v=Lu(b),g=Ju(d,(-y-v)/p);if(Ku(g,h),g=Vu(g),!r)return g;var m,w=t[0],x=n[0],S=t[1],_=n[1];x<w&&(m=w,w=x,x=m);var k=x-w,C=Tu(k-Ou)<Cu;if(!C&&_<S&&(m=S,S=_,_=m),C||k<Cu?C?S+_>0^g[1]<(Tu(g[0]-w)<Cu?S:_):S<=g[1]&&g[1]<=_:k>Ou^(w<=g[0]&&g[0]<=x)){var O=Ju(d,(-y+v)/p);return Ku(O,h),[g,Vu(O)]}}}function f(e,n){var o=r?t:Ou-t,i=0;return e<-o?i|=1:e>o&&(i|=2),n<-o?i|=4:n>o&&(i|=8),i}return nl(i,(function(t){var e,n,c,u,l;return{lineStart:function(){u=c=!1,l=1},point:function(s,h){var d,y=[s,h],p=i(s,h),b=r?p?0:f(s,h):p?f(s+(s<0?Ou:-Ou),h):0;if(!e&&(u=c=p)&&t.lineStart(),p!==c&&(!(d=a(e,y))||Zu(e,d)||Zu(y,d))&&(y[2]=1),p!==c)l=0,p?(t.lineStart(),d=a(y,e),t.point(d[0],d[1])):(d=a(e,y),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(o&&e&&r^p){var v;b&n||!(v=a(y,e,!0))||(l=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!p||e&&Zu(e,y)||t.point(y[0],y[1]),e=y,c=p,n=b},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return l|(u&&c)<<1}}}),(function(e,r,o,i){hl(i,t,n,o,e,r)}),r?[0,-t]:[-Ou,t-Ou])};function pl(t,e,n,r){function o(o,i){return t<=o&&o<=n&&e<=i&&i<=r}function i(o,i,f,u){var l=0,s=0;if(null==o||(l=a(o,f))!==(s=a(i,f))||c(o,i)<0^f>0)do{u.point(0===l||3===l?t:n,l>1?r:e)}while((l=(l+f+4)%4)!==s);else u.point(i[0],i[1])}function a(r,o){return Tu(r[0]-t)<Cu?o>0?0:3:Tu(r[0]-n)<Cu?o>0?2:1:Tu(r[1]-e)<Cu?o>0?1:0:o>0?3:2}function f(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,u,l,s,h,d,y,p,b,v,g,m=a,w=Gu(),x={point:S,lineStart:function(){x.point=_,u&&u.push(l=[]);v=!0,b=!1,y=p=NaN},lineEnd:function(){c&&(_(s,h),d&&b&&w.rejoin(),c.push(w.result()));x.point=S,b&&m.lineEnd()},polygonStart:function(){m=w,c=[],u=[],g=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,o=u.length;n<o;++n)for(var i,a,f=u[n],c=1,l=f.length,s=f[0],h=s[0],d=s[1];c<l;++c)i=h,a=d,s=f[c],h=s[0],d=s[1],a<=r?d>r&&(h-i)*(r-a)>(d-a)*(t-i)&&++e:d<=r&&(h-i)*(r-a)<(d-a)*(t-i)&&--e;return e}(),n=g&&e,o=(c=el(c)).length;(n||o)&&(a.polygonStart(),n&&(a.lineStart(),i(null,null,1,a),a.lineEnd()),o&&Uu(c,f,e,i,a),a.polygonEnd());m=a,c=u=l=null}};function S(t,e){o(t,e)&&m.point(t,e)}function _(i,a){var f=o(i,a);if(u&&l.push([i,a]),v)s=i,h=a,d=f,v=!1,f&&(m.lineStart(),m.point(i,a));else if(f&&b)m.point(i,a);else{var c=[y=Math.max(-1e9,Math.min(1e9,y)),p=Math.max(-1e9,Math.min(1e9,p))],w=[i=Math.max(-1e9,Math.min(1e9,i)),a=Math.max(-1e9,Math.min(1e9,a))];!function(t,e,n,r,o,i){var a,f=t[0],c=t[1],u=0,l=1,s=e[0]-f,h=e[1]-c;if(a=n-f,s||!(a>0)){if(a/=s,s<0){if(a<u)return;a<l&&(l=a)}else if(s>0){if(a>l)return;a>u&&(u=a)}if(a=o-f,s||!(a<0)){if(a/=s,s<0){if(a>l)return;a>u&&(u=a)}else if(s>0){if(a<u)return;a<l&&(l=a)}if(a=r-c,h||!(a>0)){if(a/=h,h<0){if(a<u)return;a<l&&(l=a)}else if(h>0){if(a>l)return;a>u&&(u=a)}if(a=i-c,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>u&&(u=a)}else if(h>0){if(a<u)return;a<l&&(l=a)}return u>0&&(t[0]=f+u*s,t[1]=c+u*h),l<1&&(e[0]=f+l*s,e[1]=c+l*h),!0}}}}}(c,w,t,e,n,r)?f&&(m.lineStart(),m.point(i,a),g=!1):(b||(m.lineStart(),m.point(c[0],c[1])),m.point(w[0],w[1]),f||m.lineEnd(),g=!1)}y=i,p=a,b=f}return x}}var bl=t=>t;function vl(t){return function(e){var n=new gl;for(var r in t)n[r]=t[r];return n.stream=e,n}}function gl(){}function ml(t,e){t&&xl.hasOwnProperty(t.type)&&xl[t.type](t,e)}gl.prototype={constructor:gl,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var wl={Feature:function(t,e){ml(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)ml(n[r].geometry,e)}},xl={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Sl(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)Sl(n[r],e,0)},Polygon:function(t,e){_l(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)_l(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)ml(n[r],e)}};function Sl(t,e,n){var r,o=-1,i=t.length-n;for(e.lineStart();++o<i;)r=t[o],e.point(r[0],r[1],r[2]);e.lineEnd()}function _l(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Sl(t[n],e,1);e.polygonEnd()}var kl=1/0,Cl=kl,Ol=-kl,Pl=Ol;var Ml={point:function(t,e){t<kl&&(kl=t);t>Ol&&(Ol=t);e<Cl&&(Cl=e);e>Pl&&(Pl=e)},lineStart:Du,lineEnd:Du,polygonStart:Du,polygonEnd:Du,result:function(){var t=[[kl,Cl],[Ol,Pl]];return Ol=Pl=-(Cl=kl=1/0),t}};function jl(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),function(t,e){t&&wl.hasOwnProperty(t.type)?wl[t.type](t,e):ml(t,e)}(n,t.stream(Ml)),e(Ml.result()),null!=r&&t.clipExtent(r),t}function Al(t,e,n){return jl(t,(function(n){var r=e[1][0]-e[0][0],o=e[1][1]-e[0][1],i=Math.min(r/(n[1][0]-n[0][0]),o/(n[1][1]-n[0][1])),a=+e[0][0]+(r-i*(n[1][0]+n[0][0]))/2,f=+e[0][1]+(o-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,f])}),n)}var El=Fu(30*Eu),Tl=function(t,e){return+e?function(t,e){function n(r,o,i,a,f,c,u,l,s,h,d,y,p,b){var v=u-r,g=l-o,m=v*v+g*g;if(m>4*e&&p--){var w=a+h,x=f+d,S=c+y,_=Lu(w*w+x*x+S*S),k=Bu(S/=_),C=Tu(Tu(S)-1)<Cu||Tu(i-s)<Cu?(i+s)/2:zu(x,w),O=t(C,k),P=O[0],M=O[1],j=P-r,A=M-o,E=g*j-v*A;(E*E/m>e||Tu((v*j+g*A)/m-.5)>.3||a*h+f*d+c*y<El)&&(n(r,o,i,a,f,c,P,M,C,w/=_,x/=_,S,p,b),b.point(P,M),n(P,M,C,w,x,S,u,l,s,h,d,y,p,b))}}return function(e){var r,o,i,a,f,c,u,l,s,h,d,y,p={point:b,lineStart:v,lineEnd:m,polygonStart:function(){e.polygonStart(),p.lineStart=w},polygonEnd:function(){e.polygonEnd(),p.lineStart=v}};function b(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){l=NaN,p.point=g,e.lineStart()}function g(r,o){var i=Hu([r,o]),a=t(r,o);n(l,s,u,h,d,y,l=a[0],s=a[1],u=r,h=i[0],d=i[1],y=i[2],16,e),e.point(l,s)}function m(){p.point=b,e.lineEnd()}function w(){v(),p.point=x,p.lineEnd=S}function x(t,e){g(r=t,e),o=l,i=s,a=h,f=d,c=y,p.point=g}function S(){n(l,s,u,h,d,y,o,i,r,a,f,c,16,e),p.lineEnd=m,m()}return p}}(t,e):function(t){return vl({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)};var Rl=vl({point:function(t,e){this.stream.point(t*Eu,e*Eu)}});function zl(t,e,n,r,o,i){if(!i)return function(t,e,n,r,o){function i(i,a){return[e+t*(i*=r),n-t*(a*=o)]}return i.invert=function(i,a){return[(i-e)/t*r,(n-a)/t*o]},i}(t,e,n,r,o);var a=Fu(i),f=Iu(i),c=a*t,u=f*t,l=a/t,s=f/t,h=(f*n-a*e)/t,d=(f*e+a*n)/t;function y(t,i){return[c*(t*=r)-u*(i*=o)+e,n-u*t-c*i]}return y.invert=function(t,e){return[r*(l*t-s*e+h),o*(d-s*t-l*e)]},y}function Fl(t){return function(t){var e,n,r,o,i,a,f,c,u,l,s=150,h=480,d=250,y=0,p=0,b=0,v=0,g=0,m=0,w=1,x=1,S=null,_=il,k=null,C=bl,O=.5;function P(t){return c(t[0]*Eu,t[1]*Eu)}function M(t){return(t=c.invert(t[0],t[1]))&&[t[0]*Au,t[1]*Au]}function j(){var t=zl(s,0,0,w,x,m).apply(null,e(y,p)),r=zl(s,h-t[0],d-t[1],w,x,m);return n=cl(b,v,g),f=al(e,r),c=al(n,f),a=Tl(f,O),A()}function A(){return u=l=null,P}return P.stream=function(t){return u&&l===t?u:u=Rl(function(t){return vl({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(_(a(C(l=t)))))},P.preclip=function(t){return arguments.length?(_=t,S=void 0,A()):_},P.postclip=function(t){return arguments.length?(C=t,k=r=o=i=null,A()):C},P.clipAngle=function(t){return arguments.length?(_=+t?yl(S=t*Eu):(S=null,il),A()):S*Au},P.clipExtent=function(t){return arguments.length?(C=null==t?(k=r=o=i=null,bl):pl(k=+t[0][0],r=+t[0][1],o=+t[1][0],i=+t[1][1]),A()):null==k?null:[[k,r],[o,i]]},P.scale=function(t){return arguments.length?(s=+t,j()):s},P.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],j()):[h,d]},P.center=function(t){return arguments.length?(y=t[0]%360*Eu,p=t[1]%360*Eu,j()):[y*Au,p*Au]},P.rotate=function(t){return arguments.length?(b=t[0]%360*Eu,v=t[1]%360*Eu,g=t.length>2?t[2]%360*Eu:0,j()):[b*Au,v*Au,g*Au]},P.angle=function(t){return arguments.length?(m=t%360*Eu,j()):m*Au},P.reflectX=function(t){return arguments.length?(w=t?-1:1,j()):w<0},P.reflectY=function(t){return arguments.length?(x=t?-1:1,j()):x<0},P.precision=function(t){return arguments.length?(a=Tl(f,O=t*t),A()):Lu(O)},P.fitExtent=function(t,e){return Al(P,t,e)},P.fitSize=function(t,e){return function(t,e,n){return Al(t,[[0,0],e],n)}(P,t,e)},P.fitWidth=function(t,e){return function(t,e,n){return jl(t,(function(n){var r=+e,o=r/(n[1][0]-n[0][0]),i=(r-o*(n[1][0]+n[0][0]))/2,a=-o*n[0][1];t.scale(150*o).translate([i,a])}),n)}(P,t,e)},P.fitHeight=function(t,e){return function(t,e,n){return jl(t,(function(n){var r=+e,o=r/(n[1][1]-n[0][1]),i=-o*n[0][0],a=(r-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([i,a])}),n)}(P,t,e)},function(){return e=t.apply(this,arguments),P.invert=e.invert&&M,j()}}((function(){return t}))()}var Il,Nl,Ll=(Il=function(t){return Lu(2/(1+t))},function(t,e){var n=Fu(t),r=Fu(e),o=Il(n*r);return o===1/0?[2,0]:[o*r*Iu(t),o*Iu(e)]});Ll.invert=(Nl=function(t){return 2*Bu(t/2)},function(t,e){var n=Lu(t*t+e*e),r=Nl(n),o=Iu(r),i=Fu(r);return[zu(t*o,n*i),Bu(n&&e*o/n)]});var Bl=function(){return Fl(Ll).scale(124.75).clipAngle(179.999)},Dl=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n?1==n?.5*(Math.pow(t,e)+1-Math.pow(1-t,1/e)):1-Math.pow(1-t,1/e):Math.pow(t,e)},Gl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"EUR",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2?arguments[2]:void 0,r=(n=n||{}).ex||1.2;return n.style=n.style||function(t,e){if(!(t.rs<r*e))return t.r1<r*e?"1em Arial":"1.5em Arial"},n.proj=n.proj||Bl().rotate([-10,-52]).reflectX(!1).reflectY(!0).scale(6378137).translate([4321e3,321e4]),n.preprocess=function(t){var e=n.proj([t.lon,t.lat]);t.x=e[0],t.y=e[1],delete t.lon,delete t.lat},n.url="https://raw.githubusercontent.com/eurostat/euronym/main/pub/v1/"+e+"/"+t+".csv",new ho(n)},Zl=function(t){var e=(t=t||{}).nutsYear||"2021",n=t.crs||"3035",r=t.scale||"03M",o=t.nutsLevel||"3",i="#888";return t.color=t.color||function(t,e){var n=t.properties;return"T"===n.co||e<400?i:e<1e3?n.lvl>=3?"":i:e<2e3?n.lvl>=2?"":i:n.lvl>=1?"":i},t.width=t.width||function(t,e){var n=t.properties;return"T"===n.co?.5:e<400?3==n.lvl||2==n.lvl||1==n.lvl?2.2:4:e<1e3?2==n.lvl||1==n.lvl?1.8:2.5:e<2e3?1==n.lvl?1.8:2.5:1.2},t.lineDash=t.lineDash||function(t,e){var n=t.properties;return"T"===n.co?[]:e<400?3==n.lvl?[2*e,2*e]:2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<1e3?2==n.lvl||1==n.lvl?[5*e,2*e]:[10*e,3*e]:e<2e3&&1==n.lvl?[5*e,2*e]:[10*e,3*e]},new vo("https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2/"+e+"/"+n+"/"+r+"/nutsbn_"+o+".json",t)}},9:function(t,e,n){t.exports=n(10)}})}));
|